fengmap.map.min.js
1.4 MB
/**Released Version v3.1.5,BUILD 69,Time 1706862834352. Fengmap Javascript SDK , see: https://www.fengmap.com for details**/
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.fengmap=n():t.fengmap=n()}(this,function(){return function(e){var i={};function r(t){var n;return(i[t]||(n=i[t]={i:t,l:!1,exports:{}},e[t].call(n.exports,n,n.exports,r),n.l=!0,n)).exports}return r.m=e,r.c=i,r.d=function(t,n,e){r.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:e})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"u",{value:!0})},r.t=function(n,t){if(1&t&&(n=r(n)),8&t)return n;if(4&t&&"object"==typeof n&&n&&n.u)return n;var e=Object.create(null);if(r.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:n}),2&t&&"string"!=typeof n)for(var i in n)r.d(e,i,function(t){return n[t]}.bind(null,i));return e},r.n=function(t){var n=t&&t.u?function(){return t.default}:function(){return t};return r.d(n,"a",n),n},r.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},r.p="",r(r.s=48)}([function(t,n,e){"use strict";e.d(n,"a",function(){return i});var n=e(1),i={document:"undefined"!=typeof document?document:{},window:"undefined"!=typeof window?window:{},environment:n.a.BROWSER,XMLHttpRequest:"undefined"!=typeof XMLHttpRequest?XMLHttpRequest:{}}},function(t,n,e){"use strict";var i={BROWSER:0,WX:1};Object.freeze(i),n.a=i},function(t,n,e){"use strict";var i,r,o=t.exports=e(4),s=e(19),a=(o.codegen=e(45),o.fetch=e(46),o.path=e(47),o.fs=o.inquire("fs"),o.toArray=function(t){if(t){for(var n=Object.keys(t),e=new Array(n.length),i=0;i<n.length;)e[i]=t[n[i++]];return e}return[]},o.toObject=function(t){for(var n={},e=0;e<t.length;){var i=t[e++],r=t[e++];void 0!==r&&(n[i]=r)}return n},/\\/g),u=/"/g,c=(o.isReserved=function(t){return/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(t)},o.safeProp=function(t){return!/^[$\w_]+$/.test(t)||o.isReserved(t)?'["'+t.replace(a,"\\\\").replace(u,'\\"')+'"]':"."+t},o.ucFirst=function(t){return t.charAt(0).toUpperCase()+t.substring(1)},/_([a-z])/g),h=(o.camelCase=function(t){return t.substring(0,1)+t.substring(1).replace(c,function(t,n){return n.toUpperCase()})},o.compareFieldsById=function(t,n){return t.id-n.id},o.decorateType=function(t,n){return t.$type?(n&&t.$type.name!==n&&(o.decorateRoot.remove(t.$type),t.$type.name=n,o.decorateRoot.add(t.$type)),t.$type):(n=new(i=i||e(21))(n||t.name),o.decorateRoot.add(n),n.ctor=t,Object.defineProperty(t,"$type",{value:n,enumerable:!1}),Object.defineProperty(t.prototype,"$type",{value:n,enumerable:!1}),n)},0);o.decorateEnum=function(t){var n;return t.$type||(n=new(r=r||e(5))("Enum"+h++,t),o.decorateRoot.add(n),Object.defineProperty(t,"$type",{value:n,enumerable:!1}),n)},o.setProperty=function(t,n,e){if("object"!=typeof t)throw TypeError("dst must be an object");if(n)return function t(n,e,i){var r=e.shift();return"__proto__"!==r&&"prototype"!==r&&(0<e.length?n[r]=t(n[r]||{},e,i):((e=n[r])&&(i=[].concat(e).concat(i)),n[r]=i)),n}(t,n=n.split("."),e);throw TypeError("path must be specified")},Object.defineProperty(o,"decorateRoot",{get:function(){return s.decorated||(s.decorated=new(e(29)))}})},function(t,n,e){"use strict";!function(s){var a=e(1),u=e(0);function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function c(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=r(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=r(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==r(t)?t:String(t)}(i.key),i)}}var h=null,t=function(){function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function")}var n,e,i,r;function o(){return r.apply(this,arguments)}return n=t,e=null,i=[{key:"global",value:(r=function(){if("undefined"!=typeof self&&null!==self&&0!==Object.keys(self).length)return self;if("undefined"!=typeof window&&null!==window&&0!==Object.keys(window).length)return window;if(null!=s&&0!==Object.keys(s).length)return s;var t;if("undefined"!=typeof my)return h||(t=my.getAppIdSync(),h={location:{host:t.appId+".hybrid.alipay-eco.com"}}),h;if(u.a.environment==a.a.WX)return{};throw new Error("unable to locate global object")},o.toString=function(){return r.toString()},o)}],e&&c(n.prototype,e),i&&c(n,i),Object.defineProperty(n,"prototype",{writable:!1}),t}();n.a=t}.call(this,e(15))},function(t,e,o){"use strict";!function(t){var i=e;function r(t,n,e){for(var i=Object.keys(n),r=0;r<i.length;++r)void 0!==t[i[r]]&&e||(t[i[r]]=n[i[r]]);return t}function n(t){function e(t,n){if(!(this instanceof e))return new e(t,n);Object.defineProperty(this,"message",{get:function(){return t}}),Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),n&&r(this,n)}return(e.prototype=Object.create(Error.prototype)).constructor=e,Object.defineProperty(e.prototype,"name",{get:function(){return t}}),e.prototype.toString=function(){return this.name+": "+this.message},e}i.asPromise=o(16),i.base64=o(36),i.EventEmitter=o(37),i.float=o(38),i.inquire=o(17),i.utf8=o(39),i.pool=o(40),i.LongBits=o(41),i.isNode=Boolean(void 0!==t&&t&&t.process&&t.process.versions&&t.process.versions.node),i.global=i.isNode&&t||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||this,i.emptyArray=Object.freeze?Object.freeze([]):[],i.emptyObject=Object.freeze?Object.freeze({}):{},i.isInteger=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t},i.isString=function(t){return"string"==typeof t||t instanceof String},i.isObject=function(t){return t&&"object"==typeof t},i.isset=i.isSet=function(t,n){var e=t[n];return!(null==e||!t.hasOwnProperty(n))&&("object"!=typeof e||0<(Array.isArray(e)?e:Object.keys(e)).length)},i.Buffer=function(){try{var t=i.inquire("buffer").Buffer;return t.prototype.utf8Write?t:null}catch(t){return null}}(),i._=null,i.S=null,i.newBuffer=function(t){return"number"==typeof t?i.Buffer?i.S(t):new i.Array(t):i.Buffer?i._(t):"undefined"==typeof Uint8Array?t:new Uint8Array(t)},i.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,i.Long=i.global.dcodeIO&&i.global.dcodeIO.Long||i.global.Long||i.inquire("long"),i.key2Re=/^true|false|0|1$/,i.key32Re=/^-?(?:0|[1-9][0-9]*)$/,i.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,i.longToHash=function(t){return t?i.LongBits.from(t).toHash():i.LongBits.zeroHash},i.longFromHash=function(t,n){t=i.LongBits.fromHash(t);return i.Long?i.Long.fromBits(t.lo,t.hi,n):t.toNumber(Boolean(n))},i.merge=r,i.lcFirst=function(t){return t.charAt(0).toLowerCase()+t.substring(1)},i.newError=n,i.ProtocolError=n("ProtocolError"),i.oneOfGetter=function(t){for(var e={},n=0;n<t.length;++n)e[t[n]]=1;return function(){for(var t=Object.keys(this),n=t.length-1;-1<n;--n)if(1===e[t[n]]&&void 0!==this[t[n]]&&null!==this[t[n]])return t[n]}},i.oneOfSetter=function(e){return function(t){for(var n=0;n<e.length;++n)e[n]!==t&&delete this[e[n]]}},i.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},i.T=function(){var e=i.Buffer;e?(i._=e.from!==Uint8Array.from&&e.from||function(t,n){return new e(t,n)},i.S=e.allocUnsafe||function(t){return new e(t)}):i._=i.S=null}}.call(this,o(15))},function(t,n,e){"use strict";t.exports=o;var a=e(6),i=(((o.prototype=Object.create(a.prototype)).constructor=o).className="Enum",e(8)),r=e(2);function o(t,n,e,i,r){if(a.call(this,t,e),n&&"object"!=typeof n)throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=i,this.comments=r||{},this.reserved=void 0,n)for(var o=Object.keys(n),s=0;s<o.length;++s)"number"==typeof n[o[s]]&&(this.valuesById[this.values[o[s]]=n[o[s]]]=o[s])}o.fromJSON=function(t,n){t=new o(t,n.values,n.options,n.comment,n.comments);return t.reserved=n.reserved,t},o.prototype.toJSON=function(t){t=!!t&&Boolean(t.keepComments);return r.toObject(["options",this.options,"values",this.values,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"comment",t?this.comment:void 0,"comments",t?this.comments:void 0])},o.prototype.add=function(t,n,e){if(!r.isString(t))throw TypeError("name must be a string");if(!r.isInteger(n))throw TypeError("id must be an integer");if(void 0!==this.values[t])throw Error("duplicate name '"+t+"' in "+this);if(this.isReservedId(n))throw Error("id "+n+" is reserved in "+this);if(this.isReservedName(t))throw Error("name '"+t+"' is reserved in "+this);if(void 0!==this.valuesById[n]){if(!this.options||!this.options.allow_alias)throw Error("duplicate id "+n+" in "+this);this.values[t]=n}else this.valuesById[this.values[t]=n]=t;return this.comments[t]=e||null,this},o.prototype.remove=function(t){if(!r.isString(t))throw TypeError("name must be a string");var n=this.values[t];if(null==n)throw Error("name '"+t+"' does not exist in "+this);return delete this.valuesById[n],delete this.values[t],delete this.comments[t],this},o.prototype.isReservedId=function(t){return i.isReservedId(this.reserved,t)},o.prototype.isReservedName=function(t){return i.isReservedName(this.reserved,t)}},function(t,n,e){"use strict";(t.exports=r).className="ReflectionObject";var i,s=e(2);function r(t,n){if(!s.isString(t))throw TypeError("name must be a string");if(n&&!s.isObject(n))throw TypeError("options must be an object");this.options=n,this.parsedOptions=null,this.name=t,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}Object.defineProperties(r.prototype,{root:{get:function(){for(var t=this;null!==t.parent;)t=t.parent;return t}},fullName:{get:function(){for(var t=[this.name],n=this.parent;n;)t.unshift(n.name),n=n.parent;return t.join(".")}}}),r.prototype.toJSON=function(){throw Error()},r.prototype.onAdd=function(t){this.parent&&this.parent!==t&&this.parent.remove(this),this.parent=t,this.resolved=!1;t=t.root;t instanceof i&&t.A(this)},r.prototype.onRemove=function(t){t=t.root;t instanceof i&&t.M(this),this.parent=null,this.resolved=!1},r.prototype.resolve=function(){return this.resolved||this.root instanceof i&&(this.resolved=!0),this},r.prototype.getOption=function(t){if(this.options)return this.options[t]},r.prototype.setOption=function(t,n,e){return e&&this.options&&void 0!==this.options[t]||((this.options||(this.options={}))[t]=n),this},r.prototype.setParsedOption=function(n,t,e){this.parsedOptions||(this.parsedOptions=[]);var i,r,o=this.parsedOptions;return e?(i=o.find(function(t){return Object.prototype.hasOwnProperty.call(t,n)}))?(r=i[n],s.setProperty(r,e,t)):((i={})[n]=s.setProperty({},e,t),o.push(i)):((r={})[n]=t,o.push(r)),this},r.prototype.setOptions=function(t,n){if(t)for(var e=Object.keys(t),i=0;i<e.length;++i)this.setOption(e[i],t[e[i]],n);return this},r.prototype.toString=function(){var t=this.constructor.className,n=this.fullName;return n.length?t+" "+n:t},r.T=function(t){i=t}},function(t,n,e){"use strict";t.exports=s;var i,a=e(6),r=(((s.prototype=Object.create(a.prototype)).constructor=s).className="Field",e(5)),u=e(9),c=e(2),h=/^required|optional|repeated$/;function s(t,n,e,i,r,o,s){if(c.isObject(i)?(s=r,o=i,i=r=void 0):c.isObject(r)&&(s=o,o=r,r=void 0),a.call(this,t,o),!c.isInteger(n)||n<0)throw TypeError("id must be a non-negative integer");if(!c.isString(e))throw TypeError("type must be a string");if(void 0!==i&&!h.test(i=i.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(void 0!==r&&!c.isString(r))throw TypeError("extend must be a string");this.rule=(i="proto3_optional"===i?"optional":i)&&"optional"!==i?i:void 0,this.type=e,this.id=n,this.extend=r||void 0,this.required="required"===i,this.optional=!this.required,this.repeated="repeated"===i,this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=!!c.Long&&void 0!==u.long[e],this.bytes="bytes"===e,this.resolvedType=null,this.extensionField=null,this.declaringField=null,this.O=null,this.comment=s}s.fromJSON=function(t,n){return new s(t,n.id,n.type,n.rule,n.extend,n.options,n.comment)},Object.defineProperty(s.prototype,"packed",{get:function(){return null===this.O&&(this.O=!1!==this.getOption("packed")),this.O}}),s.prototype.setOption=function(t,n,e){return"packed"===t&&(this.O=null),a.prototype.setOption.call(this,t,n,e)},s.prototype.toJSON=function(t){t=!!t&&Boolean(t.keepComments);return c.toObject(["rule","optional"!==this.rule&&this.rule||void 0,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},s.prototype.resolve=function(){var t;return this.resolved?this:(void 0===(this.typeDefault=u.defaults[this.type])&&(this.resolvedType=(this.declaringField||this).parent.lookupTypeOrEnum(this.type),this.resolvedType instanceof i?this.typeDefault=null:this.typeDefault=this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]),this.options&&null!=this.options.default&&(this.typeDefault=this.options.default,this.resolvedType instanceof r)&&"string"==typeof this.typeDefault&&(this.typeDefault=this.resolvedType.values[this.typeDefault]),this.options&&(!0!==this.options.packed&&(void 0===this.options.packed||!this.resolvedType||this.resolvedType instanceof r)||delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long?(this.typeDefault=c.Long.fromNumber(this.typeDefault,"u"===this.type.charAt(0)),Object.freeze&&Object.freeze(this.typeDefault)):this.bytes&&"string"==typeof this.typeDefault&&(c.base64.test(this.typeDefault)?c.base64.decode(this.typeDefault,t=c.newBuffer(c.base64.length(this.typeDefault)),0):c.utf8.write(this.typeDefault,t=c.newBuffer(c.utf8.length(this.typeDefault)),0),this.typeDefault=t),this.map?this.defaultValue=c.emptyObject:this.repeated?this.defaultValue=c.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof i&&(this.parent.ctor.prototype[this.name]=this.defaultValue),a.prototype.resolve.call(this))},s.d=function(e,i,r,o){return"function"==typeof i?i=c.decorateType(i).name:i&&"object"==typeof i&&(i=c.decorateEnum(i).name),function(t,n){c.decorateType(t.constructor).add(new s(n,e,i,r,{default:o}))}},s.T=function(t){i=t}},function(t,n,e){"use strict";t.exports=f;var r,o,s,i=e(6),a=(((f.prototype=Object.create(i.prototype)).constructor=f).className="Namespace",e(7)),u=e(10),c=e(2);function h(t,n){if(t&&t.length){for(var e={},i=0;i<t.length;++i)e[t[i].name]=t[i].toJSON(n);return e}}function f(t,n){i.call(this,t,n),this.nested=void 0,this.L=null}function l(t){return t.L=null,t}f.fromJSON=function(t,n){return new f(t,n.options).addJSON(n.nested)},f.arrayToJSON=h,f.isReservedId=function(t,n){if(t)for(var e=0;e<t.length;++e)if("string"!=typeof t[e]&&t[e][0]<=n&&t[e][1]>n)return!0;return!1},f.isReservedName=function(t,n){if(t)for(var e=0;e<t.length;++e)if(t[e]===n)return!0;return!1},Object.defineProperty(f.prototype,"nestedArray",{get:function(){return this.L||(this.L=c.toArray(this.nested))}}),f.prototype.toJSON=function(t){return c.toObject(["options",this.options,"nested",h(this.nestedArray,t)])},f.prototype.addJSON=function(t){if(t)for(var n,e=Object.keys(t),i=0;i<e.length;++i)n=t[e[i]],this.add((void 0!==n.fields?r:void 0!==n.values?s:void 0!==n.methods?o:void 0!==n.id?a:f).fromJSON(e[i],n));return this},f.prototype.get=function(t){return this.nested&&this.nested[t]||null},f.prototype.getEnum=function(t){if(this.nested&&this.nested[t]instanceof s)return this.nested[t].values;throw Error("no such enum: "+t)},f.prototype.add=function(t){if(!(t instanceof a&&void 0!==t.extend||t instanceof r||t instanceof s||t instanceof o||t instanceof f||t instanceof u))throw TypeError("object must be a valid nested object");if(this.nested){var n=this.get(t.name);if(n){if(!(n instanceof f&&t instanceof f)||n instanceof r||n instanceof o)throw Error("duplicate name '"+t.name+"' in "+this);for(var e=n.nestedArray,i=0;i<e.length;++i)t.add(e[i]);this.remove(n),this.nested||(this.nested={}),t.setOptions(n.options,!0)}}else this.nested={};return(this.nested[t.name]=t).onAdd(this),l(this)},f.prototype.remove=function(t){if(!(t instanceof i))throw TypeError("object must be a ReflectionObject");if(t.parent!==this)throw Error(t+" is not a member of "+this);return delete this.nested[t.name],Object.keys(this.nested).length||(this.nested=void 0),t.onRemove(this),l(this)},f.prototype.define=function(t,n){if(c.isString(t))t=t.split(".");else if(!Array.isArray(t))throw TypeError("illegal path");if(t&&t.length&&""===t[0])throw Error("path must be relative");for(var e=this;0<t.length;){var i=t.shift();if(e.nested&&e.nested[i]){if(!((e=e.nested[i])instanceof f))throw Error("path conflicts with non-namespace objects")}else e.add(e=new f(i))}return n&&e.addJSON(n),e},f.prototype.resolveAll=function(){for(var t=this.nestedArray,n=0;n<t.length;)t[n]instanceof f?t[n++].resolveAll():t[n++].resolve();return this.resolve()},f.prototype.lookup=function(t,n,e){if("boolean"==typeof n?(e=n,n=void 0):n&&!Array.isArray(n)&&(n=[n]),c.isString(t)&&t.length){if("."===t)return this.root;t=t.split(".")}else if(!t.length)return this;if(""===t[0])return this.root.lookup(t.slice(1),n);var i=this.get(t[0]);if(i){if(1===t.length){if(!n||-1<n.indexOf(i.constructor))return i}else if(i instanceof f&&(i=i.lookup(t.slice(1),n,!0)))return i}else for(var r=0;r<this.nestedArray.length;++r)if(this.L[r]instanceof f&&(i=this.L[r].lookup(t,n,!0)))return i;return null===this.parent||e?null:this.parent.lookup(t,n)},f.prototype.lookupType=function(t){var n=this.lookup(t,[r]);if(n)return n;throw Error("no such type: "+t)},f.prototype.lookupEnum=function(t){var n=this.lookup(t,[s]);if(n)return n;throw Error("no such Enum '"+t+"' in "+this)},f.prototype.lookupTypeOrEnum=function(t){var n=this.lookup(t,[r,s]);if(n)return n;throw Error("no such Type or Enum '"+t+"' in "+this)},f.prototype.lookupService=function(t){var n=this.lookup(t,[o]);if(n)return n;throw Error("no such Service '"+t+"' in "+this)},f.T=function(t,n,e){r=t,o=n,s=e}},function(t,n,e){"use strict";var e=e(2),r=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function i(t,n){var e=0,i={};for(n|=0;e<t.length;)i[r[e+n]]=t[e++];return i}n.basic=i([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]),n.defaults=i([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",e.emptyArray,null]),n.long=i([0,0,0,1,1],7),n.mapKey=i([0,0,0,5,5,0,0,0,1,1,0,2],2),n.packed=i([1,5,0,0,0,5,5,0,0,0,1,1,0])},function(t,n,e){"use strict";t.exports=s;var r=e(6),i=(((s.prototype=Object.create(r.prototype)).constructor=s).className="OneOf",e(7)),o=e(2);function s(t,n,e,i){if(Array.isArray(n)||(e=n,n=void 0),r.call(this,t,e),void 0!==n&&!Array.isArray(n))throw TypeError("fieldNames must be an Array");this.oneof=n||[],this.fieldsArray=[],this.comment=i}function a(t){if(t.parent)for(var n=0;n<t.fieldsArray.length;++n)t.fieldsArray[n].parent||t.parent.add(t.fieldsArray[n])}s.fromJSON=function(t,n){return new s(t,n.oneof,n.options,n.comment)},s.prototype.toJSON=function(t){t=!!t&&Boolean(t.keepComments);return o.toObject(["options",this.options,"oneof",this.oneof,"comment",t?this.comment:void 0])},s.prototype.add=function(t){if(t instanceof i)return t.parent&&t.parent!==this.parent&&t.parent.remove(t),this.oneof.push(t.name),this.fieldsArray.push(t),a(t.partOf=this),this;throw TypeError("field must be a Field")},s.prototype.remove=function(t){if(!(t instanceof i))throw TypeError("field must be a Field");var n=this.fieldsArray.indexOf(t);if(n<0)throw Error(t+" is not a member of "+this);return this.fieldsArray.splice(n,1),-1<(n=this.oneof.indexOf(t.name))&&this.oneof.splice(n,1),t.partOf=null,this},s.prototype.onAdd=function(t){r.prototype.onAdd.call(this,t);for(var n=0;n<this.oneof.length;++n){var e=t.get(this.oneof[n]);e&&!e.partOf&&(e.partOf=this).fieldsArray.push(e)}a(this)},s.prototype.onRemove=function(t){for(var n,e=0;e<this.fieldsArray.length;++e)(n=this.fieldsArray[e]).parent&&n.parent.remove(n);r.prototype.onRemove.call(this,t)},s.d=function(){for(var e=new Array(arguments.length),t=0;t<arguments.length;)e[t]=arguments[t++];return function(t,n){o.decorateType(t.constructor).add(new s(n,e)),Object.defineProperty(t,n,{get:o.oneOfGetter(e),set:o.oneOfSetter(e)})}}},function(t,n,e){var i;void 0!==(n="function"==typeof(i=function(){var h=function t(n){return n.reduce(function(t,n){return t*2+n},0)},f=function t(n){var e=[];for(var i=7;i>=0;i--)e.push(!!(n&1<<i));return e},nt=function t(n){this.data=n;this.len=this.data.length;this.pos=0;this.readByte=function(){if(this.pos>=this.data.length)throw new Error("Attempted to read past end of stream.");if(n instanceof Uint8Array)return n[this.pos++];else return n.charCodeAt(this.pos++)&255};this.readBytes=function(t){var n=[];for(var e=0;e<t;e++)n.push(this.readByte());return n};this.read=function(t){var n="";for(var e=0;e<t;e++)n+=String.fromCharCode(this.readByte());return n};this.readUnsigned=function(){var t=this.readBytes(2);return(t[1]<<8)+t[0]}},l=function t(e,r){var o=0;var n=function t(n){var e=0;for(var i=0;i<n;i++){if(r.charCodeAt(o>>3)&1<<(o&7))e|=1<<i;o++}return e};var i=[];var s=1<<e;var a=s+1;var u=e+1;var c=[];var h=function t(){c=[];u=e+1;for(var n=0;n<s;n++)c[n]=[n];c[s]=[];c[a]=null};var f;var l;while(true){l=f;f=n(u);if(f===s){h();continue}if(f===a)break;if(f<c.length){if(l!==s)c.push(c[l].concat(c[f][0]))}else{if(f!==c.length)throw new Error("Invalid LZW code.");c.push(c[l].concat(c[l][0]))}i.push.apply(i,c[f]);if(c.length===1<<u&&u<12)u++}return i},et=function t(a,u){u||(u={});var o=function t(n){var e=[];for(var i=0;i<n;i++)e.push(a.readBytes(3));return e};var c=function t(){var n,e;e="";do{n=a.readByte();e+=a.read(n)}while(n!==0);return e};var n=function t(){var n={};n.sig=a.read(3);n.ver=a.read(3);if(n.sig!=="GIF")throw new Error("Not a GIF file.");n.width=a.readUnsigned();n.height=a.readUnsigned();var e=f(a.readByte());n.gctFlag=e.shift();n.colorRes=h(e.splice(0,3));n.sorted=e.shift();n.gctSize=h(e.splice(0,3));n.bgColor=a.readByte();n.pixelAspectRatio=a.readByte();if(n.gctFlag)n.gct=o(1<<n.gctSize+1);u.hdr&&u.hdr(n)};var e=function t(n){var e=function t(n){var e=a.readByte();var i=f(a.readByte());n.reserved=i.splice(0,3);n.disposalMethod=h(i.splice(0,3));n.userInput=i.shift();n.transparencyGiven=i.shift();n.delayTime=a.readUnsigned();n.transparencyIndex=a.readByte();n.terminator=a.readByte();u.gce&&u.gce(n)};var i=function t(n){n.comment=c();u.com&&u.com(n)};var r=function t(n){var e=a.readByte();n.ptHeader=a.readBytes(12);n.ptData=c();u.pte&&u.pte(n)};var o=function t(n){var e=function t(n){var e=a.readByte();n.unknown=a.readByte();n.iterations=a.readUnsigned();n.terminator=a.readByte();u.app&&u.app.NETSCAPE&&u.app.NETSCAPE(n)};var i=function t(n){n.appData=c();u.app&&u.app[n.identifier]&&u.app[n.identifier](n)};var r=a.readByte();n.identifier=a.read(8);n.authCode=a.read(3);switch(n.identifier){case"NETSCAPE":e(n);break;default:i(n);break}};var s=function t(n){n.data=c();u.unknown&&u.unknown(n)};n.label=a.readByte();switch(n.label){case 249:n.extType="gce";e(n);break;case 254:n.extType="com";i(n);break;case 1:n.extType="pte";r(n);break;case 255:n.extType="app";o(n);break;default:n.extType="unknown";s(n);break}};var i=function t(n){var e=function t(r,o){var s=new Array(r.length);var n=r.length/o;var e=function t(n,e){var i=r.slice(e*o,(e+1)*o);s.splice.apply(s,[n*o,o].concat(i))};var i=[0,4,2,1];var a=[8,8,4,2];var u=0;for(var c=0;c<4;c++)for(var h=i[c];h<n;h+=a[c]){e(h,u);u++}return s};n.leftPos=a.readUnsigned();n.topPos=a.readUnsigned();n.width=a.readUnsigned();n.height=a.readUnsigned();var i=f(a.readByte());n.lctFlag=i.shift();n.interlaced=i.shift();n.sorted=i.shift();n.reserved=i.splice(0,2);n.lctSize=h(i.splice(0,3));if(n.lctFlag)n.lct=o(1<<n.lctSize+1);n.lzwMinCodeSize=a.readByte();var r=c();n.pixels=l(n.lzwMinCodeSize,r);if(n.interlaced)n.pixels=e(n.pixels,n.width);u.img&&u.img(n)};var r=function t(){var n={};n.sentinel=a.readByte();switch(String.fromCharCode(n.sentinel)){case"!":n.type="ext";e(n);break;case",":n.type="img";i(n);break;case";":n.type="eof";u.eof&&u.eof(n);break;default:throw new Error("Unknown block: 0x"+n.sentinel.toString(16))}if(n.type!=="eof")setTimeout(t,0)};var s=function t(){n();setTimeout(r,0)};s()},t;return function C(t){var d={vp_l:0,vp_t:0,vp_w:null,vp_h:null,c_w:null,c_h:null};for(var n in t)d[n]=t[n];if(d.vp_w&&d.vp_h)d.is_vp=true;var r;var o;var h=null;var e=false;var s=null;var i=null;var a=null;var u=null;var c=null;var f=null;var l=null;var v=true;var D=true;var p=false;var m=[];var y=[];var b=d.gif;if(typeof d.auto_play=="undefined")d.auto_play=!b.getAttribute("rel:auto_play")||b.getAttribute("rel:auto_play")=="1";var g=d.hasOwnProperty("on_end")?d.on_end:null;var k=d.hasOwnProperty("loop_delay")?d.loop_delay:0;var U=d.hasOwnProperty("loop_mode")?d.loop_mode:"auto";var _=d.hasOwnProperty("draw_while_loading")?d.draw_while_loading:true;var B=_?d.hasOwnProperty("show_progress_bar")?d.show_progress_bar:true:false;var G=d.hasOwnProperty("progressbar_height")?d.progressbar_height:25;var H=d.hasOwnProperty("progressbar_background_color")?d.progressbar_background_color:"rgba(255,255,255,0.4)";var X=d.hasOwnProperty("progressbar_foreground_color")?d.progressbar_foreground_color:"rgba(255,0,22,.8)";var w=function t(){s=null;i=null;c=a;a=null;f=null};var x=function t(){try{et(r,K)}catch(t){T("parse")}};var V=function t(n){P.innerHTML=n;P.style.visibility="visible"};var E=function t(n,e){R.width=n*L();R.height=e*L();P.style.minWidth=n*L()+"px";F.width=n;F.height=e;F.style.width=n+"px";F.style.height=e+"px";F.getContext("2d").setTransform(1,0,0,1,0,0)};var z=function t(n,e){if(!y[n]){y[n]=e;return}if(typeof e.x!=="undefined")y[n].x=e.x;if(typeof e.y!=="undefined")y[n].y=e.y};var S=function t(n,e,i){if(i&&B){var r=G;var o,s,a,u;if(d.is_vp){if(!p){a=d.vp_t+d.vp_h-r;r=r;o=d.vp_l;s=o+n/e*d.vp_w;u=R.width}else{a=(d.vp_t+d.vp_h-r)/L();r=r/L();o=d.vp_l/L();s=o+n/e*(d.vp_w/L());u=R.width/L()}if(false)var c,h,f,l}else{a=(R.height-r)/(p?L():1);s=n/e*R.width/(p?L():1);u=R.width/(p?L():1);r/=p?L():1}N.fillStyle=H;N.fillRect(s,a,u-s,r);N.fillStyle=X;N.fillRect(0,a,s,r)}};var T=function t(n){var e=function t(){N.fillStyle="black";N.fillRect(0,0,d.c_w?d.c_w:o.width,d.c_h?d.c_h:o.height);N.strokeStyle="red";N.lineWidth=3;N.moveTo(0,0);N.lineTo(d.c_w?d.c_w:o.width,d.c_h?d.c_h:o.height);N.moveTo(0,d.c_h?d.c_h:o.height);N.lineTo(d.c_w?d.c_w:o.width,0);N.stroke()};h=n;o={width:b.width,height:b.height};m=[];e()};var W=function t(n){o=n;E(o.width,o.height)};var Y=function t(n){A();w();s=n.transparencyGiven?n.transparencyIndex:null;i=n.delayTime;a=n.disposalMethod};var A=function t(){if(!f)return;m.push({data:f.getImageData(0,0,o.width,o.height),delay:i});y.push({x:0,y:0})};var Q=function t(n){if(!f)f=F.getContext("2d");var e=m.length;var i=n.lctFlag?n.lct:o.gct;if(e>0){if(c===3)if(u!==null)f.putImageData(m[u].data,0,0);else f.clearRect(l.leftPos,l.topPos,l.width,l.height);else u=e-1;if(c===2)f.clearRect(l.leftPos,l.topPos,l.width,l.height)}var r=f.getImageData(n.leftPos,n.topPos,n.width,n.height);n.pixels.forEach(function(t,n){if(t!==s){r.data[n*4+0]=i[t][0];r.data[n*4+1]=i[t][1];r.data[n*4+2]=i[t][2];r.data[n*4+3]=255}});f.putImageData(r,n.leftPos,n.topPos);if(!p){N.scale(L(),L());p=true}if(_){N.drawImage(F,0,0);_=d.auto_play}l=n};var M=function(){var o=-1;var e=0;var t=false;var n=false;var s=function t(){var n=D?1:-1;return(o+n+m.length)%m.length};var a=function t(n){o=o+n;r()};var i=function(){var i=false;var r=function t(){if(g!==null)g(b);e++;if(U!==false||e<0)n();else{i=false;v=false}};var n=function t(){i=v;if(!i)return;a(1);var n=m[o].delay*10;if(!n)n=100;var e=s();if(e===0){n+=k;setTimeout(r,n)}else setTimeout(t,n)};return function(){if(!i)setTimeout(n,0)}}();var r=function t(){var n;o=parseInt(o,10);if(o>m.length-1)o=0;if(o<0)o=0;n=y[o];F.getContext("2d").putImageData(m[o].data,n.x,n.y);N.globalCompositeOperation="copy";N.drawImage(F,0,0)};var u=function t(){v=true;i()};var c=function t(){v=false};return{init:function t(){if(h)return;if(!(d.c_w&&d.c_h))N.scale(L(),L());if(d.auto_play)i();else{o=0;r()}},step:i,play:u,pause:c,playing:v,move_relative:a,current_frame:function t(){return o},length:function t(){return m.length},move_to:function t(n){o=n;r()}}}();var Z=function t(n){S(r.pos,r.data.length,n)};var q=function t(){};var O=function t(n,e){return function(t){n(t);Z(e)}};var K={hdr:O(W),gce:O(Y),com:O(q),app:{NETSCAPE:O(q)},img:O(Q,true),eof:function t(n){A();Z(false);if(!(d.c_w&&d.c_h)){R.width=o.width*L();R.height=o.height*L()}M.init();e=false;if(I)I(b)}};var J=function t(){var n=b.parentNode;var e=document.createElement("div");R=document.createElement("canvas");N=R.getContext("2d");P=document.createElement("div");F=document.createElement("canvas");e.width=R.width=b.width;e.height=R.height=b.height;P.style.minWidth=b.width+"px";e.className="jsgif";P.className="jsgif_toolbar";e.appendChild(R);e.appendChild(P);n.insertBefore(e,b);n.removeChild(b);if(d.c_w&&d.c_h)E(d.c_w,d.c_h);j=true};var L=function t(){var n;if(d.max_width&&o&&o.width>d.max_width)n=d.max_width/o.width;else n=1;return n};var R,N,P,F;var j=false;var I=false;var $=function t(n){if(e)return false;if(n)I=n;else I=false;e=true;m=[];w();u=null;c=null;f=null;l=null;return true};var tt=function t(){return m.reduce(function(t,n){return t+n.delay},0)};return{play:M.play,pause:M.pause,move_relative:M.move_relative,move_to:M.move_to,get_playing:function t(){return v},get_canvas:function t(){return R},get_canvas_scale:function t(){return L()},get_loading:function t(){return e},get_auto_play:function t(){return d.auto_play},get_length:function t(){return M.length()},get_frames:function t(){return m},get_duration:function t(){return tt()},get_duration_ms:function t(){return tt()*10},get_current_frame:function t(){return M.current_frame()},load_url:function t(n,e){if(!$(e))return;var i=new XMLHttpRequest;i.open("GET",n,true);if("overrideMimeType"in i)i.overrideMimeType("text/plain; charset=x-user-defined");else if("responseType"in i)i.responseType="arraybuffer";else i.setRequestHeader("Accept-Charset","x-user-defined");i.onloadstart=function(){if(!j)J()};i.onload=function(t){if(this.status!=200)T("xhr - response");if(!("response"in this))this.response=new VBArray(this.responseText).toArray().map(String.fromCharCode).join("");var n=this.response;if(n.toString().indexOf("ArrayBuffer")>0)n=new Uint8Array(n);r=new nt(n);setTimeout(x,0)};i.onprogress=function(t){if(t.lengthComputable)S(t.loaded,t.total,true)};i.onerror=function(){T("xhr")};i.send()},load:function t(n){this.load_url(b.getAttribute("rel:animated_src")||b.src,n)},load_raw:function t(n,e){if(!$(e))return;if(!j)J();r=new nt(n);setTimeout(x,0)},set_frame_offset:z}}})?i.apply(n,[]):i)&&(t.exports=n)},function(t,n,e){"use strict";t.exports=f;var i,r=e(4),o=r.LongBits,s=r.base64,a=r.utf8;function u(t,n,e){this.fn=t,this.len=n,this.next=void 0,this.val=e}function c(){}function h(t){this.head=t.head,this.tail=t.tail,this.len=t.len,this.next=t.states}function f(){this.len=0,this.head=new u(c,0,0),this.tail=this.head,this.states=null}function l(){return r.Buffer?function(){return(f.create=function(){return new i})()}:function(){return new f}}function d(t,n,e){n[e]=255&t}function v(t,n){this.len=t,this.next=void 0,this.val=n}function p(t,n,e){for(;t.hi;)n[e++]=127&t.lo|128,t.lo=(t.lo>>>7|t.hi<<25)>>>0,t.hi>>>=7;for(;127<t.lo;)n[e++]=127&t.lo|128,t.lo=t.lo>>>7;n[e++]=t.lo}function m(t,n,e){n[e]=255&t,n[e+1]=t>>>8&255,n[e+2]=t>>>16&255,n[e+3]=t>>>24}f.create=l(),f.alloc=function(t){return new r.Array(t)},r.Array!==Array&&(f.alloc=r.pool(f.alloc,r.Array.prototype.subarray)),f.prototype.R=function(t,n,e){return this.tail=this.tail.next=new u(t,n,e),this.len+=n,this},(v.prototype=Object.create(u.prototype)).fn=function(t,n,e){for(;127<t;)n[e++]=127&t|128,t>>>=7;n[e]=t},f.prototype.uint32=function(t){return this.len+=(this.tail=this.tail.next=new v((t>>>=0)<128?1:t<16384?2:t<2097152?3:t<268435456?4:5,t)).len,this},f.prototype.int32=function(t){return t<0?this.R(p,10,o.fromNumber(t)):this.uint32(t)},f.prototype.sint32=function(t){return this.uint32((t<<1^t>>31)>>>0)},f.prototype.int64=f.prototype.uint64=function(t){t=o.from(t);return this.R(p,t.length(),t)},f.prototype.sint64=function(t){t=o.from(t).zzEncode();return this.R(p,t.length(),t)},f.prototype.bool=function(t){return this.R(d,1,t?1:0)},f.prototype.sfixed32=f.prototype.fixed32=function(t){return this.R(m,4,t>>>0)},f.prototype.sfixed64=f.prototype.fixed64=function(t){t=o.from(t);return this.R(m,4,t.lo).R(m,4,t.hi)},f.prototype.float=function(t){return this.R(r.float.writeFloatLE,4,t)},f.prototype.double=function(t){return this.R(r.float.writeDoubleLE,8,t)};var y=r.Array.prototype.set?function(t,n,e){n.set(t,e)}:function(t,n,e){for(var i=0;i<t.length;++i)n[e+i]=t[i]};f.prototype.bytes=function(t){var n,e=t.length>>>0;return e?(r.isString(t)&&(n=f.alloc(e=s.length(t)),s.decode(t,n,0),t=n),this.uint32(e).R(y,e,t)):this.R(d,1,0)},f.prototype.string=function(t){var n=a.length(t);return n?this.uint32(n).R(a.write,n,t):this.R(d,1,0)},f.prototype.fork=function(){return this.states=new h(this),this.head=this.tail=new u(c,0,0),this.len=0,this},f.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new u(c,0,0),this.len=0),this},f.prototype.ldelim=function(){var t=this.head,n=this.tail,e=this.len;return this.reset().uint32(e),e&&(this.tail.next=t.next,this.tail=n,this.len+=e),this},f.prototype.finish=function(){for(var t=this.head.next,n=this.constructor.alloc(this.len),e=0;t;)t.fn(t.val,n,e),e+=t.len,t=t.next;return n},f.T=function(t){i=t,f.create=l(),i.T()}},function(t,n,e){"use strict";t.exports=u;var i,r=e(4),o=r.LongBits,s=r.utf8;function a(t,n){return RangeError("index out of range: "+t.pos+" + "+(n||1)+" > "+t.len)}function u(t){this.buf=t,this.pos=0,this.len=t.length}function c(){return r.Buffer?function(t){return(u.create=function(t){return r.Buffer.isBuffer(t)?new i(t):f(t)})(t)}:f}var h,f="undefined"!=typeof Uint8Array?function(t){if(t instanceof Uint8Array||Array.isArray(t))return new u(t);throw Error("illegal buffer")}:function(t){if(Array.isArray(t))return new u(t);throw Error("illegal buffer")};function l(){var t=new o(0,0),n=0;if(!(4<this.len-this.pos)){for(;n<3;++n){if(this.pos>=this.len)throw a(this);if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*n)>>>0,this.buf[this.pos++]<128)return t}return t.lo=(t.lo|(127&this.buf[this.pos++])<<7*n)>>>0,t}for(;n<4;++n)if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*n)>>>0,this.buf[this.pos++]<128)return t;if(t.lo=(t.lo|(127&this.buf[this.pos])<<28)>>>0,t.hi=(t.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return t;if(n=0,4<this.len-this.pos){for(;n<5;++n)if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*n+3)>>>0,this.buf[this.pos++]<128)return t}else for(;n<5;++n){if(this.pos>=this.len)throw a(this);if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*n+3)>>>0,this.buf[this.pos++]<128)return t}throw Error("invalid varint encoding")}function d(t,n){return(t[n-4]|t[n-3]<<8|t[n-2]<<16|t[n-1]<<24)>>>0}function v(){if(this.pos+8>this.len)throw a(this,8);return new o(d(this.buf,this.pos+=4),d(this.buf,this.pos+=4))}u.create=c(),u.prototype.N=r.Array.prototype.subarray||r.Array.prototype.slice,u.prototype.uint32=(h=4294967295,function(){if(h=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128||(h=(h|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)||(h=(h|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)||(h=(h|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)||(h=(h|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)||!((this.pos+=5)>this.len))return h;throw this.pos=this.len,a(this,10)}),u.prototype.int32=function(){return 0|this.uint32()},u.prototype.sint32=function(){var t=this.uint32();return t>>>1^-(1&t)|0},u.prototype.bool=function(){return 0!==this.uint32()},u.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return d(this.buf,this.pos+=4)},u.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return 0|d(this.buf,this.pos+=4)},u.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var t=r.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t},u.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var t=r.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t},u.prototype.bytes=function(){var t=this.uint32(),n=this.pos,e=this.pos+t;if(e>this.len)throw a(this,t);return this.pos+=t,Array.isArray(this.buf)?this.buf.slice(n,e):n===e?new this.buf.constructor(0):this.N.call(this.buf,n,e)},u.prototype.string=function(){var t=this.bytes();return s.read(t,0,t.length)},u.prototype.skip=function(t){if("number"==typeof t){if(this.pos+t>this.len)throw a(this,t);this.pos+=t}else do{if(this.pos>=this.len)throw a(this)}while(128&this.buf[this.pos++]);return this},u.prototype.skipType=function(t){switch(t){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(t=7&this.uint32());)this.skipType(t);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+t+" at offset "+this.pos)}return this},u.T=function(t){i=t,u.create=c(),i.T();var n=r.Long?"toLong":"toNumber";r.merge(u.prototype,{int64:function(){return l.call(this)[n](!1)},uint64:function(){return l.call(this)[n](!0)},sint64:function(){return l.call(this).zzDecode()[n](!1)},fixed64:function(){return v.call(this)[n](!0)},sfixed64:function(){return v.call(this)[n](!1)}})}},function(t,n,e){"use strict";t.exports=r;var i=e(4);function r(t){if(t)for(var n=Object.keys(t),e=0;e<n.length;++e)this[n[e]]=t[n[e]]}r.create=function(t){return this.$type.create(t)},r.encode=function(t,n){return this.$type.encode(t,n)},r.encodeDelimited=function(t,n){return this.$type.encodeDelimited(t,n)},r.decode=function(t){return this.$type.decode(t)},r.decodeDelimited=function(t){return this.$type.decodeDelimited(t)},r.verify=function(t){return this.$type.verify(t)},r.fromObject=function(t){return this.$type.fromObject(t)},r.toObject=function(t,n){return this.$type.toObject(t,n)},r.prototype.toJSON=function(){return this.$type.toObject(this,i.toJSONOptions)}},function(t,n){var e=function(){return this}();try{e=e||new Function("return this")()}catch(t){"object"==typeof window&&(e=window)}t.exports=e},function(t,n,e){"use strict";t.exports=function(t,n){var e=new Array(arguments.length-1),o=0,i=2,s=!0;for(;i<arguments.length;)e[o++]=arguments[i++];return new Promise(function(i,r){e[o]=function(t){if(s)if(s=!1,t)r(t);else{for(var n=new Array(arguments.length-1),e=0;e<n.length;)n[e++]=arguments[e];i.apply(null,n)}};try{t.apply(n||null,e)}catch(t){s&&(s=!1,r(t))}})}},function(module,exports,__webpack_require__){"use strict";function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}module.exports=inquire},function(t,n,e){"use strict";n.Service=e(44)},function(t,n,e){"use strict";t.exports={}},function(t,n,e){"use strict";t.exports=function(t){for(var n,e=f.codegen(["m","w"],t.name+"$encode")("if(!w)")("w=Writer.create()"),i=t.fieldsArray.slice().sort(f.compareFieldsById),r=0;r<i.length;++r){var o=i[r].resolve(),s=t.P.indexOf(o),a=o.resolvedType instanceof c?"int32":o.type,u=h.basic[a];n="m"+f.safeProp(o.name),o.map?(e("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",n,o.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",n)("w.uint32(%i).fork().uint32(%i).%s(ks[i])",(o.id<<3|2)>>>0,8|h.mapKey[o.keyType],o.keyType),void 0===u?e("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",s,n):e(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|u,a,n),e("}")("}")):o.repeated?(e("if(%s!=null&&%s.length){",n,n),o.packed&&void 0!==h.packed[a]?e("w.uint32(%i).fork()",(o.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",n)("w.%s(%s[i])",a,n)("w.ldelim()"):(e("for(var i=0;i<%s.length;++i)",n),void 0===u?l(e,o,s,n+"[i]"):e("w.uint32(%i).%s(%s[i])",(o.id<<3|u)>>>0,a,n)),e("}")):(o.optional&&e("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",n,o.name),void 0===u?l(e,o,s,n):e("w.uint32(%i).%s(%s)",(o.id<<3|u)>>>0,a,n))}return e("return w")};var c=e(5),h=e(9),f=e(2);function l(t,n,e,i){n.resolvedType.group?t("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",e,i,(n.id<<3|3)>>>0,(n.id<<3|4)>>>0):t("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",e,i,(n.id<<3|2)>>>0)}},function(t,n,e){"use strict";t.exports=g;var s=e(8),a=(((g.prototype=Object.create(s.prototype)).constructor=g).className="Type",e(5)),u=e(10),c=e(7),h=e(22),f=e(23),r=e(14),o=e(13),l=e(12),d=e(2),v=e(20),p=e(25),m=e(26),y=e(27),b=e(28);function g(t,n){s.call(this,t,n),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.group=void 0,this.F=null,this.P=null,this.j=null,this.I=null}function i(t){return t.F=t.P=t.j=null,delete t.encode,delete t.decode,delete t.verify,t}Object.defineProperties(g.prototype,{fieldsById:{get:function(){if(!this.F){this.F={};for(var t=Object.keys(this.fields),n=0;n<t.length;++n){var e=this.fields[t[n]],i=e.id;if(this.F[i])throw Error("duplicate id "+i+" in "+this);this.F[i]=e}}return this.F}},fieldsArray:{get:function(){return this.P||(this.P=d.toArray(this.fields))}},oneofsArray:{get:function(){return this.j||(this.j=d.toArray(this.oneofs))}},ctor:{get:function(){return this.I||(this.ctor=g.generateConstructor(this)())},set:function(t){for(var n=t.prototype,e=(n instanceof r||((t.prototype=new r).constructor=t,d.merge(t.prototype,n)),t.$type=t.prototype.$type=this,d.merge(t,r,!0),this.I=t,0);e<this.fieldsArray.length;++e)this.P[e].resolve();for(var i={},e=0;e<this.oneofsArray.length;++e)i[this.j[e].resolve().name]={get:d.oneOfGetter(this.j[e].oneof),set:d.oneOfSetter(this.j[e].oneof)};e&&Object.defineProperties(t.prototype,i)}}}),g.generateConstructor=function(t){for(var n,e=d.codegen(["p"],t.name),i=0;i<t.fieldsArray.length;++i)(n=t.P[i]).map?e("this%s={}",d.safeProp(n.name)):n.repeated&&e("this%s=[]",d.safeProp(n.name));return e("if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null)")("this[ks[i]]=p[ks[i]]")},g.fromJSON=function(t,n){for(var e=new g(t,n.options),i=(e.extensions=n.extensions,e.reserved=n.reserved,Object.keys(n.fields)),r=0;r<i.length;++r)e.add((void 0!==n.fields[i[r]].keyType?h:c).fromJSON(i[r],n.fields[i[r]]));if(n.oneofs)for(i=Object.keys(n.oneofs),r=0;r<i.length;++r)e.add(u.fromJSON(i[r],n.oneofs[i[r]]));if(n.nested)for(i=Object.keys(n.nested),r=0;r<i.length;++r){var o=n.nested[i[r]];e.add((void 0!==o.id?c:void 0!==o.fields?g:void 0!==o.values?a:void 0!==o.methods?f:s).fromJSON(i[r],o))}return n.extensions&&n.extensions.length&&(e.extensions=n.extensions),n.reserved&&n.reserved.length&&(e.reserved=n.reserved),n.group&&(e.group=!0),n.comment&&(e.comment=n.comment),e},g.prototype.toJSON=function(t){var n=s.prototype.toJSON.call(this,t),e=!!t&&Boolean(t.keepComments);return d.toObject(["options",n&&n.options||void 0,"oneofs",s.arrayToJSON(this.oneofsArray,t),"fields",s.arrayToJSON(this.fieldsArray.filter(function(t){return!t.declaringField}),t)||{},"extensions",this.extensions&&this.extensions.length?this.extensions:void 0,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"group",this.group||void 0,"nested",n&&n.nested||void 0,"comment",e?this.comment:void 0])},g.prototype.resolveAll=function(){for(var t=this.fieldsArray,n=0;n<t.length;)t[n++].resolve();for(var e=this.oneofsArray,n=0;n<e.length;)e[n++].resolve();return s.prototype.resolveAll.call(this)},g.prototype.get=function(t){return this.fields[t]||this.oneofs&&this.oneofs[t]||this.nested&&this.nested[t]||null},g.prototype.add=function(t){if(this.get(t.name))throw Error("duplicate name '"+t.name+"' in "+this);if(t instanceof c&&void 0===t.extend){if((this.F||this.fieldsById)[t.id])throw Error("duplicate id "+t.id+" in "+this);if(this.isReservedId(t.id))throw Error("id "+t.id+" is reserved in "+this);if(this.isReservedName(t.name))throw Error("name '"+t.name+"' is reserved in "+this);return t.parent&&t.parent.remove(t),(this.fields[t.name]=t).message=this,t.onAdd(this),i(this)}return t instanceof u?(this.oneofs||(this.oneofs={}),(this.oneofs[t.name]=t).onAdd(this),i(this)):s.prototype.add.call(this,t)},g.prototype.remove=function(t){if(t instanceof c&&void 0===t.extend){if(this.fields&&this.fields[t.name]===t)return delete this.fields[t.name],t.parent=null,t.onRemove(this),i(this);throw Error(t+" is not a member of "+this)}if(t instanceof u){if(this.oneofs&&this.oneofs[t.name]===t)return delete this.oneofs[t.name],t.parent=null,t.onRemove(this),i(this);throw Error(t+" is not a member of "+this)}return s.prototype.remove.call(this,t)},g.prototype.isReservedId=function(t){return s.isReservedId(this.reserved,t)},g.prototype.isReservedName=function(t){return s.isReservedName(this.reserved,t)},g.prototype.create=function(t){return new this.ctor(t)},g.prototype.setup=function(){for(var t=this.fullName,n=[],e=0;e<this.fieldsArray.length;++e)n.push(this.P[e].resolve().resolvedType);this.encode=v(this)({Writer:l,types:n,util:d}),this.decode=p(this)({Reader:o,types:n,util:d}),this.verify=m(this)({types:n,util:d}),this.fromObject=y.fromObject(this)({types:n,util:d}),this.toObject=y.toObject(this)({types:n,util:d});var i,t=b[t];return t&&((i=Object.create(this)).fromObject=this.fromObject,this.fromObject=t.fromObject.bind(i),i.toObject=this.toObject,this.toObject=t.toObject.bind(i)),this},g.prototype.encode=function(t,n){return this.setup().encode(t,n)},g.prototype.encodeDelimited=function(t,n){return this.encode(t,n&&n.len?n.fork():n).ldelim()},g.prototype.decode=function(t,n){return this.setup().decode(t,n)},g.prototype.decodeDelimited=function(t){return t instanceof o||(t=o.create(t)),this.decode(t,t.uint32())},g.prototype.verify=function(t){return this.setup().verify(t)},g.prototype.fromObject=function(t){return this.setup().fromObject(t)},g.prototype.toObject=function(t,n){return this.setup().toObject(t,n)},g.d=function(n){return function(t){d.decorateType(t,n)}}},function(t,n,e){"use strict";t.exports=o;var s=e(7),i=(((o.prototype=Object.create(s.prototype)).constructor=o).className="MapField",e(9)),a=e(2);function o(t,n,e,i,r,o){if(s.call(this,t,n,i,void 0,void 0,r,o),!a.isString(e))throw TypeError("keyType must be a string");this.keyType=e,this.resolvedKeyType=null,this.map=!0}o.fromJSON=function(t,n){return new o(t,n.id,n.keyType,n.type,n.options,n.comment)},o.prototype.toJSON=function(t){t=!!t&&Boolean(t.keepComments);return a.toObject(["keyType",this.keyType,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},o.prototype.resolve=function(){if(this.resolved)return this;if(void 0===i.mapKey[this.keyType])throw Error("invalid key type: "+this.keyType);return s.prototype.resolve.call(this)},o.d=function(e,i,r){return"function"==typeof r?r=a.decorateType(r).name:r&&"object"==typeof r&&(r=a.decorateEnum(r).name),function(t,n){a.decorateType(t.constructor).add(new o(n,e,i,r))}}},function(t,n,e){"use strict";t.exports=s;var i=e(8),o=(((s.prototype=Object.create(i.prototype)).constructor=s).className="Service",e(24)),a=e(2),u=e(18);function s(t,n){i.call(this,t,n),this.methods={},this.C=null}function r(t){return t.C=null,t}s.fromJSON=function(t,n){var e=new s(t,n.options);if(n.methods)for(var i=Object.keys(n.methods),r=0;r<i.length;++r)e.add(o.fromJSON(i[r],n.methods[i[r]]));return n.nested&&e.addJSON(n.nested),e.comment=n.comment,e},s.prototype.toJSON=function(t){var n=i.prototype.toJSON.call(this,t),e=!!t&&Boolean(t.keepComments);return a.toObject(["options",n&&n.options||void 0,"methods",i.arrayToJSON(this.methodsArray,t)||{},"nested",n&&n.nested||void 0,"comment",e?this.comment:void 0])},Object.defineProperty(s.prototype,"methodsArray",{get:function(){return this.C||(this.C=a.toArray(this.methods))}}),s.prototype.get=function(t){return this.methods[t]||i.prototype.get.call(this,t)},s.prototype.resolveAll=function(){for(var t=this.methodsArray,n=0;n<t.length;++n)t[n].resolve();return i.prototype.resolve.call(this)},s.prototype.add=function(t){if(this.get(t.name))throw Error("duplicate name '"+t.name+"' in "+this);return t instanceof o?r((this.methods[t.name]=t).parent=this):i.prototype.add.call(this,t)},s.prototype.remove=function(t){if(t instanceof o){if(this.methods[t.name]!==t)throw Error(t+" is not a member of "+this);return delete this.methods[t.name],t.parent=null,r(this)}return i.prototype.remove.call(this,t)},s.prototype.create=function(t,n,e){for(var i,r=new u.Service(t,n,e),o=0;o<this.methodsArray.length;++o){var s=a.lcFirst((i=this.C[o]).resolve().name).replace(/[^$\w_]/g,"");r[s]=a.codegen(["r","c"],a.isReserved(s)?s+"_":s)("return this.rpcCall(m,q,s,r,c)")({m:i,q:i.resolvedRequestType.ctor,s:i.resolvedResponseType.ctor})}return r}},function(t,n,e){"use strict";t.exports=i;var c=e(6),h=(((i.prototype=Object.create(c.prototype)).constructor=i).className="Method",e(2));function i(t,n,e,i,r,o,s,a,u){if(h.isObject(r)?(s=r,r=o=void 0):h.isObject(o)&&(s=o,o=void 0),void 0!==n&&!h.isString(n))throw TypeError("type must be a string");if(!h.isString(e))throw TypeError("requestType must be a string");if(!h.isString(i))throw TypeError("responseType must be a string");c.call(this,t,s),this.type=n||"rpc",this.requestType=e,this.requestStream=!!r||void 0,this.responseType=i,this.responseStream=!!o||void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=a,this.parsedOptions=u}i.fromJSON=function(t,n){return new i(t,n.type,n.requestType,n.responseType,n.requestStream,n.responseStream,n.options,n.comment,n.parsedOptions)},i.prototype.toJSON=function(t){t=!!t&&Boolean(t.keepComments);return h.toObject(["type","rpc"!==this.type&&this.type||void 0,"requestType",this.requestType,"requestStream",this.requestStream,"responseType",this.responseType,"responseStream",this.responseStream,"options",this.options,"comment",t?this.comment:void 0,"parsedOptions",this.parsedOptions])},i.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),c.prototype.resolve.call(this))}},function(t,n,e){"use strict";t.exports=function(t){var n=c.codegen(["r","l"],t.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor"+(t.fieldsArray.filter(function(t){return t.map}).length?",k,value":""))("while(r.pos<c){")("var t=r.uint32()");t.group&&n("if((t&7)===4)")("break");n("switch(t>>>3){");for(var e=0;e<t.fieldsArray.length;++e){var i=t.P[e].resolve(),r=i.resolvedType instanceof a?"int32":i.type,o="m"+c.safeProp(i.name);n("case %i:",i.id),i.map?(n("if(%s===util.emptyObject)",o)("%s={}",o)("var c2 = r.uint32()+r.pos"),void 0!==u.defaults[i.keyType]?n("k=%j",u.defaults[i.keyType]):n("k=null"),void 0!==u.defaults[r]?n("value=%j",u.defaults[r]):n("value=null"),n("while(r.pos<c2){")("var tag2=r.uint32()")("switch(tag2>>>3){")("case 1: k=r.%s(); break",i.keyType)("case 2:"),void 0===u.basic[r]?n("value=types[%i].decode(r,r.uint32())",e):n("value=r.%s()",r),n("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),void 0!==u.long[i.keyType]?n('%s[typeof k==="object"?util.longToHash(k):k]=value',o):n("%s[k]=value",o)):i.repeated?(n("if(!(%s&&%s.length))",o,o)("%s=[]",o),void 0!==u.packed[r]&&n("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")("%s.push(r.%s())",o,r)("}else"),void 0===u.basic[r]?n(i.resolvedType.group?"%s.push(types[%i].decode(r))":"%s.push(types[%i].decode(r,r.uint32()))",o,e):n("%s.push(r.%s())",o,r)):void 0===u.basic[r]?n(i.resolvedType.group?"%s=types[%i].decode(r)":"%s=types[%i].decode(r,r.uint32())",o,e):n("%s=r.%s()",o,r),n("break")}for(n("default:")("r.skipType(t&7)")("break")("}")("}"),e=0;e<t.P.length;++e){var s=t.P[e];s.required&&n("if(!m.hasOwnProperty(%j))",s.name)("throw util.ProtocolError(%j,{instance:m})","missing required '"+s.name+"'")}return n("return m")};var a=e(5),u=e(9),c=e(2)},function(t,n,e){"use strict";t.exports=function(t){var n=u.codegen(["m"],t.name+"$verify")('if(typeof m!=="object"||m===null)')("return%j","object expected"),e=t.oneofsArray,i={};e.length&&n("var p={}");for(var r=0;r<t.fieldsArray.length;++r){var o,s=t.P[r].resolve(),a="m"+u.safeProp(s.name);s.optional&&n("if(%s!=null&&m.hasOwnProperty(%j)){",a,s.name),s.map?(n("if(!util.isObject(%s))",a)("return%j",c(s,"object"))("var k=Object.keys(%s)",a)("for(var i=0;i<k.length;++i){"),function(t,n,e){switch(n.keyType){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":t("if(!util.key32Re.test(%s))",e)("return%j",c(n,"integer key"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":t("if(!util.key64Re.test(%s))",e)("return%j",c(n,"integer|Long key"));break;case"bool":t("if(!util.key2Re.test(%s))",e)("return%j",c(n,"boolean key"))}}(n,s,"k[i]"),h(n,s,r,a+"[k[i]]")("}")):s.repeated?(n("if(!Array.isArray(%s))",a)("return%j",c(s,"array"))("for(var i=0;i<%s.length;++i){",a),h(n,s,r,a+"[i]")("}")):(s.partOf&&(o=u.safeProp(s.partOf.name),1===i[s.partOf.name]&&n("if(p%s===1)",o)("return%j",s.partOf.name+": multiple values"),i[s.partOf.name]=1,n("p%s=1",o)),h(n,s,r,a)),s.optional&&n("}")}return n("return null")};var s=e(5),u=e(2);function c(t,n){return t.name+": "+n+(t.repeated&&"array"!==n?"[]":t.map&&"object"!==n?"{k:"+t.keyType+"}":"")+" expected"}function h(t,n,e,i){if(n.resolvedType)if(n.resolvedType instanceof s){t("switch(%s){",i)("default:")("return%j",c(n,"enum value"));for(var r=Object.keys(n.resolvedType.values),o=0;o<r.length;++o)t("case %i:",n.resolvedType.values[r[o]]);t("break")("}")}else t("{")("var e=types[%i].verify(%s);",e,i)("if(e)")("return%j+e",n.name+".")("}");else switch(n.type){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":t("if(!util.isInteger(%s))",i)("return%j",c(n,"integer"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":t("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))",i,i,i,i)("return%j",c(n,"integer|Long"));break;case"float":case"double":t('if(typeof %s!=="number")',i)("return%j",c(n,"number"));break;case"bool":t('if(typeof %s!=="boolean")',i)("return%j",c(n,"boolean"));break;case"string":t("if(!util.isString(%s))",i)("return%j",c(n,"string"));break;case"bytes":t('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))',i,i,i)("return%j",c(n,"buffer"))}return t}},function(t,n,e){"use strict";var l=e(5),d=e(2);function s(t,n,e,i){if(n.resolvedType)if(n.resolvedType instanceof l){t("switch(d%s){",i);for(var r=n.resolvedType.values,o=Object.keys(r),s=0;s<o.length;++s)n.repeated&&r[o[s]]===n.typeDefault&&t("default:"),t("case%j:",o[s])("case %i:",r[o[s]])("m%s=%j",i,r[o[s]])("break");t("}")}else t('if(typeof d%s!=="object")',i)("throw TypeError(%j)",n.fullName+": object expected")("m%s=types[%i].fromObject(d%s)",i,e,i);else{var a=!1;switch(n.type){case"double":case"float":t("m%s=Number(d%s)",i,i);break;case"uint32":case"fixed32":t("m%s=d%s>>>0",i,i);break;case"int32":case"sint32":case"sfixed32":t("m%s=d%s|0",i,i);break;case"uint64":a=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":t("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",i,i,a)('else if(typeof d%s==="string")',i)("m%s=parseInt(d%s,10)",i,i)('else if(typeof d%s==="number")',i)("m%s=d%s",i,i)('else if(typeof d%s==="object")',i)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",i,i,i,a?"true":"");break;case"bytes":t('if(typeof d%s==="string")',i)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",i,i,i)("else if(d%s.length)",i)("m%s=d%s",i,i);break;case"string":t("m%s=String(d%s)",i,i);break;case"bool":t("m%s=Boolean(d%s)",i,i)}}return t}function v(t,n,e,i){if(n.resolvedType)n.resolvedType instanceof l?t("d%s=o.enums===String?types[%i].values[m%s]:m%s",i,e,i,i):t("d%s=types[%i].toObject(m%s,o)",i,e,i);else{var r=!1;switch(n.type){case"double":case"float":t("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",i,i,i,i);break;case"uint64":r=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":t('if(typeof m%s==="number")',i)("d%s=o.longs===String?String(m%s):m%s",i,i,i)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",i,i,i,i,r?"true":"",i);break;case"bytes":t("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",i,i,i,i,i);break;default:t("d%s=m%s",i,i)}}return t}n.fromObject=function(t){var n=t.fieldsArray,e=d.codegen(["d"],t.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!n.length)return e("return new this.ctor");e("var m=new this.ctor");for(var i=0;i<n.length;++i){var r=n[i].resolve(),o=d.safeProp(r.name);r.map?(e("if(d%s){",o)('if(typeof d%s!=="object")',o)("throw TypeError(%j)",r.fullName+": object expected")("m%s={}",o)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){",o),s(e,r,i,o+"[ks[i]]")("}")("}")):r.repeated?(e("if(d%s){",o)("if(!Array.isArray(d%s))",o)("throw TypeError(%j)",r.fullName+": array expected")("m%s=[]",o)("for(var i=0;i<d%s.length;++i){",o),s(e,r,i,o+"[i]")("}")("}")):(r.resolvedType instanceof l||e("if(d%s!=null){",o),s(e,r,i,o),r.resolvedType instanceof l||e("}"))}return e("return m")},n.toObject=function(t){var n=t.fieldsArray.slice().sort(d.compareFieldsById);if(!n.length)return d.codegen()("return {}");for(var e=d.codegen(["m","o"],t.name+"$toObject")("if(!o)")("o={}")("var d={}"),i=[],r=[],o=[],s=0;s<n.length;++s)n[s].partOf||(n[s].resolve().repeated?i:n[s].map?r:o).push(n[s]);if(i.length){for(e("if(o.arrays||o.defaults){"),s=0;s<i.length;++s)e("d%s=[]",d.safeProp(i[s].name));e("}")}if(r.length){for(e("if(o.objects||o.defaults){"),s=0;s<r.length;++s)e("d%s={}",d.safeProp(r[s].name));e("}")}if(o.length){for(e("if(o.defaults){"),s=0;s<o.length;++s){var a,u=o[s],c=d.safeProp(u.name);u.resolvedType instanceof l?e("d%s=o.enums===String?%j:%j",c,u.resolvedType.valuesById[u.typeDefault],u.typeDefault):u.long?e("if(util.Long){")("var n=new util.Long(%i,%i,%j)",u.typeDefault.low,u.typeDefault.high,u.typeDefault.unsigned)("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n",c)("}else")("d%s=o.longs===String?%j:%i",c,u.typeDefault.toString(),u.typeDefault.toNumber()):u.bytes?(a="["+Array.prototype.slice.call(u.typeDefault).join(",")+"]",e("if(o.bytes===String)d%s=%j",c,String.fromCharCode.apply(String,u.typeDefault))("else{")("d%s=%s",c,a)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",c,c)("}")):e("d%s=%j",c,u.typeDefault)}e("}")}for(var h=!1,s=0;s<n.length;++s){var u=n[s],f=t.P.indexOf(u),c=d.safeProp(u.name);u.map?(h||(h=!0,e("var ks2")),e("if(m%s&&(ks2=Object.keys(m%s)).length){",c,c)("d%s={}",c)("for(var j=0;j<ks2.length;++j){"),v(e,u,f,c+"[ks2[j]]")("}")):u.repeated?(e("if(m%s&&m%s.length){",c,c)("d%s=[]",c)("for(var j=0;j<m%s.length;++j){",c),v(e,u,f,c+"[j]")("}")):(e("if(m%s!=null&&m.hasOwnProperty(%j)){",c,u.name),v(e,u,f,c),u.partOf&&e("if(o.oneofs)")("d%s=%j",d.safeProp(u.partOf.name),u.name)),e("}")}return e("return d")}},function(t,n,e){"use strict";var s=e(14);n[".google.protobuf.Any"]={fromObject:function(t){if(t&&t["@type"]){var n,e=t["@type"].substring(t["@type"].lastIndexOf("/")+1),e=this.lookup(e);if(e)return-1===(n="."===t["@type"].charAt(0)?t["@type"].substr(1):t["@type"]).indexOf("/")&&(n="/"+n),this.create({type_url:n,value:e.encode(e.fromObject(t)).finish()})}return this.fromObject(t)},toObject:function(t,n){var e,i,r="",o="";return!((t=n&&n.json&&t.type_url&&t.value&&(o=t.type_url.substring(t.type_url.lastIndexOf("/")+1),r=t.type_url.substring(0,t.type_url.lastIndexOf("/")+1),e=this.lookup(o))?e.decode(t.value):t)instanceof this.ctor)&&t instanceof s?(e=t.$type.toObject(t,n),i="."===t.$type.fullName[0]?t.$type.fullName.substr(1):t.$type.fullName,e["@type"]=o=(r=""===r?"type.googleapis.com/":r)+i,e):this.toObject(t,n)}}},function(t,n,e){"use strict";t.exports=u;var i,d,v,r=e(8),o=(((u.prototype=Object.create(r.prototype)).constructor=u).className="Root",e(7)),s=e(5),a=e(10),p=e(2);function u(t){r.call(this,"",t),this.deferred=[],this.files=[]}function m(){}u.fromJSON=function(t,n){return n=n||new u,t.options&&n.setOptions(t.options),n.addJSON(t.nested)},u.prototype.resolvePath=p.path.resolve,u.prototype.fetch=p.fetch,u.prototype.load=function t(n,o,r){"function"==typeof o&&(r=o,o=void 0);var s=this;if(!r)return p.asPromise(t,s,n,o);var a=r===m;function u(t,n){if(r){var e=r;if(r=null,a)throw t;e(t,n)}}function c(t){var n=t.lastIndexOf("google/protobuf/");if(-1<n){t=t.substring(n);if(t in v)return t}return null}function h(t,n){try{if(p.isString(n)&&"{"===n.charAt(0)&&(n=JSON.parse(n)),p.isString(n)){d.filename=t;var e,i=d(n,s,o),r=0;if(i.imports)for(;r<i.imports.length;++r)(e=c(i.imports[r])||s.resolvePath(t,i.imports[r]))&&f(e);if(i.weakImports)for(r=0;r<i.weakImports.length;++r)(e=c(i.weakImports[r])||s.resolvePath(t,i.weakImports[r]))&&f(e,!0)}else s.setOptions(n.options).addJSON(n.nested)}catch(t){u(t)}a||l||u(null,s)}function f(e,i){if(!(-1<s.files.indexOf(e)))if(s.files.push(e),e in v)a?h(e,v[e]):(++l,setTimeout(function(){--l,h(e,v[e])}));else if(a){var t;try{t=p.fs.readFileSync(e).toString("utf8")}catch(t){return void(i||u(t))}h(e,t)}else++l,s.fetch(e,function(t,n){--l,r&&(t?i?l||u(null,s):u(t):h(e,n))})}var l=0;p.isString(n)&&(n=[n]);for(var e,i=0;i<n.length;++i)(e=s.resolvePath("",n[i]))&&f(e);if(a)return s;l||u(null,s)},u.prototype.loadSync=function(t,n){if(p.isNode)return this.load(t,n,m);throw Error("not supported")},u.prototype.resolveAll=function(){if(this.deferred.length)throw Error("unresolvable extensions: "+this.deferred.map(function(t){return"'extend "+t.extend+"' in "+t.parent.fullName}).join(", "));return r.prototype.resolveAll.call(this)};var c=/^[A-Z]/;function h(t,n){var e,i=n.parent.lookup(n.extend);if(i)return((e=new o(n.fullName,n.id,n.type,n.rule,void 0,n.options)).declaringField=n).extensionField=e,i.add(e),1}u.prototype.A=function(t){if(t instanceof o)void 0===t.extend||t.extensionField||h(0,t)||this.deferred.push(t);else if(t instanceof s)c.test(t.name)&&(t.parent[t.name]=t.values);else if(!(t instanceof a)){if(t instanceof i)for(var n=0;n<this.deferred.length;)h(0,this.deferred[n])?this.deferred.splice(n,1):++n;for(var e=0;e<t.nestedArray.length;++e)this.A(t.L[e]);c.test(t.name)&&(t.parent[t.name]=t)}},u.prototype.M=function(t){var n;if(t instanceof o)void 0!==t.extend&&(t.extensionField?(t.extensionField.parent.remove(t.extensionField),t.extensionField=null):-1<(n=this.deferred.indexOf(t))&&this.deferred.splice(n,1));else if(t instanceof s)c.test(t.name)&&delete t.parent[t.name];else if(t instanceof r){for(var e=0;e<t.nestedArray.length;++e)this.M(t.L[e]);c.test(t.name)&&delete t.parent[t.name]}},u.T=function(t,n,e){i=t,d=n,v=e}},function(t,n,e){var i;function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}i=function(t){"use strict";function n(t){return 180*t/Math.PI}function d(t){return n(Math.atan2(t[1][1]-t[0][1],t[1][0]-t[0][0]))}function l(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){var e=[],i=!0,r=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(i=(s=a.next()).done)&&(e.push(s.value),!n||e.length!==n);i=!0);}catch(t){r=!0,o=t}finally{try{i||null==a.return||a.return()}finally{if(r)throw o}}return e}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function i(t){return function(t){if(Array.isArray(t)){for(var n=0,e=new Array(t.length);n<t.length;n++)e[n]=t[n];return e}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function v(t){var n=1<arguments.length&&void 0!==arguments[1]&&arguments[1],t=l(t,2),e=l(t[0],2),i=e[0],r=e[1],e=l(t[1],2),o=e[0],s=e[1];return function(t){t=n?t<0?0:1<t?1:t:t;return[(o-i)*t+i,(s-r)*t+r]}}function p(t){return Math.sqrt(Math.pow(t[1][0]-t[0][0],2)+Math.pow(t[1][1]-t[0][1],2))}function r(t){return[(t[0][0]+t[1][0])/2,(t[0][1]+t[1][1])/2]}function o(t){return t/180*Math.PI}function s(t,n,e){n=o(n||0);return!e||0===e[0]&&0===e[1]?a(t,n):a(t.map(function(t,n){return t-e[n]}),n).map(function(t,n){return t+e[n]})}function a(t,n){return[t[0]*Math.cos(n)-t[1]*Math.sin(n),t[0]*Math.sin(n)+t[1]*Math.cos(n)]}function f(t){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,e=2<arguments.length&&void 0!==arguments[2]?arguments[2]:0,n=o(n);return[t[0]+e*Math.cos(n),t[1]+e*Math.sin(n)]}function m(t){for(var n=1<arguments.length&&void 0!==arguments[1]&&arguments[1],e=0,i=0,r=t.length;i<r;i++)var o=t[i],s=t[i===r-1?0:i+1],e=(e+=o[0]*s[1])-s[0]*o[1];return n?e/2:Math.abs(e/2)}function y(t){if(t.length<3)return null;for(var n=1/0,e=-1/0,i=1/0,r=-1/0,o=!1,s=0,a=t.length;s<a;s++){var u=t[s],c=u[0],u=u[1];null!=c&&isFinite(c)&&null!=u&&isFinite(u)&&(o=!0,c<n&&(n=c),e<c&&(e=c),u<i&&(i=u),r<u)&&(r=u)}return o?[[n,i],[e,r]]:null}function b(t){for(var n=0,e=0,i=0,r=t.length,o=0;o<r;o++){var s=t[o],a=t[o===r-1?0:o+1],u=s[0]*a[1]-a[0]*s[1];n+=u,e+=(s[0]+a[0])*u,i+=(s[1]+a[1])*u}var c=3*n;return[e/c,i/c]}function u(t,n,e){return(t[0]-e[0])*(n[1]-e[1])-(t[1]-e[1])*(n[0]-e[0])}function g(t){return e=(n=t)[0],n=n[n.length-1],e[0]===n[0]&&e[1]===n[1]?t:[].concat(i(t),[t[0]]);var n,e}function _(t){if(0===t.length)return 0;for(var n,e,i=-1,r=t.length,o=t[r-1],s=o[0],a=o[1],u=0;++i<r;)n=s,e=a,n-=s=(o=t[i])[0],e-=a=o[1],u+=Math.sqrt(n*n+e*e);return u}function w(t,n,e){e=e||b(t);for(var i=[],r=0,o=t.length;r<o;r++){var s=t[r],a=p([e,s]),s=d([e,s]);i[r]=f(e,s,a*Math.sqrt(n))}return i}function x(t,n,e){for(var i=[],r=0,o=t.length;r<o;r++)i[r]=f(t[r],n,e);return i}function E(t,n,e){for(var i=n,r=n,o=[],s=1;s<t.length-1;s++){var a=t[s];.5<Math.random()?(o.push(a-i),i=a):(o.push(r-a),r=a)}return o.push(e-i),o.push(r-e),o}function e(t){return t[1][1]>t[0][1]?t:[t[1],t[0]]}function h(t,n){var e=2<arguments.length&&void 0!==arguments[2]?arguments[2]:0,i=p(n);return c(t,n,e)&&p([n[0],t])<=i&&p([n[1],t])<=i}function c(t,n){var e=2<arguments.length&&void 0!==arguments[2]?arguments[2]:0;return Math.abs(u(t,n[0],n[1]))<=e}function S(t,n){var e=l(t,2),i=l(e[0],2),r=i[0],i=i[1],e=l(e[1],2),o=e[0],e=e[1],s=l(n,2),a=l(s[0],2),u=a[0],a=a[1],s=l(s[1],2),c=s[0],s=s[1];return r===u&&i===a||o===c&&e===s||!!(h(t[0],n)||h(t[1],n)||h(n[0],t)||h(n[1],t))||0!=(n=(s-a)*(o-r)-(c-u)*(e-i))&&(e=((o-r)*(t=i-a)-(e-i)*(o=r-u))/n,0<(i=((c-u)*t-(s-a)*o)/n))&&i<1&&0<e&&e<1}function T(t,n){for(var e=!1,i=g(n),r=0,o=i.length-1;r<o;r++){var s=i[r],a=i[r+1];if(S(t,[s,a])||h(s,t)&&h(a,t)){e=!0;break}}return e}function A(t,n){for(var e=t[0],i=t[1],r=!1,o=0,s=n.length-1;o<n.length;s=o++){var a=n[o][0],u=n[o][1],c=n[s][0],h=n[s][1];i<u!=i<h&&e<(c-a)*(i-u)/(h-u)+a&&(r=!r)}return r}function M(t,n){for(var e=2<arguments.length&&void 0!==arguments[2]?arguments[2]:0,i=!1,r=g(n),o=0,s=r.length-1;o<s;o++)if(h(t,[r[o],r[o+1]],e)){i=!0;break}return i}t.lineAngle=d,t.lineInterpolate=v,t.lineLength=p,t.lineMidpoint=r,t.lineRotate=function(n,e,i){return n.map(function(t){return s(t,e,i||r(n))})},t.lineTranslate=function(t,n,e){return t.map(function(t){return f(t,n,e)})},t.pointRotate=s,t.pointTranslate=f,t.polygonArea=m,t.polygonBounds=y,t.polygonCentroid=b,t.polygonHull=function(t){if(t.length<3)return null;for(var n=t.slice().sort(function(t,n){return t[0]===n[0]?t[1]-n[1]:t[0]-n[0]}),e=[],i=0;i<n.length;i++){for(;2<=e.length&&u(e[e.length-2],e[e.length-1],n[i])<=0;)e.pop();e.push(n[i])}for(var r=[],o=n.length-1;0<=o;o--){for(;2<=r.length&&u(r[r.length-2],r[r.length-1],n[o])<=0;)r.pop();r.push(n[o])}return r.pop(),e.pop(),e.concat(r)},t.polygonInterpolate=function(h){return function(t){if(t<=0)return h[0];var n=g(h);if(1<=t)return n[n.length-1];for(var e=_(n)*t,i=[],r=0,o=0;o<n.length-1;o++){var s=[n[o],n[o+1]],a=p(s),u=d(s),c=e-(r+=a);if(c<0){i=f(s[0],u,a+c);break}o===h.length-2&&(i=f(s[0],u,c))}return i}},t.polygonLength=_,t.polygonMean=function(t){for(var n=0,e=0,i=t.length,r=0;r<i;r++){var o=t[r];n+=o[0],e+=o[1]}return[n/i,e/i]},t.polygonRandom=function(){for(var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:3,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:100,e=2<arguments.length&&void 0!==arguments[2]?arguments[2]:[0,0],i=Math.sqrt(n/Math.PI),r=Array.from({length:t},function(){return 2*i*Math.random()}),t=Array.from({length:t},function(){return 2*i*Math.random()}),r=(r.sort(function(t,n){return t-n}),t.sort(function(t,n){return t-n}),E(r,r[0],r[r.length-1])),o=E(t,t[0],t[t.length-1]),s=o,a=s.length-1;0<a;a--){var u=Math.floor(Math.random()*(a+1)),c=[s[u],s[a]];s[a]=c[0],s[u]=c[1]}var h=[],f=0,l=0,t=(r.map(function(t,n){return[t,o[n]]}).sort(function(t,n){return Math.atan2(n[1],n[0])-Math.atan2(t[1],t[0])}).forEach(function(t){f+=+t[0],l+=+t[1],h.push([f,l])}),b(h));return x(w(h,n/m(h)),d([t,e]),p([t,e]))},t.polygonReflectX=function(t){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1,e=l(y(t),2),i=l(e[0],2),r=i[0];i[1];for(var o=(i=l(e[1],2))[0],s=(i[1],[]),a=0,u=t.length;a<u;a++){var c=l(t[a],2),h=c[0],c=c[1],f=[r+o-h,c];0===n?s[a]=[h,c]:1===n?s[a]=f:(h=v([[h,c],f]),s[a]=h(Math.max(Math.min(n,1),0)))}return s},t.polygonReflectY=function(t){for(var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1,e=l(y(t),2),i=l(e[0],2),r=(i[0],i[1]),o=((i=l(e[1],2))[0],i[1]),s=[],a=0,u=t.length;a<u;a++){var c=l(t[a],2),h=c[0],c=c[1],f=[h,r+o-c];0===n?s[a]=[h,c]:1===n?s[a]=f:(h=v([[h,c],f]),s[a]=h(Math.max(Math.min(n,1),0)))}return s},t.polygonRegular=function(){for(var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:3,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:100,e=2<arguments.length?arguments[2]:void 0,i=[],r=[0,0],o=[0,0],s=0,a=0;a<t;a++)i[a]=r,o[0]+=r[0],o[1]+=r[1],r=f(r,s,Math.sqrt(4*n*Math.tan(Math.PI/t)/t)),s-=360/t;return i=e?x(i,d(e=[[o[0]/t,o[1]/t],e]),p(e)):i},t.polygonRotate=function(t,n,e){for(var i=[],r=0,o=t.length;r<o;r++)i[r]=s(t[r],n,e);return i},t.polygonScale=function(t,n,e){e=e||b(t);for(var i=[],r=0,o=t.length;r<o;r++){var s=t[r],a=p([e,s]),s=d([e,s]);i[r]=f(e,s,a*n)}return i},t.polygonScaleArea=w,t.polygonScaleX=function(t,n,e){e=e||b(t);for(var i=[],r=0,o=t.length;r<o;r++){var s=t[r],a=p([e,s]),a=f(e,d([e,s]),a*n);i[r]=[a[0],s[1]]}return i},t.polygonScaleY=function(t,n,e){e=e||b(t);for(var i=[],r=0,o=t.length;r<o;r++){var s=t[r],a=p([e,s]),a=f(e,d([e,s]),a*n);i[r]=[s[0],a[1]]}return i},t.polygonTranslate=x,t.polygonWind=function(t){var n,e,i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"ccw";return t.length<3?null:(n=t.slice().reverse(),e=0<m(t,!0),"cw"===i||"clockwise"===i?e?t:n:e?n:t)},t.lineIntersectsLine=S,t.lineIntersectsPolygon=T,t.pointInPolygon=A,t.pointOnPolygon=M,t.pointLeftofLine=function(t,n){return n=e(n),u(t,n[1],n[0])<0},t.pointRightofLine=function(t,n){return n=e(n),0<u(t,n[1],n[0])},t.pointOnLine=h,t.pointWithLine=c,t.polygonInPolygon=function(t,n){for(var e=!0,i=g(t),r=0,o=i.length-1;r<o;r++){var s=i[r];if(!A(s,n)){e=!1;break}if(T([s,i[r+1]],n)){e=!1;break}}return e},t.polygonIntersectsPolygon=function(t,n){for(var e=!1,i=0,r=g(t),o=0,s=r.length-1;o<s;o++){var a=r[o];if(T([a,r[o+1]],n)){e=!0;break}if(M(a,n)&&++i,2===i){e=!0;break}}return e},t.angleReflect=function(t,n){return 360<=(n=2*n-t)?n-360:n<0?360+n:n},t.angleToDegrees=n,t.angleToRadians=o,Object.defineProperty(t,"u",{value:!0})},"object"===r(n)&&void 0!==t?i(n):void 0!==(n="function"==typeof(i=i)?i.apply(n,[n]):i)&&(t.exports=n)},function(t,n,e){"use strict";t.exports=e(34)},function(t,n,e){var i;i=function(){var c,r={defaultRadius:40,defaultRenderer:"canvas2d",defaultGradient:{.25:"rgb(0,0,255)",.55:"rgb(0,255,0)",.85:"yellow",1:"rgb(255,0,0)"},defaultMaxOpacity:1,defaultMinOpacity:0,defaultBlur:.85,defaultXField:"x",defaultYField:"y",defaultValueField:"value",plugins:{}},o=(c=r.defaultRadius,t.prototype={D:function(t,n){var e=t[this.k],i=t[this.U],r=this.B,o=this.G,s=this.H,a=this.X,u=t[this.V]||1,t=t.radius||this.W||c,r=(o[e]||(o[e]=[],r[e]=[]),o[e][i]?o[e][i]+=u:(o[e][i]=u,r[e][i]=t),o[e][i]);return s<r?(n?this.setDataMax(r):this.H=r,!1):r<a?(n?this.setDataMin(r):this.X=r,!1):{x:e,y:i,value:u,radius:t,min:a,max:s}},Y:function(){var t,n=[],e=this.G,i=this.B;for(t in e)for(var r in e[t])n.push({x:t,y:r,radius:i[t][r],value:e[t][r]});return{min:this.X,max:this.H,data:n}},Z:function(){this.K.emit("extremachange",{min:this.X,max:this.H})},addData:function(){if(0<arguments[0].length)for(var t=arguments[0],n=t.length;n--;)this.addData.call(this,t[n]);else{var e=this.D(arguments[0],!0);e&&(0===this.G.length&&(this.X=this.H=e.value),this.K.emit("renderpartial",{min:this.X,max:this.H,data:[e]}))}return this},setData:function(t){var n=t.data,e=n.length;this.G=[],this.B=[];for(var i=0;i<e;i++)this.D(n[i],!1);return this.H=t.max,this.X=t.min||0,this.Z(),this.K.emit("renderall",this.J()),this},removeData:function(){},setDataMax:function(t){return this.H=t,this.Z(),this.K.emit("renderall",this.J()),this},setDataMin:function(t){return this.X=t,this.Z(),this.K.emit("renderall",this.J()),this},setCoordinator:function(t){this.K=t},J:function(){return{max:this.H,min:this.X,data:this.G,radi:this.B}},getData:function(){return this.Y()}},t);function t(t){this.K={},this.G=[],this.B=[],this.X=10,this.H=1,this.k=t.xField||t.defaultXField,this.U=t.yField||t.defaultYField,this.V=t.valueField||t.defaultValueField,t.radius&&(this.W=t.radius)}function i(t){var n,e=t.gradient||t.defaultGradient,i=(t=document.createElement("canvas")).getContext("2d"),r=(t.width=256,t.height=1,i.createLinearGradient(0,0,256,1));for(n in e)r.addColorStop(n,e[n]);return i.fillStyle=r,i.fillRect(0,0,256,1),i.getImageData(0,0,256,1).data}function n(t){var n=this.shadowCanvas=document.createElement("canvas"),e=this.canvas=t.canvas;this.$=[1e4,1e4,0,0];n.width=e.width,n.height=e.height,this.tt=e.width,this.nt=e.height,this.shadowCtx=n.getContext("2d"),this.ctx=e.getContext("2d"),this.et=i(t),this.it={},this.rt(t)}e=!(n.prototype={renderPartial:function(t){0<t.data.length&&(this.ot(t),this.st())},renderAll:function(t){this.ut(),0<t.data.length&&(this.ot(function(t){for(var n=[],e=t.min,i=t.max,r=t.radi,t=t.data,o=Object.keys(t),s=o.length;s--;)for(var a=o[s],u=Object.keys(t[a]),c=u.length;c--;){var h=u[c],f=t[a][h],l=r[a][h];n.push({x:a,y:h,value:f,radius:l})}return{min:e,max:i,data:n}}(t)),this.st())},ct:function(t){this.et=i(t)},updateConfig:function(t){t.gradient&&this.ct(t),this.rt(t)},setDimensions:function(t,n){this.tt=t,this.nt=n,this.canvas.width=this.shadowCanvas.width=t,this.canvas.height=this.shadowCanvas.height=n},ut:function(){this.shadowCtx.clearRect(0,0,this.tt,this.nt),this.ctx.clearRect(0,0,this.tt,this.nt)},rt:function(t){this.ht=0==t.blur?0:t.blur||t.defaultBlur,t.backgroundColor&&(this.canvas.style.backgroundColor=t.backgroundColor),this.tt=this.canvas.width=this.shadowCanvas.width=t.width||this.tt,this.nt=this.canvas.height=this.shadowCanvas.height=t.height||this.nt,this.ft=255*(t.opacity||0),this.lt=255*(t.maxOpacity||t.defaultMaxOpacity),this.dt=255*(t.minOpacity||t.defaultMinOpacity),this.vt=!!t.useGradientOpacity},ot:function(t){for(var n,e,i,r,o,s=this.X=t.min,a=this.H=t.max,u=(t=t.data||[]).length,c=1-this.ht;u--;){var h,f=t[u],l=f.x,d=f.y,v=f.radius,f=Math.min(f.value,a),l=l-v,d=d-v,p=this.shadowCtx,m=(this.it[v]?h=this.it[v]:this.it[v]=(n=v,e=c,o=m=r=i=void 0,i=document.createElement("canvas"),r=i.getContext("2d"),o=m=n,i.width=i.height=2*n,1==e?(r.beginPath(),r.arc(m,o,n,0,2*Math.PI,!1),r.fillStyle="rgba(0,0,0,1)",r.fill()):((e=r.createRadialGradient(m,o,n*e,m,o,n)).addColorStop(0,"rgba(0,0,0,1)"),e.addColorStop(1,"rgba(0,0,0,0)"),r.fillStyle=e,r.fillRect(0,0,2*n,2*n)),h=i),(f-s)/(a-s));p.globalAlpha=m<.01?.01:m,p.drawImage(h,l,d),l<this.$[0]&&(this.$[0]=l),d<this.$[1]&&(this.$[1]=d),l+2*v>this.$[2]&&(this.$[2]=l+2*v),d+2*v>this.$[3]&&(this.$[3]=d+2*v)}},st:function(){for(var t=this.$[0],n=this.$[1],e=this.$[2]-t,i=this.$[3]-n,r=this.tt,o=this.nt,s=this.ft,a=this.lt,u=this.dt,c=this.vt,r=this.shadowCtx.getImageData(t=t<0?0:t,n=n<0?0:n,e=r<t+e?r-t:e,i=o<n+i?o-n:i),h=r.data,f=h.length,l=this.et,d=3;d<f;d+=4){var v=h[d],p=4*v;p&&(v=0<s?s:v<a?v<u?u:v:a,h[d-3]=l[p],h[d-2]=l[1+p],h[d-1]=l[2+p],h[d]=c?l[3+p]:v)}r.data=h,this.ctx.putImageData(r,t,n),this.$=[1e3,1e3,0,0]},getValueAt:function(t){var t=this.shadowCtx.getImageData(t.x,t.y,1,1).data[3],n=this.H,e=this.X;return Math.abs(n-e)*(t/255)>>0},getDataURL:function(){return this.canvas.toDataURL()}});var e,s,a=e="canvas2d"===r.defaultRenderer?n:e,u=function(){for(var t={},n=arguments.length,e=0;e<n;e++){var i,r=arguments[e];for(i in r)t[i]=r[i]}return t},h=(f.prototype={on:function(t,n,e){var i=this.cStore;i[t]||(i[t]=[]),i[t].push(function(t){return n.call(e,t)})},emit:function(t,n){var e=this.cStore;if(e[t])for(var i=e[t].length,r=0;r<i;r++)(0,e[t][r])(n)}},s=f,l.prototype={addData:function(){return this.yt.addData.apply(this.yt,arguments),this},removeData:function(){return this.yt.removeData&&this.yt.removeData.apply(this.yt,arguments),this},setData:function(){return this.yt.setData.apply(this.yt,arguments),this},setDataMax:function(){return this.yt.setDataMax.apply(this.yt,arguments),this},setDataMin:function(){return this.yt.setDataMin.apply(this.yt,arguments),this},configure:function(t){return this.bt=u(this.bt,t),this.gt.updateConfig(this.bt),this.K.emit("renderall",this.yt.J()),this},repaint:function(){return this.K.emit("renderall",this.yt.J()),this},getData:function(){return this.yt.getData()},getDataURL:function(){return this.gt.getDataURL()},getValueAt:function(t){return this.yt.getValueAt?this.yt.getValueAt(t):this.gt.getValueAt?this.gt.getValueAt(t):null}},l);function f(){this.cStore={}}function l(){var n,t,e=this.bt=u(r,arguments[0]||{});if(this.K=new s,e.plugin){var i=e.plugin;if(!r.plugins[i])throw new Error("Plugin '"+i+"' not found. Maybe it was not registered.");var i=r.plugins[i];this.gt=new i.renderer(e),this.yt=new i.store(e)}else this.gt=new a(e),this.yt=new o(e);i=(n=this).gt,e=n.K,t=n.yt,e.on("renderpartial",i.renderPartial,i),e.on("renderall",i.renderAll,i),e.on("extremachange",function(t){n.bt.onExtremaChange&&n.bt.onExtremaChange({min:t.min,max:t.max,gradient:n.bt.gradient||n.bt.defaultGradient})}),t.setCoordinator(e)}return{create:function(t){return new h(t)},register:function(t,n){r.plugins[t]=n}}},t.exports?t.exports=i():void 0!==(e="function"==typeof(i=i)?i.call(n,e,n,t):i)&&(t.exports=e)},function(t,n,e){var i;i=function(){var c,r={defaultRadius:40,defaultRenderer:"canvas2d",defaultGradient:{.25:"rgb(0,0,255)",.55:"rgb(0,255,0)",.85:"yellow",1:"rgb(255,0,0)"},defaultMaxOpacity:1,defaultMinOpacity:0,defaultBlur:.85,defaultXField:"x",defaultYField:"y",defaultValueField:"value",plugins:{}},o=(c=r.defaultRadius,t.prototype={D:function(t,n){var e=t[this.k],i=t[this.U],r=this.B,o=this.G,s=this.H,a=this.X,u=t[this.V]||1,t=t.radius||this.W||c,r=(o[e]||(o[e]=[],r[e]=[]),o[e][i]?o[e][i]+=u:(o[e][i]=u,r[e][i]=t),o[e][i]);return s<r?(n?this.setDataMax(r):this.H=r,!1):r<a?(n?this.setDataMin(r):this.X=r,!1):{x:e,y:i,value:u,radius:t,min:a,max:s}},Y:function(){var t,n=[],e=this.G,i=this.B;for(t in e)for(var r in e[t])n.push({x:t,y:r,radius:i[t][r],value:e[t][r]});return{min:this.X,max:this.H,data:n}},Z:function(){this.K.emit("extremachange",{min:this.X,max:this.H})},addData:function(){if(0<arguments[0].length)for(var t=arguments[0],n=t.length;n--;)this.addData.call(this,t[n]);else{var e=this.D(arguments[0],!0);e&&(0===this.G.length&&(this.X=this.H=e.value),this.K.emit("renderpartial",{min:this.X,max:this.H,data:[e]}))}return this},setData:function(t){var n=t.data,e=n.length;this.G=[],this.B=[];for(var i=0;i<e;i++)this.D(n[i],!1);return this.H=t.max,this.X=t.min||0,this.Z(),this.K.emit("renderall",this.J()),this},removeData:function(){},setDataMax:function(t){return this.H=t,this.Z(),this.K.emit("renderall",this.J()),this},setDataMin:function(t){return this.X=t,this.Z(),this.K.emit("renderall",this.J()),this},setCoordinator:function(t){this.K=t},J:function(){return{max:this.H,min:this.X,data:this.G,radi:this.B}},getData:function(){return this.Y()}},t);function t(t){this.K={},this.G=[],this.B=[],this.X=10,this.H=1,this.k=t.xField||t.defaultXField,this.U=t.yField||t.defaultYField,this.V=t.valueField||t.defaultValueField,t.radius&&(this.W=t.radius)}function i(t){var n,e=t.gradient||t.defaultGradient,i=(t=t.canvas).getContext("2d"),r=(t.width=256,t.height=1,i.createLinearGradient(0,0,256,1));for(n in e)r.addColorStop(n,e[n]);return i.fillStyle=r,i.fillRect(0,0,256,1),i.getImageData(0,0,256,1).data}function n(t){var n=this.shadowCanvas=t.canvas,e=this.canvas=t.canvas;this.$=[1e4,1e4,0,0];n.width=e.width,n.height=e.height,this.tt=e.width,this.nt=e.height,this.ctx=e.getContext("2d"),this.shadowCtx=n.getContext("2d"),this.et=i(t),this.it={},this.rt(t)}e=!(n.prototype={renderPartial:function(t){0<t.data.length&&(this.ot(t),this.st())},renderAll:function(t){var n;this.ut(),0<(null==t||null==(n=t.data)?void 0:n.length)&&(this.ot(function(t){for(var n=[],e=t.min,i=t.max,r=t.radi,t=t.data,o=Object.keys(t),s=o.length;s--;)for(var a=o[s],u=Object.keys(t[a]),c=u.length;c--;){var h=u[c],f=t[a][h],l=r[a][h];n.push({x:a,y:h,value:f,radius:l})}return{min:e,max:i,data:n}}(t)),this.st())},ct:function(t){this.et=i(t)},updateConfig:function(t){t.gradient&&this.ct(t),this.rt(t)},setDimensions:function(t,n){this.tt=t,this.nt=n,this.canvas.width=this.shadowCanvas.width=t,this.canvas.height=this.shadowCanvas.height=n},ut:function(){this.shadowCtx.clearRect(0,0,this.tt,this.nt),this.ctx.clearRect(0,0,this.tt,this.nt)},rt:function(t){this.ht=0==t.blur?0:t.blur||t.defaultBlur,t.backgroundColor&&(this.canvas.style.backgroundColor=t.backgroundColor),this.tt=this.canvas.width=this.shadowCanvas.width=t.width||this.tt,this.nt=this.canvas.height=this.shadowCanvas.height=t.height||this.nt,this.ft=255*(t.opacity||0),this.lt=255*(t.maxOpacity||t.defaultMaxOpacity),this.dt=255*(t.minOpacity||t.defaultMinOpacity),this.vt=!!t.useGradientOpacity},ot:function(t){for(var n,e,i,r,o,s,a=this.X=t.min,u=this.H=t.max,c=(t=t.data||[]).length,h=1-this.ht;c--;){var f=t[c],l=f.x,d=f.y,v=f.radius,f=Math.min(f.value,u),l=l-v,d=d-v,f=(f-a)/(u-a);this.ctx.globalAlpha=f<.01?.01:f,f=this.ctx,i=l,r=d,s=o=void 0,s=o=n=v,1==(e=h)?(f.beginPath(),f.arc(i,r,n,0,2*Math.PI,!1),f.fillStyle="rgba(0,0,0,1)",f.fill()):((e=f.createRadialGradient(i+o,r+s,n*e,i+o,r+s,n)).addColorStop(0,"rgba(0,0,0,1)"),e.addColorStop(1,"rgba(0,0,0,0)"),f.fillStyle=e,f.fillRect(i,r,2*n,2*n)),l<this.$[0]&&(this.$[0]=l),d<this.$[1]&&(this.$[1]=d),l+2*v>this.$[2]&&(this.$[2]=l+2*v),d+2*v>this.$[3]&&(this.$[3]=d+2*v)}},st:function(){for(var t=this.$[0],n=this.$[1],e=this.$[2]-t,i=this.$[3]-n,r=this.tt,o=this.nt,s=this.ft,a=this.lt,u=this.dt,c=this.vt,r=this.shadowCtx.getImageData(t=t<0?0:t,n=n<0?0:n,e=r<t+e?r-t:e,i=o<n+i?o-n:i),h=r.data,f=h.length,l=this.et,d=3;d<f;d+=4){var v=h[d],p=4*v;p&&(v=0<s?s:v<a?v<u?u:v:a,h[d-3]=l[p],h[d-2]=l[1+p],h[d-1]=l[2+p],h[d]=c?l[3+p]:v)}this.ctx.putImageData(r,t,n),this.$=[1e3,1e3,0,0]},getValueAt:function(t){var t=this.shadowCtx.getImageData(t.x,t.y,1,1).data[3],n=this.H,e=this.X;return Math.abs(n-e)*(t/255)>>0},getDataURL:function(){return this.canvas.toDataURL()}});var e,s,a=e="canvas2d"===r.defaultRenderer?n:e,u=function(){for(var t={},n=arguments.length,e=0;e<n;e++){var i,r=arguments[e];for(i in r)t[i]=r[i]}return t},h=(f.prototype={on:function(t,n,e){var i=this.cStore;i[t]||(i[t]=[]),i[t].push(function(t){return n.call(e,t)})},emit:function(t,n){var e=this.cStore;if(e[t])for(var i=e[t].length,r=0;r<i;r++)(0,e[t][r])(n)}},s=f,l.prototype={addData:function(){return this.yt.addData.apply(this.yt,arguments),this},removeData:function(){return this.yt.removeData&&this.yt.removeData.apply(this.yt,arguments),this},setData:function(){return this.yt.setData.apply(this.yt,arguments),this},setDataMax:function(){return this.yt.setDataMax.apply(this.yt,arguments),this},setDataMin:function(){return this.yt.setDataMin.apply(this.yt,arguments),this},configure:function(t){return this.bt=u(this.bt,t),this.gt.updateConfig(this.bt),this.K.emit("renderall",this.yt.J()),this},repaint:function(){return this.K.emit("renderall",this.yt.J()),this},getData:function(){return this.yt.getData()},getDataURL:function(){return this.gt.getDataURL()},getValueAt:function(t){return this.yt.getValueAt?this.yt.getValueAt(t):this.gt.getValueAt?this.gt.getValueAt(t):null}},l);function f(){this.cStore={}}function l(){var n,t,e=this.bt=u(r,arguments[0]||{});if(this.K=new s,e.plugin){var i=e.plugin;if(!r.plugins[i])throw new Error("Plugin '"+i+"' not found. Maybe it was not registered.");var i=r.plugins[i];this.gt=new i.renderer(e),this.yt=new i.store(e)}else this.gt=new a(e),this.yt=new o(e);i=(n=this).gt,e=n.K,t=n.yt,e.on("renderpartial",i.renderPartial,i),e.on("renderall",i.renderAll,i),e.on("extremachange",function(t){n.bt.onExtremaChange&&n.bt.onExtremaChange({min:t.min,max:t.max,gradient:n.bt.gradient||n.bt.defaultGradient})}),t.setCoordinator(e)}return{create:function(t){return new h(t)},register:function(t,n){r.plugins[t]=n}}},t.exports?t.exports=i():void 0!==(e="function"==typeof(i=i)?i.call(n,e,n,t):i)&&(t.exports=e)},function(t,n,e){"use strict";var i=t.exports=e(35);i.build="light",i.load=function(t,n,e){return(n="function"==typeof n?(e=n,new i.Root):n||new i.Root).load(t,e)},i.loadSync=function(t,n){return(n=n||new i.Root).loadSync(t)},i.encoder=e(20),i.decoder=e(25),i.verifier=e(26),i.converter=e(27),i.ReflectionObject=e(6),i.Namespace=e(8),i.Root=e(29),i.Enum=e(5),i.Type=e(21),i.Field=e(7),i.OneOf=e(10),i.MapField=e(22),i.Service=e(23),i.Method=e(24),i.Message=e(14),i.wrappers=e(28),i.types=e(9),i.util=e(2),i.ReflectionObject.T(i.Root),i.Namespace.T(i.Type,i.Service,i.Enum),i.Root.T(i.Type),i.Field.T(i.Type)},function(t,n,e){"use strict";var i=n;function r(){i.util.T(),i.Writer.T(i.BufferWriter),i.Reader.T(i.BufferReader)}i.build="minimal",i.Writer=e(12),i.BufferWriter=e(42),i.Reader=e(13),i.BufferReader=e(43),i.util=e(4),i.rpc=e(18),i.roots=e(19),i.configure=r,r()},function(t,n,e){"use strict";n.length=function(t){var n=t.length;if(!n)return 0;for(var e=0;1<--n%4&&"="===t.charAt(n);)++e;return Math.ceil(3*t.length)/4-e};for(var c=new Array(64),u=new Array(123),i=0;i<64;)u[c[i]=i<26?i+65:i<52?i+71:i<62?i-4:i-59|43]=i++;n.encode=function(t,n,e){for(var i,r=null,o=[],s=0,a=0;n<e;){var u=t[n++];switch(a){case 0:o[s++]=c[u>>2],i=(3&u)<<4,a=1;break;case 1:o[s++]=c[i|u>>4],i=(15&u)<<2,a=2;break;case 2:o[s++]=c[i|u>>6],o[s++]=c[63&u],a=0}8191<s&&((r=r||[]).push(String.fromCharCode.apply(String,o)),s=0)}return a&&(o[s++]=c[i],o[s++]=61,1===a)&&(o[s++]=61),r?(s&&r.push(String.fromCharCode.apply(String,o.slice(0,s))),r.join("")):String.fromCharCode.apply(String,o.slice(0,s))};var h="invalid encoding";n.decode=function(t,n,e){for(var i,r=e,o=0,s=0;s<t.length;){var a=t.charCodeAt(s++);if(61===a&&1<o)break;if(void 0===(a=u[a]))throw Error(h);switch(o){case 0:i=a,o=1;break;case 1:n[e++]=i<<2|(48&a)>>4,i=a,o=2;break;case 2:n[e++]=(15&i)<<4|(60&a)>>2,i=a,o=3;break;case 3:n[e++]=(3&i)<<6|a,o=0}}if(1===o)throw Error(h);return e-r},n.test=function(t){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)}},function(t,n,e){"use strict";function i(){this._t={}}(t.exports=i).prototype.on=function(t,n,e){return(this._t[t]||(this._t[t]=[])).push({fn:n,ctx:e||this}),this},i.prototype.off=function(t,n){if(void 0===t)this._t={};else if(void 0===n)this._t[t]=[];else for(var e=this._t[t],i=0;i<e.length;)e[i].fn===n?e.splice(i,1):++i;return this},i.prototype.emit=function(t){var n=this._t[t];if(n){for(var e=[],i=1;i<arguments.length;)e.push(arguments[i++]);for(i=0;i<n.length;)n[i].fn.apply(n[i++].ctx,e)}return this}},function(t,n,e){"use strict";function i(t){function n(t,n,e,i){var r=n<0?1:0;0===(n=r?-n:n)?t(0<1/n?0:2147483648,e,i):isNaN(n)?t(2143289344,e,i):t(34028234663852886e22<n?(r<<31|2139095040)>>>0:n<11754943508222875e-54?(r<<31|Math.round(n/1401298464324817e-60))>>>0:(r<<31|(t=Math.floor(Math.log(n)/Math.LN2))+127<<23|8388607&Math.round(n*Math.pow(2,-t)*8388608))>>>0,e,i)}function e(t,n,e){t=t(n,e),n=2*(t>>31)+1,e=t>>>23&255,t&=8388607;return 255==e?t?NaN:1/0*n:0==e?1401298464324817e-60*n*t:n*Math.pow(2,e-150)*(8388608+t)}function i(t,n,e){a[0]=t,n[e]=u[0],n[e+1]=u[1],n[e+2]=u[2],n[e+3]=u[3]}function r(t,n,e){a[0]=t,n[e]=u[3],n[e+1]=u[2],n[e+2]=u[1],n[e+3]=u[0]}function o(t,n){return u[0]=t[n],u[1]=t[n+1],u[2]=t[n+2],u[3]=t[n+3],a[0]}function s(t,n){return u[3]=t[n],u[2]=t[n+1],u[1]=t[n+2],u[0]=t[n+3],a[0]}var a,u,c,h,f;function l(t,n,e,i,r,o){var s,a,u=i<0?1:0;0===(i=u?-i:i)?(t(0,r,o+n),t(0<1/i?0:2147483648,r,o+e)):isNaN(i)?(t(0,r,o+n),t(2146959360,r,o+e)):17976931348623157e292<i?(t(0,r,o+n),t((u<<31|2146435072)>>>0,r,o+e)):i<22250738585072014e-324?(t((s=i/5e-324)>>>0,r,o+n),t((u<<31|s/4294967296)>>>0,r,o+e)):(1024===(a=Math.floor(Math.log(i)/Math.LN2))&&(a=1023),t(4503599627370496*(s=i*Math.pow(2,-a))>>>0,r,o+n),t((u<<31|a+1023<<20|1048576*s&1048575)>>>0,r,o+e))}function d(t,n,e,i,r){n=t(i,r+n),t=t(i,r+e),i=2*(t>>31)+1,r=t>>>20&2047,e=4294967296*(1048575&t)+n;return 2047==r?e?NaN:1/0*i:0==r?5e-324*i*e:i*Math.pow(2,r-1075)*(e+4503599627370496)}function v(t,n,e){c[0]=t,n[e]=h[0],n[e+1]=h[1],n[e+2]=h[2],n[e+3]=h[3],n[e+4]=h[4],n[e+5]=h[5],n[e+6]=h[6],n[e+7]=h[7]}function p(t,n,e){c[0]=t,n[e]=h[7],n[e+1]=h[6],n[e+2]=h[5],n[e+3]=h[4],n[e+4]=h[3],n[e+5]=h[2],n[e+6]=h[1],n[e+7]=h[0]}function m(t,n){return h[0]=t[n],h[1]=t[n+1],h[2]=t[n+2],h[3]=t[n+3],h[4]=t[n+4],h[5]=t[n+5],h[6]=t[n+6],h[7]=t[n+7],c[0]}function y(t,n){return h[7]=t[n],h[6]=t[n+1],h[5]=t[n+2],h[4]=t[n+3],h[3]=t[n+4],h[2]=t[n+5],h[1]=t[n+6],h[0]=t[n+7],c[0]}return"undefined"!=typeof Float32Array?(a=new Float32Array([-0]),u=new Uint8Array(a.buffer),f=128===u[3],t.writeFloatLE=f?i:r,t.writeFloatBE=f?r:i,t.readFloatLE=f?o:s,t.readFloatBE=f?s:o):(t.writeFloatLE=n.bind(null,b),t.writeFloatBE=n.bind(null,g),t.readFloatLE=e.bind(null,_),t.readFloatBE=e.bind(null,w)),"undefined"!=typeof Float64Array?(c=new Float64Array([-0]),h=new Uint8Array(c.buffer),f=128===h[7],t.writeDoubleLE=f?v:p,t.writeDoubleBE=f?p:v,t.readDoubleLE=f?m:y,t.readDoubleBE=f?y:m):(t.writeDoubleLE=l.bind(null,b,0,4),t.writeDoubleBE=l.bind(null,g,4,0),t.readDoubleLE=d.bind(null,_,0,4),t.readDoubleBE=d.bind(null,w,4,0)),t}function b(t,n,e){n[e]=255&t,n[e+1]=t>>>8&255,n[e+2]=t>>>16&255,n[e+3]=t>>>24}function g(t,n,e){n[e]=t>>>24,n[e+1]=t>>>16&255,n[e+2]=t>>>8&255,n[e+3]=255&t}function _(t,n){return(t[n]|t[n+1]<<8|t[n+2]<<16|t[n+3]<<24)>>>0}function w(t,n){return(t[n]<<24|t[n+1]<<16|t[n+2]<<8|t[n+3])>>>0}t.exports=i(i)},function(t,n,e){"use strict";n.length=function(t){for(var n,e=0,i=0;i<t.length;++i)(n=t.charCodeAt(i))<128?e+=1:n<2048?e+=2:55296==(64512&n)&&56320==(64512&t.charCodeAt(i+1))?(++i,e+=4):e+=3;return e},n.read=function(t,n,e){if(e-n<1)return"";for(var i,r=null,o=[],s=0;n<e;)(i=t[n++])<128?o[s++]=i:191<i&&i<224?o[s++]=(31&i)<<6|63&t[n++]:239<i&&i<365?(i=((7&i)<<18|(63&t[n++])<<12|(63&t[n++])<<6|63&t[n++])-65536,o[s++]=55296+(i>>10),o[s++]=56320+(1023&i)):o[s++]=(15&i)<<12|(63&t[n++])<<6|63&t[n++],8191<s&&((r=r||[]).push(String.fromCharCode.apply(String,o)),s=0);return r?(s&&r.push(String.fromCharCode.apply(String,o.slice(0,s))),r.join("")):String.fromCharCode.apply(String,o.slice(0,s))},n.write=function(t,n,e){for(var i,r,o=e,s=0;s<t.length;++s)(i=t.charCodeAt(s))<128?n[e++]=i:(i<2048?n[e++]=i>>6|192:(55296==(64512&i)&&56320==(64512&(r=t.charCodeAt(s+1)))?(++s,n[e++]=(i=65536+((1023&i)<<10)+(1023&r))>>18|240,n[e++]=i>>12&63|128):n[e++]=i>>12|224,n[e++]=i>>6&63|128),n[e++]=63&i|128);return e-o}},function(t,n,e){"use strict";t.exports=function(n,e,t){var i=t||8192,r=i>>>1,o=null,s=i;return function(t){if(t<1||r<t)return n(t);i<s+t&&(o=n(i),s=0);t=e.call(o,s,s+=t);return 7&s&&(s=1+(7|s)),t}}},function(t,n,e){"use strict";t.exports=r;var i=e(4);function r(t,n){this.lo=t>>>0,this.hi=n>>>0}var o=r.zero=new r(0,0),s=(o.toNumber=function(){return 0},o.zzEncode=o.zzDecode=function(){return this},o.length=function(){return 1},r.zeroHash="\0\0\0\0\0\0\0\0",r.fromNumber=function(t){var n,e;return 0===t?o:(e=(t=(n=t<0)?-t:t)>>>0,t=(t-e)/4294967296>>>0,n&&(t=~t>>>0,e=~e>>>0,4294967295<++e)&&(e=0,4294967295<++t)&&(t=0),new r(e,t))},r.from=function(t){if("number"==typeof t)return r.fromNumber(t);if(i.isString(t)){if(!i.Long)return r.fromNumber(parseInt(t,10));t=i.Long.fromString(t)}return t.low||t.high?new r(t.low>>>0,t.high>>>0):o},r.prototype.toNumber=function(t){var n;return!t&&this.hi>>>31?(t=1+~this.lo>>>0,n=~this.hi>>>0,-(t+4294967296*(n=t?n:n+1>>>0))):this.lo+4294967296*this.hi},r.prototype.toLong=function(t){return i.Long?new i.Long(0|this.lo,0|this.hi,Boolean(t)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(t)}},String.prototype.charCodeAt);r.fromHash=function(t){return"\0\0\0\0\0\0\0\0"===t?o:new r((s.call(t,0)|s.call(t,1)<<8|s.call(t,2)<<16|s.call(t,3)<<24)>>>0,(s.call(t,4)|s.call(t,5)<<8|s.call(t,6)<<16|s.call(t,7)<<24)>>>0)},r.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},r.prototype.zzEncode=function(){var t=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^t)>>>0,this.lo=(this.lo<<1^t)>>>0,this},r.prototype.zzDecode=function(){var t=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^t)>>>0,this.hi=(this.hi>>>1^t)>>>0,this},r.prototype.length=function(){var t=this.lo,n=(this.lo>>>28|this.hi<<4)>>>0,e=this.hi>>>24;return 0==e?0==n?t<16384?t<128?1:2:t<2097152?3:4:n<16384?n<128?5:6:n<2097152?7:8:e<128?9:10}},function(t,n,e){"use strict";t.exports=o;var i=e(12),r=((o.prototype=Object.create(i.prototype)).constructor=o,e(4));function o(){i.call(this)}function s(t,n,e){t.length<40?r.utf8.write(t,n,e):n.utf8Write?n.utf8Write(t,e):n.write(t,e)}o.T=function(){o.alloc=r.S,o.writeBytesBuffer=r.Buffer&&r.Buffer.prototype instanceof Uint8Array&&"set"===r.Buffer.prototype.set.name?function(t,n,e){n.set(t,e)}:function(t,n,e){if(t.copy)t.copy(n,e,0,t.length);else for(var i=0;i<t.length;)n[e++]=t[i++]}},o.prototype.bytes=function(t){var n=(t=r.isString(t)?r._(t,"base64"):t).length>>>0;return this.uint32(n),n&&this.R(o.writeBytesBuffer,n,t),this},o.prototype.string=function(t){var n=r.Buffer.byteLength(t);return this.uint32(n),n&&this.R(s,n,t),this},o.T()},function(t,n,e){"use strict";t.exports=o;var i=e(13),r=((o.prototype=Object.create(i.prototype)).constructor=o,e(4));function o(t){i.call(this,t)}o.T=function(){r.Buffer&&(o.prototype.N=r.Buffer.prototype.slice)},o.prototype.string=function(){var t=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+t,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+t,this.len))},o.T()},function(t,n,e){"use strict";t.exports=i;var a=e(4);function i(t,n,e){if("function"!=typeof t)throw TypeError("rpcImpl must be a function");a.EventEmitter.call(this),this.rpcImpl=t,this.requestDelimited=Boolean(n),this.responseDelimited=Boolean(e)}((i.prototype=Object.create(a.EventEmitter.prototype)).constructor=i).prototype.rpcCall=function t(e,n,i,r,o){if(!r)throw TypeError("request must be specified");var s=this;if(!o)return a.asPromise(t,s,e,n,i,r);if(s.rpcImpl)try{return s.rpcImpl(e,n[s.requestDelimited?"encodeDelimited":"encode"](r).finish(),function(t,n){if(t)return s.emit("error",t,e),o(t);if(null!==n){if(!(n instanceof i))try{n=i[s.responseDelimited?"decodeDelimited":"decode"](n)}catch(t){return s.emit("error",t,e),o(t)}return s.emit("data",n,e),o(null,n)}s.end(!0)})}catch(t){s.emit("error",t,e),setTimeout(function(){o(t)},0)}else setTimeout(function(){o(Error("already ended"))},0)},i.prototype.end=function(t){return this.rpcImpl&&(t||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},function(t,n,e){"use strict";function i(n,e){"string"==typeof n&&(e=n,n=void 0);var u=[];function c(t){if("string"!=typeof t){var n="return "+h();if(t){for(var e=Object.keys(t),i=new Array(e.length+1),r=new Array(e.length),o=0;o<e.length;)i[o]=e[o],r[o]=t[e[o++]];return i[o]=n,Function.apply(null,i).apply(null,r)}return Function(n)()}for(var s=new Array(arguments.length-1),a=0;a<s.length;)s[a]=arguments[++a];if(a=0,t=t.replace(/%([%dfijs])/g,function(t,n){var e=s[a++];switch(n){case"d":case"f":return String(Number(e));case"i":return String(Math.floor(e));case"j":return JSON.stringify(e);case"s":return String(e)}return"%"}),a!==s.length)throw Error("parameter count mismatch");return u.push(t),c}function h(t){return"function "+(t||e||"")+"("+(n&&n.join(",")||"")+"){\n "+u.join("\n ")+"\n}"}return c.toString=h,c}(t.exports=i).verbose=!1},function(t,n,e){"use strict";t.exports=a;var o=e(16),s=e(17)("fs");function a(e,i,r){return i="function"==typeof i?(r=i,{}):i||{},r?!i.xhr&&s&&s.readFile?s.readFile(e,function(t,n){return t&&"undefined"!=typeof XMLHttpRequest?a.xhr(e,i,r):t?r(t):r(null,i.binary?n:n.toString("utf8"))}):a.xhr(e,i,r):o(a,this,e,i)}a.xhr=function(t,e,i){var r=new XMLHttpRequest;r.onreadystatechange=function(){if(4===r.readyState){if(0!==r.status&&200!==r.status)return i(Error("status "+r.status));if(e.binary){if(!(t=r.response))for(var t=[],n=0;n<r.responseText.length;++n)t.push(255&r.responseText.charCodeAt(n));return i(null,"undefined"!=typeof Uint8Array?new Uint8Array(t):t)}return i(null,r.responseText)}},e.binary&&("overrideMimeType"in r&&r.overrideMimeType("text/plain; charset=x-user-defined"),r.responseType="arraybuffer"),r.open("GET",t),r.send()}},function(t,n,e){"use strict";var r=n.isAbsolute=function(t){return/^(?:\/|\w+:)/.test(t)},i=n.normalize=function(t){var n=(t=t.replace(/\\/g,"/").replace(/\/{2,}/g,"/")).split("/"),e=r(t),t="";e&&(t=n.shift()+"/");for(var i=0;i<n.length;)".."===n[i]?0<i&&".."!==n[i-1]?n.splice(--i,2):e?n.splice(i,1):++i:"."===n[i]?n.splice(i,1):++i;return t+n.join("/")};n.resolve=function(t,n,e){return e||(n=i(n)),!r(n)&&(t=(t=e?t:i(t)).replace(/(?:\/|^)[^/]+$/,"")).length?i(t+"/"+n):n}},function(r,s,t){"use strict";t.r(s);var h={};t.r(h),t.d(h,"ShadowMaterial",function(){return V0}),t.d(h,"SpriteMaterial",function(){return Ul}),t.d(h,"RawShaderMaterial",function(){return Gl}),t.d(h,"ShaderMaterial",function(){return Ea}),t.d(h,"PointsMaterial",function(){return z0}),t.d(h,"MeshPhysicalMaterial",function(){return Y0}),t.d(h,"MeshStandardMaterial",function(){return W0}),t.d(h,"MeshPhongMaterial",function(){return Q0}),t.d(h,"MeshToonMaterial",function(){return Z0}),t.d(h,"MeshNormalMaterial",function(){return q0}),t.d(h,"MeshLambertMaterial",function(){return K0}),t.d(h,"MeshDepthMaterial",function(){return Hc}),t.d(h,"MeshDistanceMaterial",function(){return Xc}),t.d(h,"MeshBasicMaterial",function(){return Ia}),t.d(h,"MeshMatcapMaterial",function(){return J0}),t.d(h,"LineDashedMaterial",function(){return $0}),t.d(h,"LineBasicMaterial",function(){return Bl}),t.d(h,"Material",function(){return f});for(var _="v3.1.5",S=69,T=[],A=0;A<256;A++)T[A]=(A<16?"0":"")+A.toString(16);var St={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){var t=4294967295*Math.random()|0,n=4294967295*Math.random()|0,e=4294967295*Math.random()|0,i=4294967295*Math.random()|0;return(T[255&t]+T[t>>8&255]+T[t>>16&255]+T[t>>24&255]+"-"+T[255&n]+T[n>>8&255]+"-"+T[n>>16&15|64]+T[n>>24&255]+"-"+T[63&e|128]+T[e>>8&255]+"-"+T[e>>16&255]+T[e>>24&255]+T[255&i]+T[i>>8&255]+T[i>>16&255]+T[i>>24&255]).toUpperCase()},clamp:function(t,n,e){return Math.max(n,Math.min(e,t))},euclideanModulo:function(t,n){return(t%n+n)%n},mapLinear:function(t,n,e,i,r){return i+(t-n)*(r-i)/(e-n)},lerp:function(t,n,e){return(1-e)*t+e*n},smoothstep:function(t,n,e){return t<=n?0:e<=t?1:(t=(t-n)/(e-n))*t*(3-2*t)},smootherstep:function(t,n,e){return t<=n?0:e<=t?1:(t=(t-n)/(e-n))*t*t*(t*(6*t-15)+10)},randInt:function(t,n){return t+Math.floor(Math.random()*(n-t+1))},randFloat:function(t,n){return t+Math.random()*(n-t)},randFloatSpread:function(t){return t*(.5-Math.random())},degToRad:function(t){return t*St.DEG2RAD},radToDeg:function(t){return t*St.RAD2DEG},isPowerOfTwo:function(t){return 0==(t&t-1)&&0!==t},ceilPowerOfTwo:function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},floorPowerOfTwo:function(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))},setQuaternionFromProperEuler:function(t,n,e,i,r){var o=Math.cos,s=Math.sin,a=o(e/2),e=s(e/2),u=o((n+i)/2),c=s((n+i)/2),h=o((n-i)/2),f=s((n-i)/2),o=o((i-n)/2),s=s((i-n)/2);"XYX"===r?t.set(a*c,e*h,e*f,a*u):"YZY"===r?t.set(e*f,a*c,e*h,a*u):"ZXZ"===r?t.set(e*h,e*f,a*c,a*u):"XZX"===r?t.set(a*c,e*s,e*o,a*u):"YXY"===r?t.set(e*o,a*c,e*s,a*u):"ZYZ"===r?t.set(e*s,e*o,a*c,a*u):console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order.")}};function at(t,n,e,i){this.wt=t||0,this.xt=n||0,this.Et=e||0,this.St=void 0!==i?i:1}Object.assign(at,{slerp:function(t,n,e,i){return e.copy(t).slerp(n,i)},slerpFlat:function(t,n,e,i,r,o,s){var a,u,c,h=e[i+0],f=e[i+1],l=e[i+2],e=e[i+3],i=r[o+0],d=r[o+1],v=r[o+2],r=r[o+3];e===r&&h===i&&f===d&&l===v||(o=1-s,a=0<=(u=h*i+f*d+l*v+e*r)?1:-1,(c=1-u*u)>Number.EPSILON&&(c=Math.sqrt(c),u=Math.atan2(c,u*a),o=Math.sin(o*u)/c,s=Math.sin(s*u)/c),h=h*o+i*(u=s*a),f=f*o+d*u,l=l*o+v*u,e=e*o+r*u,o===1-s&&(h*=c=1/Math.sqrt(h*h+f*f+l*l+e*e),f*=c,l*=c,e*=c)),t[n]=h,t[n+1]=f,t[n+2]=l,t[n+3]=e}}),Object.defineProperties(at.prototype,{x:{get:function(){return this.wt},set:function(t){this.wt=t,this.Tt()}},y:{get:function(){return this.xt},set:function(t){this.xt=t,this.Tt()}},z:{get:function(){return this.Et},set:function(t){this.Et=t,this.Tt()}},w:{get:function(){return this.St},set:function(t){this.St=t,this.Tt()}}}),Object.assign(at.prototype,{isQuaternion:!0,set:function(t,n,e,i){return this.wt=t,this.xt=n,this.Et=e,this.St=i,this.Tt(),this},clone:function(){return new this.constructor(this.wt,this.xt,this.Et,this.St)},copy:function(t){return this.wt=t.x,this.xt=t.y,this.Et=t.z,this.St=t.w,this.Tt(),this},setFromEuler:function(t,n){var e,i,r,o,s,a,u;if(t&&t.isEuler)return s=t.wt,a=t.xt,e=t.Et,t=t.order,o=Math.cos,u=Math.sin,i=o(s/2),r=o(a/2),o=o(e/2),s=u(s/2),a=u(a/2),u=u(e/2),"XYZ"===t?(this.wt=s*r*o+i*a*u,this.xt=i*a*o-s*r*u,this.Et=i*r*u+s*a*o,this.St=i*r*o-s*a*u):"YXZ"===t?(this.wt=s*r*o+i*a*u,this.xt=i*a*o-s*r*u,this.Et=i*r*u-s*a*o,this.St=i*r*o+s*a*u):"ZXY"===t?(this.wt=s*r*o-i*a*u,this.xt=i*a*o+s*r*u,this.Et=i*r*u+s*a*o,this.St=i*r*o-s*a*u):"ZYX"===t?(this.wt=s*r*o-i*a*u,this.xt=i*a*o+s*r*u,this.Et=i*r*u-s*a*o,this.St=i*r*o+s*a*u):"YZX"===t?(this.wt=s*r*o+i*a*u,this.xt=i*a*o+s*r*u,this.Et=i*r*u-s*a*o,this.St=i*r*o-s*a*u):"XZY"===t&&(this.wt=s*r*o-i*a*u,this.xt=i*a*o-s*r*u,this.Et=i*r*u+s*a*o,this.St=i*r*o+s*a*u),!1!==n&&this.Tt(),this;throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.")},setFromAxisAngle:function(t,n){var n=n/2,e=Math.sin(n);return this.wt=t.x*e,this.xt=t.y*e,this.Et=t.z*e,this.St=Math.cos(n),this.Tt(),this},setFromRotationMatrix:function(t){var n,t=t.elements,e=t[0],i=t[4],r=t[8],o=t[1],s=t[5],a=t[9],u=t[2],c=t[6],t=t[10],h=e+s+t;return 0<h?(n=.5/Math.sqrt(h+1),this.St=.25/n,this.wt=(c-a)*n,this.xt=(r-u)*n,this.Et=(o-i)*n):s<e&&t<e?(n=2*Math.sqrt(1+e-s-t),this.St=(c-a)/n,this.wt=.25*n,this.xt=(i+o)/n,this.Et=(r+u)/n):t<s?(n=2*Math.sqrt(1+s-e-t),this.St=(r-u)/n,this.wt=(i+o)/n,this.xt=.25*n,this.Et=(a+c)/n):(n=2*Math.sqrt(1+t-e-s),this.St=(o-i)/n,this.wt=(r+u)/n,this.xt=(a+c)/n,this.Et=.25*n),this.Tt(),this},setFromUnitVectors:function(t,n){var e=t.dot(n)+1;return e<1e-6?(e=0,Math.abs(t.x)>Math.abs(t.z)?(this.wt=-t.y,this.xt=t.x,this.Et=0):(this.wt=0,this.xt=-t.z,this.Et=t.y)):(this.wt=t.y*n.z-t.z*n.y,this.xt=t.z*n.x-t.x*n.z,this.Et=t.x*n.y-t.y*n.x),this.St=e,this.normalize()},angleTo:function(t){return 2*Math.acos(Math.abs(St.clamp(this.dot(t),-1,1)))},rotateTowards:function(t,n){var e=this.angleTo(t);return 0!==e&&(n=Math.min(1,n/e),this.slerp(t,n)),this},inverse:function(){return this.conjugate()},conjugate:function(){return this.wt*=-1,this.xt*=-1,this.Et*=-1,this.Tt(),this},dot:function(t){return this.wt*t.wt+this.xt*t.xt+this.Et*t.Et+this.St*t.St},lengthSq:function(){return this.wt*this.wt+this.xt*this.xt+this.Et*this.Et+this.St*this.St},length:function(){return Math.sqrt(this.wt*this.wt+this.xt*this.xt+this.Et*this.Et+this.St*this.St)},normalize:function(){var t=this.length();return 0===t?(this.wt=0,this.xt=0,this.Et=0,this.St=1):(this.wt=this.wt*(t=1/t),this.xt=this.xt*t,this.Et=this.Et*t,this.St=this.St*t),this.Tt(),this},multiply:function(t,n){return void 0!==n?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(t,n)):this.multiplyQuaternions(this,t)},premultiply:function(t){return this.multiplyQuaternions(t,this)},multiplyQuaternions:function(t,n){var e=t.wt,i=t.xt,r=t.Et,t=t.St,o=n.wt,s=n.xt,a=n.Et,n=n.St;return this.wt=e*n+t*o+i*a-r*s,this.xt=i*n+t*s+r*o-e*a,this.Et=r*n+t*a+e*s-i*o,this.St=t*n-e*o-i*s-r*a,this.Tt(),this},slerp:function(t,n){if(0!==n){if(1===n)return this.copy(t);var e,i=this.wt,r=this.xt,o=this.Et,s=this.St,a=s*t.St+i*t.wt+r*t.xt+o*t.Et;a<0?(this.St=-t.St,this.wt=-t.wt,this.xt=-t.xt,this.Et=-t.Et,a=-a):this.copy(t),1<=a?(this.St=s,this.wt=i,this.xt=r,this.Et=o):((t=1-a*a)<=Number.EPSILON?(this.St=(e=1-n)*s+n*this.St,this.wt=e*i+n*this.wt,this.xt=e*r+n*this.xt,this.Et=e*o+n*this.Et,this.normalize()):(e=Math.sqrt(t),t=Math.atan2(e,a),a=Math.sin((1-n)*t)/e,n=Math.sin(n*t)/e,this.St=s*a+this.St*n,this.wt=i*a+this.wt*n,this.xt=r*a+this.xt*n,this.Et=o*a+this.Et*n),this.Tt())}return this},equals:function(t){return t.wt===this.wt&&t.xt===this.xt&&t.Et===this.Et&&t.St===this.St},fromArray:function(t,n){return this.wt=t[n=void 0===n?0:n],this.xt=t[n+1],this.Et=t[n+2],this.St=t[n+3],this.Tt(),this},toArray:function(t,n){return(t=void 0===t?[]:t)[n=void 0===n?0:n]=this.wt,t[n+1]=this.xt,t[n+2]=this.Et,t[n+3]=this.St,t},fromBufferAttribute:function(t,n){return this.wt=t.getX(n),this.xt=t.getY(n),this.Et=t.getZ(n),this.St=t.getW(n),this},At:function(t){return this.Tt=t,this},Tt:function(){}});var M=new Tt,O=new at;function Tt(t,n,e){this.x=t||0,this.y=n||0,this.z=e||0}Object.assign(Tt.prototype,{isVector3:!0,set:function(t,n,e){return this.x=t,this.y=n,this.z=e,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setComponent:function(t,n){switch(t){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},add:function(t,n){return void 0!==n?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,n)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addVectors:function(t,n){return this.x=t.x+n.x,this.y=t.y+n.y,this.z=t.z+n.z,this},addScaledVector:function(t,n){return this.x+=t.x*n,this.y+=t.y*n,this.z+=t.z*n,this},sub:function(t,n){return void 0!==n?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,n)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this},subVectors:function(t,n){return this.x=t.x-n.x,this.y=t.y-n.y,this.z=t.z-n.z,this},multiply:function(t,n){return void 0!==n?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(t,n)):(this.x*=t.x,this.y*=t.y,this.z*=t.z,this)},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this},multiplyVectors:function(t,n){return this.x=t.x*n.x,this.y=t.y*n.y,this.z=t.z*n.z,this},applyEuler:function(t){return t&&t.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(O.setFromEuler(t))},applyAxisAngle:function(t,n){return this.applyQuaternion(O.setFromAxisAngle(t,n))},applyMatrix3:function(t){var n=this.x,e=this.y,i=this.z,t=t.elements;return this.x=t[0]*n+t[3]*e+t[6]*i,this.y=t[1]*n+t[4]*e+t[7]*i,this.z=t[2]*n+t[5]*e+t[8]*i,this},applyNormalMatrix:function(t){return this.applyMatrix3(t).normalize()},applyMatrix4:function(t){var n=this.x,e=this.y,i=this.z,t=t.elements,r=1/(t[3]*n+t[7]*e+t[11]*i+t[15]);return this.x=(t[0]*n+t[4]*e+t[8]*i+t[12])*r,this.y=(t[1]*n+t[5]*e+t[9]*i+t[13])*r,this.z=(t[2]*n+t[6]*e+t[10]*i+t[14])*r,this},applyQuaternion:function(t){var n=this.x,e=this.y,i=this.z,r=t.x,o=t.y,s=t.z,t=t.w,a=t*n+o*i-s*e,u=t*e+s*n-r*i,c=t*i+r*e-o*n,n=-r*n-o*e-s*i;return this.x=a*t+n*-r+u*-s-c*-o,this.y=u*t+n*-o+c*-r-a*-s,this.z=c*t+n*-s+a*-o-u*-r,this},project:function(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)},unproject:function(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)},transformDirection:function(t){var n=this.x,e=this.y,i=this.z,t=t.elements;return this.x=t[0]*n+t[4]*e+t[8]*i,this.y=t[1]*n+t[5]*e+t[9]*i,this.z=t[2]*n+t[6]*e+t[10]*i,this.normalize()},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this},divideScalar:function(t){return this.multiplyScalar(1/t)},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clamp:function(t,n){return this.x=Math.max(t.x,Math.min(n.x,this.x)),this.y=Math.max(t.y,Math.min(n.y,this.y)),this.z=Math.max(t.z,Math.min(n.z,this.z)),this},clampScalar:function(t,n){return this.x=Math.max(t,Math.min(n,this.x)),this.y=Math.max(t,Math.min(n,this.y)),this.z=Math.max(t,Math.min(n,this.z)),this},clampLength:function(t,n){var e=this.length();return this.divideScalar(e||1).multiplyScalar(Math.max(t,Math.min(n,e)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,n){return this.x+=(t.x-this.x)*n,this.y+=(t.y-this.y)*n,this.z+=(t.z-this.z)*n,this},lerpVectors:function(t,n,e){return this.subVectors(n,t).multiplyScalar(e).add(t)},cross:function(t,n){return void 0!==n?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(t,n)):this.crossVectors(this,t)},crossVectors:function(t,n){var e=t.x,i=t.y,t=t.z,r=n.x,o=n.y,n=n.z;return this.x=i*n-t*o,this.y=t*r-e*n,this.z=e*o-i*r,this},projectOnVector:function(t){var n=t.lengthSq();return 0===n?this.set(0,0,0):(n=t.dot(this)/n,this.copy(t).multiplyScalar(n))},projectOnPlane:function(t){return M.copy(this).projectOnVector(t),this.sub(M)},reflect:function(t){return this.sub(M.copy(t).multiplyScalar(2*this.dot(t)))},angleTo:function(t){var n=Math.sqrt(this.lengthSq()*t.lengthSq());return 0===n?Math.PI/2:(t=this.dot(t)/n,Math.acos(St.clamp(t,-1,1)))},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var n=this.x-t.x,e=this.y-t.y,t=this.z-t.z;return n*n+e*e+t*t},manhattanDistanceTo:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)},setFromSpherical:function(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)},setFromSphericalCoords:function(t,n,e){var i=Math.sin(n)*t;return this.x=i*Math.sin(e),this.y=Math.cos(n)*t,this.z=i*Math.cos(e),this},setFromCylindrical:function(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)},setFromCylindricalCoords:function(t,n,e){return this.x=t*Math.sin(n),this.y=e,this.z=t*Math.cos(n),this},setFromMatrixPosition:function(t){t=t.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this},setFromMatrixScale:function(t){var n=this.setFromMatrixColumn(t,0).length(),e=this.setFromMatrixColumn(t,1).length(),t=this.setFromMatrixColumn(t,2).length();return this.x=n,this.y=e,this.z=t,this},setFromMatrixColumn:function(t,n){return this.fromArray(t.elements,4*n)},setFromMatrix3Column:function(t,n){return this.fromArray(t.elements,3*n)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z},fromArray:function(t,n){return this.x=t[n=void 0===n?0:n],this.y=t[n+1],this.z=t[n+2],this},toArray:function(t,n){return(t=void 0===t?[]:t)[n=void 0===n?0:n]=this.x,t[n+1]=this.y,t[n+2]=this.z,t},fromBufferAttribute:function(t,n,e){return void 0!==e&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(n),this.y=t.getY(n),this.z=t.getZ(n),this}});var L=new Tt,N=new At,F=new Tt(0,0,0),j=new Tt(1,1,1),C=new Tt,D=new Tt,k=new Tt;function At(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],0<arguments.length&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}function X(){}Object.assign(At.prototype,{isMatrix4:!0,set:function(t,n,e,i,r,o,s,a,u,c,h,f,l,d,v,p){var m=this.elements;return m[0]=t,m[4]=n,m[8]=e,m[12]=i,m[1]=r,m[5]=o,m[9]=s,m[13]=a,m[2]=u,m[6]=c,m[10]=h,m[14]=f,m[3]=l,m[7]=d,m[11]=v,m[15]=p,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return(new At).fromArray(this.elements)},copy:function(t){var n=this.elements,t=t.elements;return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],this},copyPosition:function(t){var n=this.elements,t=t.elements;return n[12]=t[12],n[13]=t[13],n[14]=t[14],this},extractBasis:function(t,n,e){return t.setFromMatrixColumn(this,0),n.setFromMatrixColumn(this,1),e.setFromMatrixColumn(this,2),this},makeBasis:function(t,n,e){return this.set(t.x,n.x,e.x,0,t.y,n.y,e.y,0,t.z,n.z,e.z,0,0,0,0,1),this},extractRotation:function(t){var n=this.elements,e=t.elements,i=1/L.setFromMatrixColumn(t,0).length(),r=1/L.setFromMatrixColumn(t,1).length(),t=1/L.setFromMatrixColumn(t,2).length();return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*i,n[3]=0,n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*r,n[7]=0,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this},makeRotationFromEuler:function(t){t&&t.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var n,e,i,r,o,s,a,u,c,h,f,l,d=this.elements,v=t.x,p=t.y,m=t.z,y=Math.cos(v),v=Math.sin(v),b=Math.cos(p),p=Math.sin(p),g=Math.cos(m),m=Math.sin(m);return"XYZ"===t.order?(o=y*g,s=y*m,a=v*g,u=v*m,d[0]=b*g,d[4]=-b*m,d[8]=p,d[1]=s+a*p,d[5]=o-u*p,d[9]=-v*b,d[2]=u-o*p,d[6]=a+s*p,d[10]=y*b):"YXZ"===t.order?(e=b*m,i=p*g,d[0]=(n=b*g)+(r=p*m)*v,d[4]=i*v-e,d[8]=y*p,d[1]=y*m,d[5]=y*g,d[9]=-v,d[2]=e*v-i,d[6]=r+n*v,d[10]=y*b):"ZXY"===t.order?(e=b*m,i=p*g,d[0]=(n=b*g)-(r=p*m)*v,d[4]=-y*m,d[8]=i+e*v,d[1]=e+i*v,d[5]=y*g,d[9]=r-n*v,d[2]=-y*p,d[6]=v,d[10]=y*b):"ZYX"===t.order?(o=y*g,s=y*m,a=v*g,u=v*m,d[0]=b*g,d[4]=a*p-s,d[8]=o*p+u,d[1]=b*m,d[5]=u*p+o,d[9]=s*p-a,d[2]=-p,d[6]=v*b,d[10]=y*b):"YZX"===t.order?(c=y*b,h=y*p,f=v*b,l=v*p,d[0]=b*g,d[4]=l-c*m,d[8]=f*m+h,d[1]=m,d[5]=y*g,d[9]=-v*g,d[2]=-p*g,d[6]=h*m+f,d[10]=c-l*m):"XZY"===t.order&&(c=y*b,h=y*p,f=v*b,l=v*p,d[0]=b*g,d[4]=-m,d[8]=p*g,d[1]=c*m+l,d[5]=y*g,d[9]=h*m-f,d[2]=f*m-h,d[6]=v*g,d[10]=l*m+c),d[3]=0,d[7]=0,d[11]=0,d[12]=0,d[13]=0,d[14]=0,d[15]=1,this},makeRotationFromQuaternion:function(t){return this.compose(F,t,j)},lookAt:function(t,n,e){var i=this.elements;return k.subVectors(t,n),0===k.lengthSq()&&(k.z=1),k.normalize(),C.crossVectors(e,k),0===C.lengthSq()&&(1===Math.abs(e.z)?k.x+=1e-4:k.z+=1e-4,k.normalize(),C.crossVectors(e,k)),C.normalize(),D.crossVectors(k,C),i[0]=C.x,i[4]=D.x,i[8]=k.x,i[1]=C.y,i[5]=D.y,i[9]=k.y,i[2]=C.z,i[6]=D.z,i[10]=k.z,this},multiply:function(t,n){return void 0!==n?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(t,n)):this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,n){var t=t.elements,n=n.elements,e=this.elements,i=t[0],r=t[4],o=t[8],s=t[12],a=t[1],u=t[5],c=t[9],h=t[13],f=t[2],l=t[6],d=t[10],v=t[14],p=t[3],m=t[7],y=t[11],t=t[15],b=n[0],g=n[4],_=n[8],w=n[12],x=n[1],E=n[5],S=n[9],T=n[13],A=n[2],M=n[6],O=n[10],L=n[14],R=n[3],N=n[7],P=n[11],n=n[15];return e[0]=i*b+r*x+o*A+s*R,e[4]=i*g+r*E+o*M+s*N,e[8]=i*_+r*S+o*O+s*P,e[12]=i*w+r*T+o*L+s*n,e[1]=a*b+u*x+c*A+h*R,e[5]=a*g+u*E+c*M+h*N,e[9]=a*_+u*S+c*O+h*P,e[13]=a*w+u*T+c*L+h*n,e[2]=f*b+l*x+d*A+v*R,e[6]=f*g+l*E+d*M+v*N,e[10]=f*_+l*S+d*O+v*P,e[14]=f*w+l*T+d*L+v*n,e[3]=p*b+m*x+y*A+t*R,e[7]=p*g+m*E+y*M+t*N,e[11]=p*_+m*S+y*O+t*P,e[15]=p*w+m*T+y*L+t*n,this},multiplyScalar:function(t){var n=this.elements;return n[0]*=t,n[4]*=t,n[8]*=t,n[12]*=t,n[1]*=t,n[5]*=t,n[9]*=t,n[13]*=t,n[2]*=t,n[6]*=t,n[10]*=t,n[14]*=t,n[3]*=t,n[7]*=t,n[11]*=t,n[15]*=t,this},determinant:function(){var t=this.elements,n=t[0],e=t[4],i=t[8],r=t[12],o=t[1],s=t[5],a=t[9],u=t[13],c=t[2],h=t[6],f=t[10],l=t[14];return t[3]*(+r*a*h-i*u*h-r*s*f+e*u*f+i*s*l-e*a*l)+t[7]*(+n*a*l-n*u*f+r*o*f-i*o*l+i*u*c-r*a*c)+t[11]*(+n*u*h-n*s*l-r*o*h+e*o*l+r*s*c-e*u*c)+t[15]*(-i*s*c-n*a*h+n*s*f+i*o*h-e*o*f+e*a*c)},transpose:function(){var t=this.elements,n=t[1];return t[1]=t[4],t[4]=n,n=t[2],t[2]=t[8],t[8]=n,n=t[6],t[6]=t[9],t[9]=n,n=t[3],t[3]=t[12],t[12]=n,n=t[7],t[7]=t[13],t[13]=n,n=t[11],t[11]=t[14],t[14]=n,this},setPosition:function(t,n,e){var i=this.elements;return t.isVector3?(i[12]=t.x,i[13]=t.y,i[14]=t.z):(i[12]=t,i[13]=n,i[14]=e),this},getInverse:function(t,n){void 0!==n&&console.warn("THREE.Matrix4: .getInverse() can no longer be configured to throw on degenerate.");var n=this.elements,t=t.elements,e=t[0],i=t[1],r=t[2],o=t[3],s=t[4],a=t[5],u=t[6],c=t[7],h=t[8],f=t[9],l=t[10],d=t[11],v=t[12],p=t[13],m=t[14],t=t[15],y=f*m*c-p*l*c+p*u*d-a*m*d-f*u*t+a*l*t,b=v*l*c-h*m*c-v*u*d+s*m*d+h*u*t-s*l*t,g=h*p*c-v*f*c+v*a*d-s*p*d-h*a*t+s*f*t,_=v*f*u-h*p*u-v*a*l+s*p*l+h*a*m-s*f*m,w=e*y+i*b+r*g+o*_;return 0==w?this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0):(n[0]=y*(y=1/w),n[1]=(p*l*o-f*m*o-p*r*d+i*m*d+f*r*t-i*l*t)*y,n[2]=(a*m*o-p*u*o+p*r*c-i*m*c-a*r*t+i*u*t)*y,n[3]=(f*u*o-a*l*o-f*r*c+i*l*c+a*r*d-i*u*d)*y,n[4]=b*y,n[5]=(h*m*o-v*l*o+v*r*d-e*m*d-h*r*t+e*l*t)*y,n[6]=(v*u*o-s*m*o-v*r*c+e*m*c+s*r*t-e*u*t)*y,n[7]=(s*l*o-h*u*o+h*r*c-e*l*c-s*r*d+e*u*d)*y,n[8]=g*y,n[9]=(v*f*o-h*p*o-v*i*d+e*p*d+h*i*t-e*f*t)*y,n[10]=(s*p*o-v*a*o+v*i*c-e*p*c-s*i*t+e*a*t)*y,n[11]=(h*a*o-s*f*o-h*i*c+e*f*c+s*i*d-e*a*d)*y,n[12]=_*y,n[13]=(h*p*r-v*f*r+v*i*l-e*p*l-h*i*m+e*f*m)*y,n[14]=(v*a*r-s*p*r-v*i*u+e*p*u+s*i*m-e*a*m)*y,n[15]=(s*f*r-h*a*r+h*i*u-e*f*u-s*i*l+e*a*l)*y,this)},invert:function(){var t=this.elements,n=t[0],e=t[1],i=t[2],r=t[3],o=t[4],s=t[5],a=t[6],u=t[7],c=t[8],h=t[9],f=t[10],l=t[11],d=t[12],v=t[13],p=t[14],m=t[15],y=h*p*u-v*f*u+v*a*l-s*p*l-h*a*m+s*f*m,b=d*f*u-c*p*u-d*a*l+o*p*l+c*a*m-o*f*m,g=c*v*u-d*h*u+d*s*l-o*v*l-c*s*m+o*h*m,_=d*h*a-c*v*a-d*s*f+o*v*f+c*s*p-o*h*p,w=n*y+e*b+i*g+r*_;return 0==w?this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0):(t[0]=y*(y=1/w),t[1]=(v*f*r-h*p*r-v*i*l+e*p*l+h*i*m-e*f*m)*y,t[2]=(s*p*r-v*a*r+v*i*u-e*p*u-s*i*m+e*a*m)*y,t[3]=(h*a*r-s*f*r-h*i*u+e*f*u+s*i*l-e*a*l)*y,t[4]=b*y,t[5]=(c*p*r-d*f*r+d*i*l-n*p*l-c*i*m+n*f*m)*y,t[6]=(d*a*r-o*p*r-d*i*u+n*p*u+o*i*m-n*a*m)*y,t[7]=(o*f*r-c*a*r+c*i*u-n*f*u-o*i*l+n*a*l)*y,t[8]=g*y,t[9]=(d*h*r-c*v*r-d*e*l+n*v*l+c*e*m-n*h*m)*y,t[10]=(o*v*r-d*s*r+d*e*u-n*v*u-o*e*m+n*s*m)*y,t[11]=(c*s*r-o*h*r-c*e*u+n*h*u+o*e*l-n*s*l)*y,t[12]=_*y,t[13]=(c*v*i-d*h*i+d*e*f-n*v*f-c*e*p+n*h*p)*y,t[14]=(d*s*i-o*v*i-d*e*a+n*v*a+o*e*p-n*s*p)*y,t[15]=(o*h*i-c*s*i+c*e*a-n*h*a-o*e*f+n*s*f)*y,this)},scale:function(t){var n=this.elements,e=t.x,i=t.y,t=t.z;return n[0]*=e,n[4]*=i,n[8]*=t,n[1]*=e,n[5]*=i,n[9]*=t,n[2]*=e,n[6]*=i,n[10]*=t,n[3]*=e,n[7]*=i,n[11]*=t,this},getMaxScaleOnAxis:function(){var t=this.elements,n=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],e=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],t=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(n,e,t))},makeTranslation:function(t,n,e){return this.set(1,0,0,t,0,1,0,n,0,0,1,e,0,0,0,1),this},makeRotationX:function(t){var n=Math.cos(t),t=Math.sin(t);return this.set(1,0,0,0,0,n,-t,0,0,t,n,0,0,0,0,1),this},makeRotationY:function(t){var n=Math.cos(t),t=Math.sin(t);return this.set(n,0,t,0,0,1,0,0,-t,0,n,0,0,0,0,1),this},makeRotationZ:function(t){var n=Math.cos(t),t=Math.sin(t);return this.set(n,-t,0,0,t,n,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(t,n){var e=Math.cos(n),n=Math.sin(n),i=1-e,r=t.x,o=t.y,t=t.z,s=i*r,a=i*o;return this.set(s*r+e,s*o-n*t,s*t+n*o,0,s*o+n*t,a*o+e,a*t-n*r,0,s*t-n*o,a*t+n*r,i*t*t+e,0,0,0,0,1),this},makeScale:function(t,n,e){return this.set(t,0,0,0,0,n,0,0,0,0,e,0,0,0,0,1),this},makeShear:function(t,n,e){return this.set(1,n,e,0,t,1,e,0,t,n,1,0,0,0,0,1),this},compose:function(t,n,e){var i=this.elements,r=n.wt,o=n.xt,s=n.Et,n=n.St,a=r+r,u=o+o,c=s+s,h=r*a,f=r*u,r=r*c,l=o*u,o=o*c,s=s*c,a=n*a,u=n*u,n=n*c,c=e.x,d=e.y,e=e.z;return i[0]=(1-(l+s))*c,i[1]=(f+n)*c,i[2]=(r-u)*c,i[3]=0,i[4]=(f-n)*d,i[5]=(1-(h+s))*d,i[6]=(o+a)*d,i[7]=0,i[8]=(r+u)*e,i[9]=(o-a)*e,i[10]=(1-(h+l))*e,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,this},decompose:function(t,n,e){var i=this.elements,r=L.set(i[0],i[1],i[2]).length(),o=L.set(i[4],i[5],i[6]).length(),s=L.set(i[8],i[9],i[10]).length(),t=(this.determinant()<0&&(r=-r),t.x=i[12],t.y=i[13],t.z=i[14],N.copy(this),1/r),i=1/o,a=1/s;return N.elements[0]*=t,N.elements[1]*=t,N.elements[2]*=t,N.elements[4]*=i,N.elements[5]*=i,N.elements[6]*=i,N.elements[8]*=a,N.elements[9]*=a,N.elements[10]*=a,n.setFromRotationMatrix(N),e.x=r,e.y=o,e.z=s,this},makePerspective:function(t,n,e,i,r,o){void 0===o&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var s=this.elements,a=2*r/(e-i),u=(n+t)/(n-t),e=(e+i)/(e-i),i=-(o+r)/(o-r),o=-2*o*r/(o-r);return s[0]=2*r/(n-t),s[4]=0,s[8]=u,s[12]=0,s[1]=0,s[5]=a,s[9]=e,s[13]=0,s[2]=0,s[6]=0,s[10]=i,s[14]=o,s[3]=0,s[7]=0,s[11]=-1,s[15]=0,this},makeOrthographic:function(t,n,e,i,r,o){var s=this.elements,a=1/(n-t),u=1/(e-i),c=1/(o-r),n=(n+t)*a,t=(e+i)*u,e=(o+r)*c;return s[0]=2*a,s[4]=0,s[8]=0,s[12]=-n,s[1]=0,s[5]=2*u,s[9]=0,s[13]=-t,s[2]=0,s[6]=0,s[10]=-2*c,s[14]=-e,s[3]=0,s[7]=0,s[11]=0,s[15]=1,this},equals:function(t){for(var n=this.elements,e=t.elements,i=0;i<16;i++)if(n[i]!==e[i])return!1;return!0},fromArray:function(t,n){void 0===n&&(n=0);for(var e=0;e<16;e++)this.elements[e]=t[e+n];return this},toArray:function(t,n){var e=this.elements;return(t=void 0===t?[]:t)[n=void 0===n?0:n]=e[0],t[n+1]=e[1],t[n+2]=e[2],t[n+3]=e[3],t[n+4]=e[4],t[n+5]=e[5],t[n+6]=e[6],t[n+7]=e[7],t[n+8]=e[8],t[n+9]=e[9],t[n+10]=e[10],t[n+11]=e[11],t[n+12]=e[12],t[n+13]=e[13],t[n+14]=e[14],t[n+15]=e[15],t}}),Object.assign(X.prototype,{addEventListener:function(t,n){void 0===this._t&&(this._t={});var e=this._t;void 0===e[t]&&(e[t]=[]),-1===e[t].indexOf(n)&&e[t].push(n)},hasEventListener:function(t,n){var e;return void 0!==this._t&&void 0!==(e=this._t)[t]&&-1!==e[t].indexOf(n)},removeEventListener:function(t,n){var e;void 0!==this._t&&void 0!==(t=this._t[t])&&-1!==(e=t.indexOf(n))&&t.splice(e,1)},dispatchEvent:function(t){if(void 0!==this._t){var n=this._t[t.type];if(void 0!==n){t.target=this;for(var e=n.slice(0),i=0,r=e.length;i<r;i++)e[i].call(this,t)}}}});var V=new At,W=new at;function Y(t,n,e,i){this.wt=t||0,this.xt=n||0,this.Et=e||0,this.Mt=i||Y.DefaultOrder}function Q(){this.mask=1}function Z(){this.elements=[1,0,0,0,1,0,0,0,1],0<arguments.length&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}Y.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],Y.DefaultOrder="XYZ",Object.defineProperties(Y.prototype,{x:{get:function(){return this.wt},set:function(t){this.wt=t,this.Tt()}},y:{get:function(){return this.xt},set:function(t){this.xt=t,this.Tt()}},z:{get:function(){return this.Et},set:function(t){this.Et=t,this.Tt()}},order:{get:function(){return this.Mt},set:function(t){this.Mt=t,this.Tt()}}}),Object.assign(Y.prototype,{isEuler:!0,set:function(t,n,e,i){return this.wt=t,this.xt=n,this.Et=e,this.Mt=i||this.Mt,this.Tt(),this},clone:function(){return new this.constructor(this.wt,this.xt,this.Et,this.Mt)},copy:function(t){return this.wt=t.wt,this.xt=t.xt,this.Et=t.Et,this.Mt=t.Mt,this.Tt(),this},setFromRotationMatrix:function(t,n,e){var i=St.clamp,t=t.elements,r=t[0],o=t[4],s=t[8],a=t[1],u=t[5],c=t[9],h=t[2],f=t[6],t=t[10];return"XYZ"===(n=n||this.Mt)?(this.xt=Math.asin(i(s,-1,1)),Math.abs(s)<.9999999?(this.wt=Math.atan2(-c,t),this.Et=Math.atan2(-o,r)):(this.wt=Math.atan2(f,u),this.Et=0)):"YXZ"===n?(this.wt=Math.asin(-i(c,-1,1)),Math.abs(c)<.9999999?(this.xt=Math.atan2(s,t),this.Et=Math.atan2(a,u)):(this.xt=Math.atan2(-h,r),this.Et=0)):"ZXY"===n?(this.wt=Math.asin(i(f,-1,1)),Math.abs(f)<.9999999?(this.xt=Math.atan2(-h,t),this.Et=Math.atan2(-o,u)):(this.xt=0,this.Et=Math.atan2(a,r))):"ZYX"===n?(this.xt=Math.asin(-i(h,-1,1)),Math.abs(h)<.9999999?(this.wt=Math.atan2(f,t),this.Et=Math.atan2(a,r)):(this.wt=0,this.Et=Math.atan2(-o,u))):"YZX"===n?(this.Et=Math.asin(i(a,-1,1)),Math.abs(a)<.9999999?(this.wt=Math.atan2(-c,u),this.xt=Math.atan2(-h,r)):(this.wt=0,this.xt=Math.atan2(s,t))):"XZY"===n?(this.Et=Math.asin(-i(o,-1,1)),Math.abs(o)<.9999999?(this.wt=Math.atan2(f,u),this.xt=Math.atan2(s,r)):(this.wt=Math.atan2(-c,t),this.xt=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+n),this.Mt=n,!1!==e&&this.Tt(),this},setFromQuaternion:function(t,n,e){return V.makeRotationFromQuaternion(t),this.setFromRotationMatrix(V,n,e)},setFromVector3:function(t,n){return this.set(t.x,t.y,t.z,n||this.Mt)},reorder:function(t){return W.setFromEuler(this),this.setFromQuaternion(W,t)},equals:function(t){return t.wt===this.wt&&t.xt===this.xt&&t.Et===this.Et&&t.Mt===this.Mt},fromArray:function(t){return this.wt=t[0],this.xt=t[1],this.Et=t[2],void 0!==t[3]&&(this.Mt=t[3]),this.Tt(),this},toArray:function(t,n){return(t=void 0===t?[]:t)[n=void 0===n?0:n]=this.wt,t[n+1]=this.xt,t[n+2]=this.Et,t[n+3]=this.Mt,t},toVector3:function(t){return t?t.set(this.wt,this.xt,this.Et):new Tt(this.wt,this.xt,this.Et)},At:function(t){return this.Tt=t,this},Tt:function(){}}),Object.assign(Q.prototype,{set:function(t){this.mask=1<<t|0},enable:function(t){this.mask|=1<<t|0},enableAll:function(){this.mask=-1},toggle:function(t){this.mask^=1<<t|0},disable:function(t){this.mask&=~(1<<t|0)},disableAll:function(){this.mask=0},test:function(t){return 0!=(this.mask&t.mask)}}),Object.assign(Z.prototype,{isMatrix3:!0,set:function(t,n,e,i,r,o,s,a,u){var c=this.elements;return c[0]=t,c[1]=i,c[2]=s,c[3]=n,c[4]=r,c[5]=a,c[6]=e,c[7]=o,c[8]=u,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(t){var n=this.elements,t=t.elements;return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],this},extractBasis:function(t,n,e){return t.setFromMatrix3Column(this,0),n.setFromMatrix3Column(this,1),e.setFromMatrix3Column(this,2),this},setFromMatrix4:function(t){t=t.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this},multiply:function(t){return this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,n){var t=t.elements,n=n.elements,e=this.elements,i=t[0],r=t[3],o=t[6],s=t[1],a=t[4],u=t[7],c=t[2],h=t[5],t=t[8],f=n[0],l=n[3],d=n[6],v=n[1],p=n[4],m=n[7],y=n[2],b=n[5],n=n[8];return e[0]=i*f+r*v+o*y,e[3]=i*l+r*p+o*b,e[6]=i*d+r*m+o*n,e[1]=s*f+a*v+u*y,e[4]=s*l+a*p+u*b,e[7]=s*d+a*m+u*n,e[2]=c*f+h*v+t*y,e[5]=c*l+h*p+t*b,e[8]=c*d+h*m+t*n,this},multiplyScalar:function(t){var n=this.elements;return n[0]*=t,n[3]*=t,n[6]*=t,n[1]*=t,n[4]*=t,n[7]*=t,n[2]*=t,n[5]*=t,n[8]*=t,this},determinant:function(){var t=this.elements,n=t[0],e=t[1],i=t[2],r=t[3],o=t[4],s=t[5],a=t[6],u=t[7],t=t[8];return n*o*t-n*s*u-e*r*t+e*s*a+i*r*u-i*o*a},getInverse:function(t,n){void 0!==n&&console.warn("THREE.Matrix3: .getInverse() can no longer be configured to throw on degenerate.");var n=t.elements,t=this.elements,e=n[0],i=n[1],r=n[2],o=n[3],s=n[4],a=n[5],u=n[6],c=n[7],n=n[8],h=n*s-a*c,f=a*u-n*o,l=c*o-s*u,d=e*h+i*f+r*l;return 0==d?this.set(0,0,0,0,0,0,0,0,0):(t[0]=h*(h=1/d),t[1]=(r*c-n*i)*h,t[2]=(a*i-r*s)*h,t[3]=f*h,t[4]=(n*e-r*u)*h,t[5]=(r*o-a*e)*h,t[6]=l*h,t[7]=(i*u-c*e)*h,t[8]=(s*e-i*o)*h,this)},transpose:function(){var t=this.elements,n=t[1];return t[1]=t[3],t[3]=n,n=t[2],t[2]=t[6],t[6]=n,n=t[5],t[5]=t[7],t[7]=n,this},getNormalMatrix:function(t){return this.setFromMatrix4(t).getInverse(this).transpose()},transposeIntoArray:function(t){var n=this.elements;return t[0]=n[0],t[1]=n[3],t[2]=n[6],t[3]=n[1],t[4]=n[4],t[5]=n[7],t[6]=n[2],t[7]=n[5],t[8]=n[8],this},setUvTransform:function(t,n,e,i,r,o,s){var a=Math.cos(r),r=Math.sin(r);this.set(e*a,e*r,-e*(a*o+r*s)+o+t,-i*r,i*a,-i*(-r*o+a*s)+s+n,0,0,1)},scale:function(t,n){var e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=n,e[4]*=n,e[7]*=n,this},rotate:function(t){var n=Math.cos(t),t=Math.sin(t),e=this.elements,i=e[0],r=e[3],o=e[6],s=e[1],a=e[4],u=e[7];return e[0]=n*i+t*s,e[3]=n*r+t*a,e[6]=n*o+t*u,e[1]=-t*i+n*s,e[4]=-t*r+n*a,e[7]=-t*o+n*u,this},translate:function(t,n){var e=this.elements;return e[0]+=t*e[2],e[3]+=t*e[5],e[6]+=t*e[8],e[1]+=n*e[2],e[4]+=n*e[5],e[7]+=n*e[8],this},equals:function(t){for(var n=this.elements,e=t.elements,i=0;i<9;i++)if(n[i]!==e[i])return!1;return!0},fromArray:function(t,n){void 0===n&&(n=0);for(var e=0;e<9;e++)this.elements[e]=t[e+n];return this},toArray:function(t,n){var e=this.elements;return(t=void 0===t?[]:t)[n=void 0===n?0:n]=e[0],t[n+1]=e[1],t[n+2]=e[2],t[n+3]=e[3],t[n+4]=e[4],t[n+5]=e[5],t[n+6]=e[6],t[n+7]=e[7],t[n+8]=e[8],t}});var q=0,K=new Tt,J=new at,$=new At,tt=new Tt,nt=new Tt,et=new Tt,it=new at,rt=new Tt(1,0,0),ot=new Tt(0,1,0),ut=new Tt(0,0,1),ct={type:"added"},ht={type:"removed"};function a(){Object.defineProperty(this,"id",{value:q++}),this.uuid=St.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=a.DefaultUp.clone();var t=new Tt,n=new Y,e=new at,i=new Tt(1,1,1);n.At(function(){e.setFromEuler(n,!1)}),e.At(function(){n.setFromQuaternion(e,void 0,!1)}),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:n},quaternion:{configurable:!0,enumerable:!0,value:e},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new At},normalMatrix:{value:new Z}}),this.matrix=new At,this.matrixWorld=new At,this.matrixAutoUpdate=a.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new Q,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}}function ft(){a.call(this),this.type="Camera",this.matrixWorldInverse=new At,this.projectionMatrix=new At,this.projectionMatrixInverse=new At}function dt(t,n,e,i){ft.call(this),this.type="PerspectiveCamera",this.fov=void 0!==t?t:50,this.zoom=1,this.near=void 0!==e?e:.1,this.far=void 0!==i?i:2e3,this.focus=10,this.aspect=void 0!==n?n:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}function vt(t,n,e,i,r,o){ft.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=void 0!==t?t:-1,this.right=void 0!==n?n:1,this.top=void 0!==e?e:1,this.bottom=void 0!==i?i:-1,this.near=void 0!==r?r:.1,this.far=void 0!==o?o:2e3,this.updateProjectionMatrix()}a.DefaultUp=new Tt(0,1,0),a.DefaultMatrixAutoUpdate=!0,a.prototype=Object.assign(Object.create(X.prototype),{constructor:a,isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix4:function(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)},applyQuaternion:function(t){return this.quaternion.premultiply(t),this},setRotationFromAxisAngle:function(t,n){this.quaternion.setFromAxisAngle(t,n)},setRotationFromEuler:function(t){this.quaternion.setFromEuler(t,!0)},setRotationFromMatrix:function(t){this.quaternion.setFromRotationMatrix(t)},setRotationFromQuaternion:function(t){this.quaternion.copy(t)},rotateOnAxis:function(t,n){return J.setFromAxisAngle(t,n),this.quaternion.multiply(J),this},rotateOnWorldAxis:function(t,n){return J.setFromAxisAngle(t,n),this.quaternion.premultiply(J),this},rotateX:function(t){return this.rotateOnAxis(rt,t)},rotateY:function(t){return this.rotateOnAxis(ot,t)},rotateZ:function(t){return this.rotateOnAxis(ut,t)},translateOnAxis:function(t,n){return K.copy(t).applyQuaternion(this.quaternion),this.position.add(K.multiplyScalar(n)),this},translateX:function(t){return this.translateOnAxis(rt,t)},translateY:function(t){return this.translateOnAxis(ot,t)},translateZ:function(t){return this.translateOnAxis(ut,t)},localToWorld:function(t){return t.applyMatrix4(this.matrixWorld)},worldToLocal:function(t){return t.applyMatrix4($.getInverse(this.matrixWorld))},lookAt:function(t,n,e){t.isVector3?tt.copy(t):tt.set(t,n,e);t=this.parent;this.updateWorldMatrix(!0,!1),nt.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?$.lookAt(nt,tt,this.up):$.lookAt(tt,nt,this.up),this.quaternion.setFromRotationMatrix($),t&&($.extractRotation(t.matrixWorld),J.setFromRotationMatrix($),this.quaternion.premultiply(J.inverse()))},add:function(t){if(1<arguments.length)for(var n=0;n<arguments.length;n++)this.add(arguments[n]);else t===this?console.error("THREE.Object3D.add: object can't be added as a child of itself.",t):t&&t.isObject3D?(null!==t.parent&&t.parent.remove(t),(t.parent=this).children.push(t),t.dispatchEvent(ct)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t);return this},remove:function(t){if(1<arguments.length)for(var n=0;n<arguments.length;n++)this.remove(arguments[n]);else{var e=this.children.indexOf(t);-1!==e&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(ht))}return this},attach:function(t){return this.updateWorldMatrix(!0,!1),$.getInverse(this.matrixWorld),null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),$.multiply(t.parent.matrixWorld)),t.applyMatrix4($),t.updateWorldMatrix(!1,!1),this.add(t),this},getObjectById:function(t){return this.getObjectByProperty("id",t)},getObjectByName:function(t){return this.getObjectByProperty("name",t)},getObjectByProperty:function(t,n){if(this[t]===n)return this;for(var e=0,i=this.children.length;e<i;e++){var r=this.children[e].getObjectByProperty(t,n);if(void 0!==r)return r}},getWorldPosition:function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldPosition() target is now required"),t=new Tt),this.updateMatrixWorld(!0),t.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldQuaternion() target is now required"),t=new at),this.updateMatrixWorld(!0),this.matrixWorld.decompose(nt,t,et),t},getWorldScale:function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldScale() target is now required"),t=new Tt),this.updateMatrixWorld(!0),this.matrixWorld.decompose(nt,it,t),t},getWorldDirection:function(t){void 0===t&&(console.warn("THREE.Object3D: .getWorldDirection() target is now required"),t=new Tt),this.updateMatrixWorld(!0);var n=this.matrixWorld.elements;return t.set(n[8],n[9],n[10]).normalize()},raycast:function(){},traverse:function(t){t(this);for(var n=this.children,e=0,i=n.length;e<i;e++)n[e].traverse(t)},traverseVisible:function(t){if(!1!==this.visible){t(this);for(var n=this.children,e=0,i=n.length;e<i;e++)n[e].traverseVisible(t)}},traverseAncestors:function(t){var n=this.parent;null!==n&&(t(n),n.traverseAncestors(t))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),t=!(this.matrixWorldNeedsUpdate=!1));for(var n=this.children,e=0,i=n.length;e<i;e++)n[e].updateMatrixWorld(t)},updateWorldMatrix:function(t,n){var e=this.parent;if(!0===t&&null!==e&&e.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===n)for(var i=this.children,r=0,o=i.length;r<o;r++)i[r].updateWorldMatrix(!1,!0)},clone:function(t){return(new this.constructor).copy(this,t)},copy:function(t,n){if(void 0===n&&(n=!0),this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),!0===n)for(var e=0;e<t.children.length;e++){var i=t.children[e];this.add(i.clone())}return this}}),ft.prototype=Object.assign(Object.create(a.prototype),{constructor:ft,isCamera:!0,copy:function(t,n){return a.prototype.copy.call(this,t,n),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this},getWorldDirection:function(t){void 0===t&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),t=new Tt),this.updateMatrixWorld(!0);var n=this.matrixWorld.elements;return t.set(-n[8],-n[9],-n[10]).normalize()},updateMatrixWorld:function(t){a.prototype.updateMatrixWorld.call(this,t),this.matrixWorldInverse.getInverse(this.matrixWorld)},updateWorldMatrix:function(t,n){a.prototype.updateWorldMatrix.call(this,t,n),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),dt.prototype=Object.assign(Object.create(ft.prototype),{constructor:dt,isPerspectiveCamera:!0,copy:function(t,n){return ft.prototype.copy.call(this,t,n),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this},setFocalLength:function(t){t=.5*this.getFilmHeight()/t;this.fov=2*St.RAD2DEG*Math.atan(t),this.updateProjectionMatrix()},getFocalLength:function(){var t=Math.tan(.5*St.DEG2RAD*this.fov);return.5*this.getFilmHeight()/t},getEffectiveFOV:function(){return 2*St.RAD2DEG*Math.atan(Math.tan(.5*St.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(t,n,e,i,r,o){this.aspect=t/n,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=n,this.view.offsetX=e,this.view.offsetY=i,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t,n=this.near,e=n*Math.tan(.5*St.DEG2RAD*this.fov)/this.zoom,i=2*e,r=this.aspect*i,o=-.5*r,s=this.view,a=(null!==this.view&&this.view.enabled&&(a=s.fullWidth,t=s.fullHeight,o+=s.offsetX*r/a,e-=s.offsetY*i/t,r*=s.width/a,i*=s.height/t),this.filmOffset);0!==a&&(o+=n*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(o,o+r,e,e-i,n,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)}}),vt.prototype=Object.assign(Object.create(ft.prototype),{constructor:vt,isOrthographicCamera:!0,copy:function(t,n){return ft.prototype.copy.call(this,t,n),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this},setViewOffset:function(t,n,e,i,r,o){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=n,this.view.offsetX=e,this.view.offsetY=i,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t,n=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,r=(this.top+this.bottom)/2,o=i-n,i=i+n,n=r+e,r=r-e;null!==this.view&&this.view.enabled&&(e=(this.right-this.left)/this.view.fullWidth/this.zoom,t=(this.top-this.bottom)/this.view.fullHeight/this.zoom,i=(o+=e*this.view.offsetX)+e*this.view.width,r=(n-=t*this.view.offsetY)-t*this.view.height),this.projectionMatrix.makeOrthographic(o,i,n,r,this.near,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)}});var pt=[new Tt,new Tt,new Tt,new Tt,new Tt,new Tt,new Tt,new Tt],mt=new Tt,yt=new jt,bt=new Tt,gt=new Tt,_t=new Tt,wt=new Tt,xt=new Tt,Et=new Tt,Rt=new Tt,Nt=new Tt,Pt=new Tt,Ft=new Tt;function jt(t,n){this.min=void 0!==t?t:new Tt(1/0,1/0,1/0),this.max=void 0!==n?n:new Tt(-1/0,-1/0,-1/0)}function It(t,n,e,i,r){for(var o=0,s=t.length-3;o<=s;o+=3){Ft.fromArray(t,o);var a=r.x*Math.abs(Ft.x)+r.y*Math.abs(Ft.y)+r.z*Math.abs(Ft.z),u=n.dot(Ft),c=e.dot(Ft),h=i.dot(Ft);if(Math.max(-Math.max(u,c,h),Math.min(u,c,h))>a)return!1}return!0}Object.assign(jt.prototype,{isBox3:!0,set:function(t,n){return this.min.copy(t),this.max.copy(n),this},setFromArray:function(t){for(var n=1/0,e=1/0,i=1/0,r=-1/0,o=-1/0,s=-1/0,a=0,u=t.length;a<u;a+=3){var c=t[a],h=t[a+1],f=t[a+2];c<n&&(n=c),h<e&&(e=h),f<i&&(i=f),r<c&&(r=c),o<h&&(o=h),s<f&&(s=f)}return this.min.set(n,e,i),this.max.set(r,o,s),this},setFromBufferAttribute:function(t){for(var n=1/0,e=1/0,i=1/0,r=-1/0,o=-1/0,s=-1/0,a=0,u=t.count;a<u;a++){var c=t.getX(a),h=t.getY(a),f=t.getZ(a);c<n&&(n=c),h<e&&(e=h),f<i&&(i=f),r<c&&(r=c),o<h&&(o=h),s<f&&(s=f)}return this.min.set(n,e,i),this.max.set(r,o,s),this},setFromPoints:function(t){this.makeEmpty();for(var n=0,e=t.length;n<e;n++)this.expandByPoint(t[n]);return this},setFromCenterAndSize:function(t,n){n=mt.copy(n).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this},setFromObject:function(t){return this.makeEmpty(),this.expandByObject(t)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.min.copy(t.min),this.max.copy(t.max),this},makeEmpty:function(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},getCenter:function(t){return void 0===t&&(console.warn("THREE.Box3: .getCenter() target is now required"),t=new Tt),this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(t){return void 0===t&&(console.warn("THREE.Box3: .getSize() target is now required"),t=new Tt),this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)},expandByPoint:function(t){return this.min.min(t),this.max.max(t),this},expandByVector:function(t){return this.min.sub(t),this.max.add(t),this},expandByScalar:function(t){return this.min.addScalar(-t),this.max.addScalar(t),this},expandByObject:function(t){t.updateWorldMatrix(!1,!1);for(var n=t.geometry,e=(void 0!==n&&(null===n.boundingBox&&n.computeBoundingBox(),yt.copy(n.boundingBox),yt.applyMatrix4(t.matrixWorld),this.union(yt)),t.children),i=0,r=e.length;i<r;i++)this.expandByObject(e[i]);return this},containsPoint:function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z},getParameter:function(t,n){return void 0===n&&(console.warn("THREE.Box3: .getParameter() target is now required"),n=new Tt),n.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)},intersectsSphere:function(t){return this.clampPoint(t.center,mt),mt.distanceToSquared(t.center)<=t.radius*t.radius},intersectsPlane:function(t){var n,e=0<t.normal.x?(n=t.normal.x*this.min.x,t.normal.x*this.max.x):(n=t.normal.x*this.max.x,t.normal.x*this.min.x);return 0<t.normal.y?(n+=t.normal.y*this.min.y,e+=t.normal.y*this.max.y):(n+=t.normal.y*this.max.y,e+=t.normal.y*this.min.y),0<t.normal.z?(n+=t.normal.z*this.min.z,e+=t.normal.z*this.max.z):(n+=t.normal.z*this.max.z,e+=t.normal.z*this.min.z),n<=-t.constant&&e>=-t.constant},intersectsTriangle:function(t){return!this.isEmpty()&&(this.getCenter(Rt),Nt.subVectors(this.max,Rt),bt.subVectors(t.a,Rt),gt.subVectors(t.b,Rt),_t.subVectors(t.c,Rt),wt.subVectors(gt,bt),xt.subVectors(_t,gt),Et.subVectors(bt,_t),!!It([0,-wt.z,wt.y,0,-xt.z,xt.y,0,-Et.z,Et.y,wt.z,0,-wt.x,xt.z,0,-xt.x,Et.z,0,-Et.x,-wt.y,wt.x,0,-xt.y,xt.x,0,-Et.y,Et.x,0],bt,gt,_t,Nt))&&!!It([1,0,0,0,1,0,0,0,1],bt,gt,_t,Nt)&&(Pt.crossVectors(wt,xt),It([Pt.x,Pt.y,Pt.z],bt,gt,_t,Nt))},clampPoint:function(t,n){return void 0===n&&(console.warn("THREE.Box3: .clampPoint() target is now required"),n=new Tt),n.copy(t).clamp(this.min,this.max)},distanceToPoint:function(t){return mt.copy(t).clamp(this.min,this.max).sub(t).length()},getBoundingSphere:function(t){return void 0===t&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(t.center),t.radius=.5*this.getSize(mt).length(),t},intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},applyMatrix4:function(t){return this.isEmpty()||(pt[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),pt[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),pt[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),pt[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),pt[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),pt[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),pt[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),pt[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(pt)),this},translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}});var Ct=new jt;function Dt(t,n){this.center=void 0!==t?t:new Tt,this.radius=void 0!==n?n:0}Object.assign(Dt.prototype,{set:function(t,n){return this.center.copy(t),this.radius=n,this},setFromPoints:function(t,n){for(var e=this.center,i=(void 0!==n?e.copy(n):Ct.setFromPoints(t).getCenter(e),0),r=0,o=t.length;r<o;r++)i=Math.max(i,e.distanceToSquared(t[r]));return this.radius=Math.sqrt(i),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.center.copy(t.center),this.radius=t.radius,this},empty:function(){return this.radius<=0},containsPoint:function(t){return t.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(t){return t.distanceTo(this.center)-this.radius},intersectsSphere:function(t){var n=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=n*n},intersectsBox:function(t){return t.intersectsSphere(this)},intersectsPlane:function(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius},clampPoint:function(t,n){var e=this.center.distanceToSquared(t);return void 0===n&&(console.warn("THREE.Sphere: .clampPoint() target is now required"),n=new Tt),n.copy(t),e>this.radius*this.radius&&(n.sub(this.center).normalize(),n.multiplyScalar(this.radius).add(this.center)),n},getBoundingBox:function(t){return void 0===t&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),t=new jt),t.set(this.center,this.center),t.expandByScalar(this.radius),t},applyMatrix4:function(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this},translate:function(t){return this.center.add(t),this},equals:function(t){return t.center.equals(this.center)&&t.radius===this.radius}});var kt=new Tt,Ut=new Tt,Bt=new Z;function Gt(t,n){this.normal=void 0!==t?t:new Tt(1,0,0),this.constant=void 0!==n?n:0}Object.assign(Gt.prototype,{isPlane:!0,set:function(t,n){return this.normal.copy(t),this.constant=n,this},setComponents:function(t,n,e,i){return this.normal.set(t,n,e),this.constant=i,this},setFromNormalAndCoplanarPoint:function(t,n){return this.normal.copy(t),this.constant=-n.dot(this.normal),this},setFromCoplanarPoints:function(t,n,e){e=kt.subVectors(e,n).cross(Ut.subVectors(t,n)).normalize();return this.setFromNormalAndCoplanarPoint(e,t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.normal.copy(t.normal),this.constant=t.constant,this},normalize:function(){var t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(t){return this.normal.dot(t)+this.constant},distanceToSphere:function(t){return this.distanceToPoint(t.center)-t.radius},projectPoint:function(t,n){return void 0===n&&(console.warn("THREE.Plane: .projectPoint() target is now required"),n=new Tt),n.copy(this.normal).multiplyScalar(-this.distanceToPoint(t)).add(t)},intersectLine:function(t,n){void 0===n&&(console.warn("THREE.Plane: .intersectLine() target is now required"),n=new Tt);var e=t.delta(kt),i=this.normal.dot(e);return 0===i?0===this.distanceToPoint(t.start)?n.copy(t.start):void 0:(i=-(t.start.dot(this.normal)+this.constant)/i)<0||1<i?void 0:n.copy(e).multiplyScalar(i).add(t.start)},intersectsLine:function(t){var n=this.distanceToPoint(t.start),t=this.distanceToPoint(t.end);return n<0&&0<t||t<0&&0<n},intersectsBox:function(t){return t.intersectsPlane(this)},intersectsSphere:function(t){return t.intersectsPlane(this)},coplanarPoint:function(t){return void 0===t&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),t=new Tt),t.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(t,n){n=n||Bt.getNormalMatrix(t),t=this.coplanarPoint(kt).applyMatrix4(t),n=this.normal.applyMatrix3(n).normalize();return this.constant=-t.dot(n),this},translate:function(t){return this.constant-=t.dot(this.normal),this},equals:function(t){return t.normal.equals(this.normal)&&t.constant===this.constant}});var Ht=new Dt,Xt=new Tt;function Vt(t,n,e,i,r,o){this.planes=[void 0!==t?t:new Gt,void 0!==n?n:new Gt,void 0!==e?e:new Gt,void 0!==i?i:new Gt,void 0!==r?r:new Gt,void 0!==o?o:new Gt]}Object.assign(Vt.prototype,{set:function(t,n,e,i,r,o){var s=this.planes;return s[0].copy(t),s[1].copy(n),s[2].copy(e),s[3].copy(i),s[4].copy(r),s[5].copy(o),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){for(var n=this.planes,e=0;e<6;e++)n[e].copy(t.planes[e]);return this},setFromProjectionMatrix:function(t){var n=this.planes,t=t.elements,e=t[0],i=t[1],r=t[2],o=t[3],s=t[4],a=t[5],u=t[6],c=t[7],h=t[8],f=t[9],l=t[10],d=t[11],v=t[12],p=t[13],m=t[14],t=t[15];return n[0].setComponents(o-e,c-s,d-h,t-v).normalize(),n[1].setComponents(o+e,c+s,d+h,t+v).normalize(),n[2].setComponents(o+i,c+a,d+f,t+p).normalize(),n[3].setComponents(o-i,c-a,d-f,t-p).normalize(),n[4].setComponents(o-r,c-u,d-l,t-m).normalize(),n[5].setComponents(o+r,c+u,d+l,t+m).normalize(),this},intersectsObject:function(t){var n=t.geometry;return null===n.boundingSphere&&n.computeBoundingSphere(),Ht.copy(n.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(Ht)},intersectsSprite:function(t){return Ht.center.set(0,0,0),Ht.radius=.7071067811865476,Ht.applyMatrix4(t.matrixWorld),this.intersectsSphere(Ht)},intersectsSphere:function(t){for(var n=this.planes,e=t.center,i=-t.radius,r=0;r<6;r++)if(n[r].distanceToPoint(e)<i)return!1;return!0},intersectsBox:function(t){for(var n=this.planes,e=0;e<6;e++){var i=n[e];if(Xt.x=(0<i.normal.x?t.max:t.min).x,Xt.y=(0<i.normal.y?t.max:t.min).y,Xt.z=(0<i.normal.z?t.max:t.min).z,i.distanceToPoint(Xt)<0)return!1}return!0},containsPoint:function(t){for(var n=this.planes,e=0;e<6;e++)if(n[e].distanceToPoint(t)<0)return!1;return!0}});var zt=0,Wt=1,Yt=2,Qt=3,Zt=0,qt=1,Kt=2,Jt=3,$t=0,tn=1,nn=2,en=1,rn=3,on=0,sn=1,an=2,un=0,cn=1,hn=2,fn=3,ln=4,dn=5,vn=100,pn=101,mn=102,yn=103,bn=104,gn=200,_n=201,wn=202,xn=203,En=204,Sn=205,Tn=206,An=207,Mn=208,On=209,Ln=210,Rn=0,Nn=1,Pn=2,Fn=3,jn=4,In=5,Cn=6,Dn=7,kn=0,Un=0,Bn=306,Gn=307,Hn=1e3,Xn=1001,Vn=1002,zn=1003,Wn=1004,Yn=1005,Qn=1006,Zn=1007,qn=1008,Kn=1009,Jn=1010,$n=1011,te=1012,ne=1013,ee=1014,ie=1015,re=1016,oe=1017,se=1018,ae=1019,ue=1020,ce=1021,he=1022,fe=1023,le=1024,de=1025,ve=1026,pe=1027,me=1028,ye=1029,be=1030,ge=1031,_e=1032,we=1033,xe=33776,Ee=33777,Se=33778,Te=33779,Ae=35840,Me=35841,Oe=35842,Le=35843,Re=36196,Ne=37492,Pe=37496,Fe=37808,je=37809,Ie=37810,Ce=37811,De=37812,ke=37813,Ue=37814,Be=37815,Ge=37816,He=37817,Xe=37818,Ve=37819,ze=37820,We=37821,Ye=36492,Qe=37840,Ze=37841,qe=37842,Ke=37843,Je=37844,$e=37845,ti=37846,ni=37847,ei=37848,ii=37849,ri=37850,oi=37851,si=37852,ai=37853,ui=2300,ci=2301,hi=2400,fi=2401,li=3e3,di=3200,vi=3201,pi=0,mi=1,yi=7680,bi=7681,gi=519,_i=35044;function wi(t,n,e){return this.radius=void 0!==t?t:1,this.phi=void 0!==n?n:0,this.theta=void 0!==e?e:0,this}function Mt(t,n){this.x=t||0,this.y=n||0}Object.assign(wi.prototype,{set:function(t,n,e){return this.radius=t,this.phi=n,this.theta=e,this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this},makeSafe:function(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this},setFromVector3:function(t){return this.setFromCartesianCoords(t.x,t.y,t.z)},setFromCartesianCoords:function(t,n,e){return this.radius=Math.sqrt(t*t+n*n+e*e),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(t,e),this.phi=Math.acos(St.clamp(n/this.radius,-1,1))),this}}),Object.defineProperties(Mt.prototype,{width:{get:function(){return this.x},set:function(t){this.x=t}},height:{get:function(){return this.y},set:function(t){this.y=t}}}),Object.assign(Mt.prototype,{isVector2:!0,set:function(t,n){return this.x=t,this.y=n,this},setScalar:function(t){return this.x=t,this.y=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setComponent:function(t,n){switch(t){case 0:this.x=n;break;case 1:this.y=n;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(t){return this.x=t.x,this.y=t.y,this},add:function(t,n){return void 0!==n?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,n)):(this.x+=t.x,this.y+=t.y,this)},addScalar:function(t){return this.x+=t,this.y+=t,this},addVectors:function(t,n){return this.x=t.x+n.x,this.y=t.y+n.y,this},addScaledVector:function(t,n){return this.x+=t.x*n,this.y+=t.y*n,this},sub:function(t,n){return void 0!==n?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,n)):(this.x-=t.x,this.y-=t.y,this)},subScalar:function(t){return this.x-=t,this.y-=t,this},subVectors:function(t,n){return this.x=t.x-n.x,this.y=t.y-n.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},divideScalar:function(t){return this.multiplyScalar(1/t)},applyMatrix3:function(t){var n=this.x,e=this.y,t=t.elements;return this.x=t[0]*n+t[3]*e+t[6],this.y=t[1]*n+t[4]*e+t[7],this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this},clamp:function(t,n){return this.x=Math.max(t.x,Math.min(n.x,this.x)),this.y=Math.max(t.y,Math.min(n.y,this.y)),this},clampScalar:function(t,n){return this.x=Math.max(t,Math.min(n,this.x)),this.y=Math.max(t,Math.min(n,this.y)),this},clampLength:function(t,n){var e=this.length();return this.divideScalar(e||1).multiplyScalar(Math.max(t,Math.min(n,e)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length()||1)},angle:function(){return Math.atan2(-this.y,-this.x)+Math.PI},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var n=this.x-t.x,t=this.y-t.y;return n*n+t*t},manhattanDistanceTo:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,n){return this.x+=(t.x-this.x)*n,this.y+=(t.y-this.y)*n,this},lerpVectors:function(t,n,e){return this.subVectors(n,t).multiplyScalar(e).add(t)},equals:function(t){return t.x===this.x&&t.y===this.y},fromArray:function(t,n){return this.x=t[n=void 0===n?0:n],this.y=t[n+1],this},toArray:function(t,n){return(t=void 0===t?[]:t)[n=void 0===n?0:n]=this.x,t[n+1]=this.y,t},fromBufferAttribute:function(t,n,e){return void 0!==e&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(n),this.y=t.getY(n),this},rotateAround:function(t,n){var e=Math.cos(n),n=Math.sin(n),i=this.x-t.x,r=this.y-t.y;return this.x=i*e-r*n+t.x,this.y=i*n+r*e+t.y,this}});var n={MODE_3D:2,MODE_2D:4},xi=(Object.freeze(n),n),n={NONE:0,EXTRUDE_MARKER:2,FM3DTILE_LAYER:4,IMAGE_MARKER:8,LOCATION_MARKER:16,POLYGON_MARKER:32,TEXT_MARKER:64,LINE_MARKER:128,LINE3D_MARKER:256,HEAT_MAP_MARKER:512,EXTENT:1024,EXTERNAL_MODEL:2048,MODEL:4096,FACILITY:8192,LABEL:16384,DYNAMIC_MODEL_MARKER:32768,DOM_MARKER:65536,SPHERE_MARKER:1<<17,EXTENT_LAYER:1<<20,EXTERNAL_MODEL_LAYER:1<<21,MODEL_LAYER:1<<22,FACILITY_LAYER:1<<23,LABEL_LAYER:1<<24,MARKER_GROUP:1<<25,FLOW_LINE_LAYER:1<<27,FLOW_LINE_MARKER:1<<27,FIRE_MARKER:1<<28,WALL_MARKER:1<<29,TUBE_MARKER:1<<30},E=(n.LAYER_NODE_TYPE=new Map,n.LAYER_NODE_TYPE.set(n.EXTENT_LAYER,n.EXTENT),n.LAYER_NODE_TYPE.set(n.EXTERNAL_MODEL_LAYER,n.EXTERNAL_MODEL),n.LAYER_NODE_TYPE.set(n.MODEL_LAYER,n.MODEL),n.LAYER_NODE_TYPE.set(n.FACILITY_LAYER,n.FACILITY),n.LAYER_NODE_TYPE.set(n.LABEL_LAYER,n.LABEL),n.LAYER_NODE_TYPE.set(n.DOM_MARKER,n.DOM_MARKER),n.LAYER_NODE_TYPE.set(n.DYNAMIC_MODEL_MARKER,n.DYNAMIC_MODEL_MARKER),n.LAYER_NODE_TYPE.set(n.EXTRUDE_MARKER,n.EXTRUDE_MARKER),n.LAYER_NODE_TYPE.set(n.HEAT_MAP_MARKER,n.HEAT_MAP_MARKER),n.LAYER_NODE_TYPE.set(n.LINE_MARKER,n.LINE_MARKER),n.LAYER_NODE_TYPE.set(n.LOCATION_MARKER,n.LOCATION_MARKER),n.LAYER_NODE_TYPE.set(n.POLYGON_MARKER,n.POLYGON_MARKER),n.LAYER_NODE_TYPE.set(n.TEXT_MARKER,n.TEXT_MARKER),n.LAYER_NODE_TYPE.set(n.IMAGE_MARKER,n.IMAGE_MARKER),n.LAYER_NODE_TYPE.set(n.FLOW_LINE_LAYER,n.FLOW_LINE_MARKER),n.LAYER_NODE_TYPE.set(n.FIRE_MARKER,n.FIRE_MARKER),n.LAYER_NODE_TYPE.set(n.WALL_MARKER,n.WALL_MARKER),n.LAYER_NODE_TYPE.set(n.TUBE_MARKER,n.TUBE_MARKER),n.LAYER_NODE_TYPE.set(n.LINE3D_MARKER,n.LINE3D_MARKER),n.LAYER_NODE_TYPE.set(n.SPHERE_MARKER,n.SPHERE_MARKER),n);function Ei(t){return function(t){if(Array.isArray(t))return Si(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,n){var e;if(t)return"string"==typeof t?Si(t,n):"Map"===(e="Object"===(e=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Si(t,n):void 0}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Si(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function Ti(t){return(Ti="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ai(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function Mi(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=Ti(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Ti(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Ti(t)?t:String(t)}(i.key),i)}}function Oi(t,n,e){n&&Mi(t.prototype,n),e&&Mi(t,e),Object.defineProperty(t,"prototype",{writable:!1})}var Li=function(){function f(){Ai(this,f)}return Oi(f,null,[{key:"getPointFromBound",value:function(t){var n=t.min.x,e=t.min.y,i=t.max.x,t=t.max.y;return[{x:n,y:e},{x:n,y:t},{x:i,y:e},{x:i,y:t}]}},{key:"getBoundFromPoint",value:function(t){for(var n=t[0].x,e=t[0].y,i=t[0].x,r=t[0].y,o=0;o<t.length;o++){var s=t[o];n>s.x&&(n=s.x),e>s.y&&(e=s.y),i<s.x&&(i=s.x),r<s.y&&(r=s.y)}return{max:{x:i,y:r},min:{x:n,y:e},size:{x:i-n,y:r-e}}}},{key:"getRotationBound",value:function(t,n){for(var e=new Tt(0,1,0),i=(new At).makeRotationAxis(e,n.getRotation()*Math.PI/180),r=f.getPointFromBound(t),o=[],s=0;s<r.length;s++){var a=(a=new Tt(r[s].x-n.x,0,n.y-r[s].y)).applyMatrix4(i);o.push(a)}for(var u=[],c=0;c<r.length;c++){var h=o[c];u.push({x:h.x+n.x,y:n.y-h.z})}return f.getBoundFromPoint(u)}}]),f}(),Ri=function(){function v(){Ai(this,v)}return Oi(v,null,[{key:"showFloorNode",value:function(t,n){for(var e=0;e<n.Ot.length;e++){var i=n.Ot[e];if(-1<t.getVisibleLevels().indexOf(n.level))for(var r=0;r<i.Ot.length;r++){var o=i.Ot[r];o.Lt||1!=o.visible||t.Nt.Rt.push([e,o])}}}},{key:"showAllNode",value:function(n){for(n.getLevels().forEach(function(t){v.showFloorNode(n,n.getFloor(t))});0<n.Nt.Rt.length;)n.Nt.Pt()}},{key:"recoveAllNode",value:function(t){t.enableUpdateNode(),t.Nt.Ft()}},{key:"setVisibleLevelsFrustumCulled",value:function(t,n){for(var e=t.jt,i=t.getVisibleLevels(),r=0;r<i.length;r++){var o=i[r]+"_"+E.LABEL,s=i[r]+"_"+E.FACILITY,a=i[r]+"_"+E.TEXT_MARKER,u=i[r]+"_"+E.IMAGE_MARKER,o=e.It.get(o),s=e.It.get(s),a=e.It.get(a),u=e.It.get(u),c=[];o&&o.children&&c.push.apply(c,Ei(o.children)),s&&s.children&&c.push.apply(c,Ei(s.children)),a&&a.children&&c.push.apply(c,Ei(a.children)),u&&u.children&&c.push.apply(c,Ei(u.children)),c.forEach(function(t){t.frustumCulled=n})}}},{key:"setValue",value:function(t,n,e){e[t]=n}},{key:"getValue",value:function(t,n){return n[t]}},{key:"addLastFrame",value:function(n,e){var i=window.devicePixelRatio||1,t=n.jt.renderer,r=t.domElement.parentElement,o=t.domElement.clientWidth,s=t.domElement.clientHeight,a=document.createElement("canvas"),u=(a.width=o*i,a.height=s*i,a.style.width=o+"px",a.style.height=s+"px",a.style.position="absolute",a.style.zIndex=1,a.className="exportImageLastFrame",a.getContext("2d")),c=new Image;c.onload=function(t){u.drawImage(t.path[0],0,0,o*i,s*i),r.append(a),n.Dt.Ct({type:"printBefor"}),e()},c.onerror=function(t){console.warn("fail...",t)},n.jt.render(),c.src=t.domElement.toDataURL()}},{key:"removeLastFrame",value:function(t){var n=t.jt.renderer,e=document.querySelector(".exportImageLastFrame"),n=n.domElement.parentElement;n&&e&&n.removeChild(e),t.Dt.Ct({type:"printAfter"})}},{key:"start",value:function(t){var n={callback:null,viewParam:{width:0,height:0},state:{col:0,row:0,loadCount:0},camera:null,backCamera:null,width:0,height:0,padding:0,canvas:null,renderTarget:null,cameraType:null,defaultLogoAspact:null},e=t.padding,i=t.map,r=t.imageWidth,o=t.imageHieght,s=t.callback,a=t.bound,t=t.cameraType,u=(a&&(v.setValue("originBound",{max:{x:a.max.x,y:a.max.y},min:{x:a.min.x,y:a.min.y}},n),a.size||(a.size.x=a.max.x-a.min.x,a.size.y=a.max.y-a.min.y),u=r/a.size.x,c=o/a.size.y,a=Li.getRotationBound(a,i),Math.abs(c-u)<.1)&&(r=a.size.x*u,o=a.size.y*c),v.setValue("mapZoom",i.getZoom(),n),v.setValue("cameraType",t||"2d",n),v.setValue("backCamera","2d"==n.cameraType?i.kt:{aspect:i.kt.aspect},n),r/o),c=(15e3<(o=15e3<r?+(r=15e3)/u:o)&&(r=(o=15e3)*u),e=e||0,e*=2,r=Math.ceil(r),o=Math.ceil(o),v.setValue("width",r,n),v.setValue("height",o,n),i.jt.renderer.domElement.clientWidth),t=i.jt.renderer.domElement.clientHeight,u=(v.setValue("defaultLogoAspact",c/t,n),v.setValue("domSize",{width:c,height:t},n),v.setValue("padding",e,n),v.setValue("callback",s,n),{width:r,height:o}),c=(4096<u.width&&(u.width=4096),4096<u.height&&(u.height=4096),v.setValue("viewParam",u,n),Math.ceil(r/n.viewParam.width)),t=Math.ceil(o/n.viewParam.height),s=(v.setValue("state",{col:c,row:t,loadCount:0},n),document.createElement("canvas"));s.width=r,s.height=o,s.style.width=r+"px",s.style.height=o+"px",v.setValue("canvas",s,n),"2d"==n.cameraType?(c=v.getCameraParame2d(i,r,o,a,e,void 0,n),v.setValue("camera",c,n),i.kt=c):"3d"==n.cameraType&&v.setCameraParame3d(i,r,o,null,e,n),i.jt.renderer.setPixelRatio(1),i.jt.renderer.setSize(u.width,u.height),i.Dt.Ct({type:"viewModeChanged"}),v.shot(i,s,n)}},{key:"print",value:function(t){v.addLastFrame(t.map,function(){v.start(t)})}},{key:"recoverParam",value:function(t,n){"2d"===n.cameraType?(t.kt=v.getValue("backCamera",n),t.Ut=t.kt):"3d"===n.cameraType&&(e=v.getValue("backCamera",n),t.kt.aspect=e.aspect,t.kt.clearViewOffset());var e=v.getValue("domSize",n),i=window.devicePixelRatio||1;t.jt.renderer.setPixelRatio(i),t.jt.renderer.setSize(e.width,e.height),t.Dt.Ct({type:"viewModeChanged"}),v.recoveAllNode(t,n),v.setLogo(t,v.getValue("defaultLogoAspact",n)),t.Gt.Bt.object=t.kt,v.setVisibleLevelsFrustumCulled(t,!0),t.jt.Ht(),t.jt.Xt=!0,t.jt.renderer.clear(),t.jt.render(),t.enableUpdateNode(),v.removeLastFrame(t)}},{key:"getCameraParame2d",value:function(t,n,e,i,r,o,s){var a,u,c,h,f=Math.min(n,e),o=o||(f-r)/f,r=t.getState(),f=i.min,i=i.max,l=Math.abs(i.x-f.x),i=Math.abs(i.y-f.y),f=n/e,n=(f<i/l?(c=-l/2,h=l/2,a=-l/f/2,u=l/f/2):(a=-i/2,u=i/2,c=-i*f/2,h=i*f/2),new vt(c,h,u,a,1,1e4));n.zoom=o,n.up=new Tt(0,1,0),n.rotation.x=-Math.PI/2,n.rotation.y=0,n.rotation.z=-r.rotation*Math.PI/180;e=t.getBound().center,l=v.getValue("originBound",s),i=(l.max.x+l.min.x)/2-e.x,f=(l.max.y+l.min.y)/2-e.y;return n.position.x=i,n.position.y=t.kt.position.y,n.position.z=-f,n.updateProjectionMatrix(),n.updateMatrix(),n.updateMatrixWorld(),n.updateWorldMatrix(),n.matrixWorldNeedsUpdate=!0,n}},{key:"setCameraParame3d",value:function(t,n,e,i,r,o){t.kt.aspect=n/e,v.setValue("camera",t.kt,o)}},{key:"readPixcel",value:function(e,i,r,o){var t=v.getValue("state",o),s=t.row,a=t.col,t=e.jt.renderer,u=v.getValue("canvas",o),n=v.getValue("viewParam",o),c=n.width,h=n.height,f=u.getContext("2d"),n=document.createElement("canvas"),l=(n.width=c,n.height=h,n.getContext("2d")),d=v.getValue("callback",o),n=new Image;n.onload=function(t){var n=v.getValue("state",o);n.loadCount++,v.setValue("state",n,o),l.drawImage(t.path[0],0,0,c,h),f.putImageData(l.getImageData(0,0,c,h),i,r),n.loadCount===s*a&&(u.toBlob(function(t){d&&d(t)}),v.recoverParam(e,o),o.callback=null,o.viewParam=null,o.state=null,o.camera=null,o.backCamera=null,o.canvas=null,o=null)},e.jt.render(),n.src=t.domElement.toDataURL()}},{key:"setLogo",value:function(t,n){t.jt.needLogo&&(n=Math.min(n,1),t.jt.Vt.material.uniforms.offset.value.x=-1*(.5*.4/n-1))}},{key:"caleAvoid",value:function(t,n){var e,i;"2d"!=t.cameraType&&t.cameraType,"2d"==t.cameraType?(v.showAllNode(n,t),i=v.getValue("width",t),e=v.getValue("height",t),n.jt.renderer.setSize(i,e),n.jt.Ht(),n.jt.zt(),i=v.getValue("viewParam",t),n.jt.renderer.setSize(i.width,i.height)):(n.jt.Ht(),n.jt.zt())}},{key:"shot",value:function(t,n,e){v.setLogo(t,e.width/e.height);var i=v.getValue("camera",e),r=(t.jt.Xt=!0,v.setVisibleLevelsFrustumCulled(t,!1),v.getValue("state",e)),o=r.row,s=r.col,a=v.getValue("viewParam",e);v.caleAvoid(e,t);for(var u=0;u<o*s;u++){var c=Math.floor(u/s),h=Math.max(u-c*s,0),f=n.width,l=n.height,d=new Image,c=(d.indexI=c,d.indexJ=h,a.width*d.indexJ),h=a.height*d.indexI;i.setViewOffset(f,l,c,h,a.width,a.height),i.updateProjectionMatrix(),v.readPixcel(t,c,h,e)}}}]),v}();function Ni(t){return(Ni="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Pi(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=Ni(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Ni(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Ni(t)?t:String(t)}(i.key),i)}}var n=function(){function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this.X={x:Number.MAX_VALUE,y:Number.MAX_VALUE},this.H={x:-Number.MAX_VALUE,y:-Number.MAX_VALUE}}var n,e,i;return n=t,(e=[{key:"min",get:function(){return this.X}},{key:"max",get:function(){return this.H}},{key:"center",get:function(){var t={x:Number.NaN,y:Number.NaN};return this.valid()&&(t.x=(this.min.x+this.max.x)/2,t.y=(this.min.y+this.max.y)/2),t}},{key:"size",get:function(){var t={x:Number.NaN,y:Number.NaN};return this.valid()&&(t.x=this.max.x-this.min.x,t.y=this.max.y-this.min.y),t}},{key:"copy",value:function(t){return this.H.x=t.max.x,this.H.y=t.max.y,this.X.x=t.min.x,this.X.y=t.min.y,this}},{key:"clone",value:function(){return(new t).copy(this)}},{key:"reset",value:function(){this.X={x:Number.MAX_VALUE,y:Number.MAX_VALUE},this.H={x:-Number.MAX_VALUE,y:-Number.MAX_VALUE}}},{key:"toObject",value:function(){return{min:this.min,max:this.max,center:this.center,size:this.size}}},{key:"expand",value:function(t){this.Wt(t)}},{key:"expandByCoords",value:function(t){this.Yt(t)}},{key:"valid",value:function(){return this.Qt()}},{key:"isCross",value:function(t){var n=!0;return t.max.x<this.min.x&&(n=!1),t.min.x>this.max.x&&(n=!1),t.max.y<this.min.y&&(n=!1),n=t.min.y>this.max.y?!1:n}}])&&Pi(n.prototype,e),i&&Pi(n,i),Object.defineProperty(n,"prototype",{writable:!1}),t}(),Fi=(Object.assign(n.prototype,{Qt:function(){return!(this.min.x>this.max.x||this.min.y>this.max.y)},Wt:function(t){t&&t.valid()&&(t.min.x<this.min.x&&(this.min.x=t.min.x),t.min.y<this.min.y&&(this.min.y=t.min.y),t.max.x>this.max.x&&(this.max.x=t.max.x),t.max.y>this.max.y)&&(this.max.y=t.max.y)},Yt:function(t){var n=this;t&&0!=t.length&&t.forEach(function(t){t.x<n.min.x&&(n.min.x=t.x),t.y<n.min.y&&(n.min.y=t.y),t.x>n.max.x&&(n.max.x=t.x),t.y>n.max.y&&(n.max.y=t.y)})}}),n);function ji(t){return(ji="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ii(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=ji(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=ji(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==ji(t)?t:String(t)}(i.key),i)}}var n=function(){function n(t){if(!(this instanceof n))throw new TypeError("Cannot call a class as a function");this.Zt=t.size,this.qt=t.rotation,this.Kt=t.center}var t,e,i;return t=n,(e=[{key:"min",get:function(){return{x:this.Kt.x-this.Zt.x/2,y:this.Kt.y-this.Zt.y/2}}},{key:"max",get:function(){return{x:this.Kt.x+this.Zt.x/2,y:this.Kt.y+this.Zt.y/2}}},{key:"center",get:function(){return{x:this.Kt.x,y:this.Kt.y}}},{key:"rotation",get:function(){return this.qt}},{key:"size",get:function(){return{x:this.Zt.x,y:this.Zt.y}}},{key:"clone",value:function(){return new n({size:this.Zt,center:this.Kt,rotation:this.qt})}},{key:"valid",value:function(){return!(this.min.x>this.max.x||this.min.y>this.max.y)}},{key:"expand",value:function(t){t&&t.valid()&&(t.min.x<this.min.x&&(this.min.x=t.min.x),t.min.y<this.min.y&&(this.min.y=t.min.y),t.max.x>this.max.x&&(this.max.x=t.max.x),t.max.y>this.max.y)&&(this.max.y=t.max.y)}}])&&Ii(t.prototype,e),i&&Ii(t,i),Object.defineProperty(t,"prototype",{writable:!1}),n}(),st=t(0);function Ci(t){return(Ci="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Di(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=Ci(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Ci(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Ci(t)?t:String(t)}(i.key),i)}}var ki=function(){function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function")}var n,e,i;return n=t,i=[{key:"getBrowser",value:function(){if(void 0!==navigator){var t,n,e,i,r,o,s=navigator.userAgent;if(void 0!==s)return t=-1<s.indexOf("Opera"),o=-1<s.indexOf("compatible")&&-1<s.indexOf("MSIE")&&!t,n=-1<s.indexOf("Edge"),e=-1<s.indexOf("Firefox"),i=-1<s.indexOf("Safari")&&-1===s.indexOf("Chrome"),r=-1<s.indexOf("Chrome")&&-1<s.indexOf("Safari"),o?(new RegExp("MSIE (\\d+\\.\\d+);").test(s),7===(o=parseFloat(RegExp.$1))?"IE7":8===o?"IE8":9===o?"IE9":10===o?"IE10":11===o?"IE11":"IE"):t?"Opera":n?"Edge":e?"FF":i?"Safari":r?"Chrome":void 0}}}],(e=null)&&Di(n.prototype,e),i&&Di(n,i),Object.defineProperty(n,"prototype",{writable:!1}),t}().getBrowser();function Ui(t){return(Ui="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Bi(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function Gi(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=Ui(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Ui(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Ui(t)?t:String(t)}(i.key),i)}}function Hi(t,n,e){n&&Gi(t.prototype,n),e&&Gi(t,e),Object.defineProperty(t,"prototype",{writable:!1})}var Xi=function(){function o(){Bi(this,o)}return Hi(o,null,[{key:"getRenderNode",value:function(t){var n=null;if(t)return t.getRenderNode?(n=t.getRenderNode())&&"Group"===n.type&&(n=n.children[0]):t.Lt&&(n=t.Lt),n}},{key:"downLoad",value:function(t){var n,e=new FileReader;e.readAsDataURL(t),e.onload=function(t){(n=t.target.result).length<6||((t=document.createElement("a")).download=(new Date).getTime()+".jpg",t.href=n,document.body.appendChild(t),t.click(),t.remove())}}},{key:"setLogo",value:function(t,n){t.jt.needLogo&&(n=Math.min(n,1),t.jt.Vt.material.uniforms.offset.value.x=-1*(.5*.4/n-1))}},{key:"setVisibleLevelsFrustumCulled",value:function(t,n,e){this.forEachElement(t,n,function(t){var n=o.getRenderNode(t);n&&(n.frustumCulled=e),t.type===E.LABEL&&null!=(n=t.getRenderNode())&&n.children.forEach(function(t){t.frustumCulled=e})})}},{key:"byZoomUpdateVisible",value:function(t,r,o){t.jt.It.forEach(function(t,n){if(+n.split("%A%B%C%D")[1]===o)for(var e=0;e<t.children.length;e++){var i=t.children[e];("Mesh"===i.type||"Scene"===i.type||"Sprite"===i.type)&&i.mapNode.Jt&&i.mapNode.G&&i.mapNode.G.maxlevel&&(r<i.mapNode.G.maxlevel&&r>=i.mapNode.G.minlevel||!i.mapNode.G.maxlevel?i.visible=!0:i.visible=!1)}})}},{key:"recoveAllNode",value:function(t){for(t.enableUpdateNode(),t.Nt.Ft();0<t.Nt.Rt.length;)t.Nt.Pt()}},{key:"addLastFrame",value:function(t,n){var e=st.a.window.devicePixelRatio||1,i=t.jt.renderer,r=i.domElement.parentElement,o=i.domElement.clientWidth,s=i.domElement.clientHeight,a=document.createElement("canvas"),u=(a.width=o*e,a.height=s*e,a.style.width=o+"px",a.style.height=s+"px",a.style.position="absolute",a.style.zIndex=0,a.className="exportImageLastFrame",a.getContext("2d")),c=new Image,h=(c.crossOrigin="Anonymous",c.onload=function(){u.drawImage(c,0,0,o*e,s*e),r.append(a),t.Dt.Ct({type:"printBefor"}),n()},c.onerror=function(t){console.warn("fail...",t)},t.jt.render(),"FF"===ki?"image/jpeg":"image/png");c.src=i.domElement.toDataURL(h,1)}},{key:"insideBound",value:function(t,n){var e=!1;return e=t.min.x>=n.min.x&&t.min.y>=n.min.y&&t.max.x<=n.max.x&&t.max.y<=n.max.y?!0:e}},{key:"forEachElement",value:function(t,n,e){for(var i=t.getFloor(n),r=0;r<i.Ot.length;r++)for(var o=i.Ot[r],s=0;s<o.Ot.length;s++)e(o.Ot[s])}},{key:"getInBoundSpriteElement",value:function(t,n,e,i){var r=this;this.forEachElement(t,n,function(t){var n=o.getRenderNode(t);n&&"Sprite"===n.type&&r.insideBound(t.bound,e)&&(t.type!==E.LABEL||0<t.text.length)&&i.push(t)})}},{key:"getElementBound",value:function(t){var n=new Fi;return t.forEach(function(t){n.expand(t.bound)}),n}}]),o}(),Vi=function(){function h(){Bi(this,h)}return Hi(h,null,[{key:"getSpriteWorldSize",value:function(t,n,e,i){if(t.parent.isHasText){var r=t.getScreenSize();if(!r||isNaN(r.width)||isNaN(r.height))return null;s=r.width,r=r.height}else var o=Xi.getRenderNode(t).material.userData.scaleRatio||1,s=(r=t.Zt||t.fontSize)/o;return{x:s*Math.abs(n.left-n.right)/n.zoom/i,y:r*Math.abs(n.top-n.bottom)/n.zoom/e}}},{key:"getSpriteBound",value:function(t,n,e,i){var r={},o={},s=(t=Math.ceil(t),n=Math.ceil(n),new Fi);return r.x=e.x-i.x*t,o.x=e.x+(1-i.x)*t,o.y=e.y-i.y*n,r.y=e.y+(1-i.y)*n,s.expandByCoords([r,o]),s}},{key:"calcElements",value:function(t,n,e,i,r){for(var o=0;o<t.length;o++){var s,a,u=t[o],c=Xi.getRenderNode(u);c&&"Sprite"===c.type&&(s=h.getSpriteWorldSize(u,e,i,r))&&(a=void 0,a=u.getAnchor?u.getAnchor():c.center,c=h.getSpriteBound(s.x,s.y,u.bound.center,a),isNaN(c.size.x)||isNaN(c.size.y)||c.size.x===1/0||c.size.y===1/0||n.expand(c))}}},{key:"getWidthSpriteBound",value:function(t,n,e,i,r){this.calcElements(t,r,n,e,i)}}]),h}(),zi=function(){function e(){Bi(this,e)}return Hi(e,null,[{key:"createCamera",value:function(){var t=new vt(-1,1,1,-1,1,1e4);return t.up=new Tt(0,1,0),t}},{key:"calcExportWidthHeight",value:function(t){var n=t[0].distanceTo(t[1]);return{exportWidth:t[1].distanceTo(t[2]),exportHeight:n}}},{key:"updateCamera",value:function(t,n,e,i,r){r.left=-n/2,r.right=n/2,r.top=e/2,r.bottom=-e/2;var o=1,s=i.center,a=i.size,i=null!=(i=i.rotation)?i:0,o=n/e>a.x/a.y?e/a.y:n/a.x;r.rotation.x=-Math.PI/2,r.rotation.y=0,r.rotation.z=-i*Math.PI/180;e=t.Ot[0].x,n=t.Ot[0].y,a=s.x-e,i=n-s.y;r.position.x=a,r.position.y=(t.getLevels().length+1)*t.getFloorSpace(),r.position.z=i,r.zoom=o,r.updateProjectionMatrix(),r.updateMatrixWorld()}},{key:"readOptions",value:function(t,n,e){e.autoDownload=void 0===e.autoDownload||e.autoDownload,e.isExpandbound=void 0===e.isExpandbound||e.isExpandbound,e.padding=void 0!==e.padding?e.padding:5,e.color=void 0!==e.color?e.color:"rgba(255, 255, 255, 1.0)",e.imageWidth=void 0!==e.width?e.width:1e3,e.imageHeight=void 0!==e.height?e.height:1e3,delete e.width,delete e.height;15e3<e.imageWidth&&(e.imageWidth=15e3),15e3<e.imageHeight&&(e.imageHeight=15e3),e.imageWidth<200&&(e.imageWidth=200),e.imageHeight<200&&(e.imageHeight=200),e.imageWidth=Math.ceil(e.imageWidth),e.imageHeight=Math.ceil(e.imageHeight),e.level=void 0!==e.level?e.level:1,e.oldLevel=t.getLevel(),e.bound=n,e.map=t}},{key:"initOptions",value:function(t){(t=Object.assign(t,{renderSizeMap:{width:null,height:null},renderSizeExport:{width:0,height:0},camera:null,backCamera:null,imageRenderSize:{width:null,height:null}})).renderSizeMap={width:t.map.jt.renderer.domElement.clientWidth,height:t.map.jt.renderer.domElement.clientHeight},t.imageRenderSize={width:t.imageWidth-2*t.padding,height:t.imageHeight-2*t.padding},t.renderSizeExport={width:t.imageRenderSize.width,height:t.imageRenderSize.height};2048<t.renderSizeExport.width&&(t.renderSizeExport.width=2048),2048<t.renderSizeExport.height&&(t.renderSizeExport.height=2048),t.backCamera=t.map.camera,t.camera=this.createCamera()}},{key:"findSpriteElement",value:function(t,n,e){var i=[];return Xi.getInBoundSpriteElement(t,n,e,i),i}},{key:"expandBoundBySprite",value:function(t,n){for(var e=n.bound.clone(),i=0;i<100&&(this.updateCamera(n.map,n.imageRenderSize.width,n.imageRenderSize.height,e,n.camera),Vi.getWidthSpriteBound(t,n.camera,n.imageRenderSize.height,n.imageRenderSize.width,e),!(15e3<e.size.x||15e4<e.size.y));i++);var r=n.bound.clone();return r.expand(e),r}},{key:"addLastFrame",value:function(t,n){Xi.addLastFrame(t,n)}},{key:"befor",value:function(s){return new Promise(function(t,n){var e=s.style,i=void 0===e?[]:e,e=s.map,r=s.level,o=(e.Nt.$t=!1,[]);Xi.forEachElement(e,r,function(n){i.forEach(function(t){if(t.type===n.type)switch(t.type){case E.LABEL:0<n.text.length&&o.push(n.tn(t.fontSize));break;case E.TEXT_MARKER:n.Lt.userData.originFontSize=n.fontSize,n.fontSize=t.fontSize,n.update();break;case E.FACILITY:n.size=t.size;break;case E.IMAGE_MARKER:n.Lt.userData.originSize=n.size,n.size=t.size}})}),Promise.all(o).then(t)})}},{key:"after",value:function(t){var n=t.style,e=void 0===n?[]:n,n=t.map,t=t.level;n.Nt.$t=!0,Xi.forEachElement(n,t,function(n){e.forEach(function(t){if(t.type===n.type)switch(t.type){case E.LABEL:n.fontSize=null;break;case E.FACILITY:n.size=null;break;case E.IMAGE_MARKER:n.size=n.Lt.userData.originSize,delete n.Lt.userData.originSize;break;case E.TEXT_MARKER:n.fontSize=n.Lt.userData.originFontSize,delete n.Lt.userData.originFontSize,n.update()}})})}},{key:"caleAvoid",value:function(t){Xi.byZoomUpdateVisible(t.map,t.map.getZoom(),t.level),t.map.setDevicePixalRatio(1),e.showAllLevelNode(t.map,t.level),t.map.jt.renderer.setSize(t.imageRenderSize.width,t.imageRenderSize.height),t.map.jt.Ht(),t.map.jt.Xt=!0,t.map.jt.zt(),Xi.forEachElement(t.map,t.level,function(t){t.updateSize?t.updateSize():t.nn&&t.nn()}),t.map.jt.renderer.setSize(t.renderSizeExport.width,t.renderSizeExport.height)}},{key:"start",value:function(t,n){var e=t.map,i=t.imageRenderSize,r=t.renderSizeExport,o=t.camera,s=(Xi.setLogo(e,i.width/i.height),Xi.setVisibleLevelsFrustumCulled(e,t.level,!1),this.caleAvoid(t),document.createElement("canvas")),a=(s.width=t.imageWidth,s.height=t.imageHeight,s.style.width=t.imageWidth+"px",s.style.height=t.imageHeight+"px",s.getContext("2d")),u=(a.fillStyle=t.color,a.fillRect(0,0,t.imageWidth,t.imageHeight),{col:0,row:0,loadCount:0});if(u.col=Math.ceil(t.imageRenderSize.width/t.renderSizeExport.width),u.row=Math.ceil(t.imageRenderSize.height/t.renderSizeExport.height),isNaN(u.col)||isNaN(u.row))n(null);else for(var c=0;c<u.row*u.col;c++){var h=Math.floor(c/u.col),f=Math.max(c-h*u.col,0),f=r.width*f,h=r.height*h;o.setViewOffset(i.width,i.height,f,h,r.width,r.height),o.updateProjectionMatrix(),this.renderImage(f,h,u,s,a,n,t)}}},{key:"renderDomMarker",value:function(a){if(a.dependent&&a.dependent.html2canvas){a.camera.view=null,this.updateCamera(a.map,a.width,a.height,a.bound,a.camera);for(var t=a.width/2,n=a.height/2,e=new Tt,i=new At,r=new At,u=(i.copy(a.camera.matrixWorldInverse),r.multiplyMatrices(a.camera.projectionMatrix,i),[]),o=[],s=a.map.en,c=0;c<s.Ot.length;c++){var h=s.Ot[c];h.level===a.level&&(e.setFromMatrixPosition(h.Lt.matrixWorld),e.applyMatrix4(r),u.push({x:e.x*t+t,y:-e.y*n+n}),h=a.dependent.html2canvas(h.Lt.element.childNodes[0],{backgroundColor:null}),o.push(h))}0==o.length?a.callback(a.canvasAll):Promise.all(o).then(function(r){for(var o=0,s=0;s<r.length;s++)!function(){var t=r[s],n=u[s],e=new Image,i=(e.onload=function(){o+=1,a.ctxAll.drawImage(e,n.x-t.width/2,n.y-t.height/2),o===r.length&&a.callback(a.canvasAll)},e.onerror=function(t){(o+=1)===r.length&&a.callback(a.canvasAll),console.error(t)},"FF"===ki?"image/jpeg":"image/png");e.src=t.toDataURL(i,1)}()}).catch(function(t){console.error(t),a.callback(a.canvasAll)})}else a.callback(a.canvasAll)}},{key:"renderImage",value:function(t,n,e,i,r,o,s){var a=this,u=s.map,c=s.padding,h=s.renderSizeExport,f=document.createElement("canvas"),l=(f.width=h.width,f.height=h.height,f.getContext("2d")),d=new Image,f=(d.crossOrigin="Anonymous",d.onload=function(){e.loadCount++,l.drawImage(d,0,0,h.width,h.height),r.putImageData(l.getImageData(0,0,h.width,h.height),t+c,n+c),e.loadCount===e.row*e.col&&a.renderDomMarker({ctxAll:r,level:s.level,canvasAll:i,map:s.map,width:s.imageWidth,height:s.imageHeight,camera:s.camera,dependent:s.dependent,bound:s.bound,callback:function(t){t.toBlob(function(t){s.autoDownload&&Xi.downLoad(t),o(t)})}})},u.jt.render(),"FF"===ki?"image/jpeg":"image/png");d.src=u.jt.renderer.domElement.toDataURL(f,1)}},{key:"recoverParam",value:function(t){var n=t.map,e=(n.kt=t.backCamera,t.renderSizeMap),i=window.devicePixelRatio||1;n.jt.renderer.setSize(e.width,e.height),n.setDevicePixalRatio(i),Xi.forEachElement(n,t.level,function(t){t.updateSize?t.updateSize():t.nn&&t.nn()}),Xi.recoveAllNode(n,t),Xi.setLogo(n,e.width/e.height),n.Gt.Bt.object=n.kt,Xi.setVisibleLevelsFrustumCulled(n,t.level,!0),n.jt.Ht(),n.jt.Xt=!0,n.enableUpdateNode()}},{key:"showFloorNode",value:function(t,n){for(var e=0;e<n.Ot.length;e++){var i=n.Ot[e];if(-1<n.parent.visibleLevels.indexOf(n.level))for(var r=0;r<i.Ot.length;r++){var o=i.Ot[r];Xi.getRenderNode(o)||1!=o.visible||t.Nt.Rt.push([e,o])}}}},{key:"removeLastFrame",value:function(t){var n=t.jt.renderer.domElement.parentElement;n&&n.childNodes.forEach(function(t){"exportImageLastFrame"===t.className&&n.removeChild(t)}),t.Dt.Ct({type:"printAfter"})}},{key:"showAllLevelNode",value:function(t,n){for(e.showFloorNode(t,t.getFloor(n));0<t.Nt.Rt.length;)t.Nt.Pt()}}]),e}(),B=t(1);function Wi(t){return(Wi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Yi(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=Wi(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Wi(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Wi(t)?t:String(t)}(i.key),i)}}function Qi(t,n,e){return n&&Yi(t.prototype,n),e&&Yi(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var e=Qi(function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this.rn=!1,this.sn=new Map,this.an=new Map}),Zi=(Object.assign(e.prototype,{un:function(t,n){this.an.has(t)||this.an.set(t,new Set),this.an.get(t).add(n)},cn:function(){this.sn.clear(),this.sn=null,this.an.clear(),this.an=null}}),e);function qi(t){return(qi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ki(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=qi(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=qi(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==qi(t)?t:String(t)}(i.key),i)}}function Ji(t,n,e){n=tr(n);var i=t,n=$i()?Reflect.construct(n,e||[],tr(t).constructor):n.apply(t,e);if(n&&("object"===qi(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function $i(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return($i=function(){return!!t})()}function tr(t){return(tr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function nr(t,n){return(nr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}e=function(){var t,n,e=r,i=Zi;if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");function r(){var t;if(this instanceof r)return(t=Ji(this,r)).hn=0,t.ln=0,t.dn=new Map,t;throw new TypeError("Cannot call a class as a function")}return e.prototype=Object.create(i&&i.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),i&&nr(e,i),e=r,t&&Ki(e.prototype,t),n&&Ki(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}();Object.assign(e.prototype,{vn:function(t,n,e){var i;return this.sn.has(t)?(i=this.sn.get(t),n&&(i.isComplete?i.isError?n(null):n(i):this.un(t,n))):i=this.pn(t,n,e),i},pn:function(n,t,e){var i,r=this;return this.hn++,(i=st.a.environment===B.a.WX?st.a.textureHelper.createImage(e):new Image).crossOrigin="Anonymous",i.onload="IE11"===ki?new function(){this.ln++,i.isComplete=!0,r.mn(n,i)}:function(){r.ln++,i.isComplete=!0,r.mn(n,i)},i.onerror=function(t){r.ln++,i.isComplete=!0,i.isError=!0,r.mn(n,null)},i.src=n,i.isComplete=!1,this.sn.set(n,i),t&&this.un(n,t),i},mn:function(t,i){this.an.has(t)&&(this.an.get(t).forEach(function(t,n,e){n(i),e.delete(t)}),this.an.delete(t)),0<this.dn.size&&this.hn===this.ln&&this.dn.forEach(function(t,n){t(n)})},cn:function(){this.sn.clear(),this.an.clear()}});var er=new e;function ir(t,n,e){var i=this,r=!1,o=0,s=0,a=void 0,u=[];this.onStart=void 0,this.onLoad=t,this.onProgress=n,this.onError=e,this.itemStart=function(t){s++,!1===r&&void 0!==i.onStart&&i.onStart(t,o,s),r=!0},this.itemEnd=function(t){o++,void 0!==i.onProgress&&i.onProgress(t,o,s),o===s&&(r=!1,void 0!==i.onLoad)&&i.onLoad()},this.itemError=function(t){void 0!==i.onError&&i.onError(t)},this.resolveURL=function(t){return a?a(t):t},this.setURLModifier=function(t){return a=t,this},this.addHandler=function(t,n){return u.push(t,n),this},this.removeHandler=function(t){t=u.indexOf(t);return-1!==t&&u.splice(t,2),this},this.getHandler=function(t){for(var n=0,e=u.length;n<e;n+=2){var i=u[n],r=u[n+1];if(i.global&&(i.lastIndex=0),i.test(t))return r}return null},this.isLoaded=function(){return o===s}}var rr=new ir;function or(t){return(or="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function sr(){sr=function(){return s};var u,s={},t=Object.prototype,c=t.hasOwnProperty,h=Object.defineProperty||function(t,n,e){t[n]=e.value},n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",e=n.asyncIterator||"@@asyncIterator",r=n.toStringTag||"@@toStringTag";function o(t,n,e){return Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[n]}try{o({},"")}catch(u){o=function(t,n,e){return t[n]=e}}function a(t,n,e,i){var r,o,s,a,n=n&&n.prototype instanceof y?n:y,n=Object.create(n.prototype),i=new A(i||[]);return h(n,"_invoke",{value:(r=t,o=e,s=i,a=l,function(t,n){if(a===v)throw new Error("Generator is already running");if(a===p){if("throw"===t)throw n;return{value:u,done:!0}}for(s.method=t,s.arg=n;;){var e=s.delegate;if(e){e=function t(n,e){var i=e.method,r=n.iterator[i];if(r===u)return e.delegate=null,"throw"===i&&n.iterator.return&&(e.method="return",e.arg=u,t(n,e),"throw"===e.method)||"return"!==i&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+i+"' method")),m;i=f(r,n.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,m;r=i.arg;return r?r.done?(e[n.resultName]=r.value,e.next=n.nextLoc,"return"!==e.method&&(e.method="next",e.arg=u),e.delegate=null,m):r:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,m)}(e,s);if(e){if(e===m)continue;return e}}if("next"===s.method)s.sent=s.yn=s.arg;else if("throw"===s.method){if(a===l)throw a=p,s.arg;s.dispatchException(s.arg)}else"return"===s.method&&s.abrupt("return",s.arg);a=v;e=f(r,o,s);if("normal"===e.type){if(a=s.done?p:d,e.arg===m)continue;return{value:e.arg,done:s.done}}"throw"===e.type&&(a=p,s.method="throw",s.arg=e.arg)}})}),n}function f(t,n,e){try{return{type:"normal",arg:t.call(n,e)}}catch(t){return{type:"throw",arg:t}}}s.wrap=a;var l="suspendedStart",d="suspendedYield",v="executing",p="completed",m={};function y(){}function b(){}function g(){}var n={},_=(o(n,i,function(){return this}),Object.getPrototypeOf),_=_&&_(_(M([]))),w=(_&&_!==t&&c.call(_,i)&&(n=_),g.prototype=y.prototype=Object.create(n));function x(t){["next","throw","return"].forEach(function(n){o(t,n,function(t){return this._invoke(n,t)})})}function E(s,a){var n;h(this,"_invoke",{value:function(e,i){function t(){return new a(function(t,n){!function n(t,e,i,r){var o,t=f(s[t],s,e);if("throw"!==t.type)return(e=(o=t.arg).value)&&"object"==or(e)&&c.call(e,"__await")?a.resolve(e.bn).then(function(t){n("next",t,i,r)},function(t){n("throw",t,i,r)}):a.resolve(e).then(function(t){o.value=t,i(o)},function(t){return n("throw",t,i,r)});r(t.arg)}(e,i,t,n)})}return n=n?n.then(t,t):t()}})}function S(t){var n={tryLoc:t[0]};1 in t&&(n.catchLoc=t[1]),2 in t&&(n.finallyLoc=t[2],n.afterLoc=t[3]),this.tryEntries.push(n)}function T(t){var n=t.completion||{};n.type="normal",delete n.arg,t.completion=n}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function M(n){if(n||""===n){var e,t=n[i];if(t)return t.call(n);if("function"==typeof n.next)return n;if(!isNaN(n.length))return e=-1,(t=function t(){for(;++e<n.length;)if(c.call(n,e))return t.value=n[e],t.done=!1,t;return t.value=u,t.done=!0,t}).next=t}throw new TypeError(or(n)+" is not iterable")}return h(w,"constructor",{value:b.prototype=g,configurable:!0}),h(g,"constructor",{value:b,configurable:!0}),b.displayName=o(g,r,"GeneratorFunction"),s.isGeneratorFunction=function(t){t="function"==typeof t&&t.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},s.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,o(t,r,"GeneratorFunction")),t.prototype=Object.create(w),t},s.awrap=function(t){return{bn:t}},x(E.prototype),o(E.prototype,e,function(){return this}),s.AsyncIterator=E,s.async=function(t,n,e,i,r){void 0===r&&(r=Promise);var o=new E(a(t,n,e,i),r);return s.isGeneratorFunction(n)?o:o.next().then(function(t){return t.done?t.value:o.next()})},x(w),o(w,r,"Generator"),o(w,i,function(){return this}),o(w,"toString",function(){return"[object Generator]"}),s.keys=function(t){var n,e=Object(t),i=[];for(n in e)i.push(n);return i.reverse(),function t(){for(;i.length;){var n=i.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},s.values=M,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this.yn=u,this.done=!1,this.delegate=null,this.method="next",this.arg=u,this.tryEntries.forEach(T),!t)for(var n in this)"t"===n.charAt(0)&&c.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=u)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var i=this;function t(t,n){return o.type="throw",o.arg=e,i.next=t,n&&(i.method="next",i.arg=u),!!n}for(var n=this.tryEntries.length-1;0<=n;--n){var r=this.tryEntries[n],o=r.completion;if("root"===r.tryLoc)return t("end");if(r.tryLoc<=this.prev){var s=c.call(r,"catchLoc"),a=c.call(r,"finallyLoc");if(s&&a){if(this.prev<r.catchLoc)return t(r.catchLoc,!0);if(this.prev<r.finallyLoc)return t(r.finallyLoc)}else if(s){if(this.prev<r.catchLoc)return t(r.catchLoc,!0)}else{if(!a)throw new Error("try statement without catch or finally");if(this.prev<r.finallyLoc)return t(r.finallyLoc)}}}},abrupt:function(t,n){for(var e=this.tryEntries.length-1;0<=e;--e){var i=this.tryEntries[e];if(i.tryLoc<=this.prev&&c.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var r=i;break}}var o=(r=r&&("break"===t||"continue"===t)&&r.tryLoc<=n&&n<=r.finallyLoc?null:r)?r.completion:{};return o.type=t,o.arg=n,r?(this.method="next",this.next=r.finallyLoc,m):this.complete(o)},complete:function(t,n){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&&n&&(this.next=n),m},finish:function(t){for(var n=this.tryEntries.length-1;0<=n;--n){var e=this.tryEntries[n];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),T(e),m}},catch:function(t){for(var n=this.tryEntries.length-1;0<=n;--n){var e,i,r=this.tryEntries[n];if(r.tryLoc===t)return"throw"===(e=r.completion).type&&(i=e.arg,T(r)),i}throw new Error("illegal catch attempt")},delegateYield:function(t,n,e){return this.delegate={iterator:M(t),resultName:n,nextLoc:e},"next"===this.method&&(this.arg=u),m}},s}function ar(t,n,e,i,r,o,s){try{var a=t[o](s),u=a.value}catch(t){return void e(t)}a.done?n(u):Promise.resolve(u).then(i,r)}function ur(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=or(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=or(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==or(t)?t:String(t)}(i.key),i)}}function cr(C,t,D){var i,r,k,o,s,a,n=this,u=(void 0===t&&console.warn('THREE.OrbitControls: The second parameter "domElement" is now mandatory.'),t===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.object=C,this.isScreenLock=!1,this.domElement=t,this.gn=D,this.enabled=!0,this.useRange=!1,this.target=new Tt,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.isDamping=!1,this.dampingFactor=.25,this.enableZoom=!0,this.zoomSpeed=1,this.zoomSpeedParam=1,this.enableRotate=!0,this.enableRotateLeft=!0,this.enableRotateUp=!0,this.rotateSpeed=2,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!1,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.enableKeys=!0,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={LEFT:zt,MIDDLE:Wt,RIGHT:Yt},this.touches={ONE:Zt,TWO:Kt},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.rotateLeftStart=new Mt,this.rotateLeftEnd=new Mt,this.mapStateArray=[],this.timelone=null,this._n=function(){n.isDamping&&(v.theta>l||v.phi>l||m.length()>l?(n.update(),n.gn.enableUpdateRender()):(n.isDamping=!1,n.update()))},this._n=this._n.bind(this),this.gn.on("beforeRender",this._n),this.getPolarAngle=function(){return d.phi},this.getAzimuthalAngle=function(){return d.theta},this.panAdd=function(t){m.add(t)},this.saveState=function(){u.target0.copy(u.target),u.position0.copy(u.object.position),u.zoom0=u.object.zoom},this.resetState=function(){f=h.NONE},this.reset=function(){u.target.copy(u.target0),u.object.position.copy(u.position0),u.object.zoom=u.zoom0,u.object.updateProjectionMatrix(),u.dispatchEvent(U),u.update(),f=h.NONE},this.updateCheck=function(){if(this.gn.Gt&&this.gn.Gt.enableDragRange)if(this.gn.Gt.wn())this.saveMapState();else{for(var t,n=this.mapStateArray.length-1;0<=n;){var e=this.mapStateArray[n];if(e.viewMode=this.gn.getViewMode(),this.updateState(e),this.gn.Gt.wn())break;n--}n<0&&(t=(t=this.gn.getBuilding(this.gn.Gt.En.xn)).getFloor(t.level),this.gn.setCenter({x:t.x,y:t.y}))}},this.updateState=function(t){var n=this;this.gn.Gt.pauseDamping(),this.gn.setCenter({animate:!1,x:t.center.x,y:t.center.y,finish:function(){n.gn.setRotation({animate:!1,rotation:t.rotation,finish:function(){n.gn.setTilt({animate:!1,tilt:t.tiltAngle,finish:function(){n.gn.setZoom({animate:!1,zoom:t.zoom})}})}})}})},this.saveMapState=function(){var t=this.gn.getState();!function(t){var n,e=!0;for(n in t)if(""+n!="level"&&""+n!="visibleLevels"&&""+n!="viewBuildingID"&&""+n!="floorSpace"&&""+n!="viewMode")if(""+n=="center"){var i=t[n];if(isNaN(parseFloat(""+i.x))||isNaN(parseFloat(""+i.y))){e=!1;break}}else if(isNaN(parseFloat(""+t[n]))){e=!1;break}return e}(t)||(200<=this.mapStateArray.length&&this.mapStateArray.splice(0,1),this.mapStateArray.push(t))},this.getTarget=function(t,n){var e,i;return 0===this.gn.Ot.length?t:(e=this.gn.getMapOptions().screenLockCoords,i={x:this.gn.getContainer().clientWidth/2,y:this.gn.getContainer().clientHeight/2},e={x:this.gn.getContainer().clientWidth*e.x,y:this.gn.getContainer().clientHeight*e.y},(i=dr.coordsScreenToMap(this.gn,i,n)).x=i.x-this.gn.x,i.y=-i.y+this.gn.y,(e=dr.coordsScreenToMap(this.gn,e,n)).x=e.x-this.gn.x,e.y=-e.y+this.gn.y,n=e.x-i.x,e=e.y-i.y,i=t.clone(),isNaN(n)||isNaN(e)||1e3<Math.abs(e)||1e3<Math.abs(n)||(i.x=i.x-n,i.z=i.z-e),i)},this.update=(i=new Tt,r=(new at).setFromUnitVectors(C.up,new Tt(0,1,0)),k=r.clone().inverse(),o=new Tt,s=new at,a=0,function(t){t=t||{};var n,e=u.object.position;return i.copy(e).sub(u.target),i.applyQuaternion(r),d.setFromVector3(i),u.autoRotate&&f===h.NONE&&M(2*Math.PI/60/60*u.autoRotateSpeed),u.enableDamping&&u.isDamping?(d.theta+=v.theta*u.dampingFactor,d.phi+=v.phi*u.dampingFactor):(d.theta+=v.theta,d.phi+=v.phi),d.theta=Math.max(u.minAzimuthAngle,Math.min(u.maxAzimuthAngle,d.theta)),t&&void 0!==t.theta&&(d.theta=Math.max(u.minAzimuthAngle,Math.min(u.maxAzimuthAngle,t.theta))),d.phi=Math.max(u.minPolarAngle,Math.min(u.maxPolarAngle,d.phi)),t&&void 0!==t.phi&&(d.phi=Math.max(u.minPolarAngle,Math.min(u.maxPolarAngle,t.phi))),d.makeSafe(),d.radius*=p,d.radius=Math.max(u.minDistance,Math.min(u.maxDistance,d.radius)),this.useRange?((n=(new Tt).setFromMatrixPosition(u.object.matrixWorld)).add(m),n=(new At).copy(u.object.matrixWorld).setPosition(n),n=(new At).getInverse(n),(new Vt).setFromProjectionMatrix((new At).multiplyMatrices(u.object.projectionMatrix,n)).intersectsSphere(u.viewSphere)&&u.target.add(m)):u.enableDamping&&u.isDamping?u.target.addScaledVector(m,u.dampingFactor):u.target.add(m),i.setFromSpherical(d),i.applyQuaternion(k),t&&t.offset&&i.add(t.offset),this.useRange&&((n=(new Tt).setFromMatrixPosition(u.object.matrixWorld)).add(i),t=(new At).copy(u.object.matrixWorld).setPosition(n),n=(new At).getInverse(t),!(new Vt).setFromProjectionMatrix((new At).multiplyMatrices(u.object.projectionMatrix,n)).intersectsSphere(u.viewSphere))||e.copy(u.target).add(i),u.isScreenLock&&void 0!==this.gn.getMapOptions().screenLockCoords?((t=u.object.clone()).lookAt(u.target),u.object.lookAt(this.getTarget(u.target,t)),u.object.rotation.z=t.rotation.z):u.object.lookAt(u.target),u.enableDamping&&u.isDamping?(v.theta*=1-u.dampingFactor,v.phi*=1-u.dampingFactor,m.multiplyScalar(1-u.dampingFactor)):(v.set(0,0,0),m.set(0,0,0)),p=1,!(!(y||o.distanceToSquared(u.object.position)>l||8*(1-s.dot(u.object.quaternion))>l||a!==u.object.zoom)||(u.dispatchEvent(U),o.copy(u.object.position),s.copy(u.object.quaternion),a=u.object.zoom,y=!1))}),this.dispose=function(){u.domElement.removeEventListener("contextmenu",ot,!1),u.domElement.removeEventListener("mousedown",$,!1),u.domElement.removeEventListener("wheel",tt,!1),u.domElement.removeEventListener("touchstart",et,!1),u.domElement.removeEventListener("touchend",rt,!1),u.domElement.removeEventListener("touchmove",it,!1),st.a.document.removeEventListener("mousemove",j,!1),st.a.document.removeEventListener("mouseup",I,!1),u.domElement.removeEventListener("keydown",nt,!1)},this),U={type:"change"},e={type:"start"},c={type:"end"},h={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},f=h.NONE,l=1e-6,d=new wi,v=new wi,p=1,m=new Tt,y=!1,b=new Mt,g=new Mt,_=new Mt,w=new Mt,x=new Mt,E=new Mt,S=new Mt,T=new Mt,A=new Mt,B=null;function G(){return Math.pow(.95,u.zoomSpeed)}function M(t){u.enableRotateLeft&&(v.theta-=t)}function H(t){u.enableRotateUp&&(v.phi-=t)}O=new Tt;var O,L,R,X=function(t,n){O.setFromMatrixColumn(n,0),O.multiplyScalar(-t),m.add(O)},V=(L=new Tt,function(t,n){!0===u.screenSpacePanning?L.setFromMatrixColumn(n,1):(L.setFromMatrixColumn(n,0),L.crossVectors(u.object.up,L)),L.multiplyScalar(t),m.add(L)}),N=(this.panUp=function(t){var n=new Tt(0,1,0);n.multiplyScalar(t),m.add(n)},R=new Tt,function(t,n){var e,i=u.domElement;u.object.isPerspectiveCamera?(e=u.object.position,R.copy(e).sub(u.target),e=R.length(),e*=Math.tan(u.object.fov/2*Math.PI/180),X(2*t*e/i.clientHeight,u.object.matrix),V(2*n*e/i.clientHeight,u.object.matrix)):u.object.isOrthographicCamera?(X(t*(u.object.right-u.object.left)/u.object.zoom/i.clientWidth,u.object.matrix),V(n*(u.object.top-u.object.bottom)/u.object.zoom/i.clientHeight,u.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),u.enablePan=!1)});function P(t){u.object.isPerspectiveCamera?p/=t:u.object.isOrthographicCamera?(u.object.zoom=Math.max(u.minZoom,Math.min(u.maxZoom,u.object.zoom*t)),u.object.updateProjectionMatrix(),p/=t,y=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),u.enableZoom=!1)}function z(t){u.object.isPerspectiveCamera?p*=t:u.object.isOrthographicCamera?(u.object.zoom=Math.max(u.minZoom,Math.min(u.maxZoom,u.object.zoom/t)),u.object.updateProjectionMatrix(),p*=t,y=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),u.enableZoom=!1)}function F(t){b.set(t.clientX,t.clientY)}function W(t){w.set(t.clientX,t.clientY)}function Y(t){var n,e;1==t.touches.length?b.set(t.touches[0].pageX,t.touches[0].pageY):(n=.5*(t.touches[0].pageX+t.touches[1].pageX),e=.5*(t.touches[0].pageY+t.touches[1].pageY),b.set(n,e),n=t.touches[0].pageX-t.touches[1].pageX,e=t.touches[0].pageY-t.touches[1].pageY,u.rotateLeftStart.set(n,e))}function Q(t){var n;1==t.touches.length?w.set(t.touches[0].pageX,t.touches[0].pageY):(n=.5*(t.touches[0].pageX+t.touches[1].pageX),t=.5*(t.touches[0].pageY+t.touches[1].pageY),w.set(n,t))}function Z(t){var n=t.touches[0].pageX-t.touches[1].pageX,t=t.touches[0].pageY-t.touches[1].pageY,n=Math.sqrt(n*n+t*t);S.set(0,n)}function q(t){1==t.touches.length?g.set(t.touches[0].pageX,t.touches[0].pageY):(e=.5*(t.touches[0].pageX+t.touches[1].pageX),n=.5*(t.touches[0].pageY+t.touches[1].pageY),g.set(e,n),e=t.touches[0].pageX-t.touches[1].pageX,n=t.touches[0].pageY-t.touches[1].pageY,u.rotateLeftEnd.set(e,n),t=u.rotateLeftStart.angle(),M((-u.rotateLeftEnd.angle()+t)*u.rotateSpeed),u.rotateLeftStart.copy(u.rotateLeftEnd)),_.subVectors(g,b).multiplyScalar(u.rotateSpeed);var n,e=u.domElement;H(2*Math.PI*_.y/e.clientHeight),b.copy(g)}function K(t){var n;1==t.touches.length?(x.set(t.touches[0].pageX,t.touches[0].pageY),x.x<0&&x.copy(w)):(n=.5*(t.touches[0].pageX+t.touches[1].pageX),t=.5*(t.touches[0].pageY+t.touches[1].pageY),x.set(n,t)),E.subVectors(x,w).multiplyScalar(u.panSpeed),N(E.x,E.y),w.copy(x)}function J(t){var n;t.touches[0]&&t.touches[1]&&(n=t.touches[0].pageX-t.touches[1].pageX,t=t.touches[0].pageY-t.touches[1].pageY,n=Math.sqrt(n*n+t*t),T.set(0,n),A.set(0,Math.pow(T.y/S.y,u.zoomSpeed)),P(A.y),S.copy(T))}function $(t){if(!1!==u.enabled){switch(t.preventDefault(),(u.domElement.focus?u.domElement:window).focus(),t.button){case 0:switch(u.mouseButtons.LEFT){case zt:if(t.ctrlKey||t.metaKey||t.shiftKey){if(!1===u.enablePan)return;W(t),f=h.PAN}else{if(!1===u.enableRotate)return;F(t),f=h.ROTATE}break;case Yt:if(t.ctrlKey||t.metaKey||t.shiftKey){if(!1===u.enableRotate)return;F(t),f=h.ROTATE}else{if(!1===u.enablePan)return;W(t),f=h.PAN}break;default:f=h.NONE}break;case 1:switch(u.mouseButtons.MIDDLE){case Wt:if(!1===u.enableZoom)return;S.set(t.clientX,t.clientY),f=h.DOLLY;break;case zt:if(!1===u.enableRotate)return;F(t),f=h.ROTATE;break;default:f=h.NONE}break;case 2:switch(u.mouseButtons.RIGHT){case zt:if(!1===u.enableRotate)return;F(t),f=h.ROTATE;break;case Yt:if(!1===u.enablePan)return;W(t),f=h.PAN;break;default:f=h.NONE}}f!==h.NONE&&(st.a.document.addEventListener("mousemove",j,!1),st.a.document.addEventListener("mouseup",I,!1),u.dispatchEvent(e))}}function j(t){var n;if(!1!==u.enabled)switch(t.preventDefault(),f){case h.ROTATE:!1!==u.enableRotate&&(n=t,g.set(n.clientX,n.clientY),_.subVectors(g,b).multiplyScalar(u.rotateSpeed),n=u.domElement,M(2*Math.PI*_.x/n.clientHeight),H(2*Math.PI*_.y/n.clientHeight),b.copy(g),u.isDamping=!0,u.update(),u.updateCheck());break;case h.DOLLY:!1!==u.enableZoom&&(T.set(t.clientX,t.clientY),A.subVectors(T,S),0<A.y?P(G()):A.y<0&&z(G()),S.copy(T),u.isDamping=!0,u.update(),u.updateCheck());break;case h.PAN:!1!==u.enablePan&&(x.set(t.clientX,t.clientY),E.subVectors(x,w).multiplyScalar(u.panSpeed),N(E.x,E.y),w.copy(x),u.isDamping=!0,u.update(),u.updateCheck())}}function I(t){!1!==u.enabled&&(st.a.document.removeEventListener("mousemove",j,!1),st.a.document.removeEventListener("mouseup",I,!1),u.dispatchEvent(c),f=h.NONE)}function tt(t){var n;!1===u.enabled||!1===u.enableZoom||f!==h.NONE&&f!==h.ROTATE||(t.preventDefault(),t.stopPropagation(),u.dispatchEvent(e),t=t,n=Math.pow(.95,u.zoomSpeed*u.zoomSpeedParam),t.deltaY<0?z(n):0<t.deltaY&&P(n),u.isDamping=!0,u.update(),u.updateCheck(),u.dispatchEvent(c))}function nt(t){if(!1!==u.enabled&&!1!==u.enableKeys&&!1!==u.enablePan){var n=!1;switch(t.keyCode){case u.keys.UP:N(0,u.keyPanSpeed),n=!0;break;case u.keys.BOTTOM:N(0,-u.keyPanSpeed),n=!0;break;case u.keys.LEFT:N(u.keyPanSpeed,0),n=!0;break;case u.keys.RIGHT:N(-u.keyPanSpeed,0),n=!0}n&&(t.preventDefault(),u.isDamping=!0,u.update(),u.updateCheck())}}function et(t){if(!1!==u.enabled){switch(t.preventDefault(),t.touches.length){case 1:switch(u.touches.ONE){case Zt:if(!1===u.enableRotate)return;Y(t),f=h.TOUCH_ROTATE;break;case qt:if(!1===u.enablePan)return;Q(t),f=h.TOUCH_PAN;break;default:f=h.NONE}break;case 2:switch(B=t.touches[0].identifier,u.touches.TWO){case Kt:if(!1===u.enableZoom&&!1===u.enablePan)return;n=t,u.enableZoom&&Z(n),u.enablePan&&Q(n),f=h.TOUCH_DOLLY_PAN;break;case Jt:if(!1===u.enableZoom&&!1===u.enableRotate)return;n=t,u.enableZoom&&Z(n),u.enableRotate&&Y(n),f=h.TOUCH_DOLLY_ROTATE;break;default:f=h.NONE}break;default:f=h.NONE}var n;f!==h.NONE&&u.dispatchEvent(e)}}function it(t){var n,e;if(!1!==u.enabled)switch(2===t.touches.length&&t.touches[1].identifier===B&&(n=t.touches[0],t.touches[0]=t.touches[1],t.touches[1]=n),t.preventDefault(),t.stopPropagation(),f){case h.TOUCH_ROTATE:!1!==u.enableRotate&&(q(t),u.isDamping=!0,u.update(),u.updateCheck());break;case h.TOUCH_PAN:!1!==u.enablePan&&(K(t),u.isDamping=!0,u.update(),u.updateCheck());break;case h.TOUCH_DOLLY_PAN:!1===u.enableZoom&&!1===u.enablePan||(e=t,u.enableZoom&&J(e),u.enablePan&&K(e),u.isDamping=!0,u.update(),u.updateCheck());break;case h.TOUCH_DOLLY_ROTATE:!1===u.enableZoom&&!1===u.enableRotate||(e=t,u.enableZoom&&J(e),u.enableRotate&&q(e),u.isDamping=!0,u.update(),u.updateCheck());break;default:f=h.NONE}}function rt(t){!1!==u.enabled&&(u.dispatchEvent(c),f=h.NONE)}function ot(t){!1!==u.enabled&&t.preventDefault()}this.dollyIn=P,this.dollyOut=z,u.domElement.addEventListener("contextmenu",ot,!1),u.domElement.addEventListener("mousedown",$,!1),u.domElement.addEventListener("wheel",tt,!1),u.domElement.addEventListener("touchstart",et,!1),u.domElement.addEventListener("touchend",rt,!1),u.domElement.addEventListener("touchmove",it,!1),u.domElement.addEventListener("keydown",nt,!1),-1===u.domElement.tabIndex&&(u.domElement.tabIndex=0),u.isDamping=!0,this.update(),this.updateCheck(),this.removeEvent=function(){u.domElement.removeEventListener("contextmenu",ot,!1),u.domElement.removeEventListener("mousedown",$,!1),u.domElement.removeEventListener("wheel",tt,!1),u.domElement.removeEventListener("touchstart",et,!1),u.domElement.removeEventListener("touchend",rt,!1),u.domElement.removeEventListener("touchmove",it,!1),u.domElement.removeEventListener("keydown",nt,!1),st.a.document.removeEventListener("mousemove",j,!1),st.a.document.removeEventListener("mouseup",I,!1)}}function hr(t,n,e){cr.call(this,t,n,e),this.mouseButtons.LEFT=Yt,this.mouseButtons.RIGHT=zt,this.touches.ONE=qt,this.touches.TWO=Jt,this.Sn=null}var fr=!1,lr=0,dr=function(){function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function")}var n,e,i;return n=t,i=[{key:"coordsMapToScreen",value:function(t,n){var e=void 0!==n.height?n.height:0,i=t.getMapOptions().buildingID,i=(n.buildingID&&(i=n.buildingID),t.getBuilding(i)),r=(void 0!==n.level?n:i).level,i=void 0!==n.z?n.z:i.getFloor(r).nt;return this.coordsMapToScreen_(t,{x:n.x,y:n.y,z:i+e})}},{key:"coordsScreenToMap",value:function(t,n,e){var i,r,o=(void 0!==n.buildingID?n:t.getMapOptions()).buildingID,o=t.getBuilding(o),s=t.Tn,a=(void 0!==n.level?n:o).level,o=void 0!==n.z?n.z:o.getFloor(a).nt,a=null,u=t.jt.renderer.domElement.clientWidth,c=t.jt.renderer.domElement.clientHeight,h=new Tt,f=new Tt,t=(null!=(e=(a=e||t.Gt.Bt.object).userData)&&e.near?a.userData:a).near,e=(null!=(e=a.userData)&&e.far?a.userData:a).far,u=(a.isPerspectiveCamera?(a.updateMatrixWorld(),h.setFromMatrixPosition(a.matrixWorld),i=n.x/u*2-1,r=-n.y/c*2+1,f.set(i,r,t).unproject(a).sub(h).normalize()):(i=n.x/u*2-1,r=-n.y/c*2+1,h.set(i,r,(t+e)/(t-e)).unproject(a),f.set(0,0,-1).transformDirection(a.matrixWorld)),(-h.y+o)/f.y),n=(u<0&&(u=e),(new Tt).copy(h).add((new Tt).copy(f).multiplyScalar(u)));return{x:n.x+s.x,y:s.y-n.z,z:o}}},{key:"_drawImage",value:function(t,n,e,i,r,o){var s=Math.min(r/e,o/i),e=e*s,i=i*s;t.drawImage(n,(r-e)/2,(o-i)/2,e,i)}},{key:"screenshot",value:function(s,t,n,e,a,u,c,h){var f=this,l=n.x-t.x,d=n.y-t.y,i=(n.x+t.x)/2,r=(n.y+t.y)/2,o=s.jt.renderer.domElement.style.width,v=s.jt.renderer.domElement.style.height,p=o.split("p")[0],m=v.split("p")[0],y=null,y=(n.x-t.x)/(n.y-t.y)>p/m?p/(n.x-t.x):m/(n.y-t.y),o=i-p/2,v=r-m/2,n=document.getElementsByTagName("canvas")[0],b=document.createElement("canvas"),g=document.createElement("canvas"),_=document.createElement("canvas"),w=st.a.window.devicePixelRatio,x=new Image,E=(s.getViewMode(),s.kt.setViewOffset(p*y,m*y,p*(y-1)/2+o*y,m*(y-1)/2+v*y,p,m),s.jt.render(),b.width=l*y*w,b.height=d*y*w,b.style.width=l*y*w+"px",b.style.height=d*y*w+"px",e?(g.width=1240*Math.pow(1.414,a-1),g.height=1754*Math.pow(1.414,a-1),g.style.width=1240*Math.pow(1.414,a-1)+"px",g.style.height=1754*Math.pow(1.414,a-1)+"px"):(g.height=1240*Math.pow(1.414,a-1),g.width=1754*Math.pow(1.414,a-1),g.style.height=1240*Math.pow(1.414,a-1)+"px",g.style.width=1754*Math.pow(1.414,a-1)+"px"),_.height=h||d*Math.pow(1.414,a-1),_.width=c||l*Math.pow(1.414,a-1),_.style.height=_.height+"px",_.style.width=_.width+"px",x.src=n.toDataURL("image/png"),(s.getViewMode()===xi.PERSPECTIVE?s.An:s.Ut).clearViewOffset(),b.getContext("2d")),S=g.getContext("2d"),T=_.getContext("2d");x.onload=function(){s.getViewMode(),E.drawImage(x,-(p*w-l*y*w)/2,-(m*w-d*y*w)/2);var o=new Image;o.src=b.toDataURL("image/png"),o.onload=function(){s.camera.clearViewOffset(),s.enableUpdateRender();var t=Math.min(1240*Math.pow(1.414,a-1)/(l*y),1754*Math.pow(1.414,a-1)/(d*y)),n=(g.width-l*y*t)/2,e=(g.height-d*y*t)/2,i=(S.drawImage(o,n,e,l*y*t,d*y*t),c&&h?f._drawImage(T,o,l,d,_.width,_.height):T.drawImage(o,0,0,l*Math.pow(1.414,a-1),d*Math.pow(1.414,a-1)),g.toDataURL("image/png")),r=_.toDataURL("image/png");-1<navigator.userAgent.indexOf("Edge")||-1<navigator.userAgent.indexOf(".NET4.0C")?u(i,null,r,null):g.toBlob(function(n){return _.toBlob(function(t){return u(i,n,r,t)})})}}}},{key:"print",value:function(t,n){var e=this,i=(fr=!0,t.getZoom()),r=(t.setZoom({animate:!0,zoom:29}),t.Gt.Bt.target.x),o=t.Gt.Bt.target.z,s=(t.Gt.Bt.panAdd({x:-r,z:-o,y:0}),t.getTilt()),a=t.getRotation(),u=document.createElement("canvas");u.width=6*t.jt.renderer.domElement.width,u.height=6*t.jt.renderer.domElement.height,t.setTilt({tilt:90,finish:function(){t.setRotation({rotation:0})}}),t.getViewMode()===xi.MODE_3D?t.setViewMode({mode:xi.MODE_2D,callback:function(){return e.shot_(t,u,u.getContext("2d"),0,t.Ut.zoom,r,o,i,xi.MODE_3D,s,a,n)}}):this.shot_(t,u,u.getContext("2d"),0,t.Ut.zoom,r,o,i,xi.MODE_2D,s,a,n)}},{key:"export",value:function(t){var n;void 0!==t.imageWidth&&void 0!==t.imageHieght&&(n=t.map.getViewMode(),void 0===t.mode?t.cameraType=n===xi.MODE_2D?"2d":"3d":t.cameraType=t.mode===xi.MODE_2D?"2d":"3d",n!=xi.MODE_2D||t.mode!==xi.MODE_3D)&&Ri.print(t)}},{key:"coordsMapToScreen_",value:function(t,n){var e=t.Gt.Bt.object,i=(null!=(i=e.userData)&&i.near?e.userData:e).near,r=(null!=(r=e.userData)&&r.far?e.userData:e).far,o=e.near,s=e.far,i=(e.near=i,e.far=r,e.updateProjectionMatrix(),t.Tn),r=new Tt(n.x-i.x,n.z,-n.y+i.y).project(e),n=t.jt.renderer.domElement.clientWidth,i=t.jt.renderer.domElement.clientHeight;return e.near=o,e.far=s,e.updateProjectionMatrix(),r.z<-1||1<r.z?null:{x:Math.round(n/2*r.x+n/2),y:Math.round(-i/2*r.y+i/2)}}},{key:"shot_",value:function(e,i,r,t,o,s,a,u,c,h,f,l){var n,d,v,p,m;return fr&&t<36?(d=n=null,t<6?(n=0,d=+t):t<12?(n=1,d=t-6):t<18?(n=2,d=t-12):t<24?(n=3,d=t-18):t<30?(n=4,d=t-24):t<36&&(n=5,d=t-30),v=e.jt.renderer.domElement.width,p=e.jt.renderer.domElement.height,(m=new Image).indexI=n,m.indexJ=d,e.Ut.setViewOffset(v,p,2.5*-v+v*n,2.5*-p+p*d,v,p),e.Ut.updateProjectionMatrix(),m.onload=function(t){lr++;var n=(n=t.target)||t.path[0];r.drawImage(n,v*n.indexI,p*n.indexJ),36===lr&&(i.toBlob(function(t){e.Ut.zoom=6*o,e.Ut.updateProjectionMatrix(),e.setViewMode({mode:c,callback:function(){e.setRotation({rotation:f,finish:function(){e.setTilt({tilt:h})}})}}),e.setZoom({zoom:u}),e.Ut.clearViewOffset(),e.jt.Mn(),e.Gt.Bt.panAdd({x:s,z:a,y:0}),e.jt.Ht(),e.Gt.Bt.update(),e.jt.render(),fr=!1,l(t)}),lr=0)},e.jt.Ht(),e.Gt.Bt.update(),e.jt.render(),m.src=e.jt.renderer.domElement.toDataURL(),this.shot_(e,i,r,++t,o,s,a,u,c,h,f,l)):void 0}},{key:"exportToImage",value:function(o,s,u,c,h){u=u||{},zi.readOptions(o,s,u),zi.initOptions(u),u.renderSizeExport.width<=0||u.renderSizeExport.height<=0?h&&h():zi.addLastFrame(u.map,function(){function t(){for(u.map.jt.On(),zi.showFloorNode(u.map,u.map.getFloor(u.level));0<u.map.Nt.Rt.length;)u.map.Nt.Pt();var t,n=[!1,!1];rr.isLoaded()?(n[0]=!0,n.every(function(t){return t})&&r()):(t=rr.onLoad,rr.onLoad=function(){t(),n[0]=!0,rr.onLoad=t,n.every(function(t){return t})&&r()}),er.ln===er.hn?(n[1]=!0,n.every(function(t){return t})&&r()):er.dn.set(u.map.Ln,function(){er.dn.delete(u.map.Ln),n[1]=!0,n.every(function(t){return t})&&r()})}var e=u.map.getLevel(),i=u.map.getVisibleLevels(),r=(u.map.jt.renderer.domElement.style.opacity="0",u.map.toolBar&&(u.map.toolBar.enable=!1),function(){a=sr().mark(function t(){var n;return sr().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,zi.befor(u);case 2:!0===u.isExpandbound&&(n=zi.findSpriteElement(u.map,u.level,u.bound),s=zi.expandBoundBySprite(n,u)),zi.updateCamera(u.map,u.imageRenderSize.width,u.imageRenderSize.height,s,u.camera),u.map.camera=u.camera,zi.start(u,function(t){zi.recoverParam(u),u.map.jt.renderer.domElement.style.opacity="1",u.map.setVisibleLevels(i),u.map.setLevel({level:e,animate:!1,finish:function(){zi.after(u),zi.showAllLevelNode(u.map,u.oldLevel),u.map.jt.render(),u.map.toolBar&&(u.map.toolBar.enable=!0),u.map.jt.Ht(),u.map.jt.Xt=!0,u.map.jt.zt(),zi.removeLastFrame(o),null!==t?c&&c(t):h&&h()}})});case 6:case"end":return t.stop()}},t)});var a,t=function(){var t=this,s=arguments;return new Promise(function(n,e){var i=a.apply(t,s);function r(t){ar(i,n,e,r,o,"next",t)}function o(t){ar(i,n,e,r,o,"throw",t)}r(void 0)})};return function(){return t.apply(this,arguments)}}());u.map.setVisibleLevels([u.level],function(){u.map.setLevel({level:u.level,animate:!1,finish:t})})})}}],(e=null)&&ur(n.prototype,e),i&&ur(n,i),Object.defineProperty(n,"prototype",{writable:!1}),t}(),e=((cr.prototype=Object.create(X.prototype)).constructor=cr,(hr.prototype=Object.create(X.prototype)).constructor=hr,Object.assign(hr.prototype,{setMouseMiddleButtonRotation:function(){this.mouseButtons.RIGHT=Qt,this.mouseButtons.MIDDLE=zt},dispose:function(){this.removeEvent(),this.object=null,this.domElement=null,this.gn.off("beforeRender",this.gn._n),this.gn=null},pauseDamping:function(){this.Sn={dampingFactor:this.dampingFactor,enableDamping:this.enableDamping},this.enableDamping=!1,this.dampingFactor=1},resumeDamping:function(){this.Sn&&(this.enableDamping=this.Sn.enableDamping,this.dampingFactor=this.Sn.dampingFactor)}}),{FOV:35,CAMERA_NEAR:1,CAMERA_FAR:1e5,ZOOM_UPPER_BOUND:30,TILT_UPPER_BOUND:90,THOUSAND:1e3,DEG2RAD:.0174532,RAD2DEG:57.2957795,DRAW_TIME:500,EPS:.001}),u=(Object.freeze(e),e),vr={NAME_KEY_ERROR:0,MAP_ID_URL_ERROR:2,THEME_ID_URL_ERROR:4,LICENSE_ERROR:8,PATH_ERROR:404,INFO:32,DEFAULT_LEVEL_ERROR:64},e={RIGHT:2,LEFT:4,BOTTOM:8,TOP:16,RIGHT_BOTTOM:32,LEFT_BOTTOM:64,RIGHT_TOP:128,LEFT_TOP:256,CENTER:512},pr=(Object.freeze(e),e);function Ot(t,n,e,i){this.x=t||0,this.y=n||0,this.z=e||0,this.w=void 0!==i?i:1}function mr(t){return(mr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function yr(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=mr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=mr(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==mr(t)?t:String(t)}(i.key),i)}}Object.defineProperties(Ot.prototype,{width:{get:function(){return this.z},set:function(t){this.z=t}},height:{get:function(){return this.w},set:function(t){this.w=t}}}),Object.assign(Ot.prototype,{isVector4:!0,set:function(t,n,e,i){return this.x=t,this.y=n,this.z=e,this.w=i,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this.w=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setW:function(t){return this.w=t,this},setComponent:function(t,n){switch(t){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;case 3:this.w=n;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this},add:function(t,n){return void 0!==n?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,n)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this},addVectors:function(t,n){return this.x=t.x+n.x,this.y=t.y+n.y,this.z=t.z+n.z,this.w=t.w+n.w,this},addScaledVector:function(t,n){return this.x+=t.x*n,this.y+=t.y*n,this.z+=t.z*n,this.w+=t.w*n,this},sub:function(t,n){return void 0!==n?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,n)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this},subVectors:function(t,n){return this.x=t.x-n.x,this.y=t.y-n.y,this.z=t.z-n.z,this.w=t.w-n.w,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},applyMatrix4:function(t){var n=this.x,e=this.y,i=this.z,r=this.w,t=t.elements;return this.x=t[0]*n+t[4]*e+t[8]*i+t[12]*r,this.y=t[1]*n+t[5]*e+t[9]*i+t[13]*r,this.z=t[2]*n+t[6]*e+t[10]*i+t[14]*r,this.w=t[3]*n+t[7]*e+t[11]*i+t[15]*r,this},divideScalar:function(t){return this.multiplyScalar(1/t)},setAxisAngleFromQuaternion:function(t){this.w=2*Math.acos(t.w);var n=Math.sqrt(1-t.w*t.w);return n<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/n,this.y=t.y/n,this.z=t.z/n),this},setAxisAngleFromRotationMatrix:function(t){var n,e,i,r,o,s,a,u,c,h,t=t.elements,f=t[0],l=t[4],d=t[8],v=t[1],p=t[5],m=t[9],y=t[2],b=t[6],t=t[10];return Math.abs(l-v)<.01&&Math.abs(d-y)<.01&&Math.abs(m-b)<.01?Math.abs(l+v)<.1&&Math.abs(d+y)<.1&&Math.abs(m+b)<.1&&Math.abs(f+p+t-3)<.1?this.set(1,0,0,0):(r=Math.PI,s=(t+1)/2,a=(l+v)/4,u=(d+y)/4,c=(m+b)/4,(o=(p+1)/2)<(h=(f+1)/2)&&s<h?i=h<.01?(n=0,e=.707106781):(e=a/(n=Math.sqrt(h)),u/n):s<o?i=o<.01?(e=0,n=.707106781):(n=a/(e=Math.sqrt(o)),c/e):s<.01?(e=n=.707106781,i=0):(n=u/(i=Math.sqrt(s)),e=c/i),this.set(n,e,i,r)):(h=Math.sqrt((b-m)*(b-m)+(d-y)*(d-y)+(v-l)*(v-l)),Math.abs(h)<.001&&(h=1),this.x=(b-m)/h,this.y=(d-y)/h,this.z=(v-l)/h,this.w=Math.acos((f+p+t-1)/2)),this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this},clamp:function(t,n){return this.x=Math.max(t.x,Math.min(n.x,this.x)),this.y=Math.max(t.y,Math.min(n.y,this.y)),this.z=Math.max(t.z,Math.min(n.z,this.z)),this.w=Math.max(t.w,Math.min(n.w,this.w)),this},clampScalar:function(t,n){return this.x=Math.max(t,Math.min(n,this.x)),this.y=Math.max(t,Math.min(n,this.y)),this.z=Math.max(t,Math.min(n,this.z)),this.w=Math.max(t,Math.min(n,this.w)),this},clampLength:function(t,n){var e=this.length();return this.divideScalar(e||1).multiplyScalar(Math.max(t,Math.min(n,e)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,n){return this.x+=(t.x-this.x)*n,this.y+=(t.y-this.y)*n,this.z+=(t.z-this.z)*n,this.w+=(t.w-this.w)*n,this},lerpVectors:function(t,n,e){return this.subVectors(n,t).multiplyScalar(e).add(t)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w},fromArray:function(t,n){return this.x=t[n=void 0===n?0:n],this.y=t[n+1],this.z=t[n+2],this.w=t[n+3],this},toArray:function(t,n){return(t=void 0===t?[]:t)[n=void 0===n?0:n]=this.x,t[n+1]=this.y,t[n+2]=this.z,t[n+3]=this.w,t},fromBufferAttribute:function(t,n,e){return void 0!==e&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(n),this.y=t.getY(n),this.z=t.getZ(n),this.w=t.getW(n),this}});var br=function(){function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function")}var n,e,i;return n=t,i=[{key:"convertPointCoordsByCenter",value:function(t,n){return t.x=t.x-n.x,t.y=t.y-n.y,void 0!==t.z&&void 0!==n.z&&(t.z=t.z-n.z),t}},{key:"convertPointsCoordsByCenter",value:function(t,n){for(var e=0;e<t.length;e++)this.convertPointCoordsByCenter(t[e],n);return t}},{key:"getMapScaleInfo",value:function(){var t,n;return st.a.environment===B.a.WX?96/2.54:(window.screen.deviceXDPI?t=window.screen.deviceXDPI:((n=document.createElement("DIV")).style.cssText="width:1in;height:1in;position:absolute;left:0px;top:0px;z-index:99;visibility:hidden",document.body.appendChild(n),t=parseInt(n.offsetWidth),n.parentNode.removeChild(n)),t/2.54)}},{key:"getCenterByAnchor",value:function(t){var n=new Mt(.5,.5);switch(t){case pr.LEFT:n.setX(0);break;case pr.RIGHT:n.setX(1);break;case pr.TOP:n.setY(1);break;case pr.BOTTOM:n.setY(0);break;case pr.LEFT_TOP:n.set(0,1);break;case pr.RIGHT_TOP:n.set(1,1);break;case pr.LEFT_BOTTOM:n.set(0,0);break;case pr.RIGHT_BOTTOM:n.set(1,0)}return n}},{key:"uniqWithArrayOne",value:function(t){var n=[];return t.forEach(function(t){n.includes(t)||n.push(t)}),n}},{key:"uniqWithArrayTwo",value:function(t){if(t.length<1)return[];t=JSON.parse(JSON.stringify(t));for(var n=[],e=0;e<t.length;e++){var i=(i=this.uniqWithArrayOne(t[e])).filter(function(t){return!n.includes(t)});t[e]=i,n=n.concat(i)}return t.filter(function(t){return 0<t.length})}}],(e=null)&&yr(n.prototype,e),i&&yr(n,i),Object.defineProperty(n,"prototype",{writable:!1}),t}(),gr={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},_r={h:0,s:0,l:0},wr={h:0,s:0,l:0};function lt(t,n,e){return void 0===n&&void 0===e?this.set(t):this.setRGB(t,n,e)}function xr(t,n,e){return e<0&&(e+=1),1<e&&--e,e<1/6?t+6*(n-t)*e:e<.5?n:e<2/3?t+6*(n-t)*(2/3-e):t}function Er(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function Sr(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}function Tr(t){return(Tr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ar(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=Tr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Tr(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Tr(t)?t:String(t)}(i.key),i)}}Object.assign(lt.prototype,{isColor:!0,r:1,g:1,b:1,set:function(t){return t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t),this},setScalar:function(t){return this.r=t,this.g=t,this.b=t,this},setHex:function(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this},setRGB:function(t,n,e){return this.r=t,this.g=n,this.b=e,this},setHSL:function(t,n,e){return t=St.euclideanModulo(t,1),n=St.clamp(n,0,1),e=St.clamp(e,0,1),0===n?this.r=this.g=this.b=e:(this.r=xr(n=2*e-(e=e<=.5?e*(1+n):e+n-e*n),e,t+1/3),this.g=xr(n,e,t),this.b=xr(n,e,t-1/3)),this},setStyle:function(n){function t(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+n+" will be ignored.")}if(u=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(n)){var e,i,r,o,s=u[1],a=u[2];switch(s){case"rgb":case"rgba":if(e=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(255,parseInt(e[1],10))/255,this.g=Math.min(255,parseInt(e[2],10))/255,this.b=Math.min(255,parseInt(e[3],10))/255,t(e[5]),this;if(e=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(100,parseInt(e[1],10))/100,this.g=Math.min(100,parseInt(e[2],10))/100,this.b=Math.min(100,parseInt(e[3],10))/100,t(e[5]),this;break;case"hsl":case"hsla":if(e=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return i=parseFloat(e[1])/360,r=parseInt(e[2],10)/100,o=parseInt(e[3],10)/100,t(e[5]),this.setHSL(i,r,o)}}else if(u=/^\#([A-Fa-f0-9]+)$/.exec(n)){var s=u[1],u=s.length;if(3===u)return this.r=parseInt(s.charAt(0)+s.charAt(0),16)/255,this.g=parseInt(s.charAt(1)+s.charAt(1),16)/255,this.b=parseInt(s.charAt(2)+s.charAt(2),16)/255,this;if(6===u)return this.r=parseInt(s.charAt(0)+s.charAt(1),16)/255,this.g=parseInt(s.charAt(2)+s.charAt(3),16)/255,this.b=parseInt(s.charAt(4)+s.charAt(5),16)/255,this}return n&&0<n.length?this.setColorName(n):this},setColorName:function(t){var n=gr[t];return void 0!==n?this.setHex(n):console.warn("THREE.Color: Unknown color "+t),this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this},copyGammaToLinear:function(t,n){return void 0===n&&(n=2),this.r=Math.pow(t.r,n),this.g=Math.pow(t.g,n),this.b=Math.pow(t.b,n),this},copyLinearToGamma:function(t,n){n=0<(n=void 0===n?2:n)?1/n:1;return this.r=Math.pow(t.r,n),this.g=Math.pow(t.g,n),this.b=Math.pow(t.b,n),this},convertGammaToLinear:function(t){return this.copyGammaToLinear(this,t),this},convertLinearToGamma:function(t){return this.copyLinearToGamma(this,t),this},copySRGBToLinear:function(t){return this.r=Er(t.r),this.g=Er(t.g),this.b=Er(t.b),this},copyLinearToSRGB:function(t){return this.r=Sr(t.r),this.g=Sr(t.g),this.b=Sr(t.b),this},convertSRGBToLinear:function(){return this.copySRGBToLinear(this),this},convertLinearToSRGB:function(){return this.copyLinearToSRGB(this),this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(t){void 0===t&&(console.warn("THREE.Color: .getHSL() target is now required"),t={h:0,s:0,l:0});var n,e=this.r,i=this.g,r=this.b,o=Math.max(e,i,r),s=Math.min(e,i,r),a=(s+o)/2;if(s===o)c=n=0;else{var u=o-s,c=a<=.5?u/(o+s):u/(2-o-s);switch(o){case e:n=(i-r)/u+(i<r?6:0);break;case i:n=(r-e)/u+2;break;case r:n=(e-i)/u+4}n/=6}return t.h=n,t.s=c,t.l=a,t},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:function(t,n,e){return this.getHSL(_r),_r.h+=t,_r.s+=n,_r.l+=e,this.setHSL(_r.h,_r.s,_r.l),this},add:function(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this},addColors:function(t,n){return this.r=t.r+n.r,this.g=t.g+n.g,this.b=t.b+n.b,this},addScalar:function(t){return this.r+=t,this.g+=t,this.b+=t,this},sub:function(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this},multiply:function(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this},multiplyScalar:function(t){return this.r*=t,this.g*=t,this.b*=t,this},lerp:function(t,n){return this.r+=(t.r-this.r)*n,this.g+=(t.g-this.g)*n,this.b+=(t.b-this.b)*n,this},lerpHSL:function(t,n){this.getHSL(_r),t.getHSL(wr);var t=St.lerp(_r.h,wr.h,n),e=St.lerp(_r.s,wr.s,n),n=St.lerp(_r.l,wr.l,n);return this.setHSL(t,e,n),this},equals:function(t){return t.r===this.r&&t.g===this.g&&t.b===this.b},fromArray:function(t,n){return this.r=t[n=void 0===n?0:n],this.g=t[n+1],this.b=t[n+2],this},toArray:function(t,n){return(t=void 0===t?[]:t)[n=void 0===n?0:n]=this.r,t[n+1]=this.g,t[n+2]=this.b,t}}),lt.NAMES=gr;var Mr=function(){function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function")}var n,e,i;return n=t,i=[{key:"round",value:function(t){return 0<t.toFixed(2)?Math.ceil(t.toFixed(2)):Math.floor(t.toFixed(2))}},{key:"generateUUID",value:function(){for(var t=[],n=0;n<256;n++)t[n]=(n<16?"0":"")+n.toString(16);var e=4294967295*Math.random()|0,i=4294967295*Math.random()|0,r=4294967295*Math.random()|0,o=4294967295*Math.random()|0,e=t[255&e]+t[e>>8&255]+t[e>>16&255]+t[e>>24&255]+"-"+t[255&i]+t[i>>8&255]+"-"+t[i>>16&15|64]+t[i>>24&255]+"-"+t[63&r|128]+t[r>>8&255]+"-"+t[r>>16&255]+t[r>>24&255]+t[255&o]+t[o>>8&255]+t[o>>16&255]+t[o>>24&255];return t.length=0,e.toUpperCase()}},{key:"findNearNthPowerOfTwo",value:function(t){t-=1;return(t=(t=(t=(t=(t|=t>>1)|t>>2)|t>>4)|t>>8)|t>>16)<0?1:1+t}},{key:"rgbToArray",value:function(t){var n=new lt;return n.setStyle(t),[n.r,n.g,n.b]}},{key:"toRgba",value:function(t){var n;return void 0===t?t:"number"!=typeof t?3<=(n=t.split(",")).length?"rgba("+parseInt(n[0])+","+parseInt(n[1])+","+parseInt(n[2])+",1)":t:"rgba("+parseInt(255*new lt(t).r)+","+parseInt(255*new lt(t).g)+","+parseInt(255*new lt(t).b)+",1)"}},{key:"toColor",value:function(t){var n;return"number"==typeof t?t:3<=(n=t.split(",")).length?parseInt(n[0])<<16|parseInt(n[1])<<8|parseInt(n[2]):(console.error("color format error",t),0)}},{key:"cov",value:function(t){for(var n=[],e=[0,0],i=[],r=0;r<t.length;r++)e[0]+=t[r].x,e[1]+=t[r].y;e[0]=e[0]/t.length,e[1]=e[1]/t.length;for(var o=0;o<t.length;o++)i.push([t[o].x-e[0],t[o].y-e[1]]);for(var s=[],a=0;a<i[0].length;a++){for(var u=[],c=0;c<i.length;c++)u.push(i[c][a]);s.push(u)}for(var h=0;h<s.length;h++){for(var f=[],l=0;l<i[0].length;l++){for(var d=0,v=0;v<s[h].length;v++)d+=s[h][v]*i[v][l];d/=t.length-1,f.push(d)}n.push(f)}return n}},{key:"eig",value:function(t){var n=(t[0][0]+t[1][1])/2,e=t[0][0]*t[1][1]-t[1][0]*t[0][1],i=n+Math.sqrt(n*n-e),n=n-Math.sqrt(n*n-e);return 0==t[0][1]&&0==t[1][0]?{eigValue:[i,n],eigVect:[[1,0],[0,1]]}:(e=(i-t[0][0])/t[0][1],t=(n-t[0][0])/t[0][1],{eigValue:[i,n],eigVect:[[1/Math.sqrt(1+e*e),e/Math.sqrt(1+e*e)],[1/Math.sqrt(1+t*t),t/Math.sqrt(1+t*t)]]})}}],(e=null)&&Ar(n.prototype,e),i&&Ar(n,i),Object.defineProperty(n,"prototype",{writable:!1}),t}();function Or(t){return(Or="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Lr(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=Or(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Or(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Or(t)?t:String(t)}(i.key),i)}}var e=function(){function n(t){if(!(this instanceof n))throw new TypeError("Cannot call a class as a function");this.Rn=(t=t||{}).src,this.Nn=t.dest,this.Pn=null,this.Fn=[],this.jn=0,this.In=0,this.Cn=0,this.Dn=u.THOUSAND,this.kn=!1,this.Un=!1,this.Bn=!0,this.Gn=null,this.Hn=null,this.Xn=Mr.generateUUID()}var t,e,i;return t=n,(e=[{key:"play",value:function(){return this.Vn()}},{key:"pause",value:function(){return this.Un=!0,this}},{key:"resume",value:function(){return this.Un=!1,this.jn+=this.Cn,this.Cn=0,this}},{key:"stop",value:function(){return this.Bn=!0,this}},{key:"finish",value:function(){return this.Bn=!0,this.Hn&&this.Hn(),this.Fn=[],this}}])&&Lr(t.prototype,e),i&&Lr(t,i),Object.defineProperty(t,"prototype",{writable:!1}),n}(),Rr=(Object.assign(e.prototype,{zn:function(){for(var t in this)this[""+t]=null,delete this[""+t]},Wn:function(t){return this.Rn=t,this},Yn:function(t){return this.Nn=t,this},Qn:function(t){return this.Dn=t*u.THOUSAND,this},Zn:function(t){return this.In=t*u.THOUSAND,this},qn:function(t){return this.Gn=t,this},Kn:function(t){return this.Hn=t,this},Jn:function(t){return this.kn=t,this},Vn:function(){return this.Bn=!1,this.Pn&&(this.jn=this.Pn.$n),this},te:function(){var t=new this.constructor({src:this.Rn,dest:this.Nn});return t.jn=this.jn,t.In=this.In,t.Dn=this.Dn,t.kn=this.kn,t.Gn=this.Gn,t.Hn=this.Hn,t},ne:function(){var t=this.Nn.concat(),n=this.Rn.concat();return this.Rn=t,this.Nn=n,this}}),e);function Nr(t){return(Nr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Pr(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=Nr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Nr(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Nr(t)?t:String(t)}(i.key),i)}}function Fr(t,n,e){return n&&Pr(t.prototype,n),e&&Pr(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var jr=Fr(function t(n,e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this.start=null!=n?n:0,this.stop=null!=e?e:0});function I(t){return null!=t}function Ir(t){return(Ir="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Cr(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=Ir(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Ir(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Ir(t)?t:String(t)}(i.key),i)}}var Dr=function(){function u(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,e=this,i=u;if(!(e instanceof i))throw new TypeError("Cannot call a class as a function");this.center=null==t?void 0:t.clone(),this.radius=n}var t,n,e;return t=u,e=[{key:"computePlaneDistances",value:function(t,n,e,i){I(i)||(i=new jr);var r=new Tt,n=(r.subVectors(t.center,n),e.dot(r));return i.start=n-t.radius,i.stop=n+t.radius,i}},{key:"clone",value:function(t,n){if(I(t))return I(n)?(n.center=t.center.clone(),n.radius=t.radius,n):new u(t.center,t.radius)}},{key:"expand",value:function(t,n,e){e=u.clone(t,e);t=n.distance(e.center);return t>e.radius&&(e.radius=t),e}},{key:"union",value:function(t,n,e){I(e)||(e=new u);var i=t.center,r=t.radius,o=n.center,s=n.radius,a=new Tt,o=(a.subVectors(o,i),a.length());return o+s<=r?u.clone(t,e):o+r<=s?u.clone(n,e):(t=.5*(r+o+s),(n=a.clone()).multiplyScalar((t-r)/o),n.add(i),e.center=n.clone(),e.radius=t),e}},{key:"equals",value:function(t,n){return t===n||I(t)&&I(n)&&t.equals(n.center)&&t.radius===n.radius}}],(n=[{key:"valid",get:function(){return null!==this.center&&null!==this.radius}},{key:"reset",value:function(){this.center=null,this.radius=null}}])&&Cr(t.prototype,n),e&&Cr(t,e),Object.defineProperty(t,"prototype",{writable:!1}),u}();function kr(t){return(kr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ur(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=kr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=kr(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==kr(t)?t:String(t)}(i.key),i)}}var Br=function(){function i(t){if(!(this instanceof i))throw new TypeError("Cannot call a class as a function");this.Bt=t,this.ee=new jr,this.ie=new Dr}var t,n,e;return t=i,e=[{key:"getMeshBoudinggSphere",value:function(t){var t=(new jt).setFromObject(t),n=new Tt,e=(t.getCenter(n),new Tt),t=(t.getSize(e),.5*e.length());return new Dr(n,t)}},{key:"getSceneBoudingSphere",value:function(t,e){t.traverse(function(t){var n;"Mesh"===t.type?n=i.getMeshBoudinggSphere(t):"Scene"!==t.type&&"Group"!==t.type&&"DirectionalLight"!==t.type&&"AmbientLight"!==t.type&&(n=new Dr(t.position,0)),!n||isNaN(n.radius)||isNaN(n.center.x)||isNaN(n.center.y)||isNaN(n.center.z)||(e.valid||Dr.clone(n,e),Dr.union(n,e,e))})}}],(n=[{key:"reset",value:function(){this.re()}},{key:"update",value:function(t){this.oe(t)}}])&&Ur(t.prototype,n),e&&Ur(t,e),Object.defineProperty(t,"prototype",{writable:!1}),i}();function Gr(t){return(Gr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Hr(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=Gr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Gr(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Gr(t)?t:String(t)}(i.key),i)}}function Xr(t,n,e){return n&&Hr(t.prototype,n),e&&Hr(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}Object.assign(Br.prototype,{se:function(){var t,n,e;!this.ie.valid||this.ie.radius<=0||(e=(t=this.Bt).target,((t=t.object).far>u.CAMERA_FAR||void 0===t.userData.far)&&(t.userData.far=Math.max(t.far,null!=(n=t.userData.far)?n:0)),void 0===t.userData.near&&(t.userData.near=t.near),n=t.position,e=e.clone().sub(n).normalize(),Dr.computePlaneDistances(this.ie,n,e,this.ee),this.ee.start>=this.ee.stop)||(t.near=Math.max(this.ee.start,t.userData.near),t.far=this.ee.stop,t.updateProjectionMatrix())},re:function(){this.ie.reset()},oe:function(t){var n=this;t.forEach(function(t){t&&Br.getSceneBoudingSphere(t,n.ie)}),this.se()}});var e=Xr(function t(n,e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this.ae=n,this.ue=e}),Vr=(Object.assign(e.prototype,{ce:function(t){return!1},he:function(t,n){}}),e),e={NONE:0,POINT:1,LINE:2,POLYGON:4,MULTIPOINT:8,MULTILINE:16,MULTIPOLYGON:32,GROUP:64,EXTENT:1024,EXTERNALMODEL:2048,MODEL:4096,FACILITY:8192,LABEL:16384,EXTENTGROUP:1<<20,EXTERNALMODELGROUP:1<<21,MODELGROUP:1<<22,FACILITYGROUP:1<<23,LABELGROUP:1<<24},zr=(Object.freeze(e),e),Wr=function(t,n,e){e=e||2;var i,r,o,s,a,u=n&&n.length,c=u?n[0]*e:t.length,h=Yr(t,0,c,e,!0),f=[];if(h&&h.next!==h.prev){if(u&&(h=function(t,n,e,i){var r,o,s,a,u=[];for(r=0,o=n.length;r<o;r++)a=n[r]*i,s=r<o-1?n[r+1]*i:t.length,(a=Yr(t,a,s,i,!1))===a.next&&(a.steiner=!0),u.push(function(t){var n=t,e=t;for(;(n.x<e.x||n.x===e.x&&n.y<e.y)&&(e=n),n=n.next,n!==t;);return e}(a));for(u.sort(qr),r=0;r<u.length;r++)!function(t,n){(n=function(t,n){var e,i=n,r=t.x,o=t.y,s=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var a=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(a<=r&&s<a){if((s=a)===r){if(o===i.y)return i;if(o===i.next.y)return i.next}e=i.x<i.next.x?i:i.next}}}while(i=i.next,i!==n);if(!e)return null;if(r!==s){var u,c=e,h=e.x,f=e.y,l=1/0;for(i=e;r>=i.x&&i.x>=h&&r!==i.x&&Jr(o<f?r:s,o,h,f,o<f?s:r,o,i.x,i.y)&&(u=Math.abs(o-i.y)/(r-i.x),ro(i,t))&&(u<l||u===l&&(i.x>e.x||i.x===e.x&&function(t,n){return $r(t.prev,t,n.prev)<0&&$r(n.next,t,t.next)<0}(e,i)))&&(e=i,l=u),(i=i.next)!==c;);}return e}(t,n))&&(t=oo(n,t),Qr(n,n.next),Qr(t,t.next))}(u[r],e),e=Qr(e,e.next);return e}(t,n,h,e)),t.length>80*e){for(var l=i=t[0],d=r=t[1],v=e;v<c;v+=e)(o=t[v])<l&&(l=o),(s=t[v+1])<d&&(d=s),i<o&&(i=o),r<s&&(r=s);a=0!==(a=Math.max(i-l,r-d))?1/a:0}Zr(h,f,e,l,d,a)}return f};function Yr(t,n,e,i,r){var o,s;if(r===0<function(t,n,e,i){for(var r=0,o=n,s=e-i;o<e;o+=i)r+=(t[s]-t[o])*(t[o+1]+t[s+1]),s=o;return r}(t,n,e,i))for(o=n;o<e;o+=i)s=so(o,t[o],t[o+1],s);else for(o=e-i;n<=o;o-=i)s=so(o,t[o],t[o+1],s);return s&&to(s,s.next)&&(ao(s),s=s.next),s}function Qr(t,n){if(!t)return t;n=n||t;var e,i=t;do{if(e=!1,i.steiner||!to(i,i.next)&&0!==$r(i.prev,i,i.next))i=i.next;else{if(ao(i),(i=n=i.prev)===i.next)break;e=!0}}while(e||i!==n);return n}function Zr(t,n,e,i,r,o,s){if(t){if(!s&&o){for(var a=t,u=i,c=r,h=o,f=a;null===f.z&&(f.z=Kr(f.x,f.y,u,c,h)),f.prevZ=f.prev,f.nextZ=f.next,(f=f.next)!==a;);f.prevZ.nextZ=null,f.prevZ=null;var l,d,v,p,m,y,b,g,_=f,w=1;do{for(d=_,m=_=null,y=0;d;){for(y++,v=d,l=b=0;l<w&&(b++,v=v.nextZ);l++);for(g=w;0<b||0<g&&v;)0!==b&&(0===g||!v||d.z<=v.z)?(d=(p=d).nextZ,b--):(v=(p=v).nextZ,g--),m?m.nextZ=p:_=p,p.prevZ=m,m=p;d=v}}while(m.nextZ=null,w*=2,1<y)}for(var x,E,S=t;t.prev!==t.next;)if(x=t.prev,E=t.next,o?function(t,n,e,i){var r=t.prev,o=t,s=t.next;if(0<=$r(r,o,s))return;var a=(r.x<o.x?r.x<s.x?r:s:o.x<s.x?o:s).x,u=(r.y<o.y?r.y<s.y?r:s:o.y<s.y?o:s).y,c=(r.x>o.x?r.x>s.x?r:s:o.x>s.x?o:s).x,h=(r.y>o.y?r.y>s.y?r:s:o.y>s.y?o:s).y,f=Kr(a,u,n,e,i),l=Kr(c,h,n,e,i),d=t.prevZ,v=t.nextZ;for(;d&&d.z>=f&&v&&v.z<=l;){if(d!==t.prev&&d!==t.next&&Jr(r.x,r.y,o.x,o.y,s.x,s.y,d.x,d.y)&&0<=$r(d.prev,d,d.next))return;if(d=d.prevZ,v!==t.prev&&v!==t.next&&Jr(r.x,r.y,o.x,o.y,s.x,s.y,v.x,v.y)&&0<=$r(v.prev,v,v.next))return;v=v.nextZ}for(;d&&d.z>=f;){if(d!==t.prev&&d!==t.next&&Jr(r.x,r.y,o.x,o.y,s.x,s.y,d.x,d.y)&&0<=$r(d.prev,d,d.next))return;d=d.prevZ}for(;v&&v.z<=l;){if(v!==t.prev&&v!==t.next&&Jr(r.x,r.y,o.x,o.y,s.x,s.y,v.x,v.y)&&0<=$r(v.prev,v,v.next))return;v=v.nextZ}return 1}(t,i,r,o):function(t){var n=t.prev,e=t,i=t.next;if(0<=$r(n,e,i))return;var r=t.next.next;for(;r!==t.prev;){if(Jr(n.x,n.y,e.x,e.y,i.x,i.y,r.x,r.y)&&0<=$r(r.prev,r,r.next))return;r=r.next}return 1}(t))n.push(x.i/e),n.push(t.i/e),n.push(E.i/e),ao(t),t=E.next,S=E.next;else if((t=E)===S){s?1===s?Zr(t=function(t,n,e){var i=t;do{var r=i.prev,o=i.next.next}while(!to(r,o)&&no(r,i,i.next,o)&&ro(r,o)&&ro(o,r)&&(n.push(r.i/e),n.push(i.i/e),n.push(o.i/e),ao(i),ao(i.next),i=t=o),i=i.next,i!==t);return Qr(i)}(Qr(t),n,e),n,e,i,r,o,2):2===s&&function(t,n,e,i,r,o){var s=t;do{for(var a,u=s.next.next;u!==s.prev;){if(s.i!==u.i&&function(t,n){return t.next.i!==n.i&&t.prev.i!==n.i&&!function(t,n){var e=t;do{if(e.i!==t.i&&e.next.i!==t.i&&e.i!==n.i&&e.next.i!==n.i&&no(e,e.next,t,n))return 1}while(e=e.next,e!==t);return}(t,n)&&(ro(t,n)&&ro(n,t)&&function(t,n){var e=t,i=!1,r=(t.x+n.x)/2,o=(t.y+n.y)/2;for(;e.y>o!=e.next.y>o&&e.next.y!==e.y&&r<(e.next.x-e.x)*(o-e.y)/(e.next.y-e.y)+e.x&&(i=!i),e=e.next,e!==t;);return i}(t,n)&&($r(t.prev,t,n.prev)||$r(t,n.prev,n))||to(t,n)&&0<$r(t.prev,t,t.next)&&0<$r(n.prev,n,n.next))}(s,u))return a=oo(s,u),s=Qr(s,s.next),a=Qr(a,a.next),Zr(s,n,e,i,r,o),Zr(a,n,e,i,r,o);u=u.next}}while(s=s.next,s!==t)}(t,n,e,i,r,o):Zr(Qr(t),n,e,i,r,o,1);break}}}function qr(t,n){return t.x-n.x}function Kr(t,n,e,i,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-e)*r)|t<<8))|t<<4))|t<<2))|t<<1))|(n=1431655765&((n=858993459&((n=252645135&((n=16711935&((n=32767*(n-i)*r)|n<<8))|n<<4))|n<<2))|n<<1))<<1}function Jr(t,n,e,i,r,o,s,a){return 0<=(r-s)*(n-a)-(t-s)*(o-a)&&0<=(t-s)*(i-a)-(e-s)*(n-a)&&0<=(e-s)*(o-a)-(r-s)*(i-a)}function $r(t,n,e){return(n.y-t.y)*(e.x-n.x)-(n.x-t.x)*(e.y-n.y)}function to(t,n){return t.x===n.x&&t.y===n.y}function no(t,n,e,i){var r=io($r(t,n,e)),o=io($r(t,n,i)),s=io($r(e,i,t)),a=io($r(e,i,n));return r!==o&&s!==a||0===r&&eo(t,e,n)||0===o&&eo(t,i,n)||0===s&&eo(e,t,i)||!(0!==a||!eo(e,n,i))}function eo(t,n,e){return n.x<=Math.max(t.x,e.x)&&n.x>=Math.min(t.x,e.x)&&n.y<=Math.max(t.y,e.y)&&n.y>=Math.min(t.y,e.y)}function io(t){return 0<t?1:t<0?-1:0}function ro(t,n){return $r(t.prev,t,t.next)<0?0<=$r(t,n,t.next)&&0<=$r(t,t.prev,n):$r(t,n,t.prev)<0||$r(t,t.next,n)<0}function oo(t,n){var e=new uo(t.i,t.x,t.y),i=new uo(n.i,n.x,n.y),r=t.next,o=n.prev;return(t.next=n).prev=t,(e.next=r).prev=e,(i.next=e).prev=i,(o.next=i).prev=o,i}function so(t,n,e,i){t=new uo(t,n,e);return i?(t.next=i.next,(t.prev=i).next.prev=t,i.next=t):(t.prev=t).next=t,t}function ao(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function uo(t,n,e){this.i=t,this.x=n,this.y=e,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function co(t){return function(t){if(Array.isArray(t))return ho(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,n){var e;if(t)return"string"==typeof t?ho(t,n):"Map"===(e="Object"===(e=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?ho(t,n):void 0}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ho(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}var fo={area:function(t){for(var n=t.length,e=0,i=n-1,r=0;r<n;i=r++)e+=t[i].x*t[r].y-t[r].x*t[i].y;return.5*e},isClockWise:function(t){return fo.area(t)<0},triangulateShape:function(t,n){var e=[],i=[],r=[],o=(lo(t),vo(e,t),t.length);n.forEach(lo);for(var s=0;s<n.length;s++)i.push(o),o+=n[s].length,vo(e,n[s]);for(var a=Wr(e,i),u=0;u<a.length;u+=3)r.push(a.slice(u,u+3));return r},triangulate:function(t){(r=[]).push.apply(r,co(t[0]));for(var n=[],e=1;e<t.length;e++){var i=[];i.push.apply(i,co(t[e])),n.push(i)}if(!fo.isClockWise(r))for(var r=r.reverse(),o=0,s=n.length;o<s;o++){var a=n[o];fo.isClockWise(a)&&(n[o]=a.reverse())}return fo.triangulateShape(r,n)}};function lo(t){var n,e=t.length;2<e&&(e=t[e-1],n=t[0],e.x===n.x)&&e.y===n.y&&t.pop()}function vo(t,n){for(var e=0;e<n.length;e++)t.push(n[e].x),t.push(n[e].y)}function po(t){return(po="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function mo(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=po(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=po(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==po(t)?t:String(t)}(i.key),i)}}function yo(t,n,e){return n&&mo(t.prototype,n),e&&mo(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var bo=1e-5,go=.001,_o=Math.PI/180,wo=180/Math.PI,e=yo(function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function")});Object.assign(e.prototype,{fe:function(){return bo},le:function(){return _o},de:function(){return wo},ve:function(t){return t<bo&&-bo<t},pe:function(t){return bo<t},me:function(t){return t<-bo},ye:function(t,n,e){n=(t.x-e.x)*(n.y-e.y)-(n.x-e.x)*(t.y-e.y);return Math.abs(n)<bo?0:n},distanceOfTwoPoints:function(t,n){return t&&n?Math.sqrt((t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y)):Number.NaN},distance:function(t,n){return Math.sqrt(Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2))},isPolygonContainPoint:function(t,n){for(var e=0,i=0;i<t.length;i++){var r=t[i].x,o=t[i].y,s=0,a=0,a=(i<t.length-1?(s=t[i+1].x,t[i+1]):(s=t[0].x,t[0])).y;if(r===n.x&&o===n.y||s===n.x&&a===n.y)return!0;if(a!==o){var u=r+(n.y-o)*(s-r)/(a-o);if(u===n.x)return!0;r!==s?u<=Math.max(r,s)&&u>=Math.min(r,s)&&u>n.x&&u!==r&&(u===s&&0<(o-n.y)*(a-n.y)?e+=2:e++):u<=Math.max(r,s)&&u>=Math.min(r,s)&&u>n.x&&(u===s&&0<(o-n.y)*(a-n.y)?e+=2:e++)}}return 0<e%2},isPolygonContainPoint2:function(t,n){var e=t.length;if(e<3)return!1;for(var i=e-1,r=0,o=0;o<e;o++){var s=t[o],a=t[i];s.y>n.y!=a.y>n.y&&n.x<(a.x-s.x)*(n.y-s.y)/(a.y-s.y)+s.x&&(s.y>a.y?r++:r--),i=o}return 0!=r},isPolygonInPolygon:function(t,n){var e=Object.assign([],t),i=Object.assign([],n);e.push(e[0]),i.push(i[0]);for(var r=0;r<e.length-1;r++){var o=e[r];if(!this.isPolygonContainPoint(i,o)&&!this.isPolygonContainPoint2(i,o))return!1}for(var s=0;s<e.length-1;s++)for(var a=0;a<i.length-1;a++)if(this.be(e[s],e[s+1],i[a],i[a+1]).isintersect&&!this.ge(i[a],i[a+1],e[s])&&!this.ge(i[a],i[a+1],e[s+1]))return!1;return!0},_e:function(t,n,e,i){return!(Math.max(t.x,n.x)<Math.min(e.x,i.x)||Math.max(t.y,n.y)<Math.min(e.y,i.y)||Math.max(e.x,i.x)<Math.min(t.x,n.x)||Math.max(e.y,i.y)<Math.min(t.y,n.y))},we:function(t,n,e,i){return!(Math.max(t.x,n.x)<Math.min(e.x,i.x)||Math.max(t.y,n.y)<Math.min(e.y,i.y)||Math.max(e.x,i.x)<Math.min(t.x,n.x)||Math.max(e.y,i.y)<Math.min(t.y,n.y)||0===this.ye(e,n,t)&&0===this.ye(n,i,t)||this.ye(e,n,t)*this.ye(n,i,t)<0||this.ye(t,i,e)*this.ye(i,n,e)<0)},xe:function(t,n,e){return!(t.x<n.x||t.y<n.y||t.x>e.x||t.y>e.y)},Ee:function(t,n,e){var i=Math.min(n.x,e.x),r=Math.max(n.x,e.x),o=Math.min(n.y,e.y),n=Math.max(n.y,e.y);return!(t.x<i||t.x>r||t.y<o||t.y>n)},Se:function(t,n,e){var i=Math.min(e.x,n.x),r=Math.max(e.x,n.x),o=Math.min(e.y,n.y),e=Math.max(e.y,n.y);return!(t.x<i||t.x>r||t.y<o||t.y>e)},Te:function(t,n,e){for(var i,r,o=!1,s=0;s<e;s++)i=n[s],r=n[(s+1)%e],(i.y<t.y&&r.y>=t.y||r.y<t.y&&i.y>=t.y)&&(i.x<=t.x||r.x<=t.x)&&i.x+(t.y-i.y)/(r.y-i.y)*(r.x-i.x)<t.x&&(o=!o);return o},Ae:function(t,n,e){return(t.x-n.x)*(e.y-n.y)==(e.x-n.x)*(t.y-n.y)&&Math.min(n.x,e.x)<=t.x&&t.x<=Math.max(n.x,e.x)&&Math.min(n.y,e.y)<=t.y&&t.y<=Math.max(n.y,e.y)},Me:function(t,n){return Math.sqrt((t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y))},Oe:function(t,n){return(t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y)},Le:function(t,n,e){var i=n.x,n=n.y,r=e.x,e=e.y,o=t.x,t=t.y,s=r-i,a=e-n,u=s*s+a*a,c=o-i,h=t-n,f=c*c+h*h;return this.ve(u)?this.ve(f)?0:f:(u=Math.sqrt(u),h=this.pe(a=(s=s/u)*c+(c=a/u)*h)?this.me(a-u)?(h=o-(i+a*s))*h+(u=t-(n+a*c))*u:(i=o-r)*i+(s=t-e)*s:f,this.ve(h)?0:h)},Re:function(t,n,e,i){var r,o=n.x,s=n.y,a=e.x,u=e.y,c=t.x,t=t.y,h=a-o,f=u-s,l=Math.sqrt(h*h+f*f),d=c-o,v=t-s,p=Math.sqrt(d*d+v*v);return this.ve(l)?(i.x=n.x,i.y=n.y,this.ve(r=p)?0:r):(r=this.pe(f=(h=h/l)*d+(d=f/l)*v)?this.me(f-l)?(l=c-(v=o+f*h),h=t-(o=s+f*d),s=Math.sqrt(l*l+h*h),i.x=v,i.y=o,s):(f=c-a,d=t-u,l=Math.sqrt(f*f+d*d),i.x=e.x,i.y=e.y,l):(i.x=n.x,i.y=n.y,p),this.ve(r)?0:r)},Ne:function(t,n){for(var e=0,i=0,r=0,o=0;o<n;o++){var s=t[o],a=t[(o+1)%n],u=(s.x*a.y-s.y*a.x)/2;e+=u,i+=u*(s.x+a.x)/3,r+=u*(s.y+a.y)/3}return{x:i/=e,y:r/=e}},Pe:function(t){for(var n=fo.triangulate([t]),e=0,i=0,r=0,o=0;o<n.length;o++){var s=t[n[o][0]],a=t[n[o][1]],u=t[n[o][2]],c=a.x-s.x,h=a.y-s.y,f=u.x-s.x,c=(c*(u.y-s.y)-f*h)/2;e+=c,i+=(s.x+a.x+u.x)/3*c,r+=(s.y+a.y+u.y)/3*c}return{x:i/e,y:r/e}},Fe:function(t,n){if(n<3)return 0;for(var e=0,i=0;i<n;++i){var r=t[i],o=t[(i+1)%n];e+=r.x*o.y-r.y*o.x}return Math.abs(e/2)},je:function(t,n,e,i,r){var o,s;return this.we(t,n,e,i)?(o=(i.x-e.x)*(t.y-n.y)-(n.x-t.x)*(e.y-i.y),s=(t.y-e.y)*(n.x-t.x)*(i.x-e.x)+e.x*(i.y-e.y)*(n.x-t.x)-t.x*(n.y-t.y)*(i.x-e.x),r.x=s/o,o=(t.x-n.x)*(i.y-e.y)-(n.y-t.y)*(e.x-i.x),s=n.y*(t.x-n.x)*(i.y-e.y)+(i.x-n.x)*(i.y-e.y)*(t.y-n.y)-i.y*(e.x-i.x)*(n.y-t.y),r.y=s/o,1):0},Ie:function(t,n,e,i,r){var o=Math.min(e.x,i.x),s=Math.max(e.x,i.x),a=Math.min(e.y,i.y),u=Math.max(e.y,i.y),c=t.x,h=t.y,f=e.x,l=e.y,d=i.x,v=i.y;if(90==n)return!(t.x<o||t.x>s||(Math.abs(s-o<go)?t.y>=l&&t.y<=v||t.y>=v&&t.y<=l?(r.x=t.x,r.y=t.y,0):l<v&&t.x<l?(r.x=f,r.y=l,0):!(v<l&&t.x<v)||(r.x=d,r.y=v,0):(r.y=p=(v-l)/(d-f)*(c-f)+l,r.x=c,p<h||!this.Se(r,e,i))));if(270==n)return!(t.x<o||t.x>s||(Math.abs(s-o<go)?t.y>=l&&t.y<=v||t.y>=v&&t.y<=l?(r.x=t.x,r.y=t.y,0):l<v&&t.y>v?(r.x=d,r.y=v,0):!(v<l&&t.y>l)||(r.x=f,r.y=l,0):(r.y=p=(v-l)/(d-f)*(c-f)+l,r.x=c,h<p||!this.Se(r,e,i))));if(270!=n&&90!=n&&Math.abs(s-o<go)){var t=o,p=Math.tan(n/180*Math.PI)*(t-c)+h;if(r.y=p,r.x=t,this.Se(r,e,i))return s=p-h,0<(o=t-c)/Math.sqrt(o*o+s*s)*Math.cos(n/180*Math.PI)}return Math.abs(u-a<=go)?(p=a,t=1/Math.tan(n/180*Math.PI)*(p-h)+c,r.x=t,r.y=p,!!this.Se(r,e,i)&&(o=p-h,0<(s=t-c)/Math.sqrt(s*s+o*o)*Math.cos(n/180*Math.PI))):(t=h+(u=Math.tan(n/180*Math.PI))*((p=(l-h-((a=(v-l)/(d-f))*f-u*c))/(u-a))-c),r.x=p,r.y=t,!!this.Se(r,e,i)&&(s=p-c,o=t-h,Math.abs(s)<=go&&Math.abs(o)<=go||0<s/Math.sqrt(s*s+o*o)*Math.cos(n/180*Math.PI)))},Ce:function(t,n){return Math.abs(t.x-n.x)<bo&&Math.abs(t.y-n.y)<bo},De:function(t,n,e,i){var r,o,s,a,u=t.x,c=t.y,h=n.x,f=n.y,l=e.x,d=e.y;return this.Ce(t,n)||this.Ce(t,e)?(i.x=u,i.y=c,!0):(s=Math.min(n.x,e.x),a=Math.max(n.x,e.x),r=Math.min(n.y,e.y),o=Math.max(n.y,e.y),Math.abs(h-l)<1e-5?(i.x=h,r<=(i.y=c)&&c<=o):Math.abs(f-d)<1e-5?(i.x=u,i.y=f,s<=u&&u<=a):(a=c+(r=-1/((d-f)/(l-h)))*((s=(f-c-((o=(d-f)/(l-h))*h-r*u))/(r-o))-u),i.x=s,i.y=a,!!this.Se(i,n,e)||!(!this.Ce(t,n)&&!this.Ce(t,e))))},ke:function(t,n){return{x:t.y*n.z-t.z*n.y,y:t.z*n.x-t.x*n.z,z:t.x*n.y-t.y*n.x}},Ue:function(t,n){return t.x*n.x+t.y*n.y+t.z*n.z},Be:function(t){return Math.sqrt(t.x*t.x+t.y*t.y+t.z*t.z)},Ge:function(t,n){return t.x*n.x+t.y*n.y},He:function(t,n){return t.x*n.y-t.y*n.x},Xe:function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},Ve:function(t,n){var e,i;return 0==t.x&&0==t.y||0==n.x&&0==n.y?0:(e={x:t.x,y:t.y,z:0},i={x:n.x,y:n.y,z:0},e=this.ke(e,i),i=this.Ge(t,n),i=Math.acos(i/(this.Xe(t)*this.Xe(n))),0<e.z?i/Math.PI*180:360-i/Math.PI*180)},ze:function(t,n,e,i){for(var r=0;r<e.length;r++){var o=e[r],s=e[(r+1)%e.length];if(1==this.je(t,n,o,s,i))return!0}return!1},We:function(t,n,e,i,r){var o=Math.min(t.x,e.x,i.x),s=Math.max(t.x,e.x,i.x),a=Math.min(t.y,e.y,i.y),u=Math.max(t.y,e.y,i.y),s=Math.sqrt((s-o)*(s-o)+(u-a)*(u-a)),o=n/180*Math.PI,u=s*Math.cos(o)+t.x,a=s*Math.sin(o)+t.y;return 1==this.je(t,{x:u,y:a},e,i,r)},Ye:function(t){var n={x:null,y:null},e=0,i=0;1<t.length&&t[0].x===t[t.length-1].x&&t[0].y===t[t.length-1].y&&t.pop();for(var r=0;r<t.length;r++)e+=t[r].x,i+=t[r].y;return n.x=e/t.length,n.y=i/t.length,n},Qe:function(t,n,e,i){var r=[],o=t.x-n,s=t.x+n,a=t.y-n,u=t.y+n,c=Math.min(e.x,i.x),h=Math.max(e.x,i.x),f=Math.min(e.y,i.y),l=Math.max(e.y,i.y);return h<o||s<c||l<a||u<f||(o=i.x-e.x,s=i.y-e.y,(a=(t=(o*(a=t.x-e.x)+s*(u=t.y-e.y))/(i=o*o+s*s))*t-(a*a+u*u-n*n)/i)<0)||(u=Math.sqrt(a),i={x:e.x-o*(n=-t+u),y:e.y-s*n},o={x:e.x-o*(a=-t-u),y:e.y-s*a},n!==a&&(c<=i.x&&i.x<=h&&f<=i.y&&i.y<=l&&r.push(i),c<=o.x)&&o.x<=h&&f<=o.y&&o.y<=l&&r.push(o)),r},Ze:function(t,n,e){var i,r={};if(t.x!=n.x)return i=n=(n.y-t.y)/(n.x-t.x),n=t.y-n*t.x,r.x=(+e.x- -1*i*e.y-i*n)/(i*i+1),r.y=(i*i*e.y- -1*i*e.x- -1*n)/(i*i+1),r;r.x=t.x,r.y=e.y},be:function(t,n,e,i){var r,o,s,a,u={point:null,isintersect:!1};return t==e||t==i?(u.isintersect=!0,u.point=t):n==e||n==i?(u.isintersect=!0,u.point=n):(r={x:n.x-t.x,y:n.y-t.y},o={x:i.x-e.x,y:i.y-e.y},s={x:e.x-t.x,y:e.y-t.y},i={x:i.x-t.x,y:i.y-t.y},n={x:n.x-e.x,y:n.y-e.y},e={x:-s.x,y:-s.y},a=this.He(o,r),Math.abs(a)<=1e-5||this.He(s,r)*this.He(i,r)<=-5e-4&&this.He(e,o)*this.He(n,o)<-5e-4&&(i=this.He(o,s)/a,u.point={x:t.x+r.x*i,y:t.y+r.y*i},u.isintersect=!0)),u},qe:function(t,n,e){t.x===n.x&&(n.x=n.x+1),t.y===n.y&&(n.y=n.y+1),n.x===e.x&&(e.x=e.x+1),n.y===e.y&&(e.y=e.y+1);var i=n.x-t.x,t=n.y-t.y,r=e.x-n.x;return!(0<i*(e.y-n.y)-t*r)},getAngle:function(t){var n=t.p1,t=t.p2,e=t.x-n.x,t=t.y-n.y,n=Math.sqrt(e*e+t*t),n=Math.asin(Math.abs(t)/n);return 0<e&&0<t?n:e<0&&0<t?Math.PI-n:e<0&&t<0?Math.PI+n:0<e&&t<0?2*Math.PI-n:0==e&&0<t?n:0==e&&t<0?3*Math.PI/2:0<e&&0==t?n:e<0&&0==t?Math.PI:null},Ke:function(t){var n=this.distanceOfTwoPoints(t[0],t[1]),e=this.distanceOfTwoPoints(t[1],t[2]),t=this.distanceOfTwoPoints(t[0],t[2]),i=(n+e+t)/2;return Math.sqrt(i*(i-n)*(i-e)*(i-t))},Je:function(t,n){var e,i,r,o,s;return this.Re(t,n[0],n[1],{})<1e-4||this.Re(t,n[0],n[2],{})<1e-4||this.Re(t,n[1],n[2],{})<1e-4||(o={x:n[1].x-n[0].x,y:n[1].y-n[0].y},e={x:n[0].x-n[2].x,y:n[0].y-n[2].y},i={x:n[2].x-n[1].x,y:n[2].y-n[1].y},s={x:t.x-n[0].x,y:t.y-n[0].y},r={x:t.x-n[1].x,y:t.y-n[1].y},t={x:t.x-n[2].x,y:t.y-n[2].y},n=this.He(o,s),o=this.He(i,r),s=this.He(e,t),bo<n*o&&bo<o*s)},$e:function(t,n,e){var i=e.length,r={isintersect:!1,start:null,end:null,type:0,outer:null},o=[];if(this.Je(t,e)&&(r.start=t),this.Je(n,e)&&(r.end=n),null!=r.start&&null!=r.end)r.isintersect=!0,r.type=1;else{for(var s=(e[1].x+e[2].x)/2,a=(e[1].y+e[2].y)/2,u=1;u<i;u++){var c,h=this.be(t,n,e[u-1],e[u]);if(h.isintersect){if(null!=r.start)return r.end=h.point,r.isintersect=!0,r.outer="end",c=this.Ve({x:s-e[0].x,y:a-e[0].y},{x:n.x-e[0].x,y:n.y-e[0].y}),r.type=0<(c=c<180?c:c-360)?2:3,r;if(null!=r.end)return r.start=h.point,r.isintersect=!0,r.outer="start",c=this.Ve({x:s-e[0].x,y:a-e[0].y},{x:t.x-e[0].x,y:t.y-e[0].y}),r.type=0<(c=c<180?c:c-360)?2:3,r;o.push(h)}}var f,l=this.be(t,n,e[0],e[i-1]);if(l.isintersect){if(null!=r.start)return r.end=l.point,r.isintersect=!0,r.outer="end",f=this.Ve({x:s-e[0].x,y:a-e[0].y},{x:n.x-e[0].x,y:n.y-e[0].y}),r.type=0<(f=f<180?f:f-360)?2:3,r;if(null!=r.end)return r.start=l.point,r.isintersect=!0,r.outer="start",f=this.Ve({x:s-e[0].x,y:a-e[0].y},{x:t.x-e[0].x,y:t.y-e[0].y}),r.type=0<(f=f<180?f:f-360)?2:3,r;o.push(l)}2!=o.length||this.distanceOfTwoPoints(o[0].point,o[1].point)<.01||(this.distanceOfTwoPoints(o[0].point,t)<=this.distanceOfTwoPoints(o[0].point,n)?(r.start=o[0].point,r.end=o[1].point):(r.start=o[1].point,r.end=o[0].point),r.isintersect=!0,r.type=4)}return r},ti:function(t,n,e){var i=e.length,r={isintersect:!1,start:null,end:null},o=[];if(this.Je(t,e)&&(r.start=t),this.Je(n,e)&&(r.end=n),null!=r.start&&null!=r.end)r.isintersect=!0;else{for(var s=1;s<i;s++){var a=this.be(t,n,e[s-1],e[s]);if(a.isintersect){if(null!=r.start)return r.end=a.point,r.isintersect=!0,r;if(null!=r.end)return r.start=t,r.isintersect=!0,r;o.push(a)}}var u=this.be(t,n,e[0],e[i-1]);if(u.isintersect){if(null!=r.start)return r.end=u.point,r.isintersect=!0,r;if(null!=r.end)return r.start=t,r.isintersect=!0,r;o.push(u)}2==o.length&&(r.start=(this.distanceOfTwoPoints(o[0].point,t)<=this.distanceOfTwoPoints(o[0].point,n)?o[0]:o[1]).point,r.end=(this.distanceOfTwoPoints(o[0].point,t)>this.distanceOfTwoPoints(o[0].point,n)?o[0]:o[1]).point,r.isintersect=!0)}return r},ni:function(r,t){if(0==t.length)return[r];for(var n,e,i=this.ei(t),o=[],s=(i.sort(function(t,n){var e=(t.ii.x-r.ii.x)*(t.ii.x-r.ii.x)+(t.ii.y-r.ii.y)*(t.ii.y-r.ii.y),i=(n.ii.x-r.ii.x)*(n.ii.x-r.ii.x)+(n.ii.y-r.ii.y)*(n.ii.y-r.ii.y),t=(t.ri.x-r.ii.x)*(t.ri.x-r.ii.x)+(t.ri.y-r.ii.y)*(t.ri.y-r.ii.y),n=(n.ri.x-r.ii.x)*(n.ri.x-r.ii.x)+(n.ri.y-r.ii.y)*(n.ri.y-r.ii.y);return(e<t?e:t)<(i<n?i:n)}),0),s=0;s<i.length;s++)this.distanceOfTwoPoints(i[s].ii,i[s].ri)<.01||(n=this.distanceOfTwoPoints(i[s].ii,r.ii),e=this.distanceOfTwoPoints(i[s].ri,r.ii),n<.01?r.ii=i[s].ri:e<.01?r.ii=i[s].ii:n<e?.1<this.distanceOfTwoPoints(r.ii,i[s].ii)&&(o.push({oi:r.oi,ii:r.ii,ri:i[s].ii,Me:r.Me,si:r.si}),r.ii=i[s].ri):.1<this.distanceOfTwoPoints(r.ii,i[s].ri)&&(o.push({oi:r.oi,ii:r.ii,ri:i[s].ri,Me:r.Me,si:r.si}),r.ii=i[s].ii),i.splice(s,1));return.1<this.distanceOfTwoPoints(r.ii,r.ri)&&o.push(r),o},ei:function(t){var n=[];if(1==t.length)return t;for(var e=t[0],i=1;0<t.length;){if(i>=t.length){if(n.push(e),t.splice(0,1),t.length<1)break;e=t[0],i=1}if(1===t.length){n.push(e);break}this.ge(e.ii,e.ri,t[i].ii)?(this.ge(e.ii,e.ri,t[i].ri)||(e.ri=t[i].ri),t.splice(i,1)):this.ge(e.ii,e.ri,t[i].ri)?(e.ii=t[i].ii,t.splice(i,1)):this.ge(t[i].ii,t[i].ri,e.ii)?(e=(this.ge(t[i].ii,t[i].ri,e.ri)||(t[i].ri=e.ri),t[i]),t.splice(i,1)):this.ge(t[i].ii,t[i].ri,e.ri)?(t[i].ii=e.ii,e=t[i],t.splice(i,1)):i++}return n},ge:function(t,n,e){var i=t.x-e.x,r=t.y-e.y,o=n.x-e.x,s=n.y-e.y,a=this.distanceOfTwoPoints(t,e),e=this.distanceOfTwoPoints(n,e),t=this.distanceOfTwoPoints(t,n);return i*s-r*o<1e-5&&a+e-t<.001}});var z=new e;function xo(t){return(xo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Eo(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=xo(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=xo(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==xo(t)?t:String(t)}(i.key),i)}}function So(t,n,e){n=Ao(n);var i=t,n=To()?Reflect.construct(n,e||[],Ao(t).constructor):n.apply(t,e);if(n&&("object"===xo(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function To(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(To=function(){return!!t})()}function Ao(t){return(Ao=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Mo(t,n){return(Mo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var e=function(){var t,n,e=r,i=Vr;if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");function r(t,n){if(this instanceof r)return(t=So(this,r,[t,n])).ai=new Fi,t.ui=null,t;throw new TypeError("Cannot call a class as a function")}return e.prototype=Object.create(i&&i.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),i&&Mo(e,i),e=r,t&&Eo(e.prototype,t),n&&Eo(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(),Oo=(Object.assign(e.prototype,{ce:function(t){return t.getType()!=zr.MODEL?this.ci(t):this.fi(t)},fi:function(t){return!0},li:function(t){t=t.getBound();return!!z._e(this.ai.X,this.ai.H,t.min,t.max)},he:function(t,n){var e=t.getCoordinates();if(t.getType()!==zr.MODEL)n.Me=Math.sqrt(z.Oe(e[0],this.Kt));else{for(var i=Number.MAX_VALUE,r=0,o=e.length;r<o;r++)for(var s=1,a=e[r].length;s<a;s++){var u=e[r][s-1],c=e[r][s],u=z.Le(this.Kt,u,c);u<i&&(i=u)}n.Me=Math.sqrt(i)}},ci:function(t){t=t.getCoordinates()[0];return!!z.xe(t,this.ai.X,this.ai.H)&&("circle"===this.ui?z.Oe(t,this.Kt)<this._radiusSquare:z.Te(t,this.di,this.di.length-1))}}),e);function Lo(t){return(Lo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ro(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=Lo(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Lo(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Lo(t)?t:String(t)}(i.key),i)}}function No(t,n,e){n=Fo(n);var i=t,n=Po()?Reflect.construct(n,e||[],Fo(t).constructor):n.apply(t,e);if(n&&("object"===Lo(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function Po(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Po=function(){return!!t})()}function Fo(t){return(Fo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function jo(t,n){return(jo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var e=function(){var t,n,e=r,i=Oo;if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");function r(t,n){if(this instanceof r)return(t=No(this,r,[t,n])).ui="polygon",t.di=t.ue,t.vi=t.di.length-1,t.Kt=z.Pe(t.di),t.ai.Yt(t.di),t;throw new TypeError("Cannot call a class as a function")}return e.prototype=Object.create(i&&i.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),i&&jo(e,i),e=r,t&&Ro(e.prototype,t),n&&Ro(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(),Io=(Object.assign(e.prototype,{fi:function(t){if(this.li(t)){for(var n=t.getCoordinates(),e=0,i=n.length;e<i;e++)for(var r=0,o=n[e].length-1;r<o;r++)if(z.Te(n[e][r],this.di,this.di.length))return!0;for(var s=0;s<this.vi;s++){for(var a=!1,u=0,c=n.length;u<c;u++)z.Te(this.di[s],n[u],n[u].length-1)&&(a=0==u);if(a)return!0}for(var h=0;h<=this.vi;h++)for(var f=null,l=null,l=h===this.vi?(f=this.di[0],this.di[h]):(f=this.di[h],this.di[h+1]),d=0,v=n.length;d<v;d++)for(var p=0,m=n[d].length-1;p<m;p++){var y=n[d][p],b=n[d][p+1];if(z.we(f,l,y,b))return!0}}return!1}}),e),Co=t(30),e={STOP:0,PASS:1,PUSH:2},Do=(Object.freeze(e),e);function ko(t){return(ko="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Uo(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=ko(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=ko(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==ko(t)?t:String(t)}(i.key),i)}}var e=function(){function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this.pi=-1,this.mi=zr.NONE,this.yi=null,this.ai=null}var n,e,i;return n=t,(e=[{key:"getType",value:function(){return this.mi}},{key:"getCoordinates",value:function(){return this.yi}},{key:"getBound",value:function(){return this.ai||this.bi(),this.ai}}])&&Uo(n.prototype,e),i&&Uo(n,i),Object.defineProperty(n,"prototype",{writable:!1}),t}(),Bo=(Object.assign(e.prototype,{zn:function(){},gi:function(t){t._support(this)==Do.PUSH&&t._result.push(this)}}),e);function Go(t){return(Go="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ho(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=Go(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Go(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Go(t)?t:String(t)}(i.key),i)}}function Xo(t,n,e){n=zo(n);var i=t,n=Vo()?Reflect.construct(n,e||[],zo(t).constructor):n.apply(t,e);if(n&&("object"===Go(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return Wo(i)}function Vo(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Vo=function(){return!!t})()}function zo(t){return(zo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Wo(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Yo(t,n){return(Yo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var e=function(){var t,n=i,e=Bo;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");function i(t){var n;if(this instanceof i)return(n=Xo(this,i)).pi=t.eid,n.mi=zr.POLYGON,Object.assign(Wo(n),t),n;throw new TypeError("Cannot call a class as a function")}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&Yo(n,e),n=i,(e=[{key:"getCenter",value:function(){return this.Kt}}])&&Ho(n.prototype,e),t&&Ho(n,t),Object.defineProperty(n,"prototype",{writable:!1}),i}(),Qo=(Object.assign(e.prototype,{bi:function(){var n=this;this.ai=new Fi,this.yi&&this.yi.forEach(function(t){n.ai.Yt(t)})},gi:function(t){t._support(this)==Do.PUSH&&t._result.push(this)}}),e),e={NO_RIGHT_CLICK:2,NORMAL:4},Zo=(Object.freeze(e),e);function qo(t){return function(t){if(Array.isArray(t))return Ko(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,n){var e;if(t)return"string"==typeof t?Ko(t,n):"Map"===(e="Object"===(e=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Ko(t,n):void 0}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ko(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function Jo(t){return(Jo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function $o(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=Jo(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Jo(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Jo(t)?t:String(t)}(i.key),i)}}var e=function(){function r(t,n,e){var i=this;if(!(this instanceof r))throw new TypeError("Cannot call a class as a function");this.gn=t,this.En=e,this._i=[295829355.45,147914677.73,73957338.86,36978669.43,18489334.72,9244667.36,4622333.68,2311166.84,1155583.42,577791.71,288895.85,144447.93,72223.96,36111.98,18056,9028,4514,2257,1128,564,282,141,70,35,17,8,4,2,1],this.Ot=[],this.wi=new Map,this.xi=null,this.Ei=this.En.Si,this.Ti=null,this.Bt=new hr(this.gn.kt,n,this.gn),this.Bt.enableDamping=this.gn.Ai.enableDamping,this.Bt.dampingFactor=.08,this.gn.Ai.mouseMode===Zo.NO_RIGHT_CLICK&&this.Bt.setMouseMiddleButtonRotation(),this.Mi=null,this.Bt.addEventListener("change",function(){i.Hn(),i.gn.Dt.Ct({type:"viewChanged"}),i.gn.jt.Oi=1,null!==i.Mi&&clearTimeout(i.Mi),i.Mi=setTimeout(function(){i.gn.jt.Oi=0,i.gn.enableUpdateRender()},10)}),this.Li=new Br(this.Bt,this.gn.An,this.gn.Ut);t=!this.gn.Ai.lock;this.Bt.enableZoom=t,this.Bt.enablePan=t,this.Bt.enableRotate=t,this.Bt.enableRotateLeft=t,this.Bt.enableRotateUp=t,this.Ri=t,this.Ni=t,this.Pi=t,this.Fi=t,this.ji=this.Bt.useRange}var t,n,e;return t=r,(n=[{key:"enableZoom",get:function(){return this.Ri},set:function(t){this.Ri=t,this.Bt.enableZoom=t}},{key:"enableDragRange",get:function(){return this.ji},set:function(t){this.ji=t}},{key:"enableDrag",get:function(){return this.Ni},set:function(t){this.Ni=t,this.Bt.enablePan=t}},{key:"enableRotate",get:function(){return this.Pi},set:function(t){this.Pi=t,this.Bt.enableRotateLeft=t}},{key:"enableTilt",get:function(){return this.Fi},set:function(t){this.Fi=t,this.Bt.enableRotateUp=t}},{key:"enableDamping",get:function(){return this.Bt.enableDamping},set:function(t){this.Bt.enableDamping=t}},{key:"controls",get:function(){return this.Bt},set:function(t){this.Bt=t}},{key:"autoCameraNearFar",get:function(){return this.Li}},{key:"mouseMode",get:function(){return this.gn.Ai.mouseMode}},{key:"zoomSpeed",get:function(){return this.Bt.zoomSpeedParam},set:function(t){this.Bt.zoomSpeedParam=t}},{key:"copyControls",value:function(t){t=new hr(t,this.Bt.domElement,this.gn);return t.target=(new Tt).copy(this.Bt.target),t.maxDistance=this.Bt.maxDistance,t.minDistance=this.Bt.minDistance,t.minZoom=this.Bt.minZoom,t.maxZoom=this.Bt.maxZoom,t.minPolarAngle=this.Bt.minPolarAngle,t.maxPolarAngle=this.Bt.maxPolarAngle,t.update({theta:this.Bt.getAzimuthalAngle()}),t}},{key:"pauseDamping",value:function(){this.Bt&&this.Bt.pauseDamping()}},{key:"resumeDamping",value:function(){this.Bt&&this.Bt.pauseDamping()}}])&&$o(t.prototype,n),e&&$o(t,e),Object.defineProperty(t,"prototype",{writable:!1}),r}(),ts=(Object.assign(e.prototype,{zn:function(){for(var t in clearTimeout(this.Mi),this.Bt.dispose(),this)this[""+t]=null,delete this[""+t]},Ii:function(){var t,n=this.Ci(this.En.zoom),e=this.Di(n),i=this.En.Kt,r=this.gn.Nt.ki(this.gn.Tn.pi,this.gn.Tn.level);r?(i.y=r.nt,this.Bt.target=(new Tt).copy(i),this.Bt.object.lookAt(i),this.Ui(),this.En.Si===xi.MODE_3D?(r=(u.TILT_UPPER_BOUND-this.En.Bi)*u.DEG2RAD,t=e*Math.cos(r),r=e*Math.sin(r),this.Bt.object.position.set(i.x,i.y+t,i.z+r),this.Bt.minPolarAngle=(u.TILT_UPPER_BOUND-this.gn.Ai.maxTiltAngle)*u.DEG2RAD,this.Bt.maxPolarAngle=(u.TILT_UPPER_BOUND-this.gn.Ai.minTiltAngle)*u.DEG2RAD):(t=this.Gi(n),this.Bt.minPolarAngle=0,this.Bt.maxPolarAngle=0,this.Bt.object.position.set(i.x,i.y+e,i.z),this.Bt.object.zoom=1/t,this.Bt.object.updateProjectionMatrix()),r=this.Hi(this.En.qt),this.Bt.update({theta:this.Bt.getAzimuthalAngle()+r})):(this.gn.Xi.error.push(n={type:"info",InfoMode:vr.DEFAULT_LEVEL_ERROR}),this.gn.Dt.Ct(n))},Vi:function(t){this.Bt.target=t,this.Bt.update()},zi:function(e){var i,t,n,r=this;this.Ei===e.mode?e.mode===this.gn.getViewMode()&&e.finish&&e.finish():(this.Ei=e.mode,i=this.Bt,this.Ti&&!1===this.Ti.Bn&&this.Ti.finish(),e.mode===xi.MODE_2D?(i.minPolarAngle=-90*u.DEG2RAD,this.En.Bi=this.gn.getTilt(),this.Wi({animate:void 0===e.animate||e.animate,duration:1,tilt:90,finish:function(){i.maxPolarAngle=0;var t=r.gn.Ut,n=r.Yi(),n=r.Gi(n);t.quaternion.copy(i.object.quaternion),t.position.copy(i.object.position),t.zoom=1/n,t.updateProjectionMatrix(),i.object=t,i.update(),r.gn.kt=t,r.gn.jt.Ht(),e.finish&&e.finish(),r.gn.Dt.Ct({type:"viewModeChanged"})}})):e.mode===xi.MODE_3D&&(i.maxPolarAngle=(u.TILT_UPPER_BOUND-this.gn.Ai.minTiltAngle)*u.DEG2RAD,t=this.gn.An,n=this.Qi(),n=this.Di(n),t.quaternion.copy(i.object.quaternion),t.position.copy(i.object.position),t.position.setY(i.target.y+n),t.updateMatrix(),i.object=t,i.update(),this.gn.kt=t,this.gn.jt.Ht(),this.Wi({animate:void 0===e.animate||e.animate,duration:1,tilt:this.En.Bi,finish:e.finish}),this.gn.Dt.Ct({type:"viewModeChanged"})))},Zi:function(t){var n;(n=this.Ot).push.apply(n,qo(t))},Hn:function(){for(var t=0;t<this.Ot.length;t++)this.Ot[t].call(this.gn.jt)},wn:function(){try{var t=!1,n=this.gn.camera,e=this.gn.getBuilding(this.En.xn),i=e.getFloor(e.level),r=i.getLayers(E.EXTENT_LAYER)[0];if(this.gn.Ai.panRangeValue){for(var o,s,a,u,c=new Vt,h=(c.setFromProjectionMatrix((new At).multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse)),null),f=0;f<r.Ot.length;f++)r.Ot[f].Lt&&(h=r.Ot[f].Lt);return null===h?!1:(o=h.geometry.boundingSphere,(s=new Dt).copy(o).applyMatrix4(h.matrixWorld),u=new Dt(new Tt((a=this.gn.Ai.panRangeValue).center.x-this.gn.x,s.center.y,this.gn.y-a.center.y),a.radius),c.intersectsSphere(u))}for(var l=[],d=this.gn.Ai.container.clientWidth,v=this.gn.Ai.container.clientHeight,p=(l.push(dr.coordsScreenToMap(this.gn,{x:0,y:0,level:i.level,buildingID:e.pi})),l.push(dr.coordsScreenToMap(this.gn,{x:d,y:0,level:i.level,buildingID:e.pi})),l.push(dr.coordsScreenToMap(this.gn,{x:d,y:v,level:i.level,buildingID:e.pi})),l.push(dr.coordsScreenToMap(this.gn,{x:0,y:v,level:i.level,buildingID:e.pi})),new Io("polygon",l)),m=0;m<r.Ot.length;m++){var y=function(t){for(var n=[],e=0;e<t.length;e++)n.push([t[e].x,t[e].y]);for(var i=Object(Co.polygonScale)(n,.9),r=[],o=0;o<i.length;o++)r.push({x:i[o][0],y:i[o][1]});return new Qo({eid:"1",yi:[r]})}(r.Ot[m].G.yi[0]);if(p.fi(y)){t=!0;break}}return t}catch(t){return!0}}}),Object.assign(e.prototype,{qi:function(t){var n=this,t=this.gn.getZoom()*t,e=new Rr({src:[this.gn.getZoom()],dest:[t]});t>this.En.Ki[1]||t<this.En.Ki[0]||(e.Qn(.5).qn(function(t){return n.gn.setZoom({animate:!1,zoom:t.destination[0]})}).Kn(function(){return n.gn.$i.Ji(e)}),this.gn.$i.Zi(e.Vn()))},tr:function(){var t=this.gn.kt.isPerspectiveCamera?this.Yi():this.Qi();return this.nr(t)},er:function(n){var e,i,r=this,t=(this.En.zoom=n.zoom,Number.isFinite(n.duration)?n.duration:.5),o=this.Ci(this.En.zoom),s=this.Di(o),a=this.Bt.object.position.distanceTo(this.Bt.target),u=(new Tt).copy(this.Bt.object.position).sub(this.Bt.target).normalize(),u=(new Tt).copy(u).multiplyScalar(s-a);this.gn.kt.isPerspectiveCamera?"animate"in n&&!n.animate?(this.Bt.update({offset:u}),n.finish&&n.finish()):((e=new Rr({src:[0,0,0],dest:[u.x,u.y,u.z]})).Qn(t).qn(function(t){"PerspectiveCamera"===r.gn.kt.type?r.Bt.update({offset:new Tt(t.delta[0],t.delta[1],t.delta[2])}):(r.gn.$i.Ji(e),r.er({zoom:n.zoom,animate:!1,finish:n.finish}))}).Kn(function(){r.gn.$i.Ji(e),n.finish&&n.finish()}),this.gn.$i.Zi(e.Vn())):"animate"in n&&!n.animate?(s=this.Gi(o),this.gn.kt.zoom=1/s,this.gn.kt.updateProjectionMatrix(),this.gn.jt.Ht(),this.Bt.update({offset:u}),n.finish&&n.finish()):((i=new Rr({src:[this.Qi()],dest:[o]})).Qn(t).qn(function(t){"OrthographicCamera"===r.gn.kt.type?(t=r.Gi(t.destination[0]),r.gn.kt.zoom=1/t,r.gn.kt.updateProjectionMatrix(),r.gn.jt.Ht(),r.gn.enableUpdateRender(),r.gn.ir()):(r.gn.$i.Ji(i),r.er({zoom:n.zoom,animate:!1,finish:n.finish}))}).Kn(function(){r.gn.$i.Ji(i),n.finish&&n.finish()}),this.gn.$i.Zi(i.Vn()))},rr:function(t){this.En.Ki=t,this.Ui(),this.Bt.update()},Ui:function(){var t=this.Ci(this.En.Ki[0]),n=this.Ci(this.En.Ki[1]);this.Bt.maxDistance=this.Di(t),this.Bt.minDistance=this.Di(n),this.Bt.minZoom=1/this.Gi(t),this.Bt.maxZoom=1/this.Gi(n)},Ci:function(t){var n=this._i.length-1,e=(--t,t=Math.max(0,Math.min(t,n)),Math.floor(t)),t=t-e,i=Math.max(0,Math.min(e,n)),n=Math.max(0,Math.min(e+1,n)),i=this._i[i]-this._i[n];return this._i[e]-i*t},nr:function(t){for(var n=0,e=.1,i=!1,r=0;r<this._i.length-1;r++)if(t<=this._i[r]&&t>this._i[r+1]){n=r,e=(this._i[r]-t)/(this._i[r]-this._i[r+1]),i=!0;break}var o;return i?parseFloat((n+1+e).toFixed(2)):(o=this._i.length-1,t<=this._i[o]?1+o:1)},Di:function(t){return t/100*(this.gn.jt.renderer.domElement.clientHeight/br.getMapScaleInfo())/2/Math.tan(u.FOV/2*u.DEG2RAD)},Yi:function(){return(new Tt).copy(this.Bt.object.position).sub(this.Bt.target).length()*(100*Math.tan(u.FOV/2*u.DEG2RAD)*2/(this.gn.jt.renderer.domElement.clientHeight/br.getMapScaleInfo()))},Qi:function(){var t=this.gn.kt.top,n=this.gn.kt.bottom;return Math.abs(t-n)*br.getMapScaleInfo()*100/this.gn.jt.renderer.domElement.clientHeight/this.gn.kt.zoom},Gi:function(t){var n=this.gn.Ut.top,e=this.gn.Ut.bottom;return t/(Math.abs(n-e)*br.getMapScaleInfo()*100/this.gn.jt.renderer.domElement.clientHeight)}}),Object.assign(e.prototype,{Wi:function(t){var n,e=this,i=this.Bt,r=t.finish;"animate"in t&&!t.animate?(i.update({phi:(u.TILT_UPPER_BOUND-t.tilt)*u.DEG2RAD}),i.update(),r&&r()):(null===this.Ti&&(this.Ti=new Rr),n=Number.isFinite(t.duration)?t.duration:.5,this.Ti.Wn([this.gn.getTilt()]).Yn([t.tilt]).Qn(n).qn(function(t){i.update({phi:(u.TILT_UPPER_BOUND-t.destination[0])*u.DEG2RAD})}).Kn(function(){i.update({phi:(u.TILT_UPPER_BOUND-t.tilt)*u.DEG2RAD}),i.update(),e.gn.$i.Ji(e.Ti),r&&r()}),this.gn.$i.Zi(this.Ti.Vn()))},sr:function(){var t=Mr.round(-this.Bt.getAzimuthalAngle()*u.RAD2DEG);return 360<(t=t<0?360+t:t)&&(t%=360),t},Hi:function(t){t=-t%360*u.DEG2RAD-this.Bt.getAzimuthalAngle();return t=0!==t?Math.sin(t)/Math.abs(Math.sin(t))*Math.acos(Math.cos(t)):t},ar:function(t){var n,e,i=this,r=void 0!==t.loop&&t.loop,o=void 0!==t.direction?t.direction:0,s=this.Bt.getAzimuthalAngle();if(o=r?0===o?s-2*Math.PI:2*Math.PI+s:s+this.Hi(t.rotation),!("animate"in t)||t.animate)return n=t&&t.duration&&Number.isFinite(t.duration)?t.duration:.5,(e=new Rr({src:[s],dest:[o]})).Qn(n).Jn(r).qn(function(t){i.Bt.update({theta:t.destination[0]})}).Kn(function(){r||i.gn.$i.Ji(e),t.finish&&t.finish()}),this.gn.$i.Zi(e.Vn()),e;this.Bt.update({theta:o}),t.finish&&t.finish()}}),Object.assign(e.prototype,{ur:function(){var t=this.Bt.target,n=this.gn.Ot[0];return{x:parseFloat((n.x+t.x).toFixed(4)),y:parseFloat((n.y-t.z).toFixed(4))}},cr:function(t){var n,e,i,r=this,o=this.Bt,s=this.gn.Ot[0],a=t.x-s.x,s=-t.y+s.y,u=o.target.x,c=o.target.z,h=t.height;!!h&&Number.isFinite(h)?(e=o.target.y,n=h):e=n=0,"animate"in t&&t.animate?(h=Number.isFinite(t.duration)?t.duration:.5,(i=new Rr({src:[u,e,c],dest:[a,n,s]})).Qn(h).qn(function(t){o.panAdd({x:t.delta[0],y:t.delta[1],z:t.delta[2]}),o.update(),r.gn.jt.Ht()}).Kn(function(){r.gn.$i.Ji(i),r.gn.jt.Ht(),t.finish&&t.finish()}),this.gn.$i.Zi(i.Vn())):(o.panAdd({x:a-u,y:n-e,z:s-c}),o.update(),t.finish&&t.finish(),this.gn.jt.Ht())},hr:function(n,e){function t(){i.En.lr(n.pi).level=e.level,i.gn.jt.Mn(),i.gn.Nt.dr();var t={type:"levelChanged",level:e.level};n!==i.gn.Tn&&(t.buildingID=n.pi),i.gn.Dt.Ct(t),i.enableDragRange&&r.saveState(),e.finish&&e.finish(e.level),i.gn.jt.Ht()}var i=this,r=this.Bt;n===this.gn.Tn||this.gn.vr?this.pr(n,{level:e.level,animate:e.animate,duration:e.duration,callback:e.callback,finish:function(){t()}}):t()},pr:function(t,n){var e=void 0!==n.duration?n.duration:.5,i=void 0===n.animate||n.animate,r=this.Bt,o=r.target.y,s=t.getFloor(n.level).nt;i?(null===this.xi&&(this.xi=new Rr),this.xi.Wn([o]).Yn([s]).Qn(e).qn(function(t){r.panUp(t.delta[0]),r.update()}).Kn(function(){r.panUp(s-r.target.y),r.update(),n.finish&&n.finish()}),this.gn.$i.Zi(this.xi.Vn()),n.callback&&n.callback(this.xi)):(r.panUp(s-o),r.update(),n.callback&&n.callback(null),n.finish&&n.finish())}}),e),ns=new Tt,es=new Tt,is=new Tt,rs=new Tt,os=new Tt,ss=new Tt,as=new Tt;function us(t,n){this.origin=void 0!==t?t:new Tt,this.direction=void 0!==n?n:new Tt(0,0,-1)}function cs(t,n,e,i){this.ray=new us(t,n),this.near=e||0,this.far=i||1/0,this.camera=null,this.layers=new Q,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}},Object.defineProperties(this.params,{PointCloud:{get:function(){return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),this.Points}}})}function hs(t,n){return t.distance-n.distance}function fs(t,n,e,i){if(t.layers.test(n.layers)&&t.raycast(n,e),!0===i)for(var r=t.children,o=0,s=r.length;o<s;o++)fs(r[o],n,e,!0)}Object.assign(us.prototype,{set:function(t,n){return this.origin.copy(t),this.direction.copy(n),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this},at:function(t,n){return void 0===n&&(console.warn("THREE.Ray: .at() target is now required"),n=new Tt),n.copy(this.direction).multiplyScalar(t).add(this.origin)},lookAt:function(t){return this.direction.copy(t).sub(this.origin).normalize(),this},recast:function(t){return this.origin.copy(this.at(t,ns)),this},closestPointToPoint:function(t,n){void 0===n&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),n=new Tt),n.subVectors(t,this.origin);t=n.dot(this.direction);return t<0?n.copy(this.origin):n.copy(this.direction).multiplyScalar(t).add(this.origin)},distanceToPoint:function(t){return Math.sqrt(this.distanceSqToPoint(t))},distanceSqToPoint:function(t){var n=ns.subVectors(t,this.origin).dot(this.direction);return(n<0?this.origin:(ns.copy(this.direction).multiplyScalar(n).add(this.origin),ns)).distanceToSquared(t)},distanceSqToSegment:function(t,n,e,i){es.copy(t).add(n).multiplyScalar(.5),is.copy(n).sub(t).normalize(),rs.copy(this.origin).sub(es);var r,o,s,t=.5*t.distanceTo(n),n=-this.direction.dot(is),a=rs.dot(this.direction),u=-rs.dot(is),c=rs.lengthSq(),h=Math.abs(1-n*n);return h=0<h?(o=n*a-u,s=t*h,0<=(r=n*u-a)?-s<=o?o<=s?(r*=h=1/h)*(r+n*(o*=h)+2*a)+o*(n*r+o+2*u)+c:(o=t,-(r=Math.max(0,-(n*o+a)))*r+o*(o+2*u)+c):(o=-t,-(r=Math.max(0,-(n*o+a)))*r+o*(o+2*u)+c):o<=-s?-(r=Math.max(0,-(-n*t+a)))*r+(o=0<r?-t:Math.min(Math.max(-t,-u),t))*(o+2*u)+c:o<=s?(r=0,(o=Math.min(Math.max(-t,-u),t))*(o+2*u)+c):-(r=Math.max(0,-(n*t+a)))*r+(o=0<r?t:Math.min(Math.max(-t,-u),t))*(o+2*u)+c):(o=0<n?-t:t,-(r=Math.max(0,-(n*o+a)))*r+o*(o+2*u)+c),e&&e.copy(this.direction).multiplyScalar(r).add(this.origin),i&&i.copy(is).multiplyScalar(o).add(es),h},intersectSphere:function(t,n){ns.subVectors(t.center,this.origin);var e=ns.dot(this.direction),i=ns.dot(ns)-e*e,t=t.radius*t.radius;return t<i||(i=e+(t=Math.sqrt(t-i)),(e=e-t)<0&&i<0)?null:e<0?this.at(i,n):this.at(e,n)},intersectsSphere:function(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius},distanceToPlane:function(t){var n=t.normal.dot(this.direction);return 0===n?0===t.distanceToPoint(this.origin)?0:null:0<=(t=-(this.origin.dot(t.normal)+t.constant)/n)?t:null},intersectPlane:function(t,n){t=this.distanceToPlane(t);return null===t?null:this.at(t,n)},intersectsPlane:function(t){var n=t.distanceToPoint(this.origin);return 0===n||t.normal.dot(this.direction)*n<0},intersectBox:function(t,n){var e,i,r,o=1/this.direction.x,s=1/this.direction.y,a=1/this.direction.z,u=this.origin,o=0<=o?(e=(t.min.x-u.x)*o,(t.max.x-u.x)*o):(e=(t.max.x-u.x)*o,(t.min.x-u.x)*o),s=0<=s?(r=(t.min.y-u.y)*s,(t.max.y-u.y)*s):(r=(t.max.y-u.y)*s,(t.min.y-u.y)*s);return s<e||o<r||((e<r||e!=e)&&(e=r),(s<o||o!=o)&&(o=s),(r=0<=a?(i=(t.min.z-u.z)*a,(t.max.z-u.z)*a):(i=(t.max.z-u.z)*a,(t.min.z-u.z)*a))<e)||o<i||((e<i||e!=e)&&(e=i),(o=r<o||o!=o?r:o)<0)?null:this.at(0<=e?e:o,n)},intersectsBox:function(t){return null!==this.intersectBox(t,ns)},intersectTriangle:function(t,n,e,i,r){os.subVectors(n,t),ss.subVectors(e,t),as.crossVectors(os,ss);var o,n=this.direction.dot(as);if(0<n){if(i)return null;o=1}else{if(!(n<0))return null;o=-1,n=-n}rs.subVectors(this.origin,t);e=o*this.direction.dot(ss.crossVectors(rs,ss));return e<0||(i=o*this.direction.dot(os.cross(rs)))<0||n<e+i||(t=-o*rs.dot(as))<0?null:this.at(t/n,r)},applyMatrix4:function(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this},equals:function(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}}),Object.assign(cs.prototype,{set:function(t,n){this.ray.set(t,n)},setFromCamera:function(t,n){n&&n.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(n.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(n).sub(this.ray.origin).normalize(),this.camera=n):n&&n.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,(n.near+n.far)/(n.near-n.far)).unproject(n),this.ray.direction.set(0,0,-1).transformDirection(n.matrixWorld),this.camera=n):console.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(t,n,e){e=e||[];return fs(t,this,e,n),e.sort(hs),e},intersectObjects:function(t,n,e){var i=e||[];if(!1===Array.isArray(t))console.warn("THREE.Raycaster.intersectObjects: objects is not an Array.");else{for(var r=0,o=t.length;r<o;r++)fs(t[r],this,i,n);i.sort(hs)}return i}});var e={CLASSIC:2,REAL:4},ls=(Object.freeze(e),e);function ds(t){return(ds="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function vs(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=ds(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=ds(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==ds(t)?t:String(t)}(i.key),i)}}var e=function(){function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this.pi=-1,this.mi=E.NONE,this.Jt=!0,this.Pn=null,this.Ot=[],this.ai=new Fi,this.mr=!0}var n,e,i;return n=t,(e=[{key:"type",get:function(){return this.mi}},{key:"visible",get:function(){return this.Jt},set:function(t){this.Jt=t}},{key:"children",get:function(){return this.Ot}},{key:"parent",get:function(){return this.Pn},set:function(t){this.Pn=t}},{key:"needUpdateBound",get:function(){return this.mr},set:function(t){!0===(this.mr=t)&&null!==this.parent&&(this.parent.needUpdateBound=t)}},{key:"isLayer",get:function(){return!1}},{key:"setType",value:function(t){this.mi=t}},{key:"traverse",value:function(t){if(this.Ot)for(var n=this.Ot.length-1;0<=n;n--)t(this.Ot[n])}},{key:"remove",value:function(t){var n=this.Ot.indexOf(t);-1<n&&this.Ot.splice(n,1),t.parent=null,this.needUpdateBound=!0}},{key:"dispose",value:function(){var t,n=this;for(t in this.traverse(function(t){n.remove(t),t.dispose()}),this.parent&&this.parent.remove(this),this)this[""+t]&&this[""+t].zn&&this[""+t].zn(),this[""+t]&&this[""+t].dispose&&this[""+t].dispose(),this[""+t]=null,delete this[""+t]}}])&&vs(n.prototype,e),i&&vs(n,i),Object.defineProperty(n,"prototype",{writable:!1}),t}(),ps=(Object.assign(e.prototype,{yr:function(t){for(var n=this;n;){if(n instanceof t)return n;n=n.Pn}return null}}),e);function ms(t){return(ms="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ys(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=ms(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=ms(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==ms(t)?t:String(t)}(i.key),i)}}function bs(t,n,e){n=_s(n);var i=t,n=gs()?Reflect.construct(n,e||[],_s(t).constructor):n.apply(t,e);if(n&&("object"===ms(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function gs(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(gs=function(){return!!t})()}function _s(t){return(_s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ws(t,n){return(ws=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var e=function(){var t,n=i,e=ps;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");function i(t){var n;if(this instanceof i)return(n=bs(this,i)).pi=t.bid,n.br=t.bcode,n.gr=t.mid,n._r=t.name,n.wr=t.ename,n.Er=t.alias,n.wt=t.x,n.xt=t.y,n.Sr=t.levels,n.Tr=[],n;throw new TypeError("Cannot call a class as a function")}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&ws(n,e),n=i,(e=[{key:"type",get:function(){return this.mi}},{key:"x",get:function(){return this.wt}},{key:"y",get:function(){return this.xt}},{key:"bound",get:function(){var n=this;return!0===this.needUpdateBound&&(this.ai.reset(),void 0!==this.Ar&&this.ai.copy(this.Ar),this.Ot.forEach(function(t){n.ai.expand(t.bound)}),this.needUpdateBound=!1),this.ai.clone()}},{key:"buildingID",get:function(){return this.pi}},{key:"bcode",get:function(){return this.br}},{key:"name",get:function(){return this._r}},{key:"eName",get:function(){return this.wr}},{key:"alias",get:function(){return this.Er}},{key:"floorSpace",get:function(){return this.Pn.En.lr(this.pi).floorSpace},set:function(t){this.Pn.En.lr(this.pi).floorSpace=t,this.traverse(function(t){t.Mr({animate:!1})})}},{key:"level",get:function(){return this.Pn.En.lr(this.pi).level}},{key:"visibleLevels",get:function(){return this.Pn.En.lr(this.pi).visibleLevels}},{key:"getFloor",value:function(n){var e=null;return this.traverse(function(t){t.Or===n&&(e=t)}),e}},{key:"getFloorInfos",value:function(){return this.Lr()}},{key:"setLevel",value:function(t){this.Pn.Nt.Rr(this,t)}},{key:"setVisibleLevels",value:function(t,n){this.Pn.Nt.Nr({levels:t,building:this},n)}},{key:"getVisibleLevels",value:function(){return this.visibleLevels}}])&&ys(n.prototype,e),t&&ys(n,t),Object.defineProperty(n,"prototype",{writable:!1}),i}(),xs=(Object.assign(e.prototype,{Lr:function(){for(var t,n=this,e=(0===this.Tr.length&&(t=this.Pn.Fr.Pr.get(this.gr))&&(this.Tr=[],t.Ot.forEach(function(t){n.Tr.push(t)})),{alias:"alias",floorId:"floorID",gid:"level",gname:"name"}),i=Object.keys(e),r=[],o=0;o<this.Tr.length;o++){var s=this.Tr[o];r[o]={};for(var a=0;a<i.length;a++){var u=i[a],c=e[u];s[u]?r[o][c]=s[u]:r[o][c]=null}}return r}}),e);function Es(t){return(Es="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ss(t){return function(t){if(Array.isArray(t))return Ts(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,n){var e;if(t)return"string"==typeof t?Ts(t,n):"Map"===(e="Object"===(e=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Ts(t,n):void 0}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ts(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function As(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=Es(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Es(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Es(t)?t:String(t)}(i.key),i)}}function Ms(t,n,e){return n&&As(t.prototype,n),e&&As(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var e=Ms(function t(n,e,i){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this.gn=n,this.En=i,this.Ai=e,this.jr=[],this.Ir=null,this.Cr=Mr.generateUUID(),this.Dr=new cs,this.kr=new Tt,this.Ur=0,this.Br=0,this.Hn=this.Hn.bind(this),this.jn=0,this.gn.jt.renderer.domElement.addEventListener("mousedown",this.Hn,!1),this.gn.jt.renderer.domElement.addEventListener("mouseup",this.Hn,!1),this.gn.jt.renderer.domElement.addEventListener("mousemove",this.Hn,!1),this.gn.jt.renderer.domElement.addEventListener("touchstart",this.Hn,!1),this.gn.jt.renderer.domElement.addEventListener("touchend",this.Hn,!1),this.gn.jt.renderer.domElement.addEventListener("touchmove",this.Hn,!1)}),Os=(Object.assign(e.prototype,{zn:function(){for(var t in this.gn.jt.renderer.domElement.removeEventListener("mousedown",this.Hn,!1),this.gn.jt.renderer.domElement.removeEventListener("mouseup",this.Hn,!1),this.gn.jt.renderer.domElement.removeEventListener("touchstart",this.Hn,!1),this.gn.jt.renderer.domElement.removeEventListener("mousemove",this.Hn,!1),this.gn.jt.renderer.domElement.removeEventListener("touchmove",this.Hn,!1),this.gn.jt.renderer.domElement.removeEventListener("touchend",this.Hn,!1),delete this.gn,delete this.En,delete this.Ai,this)this[""+t]&&this[""+t].zn&&this[""+t].zn(),this[""+t]=null,delete this[""+t]},Zi:function(t){var n;(n=this.jr).push.apply(n,Ss(t))},Hn:function(t){if((st.a.environment!==B.a.WX||"touchmove"!==t.type)&&(!this.En||"mousemove"!==t.type||this.En.Gr))if("mousedown"===t.type||"touchstart"===t.type)this.jn=(new Date).getTime(),"touchstart"===t.type&&(this.Ur=t.changedTouches[0].clientX,this.Br=t.changedTouches[0].clientY);else{if("mouseup"===t.type||"touchend"===t.type){if(200<(new Date).getTime()-this.jn)return;if("touchend"===t.type&&Math.pow(t.changedTouches[0].clientX-this.Ur,2)+Math.pow(t.changedTouches[0].clientY-this.Br,2)>Math.pow(t.changedTouches[0].radiusX,2))return;this.jn=(new Date).getTime()}for(var n=this.Hr(t),e=0;e<this.jr.length;e++)this.jr[e](n);var i=this.Xr(n),r=null,o=null,s=(i[0]&&i[0].type!==E.FM3DTILE_LAYER&&(s=i[0].yr(xs))&&(r=i[0].level,s!==this.gn.Tn)&&(o=s.pi),this.Vr(n));if(null!==r)s.height=null!==o?s.height-this.gn.getBuilding(o).getFloor(r).height:s.height-this.gn.getFloor(r).height;else{var a=this.gn.getLevel();if(void 0===a)return;s.height=s.height-this.gn.getFloor(a).height}a="mousemove"===t.type||"touchmove"===t.type?"hover":"click",s={type:a,targets:i,coords:s,mouseEvent:t,level:r,buildingID:o};-1<this.Ai.zr.indexOf(a)&&this.Wr(i),this.gn.Dt.Ct(s)}},Wr:function(a){for(var t,u=this,c=[E.MODEL,E.EXTERNAL_MODEL],n=0;n<a.length&&0!==(t=function(s){if(-1<c.indexOf(a[s].mi)){if(a[s]===u.Ir)return{v:void 0};if(a[s].Lt){u.wi&&(u.wi.stop(),u.gn.$i.Ji(u.wi)),h(u.Ir),u.Ir=a[s],u.Ir.Yr=u.En.highlightColor;var n=a[s].Lt;if(a[s].mi===E.MODEL){n.userData.sourceMaterial=n.material,n.material=n.material.clone();var t=n.material.color,e=new lt(u.En.highlightColor);u.wi?(u.wi.Wn([t.r,t.g,t.b]),u.wi.Yn([e.r,e.g,e.b])):u.wi=new Rr({src:[t.r,t.g,t.b],dest:[e.r,e.g,e.b]}),u.wi.Qn(.5).qn(function(t){t=new lt(t.destination[0],t.destination[1],t.destination[2]);n&&n.material&&(n.material.color=t),u.gn.enableUpdateRender()}).Kn(function(){u.wi.stop(),u.gn.$i.Ji(u.wi),n&&n.material&&(n.material.color=e),u.gn.enableUpdateRender()}),u.gn.$i.Zi(u.wi.Vn())}else if(a[s].mi===E.EXTERNAL_MODEL)if("Mesh"===n.type)if(n.userData.sourceMaterial||(n.userData.sourceMaterial=n.material),Array.isArray(n.material)){for(var i=[],r=!0,o=0;o<n.material.length;o++)"MeshLambertMaterial"!==n.material[o].type?r=!1:(i[o]=n.material[o].clone(),i[o].color=new lt(u.En.highlightColor));r&&(n.material=i)}else"MeshLambertMaterial"===n.material.type&&(n.material=n.material.clone(),n.material.color=new lt(u.En.highlightColor));else"Scene"===n.type&&n.traverse(function(t){if("Mesh"===t.type)if(t.userData.sourceMaterial||(t.userData.sourceMaterial=t.material),Array.isArray(t.material)){for(var n,e=[],i=0;i<t.material.length;i++)t.material.isBasic?e.push(t.material):(n=u.Qr(t.material[i]),e.push(n));t.material=e}else{var r,o;t.material.isBasic||(r=u.Qr(t.material),null===a[s].Zr?t.material=r:((o=a[s].qr(r)).clippingPlanes=a[s].Zr,o.clipping=!0,a[s].Kr&&"outside"===a[s].Kr&&(o.clipIntersection=!0),u.gn.getMapOptions().materialMode===ls.REAL?o.uniforms.diffuse.value=r.uniforms.diffuse.value:o.color=r.color,o.userData=r.userData,t.material=o))}});return u.gn.enableUpdateRender(),{v:void 0}}return 0}}(n));n++)if(t)return t.v;function h(t){var n,e;t&&(t.Yr=null,n=t.Lt)&&(t.mi===E.MODEL?n.userData.sourceMaterial&&!1!==n.userData.sourceMaterial.canDispose&&(e=n.material,n.material=n.userData.sourceMaterial,e.dispose(),delete n.userData.sourceMaterial):t.mi===E.EXTERNAL_MODEL&&("Mesh"===n.type?(n.material=n.userData.sourceMaterial,delete n.userData.sourceMaterial):"Scene"===n.type&&n.parent&&n.traverse(function(t){"Mesh"===t.type&&t.userData.sourceMaterial&&(t.material=t.userData.sourceMaterial,delete t.userData.sourceMaterial)})))}this.wi&&(this.wi.stop(),this.gn.$i.Ji(this.wi)),h(this.Ir),this.Ir=null,this.gn.enableUpdateRender()},Qr:function(t){var n=this.Jr(t);return n.color=this.En.highlightColor,(n=this.gn.getMapOptions().materialMode===ls.REAL?this.gn.Nt.no.$r(n):this.gn.Nt.no.eo(t,n)).userData=t.userData,n},Jr:function(t){var n={};return(n=this.gn.Ai.materialMode!==ls.REAL||t.isBasic?n:{USE_EMISSIVEMAP:t.defines.USE_EMISSIVEMAP,USE_MAP:t.defines.USE_MAP,USE_AOMAP:t.defines.USE_AOMAP,USE_METALNESSMAP:t.defines.USE_METALNESSMAP,USE_NORMALMAP:t.defines.USE_NORMALMAP,TANGENTSPACE_NORMALMAP:t.defines.TANGENTSPACE_NORMALMAP,USE_ROUGHNESSMAP:t.defines.USE_ROUGHNESSMAP,aoMap:t.uniforms.aoMap.value,map:t.uniforms.map.value,color:t.uniforms.diffuse.value.getHex(),emissive:t.uniforms.emissive.value.getHex(),emissiveMap:t.uniforms.emissiveMap.value,metalness:t.uniforms.metalness.value,metalnessMap:t.uniforms.metalnessMap.value,roughness:t.uniforms.roughness.value,roughnessMap:t.uniforms.roughnessMap.value,normalScale:t.uniforms.normalScale.value,normalMap:t.uniforms.normalMap.value,vertexColors:t.vertexColors,side:t.side}).opacity=t.opacity,n.transparent=t.transparent,n},Xr:function(t){for(var n=[],e=0;e<t.length;e++)if(void 0!==t[e].type&&t[e].type===E.FM3DTILE_LAYER)n.push({type:E.FM3DTILE_LAYER,object:t[e].object});else{var i=t[e].object;if("LineSegments"!==i.type&&!(i.isNoPickup||i.parent&&i.parent.mapNode&&i.parent.mapNode.io&&i===i.parent.mapNode.io.top)){for(;!i.mapNode;)i=i.parent;for(var r=!0,o=0;o<n.length;o++)if(n[o].Lt&&n[o].Lt.uuid===i.uuid){r=!1;break}this.gn.pickFilterFunction({type:i.mapNode.mi,data:i.mapNode.G})&&r&&i.visible&&n.push(i.mapNode)}}return n},Vr:function(t){for(var n,e=null,i=0;i<t.length;i++)if("LineSegments"!==t[i].object.type){e=t[i];break}return t.length<1||!e?{x:NaN,y:NaN,z:NaN,height:NaN}:(n=e.point.clone(),{x:this.gn.x+n.x,y:this.gn.y-n.z,z:e.point.y,height:e.point.y})},Hr:function(t){var n,e,i,o=this,r=[],s=(t.touches?(e=t.touches[0],"touchend"===t.type&&(e=t.changedTouches[0]),n=this.gn.jt.renderer.domElement.getBoundingClientRect(),i=e.clientX-n.left,e=e.clientY-n.top,this.kr.x=i/n.width*2-1,this.kr.y=2*-(e/n.height)+1):(this.kr.x=(i=t).offsetX/this.gn.jt.renderer.domElement.clientWidth*2-1,this.kr.y=2*-(i.offsetY/this.gn.jt.renderer.domElement.clientHeight)+1),this.kr.z=.5,this.Dr.setFromCamera(this.kr,this.gn.kt),new Map),a=[];if(this.gn.jt.It.forEach(function(t,n){for(var n=n.split("%A%B%C%D")[0],e=s.get(n),i=(e||(s.set(n,e=[]),a.unshift(n)),o.Dr.intersectObject(t,!0)),r=0;r<i.length;r++)i[r].object.visible&&!i[r].object.isNoPick&&e.push(i[r])}),0<this.gn.jt.ro.length)for(var u=s.get("other1"),c=(u||(s.set("other1",u=[]),a.push("other1")),this.gn.jt.ro),h=0;h<c.length;h++)if(c[h].visible)for(var f=this.Dr.intersectObject(c[h],!0),l=0;l<f.length;l++)f[h].type=E.FM3DTILE_LAYER,u.push(f[h]);if(this.gn.jt.oo)for(var d=s.get("other2"),v=(d||(s.set("other2",d=[]),a.push("other2")),this.Dr.intersectObject(this.gn.jt.oo,!0)),p=0;p<v.length;p++)v[p].object.visible&&(v[p].object.isNoPickup=!0,d.push(v[p]));for(var m=0;m<a.length;m++){var y=s.get(a[m]);y.sort(function(t,n){return t.distance-n.distance});for(var b=0;b<y.length;b++)r.push(y[b])}return r}}),e),Ls=0;function l(t,n,e,i,r,o,s,a,u,c){Object.defineProperty(this,"id",{value:Ls++}),this.uuid=St.generateUUID(),this.name="",this.image=void 0!==t?t:l.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==n?n:l.DEFAULT_MAPPING,this.wrapS=void 0!==e?e:Xn,this.wrapT=void 0!==i?i:Xn,this.magFilter=void 0!==r?r:Qn,this.minFilter=void 0!==o?o:qn,this.anisotropy=void 0!==u?u:1,this.format=void 0!==s?s:fe,this.internalFormat=null,this.type=void 0!==a?a:Kn,this.offset=new Mt(0,0),this.repeat=new Mt(1,1),this.center=new Mt(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Z,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==c?c:li,this.version=0,this.onUpdate=null}function Rs(t,n,e,i,r,o,s,a,u,c,h,f){l.call(this,null,o,s,a,u,c,i,r,h,f),this.image={data:t||null,width:n||1,height:e||1},this.magFilter=void 0!==u?u:zn,this.minFilter=void 0!==c?c:zn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}l.DEFAULT_IMAGE=void 0,l.DEFAULT_MAPPING=300,l.prototype=Object.assign(Object.create(X.prototype),{constructor:l,isTexture:!0,updateMatrix:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.name=t.name,this.image=t.image,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.encoding=t.encoding,this},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(t){if(300===this.mapping){if(t.applyMatrix3(this.matrix),t.x<0||1<t.x)switch(this.wrapS){case Hn:t.x=t.x-Math.floor(t.x);break;case Xn:t.x=t.x<0?0:1;break;case Vn:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||1<t.y)switch(this.wrapT){case Hn:t.y=t.y-Math.floor(t.y);break;case Xn:t.y=t.y<0?0:1;break;case Vn:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}this.flipY&&(t.y=1-t.y)}return t}}),Object.defineProperty(l.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),((Rs.prototype=Object.create(l.prototype)).constructor=Rs).prototype.isDataTexture=!0;var Lt={common:{diffuse:{value:new lt(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new Z},uv2Transform:{value:new Z},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new Mt(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new lt(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}}},points:{diffuse:{value:new lt(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Z}},sprite:{diffuse:{value:new lt(15658734)},opacity:{value:1},center:{value:new Mt(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Z}}};function Ns(){a.call(this),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function Ps(){var e=null,i=!1,r=null;function o(t,n){!1!==i&&(r(t,n),e.requestAnimationFrame(o))}return{start:function(){!0!==i&&null!==r&&(e.requestAnimationFrame(o),i=!0)},stop:function(){i=!1},setAnimationLoop:function(t){r=t},setContext:function(t){e=t}}}function Fs(u,t){var c=t.isWebGL2,h=new WeakMap;return{get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),h.get(t)},remove:function(t){t.isInterleavedBufferAttribute&&(t=t.data);var n=h.get(t);n&&(u.deleteBuffer(n.buffer),h.delete(t))},update:function(t,n){t.isInterleavedBufferAttribute&&(t=t.data);var e,i,r,o,s,a=h.get(t);void 0===a?h.set(t,(i=n,r=(e=t).array,o=e.usage,s=u.createBuffer(),u.bindBuffer(i,s),u.bufferData(i,r,o),e.onUploadCallback(),i=u.FLOAT,r instanceof Float32Array?i=u.FLOAT:r instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):r instanceof Uint16Array?i=u.UNSIGNED_SHORT:r instanceof Int16Array?i=u.SHORT:r instanceof Uint32Array?i=u.UNSIGNED_INT:r instanceof Int32Array?i=u.INT:r instanceof Int8Array?i=u.BYTE:r instanceof Uint8Array&&(i=u.UNSIGNED_BYTE),{buffer:s,type:i,bytesPerElement:r.BYTES_PER_ELEMENT,version:e.version})):a.version<t.version&&(o=a.buffer,s=n,r=(i=t).array,i=i.updateRange,u.bindBuffer(s,o),-1===i.count?u.bufferSubData(s,0,r):(c?u.bufferSubData(s,i.offset*r.BYTES_PER_ELEMENT,r,i.offset,i.count):u.bufferSubData(s,i.offset*r.BYTES_PER_ELEMENT,r.subarray(i.offset,i.offset+i.count)),i.count=-1),a.version=t.version)}}}function js(t,n,e,i,r,o){this.a=t,this.b=n,this.c=e,this.normal=i&&i.isVector3?i:new Tt,this.vertexNormals=Array.isArray(i)?i:[],this.color=r&&r.isColor?r:new lt,this.vertexColors=Array.isArray(r)?r:[],this.materialIndex=void 0!==o?o:0}Ns.prototype=Object.assign(Object.create(a.prototype),{constructor:Ns,isScene:!0,copy:function(t,n){return a.prototype.copy.call(this,t,n),null!==t.background&&(this.background=t.background.clone()),null!==t.environment&&(this.environment=t.environment.clone()),null!==t.fog&&(this.fog=t.fog.clone()),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.autoUpdate=t.autoUpdate,this.matrixAutoUpdate=t.matrixAutoUpdate,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.assign(js.prototype,{clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.a=t.a,this.b=t.b,this.c=t.c,this.normal.copy(t.normal),this.color.copy(t.color),this.materialIndex=t.materialIndex;for(var n=0,e=t.vertexNormals.length;n<e;n++)this.vertexNormals[n]=t.vertexNormals[n].clone();for(n=0,e=t.vertexColors.length;n<e;n++)this.vertexColors[n]=t.vertexColors[n].clone();return this}});var Is=0,Cs=new At,Ds=new a,ks=new Tt;function Us(){Object.defineProperty(this,"id",{value:Is+=2}),this.uuid=St.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1}Us.prototype=Object.assign(Object.create(X.prototype),{constructor:Us,isGeometry:!0,applyMatrix4:function(t){for(var n=(new Z).getNormalMatrix(t),e=0,i=this.vertices.length;e<i;e++)this.vertices[e].applyMatrix4(t);for(e=0,i=this.faces.length;e<i;e++){var r=this.faces[e];r.normal.applyMatrix3(n).normalize();for(var o=0,s=r.vertexNormals.length;o<s;o++)r.vertexNormals[o].applyMatrix3(n).normalize()}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(t){return Cs.makeRotationX(t),this.applyMatrix4(Cs),this},rotateY:function(t){return Cs.makeRotationY(t),this.applyMatrix4(Cs),this},rotateZ:function(t){return Cs.makeRotationZ(t),this.applyMatrix4(Cs),this},translate:function(t,n,e){return Cs.makeTranslation(t,n,e),this.applyMatrix4(Cs),this},scale:function(t,n,e){return Cs.makeScale(t,n,e),this.applyMatrix4(Cs),this},lookAt:function(t){return Ds.lookAt(t),Ds.updateMatrix(),this.applyMatrix4(Ds.matrix),this},fromBufferGeometry:function(t){var o=this,n=null!==t.index?t.index.array:void 0,e=t.attributes;if(void 0===e.position)console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion.");else{var i=e.position.array,s=void 0!==e.normal?e.normal.array:void 0,a=void 0!==e.color?e.color.array:void 0,u=void 0!==e.uv?e.uv.array:void 0,c=void 0!==e.uv2?e.uv2.array:void 0;void 0!==c&&(this.faceVertexUvs[1]=[]);for(var r=0;r<i.length;r+=3)o.vertices.push((new Tt).fromArray(i,r)),void 0!==a&&o.colors.push((new lt).fromArray(a,r));var h=t.groups;if(0<h.length)for(r=0;r<h.length;r++)for(var f=h[r],l=f.start,d=l,v=l+f.count;d<v;d+=3)void 0!==n?p(n[d],n[d+1],n[d+2],f.materialIndex):p(d,d+1,d+2,f.materialIndex);else if(void 0!==n)for(r=0;r<n.length;r+=3)p(n[r],n[r+1],n[r+2]);else for(r=0;r<i.length/3;r+=3)p(r,r+1,r+2);this.computeFaceNormals(),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone())}return this;function p(t,n,e,i){var r=void 0===a?[]:[o.colors[t].clone(),o.colors[n].clone(),o.colors[e].clone()],r=new js(t,n,e,void 0===s?[]:[(new Tt).fromArray(s,3*t),(new Tt).fromArray(s,3*n),(new Tt).fromArray(s,3*e)],r,i);o.faces.push(r),void 0!==u&&o.faceVertexUvs[0].push([(new Mt).fromArray(u,2*t),(new Mt).fromArray(u,2*n),(new Mt).fromArray(u,2*e)]),void 0!==c&&o.faceVertexUvs[1].push([(new Mt).fromArray(c,2*t),(new Mt).fromArray(c,2*n),(new Mt).fromArray(c,2*e)])}},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(ks).negate(),this.translate(ks.x,ks.y,ks.z),this},normalize:function(){this.computeBoundingSphere();var t=this.boundingSphere.center,n=this.boundingSphere.radius,n=0===n?1:1/n,e=new At;return e.set(n,0,0,-n*t.x,0,n,0,-n*t.y,0,0,n,-n*t.z,0,0,0,1),this.applyMatrix4(e),this},computeFaceNormals:function(){for(var t=new Tt,n=new Tt,e=0,i=this.faces.length;e<i;e++){var r=this.faces[e],o=this.vertices[r.a],s=this.vertices[r.b],a=this.vertices[r.c];t.subVectors(a,s),n.subVectors(o,s),t.cross(n),t.normalize(),r.normal.copy(t)}},computeVertexNormals:function(t){var n,e,i;for(void 0===t&&(t=!0),i=new Array(this.vertices.length),n=0,e=this.vertices.length;n<e;n++)i[n]=new Tt;if(t)for(var r,o,s,a=new Tt,u=new Tt,c=0,h=this.faces.length;c<h;c++)f=this.faces[c],r=this.vertices[f.a],o=this.vertices[f.b],s=this.vertices[f.c],a.subVectors(s,o),u.subVectors(r,o),a.cross(u),i[f.a].add(a),i[f.b].add(a),i[f.c].add(a);else for(this.computeFaceNormals(),c=0,h=this.faces.length;c<h;c++)i[(f=this.faces[c]).a].add(f.normal),i[f.b].add(f.normal),i[f.c].add(f.normal);for(n=0,e=this.vertices.length;n<e;n++)i[n].normalize();for(c=0,h=this.faces.length;c<h;c++){var f,l=(f=this.faces[c]).vertexNormals;3===l.length?(l[0].copy(i[f.a]),l[1].copy(i[f.b]),l[2].copy(i[f.c])):(l[0]=i[f.a].clone(),l[1]=i[f.b].clone(),l[2]=i[f.c].clone())}0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var t,n;for(this.computeFaceNormals(),t=0,n=this.faces.length;t<n;t++){var e,i=(e=this.faces[t]).vertexNormals;3===i.length?(i[0].copy(e.normal),i[1].copy(e.normal),i[2].copy(e.normal)):(i[0]=e.normal.clone(),i[1]=e.normal.clone(),i[2]=e.normal.clone())}0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var t,n,e;for(s=0,a=this.faces.length;s<a;s++)for((e=this.faces[s]).so?e.so.copy(e.normal):e.so=e.normal.clone(),e.ao||(e.ao=[]),t=0,n=e.vertexNormals.length;t<n;t++)e.ao[t]?e.ao[t].copy(e.vertexNormals[t]):e.ao[t]=e.vertexNormals[t].clone();var i=new Us;for(i.faces=this.faces,t=0,n=this.morphTargets.length;t<n;t++){if(!this.morphNormals[t]){this.morphNormals[t]={},this.morphNormals[t].faceNormals=[],this.morphNormals[t].vertexNormals=[];for(var r=this.morphNormals[t].faceNormals,o=this.morphNormals[t].vertexNormals,s=0,a=this.faces.length;s<a;s++)u=new Tt,c={a:new Tt,b:new Tt,c:new Tt},r.push(u),o.push(c)}var u,c,h=this.morphNormals[t];for(i.vertices=this.morphTargets[t].vertices,i.computeFaceNormals(),i.computeVertexNormals(),s=0,a=this.faces.length;s<a;s++)e=this.faces[s],u=h.faceNormals[s],c=h.vertexNormals[s],u.copy(e.normal),c.a.copy(e.vertexNormals[0]),c.b.copy(e.vertexNormals[1]),c.c.copy(e.vertexNormals[2])}for(s=0,a=this.faces.length;s<a;s++)(e=this.faces[s]).normal=e.so,e.vertexNormals=e.ao},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new jt),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new Dt),this.boundingSphere.setFromPoints(this.vertices)},mergeVertices:function(){for(var t,n,e,i,r={},o=[],s=[],a=Math.pow(10,4),u=0,c=this.vertices.length;u<c;u++)t=this.vertices[u],void 0===r[t=Math.round(t.x*a)+"_"+Math.round(t.y*a)+"_"+Math.round(t.z*a)]?(r[t]=u,o.push(this.vertices[u]),s[u]=o.length-1):s[u]=s[r[t]];var h=[];for(u=0,c=this.faces.length;u<c;u++){(n=this.faces[u]).a=s[n.a],n.b=s[n.b],n.c=s[n.c];for(var f=[n.a,n.b,n.c],l=0;l<3;l++)if(f[l]===f[(l+1)%3]){h.push(u);break}}for(u=h.length-1;0<=u;u--){var d=h[u];for(this.faces.splice(d,1),e=0,i=this.faceVertexUvs.length;e<i;e++)this.faceVertexUvs[e].splice(d,1)}var v=this.vertices.length-o.length;return this.vertices=o,v},setFromPoints:function(t){this.vertices=[];for(var n=0,e=t.length;n<e;n++){var i=t[n];this.vertices.push(new Tt(i.x,i.y,i.z||0))}return this},sortFacesByMaterialIndex:function(){for(var t=this.faces,n=t.length,e=0;e<n;e++)t[e].pi=e;t.sort(function(t,n){return t.materialIndex-n.materialIndex});var i,r,o=this.faceVertexUvs[0],s=this.faceVertexUvs[1];o&&o.length===n&&(i=[]),s&&s.length===n&&(r=[]);for(e=0;e<n;e++){var a=t[e].pi;i&&i.push(o[a]),r&&r.push(s[a])}i&&(this.faceVertexUvs[0]=i),r&&(this.faceVertexUvs[1]=r)},dispose:function(){this.dispatchEvent({type:"dispose"})}});var Bs=new Tt;function R(t,n,e){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=t,this.itemSize=n,this.count=void 0!==t?t.length/n:0,this.normalized=!0===e,this.usage=_i,this.updateRange={offset:0,count:-1},this.version=0}function Gs(t,n,e){R.call(this,new Int8Array(t),n,e)}function Hs(t,n,e){R.call(this,new Uint8Array(t),n,e)}function Xs(t,n,e){R.call(this,new Uint8ClampedArray(t),n,e)}function Vs(t,n,e){R.call(this,new Int16Array(t),n,e)}function zs(t,n,e){R.call(this,new Uint16Array(t),n,e)}function Ws(t,n,e){R.call(this,new Int32Array(t),n,e)}function Ys(t,n,e){R.call(this,new Uint32Array(t),n,e)}function x(t,n,e){R.call(this,new Float32Array(t),n,e)}function Qs(t,n,e){R.call(this,new Float64Array(t),n,e)}function Zs(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}function qs(t){if(0===t.length)return-1/0;for(var n=t[0],e=1,i=t.length;e<i;++e)t[e]>n&&(n=t[e]);return n}Object.defineProperty(R.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(R.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setUsage:function(t){return this.usage=t,this},copy:function(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this},copyAt:function(t,n,e){t*=this.itemSize,e*=n.itemSize;for(var i=0,r=this.itemSize;i<r;i++)this.array[t+i]=n.array[e+i];return this},copyArray:function(t){return this.array.set(t),this},copyColorsArray:function(t){for(var n=this.array,e=0,i=0,r=t.length;i<r;i++){var o=t[i];void 0===o&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",i),o=new lt),n[e++]=o.r,n[e++]=o.g,n[e++]=o.b}return this},copyVector2sArray:function(t){for(var n=this.array,e=0,i=0,r=t.length;i<r;i++){var o=t[i];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",i),o=new Mt),n[e++]=o.x,n[e++]=o.y}return this},copyVector3sArray:function(t){for(var n=this.array,e=0,i=0,r=t.length;i<r;i++){var o=t[i];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",i),o=new Tt),n[e++]=o.x,n[e++]=o.y,n[e++]=o.z}return this},copyVector4sArray:function(t){for(var n=this.array,e=0,i=0,r=t.length;i<r;i++){var o=t[i];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",i),o=new Ot),n[e++]=o.x,n[e++]=o.y,n[e++]=o.z,n[e++]=o.w}return this},applyMatrix3:function(t){for(var n=0,e=this.count;n<e;n++)Bs.x=this.getX(n),Bs.y=this.getY(n),Bs.z=this.getZ(n),Bs.applyMatrix3(t),this.setXYZ(n,Bs.x,Bs.y,Bs.z);return this},applyMatrix4:function(t){for(var n=0,e=this.count;n<e;n++)Bs.x=this.getX(n),Bs.y=this.getY(n),Bs.z=this.getZ(n),Bs.applyMatrix4(t),this.setXYZ(n,Bs.x,Bs.y,Bs.z);return this},applyNormalMatrix:function(t){for(var n=0,e=this.count;n<e;n++)Bs.x=this.getX(n),Bs.y=this.getY(n),Bs.z=this.getZ(n),Bs.applyNormalMatrix(t),this.setXYZ(n,Bs.x,Bs.y,Bs.z);return this},transformDirection:function(t){for(var n=0,e=this.count;n<e;n++)Bs.x=this.getX(n),Bs.y=this.getY(n),Bs.z=this.getZ(n),Bs.transformDirection(t),this.setXYZ(n,Bs.x,Bs.y,Bs.z);return this},set:function(t,n){return this.array.set(t,n=void 0===n?0:n),this},getX:function(t){return this.array[t*this.itemSize]},setX:function(t,n){return this.array[t*this.itemSize]=n,this},getY:function(t){return this.array[t*this.itemSize+1]},setY:function(t,n){return this.array[t*this.itemSize+1]=n,this},getZ:function(t){return this.array[t*this.itemSize+2]},setZ:function(t,n){return this.array[t*this.itemSize+2]=n,this},getW:function(t){return this.array[t*this.itemSize+3]},setW:function(t,n){return this.array[t*this.itemSize+3]=n,this},setXY:function(t,n,e){return t*=this.itemSize,this.array[t+0]=n,this.array[t+1]=e,this},setXYZ:function(t,n,e,i){return t*=this.itemSize,this.array[t+0]=n,this.array[t+1]=e,this.array[t+2]=i,this},setXYZW:function(t,n,e,i,r){return t*=this.itemSize,this.array[t+0]=n,this.array[t+1]=e,this.array[t+2]=i,this.array[t+3]=r,this},onUpload:function(t){return this.onUploadCallback=t,this},clone:function(){return new this.constructor(this.array,this.itemSize).copy(this)}}),(Gs.prototype=Object.create(R.prototype)).constructor=Gs,(Hs.prototype=Object.create(R.prototype)).constructor=Hs,(Xs.prototype=Object.create(R.prototype)).constructor=Xs,(Vs.prototype=Object.create(R.prototype)).constructor=Vs,zs.prototype=Object.create(R.prototype),zs.prototype.constructor=zs,(Ws.prototype=Object.create(R.prototype)).constructor=Ws,Ys.prototype=Object.create(R.prototype),Ys.prototype.constructor=Ys,(x.prototype=Object.create(R.prototype)).constructor=x,(Qs.prototype=Object.create(R.prototype)).constructor=Qs,Object.assign(Zs.prototype,{computeGroups:function(t){for(var n,e=[],i=void 0,r=t.faces,o=0;o<r.length;o++){var s=r[o];s.materialIndex!==i&&(i=s.materialIndex,void 0!==n&&(n.count=3*o-n.start,e.push(n)),n={start:3*o,materialIndex:i})}void 0!==n&&(n.count=3*o-n.start,e.push(n)),this.groups=e},fromGeometry:function(t){var n=t.faces,e=t.vertices,i=t.faceVertexUvs,r=i[0]&&0<i[0].length,o=i[1]&&0<i[1].length,s=t.morphTargets,a=s.length;if(0<a){for(var u=[],c=0;c<a;c++)u[c]={name:s[c].name,data:[]};this.morphTargets.position=u}var h=t.morphNormals,f=h.length;if(0<f){for(var l=[],c=0;c<f;c++)l[c]={name:h[c].name,data:[]};this.morphTargets.normal=l}var d=t.skinIndices,v=t.skinWeights,p=d.length===e.length,m=v.length===e.length;0<e.length&&0===n.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(c=0;c<n.length;c++){var y,b=n[c],g=(this.vertices.push(e[b.a],e[b.b],e[b.c]),b.vertexNormals),g=(3===g.length?this.normals.push(g[0],g[1],g[2]):(g=b.normal,this.normals.push(g,g,g)),b.vertexColors);3===g.length?this.colors.push(g[0],g[1],g[2]):(g=b.color,this.colors.push(g,g,g)),!0===r&&(void 0!==(y=i[0][c])?this.uvs.push(y[0],y[1],y[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",c),this.uvs.push(new Mt,new Mt,new Mt))),!0===o&&(void 0!==(y=i[1][c])?this.uvs2.push(y[0],y[1],y[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",c),this.uvs2.push(new Mt,new Mt,new Mt)));for(var _=0;_<a;_++){var w=s[_].vertices;u[_].data.push(w[b.a],w[b.b],w[b.c])}for(_=0;_<f;_++){var x=h[_].vertexNormals[c];l[_].data.push(x.a,x.b,x.c)}p&&this.skinIndices.push(d[b.a],d[b.b],d[b.c]),m&&this.skinWeights.push(v[b.a],v[b.b],v[b.c])}return this.computeGroups(t),this.verticesNeedUpdate=t.verticesNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),this}});var Ks=1,Js=new At,$s=new a,ta=new Tt,na=new jt,ea=new jt,ia=new Tt;function ra(){Object.defineProperty(this,"id",{value:Ks+=2}),this.uuid=St.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}function oa(t){return(oa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function sa(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=oa(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=oa(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==oa(t)?t:String(t)}(i.key),i)}}function aa(t,n,e){return n&&sa(t.prototype,n),e&&sa(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function ua(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function ca(t,n,e){n=la(n);var i=t,n=fa()?Reflect.construct(n,e||[],la(t).constructor):n.apply(t,e);if(n&&("object"===oa(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return ha(i)}function ha(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function fa(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(fa=function(){return!!t})()}function la(t){return(la=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function da(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),n&&va(t,n)}function va(t,n){return(va=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}ra.prototype=Object.assign(Object.create(X.prototype),{constructor:ra,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(t){Array.isArray(t)?this.index=new(65535<qs(t)?Ys:zs)(t,1):this.index=t},getAttribute:function(t){return this.attributes[t]},setAttribute:function(t,n){return this.attributes[t]=n,this},deleteAttribute:function(t){return delete this.attributes[t],this},addGroup:function(t,n,e){this.groups.push({start:t,count:n,materialIndex:void 0!==e?e:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(t,n){this.drawRange.start=t,this.drawRange.count=n},applyMatrix4:function(t){var n=this.attributes.position,n=(void 0!==n&&(n.applyMatrix4(t),n.needsUpdate=!0),this.attributes.normal),e=(void 0!==n&&(e=(new Z).getNormalMatrix(t),n.applyNormalMatrix(e),n.needsUpdate=!0),this.attributes.tangent);return void 0!==e&&(e.transformDirection(t),e.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(t){return Js.makeRotationX(t),this.applyMatrix4(Js),this},rotateY:function(t){return Js.makeRotationY(t),this.applyMatrix4(Js),this},rotateZ:function(t){return Js.makeRotationZ(t),this.applyMatrix4(Js),this},translate:function(t,n,e){return Js.makeTranslation(t,n,e),this.applyMatrix4(Js),this},scale:function(t,n,e){return Js.makeScale(t,n,e),this.applyMatrix4(Js),this},lookAt:function(t){return $s.lookAt(t),$s.updateMatrix(),this.applyMatrix4($s.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(ta).negate(),this.translate(ta.x,ta.y,ta.z),this},setFromObject:function(t){var n,e,i=t.geometry;return t.isPoints||t.isLine?(e=new x(3*i.vertices.length,3),n=new x(3*i.colors.length,3),this.setAttribute("position",e.copyVector3sArray(i.vertices)),this.setAttribute("color",n.copyColorsArray(i.colors)),i.lineDistances&&i.lineDistances.length===i.vertices.length&&(e=new x(i.lineDistances.length,1),this.setAttribute("lineDistance",e.copyArray(i.lineDistances))),null!==i.boundingSphere&&(this.boundingSphere=i.boundingSphere.clone()),null!==i.boundingBox&&(this.boundingBox=i.boundingBox.clone())):t.isMesh&&i&&i.isGeometry&&this.fromGeometry(i),this},setFromPoints:function(t){for(var n=[],e=0,i=t.length;e<i;e++){var r=t[e];n.push(r.x,r.y,r.z||0)}return this.setAttribute("position",new x(n,3)),this},updateFromObject:function(t){var n,e=t.geometry;if(t.isMesh){var i=e.uo;if(!0===e.elementsNeedUpdate&&(i=void 0,e.elementsNeedUpdate=!1),void 0===i)return this.fromGeometry(e);i.verticesNeedUpdate=e.verticesNeedUpdate,i.normalsNeedUpdate=e.normalsNeedUpdate,i.colorsNeedUpdate=e.colorsNeedUpdate,i.uvsNeedUpdate=e.uvsNeedUpdate,i.groupsNeedUpdate=e.groupsNeedUpdate,e.verticesNeedUpdate=!1,e.normalsNeedUpdate=!1,e.colorsNeedUpdate=!1,e.uvsNeedUpdate=!1,e.groupsNeedUpdate=!1,e=i}return!0===e.verticesNeedUpdate&&(void 0!==(n=this.attributes.position)&&(n.copyVector3sArray(e.vertices),n.needsUpdate=!0),e.verticesNeedUpdate=!1),!0===e.normalsNeedUpdate&&(void 0!==(n=this.attributes.normal)&&(n.copyVector3sArray(e.normals),n.needsUpdate=!0),e.normalsNeedUpdate=!1),!0===e.colorsNeedUpdate&&(void 0!==(n=this.attributes.color)&&(n.copyColorsArray(e.colors),n.needsUpdate=!0),e.colorsNeedUpdate=!1),e.uvsNeedUpdate&&(void 0!==(n=this.attributes.uv)&&(n.copyVector2sArray(e.uvs),n.needsUpdate=!0),e.uvsNeedUpdate=!1),e.lineDistancesNeedUpdate&&(void 0!==(n=this.attributes.lineDistance)&&(n.copyArray(e.lineDistances),n.needsUpdate=!0),e.lineDistancesNeedUpdate=!1),e.groupsNeedUpdate&&(e.computeGroups(t.geometry),this.groups=e.groups,e.groupsNeedUpdate=!1),this},fromGeometry:function(t){return t.uo=(new Zs).fromGeometry(t),this.fromDirectGeometry(t.uo)},fromDirectGeometry:function(t){var n,e=new Float32Array(3*t.vertices.length);for(n in this.setAttribute("position",new R(e,3).copyVector3sArray(t.vertices)),0<t.normals.length&&(e=new Float32Array(3*t.normals.length),this.setAttribute("normal",new R(e,3).copyVector3sArray(t.normals))),0<t.colors.length&&(e=new Float32Array(3*t.colors.length),this.setAttribute("color",new R(e,3).copyColorsArray(t.colors))),0<t.uvs.length&&(e=new Float32Array(2*t.uvs.length),this.setAttribute("uv",new R(e,2).copyVector2sArray(t.uvs))),0<t.uvs2.length&&(e=new Float32Array(2*t.uvs2.length),this.setAttribute("uv2",new R(e,2).copyVector2sArray(t.uvs2))),this.groups=t.groups,t.morphTargets){for(var i=[],r=t.morphTargets[n],o=0,s=r.length;o<s;o++){var a=r[o],u=new x(3*a.data.length,3);u.name=a.name,i.push(u.copyVector3sArray(a.data))}this.morphAttributes[n]=i}return 0<t.skinIndices.length&&(e=new x(4*t.skinIndices.length,4),this.setAttribute("skinIndex",e.copyVector4sArray(t.skinIndices))),0<t.skinWeights.length&&(e=new x(4*t.skinWeights.length,4),this.setAttribute("skinWeight",e.copyVector4sArray(t.skinWeights))),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new jt);var t=this.attributes.position,n=this.morphAttributes.position;if(void 0!==t){if(this.boundingBox.setFromBufferAttribute(t),n)for(var e=0,i=n.length;e<i;e++){var r=n[e];na.setFromBufferAttribute(r),this.morphTargetsRelative?(ia.addVectors(this.boundingBox.min,na.min),this.boundingBox.expandByPoint(ia),ia.addVectors(this.boundingBox.max,na.max),this.boundingBox.expandByPoint(ia)):(this.boundingBox.expandByPoint(na.min),this.boundingBox.expandByPoint(na.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new Dt);var t=this.attributes.position,n=this.morphAttributes.position;if(t){var e=this.boundingSphere.center;if(na.setFromBufferAttribute(t),n)for(var i=0,r=n.length;i<r;i++){var o=n[i];ea.setFromBufferAttribute(o),this.morphTargetsRelative?(ia.addVectors(na.min,ea.min),na.expandByPoint(ia),ia.addVectors(na.max,ea.max),na.expandByPoint(ia)):(na.expandByPoint(ea.min),na.expandByPoint(ea.max))}na.getCenter(e);for(var s=0,i=0,r=t.count;i<r;i++)ia.fromBufferAttribute(t,i),s=Math.max(s,e.distanceToSquared(ia));if(n)for(i=0,r=n.length;i<r;i++)for(var o=n[i],a=this.morphTargetsRelative,u=0,c=o.count;u<c;u++)ia.fromBufferAttribute(o,u),a&&(ta.fromBufferAttribute(t,u),ia.add(ta)),s=Math.max(s,e.distanceToSquared(ia));this.boundingSphere.radius=Math.sqrt(s),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}},computeFaceNormals:function(){},computeVertexNormals:function(){var t=this.index,n=this.attributes;if(n.position){var e=n.position.array;if(void 0===n.normal)this.setAttribute("normal",new R(new Float32Array(e.length),3));else for(var i=n.normal.array,r=0,o=i.length;r<o;r++)i[r]=0;var s,a,u,c=n.normal.array,h=new Tt,f=new Tt,l=new Tt,d=new Tt,v=new Tt;if(t)for(var p=t.array,r=0,o=t.count;r<o;r+=3)s=3*p[r+0],a=3*p[r+1],u=3*p[r+2],h.fromArray(e,s),f.fromArray(e,a),l.fromArray(e,u),d.subVectors(l,f),v.subVectors(h,f),d.cross(v),c[s]+=d.x,c[1+s]+=d.y,c[2+s]+=d.z,c[a]+=d.x,c[1+a]+=d.y,c[2+a]+=d.z,c[u]+=d.x,c[1+u]+=d.y,c[2+u]+=d.z;else for(r=0,o=e.length;r<o;r+=9)h.fromArray(e,r),f.fromArray(e,r+3),l.fromArray(e,r+6),d.subVectors(l,f),v.subVectors(h,f),d.cross(v),c[r]=d.x,c[r+1]=d.y,c[r+2]=d.z,c[r+3]=d.x,c[r+4]=d.y,c[r+5]=d.z,c[r+6]=d.x,c[r+7]=d.y,c[r+8]=d.z;this.normalizeNormals(),n.normal.needsUpdate=!0}},normalizeNormals:function(){for(var t=this.attributes.normal,n=0,e=t.count;n<e;n++)ia.x=t.getX(n),ia.y=t.getY(n),ia.z=t.getZ(n),ia.normalize(),t.setXYZ(n,ia.x,ia.y,ia.z)},dispose:function(){this.dispatchEvent({type:"dispose"})}});var pa=function(){function u(t,n,e,i,r,o){ua(this,u),(s=ca(this,u)).type="BoxBufferGeometry",s.parameters={width:t,height:n,depth:e,widthSegments:i,heightSegments:r,depthSegments:o};var s,O=ha(s),L=(t=t||1,n=n||1,e=e||1,i=Math.floor(i)||1,r=Math.floor(r)||1,o=Math.floor(o)||1,[]),R=[],N=[],P=[],F=0,j=0;function a(t,n,e,i,r,o,s,a,u,c,h){for(var f=o/u,l=s/c,d=o/2,v=s/2,p=a/2,m=u+1,y=c+1,b=0,g=0,_=new Tt,w=0;w<y;w++)for(var x=w*l-v,E=0;E<m;E++)_[t]=(E*f-d)*i,_[n]=x*r,_[e]=p,R.push(_.x,_.y,_.z),_[t]=0,_[n]=0,_[e]=0<a?1:-1,N.push(_.x,_.y,_.z),P.push(E/u),P.push(1-w/c),b+=1;for(w=0;w<c;w++)for(E=0;E<u;E++){var S=F+E+m*w,T=F+E+m*(w+1),A=F+(E+1)+m*(w+1),M=F+(E+1)+m*w;L.push(S,T,M),L.push(T,A,M),g+=6}O.addGroup(j,g,h),j+=g,F+=b}return a("z","y","x",-1,-1,e,n,t,o,r,0),a("z","y","x",1,-1,e,n,-t,o,r,1),a("x","z","y",1,1,t,e,n,i,o,2),a("x","z","y",1,-1,t,e,-n,i,o,3),a("x","y","z",1,-1,t,n,e,i,r,4),a("x","y","z",-1,-1,t,n,-e,i,r,5),s.setIndex(L),s.setAttribute("position",new x(R,3)),s.setAttribute("normal",new x(N,3)),s.setAttribute("uv",new x(P,2)),s}return da(u,ra),aa(u)}();function ma(t,n,e,i){ra.call(this),this.type="PlaneBufferGeometry",this.parameters={width:t,height:n,widthSegments:e,heightSegments:i};for(var r=(t=t||1)/2,o=(n=n||1)/2,s=Math.floor(e)||1,a=Math.floor(i)||1,u=s+1,c=a+1,h=t/s,f=n/a,l=[],d=[],v=[],p=[],m=0;m<c;m++)for(var y=m*f-o,b=0;b<u;b++)d.push(b*h-r,-y,0),v.push(0,0,1),p.push(b/s),p.push(1-m/a);for(m=0;m<a;m++)for(b=0;b<s;b++){var g=b+u*(m+1),_=b+1+u*(m+1),w=b+1+u*m;l.push(b+u*m,g,w),l.push(g,_,w)}this.setIndex(l),this.setAttribute("position",new x(d,3)),this.setAttribute("normal",new x(v,3)),this.setAttribute("uv",new x(p,2))}(ma.prototype=Object.create(ra.prototype)).constructor=ma;var ya=0;function f(){Object.defineProperty(this,"id",{value:ya++}),this.uuid=St.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.blending=cn,this.side=on,this.flatShading=!1,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=En,this.blendDst=Sn,this.blendEquation=vn,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=Fn,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=gi,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=yi,this.stencilZFail=yi,this.stencilZPass=yi,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0}function ba(t){var n,e={};for(n in t)for(var i in e[n]={},t[n]){var r=t[n][i];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture)?e[n][i]=r.clone():Array.isArray(r)?e[n][i]=r.slice():e[n][i]=r}return e}function ga(t){for(var n={},e=0;e<t.length;e++){var i,r=ba(t[e]);for(i in r)n[i]=r[i]}return n}f.prototype=Object.assign(Object.create(X.prototype),{constructor:f,isMaterial:!0,onBeforeCompile:function(){},setValues:function(t){if(void 0!==t)for(var n in t){var e,i=t[n];void 0===i?console.warn("THREE.Material: '"+n+"' parameter is undefined."):"shading"===n?(console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===i):void 0===(e=this[n])?console.warn("THREE."+this.type+": '"+n+"' is not a property of this material."):e&&e.isColor?e.set(i):e&&e.isVector3&&i&&i.isVector3?e.copy(i):this[n]=i}},clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.name=t.name,this.fog=t.fog,this.blending=t.blending,this.side=t.side,this.flatShading=t.flatShading,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;var n=t.clippingPlanes,e=null;if(null!==n)for(var i=n.length,e=new Array(i),r=0;r!==i;++r)e[r]=n[r].clone();return this.clippingPlanes=e,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.premultipliedAlpha=t.premultipliedAlpha,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(f.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}});var _a={clone:ba,merge:ga},wa="\nvoid main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",xa="\nvoid main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}\n";function Ea(t){f.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader=wa,this.fragmentShader=xa,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,void 0!==t&&(void 0!==t.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(t))}((Ea.prototype=Object.create(f.prototype)).constructor=Ea).prototype.isShaderMaterial=!0,Ea.prototype.copy=function(t){return f.prototype.copy.call(this,t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=ba(t.uniforms),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.lights=t.lights,this.clipping=t.clipping,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.extensions=t.extensions,this};var Sa=new Tt,Ta=new Tt,Aa=new Tt,Ma=new Tt,Oa=new Tt,La=new Tt,Ra=new Tt,Na=new Tt,Pa=new Tt,Fa=new Tt;function ja(t,n,e){this.a=void 0!==t?t:new Tt,this.b=void 0!==n?n:new Tt,this.c=void 0!==e?e:new Tt}function Ia(t){f.call(this),this.type="MeshBasicMaterial",this.color=new lt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=kn,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.setValues(t)}Object.assign(ja,{getNormal:function(t,n,e,i){void 0===i&&(console.warn("THREE.Triangle: .getNormal() target is now required"),i=new Tt),i.subVectors(e,n),Sa.subVectors(t,n),i.cross(Sa);e=i.lengthSq();return 0<e?i.multiplyScalar(1/Math.sqrt(e)):i.set(0,0,0)},getBarycoord:function(t,n,e,i,r){Sa.subVectors(i,n),Ta.subVectors(e,n),Aa.subVectors(t,n);var i=Sa.dot(Sa),e=Sa.dot(Ta),t=Sa.dot(Aa),n=Ta.dot(Ta),o=Ta.dot(Aa),s=i*n-e*e;return void 0===r&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),r=new Tt),0==s?r.set(-2,-1,-1):r.set(1-(n=(n*t-e*o)*(r=1/s))-(s=(i*o-e*t)*r),s,n)},containsPoint:function(t,n,e,i){return ja.getBarycoord(t,n,e,i,Ma),0<=Ma.x&&0<=Ma.y&&Ma.x+Ma.y<=1},getUV:function(t,n,e,i,r,o,s,a){return this.getBarycoord(t,n,e,i,Ma),a.set(0,0),a.addScaledVector(r,Ma.x),a.addScaledVector(o,Ma.y),a.addScaledVector(s,Ma.z),a},isFrontFacing:function(t,n,e,i){return Sa.subVectors(e,n),Ta.subVectors(t,n),Sa.cross(Ta).dot(i)<0}}),Object.assign(ja.prototype,{set:function(t,n,e){return this.a.copy(t),this.b.copy(n),this.c.copy(e),this},setFromPointsAndIndices:function(t,n,e,i){return this.a.copy(t[n]),this.b.copy(t[e]),this.c.copy(t[i]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this},getArea:function(){return Sa.subVectors(this.c,this.b),Ta.subVectors(this.a,this.b),.5*Sa.cross(Ta).length()},getMidpoint:function(t){return void 0===t&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),t=new Tt),t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(t){return ja.getNormal(this.a,this.b,this.c,t)},getPlane:function(t){return void 0===t&&(console.warn("THREE.Triangle: .getPlane() target is now required"),t=new Gt),t.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(t,n){return ja.getBarycoord(t,this.a,this.b,this.c,n)},getUV:function(t,n,e,i,r){return ja.getUV(t,this.a,this.b,this.c,n,e,i,r)},containsPoint:function(t){return ja.containsPoint(t,this.a,this.b,this.c)},isFrontFacing:function(t){return ja.isFrontFacing(this.a,this.b,this.c,t)},intersectsBox:function(t){return t.intersectsTriangle(this)},closestPointToPoint:function(t,n){void 0===n&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),n=new Tt);var e=this.a,i=this.b,r=this.c,o=(Oa.subVectors(i,e),La.subVectors(r,e),Na.subVectors(t,e),Oa.dot(Na)),s=La.dot(Na);if(o<=0&&s<=0)return n.copy(e);Pa.subVectors(t,i);var a=Oa.dot(Pa),u=La.dot(Pa);if(0<=a&&u<=a)return n.copy(i);var c=o*u-a*s;if(c<=0&&0<=o&&a<=0)return h=o/(o-a),n.copy(e).addScaledVector(Oa,h);Fa.subVectors(t,r);var h,f,t=Oa.dot(Fa),l=La.dot(Fa);return 0<=l&&t<=l?n.copy(r):(o=t*s-o*l)<=0&&0<=s&&l<=0?(f=s/(s-l),n.copy(e).addScaledVector(La,f)):(s=a*l-t*u)<=0&&0<=u-a&&0<=t-l?(Ra.subVectors(r,i),f=(u-a)/(u-a+(t-l)),n.copy(i).addScaledVector(Ra,f)):(h=o*(r=1/(s+o+c)),f=c*r,n.copy(e).addScaledVector(Oa,h).addScaledVector(La,f))},equals:function(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}),((Ia.prototype=Object.create(f.prototype)).constructor=Ia).prototype.isMeshBasicMaterial=!0,Ia.prototype.copy=function(t){return f.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this};var Ca=new At,Da=new us,ka=new Dt,Ua=new Tt,Ba=new Tt,Ga=new Tt,Ha=new Tt,Xa=new Tt,Va=new Tt,za=new Tt,Wa=new Tt,Ya=new Tt,Qa=new Mt,Za=new Mt,qa=new Mt,Ka=new Tt,Ja=new Tt;function $a(t,n){a.call(this),this.type="Mesh",this.geometry=void 0!==t?t:new ra,this.material=void 0!==n?n:new Ia,this.updateMorphTargets()}function tu(t,n,e,i,r,o,s,a){i=n.side===sn?i.intersectTriangle(s,o,r,!0,a):i.intersectTriangle(r,o,s,n.side!==an,a);if(null===i)return null;Ja.copy(a),Ja.applyMatrix4(t.matrixWorld);r=e.ray.origin.distanceTo(Ja);return r<e.near||r>e.far?null:{distance:r,point:Ja.clone(),object:t}}function nu(t,n,e,i,r,o,s,a,u,c,h,f){Ua.fromBufferAttribute(r,c),Ba.fromBufferAttribute(r,h),Ga.fromBufferAttribute(r,f);var l=t.morphTargetInfluences;if(n.morphTargets&&o&&l){za.set(0,0,0),Wa.set(0,0,0),Ya.set(0,0,0);for(var d=0,v=o.length;d<v;d++){var p=l[d],m=o[d];0!==p&&(Ha.fromBufferAttribute(m,c),Xa.fromBufferAttribute(m,h),Va.fromBufferAttribute(m,f),s?(za.addScaledVector(Ha,p),Wa.addScaledVector(Xa,p),Ya.addScaledVector(Va,p)):(za.addScaledVector(Ha.sub(Ua),p),Wa.addScaledVector(Xa.sub(Ba),p),Ya.addScaledVector(Va.sub(Ga),p)))}Ua.add(za),Ba.add(Wa),Ga.add(Ya)}r=tu(t,n,e,i,Ua,Ba,Ga,Ka);return r&&(a&&(Qa.fromBufferAttribute(a,c),Za.fromBufferAttribute(a,h),qa.fromBufferAttribute(a,f),r.uv=ja.getUV(Ka,Ua,Ba,Ga,Qa,Za,qa,new Mt)),u&&(Qa.fromBufferAttribute(u,c),Za.fromBufferAttribute(u,h),qa.fromBufferAttribute(u,f),r.uv2=ja.getUV(Ka,Ua,Ba,Ga,Qa,Za,qa,new Mt)),t=new js(c,h,f),ja.getNormal(Ua,Ba,Ga,t.normal),r.face=t),r}$a.prototype=Object.assign(Object.create(a.prototype),{constructor:$a,isMesh:!0,copy:function(t){return a.prototype.copy.call(this,t),void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this},updateMorphTargets:function(){var t,n,e,i=this.geometry;if(i.isBufferGeometry){var r=i.morphAttributes,o=Object.keys(r);if(0<o.length){var s=r[o[0]];if(void 0!==s)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,n=s.length;t<n;t++)e=s[t].name||String(t),this.morphTargetInfluences.push(0),this.morphTargetDictionary[e]=t}}else{r=i.morphTargets;void 0!==r&&0<r.length&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(t,n){var e=this.geometry,i=this.material,r=this.matrixWorld;if(void 0!==i&&(null===e.boundingSphere&&e.computeBoundingSphere(),ka.copy(e.boundingSphere),ka.applyMatrix4(r),!1!==t.ray.intersectsSphere(ka)&&(Ca.getInverse(r),Da.copy(t.ray).applyMatrix4(Ca),null===e.boundingBox||!1!==Da.intersectsBox(e.boundingBox))))if(e.isBufferGeometry){var o,s,a,u,c,h,f,l,d,v=e.index,p=e.attributes.position,m=e.morphAttributes.position,y=e.morphTargetsRelative,b=e.attributes.uv,g=e.attributes.uv2,_=e.groups,w=e.drawRange;if(null!==v)if(Array.isArray(i))for(u=0,h=_.length;u<h;u++)for(d=i[(l=_[u]).materialIndex],c=Math.max(l.start,w.start),f=Math.min(l.start+l.count,w.start+w.count);c<f;c+=3)o=v.getX(c),s=v.getX(c+1),a=v.getX(c+2),(N=nu(this,d,t,Da,p,m,y,b,g,o,s,a))&&(N.faceIndex=Math.floor(c/3),N.face.materialIndex=l.materialIndex,n.push(N));else for(u=Math.max(0,w.start),h=Math.min(v.count,w.start+w.count);u<h;u+=3)o=v.getX(u),s=v.getX(u+1),a=v.getX(u+2),(N=nu(this,i,t,Da,p,m,y,b,g,o,s,a))&&(N.faceIndex=Math.floor(u/3),n.push(N));else if(void 0!==p)if(Array.isArray(i))for(u=0,h=_.length;u<h;u++)for(d=i[(l=_[u]).materialIndex],c=Math.max(l.start,w.start),f=Math.min(l.start+l.count,w.start+w.count);c<f;c+=3)(N=nu(this,d,t,Da,p,m,y,b,g,o=c,s=c+1,a=c+2))&&(N.faceIndex=Math.floor(c/3),N.face.materialIndex=l.materialIndex,n.push(N));else for(u=Math.max(0,w.start),h=Math.min(p.count,w.start+w.count);u<h;u+=3)(N=nu(this,i,t,Da,p,m,y,b,g,o=u,s=u+1,a=u+2))&&(N.faceIndex=Math.floor(u/3),n.push(N))}else if(e.isGeometry){var x,E=Array.isArray(i),S=e.vertices,T=e.faces,r=e.faceVertexUvs[0];0<r.length&&(x=r);for(var A=0,M=T.length;A<M;A++){var O,L,R,N,P=T[A],F=E?i[P.materialIndex]:i;void 0!==F&&(O=S[P.a],L=S[P.b],R=S[P.c],N=tu(this,F,t,Da,O,L,R,Ka))&&(x&&x[A]&&(F=x[A],Qa.copy(F[0]),Za.copy(F[1]),qa.copy(F[2]),N.uv=ja.getUV(Ka,O,L,R,Qa,Za,qa,new Mt)),N.face=P,N.faceIndex=A,n.push(N))}}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var w={alphamap_fragment:"\n#ifdef USE_ALPHAMAP\n\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n\n#endif\n",alphamap_pars_fragment:"\n#ifdef USE_ALPHAMAP\n\n\tuniform sampler2D alphaMap;\n\n#endif\n",alphatest_fragment:"\n#ifdef ALPHATEST\n\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n\n#endif\n",aomap_fragment:"\n#ifdef USE_AOMAP\n\n\t// reads channel R, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\n\t#endif\n\n#endif\n",aomap_pars_fragment:"\n#ifdef USE_AOMAP\n\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n\n#endif\n",begin_vertex:"\nvec3 transformed = vec3( position );\n",beginnormal_vertex:"\nvec3 objectNormal = vec3( normal );\n\n#ifdef USE_TANGENT\n\n\tvec3 objectTangent = vec3( tangent.xyz );\n\n#endif\n",bsdfs:'\n\n// Analytical approximation of the DFG LUT, one half of the\n// split-sum approximation used in indirect specular lighting.\n// via \'environmentBRDF\' from "Physically Based Shading on Mobile"\n// https://www.unrealengine.com/blog/physically-based-shading-on-mobile - environmentBRDF for GGX on mobile\nvec2 integrateSpecularBRDF( const in float dotNV, const in float roughness ) {\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\n\tvec4 r = roughness * c0 + c1;\n\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\n\treturn vec2( -1.04, 1.04 ) * a004 + r.zw;\n\n}\n\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\n\t// based upon Frostbite 3 Moving to Physically-based Rendering\n\t// page 32, equation 26: E[window1]\n\t// https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf\n\t// this is intended to be used on spot and point lights who are represented as luminous intensity\n\t// but who must be converted to luminous irradiance for surface lighting calculation\n\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\n\tif( cutoffDistance > 0.0 ) {\n\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\n\t}\n\n\treturn distanceFalloff;\n\n#else\n\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\n\t}\n\n\treturn 1.0;\n\n#endif\n\n}\n\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\n\treturn RECIPROCAL_PI * diffuseColor;\n\n} // validated\n\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\n\t// Original approximation by Christophe Schlick \'94\n\t// float fresnel = pow( 1.0 - dotLH, 5.0 );\n\n\t// Optimized variant (presented by Epic at SIGGRAPH \'13)\n\t// https://cdn2.unrealengine.com/Resources/files/2013SiggraphPresentationsNotes-26915738.pdf\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n\n} // validated\n\nvec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {\n\n\t// See F_Schlick\n\tfloat fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );\n\tvec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;\n\n\treturn Fr * fresnel + F0;\n\n}\n\n\n// Microfacet Models for Refraction through Rough Surfaces - equation (34)\n// http://graphicrants.blogspot.com/2013/08/specular-brdf-reference.html\n// alpha is "roughness squared" in Disney’s reparameterization\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\n\t// geometry term (normalized) = G(l)⋅G(v) / 4(n⋅l)(n⋅v)\n\t// also see #12151\n\n\tfloat a2 = pow2( alpha );\n\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\n\treturn 1.0 / ( gl * gv );\n\n} // validated\n\n// Moving Frostbite to Physically Based Rendering 3.0 - page 12, listing 2\n// https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\n\tfloat a2 = pow2( alpha );\n\n\t// dotNL and dotNV are explicitly swapped. This is not a mistake.\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\n\treturn 0.5 / max( gv + gl, EPSILON );\n\n}\n\n// Microfacet Models for Refraction through Rough Surfaces - equation (33)\n// http://graphicrants.blogspot.com/2013/08/specular-brdf-reference.html\n// alpha is "roughness squared" in Disney’s reparameterization\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\n\tfloat a2 = pow2( alpha );\n\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; // avoid alpha = 0 with dotNH = 1\n\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n\n}\n\n// GGX Distribution, Schlick Fresnel, GGX-Smith Visibility\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\n\tfloat alpha = pow2( roughness ); // UE4\'s roughness\n\n\tvec3 halfDir = normalize( incidentLight.direction + viewDir );\n\n\tfloat dotNL = saturate( dot( normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\n\tfloat D = D_GGX( alpha, dotNH );\n\n\treturn F * ( G * D );\n\n} // validated\n\n// Rect Area Light\n\n// Real-Time Polygonal-Light Shading with Linearly Transformed Cosines\n// by Eric Heitz, Jonathan Dupuy, Stephen Hill and David Neubelt\n// code: https://github.com/selfshadow/ltc_code/\n\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\n\tfloat dotNV = saturate( dot( N, V ) );\n\n\t// texture parameterized by sqrt( GGX alpha ) and sqrt( 1 - cos( theta ) )\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\n\treturn uv;\n\n}\n\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\n\t// Real-Time Area Lighting: a Journey from Research to Production (p.102)\n\t// An approximation of the form factor of a horizon-clipped rectangle.\n\n\tfloat l = length( f );\n\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n\n}\n\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\n\tfloat x = dot( v1, v2 );\n\n\tfloat y = abs( x );\n\n\t// rational polynomial approximation to theta / sin( theta ) / 2PI\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\n\treturn cross( v1, v2 ) * theta_sintheta;\n\n}\n\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\n\t// bail if point is on back side of plane of light\n\t// assumes ccw winding order of light vertices\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\n\t// construct orthonormal basis around N\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 ); // negated from paper; possibly due to a different handedness of world coordinate system\n\n\t// compute transform\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\n\t// transform rect\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\n\t// project rect onto sphere\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\n\t// calculate vector form factor\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\n\t// adjust for horizon clipping\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\n/*\n\t// alternate method of adjusting for horizon clipping (see referece)\n\t// refactoring required\n\tfloat len = length( vectorFormFactor );\n\tfloat z = vectorFormFactor.z / len;\n\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\n\t// tabulated horizon-clipped sphere, apparently...\n\tvec2 uv = vec2( z * 0.5 + 0.5, len );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\n\tfloat scale = texture2D( ltc_2, uv ).w;\n\n\tfloat result = len * scale;\n*/\n\n\treturn vec3( result );\n\n}\n\n// End Rect Area Light\n\n// ref: https://www.unrealengine.com/blog/physically-based-shading-on-mobile - environmentBRDF for GGX on mobile\nvec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\n\treturn specularColor * brdf.x + brdf.y;\n\n} // validated\n\n// Fdez-Agüera\'s "Multiple-Scattering Microfacet Model for Real-Time Image Based Lighting"\n// Approximates multiscattering in order to preserve energy.\n// http://www.jcgt.org/published/0008/01/03/\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\n\tvec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\tvec3 FssEss = F * brdf.x + brdf.y;\n\n\tfloat Ess = brdf.x + brdf.y;\n\tfloat Ems = 1.0 - Ess;\n\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619; // 1/21\n\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n\n}\n\nfloat G_BlinnPhong_Implicit( /* const in float dotNL, const in float dotNV */ ) {\n\n\t// geometry term is (n dot l)(n dot v) / 4(n dot l)(n dot v)\n\treturn 0.25;\n\n}\n\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n\n}\n\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\n\t//float dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\n\t//float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\n\tfloat G = G_BlinnPhong_Implicit( /* dotNL, dotNV */ );\n\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\n\treturn F * ( G * D );\n\n} // validated\n\n// source: http://simonstechblog.blogspot.ca/2011/12/microfacet-brdf.html\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\n\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n\n#if defined( USE_SHEEN )\n\n// https://github.com/google/filament/blob/master/shaders/src/brdf.fs#L94\nfloat D_Charlie(float roughness, float NoH) {\n\t// Estevez and Kulla 2017, "Production Friendly Microfacet Sheen BRDF"\n\tfloat invAlpha = 1.0 / roughness;\n\tfloat cos2h = NoH * NoH;\n\tfloat sin2h = max(1.0 - cos2h, 0.0078125); // 2^(-14/2), so sin2h^2 > 0 in fp16\n\treturn (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}\n\n// https://github.com/google/filament/blob/master/shaders/src/brdf.fs#L136\nfloat V_Neubelt(float NoV, float NoL) {\n\t// Neubelt and Pettineo 2013, "Crafting a Next-gen Material Pipeline for The Order: 1886"\n\treturn saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV)));\n}\n\nvec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) {\n\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\n\tvec3 H = normalize( V + L );\n\tfloat dotNH = saturate( dot( N, H ) );\n\n\treturn specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );\n\n}\n\n#endif\n',bumpmap_pars_fragment:"\n#ifdef USE_BUMPMAP\n\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\n\t// Bump Mapping Unparametrized Surfaces on the GPU by Morten S. Mikkelsen\n\t// http://api.unrealengine.com/attachments/Engine/Rendering/LightingAndShadows/BumpMappingWithoutTangentSpace/mm_sfgrad_bump.pdf\n\n\t// Evaluate the derivative of the height w.r.t. screen-space using forward differencing (listing 2)\n\n\tvec2 dHdxy_fwd() {\n\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\n\t\treturn vec2( dBx, dBy );\n\n\t}\n\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\n\t\t// Workaround for Adreno 3XX dFd*( vec3 ) bug. See #9988\n\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\t\t// normalized\n\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\n\t\tfDet *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\n\t}\n\n#endif\n",clipping_planes_fragment:"\n#if NUM_CLIPPING_PLANES > 0\n\n\tvec4 plane;\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\n\t}\n\t#pragma unroll_loop_end\n\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\n\t\tbool clipped = true;\n\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\n\t\t}\n\t\t#pragma unroll_loop_end\n\n\t\tif ( clipped ) discard;\n\n\t#endif\n\n#endif\n",clipping_planes_pars_fragment:"\n#if NUM_CLIPPING_PLANES > 0\n\n\tvarying vec3 vClipPosition;\n\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n\n#endif\n",clipping_planes_pars_vertex:"\n#if NUM_CLIPPING_PLANES > 0\n\n\tvarying vec3 vClipPosition;\n\n#endif\n",clipping_planes_vertex:"\n#if NUM_CLIPPING_PLANES > 0\n\n\tvClipPosition = - mvPosition.xyz;\n\n#endif\n",color_fragment:"\n#ifdef USE_COLOR\n\n\tdiffuseColor.rgb *= vColor;\n\n#endif\n",color_pars_fragment:"\n#ifdef USE_COLOR\n\n\tvarying vec3 vColor;\n\n#endif\n",color_pars_vertex:"\n#ifdef USE_COLOR\n\n\tvarying vec3 vColor;\n\n#endif\n",color_vertex:"\n#ifdef USE_COLOR\n\n\tvColor.xyz = color.xyz;\n\n#endif\n",common:"\n#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI_HALF 1.5707963267949\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n\n#ifndef saturate\n// <tonemapping_pars_fragment> may have defined saturate() already\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement(a) ( 1.0 - saturate( a ) )\n\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\n// expects values in the range of [0,1]x[0,1], returns values in the [0,1] range.\n// do not collapse into a single function per: http://byteblacksmith.com/improvements-to-the-canonical-one-liner-glsl-rand-for-opengl-es-2-0/\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\n\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); }\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\n\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\n\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\n\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\n\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n}\n\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t// dir can be either a direction vector or a normal vector\n\t// upper-left 3x3 of matrix is assumed to be orthogonal\n\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n\n}\n\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\n\treturn - distance * planeNormal + point;\n\n}\n\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n\n}\n\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n\n}\n\nmat3 transposeMat3( const in mat3 m ) {\n\n\tmat3 tmp;\n\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\n\treturn tmp;\n\n}\n\n// https://en.wikipedia.org/wiki/Relative_luminance\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\n\treturn dot( weights, color.rgb );\n\n}\n\nbool isPerspectiveMatrix( mat4 m ) {\n\n return m[ 2 ][ 3 ] == - 1.0;\n\n}\n",cube_uv_reflection_fragment:"\n#ifdef ENVMAP_TYPE_CUBE_UV\n\n#define cubeUV_maxMipLevel 8.0\n#define cubeUV_minMipLevel 4.0\n#define cubeUV_maxTileSize 256.0\n#define cubeUV_minTileSize 16.0\n\n// These shader functions convert between the UV coordinates of a single face of\n// a cubemap, the 0-5 integer index of a cube face, and the direction vector for\n// sampling a textureCube (not generally normalized).\n\nfloat getFace(vec3 direction) {\n vec3 absDirection = abs(direction);\n float face = -1.0;\n if (absDirection.x > absDirection.z) {\n if (absDirection.x > absDirection.y)\n face = direction.x > 0.0 ? 0.0 : 3.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n } else {\n if (absDirection.z > absDirection.y)\n face = direction.z > 0.0 ? 2.0 : 5.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n }\n return face;\n}\n\nvec2 getUV(vec3 direction, float face) {\n vec2 uv;\n if (face == 0.0) {\n uv = vec2(-direction.z, direction.y) / abs(direction.x);\n } else if (face == 1.0) {\n uv = vec2(direction.x, -direction.z) / abs(direction.y);\n } else if (face == 2.0) {\n uv = direction.xy / abs(direction.z);\n } else if (face == 3.0) {\n uv = vec2(direction.z, direction.y) / abs(direction.x);\n } else if (face == 4.0) {\n uv = direction.xz / abs(direction.y);\n } else {\n uv = vec2(-direction.x, direction.y) / abs(direction.z);\n }\n return 0.5 * (uv + 1.0);\n}\n\nvec3 bilinearCubeUV(sampler2D envMap, vec3 direction, float mipInt) {\n float face = getFace(direction);\n float filterInt = max(cubeUV_minMipLevel - mipInt, 0.0);\n mipInt = max(mipInt, cubeUV_minMipLevel);\n float faceSize = exp2(mipInt);\n\n float texelSize = 1.0 / (3.0 * cubeUV_maxTileSize);\n\n vec2 uv = getUV(direction, face) * (faceSize - 1.0);\n vec2 f = fract(uv);\n uv += 0.5 - f;\n if (face > 2.0) {\n uv.y += faceSize;\n face -= 3.0;\n }\n uv.x += face * faceSize;\n if(mipInt < cubeUV_maxMipLevel){\n uv.y += 2.0 * cubeUV_maxTileSize;\n }\n uv.y += filterInt * 2.0 * cubeUV_minTileSize;\n uv.x += 3.0 * max(0.0, cubeUV_maxTileSize - 2.0 * faceSize);\n uv *= texelSize;\n\n vec3 tl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.x += texelSize;\n vec3 tr = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.y += texelSize;\n vec3 br = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.x -= texelSize;\n vec3 bl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n vec3 tm = mix(tl, tr, f.x);\n vec3 bm = mix(bl, br, f.x);\n return mix(tm, bm, f.y);\n}\n\n// These defines must match with PMREMGenerator\n\n#define r0 1.0\n#define v0 0.339\n#define m0 -2.0\n#define r1 0.8\n#define v1 0.276\n#define m1 -1.0\n#define r4 0.4\n#define v4 0.046\n#define m4 2.0\n#define r5 0.305\n#define v5 0.016\n#define m5 3.0\n#define r6 0.21\n#define v6 0.0038\n#define m6 4.0\n\nfloat roughnessToMip(float roughness) {\n float mip = 0.0;\n if (roughness >= r1) {\n mip = (r0 - roughness) * (m1 - m0) / (r0 - r1) + m0;\n } else if (roughness >= r4) {\n mip = (r1 - roughness) * (m4 - m1) / (r1 - r4) + m1;\n } else if (roughness >= r5) {\n mip = (r4 - roughness) * (m5 - m4) / (r4 - r5) + m4;\n } else if (roughness >= r6) {\n mip = (r5 - roughness) * (m6 - m5) / (r5 - r6) + m5;\n } else {\n mip = -2.0 * log2(1.16 * roughness);// 1.16 = 1.79^0.25\n }\n return mip;\n}\n\nvec4 textureCubeUV(sampler2D envMap, vec3 sampleDir, float roughness) {\n float mip = clamp(roughnessToMip(roughness), m0, cubeUV_maxMipLevel);\n float mipF = fract(mip);\n float mipInt = floor(mip);\n\n vec3 color0 = bilinearCubeUV(envMap, sampleDir, mipInt);\n if (mipF == 0.0) {\n return vec4(color0, 1.0);\n } else {\n vec3 color1 = bilinearCubeUV(envMap, sampleDir, mipInt + 1.0);\n return vec4(mix(color0, color1, mipF), 1.0);\n }\n}\n#endif\n",defaultnormal_vertex:"\nvec3 transformedNormal = objectNormal;\n\n#ifdef USE_INSTANCING\n\n\t// this is in lieu of a per-instance normal-matrix\n\t// shear transforms in the instance matrix are not supported\n\n\tmat3 m = mat3( instanceMatrix );\n\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\n\ttransformedNormal = m * transformedNormal;\n\n#endif\n\ntransformedNormal = normalMatrix * transformedNormal;\n\n#ifdef FLIP_SIDED\n\n\ttransformedNormal = - transformedNormal;\n\n#endif\n\n#ifdef USE_TANGENT\n\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\n\t#ifdef FLIP_SIDED\n\n\t\ttransformedTangent = - transformedTangent;\n\n\t#endif\n\n#endif\n",displacementmap_pars_vertex:"\n#ifdef USE_DISPLACEMENTMAP\n\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n\n#endif\n",displacementmap_vertex:"\n#ifdef USE_DISPLACEMENTMAP\n\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n\n#endif\n",emissivemap_fragment:"\n#ifdef USE_EMISSIVEMAP\n\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n\n#endif\n",emissivemap_pars_fragment:"\n#ifdef USE_EMISSIVEMAP\n\n\tuniform sampler2D emissiveMap;\n\n#endif\n",encodings_fragment:"\ngl_FragColor = linearToOutputTexel( gl_FragColor );\n",encodings_pars_fragment:"\n// For a discussion of what this is, please read this: http://lousodrome.net/blog/light/2013/05/26/gamma-correct-and-hdr-rendering-in-a-32-bits-buffer/\n\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\n\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\n\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\n\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\n\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\n\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\n\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n// return vec4( value.brg, ( 3.0 + 128.0 ) / 256.0 );\n}\n\n// reference: http://iwasbeingirony.blogspot.ca/2010/06/difference-between-rgbm-and-rgbd.html\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\n\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\n\n// reference: http://iwasbeingirony.blogspot.ca/2010/06/difference-between-rgbm-and-rgbd.html\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\n\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\t// NOTE: The implementation with min causes the shader to not compile on\n\t// a common Alcatel A502DL in Chrome 78/Android 8.1. Some research suggests \n\t// that the chipset is Mediatek MT6739 w/ IMG PowerVR GE8100 GPU.\n\t// D = min( floor( D ) / 255.0, 1.0 );\n\tD = clamp( floor( D ) / 255.0, 0.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\n\n// LogLuv reference: http://graphicrants.blogspot.ca/2009/04/rgbm-color-encoding.html\n\n// M matrix, for encoding\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract( Le );\n\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n\treturn vResult;\n}\n\n// Inverse M matrix, for decoding\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}\n",envmap_fragment:"\n#ifdef USE_ENVMAP\n\n\t#ifdef ENV_WORLDPOS\n\n\t\tvec3 cameraToFrag;\n\t\t\n\t\tif ( isOrthographic ) {\n\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\n\t\t} else {\n\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\n\t\t}\n\n\t\t// Transforming Normal Vectors with the Inverse Transformation\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\n\t\t#else\n\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\n\t\t#endif\n\n\t#else\n\n\t\tvec3 reflectVec = vReflect;\n\n\t#endif\n\n\t#ifdef ENVMAP_TYPE_CUBE\n\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\n\t\tvec2 sampleUV;\n\n\t\treflectVec = normalize( reflectVec );\n\n\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\n\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\n\t\treflectVec = normalize( reflectVec );\n\n\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );\n\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\n\t#else\n\n\t\tvec4 envColor = vec4( 0.0 );\n\n\t#endif\n\n\t#ifndef ENVMAP_TYPE_CUBE_UV\n\n\t\tenvColor = envMapTexelToLinear( envColor );\n\n\t#endif\n\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\n\t#endif\n\n#endif\n",envmap_common_pars_fragment:"\n#ifdef USE_ENVMAP\n\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif\n",envmap_pars_fragment:"\n#ifdef USE_ENVMAP\n\n\tuniform float reflectivity;\n\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\n\t\t#define ENV_WORLDPOS\n\n\t#endif\n\n\t#ifdef ENV_WORLDPOS\n\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n\n#endif\n",envmap_pars_vertex:"\n#ifdef USE_ENVMAP\n\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\n\t\t#define ENV_WORLDPOS\n\n\t#endif\n\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\n\t#else\n\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\n\t#endif\n\n#endif\n",envmap_physical_pars_fragment:"\n#if defined( USE_ENVMAP )\n\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\n\tvec3 getLightProbeIndirectIrradiance( /*const in SpecularLightProbe specularLightProbe,*/ const in GeometricContext geometry, const in int maxMIPLevel ) {\n\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\n\t\t\t// TODO: replace with properly filtered cubemaps and access the irradiance LOD level, be it the last LOD level\n\t\t\t// of a specular cubemap, or just the default level of a specially created irradiance cubemap.\n\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\n\t\t\t#else\n\n\t\t\t\t// force the bias high to get the last LOD level as it is the most blurred.\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\n\t\t\t#endif\n\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\n\t\t#else\n\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\n\t\t#endif\n\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\n\t}\n\n\t// Trowbridge-Reitz distribution to Mip level, following the logic of http://casual-effects.blogspot.ca/2011/08/plausible-environment-lighting-in-two.html\n\tfloat getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) {\n\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\n\t\tfloat sigma = PI * roughness * roughness / ( 1.0 + roughness );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + log2( sigma );\n\n\t\t// clamp to allowable LOD ranges.\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\n\t}\n\n\tvec3 getLightProbeIndirectRadiance( /*const in SpecularLightProbe specularLightProbe,*/ const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) {\n\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\n\t\t vec3 reflectVec = reflect( -viewDir, normal );\n\n\t\t // Mixing the reflection with the normal is more accurate and keeps rough objects from gathering light from behind their tangent plane.\n\t\t reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\n\t\t#else\n\n\t\t vec3 reflectVec = refract( -viewDir, normal, refractionRatio );\n\n\t\t#endif\n\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel );\n\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\n\t\t\t#else\n\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\n\t\t\t#endif\n\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\n\t\t\t#else\n\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\n\t\t\t#endif\n\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\n\t\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\n\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\n\t\t\t#else\n\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\n\t\t\t#endif\n\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\n\t\t#endif\n\n\t\treturn envMapColor.rgb * envMapIntensity;\n\n\t}\n\n#endif\n",envmap_vertex:"\n#ifdef USE_ENVMAP\n\n\t#ifdef ENV_WORLDPOS\n\n\t\tvWorldPosition = worldPosition.xyz;\n\n\t#else\n\n\t\tvec3 cameraToVertex;\n\n\t\tif ( isOrthographic ) { \n\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\n\t\t} else {\n\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\n\t\t}\n\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\n\t\t#else\n\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\n\t\t#endif\n\n\t#endif\n\n#endif\n",fog_vertex:"\n#ifdef USE_FOG\n\n\tfogDepth = -mvPosition.z;\n\n#endif\n",fog_pars_vertex:"\n#ifdef USE_FOG\n\n\tvarying float fogDepth;\n\n#endif\n",fog_fragment:"\n#ifdef USE_FOG\n\n\t#ifdef FOG_EXP2\n\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth );\n\n\t#else\n\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\n\t#endif\n\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n\n#endif\n",fog_pars_fragment:"\n#ifdef USE_FOG\n\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\n\t#ifdef FOG_EXP2\n\n\t\tuniform float fogDensity;\n\n\t#else\n\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\n\t#endif\n\n#endif\n",gradientmap_pars_fragment:"\n\n#ifdef USE_GRADIENTMAP\n\n\tuniform sampler2D gradientMap;\n\n#endif\n\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\n\t// dotNL will be from -1.0 to 1.0\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\n\t#ifdef USE_GRADIENTMAP\n\n\t\treturn texture2D( gradientMap, coord ).rgb;\n\n\t#else\n\n\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\n\t#endif\n\n}\n\n",lightmap_fragment:"\n#ifdef USE_LIGHTMAP\n\n\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\treflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; // factor of PI should not be present; included here to prevent breakage\n\n#endif\n",lightmap_pars_fragment:"\n#ifdef USE_LIGHTMAP\n\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n\n#endif\n",lights_lambert_vertex:"\nvec3 diffuse = vec3( 1.0 );\n\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\n\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\n\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\n\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n\n#if NUM_POINT_LIGHTS > 0\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\n\t\t#endif\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if NUM_SPOT_LIGHTS > 0\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n/*\n#if NUM_RECT_AREA_LIGHTS > 0\n\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\n\t\t// TODO (abelnation): implement\n\n\t}\n\n#endif\n*/\n\n#if NUM_DIR_LIGHTS > 0\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\n\t\t#endif\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if NUM_HEMI_LIGHTS > 0\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\n\t\t#endif\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n",lights_pars_begin:"\nuniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\n\n// get the irradiance (radiance convolved with cosine lobe) at the point 'normal' on the unit sphere\n// source: https://graphics.stanford.edu/papers/envmap/envmap.pdf\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\n\t// normal is assumed to have unit length\n\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\n\t// band 0\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\n\t// band 1\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\n\t// band 2\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\n\treturn result;\n\n}\n\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) {\n\n\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\n\treturn irradiance;\n\n}\n\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\n\tvec3 irradiance = ambientLightColor;\n\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\n\t\tirradiance *= PI;\n\n\t#endif\n\n\treturn irradiance;\n\n}\n\n#if NUM_DIR_LIGHTS > 0\n\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\n\t#endif\n\n\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\n\t}\n\n#endif\n\n\n#if NUM_POINT_LIGHTS > 0\n\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t// directLight is an out parameter as having it as a return value caused compiler errors on some devices\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\n\t\tfloat lightDistance = length( lVector );\n\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\n\t}\n\n#endif\n\n\n#if NUM_SPOT_LIGHTS > 0\n\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t// directLight is an out parameter as having it as a return value caused compiler errors on some devices\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\n\t\tif ( angleCos > spotLight.coneCos ) {\n\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\n\t\t} else {\n\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\n\t\t}\n\t}\n\n#endif\n\n\n#if NUM_RECT_AREA_LIGHTS > 0\n\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\n\t// Pre-computed values of LinearTransformedCosine approximation of BRDF\n\t// BRDF approximation Texture is 64x64\n\tuniform sampler2D ltc_1; // RGBA Float\n\tuniform sampler2D ltc_2; // RGBA Float\n\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n\n#endif\n\n\n#if NUM_HEMI_LIGHTS > 0\n\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\n\t\t\tirradiance *= PI;\n\n\t\t#endif\n\n\t\treturn irradiance;\n\n\t}\n\n#endif\n",lights_toon_fragment:"\nToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",lights_toon_pars_fragment:"\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n#endif\n\n\nstruct ToonMaterial {\n\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n\n};\n\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\n\t\tirradiance *= PI; // punctual light\n\n\t#endif\n\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n\n}\n\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\n}\n\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n\n#define Material_LightProbeLOD( material )\t(0)\n",lights_phong_fragment:"\nBlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",lights_phong_pars_fragment:"\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n#endif\n\n\nstruct BlinnPhongMaterial {\n\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n\n};\n\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\n\t\tirradiance *= PI; // punctual light\n\n\t#endif\n\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n\n}\n\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\n}\n\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n\n#define Material_LightProbeLOD( material )\t(0)\n",lights_physical_fragment:"\nPhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\n\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\n\nmaterial.specularRoughness = max( roughnessFactor, 0.0525 );// 0.0525 corresponds to the base mip of a 256 cubemap.\nmaterial.specularRoughness += geometryRoughness;\nmaterial.specularRoughness = min( material.specularRoughness, 1.0 );\n\n#ifdef REFLECTIVITY\n\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n\n#else\n\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n\n#endif\n\n#ifdef CLEARCOAT\n\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\n\t#ifdef USE_CLEARCOATMAP\n\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\n\t#endif\n\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\n\t#endif\n\n\tmaterial.clearcoat = saturate( material.clearcoat ); // Burley clearcoat model\n\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n\n#endif\n\n#ifdef USE_SHEEN\n\n\tmaterial.sheenColor = sheen;\n\n#endif\n",lights_physical_pars_fragment:"\nstruct PhysicalMaterial {\n\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n\n#ifdef CLEARCOAT\n\tfloat clearcoat;\n\tfloat clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tvec3 sheenColor;\n#endif\n\n};\n\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\n\n// Clear coat directional hemishperical reflectance (this approximation should be improved)\nfloat clearcoatDHRApprox( const in float roughness, const in float dotNL ) {\n\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n\n}\n\n#if NUM_RECT_AREA_LIGHTS > 0\n\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight; // counterclockwise; light shines in local neg z direction\n\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\n\t\t// LTC Fresnel Approximation by Stephen Hill\n\t\t// http://blog.selfshadow.com/publications/s2016-advances/s2016_ltc_fresnel.pdf\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\n\t}\n\n#endif\n\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\n\tvec3 irradiance = dotNL * directLight.color;\n\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\n\t\tirradiance *= PI; // punctual light\n\n\t#endif\n\n\t#ifdef CLEARCOAT\n\n\t\tfloat ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\n\t\tvec3 ccIrradiance = ccDotNL * directLight.color;\n\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\n\t\t\tccIrradiance *= PI; // punctual light\n\n\t\t#endif\n\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\n\t\treflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\n\t#else\n\n\t\tfloat clearcoatDHR = 0.0;\n\n\t#endif\n\n\t#ifdef USE_SHEEN\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen(\n\t\t\tmaterial.specularRoughness,\n\t\t\tdirectLight.direction,\n\t\t\tgeometry,\n\t\t\tmaterial.sheenColor\n\t\t);\n\t#else\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularRoughness);\n\t#endif\n\n\treflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\n}\n\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\n\t#ifdef CLEARCOAT\n\n\t\tfloat ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\n\t\treflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\n\t\tfloat ccDotNL = ccDotNV;\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\n\t#else\n\n\t\tfloat clearcoatDHR = 0.0;\n\n\t#endif\n\n\tfloat clearcoatInv = 1.0 - clearcoatDHR;\n\n\t// Both indirect specular and indirect diffuse light accumulate here\n\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\n\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\n\treflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n\n}\n\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\n\n// ref: https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n\n}\n",lights_fragment_begin:"\n/**\n * This is a template that can be used to light a material, it uses pluggable\n * RenderEquations (RE)for specific lighting scenarios.\n *\n * Instructions for use:\n * - Ensure that both RE_Direct, RE_IndirectDiffuse and RE_IndirectSpecular are defined\n * - If you have defined an RE_IndirectSpecular, you need to also provide a Material_LightProbeLOD. <---- ???\n * - Create a material parameter that is to be passed as the third parameter to your lighting functions.\n *\n * TODO:\n * - Add area light support.\n * - Add sphere light support.\n * - Add diffuse light probe (irradiance cubemap) support.\n */\n\nGeometricContext geometry;\n\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n\n#ifdef CLEARCOAT\n\n\tgeometry.clearcoatNormal = clearcoatNormal;\n\n#endif\n\nIncidentLight directLight;\n\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\n\t\tpointLight = pointLights[ i ];\n\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\n\t\tspotLight = spotLights[ i ];\n\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\n\t\tdirectionalLight = directionalLights[ i ];\n\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\n\tRectAreaLight rectAreaLight;\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if defined( RE_IndirectDiffuse )\n\n\tvec3 iblIrradiance = vec3( 0.0 );\n\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry );\n\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\n\t\t}\n\t\t#pragma unroll_loop_end\n\n\t#endif\n\n#endif\n\n#if defined( RE_IndirectSpecular )\n\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n\n#endif\n",lights_fragment_maps:"\n#if defined( RE_IndirectDiffuse )\n\n\t#ifdef USE_LIGHTMAP\n\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\n\t\t\tlightMapIrradiance *= PI; // factor of PI should not be present; included here to prevent breakage\n\n\t\t#endif\n\n\t\tirradiance += lightMapIrradiance;\n\n\t#endif\n\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\n\t\tiblIrradiance += getLightProbeIndirectIrradiance( /*lightProbe,*/ geometry, maxMipLevel );\n\n\t#endif\n\n#endif\n\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\n\tradiance += getLightProbeIndirectRadiance( /*specularLightProbe,*/ geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel );\n\n\t#ifdef CLEARCOAT\n\n\t\tclearcoatRadiance += getLightProbeIndirectRadiance( /*specularLightProbe,*/ geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel );\n\n\t#endif\n\n#endif\n",lights_fragment_end:"\n#if defined( RE_IndirectDiffuse )\n\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n\n#endif\n\n#if defined( RE_IndirectSpecular )\n\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n\n#endif\n",logdepthbuf_fragment:"\n#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\n\t// Doing a strict comparison with == 1.0 can cause noise artifacts\n\t// on some platforms. See issue #17623.\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n\n#endif\n",logdepthbuf_pars_fragment:"\n#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n\n#endif\n",logdepthbuf_pars_vertex:"\n#ifdef USE_LOGDEPTHBUF\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\n\t#else\n\n\t\tuniform float logDepthBufFC;\n\n\t#endif\n\n#endif\n",logdepthbuf_vertex:"\n#ifdef USE_LOGDEPTHBUF\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\n\t#else\n\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\n\t\t\tgl_Position.z *= gl_Position.w;\n\n\t\t}\n\n\t#endif\n\n#endif\n",map_fragment:"\n#ifdef USE_MAP\n\n\tvec4 texelColor = texture2D( map, vUv );\n\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n\n#endif\n",map_fragment_1:"\n#ifdef USE_MAP\n\n\tvec4 texelColor = texture2D( map, vUv );\n\n\ttexelColor = mapTexelToLinear( texelColor );\n\t\n\tif(mapMixColor){\n\t diffuseColor = texelColor*texelColor.a + diffuseColor*(1.0-texelColor.a);\n\t}else {\n\t diffuseColor *= texelColor;\n\t}\n\n#endif\n",map_pars_fragment:"\n#ifdef USE_MAP\n\n\tuniform sampler2D map;\n\n#endif\n",map_particle_fragment:"\n#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\n#endif\n\n#ifdef USE_MAP\n\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n\n#endif\n\n#ifdef USE_ALPHAMAP\n\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n\n#endif\n",map_particle_pars_fragment:"\n#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\n\tuniform mat3 uvTransform;\n\n#endif\n\n#ifdef USE_MAP\n\n\tuniform sampler2D map;\n\n#endif\n\n#ifdef USE_ALPHAMAP\n\n\tuniform sampler2D alphaMap;\n\n#endif\n",metalnessmap_fragment:"\nfloat metalnessFactor = metalness;\n\n#ifdef USE_METALNESSMAP\n\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\n\t// reads channel B, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\n\tmetalnessFactor *= texelMetalness.b;\n\n#endif\n",metalnessmap_pars_fragment:"\n#ifdef USE_METALNESSMAP\n\n\tuniform sampler2D metalnessMap;\n\n#endif\n",morphnormal_vertex:"\n#ifdef USE_MORPHNORMALS\n\n\t// morphTargetBaseInfluence is set based on BufferGeometry.morphTargetsRelative value:\n\t// When morphTargetsRelative is false, this is set to 1 - sum(influences); this results in normal = sum((target - base) * influence)\n\t// When morphTargetsRelative is true, this is set to 1; as a result, all morph targets are simply added to the base after weighting\n\tobjectNormal *= morphTargetBaseInfluence;\n\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n\n#endif\n",morphtarget_pars_vertex:"\n#ifdef USE_MORPHTARGETS\n\n\tuniform float morphTargetBaseInfluence;\n\n\t#ifndef USE_MORPHNORMALS\n\n\tuniform float morphTargetInfluences[ 8 ];\n\n\t#else\n\n\tuniform float morphTargetInfluences[ 4 ];\n\n\t#endif\n\n#endif\n",morphtarget_vertex:"\n#ifdef USE_MORPHTARGETS\n\n\t// morphTargetBaseInfluence is set based on BufferGeometry.morphTargetsRelative value:\n\t// When morphTargetsRelative is false, this is set to 1 - sum(influences); this results in position = sum((target - base) * influence)\n\t// When morphTargetsRelative is true, this is set to 1; as a result, all morph targets are simply added to the base after weighting\n\ttransformed *= morphTargetBaseInfluence;\n\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\n\t#ifndef USE_MORPHNORMALS\n\n\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\n\t#endif\n\n#endif\n",normal_fragment_begin:"\n#ifdef FLAT_SHADED\n\n\t// Workaround for Adreno/Nexus5 not able able to do dFdx( vViewPosition ) ...\n\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n\n#else\n\n\tvec3 normal = normalize( vNormal );\n\n\t#ifdef DOUBLE_SIDED\n\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\n\t#endif\n\n\t#ifdef USE_TANGENT\n\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\ttangent = tangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\tbitangent = bitangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\n\t\t#endif\n\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\n\t\t#endif\n\n\t#endif\n\n#endif\n\n// non perturbed normal for clearcoat among others\n\nvec3 geometryNormal = normal;\n\n",normal_fragment_maps:"\n\n#ifdef OBJECTSPACE_NORMALMAP\n\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; // overrides both flatShading and attribute normals\n\n\t#ifdef FLIP_SIDED\n\n\t\tnormal = - normal;\n\n\t#endif\n\n\t#ifdef DOUBLE_SIDED\n\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\n\t#endif\n\n\tnormal = normalize( normalMatrix * normal );\n\n#elif defined( TANGENTSPACE_NORMALMAP )\n\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\n\t#ifdef USE_TANGENT\n\n\t\tnormal = normalize( vTBN * mapN );\n\n\t#else\n\n\t\tnormal = perturbNormal2Arb( -vViewPosition, normal, mapN );\n\n\t#endif\n\n#elif defined( USE_BUMPMAP )\n\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n\n#endif\n",normalmap_pars_fragment:"\n#ifdef USE_NORMALMAP\n\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\n#endif\n\n#ifdef OBJECTSPACE_NORMALMAP\n\n\tuniform mat3 normalMatrix;\n\n#endif\n\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\n\t// Per-Pixel Tangent Space Normal Mapping\n\t// http://hacksoflife.blogspot.ch/2009/11/per-pixel-tangent-space-normal-mapping.html\n\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN ) {\n\n\t\t// Workaround for Adreno 3XX dFd*( vec3 ) bug. See #9988\n\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\n\t\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s ); // we do not care about the magnitude\n\n\t\tvec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n\t\tvec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n\t\tvec3 N = normalize( surf_norm );\n\n\t\tmat3 tsn = mat3( S, T, N );\n\n\t\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\n\t\treturn normalize( tsn * mapN );\n\n\t}\n\n#endif\n",clearcoat_normal_fragment_begin:"\n#ifdef CLEARCOAT\n\n\tvec3 clearcoatNormal = geometryNormal;\n\n#endif\n",clearcoat_normal_fragment_maps:"\n#ifdef USE_CLEARCOAT_NORMALMAP\n\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\n\t#ifdef USE_TANGENT\n\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\n\t#else\n\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN );\n\n\t#endif\n\n#endif\n",clearcoat_pars_fragment:"\n\n#ifdef USE_CLEARCOATMAP\n\n\tuniform sampler2D clearcoatMap;\n\n#endif\n\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\n\tuniform sampler2D clearcoatRoughnessMap;\n\n#endif\n\n#ifdef USE_CLEARCOAT_NORMALMAP\n\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n\n#endif\n",packing:"\nvec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\n\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\n\nconst float PackUpscale = 256. / 255.; // fraction -> 0..1 (including 1)\nconst float UnpackDownscale = 255. / 256.; // 0..1 -> fraction (excluding 1)\n\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\n\nconst float ShiftRight8 = 1. / 256.;\n\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8; // tidy overflow\n\treturn r * PackUpscale;\n}\n\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\n\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ));\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w);\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\n\n// NOTE: viewZ/eyeZ is < 0 when in front of the camera per OpenGL conventions\n\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\n\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}\n",premultiplied_alpha_fragment:"\n#ifdef PREMULTIPLIED_ALPHA\n\n\t// Get get normal blending with premultipled, use with CustomBlending, OneFactor, OneMinusSrcAlphaFactor, AddEquation.\n\tgl_FragColor.rgb *= gl_FragColor.a;\n\n#endif\n",project_vertex:"\nvec4 mvPosition = vec4( transformed, 1.0 );\n\n#ifdef USE_INSTANCING\n\n\tmvPosition = instanceMatrix * mvPosition;\n\n#endif\n\nmvPosition = modelViewMatrix * mvPosition;\n\ngl_Position = projectionMatrix * mvPosition;\n",dithering_fragment:"\n#ifdef DITHERING\n\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n\n#endif\n",dithering_pars_fragment:"\n#ifdef DITHERING\n\n\t// based on https://www.shadertoy.com/view/MslGR8\n\tvec3 dithering( vec3 color ) {\n\t\t//Calculate grid position\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\n\t\t//Shift the individual colors differently, thus making it even harder to see the dithering pattern\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\n\t\t//modify shift acording to grid position.\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\n\t\t//shift the color by dither_shift\n\t\treturn color + dither_shift_RGB;\n\t}\n\n#endif\n",roughnessmap_fragment:"\nfloat roughnessFactor = roughness;\n\n#ifdef USE_ROUGHNESSMAP\n\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\n\t// reads channel G, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\n\troughnessFactor *= texelRoughness.g;\n\n#endif\n",roughnessmap_pars_fragment:"\n#ifdef USE_ROUGHNESSMAP\n\n\tuniform sampler2D roughnessMap;\n\n#endif\n",shadowmap_pars_fragment:"\n#ifdef USE_SHADOWMAP\n\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t/*\n\t#if NUM_RECT_AREA_LIGHTS > 0\n\n\t\t// TODO (abelnation): create uniforms for area light shadows\n\n\t#endif\n\t*/\n\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\n\t}\n\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\n\t}\n\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\n\t\tfloat occlusion = 1.0;\n\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\n\t\tfloat hard_shadow = step( compare , distribution.x ); // Hard Shadow\n\n\t\tif (hard_shadow != 1.0 ) {\n\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance ); // Chebeyshevs inequality\n\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); // 0.3 reduces light bleed\n\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\n\t\t}\n\t\treturn occlusion;\n\n\t}\n\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\n\t\tfloat shadow = 1.0;\n\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\n\t\t// if ( something && something ) breaks ATI OpenGL shader compiler\n\t\t// if ( all( something, something ) ) using this instead\n\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\n\t\tbool frustumTest = all( frustumTestVec );\n\n\t\tif ( frustumTest ) {\n\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\n\t\t#else // no percentage-closer filtering:\n\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\n\t\t#endif\n\n\t\t}\n\n\t\treturn shadow;\n\n\t}\n\n\t// cubeToUV() maps a 3D direction vector suitable for cube texture mapping to a 2D\n\t// vector suitable for 2D texture mapping. This code uses the following layout for the\n\t// 2D texture:\n\t//\n\t// xzXZ\n\t// y Y\n\t//\n\t// Y - Positive y direction\n\t// y - Negative y direction\n\t// X - Positive x direction\n\t// x - Negative x direction\n\t// Z - Positive z direction\n\t// z - Negative z direction\n\t//\n\t// Source and test bed:\n\t// https://gist.github.com/tschw/da10c43c467ce8afd0c4\n\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\n\t\t// Number of texels to avoid at the edge of each square\n\n\t\tvec3 absV = abs( v );\n\n\t\t// Intersect unit cube\n\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\n\t\t// Apply scale to avoid seams\n\n\t\t// two texels less per square (one texel will do for NEAREST)\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\n\t\t// Unwrap\n\n\t\t// space: -1 ... 1 range for each square\n\t\t//\n\t\t// #X##\t\tdim := ( 4 , 2 )\n\t\t// # #\t\tcenter := ( 1 , 1 )\n\n\t\tvec2 planar = v.xy;\n\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\n\t\tif ( absV.z >= almostOne ) {\n\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\n\t\t} else if ( absV.x >= almostOne ) {\n\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\n\t\t} else if ( absV.y >= almostOne ) {\n\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\n\t\t}\n\n\t\t// Transform to UV space\n\n\t\t// scale := 0.5 / dim\n\t\t// translate := ( center + 0.5 ) / dim\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\n\t}\n\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\n\t\t// for point lights, the uniform @vShadowCoord is re-purposed to hold\n\t\t// the vector from the light to the world-space position of the fragment.\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\n\t\t// dp = normalized distance from light to fragment position\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); // need to clamp?\n\t\tdp += shadowBias;\n\n\t\t// bd3D = base direction 3D\n\t\tvec3 bd3D = normalize( lightToPosition );\n\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\n\t\t#else // no percentage-closer filtering\n\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\n\t\t#endif\n\n\t}\n\n#endif\n",shadowmap_pars_vertex:"\n#ifdef USE_SHADOWMAP\n\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t/*\n\t#if NUM_RECT_AREA_LIGHTS > 0\n\n\t\t// TODO (abelnation): uniforms for area light shadows\n\n\t#endif\n\t*/\n\n#endif\n",shadowmap_vertex:"\n#ifdef USE_SHADOWMAP\n\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\n\t}\n\t#pragma unroll_loop_end\n\n\t#endif\n\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\n\t}\n\t#pragma unroll_loop_end\n\n\t#endif\n\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\n\t}\n\t#pragma unroll_loop_end\n\n\t#endif\n\n\t/*\n\t#if NUM_RECT_AREA_LIGHTS > 0\n\n\t\t// TODO (abelnation): update vAreaShadowCoord with area light info\n\n\t#endif\n\t*/\n\n#endif\n",shadowmask_pars_fragment:"\nfloat getShadowMask() {\n\n\tfloat shadow = 1.0;\n\n\t#ifdef USE_SHADOWMAP\n\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\n\tDirectionalLightShadow directionalLight;\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\n\t}\n\t#pragma unroll_loop_end\n\n\t#endif\n\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\n\tSpotLightShadow spotLight;\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\n\t}\n\t#pragma unroll_loop_end\n\n\t#endif\n\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\n\tPointLightShadow pointLight;\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\n\t}\n\t#pragma unroll_loop_end\n\n\t#endif\n\n\t/*\n\t#if NUM_RECT_AREA_LIGHTS > 0\n\n\t\t// TODO (abelnation): update shadow for Area light\n\n\t#endif\n\t*/\n\n\t#endif\n\n\treturn shadow;\n\n}\n",skinbase_vertex:"\n#ifdef USE_SKINNING\n\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n\n#endif\n",skinning_pars_vertex:"\n#ifdef USE_SKINNING\n\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\n\t#ifdef BONE_TEXTURE\n\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\n\t\tmat4 getBoneMatrix( const in float i ) {\n\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\n\t\t\ty = dy * ( y + 0.5 );\n\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\n\t\t\treturn bone;\n\n\t\t}\n\n\t#else\n\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\n\t\tmat4 getBoneMatrix( const in float i ) {\n\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\n\t\t}\n\n\t#endif\n\n#endif\n",skinning_vertex:"\n#ifdef USE_SKINNING\n\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n\n#endif\n",skinnormal_vertex:"\n#ifdef USE_SKINNING\n\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\n\t#ifdef USE_TANGENT\n\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\n\t#endif\n\n#endif\n",specularmap_fragment:"\nfloat specularStrength;\n\n#ifdef USE_SPECULARMAP\n\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n\n#else\n\n\tspecularStrength = 1.0;\n\n#endif\n",specularmap_pars_fragment:"\n#ifdef USE_SPECULARMAP\n\n\tuniform sampler2D specularMap;\n\n#endif\n",tonemapping_fragment:"\n#if defined( TONE_MAPPING )\n\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n\n#endif\n",tonemapping_pars_fragment:"\n#ifndef saturate\n// <common> may have defined saturate() already\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\n\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\n\n// exposure only\nvec3 LinearToneMapping( vec3 color ) {\n\n\treturn toneMappingExposure * color;\n\n}\n\n// source: https://www.cs.utah.edu/~reinhard/cdrom/\nvec3 ReinhardToneMapping( vec3 color ) {\n\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n\n}\n\n// source: http://filmicgames.com/archives/75\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n\n\t// John Hable's filmic operator from Uncharted 2 video game\n\tcolor *= toneMappingExposure;\n\treturn saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n\n}\n\n// source: http://filmicgames.com/archives/75\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\n\t// optimized filmic operator by Jim Hejl and Richard Burgess-Dawson\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n\n}\n\n// source: https://knarkowicz.wordpress.com/2016/01/06/aces-filmic-tone-mapping-curve/\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\n\tcolor *= toneMappingExposure;\n\treturn saturate( ( color * ( 2.51 * color + 0.03 ) ) / ( color * ( 2.43 * color + 0.59 ) + 0.14 ) );\n\n}\n",uv_pars_fragment:"\n#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\n\tvarying vec2 vUv;\n\n#endif\n",uv_pars_vertex:"\n#ifdef USE_UV\n\n\t#ifdef UVS_VERTEX_ONLY\n\n\t\tvec2 vUv;\n\n\t#else\n\n\t\tvarying vec2 vUv;\n\n\t#endif\n\n\tuniform mat3 uvTransform;\n\n#endif\n",uv_vertex:"\n#ifdef USE_UV\n\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\n#endif\n",uv2_pars_fragment:"\n#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\n\tvarying vec2 vUv2;\n\n#endif\n",uv2_pars_vertex:"\n#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\n\tuniform mat3 uv2Transform;\n\n#endif\n",uv2_vertex:"\n#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n\n#endif\n",worldpos_vertex:"\n#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\n\t#ifdef USE_INSTANCING\n\n\t\tworldPosition = instanceMatrix * worldPosition;\n\n\t#endif\n\n\tworldPosition = modelMatrix * worldPosition;\n\n#endif\n",background_frag:"\nuniform sampler2D t2D;\n\nvarying vec2 vUv;\n\nvoid main() {\n\n\tvec4 texColor = texture2D( t2D, vUv );\n\n\tgl_FragColor = mapTexelToLinear( texColor );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\n}\n",background_vert:"\nvarying vec2 vUv;\nuniform mat3 uvTransform;\n\nvoid main() {\n\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n\n}\n",cube_frag:"\n\n#include <envmap_common_pars_fragment>\nuniform float opacity;\n\nvarying vec3 vWorldDirection;\n\n#include <cube_uv_reflection_fragment>\n\nvoid main() {\n\n\tvec3 vReflect = vWorldDirection;\n\t#include <envmap_fragment>\n\n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\n}\n",cube_vert:"\nvarying vec3 vWorldDirection;\n\n#include <common>\n\nvoid main() {\n\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\n\tgl_Position.z = gl_Position.w; // set z to camera.far\n\n}\n",depth_frag:"\n#if DEPTH_PACKING == 3200\n\n\tuniform float opacity;\n\n#endif\n\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvarying vec2 vHighPrecisionZW;\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( 1.0 );\n\n\t#if DEPTH_PACKING == 3200\n\n\t\tdiffuseColor.a = opacity;\n\n\t#endif\n\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\n\t#include <logdepthbuf_fragment>\n\n\t// Higher precision equivalent of gl_FragCoord.z. This assumes depthRange has been left to its default values.\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\n\t#if DEPTH_PACKING == 3200\n\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\n\t#elif DEPTH_PACKING == 3201\n\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\n\t#endif\n\n}\n",depth_vert:"\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\n// This is used for computing an equivalent of gl_FragCoord.z that is as high precision as possible.\n// Some platforms compute gl_FragCoord at a lower precision which makes the manually computed value better for\n// depth-based postprocessing effects. Reproduced on iPad with A10 processor / iPadOS 13.3.1.\nvarying vec2 vHighPrecisionZW;\n\nvoid main() {\n\n\t#include <uv_vertex>\n\n\t#include <skinbase_vertex>\n\n\t#ifdef USE_DISPLACEMENTMAP\n\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\n\t#endif\n\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\n\tvHighPrecisionZW = gl_Position.zw;\n\n}\n",distanceRGBA_frag:"\n#define DISTANCE\n\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main () {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( 1.0 );\n\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist ); // clamp to [ 0, 1 ]\n\n\tgl_FragColor = packDepthToRGBA( dist );\n\n}\n",distanceRGBA_vert:"\n#define DISTANCE\n\nvarying vec3 vWorldPosition;\n\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\n\t#include <skinbase_vertex>\n\n\t#ifdef USE_DISPLACEMENTMAP\n\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\n\t#endif\n\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\n\tvWorldPosition = worldPosition.xyz;\n\n}\n",equirect_frag:"\nuniform sampler2D tEquirect;\n\nvarying vec3 vWorldDirection;\n\n#include <common>\n\nvoid main() {\n\n\tvec3 direction = normalize( vWorldDirection );\n\n\tvec2 sampleUV;\n\n\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\n\tgl_FragColor = mapTexelToLinear( texColor );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\n}\n",equirect_vert:"\nvarying vec3 vWorldDirection;\n\n#include <common>\n\nvoid main() {\n\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\n}\n",linedashed_frag:"\nuniform vec3 diffuse;\nuniform float opacity;\n\nuniform float dashSize;\nuniform float totalSize;\n\nvarying float vLineDistance;\n\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\n\t\tdiscard;\n\n\t}\n\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\n\toutgoingLight = diffuseColor.rgb; // simple shader\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\n}\n",linedashed_vert:"\nuniform float scale;\nattribute float lineDistance;\n\nvarying float vLineDistance;\n\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\tvLineDistance = scale * lineDistance;\n\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\n}\n",meshbasic_frag:"\nuniform vec3 diffuse;\nuniform float opacity;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n#endif\n\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\n\t// accumulation (baked indirect lighting only)\n\t#ifdef USE_LIGHTMAP\n\t\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\n\t#else\n\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\n\t#endif\n\n\t// modulation\n\t#include <aomap_fragment>\n\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\n\t#include <envmap_fragment>\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\n}\n",meshbasic_vert:"\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <skinbase_vertex>\n\n\t#ifdef USE_ENVMAP\n\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\n\t#endif\n\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n\n}\n",meshlambert_frag:"\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n\n\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\n\t// accumulation\n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\n\t#ifdef DOUBLE_SIDED\n\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\n\t#else\n\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\n\t#endif\n\n\t#include <lightmap_fragment>\n\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\n\t#ifdef DOUBLE_SIDED\n\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\n\t#else\n\n\t\treflectedLight.directDiffuse = vLightFront;\n\n\t#endif\n\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\n\t// modulation\n\t#include <aomap_fragment>\n\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\n\t#include <envmap_fragment>\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}\n",meshlambert_vert:"\n#define LAMBERT\n\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}\n",meshmatcap_frag:"\n#define MATCAP\n\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\n\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n#endif\n\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n\n#include <fog_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; // 0.495 to remove artifacts caused by undersized matcap disks\n\n\t#ifdef USE_MATCAP\n\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\n\t#else\n\n\t\tvec4 matcapColor = vec4( 1.0 );\n\n\t#endif\n\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\n}\n",meshmatcap_vert:"\n#define MATCAP\n\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n#endif\n\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\n\t#ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED\n\n\t\tvNormal = normalize( transformedNormal );\n\n\t#endif\n\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\n\tvViewPosition = - mvPosition.xyz;\n\n}\n",meshtoon_frag:"\n#define TOON\n\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\n\t// accumulation\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\n\t// modulation\n\t#include <aomap_fragment>\n\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n\n}\n",meshtoon_vert:"\n#define TOON\n\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n#endif\n\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\n#ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED\n\n\tvNormal = normalize( transformedNormal );\n\n#endif\n\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\n\tvViewPosition = - mvPosition.xyz;\n\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n\n}\n",meshphong_frag:"\n#define PHONG\n\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\n\t// accumulation\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\n\t// modulation\n\t#include <aomap_fragment>\n\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\n\t#include <envmap_fragment>\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n\n}\n",meshphong_vert:"\n#define PHONG\n\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n#endif\n\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\n#ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED\n\n\tvNormal = normalize( transformedNormal );\n\n#endif\n\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\n\tvViewPosition = - mvPosition.xyz;\n\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n\n}\n",meshphysical_frag:"\n#define STANDARD\n\n#ifdef PHYSICAL\n\t#define REFLECTIVITY\n\t#define CLEARCOAT\n\t#define TRANSPARENCY\n#endif\n\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n\n#ifdef TRANSPARENCY\n\tuniform float transparency;\n#endif\n\n#ifdef REFLECTIVITY\n\tuniform float reflectivity;\n#endif\n\n#ifdef CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n\n#ifdef USE_SHEEN\n\tuniform vec3 sheen;\n#endif\n\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n\t#ifdef USE_TANGENT\n\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\n\t#endif\n\n#endif\n\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <lights_physical_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\n\t// accumulation\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\n\t// modulation\n\t#include <aomap_fragment>\n\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\n\t// this is a stub for the transparency model\n\t#ifdef TRANSPARENCY\n\t\tdiffuseColor.a *= saturate( 1. - transparency + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular ) );\n\t#endif\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n\n}\n",meshphysical_vert:"\n#define STANDARD\n\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n\t#ifdef USE_TANGENT\n\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\n\t#endif\n\n#endif\n\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\n#ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED\n\n\tvNormal = normalize( transformedNormal );\n\n\t#ifdef USE_TANGENT\n\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\n\t#endif\n\n#endif\n\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\n\tvViewPosition = - mvPosition.xyz;\n\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n\n}\n",normal_frag:"\n#define NORMAL\n\nuniform float opacity;\n\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\n\tvarying vec3 vViewPosition;\n\n#endif\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n\t#ifdef USE_TANGENT\n\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\n\t#endif\n\n#endif\n\n#include <packing>\n#include <uv_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n\n}\n",normal_vert:"\n#define NORMAL\n\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\n\tvarying vec3 vViewPosition;\n\n#endif\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n\t#ifdef USE_TANGENT\n\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\n\t#endif\n\n#endif\n\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\n#ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED\n\n\tvNormal = normalize( transformedNormal );\n\n\t#ifdef USE_TANGENT\n\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\n\t#endif\n\n#endif\n\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\n\tvViewPosition = - mvPosition.xyz;\n\n#endif\n\n}\n",points_frag:"\nuniform vec3 diffuse;\nuniform float opacity;\n\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\n\toutgoingLight = diffuseColor.rgb;\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\n}\n",points_vert:"\nuniform float size;\nuniform float scale;\n\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\n\tgl_PointSize = size;\n\n\t#ifdef USE_SIZEATTENUATION\n\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\n\t#endif\n\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n\n}\n",shadow_frag:"\nuniform vec3 color;\nuniform float opacity;\n\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n\nvoid main() {\n\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\n}\n",shadow_vert:"\n#include <fog_pars_vertex>\n#include <shadowmap_pars_vertex>\n\nvoid main() {\n\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n\n}\n",sprite_frag:"\nuniform vec3 diffuse;\nuniform float opacity;\n\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\n\toutgoingLight = diffuseColor.rgb;\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\n}\n",sprite_vert:"\nuniform float rotation;\nuniform vec2 center;\n\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\n\t#ifndef USE_SIZEATTENUATION\n\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\n\t#endif\n\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\n\tmvPosition.xy += rotatedPosition;\n\n\tgl_Position = projectionMatrix * mvPosition;\n\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\n}\n"},eu={basic:{uniforms:ga([Lt.common,Lt.specularmap,Lt.envmap,Lt.aomap,Lt.lightmap,Lt.fog]),vertexShader:w.meshbasic_vert,fragmentShader:w.meshbasic_frag},lambert:{uniforms:ga([Lt.common,Lt.specularmap,Lt.envmap,Lt.aomap,Lt.lightmap,Lt.emissivemap,Lt.fog,Lt.lights,{emissive:{value:new lt(0)}}]),vertexShader:w.meshlambert_vert,fragmentShader:w.meshlambert_frag},phong:{uniforms:ga([Lt.common,Lt.specularmap,Lt.envmap,Lt.aomap,Lt.lightmap,Lt.emissivemap,Lt.bumpmap,Lt.normalmap,Lt.displacementmap,Lt.fog,Lt.lights,{emissive:{value:new lt(0)},specular:{value:new lt(1118481)},shininess:{value:30}}]),vertexShader:w.meshphong_vert,fragmentShader:w.meshphong_frag},standard:{uniforms:ga([Lt.common,Lt.envmap,Lt.aomap,Lt.lightmap,Lt.emissivemap,Lt.bumpmap,Lt.normalmap,Lt.displacementmap,Lt.roughnessmap,Lt.metalnessmap,Lt.fog,Lt.lights,{emissive:{value:new lt(0)},roughness:{value:.5},metalness:{value:.5},envMapIntensity:{value:1}}]),vertexShader:w.meshphysical_vert,fragmentShader:w.meshphysical_frag},toon:{uniforms:ga([Lt.common,Lt.specularmap,Lt.aomap,Lt.lightmap,Lt.emissivemap,Lt.bumpmap,Lt.normalmap,Lt.displacementmap,Lt.gradientmap,Lt.fog,Lt.lights,{emissive:{value:new lt(0)},specular:{value:new lt(1118481)},shininess:{value:30}}]),vertexShader:w.meshtoon_vert,fragmentShader:w.meshtoon_frag},matcap:{uniforms:ga([Lt.common,Lt.bumpmap,Lt.normalmap,Lt.displacementmap,Lt.fog,{matcap:{value:null}}]),vertexShader:w.meshmatcap_vert,fragmentShader:w.meshmatcap_frag},points:{uniforms:ga([Lt.points,Lt.fog]),vertexShader:w.points_vert,fragmentShader:w.points_frag},dashed:{uniforms:ga([Lt.common,Lt.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:w.linedashed_vert,fragmentShader:w.linedashed_frag},depth:{uniforms:ga([Lt.common,Lt.displacementmap]),vertexShader:w.depth_vert,fragmentShader:w.depth_frag},normal:{uniforms:ga([Lt.common,Lt.bumpmap,Lt.normalmap,Lt.displacementmap,{opacity:{value:1}}]),vertexShader:w.normal_vert,fragmentShader:w.normal_frag},sprite:{uniforms:ga([Lt.sprite,Lt.fog]),vertexShader:w.sprite_vert,fragmentShader:w.sprite_frag},background:{uniforms:{uvTransform:{value:new Z},t2D:{value:null}},vertexShader:w.background_vert,fragmentShader:w.background_frag},cube:{uniforms:ga([Lt.envmap,{opacity:{value:1}}]),vertexShader:w.cube_vert,fragmentShader:w.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:w.equirect_vert,fragmentShader:w.equirect_frag},distanceRGBA:{uniforms:ga([Lt.common,Lt.displacementmap,{referencePosition:{value:new Tt},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:w.distanceRGBA_vert,fragmentShader:w.distanceRGBA_frag},shadow:{uniforms:ga([Lt.lights,Lt.fog,{color:{value:new lt(0)},opacity:{value:1}}]),vertexShader:w.shadow_vert,fragmentShader:w.shadow_frag}};function iu(o,e,s,i){var a,u,c=new lt(0),h=0,f=null,l=0,d=null;function v(t,n){e.buffers.color.setClear(t.r,t.g,t.b,n,i)}return{getClearColor:function(){return c},setClearColor:function(t,n){c.set(t),v(c,h=void 0!==n?n:1)},getClearAlpha:function(){return h},setClearAlpha:function(t){v(c,h=t)},render:function(t,n,e,i){var n=n.background,r=(r=o.xr).getSession&&r.getSession();null===(n=r&&"additive"===r.environmentBlendMode?null:n)?v(c,h):n&&n.isColor&&(v(n,1),i=!0),(o.autoClear||i)&&o.clear(o.autoClearColor,o.autoClearDepth,o.autoClearStencil),n&&(n.isCubeTexture||n.isWebGLCubeRenderTarget||n.mapping===Bn)?(void 0===u&&((u=new $a(new pa(1,1,1),new Ea({type:"BackgroundCubeMaterial",uniforms:ba(eu.cube.uniforms),vertexShader:eu.cube.vertexShader,fragmentShader:eu.cube.fragmentShader,side:sn,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(t,n,e){this.matrixWorld.copyPosition(e.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),s.update(u)),r=n.isWebGLCubeRenderTarget?n.texture:n,u.material.uniforms.envMap.value=r,u.material.uniforms.flipEnvMap.value=r.isCubeTexture?-1:1,f===n&&l===r.version&&d===o.toneMapping||(u.material.needsUpdate=!0,f=n,l=r.version,d=o.toneMapping),t.unshift(u,u.geometry,u.material,0,0,null)):n&&n.isTexture&&(void 0===a&&((a=new $a(new ma(2,2),new Ea({type:"BackgroundMaterial",uniforms:ba(eu.background.uniforms),vertexShader:eu.background.vertexShader,fragmentShader:eu.background.fragmentShader,side:on,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),Object.defineProperty(a.material,"map",{get:function(){return this.uniforms.t2D.value}}),s.update(a)),!0===(a.material.uniforms.t2D.value=n).matrixAutoUpdate&&n.updateMatrix(),a.material.uniforms.uvTransform.value.copy(n.matrix),f===n&&l===n.version&&d===o.toneMapping||(a.material.needsUpdate=!0,l=(f=n).version,d=o.toneMapping),t.unshift(a,a.geometry,a.material,0,0,null))}}}function ru(s,a,u,t){var c,h=t.isWebGL2;this.setMode=function(t){c=t},this.render=function(t,n){s.drawArrays(c,t,n),u.update(n,c)},this.renderInstances=function(t,n,e,i){if(0!==i){var r,o;if(h)r=s,o="drawArraysInstanced";else if(o="drawArraysInstancedANGLE",null===(r=a.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");r[o](c,n,e,i),u.update(e,c,i)}}}function ou(n,e,t){var i;function r(t){if("highp"===t){if(0<n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.HIGH_FLOAT).precision&&0<n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision)return"highp";t="mediump"}return"mediump"===t&&0<n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision&&0<n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision?"mediump":"lowp"}var o="undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&n instanceof WebGL2ComputeRenderingContext,s=void 0!==t.precision?t.precision:"highp",a=r(s),a=(a!==s&&(console.warn("THREE.WebGLRenderer:",s,"not supported, using",a,"instead."),s=a),!0===t.logarithmicDepthBuffer),t=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),u=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),c=n.getParameter(n.MAX_TEXTURE_SIZE),h=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),f=n.getParameter(n.MAX_VERTEX_ATTRIBS),l=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),d=n.getParameter(n.MAX_VARYING_VECTORS),v=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),p=0<u,m=o||!!e.get("OES_texture_float");return{isWebGL2:o,getMaxAnisotropy:function(){var t;return void 0===i&&(t=e.get("EXT_texture_filter_anisotropic"),i=null!==t?n.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0),i},getMaxPrecision:r,precision:s,logarithmicDepthBuffer:a,maxTextures:t,maxVertexTextures:u,maxTextureSize:c,maxCubemapSize:h,maxAttributes:f,maxVertexUniforms:l,maxVaryings:d,maxFragmentUniforms:v,vertexTextures:p,floatFragmentTextures:m,floatVertexTextures:p&&m,maxSamples:o?n.getParameter(n.MAX_SAMPLES):0}}function su(){var c=this,h=null,f=0,l=!1,d=!1,v=new Gt,p=new Z,m={value:null,needsUpdate:!1};function y(){m.value!==h&&(m.value=h,m.needsUpdate=0<f),c.numPlanes=f,c.numIntersection=0}function b(t,n,e,i){var r=null!==t?t.length:0,o=null;if(0!==r){if(o=m.value,!0!==i||null===o){var i=e+4*r,s=n.matrixWorldInverse;p.getNormalMatrix(s),(null===o||o.length<i)&&(o=new Float32Array(i));for(var a=0,u=e;a!==r;++a,u+=4)v.copy(t[a]).applyMatrix4(s,p),v.normal.toArray(o,u),o[u+3]=v.constant}m.value=o,m.needsUpdate=!0}return c.numPlanes=r,c.numIntersection=0,o}this.uniform=m,this.numPlanes=0,this.numIntersection=0,this.init=function(t,n,e){var i=0!==t.length||n||0!==f||l;return l=n,h=b(t,e,0),f=t.length,i},this.beginShadows=function(){d=!0,b(null)},this.endShadows=function(){d=!1,y()},this.setState=function(t,n,e,i,r,o){if(!l||null===t||0===t.length||d&&!e)d?b(null):y();else{var e=d?0:f,s=4*e,a=r.clippingState||null;m.value=a;for(var a=b(t,i,s,o),u=0;u!==s;++u)a[u]=h[u];r.clippingState=a,this.numIntersection=n?this.numPlanes:0,this.numPlanes+=e}}}function au(e){var i={};return{get:function(t){if(void 0!==i[t])return i[t];var n;switch(t){case"WEBGL_depth_texture":n=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":n=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":n=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":n=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:n=e.getExtension(t)}return null===n&&console.warn("THREE.WebGLRenderer: "+t+" extension not supported."),i[t]=n}}}function uu(f,l,i){var r=new WeakMap,d=new WeakMap;function o(t){var n,t=t.target,e=r.get(t);for(n in null!==e.index&&l.remove(e.index),e.attributes)l.remove(e.attributes[n]);t.removeEventListener("dispose",o),r.delete(t);t=d.get(e);t&&(l.remove(t),d.delete(e)),i.memory.geometries--}function s(t){var n=[],e=t.index,i=t.attributes.position,r=0;if(null!==e)for(var o=e.array,r=e.version,s=0,a=o.length;s<a;s+=3){var u=o[s+0],c=o[s+1],h=o[s+2];n.push(u,c,c,h,h,u)}else{o=i.array;r=i.version;for(s=0,a=o.length/3-1;s<a;s+=3){u=s+0,c=s+1,h=s+2;n.push(u,c,c,h,h,u)}}e=new(65535<qs(n)?Ys:zs)(n,1),e.version=r,l.update(e,f.ELEMENT_ARRAY_BUFFER),i=d.get(t);i&&l.remove(i),d.set(t,e)}return{get:function(t,n){var e=r.get(n);return e||(n.addEventListener("dispose",o),n.isBufferGeometry?e=n:n.isGeometry&&(void 0===n.co&&(n.co=(new ra).setFromObject(t)),e=n.co),r.set(n,e),i.memory.geometries++),e},update:function(t){var n=t.index,e=t.attributes;for(i in null!==n&&l.update(n,f.ELEMENT_ARRAY_BUFFER),e)l.update(e[i],f.ARRAY_BUFFER);var i,r=t.morphAttributes;for(i in r)for(var o=r[i],s=0,a=o.length;s<a;s++)l.update(o[s],f.ARRAY_BUFFER)},getWireframeAttribute:function(t){var n,e=d.get(t);return(!e||null!==(n=t.index)&&e.version<n.version)&&s(t),d.get(t)}}}function cu(s,a,u,t){var c,h,f,l=t.isWebGL2;this.setMode=function(t){c=t},this.setIndex=function(t){h=t.type,f=t.bytesPerElement},this.render=function(t,n){s.drawElements(c,n,h,t*f),u.update(n,c)},this.renderInstances=function(t,n,e,i){if(0!==i){var r,o;if(l)r=s,o="drawElementsInstanced";else if(o="drawElementsInstancedANGLE",null===(r=a.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");r[o](c,e,h,n*f,i),u.update(e,c,i)}}}function hu(i){var r={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:r,programs:null,autoReset:!0,reset:function(){r.frame++,r.calls=0,r.triangles=0,r.points=0,r.lines=0},update:function(t,n,e){switch(e=e||1,r.calls++,n){case i.TRIANGLES:r.triangles+=e*(t/3);break;case i.LINES:r.lines+=e*(t/2);break;case i.LINE_STRIP:r.lines+=e*(t-1);break;case i.LINE_LOOP:r.lines+=e*t;break;case i.POINTS:r.points+=e*t;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",n)}}}}function fu(t,n){return Math.abs(n[1])-Math.abs(t[1])}function lu(v){var p={},m=new Float32Array(8);return{update:function(t,n,e,i){var r=t.morphTargetInfluences,o=void 0===r?0:r.length;if(void 0===(s=p[n.id])){for(var s=[],a=0;a<o;a++)s[a]=[a,0];p[n.id]=s}for(var u=e.morphTargets&&n.morphAttributes.position,c=e.morphNormals&&n.morphAttributes.normal,a=0;a<o;a++)0!==(h=s[a])[1]&&(u&&n.deleteAttribute("morphTarget"+a),c)&&n.deleteAttribute("morphNormal"+a);for(a=0;a<o;a++)(h=s[a])[0]=a,h[1]=r[a];s.sort(fu);for(var h,f=0,a=0;a<8;a++){if(h=s[a]){var l=h[0],d=h[1];if(d){u&&n.setAttribute("morphTarget"+a,u[l]),c&&n.setAttribute("morphNormal"+a,c[l]),f+=m[a]=d;continue}}m[a]=0}t=n.morphTargetsRelative?1:1-f,i.getUniforms().setValue(v,"morphTargetBaseInfluence",t),i.getUniforms().setValue(v,"morphTargetInfluences",m)}}}function du(r,o,s,a){var u=new WeakMap;return{update:function(t){var n=a.render.frame,e=t.geometry,i=o.get(t,e);return u.get(i)!==n&&(e.isGeometry&&i.updateFromObject(t),o.update(i),u.set(i,n)),t.isInstancedMesh&&s.update(t.instanceMatrix,r.ARRAY_BUFFER),i},dispose:function(){u=new WeakMap}}}function vu(t,n,e,i,r,o,s,a,u,c){l.call(this,t=void 0!==t?t:[],n=void 0!==n?n:301,e,i,r,o,s=void 0!==s?s:he,a,u,c),this.flipY=!1}function pu(t,n,e,i){l.call(this,null),this.image={data:t||null,width:n||1,height:e||1,depth:i||1},this.magFilter=zn,this.minFilter=zn,this.wrapR=Xn,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}function mu(t,n,e,i){l.call(this,null),this.image={data:t||null,width:n||1,height:e||1,depth:i||1},this.magFilter=zn,this.minFilter=zn,this.wrapR=Xn,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}eu.physical={uniforms:ga([eu.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new Mt(1,1)},clearcoatNormalMap:{value:null},sheen:{value:new lt(0)},transparency:{value:0}}]),vertexShader:w.meshphysical_vert,fragmentShader:w.meshphysical_frag},((vu.prototype=Object.create(l.prototype)).constructor=vu).prototype.isCubeTexture=!0,Object.defineProperty(vu.prototype,"images",{get:function(){return this.image},set:function(t){this.image=t}}),((pu.prototype=Object.create(l.prototype)).constructor=pu).prototype.isDataTexture2DArray=!0,((mu.prototype=Object.create(l.prototype)).constructor=mu).prototype.isDataTexture3D=!0;var yu=new l,bu=new pu,gu=new mu,_u=new vu,wu=[],xu=[],Eu=new Float32Array(16),Su=new Float32Array(9),Tu=new Float32Array(4);function Au(t,n,e){var i=t[0];if(i<=0||0<i)return t;var r=n*e,o=wu[r];if(void 0===o&&(o=new Float32Array(r),wu[r]=o),0!==n){i.toArray(o,0);for(var s=1,a=0;s!==n;++s)t[s].toArray(o,a+=e)}return o}function Mu(t,n){if(t.length===n.length){for(var e=0,i=t.length;e<i;e++)if(t[e]!==n[e])return;return 1}}function Ou(t,n){for(var e=0,i=n.length;e<i;e++)t[e]=n[e]}function Lu(t,n){var e=xu[n];void 0===e&&(e=new Int32Array(n),xu[n]=e);for(var i=0;i!==n;++i)e[i]=t.allocateTextureUnit();return e}function Ru(t,n){var e=this.cache;e[0]!==n&&(t.uniform1f(this.addr,n),e[0]=n)}function Nu(t,n){var e=this.cache;void 0!==n.x?e[0]===n.x&&e[1]===n.y||(t.uniform2f(this.addr,n.x,n.y),e[0]=n.x,e[1]=n.y):Mu(e,n)||(t.uniform2fv(this.addr,n),Ou(e,n))}function Pu(t,n){var e=this.cache;void 0!==n.x?e[0]===n.x&&e[1]===n.y&&e[2]===n.z||(t.uniform3f(this.addr,n.x,n.y,n.z),e[0]=n.x,e[1]=n.y,e[2]=n.z):void 0!==n.r?e[0]===n.r&&e[1]===n.g&&e[2]===n.b||(t.uniform3f(this.addr,n.r,n.g,n.b),e[0]=n.r,e[1]=n.g,e[2]=n.b):Mu(e,n)||(t.uniform3fv(this.addr,n),Ou(e,n))}function Fu(t,n){var e=this.cache;void 0!==n.x?e[0]===n.x&&e[1]===n.y&&e[2]===n.z&&e[3]===n.w||(t.uniform4f(this.addr,n.x,n.y,n.z,n.w),e[0]=n.x,e[1]=n.y,e[2]=n.z,e[3]=n.w):Mu(e,n)||(t.uniform4fv(this.addr,n),Ou(e,n))}function ju(t,n){var e=this.cache,i=n.elements;void 0===i?Mu(e,n)||(t.uniformMatrix2fv(this.addr,!1,n),Ou(e,n)):Mu(e,i)||(Tu.set(i),t.uniformMatrix2fv(this.addr,!1,Tu),Ou(e,i))}function Iu(t,n){var e=this.cache,i=n.elements;void 0===i?Mu(e,n)||(t.uniformMatrix3fv(this.addr,!1,n),Ou(e,n)):Mu(e,i)||(Su.set(i),t.uniformMatrix3fv(this.addr,!1,Su),Ou(e,i))}function Cu(t,n){var e=this.cache,i=n.elements;void 0===i?Mu(e,n)||(t.uniformMatrix4fv(this.addr,!1,n),Ou(e,n)):Mu(e,i)||(Eu.set(i),t.uniformMatrix4fv(this.addr,!1,Eu),Ou(e,i))}function Du(t,n,e){var i=this.cache,r=e.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),e.safeSetTexture2D(n||yu,r)}function ku(t,n,e){var i=this.cache,r=e.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),e.setTexture2DArray(n||bu,r)}function Uu(t,n,e){var i=this.cache,r=e.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),e.setTexture3D(n||gu,r)}function Bu(t,n,e){var i=this.cache,r=e.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),e.safeSetTextureCube(n||_u,r)}function Gu(t,n){var e=this.cache;e[0]!==n&&(t.uniform1i(this.addr,n),e[0]=n)}function Hu(t,n){var e=this.cache;Mu(e,n)||(t.uniform2iv(this.addr,n),Ou(e,n))}function Xu(t,n){var e=this.cache;Mu(e,n)||(t.uniform3iv(this.addr,n),Ou(e,n))}function Vu(t,n){var e=this.cache;Mu(e,n)||(t.uniform4iv(this.addr,n),Ou(e,n))}function zu(t,n){var e=this.cache;e[0]!==n&&(t.uniform1ui(this.addr,n),e[0]=n)}function Wu(t,n){t.uniform1fv(this.addr,n)}function Yu(t,n){t.uniform1iv(this.addr,n)}function Qu(t,n){t.uniform2iv(this.addr,n)}function Zu(t,n){t.uniform3iv(this.addr,n)}function qu(t,n){t.uniform4iv(this.addr,n)}function Ku(t,n){n=Au(n,this.size,2);t.uniform2fv(this.addr,n)}function Ju(t,n){n=Au(n,this.size,3);t.uniform3fv(this.addr,n)}function $u(t,n){n=Au(n,this.size,4);t.uniform4fv(this.addr,n)}function tc(t,n){n=Au(n,this.size,4);t.uniformMatrix2fv(this.addr,!1,n)}function nc(t,n){n=Au(n,this.size,9);t.uniformMatrix3fv(this.addr,!1,n)}function ec(t,n){n=Au(n,this.size,16);t.uniformMatrix4fv(this.addr,!1,n)}function ic(t,n,e){var i=n.length,r=Lu(e,i);t.uniform1iv(this.addr,r);for(var o=0;o!==i;++o)e.safeSetTexture2D(n[o]||yu,r[o])}function rc(t,n,e){var i=n.length,r=Lu(e,i);t.uniform1iv(this.addr,r);for(var o=0;o!==i;++o)e.safeSetTextureCube(n[o]||_u,r[o])}function oc(t,n,e){this.id=t,this.addr=e,this.cache=[],this.setValue=function(t){switch(t){case 5126:return Ru;case 35664:return Nu;case 35665:return Pu;case 35666:return Fu;case 35674:return ju;case 35675:return Iu;case 35676:return Cu;case 5124:case 35670:return Gu;case 35667:case 35671:return Hu;case 35668:case 35672:return Xu;case 35669:case 35673:return Vu;case 5125:return zu;case 35678:case 36198:case 36298:case 36306:case 35682:return Du;case 35679:case 36299:case 36307:return Uu;case 35680:case 36300:case 36308:case 36293:return Bu;case 36289:case 36303:case 36311:case 36292:return ku}}(n.type)}function sc(t,n,e){this.id=t,this.addr=e,this.cache=[],this.size=n.size,this.setValue=function(t){switch(t){case 5126:return Wu;case 35664:return Ku;case 35665:return Ju;case 35666:return $u;case 35674:return tc;case 35675:return nc;case 35676:return ec;case 5124:case 35670:return Yu;case 35667:case 35671:return Qu;case 35668:case 35672:return Zu;case 35669:case 35673:return qu;case 35678:case 36198:case 36298:case 36306:case 35682:return ic;case 35680:case 36300:case 36308:case 36293:return rc}}(n.type)}function ac(t){this.id=t,this.seq=[],this.map={}}sc.prototype.updateCache=function(t){var n=this.cache;t instanceof Float32Array&&n.length!==t.length&&(this.cache=new Float32Array(t.length)),Ou(n,t)},ac.prototype.setValue=function(t,n,e){for(var i=this.seq,r=0,o=i.length;r!==o;++r){var s=i[r];s.setValue(t,n[s.id],e)}};var uc=/([\w\d_]+)(\])?(\[|\.)?/g;function cc(t,n){t.seq.push(n),t.map[n.id]=n}function hc(t,n){this.seq=[],this.map={};for(var e=t.getProgramParameter(n,t.ACTIVE_UNIFORMS),i=0;i<e;++i){var r=t.getActiveUniform(n,i),o=t.getUniformLocation(n,r.name),s=(v=d=l=f=h=c=u=a=s=void 0,r),a=o,u=this,c=s.name,h=c.length;for(uc.lastIndex=0;;){var f=uc.exec(c),l=uc.lastIndex,d=f[1],v="]"===f[2],f=f[3];if(v&&(d|=0),void 0===f||"["===f&&l+2===h){cc(u,new(void 0===f?oc:sc)(d,s,a));break}v=u.map[d];void 0===v&&cc(u,v=new ac(d)),u=v}}}function fc(t,n,e){n=t.createShader(n);return t.shaderSource(n,e),t.compileShader(n),n}hc.prototype.setValue=function(t,n,e,i){n=this.map[n];void 0!==n&&n.setValue(t,e,i)},hc.prototype.setOptional=function(t,n,e){n=n[e];void 0!==n&&this.setValue(t,e,n)},hc.upload=function(t,n,e,i){for(var r=0,o=n.length;r!==o;++r){var s=n[r],a=e[s.id];!1!==a.needsUpdate&&s.setValue(t,a.value,i)}},hc.seqWithValue=function(t,n){for(var e=[],i=0,r=t.length;i!==r;++i){var o=t[i];o.id in n&&e.push(o)}return e};var lc=0;function dc(t){switch(t){case li:return["Linear","( value )"];case 3001:return["sRGB","( value )"];case 3002:return["RGBE","( value )"];case 3004:return["RGBM","( value, 7.0 )"];case 3005:return["RGBM","( value, 16.0 )"];case 3006:return["RGBD","( value, 256.0 )"];case 3007:return["Gamma","( value, float( GAMMA_FACTOR ) )"];case 3003:return["LogLuv","( value )"];default:throw new Error("unsupported encoding: "+t)}}function vc(t,n,e){var i=t.getShaderParameter(n,t.COMPILE_STATUS),r=t.getShaderInfoLog(n).trim();return i&&""===r?"":"THREE.WebGLShader: gl.getShaderInfoLog() "+e+"\n"+r+function(t){for(var n=t.split("\n"),e=0;e<n.length;e++)n[e]=e+1+": "+n[e];return n.join("\n")}(t.getShaderSource(n))}function pc(t,n){n=dc(n);return"vec4 "+t+"( vec4 value ) { return "+n[0]+"ToLinear"+n[1]+"; }"}function mc(t){return""!==t}function yc(t,n){return t.replace(/NUM_DIR_LIGHTS/g,n.numDirLights).replace(/NUM_SPOT_LIGHTS/g,n.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,n.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,n.numPointLights).replace(/NUM_HEMI_LIGHTS/g,n.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,n.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS/g,n.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,n.numPointLightShadows)}function bc(t,n){return t.replace(/NUM_CLIPPING_PLANES/g,n.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,n.numClippingPlanes-n.numClipIntersection)}var gc=/^[ \t]*#include +<([\w\d./]+)>/gm;function _c(t){return t.replace(gc,wc)}function wc(t,n){var e=w[n];if(void 0===e)throw new Error("Can not resolve #include <"+n+">");return _c(e)}var xc=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,Ec=/#pragma unroll_loop_start[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}[\s]+?#pragma unroll_loop_end/g;function Sc(t){return t.replace(Ec,Ac).replace(xc,Tc)}function Tc(t,n,e,i){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),Ac(0,n,e,i)}function Ac(t,n,e,i){for(var r="",o=parseInt(n);o<parseInt(e);o++)r+=i.replace(/\[ i \]/g,"[ "+o+" ]").replace(/UNROLLED_LOOP_INDEX/g,o);return r}function Mc(t){var n="precision "+t.precision+" float;\nprecision "+t.precision+" int;";return"highp"===t.precision?n+="\n#define HIGH_PRECISION":"mediump"===t.precision?n+="\n#define MEDIUM_PRECISION":"lowp"===t.precision&&(n+="\n#define LOW_PRECISION"),n}function Oc(t,n,e){var i,r,o,s,a,u,c=t.getContext(),h=e.defines,f=e.vertexShader,l=e.fragmentShader,d=(v="SHADOWMAP_TYPE_BASIC",(d=e).shadowMapType===en?v="SHADOWMAP_TYPE_PCF":2===d.shadowMapType?v="SHADOWMAP_TYPE_PCF_SOFT":d.shadowMapType===rn&&(v="SHADOWMAP_TYPE_VSM"),v),v=function(t){var n="ENVMAP_TYPE_CUBE";if(t.envMap)switch(t.envMapMode){case 301:case 302:n="ENVMAP_TYPE_CUBE";break;case Bn:case Gn:n="ENVMAP_TYPE_CUBE_UV";break;case 303:case 304:n="ENVMAP_TYPE_EQUIREC";break;case 305:n="ENVMAP_TYPE_SPHERE"}return n}(e),p=function(t){var n="ENVMAP_MODE_REFLECTION";if(t.envMap)switch(t.envMapMode){case 302:case 304:n="ENVMAP_MODE_REFRACTION"}return n}(e),m=function(t){var n="ENVMAP_BLENDING_NONE";if(t.envMap)switch(t.combine){case kn:n="ENVMAP_BLENDING_MULTIPLY";break;case 1:n="ENVMAP_BLENDING_MIX";break;case 2:n="ENVMAP_BLENDING_ADD"}return n}(e),y=0<t.gammaFactor?t.gammaFactor:1,b=e.isWebGL2?"":(g=[(b=e).extensionDerivatives||b.envMapCubeUV||b.bumpMap||b.tangentSpaceNormalMap||b.clearcoatNormalMap||b.flatShading||"physical"===b.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(b.extensionFragDepth||b.logarithmicDepthBuffer)&&b.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",b.extensionDrawBuffers&&b.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(b.extensionShaderTextureLOD||b.envMap)&&b.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""],"FMMeshStandardMaterial"===b.shaderName&&g.push("#extension GL_OES_standard_derivatives : enable"),g.filter(mc).join("\n")),g=function(t){var n,e=[];for(n in t){var i=t[n];!1!==i&&e.push("#define "+n+" "+i)}return e.join("\n")}(h),_=c.createProgram(),m=(e.isRawShaderMaterial?(0<(i=[g].filter(mc).join("\n")).length&&(i+="\n"),0<(r=[b,g].filter(mc).join("\n")).length&&(r+="\n")):(i=[Mc(e),"#define SHADER_NAME "+e.shaderName,g,e.instancing?"#define USE_INSTANCING":"",e.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+y,"#define MAX_BONES "+e.maxBones,e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp2?"#define FOG_EXP2":"",e.map?"#define USE_MAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+p:"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.emissiveMap?"#define USE_EMISSIVEMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.normalMap&&e.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",e.normalMap&&e.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",e.clearcoatMap?"#define USE_CLEARCOATMAP":"",e.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",e.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",e.displacementMap&&e.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.roughnessMap?"#define USE_ROUGHNESSMAP":"",e.metalnessMap?"#define USE_METALNESSMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.vertexTangents?"#define USE_TANGENT":"",e.vertexColors?"#define USE_COLOR":"",e.vertexUvs?"#define USE_UV":"",e.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",e.flatShading?"#define FLAT_SHADED":"",e.skinning?"#define USE_SKINNING":"",e.useVertexTexture?"#define BONE_TEXTURE":"",e.morphTargets?"#define USE_MORPHTARGETS":"",e.morphNormals&&!1===e.flatShading?"#define USE_MORPHNORMALS":"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+d:"",e.sizeAttenuation?"#define USE_SIZEATTENUATION":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",e.logarithmicDepthBuffer&&e.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(mc).join("\n"),r=[b,Mc(e),"#define SHADER_NAME "+e.shaderName,g,e.alphaTest?"#define ALPHATEST "+e.alphaTest+(e.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+y,e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp2?"#define FOG_EXP2":"",e.map?"#define USE_MAP":"",e.matcap?"#define USE_MATCAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+v:"",e.envMap?"#define "+p:"",e.envMap?"#define "+m:"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.emissiveMap?"#define USE_EMISSIVEMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.normalMap&&e.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",e.normalMap&&e.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",e.clearcoatMap?"#define USE_CLEARCOATMAP":"",e.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",e.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.roughnessMap?"#define USE_ROUGHNESSMAP":"",e.metalnessMap?"#define USE_METALNESSMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.sheen?"#define USE_SHEEN":"",e.vertexTangents?"#define USE_TANGENT":"",e.vertexColors?"#define USE_COLOR":"",e.vertexUvs?"#define USE_UV":"",e.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",e.gradientMap?"#define USE_GRADIENTMAP":"",e.flatShading?"#define FLAT_SHADED":"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+d:"",e.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",e.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",e.logarithmicDepthBuffer&&e.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(e.extensionShaderTextureLOD||e.envMap)&&e.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",e.toneMapping!==Un?"#define TONE_MAPPING":"",e.toneMapping!==Un?w.tonemapping_pars_fragment:"",e.toneMapping!==Un?function(t,n){var e;switch(n){case 1:e="Linear";break;case 2:e="Reinhard";break;case 3:e="Uncharted2";break;case 4:e="OptimizedCineon";break;case 5:e="ACESFilmic";break;default:throw new Error("unsupported toneMapping: "+n)}return"vec3 "+t+"( vec3 color ) { return "+e+"ToneMapping( color ); }"}("toneMapping",e.toneMapping):"",e.dithering?"#define DITHERING":"",e.outputEncoding||e.mapEncoding||e.matcapEncoding||e.envMapEncoding||e.emissiveMapEncoding||e.lightMapEncoding?w.encodings_pars_fragment:"",e.mapEncoding?pc("mapTexelToLinear",e.mapEncoding):"",e.matcapEncoding?pc("matcapTexelToLinear",e.matcapEncoding):"",e.envMapEncoding?pc("envMapTexelToLinear",e.envMapEncoding):"",e.emissiveMapEncoding?pc("emissiveMapTexelToLinear",e.emissiveMapEncoding):"",e.lightMapEncoding?pc("lightMapTexelToLinear",e.lightMapEncoding):"",e.outputEncoding?(h="linearToOutputTexel",y=dc(y=e.outputEncoding),"vec4 "+h+"( vec4 value ) { return LinearTo"+y[0]+y[1]+"; }"):"",e.depthPacking?"#define DEPTH_PACKING "+e.depthPacking:"","\n"].filter(mc).join("\n")),f=bc(f=yc(f=_c(f),e),e),l=bc(l=yc(l=_c(l),e),e),f=Sc(f),l=Sc(l),e.isWebGL2&&!e.isRawShaderMaterial&&(v=!1,p=/^\s*#version\s+300\s+es\s*\n/,e.isShaderMaterial&&null!==f.match(p)&&null!==l.match(p)&&(v=!0,f=f.replace(p,""),l=l.replace(p,"")),i=["#version 300 es\n","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+i,r=["#version 300 es\n","#define varying in",v?"":"out highp vec4 pc_fragColor;",v?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+r),i+f),d=r+l,h=fc(c,c.VERTEX_SHADER,m),y=fc(c,c.FRAGMENT_SHADER,d);return c.attachShader(_,h),c.attachShader(_,y),void 0!==e.index0AttributeName?c.bindAttribLocation(_,0,e.index0AttributeName):!0===e.morphTargets&&c.bindAttribLocation(_,0,"position"),c.linkProgram(_),t.debug.checkShaderErrors&&(p=c.getProgramInfoLog(_).trim(),v=c.getShaderInfoLog(h).trim(),f=c.getShaderInfoLog(y).trim(),!(t=l=!0)===c.getProgramParameter(_,c.LINK_STATUS)?(l=!1,o=vc(c,h,"vertex"),s=vc(c,y,"fragment"),console.error("THREE.WebGLProgram: shader error: ",c.getError(),"gl.VALIDATE_STATUS",c.getProgramParameter(_,c.VALIDATE_STATUS),"gl.getProgramInfoLog",p,o,s)):""!==p?(console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",p),st.a.environment===B.a.WX&&(""!==v&&(console.error("vertexLog",v),console.error("vertexGlsl",m)),""!==f)&&(console.error("fragmentLog",f),console.error("fragmentGlsl",d))):""!==v&&""!==f||(t=!1),t)&&(this.diagnostics={runnable:l,programLog:p,vertexShader:{log:v,prefix:i},fragmentShader:{log:f,prefix:r}}),c.detachShader(_,h),c.detachShader(_,y),c.deleteShader(h),c.deleteShader(y),this.getUniforms=function(){return a=void 0===a?new hc(c,_):a},this.getAttributes=function(){return u=void 0===u?function(t,n){for(var e={},i=t.getProgramParameter(n,t.ACTIVE_ATTRIBUTES),r=0;r<i;r++){var o=t.getActiveAttrib(n,r).name;e[o]=t.getAttribLocation(n,o)}return e}(c,_):u},this.destroy=function(){c.deleteProgram(_),this.program=void 0},this.name=e.shaderName,this.id=lc++,this.cacheKey=n,this.usedTimes=1,this.program=_,this.vertexShader=h,this.fragmentShader=y,this}function Lc(d,v,p){var s=[],m=p.isWebGL2,y=p.logarithmicDepthBuffer,b=p.floatVertexTextures,g=p.precision,_=p.maxVertexUniforms,w=p.vertexTextures,x={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},r=["precision","isWebGL2","supportsVertexTextures","outputEncoding","instancing","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","envMapCubeUV","lightMap","lightMapEncoding","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","tangentSpaceNormalMap","clearcoatMap","clearcoatRoughnessMap","clearcoatNormalMap","displacementMap","specularMap","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","vertexTangents","vertexUvs","uvsVertexOnly","fog","useFog","fogExp2","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","maxMorphTargets","maxMorphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","numDirLightShadows","numPointLightShadows","numSpotLightShadows","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering","sheen"];function E(t){var n;return t?t.isTexture?n=t.encoding:t.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),n=t.texture.encoding):n=li,n}this.getParameters=function(t,n,e,i,r,o,s){var a,u=i.fog,i=t.isMeshStandardMaterial?i.environment:null,i=t.envMap||i,c=x[t.type],h=s.isSkinnedMesh?(h=(h=s).skeleton.bones,b?1024:(a=Math.floor((_-20)/4),(a=Math.min(a,h.length))<h.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+h.length+" bones. This GPU supports "+a+"."),0):a)):0,f=(null!==t.precision&&(g=p.getMaxPrecision(t.precision))!==t.precision&&console.warn("THREE.WebGLProgram.getParameters:",t.precision,"not supported, using",g,"instead."),a=t,(f=c)?(f=eu[f],{name:a.type,uniforms:_a.clone(f.uniforms),vertexShader:f.vertexShader,fragmentShader:f.fragmentShader}):{name:a.type,uniforms:a.uniforms,vertexShader:a.vertexShader,fragmentShader:a.fragmentShader}),l=(t.onBeforeCompile(f,d),d.getRenderTarget());return{isWebGL2:m,shaderID:c,shaderName:f.name,uniforms:f.uniforms,vertexShader:f.vertexShader,fragmentShader:f.fragmentShader,defines:t.defines,isRawShaderMaterial:t.isRawShaderMaterial,isShaderMaterial:t.isShaderMaterial,precision:g,instancing:!0===s.isInstancedMesh,supportsVertexTextures:w,outputEncoding:null!==l?E(l.texture):d.outputEncoding,map:!!t.map,mapEncoding:E(t.map),matcap:!!t.matcap,matcapEncoding:E(t.matcap),envMap:!!i,envMapMode:i&&i.mapping,envMapEncoding:E(i),envMapCubeUV:!!i&&(i.mapping===Bn||i.mapping===Gn),lightMap:!!t.lightMap,lightMapEncoding:E(t.lightMap),aoMap:!!t.aoMap,emissiveMap:!!t.emissiveMap,emissiveMapEncoding:E(t.emissiveMap),bumpMap:!!t.bumpMap,normalMap:!!t.normalMap,objectSpaceNormalMap:t.normalMapType===mi,tangentSpaceNormalMap:t.normalMapType===pi,clearcoatMap:!!t.clearcoatMap,clearcoatRoughnessMap:!!t.clearcoatRoughnessMap,clearcoatNormalMap:!!t.clearcoatNormalMap,displacementMap:!!t.displacementMap,roughnessMap:!!t.roughnessMap,metalnessMap:!!t.metalnessMap,specularMap:!!t.specularMap,alphaMap:!!t.alphaMap,gradientMap:!!t.gradientMap,sheen:!!t.sheen,combine:t.combine,vertexTangents:t.normalMap&&t.vertexTangents,vertexColors:t.vertexColors,vertexUvs:!!(t.map||t.bumpMap||t.normalMap||t.specularMap||t.alphaMap||t.emissiveMap||t.roughnessMap||t.metalnessMap||t.clearcoatMap||t.clearcoatRoughnessMap||t.clearcoatNormalMap||t.displacementMap),uvsVertexOnly:!(t.map||t.bumpMap||t.normalMap||t.specularMap||t.alphaMap||t.emissiveMap||t.roughnessMap||t.metalnessMap||t.clearcoatNormalMap||!t.displacementMap),fog:!!u,useFog:t.fog,fogExp2:u&&u.isFogExp2,flatShading:t.flatShading,sizeAttenuation:t.sizeAttenuation,logarithmicDepthBuffer:y,skinning:t.skinning&&0<h,maxBones:h,useVertexTexture:b,morphTargets:t.morphTargets,morphNormals:t.morphNormals,maxMorphTargets:d.maxMorphTargets,maxMorphNormals:d.maxMorphNormals,numDirLights:n.directional.length,numPointLights:n.point.length,numSpotLights:n.spot.length,numRectAreaLights:n.rectArea.length,numHemiLights:n.hemi.length,numDirLightShadows:n.directionalShadowMap.length,numPointLightShadows:n.pointShadowMap.length,numSpotLightShadows:n.spotShadowMap.length,numClippingPlanes:r,numClipIntersection:o,dithering:t.dithering,shadowMapEnabled:d.shadowMap.enabled&&0<e.length,shadowMapType:d.shadowMap.type,toneMapping:t.toneMapped?d.toneMapping:Un,physicallyCorrectLights:d.physicallyCorrectLights,premultipliedAlpha:t.premultipliedAlpha,alphaTest:t.alphaTest,doubleSided:t.side===an,flipSided:t.side===sn,depthPacking:void 0!==t.depthPacking&&t.depthPacking,index0AttributeName:t.index0AttributeName,extensionDerivatives:t.extensions&&t.extensions.derivatives,extensionFragDepth:t.extensions&&t.extensions.fragDepth,extensionDrawBuffers:t.extensions&&t.extensions.drawBuffers,extensionShaderTextureLOD:t.extensions&&t.extensions.shaderTextureLOD,rendererExtensionFragDepth:m||null!==v.get("EXT_frag_depth"),rendererExtensionDrawBuffers:m||null!==v.get("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:m||null!==v.get("EXT_shader_texture_lod"),onBeforeCompile:t.onBeforeCompile}},this.getProgramCacheKey=function(t){var n=[];if(t.shaderID?n.push(t.shaderID):(n.push(t.fragmentShader),n.push(t.vertexShader)),void 0!==t.defines)for(var e in t.defines)n.push(e),n.push(t.defines[e]);if(void 0===t.isRawShaderMaterial){for(var i=0;i<r.length;i++)n.push(t[r[i]]);n.push(d.outputEncoding),n.push(d.gammaFactor)}return n.push(t.onBeforeCompile.toString()),n.join()},this.acquireProgram=function(t,n){for(var e,i=0,r=s.length;i<r;i++){var o=s[i];if(o.cacheKey===n){++(e=o).usedTimes;break}}return void 0===e&&(e=new Oc(d,n,t),s.push(e)),e},this.releaseProgram=function(t){var n;0==--t.usedTimes&&(n=s.indexOf(t),s[n]=s[s.length-1],s.pop(),t.destroy())},this.programs=s}function Rc(){var i=new WeakMap;return{get:function(t){var n=i.get(t);return void 0===n&&i.set(t,n={}),n},remove:function(t){i.delete(t)},update:function(t,n,e){i.get(t)[n]=e},dispose:function(){i=new WeakMap}}}function Nc(t,n){return t.groupOrder!==n.groupOrder?t.groupOrder-n.groupOrder:t.renderOrder!==n.renderOrder?t.renderOrder-n.renderOrder:t.program!==n.program?t.program.id-n.program.id:t.material.id!==n.material.id?t.material.id-n.material.id:t.z!==n.z?t.z-n.z:t.id-n.id}function Pc(t,n){return t.groupOrder!==n.groupOrder?t.groupOrder-n.groupOrder:t.renderOrder!==n.renderOrder?t.renderOrder-n.renderOrder:t.z!==n.z?n.z-t.z:t.id-n.id}function Fc(){var a=[],u=0,s=[],c=[],h={id:-1};function f(t,n,e,i,r,o){var s=a[u];return void 0===s?(s={id:t.id,object:t,geometry:n,material:e,program:e.program||h,groupOrder:i,renderOrder:t.renderOrder,z:r,group:o},a[u]=s):(s.id=t.id,s.object=t,s.geometry=n,s.material=e,s.program=e.program||h,s.groupOrder=i,s.renderOrder=t.renderOrder,s.z=r,s.group=o),u++,s}return{opaque:s,transparent:c,init:function(){u=0,c.length=s.length=0},push:function(t,n,e,i,r,o){n=f(t,n,e,i,r,o),(!1!==t.userData.transparent&&!0===e.transparent?c:s).push(n)},unshift:function(t,n,e,i,r,o){n=f(t,n,e,i,r,o),!1===t.userData.transparent?s.push(n):(!0===e.transparent?c:s).unshift(n)},finish:function(){for(var t=u,n=a.length;t<n;t++){var e=a[t];if(null===e.id)break;e.id=null,e.object=null,e.geometry=null,e.material=null,e.program=null,e.group=null}},sort:function(t,n){1<s.length&&s.sort(t||Nc),1<c.length&&c.sort(n||Pc)}}}function jc(){var r=new WeakMap;function o(t){t=t.target;t.removeEventListener("dispose",o),r.delete(t)}return{get:function(t,n){var e,i=r.get(t);return void 0===i?(e=new Fc,r.set(t,new WeakMap),r.get(t).set(n,e),t.addEventListener("dispose",o)):void 0===(e=i.get(n))&&(e=new Fc,i.set(n,e)),e},dispose:function(){r=new WeakMap}}}function Ic(){var e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];var n;switch(t.type){case"DirectionalLight":n={direction:new Tt,color:new lt};break;case"SpotLight":n={position:new Tt,direction:new Tt,color:new lt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new Tt,color:new lt,distance:0,decay:0};break;case"HemisphereLight":n={direction:new Tt,skyColor:new lt,groundColor:new lt};break;case"RectAreaLight":n={color:new lt,position:new Tt,halfWidth:new Tt,halfHeight:new Tt}}return e[t.id]=n}}}var Cc=0;function Dc(t,n){return(n.castShadow?1:0)-(t.castShadow?1:0)}function kc(){for(var e,A=new Ic,M=(e={},{get:function(t){if(void 0!==e[t.id])return e[t.id];var n;switch(t.type){case"DirectionalLight":case"SpotLight":n={shadowBias:0,shadowRadius:1,shadowMapSize:new Mt};break;case"PointLight":n={shadowBias:0,shadowRadius:1,shadowMapSize:new Mt,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=n}}),O={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]},t=0;t<9;t++)O.probe.push(new Tt);var L=new Tt,R=new At,N=new At;return{setup:function(t,n,e){for(var i=0,r=0,o=0,s=0;s<9;s++)O.probe[s].set(0,0,0);var a=0,u=0,c=0,h=0,f=0,l=0,d=0,v=0,p=e.matrixWorldInverse;t.sort(Dc);for(var s=0,m=t.length;s<m;s++){var y,b,g,_=t[s],w=_.color,x=_.intensity,E=_.distance,S=_.shadow&&_.shadow.map?_.shadow.map.texture:null;if(_.isAmbientLight)i+=w.r*x,r+=w.g*x,o+=w.b*x;else if(_.isLightProbe)for(var T=0;T<9;T++)O.probe[T].addScaledVector(_.sh.coefficients[T],x);else _.isDirectionalLight?((g=A.get(_)).color.copy(_.color).multiplyScalar(_.intensity),g.direction.setFromMatrixPosition(_.matrixWorld),L.setFromMatrixPosition(_.target.matrixWorld),g.direction.sub(L),g.direction.transformDirection(p),_.castShadow&&(y=_.shadow,(b=M.get(_)).shadowBias=y.bias,b.shadowRadius=y.radius,b.shadowMapSize=y.mapSize,O.directionalShadow[a]=b,O.directionalShadowMap[a]=S,O.directionalShadowMatrix[a]=_.shadow.matrix,l++),O.directional[a]=g,a++):_.isSpotLight?((g=A.get(_)).position.setFromMatrixPosition(_.matrixWorld),g.position.applyMatrix4(p),g.color.copy(w).multiplyScalar(x),g.distance=E,g.direction.setFromMatrixPosition(_.matrixWorld),L.setFromMatrixPosition(_.target.matrixWorld),g.direction.sub(L),g.direction.transformDirection(p),g.coneCos=Math.cos(_.angle),g.penumbraCos=Math.cos(_.angle*(1-_.penumbra)),g.decay=_.decay,_.castShadow&&(y=_.shadow,(b=M.get(_)).shadowBias=y.bias,b.shadowRadius=y.radius,b.shadowMapSize=y.mapSize,O.spotShadow[c]=b,O.spotShadowMap[c]=S,O.spotShadowMatrix[c]=_.shadow.matrix,v++),O.spot[c]=g,c++):_.isRectAreaLight?((g=A.get(_)).color.copy(w).multiplyScalar(x),g.position.setFromMatrixPosition(_.matrixWorld),g.position.applyMatrix4(p),N.identity(),R.copy(_.matrixWorld),R.premultiply(p),N.extractRotation(R),g.halfWidth.set(.5*_.width,0,0),g.halfHeight.set(0,.5*_.height,0),g.halfWidth.applyMatrix4(N),g.halfHeight.applyMatrix4(N),O.rectArea[h]=g,h++):_.isPointLight?((g=A.get(_)).position.setFromMatrixPosition(_.matrixWorld),g.position.applyMatrix4(p),g.color.copy(_.color).multiplyScalar(_.intensity),g.distance=_.distance,g.decay=_.decay,_.castShadow&&(y=_.shadow,(b=M.get(_)).shadowBias=y.bias,b.shadowRadius=y.radius,b.shadowMapSize=y.mapSize,b.shadowCameraNear=y.camera.near,b.shadowCameraFar=y.camera.far,O.pointShadow[u]=b,O.pointShadowMap[u]=S,O.pointShadowMatrix[u]=_.shadow.matrix,d++),O.point[u]=g,u++):_.isHemisphereLight&&((g=A.get(_)).direction.setFromMatrixPosition(_.matrixWorld),g.direction.transformDirection(p),g.direction.normalize(),g.skyColor.copy(_.color).multiplyScalar(x),g.groundColor.copy(_.groundColor).multiplyScalar(x),O.hemi[f]=g,f++)}O.ambient[0]=i,O.ambient[1]=r,O.ambient[2]=o,(e=O.hash).directionalLength===a&&e.pointLength===u&&e.spotLength===c&&e.rectAreaLength===h&&e.hemiLength===f&&e.numDirectionalShadows===l&&e.numPointShadows===d&&e.numSpotShadows===v||(O.directional.length=a,O.spot.length=c,O.rectArea.length=h,O.point.length=u,O.hemi.length=f,O.directionalShadow.length=l,O.directionalShadowMap.length=l,O.pointShadow.length=d,O.pointShadowMap.length=d,O.spotShadow.length=v,O.spotShadowMap.length=v,O.directionalShadowMatrix.length=l,O.pointShadowMatrix.length=d,O.spotShadowMatrix.length=v,e.directionalLength=a,e.pointLength=u,e.spotLength=c,e.rectAreaLength=h,e.hemiLength=f,e.numDirectionalShadows=l,e.numPointShadows=d,e.numSpotShadows=v,O.version=Cc++)},state:O}}function Uc(){var n=new kc,e=[],i=[];return{init:function(){e.length=0,i.length=0},state:{lightsArray:e,shadowsArray:i,lights:n},setupLights:function(t){n.setup(e,i,t)},pushLight:function(t){e.push(t)},pushShadow:function(t){i.push(t)}}}function Bc(){var i=new WeakMap;function r(t){t=t.target;t.removeEventListener("dispose",r),i.delete(t)}return{get:function(t,n){var e;return!1===i.has(t)?(e=new Uc,i.set(t,new WeakMap),i.get(t).set(n,e),t.addEventListener("dispose",r)):!1===i.get(t).has(n)?(e=new Uc,i.get(t).set(n,e)):e=i.get(t).get(n),e},dispose:function(){i=new WeakMap}}}function Gc(t,n,e){this.width=t,this.height=n,this.scissor=new Ot(0,0,t,n),this.scissorTest=!1,this.viewport=new Ot(0,0,t,n),this.texture=new l(void 0,(e=e||{}).mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.encoding),this.texture.image={},this.texture.image.width=t,this.texture.image.height=n,this.texture.generateMipmaps=void 0!==e.generateMipmaps&&e.generateMipmaps,this.texture.minFilter=void 0!==e.minFilter?e.minFilter:Qn,this.depthBuffer=void 0===e.depthBuffer||e.depthBuffer,this.stencilBuffer=void 0===e.stencilBuffer||e.stencilBuffer,this.depthTexture=void 0!==e.depthTexture?e.depthTexture:null}function Hc(t){f.call(this),this.type="MeshDepthMaterial",this.depthPacking=di,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(t)}function Xc(t){f.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new Tt,this.nearDistance=1,this.farDistance=1e3,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(t)}Gc.prototype=Object.assign(Object.create(X.prototype),{constructor:Gc,isWebGLRenderTarget:!0,setSize:function(t,n){this.width===t&&this.height===n||(this.width=t,this.height=n,this.texture.image.width=t,this.texture.image.height=n,this.dispose()),this.viewport.set(0,0,t,n),this.scissor.set(0,0,t,n)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.width=t.width,this.height=t.height,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.depthTexture=t.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),((Hc.prototype=Object.create(f.prototype)).constructor=Hc).prototype.isMeshDepthMaterial=!0,Hc.prototype.copy=function(t){return f.prototype.copy.call(this,t),this.depthPacking=t.depthPacking,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this},((Xc.prototype=Object.create(f.prototype)).constructor=Xc).prototype.isMeshDistanceMaterial=!0,Xc.prototype.copy=function(t){return f.prototype.copy.call(this,t),this.referencePosition.copy(t.referencePosition),this.nearDistance=t.nearDistance,this.farDistance=t.farDistance,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this};var Vc="\nuniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n\n#include <packing>\n\nvoid main() {\n\n float mean = 0.0;\n float squared_mean = 0.0;\n\n\t// This seems totally useless but it's a crazy work around for a Adreno compiler bug\n\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) );\n\n for ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) {\n\n #ifdef HORIZONAL_PASS\n\n vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) );\n mean += distribution.x;\n squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\n #else\n\n float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) );\n mean += depth;\n squared_mean += depth * depth;\n\n #endif\n\n }\n\n mean = mean * HALF_SAMPLE_RATE;\n squared_mean = squared_mean * HALF_SAMPLE_RATE;\n\n float std_dev = sqrt( squared_mean - mean * mean );\n\n gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n\n}\n",zc="\n\nvoid main() {\n\n\tgl_Position = vec4( position, 1.0 );\n\n}\n\n";function Wc(b,g,_){var w=new Vt,x=new Mt,E=new Mt,S=new Ot,r=[],o=[],f={},l={0:sn,1:on,2:an},T=new Ea({defines:{SAMPLE_RATE:.25,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new Mt},radius:{value:4}},vertexShader:zc,fragmentShader:Vc}),A=T.clone(),t=(A.defines.HORIZONAL_PASS=1,new ra),M=(t.setAttribute("position",new R(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3)),new $a(t,T)),O=this;function d(t,n,e){var e=t<<0|n<<1|e<<2,i=r[e];return void 0===i&&(i=new Hc({depthPacking:vi,morphTargets:t,skinning:n}),r[e]=i),i}function v(t,n,e){var e=t<<0|n<<1|e<<2,i=o[e];return void 0===i&&(i=new Xc({morphTargets:t,skinning:n}),o[e]=i),i}function L(t,n,e,i,r,o){var s,a=t.geometry,u=null,c=d,h=t.customDepthMaterial;return!0===e.isPointLight&&(c=v,h=t.customDistanceMaterial),u=void 0===h?(!(s=!1)===n.morphTargets&&(!0===a.isBufferGeometry?s=a.morphAttributes&&a.morphAttributes.position&&0<a.morphAttributes.position.length:!0===a.isGeometry&&(s=a.morphTargets&&0<a.morphTargets.length)),!(a=!1)===t.isSkinnedMesh&&(!0===n.skinning?a=!0:console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",t)),c(s,a,!0===t.isInstancedMesh)):h,b.localClippingEnabled&&!0===n.clipShadows&&0!==n.clippingPlanes.length&&(c=u.uuid,s=n.uuid,void 0===(a=f[c])&&(f[c]=a={}),void 0===(t=a[s])&&(t=u.clone(),a[s]=t),u=t),u.visible=n.visible,u.wireframe=n.wireframe,u.side=o===rn?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:l[n.side],u.clipShadows=n.clipShadows,u.clippingPlanes=n.clippingPlanes,u.clipIntersection=n.clipIntersection,u.wireframeLinewidth=n.wireframeLinewidth,u.linewidth=n.linewidth,!0===e.isPointLight&&!0===u.isMeshDistanceMaterial&&(u.referencePosition.setFromMatrixPosition(e.matrixWorld),u.nearDistance=i,u.farDistance=r),u}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=en,this.render=function(t,n,e){if(!1!==O.enabled&&(!1!==O.autoUpdate||!1!==O.needsUpdate)&&0!==t.length){var i=b.getRenderTarget(),r=b.getActiveCubeFace(),o=b.getActiveMipmapLevel(),s=b.state;s.setBlending(un),s.buffers.color.setClear(1,1,1,1),s.buffers.depth.setTest(!0),s.setScissorTest(!1);for(var a,u,c=0,h=t.length;c<h;c++){var f=t[c],l=f.shadow;if(void 0===l)console.warn("THREE.WebGLShadowMap:",f,"has no shadow.");else{x.copy(l.mapSize);for(var d,v=l.getFrameExtents(),p=(x.multiply(v),E.copy(l.mapSize),(x.x>_||x.y>_)&&(console.warn("THREE.WebGLShadowMap:",f,"has shadow exceeding max texture size, reducing"),x.x>_&&(E.x=Math.floor(_/v.x),x.x=E.x*v.x,l.mapSize.x=E.x),x.y>_)&&(E.y=Math.floor(_/v.y),x.y=E.y*v.y,l.mapSize.y=E.y),null!==l.map||l.isPointLightShadow||this.type!==rn||(l.map=new Gc(x.x,x.y,d={minFilter:Qn,magFilter:Qn,format:fe}),l.map.texture.name=f.name+".shadowMap",l.mapPass=new Gc(x.x,x.y,d),l.camera.updateProjectionMatrix()),null===l.map&&(l.map=new Gc(x.x,x.y,d={minFilter:zn,magFilter:zn,format:fe}),l.map.texture.name=f.name+".shadowMap",l.camera.updateProjectionMatrix()),b.setRenderTarget(l.map),b.clear(),l.getViewportCount()),m=0;m<p;m++){var y=l.getViewport(m);S.set(E.x*y.x,E.y*y.y,E.x*y.z,E.y*y.w),s.viewport(S),l.updateMatrices(f,m),w=l.getFrustum(),!function t(n,e,i,r,o){if(!1===n.visible)return;var s=n.layers.test(e.layers);if(s&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&o===rn)&&(!n.frustumCulled||w.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse,n.matrixWorld);var a=g.update(n),u=n.material;if(Array.isArray(u))for(var c=a.groups,h=0,f=c.length;h<f;h++){var l,d=c[h],v=u[d.materialIndex];v&&v.visible&&(l=L(n,v,r,i.near,i.far,o),b.renderBufferDirect(i,null,a,l,n,d))}else u.visible&&(l=L(n,u,r,i.near,i.far,o),b.renderBufferDirect(i,null,a,l,n,null))}var p=n.children;for(var m=0,y=p.length;m<y;m++)t(p[m],e,i,r,o)}(n,e,l.camera,f,this.type)}l.isPointLightShadow||this.type!==rn||(v=l,a=e,u=void 0,u=g.update(M),T.uniforms.shadow_pass.value=v.map.texture,T.uniforms.resolution.value=v.mapSize,T.uniforms.radius.value=v.radius,b.setRenderTarget(v.mapPass),b.clear(),b.renderBufferDirect(a,null,u,T,M,null),A.uniforms.shadow_pass.value=v.mapPass.texture,A.uniforms.resolution.value=v.mapSize,A.uniforms.radius.value=v.radius,b.setRenderTarget(v.map),b.clear(),b.renderBufferDirect(a,null,u,A,M,null))}}O.needsUpdate=!1,b.setRenderTarget(i,r,o)}}}function Yc(t){return(Yc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Qc(t,n,e){return(n=function(t){t=function(t,n){if("object"!=Yc(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Yc(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Yc(t)?t:String(t)}(n))in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function Zc(h,e,t){var i=t.isWebGL2;var r=new function(){var n=!1,o=new Ot,e=null,s=new Ot(0,0,0,0);return{setMask:function(t){e===t||n||(h.colorMask(t,t,t,t),e=t)},setLocked:function(t){n=t},setClear:function(t,n,e,i,r){!0===r&&(t*=i,n*=i,e*=i),o.set(t,n,e,i),!1===s.equals(o)&&(h.clearColor(t,n,e,i),s.copy(o))},reset:function(){n=!1,e=null,s.set(-1,0,0,0)}}},o=new function(){var n=!1,e=null,i=null,r=null;return{setTest:function(t){(t?R:N)(h.DEPTH_TEST)},setMask:function(t){e===t||n||(h.depthMask(t),e=t)},setFunc:function(t){if(i!==t){if(t)switch(t){case Rn:h.depthFunc(h.NEVER);break;case Nn:h.depthFunc(h.ALWAYS);break;case Pn:h.depthFunc(h.LESS);break;case Fn:h.depthFunc(h.LEQUAL);break;case jn:h.depthFunc(h.EQUAL);break;case In:h.depthFunc(h.GEQUAL);break;case Cn:h.depthFunc(h.GREATER);break;case Dn:h.depthFunc(h.NOTEQUAL);break;default:h.depthFunc(h.LEQUAL)}else h.depthFunc(h.LEQUAL);i=t}},setLocked:function(t){n=t},setClear:function(t){r!==t&&(h.clearDepth(t),r=t)},reset:function(){n=!1,r=i=e=null}}},s=new function(){var n=!1,e=null,i=null,r=null,o=null,s=null,a=null,u=null,c=null;return{setTest:function(t){n||(t?R:N)(h.STENCIL_TEST)},setMask:function(t){e===t||n||(h.stencilMask(t),e=t)},setFunc:function(t,n,e){i===t&&r===n&&o===e||(h.stencilFunc(t,n,e),i=t,r=n,o=e)},setOp:function(t,n,e){s===t&&a===n&&u===e||(h.stencilOp(t,n,e),s=t,a=n,u=e)},setLocked:function(t){n=t},setClear:function(t){c!==t&&(h.clearStencil(t),c=t)},reset:function(){n=!1,c=u=a=s=o=r=i=e=null}}},t=h.getParameter(h.MAX_VERTEX_ATTRIBS),a=new Uint8Array(t),u=new Uint8Array(t),c=new Uint8Array(t),n={},f=null,l=null,d=null,v=null,p=null,m=null,y=null,b=null,g=null,_=!1,w=null,x=null,E=null,S=null,C=null,D=h.getParameter(h.MAX_COMBINED_TEXTURE_IMAGE_UNITS),T=!1,t=0,A=h.getParameter(h.VERSION),M=(-1!==A.indexOf("WebGL")?(t=parseFloat(/^WebGL\ ([0-9])/.exec(A)[1]),T=1<=t):-1!==A.indexOf("OpenGL ES")&&(t=parseFloat(/^OpenGL\ ES\ ([0-9])/.exec(A)[1]),T=2<=t),null),O={},k=new Ot,U=new Ot;function B(t,n,e){var i=new Uint8Array(4),r=h.createTexture();h.bindTexture(t,r),h.texParameteri(t,h.TEXTURE_MIN_FILTER,h.NEAREST),h.texParameteri(t,h.TEXTURE_MAG_FILTER,h.NEAREST);for(var o=0;o<e;o++)h.texImage2D(n+o,0,h.RGBA,1,1,0,h.RGBA,h.UNSIGNED_BYTE,i);return r}var L={};function G(t,n){a[t]=1,0===u[t]&&(h.enableVertexAttribArray(t),u[t]=1),c[t]!==n&&((i?h:e.get("ANGLE_instanced_arrays"))[i?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](t,n),c[t]=n)}function R(t){!0!==n[t]&&(h.enable(t),n[t]=!0)}function N(t){!1!==n[t]&&(h.disable(t),n[t]=!1)}L[h.TEXTURE_2D]=B(h.TEXTURE_2D,h.TEXTURE_2D,1),L[h.TEXTURE_CUBE_MAP]=B(h.TEXTURE_CUBE_MAP,h.TEXTURE_CUBE_MAP_POSITIVE_X,6),r.setClear(0,0,0,1),o.setClear(1),s.setClear(0),R(h.DEPTH_TEST),o.setFunc(Fn),I(!1),H(tn),R(h.CULL_FACE),j(un);var P=Qc(Qc(Qc({},vn,h.FUNC_ADD),pn,h.FUNC_SUBTRACT),mn,h.FUNC_REVERSE_SUBTRACT),F=(i?(P[yn]=h.MIN,P[bn]=h.MAX):null!==(A=e.get("EXT_blend_minmax"))&&(P[yn]=A.MIN_EXT,P[bn]=A.MAX_EXT),Qc(Qc(Qc(Qc(Qc(Qc(Qc(Qc(Qc(Qc(t={},gn,h.ZERO),_n,h.ONE),wn,h.SRC_COLOR),En,h.SRC_ALPHA),Ln,h.SRC_ALPHA_SATURATE),Mn,h.DST_COLOR),Tn,h.DST_ALPHA),xn,h.ONE_MINUS_SRC_COLOR),Sn,h.ONE_MINUS_SRC_ALPHA),On,h.ONE_MINUS_DST_COLOR),Qc(t,An,h.ONE_MINUS_DST_ALPHA));function j(t,n,e,i,r,o,s,a){if(t===un)l&&(N(h.BLEND),l=!1);else if(l||(R(h.BLEND),l=!0),t!==dn){if(t!==d||a!==_){if(v===vn&&y===vn||(h.blendEquation(h.FUNC_ADD),y=v=vn),a)switch(t){case cn:h.blendFuncSeparate(h.ONE,h.ONE_MINUS_SRC_ALPHA,h.ONE,h.ONE_MINUS_SRC_ALPHA);break;case hn:h.blendFunc(h.ONE,h.ONE);break;case fn:h.blendFuncSeparate(h.ZERO,h.ZERO,h.ONE_MINUS_SRC_COLOR,h.ONE_MINUS_SRC_ALPHA);break;case ln:h.blendFuncSeparate(h.ZERO,h.SRC_COLOR,h.ZERO,h.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}else switch(t){case cn:h.blendFuncSeparate(h.SRC_ALPHA,h.ONE_MINUS_SRC_ALPHA,h.ONE,h.ONE_MINUS_SRC_ALPHA);break;case hn:h.blendFunc(h.SRC_ALPHA,h.ONE);break;case fn:h.blendFunc(h.ZERO,h.ONE_MINUS_SRC_COLOR);break;case ln:h.blendFunc(h.ZERO,h.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}g=b=m=p=null,d=t,_=a}}else r=r||n,o=o||e,s=s||i,n===v&&r===y||(h.blendEquationSeparate(P[n],P[r]),v=n,y=r),e===p&&i===m&&o===b&&s===g||(h.blendFuncSeparate(F[e],F[i],F[o],F[s]),p=e,m=i,b=o,g=s),d=t,_=null}function I(t){w!==t&&(t?h.frontFace(h.CW):h.frontFace(h.CCW),w=t)}function H(t){t!==$t?(R(h.CULL_FACE),t!==x&&(t===tn?h.cullFace(h.BACK):t===nn?h.cullFace(h.FRONT):h.cullFace(h.FRONT_AND_BACK))):N(h.CULL_FACE),x=t}function X(t,n,e){t?(R(h.POLYGON_OFFSET_FILL),S===n&&C===e||(h.polygonOffset(n,e),S=n,C=e)):N(h.POLYGON_OFFSET_FILL)}function V(t){void 0===t&&(t=h.TEXTURE0+D-1),M!==t&&(h.activeTexture(t),M=t)}return{buffers:{color:r,depth:o,stencil:s},initAttributes:function(){for(var t=0,n=a.length;t<n;t++)a[t]=0},enableAttribute:function(t){G(t,0)},enableAttributeAndDivisor:G,disableUnusedAttributes:function(){for(var t=0,n=u.length;t!==n;++t)u[t]!==a[t]&&(h.disableVertexAttribArray(t),u[t]=0)},enable:R,disable:N,useProgram:function(t){return f!==t&&(h.useProgram(t),f=t,!0)},setBlending:j,setMaterial:function(t,n,e){(t.side===an?N:R)(h.CULL_FACE);var i=t.side===sn,n=(I(i=n?!i:i),t.blending!==cn||!1!==t.transparent&&!1!==e.userData.transparent?j(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.premultipliedAlpha):j(un),o.setFunc(t.depthFunc),o.setTest(t.depthTest),o.setMask(t.depthWrite),r.setMask(t.colorWrite),t.stencilWrite);s.setTest(n),n&&(s.setMask(t.stencilWriteMask),s.setFunc(t.stencilFunc,t.stencilRef,t.stencilFuncMask),s.setOp(t.stencilFail,t.stencilZFail,t.stencilZPass)),X(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits)},setFlipSided:I,setCullFace:H,setLineWidth:function(t){t!==E&&(T&&h.lineWidth(t),E=t)},setPolygonOffset:X,setScissorTest:function(t){(t?R:N)(h.SCISSOR_TEST)},activeTexture:V,bindTexture:function(t,n){null===M&&V();var e=O[M];void 0===e&&(O[M]=e={type:void 0,texture:void 0}),e.type===t&&e.texture===n||(h.bindTexture(t,n||L[t]),e.type=t,e.texture=n)},unbindTexture:function(){var t=O[M];void 0!==t&&void 0!==t.type&&(h.bindTexture(t.type,null),t.type=void 0,t.texture=void 0)},compressedTexImage2D:function(){try{h.compressedTexImage2D.apply(h,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage2D:function(){try{h.texImage2D.apply(h,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage3D:function(){try{h.texImage3D.apply(h,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},scissor:function(t){!1===k.equals(t)&&(h.scissor(t.x,t.y,t.z,t.w),k.copy(t))},viewport:function(t){!1===U.equals(t)&&(h.viewport(t.x,t.y,t.z,t.w),U.copy(t))},reset:function(){for(var t=0;t<u.length;t++)1===u[t]&&(h.disableVertexAttribArray(t),u[t]=0);n={},O={},x=w=d=f=M=null,r.reset(),o.reset(),s.reset()}}}function qc(t){return(qc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Kc(t,n,e){return(n=function(t){t=function(t,n){if("object"!=qc(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=qc(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==qc(t)?t:String(t)}(n))in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function Jc(m,i,y,b,r,g,u){var o,_=r.isWebGL2,n=r.maxTextures,w=r.maxCubemapSize,D=r.maxTextureSize,k=r.maxSamples,s=new WeakMap,e=!1;try{e="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(t){}function a(t,n){return e?new OffscreenCanvas(t,n):st.a.document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function x(t,n,e,i){var r=1;return(r=t.width>i||t.height>i?i/Math.max(t.width,t.height):r)<1||!0===n?"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?(n=(i=n?St.floorPowerOfTwo:Math.floor)(r*t.width),i=i(r*t.height),void 0===o&&(o=a(n,i)),(r=e?a(n,i):o).width=n,r.height=i,r.getContext("2d").drawImage(t,0,0,n,i),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+t.width+"x"+t.height+") to ("+n+"x"+i+")."),r):("data"in t&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+t.width+"x"+t.height+")."),t):t}function E(t){return St.isPowerOfTwo(t.width)&&St.isPowerOfTwo(t.height)}function S(t,n){return t.generateMipmaps&&n&&t.minFilter!==zn&&t.minFilter!==Qn}function T(t,n,e,i){m.generateMipmap(t),b.get(n).ho=Math.log(Math.max(e,i))*Math.LOG2E}function A(t,n,e){if(!1===_)return n;if(null!==t){if(void 0!==m[t])return m[t];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+t+"'")}t=n;return n===m.RED&&(e===m.FLOAT&&(t=m.R32F),e===m.HALF_FLOAT&&(t=m.R16F),e===m.UNSIGNED_BYTE)&&(t=m.R8),n===m.RGB&&(e===m.FLOAT&&(t=m.RGB32F),e===m.HALF_FLOAT&&(t=m.RGB16F),e===m.UNSIGNED_BYTE)&&(t=m.RGB8),(t=n===m.RGBA&&(e===m.FLOAT&&(t=m.RGBA32F),e===m.HALF_FLOAT&&(t=m.RGBA16F),e===m.UNSIGNED_BYTE)?m.RGBA8:t)!==m.R16F&&t!==m.R32F&&t!==m.RGBA16F&&t!==m.RGBA32F||i.get("EXT_color_buffer_float"),t}function c(t){return t===zn||t===Wn||t===Yn?m.NEAREST:m.LINEAR}function h(t){var n,e,t=t.target;t.removeEventListener("dispose",h),n=t,void 0!==(e=b.get(n)).fo&&(m.deleteTexture(e.do),b.remove(n)),t.isVideoTexture&&s.delete(t),u.memory.textures--}function f(t){var t=t.target,n=(t.removeEventListener("dispose",f),b.get(t)),e=b.get(t.texture);if(t){if(void 0!==e.do&&m.deleteTexture(e.do),t.depthTexture&&t.depthTexture.dispose(),t.isWebGLCubeRenderTarget)for(var i=0;i<6;i++)m.deleteFramebuffer(n.vo[i]),n.po&&m.deleteRenderbuffer(n.po[i]);else m.deleteFramebuffer(n.vo),n.po&&m.deleteRenderbuffer(n.po),n.mo&&m.deleteFramebuffer(n.mo),n.yo&&m.deleteRenderbuffer(n.yo),n.bo&&m.deleteRenderbuffer(n.bo);b.remove(t.texture),b.remove(t)}u.memory.textures--}var l=0;function d(t,n){var e,i=b.get(t);if(t.isVideoTexture&&(e=t,r=u.render.frame,s.get(e)!==r)&&(s.set(e,r),e.update()),0<t.version&&i._o!==t.version){var r=t.image;if(void 0===r)st.a.environment===B.a.BROWSER&&console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==r.complete)return void N(i,t,n);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}y.activeTexture(m.TEXTURE0+n),y.bindTexture(m.TEXTURE_2D,i.do)}function v(t,n){if(6===t.image.length){var e=b.get(t);if(0<t.version&&e._o!==t.version){R(e,t),y.activeTexture(m.TEXTURE0+n),y.bindTexture(m.TEXTURE_CUBE_MAP,e.do),m.pixelStorei(m.UNPACK_FLIP_Y_WEBGL,t.flipY);for(var i=t&&(t.isCompressedTexture||t.image[0].isCompressedTexture),r=t.image[0]&&t.image[0].isDataTexture,o=[],s=0;s<6;s++)o[s]=i||r?r?t.image[s].image:t.image[s]:x(t.image[s],!1,!0,w);var a=o[0],u=E(a)||_,c=g.convert(t.format),h=g.convert(t.type),f=A(t.internalFormat,c,h);if(L(m.TEXTURE_CUBE_MAP,t,u),i){for(s=0;s<6;s++)for(var l=o[s].mipmaps,d=0;d<l.length;d++){var v=l[d];t.format!==fe&&t.format!==he?null!==c?y.compressedTexImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+s,d,f,v.width,v.height,0,v.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):y.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+s,d,f,v.width,v.height,0,c,h,v.data)}e.ho=l.length-1}else{l=t.mipmaps;for(s=0;s<6;s++)if(r){y.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+s,0,f,o[s].width,o[s].height,0,c,h,o[s].data);for(d=0;d<l.length;d++){var p=(v=l[d]).image[s].image;y.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+s,d+1,f,p.width,p.height,0,c,h,p.data)}}else{y.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+s,0,f,c,h,o[s]);for(d=0;d<l.length;d++){v=l[d];y.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+s,d+1,f,c,h,v.image[s])}}e.ho=l.length}S(t,u)&&T(m.TEXTURE_CUBE_MAP,t,a.width,a.height),e._o=t.version,t.onUpdate&&t.onUpdate(t)}else y.activeTexture(m.TEXTURE0+n),y.bindTexture(m.TEXTURE_CUBE_MAP,e.do)}}function p(t,n){y.activeTexture(m.TEXTURE0+n),y.bindTexture(m.TEXTURE_CUBE_MAP,b.get(t).do)}var M=Kc(Kc(Kc({},Hn,m.REPEAT),Xn,m.CLAMP_TO_EDGE),Vn,m.MIRRORED_REPEAT),O=Kc(Kc(Kc(Kc(Kc(Kc({},zn,m.NEAREST),Wn,m.NEAREST_MIPMAP_NEAREST),Yn,m.NEAREST_MIPMAP_LINEAR),Qn,m.LINEAR),Zn,m.LINEAR_MIPMAP_NEAREST),qn,m.LINEAR_MIPMAP_LINEAR);function L(t,n,e){e?(m.texParameteri(t,m.TEXTURE_WRAP_S,M[n.wrapS]),m.texParameteri(t,m.TEXTURE_WRAP_T,M[n.wrapT]),t!==m.TEXTURE_3D&&t!==m.TEXTURE_2D_ARRAY||m.texParameteri(t,m.TEXTURE_WRAP_R,M[n.wrapR]),m.texParameteri(t,m.TEXTURE_MAG_FILTER,O[n.magFilter]),m.texParameteri(t,m.TEXTURE_MIN_FILTER,O[n.minFilter])):(m.texParameteri(t,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE),m.texParameteri(t,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE),t!==m.TEXTURE_3D&&t!==m.TEXTURE_2D_ARRAY||m.texParameteri(t,m.TEXTURE_WRAP_R,m.CLAMP_TO_EDGE),n.wrapS===Xn&&n.wrapT===Xn||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),m.texParameteri(t,m.TEXTURE_MAG_FILTER,c(n.magFilter)),m.texParameteri(t,m.TEXTURE_MIN_FILTER,c(n.minFilter)),n.minFilter!==zn&&n.minFilter!==Qn&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter."));e=i.get("EXT_texture_filter_anisotropic");!e||n.type===ie&&null===i.get("OES_texture_float_linear")||n.type===re&&null===(_||i.get("OES_texture_half_float_linear"))||(1<n.anisotropy||b.get(n).wo)&&(m.texParameterf(t,e.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(n.anisotropy,r.getMaxAnisotropy())),b.get(n).wo=n.anisotropy)}function R(t,n){void 0===t.fo&&(t.fo=!0,n.addEventListener("dispose",h),t.do=m.createTexture(),u.memory.textures++)}function N(t,n,e){var i=m.TEXTURE_2D,e=(n.isDataTexture2DArray&&(i=m.TEXTURE_2D_ARRAY),n.isDataTexture3D&&(i=m.TEXTURE_3D),R(t,n),y.activeTexture(m.TEXTURE0+e),y.bindTexture(i,t.do),m.pixelStorei(m.UNPACK_FLIP_Y_WEBGL,n.flipY),m.pixelStorei(m.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n.premultiplyAlpha),m.pixelStorei(m.UNPACK_ALIGNMENT,n.unpackAlignment),e=n,!_&&(e.wrapS!==Xn||e.wrapT!==Xn||e.minFilter!==zn&&e.minFilter!==Qn)&&!1===E(n.image)),e=x(n.image,e,!1,D),r=E(e)||_,o=g.convert(n.format),s=g.convert(n.type),a=A(n.internalFormat,o,s);L(i,n,r);var u,c=n.mipmaps;if(n.isDepthTexture)a=m.DEPTH_COMPONENT,_?a=n.type===ie?m.DEPTH_COMPONENT32F:n.type===ee?m.DEPTH_COMPONENT24:n.type===ue?m.DEPTH24_STENCIL8:m.DEPTH_COMPONENT16:n.type===ie&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),n.format===ve&&a===m.DEPTH_COMPONENT&&n.type!==te&&n.type!==ee&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),n.type=te,s=g.convert(n.type)),n.format===pe&&a===m.DEPTH_COMPONENT&&(a=m.DEPTH_STENCIL,n.type!==ue)&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),n.type=ue,s=g.convert(n.type)),y.texImage2D(m.TEXTURE_2D,0,a,e.width,e.height,0,o,s,null);else if(n.isDataTexture)if(0<c.length&&r){for(var h=0,f=c.length;h<f;h++)u=c[h],y.texImage2D(m.TEXTURE_2D,h,a,u.width,u.height,0,o,s,u.data);n.generateMipmaps=!1,t.ho=c.length-1}else y.texImage2D(m.TEXTURE_2D,0,a,e.width,e.height,0,o,s,e.data),t.ho=0;else if(n.isCompressedTexture){for(h=0,f=c.length;h<f;h++)u=c[h],n.format!==fe&&n.format!==he?null!==o?y.compressedTexImage2D(m.TEXTURE_2D,h,a,u.width,u.height,0,u.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):y.texImage2D(m.TEXTURE_2D,h,a,u.width,u.height,0,o,s,u.data);t.ho=c.length-1}else if(n.isDataTexture2DArray)y.texImage3D(m.TEXTURE_2D_ARRAY,0,a,e.width,e.height,e.depth,0,o,s,e.data),t.ho=0;else if(n.isDataTexture3D)y.texImage3D(m.TEXTURE_3D,0,a,e.width,e.height,e.depth,0,o,s,e.data),t.ho=0;else if(0<c.length&&r){for(h=0,f=c.length;h<f;h++)u=c[h],y.texImage2D(m.TEXTURE_2D,h,a,o,s,u);n.generateMipmaps=!1,t.ho=c.length-1}else y.texImage2D(m.TEXTURE_2D,0,a,o,s,e),t.ho=0;S(n,r)&&T(i,n,e.width,e.height),t._o=n.version,n.onUpdate&&n.onUpdate(n)}function P(t,n,e,i){var r=g.convert(n.texture.format),o=g.convert(n.texture.type),s=A(n.texture.internalFormat,r,o);y.texImage2D(i,0,s,n.width,n.height,0,r,o,null),m.bindFramebuffer(m.FRAMEBUFFER,t),m.framebufferTexture2D(m.FRAMEBUFFER,e,i,b.get(n.texture).do,0),m.bindFramebuffer(m.FRAMEBUFFER,null)}function F(t,n,e){var i,r,o;m.bindRenderbuffer(m.RENDERBUFFER,t),n.depthBuffer&&!n.stencilBuffer?(r=m.DEPTH_COMPONENT16,e?((o=n.depthTexture)&&o.isDepthTexture&&(o.type===ie?r=m.DEPTH_COMPONENT32F:o.type===ee&&(r=m.DEPTH_COMPONENT24)),o=j(n),m.renderbufferStorageMultisample(m.RENDERBUFFER,o,r,n.width,n.height)):m.renderbufferStorage(m.RENDERBUFFER,r,n.width,n.height),m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_ATTACHMENT,m.RENDERBUFFER,t)):n.depthBuffer&&n.stencilBuffer?(e?(o=j(n),m.renderbufferStorageMultisample(m.RENDERBUFFER,o,m.DEPTH24_STENCIL8,n.width,n.height)):m.renderbufferStorage(m.RENDERBUFFER,m.DEPTH_STENCIL,n.width,n.height),m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_STENCIL_ATTACHMENT,m.RENDERBUFFER,t)):(t=g.convert(n.texture.format),i=g.convert(n.texture.type),r=A(n.texture.internalFormat,t,i),e?(o=j(n),m.renderbufferStorageMultisample(m.RENDERBUFFER,o,r,n.width,n.height)):m.renderbufferStorage(m.RENDERBUFFER,r,n.width,n.height)),m.bindRenderbuffer(m.RENDERBUFFER,null)}function U(t){var n=b.get(t),e=!0===t.isWebGLCubeRenderTarget;if(t.depthTexture){if(e)throw new Error("target.depthTexture not supported in Cube render targets");var i=n.vo,r=t;if(r&&r.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(m.bindFramebuffer(m.FRAMEBUFFER,i),!r.depthTexture||!r.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");if(b.get(r.depthTexture).do&&r.depthTexture.image.width===r.width&&r.depthTexture.image.height===r.height||(r.depthTexture.image.width=r.width,r.depthTexture.image.height=r.height,r.depthTexture.needsUpdate=!0),d(r.depthTexture,0),i=b.get(r.depthTexture).do,r.depthTexture.format===ve)m.framebufferTexture2D(m.FRAMEBUFFER,m.DEPTH_ATTACHMENT,m.TEXTURE_2D,i,0);else{if(r.depthTexture.format!==pe)throw new Error("Unknown depthTexture format");m.framebufferTexture2D(m.FRAMEBUFFER,m.DEPTH_STENCIL_ATTACHMENT,m.TEXTURE_2D,i,0)}}else if(e){n.po=[];for(var o=0;o<6;o++)m.bindFramebuffer(m.FRAMEBUFFER,n.vo[o]),n.po[o]=m.createRenderbuffer(),F(n.po[o],t,!1)}else m.bindFramebuffer(m.FRAMEBUFFER,n.vo),n.po=m.createRenderbuffer(),F(n.po,t,!1);m.bindFramebuffer(m.FRAMEBUFFER,null)}function j(t){return _&&t.isWebGLMultisampleRenderTarget?Math.min(k,t.samples):0}var I=!1,C=!1;this.allocateTextureUnit=function(){var t=l;return n<=t&&console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+n),l+=1,t},this.resetTextureUnits=function(){l=0},this.setTexture2D=d,this.setTexture2DArray=function(t,n){var e=b.get(t);0<t.version&&e._o!==t.version?N(e,t,n):(y.activeTexture(m.TEXTURE0+n),y.bindTexture(m.TEXTURE_2D_ARRAY,e.do))},this.setTexture3D=function(t,n){var e=b.get(t);0<t.version&&e._o!==t.version?N(e,t,n):(y.activeTexture(m.TEXTURE0+n),y.bindTexture(m.TEXTURE_3D,e.do))},this.setTextureCube=v,this.setTextureCubeDynamic=p,this.setupRenderTarget=function(t){var n,e=b.get(t),i=b.get(t.texture),r=(t.addEventListener("dispose",f),i.do=m.createTexture(),u.memory.textures++,!0===t.isWebGLCubeRenderTarget),o=!0===t.isWebGLMultisampleRenderTarget,s=E(t)||_;if(!_||t.texture.format!==he||t.texture.type!==ie&&t.texture.type!==re||(t.texture.format=fe,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),r){e.vo=[];for(var a=0;a<6;a++)e.vo[a]=m.createFramebuffer()}else e.vo=m.createFramebuffer(),o&&(_?(e.mo=m.createFramebuffer(),e.yo=m.createRenderbuffer(),m.bindRenderbuffer(m.RENDERBUFFER,e.yo),o=g.convert(t.texture.format),n=g.convert(t.texture.type),o=A(t.texture.internalFormat,o,n),n=j(t),m.renderbufferStorageMultisample(m.RENDERBUFFER,n,o,t.width,t.height),m.bindFramebuffer(m.FRAMEBUFFER,e.mo),m.framebufferRenderbuffer(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0,m.RENDERBUFFER,e.yo),m.bindRenderbuffer(m.RENDERBUFFER,null),t.depthBuffer&&(e.bo=m.createRenderbuffer(),F(e.bo,t,!0)),m.bindFramebuffer(m.FRAMEBUFFER,null)):console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2."));if(r){y.bindTexture(m.TEXTURE_CUBE_MAP,i.do),L(m.TEXTURE_CUBE_MAP,t.texture,s);for(a=0;a<6;a++)P(e.vo[a],t,m.COLOR_ATTACHMENT0,m.TEXTURE_CUBE_MAP_POSITIVE_X+a);S(t.texture,s)&&T(m.TEXTURE_CUBE_MAP,t.texture,t.width,t.height),y.bindTexture(m.TEXTURE_CUBE_MAP,null)}else y.bindTexture(m.TEXTURE_2D,i.do),L(m.TEXTURE_2D,t.texture,s),P(e.vo,t,m.COLOR_ATTACHMENT0,m.TEXTURE_2D),S(t.texture,s)&&T(m.TEXTURE_2D,t.texture,t.width,t.height),y.bindTexture(m.TEXTURE_2D,null);t.depthBuffer&&U(t)},this.updateRenderTargetMipmap=function(t){var n,e,i=t.texture;S(i,E(t)||_)&&(n=t.isWebGLCubeRenderTarget?m.TEXTURE_CUBE_MAP:m.TEXTURE_2D,e=b.get(i).do,y.bindTexture(n,e),T(n,i,t.width,t.height),y.bindTexture(n,null))},this.updateMultisampleRenderTarget=function(t){var n,e,i,r;t.isWebGLMultisampleRenderTarget&&(_?(n=b.get(t),m.bindFramebuffer(m.READ_FRAMEBUFFER,n.mo),m.bindFramebuffer(m.DRAW_FRAMEBUFFER,n.vo),e=t.width,i=t.height,r=m.COLOR_BUFFER_BIT,t.depthBuffer&&(r|=m.DEPTH_BUFFER_BIT),t.stencilBuffer&&(r|=m.STENCIL_BUFFER_BIT),m.blitFramebuffer(0,0,e,i,0,0,e,i,r,m.NEAREST),m.bindFramebuffer(m.FRAMEBUFFER,n.mo)):console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2."))},this.safeSetTexture2D=function(t,n){t&&t.isWebGLRenderTarget&&(!1===I&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),I=!0),t=t.texture),d(t,n)},this.safeSetTextureCube=function(t,n){t&&t.isWebGLCubeRenderTarget&&(!1===C&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),C=!0),t=t.texture),(t&&t.isCubeTexture||Array.isArray(t.image)&&6===t.image.length?v:p)(t,n)}}function $c(e,i,t){var r=t.isWebGL2;return{convert:function(t){var n;if(t===Kn)return e.UNSIGNED_BYTE;if(t===oe)return e.UNSIGNED_SHORT_4_4_4_4;if(t===se)return e.UNSIGNED_SHORT_5_5_5_1;if(t===ae)return e.UNSIGNED_SHORT_5_6_5;if(t===Jn)return e.BYTE;if(t===$n)return e.SHORT;if(t===te)return e.UNSIGNED_SHORT;if(t===ne)return e.INT;if(t===ee)return e.UNSIGNED_INT;if(t===ie)return e.FLOAT;if(t===re)return r?e.HALF_FLOAT:null!==(n=i.get("OES_texture_half_float"))?n.HALF_FLOAT_OES:null;if(t===ce)return e.ALPHA;if(t===he)return e.RGB;if(t===fe)return e.RGBA;if(t===le)return e.LUMINANCE;if(t===de)return e.LUMINANCE_ALPHA;if(t===ve)return e.DEPTH_COMPONENT;if(t===pe)return e.DEPTH_STENCIL;if(t===me)return e.RED;if(t===ye)return e.RED_INTEGER;if(t===be)return e.RG;if(t===ge)return e.RG_INTEGER;if(t===_e)return e.RGB_INTEGER;if(t===we)return e.RGBA_INTEGER;if(t===xe||t===Ee||t===Se||t===Te){if(null===(n=i.get("WEBGL_compressed_texture_s3tc")))return null;if(t===xe)return n.COMPRESSED_RGB_S3TC_DXT1_EXT;if(t===Ee)return n.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(t===Se)return n.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(t===Te)return n.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(t===Ae||t===Me||t===Oe||t===Le){if(null===(n=i.get("WEBGL_compressed_texture_pvrtc")))return null;if(t===Ae)return n.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(t===Me)return n.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(t===Oe)return n.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(t===Le)return n.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(t===Re)return null!==(n=i.get("WEBGL_compressed_texture_etc1"))?n.COMPRESSED_RGB_ETC1_WEBGL:null;if((t===Ne||t===Pe)&&null!==(n=i.get("WEBGL_compressed_texture_etc"))){if(t===Ne)return n.COMPRESSED_RGB8_ETC2;if(t===Pe)return n.COMPRESSED_RGBA8_ETC2_EAC}return t===Fe||t===je||t===Ie||t===Ce||t===De||t===ke||t===Ue||t===Be||t===Ge||t===He||t===Xe||t===Ve||t===ze||t===We||t===Qe||t===Ze||t===qe||t===Ke||t===Je||t===$e||t===ti||t===ni||t===ei||t===ii||t===ri||t===oi||t===si||t===ai?null!==(n=i.get("WEBGL_compressed_texture_astc"))?t:null:t===Ye?null!==(n=i.get("EXT_texture_compression_bptc"))?t:null:t===ue?r?e.UNSIGNED_INT_24_8:null!==(n=i.get("WEBGL_depth_texture"))?n.UNSIGNED_INT_24_8_WEBGL:null:void 0}}}function th(t){dt.call(this),this.cameras=t||[]}function nh(){a.call(this),this.type="Group"}function eh(d,n){var e=this,m=null,i=1,v=null,r="local-floor",p=null,y=[],o=new Map,b=new dt,g=(b.layers.enable(1),b.viewport=new Ot,new dt),_=(g.layers.enable(2),g.viewport=new Ot,new th([b,g])),w=(_.layers.enable(1),_.layers.enable(2),null),x=null;function s(t){var n=o.get(t.inputSource);n&&(n.targetRay&&n.targetRay.dispatchEvent({type:t.type}),n.grip)&&n.grip.dispatchEvent({type:t.type})}function a(){o.forEach(function(t,n){t.targetRay&&(t.targetRay.dispatchEvent({type:"disconnected",data:n}),t.targetRay.visible=!1),t.grip&&(t.grip.dispatchEvent({type:"disconnected",data:n}),t.grip.visible=!1)}),o.clear(),d.setFramebuffer(null),d.setRenderTarget(d.getRenderTarget()),h.stop(),e.isPresenting=!1,e.dispatchEvent({type:"sessionend"})}function u(t){v=t,h.setContext(m),h.start(),e.isPresenting=!0,e.dispatchEvent({type:"sessionstart"})}function c(t){for(var n=m.inputSources,e=0;e<y.length;e++)o.set(n[e],y[e]);for(e=0;e<t.removed.length;e++){var i=t.removed[e];(r=o.get(i))&&(r.targetRay&&r.targetRay.dispatchEvent({type:"disconnected",data:i}),r.grip&&r.grip.dispatchEvent({type:"disconnected",data:i}),o.delete(i))}for(e=0;e<t.added.length;e++){var r,i=t.added[e];(r=o.get(i))&&(r.targetRay&&r.targetRay.dispatchEvent({type:"connected",data:i}),r.grip)&&r.grip.dispatchEvent({type:"connected",data:i})}}this.enabled=!1,this.isPresenting=!1,this.getController=function(t){var n=y[t];return void 0===n&&(y[t]=n={}),void 0===n.targetRay&&(n.targetRay=new nh,n.targetRay.matrixAutoUpdate=!1,n.targetRay.visible=!1),n.targetRay},this.getControllerGrip=function(t){var n=y[t];return void 0===n&&(y[t]=n={}),void 0===n.grip&&(n.grip=new nh,n.grip.matrixAutoUpdate=!1,n.grip.visible=!1),n.grip},this.setFramebufferScaleFactor=function(t){i=t,1==e.isPresenting&&console.warn("WebXRManager: Cannot change framebuffer scale while presenting VR content")},this.setReferenceSpaceType=function(t){r=t},this.getReferenceSpace=function(){return v},this.getSession=function(){return m},this.setSession=function(t){null!==(m=t)&&(m.addEventListener("select",s),m.addEventListener("selectstart",s),m.addEventListener("selectend",s),m.addEventListener("squeeze",s),m.addEventListener("squeezestart",s),m.addEventListener("squeezeend",s),m.addEventListener("end",a),t={antialias:(t=n.getContextAttributes()).antialias,alpha:t.alpha,depth:t.depth,stencil:t.stencil,framebufferScaleFactor:i},t=new XRWebGLLayer(m,n,t),m.updateRenderState({baseLayer:t}),m.requestReferenceSpace(r).then(u),m.addEventListener("inputsourceschange",c))};var E=new Tt,S=new Tt;function T(t,n){null===n?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(n.matrixWorld,t.matrix),t.matrixWorldInverse.getInverse(t.matrixWorld)}this.getCamera=function(t){_.near=g.near=b.near=t.near,_.far=g.far=b.far=t.far,w===_.near&&x===_.far||(m.updateRenderState({depthNear:_.near,depthFar:_.far}),w=_.near,x=_.far);var n=t.parent,e=_.cameras;T(_,n);for(var i=0;i<e.length;i++)T(e[i],n);t.matrixWorld.copy(_.matrixWorld);for(var r,o,s,a,u,c,h,f,l,d,v=t.children,i=0,p=v.length;i<p;i++)v[i].updateMatrixWorld(!0);return t=_,r=b,o=g,E.setFromMatrixPosition(r.matrixWorld),S.setFromMatrixPosition(o.matrixWorld),s=E.distanceTo(S),a=r.projectionMatrix.elements,o=o.projectionMatrix.elements,u=a[14]/(a[10]-1),c=a[14]/(a[10]+1),h=(a[9]+1)/a[5],f=(a[9]-1)/a[5],a=(a[8]-1)/a[0],o=(o[8]+1)/o[0],l=u*a,d=u*o,a=(o=s/(o-a))*-a,r.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(a),t.translateZ(o),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.getInverse(t.matrixWorld),r=u+o,u=c+o,t.projectionMatrix.makePerspective(l-a,s-a+d,h*c/u*r,f*c/u*r,r,u),_};var A=null;var h=new Ps;h.setAnimationLoop(function(t,n){if(null!==(p=n.getViewerPose(v))){var e=p.views,i=m.renderState.baseLayer;d.setFramebuffer(i.framebuffer);for(var r=0;r<e.length;r++){var o=e[r],s=i.getViewport(o),a=_.cameras[r];a.matrix.fromArray(o.transform.matrix),a.projectionMatrix.fromArray(o.projectionMatrix),a.viewport.set(s.x,s.y,s.width,s.height),0===r&&_.matrix.copy(a.matrix)}}for(var u=m.inputSources,r=0;r<y.length;r++){var c=y[r],h=u[r],f=null,l=null;h&&(c.targetRay&&null!==(f=n.getPose(h.targetRaySpace,v))&&(c.targetRay.matrix.fromArray(f.transform.matrix),c.targetRay.matrix.decompose(c.targetRay.position,c.targetRay.rotation,c.targetRay.scale)),c.grip)&&h.gripSpace&&null!==(l=n.getPose(h.gripSpace,v))&&(c.grip.matrix.fromArray(l.transform.matrix),c.grip.matrix.decompose(c.grip.position,c.grip.rotation,c.grip.scale)),c.targetRay&&(c.targetRay.visible=null!==f),c.grip&&(c.grip.visible=null!==l)}A&&A(t,n)}),this.setAnimationLoop=function(t){A=t},this.dispose=function(){}}function ih(t){var _,w,x,E,v,m,y,S,k,p,f,o,u,s,U,B,G,l,i=void 0!==(t=t||{}).canvas?t.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),n=void 0!==t.context?t.context:null,e=void 0!==t.alpha&&t.alpha,H=void 0===t.depth||t.depth,X=void 0===t.stencil||t.stencil,V=void 0!==t.antialias&&t.antialias,z=void 0===t.premultipliedAlpha||t.premultipliedAlpha,W=void 0!==t.preserveDrawingBuffer&&t.preserveDrawingBuffer,Y=void 0!==t.powerPreference?t.powerPreference:"default",Q=void 0!==t.failIfMajorPerformanceCaveat&&t.failIfMajorPerformanceCaveat,Z=void 0!==t.useWebGL2&&t.useWebGL2,b=null,g=null,T=(this.domElement=i,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.outputEncoding=li,this.physicallyCorrectLights=!1,this.toneMapping=1,this.toneMappingExposure=1,this.toneMappingWhitePoint=1,this.maxMorphTargets=8,this.maxMorphNormals=4,this),q=!1,K=null,J=0,$=0,a=null,d=null,A=-1,M={geometry:null,program:null,wireframe:!1},O=null,tt=null,L=new Ot,c=new Ot,nt=null,r=i.width,R=i.height,N=1,et=null,it=null,h=new Ot(0,0,r,R),P=new Ot(0,0,r,R),rt=!1,ot=new Vt,F=new su,st=!1,at=!1,j=new At,I=new Tt;function ut(){return null===a?N:1}try{var ct={alpha:e,depth:H,stencil:X,antialias:V,premultipliedAlpha:z,preserveDrawingBuffer:W,powerPreference:Y,failIfMajorPerformanceCaveat:Q,xrCompatible:!1};if(i.addEventListener("webglcontextlost",lt,!1),i.addEventListener("webglcontextrestored",dt,!1),null===(_=Z?i.getContext("webgl2",ct):n||i.getContext("webgl",ct)||i.getContext("experimental-webgl",ct)))throw null!==i.getContext("webgl")?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.");void 0===_.getShaderPrecisionFormat&&(_.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(t){throw console.error("THREE.WebGLRenderer: "+t.message),t}function ht(){w=new au(_),!1===(x=new ou(_,w,t)).isWebGL2&&(w.get("WEBGL_depth_texture"),w.get("OES_texture_float"),w.get("OES_texture_half_float"),w.get("OES_texture_half_float_linear"),w.get("OES_standard_derivatives"),w.get("OES_element_index_uint"),w.get("ANGLE_instanced_arrays")),w.get("OES_texture_float_linear"),l=new $c(_,w,x),(E=new Zc(_,w,x)).scissor(c.copy(P).multiplyScalar(N).floor()),E.viewport(L.copy(h).multiplyScalar(N).floor()),v=new hu(_),m=new Rc,y=new Jc(_,w,E,m,x,l,v),S=new Fs(_,x),k=new uu(_,S,v),p=new du(_,k,S,v),U=new lu(_),f=new Lc(T,w,x),o=new jc,u=new Bc,s=new iu(T,E,p,z),B=new ru(_,w,v,x),G=new cu(_,w,v,x),v.programs=f.programs,T.capabilities=x,T.extensions=w,T.properties=m,T.renderLists=o,T.state=E,T.info=v}ht();var C=new eh(T,_),ft=(this.xr=C,new Wc(T,p,x.maxTextureSize));function lt(t){t.preventDefault(),q=!0}function dt(){q=!1,ht()}function vt(t){var t=t.target;t.removeEventListener("dispose",vt),pt(t=t),m.remove(t)}function pt(t){var n=m.get(t).program;(t.program=void 0)!==n&&f.releaseProgram(n)}this.shadowMap=ft,this.getContext=function(){return _},this.getContextAttributes=function(){return _.getContextAttributes()},this.forceContextLoss=function(){var t=w.get("WEBGL_lose_context");t&&t.loseContext()},this.forceContextRestore=function(){var t=w.get("WEBGL_lose_context");t&&t.restoreContext()},this.getPixelRatio=function(){return N},this.setPixelRatio=function(t){void 0!==t&&(N=t,this.setSize(r,R,!1))},this.getSize=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getsize() now requires a Vector2 as an argument"),t=new Mt),t.set(r,R)},this.setSize=function(t,n,e){C.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(r=t,R=n,i.width=Math.floor(t*N),i.height=Math.floor(n*N),!1!==e&&(i.style.width=t+"px",i.style.height=n+"px"),this.setViewport(0,0,t,n))},this.getDrawingBufferSize=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getdrawingBufferSize() now requires a Vector2 as an argument"),t=new Mt),t.set(r*N,R*N).floor()},this.setDrawingBufferSize=function(t,n,e){r=t,R=n,N=e,i.width=Math.floor(t*e),i.height=Math.floor(n*e),this.setViewport(0,0,t,n)},this.getCurrentViewport=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getCurrentViewport() now requires a Vector4 as an argument"),t=new Ot),t.copy(L)},this.getViewport=function(t){return t.copy(h)},this.setViewport=function(t,n,e,i){t.isVector4?h.set(t.x,t.y,t.z,t.w):h.set(t,n,e,i),E.viewport(L.copy(h).multiplyScalar(N).floor())},this.getScissor=function(t){return t.copy(P)},this.setScissor=function(t,n,e,i){t.isVector4?P.set(t.x,t.y,t.z,t.w):P.set(t,n,e,i),E.scissor(c.copy(P).multiplyScalar(N).floor())},this.getScissorTest=function(){return rt},this.setScissorTest=function(t){E.setScissorTest(rt=t)},this.setOpaqueSort=function(t){et=t},this.setTransparentSort=function(t){it=t},this.getClearColor=function(){return s.getClearColor()},this.setClearColor=function(){s.setClearColor.apply(s,arguments)},this.getClearAlpha=function(){return s.getClearAlpha()},this.setClearAlpha=function(){s.setClearAlpha.apply(s,arguments)},this.clear=function(t,n,e){var i=0;void 0!==t&&!t||(i|=_.COLOR_BUFFER_BIT),void 0!==n&&!n||(i|=_.DEPTH_BUFFER_BIT),void 0!==e&&!e||(i|=_.STENCIL_BUFFER_BIT),_.clear(i)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){i.removeEventListener("webglcontextlost",lt,!1),i.removeEventListener("webglcontextrestored",dt,!1),o.dispose(),u.dispose(),m.dispose(),p.dispose(),C.dispose(),bt.stop(),this.forceContextLoss()},this.renderBufferImmediate=function(t,n){E.initAttributes();var e=m.get(t),n=(t.hasPositions&&!e.position&&(e.position=_.createBuffer()),t.hasNormals&&!e.normal&&(e.normal=_.createBuffer()),t.hasUvs&&!e.uv&&(e.uv=_.createBuffer()),t.hasColors&&!e.color&&(e.color=_.createBuffer()),n.getAttributes());t.hasPositions&&(_.bindBuffer(_.ARRAY_BUFFER,e.position),_.bufferData(_.ARRAY_BUFFER,t.positionArray,_.DYNAMIC_DRAW),E.enableAttribute(n.position),_.vertexAttribPointer(n.position,3,_.FLOAT,!1,0,0)),t.hasNormals&&(_.bindBuffer(_.ARRAY_BUFFER,e.normal),_.bufferData(_.ARRAY_BUFFER,t.normalArray,_.DYNAMIC_DRAW),E.enableAttribute(n.normal),_.vertexAttribPointer(n.normal,3,_.FLOAT,!1,0,0)),t.hasUvs&&(_.bindBuffer(_.ARRAY_BUFFER,e.uv),_.bufferData(_.ARRAY_BUFFER,t.uvArray,_.DYNAMIC_DRAW),E.enableAttribute(n.uv),_.vertexAttribPointer(n.uv,2,_.FLOAT,!1,0,0)),t.hasColors&&(_.bindBuffer(_.ARRAY_BUFFER,e.color),_.bufferData(_.ARRAY_BUFFER,t.colorArray,_.DYNAMIC_DRAW),E.enableAttribute(n.color),_.vertexAttribPointer(n.color,3,_.FLOAT,!1,0,0)),E.disableUnusedAttributes(),_.drawArrays(_.TRIANGLES,0,t.count),t.count=0};var mt=new Ns;this.renderBufferDirect=function(t,n,e,i,r,o){null===n&&(n=mt);var s=r.isMesh&&r.matrixWorld.determinant()<0,t=xt(t,n,i,r),n=(E.setMaterial(i,s,r),!1),s=(M.geometry===e.id&&M.program===t.id&&M.wireframe===(!0===i.wireframe)||(M.geometry=e.id,M.program=t.id,M.wireframe=!0===i.wireframe,n=!0),(i.morphTargets||i.morphNormals)&&(U.update(r,e,i,t),n=!0),e.index),a=e.attributes.position;if(null===s){if(void 0===a||0===a.count)return}else if(0===s.count)return;var u=1,c=(!0===i.wireframe&&(s=k.getWireframeAttribute(e),u=2),B),n=(null!==s&&(h=S.get(s),(c=G).setIndex(h)),n&&(function(t,n,e,i){if(!1===x.isWebGL2&&(t.isInstancedMesh||n.isInstancedBufferGeometry)&&null===w.get("ANGLE_instanced_arrays"))return;E.initAttributes();var r,o=n.attributes,s=i.getAttributes(),a=e.defaultAttributeValues;for(r in s){var u=s[r];if(0<=u){var c=o[r];if(void 0!==c){var h,f,l,d,v,p,m,y=c.normalized,b=c.itemSize;void 0!==(h=S.get(c))&&(f=h.buffer,l=h.type,d=h.bytesPerElement,c.isInterleavedBufferAttribute?(v=c.data,p=v.stride,m=c.offset,v&&v.isInstancedInterleavedBuffer?(E.enableAttributeAndDivisor(u,v.meshPerAttribute),void 0===n.maxInstancedCount&&(n.maxInstancedCount=v.meshPerAttribute*v.count)):E.enableAttribute(u),_.bindBuffer(_.ARRAY_BUFFER,f),_.vertexAttribPointer(u,b,l,y,p*d,m*d)):(c.isInstancedBufferAttribute?(E.enableAttributeAndDivisor(u,c.meshPerAttribute),void 0===n.maxInstancedCount&&(n.maxInstancedCount=c.meshPerAttribute*c.count)):E.enableAttribute(u),_.bindBuffer(_.ARRAY_BUFFER,f),_.vertexAttribPointer(u,b,l,y,0,0)))}else if("instanceMatrix"===r)void 0!==(h=S.get(t.instanceMatrix))&&(f=h.buffer,l=h.type,E.enableAttributeAndDivisor(u+0,1),E.enableAttributeAndDivisor(u+1,1),E.enableAttributeAndDivisor(u+2,1),E.enableAttributeAndDivisor(u+3,1),_.bindBuffer(_.ARRAY_BUFFER,f),_.vertexAttribPointer(u+0,4,l,!1,64,0),_.vertexAttribPointer(u+1,4,l,!1,64,16),_.vertexAttribPointer(u+2,4,l,!1,64,32),_.vertexAttribPointer(u+3,4,l,!1,64,48));else if(void 0!==a){var g=a[r];if(void 0!==g)switch(g.length){case 2:_.vertexAttrib2fv(u,g);break;case 3:_.vertexAttrib3fv(u,g);break;case 4:_.vertexAttrib4fv(u,g);break;default:_.vertexAttrib1fv(u,g)}}}}E.disableUnusedAttributes()}(r,e,i,t),null!==s)&&_.bindBuffer(_.ELEMENT_ARRAY_BUFFER,h.buffer),(null!==s?s:a).count),t=e.drawRange.start*u,h=e.drawRange.count*u,s=null!==o?o.start*u:0,a=null!==o?o.count*u:1/0,o=Math.max(t,s),u=Math.min(n,t+h,s+a)-1,n=Math.max(0,u-o+1);0!==n&&(r.isMesh?!0===i.wireframe?(E.setLineWidth(i.wireframeLinewidth*ut()),c.setMode(_.LINES)):c.setMode(_.TRIANGLES):r.isLine?(t=i.linewidth,E.setLineWidth((t=void 0===t?1:t)*ut()),r.isLineSegments?c.setMode(_.LINES):r.isLineLoop?c.setMode(_.LINE_LOOP):c.setMode(_.LINE_STRIP)):r.isPoints?c.setMode(_.POINTS):r.isSprite&&c.setMode(_.TRIANGLES),r.isInstancedMesh?c.renderInstances(e,o,n,r.count):e.isInstancedBufferGeometry?c.renderInstances(e,o,n,e.maxInstancedCount):c.render(o,n))},this.compile=function(e,t){(g=u.get(e,t)).init(),e.traverse(function(t){t.isLight&&(g.pushLight(t),t.castShadow)&&g.pushShadow(t)}),g.setupLights(t);var i={};e.traverse(function(t){if(t.material)if(Array.isArray(t.material))for(var n=0;n<t.material.length;n++)t.material[n].uuid in i==!1&&(wt(t.material[n],e,t),i[t.material[n].uuid]=!0);else t.material.uuid in i==!1&&(wt(t.material,e,t),i[t.material.uuid]=!0)})};var yt=null;var bt=new Ps;function gt(t,n,e,i){for(var r=0,o=t.length;r<o;r++){var s=t[r],a=s.object,u=s.geometry,c=void 0===i?s.material:i,h=s.group;if(e.isArrayCamera)for(var f=(tt=e).cameras,l=0,d=f.length;l<d;l++){var v=f[l];a.layers.test(v.layers)&&(E.viewport(L.copy(v.viewport)),g.setupLights(v),_t(a,n,v,u,c,h))}else tt=null,_t(a,n,e,u,c,h)}}function _t(t,n,e,i,r,o){var s,a;r&&r.opacity<.001||(t.onBeforeRender(T,n,e,i,r,o),g=u.get(n,tt||e),t.userData.resetLight&&g.setupLights(e),t.modelViewMatrix.multiplyMatrices(e.matrixWorldInverse,t.matrixWorld),t.normalMatrix.getNormalMatrix(t.modelViewMatrix),t.isImmediateRenderObject?(s=xt(e,n,r,t),E.setMaterial(r),M.geometry=null,M.program=null,M.wireframe=!1,a=s,t.render(function(t){T.renderBufferImmediate(t,a)})):T.renderBufferDirect(e,n,i,r,t,o),t.onAfterRender(T,n,e,i,r,o),g=u.get(n,tt||e))}function wt(t,n,e){var i=m.get(t),r=g.state.lights,o=g.state.shadowsArray,s=r.state.version,o=f.getParameters(t,r.state,o,n,F.numPlanes,F.numIntersection,e),e=f.getProgramCacheKey(o),a=i.program,u=!0;if(void 0===a)t.addEventListener("dispose",vt);else if(a.cacheKey!==e)pt(t);else{if(i.lightsStateVersion!==s)i.lightsStateVersion=s;else if(void 0!==o.shaderID)return;u=!1}u&&(a=f.acquireProgram(o,e),i.program=a,i.uniforms=o.uniforms,i.environment=t.isMeshStandardMaterial?n.environment:null,i.outputEncoding=T.outputEncoding,t.program=a);var c=a.getAttributes();if(t.morphTargets)for(var h=t.numSupportedMorphTargets=0;h<T.maxMorphTargets;h++)0<=c["morphTarget"+h]&&t.numSupportedMorphTargets++;if(t.morphNormals)for(h=t.numSupportedMorphNormals=0;h<T.maxMorphNormals;h++)0<=c["morphNormal"+h]&&t.numSupportedMorphNormals++;u=i.uniforms,(t.isShaderMaterial||t.isRawShaderMaterial)&&!0!==t.clipping||(i.numClippingPlanes=F.numPlanes,i.numIntersection=F.numIntersection,u.clippingPlanes=F.uniform),i.fog=n.fog,i.needsLights=(e=t).isMeshLambertMaterial||e.isMeshToonMaterial||e.isMeshPhongMaterial||e.isMeshStandardMaterial||e.isShadowMaterial||e.isShaderMaterial&&!0===e.lights,i.lightsStateVersion=s,i.needsLights&&(u.ambientLightColor.value=r.state.ambient,u.lightProbe.value=r.state.probe,u.directionalLights.value=r.state.directional,u.directionalLightShadows.value=r.state.directionalShadow,u.spotLights.value=r.state.spot,u.spotLightShadows.value=r.state.spotShadow,u.rectAreaLights.value=r.state.rectArea,u.pointLights.value=r.state.point,u.pointLightShadows.value=r.state.pointShadow,u.hemisphereLights.value=r.state.hemi,u.directionalShadowMap.value=r.state.directionalShadowMap,u.directionalShadowMatrix.value=r.state.directionalShadowMatrix,u.spotShadowMap.value=r.state.spotShadowMap,u.spotShadowMatrix.value=r.state.spotShadowMatrix,u.pointShadowMap.value=r.state.pointShadowMap,u.pointShadowMatrix.value=r.state.pointShadowMatrix),o=i.program.getUniforms(),a=hc.seqWithValue(o.seq,u);i.uniformsList=a}function xt(t,n,e,i){y.resetTextureUnits();var r,o,s,a,u=n.fog,c=e.isMeshStandardMaterial?n.environment:null,h=m.get(e),f=g.state.lights,l=(st&&(at||t!==O)&&(l=t===O&&e.id===A,F.setState(e.clippingPlanes,e.clipIntersection,e.clipShadows,t,h,l)),e.version===h._o?(void 0===h.program||e.fog&&h.fog!==u||h.environment!==c||h.needsLights&&h.lightsStateVersion!==f.state.version||void 0!==h.numClippingPlanes&&(h.numClippingPlanes!==F.numPlanes||h.numIntersection!==F.numIntersection)||h.outputEncoding!==T.outputEncoding)&&wt(e,n,i):(wt(e,n,i),h._o=e.version),!1),f=!1,n=!1,d=h.program,v=d.getUniforms(),p=h.uniforms;return E.useProgram(d.program)&&(n=f=l=!0),e.id!==A&&(A=e.id,f=!0),(l||O!==t)&&(v.setValue(_,"projectionMatrix",t.projectionMatrix),x.logarithmicDepthBuffer&&v.setValue(_,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),O!==t&&(O=t,n=f=!0),(e.isShaderMaterial||e.isMeshPhongMaterial||e.isMeshToonMaterial||e.isMeshStandardMaterial||e.envMap)&&void 0!==(l=v.map.cameraPosition)&&l.setValue(_,I.setFromMatrixPosition(t.matrixWorld)),(e.isMeshPhongMaterial||e.isMeshToonMaterial||e.isMeshLambertMaterial||e.isMeshBasicMaterial||e.isMeshStandardMaterial||e.isShaderMaterial)&&v.setValue(_,"isOrthographic",!0===t.isOrthographicCamera),e.isMeshPhongMaterial||e.isMeshToonMaterial||e.isMeshLambertMaterial||e.isMeshBasicMaterial||e.isMeshStandardMaterial||e.isShaderMaterial||e.skinning)&&v.setValue(_,"viewMatrix",t.matrixWorldInverse),e.skinning&&(v.setOptional(_,i,"bindMatrix"),v.setOptional(_,i,"bindMatrixInverse"),l=i.skeleton)&&(t=l.bones,x.floatVertexTextures?(void 0===l.boneTexture&&(t=Math.sqrt(4*t.length),t=St.ceilPowerOfTwo(t),t=Math.max(t,4),(a=new Float32Array(t*t*4)).set(l.boneMatrices),s=new Rs(a,t,t,fe,ie),l.boneMatrices=a,l.boneTexture=s,l.boneTextureSize=t),v.setValue(_,"boneTexture",l.boneTexture,y),v.setValue(_,"boneTextureSize",l.boneTextureSize)):v.setOptional(_,l,"boneMatrices")),!f&&h.receiveShadow===i.receiveShadow||(h.receiveShadow=i.receiveShadow,v.setValue(_,"receiveShadow",i.receiveShadow)),f&&(v.setValue(_,"toneMappingExposure",T.toneMappingExposure),v.setValue(_,"toneMappingWhitePoint",T.toneMappingWhitePoint),h.needsLights&&(a=n,(s=p).ambientLightColor.needsUpdate=a,s.lightProbe.needsUpdate=a,s.directionalLights.needsUpdate=a,s.directionalLightShadows.needsUpdate=a,s.pointLights.needsUpdate=a,s.pointLightShadows.needsUpdate=a,s.spotLights.needsUpdate=a,s.spotLightShadows.needsUpdate=a,s.rectAreaLights.needsUpdate=a,s.hemisphereLights.needsUpdate=a),u&&e.fog&&(t=u,(l=p).fogColor.value.copy(t.color),t.isFog?(l.fogNear.value=t.near,l.fogFar.value=t.far):t.isFogExp2&&(l.fogDensity.value=t.density)),e.isMeshBasicMaterial?D(p,e):e.isMeshLambertMaterial?(D(p,e),f=p,(n=e).emissiveMap&&(f.emissiveMap.value=n.emissiveMap)):e.isMeshToonMaterial?(D(p,e),u=e,(t=p).specular.value.copy(u.specular),t.shininess.value=Math.max(u.shininess,1e-4),u.gradientMap&&(t.gradientMap.value=u.gradientMap),u.emissiveMap&&(t.emissiveMap.value=u.emissiveMap),u.bumpMap&&(t.bumpMap.value=u.bumpMap,t.bumpScale.value=u.bumpScale,u.side===sn)&&(t.bumpScale.value*=-1),u.normalMap&&(t.normalMap.value=u.normalMap,t.normalScale.value.copy(u.normalScale),u.side===sn)&&t.normalScale.value.negate(),u.displacementMap&&(t.displacementMap.value=u.displacementMap,t.displacementScale.value=u.displacementScale,t.displacementBias.value=u.displacementBias)):e.isMeshPhongMaterial?(D(p,e),f=e,(n=p).specular.value.copy(f.specular),n.shininess.value=Math.max(f.shininess,1e-4),f.emissiveMap&&(n.emissiveMap.value=f.emissiveMap),f.bumpMap&&(n.bumpMap.value=f.bumpMap,n.bumpScale.value=f.bumpScale,f.side===sn)&&(n.bumpScale.value*=-1),f.normalMap&&(n.normalMap.value=f.normalMap,n.normalScale.value.copy(f.normalScale),f.side===sn)&&n.normalScale.value.negate(),f.displacementMap&&(n.displacementMap.value=f.displacementMap,n.displacementScale.value=f.displacementScale,n.displacementBias.value=f.displacementBias)):e.isMeshStandardMaterial?(D(p,e,c),e.isMeshPhysicalMaterial?(Et(t=p,u=e,c),t.reflectivity.value=u.reflectivity,t.clearcoat.value=u.clearcoat,t.clearcoatRoughness.value=u.clearcoatRoughness,u.sheen&&t.sheen.value.copy(u.sheen),u.clearcoatMap&&(t.clearcoatMap.value=u.clearcoatMap),u.clearcoatRoughnessMap&&(t.clearcoatRoughnessMap.value=u.clearcoatRoughnessMap),u.clearcoatNormalMap&&(t.clearcoatNormalScale.value.copy(u.clearcoatNormalScale),t.clearcoatNormalMap.value=u.clearcoatNormalMap,u.side===sn)&&t.clearcoatNormalScale.value.negate(),t.transparency.value=u.transparency):Et(p,e,c)):e.isMeshMatcapMaterial?(D(p,e),n=p,(f=e).matcap&&(n.matcap.value=f.matcap),f.bumpMap&&(n.bumpMap.value=f.bumpMap,n.bumpScale.value=f.bumpScale,f.side===sn)&&(n.bumpScale.value*=-1),f.normalMap&&(n.normalMap.value=f.normalMap,n.normalScale.value.copy(f.normalScale),f.side===sn)&&n.normalScale.value.negate(),f.displacementMap&&(n.displacementMap.value=f.displacementMap,n.displacementScale.value=f.displacementScale,n.displacementBias.value=f.displacementBias)):e.isMeshDepthMaterial?(D(p,e),t=p,(u=e).displacementMap&&(t.displacementMap.value=u.displacementMap,t.displacementScale.value=u.displacementScale,t.displacementBias.value=u.displacementBias)):e.isMeshDistanceMaterial?(D(p,e),c=p,(n=e).displacementMap&&(c.displacementMap.value=n.displacementMap,c.displacementScale.value=n.displacementScale,c.displacementBias.value=n.displacementBias),c.referencePosition.value.copy(n.referencePosition),c.nearDistance.value=n.nearDistance,c.farDistance.value=n.farDistance):e.isMeshNormalMaterial?(D(p,e),f=p,(t=e).bumpMap&&(f.bumpMap.value=t.bumpMap,f.bumpScale.value=t.bumpScale,t.side===sn)&&(f.bumpScale.value*=-1),t.normalMap&&(f.normalMap.value=t.normalMap,f.normalScale.value.copy(t.normalScale),t.side===sn)&&f.normalScale.value.negate(),t.displacementMap&&(f.displacementMap.value=t.displacementMap,f.displacementScale.value=t.displacementScale,f.displacementBias.value=t.displacementBias)):e.isLineBasicMaterial?(u=e,(c=p).diffuse.value.copy(u.color),c.opacity.value=u.opacity,e.isLineDashedMaterial&&(n=e,(f=p).dashSize.value=n.dashSize,f.totalSize.value=n.dashSize+n.gapSize,f.scale.value=n.scale)):e.isPointsMaterial?(t=e,(c=p).diffuse.value.copy(t.color),c.opacity.value=t.opacity,c.size.value=t.size*N,c.scale.value=.5*R,t.map&&(c.map.value=t.map),t.alphaMap&&(c.alphaMap.value=t.alphaMap),t.map?r=t.map:t.alphaMap&&(r=t.alphaMap),void 0!==r&&(!0===r.matrixAutoUpdate&&r.updateMatrix(),c.uvTransform.value.copy(r.matrix))):e.isSpriteMaterial?(u=e,(f=p).diffuse.value.copy(u.color),f.opacity.value=u.opacity,f.rotation.value=u.rotation,u.map&&(f.map.value=u.map),u.alphaMap&&(f.alphaMap.value=u.alphaMap),u.map?o=u.map:u.alphaMap&&(o=u.alphaMap),void 0!==o&&(!0===o.matrixAutoUpdate&&o.updateMatrix(),f.uvTransform.value.copy(o.matrix))):e.isShadowMaterial&&(p.color.value.copy(e.color),p.opacity.value=e.opacity),void 0!==p.ltc_1&&(p.ltc_1.value=Lt.LTC_1),void 0!==p.ltc_2&&(p.ltc_2.value=Lt.LTC_2),hc.upload(_,h.uniformsList,p,y),e.isShaderMaterial)&&(e.uniformsNeedUpdate=!1),e.isShaderMaterial&&!0===e.uniformsNeedUpdate&&(hc.upload(_,h.uniformsList,p,y),e.uniformsNeedUpdate=!1),e.isSpriteMaterial&&v.setValue(_,"center",i.center),v.setValue(_,"modelViewMatrix",i.modelViewMatrix),v.setValue(_,"normalMatrix",i.normalMatrix),v.setValue(_,"modelMatrix",i.matrixWorld),d}function D(t,n,e){t.opacity.value=n.opacity,n.color&&t.diffuse.value.copy(n.color),n.emissive&&t.emissive.value.copy(n.emissive).multiplyScalar(n.emissiveIntensity),n.map&&(t.map.value=n.map),n.alphaMap&&(t.alphaMap.value=n.alphaMap),n.specularMap&&(t.specularMap.value=n.specularMap);var i,r,e=n.envMap||e;e&&(t.envMap.value=e,t.flipEnvMap.value=e.isCubeTexture?-1:1,t.reflectivity.value=n.reflectivity,t.refractionRatio.value=n.refractionRatio,t.maxMipLevel.value=m.get(e).ho),n.lightMap&&(t.lightMap.value=n.lightMap,t.lightMapIntensity.value=n.lightMapIntensity),n.aoMap&&(t.aoMap.value=n.aoMap,t.aoMapIntensity.value=n.aoMapIntensity),n.map?i=n.map:n.specularMap?i=n.specularMap:n.displacementMap?i=n.displacementMap:n.normalMap?i=n.normalMap:n.bumpMap?i=n.bumpMap:n.roughnessMap?i=n.roughnessMap:n.metalnessMap?i=n.metalnessMap:n.alphaMap?i=n.alphaMap:n.emissiveMap&&(i=n.emissiveMap),void 0!==i&&(!0===(i=i.isWebGLRenderTarget?i.texture:i).matrixAutoUpdate&&i.updateMatrix(),t.uvTransform.value.copy(i.matrix)),n.aoMap?r=n.aoMap:n.lightMap&&(r=n.lightMap),void 0!==r&&(!0===(r=r.isWebGLRenderTarget?r.texture:r).matrixAutoUpdate&&r.updateMatrix(),t.uv2Transform.value.copy(r.matrix))}function Et(t,n,e){t.roughness.value=n.roughness,t.metalness.value=n.metalness,n.roughnessMap&&(t.roughnessMap.value=n.roughnessMap),n.metalnessMap&&(t.metalnessMap.value=n.metalnessMap),n.emissiveMap&&(t.emissiveMap.value=n.emissiveMap),n.bumpMap&&(t.bumpMap.value=n.bumpMap,t.bumpScale.value=n.bumpScale,n.side===sn)&&(t.bumpScale.value*=-1),n.normalMap&&(t.normalMap.value=n.normalMap,t.normalScale.value.copy(n.normalScale),n.side===sn)&&t.normalScale.value.negate(),n.displacementMap&&(t.displacementMap.value=n.displacementMap,t.displacementScale.value=n.displacementScale,t.displacementBias.value=n.displacementBias),(n.envMap||e)&&(t.envMapIntensity.value=n.envMapIntensity)}bt.setAnimationLoop(function(t){C.isPresenting||yt&&yt(t)}),"undefined"!=typeof window&&bt.setContext(window),this.setAnimationLoop=function(t){yt=t,C.setAnimationLoop(t),bt.start()},this.render=function(t,n){var e,i,r;void 0!==arguments[2]&&(console.warn("THREE.WebGLRenderer.render(): the renderTarget argument has been removed. Use .setRenderTarget() instead."),i=arguments[2]),void 0!==arguments[3]&&(console.warn("THREE.WebGLRenderer.render(): the forceClear argument has been removed. Use .clear() instead."),r=arguments[3]),n&&n.isCamera?q||(M.geometry=null,M.program=null,M.wireframe=!1,A=-1,!(O=null)===t.autoUpdate&&t.updateMatrixWorld(),null===n.parent&&n.updateMatrixWorld(),C.enabled&&C.isPresenting&&(n=C.getCamera(n)),(g=u.get(t,n)).init(),t.onBeforeRender(T,t,n,i||a),j.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),ot.setFromProjectionMatrix(j),at=this.localClippingEnabled,st=F.init(this.clippingPlanes,at,n),(b=o.get(t,n)).init(),function t(n,e,i,r){if(!1===n.visible)return;var o=n.layers.test(e.layers);if(o)if(n.isGroup)i=n.renderOrder;else if(n.isLOD)!0===n.autoUpdate&&n.update(e);else if(n.isLight)g.pushLight(n),n.castShadow&&g.pushShadow(n);else if(n.isSprite)n.frustumCulled&&!ot.intersectsSprite(n)||(r&&I.setFromMatrixPosition(n.matrixWorld).applyMatrix4(j),s=p.update(n),(a=n.material).visible&&b.push(n,s,a,i,I.z,null));else if(n.isImmediateRenderObject)r&&I.setFromMatrixPosition(n.matrixWorld).applyMatrix4(j),b.push(n,null,n.material,i,I.z,null);else if((n.isMesh||n.isLine||n.isPoints)&&(n.isSkinnedMesh&&n.skeleton.frame!==v.render.frame&&(n.skeleton.update(),n.skeleton.frame=v.render.frame),!n.frustumCulled||ot.intersectsObject(n))){r&&I.setFromMatrixPosition(n.matrixWorld).applyMatrix4(j);var s=p.update(n),a=n.material;if(Array.isArray(a))for(var u=s.groups,c=0,h=u.length;c<h;c++){var f=u[c],l=a[f.materialIndex];l&&l.visible&&b.push(n,s,l,i,I.z,f)}else a.visible&&b.push(n,s,a,i,I.z,null)}var d=n.children;for(c=0,h=d.length;c<h;c++)t(d[c],e,i,r)}(t,n,0,T.sortObjects),b.finish(),!0===T.sortObjects&&b.sort(et,it),st&&F.beginShadows(),e=g.state.shadowsArray,ft.render(e,t,n),g.setupLights(n),st&&F.endShadows(),this.info.autoReset&&this.info.reset(),void 0!==i&&this.setRenderTarget(i),s.render(b,t,n,r),e=b.opaque,i=b.transparent,t.overrideMaterial?(r=t.overrideMaterial,e.length&>(e,t,n,r),i.length&>(i,t,n,r)):(e.length&>(e,t,n),i.length&>(i,t,n)),t.onAfterRender(T,t,n),null!==a&&(y.updateRenderTargetMipmap(a),y.updateMultisampleRenderTarget(a)),E.buffers.depth.setTest(!0),E.buffers.depth.setMask(!0),E.buffers.color.setMask(!0),E.setPolygonOffset(!1),g=b=null):console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.setFramebuffer=function(t){K!==t&&null===a&&_.bindFramebuffer(_.FRAMEBUFFER,t),K=t},this.getActiveCubeFace=function(){return J},this.getActiveMipmapLevel=function(){return $},this.getRenderTarget=function(){return a},this.setRenderTarget=function(t,n,e){J=n,$=e,(a=t)&&void 0===m.get(t).vo&&y.setupRenderTarget(t);var i,r=K,o=!1;nt=t?(i=m.get(t).vo,t.isWebGLCubeRenderTarget?(r=i[n||0],o=!0):r=t.isWebGLMultisampleRenderTarget?m.get(t).mo:i,L.copy(t.viewport),c.copy(t.scissor),t.scissorTest):(L.copy(h).multiplyScalar(N).floor(),c.copy(P).multiplyScalar(N).floor(),rt),d!==r&&(_.bindFramebuffer(_.FRAMEBUFFER,r),d=r),E.viewport(L),E.scissor(c),E.setScissorTest(nt),o&&(i=m.get(t.texture),_.framebufferTexture2D(_.FRAMEBUFFER,_.COLOR_ATTACHMENT0,_.TEXTURE_CUBE_MAP_POSITIVE_X+(n||0),i.do,e||0))},this.readRenderTargetPixels=function(t,n,e,i,r,o,s){if(t&&t.isWebGLRenderTarget){var a=m.get(t).vo;if(a=t.isWebGLCubeRenderTarget&&void 0!==s?a[s]:a){s=!1;a!==d&&(_.bindFramebuffer(_.FRAMEBUFFER,a),s=!0);try{var u=t.texture,c=u.format,h=u.type;c!==fe&&l.convert(c)!==_.getParameter(_.IMPLEMENTATION_COLOR_READ_FORMAT)?console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format."):h===Kn||l.convert(h)===_.getParameter(_.IMPLEMENTATION_COLOR_READ_TYPE)||h===ie&&(x.isWebGL2||w.get("OES_texture_float")||w.get("WEBGL_color_buffer_float"))||h===re&&(x.isWebGL2?w.get("EXT_color_buffer_float"):w.get("EXT_color_buffer_half_float"))?_.checkFramebufferStatus(_.FRAMEBUFFER)===_.FRAMEBUFFER_COMPLETE?0<=n&&n<=t.width-i&&0<=e&&e<=t.height-r&&_.readPixels(n,e,i,r,l.convert(c),l.convert(h),o):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete."):console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.")}finally{s&&_.bindFramebuffer(_.FRAMEBUFFER,d)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.copyFramebufferToTexture=function(t,n,e){void 0===e&&(e=0);var i=Math.pow(2,-e),r=Math.floor(n.image.width*i),i=Math.floor(n.image.height*i),o=l.convert(n.format);y.setTexture2D(n,0),_.copyTexImage2D(_.TEXTURE_2D,e,o,t.x,t.y,r,i,0),E.unbindTexture()},this.copyTextureToTexture=function(t,n,e,i){var r=n.image.width,o=n.image.height,s=l.convert(e.format),a=l.convert(e.type);y.setTexture2D(e,0),n.isDataTexture?_.texSubImage2D(_.TEXTURE_2D,i||0,t.x,t.y,r,o,s,a,n.image.data):_.texSubImage2D(_.TEXTURE_2D,i||0,t.x,t.y,s,a,n.image),E.unbindTexture()},this.initTexture=function(t){y.setTexture2D(t,0),E.unbindTexture()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}th.prototype=Object.assign(Object.create(dt.prototype),{constructor:th,isArrayCamera:!0}),nh.prototype=Object.assign(Object.create(a.prototype),{constructor:nh,isGroup:!0}),Object.assign(eh.prototype,X.prototype);var e={vert:"\n \n uniform vec2 offset;\n uniform float rotation;\n uniform vec2 scale;\n varying vec2 vUv;\n void main() {\n vUv = uv;\n \n \n vec2 rotatedPosition;\n rotatedPosition.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\n rotatedPosition.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n \n \n rotatedPosition.x *= scale.x * abs(projectionMatrix[0][0] / projectionMatrix[1][1]);\n rotatedPosition.y *= scale.y;\n \n rotatedPosition.xy += offset;\n gl_Position = vec4(rotatedPosition,0.0,1.0);\n }\n ",frag:"\n uniform vec3 diffuse;\n uniform sampler2D mmap;\n #include <common>\n varying vec2 vUv;\n \n void main() {\n \n // vec2 muv = vec2(vUv.x , 1.0 - vUv.y);\n vec4 diffuseColor = texture2D( mmap, vUv );\n \n \n gl_FragColor = diffuseColor;\n }\n "},rh=e;function oh(t){return(oh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function sh(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=oh(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=oh(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==oh(t)?t:String(t)}(i.key),i)}}function ah(t,n,e){n=ch(n);var i=t,n=uh()?Reflect.construct(n,e||[],ch(t).constructor):n.apply(t,e);if(n&&("object"===oh(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function uh(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(uh=function(){return!!t})()}function ch(t){return(ch=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function hh(t,n){return(hh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var fh=function(){var t,n,e=r,i=Ea;if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");function r(t){if(this instanceof r)return(t=ah(this,r,[t])).uniforms.offset={value:new Mt},t.uniforms.rotation={value:0},t.uniforms.scale={value:new Mt(1,1)},t.depthTest=!1,t.vertexShader=rh.vert,t.fragmentShader=rh.frag,t;throw new TypeError("Cannot call a class as a function")}return e.prototype=Object.create(i&&i.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),i&&hh(e,i),e=r,t&&sh(e.prototype,t),n&&sh(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}();function lh(t,n){this.array=t,this.stride=n,this.count=void 0!==t?t.length/n:0,this.usage=_i,this.updateRange={offset:0,count:-1},this.version=0}Object.defineProperty(lh.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(lh.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setUsage:function(t){return this.usage=t,this},copy:function(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this},copyAt:function(t,n,e){t*=this.stride,e*=n.stride;for(var i=0,r=this.stride;i<r;i++)this.array[t+i]=n.array[e+i];return this},set:function(t,n){return this.array.set(t,n=void 0===n?0:n),this},clone:function(){return(new this.constructor).copy(this)},onUpload:function(t){return this.onUploadCallback=t,this}});var dh=new Tt;function vh(t,n,e,i){this.data=t,this.itemSize=n,this.offset=e,this.normalized=!0===i}function ph(t){return(ph="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function mh(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=ph(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=ph(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==ph(t)?t:String(t)}(i.key),i)}}function yh(t,n,e){n=gh(n);var i=t,n=bh()?Reflect.construct(n,e||[],gh(t).constructor):n.apply(t,e);if(n&&("object"===ph(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function bh(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(bh=function(){return!!t})()}function gh(t){return(gh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function _h(t,n){return(_h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}Object.defineProperties(vh.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}}}),Object.assign(vh.prototype,{isInterleavedBufferAttribute:!0,applyMatrix4:function(t){for(var n=0,e=this.data.count;n<e;n++)dh.x=this.getX(n),dh.y=this.getY(n),dh.z=this.getZ(n),dh.applyMatrix4(t),this.setXYZ(n,dh.x,dh.y,dh.z);return this},setX:function(t,n){return this.data.array[t*this.data.stride+this.offset]=n,this},setY:function(t,n){return this.data.array[t*this.data.stride+this.offset+1]=n,this},setZ:function(t,n){return this.data.array[t*this.data.stride+this.offset+2]=n,this},setW:function(t,n){return this.data.array[t*this.data.stride+this.offset+3]=n,this},getX:function(t){return this.data.array[t*this.data.stride+this.offset]},getY:function(t){return this.data.array[t*this.data.stride+this.offset+1]},getZ:function(t){return this.data.array[t*this.data.stride+this.offset+2]},getW:function(t){return this.data.array[t*this.data.stride+this.offset+3]},setXY:function(t,n,e){return t=t*this.data.stride+this.offset,this.data.array[t+0]=n,this.data.array[t+1]=e,this},setXYZ:function(t,n,e,i){return t=t*this.data.stride+this.offset,this.data.array[t+0]=n,this.data.array[t+1]=e,this.data.array[t+2]=i,this},setXYZW:function(t,n,e,i,r){return t=t*this.data.stride+this.offset,this.data.array[t+0]=n,this.data.array[t+1]=e,this.data.array[t+2]=i,this.data.array[t+3]=r,this}});var wh=function(){var t,n,e=r,i=ra;if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");function r(){var t,n;if(this instanceof r)return t=yh(this,r),n=new lh(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5),t.setIndex([0,1,2,0,2,3]),t.setAttribute("position",new vh(n,3,0,!1)),t.setAttribute("uv",new vh(n,2,3,!1)),t;throw new TypeError("Cannot call a class as a function")}return e.prototype=Object.create(i&&i.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),i&&_h(e,i),e=r,t&&mh(e.prototype,t),n&&mh(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}();function xh(t,n,e,i,r,o,s,a,u){l.call(this,t,n,e,i,r,o,s,a,u),this.needsUpdate=!0}function Eh(t,n,e,i,r,o){var s=(t+e)/2,a=(n+i)/2,u=((t-e)*(t-e)+(n-i)*(n-i))/4,c=Math.sqrt(u),c=c*(c/Math.sqrt(r*r-u)),r=Math.PI/2,u=(e-t)/(n-i),h=(t-e)/(n-i),f=Math.sqrt(1+u*u),l=Math.sqrt(1+h*h),u={x:s+c*(1/f),y:a+c*(u/f),theta:r},f={x:s+c*(-1/l),y:a+c*(h/l),theta:r};return 0<(e-t)*(u.y-n)-(i-n)*(u.x-t)?0===o?u:f:0===o?f:u}function Sh(t,n,e,i){for(var r=0;r<t.length;r++)switch(t[r]){case"m":n.moveTo(i.x+parseFloat(t[r+1]),i.y+parseFloat(t[r+2])),e.x=i.x+parseFloat(t[r+1]),e.y=i.y+parseFloat(t[r+2]),i.x=e.x,i.y=e.y,r+=2;break;case"M":n.moveTo(parseFloat(t[r+1]),parseFloat(t[r+2])),e.x=parseFloat(t[r+1]),e.y=parseFloat(t[r+2]),i.x=e.x,i.y=e.y,r+=2;break;case"l":n.lineTo(e.x+parseFloat(t[r+1]),e.y+parseFloat(t[r+2])),e.x=e.x+parseFloat(t[r+1]),e.y=e.y+parseFloat(t[r+2]),r+=2;break;case"L":n.lineTo(parseFloat(t[r+1]),parseFloat(t[r+2])),e.x=parseFloat(t[r+1]),e.y=parseFloat(t[r+2]),r+=2;break;case"A":var o=parseFloat(t[r+1]),s=parseFloat(t[r+2]),a=(parseFloat(t[r+3]),Math.PI,parseFloat(t[r+4]),parseFloat(t[r+5])),u=e.x,c=e.y,h=parseFloat(t[r+6]),f=parseFloat(t[r+7]);o===s&&(l=Eh(u,c,h,f,o,a),n.arcTo(l.x,l.y,h,f,l.theta),e.x=h,e.y=f),r+=7;break;case"a":var l,o=parseFloat(t[r+1]),s=parseFloat(t[r+2]),a=(parseFloat(t[r+3]),Math.PI,parseFloat(t[r+4]),parseFloat(t[r+5])),u=e.x,c=e.y,h=u+parseFloat(t[r+6]),f=c+parseFloat(t[r+7]);o===s&&(l=Eh(u,c,h,f,o,a),n.arcTo(l.x,l.y,h,f,l.theta),e.x=h,e.y=f),r+=7;break;case"h":n.lineTo(e.x+parseFloat(t[r+1]),e.y),e.x=e.x+parseFloat(t[r+1]),r+=1;break;case"H":n.lineTo(parseFloat(t[r+1]),e.y),e.x=parseFloat(t[r+1]),r+=1;break;case"z":case"Z":n.lineTo(i.x,i.y)}}xh.prototype=Object.create(l.prototype);var Th=["M","0","15.07","L","0.69","1.92","A","2","2","0","0","1","2.66","0","L","11.8","0","l","-0.07","1.37","H","3.09","A","1.09","1.09","0","0","0","2","2.44","l","-0.2","4.44","h","9.37","l","-0.07","1.37","H","1.72","l","-0.36","6.82","Z"],Ah=["M","13.79","11","l","-0.08","1.63","a","1","1","0","0","0","1","1.08","h","8.53","l","-0.07","1.36","h","-9","A","1.84","1.84","0","0","1","12.31","13","l","0.48","-9.16","h","8.9","a","2","2","0","0","1","2","2","L","23.53","9","A","2.11","2.11","0","0","1","21.47","11","Z","m","8.4","-2.49","l","0.08","-2.16","a","1.07","1.07","0","0","0","-1.09","-1.09","H","14.09","l","-0.22","4.33","H","21","A","1.15","1.15","0","0","0","22.19","8.51","Z"],Mh=["M","33.94","3.86","a","1.93","1.93","0","0","1","2","1.95","l","-0.47","9.27","H","34.07","l","0.45","-8.72","a","1.09","1.09","0","0","0","-1.09","-1.1","H","26.3","l","-0.51","9.82","H","24.41","L","25","3.85","Z"],Oh=["M","36.48","17.72","H","45","a","1.16","1.16","0","0","0","1.16","-1.22","l","0.07","-1.43","H","38.72","a","2","2","0","0","1","-2","-2.06","l","0.37","-7.19","a","2","2","0","0","1","2.15","-2","H","48.2","l","-0.69","13.28","a","2.09","2.09","0","0","1","-2.06","2","h","-9","Z","m","9.85","-4.05","l","0.44","-8.45","H","39.53","a","1.07","1.07","0","0","0","-1.08","1.1","l","-0.32","6.27","a","1.16","1.16","0","0","0","1.1","1.1","Z"],Lh=["M","57.43","11.59","L","63.48","0","h","1.83","l","-0.79","15.05","H","63.15","l","0.67","-12.79","L","57.67","14","h","-0.75","L","52.07","2.34","l","-0.64","12.72","H","50","L","50.83","0","H","52.6","Z"],Rh=["M","69.6","10.2","l","-2.37","4.87","h","-1.5","L","73.09","0","h","1.49","l","5.77","15.05","h","-1.5","L","77","10.2","Z","m","6.86","-1.39","L","73.74","1.73","L","70.28","8.81","Z"],Nh=["M","82.95","15.07","H","81.57","L","82.35","0","h","10","a","1.94","1.94","0","0","1","1.85","2","L","93.89","7.4","a","2","2","0","0","1","-2","1.92","H","83.25","Z","m","8.43","-7.15","a","1.13","1.13","0","0","0","1.09","-1.09","l","0.35","-4.37","a","1.1","1.1","0","0","0","-1.08","-1.06","H","83.66","l","-0.34","6.53","Z"];var Ph={xo:(xh.prototype.constructor=xh).prototype.isCanvasTexture=!0};function Fh(t){return(Fh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function jh(t){return function(t){if(Array.isArray(t))return Ih(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,n){var e;if(t)return"string"==typeof t?Ih(t,n):"Map"===(e="Object"===(e=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Ih(t,n):void 0}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ih(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function Ch(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=Fh(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Fh(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Fh(t)?t:String(t)}(i.key),i)}}function Dh(t){r=st.a.document.createElement("canvas"),o=r.getContext("2d"),r.width=500,r.height=120,r.style.width="500px",r.style.height="120px",i={x:0,y:0},e={x:0,y:0},o.transform(5,0,0,5,10,10),(s=o.createLinearGradient(5.9,15.07,5.9,0)).addColorStop(0,"#232323"),s.addColorStop(1,"#585858"),o.fillStyle=s,o.beginPath(),Sh(Th,o,e,i),o.closePath(),o.fill(),o.beginPath(),Sh(Ah,o,e,i),o.closePath(),o.fill(),o.beginPath(),Sh(Mh,o,e,i),o.closePath(),o.fill(),o.beginPath(),Sh(Oh,o,e,i),o.closePath(),o.fill(),(s=o.createLinearGradient(57.68,15.07,57.68,0)).addColorStop(0,"#77bf00"),s.addColorStop(1,"#addc0c"),o.fillStyle=s,o.beginPath(),Sh(Lh,o,e,i),o.closePath(),o.fill(),o.beginPath(),Sh(Rh,o,e,i),o.closePath(),o.fill(),o.beginPath(),Sh(Nh,o,e,i),o.closePath(),o.fill(),st.a.environment==B.a.BROWSER?n=new xh(r):(s=r.toDataURL("image/png"),o.restore(),n=new l,st.a.textureHelper.createImage({url:s,onload:function(t){n.image=t,n.needsUpdate=!0}}));var n,e=n,i=new Mt(.4,.096),r=new fh,o=-1*(.5*i.x/t-1),s=-1*(1-.5*i.y);return e.minFilter=Qn,e.generateMipmaps=!1,r.transparent=!0,r.depthTest=!1,r.uniforms={scale:{value:i},offset:{value:new Mt(o,s)},mmap:{value:e}},r.needsUpdate=!0,new $a(new wh,r)}var e=function(){function i(t,n,e){if(!(this instanceof i))throw new TypeError("Cannot call a class as a function");this.Eo=0,this.Oi=0,this.gn=t,this.Ai=n,this.En=e,this.renderer=this.So(n.container,n.logarithmicDepthBuffer),this.It=new Map;e=this.gn.getMapOptions().depthPeeling;e&&st.a.environment===B.a.BROWSER&&(this.To=new st.a.DepthPeelingRenderer({map:t,renderManager:this,mode:e.mode,layers:e.layers,type:e.types})),this.Ao=JSON.parse(JSON.stringify(n.renderOrder)),this.Mo=0,this.Oo=!1,this.Vt=null,this.Lo=Ph.xo,this.Lo&&(this.Vt=Dh(this.renderer.domElement.clientWidth/this.renderer.domElement.clientHeight),this.Vt.frustumCulled=!1,this.xx45f6=this.Vt),this.Ro=!1,this.Xt=!1,this.St=this.renderer.domElement.clientWidth,this.No=this.renderer.domElement.clientHeight,this.type="basic",this.kn=!0,this.oo=void 0,this.Po=void 0,this.ro=[],this.Fo()}var t,n,e;return t=i,(n=[{key:"setTileLayScene",value:function(t){this.oo=t}},{key:"getTileLayScene",value:function(){return this.oo}},{key:"setGroundLayerScene",value:function(t){this.Po=t}},{key:"getGroundLayerScene",value:function(){return this.Po}},{key:"set3DTilesLayerSceneArr",value:function(t){this.ro.push(t)}},{key:"get3DTilesLayerSceneArr",value:function(){return this.ro}},{key:"needLogo",get:function(){return this.Lo}},{key:"render",value:function(){var i=this,r=this;if(this.renderer&&(this.Eo+=1,15e6<this.Eo&&(this.Eo=0),st.a.environment!==B.a.WX||1!=this.Oi||this.Eo%2!=0)){this.gn.Gt.Li.re(),this.gn.Gt.Li.oe(this.It),this.gn.Gt.Li.oe([this.oo,this.Po].concat(jh(this.ro))),this.renderer.clear(),this.oo&&this.renderer.render(this.oo,this.gn.kt),this.Po&&this.renderer.render(this.Po,this.gn.kt);for(var t=0;t<this.ro.length;t++)this.renderer.render(this.ro[t],this.gn.kt);this.gn.getMapOptions().depthPeeling?this.To.render():this.It.forEach(function(t){return i.renderer.render(t,i.gn.kt)});var o={min:1/0,max:-1/0},s=(this.gn.jo.Ot.forEach(function(t){var e=[];t.Io.forEach(function(t){var n;(function(t){for(var n=!1,e=Array.from(r.getRenderList()),i=0;i<e.length;i++)if(e[i][0].split("%A%B%C%D")[0]===t){n=!0;break}return n})(t.buildingID||i.gn.getMapOptions().mapID)&&t.isCross&&(e.push(t),(n=Math.min(t.levelRange[0],t.levelRange[1]))<o.min&&(o.min=n),n=Math.max(t.levelRange[0],t.levelRange[1]),o.max<n)&&(o.max=n)}),e.forEach(function(t){i.renderer.render(t.line,i.gn.kt)})}),this.Ao.indexOf(E.LINE_MARKER));this.It.forEach(function(t,n){var n=n.split("%A%B%C%D"),e=n[1],n=n[2];+e===o.max&&(e=i.Ao.indexOf(E.LAYER_NODE_TYPE.get(+n)),s<e)&&i.renderer.render(t,i.gn.kt)}),this.gn.jo&&this.renderer.render(this.gn.jo.Co,this.gn.kt),this.Lo&&this.Vt&&this.renderer.render(this.Vt,this.gn.kt)}}},{key:"resize",value:function(){this.renderer&&(5<Math.abs(this.renderer.domElement.parentElement.clientHeight-this.No)||5<Math.abs(this.renderer.domElement.parentElement.clientWidth-this.St))&&(this.Do(this.renderer.domElement.parentElement.clientWidth,this.renderer.domElement.parentElement.clientHeight),this.St=this.renderer.domElement.clientWidth,this.No=this.renderer.domElement.clientHeight,this.gn.Dt.Ct({type:"resize"}))}},{key:"getRenderList",value:function(){return this.It}},{key:"parent",get:function(){return this.gn}},{key:"getWebGLRenderer",value:function(){return ih}}])&&Ch(t.prototype,n),e&&Ch(t,e),Object.defineProperty(t,"prototype",{writable:!1}),i}(),kh=(Object.assign(e.prototype,{ko:function(){for(var t in this.gn=null,this.Ai=null,this.En=null,this)this[""+t]=null,delete this[""+t]},zn:function(){this.kn=!1,this.It.clear(),st.a.window.cancelAnimationFrame(this.Uo)},So:function(t,n){n=new ih({useWebGL2:this.gn.getMapOptions().depthPeeling,antialias:!0,alpha:!0,logarithmicDepthBuffer:n,canvas:st.a.environment==B.a.BROWSER?void 0:t});return n.setPixelRatio(st.a.window.devicePixelRatio),st.a.environment===B.a.BROWSER&&n.setSize(t.clientWidth,t.clientHeight),n.autoClear=!1,n.domElement.style.position="absolute",n.domElement.style.top=0,n.domElement.style.zIndex=0,st.a.environment==B.a.BROWSER&&t.appendChild(n.domElement),n},Bo:function(t){this.renderer=t},Go:function(t){t="3D"===t?this.gn.An:this.gn.Ut;return t.updateMatrixWorld(!0),(new Vt).setFromProjectionMatrix((new At).multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse))},Ho:function(t){for(var n=[],e=[],i=0;i<t.length;i++){var r=this.Ao.indexOf(t[i]);-1!==r&&(n.push(r),e.push(t[i]))}n.sort(function(t,n){return t-n});for(var o=0;o<n.length;o++)this.Ao[n[o]]=e[o];this.Mn()},Xo:function(t){this.Ao=t,this.Mn()},Vo:function(t,n){var e=1,i=this.renderer.domElement.clientHeight,n=this.gn.kt.isPerspectiveCamera?n?n/(i/(2*Math.tan(this.gn.An.fov*u.DEG2RAD/2))):t.mapNode.Zt/(i/(2*Math.tan(this.gn.An.fov*u.DEG2RAD/2))):n?n*Math.abs(this.gn.kt.top-this.gn.kt.bottom)/this.gn.kt.zoom/i:t.mapNode.Zt*Math.abs(this.gn.kt.top-this.gn.kt.bottom)/this.gn.kt.zoom/i;t.material.userData.scaleRatio&&(e=t.material.userData.scaleRatio),t.scale.set(n,n/e,n)},Ht:function(){var r=this;this.It.forEach(function(t){switch(t.userData.type){case"label":for(var n=0;n<t.children.length;n++)t.children[n].mapNode.zo(r.gn.Nt);break;case"facility":for(var e=0;e<t.children.length;e++)r.Vo(t.children[e]);break;default:for(var i=0;i<t.children.length;i++)!t.children[i].mapNode||t.children[i].mapNode.type!==E.IMAGE_MARKER&&t.children[i].mapNode.type!==E.LOCATION_MARKER||t.children[i].mapNode.nn()}})},Do:function(t,n){var e=this.gn.An,i=this.gn.Ut,r=new Mt(.4,.096),o=-1*(.5*r.x/(t/n)-1),s=-1*(1-.5*r.y);for(e.aspect=t/n,e.updateProjectionMatrix(),i.left=-t/2,i.right=t/2,i.top=n/2,i.bottom=-n/2,i.updateProjectionMatrix(),this.Vt&&(this.Vt.material.uniforms.scale={value:r},this.Vt.material.uniforms.offset={value:new Mt(o,s)}),this.renderer.setSize(t,n),this.Ht(),this.gn.enableUpdateRender(),this.gn.enableUpdateNode(),this.gn.Nt.Ft();0<this.gn.Nt.Rt.length;)this.gn.Nt.Pt()},Wo:function(t,n){st.a.environment===B.a.BROWSER&&(t.updateMatrixWorld(!0),t.parent.updateMatrixWorld(!0));var e,i,r=this.gn.kt,r=(new Tt).setFromMatrixPosition(t.matrixWorld).applyMatrix4(r.matrixWorldInverse).applyMatrix4(r.projectionMatrix),o=t.mapNode.Zt;if(n){if("string"==typeof t.mapNode.text){if(!t.material.map.image)return;e=t.mapNode.type===E.LABEL?(o=t.material.map.image.height/2/1.2,t.material.map.image.width/2/1.2):(o*=t.mapNode.text.split("%rn%").length)/t.material.userData.scaleRatio}else e=(o*=t.mapNode.text.length)/t.material.userData.scaleRatio;void 0!==t.material.userData.style&&(n=t.material.userData.style,i=o*t.material.userData.itHeightRatio*1.1,"limage-rtext"===n||"ltext-rimage"===n?o<i&&(e=(o=i)/t.material.userData.scaleRatio):"timage-btext"===n||"ttext-bimage"===n?e=(o+=i)/t.material.userData.scaleRatio:"overlay-text"===n&&o<i&&(e=(o=i)/t.material.userData.scaleRatio))}else e=o;return o=o/this.renderer.domElement.clientHeight*2,e=e/this.renderer.domElement.clientWidth*2,{leftTop:new Mt(r.x-e/2,r.y+o/2),rightDown:new Mt(r.x+e/2,r.y-o/2)}},Yo:function(t,n,e,i,r){for(var o=0;o<n.length;o++)if(!n[o].mapNode.Jt||n[o].mapNode.Qo)n[o].visible=!1;else if(n[o].mapNode.G&&(n[o].mapNode.G.maxlevel<=i||n[o].mapNode.G.minlevel>i))n[o].visible=!1;else if(!1===r)n[o].visible=!0;else if(!1===n[o].mapNode.Zo)n[o].visible=!0;else{var s=n[o].children[0]||n[o];if(s.material.map){var a=this.Wo(s,e);if(a){n[o].userData.bounds=a;for(var u=!0,c=0;c<t.length;c++){var h=t[c].userData.bounds;if(!(u=!z._e(a.leftTop,a.rightDown,h.leftTop,h.rightDown)))break}u?(n[o].visible=!0,t.push(n[o])):n[o].visible=!1}}}},zt:function(){var y=this;this.Xt&&(this.gn.traverse(function(t){if(y.gn.Nt.qo(t))for(var n=t.visibleLevels,e=[],i=y.gn.getZoom(),r=y.En.Ko,o=0;o<n.length;o++){var s=t.getFloor(n[o]);if(s){var a=s.getLayers(E.LABEL_LAYER),u=void 0,a=(0<a.length&&(u=a[0].scene),s.getLayers(E.FACILITY_LAYER)),c=void 0;0<a.length&&(c=a[0].scene),e.length=0,u&&y.Yo(e,u.children,!0,i,u.mapNode.Zo),c&&y.Yo(e,c.children,!1,i,c.mapNode.Zo);for(var h=0;h<r.length;h++)for(var f=r[h],l=e.length=0;l<f.length;l++){var d=f[l],d=s.getLayers(d),v=void 0,p=void 0,m=!1;0<d.length&&(p=(v=d[0]).scene,m=!0===v.isHasText),p&&void 0!==v.collision&&y.Yo(e,p.children,m,i,v.collision)}}}}),this.Xt=!1,this.gn.enableUpdateRender())},Jo:function(){!0!==this.En.$o&&!0!==this.En.ts||(this.Xt=!0)},Mn:function(){this.Ro=!0},Ji:function(t){this.It.delete(t)},ut:function(){this.It.clear()},On:function(){var i,r=this;this.Ro&&(this.It.clear(),i=[],this.gn.traverse(function(t){if(r.gn.Nt.qo(t))for(var n=0;n<t.visibleLevels.length;n++){var e=t.getFloor(t.visibleLevels[n]);e&&i.push(e)}}),i.sort(function(t,n){return t.height<n.height?-1:t.height>n.height?1:t.parent===r.gn.Tn?-1:n.parent===r.gn.Tn?1:0}),i.forEach(function(t){var n=[];t.traverse(function(t){n.unshift(t)}),n.sort(function(t,n){var t=r.Ao.indexOf(E.LAYER_NODE_TYPE.get(t.mi)),n=r.Ao.indexOf(E.LAYER_NODE_TYPE.get(n.mi)),e=r.Ao.length-1;return(t=-1===t?e:t)-(n=-1===n?e:n)}),n.forEach(function(t,n,e){var i=t.parent,i=i.parent.pi+"%A%B%C%D"+i.level+"%A%B%C%D"+t.mi;r.It.set(i,t.scene)})}),this.Ro=!1,this.Ht(),this.Jo())},Gn:function(){this.It&&0<this.It.size&&!this.Oo&&(this.gn.Dt.Ct({type:"firstRender"}),this.Oo=!0)},Fo:function(){var t;this.gn&&this.kn&&(this.kn&&(this.Uo=st.a.window.requestAnimationFrame(this.Fo.bind(this))),this.gn.Dt.Ct({type:"beforeRender"}),this.resize(),t={type:"update",renderType:this.En.ns?0:1},this.En.ns&&(this.render(),this.Gn(),this.En.ns=!1),this.gn.Dt.Ct(t))}}),e),Uh=t(3);function Bh(t){return(Bh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Gh(n,t){var e,i=Object.keys(n);return Object.getOwnPropertySymbols&&(e=Object.getOwnPropertySymbols(n),t&&(e=e.filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})),i.push.apply(i,e)),i}function Hh(i){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Gh(Object(r),!0).forEach(function(t){var n,e;n=i,e=r[t=t],(t=zh(t))in n?Object.defineProperty(n,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[t]=e}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(r)):Gh(Object(r)).forEach(function(t){Object.defineProperty(i,t,Object.getOwnPropertyDescriptor(r,t))})}return i}function Xh(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,zh(i.key),i)}}function Vh(t,n,e){return n&&Xh(t.prototype,n),e&&Xh(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function zh(t){t=function(t,n){if("object"!=Bh(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Bh(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Bh(t)?t:String(t)}var e=Vh(function t(n){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this.es=Hh({data:null,method:"GET",responseType:"json"},n),this.rs=null}),Wh=(Object.assign(e.prototype,{ss:function(t,n,e){var i=this.es,r=i.data,o=i.method,s=i.url,a=i.responseType,u=i.header,c=null;if((c=new(st.a.environment===B.a.WX?st.a.XMLHttpRequest:"undefined"!=typeof XMLHttpRequest?XMLHttpRequest:Uh.a.global().fengmap.XMLHttpRequest)).responseType=a,c.open(o,s),"object"==Bh(u))for(var h in u)c.setRequestHeader(h,u[h]);c.addEventListener("load",function(){200===c.status||0===c.status||201===c.status?t&&t(c.response):n&&(404===c.status?n(vr.PATH_ERROR):2069===c.response.error_code?n(vr.NAME_KEY_ERROR):2063===c.response.error_code?n(vr.MAP_ID_URL_ERROR):400===c.response.error_code?n(vr.THEME_ID_URL_ERROR):n(c.response))}),c.addEventListener("timeout",function(t){e&&e(t)}),c.addEventListener("error",function(t){n&&n(t)}),c.send(JSON.stringify(r)),this.rs=c},zn:function(){this.rs&&this.rs.abort&&(this.rs.abort(),this.rs=null)}}),e),e=t(31),Yh=t.n(e);function Qh(t){return(Qh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Zh(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=Qh(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Qh(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Qh(t)?t:String(t)}(i.key),i)}}function qh(t,n,e){return n&&Zh(t.prototype,n),e&&Zh(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}for(var Kh=["TmF2aVNlZ21lbg==","YWNjZXNzaWJsZQ==","Zmlk","bmZv","Rmxvb3JHZW8=","bGlmdFR5cGU=","bGVu","dmVs","ZXh0ZW50TGF5ZQ==","RXh0ZW50Qml6SQ==","cmVhZE9ubHk=","LnByb3RvYnVm","aW50MzI=","ZG9vcnR5cGU=","R0VPUE9JTlRfTQ==","TmF2aVpvbmU=","ZW50cmFuY2VGbA==","bGVuZ3Ro","ZWxCaXpJbmZv","c3RhaXJMYXllcg==","dG9CaWQ=","R2F0ZQ==","b2Zmc2V0WQ==","Zmlkcw==","aXNTZWxlY3RhYg==","ZmxhZw==","ZXh0ZXJuYWxNbw==","bGlmdEVudHJ5","VklTRUdNRU5U","SW5kZXhJbmZv","ZGF0YQ==","ZGVsQml6SW5mbw==","bWlk","cG9pTGF5ZXI=","bW9kZWxpZA==","cGFja2Vk","dGhyb3VnaA==","bmF2aVNlZ21lbg==","bGlmdExheWVy","cmVwZWF0ZWQ=","ZGVmQ2VuWQ==","b29y","bm9kZUlk","TmF2aU1vZGVs","cmFuaw==","c25vZGU=","cHRz","ZGVmR2lk","aGFzaENvZGU=","bmVzdGVk","Ymlk","cmVxdWlyZWQ=","R0VPTElORV9OQQ==","b2Zmc2V0WA==","TmF2aU5vZGU=","bHR5cGU=","T1ZFUkxBWURBVA==","ZGVmQ2VuWA==","b3B0aW9ucw==","YmFzZUxldmVs","YXJlYQ==","TGF5ZXJHcm91cA==","ZmllbGRz","cGFzcw==","Zmxvb3Jz","SUZU","Rmxvb3JOYXZp","amF2YV9vdXRlcg==","UG9seWdvbkxhYg==","ZW50cmFuY2VUeQ==","VHlwZQ==","bmF2aVpvbmVz","ZWxMYXllcg==","YWxpYXM=","d2lkdGg=","YXllcg==","ZW50cnl0eXBlcw==","TGlmdEJpekluZg==","bm9kZXR5cGVz","amF2YV9wYWNrYQ==","bmF2aVR5cGU=","ZGF0ZVZlcg==","bGlmdEZsYWc=","Z2lk","bWF4WA==","bW5hbWU=","bWluU2NhbGVMZQ==","Zmxvb3JJZA==","X2NsYXNzbmFtZQ==","TW9kZWxCaXpJbg==","Zmxvb3I=","bmFtZQ==","c2NhbGVMZXZlbA==","RXh0ZXJuYWxNbw==","cGdpZA==","ZmlsZVZlcg==","VEFJUg==","bWlubGV2ZWw=","Rmxvb3JDb25maQ==","R2VuZXJhbEdlbw==","ZHJpdmU=","Ym9vbA==","a2V5","R0VPUE9MWUdPTg==","dG9HaWQ=","ZGVmQ2VuWg==","YnR5cGU=","R0VPUE9JTlRfUw==","cC5wbGF0Zm9ybQ==","TmF2aUZsb29y","ZmxvYXQ=","bmF2aUV4dGVudA==","UE9JQml6SW5mbw==","TGFiZWxCaXpJbg==","TGF5ZXI=","cnVsZQ==","bGlk","Y29tLmZlbmdtYQ==","c2NhbGU=","c2VnbWVudElk","ZGVzYw==","ZGVsTGF5ZXI=","R0VPUE9JTlRfUA==","cm90YXRlQW5nbA==","X0xBQkVM","cG9seWdvbkxheQ==","ZmlsZURhdGU=","R0VPUE9JTlRfTA==","U3RhaXJCaXpJbg==","ZXNjYWxhdG9yTA==","bGlua1NlZw==","QnVmZmVy","TmF2aUV4dGVudA==","Z2Vv","R0VPTElORQ==","bmF2aU5vZGVz","cmVqZWN0cw==","UG9seWdvbkJpeg==","aXNWaXNpYmxl","b25zaGlw","YnVmZmVycw==","bWF4bGV2ZWw=","ZG91Ymxl","R0VPUE9JTlRfRQ==","bmF2aQ==","Rmxvb3JCaXo=","Z1Byb3RvQnVm","T0RFTA==","ZW5hbWU=","bW9kZWxMYXllcg==","a2V5cw==","ZWlk","bGF5ZXJz","QU5PUkFNQQ==","UkRFUg==","R0VPUE9JTlQ=","QnVpbGRpbmc=","bWluWA==","TWFw","aGVpZ2h0","c3RyaW5n","dHlwZQ==","ZGVmYXVsdA==","cG9seWdvbkxhYg==","TmF2aVJlbGF0aQ==","dWludDY0","aWR4cw==","SW5mbw==","X0VYVEVOVA=="],Jh=Kh,$h=218;--$h;)Jh.push(Jh.shift());function P(t,n){var e=Kh[t=+t],i=(void 0===P.ngQRZk&&(i=function(){var n;try{n=Function('return (function() {}.constructor("return this")( ));')()}catch(t){n=window}return n}(),(i=st.a.environment===B.a.WX?st.a.window:i).atob||(i.atob=function(t){for(var n,e,i=String(t).replace(/=+$/,""),r="",o=0,s=0;e=i.charAt(s++);~e&&(n=o%4?64*n+e:e,o++%4)&&(r+=String.fromCharCode(255&n>>(-2*o&6))))e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(e);return r}),P.bOCUYG=function(t){for(var n=atob(t),e=[],i=0,r=n.length;i<r;i++)e+="%"+("00"+n.charCodeAt(i).toString(16)).slice(-2);return decodeURIComponent(e)},P.TcYoxp={},P.ngQRZk=!0),P.TcYoxp[t]);return void 0===i?(e=P.bOCUYG(e),P.TcYoxp[t]=e):e=i,e}var tf=qh(function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");var n={},e=(n[P("0x1f")+"ge"]=P("0x45")+P("0x3c")+P("0x84"),n[P("0x13")+P("0x28")]=P("0x32")+P("0x62"),{}),i=(e[P("0x43")]="required",e[P("0x71")]=P("0x70"),e.id=1,{}),r=(i.rule=P("0x3"),i[P("0x71")]=P("0x85"),i.id=2,{}),o=(r.rule=P("0x3"),r.type=P("0x75"),r.id=3,{}),s=(o[P("0x43")]=P("0x3"),o[P("0x71")]=P("0x70"),o.id=4,{}),a=(s[P("0x43")]=P("0x3"),s[P("0x71")]=P("0x70"),s.id=5,{}),u=(a[P("0x71")]=P("0x70"),a.id=6,{}),c=(u[P("0x71")]=P("0x70"),u.id=7,{}),h=(c[P("0x71")]=P("0x70"),c.id=8,{}),f=(h[P("0x72")]=!1,{}),h=(f.type="bool",f.id=9,f[P("0xa")]=h,{}),l=(h[P("0x43")]="repeated",h[P("0x71")]=P("0x53"),h.id=10,{}),d=(l.rule="repeated",l.type=P("0x70"),l.id=11,{}),e=(d[P("0x99")]=e,d.fileVer=i,d[P("0x21")]=r,d[P("0x25")]=o,d.hashCode=s,d[P("0x36")]=a,d[P("0x4e")]=u,d.desc=c,d.readOnly=f,d[P("0x5c")]=h,d[P("0x66")]=l,{}),i=(e[P("0x43")]=P("0x3"),e[P("0x71")]="int32",e.id=1,{}),r=(i[P("0x43")]=P("0x3"),i.type=P("0x85"),i.id=2,{}),o=(r[P("0x43")]="required",r[P("0x71")]="int32",r.id=3,{}),s=(o.rule="required",o[P("0x71")]=P("0x75"),o.id=4,{}),a=(s.rule=P("0x3"),s[P("0x71")]="bytes",s.id=5,{}),u=(a[P("0x23")]=e,a[P("0x2f")]=i,a[P("0x3a")]=r,a[P("0x7f")]=o,a[P("0x97")]=s,{}),c=(u[P("0xe")]=a,{}),f=(c.Buffer=u,{}),h=(f[P("0xe")]=d,f.nested=c,{}),l=(h[P("0x43")]=P("0x3"),h[P("0x71")]="string",h.id=19,{}),e=(l.rule=P("0x3"),l.type=P("0x85"),l.id=20,{}),i=(e[P("0x43")]=P("0x3"),e[P("0x71")]="uint64",e.id=21,{}),r=(i[P("0x43")]=P("0x3"),i[P("0x71")]=P("0x70"),i.id=22,{}),o=(r.rule=P("0x3"),r[P("0x71")]=P("0x70"),r.id=23,{}),s=(o.type="string",o.id=24,{}),a=(s[P("0x71")]=P("0x70"),s.id=25,{}),u=(a[P("0x72")]=!1,{}),d=(u[P("0x71")]=P("0x35"),u.id=26,u[P("0xa")]=a,{}),c=(d[P("0x71")]=P("0x3e"),d.id=1,{}),a=(c[P("0x71")]="float",c.id=2,{}),v=(a[P("0x71")]="float",a.id=3,{}),p=(v[P("0x71")]=P("0x3e"),v.id=4,{}),m=(p.type=P("0x3e"),p.id=5,{}),y=(m.type=P("0x3e"),m.id=6,{}),b=(y.type=P("0x3e"),y.id=7,{}),g=(b[P("0x71")]=P("0x70"),b.id=8,{}),_=(g.type=P("0x3e"),g.id=9,{}),w=(_[P("0x71")]=P("0x3e"),_.id=10,{}),x=(w[P("0x71")]=P("0x3e"),w.id=11,{}),E=(x.type=P("0x3e"),x.id=12,{}),S=(E[P("0x71")]=P("0x3e"),E.id=13,{}),T=(S[P("0x71")]=P("0x3e"),S.id=14,{}),A=(T.type=P("0x3e"),T.id=15,{}),M=(A[P("0x71")]=P("0x3e"),A.id=16,{}),O=(M[P("0x71")]=P("0x70"),M.id=17,{}),L=(O[P("0x71")]="int32",O.id=28,{}),R=(L.rule=P("0xa0"),L[P("0x71")]="LayerGroup",L.id=18,{}),N=(R[P("0x43")]="repeated",R[P("0x71")]=P("0x6c"),R.id=27,{}),h=(N.mid=h,N.fileVer=l,N[P("0x21")]=e,N[P("0x25")]=i,N[P("0x0")]=r,N[P("0x36")]=o,N[P("0x48")]=s,N[P("0x83")]=u,N.x=d,N.y=c,N.z=a,N[P("0x6d")]=v,N.minY=p,N[P("0x24")]=m,N.maxY=y,N[P("0xa8")]=b,N[P("0x9")]=g,N[P("0xa1")]=_,N[P("0x39")]=w,N[P("0x6f")]=x,N[P("0x4b")+"eX"]=E,N.rotateAngleY=S,N[P("0x4b")+"eZ"]=T,N[P("0x46")]=A,N[P("0x2c")]=M,N[P("0x20")]=O,N.layerGroups=L,N.buildings=R,{}),l=(h[P("0x71")]=P("0x85"),h.id=1,{}),e=(l[P("0x71")]=P("0x70"),l.id=2,{}),i=(e[P("0x71")]=P("0x70"),e.id=3,{}),r=(i[P("0x71")]=P("0x16"),i.id=4,{}),o=(r.type=P("0x3e"),r.id=5,{}),s=(o[P("0x71")]=P("0x3e"),o.id=6,{}),u=(s[P("0x71")]=P("0x3e"),s.id=7,{}),d=(u[P("0x71")]=P("0x3e"),u.id=8,{}),c=(d[P("0x71")]=P("0x3e"),d.id=9,{}),a=(c[P("0x71")]=P("0x3e"),c.id=10,{}),v=(a[P("0x71")]=P("0x3e"),a.id=11,{}),p=(v[P("0x71")]=P("0x3e"),v.id=12,{}),m=(p[P("0x71")]=P("0x35"),p.id=13,{}),y=(m[P("0x71")]=P("0x35"),m.id=14,{}),b=(y[P("0x71")]=P("0x35"),y.id=15,{}),g=(b.type=P("0x70"),b.id=16,{}),_=(g[P("0x44")]=h,g.lname=l,g[P("0x19")]=e,g[P("0x7")]=i,g[P("0x5")]=r,g[P("0x8f")]=o,g[P("0x6f")]=s,g[P("0x4b")+"eX"]=u,g.rotateAngleY=d,g[P("0x4b")+"eZ"]=c,g[P("0x26")+P("0x80")]=a,g["maxScaleLe"+P("0x80")]=v,g[P("0x5a")]=p,g[P("0x91")+"le"]=m,g.isEditable=y,g[P("0x48")]=b,{}),w=(_[P("0x6b")]=1,_[P("0x5f")+"SCALATOR"]=2,_[P("0x4f")+P("0x11")]=3,_[P("0x3b")+P("0x30")]=4,_[P("0x4a")+P("0x69")]=5,_[P("0x4a")+"OI"]=6,_[P("0x3b")+"TORELABEL"]=7,_.GEOPOINT_NAVINODE=8,_[P("0x87")+P("0x63")]=9,_[P("0x56")]=20,_[P("0x4")+P("0x95")]=21,_["GEOLINE_BO"+P("0x6a")]=22,_[P("0x37")]=30,_[P("0x37")+P("0x78")]=31,_.GEOPOLYGON_STORE=32,_[P("0x37")+P("0x4c")]=33,_.RASTERATA=40,_[P("0x8")+"A"]=50,{}),x=(w.values=_,{}),E=(x[P("0x16")]=w,{}),S=(E[P("0xe")]=g,E[P("0x1")]=x,{}),T=(S[P("0x71")]="int32",S.id=1,{}),A=(T[P("0x71")]="string",T.id=2,{}),M=(A[P("0x71")]="string",A.id=3,{}),O=(M[P("0x71")]=P("0x3e"),M.id=4,{}),L=(O[P("0x71")]=P("0x70"),O.id=5,{}),R=(L[P("0x43")]="repeated",L[P("0x71")]=P("0x42"),L.id=6,{}),h=(R[P("0x71")]=P("0x70"),R.id=7,{}),l=(h[P("0x71")]="int32",h.id=8,{}),e=(l.gid=S,l.gname=T,l[P("0x19")]=A,l[P("0x6f")]=M,l[P("0x48")]=O,l[P("0x68")]=L,l[P("0x27")]=R,l[P("0x20")]=h,{}),i=(e[P("0xe")]=l,{}),r=(i[P("0x71")]=P("0x85"),i.id=1,{}),o=(r[P("0x71")]=P("0x3e"),r.id=2,{}),s=(o[P("0x71")]=P("0x3e"),o.id=3,{}),u=(s.type=P("0x3e"),s.id=4,{}),d=(u.type=P("0x3e"),u.id=5,{}),c=(d[P("0x71")]="float",d.id=6,{}),a=(c[P("0x71")]=P("0x3e"),c.id=7,{}),v=(a[P("0x43")]=P("0xa0"),a.type=P("0x70"),a.id=8,{}),p=(v.type=P("0x85"),v.id=9,{}),m=(p.type="bool",p.id=10,{}),y=(m[P("0x71")]=P("0x85"),m.id=11,{}),b=(y[P("0x71")]="int32",y.id=12,{}),_=(b[P("0x71")]=P("0x70"),b.id=13,{}),w=(_.rule="repeated",_[P("0x71")]=P("0x96"),_.id=14,{}),g=(w[P("0x9c")]=!1,{}),x=(g[P("0x43")]=P("0xa0"),g.type=P("0x5e"),g.id=15,g[P("0xa")]=w,{}),S=(x[P("0x23")]=i,x.x=r,x.y=o,x.offsetX=s,x[P("0x8f")]=u,x.angle=d,x.scale=c,x[P("0x90")]=a,x[P("0x2e")]=v,x[P("0xb")]=p,x.minlevel=m,x[P("0x5d")]=y,x.floorId=b,x.idxs=_,x[P("0xa7")]=g,{}),T=(S[P("0x9c")]=!1,{}),A=(T.rule=P("0xa0"),T[P("0x71")]=P("0x85"),T.id=1,T[P("0xa")]=S,{}),M=(A[P("0x76")]=T,{}),O=(M[P("0xe")]=A,{}),L=(O.IndexInfo=M,{}),R=(L[P("0xe")]=x,L[P("0x1")]=O,{}),h=(R[P("0x71")]=P("0x70"),R.id=1,{}),l=(h.type="string",h.id=2,{}),w=(l.type=P("0x70"),l.id=3,{}),i=(w[P("0x71")]=P("0x70"),w.id=4,{}),r=(i.type="float",i.id=5,{}),o=(r[P("0x71")]=P("0x3e"),r.id=6,{}),s=(o.type=P("0x70"),o.id=7,{}),u=(s[P("0x71")]=P("0x85"),s.id=8,{}),d=(u[P("0x43")]="repeated",u[P("0x71")]="Floor",u.id=9,{}),c=(d[P("0x71")]="int32",d.id=10,{}),a=(c[P("0x2")]=R,c[P("0x2b")]=h,c[P("0x64")]=l,c[P("0x19")]=w,c.x=i,c.y=r,c.mid=o,c.version=s,c.floors=u,c.bcode=d,{}),v=(a.fields=c,{}),p=(v[P("0x42")]=E,v[P("0xd")]=e,v.Floor=L,v[P("0x6c")]=a,{}),m=(p[P("0xe")]=N,p[P("0x1")]=v,{}),y=(m[P("0x43")]=P("0x3"),m[P("0x71")]=P("0x70"),m.id=1,{}),b=(y[P("0x43")]="repeated",y[P("0x71")]=P("0x3d"),y.id=2,{}),_=(b.mid=m,b[P("0x10")]=y,{}),g=(_[P("0x71")]="int32",_.id=1,{}),S=(g[P("0x71")]="string",g.id=2,{}),T=(S[P("0x71")]=P("0x70"),S.id=3,{}),A=(T[P("0x71")]=P("0x70"),T.id=4,{}),M=(A[P("0x43")]=P("0xa0"),A.type=P("0x74")+P("0x5b"),A.id=5,{}),x=(M[P("0x43")]=P("0xa0"),M[P("0x71")]=P("0x74")+P("0x5b"),M.id=6,{}),O=(x[P("0x43")]=P("0xa0"),x[P("0x71")]=P("0x74")+P("0x5b"),x.id=7,{}),R=(O.gid=_,O[P("0x27")]=g,O[P("0x2")]=S,O[P("0x99")]=T,O[P("0x60")]=A,O[P("0x34")]=M,O.accessible=x,{}),h=(R[P("0xe")]=O,{}),l=(h[P("0x43")]=P("0x3"),h[P("0x71")]="int32",h.id=1,{}),w=(l[P("0x71")]=P("0x85"),l.id=2,{}),i=(w[P("0x71")]=P("0x85"),w.id=3,{}),r=(i[P("0x43")]=P("0xa0"),i[P("0x71")]="IndexInfo",i.id=4,{}),o=(r[P("0x9c")]=!1,{}),s=(o[P("0x43")]=P("0xa0"),o[P("0x71")]=P("0x5e"),o.id=5,o.options=r,{}),u=(s.type=P("0x85"),s.id=6,{}),d=(u[P("0x43")]=P("0xa0"),u.type=P("0x70"),u.id=7,{}),c=(d[P("0x43")]="repeated",d[P("0x71")]="string",d.id=8,{}),E=(c[P("0x67")]=h,c[P("0x71")]=l,c[P("0x7a")]=w,c[P("0x76")]=i,c[P("0xa7")]=o,c[P("0x92")]=s,c[P("0x8d")]=u,c[P("0x38")]=d,{}),e=(E[P("0x9c")]=!1,{}),L=(e[P("0x43")]=P("0xa0"),e[P("0x71")]=P("0x85"),e.id=1,e.options=E,{}),a=(L[P("0x76")]=e,{}),N=(a[P("0xe")]=L,{}),v=(N[P("0x96")]=a,{}),m=(v[P("0xe")]=c,v.nested=N,{}),y=(m[P("0x3d")]=R,m[P("0x74")+P("0x5b")]=v,{}),_=(y.fields=b,y[P("0x1")]=m,{}),g=(_[P("0x43")]=P("0x3"),_[P("0x71")]=P("0x70"),_.id=1,{}),S=(g[P("0x43")]="required",g[P("0x71")]=P("0x85"),g.id=2,{}),T=(S.type=P("0x3e"),S.id=3,{}),A=(T[P("0x43")]=P("0xa0"),T[P("0x71")]=P("0x33")+P("0x77"),T.id=4,{}),M=(A.rule=P("0xa0"),A[P("0x71")]=P("0x33")+"Info",A.id=5,{}),x=(M.rule="repeated",M[P("0x71")]="GeneralGeo"+P("0x77"),M.id=6,{}),O=(x[P("0x43")]="repeated",x[P("0x71")]="GeneralGeoInfo",x.id=7,{}),r=(O[P("0x43")]="repeated",O[P("0x71")]=P("0x33")+P("0x77"),O.id=8,{}),h=(r.rule=P("0xa0"),r[P("0x71")]=P("0x33")+"Info",r.id=9,{}),l=(h[P("0x43")]=P("0xa0"),h[P("0x71")]="GeneralGeoInfo",h.id=10,{}),w=(l[P("0x43")]=P("0xa0"),l.type=P("0x33")+P("0x77"),l.id=11,{}),i=(w[P("0x43")]=P("0xa0"),w[P("0x71")]=P("0x33")+"Info",w.id=12,{}),o=(i[P("0x43")]=P("0xa0"),i[P("0x71")]=P("0x33")+P("0x77"),i.id=13,{}),s=(o[P("0x99")]=_,o[P("0x23")]=g,o[P("0x6f")]=S,o[P("0x81")+"r"]=T,o[P("0x65")]=A,o.labelLayer=M,o[P("0x9a")]=x,o[P("0x4d")+"er"]=O,o[P("0x73")+"elLayer"]=r,o[P("0x9f")]=h,o[P("0x8c")]=l,o[P("0x51")+P("0x1b")]=w,o[P("0x93")+P("0x49")]=i,{}),u=(s[P("0x43")]=P("0x3"),s[P("0x71")]=P("0x85"),s.id=1,{}),d=(u[P("0x71")]="string",u.id=2,{}),E=(d[P("0x71")]=P("0x3e"),d.id=3,{}),e=(E.type="float",E.id=4,{}),L=(e[P("0x43")]="repeated",e[P("0x71")]=P("0x96"),e.id=5,{}),a=(L[P("0x9c")]=!1,{}),c=(a[P("0x43")]=P("0xa0"),a.type=P("0x5e"),a.id=6,a[P("0xa")]=L,{}),N=(c.eid=s,c[P("0x55")]=u,c[P("0x6f")]=d,c[P("0xc")]=E,c.idxs=e,c[P("0xa7")]=a,{}),R=(N.packed=!1,{}),v=(R[P("0x43")]=P("0xa0"),R.type=P("0x85"),R.id=1,R[P("0xa")]=N,{}),b=(v[P("0x76")]=R,{}),m=(b[P("0xe")]=v,{}),_=(m[P("0x96")]=b,{}),g=(_.fields=c,_[P("0x1")]=m,{}),S=(g["GeneralGeo"+P("0x77")]=_,{}),T=(S[P("0xe")]=o,S[P("0x1")]=g,{}),A=(T.rule=P("0x3"),T[P("0x71")]=P("0x70"),T.id=1,{}),M=(A[P("0x43")]=P("0x3"),A[P("0x71")]=P("0x85"),A.id=2,{}),x=(M[P("0x43")]="repeated",M[P("0x71")]=P("0x82")+P("0x7c"),M.id=3,{}),O=(x.rule="repeated",x.type=P("0x29")+"fo",x.id=4,{}),r=(O[P("0x43")]=P("0xa0"),O.type=P("0x41")+"fo",O.id=5,{}),h=(r.rule=P("0xa0"),r.type=P("0x40"),r.id=6,{}),l=(h[P("0x43")]=P("0xa0"),h.type=P("0x59")+"Info",h.id=7,{}),w=(l[P("0x43")]=P("0xa0"),l[P("0x71")]=P("0x1d")+"o",l.id=8,{}),i=(w[P("0x43")]=P("0xa0"),w.type=P("0x50")+"fo",w.id=9,{}),L=(i[P("0x43")]=P("0xa0"),i[P("0x71")]=P("0x14")+P("0x8b"),i.id=10,{}),s=(L[P("0x43")]=P("0xa0"),L[P("0x71")]=P("0x2d")+P("0x98"),L.id=11,{}),u=(s[P("0x99")]=T,s[P("0x23")]=A,s[P("0x81")+"r"]=M,s[P("0x65")]=x,s.labelLayer=O,s[P("0x9a")]=r,s[P("0x4d")+"er"]=h,s.liftLayer=l,s[P("0x8c")]=w,s["polygonLab"+P("0x18")]=i,s[P("0x93")+"delLayer"]=L,{}),d=(u.rule=P("0x3"),u[P("0x71")]=P("0x85"),u.id=1,{}),E=(d.type=P("0x70"),d.id=2,{}),e=(E[P("0x71")]=P("0x85"),E.id=3,{}),a=(e[P("0x71")]=P("0x70"),e.id=4,{}),N=(a.type=P("0x70"),a.id=5,{}),R=(N[P("0x71")]="int32",N.id=6,{}),v=(R[P("0x71")]="int32",R.id=7,{}),b=(v.eid=u,v[P("0x7b")]=d,v.type=E,v[P("0x2b")]=e,v[P("0x64")]=a,v[P("0x31")]=N,v[P("0x5d")]=R,{}),c=(b.fields=v,{}),m=(c[P("0x43")]="required",c[P("0x71")]=P("0x85"),c.id=1,{}),_=(m[P("0x71")]="string",m.id=2,{}),o=(_[P("0x71")]="int32",_.id=3,{}),g=(o[P("0x71")]=P("0x70"),o.id=4,{}),T=(g[P("0x71")]=P("0x70"),g.id=5,{}),A=(T.type=P("0x85"),T.id=6,{}),M=(A[P("0x71")]=P("0x85"),A.id=7,{}),x=(M[P("0x71")]="int32",M.id=8,{}),O=(x[P("0x67")]=c,x[P("0x7b")]=m,x[P("0x71")]=_,x[P("0x2b")]=o,x[P("0x64")]=g,x[P("0x31")]=T,x[P("0x5d")]=A,x[P("0xf")]=M,{}),r=(O[P("0xe")]=x,{}),h=(r[P("0x43")]=P("0x3"),r[P("0x71")]=P("0x85"),r.id=1,{}),l=(h[P("0x71")]=P("0x70"),h.id=2,{}),w=(l[P("0x71")]=P("0x85"),l.id=3,{}),i=(w[P("0x71")]=P("0x70"),w.id=4,{}),L=(i.type=P("0x70"),i.id=5,{}),u=(L[P("0x71")]=P("0x85"),L.id=6,{}),d=(u.type=P("0x85"),u.id=7,{}),E=(d[P("0x67")]=r,d[P("0x7b")]=h,d[P("0x71")]=l,d[P("0x2b")]=w,d[P("0x64")]=i,d[P("0x31")]=L,d.maxlevel=u,{}),e=(E.fields=d,{}),a=(e[P("0x43")]=P("0x3"),e[P("0x71")]=P("0x85"),e.id=1,{}),N=(a[P("0x71")]=P("0x70"),a.id=2,{}),R=(N[P("0x71")]="int32",N.id=3,{}),v=(R[P("0x71")]=P("0x70"),R.id=4,{}),c=(v[P("0x71")]=P("0x70"),v.id=5,{}),m=(c.type="int32",c.id=6,{}),_=(m[P("0x71")]=P("0x85"),m.id=7,{}),o=(_[P("0x67")]=e,_.fid=a,_[P("0x71")]=N,_[P("0x2b")]=R,_[P("0x64")]=v,_[P("0x31")]=c,_[P("0x5d")]=m,{}),g=(o[P("0xe")]=_,{}),T=(g[P("0x43")]=P("0x3"),g.type=P("0x85"),g.id=1,{}),A=(T.type=P("0x70"),T.id=2,{}),M=(A[P("0x71")]=P("0x85"),A.id=3,{}),x=(M[P("0x71")]=P("0x70"),M.id=4,{}),r=(x.type=P("0x70"),x.id=5,{}),h=(r[P("0x71")]="int32",r.id=6,{}),l=(h.type="int32",h.id=7,{}),w=(l.eid=g,l[P("0x7b")]=T,l[P("0x71")]=A,l.name=M,l[P("0x64")]=x,l[P("0x31")]=r,l[P("0x5d")]=h,{}),i=(w[P("0xe")]=l,{}),L=(i[P("0x43")]="required",i[P("0x71")]=P("0x85"),i.id=1,{}),u=(L.type=P("0x70"),L.id=2,{}),d=(u.type=P("0x85"),u.id=3,{}),e=(d.type=P("0x85"),d.id=4,{}),a=(e[P("0x71")]=P("0x70"),e.id=5,{}),N=(a.type=P("0x85"),a.id=6,{}),R=(N[P("0x71")]=P("0x85"),N.id=7,{}),v=(R[P("0x67")]=i,R[P("0x7b")]=L,R[P("0x71")]=u,R[P("0x92")]=d,R[P("0x2a")]=e,R[P("0x31")]=a,R[P("0x5d")]=N,{}),c=(v[P("0xe")]=R,{}),m=(c[P("0x43")]=P("0x3"),c[P("0x71")]="int32",c.id=1,{}),_=(m[P("0x71")]=P("0x70"),m.id=2,{}),g=(_[P("0x71")]=P("0x85"),_.id=3,{}),T=(g[P("0x71")]=P("0x85"),g.id=4,{}),A=(T[P("0x71")]="int32",T.id=5,{}),M=(A[P("0x71")]=P("0x85"),A.id=6,{}),x=(M[P("0x67")]=c,M[P("0x7b")]=m,M[P("0x71")]=_,M[P("0x92")]=g,M[P("0x31")]=T,M.maxlevel=A,{}),r=(x[P("0xe")]=M,{}),h=(r.rule=P("0x3"),r[P("0x71")]=P("0x85"),r.id=1,{}),l=(h.type=P("0x70"),h.id=2,{}),i=(l[P("0x71")]="int32",l.id=3,{}),L=(i[P("0x71")]="float",i.id=4,{}),u=(L[P("0x71")]=P("0x70"),L.id=5,{}),d=(u[P("0x71")]="string",u.id=6,{}),e=(d[P("0x71")]=P("0x3e"),d.id=7,{}),a=(e[P("0x67")]=r,e[P("0x7b")]=h,e[P("0x71")]=l,e[P("0x1a")]=i,e[P("0x2b")]=L,e[P("0x64")]=u,e.angle=d,{}),N=(a.fields=e,{}),R=(N[P("0x43")]=P("0x3"),N[P("0x71")]="int32",N.id=1,{}),c=(R.type="string",R.id=2,{}),m=(c[P("0x71")]=P("0x85"),c.id=3,{}),_=(m[P("0x71")]=P("0x70"),m.id=4,{}),g=(_[P("0x71")]=P("0x70"),_.id=5,{}),T=(g[P("0x71")]="int32",g.id=6,{}),A=(T.type=P("0x85"),T.id=7,{}),M=(A[P("0x67")]=N,A[P("0x7b")]=R,A[P("0x71")]=c,A.name=m,A[P("0x64")]=_,A[P("0x31")]=g,A[P("0x5d")]=T,{}),r=(M[P("0xe")]=A,{}),h=(r[P("0x82")+"nfo"]=b,r[P("0x29")+"fo"]=O,r[P("0x41")+"fo"]=E,r[P("0x59")+P("0x77")]=o,r.POIBizInfo=w,r[P("0x1d")+"o"]=v,r[P("0x50")+"fo"]=x,r[P("0x14")+P("0x8b")]=a,r[P("0x2d")+"delBizInfo"]=M,{}),l=(h[P("0xe")]=s,h.nested=r,{}),i=(l[P("0x43")]="required",l.type=P("0x70"),l.id=1,{}),L=(i[P("0x43")]="required",i.type=P("0x85"),i.id=2,{}),u=(L[P("0x43")]=P("0xa0"),L[P("0x71")]=P("0x6"),L.id=3,{}),d=(u[P("0x43")]="repeated",u[P("0x71")]=P("0x79")+"t",u.id=4,{}),e=(d[P("0x43")]=P("0xa0"),d[P("0x71")]=P("0x88"),d.id=5,{}),N=(e[P("0x43")]=P("0xa0"),e[P("0x71")]="NaviModel",e.id=6,{}),R=(N[P("0x9c")]=!1,{}),c=(R[P("0x43")]=P("0xa0"),R[P("0x71")]=P("0x85"),R.id=7,R[P("0xa")]=N,{}),m=(c[P("0x43")]=P("0xa0"),c[P("0x71")]="NaviExtent",c.id=8,{}),_=(m[P("0x99")]=l,m[P("0x23")]=i,m[P("0x57")]=L,m[P("0x9e")+"ts"]=u,m[P("0x17")]=d,m.naviModels=e,m.nextFloors=R,m[P("0x3f")+"s"]=c,{}),g=(_[P("0x71")]="int32",_.id=1,{}),T=(g.type=P("0x85"),g.id=2,{}),A=(T[P("0x71")]=P("0x85"),T.id=3,{}),b=(A[P("0x71")]=P("0x85"),A.id=4,{}),O=(b[P("0x71")]="int32",b.id=5,{}),E=(O[P("0x71")]=P("0x70"),O.id=6,{}),o=(E.type="string",E.id=7,{}),w=(o[P("0x71")]=P("0x70"),o.id=8,{}),v=(w[P("0x71")]="int32",w.id=9,{}),x=(v[P("0x71")]=P("0x70"),v.id=10,{}),a=(x[P("0x71")]=P("0x85"),x.id=11,{}),M=(a[P("0x9c")]=!1,{}),s=(M[P("0x43")]=P("0xa0"),M.type=P("0x85"),M.id=12,M[P("0xa")]=a,{}),r=(s[P("0x9c")]=!1,{}),N=(r[P("0x43")]=P("0xa0"),r[P("0x71")]=P("0x5e"),r.id=13,r[P("0xa")]=s,{}),l=(N.default=0,{}),i=(l.type="int32",l.id=14,l[P("0xa")]=N,{}),L=(i[P("0xa3")]=_,i.nodeType=g,i[P("0x7e")]=T,i[P("0x22")]=A,i[P("0x94")]=b,i.liftFloor=O,i[P("0x52")]=E,i[P("0x55")]=o,i[P("0x15")+"pe"]=w,i[P("0x89")+P("0xa2")]=v,i[P("0x86")]=x,i[P("0x76")]=M,i.pts=r,i[P("0x7a")]=l,{}),u=(L[P("0xe")]=i,{}),d=(u[P("0x71")]=P("0x85"),u.id=1,{}),e=(d[P("0x71")]="int32",d.id=2,{}),R=(e[P("0x71")]=P("0x85"),e.id=3,{}),c=(R[P("0x71")]=P("0x5e"),R.id=4,{}),a=(c[P("0x71")]=P("0x85"),c.id=5,{}),s=(a[P("0x71")]=P("0x70"),a.id=6,{}),N=(s[P("0x71")]=P("0x85"),s.id=7,{}),_=(N[P("0x71")]=P("0x70"),N.id=8,{}),g=(_[P("0x71")]=P("0x70"),_.id=9,{}),T=(g[P("0x71")]=P("0x85"),g.id=10,{}),A=(T[P("0x9c")]=!1,{}),b=(A[P("0x43")]="repeated",A[P("0x71")]=P("0x85"),A.id=11,A[P("0xa")]=T,{}),O=(b[P("0x9c")]=!1,{}),E=(O[P("0x43")]=P("0xa0"),O[P("0x71")]=P("0x5e"),O.id=12,O[P("0xa")]=b,{}),o=(E[P("0x47")]=u,E[P("0xa6")]=d,E.enode=e,E[P("0x8a")]=R,E[P("0xa5")]=c,E[P("0x2b")]=a,E.entry=s,E[P("0x48")]=N,E[P("0x55")]=_,E[P("0x9d")]=g,E[P("0x76")]=A,E[P("0xa7")]=O,{}),w=(o[P("0xe")]=E,{}),v=(w.rule=P("0x3"),w[P("0x71")]=P("0x85"),w.id=1,{}),x=(v[P("0x72")]=0,{}),M=(x[P("0x43")]=P("0x3"),x.type=P("0x85"),x.id=2,x[P("0xa")]=v,{}),r=(M.type=P("0x70"),M.id=3,{}),l=(r[P("0x43")]=P("0xa0"),r[P("0x71")]=P("0x70"),r.id=4,{}),i=(l[P("0x9c")]=!1,{}),T=(i[P("0x43")]=P("0xa0"),i[P("0x71")]="int32",i.id=5,i[P("0xa")]=l,{}),b=(T[P("0x9c")]=!1,{}),u=(b[P("0x43")]="repeated",b[P("0x71")]=P("0x5e"),b.id=6,b[P("0xa")]=T,{}),d=(u.id=w,u[P("0x71")]=x,u[P("0x55")]=M,u[P("0x58")]=r,u[P("0x76")]=i,u.pts=b,{}),e=(d[P("0xe")]=u,{}),R=(e[P("0x43")]="required",e[P("0x71")]=P("0x85"),e.id=1,{}),c=(R[P("0x9c")]=!1,{}),a=(c[P("0x43")]=P("0xa0"),c.type=P("0x85"),c.id=2,c.options=R,{}),s=(a.packed=!1,{}),N=(s[P("0x43")]=P("0xa0"),s[P("0x71")]="int32",s.id=3,s[P("0xa")]=a,{}),_=(N[P("0x9c")]=!1,{}),g=(_[P("0x43")]=P("0xa0"),_.type=P("0x85"),_.id=4,_[P("0xa")]=N,{}),A=(g[P("0x9b")]=e,g.doorids=c,g[P("0x1e")]=s,g[P("0x1c")]=_,{}),O=(A[P("0xe")]=g,{}),E=(O[P("0x43")]=P("0x3"),O[P("0x71")]=P("0x85"),O.id=1,{}),v=(E[P("0x9c")]=!1,{}),l=(v.rule=P("0xa0"),v[P("0x71")]="double",v.id=2,v.options=E,{}),T=(l[P("0x43")]="repeated",l[P("0x71")]=P("0x96"),l.id=3,{}),w=(T.id=O,T[P("0xa7")]=v,T[P("0x76")]=l,{}),x=(w.packed=!1,{}),M=(x[P("0x43")]=P("0xa0"),x[P("0x71")]=P("0x85"),x.id=1,x.options=w,{}),r=(M[P("0x76")]=x,{}),i=(r[P("0xe")]=M,{}),b=(i[P("0x96")]=r,{}),u=(b[P("0xe")]=T,b[P("0x1")]=i,{}),R=(u[P("0x6")]=L,u[P("0x79")+"t"]=o,u[P("0x88")]=d,u[P("0xa4")]=A,u[P("0x54")]=b,{}),a=(R.fields=m,R[P("0x1")]=u,{}),N=(a[P("0x6e")]=f,a.Scene=p,a[P("0x8e")]=y,a[P("0x7d")]=S,a[P("0x61")]=h,a[P("0x12")]=R,{}),e=(N[P("0xa")]=n,N[P("0x1")]=a,{}),c=(e.protobuf=N,{});c[P("0x1")]=e,this.id=c});function nf(t){return(nf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ef(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=nf(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=nf(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==nf(t)?t:String(t)}(i.key),i)}}function rf(t,n,e){return n&&ef(t.prototype,n),e&&ef(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var e=rf(function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this.us=null}),of=(Object.assign(e.prototype,{cs:function(){this.us||(this.us=Yh.a.Root.fromJSON((new("undefined"!=typeof KjWzhWlSj&&KjWzhWlSj.ProtoDef?KjWzhWlSj.ProtoDef:tf)).id))},hs:function(t){return this.cs(),this.us.lookup("Map").decode(t)},ls:function(t){for(var n=0;n<t.buffers.length;n++){var e=t.buffers[n];if(1==e.btype)return this.ds(e.data)}return null},vs:function(t){for(var n=0;n<t.buffers.length;n++){var e=t.buffers[n];if(7==e.btype)return this.ps(e.data)}return null},ys:function(t,n){for(var e=0;e<t.buffers.length;e++){var i=t.buffers[e];if(2==i.btype&&i.gid==n)return this.bs(i.data)}return null},gs:function(t,n){for(var e=0;e<t.buffers.length;e++){var i=t.buffers[e];if(3==i.btype&&i.gid==n)return this._s(i.data)}return null},ws:function(t,n){for(var e=0;e<t.buffers.length;e++){var i=t.buffers[e];if(4==i.btype&&i.gid==n)return this.xs(i.data)}return null},Es:function(t,n){for(var e=0;e<t.buffers.length;e++){var i=t.buffers[e];if(5===i.btype&&i.gid===n)return this.xs(i.data)}return null},Ss:function(t,n){for(var e=0;e<t.buffers.length;e++){var i=t.buffers[e];if(6===i.btype&&i.gid===n)return this.xs(i.data)}return null},ds:function(t){this.cs();var n=this.us.lookup("Scene").decode(t);return n.levels=[],n.layerGroups.forEach(function(t){n.levels.push(t.gid)}),n},ps:function(t){return this.cs(),this.us.lookup("Gate").decode(t)},bs:function(t){return this.cs(),this.us.lookup("FloorGeo").decode(t)},_s:function(t){return this.cs(),this.us.lookup("FloorBiz").decode(t)},xs:function(t){return this.cs(),this.us.lookup("FloorNavi").decode(t)}}),e);function sf(t){return(sf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function af(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=sf(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=sf(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==sf(t)?t:String(t)}(i.key),i)}}function uf(t,n,e){return n&&af(t.prototype,n),e&&af(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var cf,hf,ff,lf,df,e=uf(function t(){var n;if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");st.a.environment===B.a.WX?this.Ts=new st.a.ProtoReaderStatic:void 0!==Uh.a.global().KjWzhWlSj&&Uh.a.global().KjWzhWlSj.ProtoReaderStatic?(n=Uh.a.global().KjWzhWlSj.ProtoReaderStatic,this.Ts=new n):this.Ts=new of}),vf=(Object.assign(e.prototype,{hs:function(t){return this.Ts.hs(t)},ls:function(t){return this.Ts.ls(t)},vs:function(t){return this.Ts.vs(t)},ys:function(t,n){return this.Ts.ys(t,n)},gs:function(t,n){return this.Ts.gs(t,n)},ws:function(t,n){return this.Ts.ws(t,n)},Es:function(t,n){return this.Ts.Es(t,n)},Ss:function(t,n){return this.Ts.Ss(t,n)},ds:function(t){return this.Ts.ds(t)},ps:function(t){return this.Ts.ps(t)},bs:function(t){return this.Ts.bs(t)},_s:function(t){return this.Ts._s(t)},xs:function(t){return this.Ts.xs(t)}}),e),e="https://console.fengmap.com/api-s/",pf="https://console.fengmap.cool/api-s/",mf={domain:e,online:e+"sdk/check",check:e+"sdk/auth/web",download:e+"sdk/auth/obtainMapRoute",downloadTile:e+"sdk/authLayered/obtainMapRoute",collect:e+"sdk/collect",themeUrl:e+"webtheme/",externalModelURL:e+"webmodel/"};function yf(t,n){for(var e,i=0,r=0,r=0;r<8;r++)1&n&&(i^=t),e=128&t,t<<=1,e&&(t^=27),n>>=1;return i}function bf(t,n,e){for(var i=0;i<4;i++)t[0+i]^=n[16*e+4*i],t[4+i]^=n[16*e+4*i+1],t[8+i]^=n[16*e+4*i+2],t[12+i]^=n[16*e+4*i+3]}function gf(t){for(var n,e,i,r=1;r<4;r++)for(e=0;e<r;){for(i=t[4*r+4-1],n=3;0<n;n--)t[4*r+n]=t[4*r+n-1];t[4*r+0]=i,e++}}function _f(t){for(var n,e,i,r=0;r<4;r++)for(n=0;n<4;n++)e=(240&t[4*r+n])>>4,i=15&t[4*r+n],t[4*r+n]=hf[16*e+i]}function wf(t){for(var n=0;n<4;n++)t[n]=cf[16*((240&t[n])>>4)+(15&t[n])]}function xf(t){return parseInt(t,16)}cf=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],hf=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],df=[2,lf=ff=0,0,0];var Ef={decryption:function(t,n){for(var e=Array(16),i=0;i<16;i++)e[i]=16*xf(n.substr(2*i,1))+xf(n.substr(2*i+1,1));var r=Array(16);for(i=0;i<16;i++)r[i]=16*xf(t.substr(2*i,1))+xf(t.substr(2*i+1,1));var o=Array(16);switch(i=[],e.length){default:case 16:ff=4,lf=10;break;case 24:ff=6,lf=12;break;case 32:ff=8,lf=14}for(var s=i=Array(16*(lf+1)),a=Array(4),u=4*(lf+1),c=0;c<ff;c++)s[4*c+0]=e[4*c+0],s[4*c+1]=e[4*c+1],s[4*c+2]=e[4*c+2],s[4*c+3]=e[4*c+3];for(c=ff;c<u;c++){if(a[0]=s[4*(c-1)+0],a[1]=s[4*(c-1)+1],a[2]=s[4*(c-1)+2],a[3]=s[4*(c-1)+3],0==c%ff){for(var h=void 0,f=void 0,h=(e=a)[0],f=0;f<3;f++)e[f]=e[f+1];if(e[3]=h,wf(a),1==(e=c/ff))df[0]=1;else if(1<e)for(df[0]=2,e--;0<e-1;)df[0]=yf(df[0],2),e--;(f=e=a)[0]=e[0]^(h=df)[0],f[1]=e[1]^h[1],f[2]=e[2]^h[2],f[3]=e[3]^h[3]}else 6<ff&&4==c%ff&&wf(a);s[4*c+0]=s[4*(c-ff)+0]^a[0],s[4*c+1]=s[4*(c-ff)+1]^a[1],s[4*c+2]=s[4*(c-ff)+2]^a[2],s[4*c+3]=s[4*(c-ff)+3]^a[3]}for(s=Array(16),a=0;a<4;a++)for(c=0;c<4;c++)s[4*a+c]=r[a+4*c];for(bf(s,i,lf),r=lf-1;1<=r;r--)for(gf(s),_f(s),bf(s,i,r),a=s,c=[14,9,13,11],u=f=void 0,e=Array(4),h=Array(4),u=0;u<4;u++){for(f=0;f<4;f++)e[f]=a[4*f+u];var f=c,l=e,d=h;for(d[0]=yf(f[0],l[0])^yf(f[3],l[1])^yf(f[2],l[2])^yf(f[1],l[3]),d[1]=yf(f[1],l[0])^yf(f[0],l[1])^yf(f[3],l[2])^yf(f[2],l[3]),d[2]=yf(f[2],l[0])^yf(f[1],l[1])^yf(f[0],l[2])^yf(f[3],l[3]),d[3]=yf(f[3],l[0])^yf(f[2],l[1])^yf(f[1],l[2])^yf(f[0],l[3]),f=0;f<4;f++)a[4*f+u]=h[f]}for(gf(s),_f(s),bf(s,i,0),a=0;a<4;a++)for(c=0;c<4;c++)o[a+4*c]=s[4*a+c];for(r="",i=0;i<16;++i)r+=s=(s=o[i].toString(16)).length<2?"0"+s:s;return r}};function Sf(t,n){var e=(65535&t)+(65535&n);return(t>>16)+(n>>16)+(e>>16)<<16|65535&e}function Tf(t,n,e,i,r,o){return Sf((n=Sf(Sf(n,t),Sf(i,o)))<<r|n>>>32-r,e)}function Af(t,n,e,i,r,o,s){return Tf(n&e|~n&i,t,n,r,o,s)}function Mf(t,n,e,i,r,o,s){return Tf(n&i|e&~i,t,n,r,o,s)}function Of(t,n,e,i,r,o,s){return Tf(n^e^i,t,n,r,o,s)}function Lf(t,n,e,i,r,o,s){return Tf(e^(n|~i),t,n,r,o,s)}function Rf(t,n){t[n>>5]|=128<<n%32,t[14+(n+64>>>9<<4)]=n;for(var e,i,r,o,s=1732584193,a=-271733879,u=-1732584194,c=271733878,h=0;h<t.length;h+=16)s=Af(e=s,i=a,r=u,o=c,t[h],7,-680876936),c=Af(c,s,a,u,t[h+1],12,-389564586),u=Af(u,c,s,a,t[h+2],17,606105819),a=Af(a,u,c,s,t[h+3],22,-1044525330),s=Af(s,a,u,c,t[h+4],7,-176418897),c=Af(c,s,a,u,t[h+5],12,1200080426),u=Af(u,c,s,a,t[h+6],17,-1473231341),a=Af(a,u,c,s,t[h+7],22,-45705983),s=Af(s,a,u,c,t[h+8],7,1770035416),c=Af(c,s,a,u,t[h+9],12,-1958414417),u=Af(u,c,s,a,t[h+10],17,-42063),a=Af(a,u,c,s,t[h+11],22,-1990404162),s=Af(s,a,u,c,t[h+12],7,1804603682),c=Af(c,s,a,u,t[h+13],12,-40341101),u=Af(u,c,s,a,t[h+14],17,-1502002290),s=Mf(s,a=Af(a,u,c,s,t[h+15],22,1236535329),u,c,t[h+1],5,-165796510),c=Mf(c,s,a,u,t[h+6],9,-1069501632),u=Mf(u,c,s,a,t[h+11],14,643717713),a=Mf(a,u,c,s,t[h],20,-373897302),s=Mf(s,a,u,c,t[h+5],5,-701558691),c=Mf(c,s,a,u,t[h+10],9,38016083),u=Mf(u,c,s,a,t[h+15],14,-660478335),a=Mf(a,u,c,s,t[h+4],20,-405537848),s=Mf(s,a,u,c,t[h+9],5,568446438),c=Mf(c,s,a,u,t[h+14],9,-1019803690),u=Mf(u,c,s,a,t[h+3],14,-187363961),a=Mf(a,u,c,s,t[h+8],20,1163531501),s=Mf(s,a,u,c,t[h+13],5,-1444681467),c=Mf(c,s,a,u,t[h+2],9,-51403784),u=Mf(u,c,s,a,t[h+7],14,1735328473),s=Of(s,a=Mf(a,u,c,s,t[h+12],20,-1926607734),u,c,t[h+5],4,-378558),c=Of(c,s,a,u,t[h+8],11,-2022574463),u=Of(u,c,s,a,t[h+11],16,1839030562),a=Of(a,u,c,s,t[h+14],23,-35309556),s=Of(s,a,u,c,t[h+1],4,-1530992060),c=Of(c,s,a,u,t[h+4],11,1272893353),u=Of(u,c,s,a,t[h+7],16,-155497632),a=Of(a,u,c,s,t[h+10],23,-1094730640),s=Of(s,a,u,c,t[h+13],4,681279174),c=Of(c,s,a,u,t[h],11,-358537222),u=Of(u,c,s,a,t[h+3],16,-722521979),a=Of(a,u,c,s,t[h+6],23,76029189),s=Of(s,a,u,c,t[h+9],4,-640364487),c=Of(c,s,a,u,t[h+12],11,-421815835),u=Of(u,c,s,a,t[h+15],16,530742520),s=Lf(s,a=Of(a,u,c,s,t[h+2],23,-995338651),u,c,t[h],6,-198630844),c=Lf(c,s,a,u,t[h+7],10,1126891415),u=Lf(u,c,s,a,t[h+14],15,-1416354905),a=Lf(a,u,c,s,t[h+5],21,-57434055),s=Lf(s,a,u,c,t[h+12],6,1700485571),c=Lf(c,s,a,u,t[h+3],10,-1894986606),u=Lf(u,c,s,a,t[h+10],15,-1051523),a=Lf(a,u,c,s,t[h+1],21,-2054922799),s=Lf(s,a,u,c,t[h+8],6,1873313359),c=Lf(c,s,a,u,t[h+15],10,-30611744),u=Lf(u,c,s,a,t[h+6],15,-1560198380),a=Lf(a,u,c,s,t[h+13],21,1309151649),s=Lf(s,a,u,c,t[h+4],6,-145523070),c=Lf(c,s,a,u,t[h+11],10,-1120210379),u=Lf(u,c,s,a,t[h+2],15,718787259),a=Lf(a,u,c,s,t[h+9],21,-343485551),s=Sf(s,e),a=Sf(a,i),u=Sf(u,r),c=Sf(c,o);return[s,a,u,c]}function Nf(t){for(var n="",e=32*t.length,i=0;i<e;i+=8)n+=String.fromCharCode(t[i>>5]>>>i%32&255);return n}function Pf(t){var n=[];for(n[(t.length>>2)-1]=void 0,i=0;i<n.length;i+=1)n[i]=0;for(var e=8*t.length,i=0;i<e;i+=8)n[i>>5]|=(255&t.charCodeAt(i/8))<<i%32;return n}function Ff(t){for(var n,e="0123456789abcdef",i="",r=0;r<t.length;r+=1)n=t.charCodeAt(r),i+=e.charAt(n>>>4&15)+e.charAt(15&n);return i}function jf(t){return unescape(encodeURIComponent(t))}function If(t){return Nf(Rf(Pf(t=jf(t)),8*t.length))}function Cf(t,n){var e,t=jf(t),n=jf(n),i=Pf(t),r=[],o=[];for(r[15]=o[15]=void 0,16<i.length&&(i=Rf(i,8*t.length)),e=0;e<16;e+=1)r[e]=909522486^i[e],o[e]=1549556828^i[e];return t=Rf(r.concat(Pf(n)),512+8*n.length),Nf(Rf(o.concat(t),640))}function Df(t,n,e){return n?e?Cf(n,t):Ff(Cf(n,t)):e?If(t):Ff(If(t))}var kf={encryption:function(t){return Df(t)}};function Uf(t){return(Uf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Bf(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=Uf(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Uf(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Uf(t)?t:String(t)}(i.key),i)}}function Gf(t,n,e){return n&&Bf(t.prototype,n),e&&Bf(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}e=Gf(function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function")});Object.assign(e.prototype,{As:function(t,n,e,i,r){void 0===st.a.KjWzhWlSj||!st.a.KjWzhWlSj.license||!st.a.KjWzhWlSj.license||"string"==typeof n&&0!=n.length&&(n=Ef.decryption(n,"026685bf295f587b5dffc1f18d5dc27c"),e=kf.encryption(e),n=Ef.decryption(n,e),-1!==t.indexOf(n))?i&&i():r&&r()},Ms:function(t,n,e,i){var r;-1!==n.indexOf("")||-1!==n.indexOf("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")||void 0===t.mapURL?e&&e():(r=kf.encryption("fengmap.localhost:"+t.appName),r=Ef.decryption(t.key,r),-1!==n.indexOf(r)?this.As(n,t.license,t.buildingID,function(){e&&e()},function(){i&&i(vr.LICENSE_ERROR)}):i&&i(vr.NAME_KEY_ERROR))},Os:function(t,n,e){var i=this;void 0!==t.mapURL?n&&n():(t.enableCollect&&this.Ls(t),this.Rs(function(){new Wh({method:"POST",url:mf.check,header:{"X-Requested-With":"XMLHttpRequest","Content-type":"application/json;charset=utf-8"},data:i.Ns(t)}).ss(function(){n&&n()},function(t){e&&e(t)},function(){n&&n()})},function(){n&&n()}))},Rs:function(t,n){new Wh({method:"GET",url:mf.online}).ss(function(){t&&t()},function(){n&&n()},function(){n&&n()})},Ns:function(t,n){st.a.environment===B.a.BROWSER&&-1!==(i=(e=Uh.a.global().location.host).indexOf(":"))&&(e=e.slice(0,i));var e,i={mapId:t.buildingID,appName:t.appName};return n?i.keyValue=t.key:i.appKey=t.key,n?i.webUrl=e||"0.0.0.0":i.webURL=e||"0.0.0.0",i},Ls:function(t){if("undefined"!=typeof navigator&&"undefined"!=typeof document){var n={};-1!==navigator.userAgent.indexOf("Opera")?n.userAgent="Opera":-1!==navigator.userAgent.indexOf("Firefox")?n.userAgent="FF":-1!==navigator.userAgent.indexOf("Chrome")?n.userAgent="Chrome":-1!==navigator.userAgent.indexOf("Safari")&&0===navigator.userAgent.indexOf("Chrome")?n.userAgent="Safari":-1!==navigator.userAgent.indexOf("compatible")&&-1!==navigator.userAgent.indexOf("MSIE")?n.userAgent="IE":-1!==navigator.userAgent.indexOf("Trident")&&(n.userAgent="Edge"),n.product="JS",n.sdkVersion=_+"."+S,n.appName=t.appName,n.appkey=t.key;for(var t=st.a.document.createElement("canvas").getContext("experimental-webgl"),e=t.getExtension("WEBGL_debug_renderer_info"),i=(n.gpu=e?t.getParameter(e.UNMASKED_RENDERER_WEBGL):null,n.os=navigator.platform,!0),r=navigator.userAgent,o=["Android","iPhone","SymbianOS","Windows Phone","iPad","iPod"],s=0;s<o.length;s++)if(0<r.indexOf(o[s])){i=!1;break}n.device=i?"pc":"mobile",new Wh({method:"POST",url:mf.collect,header:{"X-Requested-With":"XMLHttpRequest","Content-type":"application/json;charset=utf-8"},data:n}).ss()}}});var Hf=new e;function Xf(t){return(Xf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Vf(t){return function(t){if(Array.isArray(t))return zf(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,n){var e;if(t)return"string"==typeof t?zf(t,n):"Map"===(e="Object"===(e=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?zf(t,n):void 0}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function zf(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function Wf(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=Xf(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Xf(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Xf(t)?t:String(t)}(i.key),i)}}function Yf(t,n,e){return n&&Wf(t.prototype,n),e&&Wf(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var e=Yf(function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this.Ts=new vf,this.Ps=[]}),Qf=(Object.assign(e.prototype,{zn:function(){this.Ps.forEach(function(t){t.zn()}),this.Ps.length=0},Fs:function(t,n,e,i){var r;t.mapURL?(r=t.isPreview?t.isOutdoor?t.tile?t.mapURL+t.buildingID+"/separate/"+t.buildingID+n+".fmap":t.mapURL+t.buildingID+"/"+t.buildingID+n+".fmap":t.tile?t.mapURL+t.mapID+"/"+t.bid+"/"+t.buildingID+"/separate/"+t.buildingID+n+".fmap":t.mapURL+t.mapID+"/"+t.bid+"/"+t.buildingID+"/"+t.buildingID+n+".fmap":t.mapURLAbsolute?t.mapURL+t.buildingID+n+".fmap":t.isOutdoor?t.mapURL+t.buildingID+"/"+t.buildingID+n+".fmap":t.mapURL+t.mapID+"/"+t.bid+"/"+t.buildingID+"/"+t.buildingID+n+".fmap",e&&e(r)):(r={newFlag:"2",keyType:3,isSeparate:!1},t.isOutdoor||(r.bId=t.bid,r.rootMid=t.mapID),n=new Wh({method:"POST",url:""===n?mf.download:mf.downloadTile+"/"+t.buildingID+n+".fmap",header:{"X-Requested-With":"XMLHttpRequest","Content-type":"application/json;charset=utf-8"},data:Object.assign(r,Hf.Ns(t,!0))}),this.Ps.push(n),n.ss(function(t){e&&e(t.replace('"',"").replace('"',""))},function(t){i&&i(t)},function(t){i&&i(t)}))},js:function(e,i,r){var o=this;e.enableCollect=!0,Hf.Os(e,function(){o.Fs(e,"",function(t){t=new Wh({method:"GET",responseType:"arraybuffer",url:t});o.Ps.push(t),t.ss(function(t){var t=new Uint8Array(t),n=o.Ts.hs(t);!e.isOutdoor||(t=[],n.keys&&0!==n.keys.length?t.push.apply(t,Vf(n.keys)):t.push(n.key),e.isPreview)?i&&i(n):Hf.Ms(e,t,function(){i&&i(n)},function(t){r&&r(t)})},function(t){r&&r(t===vr.PATH_ERROR?vr.MAP_ID_URL_ERROR:t)},function(t){r&&r(t)})},function(t){r&&r(t)})},function(t){r&&r(t)})},Is:function(e,i,r){var o=this;e.enableCollect=!0,Hf.Os(e,function(){o.Fs(e,".scene",function(t){t=new Wh({method:"GET",responseType:"arraybuffer",url:t});o.Ps.push(t),t.ss(function(t){var t=new Uint8Array(t),n=o.Ts.ds(t);!e.isOutdoor||(t=[],n.keys&&0!==n.keys.length?t.push.apply(t,Vf(n.keys)):t.push(n.key),e.isPreview)?i&&i(n):Hf.Ms(e,t,function(){i&&i(n)},function(t){r&&r(t)})},function(t){r&&r(t)},function(t){r&&r(t)})},function(t){r&&r(t)})},function(t){r&&r(t)})},Cs:function(t,n,e){var i=this;this.Fs(t,".gate",function(t){t=new Wh({method:"GET",responseType:"arraybuffer",url:t});i.Ps.push(t),t.ss(function(t){t=new Uint8Array(t),t=i.Ts.ps(t);n&&n(t)},function(t){e&&e(t)},function(t){e&&e(t)})},function(t){e&&e(t)})},Ds:function(t,n,e,i){var r=this;this.Fs(t,".floor."+n+".geo",function(t){t=new Wh({method:"GET",responseType:"arraybuffer",url:t});r.Ps.push(t),t.ss(function(t){t=new Uint8Array(t),t=r.Ts.bs(t);e&&e(t)},function(t){i&&i(t)},function(t){i&&i(t)})},function(t){i&&i(t)})},ks:function(t,n,e,i){var r=this;this.Fs(t,".floor."+n+".biz",function(t){t=new Wh({method:"GET",responseType:"arraybuffer",url:t});r.Ps.push(t),t.ss(function(t){t=new Uint8Array(t),t=r.Ts._s(t);e&&e(t)},function(t){i&&i(t)},function(t){i&&i(t)})},function(t){i&&i(t)})},Us:function(t,n,e,i){var r=this;this.Fs(t,n,function(t){t=new Wh({method:"GET",responseType:"arraybuffer",url:t});r.Ps.push(t),t.ss(function(t){t=new Uint8Array(t),t=r.Ts.xs(t);e&&e(t)},function(t){i&&i(t)})},function(t){i&&i(t)},function(t){i&&i(t)})},Bs:function(t,n,e,i){this.Us(t,".floor."+n+".navi",e,i)},Gs:function(t,n,e,i){this.Us(t,".floor."+n+".drive.navi",e,i)},Hs:function(t,n,e,i){this.Us(t,".floor."+n+".accessible.navi",e,i)}}),e);function Zf(t){for(var n=[],e=t.length,i=0;i<e;i++){for(var r=t[i],o={x:this.Xs(r.x),y:this.Xs(r.y)},s=n.length,a=!1,u=0;u<s;u++){var c=n[u];if(c.x==o.x&&c.y==o.y){a=!0;break}}a||n.push(o)}return n}function qf(t){return+t.toFixed(2)}function Kf(t){return(Kf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Jf(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=Kf(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Kf(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Kf(t)?t:String(t)}(i.key),i)}}function $f(t,n,e){return n&&Jf(t.prototype,n),e&&Jf(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}e=$f(function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function")});Object.assign(e.prototype,{Vs:function(t,n){for(var e=[],i=0,r=0;r<t.length;r++){var o=t[r].idxs;if("number"==typeof(o=o||t[r]))for(;i<o;)e.push({x:n[i],y:n[i+1]}),i+=2;else for(var s=0;s<o.length;s++)for(var a=o[s];i<a;)e.push({x:n[i],y:n[i+1]}),i+=2}return e},zs:function(t,n){for(var e=[],i=0,r=0;r<t.length;r++){var o=t[r].idxs;if("number"==typeof(o=o||t[r])){for(var s=[];i<o;)s.push({x:n[i],y:n[i+1]}),i+=2;e.push(s)}else for(var a=0;a<o.length;a++){for(var u=o[a],c=[];i<u;)c.push({x:n[i],y:n[i+1]}),i+=2;e.push(c)}}return e},Ws:function(t,n){for(var e=[],i=[],r=0,o=0;o<t.length;o++){var s=t[o].idxs;if("number"==typeof(s=s||t[o]))for(;r<s;)e.push({x:n[r],y:n[r+1]}),r+=2;else for(var a=0;a<s.length;a++)if(0===a)for(var u=s[a];r<u;)e.push({x:n[r],y:n[r+1]}),r+=2;else{for(var c=[],h=s[a];r<h;)c.push({x:n[r],y:n[r+1]}),r+=2;i.push(c)}}var f=[];return f.push(e),f.push.apply(f,i),f},Ys:function(t){return Zf(t)},Xs:qf});var tl=new e;function nl(t){return(nl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function el(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=nl(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=nl(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==nl(t)?t:String(t)}(i.key),i)}}function il(t,n,e){return n&&el(t.prototype,n),e&&el(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var rl={G1:"MULTIPOLYGON(((",G2:"POINT(",G3:"MULTILINESTRING(("},e=(rl.GLEN1="MULTIPOLYGON(((".length,rl.GLEN2="POINT(".length,rl.GLEN3="MULTILINESTRING((".length,il(function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function")}));Object.assign(e.prototype,{Vs:function(t){var n=[];return 0!=t.indexOf(rl.G2)?[]:(t=t.substring(rl.GLEN2,t.length-1).split(" "),n.push({x:parseFloat(t[0]),y:parseFloat(t[1])}),n)},Qs:function(t,n){for(var e=0;e<t.length;e++){var i=t[e].split(" ");n.push({x:parseFloat(i[0]),y:parseFloat(i[1])})}},zs:function(t){return 0!=t.indexOf(rl.G3)?[]:(t=t.substring(rl.GLEN3,t.length-2).split(","),this.Qs(t,t=[]),[t])},Ws:function(t){var n=[],e=[];if(0!=t.indexOf(rl.G1))return[];for(var i=t.substring(rl.GLEN1,t.length-3).split(/\),\(/),r=0;r<i.length;r++){var o=i[r].split(/,/);if(0==r)this.Qs(o,n);else{for(var s=[],a=0;a<o.length;a++){var u=o[a].split(" ");s.push({x:parseFloat(u[0]),y:parseFloat(u[1])})}e.push(s)}}t=[];return t.push(n),t.push.apply(t,e),t},Ys:function(t){return Zf(t)},Xs:qf});var ol=new e;function sl(t,n){var e,i,r,o,s="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(s)return i=!(e=!0),{s:function(){s=s.call(t)},n:function(){var t=s.next();return e=t.done,t},e:function(t){i=!0,r=t},f:function(){try{e||null==s.return||s.return()}finally{if(i)throw r}}};if(Array.isArray(t)||(s=function(t,n){var e;if(t)return"string"==typeof t?al(t,n):"Map"===(e="Object"===(e=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?al(t,n):void 0}(t))||n&&t&&"number"==typeof t.length)return s&&(t=s),o=0,{s:n=function(){},n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:n};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function al(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function ul(t){return(ul="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function cl(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=ul(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=ul(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==ul(t)?t:String(t)}(i.key),i)}}var e=function(){function n(t){if(!(this instanceof n))throw new TypeError("Cannot call a class as a function");this.mi=zr.GROUP,this.Ot=new Map,this.pi=-1,this.ai=null,Object.assign(this,t)}var t,e,i;return t=n,(e=[{key:"getType",value:function(){return this.mi}},{key:"getBound",value:function(){return this.ai||this.bi(),this.ai}},{key:"getChildren",value:function(){return this.Ot}}])&&cl(t.prototype,e),i&&cl(t,i),Object.defineProperty(t,"prototype",{writable:!1}),n}(),hl=(Object.assign(e.prototype,{zn:function(){var t,n=sl(this.Ot.values());try{for(n.s();!(t=n.n()).done;){var e=t.value;e.zn&&e.zn()}}catch(t){n.e(t)}finally{n.f()}this.Ot.clear()},gi:function(n){var t=n._support(this);t==Do.PASS?this.Ot.forEach(function(t){t.gi(n)}):t==Do.PUSH&&n._result.push(this)},bi:function(){var n=this;this.ai=new Fi,0!=this.Ot.size&&this.Ot.forEach(function(t){n.ai.Wt(t.getBound())})}}),e);function fl(t){return(fl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ll(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=fl(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=fl(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==fl(t)?t:String(t)}(i.key),i)}}function dl(t,n,e){n=pl(n);var i=t,n=vl()?Reflect.construct(n,e||[],pl(t).constructor):n.apply(t,e);if(n&&("object"===fl(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return ml(i)}function vl(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(vl=function(){return!!t})()}function pl(t){return(pl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ml(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function yl(t,n){return(yl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var e=function(){var t,n,e=r,i=Bo;if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");function r(t){var n;if(this instanceof r)return(n=dl(this,r)).pi=t.eid,n.mi=zr.POINT,Object.assign(ml(n),t),n;throw new TypeError("Cannot call a class as a function")}return e.prototype=Object.create(i&&i.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),i&&yl(e,i),e=r,t&&ll(e.prototype,t),n&&ll(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(),bl=(Object.assign(e.prototype,{bi:function(){this.ai=new Fi,this.yi&&this.ai.Yt(this.yi)},gi:function(t){t._support(this)==Do.PUSH&&t._result.push(this)}}),e);function gl(t){return(gl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var _l=["layerGroups"],wl=["layers"];function xl(t,n){if(null==t)return{};var e,i=function(t,n){if(null==t)return{};var e,i,r={},o=Object.keys(t);for(i=0;i<o.length;i++)e=o[i],0<=n.indexOf(e)||(r[e]=t[e]);return r}(t,n);if(Object.getOwnPropertySymbols)for(var r=Object.getOwnPropertySymbols(t),o=0;o<r.length;o++)e=r[o],0<=n.indexOf(e)||Object.prototype.propertyIsEnumerable.call(t,e)&&(i[e]=t[e]);return i}function El(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=gl(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=gl(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==gl(t)?t:String(t)}(i.key),i)}}function Sl(t,n,e){return n&&El(t.prototype,n),e&&El(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var e=Sl(function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this.Zs=[1,2,3,4],this.qs=[6,7,9],this.Ks=[31,32],this.Js=new Map,this.Js.set(31,zr.EXTENTGROUP),this.Js.set(32,zr.MODELGROUP),this.Js.set(6,zr.FACILITYGROUP),this.Js.set(7,zr.LABELGROUP),this.Js.set(9,zr.EXTERNALMODELGROUP),this.$s=new Map,this.$s.set(31,["extentLayer",null]),this.$s.set(32,["modelLayer","labelLayer"]),this.$s.set(6,["poiLayer",null]),this.$s.set(7,["labelLayer",null]),this.$s.set(9,["externalModelLayer",null]),this.Ts=new vf}),Tl=(Object.assign(e.prototype,{ta:function(t){var n;return t?(n=t.scene,this.na(n,t)):null},na:function(t,e){var i=this,n=t.layerGroups,r=xl(t,_l),o=t.fileVer,s=new hl(r);return n.forEach(function(t){var n=i.ea(t,e,o);s.Ot.set(t.gid,n)}),s},ea:function(t,n,e){var i=this,r=t.layers,o=xl(t,wl),s=new hl(o),a=n&&n.floors?n.floors.get(t.gid).geo[0]:null,u=n&&n.floors?n.floors.get(t.gid).biz[0]:null;return r.forEach(function(t){6===t.ltype&&-1!==t.lname.indexOf("storelabel")&&(t.ltype=7);var n=i.ia(t,a,u,e);null!==n&&s.Ot.set(i.Js.get(t.ltype),n)}),this.ra(s),s},ra:function(t){var n=Array.from(t.Ot);n.sort(function(t,n){return t[0]-n[0]}),t.Ot=new Map(n)},ia:function(t,n,e,i){var r;return-1===this.Zs.indexOf(t.ltype)&&this.$s.get(t.ltype)?(r=new hl(t),this.oa(r,n,e,i),r&&(r.mi=this.Js.get(t.ltype)),r):null},oa:function(t,n,e,i){if(t){var r=this.$s.get(t.ltype);if(r){var o=n?n[r[0]]:[],s=e?e[r[0]]:[];switch(t.ltype){case 6:this.sa(t,o,s,i,zr.FACILITY);break;case 7:this.sa(t,o,s,i,zr.LABEL);break;case 9:this.sa(t,o,s,i,zr.EXTERNALMODEL);break;case 31:this.aa(t,o,s,i,zr.EXTENT,null);break;case 32:this.aa(t,o,s,i,zr.MODEL,n?n[r[1]]:null)}}}},sa:function(t,n,e,i,r){for(var o=0;o<n.length;o++){var s=this.ua(n[o],e[o],i);s.mi=r,t.Ot.set(n[o].eid,s)}},ua:function(t,n,e){n=Object.assign({},n,{area:t.area,eid:t.eid,height:t.height}),n=new bl(n);return t.coordinates?n.yi=t.coordinates:(n.yi=1==e?ol.Vs(t.geo):tl.Vs(t.idxs,t.pts),t.coordinates=n.yi),n},aa:function(t,n,e,i,r,o){for(var s=0;s<n.length;s++){var a=this.ca(n[s],e[s],i,o?o[s]:null);a.mi=r,t.Ot.set(n[s].eid,a)}},ca:function(t,n,e,i){n=Object.assign({},n,{area:t.area,eid:t.eid,height:t.height}),n=new Qo(n);return n.yi=1===e?ol.Ws(t.geo):tl.Ws(t.idxs,t.pts),i&&(i.coordinates||(i.coordinates=1===e?ol.Vs(i.geo):tl.Vs(i.idxs,i.pts)),n.Kt=i.coordinates[0]),n}}),e),Al={NONE_RODE_NETWORK:1,WALK_RODE_NETWORK:2,DRIVE_RODE_NETWORK:4,ACCESSIBLE_RODE_NETWORK:8};function Ml(t){return(Ml="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ol(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=Ml(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Ml(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Ml(t)?t:String(t)}(i.key),i)}}function Ll(t,n,e){return n&&Ol(t.prototype,n),e&&Ol(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var e=Ll(function t(){var n=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=this,i=t;if(!(e instanceof i))throw new TypeError("Cannot call a class as a function");this.ha=n.disposeCallback,this.fa=!1,this.la=!1,this.da=void 0!==n.enable&&n.enable,this.name=void 0!==n.name?n.name:"",this.va=new Map,this.pa=n.mapCreateTime}),Rl=(Object.assign(e.prototype,{ma:function(){!this.da||this.la||this.fa&&0===this.va.size&&(this.ha({mapCreateTime:this.pa}),this.la=!0)},ya:function(t){this.da&&(this.fa=t,this.ma())},ba:function(t){this.da&&(this.va.has(t)&&console.warn("添加的引用已经存在..."),this.va.set(t,0))},ga:function(t){this.da&&(this.va.has(t)?(this.va.delete(t),this.ma()):console.warn("移除的引用不存在"))}}),e);function Nl(t){return(Nl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Pl(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=Nl(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Nl(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Nl(t)?t:String(t)}(i.key),i)}}var e=function(){function n(t){if(!(this instanceof n))throw new TypeError("Cannot call a class as a function");this.Pr=new Map,this._a=new Map,this.es=new Map,this.wa=new Map,this.xa=new Map,this.Ea=new Map,this.Sa=[2,3],this.Ta=!1,this.Ts=new vf,this.Aa=new Tl,this.Ma=new Qf,this.Oa=null,this.ko=this.ko.bind(this),this.La=new Rl({disposeCallback:this.ko,enable:!0,name:"DataManager",mapCreateTime:t?t.mapCreateTime:(new Date).getTime()})}var t,e,i;return t=n,(e=[{key:"load",value:function(t,n){this.Ra(t,n)}},{key:"loadWhole",value:function(t,n){this.Na(t,n)}},{key:"getDecode",value:function(t){t=void 0!==t.buildingID?t.buildingID:t.mapID;return this.Pa({buildingID:t})}},{key:"getData",value:function(t){t=void 0!==t.buildingID?t.buildingID:t.mapID;return this.Pr.get(t)}},{key:"setCache",value:function(t){this.Pr=t[0],this._a=t[1]}},{key:"getCache",value:function(){return[this.Pr,this._a]}}])&&Pl(t.prototype,e),i&&Pl(t,i),Object.defineProperty(t,"prototype",{writable:!1}),n}(),Fl=(Object.assign(e.prototype,{zn:function(t){this.Oa=t,this.Ma.zn(),this.La.ya(!0)},ko:function(){this.Pr.clear(),this.Pr=null,this._a.clear(),this._a=null,this.es.clear(),this.es=null,this.wa.clear(),this.wa=null,this.xa.clear(),this.xa=null,this.Ea.clear(),this.Ea=null,this.Oa&&this.Oa({name:"DataManager"})},Fa:function(t){this.wa.set(t.buildingID+t.uuid,null),this.xa.set(t.buildingID+t.uuid,null),this.Ea.set(t.buildingID+t.uuid,0)},Ra:function(a,u){var c=this;this.Fa(a),this.Is(a,function(n,t){u&&u(n,t);var s=c.ja(a),t=a.loadNavi&&s.buildings&&0<s.buildings.length;c.Cs(a,t,function(t,n){u&&u(t,n);for(var e=void 0!==a.level?a.level:parseInt(s.defGid),i=(c.Ia(a,e,u),a.visibleLevels||s.levels),r=0;r<i.length;r++)i[r]===e||s.levels.indexOf(i[r])<0||c.Ia(a,i[r],u);if(a.preLoad)for(var o=0;o<s.levels.length;o++)s.levels[o]!==e&&-1===i.indexOf(s.levels[o])&&c.Ia(a,s.levels[o],u)},function(t){u&&u(n,t)})},function(t,n){u&&u(t,n)})},Cs:function(e,t,i,r){var o,s=this;t?(t=this.Ca(e))?i&&i("gate",t):(o="_sendGate"+St.generateUUID(),this.La.ba(o),this.Ma.Cs(e,function(t){s._a.get(e.buildingID).gate=t,i&&i("gate",t),s.La.ga(o)},function(t){var n;e.navigationData?((n=s._a.get(e.buildingID)).gate=e.navigationData,i&&i("gate",n.gate)):r("error",t),s.La.ga(o)})):i&&i("gate",null)},Is:function(n,e,i){var r,o=this,t=this.ja(n);t?(e&&e("scene",t),n.justDecode||(t=this.Pr.get(n.buildingID),e&&e("building",t))):(r="_sendScene"+St.generateUUID(),this.La.ba(r),this.Ma.Is(n,function(t){n.isOutdoor&&o.Da(t),o._a.set(n.buildingID,{scene:t}),e&&e("scene",t),n.justDecode||(t=o.Aa.na(t),o.Pr.set(n.buildingID,t),e&&e("building",t)),o.La.ga(r)},function(t){i&&i("error",t===vr.PATH_ERROR?vr.MAP_ID_URL_ERROR:t),o.La.ga(r)}))},Da:function(t){var n=t.fileVer;t.buildings&&1<n&&t.buildings.forEach(function(n){n.floors&&(n.levelChart=[],n.fids=[],n.floors.forEach(function(t){t.yi=tl.Ws(t.idxs,t.pts),t.pgid&&n.levelChart.push(t.pgid,t.gid),t.baseLevel&&(n.minlevel=t.minlevel,n.maxlevel=t.maxlevel),t.fids&&n.fids.push.apply(n.fids,t.fids)}))})},Ia:function(t,n,e,i){var r=this.wa.get(t.buildingID+t.uuid);r||this.wa.set(t.buildingID+t.uuid,r=[]),i?r.unshift(n):r.push(n),this.Ta&&1!==r.length||this.ka(t,e)},ka:function(i,r){var o,t,s,a=this,u=this.ja(i);u&&(o=this.wa.get(i.buildingID+i.uuid))&&0!==o.length&&((t=this.xa.get(i.buildingID+i.uuid))||this.xa.set(i.buildingID+i.uuid,t=[]),s=o[0],-1!==t.indexOf(s)?(o.splice(o.indexOf(s),1),this.ka(i,r)):(t.push(s),this.Ua(i,s,function(t,n){var e=a.Ea.get(i.buildingID+i.uuid);"layerGroup"===t&&(r&&r(t,n),a.Ea.set(i.buildingID+i.uuid,++e),e===u.layerGroups.length&&r&&r("decode",a.Pa(i)),o.splice(o.indexOf(s),1),a.ka(i,r)),"layer"===t&&r&&r(t,n),"floor"===t&&(r&&r(t,n),e===u.layerGroups.length)&&r&&r("complete",a.Ba(i))},function(t,n){r&&r(t,n)})))},Ua:function(r,o,s,n){var t,a,u,c,h,e,i=this,f=this.ja(r),l=this.Ga(f,o);l?(t=l.gname,l=l.naviType||0,a=this.Sa[0],u=0,c=new Map,h=r.merge,e=function(n){var e,i,t;a===++u&&(e=c.get("geo"),i=c.get("biz"),h&&h.merge(o,e,i,f.fileVer),s&&s("layerGroup",c),r.justDecode||((t=n.ki(r,o)).Ot.forEach(function(t){n.Aa.oa(t,e,i,f.fileVer),s&&s("layer",t)}),s&&s("floor",t)))},r.loadNavi&&((0!=(l&Al.WALK_RODE_NETWORK)||f.fileVer<3)&&(a++,this.Bs(r,o,t,function(t,n){c.set(t,n),s&&s(t,n),e(i)},function(t){n&&n(t)})),0!=(l&Al.DRIVE_RODE_NETWORK)&&(a++,this.Gs(r,o,t,function(t,n){c.set(t,n),s&&s(t,n),e(i)},function(t){n&&n(t)})),0!=(l&Al.ACCESSIBLE_RODE_NETWORK))&&(a++,this.Hs(r,o,t,function(t,n){c.set(t,n),s&&s(t,n),e(i)},function(t){n&&n(t)})),this.Ds(r,o,t,function(t,n){c.set(t,n),s&&s(t,n),e(i)},function(t){n&&n(t)}),this.ks(r,o,t,function(t,n){c.set(t,n),s&&s(t,n),e(i)},function(t){n&&n(t)})):n&&n("error",vr.DEFAULT_LEVEL_ERROR)},Ds:function(n,e,t,i,r){var o,s=this,a=this.Ha(n,e,"geo");a?i&&i("geo",a):(o="_sendFloorGeo"+St.generateUUID(),this.La.ba(o),this.Ma.Ds(n,t,function(t){s.Xa(n,e,"geo",t),i&&i("geo",t),s.La.ga(o)},function(t){r&&r("error",t),s.La.ga(o)}))},ks:function(n,e,t,i,r){var o,s=this,a=this.Ha(n,e,"biz");a?i&&i("biz",a):(o="_sendFloorBiz"+St.generateUUID(),this.La.ba(o),this.Ma.ks(n,t,function(t){s.Xa(n,e,"biz",t),i&&i("biz",t),s.La.ga(o)},function(t){r&&r("error",t),s.La.ga(o)}))},Bs:function(n,e,t,i,r){var o,s=this,a=this.Ha(n,e,"navi");a?i&&i("navi",a):(o="_sendFloorNavi"+St.generateUUID(),this.La.ba(o),this.Ma.Bs(n,t,function(t){s.Xa(n,e,"navi",t),i&&i("navi",t),s.La.ga(o)},function(t){r&&r("error",t),s.La.ga(o)}))},Gs:function(n,e,t,i,r){var o,s=this,a=this.Ha(n,e,"drive_navi");a?i&&i("drive_navi",a):(o="_sendFloorNaviDrive"+St.generateUUID(),this.La.ba(o),this.Ma.Gs(n,t,function(t){s.Xa(n,e,"drive_navi",t),i&&i("drive_navi",t),s.La.ga(o)},function(t){r&&r("error",t),s.La.ga(o)}))},Hs:function(n,e,t,i,r){var o,s=this,a=this.Ha(n,e,"accessible_navi");a?i&&i("drive_navi",a):(o="_sendFloorNaviAccessible"+St.generateUUID(),this.La.ba(o),this.Ma.Hs(n,t,function(t){s.Xa(n,e,"accessible_navi",t),i&&i("accessible_navi",t),s.La.ga(o)},function(t){r&&r("error",t),s.La.ga(o)}))},Na:function(t,e){this.js(t,function(t,n){e&&e(t,n)},function(t,n){e&&e(t,n)})},js:function(n,e,i){var r,o=this,s=this.Pa(n);s?e&&e("decode",s):(r="_sendWhole"+St.generateUUID(),this.La.ba(r),this.Ma.js(n,function(t){o.Va(n,t),s=o.Pa(n),e&&e("decode",s),n.justDecode||(t=o.Aa.ta(s),o.Pr.set(n.buildingID,t),e&&e("complete",t)),o.La.ga(r)},function(t){i&&i("error",t),o.La.ga(r)}))},Ba:function(t){if(this.Pr)return this.Pr.get(t.buildingID)||null},ki:function(t,n){t=this.Pr.get(t.buildingID);return t?t.Ot.get(n):null},Va:function(t,n){var e={scene:null,floors:new Map},i=this.Ts.ls(n);t.isOutdoor&&this.Da(i),e.scene=i,e.gate=this.Ts.vs(n);for(var r=0;r<i.layerGroups.length;r++){var o=i.layerGroups[r],s=this.Ts.ys(n,o.gid),a=this.Ts.gs(n,o.gid),u=this.Ts.ws(n,o.gid),c=this.Ts.Es(n,o.gid),h=this.Ts.Ss(n,o.gid),f=(t.merge&&t.merge.merge(o.gid,s,a,i.fileVer),new Map);f.set("geo",s),f.set("biz",a),f.set("navi",u),f.set("drive_navi",c),f.set("accessible_navi",h),e.floors.set(o.gid,f)}this._a.set(t.buildingID,e)},Pa:function(t){var n=this._a.get(t.buildingID);if(!n)return null;for(var e=n.scene,n=n.gate,i=new Map,n={scene:e,floors:i,gate:n},r=0;r<e.layerGroups.length;r++){var o=e.layerGroups[r],s=o.gid,a={gid:s,gname:o.gname,level:s,geo:[],biz:[],navi:[],naviDrive:[],naviAccessible:[]},u=(a.geo.push(this.Ha(t,s,"geo")),a.biz.push(this.Ha(t,s,"biz")),this.Ha(t,s,"navi")),u=(u&&a.navi.push(u),this.Ha(t,s,"drive_navi")),u=(u&&a.naviDrive.push(u),this.Ha(t,s,"accessible_navi"));u&&a.naviAccessible.push(u),i.set(o.gid,a)}return n},ja:function(t){t=this._a.get(t.buildingID);return t?t.scene:null},Ca:function(t){t=this._a.get(t.buildingID);return t?t.gate:null},Xa:function(t,n,e,i){var r,t=this._a.get(t.buildingID);t&&((r=t.floors)||(r=new Map,t.floors=r),(t=r.get(n))||(t=new Map,r.set(n,t)),t.set(e,i))},Ha:function(t,n,e){var t=this._a.get(t.buildingID);return(t=t&&t.floors)&&(t=t.get(n))?t.get(e):null},Ga:function(t,n){if(null!=t)for(var e=t.layerGroups,i=0;i<e.length;i++)if(e[i].gid==n)return e[i];return null}}),e);function jl(t,n){return Ea.prototype.copy.call(t,n),t.fragmentShader=n.fragmentShader,t.vertexShader=n.vertexShader,t.uniforms=_a.clone(n.uniforms),t.lights=n.lights,t}function Il(n){Object.defineProperties(n,{color:{enumerable:!0,get:function(){return n.uniforms.diffuse.value},set:function(t){n.uniforms.diffuse.value=t}},opacity:{enumerable:!0,get:function(){return n.uniforms.opacity.value},set:function(t){n.uniforms.opacity.value=t}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(t){this.uniforms.map.value=t}}})}function Cl(t){t.fmcommon={diffuse:{value:new lt(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new Z}}}Cl(Lt),Lt.line={lineWidth:{value:1},resolution:{value:new Mt(1,1)},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1},mmap:{value:null},offset:{value:new Mt(0,0)},repeat:{value:new Mt(1,1)},miny:{value:0},pcolor:{value:new lt(11447982)},usePassOpacity:{value:0},passOpacity:{value:1}},eu.line={uniforms:_a.merge([Lt.fmcommon,Lt.line]),vertexShader:"\n\t\t#include <common>\n\t\t#include <color_pars_vertex>\n\n\t\tuniform float lineWidth;\n\t\tuniform vec2 resolution;\n\n\t\tattribute float uvyStart;\n\t\tattribute float uvyEnd;\n\n\t\tattribute vec3 instanceStart;\n\t\tattribute vec3 instanceEnd;\n\n\t\tattribute vec3 instanceColorStart;\n\t\tattribute vec3 instanceColorEnd;\n\t\tattribute vec2 uv2;\n\n\n\t\tvarying vec2 vUv;\n\t\tvarying vec2 vUv2;\n\t\tvarying float uvScale;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashScale;\n\t\t\tattribute float instanceDistanceStart;\n\t\t\tattribute float instanceDistanceEnd;\n\t\t\tvarying float vLineDistance;\n\n\t\t#endif\n\n\t\tvoid trimSegment( const in vec4 start, inout vec4 end ) {\n\n\t\t\t// trim end segment so it terminates between the camera plane and the near plane\n\n\t\t\t// conservative estimate of the near plane\n\t\t\tfloat a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column\n\t\t\tfloat b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column\n\t\t\tfloat nearEstimate = - 0.5 * b / a;\n\n\t\t\tfloat alpha = ( nearEstimate - start.z ) / ( end.z - start.z );\n\n\t\t\tend.xyz = mix( start.xyz, end.xyz, alpha );\n\n\t\t}\n\n\t\t#include <logdepthbuf_pars_vertex>\n\n\t\tvoid main() {\n\n\t\t\t#ifdef USE_COLOR\n\n\t\t\t\tvColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;\n\n\t\t\t#endif\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tvLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;\n\n\t\t\t#endif\n\n\t\t\tfloat aspect = resolution.x / resolution.y;\n\n\t\t\tvUv = uv;\n\n\t\t\tfloat duvy = uvyEnd - uvyStart;\n\t\t\tfloat uvy = uvyStart + duvy * uv2.y;\n\t\t\t// vUv2 = vec2(uv2.x ,uvy);\n\t\t\tvUv2 = ( position.y < 0.5 ) ? vec2(uv2.x ,uvyStart) : vec2(uv2.x ,uvyEnd);\n\t\t\t// camera space\n\t\t\tvec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );\n\t\t\tvec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );\n\n\t\t\t// special case for perspective projection, and segments that terminate either in, or behind, the camera plane\n\t\t\t// clearly the gpu firmware has a way of addressing this issue when projecting into ndc space\n\t\t\t// but we need to perform ndc-space calculations in the shader, so we must address this issue directly\n\t\t\t// perhaps there is a more elegant solution -- WestLangley\n\n\t\t\tbool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column\n\n\t\t\tif ( perspective ) {\n\n\t\t\t\tif ( start.z < 0.0 && end.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( start, end );\n\n\t\t\t\t} else if ( end.z < 0.0 && start.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( end, start );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// clip space\n\t\t\tvec4 clipStart = projectionMatrix * start;\n\t\t\tvec4 clipEnd = projectionMatrix * end;\n\n\t\t\t// ndc space\n\t\t\tvec2 ndcStart = clipStart.xy / clipStart.w;\n\t\t\tvec2 ndcEnd = clipEnd.xy / clipEnd.w;\n\n\t\t\t// direction\n\t\t\tvec2 dir = ndcEnd - ndcStart;\n\n\t\t\t// account for clip-space aspect ratio\n\t\t\tdir.x *= aspect;\n\t\t\tfloat scaleDir = length(dir);\n\t\t\tuvScale = 0.05/scaleDir;\n\t\t\tdir = normalize( dir );\n\n\t\t\t// perpendicular to dir\n\t\t\tvec2 offset = vec2( dir.y, - dir.x );\n\n\t\t\t// undo aspect ratio adjustment\n\t\t\tdir.x /= aspect;\n\t\t\toffset.x /= aspect;\n\n\t\t\t// sign flip\n\t\t\tif ( position.x < 0.0 ) offset *= - 1.0;\n\n\t\t\t// endcaps\n\t\t\tif ( position.y < 0.0 ) {\n\n\t\t\t\toffset += - dir;\n\n\t\t\t} else if ( position.y > 1.0 ) {\n\n\t\t\t\toffset += dir;\n\n\t\t\t}\n\n\t\t\t// adjust for lineWidth\n\t\t\toffset *= lineWidth;\n\n\t\t\t// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...\n\t\t\toffset /= resolution.y;\n\n\t\t\t// select end\n\t\t\tvec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;\n\n\t\t\t// back to clip space\n\t\t\toffset *= clip.w;\n\n\t\t\tclip.xy += offset;\n\n\t\t\tgl_Position = clip;\n\n\t\t\t#include <logdepthbuf_vertex>\n\n\t\t\tvec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation\n\n\t\t}\n\t\t",fragmentShader:"\n\t\tuniform vec3 diffuse;\n\t\tuniform float opacity;\n\t\tuniform vec2 repeat;\n\t\tuniform vec2 offset;\n\t\tuniform float miny;\n\t\tuniform vec3 pcolor;\n\t\tuniform float usePassOpacity;\n\t\tuniform float passOpacity;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashSize;\n\t\t\tuniform float gapSize;\n\n\t\t#endif\n\n\t\t\tuniform sampler2D mmap;\n\n\t\tvarying float vLineDistance;\n\n\t\t#include <common>\n\t\t#include <color_pars_fragment>\n\n\t\tvarying float uvScale;\n\t\tvarying vec2 vUv;\n\t\tvarying vec2 vUv2;\n\n\t\t#include <logdepthbuf_pars_fragment>\n\n\t\tvoid main() {\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tif ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps\n\n\t\t\t\tif ( mod( vLineDistance, dashSize + gapSize ) > dashSize ) discard; // todo - FIX\n\n\t\t\t#endif\n\n\t\t\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t\t\t#include <logdepthbuf_fragment>\n\n\t\t\t#ifdef USE_MMAP\n\n\t\t\t\tif(vUv2.y >= miny && miny != 1.0){\n\t\t\t\t vec4 texColor = texture2D( mmap, vUv2 * repeat + offset );\n\t\t\t\t\tdiffuseColor = vec4(texColor.xyz,min(texColor.w, opacity));\n\t\t\t\t}else{\n\t\t\t\t\tfloat ret = opacity;\n\t\t\t\t\tif(usePassOpacity == 1.0) {\n\t\t\t\t\t\tret = passOpacity;\n\t\t\t\t\t}\n\t\t\t\t\tdiffuseColor = vec4(pcolor, ret);\n\n\t\t\t\t\tif(usePassOpacity == 1.0 && ret < 0.1) {\n\t\t\t\t\t\tdiscard;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t#endif\n\n\t\t\tgl_FragColor = diffuseColor;\n\n\t\t\t#include <encodings_fragment>\n\n\t\t}\n\t\t"};function Dl(t){Ea.call(this,{type:"FMLineMaterial",uniforms:_a.clone(eu.line.uniforms),vertexShader:eu.line.vertexShader,fragmentShader:eu.line.fragmentShader}),this.dashed=!1,Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(t){this.uniforms.diffuse.value.copy(t)}},lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(t){this.uniforms.lineWidth.value=t}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(t){this.uniforms.dashScale.value=t}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(t){this.uniforms.dashSize.value=t}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(t){this.uniforms.gapSize.value=t}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(t){this.uniforms.resolution.value.copy(t)}},pcolor:{enumerable:!0,get:function(){return this.uniforms.pcolor.value},set:function(t){this.uniforms.pcolor.value.copy(t)}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(t){this.uniforms.opacity.value=t}}}),this.setValues(t)}((Dl.prototype=Object.create(Ea.prototype)).constructor=Dl).prototype.isFMLineMaterial=!0,Dl.prototype.copy=function(t){return Ea.prototype.copy.call(this,t),this.color.copy(t.color),this.lineWidth=t.lineWidth,this.resolution=t.resolution,this};var kl=Dl;function Ul(t){f.call(this),this.type="SpriteMaterial",this.color=new lt(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(t)}function Bl(t){f.call(this),this.type="LineBasicMaterial",this.color=new lt(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.setValues(t)}function Gl(t){Ea.call(this,t),this.type="RawShaderMaterial"}((Ul.prototype=Object.create(f.prototype)).constructor=Ul).prototype.isSpriteMaterial=!0,Ul.prototype.copy=function(t){return f.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.rotation=t.rotation,this.sizeAttenuation=t.sizeAttenuation,this},((Bl.prototype=Object.create(f.prototype)).constructor=Bl).prototype.isLineBasicMaterial=!0,Bl.prototype.copy=function(t){return f.prototype.copy.call(this,t),this.color.copy(t.color),this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this},((Gl.prototype=Object.create(Ea.prototype)).constructor=Gl).prototype.isRawShaderMaterial=!0;var Hl={Left:0,Center:2,Right:4};function Xl(t){return(Xl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Vl(t,n){var e,i,r,o,s="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(s)return i=!(e=!0),{s:function(){s=s.call(t)},n:function(){var t=s.next();return e=t.done,t},e:function(t){i=!0,r=t},f:function(){try{e||null==s.return||s.return()}finally{if(i)throw r}}};if(Array.isArray(t)||(s=function(t,n){var e;if(t)return"string"==typeof t?zl(t,n):"Map"===(e="Object"===(e=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?zl(t,n):void 0}(t))||n&&t&&"number"==typeof t.length)return s&&(t=s),o=0,{s:n=function(){},n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:n};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function zl(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function Wl(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=Xl(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Xl(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Xl(t)?t:String(t)}(i.key),i)}}function Yl(t,n,e){return n&&Wl(t.prototype,n),e&&Wl(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var e=Yl(function t(n){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this.no=n}),Ql=(Object.assign(e.prototype,{za:function(t,n){var e=st.a.document.createElement("canvas"),i=e.getContext("2d");return e.width=t,e.height=n,e.style.width=t+"px",e.style.height=n+"px",{canvas:e,ctx:i}},Wa:function(t,n,e,i,r){var o=r,s={x:r.x+n,y:r.y},a={x:r.x,y:r.y+e},n={x:r.x+n,y:r.y+e},r={x:o.x+i,y:o.y},e={x:s.x-i,y:s.y},u={x:s.x,y:s.y+i},c={x:n.x,y:n.y-i},h={x:n.x-i,y:n.y},f={x:a.x+i,y:a.y},l={x:a.x,y:a.y-i},d={x:o.x,y:o.y+i};t.beginPath(),t.moveTo(r.x,r.y),t.lineTo(e.x,e.y),t.arcTo(s.x,s.y,u.x,u.y,i),t.lineTo(c.x,c.y),t.arcTo(n.x,n.y,h.x,h.y,i),t.lineTo(f.x,f.y),t.arcTo(a.x,a.y,l.x,l.y,i),t.lineTo(d.x,d.y),t.arcTo(o.x,o.y,r.x,r.y,i),t.closePath()},Ya:function(t,n,e,i){var r,o,s,a,u=1,c=void 0!==i.needSize&&i.needSize,h=2*e.fontsize*1.2,f=void 0!==e.fontWeight?e.fontWeight:400,l=this.Qa(i.family,e.fontFamily),d=0,v=0,f="".concat(f," ").concat(h,"px ").concat(l),l=void 0!==e.space?2*e.space:4,p=0,m=(void 0!==e.plateSize&&(p=(e.plateSize-e.fontsize)/2*2),p=Math.max(p,6),h/3),y=0,b=[],g=st.a.document.createElement("canvas"),_=g.getContext("2d"),w=(_.font=f,_.textBaseline="Alphabetic",1.2*e.fontsize*2),x=(void 0!==e.imageSize&&(w=1.2*e.imageSize*2),n&&0!=w||(l=w=0),-1<t.indexOf("%rn%"));if(x){var E,S=Vl(b=t.split("%rn%"));try{for(S.s();!(E=S.n()).done;){var T=E.value,d=Math.max(_.measureText(T).width+4,d);v+=h}}catch(t){S.e(t)}finally{S.f()}v+=4*b.length}else d=_.measureText(t).width+4,v=4+h;r=Math.ceil(v)+2*p,s=0+w+l+(o=Math.ceil(d)+2*p),a=0+Math.max(r,w),e.plateStrokeColor&&(s+=4,a+=4),y=x?v/b.length/2+m+p:a/2+m,x&&(u=a/(0+h+2*p)),g.width=s,g.height=a,g.style.width=s+"px",g.style.height=a+"px",g.spriteScale=u,_.font=f,st.a.environment===B.a.WX&&(_.shadowOffsetX=0,_.shadowOffsetY=0,_.shadowBlur=0,_.shadowColor="rgba(0,0,0,0.0)"),_.clearRect(0,0,g.width,g.height),(e.plateColor||e.plateStrokeColor)&&(e.plateColor&&(_.fillStyle=e.plateColor),_.lineWidth=2,this.Wa(_,o,r,10,{x:w+0+l,y:a/2-r/2}),e.plateColor&&_.fill(),e.plateStrokeColor&&(_.strokeStyle=e.plateStrokeColor,_.stroke()),_.beginPath()),n&&_.drawImage(n,0,(a-w)/2,w,w);var A=w+0+l+p+2,m=(_.lineWidth=4*(void 0!==e.strokeWidth?e.strokeWidth:1),1);if(void 0!==e.strokeWidth&&(m=parseFloat(e.strokeWidth)),e.strokeColor&&0!==m)if(_.strokeStyle=e.strokeColor,x)for(var M=y,O=0;O<b.length;O++)O&&(M+=4+h),n?(_.textAlign="left",_.strokeText(b[O],A,M)):i.textAlign===Hl.Left?(_.textAlign="left",_.strokeText(b[O],0,M)):i.textAlign===Hl.Right?(_.textAlign="right",_.strokeText(b[O],s,M)):(_.textAlign="center",_.strokeText(b[O],s/2,M));else n?(_.textAlign="left",_.strokeText(t,A,y)):i.textAlign===Hl.Left?_.strokeText(t,0,y):i.textAlign===Hl.Right?(_.textAlign="right",_.strokeText(t,s,y)):(_.textAlign="center",_.strokeText(t,s/2,y));if(_.fillStyle=e.fillColor,x||!1===i.drawText){if(!1!==i.drawText)for(var L=y,R=0;R<b.length;R++)R&&(L+=4+h),n?(_.textAlign="left",_.fillText(b[R],A,L)):i.textAlign===Hl.Left?(_.textAlign="left",_.fillText(b[R],0,L)):i.textAlign===Hl.Right?(_.textAlign="right",_.fillText(b[R],s,L)):(_.textAlign="center",_.fillText(b[R],s/2,L))}else n?(_.textAlign="left",_.fillText(t,A,y)):i.textAlign===Hl.Left?(_.textAlign="left",_.fillText(t,0,y)):i.textAlign===Hl.Right?(_.textAlign="right",_.fillText(t,s,y)):(_.textAlign="center",_.fillText(t,s/2,y));u=0;return c&&(u=x?e.fontsize+(4*(b.length-1)+0+p)/b.length:e.fontsize+0+p,g.size=u),g.drawTextWidth=d,g.drawTextLeft=A,g},Za:function(t){var n=t.width,e=t.height,i=t.arrowWidth||10,r=this.za(n,e),o=r.canvas,r=r.ctx,s=(r.fillStyle=t.godEdgeColor,r.fillRect(0,0,n,e),n*(1-t.godEdgePercent));r.fillStyle=t.godColor,r.fillRect((n-s)/2,0,s,e),r.fillStyle="#ffffff",r.shadowOffsetX=-2,r.shadowOffsetY=2,r.shadowBlur=4,r.shadowColor="rgba(0,0,0,0.5)";var n=n/2,a=e/2,e=e*t.godArrowPercent,s=s*t.godArrowWidthPercent,n=n-s/2,a=a+e/2;return r.beginPath(),r.moveTo(n,a),r.lineTo(n,a+i),r.lineTo(n+s/2,a-e+i),r.lineTo(n+s,a+i),r.lineTo(n+s,a),r.lineTo(n+s/2,a-e),r.closePath(),r.fillStyle=t.godArrowColor,r.fill(),o},qa:function(t){var n=t.width,e=t.height,i=this.za(n,e),r=i.canvas,i=i.ctx,n=(this.Ka(i,n,e),t.height*t.arrowHeightPercent),e=(1-t.arrowHeightPercent)*t.height/2,o=t.width*(t.arrowWidthPercent-t.arrowPercent);return i.beginPath(),i.moveTo(0,e),i.lineTo(o,e),i.lineTo(t.width*t.arrowWidthPercent,e+n/2),i.lineTo(o,e+n),i.lineTo(0,e+n),i.lineTo(t.width*t.arrowPercent,e+n/2),i.closePath(),i.fillStyle=t.color,i.fill(),r},Ka:function(t,n,e){var i=new Z,r=(i.set(Math.cos(Math.PI/2),-Math.sin(Math.PI/2),+n/2,Math.sin(Math.PI/2),Math.cos(Math.PI/2),+e/2,0,0,1),new Z),n=(r.set(1,0,-n/2,0,1,-e/2,0,0,1),i.multiply(r),i.elements);t.transform(n[0],n[3],n[1],n[4],n[2],n[6])},Ja:function(e){var t=e.width,n=e.height,i=e.dashArray,r=this.za(t,n),o=r.canvas,s=r.ctx,a=(this.Ka(s,t,n),i.reduce(function(t,n){return t+n})),u=0;return i.forEach(function(t,n){n%2==0&&(s.fillStyle=e.color,s.fillRect(u/a*e.width,0,t/a*e.width,e.height)),u+=t}),o},Qa:function(t,n){var e=this.no.Nt.Ai.fontFamily;return void 0!==t?t+","+e:void 0!==n&&'"Microsoft Yahei","微软雅黑",Tahoma,Arial'===e?n:e},zn:function(){}}),e);function Zl(t){return(Zl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ql(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=Zl(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Zl(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Zl(t)?t:String(t)}(i.key),i)}}function Kl(t,n,e){n=$l(n);var i=t,n=Jl()?Reflect.construct(n,e||[],$l(t).constructor):n.apply(t,e);if(n&&("object"===Zl(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function Jl(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Jl=function(){return!!t})()}function $l(t){return($l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function t0(t,n){return(t0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var e=function(){var t,n,e=r,i=Zi;if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");function r(){if(this instanceof r)return Kl(this,r);throw new TypeError("Cannot call a class as a function")}return e.prototype=Object.create(i&&i.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),i&&t0(e,i),e=r,t&&ql(e.prototype,t),n&&ql(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(),n0=(Object.assign(e.prototype,{$a:function(t){var n,e=[];for(n in t)e.push(t[n]);return e.join()}}),e);function e0(t){return(e0="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i0(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=e0(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=e0(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==e0(t)?t:String(t)}(i.key),i)}}function r0(t,n,e){n=s0(n);var i=t,n=o0()?Reflect.construct(n,e||[],s0(t).constructor):n.apply(t,e);if(n&&("object"===e0(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return a0(i)}function o0(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(o0=function(){return!!t})()}function s0(t){return(s0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function a0(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function u0(t,n){return(u0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}function c0(t){Ea.call(this),this.type="FMMeshLambertMaterial",this.uniforms=_a.clone(eu.fmLambert.uniforms),this.vertexShader=eu.fmLambert.vertexShader,this.fragmentShader=eu.fmLambert.fragmentShader,this.lights=!0,this.fog=!0,Il(this),Object.defineProperties(this,{emissive:{enumerable:!0,get:function(){return this.uniforms.emissive.value},set:function(t){this.uniforms.emissive.value=t}},mapMixColor:{enumerable:!0,get:function(){return this.uniforms.mapMixColor.value},set:function(t){this.uniforms.mapMixColor.value=t}}}),this.setValues(t)}var e=function(){var t,n,e=r,i=n0;if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");function r(t){var n;if(this instanceof r)return(n=r0(this,r)).Oa=null,n.ko=n.ko.bind(a0(n)),n.La=new Rl({disposeCallback:n.ko,enable:!0,name:"TextureManager",mapCreateTime:t.mapCreateTime}),n;throw new TypeError("Cannot call a class as a function")}return e.prototype=Object.create(i&&i.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),i&&u0(e,i),e=r,t&&i0(e.prototype,t),n&&i0(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(),h0=(Object.assign(e.prototype,{tu:function(n,e){if(st.a.environment==B.a.BROWSER)r=new xh(n);else{var i=e.paramKey,r=new l;if(e.labelImageCatch[i].image)return r.image=e.labelImageCatch[i].image,r.minFilter=Qn,r.generateMipmaps=!1,r.needsUpdate=!0,t=e.labelImageCatch[i].texture,r.scaleRatio=t.scaleRatio,r.mspriteScale=t.mspriteScale,e.needSize&&(r.size=t.size),r.needsUpdate=!0,e&&e.callback&&e.callback(r),r.useCatch=!0,r;e.labelImageCatch[i].texture={scaleRatio:n.height/n.width,mspriteScale:n.spriteScale,size:n.size};var t=n.toDataURL("image/png");st.a.textureHelper.createImage({url:t,onload:function(t){r.image=t,r.needsUpdate=!0,e&&e.callback&&e.callback(r),e.labelImageCatch[i].canvas={size:n.size,spriteScale:n.spriteScale,width:n.width,height:n.height},e.labelImageCatch[i].image=t}})}return r.minFilter=Qn,r.generateMipmaps=!1,r.needsUpdate=!0,r},nu:function(t){var n=new l;return n.minFilter=Qn,n.generateMipmaps=!1,n.flipY=t.flipY,n},eu:function(t,n){var r,e,o=this,s=(void 0===t.flipY&&(t.flipY=!0),this.$a(t));return this.sn.has(s)?this.an.has(s)?this.un(s,n):n(r=this.sn.get(s)):(r=this.nu(t),this.sn.set(s,r),this.un(s,n),e="_getTexture"+St.generateUUID(),this.La.ba(e),er.vn(t.url,function(i){r.image=i,r.needsUpdate=!0,o.an.get(s).forEach(function(t,n,e){i&&n(r),e.delete(t)}),o.an.delete(s),o.La.ga(e)},{needDraw:t.needDraw})),r},iu:function(t,n){var e=this.tu(t,n);return e.useCatch||(e.scaleRatio=t.height/t.width,e.mspriteScale=t.spriteScale,n.needSize&&(e.size=t.size)),e},zn:function(t){this.Oa=t,this.La.ya(!0)},ko:function(){this.sn.forEach(function(t,n,e){t.dispose(),e.delete(n)}),this.sn.clear(),this.sn=null,this.an.forEach(function(t,n,e){t.forEach(function(t,n,e){e.delete(n)}),e.delete(n)}),this.an.clear(),this.an=null,this.Oa&&this.Oa({name:"TextureManager"})}}),e),f0=(Cl(Lt),eu.fmLambert={uniforms:_a.merge([Lt.fmcommon,Lt.lights,{emissive:{value:new lt(0)},mapMixColor:{value:!1},fogColor:{value:new lt(0)},fogDensity:{value:0}}]),vertexShader:"\n#define LAMBERT\n\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n \n#include <common> \n#include <uv_pars_vertex> \n#include <bsdfs> \n#include <lights_pars_begin> \n#include <logdepthbuf_pars_vertex>\n#include <fog_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <uv_vertex> \n\n\t#include <beginnormal_vertex> \n\t#include <morphnormal_vertex> \n\t#include <defaultnormal_vertex> \n\n\t#include <begin_vertex> \n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex> \n\t#include <clipping_planes_vertex> \n\t\n\t#include <worldpos_vertex> \n\t#include <lights_lambert_vertex> \n\t#include <fog_vertex>\n\t\n}\n",fragmentShader:"\nuniform bool mapMixColor;\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n\n\n#include <common> \n#include <packing> \n#include <uv_pars_fragment> \n#include <map_pars_fragment> \n#include <bsdfs> \n#include <lights_pars_begin>\n#include <logdepthbuf_pars_fragment> \n#include <fog_pars_fragment> \n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\n #include <logdepthbuf_fragment>\n\t#include <map_fragment_1> \n\t \n\n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\n\t#ifdef DOUBLE_SIDED\n\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\n\t#else\n\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\n\t#endif\n\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\n\t#else\n\n\t\treflectedLight.directDiffuse = vLightFront;\n\n\t#endif\n\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\n\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <fog_fragment> \n}\n"},((c0.prototype=Object.create(Ea.prototype)).constructor=c0).prototype.isFMMeshLambertMaterial=!0,c0.prototype.copy=function(t){return jl(this,t)},c0);function l0(t){Ea.call(this),this.type="FMMeshBasicMaterial",this.uniforms=_a.clone(eu.fmBasic.uniforms),this.vertexShader=eu.fmBasic.vertexShader,this.fragmentShader=eu.fmBasic.fragmentShader,Il(this),this.setValues(t)}Cl(Lt),eu.fmBasic={uniforms:_a.merge([Lt.fmcommon]),vertexShader:"\n#include <common> \n#include <uv_pars_vertex> \n\nvoid main() {\n\n\t#include <uv_vertex> \n\n\t#include <begin_vertex> \n\t#include <project_vertex> \n\n\t#include <worldpos_vertex> \n}\n",fragmentShader:"\nuniform vec3 diffuse;\nuniform float opacity;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n#endif\n\n#include <common> \n#include <uv_pars_fragment> \n#include <map_pars_fragment> \n\nvoid main() {\n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t#include <map_fragment> \n\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\n\t#ifdef USE_LIGHTMAP\n\n\t\treflectedLight.indirectDiffuse += texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\n\t#else\n\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\n\t#endif\n\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n \n}\n"},((l0.prototype=Object.create(Ea.prototype)).constructor=l0).prototype.isFMMeshBasicMaterial=!0,l0.prototype.copy=function(t){return Ea.prototype.copy.call(this,t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=_a.clone(t.uniforms),this};function d0(t){return(d0="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function v0(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=d0(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=d0(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==d0(t)?t:String(t)}(i.key),i)}}function p0(t,n,e){n=y0(n);var i=t,n=m0()?Reflect.construct(n,e||[],y0(t).constructor):n.apply(t,e);if(n&&("object"===d0(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function m0(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(m0=function(){return!!t})()}function y0(t){return(y0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function b0(t,n){return(b0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var g0=_a.merge([{sweepW:{value:0},sweepH:{value:0},se2N:{value:new Mt(0,0)},se2RN:{value:new Mt(0,0)},moveP:{value:new Mt(0,0)},color_r:{value:new lt(16711935)},color_a:{value:new lt(16776960)},isRect:{value:!1},isAnnulus:{value:!1},isEnable:{value:!1},circleC:{value:new Mt(0,0)},maxR:{value:0},minR:{value:0},isSweepTexture:{value:!1},sweepTexture:{value:null},sweepStrength:{value:1}},eu.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new Mt(1,1)},clearcoatNormalMap:{value:null},sheen:{value:new lt(0)},transparency:{value:0}}]),e=function(){var t,n=i,e=Ea;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");function i(){var t;if(this instanceof i)return(t=p0(this,i)).type="FMMeshStandardMaterial",t.uniforms=_a.clone(g0),t.vertexShader="\n #define STANDARD\n \n varying vec3 vViewPosition;\n varying vec3 v_position;\n \n #ifndef FLAT_SHADED\n\n varying vec3 vNormal;\n \n #ifdef USE_TANGENT\n \n varying vec3 vTangent;\n varying vec3 vBitangent;\n \n #endif\n \n #endif\n \n #include <common>\n #include <uv_pars_vertex>\n #include <uv2_pars_vertex>\n #include <displacementmap_pars_vertex>\n #include <color_pars_vertex>\n #include <fog_pars_vertex>\n #include <morphtarget_pars_vertex>\n #include <skinning_pars_vertex>\n #include <shadowmap_pars_vertex>\n #include <logdepthbuf_pars_vertex>\n #include <clipping_planes_pars_vertex>\n\n void main() {\n \t#include <uv_vertex>\n #include <uv2_vertex>\n #include <color_vertex>\n \n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n \n #ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED\n \n vNormal = normalize( transformedNormal );\n \n #ifdef USE_TANGENT\n \n vTangent = normalize( transformedTangent );\n vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n \n #endif\n \n #endif\n \n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n \n vViewPosition = - mvPosition.xyz;\n \n vec4 pos = vec4(position, 1.0);\n v_position = vec3(modelMatrix * vec4( position, 1.0 ));\n \n #include <worldpos_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n }\n ",t.fragmentShader="\n\n\n\t#define STANDARD\n\n\t#ifdef PHYSICAL\n\t\t#define REFLECTIVITY\n\t\t#define CLEARCOAT\n\t\t#define TRANSPARENCY\n\t#endif\n\n\tvarying vec3 v_position;\n\n\tuniform bool isRect;\n\tuniform bool isAnnulus;\n\n\tuniform float sweepW;\n\tuniform float sweepH;\n\tuniform vec2 se2N;\n\tuniform vec2 se2RN;\n\tuniform vec2 moveP;\n\tuniform vec3 color_r;\n\n\tuniform vec2 circleC;\n\tuniform float maxR;\n\tuniform float minR;\n\tuniform vec3 color_a;\n\n\tuniform bool isSweepTexture;\n\tuniform sampler2D sweepTexture;\n\tuniform float sweepStrength;\n\n\tbool isInRectW(vec2 v, vec2 a, float w){\n\t\tfloat a1 = abs(dot(v,a));\n\t\treturn a1 < w;\n\t}\n\tbool isInRectH(vec2 v, vec2 a, float h){\n\t\tfloat a1 = abs(dot(v,a));\n\t\treturn a1 < h;\n\t}\n\n\tbool isMaxCircle(vec3 a, vec2 b, float r){\n\t\tfloat c = pow((a.x-b.x),2.0)+pow((a.z-b.y),2.0);\n\t\treturn c <= pow(r,2.0);\n\t}\n\n\tbool isMinCircle(vec3 a, vec2 b, float r){\n\t\tfloat c = pow((a.x-b.x),2.0)+pow((a.z-b.y),2.0);\n\t\treturn c > pow(r,2.0);\n\t}\n\n\tuniform vec3 diffuse;\n\tuniform vec3 emissive;\n\tuniform float roughness;\n\tuniform float metalness;\n\tuniform float opacity;\n\tuniform bool isEnable;\n\n\t#ifdef TRANSPARENCY\n\t\tuniform float transparency;\n\t#endif\n\n\t#ifdef REFLECTIVITY\n\t\tuniform float reflectivity;\n\t#endif\n\n\t#ifdef CLEARCOAT\n\t\tuniform float clearcoat;\n\t\tuniform float clearcoatRoughness;\n\t#endif\n\n\t#ifdef USE_SHEEN\n\t\tuniform vec3 sheen;\n\t#endif\n\n\tvarying vec3 vViewPosition;\n\n\t#ifndef FLAT_SHADED\n\n\t\tvarying vec3 vNormal;\n\n\t\t#ifdef USE_TANGENT\n\n\t\t\tvarying vec3 vTangent;\n\t\t\tvarying vec3 vBitangent;\n\n\t\t#endif\n\n\t#endif\n\n\t#include <common>\n\t#include <packing>\n\t#include <dithering_pars_fragment>\n\t#include <color_pars_fragment>\n\t#include <uv_pars_fragment>\n\t#include <uv2_pars_fragment>\n\t#include <map_pars_fragment>\n\t#include <alphamap_pars_fragment>\n\t#include <aomap_pars_fragment>\n\t#include <lightmap_pars_fragment>\n\t#include <emissivemap_pars_fragment>\n\t#include <bsdfs>\n\t#include <cube_uv_reflection_fragment>\n\t#include <envmap_common_pars_fragment>\n\t#include <envmap_physical_pars_fragment>\n\t#include <fog_pars_fragment>\n\t#include <lights_pars_begin>\n\t#include <lights_physical_pars_fragment>\n\t#include <shadowmap_pars_fragment>\n\t#include <bumpmap_pars_fragment>\n\t#include <normalmap_pars_fragment>\n\t#include <clearcoat_pars_fragment>\n\t#include <roughnessmap_pars_fragment>\n\t#include <metalnessmap_pars_fragment>\n\t#include <logdepthbuf_pars_fragment>\n\t#include <clipping_planes_pars_fragment>\n\n\tvoid main() {\n\t\t#include <clipping_planes_fragment>\n\n\t\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t\tvec3 totalEmissiveRadiance = emissive;\n\n\t\t#include <logdepthbuf_fragment>\n\t\t#include <map_fragment>\n\t\t#include <color_fragment>\n\t\t#include <alphamap_fragment>\n\t\t#include <alphatest_fragment>\n\t\t#include <roughnessmap_fragment>\n\t\t#include <metalnessmap_fragment>\n\t\t#include <normal_fragment_begin>\n\t\t#include <normal_fragment_maps>\n\t\t#include <clearcoat_normal_fragment_begin>\n\t\t#include <clearcoat_normal_fragment_maps>\n\t\t#include <emissivemap_fragment>\n\n\t\t// accumulation\n\t\t#include <lights_physical_fragment>\n\t\t#include <lights_fragment_begin>\n\t\t#include <lights_fragment_maps>\n\t\t#include <lights_fragment_end>\n\n\t\t// modulation\n\t\t#include <aomap_fragment>\n\n\t\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\n\t\t// this is a stub for the transparency model\n\t\t#ifdef TRANSPARENCY\n\t\t\tdiffuseColor.a *= saturate( 1. - transparency + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular ) );\n\t\t#endif\n\n\t\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\n\t\tif(isRect&&isEnable){\n\n\t\t\tvec2 v = vec2(v_position.x - moveP.x, v_position.z - moveP.y);\n\t\t\tif(isInRectW(v,se2N,sweepW) && isInRectH(v,se2RN,sweepH)){\n\t\t\t\tgl_FragColor = vec4(mix(gl_FragColor.rgb, sweepStrength*color_a.rgb, 0.5),gl_FragColor.a);\n\t\t\t}\n\t\t}\n\t\tif(isAnnulus&&isEnable){\n\t\t\tif(isMaxCircle(v_position.xyz,circleC,maxR) && isMinCircle(v_position.xyz,circleC,minR)){\n\t\t\t\tif(isSweepTexture){\n\t\t\t\t\tvec2 uv = vec2((v_position.x-(circleC.x-maxR))/(2.0*maxR),(v_position.z-(circleC.y-maxR))/(2.0*maxR));\n\t\t\t\t\tvec4 tex = texture2D( sweepTexture, uv );\n\t\t\t\t\ttex = mapTexelToLinear( tex );\n\t\t\t\t\tfloat d2 = pow(v_position.x-circleC.x,2.0) + pow(v_position.z-circleC.y,2.0);\n\t\t\t\t\tfloat a = smoothstep(0.0, pow(maxR,2.0), d2);\n\t\t\t\t\ta = 1.0 - a;\n\t\t\t\t\ttex.a = a;\n\t\t\t\t\tgl_FragColor = vec4(mix(gl_FragColor.rgb, sweepStrength*tex.rgb, 0.2),gl_FragColor.a);\n\t\t\t\t} else {\n\t\t\t\t\tgl_FragColor = vec4(mix(gl_FragColor.rgb, sweepStrength*color_a.rgb, 0.5),gl_FragColor.a);\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\t#include <tonemapping_fragment>\n\t\t#include <encodings_fragment>\n\t\t#include <fog_fragment>\n\t\t#include <premultiplied_alpha_fragment>\n\t\t#include <dithering_fragment>\n\t}\n",t.lights=!0,t.fog=!0,t;throw new TypeError("Cannot call a class as a function")}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&b0(n,e),n=i,(e=[{key:"copy",value:function(t){return jl(this,t)}}])&&v0(n.prototype,e),t&&v0(n,t),Object.defineProperty(n,"prototype",{writable:!1}),i}(),_0=(e.prototype.isFMMeshStandardMaterial=!0,e);function w0(t){return(w0="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function x0(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=w0(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=w0(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==w0(t)?t:String(t)}(i.key),i)}}var E0=function(){function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function")}var n,e,i;return n=t,i=[{key:"setPixel",value:function(t){var n=t.x,e=t.y,i=t.color,r=t.d,t=t.width;r[4*(e*t+n)+0]=i[0],r[4*(e*t+n)+1]=i[1],r[4*(e*t+n)+2]=i[2],r[4*(e*t+n)+3]=i[3]}},{key:"getPowerOfTwoSizeCanvas",value:function(t){var n=St.floorPowerOfTwo(t.width),e=St.floorPowerOfTwo(t.height),i=st.a.document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return i.width=n,i.height=e,i.getContext("2d").drawImage(t,0,0,n,e),i}}],(e=null)&&x0(n.prototype,e),i&&x0(n,i),Object.defineProperty(n,"prototype",{writable:!1}),t}(),S0=Object.freeze({CENTER:0,LEFT:1,RIGHT:-1}),T0=Object.freeze({CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1});function A0(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var i,r,o,s,a=[],u=!0,c=!1;try{if(o=(e=e.call(t)).next,0===n){if(Object(e)!==e)return;u=!1}else for(;!(u=(i=o.call(e)).done)&&(a.push(i.value),a.length!==n);u=!0);}catch(t){c=!0,r=t}finally{try{if(!u&&null!=e.return&&(s=e.return(),Object(s)!==s))return}finally{if(c)throw r}}return a}}(t,n)||M0(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function M0(t,n){var e;if(t)return"string"==typeof t?O0(t,n):"Map"===(e="Object"===(e=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?O0(t,n):void 0}function O0(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function L0(n,t){var e,i=Object.keys(n);return Object.getOwnPropertySymbols&&(e=Object.getOwnPropertySymbols(n),t&&(e=e.filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})),i.push.apply(i,e)),i}function R0(i){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?L0(Object(r),!0).forEach(function(t){var n,e;n=i,e=r[t=t],(t=F0(t))in n?Object.defineProperty(n,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[t]=e}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(r)):L0(Object(r)).forEach(function(t){Object.defineProperty(i,t,Object.getOwnPropertyDescriptor(r,t))})}return i}function N0(t){return(N0="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function P0(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,F0(i.key),i)}}function F0(t){t=function(t,n){if("object"!=N0(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=N0(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==N0(t)?t:String(t)}var e=function(){function n(t){if(!(this instanceof n))throw new TypeError("Cannot call a class as a function");this.Nt=t,this.ru=new Ql(this),this.ou=new h0({mapCreateTime:this.Nt.gn.Ln}),this.su={},this.au=new Map,this.uu=new Map,this.cu=new Map,this.hu=new Map,this.fu=new Map,this.lu=new Map,this.du={},this.vu={},this.Oa=null,this.ko=this.ko.bind(this),this.La=new Rl({disposeCallback:this.ko,enable:!0,name:"MaterialManager",mapCreateTime:this.Nt.gn.Ln}),this.pu=null,this.mu={},this.yu()}var t,e,i;return t=n,(e=[{key:"lamberMaterials",get:function(){return this.uu}},{key:"getMaterialCacheKey",value:function(t){return this.bu(t)}},{key:"regHook",value:function(t,n){this.mu[t]||(this.mu[t]=[]),this.mu[t].push(n)}},{key:"callHook",value:function(t){for(var n=arguments.length,e=new Array(1<n?n-1:0),i=1;i<n;i++)e[i-1]=arguments[i];t=this.mu[t];t&&t.forEach(function(t){return t.apply(void 0,e)})}}])&&P0(t.prototype,e),i&&P0(t,i),Object.defineProperty(t,"prototype",{writable:!1}),n}(),j0=(Object.assign(e.prototype,{gu:function(t,n){this.du[n.uuid]||(this.du[n.uuid]=[]),this.du[n.uuid].push(t.uuid)},_u:function(t,e){t=this.du[e.uuid].indexOf(t.uuid);if(-1!==t&&this.du[e.uuid].splice(t,1),0===this.du[e.uuid].length){var i=[];if(e instanceof _0){this.fu.forEach(function(t,n){t.uuid===e.uuid&&i.push(n)});for(var n=0;n<i.length;n++)this.fu.delete(i[n])}delete this.du[e.uuid]}},bu:function(t){var n,e=[];for(n in t)t[n]?t[n].constructor===l?e.push(t[n].uuid):t[n].constructor===Mt?(e.push(t[n].x),e.push(t[n].y)):e.push(t[n]):e.push(t[n]);return e.join()},wu:function(t,n){var e=this.bu(t);return this.au.has(e)||(t=this.xu(t,n),this.au.set(e,t)),this.au.get(e)},xu:function(t,n){var e;return t.isline?new Bl({color:t.color,linewidth:1,transparent:!0,opacity:t.opacity}):(e=new l0,void 0!==t.color&&(e.color=new lt(t.color)),void 0!==t.opacity&&(e.opacity=t.opacity),void 0!==t.url&&this.ou.eu({url:t.url,flipY:t.flipY},function(t){t.image&&(e.map=t,e.needsUpdate=!0),n&&n()}),t=void 0!==t.needDepth&&t.needDepth,e.transparent=!0,e.depthTest=t,e.depthWrite=t,e)},Eu:function(t){var n=this.bu(t);return this.uu.has(n)||(t=this.Su(t),this.uu.set(n,t)),this.uu.get(n)},$r:function(t){var n=this.bu(t);return this.fu.has(n)||(t=this.Tu(t),this.fu.set(n,t)),this.fu.get(n)},Tu:function(t){var n=new _0;return n.defines.USE_UV=!0,n.uniforms.diffuse.value=new lt(t.color),n.uniforms.emissive.value=new lt(t.emissive),n.defines.USE_METALNESSMAP=t.USE_METALNESSMAP,n.defines.USE_ROUGHNESSMAP=t.USE_ROUGHNESSMAP,n.uniforms.metalness.value=t.metalness,n.uniforms.metalnessMap.value=t.metalnessMap,n.uniforms.roughness.value=t.roughness,n.uniforms.roughnessMap.value=t.roughnessMap,n.defines.USE_NORMALMAP=t.USE_NORMALMAP,n.defines.TANGENTSPACE_NORMALMAP=t.TANGENTSPACE_NORMALMAP,n.uniforms.normalScale.value=t.normalScale,n.uniforms.normalMap.value=t.normalMap,n.defines.USE_EMISSIVEMAP=t.USE_EMISSIVEMAP,n.uniforms.emissiveMap.value=t.emissiveMap,n.defines.USE_MAP=t.USE_MAP,n.uniforms.map.value=t.map,t.aoMap&&(n.defines.USE_AOMAP=!0,n.uniforms.aoMap.value=t.aoMap),n.transparent=t.transparent,n.uniforms.opacity.value=t.opacity,n.skinning=t.skinning,n.side=t.side,n.vertexColors=t.vertexColors,this.pu&&(n.uniforms.envMap.value=this.pu,n.envMap=this.pu),n.needsUpdate=!0,n},eo:function(t,n){(n=n||{}).uuid=t.uuid;var e=this.bu(n);return this.lu.has(e)||(t=t.clone(),n.color&&(t.color=new lt(n.color)),n.opacity&&(t.opacity=n.opacity),n.transparent&&(t.transparent=n.transparent),this.lu.set(e,t)),this.lu.get(e)},Su:function(n){var e=new f0;return e.color=new lt(n.color),e.opacity=n.alpha,e.transparent=e.opacity<1,void 0!==n.url&&this.ou.eu({url:n.url},function(t){t.image&&(e.map=t,e.needsUpdate=!0),n.finish&&n.finish(e)}),e},Au:function(t){var n=void 0===t.needDepth||t.needDepth,t=new kl({color:t.color,opacity:t.opacity,lineWidth:t.lineWidth,vertexColors:2,dashed:!1,transparent:!0}),n=(t.depthWrite=n,t.depthTest=n,this.Nt.gn);return st.a.environment===B.a.BROWSER?t.resolution.set(n.jt.renderer.domElement.clientWidth,n.jt.renderer.domElement.clientHeight):t.resolution.set(n.jt.renderer.domElement.width,n.jt.renderer.domElement.height),t},Mu:function(t){var n=this.bu(t);return this.cu.has(n)||(t=this.Au(t),this.cu.set(n,t)),this.cu.get(n)},Ou:function(t,n,e){var i=new Ul,t=(i.sizeAttenuation=!1,i.depthTest=!1,i.depthWrite=!1,i.transparent=!0,i.opacity=e.opacity,i.side=an,this.Lu(t,null,n,e));return i.map=t,e.needSize&&(i.size=t.size),i.userData.scaleRatio=t.scaleRatio,i.userData.mspriteScale=t.mspriteScale,i.needsUpdate=!0,i},Ru:function(n,e,i,r){var o,s,t,a=this,u=new Ul;return u.sizeAttenuation=!1,u.depthTest=!1,u.depthWrite=!1,u.side=an,u.opacity=i.opacity,u.transparent=!0,u.blending=dn,i.imageUrl?(u.visible=!1,o="_createLabelMaterial"+St.generateUUID(),this.La.ba(o),s=this,er.vn(i.imageUrl,function(t){t=a.Lu(n,t,e,R0(R0({},i),{},{callback:function(t){u.map=t,u.visible=!0,u.userData.scaleRatio=t.scaleRatio,u.userData.mspriteScale=t.mspriteScale,r&&r(u),u.needsUpdate=!0}}));st.a.environment===B.a.BROWSER&&(u.map=t,u.visible=!0,u.needsUpdate=!0,u.userData.scaleRatio=t.scaleRatio,u.userData.mspriteScale=t.mspriteScale,r)&&r(u),s.La.ga(o)},{needDraw:!0})):(t=this.Lu(n,null,e,R0(R0({},i),{},{callback:function(t){u.map=t,u.needsUpdate=!0,u.userData.scaleRatio=t.scaleRatio,u.userData.mspriteScale=t.mspriteScale,r&&r(u),u.visible=!0}})),st.a.environment===B.a.BROWSER?(u.map=t,u.needsUpdate=!0,u.userData.scaleRatio=t.scaleRatio,u.userData.mspriteScale=t.mspriteScale,r&&r(u)):u.map||(u.visible=!1)),u},Lu:function(t,n,e,i){var r=this.Nu(t,e);return this.vu[r]||(this.vu[r]={}),t=this.vu[r].canvas||this.ru.Ya(t,n,e,i),this.ou.iu(t,{paramKey:r,labelImageCatch:this.vu,needSize:i.needSize,callback:i.callback})},Nu:function(t,n){return[t,n.alpha,n.fontsize,n.fillColor,n.image].join()},Pu:function(t,n){var e=this.bu(t);return this.hu.has(e)||(t=this.Fu(t,n),this.hu.set(e,t)),n&&n(this.hu.get(e)),this.hu.get(e)},Fu:function(t,n){var e=void 0!==t.opacity?t.opacity:1,i=new Ul;return i.sizeAttenuation=!1,i.depthTest=t.needDepth,i.depthWrite=t.needDepth,i.transparent=!0,i.opacity=e,i.visible=!1,this.ou.eu({url:t.url},function(t){t.image&&(i.map=t,i.needsUpdate=!0,i.visible=!0,i.userData.scaleRatio=t.image.width/t.image.height),n&&n(i)}),i},createArrowWidthBackTexture:function(n){var e,t=this.ru.Za(n);return st.a.environment===B.a.BROWSER?new xh(E0.getPowerOfTwoSizeCanvas(t)):(t=t.toDataURL("image/png"),e=new l,st.a.textureHelper.createImage({url:t,onload:function(t){e.image=t,e.needsUpdate=!0,n.callback&&n.callback()}}),e)},createNormalLineTexture:function(n){var e,t=this.ru.Ja(n);return st.a.environment===B.a.BROWSER?new xh(E0.getPowerOfTwoSizeCanvas(t)):(t=t.toDataURL("image/png"),e=new l,st.a.textureHelper.createImage({url:t,onload:function(t){e.image=t,e.needsUpdate=!0,n.callback&&n.callback()}}),e)},ju:function(n){var e,t=this.ru.qa(n);return st.a.environment===B.a.BROWSER?new xh(E0.getPowerOfTwoSizeCanvas(t)):(t=t.toDataURL("image/png"),e=new l,st.a.textureHelper.createImage({url:t,onload:function(t){e.image=t,e.needsUpdate=!0,n.callback&&n.callback()}}),e)},Iu:function(t,n){var e;return this.su[t+n]||((e=new Gl({uniforms:{color:{value:new lt(t)},alpha:{value:n}},vertexShader:"\nprecision mediump float;\nprecision mediump int;\n\nattribute vec3 position;\n\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\n\nvoid main() {\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n ",fragmentShader:"\nprecision mediump float;\nprecision mediump int;\n\nuniform vec3 color;\nuniform float alpha;\n\nvoid main() {\n gl_FragColor = vec4(color,alpha);\n}\n "})).transparent=!0,this.su[t+n]=e)},Cu:function(t,n){t=new Ea({uniforms:{color:{value:new lt(t)},alpha:{value:n}},vertexShader:"\nattribute float gradientAlpha;\n\nvarying float v_gradientAlpha;\n\nvoid main() {\n v_gradientAlpha = gradientAlpha;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n ",fragmentShader:"\n\nuniform vec3 color;\nuniform float alpha;\n\nvarying float v_gradientAlpha;\n\nvoid main() {\n gl_FragColor = vec4(color, alpha * v_gradientAlpha);\n}\n "});return t.depthTest=!0,t.depthWrite=!1,t.transparent=!0,t},Du:function(t,n){var e=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},i=new l,r=(i.minFilter=e.generateMipmaps?1008:Qn,i.generateMipmaps=!!e.generateMipmaps,i.anisotropy=4,i.wrapS=Hn,i.wrapT=Hn,"_loadTexture"+St.generateUUID()),o=(this.La.ba(r),this);return er.vn(t,function(t){t&&(i.image=t,i.needsUpdate=!0),n(i),o.La.ga(r)}),i},zn:function(t){var n=this;this.Oa=t,this.ou.zn(function(){n.ou=null,n.La.ya(!0)}),this.vu={}},ko:function(){er.cn(),this.ru.zn(),this.ru=null,this.au.clear(),this.uu.clear(),this.cu.clear(),this.hu.clear(),this.Oa&&this.Oa({name:"MaterialManager"})},yu:function(){var o=this;this.Nt.gn.Ai.hdr&&this.Nt.gn.Ai.hdr.load(this.Nt.gn,function(t){o.pu=t;var n,e=function(t,n){var e,i,r,o,s="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(s)return i=!(e=!0),{s:function(){s=s.call(t)},n:function(){var t=s.next();return e=t.done,t},e:function(t){i=!0,r=t},f:function(){try{e||null==s.return||s.return()}finally{if(i)throw r}}};if(Array.isArray(t)||(s=M0(t))||n&&t&&"number"==typeof t.length)return s&&(t=s),o=0,{s:n=function(){},n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:n};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(o.fu);try{for(e.s();!(n=e.n()).done;){var i=A0(n.value,2),r=(i[0],i[1]);r.envMap||(r.uniforms.envMap.value=o.pu,r.envMap=o.pu)}}catch(t){e.e(t)}finally{e.f()}})}}),e);function I0(t){return(I0="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function C0(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=I0(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=I0(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==I0(t)?t:String(t)}(i.key),i)}}function D0(t,n,e){return n&&C0(t.prototype,n),e&&C0(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var e=D0(function t(n){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this.Nt=n}),k0=(Object.assign(e.prototype,{ku:function(t){var t=this.Nt.Uu.get(t),n=this.Nt.Uu.get(this.Nt.Ai.buildingID),e={};return(e=t?{theme:t.theme,themeExtension:t.themeExtension}:e).theme||(e.theme=n.theme),e.themeExtension||(e.themeExtension=n.themeExtension),e},Bu:function(t){t=this.ku(t);return Object.assign({},t.theme.Gu,t.themeExtension.Gu)},Hu:function(t){t=this.ku(t);return Object.assign({},t.theme.Xu.get("0"),t.themeExtension.Xu.get("0"))},Vu:function(t){return this.zu(E.MODEL,t)},Wu:function(t){return this.zu(E.FACILITY,t)},Yu:function(t){return this.zu(E.LABEL,t)},Qu:function(t){return this.zu(E.EXTERNAL_MODEL,t)},zu:function(t,n){var e=this.ku(n.bid),i={},r={},o=e.themeExtension.Zu(t).get(n.fid),s=e.theme.Zu(t).get(n.fid);if(o||s){var a=(o&&void 0!==o.normalID?o:s).normalID,u=e.themeExtension.qu(t).get(a),a=e.theme.qu(t).get(a);if(u||a)return r.themeUseDetail={content:n.fid,name:"fid",isExtension:!!o},Object.assign(r,a,u,s,o)}return o=e.themeExtension.Ku(t).get(n.typeID),s=e.theme.Ku(t).get(n.typeID),(o||s)&&(r.themeUseDetail={content:n.typeID,name:"typeId",isExtension:!!o},Object.assign(i,s,o)),i.normalID||(o=e.themeExtension.Ku(t).get("0"),s=e.theme.Ku(t).get("0"),Object.assign(i,o,s)),u=e.themeExtension.qu(t).get(i.normalID),a=e.theme.qu(t).get(i.normalID),Object.assign(r,a,u)},Ju:function(t){t=this.ku(t);return t.themeExtension.$u||t.theme.$u},zn:function(){this.Nt=null}}),e),U0=function(t){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);for(var n="",e=0,i=t.length;e<i;e++)n+=String.fromCharCode(t[e]);try{return decodeURIComponent(escape(n))}catch(t){return n}},B0=function(t){var n=t.lastIndexOf("/");return-1===n?"./":t.substr(0,n+1)},G0={enabled:!1,files:{},add:function(t,n){!1!==this.enabled&&(this.files[t]=n)},get:function(t){if(!1!==this.enabled)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}};function H0(t){od.call(this,t)}function X0(t){od.call(this,t)}function V0(t){f.call(this),this.type="ShadowMaterial",this.color=new lt(0),this.transparent=!0,this.setValues(t)}function z0(t){f.call(this),this.type="PointsMaterial",this.color=new lt(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(t)}function W0(t){f.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new lt(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new lt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=pi,this.normalScale=new Mt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.vertexTangents=!1,this.setValues(t)}function Y0(t){W0.call(this),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoat=0,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Mt(1,1),this.clearcoatNormalMap=null,this.reflectivity=.5,this.sheen=null,this.transparency=0,this.setValues(t)}function Q0(t){f.call(this),this.type="MeshPhongMaterial",this.color=new lt(16777215),this.specular=new lt(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new lt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=pi,this.normalScale=new Mt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=kn,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Z0(t){f.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new lt(16777215),this.specular=new lt(1118481),this.shininess=30,this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new lt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=pi,this.normalScale=new Mt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function q0(t){f.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=pi,this.normalScale=new Mt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function K0(t){f.call(this),this.type="MeshLambertMaterial",this.color=new lt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new lt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=kn,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function J0(t){f.call(this),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new lt(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=pi,this.normalScale=new Mt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function $0(t){Bl.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}function td(t){od.call(this,t),this.textures={}}H0.prototype=Object.assign(Object.create(od.prototype),{constructor:H0,load:function(e,i,t,n){void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var r,o,s,a=this,u=G0.get(e);return void 0!==u?(a.manager.itemStart(e),setTimeout(function(){i&&i(u),a.manager.itemEnd(e)},0),u):st.a.environment===B.a.WX?(e.includes(wx.env.USER_DATA_PATH)?(o=wx.getFileSystemManager()).readFile({filePath:e,encoding:"base64",success:function(t){var t="data:image/png;base64,".concat(t.data),n=st.a.textureHelper.createImage({url:t,onload:function(){G0.add(e,n),i&&i(n),a.manager.itemEnd(e),o.unlink({filePath:e,fail:function(t){},success:function(){}})}})},fail:function(t){console.error(t),n&&n(t),a.manager.itemError(e),a.manager.itemEnd(e)}}):r=st.a.textureHelper.createImage({url:e,onload:function(){G0.add(e,r),i&&i(r),a.manager.itemEnd(e)},onerror:function(t){console.error(t),n&&n(t),a.manager.itemError(e),a.manager.itemEnd(e)}}),r):((s=st.a.document.createElementNS("http://www.w3.org/1999/xhtml","img")).addEventListener("load",c,!1),s.addEventListener("error",h,!1),"data:"!==e.substr(0,5)&&void 0!==this.crossOrigin&&(s.crossOrigin=this.crossOrigin),a.manager.itemStart(e),s.src=e,s);function c(){s.removeEventListener("load",c,!1),s.removeEventListener("error",h,!1),G0.add(e,this),i&&i(this),a.manager.itemEnd(e)}function h(t){s.removeEventListener("load",c,!1),s.removeEventListener("error",h,!1),n&&n(t),a.manager.itemError(e),a.manager.itemEnd(e)}}}),X0.prototype=Object.assign(Object.create(od.prototype),{constructor:X0,load:function(n,e,t,i){var r=new l,o=new H0(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(n,function(t){r.image=t;t=0<n.search(/\.jpe?g($|\?)/i)||0===n.search(/^data\:image\/jpeg/);r.format=t?he:fe,r.needsUpdate=!0,void 0!==e&&e(r)},t,i),r}}),((V0.prototype=Object.create(f.prototype)).constructor=V0).prototype.isShadowMaterial=!0,V0.prototype.copy=function(t){return f.prototype.copy.call(this,t),this.color.copy(t.color),this},((z0.prototype=Object.create(f.prototype)).constructor=z0).prototype.isPointsMaterial=!0,z0.prototype.copy=function(t){return f.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this.morphTargets=t.morphTargets,this},((W0.prototype=Object.create(f.prototype)).constructor=W0).prototype.isMeshStandardMaterial=!0,W0.prototype.copy=function(t){return f.prototype.copy.call(this,t),this.defines={STANDARD:""},this.color.copy(t.color),this.roughness=t.roughness,this.metalness=t.metalness,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.roughnessMap=t.roughnessMap,this.metalnessMap=t.metalnessMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapIntensity=t.envMapIntensity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.vertexTangents=t.vertexTangents,this},((Y0.prototype=Object.create(W0.prototype)).constructor=Y0).prototype.isMeshPhysicalMaterial=!0,Y0.prototype.copy=function(t){return W0.prototype.copy.call(this,t),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=t.clearcoat,this.clearcoatMap=t.clearcoatMap,this.clearcoatRoughness=t.clearcoatRoughness,this.clearcoatRoughnessMap=t.clearcoatRoughnessMap,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.reflectivity=t.reflectivity,t.sheen?this.sheen=(this.sheen||new lt).copy(t.sheen):this.sheen=null,this.transparency=t.transparency,this},((Q0.prototype=Object.create(f.prototype)).constructor=Q0).prototype.isMeshPhongMaterial=!0,Q0.prototype.copy=function(t){return f.prototype.copy.call(this,t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},((Z0.prototype=Object.create(f.prototype)).constructor=Z0).prototype.isMeshToonMaterial=!0,Z0.prototype.copy=function(t){return f.prototype.copy.call(this,t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.gradientMap=t.gradientMap,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},((q0.prototype=Object.create(f.prototype)).constructor=q0).prototype.isMeshNormalMaterial=!0,q0.prototype.copy=function(t){return f.prototype.copy.call(this,t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},((K0.prototype=Object.create(f.prototype)).constructor=K0).prototype.isMeshLambertMaterial=!0,K0.prototype.copy=function(t){return f.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},((J0.prototype=Object.create(f.prototype)).constructor=J0).prototype.isMeshMatcapMaterial=!0,J0.prototype.copy=function(t){return f.prototype.copy.call(this,t),this.defines={MATCAP:""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},(($0.prototype=Object.create(Bl.prototype)).constructor=$0).prototype.isLineDashedMaterial=!0,$0.prototype.copy=function(t){return Bl.prototype.copy.call(this,t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this},td.prototype=Object.assign(Object.create(od.prototype),{constructor:td,load:function(t,n,e,i){var r=this,o=new ad(r.manager);o.setPath(r.path),o.load(t,function(t){n(r.parse(JSON.parse(t)))},e,i)},parse:function(t){var n=this.textures;function e(t){return void 0===n[t]&&console.warn("THREE.MaterialLoader: Undefined texture",t),n[t]}var i,r=new h[t.type];if(void 0!==t.uuid&&(r.uuid=t.uuid),void 0!==t.name&&(r.name=t.name),void 0!==t.color&&r.color.setHex(t.color),void 0!==t.roughness&&(r.roughness=t.roughness),void 0!==t.metalness&&(r.metalness=t.metalness),void 0!==t.sheen&&(r.sheen=(new lt).setHex(t.sheen)),void 0!==t.emissive&&r.emissive.setHex(t.emissive),void 0!==t.specular&&r.specular.setHex(t.specular),void 0!==t.shininess&&(r.shininess=t.shininess),void 0!==t.clearcoat&&(r.clearcoat=t.clearcoat),void 0!==t.clearcoatRoughness&&(r.clearcoatRoughness=t.clearcoatRoughness),void 0!==t.fog&&(r.fog=t.fog),void 0!==t.flatShading&&(r.flatShading=t.flatShading),void 0!==t.blending&&(r.blending=t.blending),void 0!==t.combine&&(r.combine=t.combine),void 0!==t.side&&(r.side=t.side),void 0!==t.opacity&&(r.opacity=t.opacity),void 0!==t.transparent&&(r.transparent=t.transparent),void 0!==t.alphaTest&&(r.alphaTest=t.alphaTest),void 0!==t.depthTest&&(r.depthTest=t.depthTest),void 0!==t.depthWrite&&(r.depthWrite=t.depthWrite),void 0!==t.colorWrite&&(r.colorWrite=t.colorWrite),void 0!==t.stencilWrite&&(r.stencilWrite=t.stencilWrite),void 0!==t.stencilWriteMask&&(r.stencilWriteMask=t.stencilWriteMask),void 0!==t.stencilFunc&&(r.stencilFunc=t.stencilFunc),void 0!==t.stencilRef&&(r.stencilRef=t.stencilRef),void 0!==t.stencilFuncMask&&(r.stencilFuncMask=t.stencilFuncMask),void 0!==t.stencilFail&&(r.stencilFail=t.stencilFail),void 0!==t.stencilZFail&&(r.stencilZFail=t.stencilZFail),void 0!==t.stencilZPass&&(r.stencilZPass=t.stencilZPass),void 0!==t.wireframe&&(r.wireframe=t.wireframe),void 0!==t.wireframeLinewidth&&(r.wireframeLinewidth=t.wireframeLinewidth),void 0!==t.wireframeLinecap&&(r.wireframeLinecap=t.wireframeLinecap),void 0!==t.wireframeLinejoin&&(r.wireframeLinejoin=t.wireframeLinejoin),void 0!==t.rotation&&(r.rotation=t.rotation),1!==t.linewidth&&(r.linewidth=t.linewidth),void 0!==t.dashSize&&(r.dashSize=t.dashSize),void 0!==t.gapSize&&(r.gapSize=t.gapSize),void 0!==t.scale&&(r.scale=t.scale),void 0!==t.polygonOffset&&(r.polygonOffset=t.polygonOffset),void 0!==t.polygonOffsetFactor&&(r.polygonOffsetFactor=t.polygonOffsetFactor),void 0!==t.polygonOffsetUnits&&(r.polygonOffsetUnits=t.polygonOffsetUnits),void 0!==t.skinning&&(r.skinning=t.skinning),void 0!==t.morphTargets&&(r.morphTargets=t.morphTargets),void 0!==t.morphNormals&&(r.morphNormals=t.morphNormals),void 0!==t.dithering&&(r.dithering=t.dithering),void 0!==t.vertexTangents&&(r.vertexTangents=t.vertexTangents),void 0!==t.visible&&(r.visible=t.visible),void 0!==t.toneMapped&&(r.toneMapped=t.toneMapped),void 0!==t.userData&&(r.userData=t.userData),void 0!==t.vertexColors&&("number"==typeof t.vertexColors?r.vertexColors=0<t.vertexColors:r.vertexColors=t.vertexColors),void 0!==t.uniforms)for(var o in t.uniforms){var s=t.uniforms[o];switch(r.uniforms[o]={},s.type){case"t":r.uniforms[o].value=e(s.value);break;case"c":r.uniforms[o].value=(new lt).setHex(s.value);break;case"v2":r.uniforms[o].value=(new Mt).fromArray(s.value);break;case"v3":r.uniforms[o].value=(new Tt).fromArray(s.value);break;case"v4":r.uniforms[o].value=(new Ot).fromArray(s.value);break;case"m3":r.uniforms[o].value=(new Z).fromArray(s.value);case"m4":r.uniforms[o].value=(new At).fromArray(s.value);break;default:r.uniforms[o].value=s.value}}if(void 0!==t.defines&&(r.defines=t.defines),void 0!==t.vertexShader&&(r.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(r.fragmentShader=t.fragmentShader),void 0!==t.extensions)for(var a in t.extensions)r.extensions[a]=t.extensions[a];return void 0!==t.shading&&(r.flatShading=1===t.shading),void 0!==t.size&&(r.size=t.size),void 0!==t.sizeAttenuation&&(r.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(r.map=e(t.map)),void 0!==t.matcap&&(r.matcap=e(t.matcap)),void 0!==t.alphaMap&&(r.alphaMap=e(t.alphaMap)),void 0!==t.bumpMap&&(r.bumpMap=e(t.bumpMap)),void 0!==t.bumpScale&&(r.bumpScale=t.bumpScale),void 0!==t.normalMap&&(r.normalMap=e(t.normalMap)),void 0!==t.normalMapType&&(r.normalMapType=t.normalMapType),void 0!==t.normalScale&&(i=t.normalScale,!1===Array.isArray(i)&&(i=[i,i]),r.normalScale=(new Mt).fromArray(i)),void 0!==t.displacementMap&&(r.displacementMap=e(t.displacementMap)),void 0!==t.displacementScale&&(r.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(r.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(r.roughnessMap=e(t.roughnessMap)),void 0!==t.metalnessMap&&(r.metalnessMap=e(t.metalnessMap)),void 0!==t.emissiveMap&&(r.emissiveMap=e(t.emissiveMap)),void 0!==t.emissiveIntensity&&(r.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(r.specularMap=e(t.specularMap)),void 0!==t.envMap&&(r.envMap=e(t.envMap)),void 0!==t.envMapIntensity&&(r.envMapIntensity=t.envMapIntensity),void 0!==t.reflectivity&&(r.reflectivity=t.reflectivity),void 0!==t.refractionRatio&&(r.refractionRatio=t.refractionRatio),void 0!==t.lightMap&&(r.lightMap=e(t.lightMap)),void 0!==t.lightMapIntensity&&(r.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(r.aoMap=e(t.aoMap)),void 0!==t.aoMapIntensity&&(r.aoMapIntensity=t.aoMapIntensity),void 0!==t.gradientMap&&(r.gradientMap=e(t.gradientMap)),void 0!==t.clearcoatMap&&(r.clearcoatMap=e(t.clearcoatMap)),void 0!==t.clearcoatRoughnessMap&&(r.clearcoatRoughnessMap=e(t.clearcoatRoughnessMap)),void 0!==t.clearcoatNormalMap&&(r.clearcoatNormalMap=e(t.clearcoatNormalMap)),void 0!==t.clearcoatNormalScale&&(r.clearcoatNormalScale=(new Mt).fromArray(t.clearcoatNormalScale)),r},setTextures:function(t){return this.textures=t,this}});var nd,ed,id,rd;function od(t){this.manager=void 0!==t?t:rr,this.crossOrigin="anonymous",this.path="",this.resourcePath=""}Object.assign(od.prototype,{load:function(){},parse:function(){},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this},setResourcePath:function(t){return this.resourcePath=t,this}}),Object.assign(od.prototype,{crossOrigin:"anonymous",onLoadStart:function(){},onLoadProgress:function(){},onLoadComplete:function(){},initMaterials:function(t,n,e){for(var i=[],r=0;r<t.length;++r)i[r]=this.createMaterial(t[r],n,e);return i},createMaterial:(nd={NoBlending:0,NormalBlending:1,AdditiveBlending:2,SubtractiveBlending:3,MultiplyBlending:4,CustomBlending:5},ed=new lt,id=new X0,rd=new td,function(t,s,a){var u={};function n(t,n,e,i,r){var t=s+t,o=(new ir).getHandler(t),o=(null!==o?o:(id.setCrossOrigin(a),id)).load(t),t=(void 0!==n&&(o.repeat.fromArray(n),1!==n[0]&&(o.wrapS=1e3),1!==n[1])&&(o.wrapT=1e3),void 0!==e&&o.offset.fromArray(e),void 0!==i&&("repeat"===i[0]&&(o.wrapS=1e3),"mirror"===i[0]&&(o.wrapS=1002),"repeat"===i[1]&&(o.wrapT=1e3),"mirror"===i[1])&&(o.wrapT=1002),void 0!==r&&(o.anisotropy=r),St.generateUUID());return u[t]=o,t}var e,i={uuid:St.generateUUID(),type:"MeshLambertMaterial"};for(e in t){var r=t[e];switch(e){case"DbgColor":case"DbgIndex":case"opticalDensity":case"illumination":break;case"DbgName":i.name=r;break;case"blending":i.blending=nd[r];break;case"colorAmbient":case"mapAmbient":break;case"colorDiffuse":i.color=ed.fromArray(r).getHex();break;case"colorSpecular":i.specular=ed.fromArray(r).getHex();break;case"colorEmissive":i.emissive=ed.fromArray(r).getHex();break;case"specularCoef":i.shininess=r;break;case"shading":"basic"===r.toLowerCase()&&(i.type="MeshBasicMaterial"),"phong"===r.toLowerCase()&&(i.type="MeshPhongMaterial"),"standard"===r.toLowerCase()&&(i.type="MeshStandardMaterial");break;case"mapDiffuse":i.map=n(r,t.mapDiffuseRepeat,t.mapDiffuseOffset,t.mapDiffuseWrap,t.mapDiffuseAnisotropy);break;case"mapDiffuseRepeat":case"mapDiffuseOffset":case"mapDiffuseWrap":case"mapDiffuseAnisotropy":break;case"mapEmissive":i.emissiveMap=n(r,t.mapEmissiveRepeat,t.mapEmissiveOffset,t.mapEmissiveWrap,t.mapEmissiveAnisotropy);break;case"mapEmissiveRepeat":case"mapEmissiveOffset":case"mapEmissiveWrap":case"mapEmissiveAnisotropy":break;case"mapLight":i.lightMap=n(r,t.mapLightRepeat,t.mapLightOffset,t.mapLightWrap,t.mapLightAnisotropy);break;case"mapLightRepeat":case"mapLightOffset":case"mapLightWrap":case"mapLightAnisotropy":break;case"mapAO":i.aoMap=n(r,t.mapAORepeat,t.mapAOOffset,t.mapAOWrap,t.mapAOAnisotropy);break;case"mapAORepeat":case"mapAOOffset":case"mapAOWrap":case"mapAOAnisotropy":break;case"mapBump":i.bumpMap=n(r,t.mapBumpRepeat,t.mapBumpOffset,t.mapBumpWrap,t.mapBumpAnisotropy);break;case"mapBumpScale":i.bumpScale=r;break;case"mapBumpRepeat":case"mapBumpOffset":case"mapBumpWrap":case"mapBumpAnisotropy":break;case"mapNormal":i.normalMap=n(r,t.mapNormalRepeat,t.mapNormalOffset,t.mapNormalWrap,t.mapNormalAnisotropy);break;case"mapNormalFactor":i.normalScale=r;break;case"mapNormalRepeat":case"mapNormalOffset":case"mapNormalWrap":case"mapNormalAnisotropy":break;case"mapSpecular":i.specularMap=n(r,t.mapSpecularRepeat,t.mapSpecularOffset,t.mapSpecularWrap,t.mapSpecularAnisotropy);break;case"mapSpecularRepeat":case"mapSpecularOffset":case"mapSpecularWrap":case"mapSpecularAnisotropy":break;case"mapMetalness":i.metalnessMap=n(r,t.mapMetalnessRepeat,t.mapMetalnessOffset,t.mapMetalnessWrap,t.mapMetalnessAnisotropy);break;case"mapMetalnessRepeat":case"mapMetalnessOffset":case"mapMetalnessWrap":case"mapMetalnessAnisotropy":break;case"mapRoughness":i.roughnessMap=n(r,t.mapRoughnessRepeat,t.mapRoughnessOffset,t.mapRoughnessWrap,t.mapRoughnessAnisotropy);break;case"mapRoughnessRepeat":case"mapRoughnessOffset":case"mapRoughnessWrap":case"mapRoughnessAnisotropy":break;case"mapAlpha":i.alphaMap=n(r,t.mapAlphaRepeat,t.mapAlphaOffset,t.mapAlphaWrap,t.mapAlphaAnisotropy);break;case"mapAlphaRepeat":case"mapAlphaOffset":case"mapAlphaWrap":case"mapAlphaAnisotropy":break;case"flipSided":i.side=1;break;case"doubleSided":i.side=2;break;case"transparency":i.opacity=r;break;case"depthTest":case"depthWrite":case"colorWrite":case"opacity":case"reflectivity":case"transparent":case"visible":case"wireframe":i[e]=r;break;case"vertexColors":!0===r&&(i.vertexColors=2),"face"===r&&(i.vertexColors=1)}}return"MeshBasicMaterial"===i.type&&delete i.emissive,"MeshPhongMaterial"!==i.type&&delete i.specular,i.opacity<1&&(i.transparent=!0),rd.setTextures(u),rd.parse(i)})});var sd={};function ad(t){od.call(this,t)}ad.prototype=Object.assign(Object.create(od.prototype),{constructor:ad,load:function(s,t,n,e){void 0===s&&(s=""),void 0!==this.path&&(s=this.path+s),s=this.manager.resolveURL(s);var a=this,i=G0.get(s);if(void 0!==i)return a.manager.itemStart(s),setTimeout(function(){t&&t(i),a.manager.itemEnd(s)},0),i;if(void 0===sd[s]){var r=s.match(/^data:(.*?)(;base64)?,(.*)$/);if(r){var o=r[1],u=!!r[2],c=r[3],c=decodeURIComponent(c);u&&(c=atob(c));try{var h=(this.responseType||"").toLowerCase();switch(h){case"arraybuffer":case"blob":for(var f=new Uint8Array(c.length),l=0;l<c.length;l++)f[l]=c.charCodeAt(l);d="blob"===h?new Blob([f.buffer],{type:o}):f.buffer;break;case"document":var d=(new DOMParser).parseFromString(c,o);break;case"json":d=JSON.parse(c);break;default:d=c}setTimeout(function(){t&&t(d),a.manager.itemEnd(s)},0)}catch(t){setTimeout(function(){e&&e(t),a.manager.itemError(s),a.manager.itemEnd(s)},0)}}else{sd[s]=[],sd[s].push({onLoad:t,onProgress:n,onError:e});var v,p=new st.a.XMLHttpRequest;for(v in p.open("GET",s,!0),p.addEventListener("load",function(t){var n=this.response,e=sd[s];if(delete sd[s],200===this.status||0===this.status){0===this.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),G0.add(s,n);for(var i=0,r=e.length;i<r;i++)(o=e[i]).onLoad&&o.onLoad(n)}else{for(var o,i=0,r=e.length;i<r;i++)(o=e[i]).onError&&o.onError(t);a.manager.itemError(s)}a.manager.itemEnd(s)},!1),p.addEventListener("progress",function(t){for(var n=sd[s],e=0,i=n.length;e<i;e++){var r=n[e];r.onProgress&&r.onProgress(t)}},!1),p.addEventListener("error",function(t){var n=sd[s];delete sd[s];for(var e=0,i=n.length;e<i;e++){var r=n[e];r.onError&&r.onError(t)}a.manager.itemError(s),a.manager.itemEnd(s)},!1),p.addEventListener("abort",function(t){var n=sd[s];delete sd[s];for(var e=0,i=n.length;e<i;e++){var r=n[e];r.onError&&r.onError(t)}a.manager.itemError(s),a.manager.itemEnd(s)},!1),void 0!==this.responseType&&(p.responseType=this.responseType),void 0!==this.withCredentials&&(p.withCredentials=this.withCredentials),p.overrideMimeType&&p.overrideMimeType(void 0!==this.mimeType?this.mimeType:"text/plain"),this.requestHeader)p.setRequestHeader(v,this.requestHeader[v]);p.send(null)}return a.manager.itemStart(s),p}sd[s].push({onLoad:t,onProgress:n,onError:e})},setResponseType:function(t){return this.responseType=t,this},setWithCredentials:function(t){return this.withCredentials=t,this},setMimeType:function(t){return this.mimeType=t,this},setRequestHeader:function(t){return this.requestHeader=t,this}});var ud={arraySlice:function(t,n,e){return ud.isTypedArray(t)?new t.constructor(t.subarray(n,void 0!==e?e:t.length)):t.slice(n,e)},convertArray:function(t,n,e){return!t||!e&&t.constructor===n?t:"number"==typeof n.BYTES_PER_ELEMENT?new n(t):Array.prototype.slice.call(t)},isTypedArray:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)},getKeyframeOrder:function(e){for(var t=e.length,n=new Array(t),i=0;i!==t;++i)n[i]=i;return n.sort(function(t,n){return e[t]-e[n]}),n},sortedArray:function(t,n,e){for(var i=t.length,r=new t.constructor(i),o=0,s=0;s!==i;++o)for(var a=e[o]*n,u=0;u!==n;++u)r[s++]=t[a+u];return r},flattenJSON:function(t,n,e,i){for(var r=1,o=t[0];void 0!==o&&void 0===o[i];)o=t[r++];if(void 0!==o){var s=o[i];if(void 0!==s)if(Array.isArray(s))for(;void 0!==(s=o[i])&&(n.push(o.time),e.push.apply(e,s)),void 0!==(o=t[r++]););else if(void 0!==s.toArray)for(;void 0!==(s=o[i])&&(n.push(o.time),s.toArray(e,e.length)),void 0!==(o=t[r++]););else for(;void 0!==(s=o[i])&&(n.push(o.time),e.push(s)),void 0!==(o=t[r++]););}},subclip:function(t,n,e,i,r){r=r||30;for(var o=t.clone(),s=(o.name=n,[]),a=0;a<o.tracks.length;++a){for(var u=o.tracks[a],c=u.getValueSize(),h=[],f=[],l=0;l<u.times.length;++l){var d=u.times[l]*r;if(!(d<e||i<=d)){h.push(u.times[l]);for(var v=0;v<c;++v)f.push(u.values[l*c+v])}}0!==h.length&&(u.times=ud.convertArray(h,u.times.constructor),u.values=ud.convertArray(f,u.values.constructor),s.push(u))}o.tracks=s;for(var p=1/0,a=0;a<o.tracks.length;++a)p>o.tracks[a].times[0]&&(p=o.tracks[a].times[0]);for(a=0;a<o.tracks.length;++a)o.tracks[a].shift(-1*p);return o.resetDuration(),o}};function cd(t,n,e,i){this.parameterPositions=t,this.tc=0,this.resultBuffer=void 0!==i?i:new n.constructor(e),this.sampleValues=n,this.valueSize=e}function hd(t,n,e,i){cd.call(this,t,n,e,i),this.nc=-0,this.ec=-0,this.ic=-0,this.rc=-0}function fd(t,n,e,i){cd.call(this,t,n,e,i)}function ld(t,n,e,i){cd.call(this,t,n,e,i)}function dd(t,n,e,i){if(void 0===t)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===n||0===n.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=ud.convertArray(n,this.TimeBufferType),this.values=ud.convertArray(e,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}function vd(t,n,e){dd.call(this,t,n,e)}function pd(t,n,e,i){dd.call(this,t,n,e,i)}function md(t,n,e,i){dd.call(this,t,n,e,i)}function yd(t,n,e,i){cd.call(this,t,n,e,i)}function bd(t,n,e,i){dd.call(this,t,n,e,i)}function gd(t,n,e,i){dd.call(this,t,n,e,i)}function _d(t,n,e,i){dd.call(this,t,n,e,i)}function wd(t,n,e){this.name=t,this.tracks=e,this.duration=void 0!==n?n:-1,this.uuid=St.generateUUID(),this.duration<0&&this.resetDuration()}function xd(t){if(void 0===t.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");var n,e,i=function(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return md;case"vector":case"vector2":case"vector3":case"vector4":return _d;case"color":return pd;case"quaternion":return bd;case"bool":case"boolean":return vd;case"string":return gd}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+t)}(t.type);return void 0===t.times&&(ud.flattenJSON(t.keys,n=[],e=[],"value"),t.times=n,t.values=e),void 0!==i.parse?i.parse(t):new i(t.name,t.times,t.values,t.interpolation)}function Ed(t){"boolean"==typeof t&&(console.warn("JSONLoader: showStatus parameter has been removed from constructor."),t=void 0),this.manager=void 0!==t?t:rr,this.withCredentials=!1}Object.assign(cd.prototype,{evaluate:function(t){var n,e=this.parameterPositions,i=this.tc,r=e[i],o=e[i-1];t:{n:{e:{i:if(!(t<r)){for(var s=i+2;;){if(void 0===r){if(t<o)break i;return i=e.length,this.tc=i,this.afterEnd_(i-1,t,o)}if(i===s)break;if(o=r,t<(r=e[++i]))break n}n=e.length;break e}if(o<=t)break t;var a=e[1];t<a&&(i=2,o=a);for(s=i-2;;){if(void 0===o)return this.tc=0,this.beforeStart_(0,t,r);if(i===s)break;if(r=o,(o=e[--i-1])<=t)break n}n=i,i=0}for(;i<n;){var u=i+n>>>1;t<e[u]?n=u:i=1+u}if(r=e[i],void 0===(o=e[i-1]))return this.tc=0,this.beforeStart_(0,t,r);if(void 0===r)return i=e.length,this.tc=i,this.afterEnd_(i-1,o,t)}this.tc=i,this.intervalChanged_(i,o,r)}return this.interpolate_(i,o,t,r)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(t){for(var n=this.resultBuffer,e=this.sampleValues,i=this.valueSize,r=t*i,o=0;o!==i;++o)n[o]=e[r+o];return n},interpolate_:function(){throw new Error("call to abstract method")},intervalChanged_:function(){}}),Object.assign(cd.prototype,{beforeStart_:cd.prototype.copySampleValue_,afterEnd_:cd.prototype.copySampleValue_}),hd.prototype=Object.assign(Object.create(cd.prototype),{constructor:hd,DefaultSettings_:{endingStart:hi,endingEnd:hi},intervalChanged_:function(t,n,e){var i=this.parameterPositions,r=t-2,o=t+1,s=i[r],a=i[o];if(void 0===s)switch(this.getSettings_().endingStart){case fi:r=t,s=2*n-e;break;case 2402:s=n+i[r=i.length-2]-i[r+1];break;default:r=t,s=e}if(void 0===a)switch(this.getSettings_().endingEnd){case fi:o=t,a=2*e-n;break;case 2402:a=e+i[o=1]-i[0];break;default:o=t-1,a=n}var u=.5*(e-n),c=this.valueSize;this.nc=u/(n-s),this.ic=u/(a-e),this.ec=r*c,this.rc=o*c},interpolate_:function(t,n,e,i){for(var r=this.resultBuffer,o=this.sampleValues,s=this.valueSize,a=t*s,u=a-s,c=this.ec,h=this.rc,t=this.nc,f=this.ic,e=(e-n)/(i-n),i=e*e,n=i*e,l=-t*n+2*t*i-t*e,d=(1+t)*n+(-1.5-2*t)*i+(-.5+t)*e+1,v=(-1-f)*n+(1.5+f)*i+.5*e,p=f*n-f*i,m=0;m!==s;++m)r[m]=l*o[c+m]+d*o[u+m]+v*o[a+m]+p*o[h+m];return r}}),fd.prototype=Object.assign(Object.create(cd.prototype),{constructor:fd,interpolate_:function(t,n,e,i){for(var r=this.resultBuffer,o=this.sampleValues,s=this.valueSize,a=t*s,u=a-s,c=(e-n)/(i-n),h=1-c,f=0;f!==s;++f)r[f]=o[u+f]*h+o[a+f]*c;return r}}),ld.prototype=Object.assign(Object.create(cd.prototype),{constructor:ld,interpolate_:function(t){return this.copySampleValue_(t-1)}}),Object.assign(dd.prototype,{constructor:dd,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:ci,InterpolantFactoryMethodDiscrete:function(t){return new ld(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodLinear:function(t){return new fd(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:function(t){return new hd(this.times,this.values,this.getValueSize(),t)},setInterpolation:function(t){var n;switch(t){case ui:n=this.InterpolantFactoryMethodDiscrete;break;case ci:n=this.InterpolantFactoryMethodLinear;break;case 2302:n=this.InterpolantFactoryMethodSmooth}if(void 0===n){var e="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(t===this.DefaultInterpolation)throw new Error(e);this.setInterpolation(this.DefaultInterpolation)}console.warn("THREE.KeyframeTrack:",e)}else this.createInterpolant=n;return this},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return ui;case this.InterpolantFactoryMethodLinear:return ci;case this.InterpolantFactoryMethodSmooth:return 2302}},getValueSize:function(){return this.values.length/this.times.length},shift:function(t){if(0!==t)for(var n=this.times,e=0,i=n.length;e!==i;++e)n[e]+=t;return this},scale:function(t){if(1!==t)for(var n=this.times,e=0,i=n.length;e!==i;++e)n[e]*=t;return this},trim:function(t,n){for(var e,i=this.times,r=i.length,o=0,s=r-1;o!==r&&i[o]<t;)++o;for(;-1!==s&&i[s]>n;)--s;return++s,0===o&&s===r||(s<=o&&(o=(s=Math.max(s,1))-1),e=this.getValueSize(),this.times=ud.arraySlice(i,o,s),this.values=ud.arraySlice(this.values,o*e,s*e)),this},validate:function(){for(var t=!0,n=this.getValueSize(),e=(n-Math.floor(n)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1),this.times),i=this.values,r=e.length,o=(0===r&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1),null),s=0;s!==r;s++){var a=e[s];if("number"==typeof a&&isNaN(a)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,s,a),t=!1;break}if(null!==o&&a<o){console.error("THREE.KeyframeTrack: Out of order keys.",this,s,a,o),t=!1;break}o=a}if(void 0!==i&&ud.isTypedArray(i))for(var s=0,u=i.length;s!==u;++s){var c=i[s];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,s,c),t=!1;break}}return t},optimize:function(){for(var t=ud.arraySlice(this.times),n=ud.arraySlice(this.values),e=this.getValueSize(),i=2302===this.getInterpolation(),r=1,o=t.length-1,s=1;s<o;++s){var a=!1,u=t[s];if(u!==t[s+1]&&(1!==s||u!==u[0]))if(i)a=!0;else for(var c=s*e,h=c-e,f=c+e,l=0;l!==e;++l){var d=n[c+l];if(d!==n[h+l]||d!==n[f+l]){a=!0;break}}if(a){if(s!==r){t[r]=t[s];for(var v=s*e,p=r*e,l=0;l!==e;++l)n[p+l]=n[v+l]}++r}}if(0<o){t[r]=t[o];for(v=o*e,p=r*e,l=0;l!==e;++l)n[p+l]=n[v+l];++r}return r!==t.length?(this.times=ud.arraySlice(t,0,r),this.values=ud.arraySlice(n,0,r*e)):(this.times=t,this.values=n),this},clone:function(){var t=ud.arraySlice(this.times,0),n=ud.arraySlice(this.values,0),t=new this.constructor(this.name,t,n);return t.createInterpolant=this.createInterpolant,t}}),vd.prototype=Object.assign(Object.create(dd.prototype),{constructor:vd,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:ui,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),pd.prototype=Object.assign(Object.create(dd.prototype),{constructor:pd,ValueTypeName:"color"}),md.prototype=Object.assign(Object.create(dd.prototype),{constructor:md,ValueTypeName:"number"}),yd.prototype=Object.assign(Object.create(cd.prototype),{constructor:yd,interpolate_:function(t,n,e,i){for(var r=this.resultBuffer,o=this.sampleValues,s=this.valueSize,a=t*s,u=(e-n)/(i-n),c=a+s;a!==c;a+=4)at.slerpFlat(r,0,o,a-s,o,a,u);return r}}),bd.prototype=Object.assign(Object.create(dd.prototype),{constructor:bd,ValueTypeName:"quaternion",DefaultInterpolation:ci,InterpolantFactoryMethodLinear:function(t){return new yd(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:void 0}),gd.prototype=Object.assign(Object.create(dd.prototype),{constructor:gd,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:ui,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),_d.prototype=Object.assign(Object.create(dd.prototype),{constructor:_d,ValueTypeName:"vector"}),Object.assign(wd,{parse:function(t){for(var n=[],e=t.tracks,i=1/(t.fps||1),r=0,o=e.length;r!==o;++r)n.push(xd(e[r]).scale(i));return new wd(t.name,t.duration,n)},CreateFromMorphTargetSequence:function(t,n,e,i){for(var r=n.length,o=[],s=0;s<r;s++){var a=[],u=((c=[]).push((s+r-1)%r,s,(s+1)%r),a.push(0,1,0),ud.getKeyframeOrder(c)),c=ud.sortedArray(c,1,u),a=ud.sortedArray(a,1,u);i||0!==c[0]||(c.push(r),a.push(a[0])),o.push(new md(".morphTargetInfluences["+n[s].name+"]",c,a).scale(1/e))}return new wd(t,-1,o)},findByName:function(t,n){var e=t;Array.isArray(t)||(e=t.geometry&&t.geometry.animations||t.animations);for(var i=0;i<e.length;i++)if(e[i].name===n)return e[i];return null},CreateClipsFromMorphTargetSequences:function(t,n,e){for(var i={},r=/^([\w-]*?)([\d]+)$/,o=0,s=t.length;o<s;o++){var a=t[o],u=a.name.match(r);u&&1<u.length&&((u=i[c=u[1]])||(i[c]=u=[]),u.push(a))}var c,h=[];for(c in i)h.push(wd.CreateFromMorphTargetSequence(c,i[c],n,e));return h},parseAnimation:function(t,n){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var e=function(t,n,e,i,r){var o;0!==e.length&&(ud.flattenJSON(e,e=[],o=[],i),0!==e.length)&&r.push(new t(n,e,o))},i=[],r=t.name||"default",o=t.length||-1,s=t.fps||30,a=t.hierarchy||[],u=0;u<a.length;u++){var c=a[u].keys;if(c&&0!==c.length)if(c[0].morphTargets){for(var h,f={},l=0;l<c.length;l++)if(c[l].morphTargets)for(var d=0;d<c[l].morphTargets.length;d++)f[c[l].morphTargets[d]]=-1;for(h in f){for(var v=[],p=[],d=0;d!==c[l].morphTargets.length;++d){var m=c[l];v.push(m.time),p.push(m.morphTarget===h?1:0)}i.push(new md(".morphTargetInfluence["+h+"]",v,p))}o=f.length*(s||1)}else{var y=".bones["+n[u].name+"]";e(_d,y+".position",c,"pos",i),e(bd,y+".quaternion",c,"rot",i),e(_d,y+".scale",c,"scl",i)}}return 0===i.length?null:new wd(r,o,i)}}),Object.assign(wd.prototype,{resetDuration:function(){for(var t=0,n=0,e=this.tracks.length;n!==e;++n)var i=this.tracks[n],t=Math.max(t,i.times[i.times.length-1]);return this.duration=t,this},trim:function(){for(var t=0;t<this.tracks.length;t++)this.tracks[t].trim(0,this.duration);return this},validate:function(){for(var t=!0,n=0;n<this.tracks.length;n++)t=t&&this.tracks[n].validate();return t},optimize:function(){for(var t=0;t<this.tracks.length;t++)this.tracks[t].optimize();return this},clone:function(){for(var t=[],n=0;n<this.tracks.length;n++)t.push(this.tracks[n].clone());return new wd(this.name,this.duration,t)}}),Object.assign(Ed.prototype,{crossOrigin:"anonymous",load:function(e,i,t,n){var r=this,o=void 0===this.path?B0(e):this.path,s=(this.resourcePath=o+"maps/",new ad(this.manager));s.setPath(this.path),s.setWithCredentials(this.withCredentials),s.load(e,function(t){var t=JSON.parse(t),n=t.metadata;if(void 0!==n){n=n.type;if(void 0!==n&&"object"===n.toLowerCase())return void console.error("JSONLoader: "+e+" should be loaded with ObjectLoader instead.")}n=r.parse(t,o);i(n.geometry,n.materials)},t,n)},setPath:function(t){return this.path=t,this},setResourcePath:function(t){return this.resourcePath=t,this},setCrossOrigin:function(t){return this.crossOrigin=t,this},parse:function(t,C){void 0!==(t=void 0!==t.data?t.data:t).scale?t.scale=1/t.scale:t.scale=1;var n,e,i,r,o,s,a,u,c,h,D,k,U,B,G,H,f,l,d,v,p,m,y,b,g=new Us,_=t,w=g,x=_.faces,E=_.vertices,S=_.normals,X=_.colors,V=_.scale,z=0;if(void 0!==_.uvs){for(n=0;n<_.uvs.length;n++)_.uvs[n].length&&z++;for(n=0;n<z;n++)w.faceVertexUvs[n]=[]}for(r=0,o=E.length;r<o;)(f=new Tt).x=E[r++]*V,f.y=E[r++]*V,f.z=E[r++]*V,w.vertices.push(f);for(r=0,o=x.length;r<o;)if(D=(h=x[r++])&2,k=h&8,U=h&16,B=h&32,G=h&64,H=h&128,h&1){if((d=new js).a=x[r],d.b=x[r+1],d.c=x[r+3],(v=new js).a=x[r+1],v.b=x[r+2],v.c=x[r+3],r+=4,D&&(c=x[r++],d.materialIndex=c,v.materialIndex=c),i=w.faces.length,k)for(n=0;n<z;n++)for(y=_.uvs[n],w.faceVertexUvs[n][i]=[],w.faceVertexUvs[n][i+1]=[],e=0;e<4;e++)b=new Mt(y[2*(u=x[r++])],y[2*u+1]),2!==e&&w.faceVertexUvs[n][i].push(b),0!==e&&w.faceVertexUvs[n][i+1].push(b);if(U&&(a=3*x[r++],d.normal.set(S[a++],S[a++],S[a]),v.normal.copy(d.normal)),B)for(n=0;n<4;n++)a=3*x[r++],m=new Tt(S[a++],S[a++],S[a]),2!==n&&d.vertexNormals.push(m),0!==n&&v.vertexNormals.push(m);if(G&&(p=X[s=x[r++]],d.color.setHex(p),v.color.setHex(p)),H)for(n=0;n<4;n++)p=X[s=x[r++]],2!==n&&d.vertexColors.push(new lt(p)),0!==n&&v.vertexColors.push(new lt(p));w.faces.push(d),w.faces.push(v)}else{if((l=new js).a=x[r++],l.b=x[r++],l.c=x[r++],D&&(c=x[r++],l.materialIndex=c),i=w.faces.length,k)for(n=0;n<z;n++)for(y=_.uvs[n],w.faceVertexUvs[n][i]=[],e=0;e<3;e++)b=new Mt(y[2*(u=x[r++])],y[2*u+1]),w.faceVertexUvs[n][i].push(b);if(U&&(a=3*x[r++],l.normal.set(S[a++],S[a++],S[a])),B)for(n=0;n<3;n++)a=3*x[r++],m=new Tt(S[a++],S[a++],S[a]),l.vertexNormals.push(m);if(G&&(s=x[r++],l.color.setHex(X[s])),H)for(n=0;n<3;n++)s=x[r++],l.vertexColors.push(new lt(X[s]));w.faces.push(l)}var T=t,A=g,M=void 0!==T.influencesPerVertex?T.influencesPerVertex:2;if(T.skinWeights)for(var O=0,W=T.skinWeights.length;O<W;O+=M){var Y=T.skinWeights[O],Q=1<M?T.skinWeights[O+1]:0,Z=2<M?T.skinWeights[O+2]:0,q=3<M?T.skinWeights[O+3]:0;A.skinWeights.push(new Ot(Y,Q,Z,q))}if(T.skinIndices)for(O=0,W=T.skinIndices.length;O<W;O+=M){var K=T.skinIndices[O],J=1<M?T.skinIndices[O+1]:0,$=2<M?T.skinIndices[O+2]:0,tt=3<M?T.skinIndices[O+3]:0;A.skinIndices.push(new Ot(K,J,$,tt))}A.bones=T.bones,A.bones&&0<A.bones.length&&(A.skinWeights.length!==A.skinIndices.length||A.skinIndices.length!==A.vertices.length)&&console.warn("When skinning, number of vertices ("+A.vertices.length+"), skinIndices ("+A.skinIndices.length+"), and skinWeights ("+A.skinWeights.length+") should match.");var L=t,R=g,nt=L.scale;if(void 0!==L.morphTargets)for(var N=0,et=L.morphTargets.length;N<et;N++){R.morphTargets[N]={},R.morphTargets[N].name=L.morphTargets[N].name,R.morphTargets[N].vertices=[];for(var it=R.morphTargets[N].vertices,rt=L.morphTargets[N].vertices,P=0,ot=rt.length;P<ot;P+=3){var st=new Tt;st.x=rt[P]*nt,st.y=rt[P+1]*nt,st.z=rt[P+2]*nt,it.push(st)}}if(void 0!==L.morphColors&&0<L.morphColors.length){console.warn('fm.JSONLoader: "morphColors" no longer supported. Using them as face colors.');for(var at=R.faces,ut=L.morphColors[0].colors,N=0,et=at.length;N<et;N++)at[N].color.fromArray(ut,3*N)}var F=t,ct=g,j=[],I=[];void 0!==F.animation&&I.push(F.animation),void 0!==F.animations&&(F.animations.length?I=I.concat(F.animations):I.push(F.animations));for(var ht=0;ht<I.length;ht++){var ft=wd.parseAnimation(I[ht],ct.bones);ft&&j.push(ft)}return ct.morphTargets&&(F=wd.CreateClipsFromMorphTargetSequences(ct.morphTargets,10),j=j.concat(F)),0<j.length&&(ct.animations=j),g.computeFaceNormals(),g.computeBoundingSphere(),void 0===t.materials||0===t.materials.length?{geometry:g}:{geometry:g,materials:od.prototype.initMaterials(t.materials,this.resourcePath||C,this.crossOrigin)}}});var Sd=Ed;function Td(t,n){a.call(this),this.type="Light",this.color=new lt(t),this.intensity=void 0!==n?n:1,this.receiveShadow=void 0}function Ad(t){this.camera=t,this.bias=0,this.radius=1,this.mapSize=new Mt(512,512),this.map=null,this.mapPass=null,this.matrix=new At,this.oc=new Vt,this.sc=new Mt(1,1),this.ac=1,this.uc=[new Ot(0,0,1,1)]}function Md(){Ad.call(this,new vt(-5,5,5,-5,.5,500))}function Od(t,n){Td.call(this,t,n),this.type="DirectionalLight",this.position.copy(a.DefaultUp),this.updateMatrix(),this.target=new a,this.shadow=new Md}function Ld(){Ad.call(this,new dt(90,1,.5,500)),this.sc=new Mt(4,2),this.ac=6,this.uc=[new Ot(2,1,1,1),new Ot(0,1,1,1),new Ot(3,1,1,1),new Ot(1,1,1,1),new Ot(3,0,1,1),new Ot(1,0,1,1)],this.cc=[new Tt(1,0,0),new Tt(-1,0,0),new Tt(0,0,1),new Tt(0,0,-1),new Tt(0,1,0),new Tt(0,-1,0)],this.hc=[new Tt(0,1,0),new Tt(0,1,0),new Tt(0,1,0),new Tt(0,1,0),new Tt(0,0,1),new Tt(0,0,-1)]}function Rd(t,n,e,i){Td.call(this,t,n),this.type="PointLight",Object.defineProperty(this,"power",{get:function(){return 4*this.intensity*Math.PI},set:function(t){this.intensity=t/(4*Math.PI)}}),this.distance=void 0!==e?e:0,this.decay=void 0!==i?i:1,this.shadow=new Ld}function Nd(){Ad.call(this,new dt(50,1,.5,500))}function Pd(t,n,e,i,r,o){Td.call(this,t,n),this.type="SpotLight",this.position.copy(a.DefaultUp),this.updateMatrix(),this.target=new a,Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(t){this.intensity=t/Math.PI}}),this.distance=void 0!==e?e:0,this.angle=void 0!==i?i:Math.PI/3,this.penumbra=void 0!==r?r:0,this.decay=void 0!==o?o:1,this.shadow=new Nd}function Fd(t,n){t&&t.isGeometry&&console.error("THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."),$a.call(this,t,n),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new At,this.bindMatrixInverse=new At}Td.prototype=Object.assign(Object.create(a.prototype),{constructor:Td,isLight:!0,copy:function(t){return a.prototype.copy.call(this,t),this.color.copy(t.color),this.intensity=t.intensity,this}}),Object.assign(Ad.prototype,{fc:new At,lc:new Tt,dc:new Tt,getViewportCount:function(){return this.ac},getFrustum:function(){return this.oc},updateMatrices:function(t){var n=this.camera,e=this.matrix,i=this.fc,r=this.dc,o=this.lc;o.setFromMatrixPosition(t.matrixWorld),n.position.copy(o),r.setFromMatrixPosition(t.target.matrixWorld),n.lookAt(r),n.updateMatrixWorld(),i.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this.oc.setFromProjectionMatrix(i),e.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),e.multiply(n.projectionMatrix),e.multiply(n.matrixWorldInverse)},getViewport:function(t){return this.uc[t]},getFrameExtents:function(){return this.sc},copy:function(t){return this.camera=t.camera.clone(),this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this},clone:function(){return(new this.constructor).copy(this)}}),Md.prototype=Object.assign(Object.create(Ad.prototype),{constructor:Md,isDirectionalLightShadow:!0,updateMatrices:function(t){Ad.prototype.updateMatrices.call(this,t)}}),Od.prototype=Object.assign(Object.create(Td.prototype),{constructor:Od,isDirectionalLight:!0,copy:function(t){return Td.prototype.copy.call(this,t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),Ld.prototype=Object.assign(Object.create(Ad.prototype),{constructor:Ld,isPointLightShadow:!0,updateMatrices:function(t,n){void 0===n&&(n=0);var e=this.camera,i=this.matrix,r=this.lc,o=this.dc,s=this.fc;r.setFromMatrixPosition(t.matrixWorld),e.position.copy(r),o.copy(e.position),o.add(this.cc[n]),e.up.copy(this.hc[n]),e.lookAt(o),e.updateMatrixWorld(),i.makeTranslation(-r.x,-r.y,-r.z),s.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this.oc.setFromProjectionMatrix(s)}}),Rd.prototype=Object.assign(Object.create(Td.prototype),{constructor:Rd,isPointLight:!0,copy:function(t){return Td.prototype.copy.call(this,t),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}}),Nd.prototype=Object.assign(Object.create(Ad.prototype),{constructor:Nd,isSpotLightShadow:!0,updateMatrices:function(t){var n=this.camera,e=2*St.RAD2DEG*t.angle,i=this.mapSize.width/this.mapSize.height,r=t.distance||n.far;e===n.fov&&i===n.aspect&&r===n.far||(n.fov=e,n.aspect=i,n.far=r,n.updateProjectionMatrix()),Ad.prototype.updateMatrices.call(this,t)}}),Pd.prototype=Object.assign(Object.create(Td.prototype),{constructor:Pd,isSpotLight:!0,copy:function(t){return Td.prototype.copy.call(this,t),this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),Fd.prototype=Object.assign(Object.create($a.prototype),{constructor:Fd,isSkinnedMesh:!0,bind:function(t,n){this.skeleton=t,void 0===n&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),n=this.matrixWorld),this.bindMatrix.copy(n),this.bindMatrixInverse.getInverse(n)},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){for(var t=new Ot,n=this.geometry.attributes.skinWeight,e=0,i=n.count;e<i;e++){t.x=n.getX(e),t.y=n.getY(e),t.z=n.getZ(e),t.w=n.getW(e);var r=1/t.manhattanLength();r!=1/0?t.multiplyScalar(r):t.set(1,0,0,0),n.setXYZW(e,t.x,t.y,t.z,t.w)}},updateMatrixWorld:function(t){$a.prototype.updateMatrixWorld.call(this,t),"attached"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):"detached"===this.bindMode?this.bindMatrixInverse.getInverse(this.bindMatrix):console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var jd=new Tt,Id=new Tt,Cd=new At,Dd=new us,kd=new Dt;function Ud(t,n,e){1===e&&console.error("THREE.Line: parameter THREE.LinePieces no longer supported. Use THREE.LineSegments instead."),a.call(this),this.type="Line",this.geometry=void 0!==t?t:new ra,this.material=void 0!==n?n:new Bl}Ud.prototype=Object.assign(Object.create(a.prototype),{constructor:Ud,isLine:!0,computeLineDistances:function(){var t=this.geometry;if(t.isBufferGeometry)if(null===t.index){for(var n=t.attributes.position,e=[0],i=1,r=n.count;i<r;i++)jd.fromBufferAttribute(n,i-1),Id.fromBufferAttribute(n,i),e[i]=e[i-1],e[i]+=jd.distanceTo(Id);t.setAttribute("lineDistance",new x(e,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(t.isGeometry){var o=t.vertices;(e=t.lineDistances)[0]=0;for(i=1,r=o.length;i<r;i++)e[i]=e[i-1],e[i]+=o[i-1].distanceTo(o[i])}return this},raycast:function(t,n){var e=this.geometry,i=this.matrixWorld,r=t.params.Line.threshold;if(null===e.boundingSphere&&e.computeBoundingSphere(),kd.copy(e.boundingSphere),kd.applyMatrix4(i),kd.radius+=r,!1!==t.ray.intersectsSphere(kd)){Cd.getInverse(i),Dd.copy(t.ray).applyMatrix4(Cd);var i=r/((this.scale.x+this.scale.y+this.scale.z)/3),o=i*i,s=new Tt,a=new Tt,u=new Tt,c=new Tt,h=this&&this.isLineSegments?2:1;if(e.isBufferGeometry){var r=e.index,f=e.attributes.position.array;if(null!==r)for(var l=r.array,d=0,v=l.length-1;d<v;d+=h){var p=l[d],m=l[d+1];s.fromArray(f,3*p),a.fromArray(f,3*m),o<Dd.distanceSqToSegment(s,a,c,u)||(c.applyMatrix4(this.matrixWorld),(y=t.ray.origin.distanceTo(c))<t.near)||y>t.far||n.push({distance:y,point:u.clone().applyMatrix4(this.matrixWorld),index:d,face:null,faceIndex:null,object:this})}else for(d=0,v=f.length/3-1;d<v;d+=h)s.fromArray(f,3*d),a.fromArray(f,3*d+3),o<Dd.distanceSqToSegment(s,a,c,u)||(c.applyMatrix4(this.matrixWorld),(y=t.ray.origin.distanceTo(c))<t.near)||y>t.far||n.push({distance:y,point:u.clone().applyMatrix4(this.matrixWorld),index:d,face:null,faceIndex:null,object:this})}else if(e.isGeometry)for(var y,b=e.vertices,g=b.length,d=0;d<g-1;d+=h)o<Dd.distanceSqToSegment(b[d],b[d+1],c,u)||(c.applyMatrix4(this.matrixWorld),(y=t.ray.origin.distanceTo(c))<t.near)||y>t.far||n.push({distance:y,point:u.clone().applyMatrix4(this.matrixWorld),index:d,face:null,faceIndex:null,object:this})}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var Bd=new Tt,Gd=new Tt;function Hd(t,n){Ud.call(this,t,n),this.type="LineSegments"}function Xd(t,n){Ud.call(this,t,n),this.type="LineLoop"}Hd.prototype=Object.assign(Object.create(Ud.prototype),{constructor:Hd,isLineSegments:!0,computeLineDistances:function(){var t=this.geometry;if(t.isBufferGeometry)if(null===t.index){for(var n=t.attributes.position,e=[],i=0,r=n.count;i<r;i+=2)Bd.fromBufferAttribute(n,i),Gd.fromBufferAttribute(n,i+1),e[i]=0===i?0:e[i-1],e[i+1]=e[i]+Bd.distanceTo(Gd);t.setAttribute("lineDistance",new x(e,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(t.isGeometry)for(var o=t.vertices,e=t.lineDistances,i=0,r=o.length;i<r;i+=2)Bd.copy(o[i]),Gd.copy(o[i+1]),e[i]=0===i?0:e[i-1],e[i+1]=e[i]+Bd.distanceTo(Gd);return this}}),Xd.prototype=Object.assign(Object.create(Ud.prototype),{constructor:Xd,isLineLoop:!0});var Vd=new At,zd=new us,Wd=new Dt,Yd=new Tt;function Qd(t,n){a.call(this),this.type="Points",this.geometry=void 0!==t?t:new ra,this.material=void 0!==n?n:new z0,this.updateMorphTargets()}function Zd(t,n,e,i,r,o,s){var a=zd.distanceSqToPoint(t);a<e&&(e=new Tt,zd.closestPointToPoint(t,e),e.applyMatrix4(i),(t=r.ray.origin.distanceTo(e))<r.near||t>r.far||o.push({distance:t,distanceToRay:Math.sqrt(a),point:e,index:n,face:null,object:s}))}function qd(){a.call(this),this.type="Bone"}Qd.prototype=Object.assign(Object.create(a.prototype),{constructor:Qd,isPoints:!0,raycast:function(t,n){var e=this.geometry,i=this.matrixWorld,r=t.params.Points.threshold;if(null===e.boundingSphere&&e.computeBoundingSphere(),Wd.copy(e.boundingSphere),Wd.applyMatrix4(i),Wd.radius+=r,!1!==t.ray.intersectsSphere(Wd)){Vd.getInverse(i),zd.copy(t.ray).applyMatrix4(Vd);var r=r/((this.scale.x+this.scale.y+this.scale.z)/3),o=r*r;if(e.isBufferGeometry){var r=e.index,s=e.attributes.position.array;if(null!==r)for(var a=r.array,u=0,c=a.length;u<c;u++){var h=a[u];Yd.fromArray(s,3*h),Zd(Yd,h,o,i,t,n,this)}else for(var u=0,f=s.length/3;u<f;u++)Yd.fromArray(s,3*u),Zd(Yd,u,o,i,t,n,this)}else for(var l=e.vertices,u=0,f=l.length;u<f;u++)Zd(l[u],u,o,i,t,n,this)}},updateMorphTargets:function(){var t,n,e,i=this.geometry;if(i.isBufferGeometry){var r=i.morphAttributes,o=Object.keys(r);if(0<o.length){var s=r[o[0]];if(void 0!==s)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,n=s.length;t<n;t++)e=s[t].name||String(t),this.morphTargetInfluences.push(0),this.morphTargetDictionary[e]=t}}else{r=i.morphTargets;void 0!==r&&0<r.length&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),qd.prototype=Object.assign(Object.create(a.prototype),{constructor:qd,isBone:!0});var e="\\[\\]\\.:\\/",Kd=new RegExp("["+e+"]","g"),Jd="[^"+e+"]",e="[^"+e.replace("\\.","")+"]",$d=/((?:WC+[\/:])*)/.source.replace("WC",Jd),e=/(WCOD+)?/.source.replace("WCOD",e),tv=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Jd),Jd=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Jd),nv=new RegExp("^"+$d+e+tv+Jd+"$"),ev=["material","materials","bones"];function iv(t,n,e){e=e||rv.parseTrackName(n);this.vc=t,this.mc=t.subscribe_(n,e)}function rv(t,n,e){this.path=n,this.parsedPath=e||rv.parseTrackName(n),this.node=rv.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t}Object.assign(iv.prototype,{getValue:function(t,n){this.bind();var e=this.vc.nCachedObjects_,e=this.mc[e];void 0!==e&&e.getValue(t,n)},setValue:function(t,n){for(var e=this.mc,i=this.vc.nCachedObjects_,r=e.length;i!==r;++i)e[i].setValue(t,n)},bind:function(){for(var t=this.mc,n=this.vc.nCachedObjects_,e=t.length;n!==e;++n)t[n].bind()},unbind:function(){for(var t=this.mc,n=this.vc.nCachedObjects_,e=t.length;n!==e;++n)t[n].unbind()}}),Object.assign(rv,{Composite:iv,create:function(t,n,e){return new(t&&t.isAnimationObjectGroup?rv.Composite:rv)(t,n,e)},sanitizeNodeName:function(t){return t.replace(/\s/g,"_").replace(Kd,"")},parseTrackName:function(t){var n=nv.exec(t);if(!n)throw new Error("PropertyBinding: Cannot parse trackName: "+t);var e,n={nodeName:n[2],objectName:n[3],objectIndex:n[4],propertyName:n[5],propertyIndex:n[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==i&&-1!==i&&(e=n.nodeName.substring(i+1),-1!==ev.indexOf(e))&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=e),null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return n},findNode:function(t,r){if(!r||""===r||"."===r||-1===r||r===t.name||r===t.uuid)return t;if(t.skeleton){var n=t.skeleton.getBoneByName(r);if(void 0!==n)return n}if(t.children){n=function t(n){for(var e=0;e<n.length;e++){var i=n[e];if(i.name===r||i.uuid===r)return i;i=t(i.children);if(i)return i}return null}(t.children);if(n)return n}return null}}),Object.assign(rv.prototype,{yc:function(){},bc:function(){},BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(t,n){t[n]=this.node[this.propertyName]},function(t,n){for(var e=this.resolvedProperty,i=0,r=e.length;i!==r;++i)t[n++]=e[i]},function(t,n){t[n]=this.resolvedProperty[this.propertyIndex]},function(t,n){this.resolvedProperty.toArray(t,n)}],SetterByBindingTypeAndVersioning:[[function(t,n){this.targetObject[this.propertyName]=t[n]},function(t,n){this.targetObject[this.propertyName]=t[n],this.targetObject.needsUpdate=!0},function(t,n){this.targetObject[this.propertyName]=t[n],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,n){for(var e=this.resolvedProperty,i=0,r=e.length;i!==r;++i)e[i]=t[n++]},function(t,n){for(var e=this.resolvedProperty,i=0,r=e.length;i!==r;++i)e[i]=t[n++];this.targetObject.needsUpdate=!0},function(t,n){for(var e=this.resolvedProperty,i=0,r=e.length;i!==r;++i)e[i]=t[n++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,n){this.resolvedProperty[this.propertyIndex]=t[n]},function(t,n){this.resolvedProperty[this.propertyIndex]=t[n],this.targetObject.needsUpdate=!0},function(t,n){this.resolvedProperty[this.propertyIndex]=t[n],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,n){this.resolvedProperty.fromArray(t,n)},function(t,n){this.resolvedProperty.fromArray(t,n),this.targetObject.needsUpdate=!0},function(t,n){this.resolvedProperty.fromArray(t,n),this.targetObject.matrixWorldNeedsUpdate=!0}]],getValue:function(t,n){this.bind(),this.getValue(t,n)},setValue:function(t,n){this.bind(),this.setValue(t,n)},bind:function(){var t=this.node,n=this.parsedPath,e=n.objectName,i=n.propertyName,r=n.propertyIndex;if(t||(t=rv.findNode(this.rootNode,n.nodeName)||this.rootNode,this.node=t),this.getValue=this.yc,this.setValue=this.bc,t){if(e){var o=n.objectIndex;switch(e){case"materials":if(!t.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);t=t.material.materials;break;case"bones":if(!t.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);for(var t=t.skeleton.bones,s=0;s<t.length;s++)if(t[s].name===o){o=s;break}break;default:if(void 0===t[e])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);t=t[e]}if(void 0!==o){if(void 0===t[o])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);t=t[o]}}var a=t[i];if(void 0===a)n=n.nodeName,console.error("THREE.PropertyBinding: Trying to update property for track: "+n+"."+i+" but it wasn't found.",t);else{var n=this.Versioning.None,u=(void 0!==(this.targetObject=t).needsUpdate?n=this.Versioning.NeedsUpdate:void 0!==t.matrixWorldNeedsUpdate&&(n=this.Versioning.MatrixWorldNeedsUpdate),this.BindingType.Direct);if(void 0!==r){if("morphTargetInfluences"===i){if(!t.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(t.geometry.isBufferGeometry){if(!t.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);for(s=0;s<this.node.geometry.morphAttributes.position.length;s++)if(t.geometry.morphAttributes.position[s].name===r){r=s;break}}else{if(!t.geometry.morphTargets)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphTargets.",this);for(s=0;s<this.node.geometry.morphTargets.length;s++)if(t.geometry.morphTargets[s].name===r){r=s;break}}}u=this.BindingType.ArrayElement,this.resolvedProperty=a,this.propertyIndex=r}else void 0!==a.fromArray&&void 0!==a.toArray?(u=this.BindingType.HasFromToArray,this.resolvedProperty=a):Array.isArray(a)?(u=this.BindingType.EntireArray,this.resolvedProperty=a):this.propertyName=i;this.getValue=this.GetterByBindingType[u],this.setValue=this.SetterByBindingTypeAndVersioning[u][n]}}else console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.")},unbind:function(){this.node=null,this.getValue=this.gc,this.setValue=this._c}}),Object.assign(rv.prototype,{gc:rv.prototype.getValue,_c:rv.prototype.setValue});var d,ov,sv,av,uv,cv,hv,fv,lv,dv,vv,pv,mv,yv,bv,gv,_v,wv,xv,Ev,Sv,Tv,Av,Mv=new At,Ov=new At;function Lv(t,n){if(this.bones=(t=t||[]).slice(0),this.boneMatrices=new Float32Array(16*this.bones.length),this.frame=-1,void 0===n)this.calculateInverses();else if(this.bones.length===n.length)this.boneInverses=n.slice(0);else{console.warn("THREE.Skeleton boneInverses is the wrong length."),this.boneInverses=[];for(var e=0,i=this.bones.length;e<i;e++)this.boneInverses.push(new At)}}function Rv(t){return(Rv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Nv(t){od.call(this,t),this.dracoLoader=null,this.ddsLoader=null}function Pv(){var e={};return{get:function(t){return e[t]},add:function(t,n){e[t]=n},remove:function(t){delete e[t]},removeAll:function(){e={}}}}function Fv(t){if(!t)throw new Error("THREE.GLTFLoader: Attempting to load .dds texture without importing DDSLoader");this.name=d.MSFT_TEXTURE_DDS,this.ddsLoader=t}function jv(t){this.name=d.KHR_LIGHTS_PUNCTUAL;t=t.extensions&&t.extensions[d.KHR_LIGHTS_PUNCTUAL]||{};this.lightDefs=t.lights||[]}function Iv(){this.name=d.KHR_MATERIALS_UNLIT}function Cv(){this.name=d.KHR_MATERIALS_CLEARCOAT}function Dv(t){this.name=d.KHR_BINARY_GLTF,this.content=null,this.body=null;var n=new DataView(t,0,sv);if(this.header={magic:U0(new Uint8Array(t.slice(0,4))),version:n.getUint32(4,!0),length:n.getUint32(8,!0)},this.header.magic!==ov)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");for(var e=new DataView(t,sv),i=0;i<e.byteLength;){var r,o=e.getUint32(i,!0),s=(i+=4,e.getUint32(i,!0));i+=4,s===av.JSON?(r=new Uint8Array(t,sv+i,o),this.content=U0(r)):s===av.BIN&&(this.body=t.slice(r=sv+i,r+o)),i+=o}if(null===this.content)throw new Error("THREE.GLTFLoader: JSON content not found.")}function kv(t,n){if(!n)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=d.KHR_DRACO_MESH_COMPRESSION,this.json=t,this.dracoLoader=n,this.dracoLoader.preload()}function Uv(){this.name=d.KHR_TEXTURE_TRANSFORM}function Bv(t){W0.call(this),this.isGLTFSpecularGlossinessMaterial=!0;["#ifdef USE_SPECULARMAP","\tuniform sampler2D specularMap;","#endif"].join("\n");var e=["#ifdef USE_GLOSSINESSMAP","\tuniform sampler2D glossinessMap;","#endif"].join("\n"),i=["vec3 specularFactor = specular;","#ifdef USE_SPECULARMAP","\tvec4 texelSpecular = texture2D( specularMap, vUv );","\ttexelSpecular = sRGBToLinear( texelSpecular );","\t// reads channel RGB, compatible with a glTF Specular-Glossiness (RGBA) texture","\tspecularFactor *= texelSpecular.rgb;","#endif"].join("\n"),r=["float glossinessFactor = glossiness;","#ifdef USE_GLOSSINESSMAP","\tvec4 texelGlossiness = texture2D( glossinessMap, vUv );","\t// reads channel A, compatible with a glTF Specular-Glossiness (RGBA) texture","\tglossinessFactor *= texelGlossiness.a;","#endif"].join("\n"),o=["PhysicalMaterial material;","material.diffuseColor = diffuseColor.rgb;","vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );","float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );","material.specularRoughness = max( 1.0 - glossinessFactor, 0.0525 );// 0.0525 corresponds to the base mip of a 256 cubemap.","material.specularRoughness += geometryRoughness;","material.specularRoughness = min( material.specularRoughness, 1.0 );","material.specularColor = specularFactor.rgb;"].join("\n"),s={specular:{value:(new lt).setHex(16777215)},glossiness:{value:1},specularMap:{value:null},glossinessMap:{value:null}};this.wc=s,this.onBeforeCompile=function(t){for(var n in s)t.uniforms[n]=s[n];t.fragmentShader=t.fragmentShader.replace("uniform float roughness;","uniform vec3 specular;"),t.fragmentShader=t.fragmentShader.replace("uniform float metalness;","uniform float glossiness;"),t.fragmentShader=t.fragmentShader.replace("#include <metalnessmap_pars_fragment>",e),t.fragmentShader=t.fragmentShader.replace("#include <roughnessmap_fragment>",i),t.fragmentShader=t.fragmentShader.replace("#include <metalnessmap_fragment>",r),t.fragmentShader=t.fragmentShader.replace("#include <lights_physical_fragment>",o)},Object.defineProperties(this,{specular:{get:function(){return s.specular.value},set:function(t){s.specular.value=t}},specularMap:{get:function(){return s.specularMap.value},set:function(t){s.specularMap.value=t}},glossiness:{get:function(){return s.glossiness.value},set:function(t){s.glossiness.value=t}},glossinessMap:{get:function(){return s.glossinessMap.value},set:function(t){(s.glossinessMap.value=t)?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_ROUGHNESSMAP=""):(delete this.defines.USE_ROUGHNESSMAP,delete this.defines.USE_GLOSSINESSMAP)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(t)}function Gv(){return{name:d.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,specularGlossinessParams:["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"],getMaterialType:function(){return Bv},extendParams:function(t,n,e){var i,n=n.extensions[this.name],r=(t.color=new lt(1,1,1),t.opacity=1,[]);return Array.isArray(n.diffuseFactor)&&(i=n.diffuseFactor,t.color.fromArray(i),t.opacity=i[3]),void 0!==n.diffuseTexture&&r.push(e.assignTexture(t,"map",n.diffuseTexture)),t.emissive=new lt(0,0,0),t.glossiness=void 0!==n.glossinessFactor?n.glossinessFactor:1,t.specular=new lt(1,1,1),Array.isArray(n.specularFactor)&&t.specular.fromArray(n.specularFactor),void 0!==n.specularGlossinessTexture&&(i=n.specularGlossinessTexture,r.push(e.assignTexture(t,"glossinessMap",i)),r.push(e.assignTexture(t,"specularMap",i))),Promise.all(r)},createMaterial:function(t){var n=new Bv(t);return n.fog=!0,n.color=t.color,n.map=void 0===t.map?null:t.map,n.lightMap=null,n.lightMapIntensity=1,n.aoMap=void 0===t.aoMap?null:t.aoMap,n.aoMapIntensity=1,n.emissive=t.emissive,n.emissiveIntensity=1,n.emissiveMap=void 0===t.emissiveMap?null:t.emissiveMap,n.bumpMap=void 0===t.bumpMap?null:t.bumpMap,n.bumpScale=1,n.normalMap=void 0===t.normalMap?null:t.normalMap,n.normalMapType=pi,t.normalScale&&(n.normalScale=t.normalScale),n.displacementMap=null,n.displacementScale=1,n.displacementBias=0,n.specularMap=void 0===t.specularMap?null:t.specularMap,n.specular=t.specular,n.glossinessMap=void 0===t.glossinessMap?null:t.glossinessMap,n.glossiness=t.glossiness,n.alphaMap=null,n.envMap=void 0===t.envMap?null:t.envMap,n.envMapIntensity=1,n.refractionRatio=.98,n}}}function Hv(){this.name=d.KHR_MESH_QUANTIZATION}function Xv(t,n,e,i){cd.call(this,t,n,e,i)}function Vv(t,n){return"string"!=typeof t||""===t?"":(/^https?:\/\//i.test(n)&&/^\//.test(t)&&(n=n.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(t)||st.a.environment==B.a.WX&&st.a.WX_USER_DATA_PATH.test(t)||/^data:.*,.*$/i.test(t)||/^blob:.*$/i.test(t)?t:n+t)}function zv(t,n,e){for(var i in e.extensions)void 0===t[i]&&(n.userData.gltfExtensions=n.userData.gltfExtensions||{},n.userData.gltfExtensions[i]=e.extensions[i])}function Wv(t,n){void 0!==n.extras&&("object"===Rv(n.extras)?Object.assign(t.userData,n.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+n.extras))}function Yv(t){for(var n="",e=Object.keys(t).sort(),i=0,r=e.length;i<r;i++)n+=e[i]+":"+t[e[i]]+";";return n}function Qv(t,n,e){this.json=t||{},this.extensions=n||{},this.options=e||{},this.cache=new Pv,this.primitiveCache={},this.textureLoader=new X0(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.fileLoader=new ad(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}function Zv(f,l,d){var t,n=l.attributes,e=[];for(t in n){var i=gv[t]||t.toLowerCase();i in f.attributes||e.push(function(t,n){return d.getDependency("accessor",t).then(function(t){f.setAttribute(n,t)})}(n[t],i))}void 0===l.indices||f.index||(r=d.getDependency("accessor",l.indices).then(function(t){f.setIndex(t)}),e.push(r)),Wv(f,l);var r=f,o=l,s=d,a=o.attributes,u=new jt;if(void 0!==a.POSITION){var c=(g=s.json.accessors[a.POSITION]).min,h=g.max;if(void 0===c||void 0===h)console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");else{u.set(new Tt(c[0],c[1],c[2]),new Tt(h[0],h[1],h[2]));var v=o.targets;if(void 0!==v){for(var p=new Tt,m=new Tt,y=0,b=v.length;y<b;y++){var g,_=v[y];void 0!==_.POSITION&&(c=(g=s.json.accessors[_.POSITION]).min,h=g.max,void 0!==c&&void 0!==h?(m.setX(Math.max(Math.abs(c[0]),Math.abs(h[0]))),m.setY(Math.max(Math.abs(c[1]),Math.abs(h[1]))),m.setZ(Math.max(Math.abs(c[2]),Math.abs(h[2]))),p.max(m)):console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION."))}u.expandByVector(p)}r.boundingBox=u;a=new Dt;u.getCenter(a.center),a.radius=u.min.distanceTo(u.max)/2,r.boundingSphere=a}}return Promise.all(e).then(function(){if(void 0===l.targets)return f;for(var e=f,t=l.targets,n=d,i=!1,r=!1,o=0,s=t.length;o<s&&(void 0!==(h=t[o]).POSITION&&(i=!0),void 0!==h.NORMAL&&(r=!0),!i||!r);o++);if(!i&&!r)return Promise.resolve(e);for(var a=[],u=[],o=0,s=t.length;o<s;o++){var c,h=t[o];i&&(c=void 0!==h.POSITION?n.getDependency("accessor",h.POSITION):e.attributes.position,a.push(c)),r&&(c=void 0!==h.NORMAL?n.getDependency("accessor",h.NORMAL):e.attributes.normal,u.push(c))}return Promise.all([Promise.all(a),Promise.all(u)]).then(function(t){var n=t[0],t=t[1];return i&&(e.morphAttributes.position=n),r&&(e.morphAttributes.normal=t),e.morphTargetsRelative=!0,e})})}function qv(t,n){var e=t.getIndex();if(null===e){var i=[],r=t.getAttribute("position");if(void 0===r)return console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),t;for(var o=0;o<r.count;o++)i.push(o);t.setIndex(i),e=t.getIndex()}var s=e.count-2,a=[];if(2===n)for(o=1;o<=s;o++)a.push(e.getX(0)),a.push(e.getX(o)),a.push(e.getX(o+1));else for(o=0;o<s;o++)o%2==0?(a.push(e.getX(o)),a.push(e.getX(o+1)),a.push(e.getX(o+2))):(a.push(e.getX(o+2)),a.push(e.getX(o+1)),a.push(e.getX(o)));a.length/3!=s&&console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");n=t.clone();return n.setIndex(a),n}Object.assign(Lv.prototype,{calculateInverses:function(){this.boneInverses=[];for(var t=0,n=this.bones.length;t<n;t++){var e=new At;this.bones[t]&&e.getInverse(this.bones[t].matrixWorld),this.boneInverses.push(e)}},pose:function(){for(var t,n=0,e=this.bones.length;n<e;n++)(t=this.bones[n])&&t.matrixWorld.getInverse(this.boneInverses[n]);for(n=0,e=this.bones.length;n<e;n++)(t=this.bones[n])&&(t.parent&&t.parent.isBone?(t.matrix.getInverse(t.parent.matrixWorld),t.matrix.multiply(t.matrixWorld)):t.matrix.copy(t.matrixWorld),t.matrix.decompose(t.position,t.quaternion,t.scale))},update:function(){for(var t=this.bones,n=this.boneInverses,e=this.boneMatrices,i=this.boneTexture,r=0,o=t.length;r<o;r++){var s=t[r]?t[r].matrixWorld:Ov;Mv.multiplyMatrices(s,n[r]),Mv.toArray(e,16*r)}void 0!==i&&(i.needsUpdate=!0)},clone:function(){return new Lv(this.bones,this.boneInverses)},getBoneByName:function(t){for(var n=0,e=this.bones.length;n<e;n++){var i=this.bones[n];if(i.name===t)return i}},dispose:function(){this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=void 0)}}),Nv.prototype=Object.assign(Object.create(od.prototype),{constructor:Nv,load:function(e,i,t,n){function r(t){n?n(t):console.error(t),o.manager.itemError(e),o.manager.itemEnd(e)}var o=this,s=""!==this.resourcePath?this.resourcePath:""!==this.path?this.path:B0(e),a=(o.manager.itemStart(e),new ad(o.manager));a.setPath(this.path),a.setResponseType("arraybuffer"),"use-credentials"===o.crossOrigin&&a.setWithCredentials(!0),a.load(e,function(n){try{o.parse(n,s,function(t){i(t,n),o.manager.itemEnd(e)},r)}catch(t){r(t)}},t,r)},setDRACOLoader:function(t){return this.dracoLoader=t,this},setDDSLoader:function(t){return this.ddsLoader=t,this},parse:function(t,n,e,i){var r,o={};if("string"==typeof t)r=t;else if(U0(new Uint8Array(t,0,4))===ov){try{o[d.KHR_BINARY_GLTF]=new Dv(t)}catch(t){return void(i&&i(t))}r=o[d.KHR_BINARY_GLTF].content}else r=U0(new Uint8Array(t));var s=JSON.parse(r);if(void 0===s.asset||s.asset.version[0]<2)i&&i(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));else{if(s.extensionsUsed)for(var a=0;a<s.extensionsUsed.length;++a){var u=s.extensionsUsed[a],c=s.extensionsRequired||[];switch(u){case d.KHR_LIGHTS_PUNCTUAL:o[u]=new jv(s);break;case d.KHR_MATERIALS_CLEARCOAT:o[u]=new Cv;break;case d.KHR_MATERIALS_UNLIT:o[u]=new Iv;break;case d.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:o[u]=new Gv;break;case d.KHR_DRACO_MESH_COMPRESSION:o[u]=new kv(s,this.dracoLoader);break;case d.MSFT_TEXTURE_DDS:o[u]=new Fv(this.ddsLoader);break;case d.KHR_TEXTURE_TRANSFORM:o[u]=new Uv;break;case d.KHR_MESH_QUANTIZATION:o[u]=new Hv;break;default:0<=c.indexOf(u)&&console.warn('THREE.GLTFLoader: Unknown extension "'+u+'".')}}new Qv(s,o,{path:n||this.resourcePath||"",crossOrigin:this.crossOrigin,manager:this.manager}).parse(e,i)}}}),d={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",MSFT_TEXTURE_DDS:"MSFT_texture_dds"},jv.prototype.loadLight=function(t){var n,e=this.lightDefs[t],i=new lt(16777215),r=(void 0!==e.color&&i.fromArray(e.color),void 0!==e.range?e.range:0);switch(e.type){case"directional":(n=new Od(i)).target.position.set(0,0,-1),n.add(n.target);break;case"point":(n=new Rd(i)).distance=r;break;case"spot":(n=new Pd(i)).distance=r,e.spot=e.spot||{},e.spot.innerConeAngle=void 0!==e.spot.innerConeAngle?e.spot.innerConeAngle:0,e.spot.outerConeAngle=void 0!==e.spot.outerConeAngle?e.spot.outerConeAngle:Math.PI/4,n.angle=e.spot.outerConeAngle,n.penumbra=1-e.spot.innerConeAngle/e.spot.outerConeAngle,n.target.position.set(0,0,-1),n.add(n.target);break;default:throw new Error('THREE.GLTFLoader: Unexpected light type, "'+e.type+'".')}return n.position.set(0,0,0),n.decay=2,void 0!==e.intensity&&(n.intensity=e.intensity),n.name=e.name||"light_"+t,Promise.resolve(n)},Iv.prototype.getMaterialType=function(){return Ia},Iv.prototype.extendParams=function(t,n,e){var i,r=[],n=(t.color=new lt(1,1,1),t.opacity=1,n.pbrMetallicRoughness);return n&&(Array.isArray(n.baseColorFactor)&&(i=n.baseColorFactor,t.color.fromArray(i),t.opacity=i[3]),void 0!==n.baseColorTexture)&&r.push(e.assignTexture(t,"map",n.baseColorTexture)),Promise.all(r)},Cv.prototype.getMaterialType=function(){return Y0},Cv.prototype.extendParams=function(t,n,e){var i=[],n=n.extensions[this.name];return void 0!==n.clearcoatFactor&&(t.clearcoat=n.clearcoatFactor),void 0!==n.clearcoatTexture&&i.push(e.assignTexture(t,"clearcoatMap",n.clearcoatTexture)),void 0!==n.clearcoatRoughnessFactor&&(t.clearcoatRoughness=n.clearcoatRoughnessFactor),void 0!==n.clearcoatRoughnessTexture&&i.push(e.assignTexture(t,"clearcoatRoughnessMap",n.clearcoatRoughnessTexture)),void 0!==n.clearcoatNormalTexture&&(i.push(e.assignTexture(t,"clearcoatNormalMap",n.clearcoatNormalTexture)),void 0!==n.clearcoatNormalTexture.scale)&&(e=n.clearcoatNormalTexture.scale,t.clearcoatNormalScale=new Mt(e,e)),Promise.all(i)},ov="glTF",sv=12,av={JSON:1313821514,BIN:5130562},kv.prototype.decodePrimitive=function(t,n){var e,i=this.json,r=this.dracoLoader,o=t.extensions[this.name].bufferView,s=t.extensions[this.name].attributes,a={},u={},c={};for(e in s){var h=gv[e]||e.toLowerCase();a[h]=s[e]}for(e in t.attributes){var f,l,h=gv[e]||e.toLowerCase();void 0!==s[e]&&(f=i.accessors[t.attributes[e]],l=pv[f.componentType],c[h]=l,u[h]=!0===f.normalized)}return n.getDependency("bufferView",o).then(function(t){return new Promise(function(i){r.decodeDracoFile(t,function(t){for(var n in t.attributes){var e=t.attributes[n],n=u[n];void 0!==n&&(e.normalized=n)}i(t)},a,c)})})},Uv.prototype.extendTexture=function(t,n){return t=t.clone(),void 0!==n.offset&&t.offset.fromArray(n.offset),void 0!==n.rotation&&(t.rotation=n.rotation),void 0!==n.scale&&t.repeat.fromArray(n.scale),void 0!==n.texCoord&&console.warn('THREE.GLTFLoader: Custom UV sets in "'+this.name+'" extension not yet supported.'),t.needsUpdate=!0,t},((Bv.prototype=Object.create(W0.prototype)).constructor=Bv).prototype.copy=function(t){return W0.prototype.copy.call(this,t),this.specularMap=t.specularMap,this.specular.copy(t.specular),this.glossinessMap=t.glossinessMap,this.glossiness=t.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this},((Xv.prototype=Object.create(cd.prototype)).constructor=Xv).prototype.beforeStart_=Xv.prototype.copySampleValue_=function(t){for(var n=this.resultBuffer,e=this.sampleValues,i=this.valueSize,r=t*i*3+i,o=0;o!==i;o++)n[o]=e[r+o];return n},Xv.prototype.afterEnd_=Xv.prototype.copySampleValue_,Xv.prototype.interpolate_=function(t,n,e,i){for(var r=this.resultBuffer,o=this.sampleValues,s=this.valueSize,a=2*s,u=3*s,c=i-n,i=(e-n)/c,e=i*i,n=e*i,h=t*u,f=h-u,l=-2*n+3*e,d=n-e,v=1-l,p=d-e+i,m=0;m!==s;m++){var y=o[f+m+s],b=o[f+m+a]*c,g=o[h+m+s],_=o[h+m]*c;r[m]=v*y+p*b+l*g+d*_}return r},uv=0,cv=1,hv=2,fv=3,lv=4,dv=5,vv=6,pv={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},mv={9728:zn,9729:Qn,9984:Wn,9985:Zn,9986:Yn,9987:qn},yv={33071:Xn,33648:Vn,10497:Hn},bv={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},gv={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},_v={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},wv={CUBICSPLINE:void 0,LINEAR:ci,STEP:ui},xv="OPAQUE",Ev="MASK",Sv="BLEND",Tv={"image/png":fe,"image/jpeg":he},Qv.prototype.parse=function(n,t){var e=this,i=this.json,r=this.extensions;this.cache.removeAll(),this.markDefs(),Promise.all([this.getDependencies("scene"),this.getDependencies("animation"),this.getDependencies("camera")]).then(function(t){t={scene:t[0][i.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:i.asset,parser:e,userData:{}};zv(r,t,i),Wv(t,i),n(t)}).catch(t)},Qv.prototype.markDefs=function(){for(var t=this.json.nodes||[],n=this.json.skins||[],e=this.json.meshes||[],i={},r={},o=0,s=n.length;o<s;o++)for(var a=n[o].joints,u=0,c=a.length;u<c;u++)t[a[u]].isBone=!0;for(var h=0,f=t.length;h<f;h++){var l=t[h];void 0!==l.mesh&&(void 0===i[l.mesh]&&(i[l.mesh]=r[l.mesh]=0),i[l.mesh]++,void 0!==l.skin)&&(e[l.mesh].isSkinnedMesh=!0)}this.json.meshReferences=i,this.json.meshUses=r},Qv.prototype.getDependency=function(t,n){var e=t+":"+n,i=this.cache.get(e);if(!i){switch(t){case"scene":i=this.loadScene(n);break;case"node":i=this.loadNode(n);break;case"mesh":i=this.loadMesh(n);break;case"accessor":i=this.loadAccessor(n);break;case"bufferView":i=this.loadBufferView(n);break;case"buffer":i=this.loadBuffer(n);break;case"material":i=this.loadMaterial(n);break;case"texture":i=this.loadTexture(n);break;case"skin":i=this.loadSkin(n);break;case"animation":i=this.loadAnimation(n);break;case"camera":i=this.loadCamera(n);break;case"light":i=this.extensions[d.KHR_LIGHTS_PUNCTUAL].loadLight(n);break;default:throw new Error("Unknown type: "+t)}this.cache.add(e,i)}return i},Qv.prototype.getDependencies=function(e){var i,t,n=this.cache.get(e);return n||(t=(i=this).json[e+("mesh"===e?"es":"s")]||[],n=Promise.all(t.map(function(t,n){return i.getDependency(e,n)})),this.cache.add(e,n)),n},Qv.prototype.loadBuffer=function(t){var e,i=this.json.buffers[t],r=this.fileLoader;if(i.type&&"arraybuffer"!==i.type)throw new Error("THREE.GLTFLoader: "+i.type+" buffer type is not supported.");return void 0===i.uri&&0===t?Promise.resolve(this.extensions[d.KHR_BINARY_GLTF].body):(e=this.options,new Promise(function(t,n){r.load(Vv(i.uri,e.path),t,void 0,function(){n(new Error('THREE.GLTFLoader: Failed to load buffer "'+i.uri+'".'))})}))},Qv.prototype.loadBufferView=function(t){var i=this.json.bufferViews[t];return this.getDependency("buffer",i.buffer).then(function(t){var n=i.byteLength||0,e=i.byteOffset||0;return t.slice(e,e+n)})},Qv.prototype.loadAccessor=function(t){var y=this,b=this.json,g=this.json.accessors[t];return void 0===g.bufferView&&void 0===g.sparse?Promise.resolve(null):(t=[],void 0!==g.bufferView?t.push(this.getDependency("bufferView",g.bufferView)):t.push(null),void 0!==g.sparse&&(t.push(this.getDependency("bufferView",g.sparse.indices.bufferView)),t.push(this.getDependency("bufferView",g.sparse.values.bufferView))),Promise.all(t).then(function(t){var n=t[0],e=bv[g.type],i=pv[g.componentType],r=i.BYTES_PER_ELEMENT,o=g.byteOffset||0,s=void 0!==g.bufferView?b.bufferViews[g.bufferView].byteStride:void 0,a=!0===g.normalized,u=s&&s!==r*e?(c=Math.floor(o/s),h="InterleavedBuffer:"+g.bufferView+":"+g.componentType+":"+c+":"+g.count,(f=y.cache.get(h))||(f=new lh(new i(n,c*s,g.count*s/r),s/r),y.cache.add(h,f)),new vh(f,e,o%s/r,a)):new R(null===n?new i(g.count*e):new i(n,o,g.count*e),e,a);if(void 0!==g.sparse){var c=pv[g.sparse.indices.componentType],h=g.sparse.indices.byteOffset||0,f=g.sparse.values.byteOffset||0,l=new c(t[1],h,g.sparse.count*bv.SCALAR),d=new i(t[2],f,g.sparse.count*e);null!==n&&(u=new R(u.array.slice(),u.itemSize,u.normalized));for(var v=0,p=l.length;v<p;v++){var m=l[v];if(u.setX(m,d[v*e]),2<=e&&u.setY(m,d[v*e+1]),3<=e&&u.setZ(m,d[v*e+2]),4<=e&&u.setW(m,d[v*e+3]),5<=e)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return u}))},Av=0,Qv.prototype.loadTexture=function(t){var e,n=this,i=this.json,r=this.options,o=this.textureLoader,s=(st.a.environment===B.a.BROWSER&&(e=self.URL||self.webkitURL),i.textures[t]),a=s.extensions||{},u=a[d.MSFT_TEXTURE_DDS]?i.images[a[d.MSFT_TEXTURE_DDS].source]:i.images[s.source],c=u.uri,h=!1;return void 0!==u.bufferView&&(c=n.getDependency("bufferView",u.bufferView).then(function(t){var n,r;return st.a.environment===B.a.BROWSER?(h=!0,n=new Blob([t],{type:u.mimeType}),c=e.createObjectURL(n)):(r=wx.getFileSystemManager(),new Promise(function(n,e){var i=wx.env.USER_DATA_PATH+"/"+Av+".png";Av++,r.writeFile({filePath:i,data:t,encoding:"binary",success:function(t){n(i)},fail:function(t){console.error("失败******",i,t),e(i)}})}))})),Promise.resolve(c).then(function(e){var i=(i=r.manager.getHandler(e))||(a[d.MSFT_TEXTURE_DDS]?n.extensions[d.MSFT_TEXTURE_DDS].ddsLoader:o);return new Promise(function(t,n){i.load(Vv(e,r.path),t,void 0,n)})}).then(function(t){!0===h&&e.revokeObjectURL(c),t.flipY=!1,s.name&&(t.name=s.name),u.mimeType in Tv&&(t.format=Tv[u.mimeType]);var n=(i.samplers||{})[s.sampler]||{};return t.magFilter=mv[n.magFilter]||Qn,t.minFilter=mv[n.minFilter]||qn,t.wrapS=yv[n.wrapS]||Hn,t.wrapT=yv[n.wrapT]||Hn,t})},Qv.prototype.assignTexture=function(e,i,r){var o=this;return this.getDependency("texture",r.index).then(function(t){if(!t.isCompressedTexture)switch(i){case"aoMap":case"emissiveMap":case"metalnessMap":case"normalMap":case"roughnessMap":t.format=he}var n;void 0===r.texCoord||0==r.texCoord||"aoMap"===i&&1==r.texCoord||console.warn("THREE.GLTFLoader: Custom UV set "+r.texCoord+" for texture "+i+" not yet supported."),o.extensions[d.KHR_TEXTURE_TRANSFORM]&&(n=void 0!==r.extensions?r.extensions[d.KHR_TEXTURE_TRANSFORM]:void 0)&&(t=o.extensions[d.KHR_TEXTURE_TRANSFORM].extendTexture(t,n)),e[i]=t})},Qv.prototype.assignFinalMaterial=function(t){var n,e,i=t.geometry,r=t.material,o=void 0!==i.attributes.tangent,s=void 0!==i.attributes.color,a=void 0===i.attributes.normal,u=!0===t.isSkinnedMesh,c=0<Object.keys(i.morphAttributes).length,h=c&&void 0!==i.morphAttributes.normal;t.isPoints?(n="PointsMaterial:"+r.uuid,(e=this.cache.get(n))||(e=new z0,f.prototype.copy.call(e,r),e.color.copy(r.color),e.map=r.map,e.sizeAttenuation=!1,this.cache.add(n,e)),r=e):t.isLine&&(n="LineBasicMaterial:"+r.uuid,(e=this.cache.get(n))||(e=new Bl,f.prototype.copy.call(e,r),e.color.copy(r.color),this.cache.add(n,e)),r=e),(o||s||a||u||c)&&(n="ClonedMaterial:"+r.uuid+":",r.isGLTFSpecularGlossinessMaterial&&(n+="specular-glossiness:"),u&&(n+="skinning:"),o&&(n+="vertex-tangents:"),s&&(n+="vertex-colors:"),a&&(n+="flat-shading:"),c&&(n+="morph-targets:"),h&&(n+="morph-normals:"),(e=this.cache.get(n))||(e=r.clone(),u&&(e.skinning=!0),o&&(e.vertexTangents=!0),s&&(e.vertexColors=!0),a&&(e.flatShading=!0),c&&(e.morphTargets=!0),h&&(e.morphNormals=!0),this.cache.add(n,e)),r=e),r.aoMap&&void 0===i.attributes.uv2&&void 0!==i.attributes.uv&&i.setAttribute("uv2",new R(i.attributes.uv.array,2)),r.normalScale&&!o&&(r.normalScale.y=-r.normalScale.y),r.clearcoatNormalScale&&!o&&(r.clearcoatNormalScale.y=-r.clearcoatNormalScale.y),t.material=r},Qv.prototype.loadMaterial=function(t){var n,e,i=this.json,r=this.extensions,o=i.materials[t],s={},i=o.extensions||{},t=[],a=(i[d.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]?(e=r[d.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS],n=e.getMaterialType(),t.push(e.extendParams(s,o,this))):i[d.KHR_MATERIALS_UNLIT]?(e=r[d.KHR_MATERIALS_UNLIT],n=e.getMaterialType(),t.push(e.extendParams(s,o,this))):(n=W0,e=o.pbrMetallicRoughness||{},s.color=new lt(1,1,1),s.opacity=1,Array.isArray(e.baseColorFactor)&&(a=e.baseColorFactor,s.color.fromArray(a),s.opacity=a[3]),void 0!==e.baseColorTexture&&t.push(this.assignTexture(s,"map",e.baseColorTexture)),s.metalness=void 0!==e.metallicFactor?e.metallicFactor:1,s.roughness=void 0!==e.roughnessFactor?e.roughnessFactor:1,void 0!==e.metallicRoughnessTexture&&(t.push(this.assignTexture(s,"metalnessMap",e.metallicRoughnessTexture)),t.push(this.assignTexture(s,"roughnessMap",e.metallicRoughnessTexture)))),!0===o.doubleSided&&(s.side=an),o.alphaMode||xv);return a===Sv?(s.transparent=!0,s.depthWrite=!1):(s.transparent=!1,a===Ev&&(s.alphaTest=void 0!==o.alphaCutoff?o.alphaCutoff:.5)),void 0!==o.normalTexture&&n!==Ia&&(t.push(this.assignTexture(s,"normalMap",o.normalTexture)),s.normalScale=new Mt(1,1),void 0!==o.normalTexture.scale)&&s.normalScale.set(o.normalTexture.scale,o.normalTexture.scale),void 0!==o.occlusionTexture&&n!==Ia&&(t.push(this.assignTexture(s,"aoMap",o.occlusionTexture)),void 0!==o.occlusionTexture.strength)&&(s.aoMapIntensity=o.occlusionTexture.strength),void 0!==o.emissiveFactor&&n!==Ia&&(s.emissive=(new lt).fromArray(o.emissiveFactor)),void 0!==o.emissiveTexture&&n!==Ia&&t.push(this.assignTexture(s,"emissiveMap",o.emissiveTexture)),i[d.KHR_MATERIALS_CLEARCOAT]&&(e=r[d.KHR_MATERIALS_CLEARCOAT],n=e.getMaterialType(),t.push(e.extendParams(s,{extensions:i},this))),Promise.all(t).then(function(){var t=n===Bv?r[d.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(s):new n(s);return o.name&&(t.name=o.name),t.map&&(t.map.encoding=3001),t.emissiveMap&&(t.emissiveMap.encoding=3001),Wv(t,o),o.extensions&&zv(r,t,o),t})},Qv.prototype.loadGeometries=function(t){var e=this,i=this.extensions,n=this.primitiveCache;for(var r=[],o=0,s=t.length;o<s;o++){var a=t[o],u=(c=void 0,c=(c=(u=a).extensions&&u.extensions[d.KHR_DRACO_MESH_COMPRESSION])?"draco:"+c.bufferView+":"+c.indices+":"+Yv(c.attributes):u.indices+":"+Yv(u.attributes)+":"+u.mode),c=n[u];c?r.push(c.promise):(c=a.extensions&&a.extensions[d.KHR_DRACO_MESH_COMPRESSION]?function(n){return i[d.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(n,e).then(function(t){return Zv(t,n,e)})}(a):Zv(new ra,a,e),n[u]={primitive:a,promise:c},r.push(c))}return Promise.all(r)},Qv.prototype.loadMesh=function(m){for(var y=this,b=this.json.meshes[m],g=b.primitives,t=[],n=0,e=g.length;n<e;n++){var i=void 0===g[n].material?(void 0===(i=this.cache).DefaultMaterial&&(i.DefaultMaterial=new W0({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:on})),i.DefaultMaterial):this.getDependency("material",g[n].material);t.push(i)}return t.push(y.loadGeometries(g)),Promise.all(t).then(function(t){for(var n=t.slice(0,t.length-1),e=t[t.length-1],i=[],r=0,o=e.length;r<o;r++){var s,a=e[r],u=g[r],c=n[r];if(u.mode===lv||u.mode===dv||u.mode===vv||void 0===u.mode)!0!==(s=new(!0===b.isSkinnedMesh?Fd:$a)(a,c)).isSkinnedMesh||s.geometry.attributes.skinWeight.normalized||s.normalizeSkinWeights(),u.mode===dv?s.geometry=qv(s.geometry,1):u.mode===vv&&(s.geometry=qv(s.geometry,2));else if(u.mode===cv)s=new Hd(a,c);else if(u.mode===fv)s=new Ud(a,c);else if(u.mode===hv)s=new Xd(a,c);else{if(u.mode!==uv)throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+u.mode);s=new Qd(a,c)}if(0<Object.keys(s.geometry.morphAttributes).length){v=d=l=f=h=void 0;var h=s,f=b;if(h.updateMorphTargets(),void 0!==f.weights)for(var l=0,d=f.weights.length;l<d;l++)h.morphTargetInfluences[l]=f.weights[l];if(f.extras&&Array.isArray(f.extras.targetNames)){var v=f.extras.targetNames;if(h.morphTargetInfluences.length===v.length){h.morphTargetDictionary={};for(l=0,d=v.length;l<d;l++)h.morphTargetDictionary[v[l]]=l}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}s.name=b.name||"mesh_"+m,1<e.length&&(s.name+="_"+r),Wv(s,b),y.assignFinalMaterial(s),i.push(s)}if(1===i.length)return i[0];for(var p=new nh,r=0,o=i.length;r<o;r++)p.add(i[r]);return p})},Qv.prototype.loadCamera=function(t){var n,t=this.json.cameras[t],e=t[t.type];if(e)return"perspective"===t.type?n=new dt(St.radToDeg(e.yfov),e.aspectRatio||1,e.znear||1,e.zfar||2e6):"orthographic"===t.type&&(n=new vt(e.xmag/-2,e.xmag/2,e.ymag/2,e.ymag/-2,e.znear,e.zfar)),t.name&&(n.name=t.name),Wv(n,t),Promise.resolve(n);console.warn("THREE.GLTFLoader: Missing camera parameters.")},Qv.prototype.loadSkin=function(t){var t=this.json.skins[t],n={joints:t.joints};return void 0===t.inverseBindMatrices?Promise.resolve(n):this.getDependency("accessor",t.inverseBindMatrices).then(function(t){return n.inverseBindMatrices=t,n})},Qv.prototype.loadAnimation=function(S){for(var T=this.json.animations[S],t=[],n=[],e=[],i=[],r=[],o=0,s=T.channels.length;o<s;o++){var a=T.channels[o],u=T.samplers[a.sampler],a=a.target,c=void 0!==a.node?a.node:a.id,h=void 0!==T.parameters?T.parameters[u.input]:u.input,f=void 0!==T.parameters?T.parameters[u.output]:u.output;t.push(this.getDependency("node",c)),n.push(this.getDependency("accessor",h)),e.push(this.getDependency("accessor",f)),i.push(u),r.push(a)}return Promise.all([Promise.all(t),Promise.all(n),Promise.all(e),Promise.all(i),Promise.all(r)]).then(function(t){for(var n=t[0],e=t[1],i=t[2],r=t[3],o=t[4],s=[],a=0,u=n.length;a<u;a++){var c,h=n[a],f=e[a],l=i[a],d=r[a],v=o[a];if(void 0!==h){switch(h.updateMatrix(),h.matrixAutoUpdate=!0,_v[v.path]){case _v.weights:c=md;break;case _v.rotation:c=bd;break;default:c=_d}var p,m=h.name||h.uuid,y=void 0!==d.interpolation?wv[d.interpolation]:ci,b=[],g=(_v[v.path]===_v.weights?h.traverse(function(t){!0===t.isMesh&&t.morphTargetInfluences&&b.push(t.name||t.uuid)}):b.push(m),l.array);if(l.normalized){if(g.constructor===Int8Array)p=1/127;else if(g.constructor===Uint8Array)p=1/255;else if(g.constructor==Int16Array)p=1/32767;else{if(g.constructor!==Uint16Array)throw new Error("THREE.GLTFLoader: Unsupported output accessor component type.");p=1/65535}for(var _=new Float32Array(g.length),w=0,x=g.length;w<x;w++)_[w]=g[w]*p;g=_}for(w=0,x=b.length;w<x;w++){var E=new c(b[w]+"."+_v[v.path],f.array,g,y);"CUBICSPLINE"===d.interpolation&&(E.createInterpolant=function(t){return new Xv(this.times,this.values,this.getValueSize()/3,t)},E.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0),s.push(E)}}}return new wd(T.name||"animation_"+S,void 0,s)})},Qv.prototype.loadNode=function(t){var n=this.json,o=this.extensions,e=this,i=n.meshReferences,r=n.meshUses,s=n.nodes[t];return n=[],void 0!==s.mesh&&n.push(e.getDependency("mesh",s.mesh).then(function(t){var n,e;return 1<i[s.mesh]?(n=r[s.mesh]++,(e=t.clone()).name+="_instance_"+n):e=t,void 0!==s.weights&&e.traverse(function(t){if(t.isMesh)for(var n=0,e=s.weights.length;n<e;n++)t.morphTargetInfluences[n]=s.weights[n]}),e})),void 0!==s.camera&&n.push(e.getDependency("camera",s.camera)),s.extensions&&s.extensions[d.KHR_LIGHTS_PUNCTUAL]&&void 0!==s.extensions[d.KHR_LIGHTS_PUNCTUAL].light&&n.push(e.getDependency("light",s.extensions[d.KHR_LIGHTS_PUNCTUAL].light)),Promise.all(n).then(function(t){var n,e=!0===s.isBone?new qd:1<t.length?new nh:1===t.length?t[0]:new a;if(e!==t[0])for(var i=0,r=t.length;i<r;i++)e.add(t[i]);return s.name&&(e.userData.name=s.name,e.name=rv.sanitizeNodeName(s.name)),Wv(e,s),s.extensions&&zv(o,e,s),void 0!==s.matrix?((n=new At).fromArray(s.matrix),e.applyMatrix4(n)):(void 0!==s.translation&&e.position.fromArray(s.translation),void 0!==s.rotation&&e.quaternion.fromArray(s.rotation),void 0!==s.scale&&e.scale.fromArray(s.scale)),e})},Qv.prototype.loadScene=function(t){for(var n=this.json,e=this.extensions,t=this.json.scenes[t],i=new Ns,r=(t.name&&(i.name=t.name),Wv(i,t),t.extensions&&zv(e,i,t),t.nodes||[]),o=[],s=0,a=r.length;s<a;s++)o.push(function s(t,a,u,c){var h=u.nodes[t];return c.getDependency("node",t).then(function(t){var a;return void 0===h.skin?t:c.getDependency("skin",h.skin).then(function(t){for(var n=[],e=0,i=(a=t).joints.length;e<i;e++)n.push(c.getDependency("node",a.joints[e]));return Promise.all(n)}).then(function(s){return t.traverse(function(t){if(t.isMesh){for(var n=[],e=[],i=0,r=s.length;i<r;i++){var o=s[i];o?(n.push(o),o=new At,void 0!==a.inverseBindMatrices&&o.fromArray(a.inverseBindMatrices.array,16*i),e.push(o)):console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',a.joints[i])}t.bind(new Lv(n,e),t.matrixWorld)}}),t})}).then(function(t){a.add(t);var n=[];if(h.children)for(var e=h.children,i=0,r=e.length;i<r;i++){var o=e[i];n.push(s(o,t,u,c))}return Promise.all(n)})}(r[s],i,n,this));return Promise.all(o).then(function(){return i})};var Kv=Nv;function Jv(t){return(Jv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function $v(t){od.call(this,t),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}function tp(t){return(tp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function np(t,n){var e,i,r,o,s="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(s)return i=!(e=!0),{s:function(){s=s.call(t)},n:function(){var t=s.next();return e=t.done,t},e:function(t){i=!0,r=t},f:function(){try{e||null==s.return||s.return()}finally{if(i)throw r}}};if(Array.isArray(t)||(s=function(t,n){var e;if(t)return"string"==typeof t?ep(t,n):"Map"===(e="Object"===(e=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?ep(t,n):void 0}(t))||n&&t&&"number"==typeof t.length)return s&&(t=s),o=0,{s:n=function(){},n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:n};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ep(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function ip(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=tp(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=tp(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==tp(t)?t:String(t)}(i.key),i)}}function rp(t,n,e){n=sp(n);var i=t,n=op()?Reflect.construct(n,e||[],sp(t).constructor):n.apply(t,e);if(n&&("object"===tp(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function op(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(op=function(){return!!t})()}function sp(t){return(sp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ap(t,n){return(ap=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}$v.prototype=Object.assign(Object.create(od.prototype),{constructor:$v,setDecoderPath:function(t){return this.decoderPath=t,this},setDecoderConfig:function(t){return this.decoderConfig=t,this},setWorkerLimit:function(t){return this.workerLimit=t,this},setVerbosity:function(){console.warn("THREE.DRACOLoader: The .setVerbosity() method has been removed.")},setDrawMode:function(){console.warn("THREE.DRACOLoader: The .setDrawMode() method has been removed.")},setSkipDequantization:function(){console.warn("THREE.DRACOLoader: The .setSkipDequantization() method has been removed.")},load:function(t,e,n,i){var r=this,o=new ad(this.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),"use-credentials"===this.crossOrigin&&o.setWithCredentials(!0),o.load(t,function(t){var n={attributeIDs:r.defaultAttributeIDs,attributeTypes:r.defaultAttributeTypes,useUniqueIDs:!1};r.decodeGeometry(t,n).then(e).catch(i)},n,i)},decodeDracoFile:function(t,n,e,i){i={attributeIDs:e||this.defaultAttributeIDs,attributeTypes:i||this.defaultAttributeTypes,useUniqueIDs:!!e};this.decodeGeometry(t,i).then(n)},decodeGeometry:function(e,i){var t,n=this;for(t in i.attributeTypes){var r=i.attributeTypes[t];void 0!==r.BYTES_PER_ELEMENT&&(i.attributeTypes[t]=r.name)}var o,s=JSON.stringify(i);if($v.taskCache.has(e)){var a=$v.taskCache.get(e);if(a.key===s)return a.promise;if(0===e.byteLength)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}var u=this.workerNextTaskID++,a=e.byteLength,a=this.xc(u,a).then(function(t){return o=t,new Promise(function(t,n){o.Ec[u]={resolve:t,reject:n},o.postMessage({type:"decode",id:u,taskConfig:i,buffer:e},[e])})}).then(function(t){return n.Sc(t.geometry)});return a.finally(function(){o&&u&&n.Tc(o,u)}),$v.taskCache.set(e,{key:s,promise:a}),a},Sc:function(t){var n=new ra;t.index&&n.setIndex(new R(t.index.array,1));for(var e=0;e<t.attributes.length;e++){var i=t.attributes[e],r=i.name,o=i.array,i=i.itemSize;n.setAttribute(r,new R(o,i))}return n},Ac:function(e,t){var i=new ad(this.manager);return i.setPath(this.decoderPath),i.setResponseType(t),new Promise(function(t,n){i.load(e,t,void 0,n)})},preload:function(){return this.Mc(),this},Mc:function(){var e,t,i=this;return this.decoderPending||(t=[],(e="object"!==("undefined"==typeof WebAssembly?"undefined":Jv(WebAssembly))||"js"===this.decoderConfig.type)?t.push(this.Ac("draco_decoder.js","text")):(t.push(this.Ac("draco_wasm_wrapper.js","text")),t.push(this.Ac("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(function(t){var n=t[0],t=(e||(i.decoderConfig.wasmBinary=t[1]),$v.DRACOWorker.toString()),n=["/* draco decoder */",n,"","/* worker */",t.substring(t.indexOf("{")+1,t.lastIndexOf("}"))].join("\n");i.workerSourceURL=URL.createObjectURL(new Blob([n]))})),this.decoderPending},xc:function(t,n){var i=this;return this.Mc().then(function(){i.workerPool.length<i.workerLimit?((e=new Worker(i.workerSourceURL)).Ec={},e.Oc={},e.Lc=0,e.postMessage({type:"init",decoderConfig:i.decoderConfig}),e.onmessage=function(t){var n=t.data;switch(n.type){case"decode":e.Ec[n.id].resolve(n);break;case"error":e.Ec[n.id].reject(n);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+n.type+'"')}},i.workerPool.push(e)):i.workerPool.sort(function(t,n){return t.Lc>n.Lc?-1:1});var e=i.workerPool[i.workerPool.length-1];return e.Oc[t]=n,e.Lc+=n,e})},Tc:function(t,n){t.Lc-=t.Oc[n],delete t.Ec[n],delete t.Oc[n]},debug:function(){this.workerPool.map(function(t){return t.Lc})},dispose:function(){for(var t=0;t<this.workerPool.length;++t)this.workerPool[t].terminate();return this.workerPool.length=0,this}}),$v.DRACOWorker=function(){var e,n;onmessage=function(t){var o=t.data;switch(o.type){case"init":e=o.decoderConfig,n=new Promise(function(n){e.onModuleLoaded=function(t){n({draco:t})},DracoDecoderModule(e)});break;case"decode":var s=o.buffer,a=o.taskConfig;n.then(function(t){var t=t.draco,n=new t.Decoder,e=new t.DecoderBuffer;e.Init(new Int8Array(s),s.byteLength);try{var i=function(t,n,e,i){var r,o,s=i.attributeIDs,a=i.attributeTypes,u=n.GetEncodedGeometryType(e);if(u===t.TRIANGULAR_MESH)r=new t.Mesh,o=n.DecodeBufferToMesh(e,r);else{if(u!==t.POINT_CLOUD)throw new Error("THREE.DRACOLoader: Unexpected geometry type.");r=new t.PointCloud,o=n.DecodeBufferToPointCloud(e,r)}if(!o.ok()||0===r.ptr)throw new Error("THREE.DRACOLoader: Decoding failed: "+o.error_msg());var c,h,f,l={index:null,attributes:[]};for(c in s){var d=self[a[c]];if(i.useUniqueIDs)f=s[c],h=n.GetAttributeByUniqueId(r,f);else{if(-1===(f=n.GetAttributeId(r,t[s[c]])))continue;h=n.GetAttribute(r,f)}l.attributes.push(function(t,n,e,i,r,o){var s,a,u=o.num_components(),c=e.num_points()*u;switch(r){case Float32Array:s=new t.DracoFloat32Array,n.GetAttributeFloatForAllPoints(e,o,s),a=new Float32Array(c);break;case Int8Array:s=new t.DracoInt8Array,n.GetAttributeInt8ForAllPoints(e,o,s),a=new Int8Array(c);break;case Int16Array:s=new t.DracoInt16Array,n.GetAttributeInt16ForAllPoints(e,o,s),a=new Int16Array(c);break;case Int32Array:s=new t.DracoInt32Array,n.GetAttributeInt32ForAllPoints(e,o,s),a=new Int32Array(c);break;case Uint8Array:s=new t.DracoUInt8Array,n.GetAttributeUInt8ForAllPoints(e,o,s),a=new Uint8Array(c);break;case Uint16Array:s=new t.DracoUInt16Array,n.GetAttributeUInt16ForAllPoints(e,o,s),a=new Uint16Array(c);break;case Uint32Array:s=new t.DracoUInt32Array,n.GetAttributeUInt32ForAllPoints(e,o,s),a=new Uint32Array(c);break;default:throw new Error("THREE.DRACOLoader: Unexpected attribute type.")}for(var h=0;h<c;h++)a[h]=s.GetValue(h);return t.destroy(s),{name:i,array:a,itemSize:u}}(t,n,r,c,d,h))}if(u===t.TRIANGULAR_MESH){for(var v=r.num_faces(),p=new Uint32Array(3*v),m=new t.DracoInt32Array,y=0;y<v;++y){n.GetFaceFromMesh(r,y,m);for(var b=0;b<3;++b)p[3*y+b]=m.GetValue(b)}l.index={array:p,itemSize:1},t.destroy(m)}return t.destroy(r),l}(t,n,e,a),r=i.attributes.map(function(t){return t.array.buffer});i.index&&r.push(i.index.array.buffer),self.postMessage({type:"decode",id:o.id,geometry:i},r)}catch(t){console.error(t),self.postMessage({type:"error",id:o.id,error:t.message})}finally{t.destroy(e),t.destroy(n)}})}}},$v.taskCache=new WeakMap,$v.setDecoderPath=function(){console.warn("THREE.DRACOLoader: The .setDecoderPath() method has been removed. Use instance methods.")},$v.setDecoderConfig=function(){console.warn("THREE.DRACOLoader: The .setDecoderConfig() method has been removed. Use instance methods.")},$v.releaseDecoderModule=function(){console.warn("THREE.DRACOLoader: The .releaseDecoderModule() method has been removed. Use instance methods.")},$v.getDecoderModule=function(){console.warn("THREE.DRACOLoader: The .getDecoderModule() method has been removed. Use instance methods.")};var $d=function(){var t,n,e=r,i=Zi;if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");function r(t){var n;if(this instanceof r)return(n=rp(this,r)).gn=t,n.Rc=new Sd,n.Nc=new Kv,n.Pc=!1,n.Fc=!1,n.gn.Ai.decoderURL&&((t=new $v).setDecoderPath(n.gn.Ai.decoderURL),n.Nc.setDRACOLoader(t)),n;throw new TypeError("Cannot call a class as a function")}return e.prototype=Object.create(i&&i.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),i&&ap(e,i),e=r,t&&ip(e.prototype,t),n&&ip(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(),up=(Object.assign($d.prototype,{Ra:function(o,s,n){var a,t,u=this;this.sn.has(o)?(this.un(o,{success:s,fail:n}),!0===this.sn.get(o).loadComplete&&this.jc(o)):(this.sn.set(o,{loadComplete:!1}),a=-1===o.indexOf(".js"),t=this.Nc,(t=a?t:this.Rc).load(o,function(t,n){if(!0!==u.Fc){if(a)u.sn.set(o,{gltf:t,data:n,isAnimate:0<t.animations.length,isGltf:!0,loadComplete:!0}),s&&s(a,t);else{if(Array.isArray(n)){var e,i=np(n);try{for(i.s();!(e=i.n()).done;){var r=e.value;r.map&&u.Pc&&r.color.setScalar(1)}}catch(t){i.e(t)}finally{i.f()}}else n.map&&u.Pc&&n.color.setScalar(1);u.sn.set(o,{geometry:t,material:n,isGltf:!1,loadComplete:!0}),s&&s(a,t,n)}u.gn.Nt.Ic(),u.jc(o,!1)}},function(t){},function(t){!0!==u.Fc&&(u.sn.delete(o),n&&n(t),u.jc(o,t))}))},jc:function(r,o){var s,a=this;this.an.has(r)&&(s=this.sn.get(r))&&(this.an.get(r).forEach(function(t,n,e){var i;o?n.fail&&n.fail(o):s.isGltf?s.isAnimate?a.Nc.parse(s.data,B0(r),function(t){n.success&&n.success(!0,t)},function(t){n.fail&&n.fail(t)}):((i={animations:[]}).scene=s.gltf.scene.clone(),i.scene.traverse(function(t){"Mesh"===t.type&&delete t.userData.sourceMaterial}),n.success&&n.success(!0,i)):n.success&&n.success(!1,s.geometry,s.material),e.delete(t)}),this.an.delete(r))},zn:function(){this.Fc=!0,this.an.clear(),this.Rc=null,this.Nc=null}}),$d);function cp(t){return(cp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function hp(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=cp(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=cp(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==cp(t)?t:String(t)}(i.key),i)}}function fp(t,n,e){n=dp(n);var i=t,n=lp()?Reflect.construct(n,e||[],dp(t).constructor):n.apply(t,e);if(n&&("object"===cp(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function lp(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(lp=function(){return!!t})()}function dp(t){return(dp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function vp(t,n){return(vp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var e=function(){var t,n,e=r,i=Zi;if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");function r(t){var n,e;if(this instanceof r)return(n=fp(this,r)).Nc=new Kv,t.Ai.decoderURL&&((e=new $v).setDecoderPath(t.Ai.decoderURL),n.Nc.setDRACOLoader(e)),n;throw new TypeError("Cannot call a class as a function")}return e.prototype=Object.create(i&&i.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),i&&vp(e,i),e=r,t&&hp(e.prototype,t),n&&hp(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(),pp=(Object.assign(e.prototype,{Ra:function(e,i,r){var o=this;this.sn.has(e)?(this.un(e,{success:i,fail:r}),!0===this.sn.get(e).loadComplete&&this.jc(e)):(this.sn.set(e,{loadComplete:!1}),this.Nc.load(e,function(t,n){t.scene.userData.sourceScale=t.scene.scale.clone(),o.sn.set(e,{gltf:t,isAnimate:0<t.animations.length,data:0<t.animations.length?n:null,loadComplete:!0}),o.un(e,{success:i,fail:r}),o.jc(e)},function(t){},function(t){o.sn.delete(e),r&&r(t),o.jc(e,t)}))},jc:function(r,o){var s,a=this;this.an.has(r)&&(s=this.sn.get(r))&&(this.an.get(r).forEach(function(t,n,e){var i;o?n.fail&&n.fail(o):s.isAnimate?a.Nc.parse(s.data,B0(r),function(t){t.scene.userData.sourceScale=t.scene.scale.clone(),n.success&&n.success(t)},function(t){n.fail&&n.fail(t)}):((i={animations:[]}).scene=s.gltf.scene.clone(!0),n.success&&n.success(i)),e.delete(t)}),this.an.delete(r))},zn:function(){this.Nc=null}}),e);function mp(){this.type="Curve",this.arcLengthDivisions=200}function yp(t,n,e,i,r,o,s,a){mp.call(this),this.type="EllipseCurve",this.aX=t||0,this.aY=n||0,this.xRadius=e||1,this.yRadius=i||1,this.aStartAngle=r||0,this.aEndAngle=o||2*Math.PI,this.aClockwise=s||!1,this.aRotation=a||0}function bp(t,n,e,i,r,o){yp.call(this,t,n,e,e,i,r,o),this.type="ArcCurve"}function gp(){var r=0,o=0,s=0,a=0;function u(t,n,e,i){s=-3*(r=t)+3*n-2*(o=e)-i,a=2*t-2*n+e+i}return{initCatmullRom:function(t,n,e,i,r){u(n,e,r*(e-t),r*(i-n))},initNonuniformCatmullRom:function(t,n,e,i,r,o,s){t=(n-t)/r-(e-t)/(r+o)+(e-n)/o,r=(e-n)/o-(i-n)/(o+s)+(i-e)/s;u(n,e,t*=o,r*=o)},calc:function(t){var n=t*t;return r+o*t+s*n+a*(n*t)}}}Object.assign(mp.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(t,n){t=this.getUtoTmapping(t);return this.getPoint(t,n)},getPoints:function(t){void 0===t&&(t=5);for(var n=[],e=0;e<=t;e++)n.push(this.getPoint(e/t));return n},getSpacedPoints:function(t){void 0===t&&(t=5);for(var n=[],e=0;e<=t;e++)n.push(this.getPointAt(e/t));return n},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var n,e,i=[],r=this.getPoint(0),o=0;for(i.push(0),e=1;e<=t;e++)o+=(n=this.getPoint(e/t)).distanceTo(r),i.push(o),r=n;return this.cacheArcLengths=i},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(t,n){for(var e,i=this.getLengths(),r=0,o=i.length,s=n||t*i[o-1],a=0,u=o-1;a<=u;)if((e=i[r=Math.floor(a+(u-a)/2)]-s)<0)a=r+1;else{if(!(0<e)){u=r;break}u=r-1}return i[r=u]===s?r/(o-1):(r+(s-(n=i[r]))/(i[r+1]-n))/(o-1)},getTangent:function(t){var n=t-1e-4,t=t+1e-4,n=(1<t&&(t=1),this.getPoint(n=n<0?0:n));return this.getPoint(t).clone().sub(n).normalize()},getTangentAt:function(t){t=this.getUtoTmapping(t);return this.getTangent(t)},computeFrenetFrames:function(t,n){for(var e,i=new Tt,r=[],o=[],s=[],a=new Tt,u=new At,c=0;c<=t;c++)r[c]=this.getTangentAt(c/t),r[c].normalize();o[0]=new Tt,s[0]=new Tt;var h=Number.MAX_VALUE,f=Math.abs(r[0].x),l=Math.abs(r[0].y),d=Math.abs(r[0].z);for(f<=h&&(h=f,i.set(1,0,0)),l<=h&&(h=l,i.set(0,1,0)),d<=h&&i.set(0,0,1),a.crossVectors(r[0],i).normalize(),o[0].crossVectors(r[0],a),s[0].crossVectors(r[0],o[0]),c=1;c<=t;c++)o[c]=o[c-1].clone(),s[c]=s[c-1].clone(),a.crossVectors(r[c-1],r[c]),a.length()>Number.EPSILON&&(a.normalize(),e=Math.acos(St.clamp(r[c-1].dot(r[c]),-1,1)),o[c].applyMatrix4(u.makeRotationAxis(a,e))),s[c].crossVectors(r[c],o[c]);if(!0===n)for(e=Math.acos(St.clamp(o[0].dot(o[t]),-1,1)),e/=t,0<r[0].dot(a.crossVectors(o[0],o[t]))&&(e=-e),c=1;c<=t;c++)o[c].applyMatrix4(u.makeRotationAxis(r[c],e*c)),s[c].crossVectors(r[c],o[c]);return{tangents:r,normals:o,binormals:s}},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}),((yp.prototype=Object.create(mp.prototype)).constructor=yp).prototype.isEllipseCurve=!0,yp.prototype.getPoint=function(t,n){for(var n=n||new Mt,e=2*Math.PI,i=this.aEndAngle-this.aStartAngle,r=Math.abs(i)<Number.EPSILON;i<0;)i+=e;for(;e<i;)i-=e;i<Number.EPSILON&&(i=r?0:e),!0!==this.aClockwise||r||(i===e?i=-e:i-=e);var o,s,a,u,r=this.aStartAngle+t*i,t=this.aX+this.xRadius*Math.cos(r),r=this.aY+this.yRadius*Math.sin(r);return 0!==this.aRotation&&(o=Math.cos(this.aRotation),s=Math.sin(this.aRotation),t=(a=t-this.aX)*o-(u=r-this.aY)*s+this.aX,r=a*s+u*o+this.aY),n.set(t,r)},yp.prototype.copy=function(t){return mp.prototype.copy.call(this,t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this},((bp.prototype=Object.create(yp.prototype)).constructor=bp).prototype.isArcCurve=!0;var _p=new Tt,wp=new gp,xp=new gp,Ep=new gp;function Sp(t,n,e,i){mp.call(this),this.type="CatmullRomCurve3",this.points=t||[],this.closed=n||!1,this.curveType=e||"centripetal",this.tension=i||.5}function Tp(t,n,e,i,r){var n=.5*(i-n),r=.5*(r-e),o=t*t;return(2*e-2*i+n+r)*(t*o)+(-3*e+3*i-2*n-r)*o+n*t+e}function Ap(t,n,e,i){return(r=1-(r=t))*r*n+2*(1-t)*t*e+t*t*i;var r}function Mp(t,n,e,i,r){return(o=1-(o=t))*o*o*n+3*(o=1-t)*o*t*e+3*(1-t)*t*t*i+t*t*t*r;var o}function Op(t,n,e,i){mp.call(this),this.type="CubicBezierCurve",this.v0=t||new Mt,this.v1=n||new Mt,this.v2=e||new Mt,this.v3=i||new Mt}function Lp(t,n,e,i){mp.call(this),this.type="CubicBezierCurve3",this.v0=t||new Tt,this.v1=n||new Tt,this.v2=e||new Tt,this.v3=i||new Tt}function Rp(t,n){mp.call(this),this.type="LineCurve",this.v1=t||new Mt,this.v2=n||new Mt}function Np(t,n){mp.call(this),this.type="LineCurve3",this.v1=t||new Tt,this.v2=n||new Tt}function Pp(t,n,e){mp.call(this),this.type="QuadraticBezierCurve",this.v0=t||new Mt,this.v1=n||new Mt,this.v2=e||new Mt}function Fp(t,n,e){mp.call(this),this.type="QuadraticBezierCurve3",this.v0=t||new Tt,this.v1=n||new Tt,this.v2=e||new Tt}function jp(t){mp.call(this),this.type="SplineCurve",this.points=t||[]}function Ip(){mp.call(this),this.type="CurvePath",this.curves=[],this.autoClose=!1}function Cp(t){Ip.call(this),this.type="Path",this.currentPoint=new Mt,t&&this.setFromPoints(t)}function Dp(t){Cp.call(this,t),this.uuid=St.generateUUID(),this.type="Shape",this.holes=[]}((Sp.prototype=Object.create(mp.prototype)).constructor=Sp).prototype.isCatmullRomCurve3=!0,Sp.prototype.getPoint=function(t,n){var e,i,r,o,n=n||new Tt,s=this.points,a=s.length,t=(a-(this.closed?0:1))*t,u=Math.floor(t),t=t-u;return this.closed?u+=0<u?0:(Math.floor(Math.abs(u)/a)+1)*a:0===t&&u===a-1&&(u=a-2,t=1),e=this.closed||0<u?s[(u-1)%a]:(_p.subVectors(s[0],s[1]).add(s[0]),_p),i=s[u%a],r=s[(u+1)%a],u=this.closed||u+2<a?s[(u+2)%a]:(_p.subVectors(s[a-1],s[a-2]).add(s[a-1]),_p),"centripetal"===this.curveType||"chordal"===this.curveType?(s="chordal"===this.curveType?.5:.25,a=Math.pow(e.distanceToSquared(i),s),(o=Math.pow(i.distanceToSquared(r),s))<1e-4&&(o=1),a<1e-4&&(a=o),(s=Math.pow(r.distanceToSquared(u),s))<1e-4&&(s=o),wp.initNonuniformCatmullRom(e.x,i.x,r.x,u.x,a,o,s),xp.initNonuniformCatmullRom(e.y,i.y,r.y,u.y,a,o,s),Ep.initNonuniformCatmullRom(e.z,i.z,r.z,u.z,a,o,s)):"catmullrom"===this.curveType&&(wp.initCatmullRom(e.x,i.x,r.x,u.x,this.tension),xp.initCatmullRom(e.y,i.y,r.y,u.y,this.tension),Ep.initCatmullRom(e.z,i.z,r.z,u.z,this.tension)),n.set(wp.calc(t),xp.calc(t),Ep.calc(t)),n},Sp.prototype.copy=function(t){mp.prototype.copy.call(this,t),this.points=[];for(var n=0,e=t.points.length;n<e;n++){var i=t.points[n];this.points.push(i.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this},((Op.prototype=Object.create(mp.prototype)).constructor=Op).prototype.isCubicBezierCurve=!0,Op.prototype.getPoint=function(t,n){var n=n||new Mt,e=this.v0,i=this.v1,r=this.v2,o=this.v3;return n.set(Mp(t,e.x,i.x,r.x,o.x),Mp(t,e.y,i.y,r.y,o.y)),n},Op.prototype.copy=function(t){return mp.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this},((Lp.prototype=Object.create(mp.prototype)).constructor=Lp).prototype.isCubicBezierCurve3=!0,Lp.prototype.getPoint=function(t,n){var n=n||new Tt,e=this.v0,i=this.v1,r=this.v2,o=this.v3;return n.set(Mp(t,e.x,i.x,r.x,o.x),Mp(t,e.y,i.y,r.y,o.y),Mp(t,e.z,i.z,r.z,o.z)),n},Lp.prototype.copy=function(t){return mp.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this},((Rp.prototype=Object.create(mp.prototype)).constructor=Rp).prototype.isLineCurve=!0,Rp.prototype.getPoint=function(t,n){n=n||new Mt;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n},Rp.prototype.getPointAt=function(t,n){return this.getPoint(t,n)},Rp.prototype.getTangent=function(){return this.v2.clone().sub(this.v1).normalize()},Rp.prototype.copy=function(t){return mp.prototype.copy.call(this,t),this.v1.copy(t.v1),this.v2.copy(t.v2),this},((Np.prototype=Object.create(mp.prototype)).constructor=Np).prototype.isLineCurve3=!0,Np.prototype.getPoint=function(t,n){n=n||new Tt;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n},Np.prototype.getPointAt=function(t,n){return this.getPoint(t,n)},Np.prototype.copy=function(t){return mp.prototype.copy.call(this,t),this.v1.copy(t.v1),this.v2.copy(t.v2),this},((Pp.prototype=Object.create(mp.prototype)).constructor=Pp).prototype.isQuadraticBezierCurve=!0,Pp.prototype.getPoint=function(t,n){var n=n||new Mt,e=this.v0,i=this.v1,r=this.v2;return n.set(Ap(t,e.x,i.x,r.x),Ap(t,e.y,i.y,r.y)),n},Pp.prototype.copy=function(t){return mp.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this},Fp.prototype.getPoint=function(t,n){var n=n||new Tt,e=this.v0,i=this.v1,r=this.v2;return n.set(Ap(t,e.x,i.x,r.x),Ap(t,e.y,i.y,r.y),Ap(t,e.z,i.z,r.z)),n},((jp.prototype=Object.create(mp.prototype)).constructor=jp).prototype.isSplineCurve=!0,jp.prototype.getPoint=function(t,n){var n=n||new Mt,e=this.points,t=(e.length-1)*t,i=Math.floor(t),t=t-i,r=e[0===i?i:i-1],o=e[i],s=e[i>e.length-2?e.length-1:i+1],e=e[i>e.length-3?e.length-1:i+2];return n.set(Tp(t,r.x,o.x,s.x,e.x),Tp(t,r.y,o.y,s.y,e.y)),n},jp.prototype.copy=function(t){mp.prototype.copy.call(this,t),this.points=[];for(var n=0,e=t.points.length;n<e;n++){var i=t.points[n];this.points.push(i.clone())}return this},Ip.prototype=Object.assign(Object.create(mp.prototype),{constructor:Ip,add:function(t){this.curves.push(t)},closePath:function(){var t=this.curves[0].getPoint(0),n=this.curves[this.curves.length-1].getPoint(1);t.equals(n)||this.curves.push(new Rp(n,t))},getPoint:function(t){for(var n,e,i,r=t*this.getLength(),o=this.getCurveLengths(),s=0;s<o.length;){if(o[s]>=r)return n=o[s]-r,i=(e=this.curves[s]).getLength(),e.getPointAt(0===i?0:1-n/i);s++}return null},getLength:function(){var t=this.getCurveLengths();return t[t.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var t=[],n=0,e=0,i=this.curves.length;e<i;e++)n+=this.curves[e].getLength(),t.push(n);return this.cacheLengths=t},getSpacedPoints:function(t){void 0===t&&(t=40);for(var n=[],e=0;e<=t;e++)n.push(this.getPoint(e/t));return this.autoClose&&n.push(n[0]),n},getPoints:function(t){t=t||12;for(var n,e=[],i=0,r=this.curves;i<r.length;i++)for(var o=r[i],s=o&&o.isEllipseCurve?2*t:o&&(o.isLineCurve||o.isLineCurve3)?1:o&&o.isSplineCurve?t*o.points.length:t,a=o.getPoints(s),u=0;u<a.length;u++){var c=a[u];n&&n.equals(c)||(e.push(c),n=c)}return this.autoClose&&1<e.length&&!e[e.length-1].equals(e[0])&&e.push(e[0]),e},copy:function(t){mp.prototype.copy.call(this,t),this.curves=[];for(var n=0,e=t.curves.length;n<e;n++){var i=t.curves[n];this.curves.push(i.clone())}return this.autoClose=t.autoClose,this}}),Cp.prototype=Object.assign(Object.create(Ip.prototype),{constructor:Cp,setFromPoints:function(t){this.moveTo(t[0].x,t[0].y);for(var n=1,e=t.length;n<e;n++)this.lineTo(t[n].x,t[n].y);return this},moveTo:function(t,n){return this.currentPoint.set(t,n),this},lineTo:function(t,n){var e=new Rp(this.currentPoint.clone(),new Mt(t,n));return this.curves.push(e),this.currentPoint.set(t,n),this},quadraticCurveTo:function(t,n,e,i){t=new Pp(this.currentPoint.clone(),new Mt(t,n),new Mt(e,i));return this.curves.push(t),this.currentPoint.set(e,i),this},bezierCurveTo:function(t,n,e,i,r,o){t=new Op(this.currentPoint.clone(),new Mt(t,n),new Mt(e,i),new Mt(r,o));return this.curves.push(t),this.currentPoint.set(r,o),this},splineThru:function(t){var n=new jp([this.currentPoint.clone()].concat(t));return this.curves.push(n),this.currentPoint.copy(t[t.length-1]),this},arc:function(t,n,e,i,r,o){var s=this.currentPoint.x,a=this.currentPoint.y;return this.absarc(t+s,n+a,e,i,r,o),this},absarc:function(t,n,e,i,r,o){return this.absellipse(t,n,e,e,i,r,o),this},ellipse:function(t,n,e,i,r,o,s,a){var u=this.currentPoint.x,c=this.currentPoint.y;return this.absellipse(t+u,n+c,e,i,r,o,s,a),this},absellipse:function(t,n,e,i,r,o,s,a){t=new yp(t,n,e,i,r,o,s,a),0<this.curves.length&&((n=t.getPoint(0)).equals(this.currentPoint)||this.lineTo(n.x,n.y)),this.curves.push(t),e=t.getPoint(1);return this.currentPoint.copy(e),this},copy:function(t){return Ip.prototype.copy.call(this,t),this.currentPoint.copy(t.currentPoint),this}}),Dp.prototype=Object.assign(Object.create(Cp.prototype),{constructor:Dp,getPointsHoles:function(t){for(var n=[],e=0,i=this.holes.length;e<i;e++)n[e]=this.holes[e].getPoints(t);return n},extractPoints:function(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}},copy:function(t){Cp.prototype.copy.call(this,t),this.holes=[];for(var n=0,e=t.holes.length;n<e;n++){var i=t.holes[n];this.holes.push(i.clone())}return this}});var kp=function(t,n,e){e=e||2;var i,r,o,s,a,u=n&&n.length,c=u?n[0]*e:t.length,h=Up(t,0,c,e,!0),f=[];if(h&&h.next!==h.prev){if(u&&(h=function(t,n,e,i){var r,o,s,a,u=[];for(r=0,o=n.length;r<o;r++)a=n[r]*i,s=r<o-1?n[r+1]*i:t.length,(a=Up(t,a,s,i,!1))===a.next&&(a.steiner=!0),u.push(function(t){var n=t,e=t;for(;(n.x<e.x||n.x===e.x&&n.y<e.y)&&(e=n),n=n.next,n!==t;);return e}(a));for(u.sort(Hp),r=0;r<u.length;r++)!function(t,n){(n=function(t,n){var e,i=n,r=t.x,o=t.y,s=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var a=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(a<=r&&s<a){if((s=a)===r){if(o===i.y)return i;if(o===i.next.y)return i.next}e=i.x<i.next.x?i:i.next}}}while(i=i.next,i!==n);if(!e)return null;if(r===s)return e.prev;var u,c=e,h=e.x,f=e.y,l=1/0;i=e.next;for(;i!==c;)r>=i.x&&i.x>=h&&r!==i.x&&Vp(o<f?r:s,o,h,f,o<f?s:r,o,i.x,i.y)&&((u=Math.abs(o-i.y)/(r-i.x))<l||u===l&&i.x>e.x)&&Qp(i,t)&&(e=i,l=u),i=i.next;return e}(t,n))&&Bp(n=Zp(n,t),n.next)}(u[r],e),e=Bp(e,e.next);return e}(t,n,h,e)),t.length>80*e){for(var l=i=t[0],d=r=t[1],v=e;v<c;v+=e)(o=t[v])<l&&(l=o),(s=t[v+1])<d&&(d=s),i<o&&(i=o),r<s&&(r=s);a=0!==(a=Math.max(i-l,r-d))?1/a:0}Gp(h,f,e,l,d,a)}return f};function Up(t,n,e,i,r){var o,s;if(r===0<function(t,n,e,i){for(var r=0,o=n,s=e-i;o<e;o+=i)r+=(t[s]-t[o])*(t[o+1]+t[s+1]),s=o;return r}(t,n,e,i))for(o=n;o<e;o+=i)s=qp(o,t[o],t[o+1],s);else for(o=e-i;n<=o;o-=i)s=qp(o,t[o],t[o+1],s);return s&&Wp(s,s.next)&&(Kp(s),s=s.next),s}function Bp(t,n){if(!t)return t;n=n||t;var e,i=t;do{if(e=!1,i.steiner||!Wp(i,i.next)&&0!==zp(i.prev,i,i.next))i=i.next;else{if(Kp(i),(i=n=i.prev)===i.next)break;e=!0}}while(e||i!==n);return n}function Gp(t,n,e,i,r,o,s){if(t){if(!s&&o){for(var a=t,u=i,c=r,h=o,f=a;null===f.z&&(f.z=Xp(f.x,f.y,u,c,h)),f.prevZ=f.prev,f.nextZ=f.next,(f=f.next)!==a;);f.prevZ.nextZ=null,f.prevZ=null;var l,d,v,p,m,y,b,g,_=f,w=1;do{for(d=_,m=_=null,y=0;d;){for(y++,v=d,l=b=0;l<w&&(b++,v=v.nextZ);l++);for(g=w;0<b||0<g&&v;)0!==b&&(0===g||!v||d.z<=v.z)?(d=(p=d).nextZ,b--):(v=(p=v).nextZ,g--),m?m.nextZ=p:_=p,p.prevZ=m,m=p;d=v}}while(m.nextZ=null,w*=2,1<y)}for(var x,E,S=t;t.prev!==t.next;)if(x=t.prev,E=t.next,o?function(t,n,e,i){var r=t.prev,o=t,s=t.next;if(0<=zp(r,o,s))return;var a=(r.x<o.x?r.x<s.x?r:s:o.x<s.x?o:s).x,u=(r.y<o.y?r.y<s.y?r:s:o.y<s.y?o:s).y,c=(r.x>o.x?r.x>s.x?r:s:o.x>s.x?o:s).x,h=(r.y>o.y?r.y>s.y?r:s:o.y>s.y?o:s).y,f=Xp(a,u,n,e,i),l=Xp(c,h,n,e,i),d=t.prevZ,v=t.nextZ;for(;d&&d.z>=f&&v&&v.z<=l;){if(d!==t.prev&&d!==t.next&&Vp(r.x,r.y,o.x,o.y,s.x,s.y,d.x,d.y)&&0<=zp(d.prev,d,d.next))return;if(d=d.prevZ,v!==t.prev&&v!==t.next&&Vp(r.x,r.y,o.x,o.y,s.x,s.y,v.x,v.y)&&0<=zp(v.prev,v,v.next))return;v=v.nextZ}for(;d&&d.z>=f;){if(d!==t.prev&&d!==t.next&&Vp(r.x,r.y,o.x,o.y,s.x,s.y,d.x,d.y)&&0<=zp(d.prev,d,d.next))return;d=d.prevZ}for(;v&&v.z<=l;){if(v!==t.prev&&v!==t.next&&Vp(r.x,r.y,o.x,o.y,s.x,s.y,v.x,v.y)&&0<=zp(v.prev,v,v.next))return;v=v.nextZ}return 1}(t,i,r,o):function(t){var n=t.prev,e=t,i=t.next;if(0<=zp(n,e,i))return;var r=t.next.next;for(;r!==t.prev;){if(Vp(n.x,n.y,e.x,e.y,i.x,i.y,r.x,r.y)&&0<=zp(r.prev,r,r.next))return;r=r.next}return 1}(t))n.push(x.i/e),n.push(t.i/e),n.push(E.i/e),Kp(t),t=E.next,S=E.next;else if((t=E)===S){s?1===s?Gp(t=function(t,n,e){var i=t;do{var r=i.prev,o=i.next.next}while(!Wp(r,o)&&Yp(r,i,i.next,o)&&Qp(r,o)&&Qp(o,r)&&(n.push(r.i/e),n.push(i.i/e),n.push(o.i/e),Kp(i),Kp(i.next),i=t=o),i=i.next,i!==t);return i}(t,n,e),n,e,i,r,o,2):2===s&&function(t,n,e,i,r,o){var s=t;do{for(var a,u=s.next.next;u!==s.prev;){if(s.i!==u.i&&function(t,n){return t.next.i!==n.i&&t.prev.i!==n.i&&!function(t,n){var e=t;do{if(e.i!==t.i&&e.next.i!==t.i&&e.i!==n.i&&e.next.i!==n.i&&Yp(e,e.next,t,n))return 1}while(e=e.next,e!==t);return}(t,n)&&Qp(t,n)&&Qp(n,t)&&function(t,n){var e=t,i=!1,r=(t.x+n.x)/2,o=(t.y+n.y)/2;for(;e.y>o!=e.next.y>o&&e.next.y!==e.y&&r<(e.next.x-e.x)*(o-e.y)/(e.next.y-e.y)+e.x&&(i=!i),e=e.next,e!==t;);return i}(t,n)}(s,u))return a=Zp(s,u),s=Bp(s,s.next),a=Bp(a,a.next),Gp(s,n,e,i,r,o),Gp(a,n,e,i,r,o);u=u.next}}while(s=s.next,s!==t)}(t,n,e,i,r,o):Gp(Bp(t),n,e,i,r,o,1);break}}}function Hp(t,n){return t.x-n.x}function Xp(t,n,e,i,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-e)*r)|t<<8))|t<<4))|t<<2))|t<<1))|(n=1431655765&((n=858993459&((n=252645135&((n=16711935&((n=32767*(n-i)*r)|n<<8))|n<<4))|n<<2))|n<<1))<<1}function Vp(t,n,e,i,r,o,s,a){return 0<=(r-s)*(n-a)-(t-s)*(o-a)&&0<=(t-s)*(i-a)-(e-s)*(n-a)&&0<=(e-s)*(o-a)-(r-s)*(i-a)}function zp(t,n,e){return(n.y-t.y)*(e.x-n.x)-(n.x-t.x)*(e.y-n.y)}function Wp(t,n){return t.x===n.x&&t.y===n.y}function Yp(t,n,e,i){return Wp(t,e)&&Wp(n,i)||Wp(t,i)&&Wp(e,n)||0<zp(t,n,e)!=0<zp(t,n,i)&&0<zp(e,i,t)!=0<zp(e,i,n)}function Qp(t,n){return zp(t.prev,t,t.next)<0?0<=zp(t,n,t.next)&&0<=zp(t,t.prev,n):zp(t,n,t.prev)<0||zp(t,t.next,n)<0}function Zp(t,n){var e=new Jp(t.i,t.x,t.y),i=new Jp(n.i,n.x,n.y),r=t.next,o=n.prev;return(t.next=n).prev=t,(e.next=r).prev=e,(i.next=e).prev=i,(o.next=i).prev=o,i}function qp(t,n,e,i){t=new Jp(t,n,e);return i?(t.next=i.next,(t.prev=i).next.prev=t,i.next=t):(t.prev=t).next=t,t}function Kp(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Jp(t,n,e){this.i=t,this.x=n,this.y=e,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}var $p={area:function(t){for(var n=t.length,e=0,i=n-1,r=0;r<n;i=r++)e+=t[i].x*t[r].y-t[r].x*t[i].y;return.5*e},isClockWise:function(t){return $p.area(t)<0},triangulateShape:function(t,n){var e=[],i=[],r=[],o=(tm(t),nm(e,t),t.length);n.forEach(tm);for(var s=0;s<n.length;s++)i.push(o),o+=n[s].length,nm(e,n[s]);for(var a=kp(e,i),s=0;s<a.length;s+=3)r.push(a.slice(s,s+3));return r}};function tm(t){var n=t.length;2<n&&t[n-1].equals(t[0])&&t.pop()}function nm(t,n){for(var e=0;e<n.length;e++)t.push(n[e].x),t.push(n[e].y)}function em(t){return(em="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function im(t,n){Us.call(this),this.type="ShapeGeometry","object"===em(n)&&(console.warn("THREE.ShapeGeometry: Options parameter has been removed."),n=n.curveSegments),this.parameters={shapes:t,curveSegments:n},this.fromBufferGeometry(new rm(t,n)),this.mergeVertices()}function rm(t,l){ra.call(this),this.type="ShapeBufferGeometry",this.parameters={shapes:t,curveSegments:l},l=l||12;var d=[],v=[],p=[],m=[],n=0,y=0;if(!1===Array.isArray(t))i(t);else for(var e=0;e<t.length;e++)i(t[e]),this.addGroup(n,y,e),n+=y,y=0;function i(t){var n,e=v.length/3,t=t.extractPoints(l),i=t.shape,r=t.holes;for(!1===$p.isClockWise(i)&&(i=i.reverse()),s=0,a=r.length;s<a;s++)n=r[s],!0===$p.isClockWise(n)&&(r[s]=n.reverse());for(var o=$p.triangulateShape(i,r),s=0,a=r.length;s<a;s++)n=r[s],i=i.concat(n);for(s=0,a=i.length;s<a;s++){var u=i[s];v.push(u.x,u.y,0),p.push(0,0,1),m.push(u.x,u.y)}for(s=0,a=o.length;s<a;s++){var c=o[s],h=c[0]+e,f=c[1]+e,c=c[2]+e;d.push(h,f,c),y+=3}}this.setIndex(d),this.setAttribute("position",new x(v,3)),this.setAttribute("normal",new x(p,3)),this.setAttribute("uv",new x(m,2))}function om(t,n){Us.call(this),this.type="ExtrudeGeometry",this.parameters={shapes:t,options:n},this.fromBufferGeometry(new sm(t,n)),this.mergeVertices()}function sm(t,Z){ra.call(this),this.type="ExtrudeBufferGeometry",this.parameters={shapes:t,options:Z},t=Array.isArray(t)?t:[t];for(var q=this,K=[],J=[],n=0,e=t.length;n<e;n++)!function(C){var i=[],D=void 0!==Z.curveSegments?Z.curveSegments:12,l=void 0!==Z.steps?Z.steps:1,t=void 0!==Z.depth?Z.depth:100,e=void 0===Z.bevelEnabled||Z.bevelEnabled,n=void 0!==Z.bevelThickness?Z.bevelThickness:6,k=void 0!==Z.bevelSize?Z.bevelSize:n-2,U=void 0!==Z.bevelOffset?Z.bevelOffset:0,d=void 0!==Z.bevelSegments?Z.bevelSegments:3,r=Z.extrudePath,B=void 0!==Z.UVGenerator?Z.UVGenerator:am;void 0!==Z.amount&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),t=Z.amount);var o,s,a,u,c,h,f,v,G=!1;r&&(o=r.getSpacedPoints(l),e=!(G=!0),s=r.computeFrenetFrames(l,!1),a=new Tt,u=new Tt,c=new Tt);e||(U=k=n=d=0);var r=C.extractPoints(D),p=r.shape,m=r.holes;if(!$p.isClockWise(p))for(p=p.reverse(),f=0,v=m.length;f<v;f++)h=m[f],$p.isClockWise(h)&&(m[f]=h.reverse());var y=$p.triangulateShape(p,m),b=p;for(f=0,v=m.length;f<v;f++)h=m[f],p=p.concat(h);function g(t,n,e){return n||console.error("THREE.ExtrudeGeometry: vec does not exist"),n.clone().multiplyScalar(e).add(t)}var _,w,x,E,S,T,A=p.length,H=y.length;function X(t,n,e){var i=t.x-n.x,r=t.y-n.y,o=e.x-t.x,s=e.y-t.y,a=i*i+r*r;if(Math.abs(i*s-r*o)>Number.EPSILON){var u=Math.sqrt(a),c=Math.sqrt(o*o+s*s),h=n.x-r/u,n=n.y+i/u,u=((e.x-s/c-h)*s-(e.y+o/c-n)*o)/(i*s-r*o),e=(c=h+i*u-t.x)*c+(h=n+r*u-t.y)*h;if(e<=2)return new Mt(c,h);u=Math.sqrt(e/2)}else{n=!1;i>Number.EPSILON?o>Number.EPSILON&&(n=!0):i<-Number.EPSILON?o<-Number.EPSILON&&(n=!0):Math.sign(r)===Math.sign(s)&&(n=!0),u=n?(c=-r,h=i,Math.sqrt(a)):(c=i,h=r,Math.sqrt(a/2))}return new Mt(c/u,h/u)}for(var V=[],M=0,O=b.length,L=O-1,R=M+1;M<O;M++,L++,R++)L===O&&(L=0),R===O&&(R=0),V[M]=X(b[M],b[L],b[R]);var N,P,z=[],W=V.concat();for(f=0,v=m.length;f<v;f++){for(h=m[f],N=[],M=0,O=h.length,L=O-1,R=M+1;M<O;M++,L++,R++)L===O&&(L=0),R===O&&(R=0),N[M]=X(h[M],h[L],h[R]);z.push(N),W=W.concat(N)}for(_=0;_<d;_++){for(x=_/d,E=n*Math.cos(x*Math.PI/2),w=k*Math.sin(x*Math.PI/2)+U,M=0,O=b.length;M<O;M++)F((S=g(b[M],V[M],w)).x,S.y,-E);for(f=0,v=m.length;f<v;f++)for(h=m[f],N=z[f],M=0,O=h.length;M<O;M++)F((S=g(h[M],N[M],w)).x,S.y,-E)}for(w=k+U,M=0;M<A;M++)S=e?g(p[M],W[M],w):p[M],G?(u.copy(s.normals[0]).multiplyScalar(S.x),a.copy(s.binormals[0]).multiplyScalar(S.y),c.copy(o[0]).add(u).add(a),F(c.x,c.y,c.z)):F(S.x,S.y,0);for(P=1;P<=l;P++)for(M=0;M<A;M++)S=e?g(p[M],W[M],w):p[M],G?(u.copy(s.normals[P]).multiplyScalar(S.x),a.copy(s.binormals[P]).multiplyScalar(S.y),c.copy(o[P]).add(u).add(a),F(c.x,c.y,c.z)):F(S.x,S.y,t/l*P);for(_=d-1;0<=_;_--){for(x=_/d,E=n*Math.cos(x*Math.PI/2),w=k*Math.sin(x*Math.PI/2)+U,M=0,O=b.length;M<O;M++)F((S=g(b[M],V[M],w)).x,S.y,t+E);for(f=0,v=m.length;f<v;f++)for(h=m[f],N=z[f],M=0,O=h.length;M<O;M++)S=g(h[M],N[M],w),G?F(S.x,S.y+o[l-1].y,o[l-1].x+E):F(S.x,S.y,t+E)}function Y(t,n){var e,i;for(M=t.length;0<=--M;){(i=(e=M)-1)<0&&(i=t.length-1);for(var r=0,o=l+2*d,r=0;r<o;r++){var s=A*r,a=A*(r+1),u=(f=h=c=u=void 0,n+e+s),c=n+i+s,h=n+i+a,f=n+e+a;j(u),j(c),j(f),j(c),j(h),j(f),u=K.length/3,I((c=B.generateSideWallUV(q,K,u-6,u-3,u-2,u-1))[0]),I(c[1]),I(c[3]),I(c[1]),I(c[2]),I(c[3])}}}function F(t,n,e){i.push(t),i.push(n),i.push(e)}function Q(t,n,e){j(t),j(n),j(e);t=K.length/3,n=B.generateTopUV(q,K,t-3,t-2,t-1);I(n[0]),I(n[1]),I(n[2])}function j(t){K.push(i[3*t+0]),K.push(i[3*t+1]),K.push(i[3*t+2])}function I(t){J.push(t.x),J.push(t.y)}(function(){var t=K.length/3;if(e){var n=0*A;for(M=0;M<H;M++)Q((T=y[M])[2]+n,T[1]+n,T[0]+n);for(n=A*(l+2*d),M=0;M<H;M++)Q((T=y[M])[0]+n,T[1]+n,T[2]+n)}else{for(M=0;M<H;M++)Q((T=y[M])[2],T[1],T[0]);for(M=0;M<H;M++)Q((T=y[M])[0]+A*l,T[1]+A*l,T[2]+A*l)}q.addGroup(t,K.length/3-t,0)})(),function(){var t=K.length/3,n=0;for(Y(b,n),n+=b.length,f=0,v=m.length;f<v;f++)Y(h=m[f],n),n+=h.length;q.addGroup(t,K.length/3-t,1)}()}(t[n]);this.setAttribute("position",new x(K,3)),this.setAttribute("uv",new x(J,2)),this.computeVertexNormals()}(im.prototype=Object.create(Us.prototype)).constructor=im,(rm.prototype=Object.create(ra.prototype)).constructor=rm,(om.prototype=Object.create(Us.prototype)).constructor=om,(sm.prototype=Object.create(ra.prototype)).constructor=sm;var am={generateTopUV:function(t,n,e,i,r){var o=n[3*e],e=n[3*e+1],s=n[3*i],i=n[3*i+1],a=n[3*r],n=n[3*r+1];return[new Mt(o,e),new Mt(s,i),new Mt(a,n)]},generateSideWallUV:function(t,n,e,i,r,o){var s=n[3*e],a=n[3*e+1],e=n[3*e+2],u=n[3*i],c=n[3*i+1],i=n[3*i+2],h=n[3*r],f=n[3*r+1],r=n[3*r+2],l=n[3*o],d=n[3*o+1],n=n[3*o+2];return Math.abs(a-c)<.01?[new Mt(s,1-e),new Mt(u,1-i),new Mt(h,1-r),new Mt(l,1-n)]:[new Mt(a,1-e),new Mt(c,1-i),new Mt(f,1-r),new Mt(d,1-n)]}},um=new Mt;function cm(t,n){this.min=void 0!==t?t:new Mt(1/0,1/0),this.max=void 0!==n?n:new Mt(-1/0,-1/0)}function hm(t){return(hm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function fm(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=hm(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=hm(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==hm(t)?t:String(t)}(i.key),i)}}Object.assign(cm.prototype,{set:function(t,n){return this.min.copy(t),this.max.copy(n),this},setFromPoints:function(t){this.makeEmpty();for(var n=0,e=t.length;n<e;n++)this.expandByPoint(t[n]);return this},setFromCenterAndSize:function(t,n){n=um.copy(n).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.min.copy(t.min),this.max.copy(t.max),this},makeEmpty:function(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y},getCenter:function(t){return void 0===t&&(console.warn("THREE.Box2: .getCenter() target is now required"),t=new Mt),this.isEmpty()?t.set(0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(t){return void 0===t&&(console.warn("THREE.Box2: .getSize() target is now required"),t=new Mt),this.isEmpty()?t.set(0,0):t.subVectors(this.max,this.min)},expandByPoint:function(t){return this.min.min(t),this.max.max(t),this},expandByVector:function(t){return this.min.sub(t),this.max.add(t),this},expandByScalar:function(t){return this.min.addScalar(-t),this.max.addScalar(t),this},containsPoint:function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y},getParameter:function(t,n){return void 0===n&&(console.warn("THREE.Box2: .getParameter() target is now required"),n=new Mt),n.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y)},clampPoint:function(t,n){return void 0===n&&(console.warn("THREE.Box2: .clampPoint() target is now required"),n=new Mt),n.copy(t).clamp(this.min,this.max)},distanceToPoint:function(t){return um.copy(t).clamp(this.min,this.max).sub(t).length()},intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}});var lm=function(){function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function")}var n,e,i;return n=t,i=[{key:"findNearNthPowerOfTwo",value:function(t){t-=1;return(t=(t=(t=(t=(t|=t>>1)|t>>2)|t>>4)|t>>8)|t>>16)<0?1:1+t}},{key:"polygonArea",value:function(t){if(t.length<3)return 0;var n=t.length;if(t[0].x===t[n-1].x&&t[0].y===t[n-1].y&&--n,n<3)return 0;t[0].y,t[n-1].x,t[1].x;for(var e=1;e<n-1;++e)t[e].y,t[e-1].x,t[e+1].x;return.5*(t[n-1].y*(t[n-2].x-t[0].x))}},{key:"closedPoints",value:function(t){var n=t.length;return!(n<3||(t[0].x===t[n-1].x&&t[0].y===t[n-1].y||(t[n]={x:t[n-1].x,y:t[n-1].y}),0))}},{key:"IsRectCross",value:function(t,n,e,i){return Math.min(t.x,n.x)<=Math.max(e.x,i.x)&&Math.min(e.x,i.x)<=Math.max(t.x,n.x)&&Math.min(t.y,n.y)<=Math.max(e.y,i.y)&&Math.min(e.y,i.y)<=Math.max(t.y,n.y)}},{key:"IsLineSegmentCross",value:function(t,n,e,i){var r=t.x*(e.y-n.y)+n.x*(t.y-e.y)+e.x*(n.y-t.y),o=t.x*(i.y-n.y)+n.x*(t.y-i.y)+i.x*(n.y-t.y);return!(0<=(r^o)&&(0!=r||0!=o)||0<=((r=e.x*(t.y-i.y)+i.x*(e.y-t.y)+t.x*(i.y-e.y))^(o=e.x*(n.y-i.y)+i.x*(e.y-n.y)+n.x*(i.y-e.y)))&&(0!=r||0!=o))}},{key:"computerFocus",value:function(t,n,e,i){var r,o=(i.x-e.x)*(t.y-n.y)-(n.x-t.x)*(e.y-i.y),s=(t.y-e.y)*(n.x-t.x)*(i.x-e.x)+e.x*(i.y-e.y)*(n.x-t.x)-t.x*(n.y-t.y)*(i.x-e.x);return 0==o||(r=s/o,o=(t.x-n.x)*(i.y-e.y)-(n.y-t.y)*(e.x-i.x),s=n.y*(t.x-n.x)*(i.y-e.y)+(i.x-n.x)*(i.y-e.y)*(t.y-n.y)-i.y*(e.x-i.x)*(n.y-t.y),0==o)?null:{x:r,y:s/o}}},{key:"GetLineSegmentCrossPoint",value:function(t,n,e,i){return this.IsRectCross(t,n,e,i)?this.computerFocus(t,n,e,i):null}},{key:"IsPointInPolygon",value:function(t,n){for(var e=!1,i=0,r=t.length-1;i<t.length;r=i++)(t[i].y<=n.y&&n.y<t[r].y||t[r].y<=n.y&&n.y<t[i].y)&&n.x<(t[r].x-t[i].x)*(n.y-t[i].y)/(t[r].y-t[i].y)+t[i].x&&(e=!e);return e}},{key:"PointCmp",value:function(t,n,e){var i;return 0<=t.x&&n.x<0||(0===t.x&&0===n.x?t.y>n.y:(i=(t.x-e.x)*(n.y-e.y)-(n.x-e.x)*(t.y-e.y))<0||!(0<i)&&(i=(t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y),(n.x-e.x)*(n.x-e.y)+(n.y-e.y)*(n.y-e.y)<i))}},{key:"ClockwiseSortPoints",value:function(t){for(var n={x:0,y:0},e=0,i=0,r=0;r<t.length;r++)e+=t[r].x,i+=t[r].y;n.x=e/t.length,n.y=i/t.length;for(var o=0;o<t.length-1;o++)for(var s,a=0;a<t.length-o-1;a++)this.PointCmp(t[a],t[a+1],n)&&(s=t[a],t[a]=t[a+1],t[a+1]=s)}},{key:"PolygonClip",value:function(t,n,e){if(t.length<3||n.length<3)return!1;for(var i=0;i<t.length;i++)for(var r=(i+1)%t.length,o=0;o<n.length;o++){var s=(o+1)%n.length,s=this.GetLineSegmentCrossPoint(t[i],t[r],n[o],n[s]);s&&e.push(s)}for(var a=0;a<t.length;a++)this.IsPointInPolygon(n,t[a])&&e.push(t[a]);for(var u=0;u<n.length;u++)this.IsPointInPolygon(t,n[u])&&e.push(n[u]);return!(e.length<=0||(this.ClockwiseSortPoints(e),0))}}],(e=null)&&fm(n.prototype,e),i&&fm(n,i),Object.defineProperty(n,"prototype",{writable:!1}),t}();function dm(t,n){var e,i,r,o,s="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(s)return i=!(e=!0),{s:function(){s=s.call(t)},n:function(){var t=s.next();return e=t.done,t},e:function(t){i=!0,r=t},f:function(){try{e||null==s.return||s.return()}finally{if(i)throw r}}};if(Array.isArray(t)||(s=function(t,n){var e;if(t)return"string"==typeof t?vm(t,n):"Map"===(e="Object"===(e=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?vm(t,n):void 0}(t))||n&&t&&"number"==typeof t.length)return s&&(t=s),o=0,{s:n=function(){},n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:n};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function vm(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function pm(t){return(pm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function mm(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=pm(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=pm(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==pm(t)?t:String(t)}(i.key),i)}}var tv=function(){function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this.Gu={clearColor:16777215,clearAlpha:1},this.Cc=null,this.Dc=new Map,this.kc=new Map,this.Uc=new Map,this.Xu=new Map,this.Bc=new Map,this.Gc=new Map,this.Hc=new Map,this.Xc=new Map,this.Vc=new Map,this.zc=new Map,this.Wc=new Map,this.Yc=new Map,this.Qc=new Map,this.$u=null}var n,e,i;return n=t,(e=[{key:"resize",value:function(){this.Gu={clearColor:16777215,clearAlpha:1},this.Dc.clear(),this.kc.clear(),this.Uc.clear(),this.Xu.clear(),this.Bc.clear(),this.Gc.clear(),this.Hc.clear(),this.Xc.clear(),this.Vc.clear(),this.zc.clear(),this.Wc.clear(),this.Yc.clear(),this.Qc.clear()}}])&&mm(n.prototype,e),i&&mm(n,i),Object.defineProperty(n,"prototype",{writable:!1}),t}(),ym=(Object.assign(tv.prototype,{Zc:function(t,n,e){for(var i in n)t[i]=n[i];if(e)for(var r in e){var o=t[r];if(o){if(e[r].type)switch(e[r].type){case"toColor":o=Mr.toColor(o);break;case"toFloat":o=parseFloat(o);break;case"toRgba":o=Mr.toRgba(o);break;case"toString":o+=""}e[r].name?(t[e[r].name]=o,delete t[r]):t[r]=o}}return t},qc:function(t){this.resize(),t&&(this.sysPath=t.sysPath,this.userPath=t.userPath,this.logoPath=t.logoPath,this.sysModelPath=t.sysModelPath,this.userModelPath=t.userModelPath,this.Kc(t),this.Jc(t.extenttheme,E.EXTENT),this.Jc(t.storetheme,E.MODEL),this.$c(t.floorapply,E.MODEL),this.th(t.storeapply,E.MODEL),this.Jc(t.storelabeltheme,E.LABEL),this.$c(t.floorstorelabelapply,E.LABEL),this.th(t.storelabelapply,E.LABEL),this.Jc(t.poiimagetheme,E.FACILITY),this.$c(t.floorpoiimageapply,E.FACILITY),this.th(t.poiimageapply,E.FACILITY),this.Jc(t.externalmodeltheme,E.EXTERNAL_MODEL),this.$c(t.floorexternalapply,E.EXTERNAL_MODEL),this.th(t.externalmodelapply,E.EXTERNAL_MODEL),this.nh())},Kc:function(t){t.viewtheme&&((t=t.viewtheme).clearcolor&&(this.Gu.clearColor=Mr.toColor(t.clearcolor)),t.clearalpha&&(this.Gu.clearAlpha=parseFloat(t.clearalpha)),t.lighttheme)&&(this.Cc=t.lighttheme)},Jc:function(t,n){if(t){var e,i=dm(t);try{for(i.s();!(e=i.n()).done;){var r=e.value;if(r.id)switch(n){case E.EXTERNAL_MODEL:this.Wc.set(r.id,this.Zc({},r,{color:{type:"toColor"}}));break;case E.FACILITY:r.imagename&&this.Xc.set(r.id,this.Zc({},r,{imagename:{name:"imageName"}}));break;case E.LABEL:this.Bc.set(r.id,this.Zc({},r,{alpha:{type:"toFloat"},fillcolor:{name:"fillColor",type:"toRgba"},strokecolor:{name:"strokeColor",type:"toRgba"},platesize:{name:"plateSize"},platestrokecolor:{name:"plateStrokeColor",type:"toRgba"},platecolor:{name:"plateColor",type:"toRgba"},strokewidth:{name:"strokeWidth",type:"toFloat"},space:{type:"toFloat"},fontfamily:{name:"fontFamily"},fontweight:{name:"fontWeight",type:"toFloat"},imagesize:{name:"imageSize",type:"toFloat"}}));break;case E.MODEL:this.Dc.set(r.id,this.Zc({},r,{color:{type:"toColor"},alpha:{type:"toFloat"},strokecolor:{name:"strokeColor",type:"toColor"},strokewidth:{name:"strokeWidth",type:"toFloat"}}));break;case E.EXTENT:this.Xu.set(r.id,this.Zc({},r,{color:{type:"toColor"},alpha:{type:"toFloat"}}))}}}catch(t){i.e(t)}finally{i.f()}}},$c:function(t,n){if(t){var e,i=dm(t);try{for(i.s();!(e=i.n()).done;){var r,o=dm(e.value.typeapply);try{for(o.s();!(r=o.n()).done;){var s,a=r.value,u=this.Zc({},a,{normalid:{name:"normalID",type:"toString"},selectedid:{name:"selectID",type:"toString"}}),c=dm(a.type.split(","));try{for(c.s();!(s=c.n()).done;){var h=s.value;this.Ku(n).set(h,u)}}catch(t){c.e(t)}finally{c.f()}}}catch(t){o.e(t)}finally{o.f()}}}catch(t){i.e(t)}finally{i.f()}}},th:function(t,n){if(t){var e,i=dm(t);try{for(i.s();!(e=i.n()).done;){var r=e.value;if(r.fids){var o,s=this.Zc({},r,{normalid:{name:"normalID",type:"toString"},selectedid:{name:"selectID",type:"toString"}}),a=dm(r.fids.split(","));try{for(a.s();!(o=a.n()).done;){var u=o.value;this.Zu(n).set(u,s)}}catch(t){a.e(t)}finally{a.f()}}}}catch(t){i.e(t)}finally{i.f()}}},nh:function(){this.kc.get("0")&&this.Dc.get(this.kc.get("0").selectID)&&(this.$u=this.Dc.get(this.kc.get("0").selectID).color)},Zu:function(t){switch(t){case E.LABEL:return this.Hc;case E.FACILITY:return this.zc;case E.MODEL:return this.Uc;case E.EXTERNAL_MODEL:return this.Qc}},Ku:function(t){switch(t){case E.LABEL:return this.Gc;case E.FACILITY:return this.Vc;case E.MODEL:return this.kc;case E.EXTERNAL_MODEL:return this.Yc}},qu:function(t){switch(t){case E.LABEL:return this.Bc;case E.FACILITY:return this.Xc;case E.MODEL:return this.Dc;case E.EXTERNAL_MODEL:return this.Wc}},zn:function(){for(var t in this.resize(),this)this[""+t]=null,delete this[""+t]}}),tv);function bm(t){return(bm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function gm(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=bm(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=bm(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==bm(t)?t:String(t)}(i.key),i)}}function _m(t,n,e){n=Em(n);var i=t,n=wm()?Reflect.construct(n,e||[],Em(t).constructor):n.apply(t,e);if(n&&("object"===bm(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function wm(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(wm=function(){return!!t})()}function xm(){return(xm="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,n,e){var i=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=Em(t)););return t}(t,n);if(i)return(i=Object.getOwnPropertyDescriptor(i,n)).get?i.get.call(arguments.length<3?t:e):i.value}).apply(this,arguments)}function Em(t){return(Em=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Sm(t,n){return(Sm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var Tm=function(){var t,n=i,e=ym;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");function i(){var t;if(this instanceof i)return(t=_m(this,i)).Gu={},t;throw new TypeError("Cannot call a class as a function")}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&Sm(n,e),n=i,(e=[{key:"resize",value:function(){xm(Em(i.prototype),"resize",this).call(this),this.Gu={}}}])&&gm(n.prototype,e),t&&gm(n,t),Object.defineProperty(n,"prototype",{writable:!1}),i}();function Am(t){return(Am="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Mm(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=Am(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Am(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Am(t)?t:String(t)}(i.key),i)}}function Om(t,n,e){return n&&Mm(t.prototype,n),e&&Mm(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}Jd=Om(function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function")});Object.assign(Jd.prototype,{ss:function(t,n,e,i,r){r=void 0!==r?"?contentVersion=".concat(r):"";t=new Wh({method:"GET",url:t+n+"/"+n+".theme"+r});return t.ss(function(t){e&&e(t)},function(t){i&&i(t===vr.PATH_ERROR?vr.THEME_ID_URL_ERROR:t)}),t}});var Lm,Rm=new Jd,$d={NORMAL:1,INDOOR:2,OUTDOOR:4},Nm=(Object.freeze($d),$d),Pm=new Tt,Fm=new Tt,jm=new Tt,Im=new Mt,Cm=new Mt,Dm=new At,km=new Tt,Um=new Tt,Bm=new Tt,Gm=new Mt,Hm=new Mt,Xm=new Mt;function Vm(t){var n;a.call(this),this.type="Sprite",void 0===Lm&&(Lm=new ra,n=new lh(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5),Lm.setIndex([0,1,2,0,2,3]),Lm.setAttribute("position",new vh(n,3,0,!1)),Lm.setAttribute("uv",new vh(n,2,3,!1))),this.geometry=Lm,this.material=void 0!==t?t:new Ul,this.center=new Mt(.5,.5)}function zm(t,n,e,i,r,o){Im.subVectors(t,e).addScalar(.5).multiply(i),void 0!==r?(Cm.x=o*Im.x-r*Im.y,Cm.y=r*Im.x+o*Im.y):Cm.copy(Im),t.copy(n),t.x+=Cm.x,t.y+=Cm.y,t.applyMatrix4(Dm)}function Wm(t){return(Wm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ym(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=Wm(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Wm(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Wm(t)?t:String(t)}(i.key),i)}}Vm.prototype=Object.assign(Object.create(a.prototype),{constructor:Vm,isSprite:!0,raycast:function(t,n){null===t.camera&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),Fm.setFromMatrixScale(this.matrixWorld),Dm.copy(t.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(t.camera.matrixWorldInverse,this.matrixWorld),jm.setFromMatrixPosition(this.modelViewMatrix),t.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&Fm.multiplyScalar(-jm.z);var e,i,r=this.material.rotation,r=(0!==r&&(i=Math.cos(r),e=Math.sin(r)),this.center);zm(km.set(-.5,-.5,0),jm,r,Fm,e,i),zm(Um.set(.5,-.5,0),jm,r,Fm,e,i),zm(Bm.set(.5,.5,0),jm,r,Fm,e,i),Gm.set(0,0),Hm.set(1,0),Xm.set(1,1),null===t.ray.intersectTriangle(km,Um,Bm,!1,Pm)&&(zm(Um.set(-.5,.5,0),jm,r,Fm,e,i),Hm.set(0,1),null===t.ray.intersectTriangle(km,Bm,Um,!1,Pm))||(r=t.ray.origin.distanceTo(Pm))<t.near||r>t.far||n.push({distance:r,point:Pm.clone(),uv:ja.getUV(Pm,km,Um,Bm,Gm,Hm,Xm,new Mt),face:null,object:this})},clone:function(){return new this.constructor(this.material).copy(this)},copy:function(t){return a.prototype.copy.call(this,t),void 0!==t.center&&this.center.copy(t.center),this}});var e=function(){function n(t){if(!(this instanceof n))throw new TypeError("Cannot call a class as a function");this.eh=t,this.Jt=!0,this.ih=new Map,this.rh={x:1,y:1,z:1},this.oh=!0,this.wi=null}var t,e,i;return t=n,(e=[{key:"visible",get:function(){return this.Jt},set:function(t){this.Jt=t,this.ih.forEach(function(t){t.sh()})}},{key:"show",get:function(){return this.oh},set:function(t){t!==this.oh&&(this.oh=t,this.ah({opacity:t?1:0,duration:1,finish:function(){}}))}},{key:"setFacadeNode",value:function(t){var n=t.FID;t.type===E.LABEL&&(n="label"+t.FID),this.ih.set(n,t)}}])&&Ym(t.prototype,e),i&&Ym(t,i),Object.defineProperty(t,"prototype",{writable:!1}),n}(),Qm=(Object.assign(e.prototype,{qc:function(t){var n;this.oh=!this.eh.parent.Nt.qo(this.eh),this.eh.uh===Nm.NORMAL&&(this.eh.hh(),n=this.eh.parent.En.lr(this.eh.pi),this.rh.z=n.isZoomLimit?.2:1),t.Lt&&(t.mi===E.EXTERNAL_MODEL?(t.Lt.scale.x=this.rh.x,t.Lt.scale.y=this.rh.z,t.Lt.scale.z=this.rh.y):t.mi===E.MODEL&&(t.Lt.scale.x=this.rh.x,t.Lt.scale.y=this.rh.y,t.Lt.scale.z=this.rh.z)),this.ah({opacity:this.oh?1:0,duration:1,finish:function(){}})},fh:function(a,t){var u;t.scale.z===this.rh.z&&t.scale.y===this.rh.y||(u=void 0!==t.duration?t.duration:.5,this.rh=t.scale,this.ih.forEach(function(n){var e,i,r,o,s;n.mi!==E.MODEL&&n.mi!==E.EXTERNAL_MODEL||n.Lt&&(e=n.Lt.scale.x,i=n.Lt.scale.y,r=n.Lt.scale.z,o={x:t.scale.x-e,y:t.scale.z-i,z:t.scale.y-r},n.mi===E.MODEL&&(o={x:t.scale.x-e,y:t.scale.y-i,z:t.scale.z-r}),(s=new Rr({src:[0],dest:[1]})).Qn(u).qn(function(t){t=t.destination[0];n.Lt?(n.Lt.scale.x=o.x*t+e,n.Lt.scale.y=o.y*t+i,n.Lt.scale.z=o.z*t+r,a.enableUpdateRender()):a.$i.Ji(s)}).Kn(function(){a.$i.Ji(s),t.finish&&t.finish()}),a.$i.Zi(s.Vn()))}))},ah:function(i){var n=this,r=(this.wi?this.wi.finish():this.wi=new Rr,this.visible=!0,this.eh.parent),o=[];this.ih.forEach(function(e){e.Lt&&e.Lt.traverse(function(t){var n;t.constructor!==$a&&t.constructor!==Vm||(e.mi===E.MODEL&&(n=t.material.clone(),t.material.dispose(),t.material=n),n=t.material,Array.isArray(n)||(n=[n]),e.lh&&n.push(e.lh.material),n.forEach(function(t){"FMMeshStandardMaterial"===t.type?o.push({material:t,offset:i.opacity-t.uniforms.opacity.value,opacity:t.uniforms.opacity.value}):o.push({material:t,offset:i.opacity-t.opacity,opacity:t.opacity})}))})}),this.wi.Wn([0]).Yn([1]).Qn(i.duration).qn(function(t){for(var n=t.destination[0],e=0;e<o.length;e++)"FMMeshStandardMaterial"===o[e].material.type?o[e].material.uniforms.opacity.value=o[e].offset*n+o[e].opacity:o[e].material.opacity=o[e].offset*n+o[e].opacity,o[e].material.transparent=!0,o[e].needsUpdate=!0;r.enableUpdateRender()}).Kn(function(){n.visible=n.oh;for(var t=0;t<o.length;t++)"FMMeshStandardMaterial"===o[t].material.type?o[t].material.uniforms.opacity.value=o[t].opacity:o[t].material.opacity=o[t].opacity,o[t].needsUpdate=!0;r.$i.Ji(n.wi),i.finish&&i.finish(),r.enableUpdateRender()}).play(),r.$i.Zi(this.wi)}}),e);function Zm(t){return(Zm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function qm(t,n){var e,i,r,o,s="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(s)return i=!(e=!0),{s:function(){s=s.call(t)},n:function(){var t=s.next();return e=t.done,t},e:function(t){i=!0,r=t},f:function(){try{e||null==s.return||s.return()}finally{if(i)throw r}}};if(Array.isArray(t)||(s=function(t,n){var e;if(t)return"string"==typeof t?Km(t,n):"Map"===(e="Object"===(e=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Km(t,n):void 0}(t))||n&&t&&"number"==typeof t.length)return s&&(t=s),o=0,{s:n=function(){},n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:n};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Km(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function Jm(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=Zm(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Zm(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Zm(t)?t:String(t)}(i.key),i)}}function $m(t,n,e){n=i1(n);var i=t,n=t1()?Reflect.construct(n,e||[],i1(t).constructor):n.apply(t,e);if(n&&("object"===Zm(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return n1(i)}function t1(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(t1=function(){return!!t})()}function n1(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function e1(){return(e1="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,n,e){var i=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=i1(t)););return t}(t,n);if(i)return(i=Object.getOwnPropertyDescriptor(i,n)).get?i.get.call(arguments.length<3?t:e):i.value}).apply(this,arguments)}function i1(t){return(i1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function r1(t,n){return(r1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var tv=function(){var t,n=i,e=xs;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");function i(t){var n;if(this instanceof i)return(n=$m(this,i,[t])).dh=t.minlevel,n.ph=t.maxlevel,n.mh=t.levelChart,n.yh=t.fids,n.uh=Nm.NORMAL,n.bh=new Qm(n1(n)),n.gh=!1,n._h=new Map,n.wh=!0,n;throw new TypeError("Cannot call a class as a function")}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&r1(n,e),n=i,(e=[{key:"zoomRange",get:function(){return{minLevel:this.dh,maxLevel:this.ph}}},{key:"alignHeight",get:function(){return this.wh&&(this.xh(),this.wh=!1),this._h}},{key:"overviewMode",get:function(){return this.uh}},{key:"visible",get:function(){return this.Jt},set:function(t){this.Jt=t,this.Pn.Nt.Eh(this),this.Pn.enableUpdateNode()}},{key:"levelChart",get:function(){return this.mh}},{key:"setTheme",value:function(t){this.Pn.Nt.Sh({themeID:t,bid:this.pi})}},{key:"setThemeExtension",value:function(t){this.Pn.Nt.Th({data:t,bid:this.pi})}},{key:"clearThemeExtension",value:function(){this.Pn.Nt.Th({bid:this.pi})}},{key:"getFadeFeatures",value:function(){var t,n=[],e=qm(this.bh.ih.values());try{for(e.s();!(t=e.n()).done;){var i=t.value;n.push(i)}}catch(t){e.e(t)}finally{e.f()}return n}},{key:"dispose",value:function(){e1(i1(i.prototype),"dispose",this).call(this)}}])&&Jm(n.prototype,e),t&&Jm(n,t),Object.defineProperty(n,"prototype",{writable:!1}),i}(),o1=(Object.assign(tv.prototype,{Zi:function(t){(t.Pn=this).Ot.push(t)},hh:function(){var t,n=this.parent.En.lr(this.pi);this.uh===Nm.OUTDOOR?n.isZoomLimit=!1:(t=this.parent.getZoom(),n.isZoomLimit=!(t<this.dh||t>=this.ph))},Ah:function(){this.hh();var t=this.parent.En.lr(this.pi);this.bh.fh(this.parent,{scale:{x:1,y:1,z:t.isZoomLimit?.2:1},duration:1,finish:function(){}})},xh:function(){if(this.Pn)for(var t=this.Pn.Tn,n=0;n<this.mh.length;n+=2){var e=t.floorSpace*this.mh[n];this._h.set(this.mh[n+1],e)}},Mh:function(t){if(void 0===this.level||null===this.level)for(var n,e=0;e<this.mh.length;e+=2)this.mh[e]===t&&((n=this.parent.En.lr(this.pi)).level=this.mh[e+1],n.visibleLevels=[this.mh[e+1]])}}),tv);function s1(t,n){return Object.assign({},n.Ai,{buildingID:t.gr,level:t.level,visibleLevels:t.visibleLevels,bid:t.pi})}var Jd={NAME:2,ENAME:4,FID:8},a1=(Object.freeze(Jd),Jd);function u1(t){return(u1="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function c1(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,d1(i.key),i)}}function h1(t,n,e){n=m1(n);var i=t,n=f1()?Reflect.construct(n,e||[],m1(t).constructor):n.apply(t,e);if(n&&("object"===u1(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function f1(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(f1=function(){return!!t})()}function l1(t,n,e,i){return(l1="undefined"!=typeof Reflect&&Reflect.set?Reflect.set:function(t,n,e,i){var r,t=p1(t,n);if(t){if((r=Object.getOwnPropertyDescriptor(t,n)).set)return r.set.call(i,e),!0;if(!r.writable)return!1}if(r=Object.getOwnPropertyDescriptor(i,n)){if(!r.writable)return!1;r.value=e,Object.defineProperty(i,n,r)}else t=i,r=e,!((i=d1(i=n))in t?Object.defineProperty(t,i,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[i]=r);return!0})(t,n,e,i)}function d1(t){t=function(t,n){if("object"!=u1(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=u1(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==u1(t)?t:String(t)}function v1(){return(v1="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,n,e){var i=p1(t,n);if(i)return(i=Object.getOwnPropertyDescriptor(i,n)).get?i.get.call(arguments.length<3?t:e):i.value}).apply(this,arguments)}function p1(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=m1(t)););return t}function m1(t){return(m1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function y1(t,n){return(y1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var $d=function(){var t,n=r,e=xs;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");function r(t){var n;if(this instanceof r)return(n=h1(this,r,[t])).nt=t.height,n.Ar=t.bounds,n.Oh=t.zoom,n;throw new TypeError("Cannot call a class as a function")}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&y1(n,e),n=r,(e=[{key:"height",get:function(){return this.nt}},{key:"floorSpace",get:function(){return v1(m1(r.prototype),"floorSpace",this)},set:function(t){var n=this,e=m1(r.prototype),i=!0;if(!l1(e,"floorSpace",t,this||e)&&i)throw new TypeError("failed to set property");this.Pn.traverse(function(t){t!==n&&(t.wh=!0,t.traverse(function(t){t.Mr({animate:!1})}))}),this.Pn.Gt.pr(this,{level:this.level,animate:!1,finish:function(){n.parent.jt.Ht(),n.parent.jt.Mn()}})}},{key:"getFloors",value:function(){return this.Ot}}])&&c1(n.prototype,e),t&&c1(n,t),Object.defineProperty(n,"prototype",{writable:!1}),r}(),b1=(Object.assign($d.prototype,{Zi:function(t){(t.Pn=this).Ot.push(t)}}),$d);function g1(t){return(g1="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _1(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=g1(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=g1(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==g1(t)?t:String(t)}(i.key),i)}}var w1=function(){function o(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,e=2<arguments.length&&void 0!==arguments[2]?arguments[2]:0,i=this,r=o;if(!(i instanceof r))throw new TypeError("Cannot call a class as a function");Object.defineProperty(this,"isVector3",{value:!0}),this.x=t,this.y=n,this.z=e}var t,n,e;return t=o,(n=[{key:"set",value:function(t,n,e){return void 0===e&&(e=this.z),this.x=t,this.y=n,this.z=e,this}},{key:"clone",value:function(){return new this.constructor(this.x,this.y,this.z)}},{key:"copy",value:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}},{key:"sub",value:function(t,n){return void 0!==n?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,n)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this)}},{key:"subVectors",value:function(t,n){return this.x=t.x-n.x,this.y=t.y-n.y,this.z=t.z-n.z,this}},{key:"multiplyScalar",value:function(t){return this.x*=t,this.y*=t,this.z*=t,this}},{key:"dot",value:function(t){return this.x*t.x+this.y*t.y+this.z*t.z}},{key:"lengthSq",value:function(){return this.x*this.x+this.y*this.y+this.z*this.z}},{key:"length",value:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}},{key:"cross",value:function(t,n){return void 0!==n?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(t,n)):this.crossVectors(this,t)}},{key:"crossVectors",value:function(t,n){var e=t.x,i=t.y,t=t.z,r=n.x,o=n.y,n=n.z;return this.x=i*n-t*o,this.y=t*r-e*n,this.z=e*o-i*r,this}},{key:"angleTo",value:function(t){var n=Math.sqrt(this.lengthSq()*t.lengthSq());return 0===n?Math.PI/2:(t=this.dot(t)/n,n=Math.max(-1,Math.min(1,t)),Math.acos(n))}},{key:"normalize",value:function(){return this.divideScalar(this.length()||1)}},{key:"divideScalar",value:function(t){return this.multiplyScalar(1/t)}}])&&_1(t.prototype,n),e&&_1(t,e),Object.defineProperty(t,"prototype",{writable:!1}),o}();function x1(t){return(x1="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function E1(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=x1(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=x1(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==x1(t)?t:String(t)}(i.key),i)}}var S1=function(){function n(t){if(!(this instanceof n))throw new TypeError("Cannot call a class as a function");this.Zt=t.size,this.Kt=t.center,this.Lh=t.points}var t,e,i;return t=n,(e=[{key:"size",get:function(){return this.Zt}},{key:"min",get:function(){return{x:this.Kt.x-this.Zt.x/2,y:this.Kt.y-this.Zt.y/2}}},{key:"max",get:function(){return{x:this.Kt.x+this.Zt.x/2,y:this.Kt.y+this.Zt.y/2}}},{key:"center",get:function(){return{x:this.Kt.x,y:this.Kt.y}}},{key:"points",get:function(){return this.Lh}}])&&E1(t.prototype,e),i&&E1(t,i),Object.defineProperty(t,"prototype",{writable:!1}),n}();function T1(t){return(T1="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function A1(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=T1(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=T1(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==T1(t)?t:String(t)}(i.key),i)}}var M1=function(){function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function")}var n,e,i;return n=t,i=[{key:"distance",value:function(t,n){return z.distance(t,n)}},{key:"isContain",value:function(t,n){return z.isPolygonContainPoint(t,n)}},{key:"bound",value:function(t){for(var n=-Number.MAX_VALUE,e=-Number.MAX_VALUE,i=Number.MAX_VALUE,r=Number.MAX_VALUE,o=0;o<t.length;o++)t[o].x>n&&(n=t[o].x),t[o].y>e&&(e=t[o].y),t[o].x<i&&(i=t[o].x),t[o].y<r&&(r=t[o].y);return{max:{x:n,y:e},min:{x:i,y:r},size:{x:n-i,y:e-r},center:{x:(n+i)/2,y:(e+r)/2}}}},{key:"orientedBound",value:function(t){var n={center:{x:0,y:0},size:{x:0,y:0},rotation:{x:0,y:0},corners:[]};if(t&&0!=t.length){for(var e=Mr.cov(t),i=Mr.eig(e).eigVect,r=[],o=Number.MAX_VALUE,s=Number.MAX_VALUE,a=-Number.MAX_VALUE,u=-Number.MAX_VALUE,c=0;c<t.length;c++){var h=t[c].x*i[0][0]+t[c].y*i[0][1],f=t[c].x*i[1][0]+t[c].y*i[1][1];h<o&&(o=h),f<s&&(s=f),a<h&&(a=h),u<f&&(u=f),r.push([h,f])}var e=[(a+o)/2,(u+s)/2],l=i[0][0]*i[1][1]-i[1][0]*i[0][1],l=[[i[1][1]/l,-i[0][1]/l],[-i[1][0]/l,i[0][0]/l]],e=[l[0][0]*e[0]+l[0][1]*e[1],l[1][0]*e[0]+l[1][1]*e[1]],e=(n.center.x=e[0],n.center.y=e[1],n.size.x=a-o,n.size.y=u-s,[[o,s],[o,u],[a,u],[a,s]]),d=[[],[],[],[]],l=(d[0]=[l[0][0]*e[0][0]+l[0][1]*e[0][1],l[1][0]*e[0][0]+l[1][1]*e[0][1]],d[1]=[l[0][0]*e[1][0]+l[0][1]*e[1][1],l[1][0]*e[1][0]+l[1][1]*e[1][1]],d[2]=[l[0][0]*e[2][0]+l[0][1]*e[2][1],l[1][0]*e[2][0]+l[1][1]*e[2][1]],d[3]=[l[0][0]*e[3][0]+l[0][1]*e[3][1],l[1][0]*e[3][0]+l[1][1]*e[3][1]],new w1(1,0,0)),e=new w1(d[0][0],0,d[0][1]),e=new w1(d[3][0],0,d[3][1]).clone().sub(e).normalize(),v=e.angleTo(l)*z.de(),e=0<e.clone().cross(l).y?v:360-v,v=new w1(d[0][0],0,d[0][1]),v=new w1(d[1][0],0,d[1][1]).clone().sub(v).normalize(),p=v.angleTo(l)*z.de(),v=0<v.clone().cross(l).y;return n.rotation={x:e,y:v?p:360-p},n.corners=[{x:d[0][0],y:d[0][1]},{x:d[1][0],y:d[1][1]},{x:d[2][0],y:d[2][1]},{x:d[3][0],y:d[3][1]}],n}}},{key:"scaleBound",value:function(t,n){var e=t.max,t=t.min,e=new Mt(e.x,e.y),t=new Mt(t.x,t.y),i=e.clone().add(t).multiplyScalar(.5),e=e.clone().sub(t),t=e.clone().normalize(),e=e.clone().length()*n,n=i.clone().add(t.clone().multiplyScalar(e/2)),i=i.clone().add(t.clone().multiplyScalar(-e/2)),t=n.x,e=n.y,n=i.x,i=i.y;return{max:{x:t,y:e},min:{x:n,y:i},size:{x:Math.abs(t-n),y:Math.abs(e-i)},center:{x:(t+n)/2,y:(e+i)/2}}}},{key:"rectangleBuilder",value:function(t,n,e){var i=[];return i.push({x:e.x-t/2,y:e.y+n/2}),i.push({x:e.x+t/2,y:e.y+n/2}),i.push({x:e.x+t/2,y:e.y-n/2}),i.push({x:e.x-t/2,y:e.y-n/2}),i}},{key:"circleBuilder",value:function(t,n,e){for(var i=[],r=0;r<=e;r++){var o=r/e*Math.PI*2;i.push({x:n.x+t*Math.cos(o),y:n.y+t*Math.sin(o)})}return i}},{key:"fanBuilder",value:function(t,n,e,i){for(var r=[],o=(r.push(n),[i[0]/180*Math.PI,i[1]/180*Math.PI]),s=(o[1]-o[0])/e,a=0;a<=e;a++){var u=o[0]+a*s;r.push({x:n.x+t*Math.sin(u),y:n.y+t*Math.cos(u)})}return r}},{key:"area",value:function(t){return z.Fe(t,t.length)}},{key:"TriangleCentroid",value:function(t,n,e,i){var r=n.x-t.x,o=n.y-t.y,s=e.x-t.x,a=e.y-t.y;return i.area=(r*a-s*o)/2,i.centroid={},i.centroid.x=(t.x+n.x+e.x)/3,i.centroid.y=(t.y+n.y+e.y)/3,!0}},{key:"calculatorInsideCentroid",value:function(t,n){var e=t.length;if(e<3)return!1;for(var i=[],r=1;r<e-1;r++){var o={};this.TriangleCentroid(t[0],t[r],t[r+1],o),i.push(o)}var s=[],a=(i.forEach(function(t,n,e){s.push(t)}),!1);s.sort(function(t,n){return(0<t.area?t.area:-t.area)-(0<n.area?n.area:-n.area)});for(;0<s.length&&!(a=this.calculatorCentroid(t,s,n));)s.shift();if(!a){var u=[];i.forEach(function(t,n,e){u.push(t)});for(;0<u.length&&!(a=this.calculatorCentroid(t,u,n));)u.shift()}return a}},{key:"calculatorCentroid",value:function(t,n,e){for(var i=0,r={x:0,y:0},o=0;o<n.length;o++)r.x+=n[o].centroid.x*n[o].area,r.y+=n[o].centroid.y*n[o].area,i+=n[o].area;return e.x=r.x/i,e.y=r.y/i,this.isContain(t,e)}},{key:"latlngToMapCoordinate",value:function(t){return{x:20037508.34*parseFloat(t.x)/180,y:Math.log(Math.tan((90+parseFloat(t.y))*Math.PI/360))/(Math.PI/180)*20037508.34/180}}},{key:"mapCoordinateToLatlng",value:function(t){var n=parseFloat(t.y)/20037508.34*180;return{x:parseFloat(t.x)/20037508.34*180,y:180/Math.PI*(2*Math.atan(Math.exp(n*Math.PI/180))-Math.PI/2)}}},{key:"maxInnerRect",value:function(t,n){if(t&&0!=t.length){for(var e=new w1(0,0,1),i={center:{x:0,y:0},size:{x:0,y:0},rotation:{x:0,y:0},corners:[]},r=Number.MAX_VALUE,o=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=-Number.MAX_VALUE,u=[],c=0;c<t.length;c++){var h=t[c].x,f=t[c].y;h<r&&(r=h),f<o&&(o=f),s<h&&(s=h),a<f&&(a=f),u.push({x:h,y:f})}for(var l=void 0===n?.25:n,d=Math.ceil((s-r)/l),v=Math.ceil((a-o)/l),p=[],m=0;m<v-1;m++){for(var y=new Array(d-1).fill(0),b=0;b<d-1;b++){var g=r+l*b,_=r+l*(b+1),w=o+l*m,x=o+l*(m+1);z.isPolygonInPolygon([{x:g,y:w},{x:g,y:x},{x:_,y:x},{x:_,y:w}],u)&&(y[b]=1)}p.push(y)}for(var E=new Array(d).fill(0),C=0,D=0,k=0,U=0,B=0,S=0;S<v-1;S++)for(var T=[],A=0;A<d;A++){for(E[d-1]=0,A<d-1&&(E[A]=1==p[S][A]?E[A]+1:0);0<T.length&&E[T[T.length-1]]>=E[A];){var G=T[T.length-1],H=(T.pop(),E[G]*(0==T.length?A:A-T[T.length-1]-1));C<H&&(C=H,D=0==T.length?0:T[T.length-1]+1,k=A,B=(U=S)-E[G]+1)}T.push(A)}for(var n=r+D*l,M=o+(U+1)*l,O=r+(k+1)*l,L=o+B*l,R=[[n,L],[n,M],[O,M],[O,L]],N=0,P=2,X=Number.MAX_VALUE,V=-Number.MAX_VALUE,F=0;F<R.length;F++)R[F][0]*R[F][0]+R[F][1]*R[F][1]<X&&(X=R[N=F][0]*R[F][0]+R[F][1]*R[F][1]),R[F][0]*R[F][0]+R[F][1]*R[F][1]>V&&(V=R[P=F][0]*R[F][0]+R[F][1]*R[F][1]);i.corners=[{x:R[0][0],y:R[0][1]},{x:R[1][0],y:R[1][1]},{x:R[2][0],y:R[2][1]},{x:R[3][0],y:R[3][1]}],i.center.x=(R[P][0]+R[N][0])/2,i.center.y=(R[P][1]+R[N][1])/2;var n=new w1(R[N][0],0,R[N][1]),M=new w1(R[(N+P)/2][0],0,R[(N+P)/2][1]),O=M.clone().sub(n).normalize(),L=(O.angleTo(e),z.de(),O.clone().cross(e).y,new w1(R[(N+P)/2][0],0,R[(N+P)/2][1])),j=new w1(R[P][0],0,R[P][1]),I=j.clone().sub(L).normalize();I.angleTo(e),z.de();I.clone().cross(e).y;return O.clone().cross(I).y<0?(i.size.x=M.clone().sub(n).length(),i.size.y=j.clone().sub(L).length()):(i.size.x=j.clone().sub(L).length(),i.size.y=M.clone().sub(n).length()),new S1({center:i.center,size:i.size,points:i.corners})}}}],(e=null)&&A1(n.prototype,e),i&&A1(n,i),Object.defineProperty(n,"prototype",{writable:!1}),t}();function O1(n,t){var e,i=void 0!==(t=t||{}).duration?t.duration:1,r=void 0!==t.size?t.size:8,o=t.times||void 0,s=void 0!==t.delay?t.delay:0,a=1,u=n.yr(p);if(u)return n.wi.has("boost")?((e=n.wi.get("boost")).stop(),u.$i.Ji(e)):(e=new Rr({src:[n.Zt],dest:[r]}),n.wi.set("boost",e)),e.Qn(i).Vn().qn(function(t){n.Lt&&u.jt.Vo(n.Lt,t.destination[0]),u.enableUpdateRender()}).Kn(function(){var t;o<a||(t=0<a%1?0:s,e.ne().Zn(t).Vn(),u.enableUpdateRender(),a+=.5)}),u.$i.Zi(e),e}function L1(t){var n=t.yr(p),e=t.wi.get("boost");e&&n&&(n.$i.Ji(e),t.wi.delete("boost"),t.Lt&&n.jt.Vo(t.Lt,t.Zt),n.enableUpdateRender())}function R1(n,t){var e,i,r,o,s,a=n.yr(p);if(a)return e=void 0!==t.duration?t.duration:1,i=void 0!==t.times?t.times:1/0,r=void 0!==t.delay?t.delay:0,0===i&&(i=1/0),o=0,n.wi.has("jump")?((s=n.wi.get("jump")).Wn([n.nt]),s.Yn([n.nt+t.height])):(s=new Rr({src:[n.nt],dest:[n.nt+t.height]}),n.wi.set("jump",s),a.$i.Zi(s)),s.Qn(e).Zn(0).qn(function(t){n.Lt&&(n.Lt.position.y=t.destination[0]),a.enableUpdateRender()}).Kn(function(){var t;(o+=.5)<i&&(t=o%1==0?0:r,s.ne().Zn(t),s.Vn())}),s.Vn(),s}function N1(t){var n,e;t.Lt&&(n=t.yr(p))&&((e=t.wi.get("jump"))&&(n.$i.Ji(e),t.wi.delete("jump")),t.Lt.position.y=t.nt,n.enableUpdateRender())}function P1(t,n){var e;n.Lt&&(t=t.Rh(n.size||n.Zt),e=1,n.Lt.material.userData.scaleRatio&&(e=n.Lt.material.userData.scaleRatio),n.Lt.scale.set(t,t/e,t))}function F1(n){return!0===n.needUpdateBound&&(n.ai.reset(),n.Ot.forEach(function(t){n.ai.expand(t.bound)}),n.needUpdateBound=!1),n.ai.clone()}function j1(t){return(j1="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function I1(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,U1(i.key),i)}}function C1(t,n,e){n=H1(n);var i=t,n=D1()?Reflect.construct(n,e||[],H1(t).constructor):n.apply(t,e);if(n&&("object"===j1(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function D1(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(D1=function(){return!!t})()}function k1(t,n,e,i){return(k1="undefined"!=typeof Reflect&&Reflect.set?Reflect.set:function(t,n,e,i){var r,t=G1(t,n);if(t){if((r=Object.getOwnPropertyDescriptor(t,n)).set)return r.set.call(i,e),!0;if(!r.writable)return!1}if(r=Object.getOwnPropertyDescriptor(i,n)){if(!r.writable)return!1;r.value=e,Object.defineProperty(i,n,r)}else t=i,r=e,!((i=U1(i=n))in t?Object.defineProperty(t,i,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[i]=r);return!0})(t,n,e,i)}function U1(t){t=function(t,n){if("object"!=j1(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=j1(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==j1(t)?t:String(t)}function B1(){return(B1="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,n,e){var i=G1(t,n);if(i)return(i=Object.getOwnPropertyDescriptor(i,n)).get?i.get.call(arguments.length<3?t:e):i.value}).apply(this,arguments)}function G1(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=H1(t)););return t}function H1(t){return(H1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function X1(t,n){return(X1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var V1=function(){var t,n=r,e=ps;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");function r(){var t;if(this instanceof r)return(t=C1(this,r)).Co=new Ns,t;throw new TypeError("Cannot call a class as a function")}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&X1(n,e),n=r,(e=[{key:"scene",get:function(){return this.Co}},{key:"bound",get:function(){return F1(this)}},{key:"isLayer",get:function(){return!0}},{key:"visible",get:function(){return B1(H1(r.prototype),"visible",this)},set:function(t){var n=H1(r.prototype),e=t,i=!0;if(!k1(n,"visible",e,this||n)&&i)throw new TypeError("failed to set property");t?this.Co.parent||this.parent.effectScene.add(this.Co):this.Co.parent&&this.parent.effectScene.remove(this.Co)}},{key:"init",value:function(){this.Co.position.y=this.parent.nt}}])&&I1(n.prototype,e),t&&I1(n,t),Object.defineProperty(n,"prototype",{writable:!1}),r}();function z1(t){return(z1="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function W1(t,n){var e,i,r,o,s="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(s)return i=!(e=!0),{s:function(){s=s.call(t)},n:function(){var t=s.next();return e=t.done,t},e:function(t){i=!0,r=t},f:function(){try{e||null==s.return||s.return()}finally{if(i)throw r}}};if(Array.isArray(t)||(s=function(t,n){var e;if(t)return"string"==typeof t?Y1(t,n):"Map"===(e="Object"===(e=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Y1(t,n):void 0}(t))||n&&t&&"number"==typeof t.length)return s&&(t=s),o=0,{s:n=function(){},n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:n};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Y1(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function Q1(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=z1(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=z1(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==z1(t)?t:String(t)}(i.key),i)}}function Z1(t,n,e){n=K1(n);var i=t,n=q1()?Reflect.construct(n,e||[],K1(t).constructor):n.apply(t,e);if(n&&("object"===z1(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function q1(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(q1=function(){return!!t})()}function K1(t){return(K1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function J1(t,n){return(J1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var e=function(){var t,n=i,e=V1;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");function i(t){var n;if(this instanceof i)return(n=Z1(this,i)).Nh=[],void 0!==t&&void 0!==t.type&&(n.mi=t.type),n;throw new TypeError("Cannot call a class as a function")}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&J1(n,e),n=i,(e=[{key:"getMarkers",value:function(){return this.Ot}},{key:"add",value:function(t){t.Pn=this,t.Ph||t.qc()?this.R(t):this.Nh.push(t),this.needUpdateBound=!0}},{key:"remove",value:function(t){this.Fh(t),t.dispose();var n=this.Ot.indexOf(t),n=(-1<n&&this.Ot.splice(n,1),this.Nh.indexOf(t));-1<n&&this.Nh.splice(n,1),this.needUpdateBound=!0}},{key:"clear",value:function(){var t,n=W1(this.Ot);try{for(n.s();!(t=n.n()).done;){var e=t.value;this.Fh(e),e.dispose()}}catch(t){n.e(t)}finally{n.f()}this.Ot.length=0}},{key:"traverse",value:function(t){var n,e=W1(this.Ot);try{for(e.s();!(n=e.n()).done;){var i=n.value;t&&t(i)}}catch(t){e.e(t)}finally{e.f()}}},{key:"dispose",value:function(){var t,n=W1(this.Ot);try{for(n.s();!(t=n.n()).done;){var e=t.value;this.Fh(e),e.dispose()}}catch(t){n.e(t)}finally{n.f()}this.Ot.length=0,this.Co=void 0}}])&&Q1(n.prototype,e),t&&Q1(n,t),Object.defineProperty(n,"prototype",{writable:!1}),i}(),$1=(Object.assign(e.prototype,{jh:function(){var t,n=W1(this.Nh);try{for(n.s();!(t=n.n()).done;){var e,i=t.value;i.qc()&&(-1<(e=this.Nh.indexOf(i))&&this.Nh.splice(e,1),this.R(i))}}catch(t){n.e(t)}finally{n.f()}},R:function(t){this.Ot.push(t),t.Lt&&this.Co.add(t.Lt)},Fh:function(t){t.Pn=void 0,this.Co.remove(t.Lt)}}),e);function ty(t){return(ty="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ny(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=ty(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=ty(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==ty(t)?t:String(t)}(i.key),i)}}function ey(t,n,e){n=ry(n);var i=t,n=iy()?Reflect.construct(n,e||[],ry(t).constructor):n.apply(t,e);if(n&&("object"===ty(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function iy(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(iy=function(){return!!t})()}function ry(t){return(ry=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function oy(t,n){return(oy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}tv=function(){var t,n=i,e=$1;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");function i(){var t;if(this instanceof i)return(t=ey(this,i)).mi=E.IMAGE_MARKER,t.Zo=!0,t;throw new TypeError("Cannot call a class as a function")}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&oy(n,e),n=i,(e=[{key:"collision",get:function(){return this.Zo}}])&&ny(n.prototype,e),t&&ny(n,t),Object.defineProperty(n,"prototype",{writable:!1}),i}();function sy(t){return(sy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ay(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=sy(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=sy(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==sy(t)?t:String(t)}(i.key),i)}}function uy(t,n,e){n=hy(n);var i=t,n=cy()?Reflect.construct(n,e||[],hy(t).constructor):n.apply(t,e);if(n&&("object"===sy(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function cy(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(cy=function(){return!!t})()}function hy(t){return(hy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function fy(t,n){return(fy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}Jd=function(){var t,n=i,e=$1;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");function i(){var t;if(this instanceof i)return(t=uy(this,i)).mi=E.TEXT_MARKER,t.isHasText=!0,t.Zo=!0,t;throw new TypeError("Cannot call a class as a function")}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&fy(n,e),n=i,(e=[{key:"collision",get:function(){return this.Zo}}])&&ay(n.prototype,e),t&&ay(n,t),Object.defineProperty(n,"prototype",{writable:!1}),i}();function ly(t){return(ly="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function dy(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=ly(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=ly(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==ly(t)?t:String(t)}(i.key),i)}}function vy(t,n,e){n=my(n);var i=t,n=py()?Reflect.construct(n,e||[],my(t).constructor):n.apply(t,e);if(n&&("object"===ly(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function py(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(py=function(){return!!t})()}function my(t){return(my=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function yy(t,n){return(yy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}$d=function(){var t,n,e=r,i=$1;if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");function r(){var t;if(this instanceof r)return(t=vy(this,r)).mi=E.POLYGON_MARKER,t;throw new TypeError("Cannot call a class as a function")}return e.prototype=Object.create(i&&i.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),i&&yy(e,i),e=r,t&&dy(e.prototype,t),n&&dy(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}();function by(t){return(by="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function gy(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=by(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=by(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==by(t)?t:String(t)}(i.key),i)}}function _y(t,n,e){n=xy(n);var i=t,n=wy()?Reflect.construct(n,e||[],xy(t).constructor):n.apply(t,e);if(n&&("object"===by(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function wy(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(wy=function(){return!!t})()}function xy(t){return(xy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Ey(t,n){return(Ey=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}e=function(){var t,n,e=r,i=$1;if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");function r(){var t;if(this instanceof r)return(t=_y(this,r)).mi=E.EXTRUDE_MARKER,t;throw new TypeError("Cannot call a class as a function")}return e.prototype=Object.create(i&&i.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),i&&Ey(e,i),e=r,t&&gy(e.prototype,t),n&&gy(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}();function Sy(t){return(Sy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ty(t,n){var e,i,r,o,s="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(s)return i=!(e=!0),{s:function(){s=s.call(t)},n:function(){var t=s.next();return e=t.done,t},e:function(t){i=!0,r=t},f:function(){try{e||null==s.return||s.return()}finally{if(i)throw r}}};if(Array.isArray(t)||(s=function(t,n){var e;if(t)return"string"==typeof t?Ay(t,n):"Map"===(e="Object"===(e=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Ay(t,n):void 0}(t))||n&&t&&"number"==typeof t.length)return s&&(t=s),o=0,{s:n=function(){},n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:n};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Ay(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function My(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=Sy(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Sy(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Sy(t)?t:String(t)}(i.key),i)}}function Oy(t,n,e){n=Py(n);var i=t,n=Ly()?Reflect.construct(n,e||[],Py(t).constructor):n.apply(t,e);if(n&&("object"===Sy(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return Ry(i)}function Ly(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Ly=function(){return!!t})()}function Ry(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ny(){return(Ny="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,n,e){var i=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=Py(t)););return t}(t,n);if(i)return(i=Object.getOwnPropertyDescriptor(i,n)).get?i.get.call(arguments.length<3?t:e):i.value}).apply(this,arguments)}function Py(t){return(Py=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Fy(t,n){return(Fy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var jy=function(){var t,n=i,e=$1;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");function i(){var t;if(this instanceof i)return(t=Oy(this,i)).mi=E.HEAT_MAP_MARKER,t.Ih=!1,t.Ch=t.Ch.bind(Ry(t)),t;throw new TypeError("Cannot call a class as a function")}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&Fy(n,e),n=i,(e=[{key:"add",value:function(t){Ny(Py(i.prototype),"add",this).call(this,t),t.Ph&&!t.Dh&&this.kh(t.Uh),0<this.Nh.length&&this.yr(p).on("update",this.Ch)}},{key:"remove",value:function(t){Ny(Py(i.prototype),"remove",this).call(this,t),this.Ih&&this.kh(null)}}])&&My(n.prototype,e),t&&My(n,t),Object.defineProperty(n,"prototype",{writable:!1}),i}();Object.assign(jy.prototype,{jh:function(){var t,n=Ty(this.Nh);try{for(n.s();!(t=n.n()).done;){var e,i=t.value;i.qc()&&(-1<(e=this.Nh.indexOf(i))&&this.Nh.splice(e,1),this.R(i),i.Dh||this.kh(i.Uh),i.needUpdateBound=!0)}}catch(t){n.e(t)}finally{n.f()}},kh:function(i){var t=this.yr(v),n=t.getExtendMesh(),e=n.material.map;(n.material.map=i)?(n.material.mapMixColor=!0,n.material.map.needsUpdate=!0):n.material.mapMixColor=!1,n.material.needsUpdate=!0,t.getModelMeshs().forEach(function(t){if(t)if("MultiMaterial"===t.material.type)for(var n=t.material.materials.length,e=0;e<n;)(t.material.materials[e].map=i)?(t.material.materials[e].map.needsUpdate=!0,t.material.materials[e].mapMixColor=!0):(t.material.materials[e].mapMixColor=!1,t.material.materials[e].transparent=!0),t.material.materials[e].needsUpdate=!0,e+=0===e?3:2;else(t.material.map=i)?(t.material.mapMixColor=!0,t.material.map.needsUpdate=!0,1===t.material.opacity&&(t.material.transparent=!1)):(t.material.mapMixColor=!1,t.material.transparent=!0),t.material.needsUpdate=!0}),e&&(e.dispose(),e=null),this.Ih=!0},Ch:function(){this.jh(),0===this.Nh.length&&this.yr(p).off("update",this.Ch)}});function Iy(t,n){Td.call(this,t,n),this.type="AmbientLight",this.castShadow=void 0}function Cy(t){return(Cy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Dy(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=Cy(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Cy(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Cy(t)?t:String(t)}(i.key),i)}}Iy.prototype=Object.assign(Object.create(Td.prototype),{constructor:Iy,isAmbientLight:!0});var ky=function(){function n(t){if(!(this instanceof n))throw new TypeError("Cannot call a class as a function");this.gn=t,this.Bh=null,this.Gh=null,this.Hh=null,this.Xh=null,this.createLight=this.createLight.bind(this)}var t,e,i;return t=n,(e=[{key:"createLight",value:function(t,n){var e=this.gn.getMapOptions(),i=e.lockedLight,e=e.lightConfig[n];return t.Vh=new Iy(e[1].color,e[1].intensity),t.zh=new a,t.Wh=new Od(e[0].color,e[0].intensity),t.Wh.position.set(e[0].position.x,e[0].position.y,e[0].position.z),t.Wh.target=t.zh,t.Yh=new Od(e[2].color,e[2].intensity),t.Yh.position.set(e[2].position.x,e[2].position.y,e[2].position.z),t.Yh.target=t.zh,this.Bh=t,this.Gh=n,i&&(this.Qh=this.Qh.bind(this),this.gn.on("viewChanged",this.Qh)),this}},{key:"createLightByTheme",value:function(t,n,e){return t.Vh=new Iy(new lt("rgb("+e[1].color+")"),e[1].intensity),t.Wh=new Od(new lt("rgb("+e[0].color+")"),e[0].intensity),t.Wh.position.set(e[0].position.x,e[0].position.y,e[0].position.z),t.zh=new a,t.zh.position.set(e[0].target.x,e[0].target.y,e[0].target.z),t.Wh.target=t.zh,t.Yh=new Od(new lt("rgb("+e[2].color+")"),e[2].intensity),t.Yh.position.set(e[2].position.x,e[2].position.y,e[2].position.z),t.Zh=new a,t.Zh.position.set(e[2].target.x,e[2].target.y,e[2].target.z),t.Yh.target=t.Zh,this.Bh=t,this.Gh=n,this}}])&&Dy(t.prototype,e),i&&Dy(t,i),Object.defineProperty(t,"prototype",{writable:!1}),n}();function Uy(t,n,e){e.Lt=new $a(t,n),(e.Lt.mapNode=e).Lt.rotation.set(-Math.PI/2,0,0,"XYZ")}function By(n){var e=n.yr(p);e.Ai.hdr&&e.Ai.hdr.load(e,function(t){n.Co.environment=t,e.enableUpdateRender()})}function Gy(t,n,e){var i=new $a(new ma(200,200,1,1),new Ia({color:"#38382f",side:2}));return void 0!==t&&(i.rotation.y=t),i.position.set(n.x,n.y,n.z),e.parent.Co.add(i),i}function Hy(t){return(Hy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Xy(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=Hy(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Hy(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Hy(t)?t:String(t)}(i.key),i)}}function Vy(t,n,e){n=Yy(n);var i=t,n=zy()?Reflect.construct(n,e||[],Yy(t).constructor):n.apply(t,e);if(n&&("object"===Hy(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function zy(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(zy=function(){return!!t})()}function Wy(){return(Wy="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,n,e){var i=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=Yy(t)););return t}(t,n);if(i)return(i=Object.getOwnPropertyDescriptor(i,n)).get?i.get.call(arguments.length<3?t:e):i.value}).apply(this,arguments)}function Yy(t){return(Yy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Qy(t,n){return(Qy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}Object.assign(ky.prototype,{qh:function(t){var n=new wi;return n.setFromVector3(t),n.theta},Kh:function(t,n){var e=new wi,n=(e.setFromVector3(t),e.theta=n,new Tt);n.setFromSpherical(e),t.copy(n)},Qh:function(){var t,n,e;this.Bh&&(t=this.qh(this.gn.camera.position),null===this.Hh&&(n=this.qh(this.Bh.Wh.position),e=this.qh(this.Bh.Yh.position),this.Hh=n-t,this.Xh=e-t),n=t+this.Hh,this.Kh(this.Bh.Wh.position,n),e=t+this.Xh,this.Kh(this.Bh.Yh.position,e))},zn:function(){this.gn.getMapOptions().lockedLight&&this.gn.off("viewChanged",this.Qh)}});var Zy=function(){var t,n=i,e=$1;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");function i(){var t;if(this instanceof i)return(t=Vy(this,i)).scene.name="dynamicModel",t.mi=E.DYNAMIC_MODEL_MARKER,t;throw new TypeError("Cannot call a class as a function")}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&Qy(n,e),n=i,(e=[{key:"init",value:function(){Wy(Yy(i.prototype),"init",this).call(this),this.Jh(),this.$h(),By(this)}},{key:"remove",value:function(n){var t,e=this;n.tf?n.nf({src:[1],dest:[0],duration:1,callback:function(){var t=null==(t=n.Lt)?void 0:t.parent;t&&t.remove(n.Lt),Wy(Yy(i.prototype),"remove",e).call(e,n)}}):((t=null==(t=n.Lt)?void 0:t.parent)&&t.remove(n.Lt),Wy(Yy(i.prototype),"remove",this).call(this,n))}}])&&Xy(n.prototype,e),t&&Xy(n,t),Object.defineProperty(n,"prototype",{writable:!1}),i}();Object.assign(Zy.prototype,{Jh:function(){var t=this.yr(p);this.ef=new ky(t).createLight(this,"FMDynamicModelLayer")},$h:function(){var t=this;this.Co.add(this.Wh),this.Co.add(this.Vh),this.Co.add(this.Yh),this.Co.add(this.zh),this.Co.removeLight=function(){t.if()}},if:function(){this.Co.remove(this.Wh),this.Co.remove(this.Vh),this.Co.remove(this.Yh),this.ef.zn()}});function qy(t){return(qy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ky(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=qy(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=qy(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==qy(t)?t:String(t)}(i.key),i)}}function Jy(t,n,e){n=nb(n);var i=t,n=$y()?Reflect.construct(n,e||[],nb(t).constructor):n.apply(t,e);if(n&&("object"===qy(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function $y(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return($y=function(){return!!t})()}function tb(){return(tb="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,n,e){var i=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=nb(t)););return t}(t,n);if(i)return(i=Object.getOwnPropertyDescriptor(i,n)).get?i.get.call(arguments.length<3?t:e):i.value}).apply(this,arguments)}function nb(t){return(nb=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function eb(t,n){return(eb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var ib=function(){var t,n=i,e=$1;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");function i(){var t;if(this instanceof i)return(t=Jy(this,i)).mi=E.LINE_MARKER,t;throw new TypeError("Cannot call a class as a function")}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&eb(n,e),n=i,(e=[{key:"init",value:function(){tb(nb(i.prototype),"init",this).call(this),this.Co.position.y=0}}])&&Ky(n.prototype,e),t&&Ky(n,t),Object.defineProperty(n,"prototype",{writable:!1}),i}();function rb(t){return(rb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ob(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=rb(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=rb(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==rb(t)?t:String(t)}(i.key),i)}}function sb(t,n,e){n=cb(n);var i=t,n=ab()?Reflect.construct(n,e||[],cb(t).constructor):n.apply(t,e);if(n&&("object"===rb(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function ab(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(ab=function(){return!!t})()}function ub(){return(ub="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,n,e){var i=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=cb(t)););return t}(t,n);if(i)return(i=Object.getOwnPropertyDescriptor(i,n)).get?i.get.call(arguments.length<3?t:e):i.value}).apply(this,arguments)}function cb(t){return(cb=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function hb(t,n){return(hb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var fb=function(){var t,n=i,e=$1;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");function i(){var t;if(this instanceof i)return(t=sb(this,i)).mi=E.LOCATION_MARKER,t;throw new TypeError("Cannot call a class as a function")}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&hb(n,e),n=i,(e=[{key:"init",value:function(){ub(cb(i.prototype),"init",this).call(this),this.Co.position.y=0}}])&&ob(n.prototype,e),t&&ob(n,t),Object.defineProperty(n,"prototype",{writable:!1}),i}();function lb(t){return(lb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function db(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=lb(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=lb(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==lb(t)?t:String(t)}(i.key),i)}}function vb(t,n,e){n=mb(n);var i=t,n=pb()?Reflect.construct(n,e||[],mb(t).constructor):n.apply(t,e);if(n&&("object"===lb(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function pb(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(pb=function(){return!!t})()}function mb(t){return(mb=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function yb(t,n){return(yb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var bb=function(){var t,n=i,e=$1;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");function i(){var t;if(this instanceof i)return(t=vb(this,i)).mi=E.DOM_MARKER,t;throw new TypeError("Cannot call a class as a function")}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&yb(n,e),n=i,(e=[{key:"init",value:function(){}},{key:"add",value:function(t){this.Ot.push(t),this.needUpdateBound=!0}},{key:"remove",value:function(t){t=this.Ot.indexOf(t);-1<t&&this.Ot.splice(t,1),this.needUpdateBound=!0}},{key:"clear",value:function(){for(;0<this.Ot.length;)this.Ot[0].dispose();this.Ot.length=0,this.needUpdateBound=!0}},{key:"dispose",value:function(){this.Ot.length=0,this.Co=void 0}},{key:"visible",get:function(){return this.Jt},set:function(t){for(var n=0;n<this.Ot.length;n++)this.Ot[n].visible=t}}])&&db(n.prototype,e),t&&db(n,t),Object.defineProperty(n,"prototype",{writable:!1}),i}();function gb(t){return(gb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _b(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=gb(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=gb(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==gb(t)?t:String(t)}(i.key),i)}}function wb(t,n,e){n=Sb(n);var i=t,n=xb()?Reflect.construct(n,e||[],Sb(t).constructor):n.apply(t,e);if(n&&("object"===gb(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function xb(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(xb=function(){return!!t})()}function Eb(){return(Eb="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,n,e){var i=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=Sb(t)););return t}(t,n);if(i)return(i=Object.getOwnPropertyDescriptor(i,n)).get?i.get.call(arguments.length<3?t:e):i.value}).apply(this,arguments)}function Sb(t){return(Sb=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Tb(t,n){return(Tb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var i=function(){var t,n=i,e=ps;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");function i(t){if(this instanceof i)return(t=wb(this,i,[t])).rf=void 0,t;throw new TypeError("Cannot call a class as a function")}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&Tb(n,e),n=i,(e=[{key:"isbloom",get:function(){return this.rf},set:function(t){this.rf=t}},{key:"ID",get:function(){return this.G.pi}},{key:"level",get:function(){return this.Pn.Pn.Or}},{key:"x",get:function(){return this.bound.center.x}},{key:"y",get:function(){return this.bound.center.y}},{key:"height",get:function(){return this.G.height}},{key:"bound",get:function(){return!0===this.mr&&(this.G.ai=null,this.ai=this.G.getBound(),this.mr=!1),this.ai.clone()}},{key:"boundNoClone",get:function(){return 1==this.mr&&(this.G.ai=null,this.ai=this.G.getBound(),this.mr=!1),this.ai}},{key:"zoomRange",get:function(){return{maxLevel:this.G.maxLevel,minLevel:this.G.minLevel}}},{key:"visible",get:function(){return this.Jt},set:function(t){this.Jt=t,this.sh()}},{key:"getData",value:function(){var t=this.G;return{ID:t.pi,typeID:t.type,FID:t.fid,height:t.height,name:t.name,eName:t.ename,minLevel:t.minlevel,maxLevel:t.maxlevel}}},{key:"getBound",value:function(){var t=this.bound;return{maxY:t.max.y,maxX:t.max.x,minX:t.min.x,minY:t.min.y}}},{key:"getRenderNode",value:function(){return this.Lt}},{key:"dispose",value:function(){this.sf(),this.gn=null,Eb(Sb(i.prototype),"dispose",this).call(this)}}])&&_b(n.prototype,e),t&&_b(n,t),Object.defineProperty(n,"prototype",{writable:!1}),i}(),Ab=(Object.assign(i.prototype,{sh:function(){var t,n,e;this.mi===E.LABEL||this.mi===E.FACILITY?(e=(n=this).yr(p))&&(n.Lt&&e.Nt.Jo(),e.enableUpdateNode(),e.enableUpdateRender()):(e=(n=this).yr(p))&&(n.Lt&&(t=e.getZoom(),e.Nt.af(n,t)),e.enableUpdateNode(),e.enableUpdateRender())},sf:function(){var t;(t=this).Lt&&(t.Lt.parent&&t.Lt.parent.remove(t.Lt),t.Lt instanceof nh?t.Lt.children.forEach(function(t){t.geometry&&t.geometry.dispose(),t.geometry=void 0,t.material=void 0,t.mapNode=void 0}):(t.Lt.geometry.dispose(),t.Lt.geometry=void 0,t.Lt.material=void 0,t.Lt.mapNode=void 0),t.Lt=void 0)}}),i);function Mb(t){return(Mb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ob(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=Mb(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Mb(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Mb(t)?t:String(t)}(i.key),i)}}function Lb(t,n,e){n=Nb(n);var i=t,n=Rb()?Reflect.construct(n,e||[],Nb(t).constructor):n.apply(t,e);if(n&&("object"===Mb(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function Rb(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Rb=function(){return!!t})()}function Nb(t){return(Nb=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Pb(t,n){return(Pb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var i=function(){var t,n=i,e=Ab;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");function i(t){var n;if(this instanceof i)return(n=Lb(this,i)).G=t,n.nt=t.height,n.mi=E.EXTENT,n.uf=null,n.cf=null,n.Lt=null,n;throw new TypeError("Cannot call a class as a function")}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&Pb(n,e),n=i,(e=[{key:"zoomRange",get:function(){}},{key:"getData",value:function(){var t=this.G;return{ID:t.pi,height:t.height,area:t.area}}},{key:"getArea",value:function(){return M1.area(this.G.yi[0])}},{key:"coordinates",get:function(){return this.G.yi}}])&&Ob(n.prototype,e),t&&Ob(n,t),Object.defineProperty(n,"prototype",{writable:!1}),i}(),Fb=(Object.assign(i.prototype,{qc:function(){var t,n,e,i;this.Lt||(t=this.yr(p))&&(i=this.yr(xs),n=t.Nt.Sc(this.G,this.nt,i),this.uf=t.Nt.hf.Hu(i.pi),e=this.Qr(t,i.pi),i!==t.Tn&&(e.polygonOffset=!0,e.polygonOffsetFactor=-1,e.polygonOffsetUnits=-1),i===t.Tn&&1!==t.children.length&&1===t.Tn.Ot.length&&(e.stencilWrite=!0,e.stencilRef=1,e.stencilFunc=516,e.stencilFail=bi,e.stencilZFail=bi,e.stencilZPass=bi),i=this.G.getBound(),this.Lt=new $a(n.geometry,e),this.Lt.rotation.set(-Math.PI/2,0,0,"XYZ"),this.Lt.position.set(i.center.x-t.wt,-this.nt,t.xt-i.center.y),this.Lt.receiveShadow=!0,this.Lt.visible=this.Jt,(this.Lt.mapNode=this).Pn.Co.add(this.Lt))},ff:function(t,n){var e;this.Lt&&(e=this.yr(xs),this.uf=n.Hu(e.pi),this.lf())},df:function(t){t!==this.cf&&(this.cf=t,this.lf())},lf:function(){var t,n;this.Lt&&(t=this.yr(p))&&(n=this.yr(xs),this.Lt.material=this.Qr(t,n.pi),t.enableUpdateRender())},Qr:function(t,n){var e=this.yr(v),e={color:this.uf.color,alpha:this.uf.alpha*e.ft,buildingID:n},n=(this.cf&&(e.url=this.cf,e.finish=function(){t.enableUpdateRender()}),t.Nt.no.Eu(e));return n.polygonOffset=!0,n.polygonOffsetFactor=1,n.polygonOffsetUnits=4,n.userData.opacity=n.opacity,n},sh:function(){var t=this.yr(p);t&&(this.Lt&&(this.Lt.visible=this.Jt),t.enableUpdateNode(),t.enableUpdateRender())},updateMaterialByThemeTool:function(t){this.uf=t,this.lf()}}),i),jb=new jt;function Ib(t,n){this.object=t,void 0===n&&(n=16776960);var t=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),e=new Float32Array(24),i=new ra;i.setIndex(new R(t,1)),i.setAttribute("position",new R(e,3)),Hd.call(this,i,new Bl({color:n,toneMapped:!1})),this.matrixAutoUpdate=!1,this.update()}function Cb(t,n,e){this.vf=t,this.pf=n,this.mf=e||null;for(var i=n.tracks,r=i.length,o=new Array(r),s={endingStart:hi,endingEnd:hi},a=0;a!==r;++a){var u=i[a].createInterpolant(null);(o[a]=u).settings=s}this.yf=s,this.bf=o,this.gf=new Array(r),this._f=null,this.wf=null,this.xf=null,this.Ef=null,this.loop=2201,this.Sf=-1,this.Tf=null,this.time=0,this.timeScale=1,this.Af=1,this.weight=1,this.Mf=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}function Db(t,n,e){this.binding=t,this.valueSize=e;var i,r=Float64Array;switch(n){case"quaternion":i=this.Of;break;case"string":case"bool":r=Array,i=this.Lf;break;default:i=this.Rf}this.buffer=new r(4*e),this.Nf=i,this.cumulativeWeight=0,this.useCount=0,this.referenceCount=0}function kb(t){this.us=t,this.Pf(),this.Ff=0,this.time=0,this.timeScale=1}((Ib.prototype=Object.create(Hd.prototype)).constructor=Ib).prototype.update=function(t){var n,e,i;void 0!==t&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&jb.setFromObject(this.object),jb.isEmpty()||(t=jb.min,n=jb.max,(i=(e=this.geometry.attributes.position).array)[0]=n.x,i[1]=n.y,i[2]=n.z,i[3]=t.x,i[4]=n.y,i[5]=n.z,i[6]=t.x,i[7]=t.y,i[8]=n.z,i[9]=n.x,i[10]=t.y,i[11]=n.z,i[12]=n.x,i[13]=n.y,i[14]=t.z,i[15]=t.x,i[16]=n.y,i[17]=t.z,i[18]=t.x,i[19]=t.y,i[20]=t.z,i[21]=n.x,i[22]=t.y,i[23]=t.z,e.needsUpdate=!0,this.geometry.computeBoundingSphere())},Ib.prototype.setFromObject=function(t){return this.object=t,this.update(),this},Ib.prototype.copy=function(t){return Hd.prototype.copy.call(this,t),this.object=t.object,this},Ib.prototype.clone=function(){return(new this.constructor).copy(this)},Object.assign(Cb.prototype,{play:function(){return this.vf.jf(this),this},stop:function(){return this.vf.If(this),this.reset()},reset:function(){return this.paused=!1,this.enabled=!0,this.time=0,this.Sf=-1,this.Tf=null,this.stopFading().stopWarping()},isRunning:function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this.Tf&&this.vf.Cf(this)},isScheduled:function(){return this.vf.Cf(this)},startAt:function(t){return this.Tf=t,this},setLoop:function(t,n){return this.loop=t,this.repetitions=n,this},setEffectiveWeight:function(t){return this.weight=t,this.Mf=this.enabled?t:0,this.stopFading()},getEffectiveWeight:function(){return this.Mf},fadeIn:function(t){return this.Df(t,0,1)},fadeOut:function(t){return this.Df(t,1,0)},crossFadeFrom:function(t,n,e){var i,r;return t.fadeOut(n),this.fadeIn(n),e&&(r=(e=this.pf.duration)/(i=t.pf.duration),t.warp(1,i/e,n),this.warp(r,1,n)),this},crossFadeTo:function(t,n,e){return t.crossFadeFrom(this,n,e)},stopFading:function(){var t=this.Ef;return null!==t&&(this.Ef=null,this.vf.kf(t)),this},setEffectiveTimeScale:function(t){return this.timeScale=t,this.Af=this.paused?0:t,this.stopWarping()},getEffectiveTimeScale:function(){return this.Af},setDuration:function(t){return this.timeScale=this.pf.duration/t,this.stopWarping()},syncWith:function(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()},halt:function(t){return this.warp(this.Af,0,t)},warp:function(t,n,e){var i=this.vf,r=i.time,o=this.xf,s=this.timeScale,i=(null===o&&(o=i.Uf(),this.xf=o),o.parameterPositions),o=o.sampleValues;return i[0]=r,i[1]=r+e,o[0]=t/s,o[1]=n/s,this},stopWarping:function(){var t=this.xf;return null!==t&&(this.xf=null,this.vf.kf(t)),this},getMixer:function(){return this.vf},getClip:function(){return this.pf},getRoot:function(){return this.mf||this.vf.us},Gn:function(t,n,e,i){if(this.enabled){var r=this.Tf;if(null!==r){r=(t-r)*e;if(r<0||0===e)return;this.Tf=null,n=e*r}n*=this.Bf(t);var o=this.Gf(n),s=this.Hf(t);if(0<s)for(var a=this.bf,u=this.gf,c=0,h=a.length;c!==h;++c)a[c].evaluate(o),u[c].accumulate(i,s)}else this.Hf(t)},Hf:function(t){var n,e,i=0;return this.enabled&&(i=this.weight,null!==(n=this.Ef))&&(i*=e=n.evaluate(t)[0],t>n.parameterPositions[1])&&(this.stopFading(),0===e)&&(this.enabled=!1),this.Mf=i},Bf:function(t){var n,e=0;return this.paused||(e=this.timeScale,null!==(n=this.xf)&&(e*=n.evaluate(t)[0],t>n.parameterPositions[1])&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e)),this.Af=e},Gf:function(t){var n,e=this.time+t,i=this.pf.duration,r=this.loop,o=this.Sf,s=2202===r;if(0===t)return-1!==o&&s&&1==(1&o)?i-e:e;if(2200===r){-1===o&&(this.Sf=0,this.Xf(!0,!0,!1));t:{if(i<=e)e=i;else{if(!(e<0)){this.time=e;break t}e=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=e,this.vf.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else if(-1===o&&(0<=t?this.Xf(!(o=0),0===this.repetitions,s):this.Xf(0===this.repetitions,!0,s)),i<=e||e<0?(e-=i*(r=Math.floor(e/i)),o+=Math.abs(r),(n=this.repetitions-o)<=0?(this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=e=0<t?i:0,this.vf.dispatchEvent({type:"finished",action:this,direction:0<t?1:-1})):(1==n?this.Xf(n=t<0,!n,s):this.Xf(!1,!1,s),this.Sf=o,this.time=e,this.vf.dispatchEvent({type:"loop",action:this,loopDelta:r}))):this.time=e,s&&1==(1&o))return i-e;return e},Xf:function(t,n,e){var i=this.yf;e?(i.endingStart=fi,i.endingEnd=fi):(i.endingStart=t?this.zeroSlopeAtStart?fi:hi:2402,i.endingEnd=n?this.zeroSlopeAtEnd?fi:hi:2402)},Df:function(t,n,e){var i=this.vf,r=i.time,o=this.Ef,i=(null===o&&(o=i.Uf(),this.Ef=o),o.parameterPositions),o=o.sampleValues;return i[0]=r,o[0]=n,i[1]=r+t,o[1]=e,this}}),Object.assign(Db.prototype,{accumulate:function(t,n){var e=this.buffer,i=this.valueSize,r=t*i+i,t=this.cumulativeWeight;if(0===t){for(var o=0;o!==i;++o)e[r+o]=e[o];t=n}else this.Nf(e,r,0,n/(t+=n),i);this.cumulativeWeight=t},apply:function(t){var n=this.valueSize,e=this.buffer,i=t*n+n,t=this.cumulativeWeight,r=this.binding;this.cumulativeWeight=0,t<1&&this.Nf(e,i,3*n,1-t,n);for(var o=n,s=n+n;o!==s;++o)if(e[o]!==e[o+n]){r.setValue(e,i);break}},saveOriginalState:function(){var t=this.binding,n=this.buffer,e=this.valueSize,i=3*e;t.getValue(n,i);for(var r=e,o=i;r!==o;++r)n[r]=n[i+r%e];this.cumulativeWeight=0},restoreOriginalState:function(){var t=3*this.valueSize;this.binding.setValue(this.buffer,t)},Lf:function(t,n,e,i,r){if(.5<=i)for(var o=0;o!==r;++o)t[n+o]=t[e+o]},Of:function(t,n,e,i){at.slerpFlat(t,n,t,n,t,e,i)},Rf:function(t,n,e,i,r){for(var o=1-i,s=0;s!==r;++s){var a=n+s;t[a]=t[a]*o+t[e+s]*i}}}),kb.prototype=Object.assign(Object.create(X.prototype),{constructor:kb,Vf:function(t,n){var e=t.mf||this.us,i=t.pf.tracks,r=i.length,o=t.gf,s=t.bf,a=e.uuid,t=this.zf,u=t[a];void 0===u&&(t[a]=u={});for(var c=0;c!==r;++c){var h=i[c],f=h.name,l=u[f];if(void 0===l){if(void 0!==(l=o[c])){null===l._f&&(++l.referenceCount,this.Wf(l,a,f));continue}var d=n&&n.gf[c].binding.parsedPath;++(l=new Db(rv.create(e,f,d),h.ValueTypeName,h.getValueSize())).referenceCount,this.Wf(l,a,f)}o[c]=l,s[c].resultBuffer=l.buffer}},jf:function(t){if(!this.Cf(t)){null===t._f&&(n=(t.mf||this.us).uuid,e=t.pf.uuid,i=this.Yf[e],this.Vf(t,i&&i.knownActions[0]),this.Qf(t,e,n));for(var n,e,i,r=t.gf,o=0,s=r.length;o!==s;++o){var a=r[o];0==a.useCount++&&(this.Zf(a),a.saveOriginalState())}this.qf(t)}},If:function(t){if(this.Cf(t)){for(var n=t.gf,e=0,i=n.length;e!==i;++e){var r=n[e];0==--r.useCount&&(r.restoreOriginalState(),this.Kf(r))}this.Jf(t)}},Pf:function(){this.$f=[],this.tl=0,this.Yf={},this.mc=[],this.nl=0,this.zf={},this.el=[],this.il=0;var t=this;this.stats={actions:{get total(){return t.$f.length},get inUse(){return t.tl}},bindings:{get total(){return t.mc.length},get inUse(){return t.nl}},controlInterpolants:{get total(){return t.el.length},get inUse(){return t.il}}}},Cf:function(t){t=t._f;return null!==t&&t<this.tl},Qf:function(t,n,e){var i=this.$f,r=this.Yf,o=r[n];void 0===o?(o={knownActions:[t],actionByRoot:{}},t.wf=0,r[n]=o):(r=o.knownActions,t.wf=r.length,r.push(t)),t._f=i.length,i.push(t),o.actionByRoot[e]=t},rl:function(t){var n=this.$f,e=n[n.length-1],i=t._f,i=(n[e._f=i]=e,n.pop(),t._f=null,t.pf.uuid),e=this.Yf,n=e[i],r=n.knownActions,o=r[r.length-1],s=t.wf;r[o.wf=s]=o,r.pop(),t.wf=null,delete n.actionByRoot[(t.mf||this.us).uuid],0===r.length&&delete e[i],this.ol(t)},ol:function(t){for(var n=t.gf,e=0,i=n.length;e!==i;++e){var r=n[e];0==--r.referenceCount&&this.sl(r)}},qf:function(t){var n=this.$f,e=t._f,i=this.tl++,r=n[i];n[t._f=i]=t,n[r._f=e]=r},Jf:function(t){var n=this.$f,e=t._f,i=--this.tl,r=n[i];n[t._f=i]=t,n[r._f=e]=r},Wf:function(t,n,e){var i=this.zf,r=i[n],o=this.mc;void 0===r&&(i[n]=r={}),(r[e]=t)._f=o.length,o.push(t)},sl:function(t){var n=this.mc,e=t.binding,i=e.rootNode.uuid,e=e.path,r=this.zf,o=r[i],s=n[n.length-1],t=t._f;n[s._f=t]=s,n.pop(),delete o[e],0===Object.keys(o).length&&delete r[i]},Zf:function(t){var n=this.mc,e=t._f,i=this.nl++,r=n[i];n[t._f=i]=t,n[r._f=e]=r},Kf:function(t){var n=this.mc,e=t._f,i=--this.nl,r=n[i];n[t._f=i]=t,n[r._f=e]=r},Uf:function(){var t=this.el,n=this.il++,e=t[n];return void 0===e&&(t[(e=new fd(new Float32Array(2),new Float32Array(2),1,this.ul)).al=n]=e),e},kf:function(t){var n=this.el,e=t.al,i=--this.il,r=n[i];n[t.al=i]=t,n[r.al=e]=r},ul:new Float32Array(1),clipAction:function(t,n){var e=n||this.us,i=e.uuid,e="string"==typeof t?wd.findByName(e,t):t,t=null!==e?e.uuid:t,r=this.Yf[t],o=null;if(void 0!==r){var s=r.actionByRoot[i];if(void 0!==s)return s;o=r.knownActions[0],null===e&&(e=o.pf)}return null===e?null:(s=new Cb(this,e,n),this.Vf(s,o),this.Qf(s,t,i),s)},existingAction:function(t,n){var n=n||this.us,e=n.uuid,n="string"==typeof t?wd.findByName(n,t):t,n=n?n.uuid:t,t=this.Yf[n];return void 0!==t&&t.actionByRoot[e]||null},stopAllAction:function(){var t=this.$f,n=this.tl,e=this.mc,i=this.nl;this.tl=0;for(var r=this.nl=0;r!==n;++r)t[r].reset();for(r=0;r!==i;++r)e[r].useCount=0;return this},update:function(t){t*=this.timeScale;for(var n=this.$f,e=this.tl,i=this.time+=t,r=Math.sign(t),o=this.Ff^=1,s=0;s!==e;++s)n[s].Gn(i,t,r,o);for(var a=this.mc,u=this.nl,s=0;s!==u;++s)a[s].apply(o);return this},setTime:function(t){for(var n=this.time=0;n<this.$f.length;n++)this.$f[n].time=0;return this.update(t)},getRoot:function(){return this.us},uncacheClip:function(t){var n=this.$f,t=t.uuid,e=this.Yf,i=e[t];if(void 0!==i){for(var r=i.knownActions,o=0,s=r.length;o!==s;++o){var a=r[o],u=(this.If(a),a._f),c=n[n.length-1];a._f=null,a.wf=null,n[c._f=u]=c,n.pop(),this.ol(a)}delete e[t]}},uncacheRoot:function(t){var n,e=t.uuid,i=this.Yf;for(n in i){var r=i[n].actionByRoot[e];void 0!==r&&(this.If(r),this.rl(r))}var o=this.zf[e];if(void 0!==o)for(var s in o){s=o[s];s.restoreOriginalState(),this.sl(s)}},uncacheAction:function(t,n){t=this.existingAction(t,n);null!==t&&(this.If(t),this.rl(t))}});var i=t(11),Ub=t.n(i);function Bb(t){return(Bb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Gb(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=Bb(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Bb(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Bb(t)?t:String(t)}(i.key),i)}}var i=function(){function n(t){if(!(this instanceof n))throw new TypeError("Cannot call a class as a function");this.es=t,this.gn=this.es.map,this.cl={},this.cf=null,this.hl={},this.fl=0,this.nt=512,this.tt=512,this.ll=!1,this.jn=null,this.Gn=this.Gn.bind(this)}var t,e,i;return t=n,(e=[{key:"isAdded",get:function(){return this.ll}},{key:"add",value:function(t){var n=this;null===this.cf&&(this.cf=t),this.dl(function(t){n.vl(t)})}},{key:"dispose",value:function(t){this.gn.off("update",this.Gn),t&&t()}},{key:"stop",value:function(){this.gn.off("update",this.Gn)}}])&&Gb(t.prototype,e),i&&Gb(t,i),Object.defineProperty(t,"prototype",{writable:!1}),n}(),Hb=(Object.assign(i.prototype,{dl:function(n){var t=this.es.externalModel.getRenderNode();t.renderOrder=1,this.es.externalModel.pl?t.traverse(function(t){"Mesh"===t.type&&(t.renderOrder=1,n(t))}):n(t)},vl:function(i){var e=this,r=this,o=0,s=null;Array.isArray(i.material)?(this.cl[i.name]=[],function e(){o<i.material.length?r.lf(i.material[o],function(t,n){r.cl[i.name].push(i.material[o].clone()),n&&(i.material[o].dispose(),i.material[o]=t),o++,s=setTimeout(e,0)}):(null!==s&&clearTimeout(s),r.jn=(new Date).getTime(),r.gn.on("update",r.Gn))}()):this.lf(i.material,function(t,n){e.cl[i.name]=i.material.clone(),n&&(i.material.dispose(),i.material=t),e.jn=(new Date).getTime(),e.gn.on("update",r.Gn)})},lf:function(t,n){var e,i=null;t&&(this.es.externalModel.pl?t.uniforms&&t.uniforms.map&&t.uniforms.map.value?i=t.uniforms.map.value.name:t.map&&(i=""+t.map.name):t.map&&(i=""+t.map.name).indexOf(".gif")<0&&(i=t.name)),(null===i||!this.es.parent.ml||!this.es.parent.ml[i])&&null!==i&&0<=i.indexOf(".gif")?(t=(t=i.split("."))[0]+"."+t[1],(e=this.hl[t])?e.canvasArray&&0<e.canvasArray.length&&(e=new xh(e.canvasArray[e.canvascount]),this.es.externalModel.pl&&(e.flipY=!1),e.repeat.set(1,1),e.name=i,e.magFilter=Qn,e.minFilter=1008,(i=new Ia({map:e})).isBasic=!0,i.gifname=t,i.transparent=!0,n(i,!0)):this.yl(this.cf+t,t,function(t){n(t,!0)})):n(null,!1)},yl:function(t,e,i){var r=this,o=document.createElement("div"),s=(o.style.display="none",document.body.appendChild(o),new Image);s.crossOrigin="Anonymous",s.onload=function(){i&&((t=document.createElement("canvas")).width=r.tt,t.height=r.nt,t.getContext("2d").drawImage(s,0,0,r.tt,r.nt),t=new xh(t),r.es.externalModel.pl&&(t.flipY=!1),t.repeat.set(1,1),t.magFilter=Qn,t.minFilter=1008,(t=new Ia({map:t})).transparent=!0,t.isBasic=!0,t.gifname=e,i(t)),r.hl[e]={canvascount:0,canvasArray:[]},o.appendChild(s);var t,n=new Ub.a({gif:s});n.load(function(){r.bl(n,e,o)})},s.src=t},bl:function(e,i,r){var o=this,s=null,a=e.get_length(),u=1;this.hl[i].canvascount=0,function t(){{var n;a<u?(document.body.removeChild(r),null!==s&&clearTimeout(s)):(e.move_to(u),(n=document.createElement("canvas")).width=o.tt,n.height=o.nt,n.getContext("2d").drawImage(e.get_canvas(),0,0,o.tt,o.nt),o.hl[i].canvasArray.push(n),u++,s=setTimeout(t,0))}}()},gl:function(t,n){t=t.split("."),t=t[0]+"."+t[1];this.hl[t]&&(this.hl[t].canvasArray.length=0,this.hl[t].canvascount=0),this.yl(n,t),this.Gn(),this.ll||(this.ll=!0,this.gn.on("update",this.Gn))},Fa:function(t){var n=t.split("."),n=n[0]+"."+n[1];this.gl(t,this.cf+n)},Gn:function(){function r(t){50<=n&&t&&(t.canvascount<t.canvasArray.length-1?t.canvascount++:t.canvascount=0)}var o=this,t=(new Date).getTime(),n=t-this.jn;50<=n&&(this.jn=t);this.es.externalModel.getRenderNode()&&(this.dl(function(i){var t;if(Array.isArray(i.material))for(var n=i.material,e=0;e<n.length;e++)!function(e){var t;!n[e].isBasic||i.material[e].isupdate?o.lf(o.cl[i.name][e],function(t,n){n&&(i.material[e].dispose(),i.material[e]=t)}):((t=o.hl[n[e].gifname])&&t.canvasArray[t.canvascount]&&(i.material.isupdate?o.lf(o.cl[i.name][e],function(t,n){n&&(i.material[e].dispose(),i.material[e]=t)}):(i.material[e].map.image=t.canvasArray[t.canvascount],i.material[e].map.needsUpdate=!0)),r(t))}(e);else i.material.isBasic&&!i.material.isupdate?((t=o.hl[i.material.gifname])&&t.canvasArray[t.canvascount]&&(i.material.isupdate?o.lf(o.cl[i.name],function(t,n){n&&(i.material.dispose(),i.material=t)}):(i.material.map.image=t.canvasArray[t.canvascount],i.material.map.needsUpdate=!0)),r(t)):o.lf(o.cl[i.name],function(t,n){n&&(i.material.dispose(),i.material=t)})}),this.gn.enableUpdateRender())}}),i);function Xb(t,n,e,i,r,o,s,a,u){l.call(this,t,n,e,i,r,o,s,a,u),this.format=void 0!==s?s:he,this.minFilter=void 0!==o?o:Qn,this.magFilter=void 0!==r?r:Qn,this.generateMipmaps=!1}function Vb(t){return(Vb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function zb(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=Vb(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Vb(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Vb(t)?t:String(t)}(i.key),i)}}Xb.prototype=Object.assign(Object.create(l.prototype),{constructor:Xb,isVideoTexture:!0,update:function(){var t=this.image;t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}});var i=function(){function n(t){if(!(this instanceof n))throw new TypeError("Cannot call a class as a function");this.es=t,this._l=t.externalModel,this.gn=this.es.map,this.wl=[],this.xl=null,this.El={},this.Sl=null,this.ll=!1,this.oldmaterial={},this.cf=null,this.Tl={},this.Gn=this.Gn.bind(this)}var t,e,i;return t=n,(e=[{key:"isAdded",get:function(){return this.ll}},{key:"add",value:function(t){var n=this;null===this.cf&&(this.cf=t),this.dl(function(t){n.vl(t)}),this.gn.on("update",this.Gn)}},{key:"dispose",value:function(){for(var t=0;t<this.wl.length;t++){var n=this.wl[t];null!==document.getElementById(n)&&document.getElementById(n).parentNode.removeChild(document.getElementById(n))}this.gn.off("update",this.Gn)}},{key:"stop",value:function(){this.gn.off("update",this.Gn)}}])&&zb(t.prototype,e),i&&zb(t,i),Object.defineProperty(t,"prototype",{writable:!1}),n}(),Wb=(Object.assign(i.prototype,{dl:function(n){var t=this.es.externalModel.getRenderNode();this._l.pl?t.traverse(function(t){"Mesh"===t.type&&n(t)}):n(t)},vl:function(i){var e=this,r=this,o=i.material,s=0,a=null;Array.isArray(o)?(this.oldmaterial[i.name]=[],function e(){s<o.length?r.lf(o[s],function(t,n){r.oldmaterial[i.name].push(o[s].clone()),n&&(i.material[s].dispose(),i.material[s]=t),s++,a=setTimeout(e,0)}):null!==a&&clearTimeout(a)}()):this.lf(o,function(t,n){e.oldmaterial[i.name]=o.clone(),n&&(i.material.dispose(),i.material=t)})},lf:function(t,n){var e,i=this,r=null;t&&(this._l.pl?t.uniforms&&t.uniforms.map&&t.uniforms.map.value?r=t.uniforms.map.value.name:t.map&&(r=""+t.map.name):t.map&&(r=""+t.map.name).indexOf(".mp4")<0&&r.indexOf(".webm")<0&&r.indexOf(".ogg")<0&&(r=t.name)),(null===r||!this.es.parent.ml||!this.es.parent.ml[r])&&null!==r&&(0<=r.indexOf(".mp4")||0<=r.indexOf(".webm")||0<=r.indexOf(".ogg"))?(e=r.split("."),(t=(t=this.Tl[r])||this.El[e[0]+"."+e[1]])?((t=new Ia({map:t.clone()})).isBasic=!0,n&&n(t,!0)):this.Al(this.cf+e[0]+"."+e[1],function(t){t.name=r;t=new Ia({map:(i.El[e[0]+"."+e[1]]=t).clone()});t.isBasic=!0,n(t,!0)})):n(null,!1)},Al:function(t,e){var i=this,r=(this.Sl=t,null),n=document.createElement("div"),o=(n.style.display="none","xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var n=16*Math.random()|0;return("x"==t?n:3&n|8).toString(16)}));this.xl=o+"_div",this.wl.push(this.xl),n.setAttribute("id",this.xl),n.innerHTML='<video id="'+o+'" loop crossOrigin="anonymous" muted><source src="'+t+'"></video>',document.body.appendChild(n),function t(){var n=document.getElementById(o);n?(null!==r&&clearTimeout(r),n.addEventListener("loadeddata",function(){var t=new Xb(n);t.video_id=o+"_div",i._l.pl&&(t.flipY=!1),e&&e(t),n.play()})):r=setTimeout(t,0)}()},Ml:function(i){var r=this;this.es.externalModel.getRenderNode()&&this.dl(function(e){var t=e.material;if(Array.isArray(t))for(var n=0;n<t.length;n++)!function(n){r.lf(r.oldmaterial[e.name][n],function(t){t&&t.map&&t.map.name===i&&(e.material[n].dispose(),e.material[n]=t)})}(n);else r.lf(r.oldmaterial[e.name],function(t){t&&t.map&&t.map.name===i&&(e.material.dispose(),e.material=t)})})},Fa:function(t){var n;this.Tl[t]&&(n=this.Tl[t].video_id,null!==document.getElementById(n)&&document.getElementById(n).parentNode.removeChild(document.getElementById(n)),this.Tl[t].dispose(),this.Tl[t]=void 0,this.Ml(t))},gl:function(n,t){var e=this;this.Al(t,function(t){e.Tl[n]&&e.Fa(n),t.name=n,e.Tl[n]=t,e.Ml(n)}),this.ll||(this.ll=!0,this.gn.on("update",this.Gn))},Gn:function(){var i=this;this.es.externalModel.getRenderNode()&&(this.dl(function(e){var t=e.material;if(Array.isArray(t))for(var n=0;n<t.length;n++)!function(n){t[n].isBasic&&!t[n].isupdate||i.lf(i.oldmaterial[e.name][n],function(t){t&&(e.material[n].dispose(),e.material[n]=t)})}(n);else t.isBasic?t.isupdate&&i.lf(i.oldmaterial[e.name],function(t){t&&(e.material.dispose(),e.material=t)}):i.lf(i.oldmaterial[e.name],function(t){t&&(e.material.dispose(),e.material=t)})}),this.gn.enableUpdateRender())}}),i);function Yb(t){return(Yb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Qb(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=Yb(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Yb(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Yb(t)?t:String(t)}(i.key),i)}}var i=function(){function n(t){if(!(this instanceof n))throw new TypeError("Cannot call a class as a function");this.gn=t.parent.parent.parent.parent,this._l=t,this.Gn=this.Gn.bind(this),this.mi="no",this.Ol=new Hb({map:this.gn,externalModel:t,parent:this}),this.Ll=new Wb({map:this.gn,externalModel:t,parent:this}),this.ml=null,this.Rl=[],this.Nl={},this.gn.on("update",this.Gn)}var t,e,i;return t=n,(e=[{key:"gifTool",get:function(){return this.Ol}},{key:"videoTool",get:function(){return this.Ll}},{key:"isGltf",get:function(){return this._l.pl}},{key:"textureNames",get:function(){return this.Rl}},{key:"oldMaterial",get:function(){return this.Nl}},{key:"replace",value:function(t,n){null===this.ml&&(this.ml={}),this.ml[t]=!0}},{key:"reset",value:function(t){this.ml[t]=!1}},{key:"dispose",value:function(){this.Ol.ll&&this.Ol.dispose(),this.Ll.ll&&this.Ll.dispose()}}])&&Qb(t.prototype,e),i&&Qb(t,i),Object.defineProperty(t,"prototype",{writable:!1}),n}(),Zb=(Object.assign(i.prototype,{Gn:function(){function n(t,n){(t=i.Pl(t)).needgif&&!i.Ol.ll&&(i.Ol.add(n),i.Ol.ll=!0),t.needvideo&&!i.Ll.ll&&(i.Ll.add(n),i.Ll.ll=!0)}var e,i=this,t=this._l.getRenderNode();t&&(this.gn.off("update",this.Gn),e=this._l.Fl,this._l.pl?t.traverse(function(t){"Mesh"===t.type&&n(t,e)}):n(t,e))},Pl:function(t){function n(t){0<=t.indexOf(".gif")?(s=!0,r.Rl.push(t)):(0<=t.indexOf(".mp4")||0<=t.indexOf(".webm")||0<=t.indexOf(".ogg"))&&(a=!0,r.Rl.push(t))}function e(t,n){0<=t.indexOf(".gif")||0<=n.indexOf(".gif")?(s=!0,0<=t.indexOf(".gif")?r.Rl.push(t):r.Rl.push(n)):(0<=t.indexOf(".mp4")||0<=t.indexOf(".webm")||0<=t.indexOf(".ogg")||0<=n.indexOf(".mp4")||0<=n.indexOf(".webm")||0<=n.indexOf(".ogg"))&&(a=!0,0<=t.indexOf(".mp4")||0<=t.indexOf(".webm")||0<=t.indexOf(".ogg")?r.Rl.push(t):r.Rl.push(n))}var i,r=this,o={needgif:!1,needvideo:!1},s=!1,a=!1,u=t.material;if(Array.isArray(u)){this.Nl[t.name]=[];for(var c,h=0;h<u.length;h++)this.Nl[t.name].push(u[h].clone()),this._l.pl?u[h].uniforms&&u[h].uniforms.map&&u[h].uniforms.map.value?u[h].uniforms.map.value.name:u[h].map&&n(u[h].map.name):(c="",e(c=u[h].map?""+u[h].map.name:c,""+u[h].name))}else this.Nl[t.name]=u.clone(),this._l.pl?(i="",u.uniforms&&u.uniforms.map&&u.uniforms.map.value?i=u.uniforms.map.value.name:u.map&&(i=u.map.name),n(i)):(i="",e(i=u.map?""+u.map.name:i,""+u.name));return o.needgif=s,o.needvideo=a,o}}),i);function qb(t){return(qb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Kb(){Kb=function(){return s};var u,s={},t=Object.prototype,c=t.hasOwnProperty,h=Object.defineProperty||function(t,n,e){t[n]=e.value},n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",e=n.asyncIterator||"@@asyncIterator",r=n.toStringTag||"@@toStringTag";function o(t,n,e){return Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[n]}try{o({},"")}catch(u){o=function(t,n,e){return t[n]=e}}function a(t,n,e,i){var r,o,s,a,n=n&&n.prototype instanceof y?n:y,n=Object.create(n.prototype),i=new A(i||[]);return h(n,"_invoke",{value:(r=t,o=e,s=i,a=l,function(t,n){if(a===v)throw new Error("Generator is already running");if(a===p){if("throw"===t)throw n;return{value:u,done:!0}}for(s.method=t,s.arg=n;;){var e=s.delegate;if(e){e=function t(n,e){var i=e.method,r=n.iterator[i];if(r===u)return e.delegate=null,"throw"===i&&n.iterator.return&&(e.method="return",e.arg=u,t(n,e),"throw"===e.method)||"return"!==i&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+i+"' method")),m;i=f(r,n.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,m;r=i.arg;return r?r.done?(e[n.resultName]=r.value,e.next=n.nextLoc,"return"!==e.method&&(e.method="next",e.arg=u),e.delegate=null,m):r:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,m)}(e,s);if(e){if(e===m)continue;return e}}if("next"===s.method)s.sent=s.yn=s.arg;else if("throw"===s.method){if(a===l)throw a=p,s.arg;s.dispatchException(s.arg)}else"return"===s.method&&s.abrupt("return",s.arg);a=v;e=f(r,o,s);if("normal"===e.type){if(a=s.done?p:d,e.arg===m)continue;return{value:e.arg,done:s.done}}"throw"===e.type&&(a=p,s.method="throw",s.arg=e.arg)}})}),n}function f(t,n,e){try{return{type:"normal",arg:t.call(n,e)}}catch(t){return{type:"throw",arg:t}}}s.wrap=a;var l="suspendedStart",d="suspendedYield",v="executing",p="completed",m={};function y(){}function b(){}function g(){}var n={},_=(o(n,i,function(){return this}),Object.getPrototypeOf),_=_&&_(_(M([]))),w=(_&&_!==t&&c.call(_,i)&&(n=_),g.prototype=y.prototype=Object.create(n));function x(t){["next","throw","return"].forEach(function(n){o(t,n,function(t){return this._invoke(n,t)})})}function E(s,a){var n;h(this,"_invoke",{value:function(e,i){function t(){return new a(function(t,n){!function n(t,e,i,r){var o,t=f(s[t],s,e);if("throw"!==t.type)return(e=(o=t.arg).value)&&"object"==qb(e)&&c.call(e,"__await")?a.resolve(e.bn).then(function(t){n("next",t,i,r)},function(t){n("throw",t,i,r)}):a.resolve(e).then(function(t){o.value=t,i(o)},function(t){return n("throw",t,i,r)});r(t.arg)}(e,i,t,n)})}return n=n?n.then(t,t):t()}})}function S(t){var n={tryLoc:t[0]};1 in t&&(n.catchLoc=t[1]),2 in t&&(n.finallyLoc=t[2],n.afterLoc=t[3]),this.tryEntries.push(n)}function T(t){var n=t.completion||{};n.type="normal",delete n.arg,t.completion=n}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function M(n){if(n||""===n){var e,t=n[i];if(t)return t.call(n);if("function"==typeof n.next)return n;if(!isNaN(n.length))return e=-1,(t=function t(){for(;++e<n.length;)if(c.call(n,e))return t.value=n[e],t.done=!1,t;return t.value=u,t.done=!0,t}).next=t}throw new TypeError(qb(n)+" is not iterable")}return h(w,"constructor",{value:b.prototype=g,configurable:!0}),h(g,"constructor",{value:b,configurable:!0}),b.displayName=o(g,r,"GeneratorFunction"),s.isGeneratorFunction=function(t){t="function"==typeof t&&t.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},s.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,o(t,r,"GeneratorFunction")),t.prototype=Object.create(w),t},s.awrap=function(t){return{bn:t}},x(E.prototype),o(E.prototype,e,function(){return this}),s.AsyncIterator=E,s.async=function(t,n,e,i,r){void 0===r&&(r=Promise);var o=new E(a(t,n,e,i),r);return s.isGeneratorFunction(n)?o:o.next().then(function(t){return t.done?t.value:o.next()})},x(w),o(w,r,"Generator"),o(w,i,function(){return this}),o(w,"toString",function(){return"[object Generator]"}),s.keys=function(t){var n,e=Object(t),i=[];for(n in e)i.push(n);return i.reverse(),function t(){for(;i.length;){var n=i.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},s.values=M,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this.yn=u,this.done=!1,this.delegate=null,this.method="next",this.arg=u,this.tryEntries.forEach(T),!t)for(var n in this)"t"===n.charAt(0)&&c.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=u)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var i=this;function t(t,n){return o.type="throw",o.arg=e,i.next=t,n&&(i.method="next",i.arg=u),!!n}for(var n=this.tryEntries.length-1;0<=n;--n){var r=this.tryEntries[n],o=r.completion;if("root"===r.tryLoc)return t("end");if(r.tryLoc<=this.prev){var s=c.call(r,"catchLoc"),a=c.call(r,"finallyLoc");if(s&&a){if(this.prev<r.catchLoc)return t(r.catchLoc,!0);if(this.prev<r.finallyLoc)return t(r.finallyLoc)}else if(s){if(this.prev<r.catchLoc)return t(r.catchLoc,!0)}else{if(!a)throw new Error("try statement without catch or finally");if(this.prev<r.finallyLoc)return t(r.finallyLoc)}}}},abrupt:function(t,n){for(var e=this.tryEntries.length-1;0<=e;--e){var i=this.tryEntries[e];if(i.tryLoc<=this.prev&&c.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var r=i;break}}var o=(r=r&&("break"===t||"continue"===t)&&r.tryLoc<=n&&n<=r.finallyLoc?null:r)?r.completion:{};return o.type=t,o.arg=n,r?(this.method="next",this.next=r.finallyLoc,m):this.complete(o)},complete:function(t,n){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&&n&&(this.next=n),m},finish:function(t){for(var n=this.tryEntries.length-1;0<=n;--n){var e=this.tryEntries[n];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),T(e),m}},catch:function(t){for(var n=this.tryEntries.length-1;0<=n;--n){var e,i,r=this.tryEntries[n];if(r.tryLoc===t)return"throw"===(e=r.completion).type&&(i=e.arg,T(r)),i}throw new Error("illegal catch attempt")},delegateYield:function(t,n,e){return this.delegate={iterator:M(t),resultName:n,nextLoc:e},"next"===this.method&&(this.arg=u),m}},s}function Jb(t,n,e,i,r,o,s){try{var a=t[o](s),u=a.value}catch(t){return void e(t)}a.done?n(u):Promise.resolve(u).then(i,r)}function $b(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=qb(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=qb(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==qb(t)?t:String(t)}(i.key),i)}}function tg(t,n,e){return n&&$b(t.prototype,n),e&&$b(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var ng=tg(function t(n,e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this.gn=n,this._l=e,this.jl=null,this.Il=null,this.Cl=null,this.Dl=null,this.kl=null,this.Ul=new ad(rr),this.Ul.setResponseType("json"),this.Bl=this.Bl.bind(this),this.gn.on("zoom",this.Bl)});function eg(t){return(eg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ig(t,n){var e,i,r,o,s="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(s)return i=!(e=!0),{s:function(){s=s.call(t)},n:function(){var t=s.next();return e=t.done,t},e:function(t){i=!0,r=t},f:function(){try{e||null==s.return||s.return()}finally{if(i)throw r}}};if(Array.isArray(t)||(s=function(t,n){var e;if(t)return"string"==typeof t?rg(t,n):"Map"===(e="Object"===(e=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?rg(t,n):void 0}(t))||n&&t&&"number"==typeof t.length)return s&&(t=s),o=0,{s:n=function(){},n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:n};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function rg(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function og(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=eg(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=eg(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==eg(t)?t:String(t)}(i.key),i)}}function sg(t,n,e){n=hg(n);var i=t,n=ag()?Reflect.construct(n,e||[],hg(t).constructor):n.apply(t,e);if(n&&("object"===eg(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return ug(i)}function ag(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(ag=function(){return!!t})()}function ug(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function cg(){return(cg="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,n,e){var i=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=hg(t)););return t}(t,n);if(i)return(i=Object.getOwnPropertyDescriptor(i,n)).get?i.get.call(arguments.length<3?t:e):i.value}).apply(this,arguments)}function hg(t){return(hg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function fg(t,n){return(fg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}Object.assign(ng.prototype,{Gl:function(){var n=this;this._l.Hl({needFadeIn:!1,needFadeOut:!1,initLODMesh:!1,lodName:this.Il,callback:function(t){t!==n.Il&&n.Gl()}})},Bl:function(){var a,e=this;return a=Kb().mark(function t(){var n;return Kb().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:n=e.Xl(e.jl,e.gn.getZoom()),e.Il!==n&&null!==n&&(e.Il=n,null!==e.kl&&clearTimeout(e.kl),e.Gl(),e.kl=setTimeout(function(){},50));case 2:case"end":return t.stop()}},t)}),function(){var t=this,s=arguments;return new Promise(function(n,e){var i=a.apply(t,s);function r(t){Jb(i,n,e,r,o,"next",t)}function o(t){Jb(i,n,e,r,o,"throw",t)}r(void 0)})}()},Xl:function(t,n){if(!t)return null;var e=this._l.G,i=e.maxlevel;if(n<e.minlevel||i<n)return null;for(var r=null,o=0;o<t.length;o++){var s=t[o],a=s.maxlevel;if(s.minlevel<=n&&n<=a){r=s.name;break}}return r},Vl:function(o){var s=this;return this.Dl!==o&&(this.Dl=o,this.Cl=null),new Promise(function(i,r){s.zl(o).then(function(t){t.lod&&Array.isArray(t.lod)||r("lod format error");var n=s.Xl(t.lod,s.gn.getZoom()),e=(null===n&&r(null),B0(o));s.jl=t.lod,i("".concat(e).concat(n))}).catch(r)})},zl:function(e){var i=this;return new Promise(function(n,t){i.Cl?n(i.Cl):i.Ul.load(e,function(t){i.Cl=t,n(i.Cl)},null,t)})},zn:function(){this.gn.off("zoom",this.Bl),this.Ul=null}});var i=function(){var t,n=i,e=Ab;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");function i(t){var n;if(this instanceof i)return(n=sg(this,i)).G=t,n.mi=E.EXTERNAL_MODEL,n.uf=null,n.Lt=null,n.Wl=null,n.Yl=null,n.ft=null,n.Ql=!1,n.Yr=null,n.pl=null,n.vf=null,n.$f=[],n.bh=null,n.Zl=n.Zl.bind(ug(n)),n.ql=new Rr,n.Kl=!0,n.Jl=null,n.Fl=null,n.$l=!1,n.Zr=null,n.Kr=null,n.t0=null,n.n0=!1,n.e0=null,n.i0=null,n.r0=!1,n.o0=null,n.Rl=[],n.s0=!1,n;throw new TypeError("Cannot call a class as a function")}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&fg(n,e),n=i,(e=[{key:"multiMediaTool",get:function(){return this.Jl}},{key:"fading",get:function(){return!this.ql.Bn}},{key:"FID",get:function(){return this.G.fid}},{key:"typeID",get:function(){return this.G.type}},{key:"name",get:function(){return this.G.name}},{key:"eName",get:function(){return this.G.ename}},{key:"color",get:function(){return this.Yl},set:function(t){this.Yl=t,this.lf()}},{key:"opacity",get:function(){return this.ft},set:function(t){this.ft=t,this.lf()}},{key:"canDispose",get:function(){return this._canDispose}},{key:"show",get:function(){return this.oh},set:function(t){t?this.bh&&!this.bh.show||this.a0():this.u0()}},{key:"isGltf",get:function(){return this.pl}},{key:"boundNoClone",get:function(){var t=this.getBound();return t?{min:{x:t.minX,y:t.minY},max:{x:t.maxX,y:t.maxY}}:null}},{key:"resetColor",value:function(){this.Ql=!0,this.lf()}},{key:"setColor",value:function(t,n){this.Yl=t,this.ft=n,this.lf()}},{key:"beforRemove",value:function(){var t=null==(t=this.parent)||null==(t=t.parent)?void 0:t.parent;this.$l=!t||!t.visibleLevels.includes(this.level)}},{key:"getBound",value:function(){if(this.Wl)return this.Wl;var t={};if(this.Lt){for(var n=new Ib(this.Lt,16776960),e=n.geometry.attributes.position.array,i=n.geometry.attributes.position.count,r=0;r<i;r++){var o=e[3*r],s=e[3*r+2],a=e[3*r+1];(!t.minX||o<t.minX)&&(t.minX=o),(!t.maxX||t.maxX<o)&&(t.maxX=o),(!t.minY||s<t.minY)&&(t.minY=s),(!t.maxY||t.maxY<s)&&(t.maxY=s),(!t.minH||a<t.minH)&&(t.minH=a),(!t.maxH||t.maxH<a)&&(t.maxH=a)}n.material.dispose(),n.geometry.dispose(),n.material=void 0,n.geometry=void 0;var n=this.yr(p);return t.minX=t.minX+n.x,t.maxX=t.maxX+n.x,t.minY=n.y-t.minY,t.maxY=n.y-t.maxY,t.maxY<t.minY&&(n=t.minY,t.minY=t.maxY,t.maxY=n),this.Wl=t,this.Wl}}},{key:"startAction",value:function(t,n,e){var i=this.$f[t];if(i){if(n){for(var r=this.getActionNames(),o=0;o<r.length;o++)r[o]!==t&&!0===this.$f[r[o]].clampWhenFinished&&!0===this.$f[r[o]].paused&&this.$f[r[o]].stop();i.loop=2200,i.clampWhenFinished=!0}else i.clampWhenFinished=!1,i.loop=2201;this.e0&&this.e0===t?this.e0===t&&(n=!1,i.time=this.i0,e?this.r0?n=!0:(n=!1,this.e0=null,this.i0=null):(this.e0=null,this.i0=null,this.r0=!1),i.paused=n,i.play()):i.reset().setEffectiveTimeScale(1).setEffectiveWeight(1).play()}e=this.yr(p);e&&e.on("beforeRender",this.Zl)}},{key:"getActionNames",value:function(){return Object.keys(this.$f)}},{key:"stopAction",value:function(t,n){var e=this.yr(p),e=(e&&e.off("beforeRender",this.Zl),this.$f[t]);e&&(e.paused=!0,this.e0=t,this.i0=e.time,this.o0=e.loop,n||(this.r0=!0))}},{key:"dispose",value:function(){null!==this.Jl&&this.Jl.dispose(),this.sf(),cg(hg(i.prototype),"dispose",this).call(this)}},{key:"getTextureNames",value:function(){return this.Rl}}])&&og(n.prototype,e),t&&og(n,t),Object.defineProperty(n,"prototype",{writable:!1}),i}(),lg=(Object.assign(i.prototype,{qc:function(t){var n=this;this.$l=!1,!this.Lt&&this.G&&this.c0(function(){n.bh&&n.bh.qc(n),t&&t()},{initLODMesh:!0})},Gl:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{needFadeIn:!0,needFadeOut:!0,initLODMesh:!0};this.Lt&&this.Pn.Co.remove(this.Lt),this.Lt=null,this.c0(null,t)},Hl:function(){var n=this,e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{needFadeIn:!0,needFadeOut:!0,initLODMesh:!1};this.c0(function(t){e.onLoaded=function(){n.Lt&&n.Pn.Co.remove(n.Lt),n.Lt=null},n.h0(t,function(){e.callback&&e.callback(e.lodName)},e)},e)},ff:function(){this.Gl()},h0:function(t,i){var r=this,o=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},s=this.yr(p);s.Nt.f0.Ra(t,function(t,n,e){r.pl=t,o.onLoaded&&o.onLoaded(),r.pl?r.l0(n,o):r.d0(n,e,r.uf),st.a.environment===B.a.BROWSER&&null===r.Jl&&(r.Jl=new Zb(r)),s.enableUpdateRender(),i&&i()})},c0:function(n,e){var t,i=this,r=(e=e||{},this.yr(p)),o=this.yr(xs);this.uf=r.Nt.hf.Qu({fid:this.G.fid,typeID:this.G.type+"",bid:o.pi}),this.uf&&this.uf.normalID&&(t=r.Nt.p0(this.uf,"model",o.buildingID)+this.uf.model+"?keyValue="+r.Ai.key,null===this.Fl&&(this.Fl=r.Nt.p0(this.uf,"model",o.buildingID)),t.includes(".json")?(this.m0||(this.m0=new ng(r,this)),this.m0.Vl(t).then(function(t){!1!==e.initLODMesh?i.h0(t,n,e):n&&n(t)})):this.h0(t,n))},y0:function(t,n){this.Ql&&void 0!==t.userData.originColor&&(this.Yl=t.userData.originColor,t.color=t.userData.originColor,void 0!==t.userData.originOpacity)&&(t.opacity=t.userData.originOpacity*n.ft,this.ft=t.userData.originOpacity)},d0:function(t,n,e){if(!this.Lt){var i=this.yr(v);if(i){var r=i.yr(p);if(Array.isArray(n)){var o,s=ig(n);try{for(s.s();!(o=s.n()).done;){var a=o.value;a.map&&(a.map.wrapS=Hn,a.map.wrapT=Hn),a.userData.sourceTransparent=a.transparent,a.userData.sourceOpacity=a.opacity,void 0===a.userData.originColor&&(a.userData.originColor=a.color),void 0===a.userData.originOpacity&&(a.userData.originOpacity=a.opacity),a.opacity=a.userData.sourceOpacity*i.ft,a.opacity<1&&(a.transparent=!0)}}catch(t){s.e(t)}finally{s.f()}}else n.map&&(n.map.wrapS=Hn,n.map.wrapT=Hn),n.userData.sourceOpacity=n.opacity,n.userData.sourceTransparent=n.transparent,void 0===n.userData.originColor&&(n.userData.originColor=n.color),void 0===n.userData.originOpacity&&(n.userData.originOpacity=n.opacity),n.opacity=n.userData.sourceOpacity*i.ft,n.opacity<1&&(n.transparent=!0);var u=[];if(void 0!==n.length)for(var c=0;c<n.length;c++){var h=n[c].clone();this.Yl&&(h.color=new lt(this.Yl)),null!==this.ft&&(h.opacity=this.ft),this.y0(h,i),u.push(h)}else{var f=n.clone();this.Yl&&(f.color=new lt(this.Yl)),null!==this.ft&&(f.opacity=this.ft),this.y0(f,i),u.push(f)}if(this.Ql=!1,!this.s0){for(var l=0;l<u.length;l++)u[l].map&&this.Rl.push(u[l].name);this.s0=!0}this.Lt=new $a(t,u),this.Yr&&this.lf(),this.bh||this.a0();var f=e.scale.split(","),t=(this.Lt.scale.set(parseFloat(f[0]),parseFloat(f[2]),parseFloat(f[1])),e.rotate.split(",")),f=new Tt,d=Math.PI/180,t=(f.set(parseFloat(t[0])*d,parseFloat(t[2])*d,parseFloat(t[1])*d),this.Lt.rotation.setFromVector3(f,"YXZ"),e.translate.split(",")),d=new Tt(this.G.yi[0].x-r.wt,this.G.yi[0].y-r.xt,0).applyEuler(new Y(-Math.PI/2,0,0,"XYZ")).add(new Tt(0,-1===this.G.height?2.2:this.G.height,0));d.add(new Tt(parseFloat(t[0]),parseFloat(t[2]),parseFloat(t[1]))),this.Lt.position.set(d.x,d.y,d.z),(this.Lt.mapNode=this).Pn.Co.add(this.Lt)}}},l0:function(t,n){var e=this,r=this;if(n=n||{},!this.Lt){var i=this.yr(p);if(i){var o=t.scene,s=this.uf.rotate.split(","),a=new Tt,u=Math.PI/180,s=(a.set(parseFloat(s[0])*u,parseFloat(s[2])*u,parseFloat(s[1])*u),o.rotation.setFromVector3(a,"YXZ"),this.uf.scale.split(",")),u=(o.scale.set(parseFloat(s[0]),parseFloat(s[2]),parseFloat(s[1])),this.uf.translate.split(",")),a=new Tt(this.G.yi[0].x-i.wt,this.G.yi[0].y-i.xt,0).applyEuler(new Y(-Math.PI/2,0,0,"XYZ")).add(new Tt(0,-1===this.G.height?2.2:this.G.height,0));if(a.add(new Tt(parseFloat(u[0]),parseFloat(u[2]),parseFloat(u[1]))),o.position.set(a.x,a.y,a.z),this.Lt=o,(this.Lt.mapNode=this).s0||(!function t(n){"Mesh"===n.type&&n.material.map&&r.Rl.push(n.material.map.name);var e=n.children;for(var i=0;i<e.length;i++)t(e[i])}(this.Lt),this.s0=!0),this.lf(),this.b0(function(){e.Pn.Co.add(e.Lt),e.Jt&&(e.Lt.visible=!0),e.bh||null!==e.Zr||e.a0({duration:!1===n.needFadeIn?0:void 0})}),0<t.animations.length){this.vf=new kb(this.Lt);var c,h=ig(t.animations);try{for(h.s();!(c=h.n()).done;){var f=c.value;this.$f[f.name]=this.vf.clipAction(f)}}catch(t){h.e(t)}finally{h.f()}s=this.yr(p);s.$i.g0(this.vf),s.Ai.autoPlay&&(i=!1,null!==this.o0&&2200===this.o0&&(i=!0),this.startAction(this.getActionNames()[0],i,!0))}null!==this.t0&&(this.t0._0(this),this.t0=null)}}},b0:function(i){var r=[],o=null;null===this.Zr?i&&i():(function t(n){"Mesh"===n.type&&r.push(n);var e=n.children;for(var i=0;i<e.length;i++)t(e[i])}(this.Lt),function t(){var n=!0;for(var e=0;e<r.length;e++)if(!r[e].isUpdateComplete){n=!1;break}n?(i&&i(),null!==o&&clearTimeout(o)):o=setTimeout(t,10)}())},qr:function(t){var n=this.yr(p),e=this.yr(v);return(n=n.getMapOptions().materialMode===ls.REAL?(e=this.Jr(t,e),n.Nt.no.Tu(e)):t.clone()).userData=t.userData,n},w0:function(){var o=this,s=[],t=this.Lt;if(this.pl)this.Lt.traverse(function(t){if("Mesh"===t.type)if(t.userData.sourceMaterial||(t.userData.sourceMaterial=t.material),Array.isArray(t.material)){for(var n=[],e=0;e<t.material.length;e++){var i=o.qr(t.material[e]);i.transparent=!0,n.push(i)}t.material=n,s=s.concat(n)}else{var r=o.qr(t.material);r.transparent=!0,t.material=r,s.push(r)}});else if(t.userData.sourceMaterial||(t.userData.sourceMaterial=t.material),Array.isArray(this.Lt.material)){for(var n=[],e=0;e<this.Lt.material.length;e++){var i=this.Lt.material[e];i.transparent=!0,n.push(i.clone())}this.Lt.material=n,s=s.concat(n)}else{t=this.Lt.material.clone();t.transparent=!0,s.push(t),this.Lt.material=t}return s},x0:function(){function n(t){var n;t&&t.userData.sourceMaterial&&(n=t.material,t.material=t.userData.sourceMaterial,delete t.userData.sourceMaterial,Array.isArray(n)?n.forEach(function(t){t.dispose()}):n.dispose())}var t=this.Lt;this.pl&&t?this.Lt.traverse(function(t){"Mesh"===t.type&&n(t)}):n(t),this.lf()},a0:function(t){var o=this,t=void 0!==(t=t||{}).duration?t.duration:.5,s=this.yr(v),a=s.yr(p);if(this.ql&&!1===this.ql.Bn){if(this.Kl)return;this.ql.stop()}this.Kl=!0;var u=this.w0();this.ql.Wn([0]).Yn([1]).Qn(t).qn(function(t){for(var n=t.destination[0],e=0;e<u.length;e++){var i=u[e],r=void 0!==o.ft?o.ft:i.userData.sourceOpacity;o.pl&&a.getMapOptions().materialMode===ls.REAL?i.uniforms.opacity.value=n*r*s.ft:i.opacity=n*r*s.ft}a.enableUpdateRender()}).Kn(function(){a.$i.Ji(o.ql),o.x0()}),a.$i.Zi(this.ql.play())},u0:function(t){var r=this,n=void 0!==(t=t||{}).duration?t.duration:.5,o=this.yr(v),s=o.yr(p);if(this.ql&&!1===this.ql.Bn){if(!this.Kl)return;this.ql.stop()}this.Kl=!1;var a=this.w0();this.ql.Wn([1]).Yn([0]).Qn(n).qn(function(t){for(var n=t.destination[0],e=0;e<a.length;e++){var i=void 0!==r.ft?r.ft:a[e].userData.sourceOpacity;r.pl&&s.getMapOptions().materialMode===ls.REAL?a[e].uniforms.opacity.value=n*i*o.ft:a[e].opacity=n*i*o.ft}s.enableUpdateRender()}).Kn(function(){s.$i.Ji(r.ql),r.sf(),s.enableUpdateNode(),t.finish&&t.finish()}),s.$i.Zi(this.ql.play())},E0:function(t,n){n=this.Jr(t,n);t.color=new lt(n.color),t.opacity=n.opacity,t.transparent=n.transparent},lf:function(){var o=this;if(this.Lt){var s=this.yr(p),a=this.yr(v);if(s){if(this.pl)this.Lt.traverse(function(t){if("Mesh"===t.type){var n=o.Jr(t.material,a);if(s.Ai.materialMode===ls.REAL){var e=s.Nt.no.$r(n),i=o.S0(e);null===i?(e.userData=t.material.userData,t.material=e):(i.userData=t.material.userData,t.material=i),o.Yr&&(n.color=o.Yr,(e=s.Nt.no.$r(n)).userData=t.material.userData,t.userData.sourceMaterial=t.material,t.material=e)}else if(Array.isArray(t.material.length))for(var r=0;r<t.material.length;r++)t.material[r].depthWrite=!0,t.material[r]=s.Nt.no.eo(t.material[r],n),o.S0(t.material[r]),o.Yr&&(n.color=o.Yr,t.userData.sourceMaterial=t.material,t.material[r]=s.Nt.no.eo(t.material[r],n));else{i=o.S0(t.material);null===i?(t.material.depthWrite=!0,t.material=s.Nt.no.eo(t.material,n)):(i.depthWrite=!0,t.material=i),o.Yr&&(n.color=o.Yr,t.userData.sourceMaterial=t.material,t.material=s.Nt.no.eo(t.material,n))}null!==o.Zr&&(t.isUpdateComplete=!0)}});else{var t=this.Lt.material;if(Array.isArray(t)){var n,e=[],i=ig(t);try{for(i.s();!(n=i.n()).done;){var r,u=n.value;this.E0(u,a),this.Yr&&((r=u.clone()).color=new lt(this.Yr),e.push(r))}}catch(t){i.e(t)}finally{i.f()}this.Yr&&(this.Lt.userData.sourceMaterial=this.Lt.material,this.Lt.material=e)}else this.E0(t,a),this.Yr&&((t=t.clone()).color=new lt(this.Yr),this.Lt.userData.sourceMaterial=this.Lt.material,this.Lt.material=t)}this.Ql&&(this.Ql=!1),s.enableUpdateRender()}}},S0:function(t){return null!==this.Zr?((t=this.qr(t)).clippingPlanes=this.Zr,t.clipping=!0,(this.n0||this.Kr&&"outside"===this.Kr)&&(t.clipIntersection=!0),t):null},Jr:function(t,n){var e={},i=(this.yr(p).Ai.materialMode===ls.REAL?(t.constructor===W0?(t.userData.sourceOpacity=t.opacity,t.userData.sourceTransparent=t.transparent,void 0===t.userData.originColor&&(t.userData.originColor=t.color),void 0===t.userData.originOpacity&&(t.userData.originOpacity=t.opacity),null===this.ft&&(this.ft=t.opacity),e={color:t.color.getHex(),USE_EMISSIVEMAP:!!t.emissiveMap,USE_METALNESSMAP:!!t.metalnessMap,USE_NORMALMAP:!!t.normalMap,TANGENTSPACE_NORMALMAP:!!t.normalMap,USE_ROUGHNESSMAP:!!t.roughnessMap,USE_MAP:!!t.map,USE_AOMAP:!!t.aoMap,map:r(t.map,null),aoMap:r(t.aoMap,null),emissive:t.emissive.getHex(),emissiveMap:r(t.emissiveMap,null),metalness:r(t.metalness,0),metalnessMap:r(t.metalnessMap,null),roughness:r(t.roughness,1),roughnessMap:r(t.roughnessMap,null),normalScale:r(t.normalScale,new Mt(1,1)),normalMap:r(t.normalMap,null),vertexColors:t.vertexColors,side:t.side,skinning:t.skinning}):t.constructor===_0&&(e={USE_EMISSIVEMAP:t.defines.USE_EMISSIVEMAP,USE_MAP:t.defines.USE_MAP,USE_AOMAP:t.defines.USE_AOMAP,USE_METALNESSMAP:t.defines.USE_METALNESSMAP,USE_NORMALMAP:t.defines.USE_NORMALMAP,TANGENTSPACE_NORMALMAP:t.defines.TANGENTSPACE_NORMALMAP,USE_ROUGHNESSMAP:t.defines.USE_ROUGHNESSMAP,aoMap:r(t.uniforms.aoMap.value,null),map:r(t.uniforms.map.value,null),color:t.uniforms.diffuse.value.getHex(),emissive:t.uniforms.emissive.value.getHex(),emissiveMap:r(t.uniforms.emissiveMap.value,null),metalness:r(t.uniforms.metalness.value,0),metalnessMap:r(t.uniforms.metalnessMap.value,null),roughness:r(t.uniforms.roughness.value,1),roughnessMap:r(t.uniforms.roughnessMap.value,null),normalScale:r(t.uniforms.normalScale.value,new Mt(1,1)),normalMap:r(t.uniforms.normalMap.value,null),vertexColors:t.vertexColors,side:t.side,skinning:t.skinning},void 0===t.userData.originColor&&(t.userData.originColor=t.uniforms.diffuse.value),void 0===t.userData.originOpacity&&(t.userData.originOpacity=t.uniforms.opacity.value),null===this.ft)&&(this.ft=t.uniforms.opacity.value),null===this.Yl&&(this.Yl=e.color)):(void 0===t.userData.sourceOpacity&&(t.userData.sourceOpacity=t.opacity),void 0===t.userData.sourceTransparent&&(t.userData.sourceTransparent=t.transparent),void 0===t.userData.originColor&&(t.userData.originColor=t.color),void 0===t.userData.originOpacity&&(t.userData.originOpacity=t.opacity),null===this.Yl&&(this.Yl=t.color),null===this.ft&&(this.ft=t.opacity)),this.Yl&&(e.color=this.Yl),void 0!==t.userData.sourceOpacity?t.userData.sourceOpacity:t.opacity);return null!==this.ft&&(i=this.ft),this.y0(t,n),e.opacity=i*n.ft,e.transparent=t.userData.sourceTransparent||e.opacity<1,e;function r(t,n){return void 0!==t?t:n}},sf:function(){var t;if(this.vf&&(this.stopAction(this.getActionNames()[0],!0),(t=this.yr(p))&&t.$i.T0(this.vf),this.vf=null),this.ql&&!1===this.ql.Bn&&this.ql.finish(),this.Lt&&"Mesh"===this.Lt.type){if(this.Lt.parent&&this.Lt.parent.remove(this.Lt),Array.isArray(this.Lt.material)){var n,e=ig(this.Lt.material);try{for(e.s();!(n=e.n()).done;){var i=n.value;i.map&&this.$l&&i.map.dispose(),i.dispose()}}catch(t){e.e(t)}finally{e.f()}}else this.Lt.material.map&&this.$l&&this.Lt.material.map.dispose(),this.Lt.material.dispose();this.Lt.geometry.dispose(),this.Lt.geometry=void 0,this.Lt.material=void 0,this.Lt.mapNode=void 0,this.Lt=void 0}else this.Lt&&"Scene"===this.Lt.type&&(this.Lt.parent&&this.Lt.parent.remove(this.Lt),this.Lt.mapNode=void 0,this.Lt=void 0)},Zl:function(){var t=this.yr(p);t&&t.enableUpdateRender()}}),i);function dg(t){return(dg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function vg(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=dg(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=dg(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==dg(t)?t:String(t)}(i.key),i)}}function pg(t,n,e){n=yg(n);var i=t,n=mg()?Reflect.construct(n,e||[],yg(t).constructor):n.apply(t,e);if(n&&("object"===dg(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function mg(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(mg=function(){return!!t})()}function yg(t){return(yg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function bg(t,n){return(bg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var i=function(){var t,n=i,e=Ab;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");function i(t){var n;if(this instanceof i)return(n=pg(this,i)).G=t,n.nt=t.height,n.mi=E.FACILITY,n.Zt=0,n.A0=null,n.wi=new Map,n.uf=null,n;throw new TypeError("Cannot call a class as a function")}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&bg(n,e),n=i,(e=[{key:"FID",get:function(){return this.G.fid}},{key:"typeID",get:function(){return this.G.type}},{key:"eName",get:function(){return this.G._ename}},{key:"name",get:function(){return this.G.name}},{key:"size",get:function(){return this.A0||this.uf.height},set:function(t){var n;this.A0=t,this.A0?this.Zt=this.A0:(t=this.yr(p),n=this.yr(xs),this.uf=t.Nt.hf.Wu({fid:this.G.fid,typeID:""+this.G.type,bid:n.pi}),this.Zt=this.uf.height),this.lf()}},{key:"scaleSize",get:function(){return this.size/this.Zt||1}},{key:"jump",value:function(t){return R1(this,t)}},{key:"stopJump",value:function(){return N1(this)}},{key:"boost",value:function(t){return O1(this,t)}},{key:"stopBoost",value:function(){return L1(this)}},{key:"getPosition",value:function(){return{x:this.G.yi[0].x,y:this.G.yi[0].y,z:this.nt}}},{key:"updateMaterialByThemeTool",value:function(t){this.uf=t,this.Zt=parseInt(this.uf.height),this.A0&&(this.Zt=this.A0),this.lf(),this.Lt.userData.size=this.Zt}}])&&vg(n.prototype,e),t&&vg(n,t),Object.defineProperty(n,"prototype",{writable:!1}),i}(),gg=(Object.assign(i.prototype,{qc:function(){var t,n;if(!this.Lt)return t=this.yr(p),n=this.yr(xs),this.uf=t.Nt.hf.Wu({fid:this.G.fid,typeID:""+this.G.type,bid:n.pi}),this.Zt=parseInt(this.uf.height),(n=this.Qr(t)).userData.opacity=n.opacity,this.Lt=new Vm(n),n=new Tt((n=this.G.yi[0]).x-t.wt,-n.y+t.xt,0).applyEuler(new Y(Math.PI/2,0,0,"XYZ")).add(new Tt(0,this.nt,0)),this.Lt.position.copy(n),this.zo(t.Nt),this.Lt.userData.size=this.Zt,(this.Lt.mapNode=this).Pn.Co.add(this.Lt),!0},ff:function(t,n){var e;this.Lt&&(e=this.yr(xs),this.uf=n.Wu({fid:this.G.fid,typeID:""+this.G.type,bid:e.pi}),this.Zt=parseInt(this.uf.height),this.lf(),this.Lt.userData.size=this.Zt)},lf:function(){var t;this.Lt&&(t=this.yr(p))&&(this.Lt.material=this.Qr(t))},Qr:function(t){var n=this,e=this.yr(v),i=e.parent;return t.Nt.no.Pu({opacity:e.ft,needDepth:!1,url:t.Nt.p0(this.uf,"path",i.buildingID)+this.uf.imageName},function(){n.zo(t.Nt),t.Nt.Jo(),t.enableUpdateRender()})},zo:function(t){P1(t,this)}}),i);function _g(t){return(_g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function wg(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=_g(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=_g(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==_g(t)?t:String(t)}(i.key),i)}}function xg(t,n,e){n=Sg(n);var i=t,n=Eg()?Reflect.construct(n,e||[],Sg(t).constructor):n.apply(t,e);if(n&&("object"===_g(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function Eg(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Eg=function(){return!!t})()}function Sg(t){return(Sg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Tg(t,n){return(Tg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var i=function(){var t,n=i,e=Ab;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");function i(t,n){var e;if(this instanceof i)return(e=xg(this,i)).G=t,e.gn=n,e.mi=E.LABEL,e.uf=null,e.M0=null,e.Qo=!1,e.bh=null,n.En.O0===a1.ENAME?e.L0=t.ename:n.En.O0===a1.FID?e.L0=t.fid:e.L0=t.name,e.L0||(e.L0="",e.Qo=!0),e.R0=n.Ai.HDText,!0===e.R0&&st.a.environment===B.a.BROWSER&&(e.N0=new st.a.LabelCollection,e.P0=null),e.F0=null,e;throw new TypeError("Cannot call a class as a function")}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&Tg(n,e),n=i,(e=[{key:"FID",get:function(){return this.G.fid}},{key:"typeID",get:function(){return this.G.type}},{key:"name",get:function(){return this.G.name}},{key:"eName",get:function(){return this.G.ename}},{key:"text",get:function(){return this.L0},set:function(t){t?(this.L0=t,this.Qo=!1):(this.L0="",this.Qo=!0),this.Lt&&(this.lf(),this.sh())}},{key:"fontSize",get:function(){return this.F0||this.uf.fontsize},set:function(t){this.F0=t,this.F0?this.uf.fontsize=this.F0:this.j0(this.gn.Nt,this.gn.Nt.hf),this.Lt&&this.lf()}},{key:"setText",value:function(t){this.text=t}}])&&wg(n.prototype,e),t&&wg(n,t),Object.defineProperty(n,"prototype",{writable:!1}),i}(),Ag=(Object.assign(i.prototype,{tn:function(t){var n=this;return this.fontSize=t,new Promise(function(t){!1===n.R0&&t(),n.readyCallback=t})},I0:function(n,t){var e,i,r,o,s=this;n&&t&&(this.N0||(this.N0=new st.a.LabelCollection,this.P0=null),e=t.width,i=t.drawTextWidth,r=t.drawTextLeft,t=this.fontSize,this.N0.map=n,this.P0?(o=this.P0).labelMeshInstance&&(this.Lt.remove(o.labelMeshInstance.mesh),this.Lt.remove(o.labelOutlineMeshInstance.mesh)):(o=this.N0.add(),this.P0=o),o.C0=!0,o.D0=[],o.k0=!0,o.rootNode=this.Lt,o.text=this.L0,o.font="".concat(t,"px ").concat(this.uf.fontFamily||'"Microsoft Yahei","微软雅黑",Tahoma,Arial'),o.U0=Mr.rgbToArray(this.uf.fillColor),o.outlineWidth=void 0!==this.uf.strokeWidth?2*this.uf.strokeWidth:4,o.outlineColor=Mr.rgbToArray(this.uf.strokeColor),o.pixelRatio=n.jt.renderer.getPixelRatio(),n.on("update",function t(){s.N0.update(),!1===o.C0&&(o.pixelOffset=[(r+i/2-e/2)/2/1.2,0],n.enableUpdateRender(),n.off("update",t),s.readyCallback)&&s.readyCallback()}),n.on("pixelRatioChanged",function(){o.pixelRatio=n.jt.renderer.getPixelRatio()}))},qc:function(){var t,n;this.Lt||(t=this.yr(v).Pn.Pn,this.j0(this.gn.Nt,t.Nt.hf),this.Lt=new nh,(n=this.Qr()).userData.opacity=n.opacity,n=new Vm(n),this.Lt.add(n),this.Lt.mapNode=this,n=new Tt((n=(n.mapNode=this).G.yi[0]).x-t.wt,-n.y+t.xt,0).applyEuler(new Y(Math.PI/2,0,0,"XYZ")).add(new Tt(0,this.G.height,0)),this.Lt.position.copy(n),this.zo(this.gn.Nt),this.Pn.Co.add(this.Lt),this.bh&&this.bh.qc(this))},ff:function(t,n){this.Lt&&(this.j0(t,n),this.lf())},lf:function(){var e=this;this.Lt&&this.yr(p)&&this.Qr(function(t){var n;e.Lt&&(n=e.Lt.children[0].material,e.Lt.children[0].material=t,n.map&&(n.map.dispose(),n.map=null),n.dispose())})},Qr:function(n){var e=this,t=this.yr(v),i={needSize:!0,opacity:this.uf.alpha*t.ft,drawText:!this.R0};return this.uf.image&&(i.imageUrl=this.M0+this.uf.image),this.gn.Nt.no.Ru(this.L0,this.uf,i,function(t){n&&n(t),e.Lt&&e.zo(e.gn.Nt),void 0!==i.imageUrl&&e.gn.Nt.Jo(),st.a.environment===B.a.WX&&e.gn.Nt.Jo(),!0===e.R0?e.I0(e.gn,null==(t=t.map)?void 0:t.image):e.readyCallback&&e.readyCallback(),e.gn.enableUpdateRender()})},zo:function(t){var n,e,i=this.Lt.children[0];i&&i.material.map&&i.material.map.image&&(n=i.material).userData.mspriteScale&&(t=t.Rh(this.fontSize),e=2*this.fontSize*1.2,e=n.map.image.height/e,n.userData.mspriteScale=Math.max(e,n.userData.mspriteScale),i.scale.set(t,t,t),i.scale.multiplyScalar(n.userData.mspriteScale),i.scale.setX(i.scale.x/n.userData.scaleRatio))},j0:function(t,n){var e=this.yr(xs),n=(this.uf=n.Yu({fid:this.G.fid,typeID:this.G.type+"",bid:e.pi}),this.F0&&(this.uf.fontsize=this.F0),this.M0=t.p0(this.uf,"path",e.buildingID),parseInt(this.fontSize));isNaN(n)},updateMaterialByThemeTool:function(t){this.uf=t;var t=this.yr(v).Pn,n=t.Pn.Nt;this.M0=n.p0(this.uf,"path",t.buildingID),this.lf()}}),i);function Mg(t){return(Mg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Og(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=Mg(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Mg(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Mg(t)?t:String(t)}(i.key),i)}}function Lg(t,n,e){n=Ng(n);var i=t,n=Rg()?Reflect.construct(n,e||[],Ng(t).constructor):n.apply(t,e);if(n&&("object"===Mg(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function Rg(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Rg=function(){return!!t})()}function Ng(t){return(Ng=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Pg(t,n){return(Pg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var i=function(){var t,n=i,e=ps;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");function i(t){var n;if(this instanceof i)return(n=Lg(this,i)).nt=void 0!==(t=t||{}).height?t.height:1,n.wt=t.x,n.xt=t.y,n.Lt=null,n.Ph=!1,n.rf=void 0,n.B0=t.userID,void 0===n.B0&&(n.B0=""+Mr.generateUUID()),n;throw new TypeError("Cannot call a class as a function")}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&Pg(n,e),n=i,(e=[{key:"userID",get:function(){return this.B0},set:function(t){this.B0=t}},{key:"isInit",get:function(){return this.Ph},set:function(t){this.Ph=t}},{key:"isbloom",get:function(){return this.rf},set:function(t){this.rf=t}},{key:"x",get:function(){return this.wt}},{key:"y",get:function(){return this.xt}},{key:"height",get:function(){return this.nt},set:function(t){this.nt=t,this.G0()}},{key:"level",get:function(){var t=this.yr(v);return t?t.level:null}},{key:"visible",get:function(){return this.Jt},set:function(t){this.Jt=t,this.Lt&&(this.Lt.visible=this.Jt,t=this.yr(p))&&t.enableUpdateRender()}},{key:"opacity",get:function(){return this.ft},set:function(t){this.ft=t,this.Lt&&(this.Lt.material.opacity=this.ft)}},{key:"isMarker",get:function(){return!0}},{key:"bound",get:function(){var n=this;return[E.IMAGE_MARKER,E.DOM_MARKER,E.DYNAMIC_MODEL_MARKER,E.LOCATION_MARKER,E.TEXT_MARKER].find(function(t){return t===n.mi})?!0===this.needUpdateBound&&(this.ai.reset(),void 0!==this.wt)&&void 0!==this.xt&&(this.ai.expandByCoords([{x:this.wt,y:this.xt}]),this.needUpdateBound=!1):!0===this.needUpdateBound&&(this.ai.reset(),this.ai.expandByCoords(this.Lh),this.needUpdateBound=!1),this.ai.clone()}},{key:"addTo",value:function(t){t.getOrCreateLayer(this.mi).add(this),this.Lt&&(null!=(t=this.Lt)&&t.updateMatrixWorld(!0),null!=(t=this.Lt))&&null!=(t=t.parent)&&t.updateMatrixWorld(!0)}},{key:"remove",value:function(){var t=this.yr(p);this.Pn&&this.Pn.remove(this),t&&t.enableUpdateRender()}},{key:"dispose",value:function(){var n=this;this.remove(),this.Lt&&(this.Lt.traverse(function(t){t instanceof $a&&(t.geometry.dispose(),t.geometry=void 0,Array.isArray(t.material)?t.material.forEach(function(t){n.H0(t)}):n.H0(t.material)),"SkinnedMesh"===t.type&&(t.skeleton.boneTexture&&t.skeleton.boneTexture.dispose(),t.skeleton.dispose())}),this.Lt.mapNode=void 0,this.Lt=void 0),this.Ph=!1}}])&&Og(n.prototype,e),t&&Og(n,t),Object.defineProperty(n,"prototype",{writable:!1}),i}(),Fg=(Object.assign(i.prototype,{H0:function(t){if(t){if(t instanceof _0){var n,e=t.uniforms;for(n in e)e[n]&&e[n].value instanceof l&&e[n].value.dispose();t.dispose()}else for(var i in t)t[i]&&t[i]instanceof l&&t[i].dispose();t.dispose()}},X0:function(){var t;void 0!==this.wt&&void 0!==this.xt||(t=this.yr(v),this.wt=t.center.x,this.xt=t.center.y)},qc:function(){return!1},G0:function(){}}),i);function jg(){ra.call(this),this.type="InstancedBufferGeometry",this.maxInstancedCount=void 0}function Ig(t,n,e){lh.call(this,t,n),this.meshPerAttribute=e||1}function Cg(t){ra.call(this),this.type="WireframeGeometry";var n,e,i,r,o,s,a=[],u=[0,0],c={},h=["a","b","c"];if(t&&t.isGeometry){for(var f=t.faces,l=0,d=f.length;l<d;l++)for(var v=f[l],p=0;p<3;p++)r=v[h[p]],o=v[h[(p+1)%3]],u[0]=Math.min(r,o),u[1]=Math.max(r,o),void 0===c[s=u[0]+","+u[1]]&&(c[s]={index1:u[0],index2:u[1]});for(s in c)_=t.vertices[(i=c[s]).index1],a.push(_.x,_.y,_.z),_=t.vertices[i.index2],a.push(_.x,_.y,_.z)}else if(t&&t.isBufferGeometry){var m,y,b,g,_=new Tt;if(null!==t.index){for(m=t.attributes.position,y=t.index,e=(b=(n=0)===(b=t.groups).length?[{start:0,count:y.count,materialIndex:0}]:b).length;n<e;++n)for(d=(l=(g=b[n]).start)+g.count;l<d;l+=3)for(p=0;p<3;p++)r=y.getX(l+p),o=y.getX(l+(p+1)%3),u[0]=Math.min(r,o),u[1]=Math.max(r,o),void 0===c[s=u[0]+","+u[1]]&&(c[s]={index1:u[0],index2:u[1]});for(s in c)_.fromBufferAttribute(m,(i=c[s]).index1),a.push(_.x,_.y,_.z),_.fromBufferAttribute(m,i.index2),a.push(_.x,_.y,_.z)}else for(l=0,d=(m=t.attributes.position).count/3;l<d;l++)for(p=0;p<3;p++)_.fromBufferAttribute(m,3*l+p),a.push(_.x,_.y,_.z),_.fromBufferAttribute(m,3*l+(p+1)%3),a.push(_.x,_.y,_.z)}this.setAttribute("position",new x(a,3))}function Dg(t){return(Dg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function kg(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=Dg(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Dg(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Dg(t)?t:String(t)}(i.key),i)}}function Ug(t,n,e){n=Gg(n);var i=t,n=Bg()?Reflect.construct(n,e||[],Gg(t).constructor):n.apply(t,e);if(n&&("object"===Dg(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function Bg(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Bg=function(){return!!t})()}function Gg(t){return(Gg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Hg(t,n){return(Hg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}jg.prototype=Object.assign(Object.create(ra.prototype),{constructor:jg,isInstancedBufferGeometry:!0,copy:function(t){return ra.prototype.copy.call(this,t),this.maxInstancedCount=t.maxInstancedCount,this},clone:function(){return(new this.constructor).copy(this)}}),Ig.prototype=Object.assign(Object.create(lh.prototype),{constructor:Ig,isInstancedInterleavedBuffer:!0,copy:function(t){return lh.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this}}),(Cg.prototype=Object.create(ra.prototype)).constructor=Cg;var Xg=function(){var t,n=i,e=jg;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");function i(){var t;if(!(this instanceof i))throw new TypeError("Cannot call a class as a function");(t=Ug(this,i)).type="LineSegmentsGeometry";return t.isLineSegmentsGeometry=!0,t.setIndex([0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5]),t.setAttribute("position",new x([-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],3)),t.setAttribute("uv",new x([-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],2)),t.setAttribute("uv2",new x([0,0,1,0,0,1/3,1,1/3,0,2/3,1,2/3,0,1,1,1],2)),t}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&Hg(n,e),n=i,(e=[{key:"applyMatrix",value:function(t){var n=this.attributes.instanceStart,e=this.attributes.instanceEnd;return void 0!==n&&(t.applyToBufferAttribute(n),t.applyToBufferAttribute(e),n.data.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}},{key:"setPositions",value:function(t){t instanceof Float32Array?n=t:Array.isArray(t)&&(n=new Float32Array(t));var n,t=new Ig(n,6,1);return this.setAttribute("instanceStart",new vh(t,3,0)),this.setAttribute("instanceEnd",new vh(t,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}},{key:"setColors",value:function(t){t instanceof Float32Array?n=t:Array.isArray(t)&&(n=new Float32Array(t));var n,t=new Ig(n,6,1);return this.addAttribute("instanceColorStart",new vh(t,3,0)),this.addAttribute("instanceColorEnd",new vh(t,3,3)),this}},{key:"setUvys",value:function(t){t instanceof Float32Array?n=t:Array.isArray(t)&&(n=new Float32Array(t));var n,t=new Ig(n,2,1);return this.setAttribute("uvyStart",new vh(t,1,0)),this.setAttribute("uvyEnd",new vh(t,1,1)),this}},{key:"fromWireframeGeometry",value:function(t){return this.setPositions(t.attributes.position.array),this}},{key:"fromEdgesGeometry",value:function(t){return this.setPositions(t.attributes.position.array),this}},{key:"fromMesh",value:function(t){return this.fromWireframeGeometry(new Cg(t.geometry)),this}},{key:"fromLineSegements",value:function(t){t=t.geometry;return t.isGeometry?this.setPositions(t.vertices):t.isBufferGeometry&&this.setPositions(t.position.array),this}},{key:"computeBoundingBox",value:function(){var t=new jt,n=(null===this.boundingBox&&(this.boundingBox=new jt),this.attributes.instanceStart),e=this.attributes.instanceEnd;void 0!==n&&void 0!==e&&(this.boundingBox.setFromBufferAttribute(n),t.setFromBufferAttribute(e),this.boundingBox.union(t))}},{key:"computeBoundingSphere",value:function(){var t=new Tt,n=(null===this.boundingSphere&&(this.boundingSphere=new Dt),null===this.boundingBox&&this.computeBoundingBox(),this.attributes.instanceStart),e=this.attributes.instanceEnd;if(void 0!==n&&void 0!==e){for(var i=this.boundingSphere.center,r=(this.boundingBox.getCenter(i),0),o=0,s=n.count;o<s;o++)t.fromBufferAttribute(n,o),r=Math.max(r,i.distanceToSquared(t)),t.fromBufferAttribute(e,o),r=Math.max(r,i.distanceToSquared(t));this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error("fm.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}},{key:"toJSON",value:function(){}},{key:"clone",value:function(){}},{key:"copy",value:function(t){return this}}])&&kg(n.prototype,e),t&&kg(n,t),Object.defineProperty(n,"prototype",{writable:!1}),i}();function Vg(t){return(Vg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function zg(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=Vg(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Vg(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Vg(t)?t:String(t)}(i.key),i)}}function Wg(t,n,e){n=Qg(n);var i=t,n=Yg()?Reflect.construct(n,e||[],Qg(t).constructor):n.apply(t,e);if(n&&("object"===Vg(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function Yg(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Yg=function(){return!!t})()}function Qg(t){return(Qg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Zg(t,n){return(Zg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var qg=function(){var t,n=i,e=Xg;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");function i(){var t;if(this instanceof i)return(t=Wg(this,i)).type="LineGeometry",t.isLineGeometry=!0,t;throw new TypeError("Cannot call a class as a function")}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&Zg(n,e),n=i,(e=[{key:"setPositions",value:function(t){for(var n=t.length-3,e=new Float32Array(2*n),i=0;i<n;i+=3)e[2*i]=t[i],e[2*i+1]=t[i+1],e[2*i+2]=t[i+2],e[2*i+3]=t[i+3],e[2*i+4]=t[i+4],e[2*i+5]=t[i+5];return this.test="ddd",(new Xg).setPositions.call(this,e),this}},{key:"setColors",value:function(t){for(var n=t.length-3,e=new Float32Array(2*n),i=0;i<n;i+=3)e[2*i]=t[i],e[2*i+1]=t[i+1],e[2*i+2]=t[i+2],e[2*i+3]=t[i+3],e[2*i+4]=t[i+4],e[2*i+5]=t[i+5];return(new Xg).setColors.call(this,e),this}},{key:"fromLine",value:function(t){t=t.geometry;return t.isGeometry?this.setPositions(t.vertices):t.isBufferGeometry&&this.setPositions(t.position.array),this}},{key:"copy",value:function(t){return this}}])&&zg(n.prototype,e),t&&zg(n,t),Object.defineProperty(n,"prototype",{writable:!1}),i}(),Kg=new Tt,Jg=new Tt;function $g(t,n){this.start=void 0!==t?t:new Tt,this.end=void 0!==n?n:new Tt}function t_(t){return(t_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function n_(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=t_(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=t_(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==t_(t)?t:String(t)}(i.key),i)}}function e_(t,n,e){n=r_(n);var i=t,n=i_()?Reflect.construct(n,e||[],r_(t).constructor):n.apply(t,e);if(n&&("object"===t_(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function i_(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(i_=function(){return!!t})()}function r_(t){return(r_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function o_(t,n){return(o_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}function s_(t,n,e){t=0<arguments.length&&void 0!==t?t:{x:0,y:0,z:0},n=1<arguments.length&&void 0!==n?n:{x:0,y:0,z:0},e=2<arguments.length?e:void 0,t=new Ot(t.x,t.y,t.z,1),n=new Ot(n.x,n.y,n.z,1);return t.applyMatrix4(e.projectionMatrix),n.multiplyScalar(t.w),n.applyMatrix4(e.projectionMatrixInverse),{x:n.x,y:n.y,z:n.z}}Object.assign($g.prototype,{set:function(t,n){return this.start.copy(t),this.end.copy(n),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.start.copy(t.start),this.end.copy(t.end),this},getCenter:function(t){return void 0===t&&(console.warn("THREE.Line3: .getCenter() target is now required"),t=new Tt),t.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(t){return void 0===t&&(console.warn("THREE.Line3: .delta() target is now required"),t=new Tt),t.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(t,n){return void 0===n&&(console.warn("THREE.Line3: .at() target is now required"),n=new Tt),this.delta(n).multiplyScalar(t).add(this.start)},closestPointToPointParameter:function(t,n){Kg.subVectors(t,this.start),Jg.subVectors(this.end,this.start);t=Jg.dot(Jg),t=Jg.dot(Kg)/t;return t=n?St.clamp(t,0,1):t},closestPointToPoint:function(t,n,e){t=this.closestPointToPointParameter(t,n);return void 0===e&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),e=new Tt),this.delta(e).multiplyScalar(t).add(this.start)},applyMatrix4:function(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this},equals:function(t){return t.start.equals(this.start)&&t.end.equals(this.end)}});var a_=function(){var t,n=i,e=$a;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");function i(t,n){if(this instanceof i)return(t=e_(this,i,[t,n])).type="LineSegments2",t.isLineSegments2=!0,t;throw new TypeError("Cannot call a class as a function")}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&o_(n,e),n=i,(e=[{key:"computeLineDistances",value:function(){for(var t=new Tt,n=new Tt,e=this.geometry,i=e.attributes.instanceStart,r=e.attributes.instanceEnd,o=new Float32Array(2*i.data.count),s=0,a=0,u=i.data.count;s<u;s++,a+=2)t.fromBufferAttribute(i,s),n.fromBufferAttribute(r,s),o[a]=0===a?0:o[a-1],o[a+1]=o[a]+t.distanceTo(n);var c=new Ig(o,2,1);return e.setAttribute("instanceDistanceStart",new vh(c,1,0)),e.setAttribute("instanceDistanceEnd",new vh(c,1,1)),this}},{key:"copy",value:function(t){return this}},{key:"raycast",value:function(t,n){null===t.camera&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.');var e=new Ot,i=new Ot,r=new Ot,o=new Tt,s=new At,a=new $g,u=new Tt,c=new jt,h=new Dt,f=void 0!==t.params.Line2&&t.params.Line2.threshold||0,l=t.ray,d=t.camera,v=d.projectionMatrix,p=this.matrixWorld,m=this.geometry,y=this.material,b=y.resolution,g=y.uniforms.lineWidth.value+f,_=m.attributes.instanceStart,w=m.attributes.instanceEnd,x=-d.near,y=2*Math.max(g/b.width,g/b.height);null===m.boundingSphere&&m.computeBoundingSphere(),h.copy(m.boundingSphere).applyMatrix4(p);f=s_({x:0,y:0,z:-Math.max(d.near,h.distanceToPoint(l.origin))},{x:y,y:0,z:0},d);if(d.isPerspectiveCamera?f.x/=2:f.x=g/d.zoom,h.radius+=f.x,!1!==t.ray.intersectsSphere(h)){null===m.boundingBox&&m.computeBoundingBox(),c.copy(m.boundingBox).applyMatrix4(p);f=s_({x:0,y:0,z:-Math.max(d.near,c.distanceToPoint(l.origin))},{x:y,y:0,z:0},d);if(d.isPerspectiveCamera?f.x/=2:f.x=g/d.zoom,c.max.x+=f.x,c.max.y+=f.x,c.max.z+=f.x,c.min.x-=f.x,c.min.y-=f.x,c.min.z-=f.x,!1!==t.ray.intersectsBox(c)){l.at(1,r),r.w=1,r.applyMatrix4(d.matrixWorldInverse),r.applyMatrix4(v),r.multiplyScalar(1/r.w),r.x*=b.x/2,r.y*=b.y/2,r.z=0,o.copy(r),s.multiplyMatrices(d.matrixWorldInverse,p);for(var E=0,S=_.count;E<S;E++){e.fromBufferAttribute(_,E),i.fromBufferAttribute(w,E),e.w=1,i.w=1,e.applyMatrix4(s),i.applyMatrix4(s);var T=e.z>x&&i.z>x;if(!T){e.z>x?(T=e.z-i.z,T=(e.z-x)/T,e.lerp(i,T)):i.z>x&&(T=i.z-e.z,T=(i.z-x)/T,i.lerp(e,T)),e.applyMatrix4(v),i.applyMatrix4(v),e.multiplyScalar(1/e.w),i.multiplyScalar(1/i.w),e.x*=b.x/2,e.y*=b.y/2,i.x*=b.x/2,i.y*=b.y/2,a.start.copy(e),a.start.z=0,a.end.copy(i),a.end.z=0;var T=a.closestPointToPointParameter(o,!0),T=(a.at(T,u),St.lerp(e.z,i.z,T)),T=-1<=T&&T<=1,A=u.distanceTo(i)<1||u.distanceTo(e)<1?.5*g*Math.sqrt(2):.5*g,A=o.distanceTo(u)<A;if(T&&A){a.start.fromBufferAttribute(_,E),a.end.fromBufferAttribute(w,E),a.start.applyMatrix4(p),a.end.applyMatrix4(p);T=new Tt,A=new Tt;l.distanceSqToSegment(a.start,a.end,A,T),n.push({point:A,pointOnLine:T,distance:l.origin.distanceTo(A),object:this,face:null,faceIndex:E,uv:null,uv2:null});break}}}}}}}])&&n_(n.prototype,e),t&&n_(n,t),Object.defineProperty(n,"prototype",{writable:!1}),i}();function u_(t){return(u_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function c_(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=u_(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=u_(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==u_(t)?t:String(t)}(i.key),i)}}function h_(t,n,e){n=l_(n);var i=t,n=f_()?Reflect.construct(n,e||[],l_(t).constructor):n.apply(t,e);if(n&&("object"===u_(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function f_(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(f_=function(){return!!t})()}function l_(t){return(l_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function d_(t,n){return(d_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var v_=function(){var t,n,e=r,i=a_;if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");function r(t,n){if(this instanceof r)return(t=h_(this,r,[t,n])).type="Line2",t.isLine2=!0,t;throw new TypeError("Cannot call a class as a function")}return e.prototype=Object.create(i&&i.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),i&&d_(e,i),e=r,t&&c_(e.prototype,t),n&&c_(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}();function p_(t){return(p_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function m_(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=p_(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=p_(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==p_(t)?t:String(t)}(i.key),i)}}var y_=function(){function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function")}var n,e,i;return n=t,(e=[{key:"calculatePoint",value:function(t,n,e){return(new Tt).copy(e).add((new Tt).copy(t).sub(e).normalize().multiplyScalar(n))}},{key:"computerArcLineByPoints",value:function(t,n,e,i,r){var o=[],t=this.calculatePoint(t,i,n),e=this.calculatePoint(e,i,n),s=new Fp(t,n,e);o.push(t);for(var a=0;a<r-1;a++){var u=s.getPoint((a+1)/r);o.push(u)}return o.push(e),o}}])&&m_(n.prototype,e),i&&m_(n,i),Object.defineProperty(n,"prototype",{writable:!1}),t}();function b_(t){return function(t){if(Array.isArray(t))return g_(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,n){var e;if(t)return"string"==typeof t?g_(t,n):"Map"===(e="Object"===(e=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?g_(t,n):void 0}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g_(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function __(t){return(__="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function w_(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=__(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=__(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==__(t)?t:String(t)}(i.key),i)}}var i=function(){function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this.Lh=null,this.Or=0,this.V0=void 0,this.z0=!0,this.W0=1,this.Y0=[],this.Q0=!1,this.Z0=null,this.q0=null,this.K0=[],this.J0=[],this.$0=[],this.td=null,this.nd=null,this.ed=!1}var n,e,i;return n=t,(e=[{key:"points",get:function(){return this.Lh},set:function(t){this.ed=!1,this.Lh=t}},{key:"level",get:function(){return this.Or},set:function(t){this.Or=t}},{key:"buildingID",get:function(){return this.V0},set:function(t){this.V0=t}},{key:"length",get:function(){return this.rd(this.K0.length)}},{key:"linePoints",get:function(){return this.Z0}},{key:"uvys",get:function(){return this.q0}},{key:"resize",value:function(){this.K0=[],this.Q0=!1}}])&&w_(n.prototype,e),i&&w_(n,i),Object.defineProperty(n,"prototype",{writable:!1}),t}(),x_=(Object.assign(i.prototype,{od:function(t,n){this.ed||("number"!=typeof n&&(n=this.W0),this.Z0=this.sd(t,n),this.q0=this.ad(),this.ed=!0)},sd:function(t,n){this.z0?this.Q0||this.ud(n):((n=[]).push.apply(n,b_(this.Lh)),this.Y0=n);for(var e=[],i=0;i<this.Y0.length;i++){var r=this.Y0[i].x-t.x,o=this.Y0[i].z,s=-this.Y0[i].y+t.y;e.push(r,o,s),0!==i&&(r=new Tt(this.Y0[i].x,this.Y0[i].y,this.Y0[i].z),o=new Tt(this.Y0[i-1].x,this.Y0[i-1].y,this.Y0[i-1].z),this.K0.push(r.distanceTo(o)))}return e},ud:function(t){for(var n,e,i=[],r=new y_,o=0;o<this.Lh.length;o++)0===o&&this.nd?(n=this.hd(t,this.nd,this.Lh[o],this.Lh[o+1]),this.isCross?i.push.apply(i,b_(r.computerArcLineByPoints(this.nd,this.Lh[o],this.Lh[o+1],n,12))):i.push(r.calculatePoint(this.Lh[o+1],n,this.Lh[o]))):o===this.Lh.length-1&&this.td?(n=this.hd(t,i[i.length-1],this.Lh[o],this.td),this.isCross?i.push.apply(i,b_(r.computerArcLineByPoints(i[i.length-1],this.Lh[o],this.td,n,12))):i.push(r.calculatePoint(i[i.length-1],n,this.Lh[o]))):0<o&&o<this.Lh.length-1?(e=this.hd(t,i[i.length-1],this.Lh[o],this.Lh[o+1]),i.push.apply(i,b_(r.computerArcLineByPoints(i[i.length-1],this.Lh[o],this.Lh[o+1],e,12)))):i.push(this.Lh[o]);this.Y0=i,this.Q0=!0},hd:function(t,n,e,i){return Math.min(.5*z.distanceOfTwoPoints(n,e),.5*z.distanceOfTwoPoints(e,i),t)},ad:function(){for(var t,n=[],e=this.rd(this.K0.length),i=0;i<this.Y0.length;i++)0===i?n.push(0):i===this.Y0.length-1?n.push(1):(t=this.rd(i)/e,n.push(t),n.push(t));return n},rd:function(t){for(var n=0,e=0;e<this.K0.length;e++)e<t&&(n+=this.K0[e]);return n}}),i),E_={FULL:0,DOTTED:2,DOT_DASH:4,CENTER:8,DASH:16,DOUBLE_DOT_DASH:32,TRI_DOT_DASH:64,FMARROW:128,ARROW:256};function S_(t){return(S_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function T_(t,n){var e,i,r,o,s="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(s)return i=!(e=!0),{s:function(){s=s.call(t)},n:function(){var t=s.next();return e=t.done,t},e:function(t){i=!0,r=t},f:function(){try{e||null==s.return||s.return()}finally{if(i)throw r}}};if(Array.isArray(t)||(s=function(t,n){var e;if(t)return"string"==typeof t?A_(t,n):"Map"===(e="Object"===(e=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?A_(t,n):void 0}(t))||n&&t&&"number"==typeof t.length)return s&&(t=s),o=0,{s:n=function(){},n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:n};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function A_(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function M_(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=S_(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=S_(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==S_(t)?t:String(t)}(i.key),i)}}function O_(t,n,e){n=P_(n);var i=t,n=L_()?Reflect.construct(n,e||[],P_(t).constructor):n.apply(t,e);if(n&&("object"===S_(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return R_(i)}function L_(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(L_=function(){return!!t})()}function R_(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function N_(){return(N_="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,n,e){var i=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=P_(t)););return t}(t,n);if(i)return(i=Object.getOwnPropertyDescriptor(i,n)).get?i.get.call(arguments.length<3?t:e):i.value}).apply(this,arguments)}function P_(t){return(P_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function F_(t,n){return(F_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var i=function(){var t,n=i,e=Fg;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");function i(t){var n;if(this instanceof i)return n=O_(this,i,[t]),t=t||{},n.mi=E.LINE_MARKER,n.cf=t.url,n.fd=void 0!==t.width?t.width:6,n.Yl=void 0!==t.color?t.color:"#33cc61",n.z0=void 0===t.smooth||t.smooth,n.ld=void 0!==t.radius?t.radius:1,n.Fo=void 0===t.animate||t.animate,n.ft=void 0!==t.opacity?t.opacity:1,n.dd=void 0===t.depth||t.depth,n.vd=void 0!==t.type?t.type:E_.FMARROW,n.pd=void 0!==t.borderColor?t.borderColor:"#4a82d2",n.md=void 0!==t.segments?t.segments:[],n.Io=[],n.yd=60,n.bd=10,n.gd="#aeaeae",n._d=n._d.bind(R_(n)),n.wd=n.wd.bind(R_(n)),n.xd=n.xd.bind(R_(n)),n.Ed=n.Ed.bind(R_(n)),n.G0=n.G0.bind(R_(n)),n.Sd=void 0!==t.zFighting?t.zFighting:void 0,n.Sd&&(n.Td=new i(Object.assign(t,{zFighting:!1})),n.Ad=1,n.Md=0),n;throw new TypeError("Cannot call a class as a function")}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&F_(n,e),n=i,(e=[{key:"bound",get:function(){if(!0===this.needUpdateBound){this.ai.reset();for(var t=this.md,n=0;n<t.length;n++){var e=t[n];this.ai.expandByCoords(e.Lh)}this.needUpdateBound=!1}return this.ai.clone()}},{key:"level",get:function(){return null}},{key:"width",get:function(){return this.fd},set:function(t){0!==t&&t!==this.fd&&(this.fd=t,this.lf(),this.Sd)&&(this.Td.width=t)}},{key:"color",get:function(){return this.Yl},set:function(t){this.Yl!==t&&(this.Yl=t,this.lf())}},{key:"opacity",get:function(){return this.ft},set:function(t){this.ft!==t&&(this.ft=t,this.lf(),this.Sd)&&(this.Td.opacity=t)}},{key:"passedColor",get:function(){return this.gd},set:function(t){this.gd!==t&&(this.gd=t,this.lf())}},{key:"segments",get:function(){return this.md},set:function(t){this.md=t;var n=this.yr(p);n&&(this.Od(n),this.qc(),this.Ed(),this.Sd)&&(this.Td.segments=t,this.Td.moveProportion(1))}},{key:"visible",get:function(){return this.Jt},set:function(t){this.Jt=t;for(var n=0;n<this.Io.length;n++)this.Io[n].line.visible=t;var e=this.yr(p);e&&(e.enableUpdateRender(),this.Sd)&&(this.Td.visible=t)}},{key:"updatePosition",value:function(t){this.G0(t)}},{key:"update",value:function(){var t,n;this.Lt&&this.Lt.material&&(t=this.yr(p))&&(n=this.yr(v),this.Lt.material=t.Nt.no.Mu({color:this.Yl,lineWidth:this.fd,opacity:this.ft*n.ft,needDepth:!1}),this.Sd)&&this.Td.update()}},{key:"moveProportion",value:function(t){for(var n=0,e=this.Io.length-1;-1<e;e--)this.Io[e].isCross||(n+=this.Io[e].seg.length);for(var i=0,r=this.Io.length-1;-1<r;r--){var o=i/n,s=(this.Io[r].isCross||(i+=this.Io[r].seg.length),i/n);s<t?this.Io[r].line.material.uniforms.miny.value=1:t<=s&&(this.Io[r].line.material.uniforms.miny.value=(t-o)/(s-o))}var a=this.yr(p);a&&a.enableUpdateRender()}},{key:"getLineNodes",value:function(){return this.Io}},{key:"addTo",value:function(t){t.jo.add(this),this.Ld(),t.on("visibleLevelsLoaded",this.Ed),t.on("zoom",this.wd),t.on("levelChanged",this.wd),t.on("resize",this.xd),this.Fo&&!1!==this.Sd&&t.$i.Rd(this._d),this.Sd&&(this.Td.addTo(t),this.Td.moveProportion(1))}},{key:"remove",value:function(){var t=this.yr(p);t&&(t.off("visibleLevelsLoaded",this.Ed),t.off("zoom",this.wd),t.off("levelChanged",this.wd),t.off("resize",this.Do),this.Od(t),this.Fo&&t.$i.Nd(this._d),t.jo.remove(this),t.enableUpdateRender(),this.Sd)&&this.Td.remove(t)}},{key:"dispose",value:function(){N_(P_(i.prototype),"dispose",this).call(this);for(var t=0;t<this.md.length;t++)this.md[t].resize();this.Sd&&this.Td.dispose()}},{key:"getRenderNode",value:function(){return this.Io}}])&&M_(n.prototype,e),t&&M_(n,t),Object.defineProperty(n,"prototype",{writable:!1}),i}(),j_=(Object.assign(i.prototype,{Od:function(t){for(var n=0;n<this.Io.length;n++){var e=this.Io[n].buildingID&&""+this.Io[n].buildingID,e=this.ki(e,this.Io[n].gid,t);e&&e.getOrCreateLayer(this.mi).Co.remove(this.Io[n].line)}this.Io=[]},Pd:function(t,n){var e=new qg,t=(e.setPositions(t),this.yr(v)),n=n.Nt.no.Mu({color:this.Yl,lineWidth:this.fd,opacity:this.opacity*t.ft,needDepth:!1});this.Lt=new v_(e,n),this.Lt.computeLineDistances(),e.dispose()},Fd:function(t){var n=new qg;n.setPositions(t),this.Lt.geometry=n,this.Lt.computeLineDistances(),n.dispose()},qc:function(){var t=this.yr(p);if(t){for(var n=this.jd(),e=this.md.length-1;-1<e;e--){var i=this.ki(this.md[e].buildingID,this.md[e].Or,t);if(!i)return;var r=void 0,o=void 0;if(0<e&&this.md[e].V0===this.md[e-1].V0&&this.md[e].Or!==this.md[e-1].Or){if(!(r=this.ki(this.md[e-1].buildingID,this.md[e-1].Or,t)))return;o=this.md[e-1].points,this.md[e].nd=Object.assign({},o[o.length-1]),this.md[e].nd.z+=r.nt-i.nt}if(e<this.md.length-1&&this.md[e].V0===this.md[e+1].V0&&this.md[e].Or!==this.md[e+1].Or){var s=this.ki(this.md[e+1].buildingID,this.md[e+1].Or,t);if(!s)return;this.md[e].td=Object.assign({},this.md[e+1].points[0]),this.md[e].td.z+=s.nt-i.nt}var a,u,s=this.Id(this.md[e],n);this.Io.push({line:s,buildingID:this.md[e].V0,gid:this.md[e].Or,seg:this.md[e],isCross:!1}),i.getOrCreateLayer(this.mi).Co.add(s),0<e&&this.md[e].V0===this.md[e-1].V0&&this.md[e].Or!==this.md[e-1].Or&&((a=new x_).Or=this.md[e].Or,a.V0=this.md[e].V0,a.isCross=!0,u=this.md[e].points,this.Cd(a,o,u,r,i),o=this.Id(a,n),this.Io.push({buildingID:a.V0,line:o,seg:a,gid:this.md[e-1].Or,gidAn:a.Or,isCross:!0,levelRange:[this.md[e-1].Or,this.md[e].Or]}),r.getOrCreateLayer(this.mi).Co.add(o))}return this.Ph=!0,t.enableUpdateRender(),this.Ph}},Cd:function(t,n,e,i,r){var o=Object.assign({},n[n.length-1]),s=Object.assign({},e[0]);o.z+=i.nt-r.nt,t.points=[o,s],t.nd=Object.assign({},n[n.length-2]),t.nd.z+=i.nt-r.nt,t.td=Object.assign({},e[1])},Id:function(t,n){var e=this.yr(p);if(e){var i=new Mt(e.x,e.y),i=(t.z0=this.z0,t.od(i,this.ld),this.ki(t.V0,t.Or,e));if(i){for(var r=[],o=0;o<t.linePoints.length;o++)r.push(t.linePoints[o]);var s=t.q0,a=new qg,s=(a.setPositions(r),a.setUvys(s),new kl({color:this.Yl,lineWidth:this.fd,vertexColors:2,dashed:!1,transparent:!0,pcolor:this.gd,opacity:this.ft})),e=(s.depthTest=this.dd,s.depthWrite=this.dd,s.transparent=!0,s.resolution=new Mt(e.jt.renderer.domElement.clientWidth,e.jt.renderer.domElement.clientHeight),void 0!==this.Ad&&(s.uniforms.usePassOpacity.value=this.Ad),void 0!==this.Md&&(s.uniforms.passOpacity.value=this.Md),n.useMap&&(s.defines.USE_MMAP=!0,s.uniforms.mmap.value=n.texture,this.Dd(s,t,this.yd),s.needsUpdate=!0),new v_(a,s));return this.Sd?e.renderOrder=0:!1===this.Sd&&(e.renderOrder=1),!this.Sd&&!1!==this.Sd||(s.stencilWrite=!0,s.stencilRef=2,s.stencilFunc=516,s.stencilFail=bi,s.stencilZFail=bi,s.stencilZPass=bi),e.computeLineDistances(),e.position.set(0,i.nt,0),e.mapNode=this,e}}},_d:function(t){for(var n=0;n<this.Io.length;n++)this.Io[n].line.material.uniforms.offset.value.y-=.001*t;this.yr(p).enableUpdateRender()},wd:function(){for(var t=0;t<this.Io.length;t++)this.Dd(this.Io[t].line.material,this.Io[t].seg,this.yd)},Dd:function(t,n,e){var i,r=this.yr(p);r&&(i=n.length,n=this.ki(n.V0,n.Or,r))&&(i=i*r.Nt.kd(n.nt),t.uniforms.repeat.value.y=Math.floor(i*st.a.window.devicePixelRatio/e),r.enableUpdateRender())},xd:function(){var t=this.yr(p);if(t){for(var n=0;n<this.Io.length;n++)this.Io[n].line.material.resolution=new Mt(t.jt.renderer.domElement.clientWidth,t.jt.renderer.domElement.clientHeight);t.enableUpdateRender()}},Ld:function(){var t,n=this.yr(p),e=T_(this.Io);try{for(e.s();!(t=e.n()).done;){var i,r=t.value;r.isCross?(i=this.Ba(r.buildingID,n).visibleLevels).indexOf(r.gid)<0||i.indexOf(r.gidAn)<0?r.line.visible=!1:(r.line.visible=!0,r.line.visible=this.Jt):-1<this.Ba(r.buildingID,n).visibleLevels.indexOf(r.gid)?(r.line.visible=!0,r.line.visible=this.Jt):r.line.visible=!1}}catch(t){e.e(t)}finally{e.f()}n.enableUpdateRender()},Ed:function(){this.yr(p)&&this.Ld()},Ud:function(){this.yd=this.fd*this.bd;var t={type:"normal",width:128,height:128,color:this.Yl,arrowHeightPercent:.6,arrowWidthPercent:1,arrowPercent:.1,lineType:null,dashArray:[2,1],textureCommand:"createNormalLineTexture",godHeightPercent:1,godEdgePercent:.2,godArrowPercent:.15,arrowWidth:20,godColor:this.Yl,godEdgeColor:this.pd,godArrowColor:"#F4FEFB",godArrowXScale:4,godArrowWidthPercent:.9,useMap:!0};switch(this.vd){case E_.FULL:t.useMap=!1;break;case E_.DOTTED:t.dashArray=[.5,.5,.5,.5,.5,.5,.5,.5];break;case E_.DOT_DASH:t.dashArray=[2.5,1,.5,1];break;case E_.CENTER:t.dashArray=[3,1,1.5,1];break;case E_.DASH:t.dashArray=[2,1];break;case E_.DOUBLE_DOT_DASH:t.dashArray=[2.5,.5,.5,.5,.5,.5];break;case E_.TRI_DOT_DASH:t.dashArray=[2.5,.5,.5,.5,.5,.5,.5,.5];break;case E_.FMARROW:case E_.ARROW:st.a.environment===B.a.BROWSER&&(t.width=5*this.fd,t.height=5*this.yd),t.arrowWidth=t.height/12,t.dashArray=[7,0],t.textureCommand="createArrowWidthBackTexture";break;default:t.useMap=!1}return t},jd:function(){var t,n,e=this.yr(p);if(e)return t=this.Ud(),n=null,this.cf?{useMap:!0,texture:e.Nt.no.Du(this.cf,function(t){t.needsUpdate=!0})}:(t.useMap&&((n=e.Nt.no[t.textureCommand](t)).minFilter=Qn,n.wrapS=Hn,n.wrapT=Hn,n.generateMipmaps=!1,n.anisotropy=4),{useMap:t.useMap,texture:n})},lf:function(){if(0<this.Io.length)for(var t=this.jd(),n=0;n<this.Io.length;n++)this.Io[n].line.material.lineWidth=this.fd,this.Io[n].line.material.color=new lt(this.Yl),this.Io[n].line.material.pcolor=new lt(this.gd),this.Io[n].line.material.opacity=this.ft,t.useMap&&(this.Io[n].line.material.uniforms.mmap.value=t.texture);var e=this.yr(p);e&&e.enableUpdateRender()},ki:function(t,n,e){return(t?this.Ba(t,e):e).getFloor(n)},Ba:function(t,n){return t=t||n.getMapOptions().buildingID,n.getBuilding(t)},G0:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},n=void 0===t.needUpdateCrossLine||t.needUpdateCrossLine;if(0<this.Io.length){var e=this.yr(p);if(e){for(var i=0;i<this.Io.length;i++){var r,o=this.Io[i];if(o.isCross)n&&(s=this.ki(o.buildingID,o.gid,e),r=this.ki(o.buildingID,o.gidAn,e),o.seg.resize(),this.Cd(o.seg,this.Io[i+1].seg.points,this.Io[i-1].seg.points,s,r),r=this.jd(),r=this.Id(o.seg,r),(s=s.getOrCreateLayer(this.mi)).Co.add(r),s.Co.remove(o.line),r.material.uniforms.miny.value=o.line.material.uniforms.miny.value,o.line.geometry.dispose(),o.line.material.dispose(),o.line=r);else{var s=this.ki(o.seg.V0,o.seg.Or,e);if(!s)return;o.line.position.y=s.nt}}e.enableUpdateRender()}}}}),i);function I_(t){return(I_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function C_(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=I_(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=I_(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==I_(t)?t:String(t)}(i.key),i)}}function D_(t,n,e){n=B_(n);var i=t,n=k_()?Reflect.construct(n,e||[],B_(t).constructor):n.apply(t,e);if(n&&("object"===I_(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function k_(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(k_=function(){return!!t})()}function U_(){return(U_="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,n,e){var i=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=B_(t)););return t}(t,n);if(i)return(i=Object.getOwnPropertyDescriptor(i,n)).get?i.get.call(arguments.length<3?t:e):i.value}).apply(this,arguments)}function B_(t){return(B_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function G_(t,n){return(G_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var i=function(){var t,n=i,e=Ab;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");function i(t){var n;if(this instanceof i)return(n=D_(this,i)).G=t,n.nt=t.height,n.mi=E.MODEL,n.Lt=null,n.lh=null,n.wi=null,n.ai=null,n.Bd="#FF0000",n.kl=null,n.io={top:null,left:null,right:null,front:null,back:null},n.Gd=!1,n.uf=null,n.Yl=null,n.ft=null,n.Hd=null,n.Xd=null,n.Vd=.01*n.zd(n.x+n.y),n.Wd=null,n.Yd=null,n.Qd=[0,0],n.Zd=null,n.qd=0,n.bh=null,n.Kd=0,n.Zr=null,n.Kr=null,n.n0=!1,n;throw new TypeError("Cannot call a class as a function")}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&G_(n,e),n=i,(e=[{key:"FID",get:function(){return this.G.fid}},{key:"typeID",get:function(){return this.G.type}},{key:"name",get:function(){return this.G.name}},{key:"eName",get:function(){return this.G.ename}},{key:"pass",get:function(){return this.G.pass}},{key:"coordinates",get:function(){return this.G.yi}},{key:"x",get:function(){var t;return null==(t=this.G.Kt)?void 0:t.x}},{key:"y",get:function(){var t;return null==(t=this.G.Kt)?void 0:t.y}},{key:"getData",value:function(){return Object.assign(U_(B_(i.prototype),"getData",this).call(this),{pass:this.G.pass})}},{key:"getArea",value:function(){return M1.area(this.G.yi[0])}},{key:"setColor",value:function(t,n){this.Gd=!0,void 0!==t&&(this.Yl=t),void 0!==n&&(this.ft=n),this.lf()}},{key:"resetColor",value:function(){this.uf&&!this.Jd()||this.j0(),this.setColor(this.uf.color,this.uf.alpha),this.Gd=!1}},{key:"setBorderColor",value:function(t,n){t&&(this.Hd=t),null!=n&&(this.Xd=n);t=this.yr(p);this.$d(t)}},{key:"resetBorderColor",value:function(){this.uf&&(this.Jd()&&this.j0(),this.setBorderColor(this.uf.strokeColor,this.uf.alpha))}},{key:"setTopImage",value:function(t){this.Kd=1,this.Wd=t.image,this.Zd=void 0!==t.coords?t.coords:this.G.Kt,this.Yd=void 0!==t.size?t.size:[5,5],this.Qd=void 0!==t.offset?t.offset:[0,0],this.qd=void 0!==t.angle?t.angle:0,this.Lt&&this.tv()}},{key:"clearTopImage",value:function(){this.Kd=0,this.nv()}},{key:"flash",value:function(t){this.ev(t);var n=this,e=this.yr(p),i=0;function r(){i%2==0?n.Lt&&(n.Lt.material.color=new lt(n.Bd)):n.Lt&&(n.Lt.material.color=new lt(n.Yl)),i++,e.enableUpdateRender()}n.kl&&clearTimeout(n.kl),function t(){n.Lt&&(n.Lt.userData.sourceMaterial||(n.Lt.userData.sourceMaterial=n.Lt.material,n.Lt.material=n.Lt.material.clone()),n.Lt.userData.sourceMaterial.canDispose=!1,r());n.kl=setTimeout(t,100)}()}},{key:"stopFlash",value:function(){var t;this.kl&&(clearTimeout(this.kl),this.kl=null,t=this.Lt.material,this.Lt.material=this.Lt.userData.sourceMaterial,delete this.Lt.userData.sourceMaterial.canDispose,delete this.Lt.userData.sourceMaterial,t.dispose(),t=null,this.yr(p).enableUpdateRender())}},{key:"getOtherNode",value:function(){return{top:this.io.top,line:this.lh}}}])&&C_(n.prototype,e),t&&C_(n,t),Object.defineProperty(n,"prototype",{writable:!1}),i}(),H_=(Object.assign(i.prototype,{qc:function(){var t,n,e,i;this.Lt||(t=(i=(n=this.yr(v)).Pn).Pn,i=i.Pn.Nt,n=n.getLayers(E.EXTENT_LAYER)[0].bound,n=i.Sc(this.G,this.nt,n,!0),this.j0(),this.Yl&&this.Gd||(this.Yl=this.uf.color),null!==this.ft&&this.Gd||(this.ft=this.uf.alpha),this.Hd&&this.Gd||(this.Hd=this.uf.strokeColor),this.fd&&this.Gd||(this.fd=this.uf.strokeWidth),null!==this.Xd&&this.Gd||(this.Xd=this.uf.alpha),(i=this.Qr(i.no)).userData.opacity=i.opacity,e=this.G.getBound(),this.Lt=new $a(n.geometry,i),i=new Tt(e.center.x-t.wt,0,t.xt-e.center.y),this.Lt.position.copy(i),this.Lt.rotation.set(-Math.PI/2,0,0,"XYZ"),(this.Lt.mapNode=this).Pn.Co.add(this.Lt),this.iv=n.shape,this.rv(n.shape),this.ov(),this.bh&&this.bh.qc(this))},sv:function(){var n=this,t=this.iv.getPoints(),e=new j_({color:this.Hd,width:this.fd,smooth:!1,animate:!1,depth:!0}),i=(e.Pn=this,[]),t=(t.forEach(function(t){i.push(t.x,t.y,n.nt+n.Vd)}),this.yr(p)),t=(e.Pd(i,t),e.Lt.material.depthWrite=!0,e.Lt.material.depthTest=!0,e.Lt.material.polygonOffset=!0,e.Lt.material.polygonOffsetFactor=-1,e.Lt.material.polygonOffsetUnits=1,this.Lt.add(e.Lt),this.nt&&-1!==this.nt?this.nt:2);e.Lt.position.setZ(.005*t),e.Lt.renderOrder=-1,e.Lt.isNoPick=!0,this.lh=e.Lt},av:function(t){return null===this.Zr?t:((t=t.clone()).clippingPlanes=this.Zr,t.clipping=!0,(this.n0||this.Kr&&"outside"===this.Kr)&&(t.clipIntersection=!0),t)},cv:function(t){var n=this.yr(v),t=t.wu({isline:!0,color:this.Hd,opacity:this.Xd*n.ft,needDepth:!0});return this.av(t)},initGLLine:function(){for(var t=this.yr(xs).Pn.Nt,n=this.cv(t.no),e=this.nt&&-1!==this.nt?this.nt:2,i=(new Us).setFromPoints(this.iv.getPoints()),r=(i&&0<i.vertices.length&&i.vertices.push(i.vertices[0]),[]),o=i.vertices.length,s=0;s<o;s++)i.vertices[s].z=this.nt+this.Vd,0===s||s===o-1?r.push(i.vertices[s]):r.push(i.vertices[s],i.vertices[s]);i.vertices=r;var a=new Hd(i,n);if(a.position.setZ(.005*e),a.castShadow=!1,a.geometry.computeBoundingSphere(),this.lh=a,this.lh.matrixAutoUpdate=!1,this.Lt.add(a),0===this.fd&&(this.lh.visible=!1),this.iv.holes)for(var u=0;u<this.iv.holes.length;u++){l=f=h=c=void 0;for(var c=a,h=this.iv.holes[u].curves,f=0;f<h.length;f++){var l=[];l.push(new Tt(h[f].v1.x,h[f].v1.y,e)),l.push(new Tt(h[f].v2.x,h[f].v2.y,e));l=new Hd((new ra).setFromPoints(l),n);c.add(l)}}},rv:function(){1<Math.floor(this.fd)?this.sv():this.initGLLine()},ov:function(){var t,n;this.Wd&&this.Yd&&(n=this.yr(p),t=new ma(1,1,1,1),n=this.hv(n,this.Wd),this.io.top=new $a(t,n),this.io.top.renderOrder=10,this.fv(),this.Lt.add(this.io.top))},tv:function(){this.Wd&&this.Yd?this.io.top?(this.lv(),this.fv()):this.ov():this.nv()},nv:function(){var t;this.io.top&&this.io.top.parent&&(this.io.top.parent.remove(this.io.top),this.io.top.geometry.dispose(),this.io.top.material.map&&this.io.top.material.map.dispose(),this.io.top.material.dispose(),this.io.top=null,t=this.yr(p))&&t.enableUpdateRender()},ev:function(t){this.Bd=t},ff:function(){this.j0(),this.Yl=this.uf.color,this.ft=this.uf.alpha,this.Hd=this.uf.strokeColor,this.Xd=this.uf.alpha,this.fd=this.uf.strokeWidth,this.lh&&(this.lh.visible=0!==this.fd),this.lf(),this.Lt&&this.tv()},dv:function(t){var n=this.yr(v);return t.wu({isline:!0,color:this.Hd,opacity:this.Xd*n.ft,needDepth:!0})},Jd:function(){return!!this.Lt&&this.Lt.material.userData.dirtyTheme},Qr:function(t){var n=this.yr(v),e=this.yr(xs).Pn.Nt,i={themeUseDetail:this.uf.themeUseDetail,level:n.level,buildingId:n.parent.buildingId},n={color:this.Yl,alpha:this.ft*n.ft,type:this.mi},r=(e.no.callHook("getMaterialBefor",{material:null==(r=this.Lt)?void 0:r.material,additionalInfo:i}),t.Eu(n,i));return e.no.callHook("getMaterialAfter",{createInfo:n,material:r,additionalInfo:i}),this.av(r)},hv:function(n,t){var e=new K0({transparent:!0,opacity:this.yr(v).ft,depthWrite:!1,visible:!1});return null!==this.Zr&&(e.clippingPlanes=this.Zr,e.clipping=!0,this.n0||this.Kr&&"outside"===this.Kr)&&(e.clipIntersection=!0),n.Nt.no.Du(t,function(t){e.map=t,e.map.wrapS=Xn,e.map.wrapT=Xn,e.needsUpdate=!0,e.visible=!0,e.polygonOffset=!0,e.polygonOffsetFactor=-1,e.polygonOffsetUnits=-4,n.enableUpdateRender()},{generateMipmaps:!0}),e},lv:function(){var t,n=this.io.top;n&&(n.material.map&&n.material.map.dispose(),n.material.map=null,n.material.dispose(),t=this.yr(p),n.material=this.hv(t,this.Wd))},lf:function(){var t,n;this.Lt&&(t=this.yr(p))&&(this.Lt.userData.sourceMaterial?this.Lt.userData.sourceMaterial=this.Qr(t.Nt.no):(n=this.Lt.material.userData,this.Lt.material=this.Qr(t.Nt.no),this.Lt.material.userData=n),this.$d(t),this.lv(),t.enableUpdateRender())},$d:function(t){if(this.lh&&Math.floor(this.fd)<2){var n=this.cv(t.Nt.no);this.lh.material=n;for(var e=0;e<this.lh.children.length;e++)this.lh.children[e].material=n}else this.lh&&(this.Lt.remove(this.lh),this.lh.mapNode instanceof j_?(this.lh.mapNode.width=this.fd,this.lh.mapNode.color=this.Hd):this.sv());t.enableUpdateRender()},fv:function(){var t=this.io.top,n=(t.scale.set(this.Yd[0],this.Yd[1],1),this.G.getBound());t.position.set(this.Qd[0]+this.Zd.x-n.center.x,this.Qd[1]+this.Zd.y-n.center.y,this.nt+.1),t.rotation.z=-this.qd*Math.PI/180},j0:function(){var t=this.yr(xs),n=t.Pn.Nt;this.uf=n.hf.Vu({fid:this.G.fid,typeID:this.G.type+"",bid:t.pi}),0===this.Kd&&(this.uf.image?this.Wd=n.p0(this.uf,"logoPath",t.buildingID)+this.uf.image:this.Wd=null,this.uf.coords&&(n=this.uf.coords.split(","),this.Zd=new Mt(parseFloat(n[0]),parseFloat(n[1]))),this.uf.angle&&(this.qd=this.uf.angle),this.uf.sizes)&&(t=this.uf.sizes.split(","),this.Yd=[parseFloat(t[0]),parseFloat(t[1])]),this.Lt&&delete this.Lt.material.userData.dirtyTheme},sf:function(){var t;this.Lt&&((t=this.yr(p))&&t.Nt.no.callHook("removeMaterial",{material:null==(t=this.Lt)?void 0:t.material,additionalInfo:{themeUseDetail:this.uf.themeUseDetail}}),this.lh&&(this.Lt.remove(this.lh),this.lh.material.dispose(),this.lh.geometry.dispose(),this.lh=void 0),this.nv(),this.Lt.parent&&this.Lt.parent.remove(this.Lt),this.Lt.geometry.dispose(),this.Lt.geometry=void 0,this.Lt.material=void 0,this.Lt.mapNode=void 0,this.Lt=void 0)},zd:function(t){return(t=(9301*t+49297)%233280)/233280}}),i);function X_(t){return(X_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function V_(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var i,r,o,s,a=[],u=!0,c=!1;try{if(o=(e=e.call(t)).next,0===n){if(Object(e)!==e)return;u=!1}else for(;!(u=(i=o.call(e)).done)&&(a.push(i.value),a.length!==n);u=!0);}catch(t){c=!0,r=t}finally{try{if(!u&&null!=e.return&&(s=e.return(),Object(s)!==s))return}finally{if(c)throw r}}return a}}(t,n)||z_(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function z_(t,n){var e;if(t)return"string"==typeof t?W_(t,n):"Map"===(e="Object"===(e=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?W_(t,n):void 0}function W_(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function Y_(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,$_(i.key),i)}}function Q_(t,n,e){n=nw(n);var i=t,n=Z_()?Reflect.construct(n,e||[],nw(t).constructor):n.apply(t,e);if(n&&("object"===X_(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function Z_(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Z_=function(){return!!t})()}function q_(){return(q_="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,n,e){var i=tw(t,n);if(i)return(i=Object.getOwnPropertyDescriptor(i,n)).get?i.get.call(arguments.length<3?t:e):i.value}).apply(this,arguments)}function K_(t,n,e,i){return(K_="undefined"!=typeof Reflect&&Reflect.set?Reflect.set:function(t,n,e,i){var r,t=tw(t,n);if(t){if((r=Object.getOwnPropertyDescriptor(t,n)).set)return r.set.call(i,e),!0;if(!r.writable)return!1}if(r=Object.getOwnPropertyDescriptor(i,n)){if(!r.writable)return!1;r.value=e,Object.defineProperty(i,n,r)}else J_(i,n,e);return!0})(t,n,e,i)}function J_(t,n,e){return(n=$_(n))in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function $_(t){t=function(t,n){if("object"!=X_(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=X_(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==X_(t)?t:String(t)}function tw(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=nw(t)););return t}function nw(t){return(nw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ew(t,n){return(ew=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var i=function(){var t,n=r,e=V1;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");function r(){if(this instanceof r)return Q_(this,r);throw new TypeError("Cannot call a class as a function")}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&ew(n,e),n=r,(e=[{key:"level",get:function(){return this.Pn.Or}},{key:"visible",get:function(){return this.Jt},set:function(t){var n=nw(r.prototype),e=t,i=!0;if(!K_(n,"visible",e,this||n)&&i)throw new TypeError("failed to set property");this.Jt=t,this.Co.visible=!(!this.Pn.visible||!this.Jt);e=this.yr(p);e&&e.Nt.Jo()}},{key:"getFeatures",value:function(){return this.Ot}},{key:"dispose",value:function(){this.if&&this.if(),q_(nw(r.prototype),"dispose",this).call(this)}},{key:"init",value:function(){q_(nw(r.prototype),"init",this).call(this);var t=this.yr(p);this.visible=t.Nt.vv(this.mi)}},{key:"getBound",value:function(){var t=this.bound;return{maxY:t.max.y,maxX:t.max.x,minX:t.min.x,minY:t.min.y}}},{key:"remove",value:function(t){this.Co.remove(t.Lt),q_(nw(r.prototype),"remove",this).call(this,t)}}])&&Y_(n.prototype,e),t&&Y_(n,t),Object.defineProperty(n,"prototype",{writable:!1}),r}(),iw=(Object.assign(i.prototype,{Zi:function(t){(t.Pn=this).Ot.push(t)},pv:function(t,n){var e,i=J_(J_(J_(J_(J_({},E.EXTERNAL_MODEL_LAYER,lg),E.MODEL_LAYER,H_),E.EXTENT_LAYER,Fb),E.FACILITY_LAYER,gg),E.LABEL_LAYER,Ag),r=function(t,n){var e,i,r,o,s="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(s)return i=!(e=!0),{s:function(){s=s.call(t)},n:function(){var t=s.next();return e=t.done,t},e:function(t){i=!0,r=t},f:function(){try{e||null==s.return||s.return()}finally{if(i)throw r}}};if(Array.isArray(t)||(s=z_(t))||n&&t&&"number"==typeof t.length)return s&&(t=s),o=0,{s:n=function(){},n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:n};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(t.Ot);try{for(r.s();!(e=r.n()).done;){var o=V_(e.value,2),s=(o[0],o[1]),a=new i[this.mi](s,n.map);this.Zi(a),a.visible=n.map.Nt.mv(this.mi,{typeID:a.typeID,FID:a.FID})}}catch(t){r.e(t)}finally{r.f()}}}),i);function rw(t){return(rw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ow(t,n,e){return(n=aw(n))in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function sw(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,aw(i.key),i)}}function aw(t){t=function(t,n){if("object"!=rw(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=rw(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==rw(t)?t:String(t)}function uw(t,n,e){n=fw(n);var i=t,n=cw()?Reflect.construct(n,e||[],fw(t).constructor):n.apply(t,e);if(n&&("object"===rw(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function cw(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(cw=function(){return!!t})()}function hw(){return(hw="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,n,e){var i=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=fw(t)););return t}(t,n);if(i)return(i=Object.getOwnPropertyDescriptor(i,n)).get?i.get.call(arguments.length<3?t:e):i.value}).apply(this,arguments)}function fw(t){return(fw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function lw(t,n){return(lw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var i=function(){var t,n=i,e=iw;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");function i(){if(this instanceof i)return uw(this,i);throw new TypeError("Cannot call a class as a function")}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&lw(n,e),n=i,(e=[{key:"init",value:function(){hw(fw(i.prototype),"init",this).call(this),this.Jh(),this.$h(),this.type===E.EXTERNAL_MODEL_LAYER&&By(this)}}])&&sw(n.prototype,e),t&&sw(n,t),Object.defineProperty(n,"prototype",{writable:!1}),i}(),dw=(Object.assign(i.prototype,{Jh:function(){var t=ow(ow(ow({},E.EXTERNAL_MODEL_LAYER,"FMExternalModelLayer"),E.MODEL_LAYER,"FMModelLayer"),E.EXTENT_LAYER,"FMExtentLayer"),n=this.yr(p),t=t[this.mi],e=n.Nt.Uu.get(n.getMapOptions().mapID).theme;n.getMapOptions().isuserLight||!e.Cc?this.ef=new ky(n).createLight(this,t):(e=n.Nt.Uu.get(n.getMapOptions().mapID).theme.Cc,this.ef=new ky(n).createLightByTheme(this,t,e.extent))},$h:function(){this.Co.add(this.Wh),this.Co.add(this.Vh),this.Co.add(this.Yh),this.Co.add(this.zh),this.Zh&&this.Co.add(this.Zh)},if:function(){this.Co.remove(this.Wh),this.Co.remove(this.Vh),this.Co.remove(this.Yh),this.ef.zn()}}),i);function vw(t){return(vw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function pw(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=vw(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=vw(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==vw(t)?t:String(t)}(i.key),i)}}function mw(t,n,e){n=bw(n);var i=t,n=yw()?Reflect.construct(n,e||[],bw(t).constructor):n.apply(t,e);if(n&&("object"===vw(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function yw(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(yw=function(){return!!t})()}function bw(t){return(bw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function gw(t,n){return(gw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}i=function(){var t,n,e=r,i=dw;if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");function r(t,n){var e;if(this instanceof r)return(e=mw(this,r)).Er=t.alias,e.yv=t.desc,e.nt=t.height,e.mi=E.EXTENT_LAYER,e.Co.name="extent",e.Co.userData.type="extent",e.bv={},e.pv(t,n),e;throw new TypeError("Cannot call a class as a function")}return e.prototype=Object.create(i&&i.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),i&&gw(e,i),e=r,t&&pw(e.prototype,t),n&&pw(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}();function _w(t){return(_w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ww(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=_w(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=_w(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==_w(t)?t:String(t)}(i.key),i)}}function xw(t,n,e){n=Sw(n);var i=t,n=Ew()?Reflect.construct(n,e||[],Sw(t).constructor):n.apply(t,e);if(n&&("object"===_w(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function Ew(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Ew=function(){return!!t})()}function Sw(t){return(Sw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Tw(t,n){return(Tw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var Aw=function(){var t,n=i,e=dw;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");function i(t,n){var e;if(this instanceof i)return(e=xw(this,i)).mi=E.MODEL_LAYER,e.Co.name="model",e.Co.userData.type="model",e.Er="model",e.gv={},e.pv(t,n),e;throw new TypeError("Cannot call a class as a function")}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&Tw(n,e),n=i,(e=[{key:"height",get:function(){return this.Pn.nt}}])&&ww(n.prototype,e),t&&ww(n,t),Object.defineProperty(n,"prototype",{writable:!1}),i}();function Mw(t){return(Mw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ow(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=Mw(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Mw(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Mw(t)?t:String(t)}(i.key),i)}}function Lw(t,n,e){n=Nw(n);var i=t,n=Rw()?Reflect.construct(n,e||[],Nw(t).constructor):n.apply(t,e);if(n&&("object"===Mw(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function Rw(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Rw=function(){return!!t})()}function Nw(t){return(Nw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Pw(t,n){return(Pw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var Fw=function(){var t,n=i,e=iw;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");function i(){if(this instanceof i)return Lw(this,i);throw new TypeError("Cannot call a class as a function")}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&Pw(n,e),n=i,(e=[{key:"collision",get:function(){return this.Zo},set:function(t){this.Zo!==t&&(this.Zo=t,t=this.yr(p))&&t.Nt.Jo()}}])&&Ow(n.prototype,e),t&&Ow(n,t),Object.defineProperty(n,"prototype",{writable:!1}),i}();function jw(t){return(jw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Iw(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=jw(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=jw(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==jw(t)?t:String(t)}(i.key),i)}}function Cw(t,n,e){n=kw(n);var i=t,n=Dw()?Reflect.construct(n,e||[],kw(t).constructor):n.apply(t,e);if(n&&("object"===jw(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return Uw(i)}function Dw(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Dw=function(){return!!t})()}function kw(t){return(kw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Uw(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Bw(t,n){return(Bw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var Gw=function(){var t,n=i,e=Fw;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");function i(t,n){var e;if(this instanceof i)return(e=Cw(this,i)).mi=E.LABEL_LAYER,e.Co.userData.type="label",e.Co.name="label",e.Co.mapNode=Uw(e),e.Er="label",e._v={},e.pv(t,n),e.Zo=!0,e;throw new TypeError("Cannot call a class as a function")}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&Bw(n,e),n=i,(e=[{key:"type",get:function(){return this.mi}}])&&Iw(n.prototype,e),t&&Iw(n,t),Object.defineProperty(n,"prototype",{writable:!1}),i}();function Hw(t){return(Hw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Xw(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=Hw(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Hw(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Hw(t)?t:String(t)}(i.key),i)}}function Vw(t,n,e){n=Ww(n);var i=t,n=zw()?Reflect.construct(n,e||[],Ww(t).constructor):n.apply(t,e);if(n&&("object"===Hw(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return Yw(i)}function zw(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(zw=function(){return!!t})()}function Ww(t){return(Ww=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Yw(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Qw(t,n){return(Qw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var Zw=function(){var t,n,e=r,i=Fw;if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");function r(t,n){var e;if(this instanceof r)return(e=Vw(this,r)).mi=E.FACILITY_LAYER,e.Co.userData.type="facility",e.Co.name="facility",e.Er="facility",e.wv={},e.Zo=!0,e.Co.mapNode=Yw(e),e.pv(t,n),e;throw new TypeError("Cannot call a class as a function")}return e.prototype=Object.create(i&&i.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),i&&Qw(e,i),e=r,t&&Xw(e.prototype,t),n&&Xw(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}();function qw(t){return(qw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Kw(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=qw(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=qw(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==qw(t)?t:String(t)}(i.key),i)}}function Jw(t,n,e){n=t2(n);var i=t,n=$w()?Reflect.construct(n,e||[],t2(t).constructor):n.apply(t,e);if(n&&("object"===qw(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function $w(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return($w=function(){return!!t})()}function t2(t){return(t2=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function n2(t,n){return(n2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var e2=function(){var t,n=i,e=dw;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");function i(t,n){var e;if(this instanceof i)return(e=Jw(this,i)).mi=E.EXTERNAL_MODEL_LAYER,e.Co.name="externalModel",e.Co.userData.type="externalModel",e.Er="externalModel",e.gv={},e.pv(t,n),e;throw new TypeError("Cannot call a class as a function")}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&n2(n,e),n=i,(e=[{key:"height",get:function(){return this.Pn.nt}},{key:"beforRemove",value:function(){this.traverse(function(t){t.beforRemove&&t.beforRemove()})}}])&&Kw(n.prototype,e),t&&Kw(n,t),Object.defineProperty(n,"prototype",{writable:!1}),i}();function i2(t){return(i2="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r2(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=i2(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=i2(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==i2(t)?t:String(t)}(i.key),i)}}function o2(t,n,e){n=a2(n);var i=t,n=s2()?Reflect.construct(n,e||[],a2(t).constructor):n.apply(t,e);if(n&&("object"===i2(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function s2(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(s2=function(){return!!t})()}function a2(t){return(a2=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function u2(t,n){return(u2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var c2=function(){var t,n,e=r,i=$1;if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");function r(){var t;if(this instanceof r)return(t=o2(this,r)).mi=E.WALL_MARKER,t;throw new TypeError("Cannot call a class as a function")}return e.prototype=Object.create(i&&i.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),i&&u2(e,i),e=r,t&&r2(e.prototype,t),n&&r2(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}();function h2(t){return(h2="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function f2(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=h2(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=h2(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==h2(t)?t:String(t)}(i.key),i)}}function l2(t,n,e){n=v2(n);var i=t,n=d2()?Reflect.construct(n,e||[],v2(t).constructor):n.apply(t,e);if(n&&("object"===h2(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function d2(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(d2=function(){return!!t})()}function v2(t){return(v2=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function p2(t,n){return(p2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var m2=function(){var t,n,e=r,i=$1;if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");function r(){var t;if(this instanceof r)return(t=l2(this,r)).mi=E.TUBE_MARKER,t.Jh(),t;throw new TypeError("Cannot call a class as a function")}return e.prototype=Object.create(i&&i.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),i&&p2(e,i),e=r,t&&f2(e.prototype,t),n&&f2(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}();Object.assign(m2.prototype,{Jh:function(){this.Vh=new Iy(7631988),this.zh=new a,this.Wh=new Od(8947848,1.2),this.Wh.position.set(-1,1,1).normalize(),this.Wh.castShadow=!1,this.Wh.target=this.zh,this.Yh=new Od(3355443),this.Yh.position.set(-.5,1,-1).normalize(),this.Yh.target=this.zh,this.Co.add(this.Wh),this.Co.add(this.Yh),this.Co.add(this.Vh),this.Co.add(this.zh)}});function y2(t){return(y2="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function b2(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=y2(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=y2(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==y2(t)?t:String(t)}(i.key),i)}}function g2(t,n,e){n=w2(n);var i=t,n=_2()?Reflect.construct(n,e||[],w2(t).constructor):n.apply(t,e);if(n&&("object"===y2(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function _2(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(_2=function(){return!!t})()}function w2(t){return(w2=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function x2(t,n){return(x2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var E2=function(){var t,n,e=r,i=$1;if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");function r(){var t;if(this instanceof r)return(t=g2(this,r)).mi=E.LINE3D_MARKER,t;throw new TypeError("Cannot call a class as a function")}return e.prototype=Object.create(i&&i.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),i&&x2(e,i),e=r,t&&b2(e.prototype,t),n&&b2(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}();function S2(t){return(S2="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function T2(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=S2(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=S2(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==S2(t)?t:String(t)}(i.key),i)}}function A2(t,n,e){n=O2(n);var i=t,n=M2()?Reflect.construct(n,e||[],O2(t).constructor):n.apply(t,e);if(n&&("object"===S2(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function M2(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(M2=function(){return!!t})()}function O2(t){return(O2=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function L2(t,n){return(L2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var R2=function(){var t,n,e=r,i=$1;if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");function r(){var t;if(this instanceof r)return(t=A2(this,r)).mi=E.SPHERE_MARKER,t;throw new TypeError("Cannot call a class as a function")}return e.prototype=Object.create(i&&i.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),i&&L2(e,i),e=r,t&&T2(e.prototype,t),n&&T2(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(),N2={},P2=(N2.LAYER_CLASS=new Map,N2.LAYER_CLASS.set(E.EXTENT_LAYER,i),N2.LAYER_CLASS.set(E.MODEL_LAYER,Aw),N2.LAYER_CLASS.set(E.LABEL_LAYER,Gw),N2.LAYER_CLASS.set(E.FACILITY_LAYER,Zw),N2.LAYER_CLASS.set(E.EXTERNAL_MODEL_LAYER,e2),N2.LAYER_CLASS.set(E.IMAGE_MARKER,tv),N2.LAYER_CLASS.set(E.TEXT_MARKER,Jd),N2.LAYER_CLASS.set(E.POLYGON_MARKER,$d),N2.LAYER_CLASS.set(E.EXTRUDE_MARKER,e),N2.LAYER_CLASS.set(E.HEAT_MAP_MARKER,jy),N2.LAYER_CLASS.set(E.DYNAMIC_MODEL_MARKER,Zy),N2.LAYER_CLASS.set(E.LINE_MARKER,ib),N2.LAYER_CLASS.set(E.LOCATION_MARKER,fb),N2.LAYER_CLASS.set(E.DOM_MARKER,bb),N2.LAYER_CLASS.set(E.WALL_MARKER,c2),N2.LAYER_CLASS.set(E.TUBE_MARKER,m2),N2.LAYER_CLASS.set(E.LINE3D_MARKER,E2),N2.LAYER_CLASS.set(E.SPHERE_MARKER,R2),N2);function F2(t){return(F2="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function j2(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var i,r,o,s,a=[],u=!0,c=!1;try{if(o=(e=e.call(t)).next,0===n){if(Object(e)!==e)return;u=!1}else for(;!(u=(i=o.call(e)).done)&&(a.push(i.value),a.length!==n);u=!0);}catch(t){c=!0,r=t}finally{try{if(!u&&null!=e.return&&(s=e.return(),Object(s)!==s))return}finally{if(c)throw r}}return a}}(t,n)||I2(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function I2(t,n){var e;if(t)return"string"==typeof t?C2(t,n):"Map"===(e="Object"===(e=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?C2(t,n):void 0}function C2(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function D2(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=F2(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=F2(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==F2(t)?t:String(t)}(i.key),i)}}function k2(t,n,e){n=G2(n);var i=t,n=U2()?Reflect.construct(n,e||[],G2(t).constructor):n.apply(t,e);if(n&&("object"===F2(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function U2(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(U2=function(){return!!t})()}function B2(){return(B2="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,n,e){var i=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=G2(t)););return t}(t,n);if(i)return(i=Object.getOwnPropertyDescriptor(i,n)).get?i.get.call(arguments.length<3?t:e):i.value}).apply(this,arguments)}function G2(t){return(G2=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function H2(t,n){return(H2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var i=function(){var t,n=i,e=ps;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");function i(t){var n;if(this instanceof i)return(n=k2(this,i)).Ai=t.mapOptions,n.En=t.states,n.G=t.data,n.Or=n.G.gid,n.xv=n.G.gname,n.Ev=n.G.alias,n.Sv=n.G.desc,n.nt=0,n.Tv=null,n.Av=[E.EXTENT_LAYER,E.EXTERNAL_MODEL_LAYER,E.MODEL_LAYER,E.LABEL_LAYER,E.FACILITY_LAYER],n.ft=1,n.Mv=!0,n.Ov=new Ns,n.Ov.isEffect=!0,n;throw new TypeError("Cannot call a class as a function")}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&H2(n,e),n=i,(e=[{key:"bound",get:function(){return F1(this)}},{key:"height",get:function(){return this.nt}},{key:"type",get:function(){return this.G.mi}},{key:"center",get:function(){var t=this.Tv;return{x:(t.minX+t.maxX)/2,y:(t.minY+t.maxY)/2}}},{key:"x",get:function(){return this.center.x}},{key:"y",get:function(){return this.center.y}},{key:"visible",get:function(){return this.Jt},set:function(t){var n=this,t=(this.Jt=t,this.traverse(function(t){t.Co.visible=!(!t.visible||!n.Jt)}),this.yr(p));t&&t.Nt.Jo()}},{key:"level",get:function(){return this.Or}},{key:"name",get:function(){return this.xv}},{key:"ID",get:function(){return this.pi}},{key:"alias",get:function(){return this.Ev}},{key:"floorID",get:function(){return this.G.floorId}},{key:"effectScene",get:function(){return this.Ov}},{key:"getLayers",value:function(t,n){if(void 0===t)return this.Ot;for(var e=[],i=0;i<this.Ot.length;i++)0==(this.Ot[i].type&t)==!!n&&e.push(this.Ot[i]);return e}},{key:"getExtendMesh",value:function(){var t=this.getLayers(E.EXTENT_LAYER)[0];return t?t.Ot[0].Lt:null}},{key:"getExtendByCoords",value:function(t){for(var n=null,e=this.getLayers(E.EXTENT_LAYER)[0],i=0;i<e.Ot.length;i++){var r=e.Ot[i],o=r.G.yi[0];if(z.Te(t,o,o.length)){n=r;break}}return n}},{key:"getModelMeshs",value:function(){for(var t=this.getLayers(E.MODEL_LAYER)[0],n=[],e=0;e<t.Ot.length;e++)n.push(t.Ot[e].Lt);return n}},{key:"getBound",value:function(){return this.G.getBound().toObject()}},{key:"setExtentImage",value:function(t){for(var n=this.getLayers(E.EXTENT_LAYER)[0],e=0;e<n.Ot.length;e++)n.Ot[e].df(t)}},{key:"clearExtentImage",value:function(){this.setExtentImage("")}},{key:"getOrCreateLayer",value:function(t){var n=this.getLayers(t)[0];return void 0!==n||(n=new(P2.LAYER_CLASS.get(t)),this.Zi(n),this.yr(p).jt.Mn()),n}},{key:"getMapCoordsRange",value:function(){return this.Tv}},{key:"opacity",value:function(){return this.ft}},{key:"remove",value:function(t){t.beforRemove&&t.beforRemove(),B2(G2(i.prototype),"remove",this).call(this,t);t=this.yr(p);t&&t.jt&&t.jt.Mn()}}])&&D2(n.prototype,e),t&&D2(n,t),Object.defineProperty(n,"prototype",{writable:!1}),i}(),v=(Object.assign(i.prototype,{Lv:function(){var t=this.En.lr(this.Pn.pi);t.nonFocusAlphaMode&&(this.Pn.level===this.Or?1!==this.ft&&(this.ft=1,this.Mv=!0):this.ft!==t.nonFocusAlpha&&(this.ft=t.nonFocusAlpha,this.Mv=!0))},Zi:function(t){(t.Pn=this).Ot.push(t),this.needUpdateBound=!0,t.init(),this.Rv(t)},Rv:function(t){this.Ov.add(t.Co)},Nv:function(){var i,r,t,o=this,n=this.Pn;this.Pn.constructor===b1?this.nt=n.floorSpace*this.Or:1===n.visibleLevels.length&&this.En.xn!=n.buildingID?(t=n.parent.Tn,this.nt=t.getFloor(t.level).height):(i=1/0,r=0,(t=n.alignHeight).forEach(function(t,n,e){Math.abs(o.Or-n)<i&&(i=Math.abs(o.Or-n),r=n)}),this.nt=t.get(r)+n.floorSpace*(this.Or-r))},Pv:function(t){t.mi===E.LOCATION_MARKER&&t.Ot.forEach(function(t){t.G0()})},Mr:function(t){function e(){o.jo.Ot.forEach(function(t){t.mi===E.LINE_MARKER&&t.G0({needUpdateCrossLine:1<i.parent.visibleLevels.length})}),o.enableUpdateNode()}var i=this,n=void 0===(t=t||{}).animate||t.animate,r=void 0!==t.duration?t.duration:.5,o=this.yr(p),s=this.nt;this.Nv();n?(this.Fv||(this.Fv=new Rr),this.Fv.Wn([s]).Yn([this.nt]).Qn(r).qn(function(n){i.traverse(function(t){t.mi!==E.LINE_MARKER&&t.mi!==E.LOCATION_MARKER&&(t.Co.position.y=n.destination[0]),i.Pv(t)}),e()}).Kn(function(){t.finish&&t.finish()}),o.$i.Zi(this.Fv.Vn())):(this.Fv&&this.Fv.stop(),this.traverse(function(t){t.mi!==E.LINE_MARKER&&t.mi!==E.LOCATION_MARKER&&(t.Co.position.y=i.nt),i.Pv(t)}),e())},jv:function(e){for(var t=0;t<this.Ot.length;t++)if("externalModel"===this.Ot[t].Er)this.Ot[t].Co.traverse(function(t){if("Mesh"===t.type&&t.material.length)for(var n=0;n<t.material.length;n++)t.material[n].userData.oldAlpha||(t.material[n].userData.oldAlpha=t.material[n].opacity),t.material[n].opacity=e});else for(var n=this.Ot[t].Co.children,i=0;i<n.length;i++)n[i].material&&(n[i].material.userData.oldAlpha||(n[i].material=n[i].material.clone(),n[i].material.userData.oldAlpha=n[i].material.opacity),n[i].material.opacity=e)},Iv:function(){for(var t=0;t<this.Ot.length;t++)if("externalModel"===this.Ot[t].Er)this.Ot[t].Co.traverse(function(t){if("Mesh"===t.type)if(t.material.length)for(var n=0;n<t.material.length;n++)t.material[n].userData.oldAlpha&&(t.material[n].opacity=t.material[n].userData.oldAlpha);else t.material.userData.oldAlpha&&(t.material.opacity=t.material.userData.oldAlpha)});else for(var n=this.Ot[t].Co.children,e=0;e<n.length;e++)n[e].material&&n[e].material.userData.oldAlpha&&(n[e].material.opacity=n[e].material.userData.oldAlpha)},Cv:function(){var n=this;this.Pn.Pn.Fr.Pr.get(this.Pn.gr).Ot.forEach(function(t){t.gid===n.Or&&(t=t.Ot.get(E.EXTENT_LAYER).getBound(),n.Tv={minX:t.X.x,minY:t.X.y,maxX:t.H.x,maxY:t.H.y})})},Dv:function(){var i,r=this,t=this.G,o=null,s=this.yr(p),n=function(t,n){var e,i,r,o,s="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(s)return i=!(e=!0),{s:function(){s=s.call(t)},n:function(){var t=s.next();return e=t.done,t},e:function(t){i=!0,r=t},f:function(){try{e||null==s.return||s.return()}finally{if(i)throw r}}};if(Array.isArray(t)||(s=I2(t))||n&&t&&"number"==typeof t.length)return s&&(t=s),o=0,{s:n=function(){},n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:n};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(t.Ot);try{for(n.s();!(i=n.n()).done;)!function(){var t=j2(i.value,2),n=t[0],t=t[1];if(r.Ot.some(function(t){return t.type===n}))return;var e=P2.LAYER_CLASS.get(n);o=new e(t,{map:s}),r.Zi(o)}()}catch(t){n.e(t)}finally{n.f()}},kv:function(t,n){for(var e=null,i=0;i<t.length;i++)if(""+t[i].mi==""+n){e=t[i];break}return e}}),i);var X2={textureCanvas:null,dispose:function(){}};function V2(t){return(V2="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function z2(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=V2(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=V2(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==V2(t)?t:String(t)}(i.key),i)}}function W2(t,n,e){return n&&z2(t.prototype,n),e&&z2(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var Aw=W2(function t(n,e,i,r){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this.gn=n,this.Ai=e,this.En=i,this.Hn=r,this.no=new j0(this),this.Ai.themeTool&&this.Ai.themeTool.setMaterialManager(this.no),this.G=null,this.f0=new up(n),this.f0.Pc=this.Ai.ClassicMaterial,this.Uv=new pp(n),this.hf=new k0(this),this.Uu=new Map,this.Rt=[],this.Bv=[],this.Gv=0,this.Hv=!1,this.Gn=this.Gn.bind(this),this.Xv=null,this.Vv=this.Vv.bind(this),this.zv=new Gt(new Tt(0,1,0),0),this.Dr=new cs,this.$t=!0,n.on("visibleLevelsLoaded",this.Vv),n.on("loaded",this.Vv),n.on("viewChanged",this.Vv),n.on("viewModeChanged",this.Vv),n.on("buildingEntered",this.Vv),n.on("buildingExited",this.Vv),n.on("zoom",this.Vv),n.on("move",this.Vv),n.on("mapLoaded",this.Vv),n.on("levelChanged",this.Vv),n.on("sceneLoaded",this.Vv),n.on("firstViewLoaded",this.Vv),n.on("beforeRender",this.Gn),this.Oa=null,this.ko=this.ko.bind(this),this.La=new Rl({disposeCallback:this.ko,enable:!0,name:"NodeManager",mapCreateTime:this.gn.Ln})}),Y2=(Object.assign(Aw.prototype,{Vv:function(n){var t,e=this;if("visibleLevelsLoaded"!==n.type&&"loaded"!==n.type&&"viewChanged"!==n.type||(this.En.Wv=!0,this.Jo()),"viewModeChanged"===n.type&&this.gn.Gt.Bt.updateCheck(),"mapLoaded"===n.type&&this.gn.Yv(function(t){e.Qv({bid:t.pi})}),"move"===n.type&&this.gn.Zv(),"buildingEntered"!==n.type&&"buildingExited"!==n.type||this.Qv({bid:n.buildingID}),"zoom"===n.type){if(this.gn.Zv(),this.gn.traverse(function(t){t!==e.gn.Tn&&(e.Qv({bid:t.pi}),t.Ah())}),st.a.environment===B.a.WX){if(void 0===X2.lastHandleZoomTime&&(X2.lastHandleZoomTime=Date.now()),Date.now()-X2.lastHandleZoomTime<50)return void(X2.lastHandleZoomTime=Date.now());X2.lastHandleZoomTime=Date.now()}this.gn.traverse(function(t){t.visible&&t.traverse(function(t){t.visible&&t.traverse(function(t){t.visible&&t.traverse(function(t){t.type===E.EXTERNAL_MODEL&&t.Lt&&(!(t.G&&(t.G.maxlevel<=n.zoom||t.G.minlevel>n.zoom))?t.fading&&t.a0():t.u0())})})})})}"levelChanged"!==n.type&&"visibleLevelsLoaded"!==n.type||(n.buildingID&&n.buildingID!==this.gn.Ai.buildingID?(t=this.gn.getBuilding(n.buildingID))&&t.traverse(function(t){t.Mr()}):this.gn.traverse(function(t){"levelChanged"===n.type&&t.pi!==e.gn.Ai.buildingID&&t.Mh(n.level),t.traverse(function(t){t.Mr({animate:!1})})})),"sceneLoaded"!==n.type||n.buildingID||(this.Gv+=5,this.gn.Dt.Ct({type:"progress",progressBar:this.Gv})),"visibleLevelsLoaded"===n.type&&void 0===n.buildingID&&(this.Gv+=50,this.gn.Dt.Ct({type:"progress",progressBar:this.Gv})),"loaded"===n.type&&(this.Gv+=30,this.gn.Dt.Ct({type:"progress",progressBar:this.Gv})),"firstViewLoaded"===n.type&&(this.Gv=100,this.gn.Dt.Ct({type:"progress",progressBar:this.Gv}))},kd:function(t){var n=(new Tt).copy(this.gn.Gt.Bt.target),e=new Mt(0,0);return n.y=t+e.y,10/("PerspectiveCamera"===this.gn.kt.type?(t=this.gn.kt.near,e=this.gn.kt.fov,n=this.gn.Gt.Bt.object.position.distanceTo(n),10*t*Math.tan(e/2*u.DEG2RAD)*2/this.gn.jt.renderer.domElement.clientHeight*n/t):(e=this.gn.kt.top,n=this.gn.kt.bottom,10*Math.abs(e-n)/this.gn.jt.renderer.domElement.clientHeight/this.gn.kt.zoom))},Gn:function(){this.En.qv&&(this.Kv(),this.Jv(),this.Ft(),this.Pt(),this.gn.jt.On(),this.gn.jt.zt())},Jo:function(){this.gn.jt.Jo()},Mn:function(){this.gn.jt.Mn()},$v:function(t,n){var e,i,r;return!t.getBound||!n||!(t=t.boundNoClone)||(e=!0,i=t.max,t=t.min,r=n.max,n=n.min,!(i.x<n.x||t.x>r.x||i.y<n.y||t.y>r.y)&&e)},tp:function(t,n){for(var e=[],i=[],r=this.Ai.container.clientWidth,o=this.Ai.container.clientHeight,s=(e.push(dr.coordsScreenToMap(this.gn,{x:0,y:0,level:n,buildingID:t.pi})),e.push(dr.coordsScreenToMap(this.gn,{x:r,y:0,level:n,buildingID:t.pi})),e.push(dr.coordsScreenToMap(this.gn,{x:r,y:o,level:n,buildingID:t.pi})),e.push(dr.coordsScreenToMap(this.gn,{x:0,y:o,level:n,buildingID:t.pi})),t.visibleLevels),a=new Fi,u=0;u<s.length;u++){var c=t.getFloor(s[u]).getBound();a.Yt([c.max,c.min])}i.push({x:a.min.x,y:a.min.y}),i.push({x:a.min.x,y:a.max.y}),i.push({x:a.max.x,y:a.max.y}),i.push({x:a.max.x,y:a.min.y});r=[],lm.PolygonClip(e,i,r),o=new cm;return o.setFromPoints(r),o},Sc:function(t,n,e,i){var r=t.yi,o=t.getBound(),s=new Dp,a=r[0];if(0<a.length){s.moveTo(a[0].x-o.center.x,a[0].y-o.center.y);for(var u=1;u<a.length;u++)s.lineTo(a[u].x-o.center.x,a[u].y-o.center.y)}if(1<r.length)for(var c=1;c<r.length;c++){var h=r[c],f=new Cp;if(0<h.length){f.moveTo(h[0].x-o.center.x,h[0].y-o.center.y);for(var l=1;l<h.length;l++)f.lineTo(h[l].x-o.center.x,h[l].y-o.center.y)}s.holes.push(f)}for(var d,v,p,m=null,m=0===n?new im(s):new om(s,{depth:n,bevelEnabled:!1}),y=i?(d=e.min.x,v=e.min.y,p=e.max.x-d,e.max.y-v):(d=o.min.x,v=o.min.y,p=o.max.x-d,o.max.y-v),b=m.faces,g=b.length,_=0;_<g;_++){var w=m.vertices[b[_].a],x=m.vertices[b[_].b],E=m.vertices[b[_].c];m.faceVertexUvs[0][_][0].x=(w.x+o.center.x-d)/p,m.faceVertexUvs[0][_][0].y=(w.y+o.center.y-v)/y,m.faceVertexUvs[0][_][1].x=(x.x+o.center.x-d)/p,m.faceVertexUvs[0][_][1].y=(x.y+o.center.y-v)/y,m.faceVertexUvs[0][_][2].x=(E.x+o.center.x-d)/p,m.faceVertexUvs[0][_][2].y=(E.y+o.center.y-v)/y}return m.computeBoundingSphere(),{geometry:m,shape:s}},Sh:function(e){var i=this,r=this.En.lr(e.bid);r.themeNeedLoad=!0,r.themeLoaded=!1,this.np({themeID:e.themeID},function(t){r.themeID=e.themeID;var n=i.Uu.get(e.bid);n||(i.Uu.set(e.bid,{theme:new ym}),n=i.Uu.get(e.bid)),n.theme.qc(t),r.themeLoaded=!0,e.bid===i.Ai.buildingID&&(i.En.j0(i.hf),i.gn.setBackgroundColor(i.En.backgroundColor,i.En.backgroundAlpha)),i.ep()})},Th:function(t){var n=this.Uu.get(t.bid);t.data?(n||(this.Uu.set(t.bid,{themeExtension:new Tm}),n=this.Uu.get(t.bid)),n.themeExtension||(n.themeExtension=new Tm),n.themeExtension.qc(t.data)):n&&n.themeExtension&&(this.Ai.buildingID===t.bid?n.themeExtension.resize():(n.themeExtension.zn(),n.themeExtension=null)),this.En.j0(this.hf),this.gn.setBackgroundColor(this.En.backgroundColor,this.En.backgroundAlpha),!1!==t.needUpdataNode&&this.ip(t)},zn:function(t){var n=this;this.gn.off("visibleLevelsLoaded",this.Vv),this.gn.off("loaded",this.Vv),this.gn.off("viewChanged",this.Vv),this.gn.off("viewModeChanged",this.Vv),this.gn.off("buildingEntered",this.Vv),this.gn.off("zoom",this.Vv),this.gn.off("move",this.Vv),this.gn.off("buildingLoaded",this.Vv),this.gn.off("beforeRender",this.Gn),this.Oa=t,this.no.zn(function(){n.no=null,n.La.ya(!0)})},ko:function(){for(var t in this.Rt=[],this.f0.zn(),this.f0=null,this.Uu.clear(),this.gn=null,this)this[""+t]&&this[""+t].zn&&this[""+t].zn();for(var n in this.Oa&&this.Oa({name:"NodeManager"}),this)this[""+n]=null,delete this[""+n]}}),Object.assign(Aw.prototype,{p0:function(t,n,e){var i=this.En.lr(this.gn.Tn.pi).themeID,r=this.Ai,o=this.Uu.get(this.Ai.buildingID).theme,s="";if(s=e===this.Ai.buildingID?r.userThemeURL?r.userThemeURL+i:r.themeURL+i:(e=(e=this.Uu.get(e))&&e.theme?e.theme.themeID:i,r.userThemeURL?r.userThemeURL+e:r.themeURL+e),r.isPreview)return i=r.themeURL,"path"===n?("1"===t.isuser?i+=o.userPath+"/":i+=o.sysPath+"/",i):"logoPath"===n?i+(o.logoPath+"/"):"model"===n?("1"===t.isuser?i+=o.userModelPath+"/":i+=o.sysModelPath+"/",i):void 0;if("model"===n){if(r.externalModelURL)return r.externalModelURL+"models/";if(r.userThemeURL)return s+"/models/"}return s+"/"},Ic:function(){var n;this.En.rp||this.En.ts&&0===this.Rt.length&&(n=!0,this.f0.sn.forEach(function(t){t.loadComplete||(n=!1)}),n)&&(this.En.rp=!0,this.gn.Dt.Ct({type:"externalFirstLoaded"}))},op:function(t,o){var s=this;if(this.Ai.tile&&!this.Ai.preLoad){for(var a=[],u=t.building,n=0;n<u.visibleLevels.length;n++){var e=u.getFloor(u.visibleLevels[n]);e&&0===this.sp(e)&&(this.ap(e)?(e.Dv(),this.cp(e)):a.push(u.visibleLevels[n]))}0<a.length?((t=s1(u,this)).buildings=null,this.gn.Fr.Ra(t,function(t,n){if("floor"===t){var e=s.En.hp(u.pi);if(e.set(n.gid,!0),-1<a.indexOf(n.gid)){for(var t=u.getFloor(n.gid),i=(s.fp(t),!0),r=0;r<a.length;r++)if(!e.get(a[r])){i=!1;break}i&&o&&o()}}})):o&&o()}else o&&o()},lp:function(t){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},e=this.En.lr(t),i=e.themeExtension||n.themeExtension,r=e.themeID||n.themeID;r&&t?(this.Uu.set(t,{theme:new ym}),e.themeLoaded=!1,e.themeNeedLoad=!0,this.dp({bid:t,themeID:r,themeExtension:i,contentVersion:n.contentVersion})):(e.themeLoaded=!0,e.themeNeedLoad=!1)},vp:function(c){var h=this,t=(c=c||[],this.gn.Ai.buildingOptions),f=t.buildings||t.themeID,l=null;(function t(){var n=h.gn.getBuildings();if(!1===h.gn.pp)l=setTimeout(t,1);else{null!==l&&clearTimeout(l);var e=[];if(0<c.length)for(var i=0;i<c.length;i++){var r=c[i].bcode,r=h.mp(r);h.lp(r,c[i]),e.push(r)}if(f)for(var o=0;o<n.length;o++){var s=n[o].buildingID;e.includes(s)||h.lp(s)}if(e.length!==n.length)for(var a=0;a<n.length;a++){var u=n[a].buildingID;e.includes(u)||((u=h.En.lr(u)).themeLoaded=!0,u.themeNeedLoad=!1)}}})()},dp:function(e){var i=this;this.np(e,function(t){var n=i.Uu.get(e.bid);n.theme.qc(t),n.theme.themeID=e.themeID,e.themeExtension&&(n.themeExtension=new Tm,n.themeExtension.qc(e.themeExtension)),i.En.lr(e.bid).themeLoaded=!0,e.bid===i.Ai.buildingID&&(i.En.j0(i.hf),i.gn.setBackgroundColor(i.En.backgroundColor,i.En.backgroundAlpha),i.vp(t.buildings)),i.En.qv=i.yp(),(i.En.bp||i.En.gp)&&(i.Hn(null,null,i.En.bp,!1,i.En.gp,i.En.qv),i.En.bp)&&(i.En.bp=!1)})},np:function(t,n){var e,i=this;t.theme?n(t.theme):(e="_loadTheme"+St.generateUUID(),this.La.ba(e),Rm.ss(this.Ai.themeURL,t.themeID,function(t){n&&n(t),i.La.ga(e)},function(t){i.gn.Dt.Ct({type:"info",InfoMode:t}),i.La.ga(e)},t.contentVersion))},_p:function(t){var n,e=this.En.lr(t.pi);e.buildingLoaded||(this.Ai.tile?this.qo(t)?((n=s1(t,this)).buildings=null,n.isOutdoor=!1,this.wp(n)):e.sceneLoaded||this.Ai.tile&&((n=s1(t,this)).buildings=null,n.isOutdoor=!1,this.xp(n)):((e=Object.assign({},this.Ai)).isOutdoor=!1,e.buildingID=t.gr,e.bid=t.pi,e.buildings=null,this.Ep(e)))},Sp:function(t,n){var e=null,t=this.gn.getBuilding(t.bid),n={type:"info",InfoMode:n,buildingID:e=t?t.pi:e};this.gn.Xi.error.push(n),this.gn.Dt.Ct(n)},Tp:function(t,n){var e=null;t.buildingID!==t.mapID&&(e=t.bid),this.Ap({bid:t.bid,levels:n.levels}),this.gn.Dt.Ct({type:"sceneLoaded",buildingID:e}),this.gn.Dt.Ct({type:"info",InfoMode:vr.INFO,mapID:n.mid,buildingID:e})},Ep:function(c){var h=this;this.gn.Fr.Na(c,function(t,s){var n;if(!(0<h.gn.Xi.error.length))if("complete"===t)if(c.isOutdoor){var e=h.Mp(s);if(!(0<h.gn.Xi.error.length)){var i=h.En.lr(e.pi);if(i.buildingLoaded=!0,!(i.sceneLoaded=!0)!==h.Op(s,!0))for(var r=h.En.hp(e.pi),o=0;o<e.Sr.length;o++){var a=s.Ot.get(e.Sr[o]),u=(r.set(a.gid,!0),h.ea(e,a,e.Sr[o]));h.fp(u),h.Lp(e,a.gid)}}}else h.gn.Ot.forEach(function(t){if(t.gr===s.mid){t.Sr=s.levels,t.Ar=new jt(new Tt(s.minX,s.minY),new Tt(s.maxX,s.maxY));for(var n=h.En.lr(t.pi),e=(n.buildingLoaded=!0,n.sceneLoaded=!0,h.En.hp(t.pi)),i=0;i<s.levels.length;i++){var r=s.Ot.get(s.levels[i]),o=(e.set(r.gid,!0),h.ea(t,r,s.levels[i]));h.fp(o),h.Lp(t,r.gid)}}});else"decode"===t?(i=null,(n=h.gn.getBuilding(c.bid))&&(i=n.pi),h.Ap({bid:void 0!==c.bid?c.bid:c.buildingID,levels:s.scene.levels}),h.gn.Dt.Ct({type:"sceneLoaded",buildingID:i}),h.gn.Dt.Ct({type:"info",InfoMode:vr.INFO,mapID:s.scene.mid,buildingID:i})):"error"===t&&h.Sp(c,s)})},Op:function(t,n){if(t.buildings)for(var e=0;e<t.buildings.length;e++){var i=this.Rp(t.buildings[e]);if(0<this.gn.Xi.error.length&&n)return!1;this._p(i)}return t.buildings&&0!==t.buildings.length&&t.buildings.length!==this.gn.Ot.length-1||(this.gn.pp=!0),!0},Np:function(t,n){for(var e=0;e<t.Sr.length;e++){var i=n.Ot.get(t.Sr[e]);this.ea(t,i,t.Sr[e])}},wp:function(o){var s=this;this.gn.Fr.Ra(o,function(t,n){var e,i,r;0<s.gn.Xi.error.length||("building"===t&&(e=null,r=(i=s.En.lr(o.bid)).sceneLoaded,i.buildingLoaded=!0,i.sceneLoaded=!0,o.buildingID===o.mapID?(e=s.Mp(n),s.Op(n,!1)):(e=s.gn.getBuilding(o.bid),r||(e.Sr=n.levels,e.Ar=new jt(new Tt(n.minX,n.minY),new Tt(n.maxX,n.maxY)))),r||s.Np(e,n)),"scene"===t&&s.Tp(o,n),"floor"===t&&(i=s.gn.getBuilding(o.bid),s.En.hp(i.pi).set(n.gid,!0),(r=i.getFloor(n.gid)).G=n,s.fp(r),s.Lp(i,n.gid)),"error"===t&&s.Sp(o,n))})},xp:function(r){var o=this,e=null;this.gn.Fr.Is(r,function(t,n){"building"===t?((e=o.gn.getBuilding(r.bid)).Sr=n.levels,e.Ar=new jt(new Tt(n.minX,n.minY),new Tt(n.maxX,n.maxY)),o.En.lr(e.pi).sceneLoaded=!0,o.Np(e,n),o.Lp(e,void 0)):"scene"===t&&o.Tp(r,n)},function(t,n){var e=null,i=o.gn.getBuilding(r.bid);i&&(e=i.pi),o.gn.Dt.Ct({type:"info",InfoMode:n,buildingID:e})})},Eh:function(t){this._p(t)},Lp:function(t,n){var e=this.En.lr(t.pi),i=e.loaded,r=e.visibleLevelsLoaded;this.Pp(t),!r&&e.visibleLevelsLoaded&&(this.En.bp&&this.En.qv?(this.Hn(null,n,!0,!0,!1,this.En.qv),this.En.bp=!1):this.Hn(null,n,!1,!0,!1,this.En.qv),r={type:"visibleLevelsLoaded"},t!==this.gn.Tn&&(r.buildingID=t.pi),this.gn.Dt.Ct(r)),!i&&e.loaded&&(t!==this.gn.Tn?this.gn.Dt.Ct({type:"buildingLoaded",buildingID:t.pi}):this.gn.Dt.Ct({type:"mapLoaded"})),this.En.gp&&this.En.qv&&this.Hn(null,n,!1,!1,!0,this.En.qv)},yp:function(){for(var t=!0,n=0;n<this.gn.Ot.length;n++){var e=this.gn.Ot[n];if(e.constructor===o1){if(this.qo(e)&&!this.En.yp(e.pi)){t=!1;break}}else if(!this.En.yp(e.pi)){t=!1;break}}return t}}),Gw=Aw,Object.assign(Gw.prototype,{Fp:function(t){var t=this.map.getBuilding(t);return null===t?-1:(t=t.bounds,Math.sqrt((t.maxX-t.minX)*(t.maxX-t.minX)+(t.maxY-t.minY)*(t.maxY-t.minY)))},Qv:function(t){var t=this.gn.getBuilding(t.bid),n=!0;this.qo(t)&&(this.Eh(t),n=!1),t.bh&&(t.bh.show=n),this.Mn(),this.gn.enableUpdateNode()},jp:function(t){var n,e=this;return!(this.qo(t)||(t=t.getFloor(t.level))&&null!=(t=t.getLayers(E.EXTENT_LAYER)[0])&&(n=!1,t&&t.traverse(function(t){n=!M1.isContain(t.coordinates[0],e.gn.Ip())}),!n))},qo:function(t){return!1!==t.visible&&(t.overviewMode===Nm.INDOOR||(t.overviewMode!==Nm.OUTDOOR||this.En.xn===t.buildingID)&&(this.En.xn!==this.gn.Ai.buildingID?this.En.xn===t.pi:t===this.gn.Tn||!!this.gn.Cp(t)&&!!this.gn.Dp()))},Mp:function(t){var n=new b1({bid:this.Ai.buildingID,mid:this.Ai.mapID,height:t.height,scaleLevel:t.scaleLevel,name:t.mname,levels:t.levels,x:t.x,y:t.y,bounds:new jt(new Tt(t.minX,t.minY),new Tt(t.maxX,t.maxY))});return this.gn.Zi(n),this.gn.Tn=n,this.gn.wt=t.x,this.gn.xt=t.y,n},Rp:function(t){var n=this.En.lr(t.bid);if(!n.visibleLevels||0===n.visibleLevels.length){for(var e=[],i=0;i<t.levelChart.length;i+=2)for(var r=0;r<this.gn.Tn.visibleLevels.length;r++)t.levelChart[i]===this.gn.Tn.visibleLevels[r]&&e.push(t.levelChart[i+1]);n.visibleLevels=e}if(void 0===n.level)for(var o=0;o<t.levelChart.length;o+=2)t.levelChart[o]===this.gn.Tn.level&&(n.level=t.levelChart[o+1]);var s=new Map;if(t.floors)for(var a=0;a<t.floors.length;a++){var u=t.floors[a].yi,c=t.floors[a].gid;s.set(c,u)}var h=new o1(t);return n.minLevel&&(h.dh=n.minLevel),n.maxLevel&&(h.ph=n.maxLevel),h.uh=n.overviewMode,h.kp=s,this.gn.Zi(h),h},mp:function(t){for(var n=null,e=this.gn.getBuildings(),i=0;i<e.length;i++)if(""+e[i].bcode==""+t){n=e[i].buildingID;break}return n}}),Object.assign(Gw.prototype,{Up:function(){var n=this;this.gn.traverse(function(t){t.traverse(function(t){t=t.getLayers(E.LABEL_LAYER)[0];t&&t.traverse(function(t){n.En.O0===a1.FID?t.text=t.G.fid:n.En.O0===a1.ENAME?t.text=t.G.ename:t.text=t.G.name})})})},Rh:function(t){var n=0,n=this.gn.kt.isPerspectiveCamera?t/(this.gn.jt.renderer.domElement.clientHeight/(2*Math.tan(this.gn.kt.fov*u.DEG2RAD/2))):t*Math.abs(this.gn.kt.top-this.gn.kt.bottom)/this.gn.kt.zoom/this.gn.jt.renderer.domElement.clientHeight;return n=isNaN(n)?1:n},Bp:function(t,n){var e;return this.gn.kt.isPerspectiveCamera?(e=new At,t.updateMatrixWorld(),this.gn.An.updateMatrixWorld(),e.multiplyMatrices(this.gn.An.matrixWorldInverse,t.matrixWorld),t=(new Tt).applyMatrix4(e),this.Rh(n)*Math.abs(t.z)):this.Rh(n)}}),Object.assign(Gw.prototype,{ip:function(t){var n=this;null!==this.Xv&&(clearTimeout(this.Xv),this.Xv=null),this.Xv=setTimeout(function(){n.ep({changeScopeTypes:t.changeScopeTypes,fids:t.fids})},t.time||0)},ep:function(){function e(){if(o.length<=0)i.gn.off("update",e);else{for(var t=0,n=0;n<o.length&&!(20<++t);n++)o[n].ff(i,i.hf),o.splice(n,1),n--;i.gn.enableUpdateRender()}}var i=this,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},n=t.changeScopeTypes,r=t.fids,n=n||[E.EXTENT,E.MODEL,E.LABEL,E.FACILITY,E.EXTERNAL_MODEL],r=r||[],o=[];this.gn.off("update",e),this.gn.traverse(function(t){t.traverse(function(t){t.parent.visibleLevels.includes(t.level)&&t.traverse(function(t){t.traverse(function(t){(!(0<r.length)||r.includes(t.FID))&&n.includes(t.type)&&t.visible&&t.ff&&t.Lt&&o.push(t)})})})}),this.gn.on("update",e)},af:function(t,n){t.Lt&&((!t.bh||t.bh.visible)&&t.Jt?t.Lt.visible=t.G.maxlevel&&n>=t.G.minlevel&&n<t.G.maxlevel:t.Lt.visible=!1)},Gp:function(){this.Uu.set(this.Ai.buildingID,{theme:new ym});var t=this.En.lr(this.Ai.buildingID);t.themeNeedLoad=!0,t.themeLoaded=!1,this.dp({bid:this.Ai.buildingID,themeID:this.Ai.themeID,theme:this.Ai.uf,themeExtension:this.Ai.themeExtension}),this.Ai.tile?((t=Object.assign({},this.Ai,{level:t.level,visibleLevels:t.visibleLevels})).bid=t.buildingID,this.wp(t)):this.Ep(this.Ai)},Ft:function(){if(this.En.Wv&&this.$t&&(st.a.environment!==B.a.WX||1!=this.gn.jt.Oi||this.gn.jt.Eo%2==0)){this.Rt=[];for(var t=this.gn.getZoom(),n=this.Ai.tile&&!this.Ai.preLoad,e=0;e<this.gn.Ot.length;e++)for(var i=this.gn.Ot[e],r=this.jp(i),o=0;o<i.Ot.length;o++){for(var s=i.Ot[o],a=null,u=-1<i.visibleLevels.indexOf(s.level),c=(u&&!r&&(a=this.tp(i,s.level),0===this.sp(s))&&this.ap(s)&&(s.Dv(),this.cp(s),this.Mn()),[]),h=0;h<s.Ot.length;h++){var f=s.Ot[h];if(!u||r&&n)this.Hp(f)&&n&&c.push(f);else for(var l=0;l<f.Ot.length;l++){var d=f.Ot[l],v=!0;r||!d.visible||d.bh&&!d.bh.visible?v=!1:d.G&&d.G.maxlevel&&(t>=d.G.maxlevel||t<d.G.minlevel)?(v=!1)===d.canDispose&&(v=!0):this.$v(d,a)||(v=!1),!d.Lt&&v&&this.Rt.push([e,d]),!d.Lt||v||d.fading||d.sf&&d.sf()}}for(var p=0;p<c.length;p++)s.remove(c[p]),c[p].dispose()}this.En.Wv=!1,this.gn.enableUpdateRender()}},Hp:function(t){var n=E.EXTENT_LAYER|E.FACILITY_LAYER|E.LABEL_LAYER|E.MODEL_LAYER|E.EXTERNAL_MODEL_LAYER;return 0!=(t.mi&n)},Pt:function(){if(0<this.Rt.length){for(var t=!1,n=0,e=0;e<this.Rt.length&&!(20<++n);e++){var i=this.Rt[e][1];i.mi!==E.FACILITY&&i.mi!==E.LABEL||(t=!0),i.qc(),this.Rt.splice(e,1),e--}t&&this.Jo(),this.Ic(),this.gn.enableUpdateRender(),this.En.$o&&0===this.Rt.length&&!this.Hv&&(this.gn.Dt.Ct({type:"firstViewLoaded"}),this.Hv=!0)}!this.Hv&&this.$o&&0===this.Rt.length&&(this.gn.Dt.Ct({type:"firstViewLoaded"}),this.Hv=!0)},mv:function(t,n){var e=this.gn.getMapOptions().hideList,i=n.typeID,n=n.FID,e=e[t];return void 0===e||(t=e.typeIDs,void 0===(e=e.FIDs)&&(e=[]),!(t=void 0===t?[]:t).includes(i)&&!e.includes(n))},cp:function(t){var i=this;t.Pn.pi===this.Ai.buildingID&&t.traverse(function(t){t.type!==E.MODEL_LAYER&&t.type!==E.EXTERNAL_MODEL_LAYER&&t.type!==E.LABEL_LAYER||t.traverse(function(e){i.gn.traverse(function(t){if(t!==i.gn.Tn)for(var n=0;n<t.yh.length;n++)t.yh[n]===e.FID&&(t.bh.setFacadeNode(e),e.bh=t.bh)})})})}}),Object.assign(Aw.prototype,{vv:function(t){t=this.gn.getMapOptions().hideList[t];return void 0===t||0!==Object.keys(t).length},Ap:function(n){var t=this.En.lr(n.bid),e=[];t.visibleLevels.forEach(function(t){-1<n.levels.indexOf(t)&&e.push(t)}),t.visibleLevels=e},Xp:function(t,n){function e(){i.gn.jt.Mn(),n.finish&&n.finish()}var i=this,r=(n=n||{},this.En.lr(t.pi));"animate"in n&&!n.animate?(t.traverse(function(t){t.Mr({animate:!1})}),e()):t.traverse(function(t){t.Or===r.level?t.Mr({finish:function(){e()}}):t.Mr({})})},ki:function(t,n){t=this.gn.getBuilding(t);return t?t.getFloor(n):null},Vp:function(t){t=this.gn.getBuilding(t);return null!==t?t.Ot:[]},Nr:function(n,e){var i=this;n.levels.sort(),this.En.lr(n.building.pi).visibleLevels=n.levels,this.Ap({bid:n.building.pi,levels:n.building.Sr}),this.op(n,function(){i.Mn(),i.gn.jt.Ht();var t={type:"visibleLevelsLoaded"};n.building!==i.gn.Tn&&(t.buildingID=n.building.pi),i.gn.Dt.Ct(t),e&&e()})},Rr:function(n,e){var i=this,r=(this.gn.Zv(),this.En.lr(n.pi));r.targetLevel=e.level,-1<r.visibleLevels.indexOf(e.level)?this.gn.Gt.hr(n,e):(r.visibleLevels.length<=1?r.visibleLevels=[e.level]:r.visibleLevels.push(e.level),n.setVisibleLevels(r.visibleLevels,function(){var t;r.targetLevel===e.level?i.gn.Gt.hr(n,e):(t={type:"levelChanged",level:e.level},n!==i.gn.Tn&&(t.buildingID=n.pi),i.gn.Dt.Ct(t),e.finish&&e.finish())}))},ap:function(t){var n=!1;return t.G.Ot.forEach(function(t){0<t.Ot.size&&(n=!0)}),n},sp:function(t){var n=this,e=0;return t.traverse(function(t){n.Hp(t)&&e++}),e},Pp:function(t){var n=this.En.lr(t.pi),e=this.En.hp(t.pi);if(!n.visibleLevelsLoaded){for(var i=!0,r=t.visibleLevels,o=0;o<r.length;o++)e.get(r[o])||(i=!1);n.visibleLevelsLoaded=i}this.Ai.tile&&!this.Ai.preLoad?n.loaded=n.visibleLevelsLoaded:e.size===t.Sr.length&&(n.loaded=!0),this.zp()},zp:function(){var e,i,r=this,o=!0;this.gn.traverse(function(t){var n=r.En.lr(t.pi);n.visibleLevelsLoaded||(t.constructor===o1?r.qo(t)&&!n.visibleLevelsLoaded&&(o=!1):n.visibleLevelsLoaded||(o=!1))}),!this.En.ts&&o&&(this.En.bp=!0),this.En.ts=o,this.En.$o||(i=e=!0,this.gn.traverse(function(t){var n=r.En.lr(t.pi);n.sceneLoaded||(e=!1),(!r.qo(t)||n.loaded)&&e||(i=!1)}),!this.En.$o&&i&&(this.En.gp=!0),this.En.$o=i)},dr:function(){this.En.Wp=!0},Kv:function(){var i=this;this.En.Wp&&(this.Bv=[],this.gn.traverse(function(e){for(var t=0;t<e.Ot.length;t++)!function(n){var t=e.Ot[n];t.Lv(),t.Mv&&t.traverse(function(t){t.traverse(function(t){t.type!==E.EXTENT&&t.type!==E.FACILITY&&t.type!==E.LABEL&&t.type!==E.MODEL&&t.type!==E.EXTERNAL_MODEL&&t.type!==E.TEXT_MARKER&&t.type!==E.DOM_MARKER&&t.type!==E.EXTRUDE_MARKER&&t.type!==E.IMAGE_MARKER&&t.type!==E.POLYGON_MARKER&&t.type!==E.DYNAMIC_MODEL_MARKER||t.Lt&&i.Bv.push([n,t])})}),t.Mv=!1}(t)}),this.En.Wp=!1)},Jv:function(){if(0<this.Bv.length){for(var t=0,n=0;n<this.Bv.length&&!(++t>this.Ai.maxMaterialCount);n++){var e=this.Bv[n][1];e.update?e.update():e.lf(),this.Bv.splice(n,1),n--}this.gn.enableUpdateRender()}},ea:function(t,n,e){n=new v({mapOptions:this.Ai,states:this.En,data:n,key:e});return t.Zi(n),n.Lv(),n.Nv(),n},fp:function(t){t.Dv(),t.Cv(),this.cp(t)},Yp:function(t,n){for(var e=!0,i=0;i<t.length;i++)if(t[i]===n){e=!1;break}return e},Qp:function(t,n,e){var i=[];i.push(t);for(var r=0;r<n.length;r++)n[r]!==t&&i.push(n[r]);if(e)for(var o=0;o<e.length;o++)this.Yp(i,e[o])&&i.push(e[o]);return i}}),Aw);function Q2(t){return(Q2="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Z2(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=Q2(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Q2(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Q2(t)?t:String(t)}(i.key),i)}}function q2(t,n,e){return n&&Z2(t.prototype,n),e&&Z2(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var Zw=q2(function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this.Ot=new Map,this.Zp=[],this.$n=(new Date).getTime(),this.qp=new Map,this.Oa=null,this.ko=this.ko.bind(this),this.Uo=0,this.Fo()}),K2=(Object.assign(Zw.prototype,{Zi:function(t){if(Array.isArray(t)){this.Ot.set(t[0].Xn,t[0]),t[0].Pn=this;for(var n=1;n<t.length;n++)t[n].jn=t[n-1].jn+t[n-1].Dn,t[n].In=t[n-1].In+t[n-1].Dn,this.Ot.set(t[n].Xn,t[n]),t[n].Pn=this}else this.Ot.has(t.Xn)||(this.Ot.set(t.Xn,t),t.Pn=this,t.jn=this.$n)},Ji:function(t){if(Array.isArray(t))for(var n=0;n<t.length;n++)this.Ot.delete(t[n].Xn);else this.Ot.delete(t.Xn)},g0:function(t){this.Zp.push(t)},T0:function(t){t=this.Zp.indexOf(t);-1<t&&this.Zp.splice(t,1)},Rd:function(t){this.qp.set(t.Xn=Mr.generateUUID(),t)},Nd:function(t){this.qp.delete(t.Xn)},Gn:function(t,n,e){for(var i=[],r=[],o=0;o<t.Rn.length;o++)void 0===t.Fn[o]&&(t.Fn[o]=0),1<=n?(i.push(t.Nn[o]),r.push(t.Nn[o]-t.Rn[o]-t.Fn[o])):(i.push((t.Nn[o]-t.Rn[o])*n+t.Rn[o]),r.push((t.Nn[o]-t.Rn[o])*e),t.Fn[o]+=(t.Nn[o]-t.Rn[o])*e);t.Gn({destination:i,delta:r}),r.length=i.length=0},Fo:function(){var i=this,r=(this.Uo=st.a.window.requestAnimationFrame(this.Fo.bind(this)),(new Date).getTime()),o=r-this.$n;this.qp.forEach(function(t){return t(o)});for(var t=0;t<this.Zp.length;t++)this.Zp[t].update(o/1e3);this.Ot.forEach(function(t){var n,e;t.Bn||(t.Un?t.Cn+=o:(n=(r-t.jn)/t.Dn,e=o/t.Dn,i.Gn(t,n,e),n=r-t.jn-t.In,t.Dn<=n&&(t.Fn=[],t.kn?(t.jn=r,t.Hn&&t.Hn()):(e=t.Bn,t.Bn=!0,!e&&t.Hn&&t.Hn()))))}),this.$n=r,this.Oa&&0===this.Ot.size&&this.ko()},zn:function(t){this.Oa=t},ko:function(){this.Uo&&(st.a.window.cancelAnimationFrame(this.Uo),this.Uo=0),this.Ot.forEach(function(t){t.zn()}),this.Ot.clear(),this.Zp=[],this.qp.clear(),this.Oa&&this.Oa({name:"Animator"})}}),Zw);function J2(t){return(J2="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function $2(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=J2(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=J2(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==J2(t)?t:String(t)}(i.key),i)}}function tx(t,n,e){return n&&$2(t.prototype,n),e&&$2(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var e2=tx(function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this._t={}}),nx=(Object.assign(e2.prototype,{Kp:function(t,n){this.Jp(t,n)||(void 0===this._t[t]&&(this._t[t]=[]),this._t[t].push(n))},Jp:function(t,n){return n?void 0!==this._t[t]&&-1!==this._t[t].indexOf(n):void 0!==this._t[t]&&0<this._t[t].length},$p:function(t,n){void 0!==this._t[t]&&-1!==(n=this._t[t].indexOf(n))&&this._t[t].splice(n,1)},Ct:function(t){if(void 0!==this._t[t.type])for(var n=this._t[t.type].slice(0),e=0,i=n.length;e<i;e++)n[e].call(this,t)}}),e2),tv={Entire:2,Individual:4},ex=(Object.freeze(tv),tv),ix={RUNTIME:0,DIRTY:1};function rx(t){return(rx="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ox(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=rx(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=rx(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==rx(t)?t:String(t)}(i.key),i)}}function sx(t,n,e){return n&&ox(t.prototype,n),e&&ox(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var ax=sx(function t(n){var e;if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this.container=n.container,this.appName=n.appName,this.key=n.key,this.license=n.license,this.mapID=n.mapID,this.buildingID=n.mapID,this.mapURL=n.mapURL,this.mapURLAbsolute=void 0!==n.mapURLAbsolute&&n.mapURLAbsolute,this.themeTool=void 0!==n.themeTool?n.themeTool:null,this.merge=void 0!==n.merge?n.merge:null,this.userThemeURL=n.themeURL,this.themeURL=n.themeURL||mf.themeUrl,this.themeID=n.themeID||"2001",this.externalModelURL=n.externalModelURL,this.uf=n.theme,this.themeExtension=void 0!==n.themeExtension?n.themeExtension:{},this.isPreview=void 0!==st.a.KjWzhWlSj&&!!st.a.KjWzhWlSj.ProtoDef,this.nonFocusAlpha=void 0!==n.nonFocusAlpha?n.nonFocusAlpha:.1,this.nonFocusAlphaMode=void 0!==n.nonFocusAlphaMode&&n.nonFocusAlphaMode,this.state=n.state||{},this.center=(void 0!==this.state.center?this.state:n).center,this.zoomRange=void 0!==this.state.zoomRange?this.state.zoomRange:void 0!==n.zoomRange?n.zoomRange:[16,23],this.mapZoom=void 0!==this.state.zoom?this.state.zoom:void 0!==n.mapZoom?n.mapZoom:20,this.rotation=void 0!==this.state.rotation?this.state.rotation:void 0!==n.rotation?n.rotation:0,this.maxTiltAngle=void 0!==n.maxTiltAngle?n.maxTiltAngle:90,this.minTiltAngle=void 0!==n.minTiltAngle?n.minTiltAngle:30,this.tiltAngle=void 0!==this.state.tiltAngle?this.state.tiltAngle:void 0!==n.tiltAngle?n.tiltAngle:30,this.viewMode=void 0!==this.state.viewMode?this.state.viewMode:void 0!==n.viewMode?n.viewMode:xi.MODE_3D,this.floorSpace=void 0!==this.state.floorSpace?this.state.floorSpace:void 0!==n.floorSpace?n.floorSpace:50,this.level=void 0!==this.state.level?this.state.level:void 0!==n.level?n.level:1,this.visibleLevels=void 0!==this.state.visibleLevels?this.state.visibleLevels:void 0!==n.visibleLevels?n.visibleLevels:[1],this.buildingOptions=n.buildingOptions||{},this.navigationData=n.navigationData,this.buildings=n.buildings,this.backgroundColor=n.backgroundColor,this.backgroundAlpha=n.backgroundAlpha,this.$u=n.highlightColor,this.zr=void 0!==n.highlightPicker?n.highlightPicker:["click"],this.logarithmicDepthBuffer=n.logarithmicDepthBuffer||!1,this.tile=!1!==n.tile||n.tile,this.preLoad=!1!==n.preLoad||n.preLoad,this.loadLayerWaitingTime=n.loadLayerWaitingTime||.002,this.renderOrder=n.renderOrder||[E.EXTENT,E.EXTERNAL_MODEL,E.MODEL,E.DYNAMIC_MODEL_MARKER,E.EXTRUDE_MARKER,E.TUBE_MARKER,E.WALL_MARKER,E.SPHERE_MARKER,E.POLYGON_MARKER,E.HEAT_MAP_MARKER,E.LINE3D_MARKER,E.LINE_MARKER,E.FACILITY,E.LABEL,E.IMAGE_MARKER,E.TEXT_MARKER,E.LOCATION_MARKER],this.collisionOrder=n.collisionOrder?br.uniqWithArrayTwo(n.collisionOrder):[[E.TEXT_MARKER,E.IMAGE_MARKER]],this.fontFamily=n.fontFamily||'"Microsoft Yahei","微软雅黑",Tahoma,Arial',this.hdr=n.hdr,this.shadingMode=void 0!==n.shadingMode?n.shadingMode:ls.REAL,this.materialMode=this.shadingMode,this.maxMaterialCount=void 0!==n.maxMaterialCount?n.maxMaterialCount:1/0,this.lock=void 0!==n.lock&&n.lock,this.labelField=void 0!==n.labelField?n.labelField:a1.NAME,this.enabledPanRange=void 0!==n.enabledPanRange&&n.enabledPanRange,this.panRangeValue=void 0!==n.panRangeValue?n.panRangeValue:null,this.screenLockCoords=n.screenLockCoords,this.lightConfig={FMExtentLayer:[{name:"DirectionalLight",color:11579568,intensity:.95,position:{x:58,y:65,z:40},id:0},{name:"AmbientLight",color:11579568,intensity:.85,id:1},{name:"DirectionalLight",color:6447714,intensity:.65,position:{x:-100,y:0,z:45},id:2}],FMDynamicModelLayer:[{name:"DirectionalLight",color:11579568,intensity:.95,position:{x:58,y:65,z:45},id:0},{name:"AmbientLight",color:11579568,intensity:.85,id:1},{name:"DirectionalLight",color:6447714,position:{x:-100,y:0,z:45},intensity:.45,id:2}],FMModelLayer:[{name:"DirectionalLight",color:11645361,intensity:.95,position:{x:58,y:65,z:40},id:0},{name:"AmbientLight",color:11645361,intensity:.85,id:1},{name:"DirectionalLight",color:6513507,position:{x:-100,y:0,z:45},intensity:.65,id:2}],FMExternalModelLayer:[{name:"DirectionalLight",color:11579568,intensity:.95,position:{x:58,y:65,z:45},id:0},{name:"AmbientLight",color:11579568,intensity:.85,id:1},{name:"DirectionalLight",color:6447714,position:{x:-100,y:0,z:45},intensity:.45,id:2}]},this.isuserLight=!1,void 0!==n.light&&(this.lightConfig=n.light.getConfig(),this.isuserLight=!0),this.lockedLight=void 0!==n.lockedLight&&n.lockedLight,this.hideList=void 0!==n.hideList?n.hideList:{},this.ClassicMaterial=void 0===n.ClassicMaterial||n.ClassicMaterial,this.isOutdoor=!0,this.enableDamping=void 0!==n.enableDamping&&n.enableDamping,this.enterTriggerMode=void 0!==n.enterTriggerMode?n.enterTriggerMode:ex.Entire,this.autoPlay=void 0===n.autoPlay||n.autoPlay,this.decoderURL=void 0!==n.decoderURL?n.decoderURL:null,this.HDText=void 0!==n.HDText&&n.HDText,this.depthPeeling=void 0!==n.depthPeeling?n.depthPeeling:null,this.depthPeeling&&(this.depthPeeling.mode=(null==(e=n.depthPeeling)?void 0:e.mode)||ix.RUNTIME,this.depthPeeling.layers=(null==(e=n.depthPeeling)?void 0:e.layers)||4,this.depthPeeling.types=(null==(e=n.depthPeeling)?void 0:e.types)||[E.MODEL_LAYER,E.EXTERNAL_MODEL_LAYER,E.DYNAMIC_MODEL_MARKER]),this.mouseMode=void 0!==n.mouseMode?n.mouseMode:Zo.NORMAL});function ux(t){return(ux="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function cx(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=ux(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=ux(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==ux(t)?t:String(t)}(i.key),i)}}function hx(t){a.call(this),this.element=t,this.element.style.position="absolute",this.addEventListener("removed",function(){this.traverse(function(t){t.element instanceof Element&&null!==t.element.parentNode&&t.element.parentNode.removeChild(t.element)})})}function fx(){function a(t,n,e){var i,r;t instanceof hx&&(t.onBeforeRender(h,n,e),f.setFromMatrixPosition(t.matrixWorld),f.applyMatrix4(l),i=t.element,r="translate(-50%,-50%) translate("+(f.x*u+u)+"px,"+(-f.y*c+c)+"px)",i.style.WebkitTransform=r,i.style.MozTransform=r,i.style.oTransform=r,i.style.transform=r,i.style.display=t.visible&&-1<=f.z&&f.z<=1?"":"none",r={distanceToCameraSquared:p(e,t)},d.objects.set(t,r),i.parentNode!==v&&v.appendChild(i),t.onAfterRender(h,n,e));for(var o=0,s=t.children.length;o<s;o++)a(t.children[o],n,e)}var e,i,u,c,r,o,h=this,f=new Tt,s=new At,l=new At,d={objects:new WeakMap},v=document.createElement("div"),p=(v.style.overflow="hidden",this.domElement=v,this.getSize=function(){return{width:e,height:i}},this.setSize=function(t,n){u=(e=t)/2,c=(i=n)/2,v.style.width=t+"px",v.style.height=n+"px"},r=new Tt,o=new Tt,function(t,n){return r.setFromMatrixPosition(t.matrixWorld),o.setFromMatrixPosition(n.matrixWorld),r.distanceToSquared(o)});this.render=function(t,n){!0===t.autoUpdate&&t.updateMatrixWorld(),null===n.parent&&n.updateMatrixWorld(),s.copy(n.matrixWorldInverse),l.multiplyMatrices(n.projectionMatrix,s),a(t,t,n)}}var Jd=function(){function n(t){if(!(this instanceof n))throw new TypeError("Cannot call a class as a function");this.Ai=t,this.zoomRange=this.Ai.zoomRange,this.zoom=this.Ai.mapZoom,this.qt=this.Ai.rotation,this.tm=this.Ai.maxTiltAngle,this.nm=this.Ai.minTiltAngle,this.tiltAngle=this.Ai.tiltAngle,this.Si=this.Ai.viewMode,this.im=new Map,this.rm(),this.qv=!1,this.ts=!1,this.$o=!1,this.gp=!1,this.bp=!1,this.O0=this.Ai.labelField,this.Kt=new Tt,this.om=this.Oh,this.Gr=!1,this.sm=!0,this.am=!1,this.$u=void 0!==this.Ai.$u?this.Ai.$u:null,this.um=null,this.hm=void 0!==this.Ai.backgroundColor?this.Ai.backgroundColor:null,this.fm=null,this.lm=void 0!==this.Ai.backgroundAlpha?this.Ai.backgroundAlpha:null,this.dm=null,this.rp=!1,this.ns=!1,this.Wv=!1,this.Wp=!0,this.Ko=this.Ai.collisionOrder,this.xn=this.Ai.buildingID}var t,e,i;return t=n,(e=[{key:"zoom",get:function(){return this.Oh},set:function(t){this.Oh=Math.min(Math.max(t,this.Ki[0]),this.Ki[1])}},{key:"zoomRange",get:function(){return this.Ki},set:function(t){t[0]=Math.min(Math.max(t[0],1),29),t[1]=Math.min(Math.max(t[1],1),29),this.Ki=t}},{key:"tiltAngle",get:function(){return this.Bi},set:function(t){t=Math.min(Math.max(t,this.nm),this.tm),this.Bi=t}},{key:"highlightColor",get:function(){return null!==this.$u?this.$u:this.um},set:function(t){this.$u=t}},{key:"backgroundColor",get:function(){return null!==this.hm?this.hm:this.fm}},{key:"backgroundAlpha",get:function(){return null!==this.lm?this.lm:this.dm}}])&&cx(t.prototype,e),i&&cx(t,i),Object.defineProperty(t,"prototype",{writable:!1}),n}(),lx=(Object.assign(Jd.prototype,{rm:function(){this.vm(this.Ai.buildingID);var t=this.Ai.buildingOptions.buildings;if(t)for(var n=0;n<t.length;n++)t[n].buildingID&&this.vm(t[n].buildingID)},j0:function(t){this.um=t.Ju(this.Ai.buildingID);t=t.Bu(this.Ai.buildingID);this.fm=t.clearColor,this.dm=t.clearAlpha},pm:function(t,n){switch(t){case"click":this.sm=n;break;case"move":this.am=n;break;case"hover":this.Gr=n}},ym:function(t){this.Ai.center&&(this.Kt.x=this.Ai.center.x-t.x,this.Kt.z=-this.Ai.center.y+t.y)},lr:function(t){return this.im.has(t)||this.vm(t),this.im.get(t)},vm:function(t){var n={};if(this.Ai.buildingID===t)n={themeID:this.Ai.themeID,visibleLevels:this.Ai.visibleLevels,level:this.Ai.level,targetLevel:this.Ai.level,floorSpace:this.Ai.floorSpace,nonFocusAlphaMode:this.Ai.nonFocusAlphaMode,nonFocusAlpha:this.Ai.nonFocusAlpha};else{var e=this.Ai.buildingOptions,i=e.buildings,n={themeID:e.themeID,themeExtension:e.themeExtension,visibleLevels:void 0!==e.visibleLevels?e.visibleLevels:[],level:e.level,targetLevel:e.level,floorSpace:(void 0!==e.floorSpace?e:this.Ai).floorSpace,overviewMode:void 0!==e.overviewMode?e.overviewMode:Nm.NORMAL,nonFocusAlphaMode:(void 0!==e.nonFocusAlphaMode?e:this.Ai).nonFocusAlphaMode,nonFocusAlpha:(void 0!==e.nonFocusAlpha?e:this.Ai).nonFocusAlpha,minLevel:e.minLevel,maxLevel:e.maxLevel,themeLoaded:!1,themeNeedLoad:!0};if(i)for(var r=0;r<i.length;r++)i[r].buildingID===t&&(void 0!==i[r].themeID&&(n.themeID=i[r].themeID),void 0!==i[r].themeExtension&&(n.themeExtension=i[r].themeExtension),void 0!==i[r].visibleLevels&&(n.visibleLevels=i[r].visibleLevels),void 0!==i[r].level&&(n.level=i[r].level),void 0!==i[r].targetLevel&&(n.targetLevel=i[r].targetLevel),void 0!==i[r].floorSpace&&(n.floorSpace=i[r].floorSpace),void 0!==i[r].overviewMode&&(n.overviewMode=i[r].overviewMode),void 0!==i[r].nonFocusAlphaMode&&(n.nonFocusAlphaMode=i[r].nonFocusAlphaMode),void 0!==i[r].nonFocusAlpha&&(n.nonFocusAlpha=i[r].nonFocusAlpha),void 0!==i[r].minLevel&&(n.minLevel=i[r].minLevel),void 0!==i[r].maxLevel)&&(n.maxLevel=i[r].maxLevel)}n.level&&-1===n.visibleLevels.indexOf(n.level)&&(1<n.visibleLevels.length?n.visibleLevels.push(n.level):n.visibleLevels=[n.level]),this.im.set(t,n)},hp:function(t){t=this.lr(t);return t.levelsLoaded||(t.levelsLoaded=new Map),t.levelsLoaded},yp:function(t){t=this.im.get(t);return!1===t.themeNeedLoad||!1!==t.themeLoaded}}),Jd);(hx.prototype=Object.create(a.prototype)).constructor=hx;function dx(t){return(dx="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function vx(t,n){var e,i,r,o,s="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(s)return i=!(e=!0),{s:function(){s=s.call(t)},n:function(){var t=s.next();return e=t.done,t},e:function(t){i=!0,r=t},f:function(){try{e||null==s.return||s.return()}finally{if(i)throw r}}};if(Array.isArray(t)||(s=function(t,n){var e;if(t)return"string"==typeof t?px(t,n):"Map"===(e="Object"===(e=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?px(t,n):void 0}(t))||n&&t&&"number"==typeof t.length)return s&&(t=s),o=0,{s:n=function(){},n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:n};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function px(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function mx(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=dx(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=dx(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==dx(t)?t:String(t)}(i.key),i)}}var $d=function(){function n(t){if(!(this instanceof n))throw new TypeError("Cannot call a class as a function");this.Pn=t,this.gt=null,this.bm=this.bm.bind(this),this.gm=this.gm.bind(this),this.Co=new Ns,this.Ot=[]}var t,e,i;return t=n,(e=[{key:"add",value:function(t){t.Pn=this,(t.Ph||t.qc())&&this.R(t),this.needUpdateBound=!0}},{key:"remove",value:function(t){t=this.Ot.indexOf(t);-1<t&&this.Ot.splice(t,1),this.needUpdateBound=!0}},{key:"clear",value:function(){var t,n=vx(this.Ot);try{for(n.s();!(t=n.n()).done;)t.value.dispose()}catch(t){n.e(t)}finally{n.f()}this.Ot.length=0}},{key:"dispose",value:function(){if(null!==this.gt){this.Pn.off("resize",this.bm),this.Pn.off("beforeRender",this.gm);for(var t=0;t<this.Ot.length;t++)this.Ot[t].dispose();this.Ot.length=0,this.Co=void 0,this.gt.domElement.parentNode&&this.gt.domElement.parentNode.removeChild(this.gt.domElement)}}}])&&mx(t.prototype,e),i&&mx(t,i),Object.defineProperty(t,"prototype",{writable:!1}),n}(),yx=(Object.assign($d.prototype,{qc:function(){this.gt=new fx,this.gt.setSize(this.Pn.getContainer().clientWidth,this.Pn.getContainer().clientHeight),this.gt.domElement.style.top="0px",this.gt.domElement.style.left="0px",this.gt.domElement.style.position="absolute",this.gt.domElement.style.pointerEvents="none",this.gt.domElement.style.zIndex=2,this.Pn.getContainer().appendChild(this.gt.domElement),this.Pn.on("resize",this.bm),this.Pn.on("beforeRender",this.gm)},gm:function(){for(var t=[],n=Array.from(this.Pn.getRenderManager().getRenderList().keys()),e=0;e<this.Ot.length;e++)this.Ot[e].Lt.element.childNodes[0].style.display="none",this.Ot[e].G0();for(var i=0;i<n.length;i++)for(var r=n[i].split("%A%B%C%D"),o=(-1===t.indexOf(r[0])&&t.push(r[0]),r[0]),s=r[1],a=this.Pn.getBuilding(""+o),u=0;u<this.Ot.length;u++)this.Ot[u].V0===o&&""+this.Ot[u].level==""+s&&this.Ot[u].visible&&(this.Ot[u].Lt.element.childNodes[0].style.display="block",this.Ot[u].level===a.level?this.Ot[u].Lt.element.childNodes[0].style.opacity=this.Ot[u].opacity:this.Ot[u].Lt.element.childNodes[0].style.opacity=a.getFloor(this.Ot[u].level).ft);this.Yo(t),this.gt.render(this.Co,this.Pn.camera)},bm:function(){this.gt.setSize(this.Pn.getContainer().clientWidth,this.Pn.getContainer().clientHeight)},Pl:function(t,n){for(var e=this.Pn.getBuilding(""+n).visibleLevels,i=!1,r=0;r<e.length;r++)if(e[r]===t){i=!0;break}return i},Yo:function(t){for(var r=this,n=0;n<t.length;n++)for(var e=this.Pn.getBuilding(""+t[n]).visibleLevels,i=0;i<e.length;i++){var o=function(t,n){for(var e=[],i=0;i<r.Ot.length;i++)r.Ot[i].Or===n&&r.Ot[i].V0===t&&e.push(r.Ot[i]);return e}(t[n],e[i]);if(1<o.length){l=f=h=c=u=a=s=void 0;for(var s=o,a=[],u=0;u<s.length;u++)if(s[u].Jt&&s[u].Zo){for(var c=!0,h=0;h<a.length;h++){var f=a[h]._m(),l=s[u]._m();if(!(c=!z._e(l.leftTop,l.rightDown,f.leftTop,f.rightDown)))break}c?(s[u].Lt.element.childNodes[0].style.display="block",s[u].wm=!1,a.push(s[u])):(s[u].Lt.element.childNodes[0].style.display="none",s[u].wm=!0)}}}},R:function(t){this.Ot.push(t),t.Lt&&this.Co.add(t.Lt)}}),$d);function bx(t){return(bx="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function gx(n,t){var e,i=Object.keys(n);return Object.getOwnPropertySymbols&&(e=Object.getOwnPropertySymbols(n),t&&(e=e.filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})),i.push.apply(i,e)),i}function _x(i){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?gx(Object(r),!0).forEach(function(t){var n,e;n=i,e=r[t=t],(t=Ex(t))in n?Object.defineProperty(n,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[t]=e}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(r)):gx(Object(r)).forEach(function(t){Object.defineProperty(i,t,Object.getOwnPropertyDescriptor(r,t))})}return i}function xx(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Ex(i.key),i)}}function Ex(t){t=function(t,n){if("object"!=bx(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=bx(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==bx(t)?t:String(t)}function Sx(t,n,e){n=Ax(n);var i=t,n=Tx()?Reflect.construct(n,e||[],Ax(t).constructor):n.apply(t,e);if(n&&("object"===bx(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return Mx(i)}function Tx(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Tx=function(){return!!t})()}function Ax(t){return(Ax=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Mx(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ox(t,n){return(Ox=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var e=function(){var t,n=i,e=ps;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");function i(t){var n;if(this instanceof i)return n=Sx(this,i),t.uatEnvironment&&(mf={domain:pf,online:pf+"sdk/check",check:pf+"sdk/auth/web",download:pf+"sdk/auth/obtainMapRoute",downloadTile:pf+"sdk/authLayered/obtainMapRoute",collect:pf+"sdk/collect",themeUrl:pf+"webtheme/",externalModelURL:pf+"webmodel/"}),n.Xi={error:[]},n.Ln=(new Date).getTime(),n.Ai=new ax(t),n.En=new lx(n.Ai),n.wt=null,n.xt=null,st.a.environment===B.a.WX&&st.a.initCanvas(n.Ai,Mx(n)),n.Tn=null,n.pp=!1,n.xm=new Tt,n.vr=null!=t.followFocus&&t.followFocus,n.Em=null,n.Sm=!1,n.Ao=[E.IMAGE_MARKER,E.TEXT_MARKER],n.Dt=new nx,n.$i=new K2,n.Fr=null,n.Nt=null,n.An=null,n.Ut=null,st.a.environment==B.a.BROWSER?n.kt=n.Tm(n.Ai.container.clientWidth,n.Ai.container.clientHeight):n.kt=n.Tm(n.Ai.container.width,n.Ai.container.height),n.jt=new kh(Mx(n),n.Ai,n.En),n.jo=new $1,n.jo.Pn=Mx(n),n.Gt=new ts(Mx(n),n.Ai.container,n.En),n.Gt.enableDragRange=n.Ai.enabledPanRange,n.Ai.panRangeValue&&(n.Ai.enabledPanRange=!0,n.Gt.enableDragRange=!0),n.Dr=new Os(Mx(n),n.Ai,n.En),n.ko=n.ko.bind(Mx(n)),n.Am=!1,n.ir=n.ir.bind(Mx(n)),n.Mm=n.Mm.bind(Mx(n)),n.Om=[],n.Lm=!1,n.Rm=null,n.Nm=null,n.Pm=n.Pm.bind(Mx(n)),n.en=new yx(Mx(n)),n.Fm(),rr.onLoad=function(){n.enableUpdateRender()},n;throw new TypeError("Cannot call a class as a function")}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&Ox(n,e),n=i,(e=[{key:"requestDispose",get:function(){return this.Am}},{key:"focusBuilding",get:function(){return this.jm}},{key:"x",get:function(){return this.wt}},{key:"y",get:function(){return this.xt}},{key:"bound",get:function(){var n=this;return!0===this.needUpdateBound&&0<this.Ot.length&&(this.ai.reset(),this.Ot.forEach(function(t){n.ai.expand(t.bound)}),this.ai.expand(this.jo.bound),this.needUpdateBound=!1),this.ai.clone()}},{key:"camera",get:function(){return this.kt},set:function(t){this.kt=t}},{key:"followFocus",get:function(){return this.vr},set:function(t){this.vr!==t&&(this.vr=t,this.vr||this.Gt.pr(this.Tn,{level:this.getLevel()}))}},{key:"getScaleBarInfo",value:function(){var t=st.a.environment===B.a.WX?{x:st.a.document.body.clientWidth/2,y:st.a.document.body.clientHeight/2}:{x:document.body.clientWidth/2,y:document.body.clientHeight/2},n={x:t.x+100,y:t.y},t=dr.coordsScreenToMap(this,t),n=dr.coordsScreenToMap(this,n),t=Math.sqrt((t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y))/100,n=[1e7,5e6,2e6,1e6,5e5,2e5,1e5,5e4,25e3,2e4,1e4,5e3,2e3,1e3,500,200,100,50,20,10,5,2,1,.5,.2,.1,.05,.02,.01][Math.floor(this.getZoom())-1],e="",e=n<1e3&&1<=n?"米":n<1?(n*=1e3,"毫米"):(n/=1e3,"公里");return{screenDistance:n/t,actualDistance:n,unit:e}}},{key:"setDevicePixalRatio",value:function(t){this.getRenderManager().renderer.setPixelRatio(t),this.Dt.Ct({type:"pixelRatioChanged"}),this.enableUpdateRender()}},{key:"removeAnimator",value:function(t){this.$i.Ji(t)}},{key:"copyCamera",value:function(){var t=null;return(t=this.kt===this.An?new dt(u.FOV,1,u.CAMERA_NEAR,u.CAMERA_FAR):new vt(1,1,1,1,u.CAMERA_NEAR,u.CAMERA_FAR)).copy(this.kt),t}},{key:"enableUpdateRender",value:function(){this.En.ns=!0}},{key:"enableUpdateNode",value:function(){this.En.Wv=!0}},{key:"getFloorInfos",value:function(){return this.getBuilding(this.Ai.buildingID).getFloorInfos()}},{key:"setHighlightColor",value:function(t){this.En.highlightColor=t}},{key:"setControlTarget",value:function(t){this.Gt.Vi(t)}},{key:"resize",value:function(t,n){this.jt.Do(t,n)}},{key:"getMarkerGroup",value:function(){return this.jo}},{key:"getVisibleLevels",value:function(){return this.Tn.visibleLevels}},{key:"setTheme",value:function(t){this.Nt.Sh({themeID:t,bid:this.Ai.buildingID})}},{key:"setThemeExtension",value:function(t,n){this.Nt.Th(_x({data:t,bid:this.Ai.buildingID},n))}},{key:"clearThemeExtension",value:function(){this.Nt.Th({bid:this.Ai.buildingID})}},{key:"getRenderOrder",value:function(){return this.jt.Ao}},{key:"setRenderOrder",value:function(t){this.jt.Xo(t)}},{key:"getCollisionOrder",value:function(){return this.En.Ko}},{key:"setCollisionOrder",value:function(t){this.En.Ko=br.uniqWithArrayTwo(t),this.Nt.Jo()}},{key:"adjustRenderOrder",value:function(t){this.jt.Ho(t)}},{key:"setVisibleLevels",value:function(t,n){this.Tn.setVisibleLevels(t,n)}},{key:"getRenderManager",value:function(){return this.jt}},{key:"setRenderManager",value:function(t){for(var n in this.jt.render=t.render,this.jt.getLayerType=t.getLayerType,t)this.jt[n]=t[n]}},{key:"getCenter",value:function(){return this.Gt.ur()}},{key:"setCenter",value:function(t){this.Gt.cr(t)}},{key:"zoomIn",value:function(){this.Gt.qi(1.02)}},{key:"zoomOut",value:function(){this.Gt.qi(.98)}},{key:"getZoomRange",value:function(){return this.En.Ki}},{key:"setZoomRange",value:function(t){this.Gt.rr(t)}},{key:"getZoom",value:function(){return this.Gt.tr()}},{key:"setZoom",value:function(t){this.Gt.er(t)}},{key:"getRotation",value:function(){return this.Gt.sr()}},{key:"setRotation",value:function(t){this.Gt.ar(t)}},{key:"autoRotate",value:function(t){return(t=t||{}).loop=!0,void 0===t.duration&&(t.duration=5),this.Gt.ar(t)}},{key:"getTilt",value:function(){return Mr.round(90-this.Gt.Bt.getPolarAngle()*u.RAD2DEG)}},{key:"setTilt",value:function(t){t.tilt=St.clamp(t.tilt,this.Ai.minTiltAngle,this.Ai.maxTiltAngle),this.En.Bi=t.tilt,this.Gt.Wi(t)}},{key:"getFloor",value:function(t){return null===this.Tn?null:this.Tn.getFloor(t)}},{key:"getLevel",value:function(){var t;return null==(t=this.Tn)?void 0:t.level}},{key:"getLevels",value:function(){return null!==this.Tn?this.Tn.Sr:null}},{key:"setLevel",value:function(t){this.Nt.Rr(this.Tn,t)}},{key:"getFloorSpace",value:function(){return null!==this.Tn?this.Tn.floorSpace:null}},{key:"setFloorSpace",value:function(t){this.Tn.floorSpace=t,this.Dt.Ct({type:"floorSpaceChanged"});for(var n=this.jo.Ot,e=0;e<n.length;e++)n[e].G0()}},{key:"getViewMode",value:function(){return this.kt.isPerspectiveCamera?xi.MODE_3D:xi.MODE_2D}},{key:"setViewMode",value:function(t){this.Gt.zi(t)}},{key:"getInteractions",value:function(){return this.getInteracations()}},{key:"getInteracations",value:function(){return this.Gt}},{key:"getBound",value:function(){return this.Tn.bound.clone()}},{key:"getState",value:function(){return{center:this.getCenter(),zoom:this.getZoom(),rotation:this.getRotation(),tiltAngle:this.getTilt(),viewMode:this.getViewMode(),level:this.Tn.level,floorSpace:this.getFloorSpace(),visibleLevels:this.Tn.visibleLevels,viewBuildingID:this.En.xn}}},{key:"setState",value:function(t,n){var e,i=this,r=(n=n||{},this.getState());for(e in r)void 0===t[e]&&(t[e]=r[e]);var o=!1!==n.animate;this.Gt.pauseDamping(),this.setFloorSpace(t.floorSpace),this.setCenter({animate:o,x:t.center.x,y:t.center.y,finish:function(){i.setRotation({animate:o,rotation:t.rotation,finish:function(){i.setTilt({animate:o,tilt:t.tiltAngle,finish:function(){i.setZoom({animate:o,zoom:t.zoom,finish:function(){i.setViewMode({animate:o,mode:t.viewMode,finish:function(){i.setVisibleLevels(t.visibleLevels,function(){i.setLevel({animate:o,level:t.level,finish:function(){i.Gt.resumeDamping(),n.finish&&n.finish()}})})}})}})}})}})}})}},{key:"getNodes",value:function(t,n){var e,s=this,i=[],r=(this.Tn,[E.LABEL_LAYER,E.FACILITY_LAYER,E.MODEL_LAYER,E.EXTENT_LAYER,E.EXTERNAL_MODEL_LAYER]),o={};if(n)for(var a=0;a<n.length;a++){var u=(u=n[a].buildingID)||this.Tn.buildingID,c=function(t,n){var e=[],i=t.buildingID;i=i||s.Tn.buildingID;for(var r=t.levels,o=0;o<n.length;o++)n[o].buildingID!==i||r&&-1===r.indexOf(n[o].level)||e.push(n[o]);return e}(n[a],t);o[""+u]=c}else for(var h=0;h<t.length;h++){var f=t[h].buildingID,l=o[""+(f=f||this.Tn.buildingID)];l?l.push(t[h]):o[""+f]=[t[h]]}for(e in o)for(var d=o[e],v=function(t){for(var n=null,e=0;e<s.Ot.length;e++)if(s.Ot[e].buildingID===t){n=s.Ot[e];break}return n}(""+e),p=0;p<d.length;p++){var m=d[p].level,y=d[p].eid,b=d[p].type;t:for(var g=0;g<v.Ot.length;g++)if(v.Ot[g].Or===m)for(var _=(_=v.Ot[g].getLayers()).filter(function(t){return r.includes(t.type)}),w=0;w<_.length;w++)for(var x=0;x<_[w].Ot.length;x++)if(_[w].Ot[x].G.pi===y&&_[w].Ot[x].mi===b){i.push(_[w].Ot[x]);break t}}return i}},{key:"getDataManager",value:function(){return this.Fr}},{key:"getMapOptions",value:function(){return this.Ai}},{key:"getContainer",value:function(){return this.Ai.container}},{key:"setFitView",value:function(t,n){var e=this,i=!1!==(n=n||{}).animate,r=this.getZoomRange(),o=this.copyCamera(),s=this.Gt.copyControls(o),a=this.Gt.Bt,u=this.kt;this.Gt.Bt=s,this.kt=o,this.setZoomRange([1,29]),s.enableDamping=!1,this.Gt.pr(this.Tn,{level:this.getLevel(),animate:!1}),this.setZoom({zoom:29,animate:!1,finish:function(){e.setCenter({animate:!1,x:t.center.x,y:t.center.y,finish:function(){e.Im(t,5,0,function(t){e.Gt.Bt=a,e.kt=u,e.setZoomRange(r),s.dispose(),s=null,e.enableUpdateRender(),e.setZoom({animate:i,zoom:t.zoom,duration:.5}),e.setCenter({animate:i,x:t.center.x,y:t.center.y,duration:.5,finish:function(){n.finish&&n.finish()}})})}})}})}},{key:"setBackgroundColor",value:function(t,n){this.jt.renderer.setClearColor("string"===t?parseInt(t.slice(1),16):t,n),this.enableUpdateRender()}},{key:"setLabelField",value:function(t){this.En.O0=t,this.Nt.Up(),this.Nt.Jo()}},{key:"getLabelField",value:function(){return this.En.O0}},{key:"getBuilding",value:function(t){return this.Ba({bid:t})}},{key:"getBuildings",value:function(){var n=this,e=[];return this.traverse(function(t){t!==n.Tn&&e.push(t)}),e}},{key:"changeOverviewMode",value:function(t){for(var n=0;n<t.buildingIDs.length;n++){var e=this.getBuilding(t.buildingIDs[n]);e.uh!==t.overviewMode&&(e.uh=t.overviewMode,this.followFocus&&t.overviewMode!=Nm.OUTDOOR&&e.parent.focusBuilding&&e.parent.focusBuilding.buildingID==e.buildingID&&e.setLevel({level:e.level}),e.Ah(),this.Nt.Qv({bid:t.buildingIDs[n]}),this.Dt.Ct({type:"buildingOverviewModeChanged",buildingID:t.buildingIDs[n]}))}t.overviewMode==Nm.OUTDOOR&&this.followFocus&&this.Tn.setLevel({level:this.Tn.level})}},{key:"enterBuilding",value:function(t){var n=this,e=this.getBuilding(t.buildingID);this.Gt.cr({x:e.x,y:e.y,animate:!0,duration:.5,finish:function(){n.getBuildings().forEach(function(t){n.Om.push({buildingID:t.buildingID,visible:t.visible}),t.visible=!1}),e.visible=!0,n.En.xn=t.buildingID,n.Nt.Eh(e),n.Nt.Mn(),n.Nt.Xp(e,{}),n.Dt.Ct({type:"ViewBuildingChange",buildingID:n.En.xn}),n.Dt.Ct({type:"buildingEntered",buildingID:n.En.xn}),t.finish&&t.finish({buildingID:t.buildingID})}})}},{key:"exitBuilding",value:function(t){var n=this,e=(this.Om.forEach(function(t){n.getBuilding(t.buildingID).visible=t.visible}),this.Om.length=0,this.getBuilding(this.En.xn));this.Gt.cr({x:e.x,y:e.y,animate:!0,duration:.5,finish:function(){n.En.xn=n.Ai.buildingID,n.Nt.Mn(),n.Nt.Xp(e,{}),n.Dt.Ct({type:"ViewBuildingChange",buildingID:n.En.xn}),n.Dt.Ct({type:"buildingExited",buildingID:e.pi}),t.finish&&t.finish({buildingID:e.pi})}})}},{key:"on",value:function(t,n){this.Dt&&(this.Dt.Kp(t,n),this.En.pm(t,!0))}},{key:"off",value:function(t,n){this.Dt&&(this.Dt.$p(t,n),this.Dt.Jp(t)||this.En&&this.En.pm(t,!1))}},{key:"pickFilterFunction",value:function(){return!0}},{key:"dispose",value:function(){var t,n=this;this.Am||(this.Am=!0,this.en.dispose(),this.jt.zn(),st.a.environment==B.a.BROWSER&&this.Ai.container.removeChild(this.jt.renderer.domElement),st.a.environment===B.a.WX&&(X2.textureCanvas=null,X2.dispose()),t=function(){n.Fr.zn(function(){n.$i.zn(function(){n.Nt.zn(function(){for(var t in n.ko(),n.traverse(function(t){n.remove(t),t.dispose()}),n.parent&&n.parent.remove(n),n)n[""+t]=null,delete n[""+t]})})})},rr.isLoaded()?t():rr.onLoad=t)}},{key:"collisionCheck",value:function(){this.Nt.Jo()}}])&&xx(n.prototype,e),t&&xx(n,t),Object.defineProperty(n,"prototype",{writable:!1}),i}(),p=(Object.assign(e.prototype,{ko:function(){for(var t,n=[this.Dr,this.Gt],e=0;e<n.length;e++)n[e].zn();for(t in this.jt.ko(),this.jt=null,this.Fr=null,this.Nt=null,this)-1<n.indexOf(this[""+t])&&delete this[""+t];this.Tn=n=null},Tm:function(t,n){return this.An=new dt(u.FOV,t/n,u.CAMERA_NEAR,u.CAMERA_FAR),this.Ut=new vt(-t/2,t/2,n/2,-n/2,u.CAMERA_NEAR,u.CAMERA_FAR),this.En.Si===xi.MODE_3D?this.An:this.Ut},Zi:function(t){(t.Pn=this).Ot.push(t),this.needUpdateBound=!0},tp:function(t){for(var n=[],e=(n.push({x:t.min.x,y:t.min.y}),n.push({x:t.min.x,y:t.max.y}),n.push({x:t.max.x,y:t.max.y}),n.push({x:t.max.x,y:t.min.y}),new Fi),i=0;i<n.length;i++){var r=dr.coordsMapToScreen(this,{x:n[i].x,y:n[i].y,level:this.getLevel(),height:0});if(null===r)return null;e.Yt([r])}return e},Cm:function(t){var n=this.jt.renderer.domElement.clientHeight,e=this.jt.renderer.domElement.clientWidth,i=this.getZoom(),i=this.Gt.Ci(i),t=this.tp(t);return t?i*(e/n>(i=t.size).x/i.y?i.y/n:i.x/e):null},Dm:function(t){t=this.tp(t);return t?dr.coordsScreenToMap(this,{x:(t.max.x+t.min.x)/2,y:(t.max.y+t.min.y)/2,level:this.getLevel()}):null},Im:function(n,e,i,r){var o=this,s=this.getZoom(),t=this.Cm(n);t?s=this.Gt.nr(t):s-=1,this.setZoom({animate:!1,zoom:s,finish:function(){var t=o.Dm(n);t?o.setCenter({animate:!1,x:t.x,y:t.y,finish:function(){++i===e?r({zoom:s,center:t}):o.Im(n,e,i,r)}}):0<s?o.Im(n,e,i,r):r({zoom:s,center:n.center})}})},ir:function(){var t=this.getZoom();Math.abs(t-this.En.om)>u.EPS&&(this.Dt.Ct({type:"zoom",zoom:t}),this.kt.isOrthographicCamera&&this.jt.Ht(),this.En.om=t)},Mm:function(){var t;this.En.am&&(t=this.Gt.Bt.target).distanceToSquared(this.xm)>u.EPS&&(this.Dt.Ct({type:"move",center:this.getCenter()}),this.xm=t.clone())},Fm:function(){var t,n,e,i,s=this,a=!0;n=(t=this).Ai,e=this.En,i=function(t,n,e,i,r,o){a&&(s.En.ym(s.Tn),a=s.Gt.Ii()),s.jt.Mn(),s.kt.updateMatrixWorld(),e&&o&&s.Gt.Zi([s.ir,s.Mm]),r&&o&&(s.Lm=!0,s.Dt.Ct({type:"loaded"}),s.Zv(),s.En.gp=!1)},t.Fr=new Fl({mapCreateTime:t.Ln}),t.Nt=new Y2(t,n,e,i),t.Nt.Gp()},Ba:function(n){var e=null;return this.traverse(function(t){t.pi!==n.bid&&t.gr!==n.mid||(e=t)}),e},Ip:function(){var t=this.jt.renderer.domElement,t={x:t.clientWidth/2,y:t.clientHeight/2,z:this.Gt.controls.target.y};return dr.coordsScreenToMap(this,t)},Cp:function(e){var i=this;if(e===this.Tn)return!1;if(!this.Lm)return!1;var r=!1;if(this.Ai.enterTriggerMode===ex.Individual)e.bh.ih.forEach(function(t,n){t.type===E.MODEL&&t.level===i.Tn.level&&M1.isContain(t.coordinates[0],i.Ip())&&(i.jm=e,r=!0)});else for(var t,n=0;n<e.levelChart.length;n+=2)e.levelChart[n]===this.Tn.level&&(t=e.levelChart[n+1],t=e.kp.get(t),M1.isContain(t[0],this.Ip()))&&(this.jm=e,r=!0);return r},Yv:function(n){var e=this;this.traverse(function(t){e.jm||(e.Cp(t),e.jm&&n(t))})},Zv:function(){var e=this;if(this.Sm&&this.jm.pi!=this.En.Ai.mapID){var t=this.km(),n=this.jm.pi;if(t||this.Rm===n||(n=this.Rm,t=!0),t){if(this.getState().viewBuildingID&&this.getState().viewBuildingID!==this.En.Ai.mapID)return;var t={type:"buildingExited",buildingID:n},i=(this.Sm=!1,this.jm=null,this.getBuilding(n));this.Nt.yp(n)&&i.gh&&(i.gh=!1,this.Dt.Ct(t))}}this.traverse(function(t){var n;e.Sm||e.Cp(t)&&(n=e.Dp(),e.Rm=t.buildingID,!n||e.getState().viewBuildingID&&e.getState().viewBuildingID!==e.En.Ai.mapID||(e.Sm=!0,e.Nt.yp(t.pi)&&0==t.gh?(t.gh=!0,e.Dt.Ct({type:"buildingEntered",buildingID:t.pi})):(e.Nm=t.pi,e.on("update",e.Pm))))})},Pm:function(){var t,n;this.Nt.yp(this.Nm)&&(this.jm&&this.jm.pi===this.Nm&&(t=this.Cp(this.jm),n=this.Dp(),t)&&n&&(this.jm.gh=!0,this.Dt.Ct({type:"buildingEntered",buildingID:this.Nm})),this.off("update",this.Pm),this.Nm=null)},km:function(){var t,n=this.Um();return this.jm.overviewMode==Nm.NORMAL?(t=(t=this.getZoom())<this.jm.dh||t>=this.jm.ph,!n||t):!n},Dp:function(){var t;return this.jm.overviewMode!=Nm.NORMAL||!((t=this.getZoom())<this.jm.dh||t>=this.jm.ph)},Um:function(){var t,n,e=this;return null!=this.jm&&(!!this.Cp(this.jm)||null!=(t=this.jm.getFloor(this.jm.level).getLayers(E.EXTENT_LAYER)[0])&&(n=!1,t&&t.traverse(function(t){n=!M1.isContain(t.coordinates[0],e.Ip())}),!n))}}),e);function Lx(t){return(Lx="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Rx(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=Lx(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Lx(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Lx(t)?t:String(t)}(i.key),i)}}function Nx(t,n,e){n=Fx(n);var i=t,n=Px()?Reflect.construct(n,e||[],Fx(t).constructor):n.apply(t,e);if(n&&("object"===Lx(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function Px(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Px=function(){return!!t})()}function Fx(t){return(Fx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function jx(t,n){return(jx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var jy=function(){var t,n=i,e=Fg;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");function i(t){if(this instanceof i)return(t=Nx(this,i,[t])).wi=new Map,t;throw new TypeError("Cannot call a class as a function")}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&jx(n,e),n=i,(e=[{key:"moveTo",value:function(t){var n,e=this,i=void 0!==t.animate&&t.animate,r=t.duration||.5,o=this.yr(p);if(o)return i?(this.wi.has("moveTo")?n=this.wi.get("moveTo"):(n=new Rr,this.wi.set("moveTo",n)),n.Wn([this.wt,this.xt]).Yn([t.x,t.y]).Qn(r).qn(function(t){e.wt=t.destination[0],e.xt=t.destination[1],e.G0(),o.enableUpdateRender()}).Kn(function(){e.wt=t.x,e.xt=t.y,e.G0(),t.finish&&t.finish(),o.enableUpdateRender()}),o.$i.Zi(n.Vn()),n):(this.wt=t.x,this.xt=t.y,this.G0(),t.finish&&t.finish(),void o.enableUpdateRender())}},{key:"stop",value:function(){var n=this.yr(p);n&&this.wi&&(this.wi.forEach(function(t){n.$i.Ji(t)}),this.wi.clear())}}])&&Rx(n.prototype,e),t&&Rx(n,t),Object.defineProperty(n,"prototype",{writable:!1}),i}(),Ix=(Object.assign(jy.prototype,{G0:function(){if(this.Lt){var t=this.yr(p);if(!t)return!1;var n=this.mi===E.DOM_MARKER?this.Bm.height+this.nt:this.nt;this.Lt.position.set(this.wt-t.x,n,-this.xt+t.y),this.needUpdateBound=!0,t.enableUpdateRender()}}}),jy);function Cx(t){return(Cx="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Dx(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=Cx(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Cx(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Cx(t)?t:String(t)}(i.key),i)}}function kx(t,n,e){n=Gx(n);var i=t,n=Ux()?Reflect.construct(n,e||[],Gx(t).constructor):n.apply(t,e);if(n&&("object"===Cx(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function Ux(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Ux=function(){return!!t})()}function Bx(){return(Bx="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,n,e){var i=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=Gx(t)););return t}(t,n);if(i)return(i=Object.getOwnPropertyDescriptor(i,n)).get?i.get.call(arguments.length<3?t:e):i.value}).apply(this,arguments)}function Gx(t){return(Gx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Hx(t,n){return(Hx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var Xx=function(){var t,n=i,e=Ix;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");function i(t){if(this instanceof i)return kx(this,i,[t]);throw new TypeError("Cannot call a class as a function")}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&Hx(n,e),n=i,(e=[{key:"collision",get:function(){return this.Zo},set:function(t){this.Zo!==t&&(this.Zo=t,t=this.yr(p))&&t.Nt.Jo()}},{key:"addTo",value:function(t){Bx(Gx(i.prototype),"addTo",this).call(this,t);t=this.yr(p);t&&(t.on("viewModeChanged",this.nn),t.on("zoom",this.nn),t.on("resize",this.nn),t.Nt.Jo())}},{key:"remove",value:function(){this.stop();var t=this.yr(p);t&&(t.off("viewModeChanged",this.nn),t.off("zoom",this.nn),t.off("resize",this.nn),Bx(Gx(i.prototype),"remove",this).call(this),t.Nt.Jo(),t.enableUpdateRender())}}])&&Dx(n.prototype,e),t&&Dx(n,t),Object.defineProperty(n,"prototype",{writable:!1}),i}();function Vx(t){return(Vx="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function zx(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=Vx(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Vx(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Vx(t)?t:String(t)}(i.key),i)}}function Wx(t,n,e){n=Qx(n);var i=t,n=Yx()?Reflect.construct(n,e||[],Qx(t).constructor):n.apply(t,e);if(n&&("object"===Vx(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return Zx(i)}function Yx(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Yx=function(){return!!t})()}function Qx(t){return(Qx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Zx(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function qx(t,n){return(qx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}Zy=function(){var t,n=i,e=Xx;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");function i(t){var n;if(this instanceof i)return(n=Wx(this,i,[t])).mi=E.IMAGE_MARKER,n.cf=t.url,n.Zt=void 0!==t.size?t.size:32,n.dd=void 0!==t.depth&&t.depth,n.ft=void 0!==t.opacity?t.opacity:1,n.Zo=void 0===t.collision||t.collision,n.Kt=br.getCenterByAnchor(t.anchor),n.nn=n.nn.bind(Zx(n)),n;throw new TypeError("Cannot call a class as a function")}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&qx(n,e),n=i,(e=[{key:"url",get:function(){return this.cf},set:function(t){this.cf=t,this.lf()}},{key:"opacity",get:function(){return this.ft},set:function(t){this.ft=t,this.lf()}},{key:"size",get:function(){return this.Zt},set:function(t){this.Zt=t,this.nn()}},{key:"jump",value:function(t){return R1(this,t)}},{key:"stopJump",value:function(){return N1(this)}},{key:"boost",value:function(t){return O1(this,t)}},{key:"stopBoost",value:function(){return L1(this)}},{key:"getRenderNode",value:function(){return this.Lt}}])&&zx(n.prototype,e),t&&zx(n,t),Object.defineProperty(n,"prototype",{writable:!1}),i}(),Object.assign(Zy.prototype,{qc:function(){var t;return!!this.cf&&!!(t=this.yr(p))&&(t=this.Qr(t),this.Lt=new Vm(t),this.Lt.center.set(this.Kt.x,this.Kt.y),this.Lt.visible=this.Jt,this.G0(),this.nn(),(this.Lt.mapNode=this).Ph=!0)},nn:function(){var t=this.yr(p);t&&(P1(t.Nt,this),t.Nt.Jo(),t.enableUpdateRender())},lf:function(){var t=this.yr(p);t&&(this.Lt.material=this.Qr(t),this.nn())},Qr:function(t){var n=this,e=this.yr(v);return t.Nt.no.Pu({url:this.cf,needDepth:this.dd,opacity:this.ft*e.ft},function(){n.Lt&&n.nn(),t.enableUpdateRender()})}}),ib=Zy;function Kx(t){return(Kx="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Jx(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=Kx(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Kx(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Kx(t)?t:String(t)}(i.key),i)}}function $x(t,n,e){n=nE(n);var i=t,n=tE()?Reflect.construct(n,e||[],nE(t).constructor):n.apply(t,e);if(n&&("object"===Kx(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return eE(i)}function tE(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(tE=function(){return!!t})()}function nE(t){return(nE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function eE(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function iE(t,n){return(iE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}fb=function(){var t,n=i,e=Xx;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");function i(t){var n;if(this instanceof i)return(n=$x(this,i,[t])).mi=void 0!==t.type?t.type:E.TEXT_MARKER,n.L0=void 0!==t.text?t.text:"",n.Gm=void 0!==t.fontsize?t.fontsize:20,void 0!==t.fontSize&&(n.Gm=t.fontSize),n.Hm=t.fontFamily,n.U0=void 0!==t.fillColor?t.fillColor:"0,0,0",n.Xm=void 0!==t.strokeColor?t.strokeColor:"255,225,255",n.Vm=void 0!==t.strokeWidth?t.strokeWidth:1,n.zm=t.plateColor,n.Wm=t.plateStrokeColor,n.dd=void 0!==t.depth&&t.depth,n.Zo=void 0===t.collision||t.collision,n.ft=void 0!==t.opacity?t.opacity:1,n.Ym=void 0!==t.textAlign?t.textAlign:Hl.Center,n.Qm=t.anchor,n.Kt=br.getCenterByAnchor(t.anchor),n.Zt=0,n.nn=n.nn.bind(eE(n)),n;throw new TypeError("Cannot call a class as a function")}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&iE(n,e),n=i,(e=[{key:"size",get:function(){return this.Zt},set:function(t){this.Zt=t}},{key:"text",get:function(){return this.L0},set:function(t){this.L0=t}},{key:"fillColor",get:function(){return this.U0},set:function(t){this.U0=t}},{key:"strokeColor",get:function(){return this.Xm},set:function(t){this.Xm=t}},{key:"strokeWidth",get:function(){return this.Vm},set:function(t){this.Vm=t}},{key:"fontsize",get:function(){return this.Gm},set:function(t){this.Gm=t}},{key:"fontSize",get:function(){return this.Gm},set:function(t){this.Gm=t}},{key:"plateColor",get:function(){return this.zm},set:function(t){this.zm=t}},{key:"plateStrokeColor",get:function(){return this.Wm},set:function(t){this.Wm=t}},{key:"update",value:function(){this.lf()}},{key:"setInitWriteRenderNodeFunction",value:function(t){this.Zm=t}},{key:"findParent",value:function(t){return this.yr(t)}},{key:"updateSize",value:function(){this.nn()}},{key:"getRenderNode",value:function(){return this.Lt}},{key:"getScreenSize",value:function(){var t=null;return t=this.Lt?{width:this.Lt.children[0].material.map.image.width/2,height:this.Lt.children[0].material.map.image.height/2}:t}}])&&Jx(n.prototype,e),t&&Jx(n,t),Object.defineProperty(n,"prototype",{writable:!1}),i}(),Object.assign(fb.prototype,{qc:function(){var t=this.yr(p);if(!t)return!1;this.R0=!1;t=t.Nt,t=this.Qr(t.no).material,this.Lt=new nh,t=new Vm(t);return t.center.set(this.Kt.x,this.Kt.y),this.Lt.add(t),this.nn(),this.G0(),this.Lt.mapNode=this,(t.mapNode=this).Ph=!0,this.Zm&&(this.Lt=this.Zm(this.Lt)),!0},qm:function(t,n){if(t&&t.material){var e=this.yr(p);if(!e)return!1;e=e.Nt.Rh(n);t.scale.set(e,e,e),t.scale.multiplyScalar(t.material.userData.mspriteScale||1),t.scale.setX(t.scale.x/t.material.userData.scaleRatio)}},nn:function(){var t=this.yr(p);if(!t)return!1;var n=this.Lt.isGroup?this.Lt.children[0]:this.Lt;"Sprite"===n.type&&(this.qm(n,this.Zt),t.enableUpdateRender())},H0:function(t){t&&t.material&&(t.material.map&&t.material.map.dispose(),t.material.dispose())},lf:function(){var t,n=this.yr(p);n&&(t=this.Lt.isGroup?this.Lt.children[0]:this.Lt,this.H0(t),n=this.Qr(n.Nt.no).material,t.material=n,this.nn())},Qr:function(t){var n=this.yr(v),t=t.Ou(this.L0,{fontsize:this.R0?this.Gm+2:this.Gm,fillColor:Mr.toRgba(this.U0),strokeColor:Mr.toRgba(this.Xm),plateColor:Mr.toRgba(this.zm),plateStrokeColor:Mr.toRgba(this.Wm),strokeWidth:this.Vm},{family:this.Hm,needSize:!0,opacity:this.ft*n.ft,textAlign:this.Ym,drawText:!this.R0});return this.Zt=t.size,{material:t}}}),bb=fb;function rE(t){return(rE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function oE(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=rE(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=rE(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==rE(t)?t:String(t)}(i.key),i)}}var sE=function(){function i(){if(!(this instanceof i))throw new TypeError("Cannot call a class as a function")}var t,n,e;return t=i,e=[{key:"createShape",value:function(t,n){var e=new Dp;if(Array.isArray(t[0])){var i=t[0];e.moveTo(i[0].x-n.x,i[0].y-n.y);for(var r=1;r<i.length;r++)e.lineTo(i[r].x-n.x,i[r].y-n.y);if(1<t.length)for(var o=1;o<t.length;o++){var s=t[o],a=new Cp;if(0<s.length){a.moveTo(s[0].x-n.x,s[0].y-n.y);for(var u=1;u<s.length;u++)a.lineTo(s[u].x-n.x,s[u].y-n.y)}e.holes.push(a)}}else{e.moveTo(t[0].x-n.x,t[0].y-n.y);for(var c=1;c<t.length;c++)e.lineTo(t[c].x-n.x,t[c].y-n.y)}return e}},{key:"createShapeBufferGeometryByCenter",value:function(t,n,e){t=new rm(this.createShape(t,n));if(e){for(var i=[Number.MAX_VALUE,Number.MAX_VALUE],r=[-Number.MAX_VALUE,-Number.MAX_VALUE],o=t.attributes.position.array,s=0;s<o.length/3;s++){var a=o[3*s],u=o[3*s+1];a<i[0]&&(i[0]=a),u<i[1]&&(i[1]=u),r[0]<a&&(r[0]=a),r[1]<u&&(r[1]=u)}for(var c=t.attributes.uv.array,h=[r[0]-i[0],r[1]-i[1]],f=0;f<o.length/3;f++){var l=o[3*f],d=o[3*f+1];c[2*f]=(l-i[0])/h[0],c[2*f+1]=(d-i[1])/h[1]}t.setAttribute("uv",new x(c,2))}return t}},{key:"createExtrudeBufferGeometry",value:function(t,n){return new sm(t,{steps:1,depth:n.depth,bevelEnabled:!1,bevelThickness:0,bevelSize:0,bevelOffset:0,bevelSegments:1})}},{key:"closedPoints",value:function(t){return lm.closedPoints(t)}},{key:"createReactShape",value:function(t,n){var e=new Dp,n=n/2,t=t/2;return e.moveTo(-t,-n),e.lineTo(-t,n),e.lineTo(t,n),e.lineTo(t,-n),e}},{key:"createCircleShape",value:function(t,n){var e=new Dp;return e.absarc(0,0,t,0,2*Math.PI,!1),e}},{key:"createReactExtrudeBufferGeometry",value:function(t,n,e){t=i.createReactShape(t,n);return this.createExtrudeBufferGeometry(t,e)}},{key:"createCircleExtrudeBufferGeometry",value:function(t,n,e){t=i.createCircleShape(t,n);return this.createExtrudeBufferGeometry(t,e)}},{key:"createCenterBufferGeometry",value:function(t,n){for(var e=[],i=0;i<t.length-1;i++)for(var r=2;r<10;r+=2)e.push({x:t[i].x+(t[i+1].x-t[i].x)*r*.1,y:t[i].y+(t[i+1].y-t[i].y)*r*.1,z:t[i].z+(t[i+1].z-t[i].z)*r*.1});e.push({x:e[0].x,y:e[0].y,z:e[0].z});for(var o=new ra,s=[],a=[],u=0;u<e.length-1;u++)s.push(e[u].x),s.push(e[u].y),s.push(e[u].z),s.push(e[u+1].x),s.push(e[u+1].y),s.push(e[u+1].z),s.push(n.x),s.push(n.y),s.push(n.z),a.push(0,0,1);var c=new Float32Array(s);return o.setAttribute("position",new x(c,3)),o.setAttribute("gradientAlpha",new x(a,1)),o}},{key:"scalePoints",value:function(t,n,e){for(var i=[],r=0;r<t.length;r++){var o=t[r].x,s=t[r].y,a=t[r].z;i.push({x:o+(o-n.x)*(e-1),y:s+(s-n.y)*(e-1),z:a})}return i}},{key:"scaleValuePoints",value:function(t,n,e){for(var i=[],r=0;r<t.length;r++){var o={x:t[r].x,y:t[r].y,z:t[r].z};o.x-n.x<0?o.x-=e:o.x+=e,o.y-n.y<0?o.y-=e:o.y+=e,i.push(o)}return i}}],(n=null)&&oE(t.prototype,n),e&&oE(t,e),Object.defineProperty(t,"prototype",{writable:!1}),i}();function aE(t){return(aE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function uE(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=aE(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=aE(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==aE(t)?t:String(t)}(i.key),i)}}function cE(t,n,e){n=fE(n);var i=t,n=hE()?Reflect.construct(n,e||[],fE(t).constructor):n.apply(t,e);if(n&&("object"===aE(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function hE(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(hE=function(){return!!t})()}function fE(t){return(fE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function lE(t,n){return(lE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}c2=function(){var t,n=i,e=Fg;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");function i(t){var n;if(this instanceof i)return(n=cE(this,i,[t])).mi=E.POLYGON_MARKER,n.cf=void 0!==t.url?t.url:void 0,n.Yl=void 0!==t.color?t.color:"#FF0000",n.ft=void 0!==t.opacity?t.opacity:1,n.Hd=t.borderColor||t.borderColor||"#00ff00",n.fd="number"==typeof t.borderWidth?t.borderWidth:2,n.nt=void 0!==t.height?t.height:0,n.Lh=void 0!==t.points?t.points:[],n;throw new TypeError("Cannot call a class as a function")}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&lE(n,e),n=i,(e=[{key:"x",get:function(){return this.wt}},{key:"y",get:function(){return this.xt}},{key:"points",get:function(){return this.Lh},set:function(t){var n,e;this.Lh=t,this.Lt&&(t=this.yr(p))&&(n=new Mt(t.x,t.y),n=sE.createShapeBufferGeometryByCenter(this.Lh,n,!!this.cf),e=this.Lt.geometry,this.Lt.geometry=n,e.dispose(),e=null,e=this.Km(n),this.lh.Fd(e),t.enableUpdateRender())}},{key:"color",get:function(){return this.Yl},set:function(t){this.Yl=t,this.Jm()}},{key:"borderColor",get:function(){return this.Hd},set:function(t){this.Hd=t,this.lh&&(this.lh.color=t,this.lh.update())}},{key:"borderWidth",get:function(){return this.fd},set:function(t){this.fd=t,this.lh&&(this.lh.width=t,this.lh.update())}},{key:"opacity",get:function(){return this.ft},set:function(t){this.ft=t,this.Jm()}},{key:"getBound",value:function(){return M1.bound(this.Lh)}},{key:"getInsideCenter",value:function(){var t={};return M1.calculatorInsideCentroid(this.Lh,t),t}},{key:"getRenderNode",value:function(){return this.Lt}}])&&uE(n.prototype,e),t&&uE(n,t),Object.defineProperty(n,"prototype",{writable:!1}),i}(),Object.assign(c2.prototype,{Km:function(t){for(var n=t.attributes.position.array.length,e=new Float32Array(n+3),i=0;i<n;i++)e[i]=t.attributes.position.array[i];return e[n]=t.attributes.position.array[0],e[n+1]=t.attributes.position.array[1],e[n+2]=t.attributes.position.array[2],e},qc:function(){var t,n,e,i;return!!this.Lh&&!!(t=this.yr(p))&&(i=this.yr(v),n=t.Nt.no.wu({url:this.cf,color:this.Yl,opacity:this.ft*i.ft,visible:!this.cf},function(){n.map.wrapS=Xn,n.map.wrapT=Xn,n.needsUpdate=!0,n.visible=!0}),i=new Mt(t.x,t.y),i=sE.createShapeBufferGeometryByCenter(this.Lh,i,!!this.cf),e=this.Km(i),Uy(i,n,this),this.Lt.position.set(0,this.nt,0),(i=new j_({color:this.Hd,width:this.fd})).Pn=this,i.Pd(e,t),this.Z0=e,this.lh=i,this.Lt.add(i.Lt),t.enableUpdateRender(),!0)},G0:function(){this.Lt&&this.Lt.position.set(0,this.nt,0),this.yr(p).enableUpdateRender()},Jm:function(){var t=this,n=this.yr(p);if(!n)return!1;var e=n.Nt,i=this.yr(v);this.Lt.material=e.no.wu({url:this.cf,color:this.Yl,opacity:this.ft*i.ft,visible:!this.cf},function(){t.Lt.material.map.wrapS=Xn,t.Lt.material.map.wrapT=Xn,t.Lt.material.needsUpdate=!0,t.Lt.material.visible=!0}),n.enableUpdateRender()},lf:function(){this.Jm(),this.lh.update()}}),m2=c2;function dE(t){return(dE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function vE(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=dE(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=dE(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==dE(t)?t:String(t)}(i.key),i)}}function pE(t,n,e){n=yE(n);var i=t,n=mE()?Reflect.construct(n,e||[],yE(t).constructor):n.apply(t,e);if(n&&("object"===dE(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function mE(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(mE=function(){return!!t})()}function yE(t){return(yE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function bE(t,n){return(bE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var gE=function(){var t,n,e=r,i=ra;if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");function r(){var t,n;if(this instanceof r)return t=pE(this,r),n=new lh(new Float32Array([-.5,0,-.5,0,0,.5,0,-.5,1,0,.5,0,.5,1,1,-.5,0,.5,0,1]),5),t.setIndex([0,1,2,0,2,3]),t.setAttribute("position",new vh(n,3,0,!1)),t.setAttribute("uv",new vh(n,2,3,!1)),t;throw new TypeError("Cannot call a class as a function")}return e.prototype=Object.create(i&&i.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),i&&bE(e,i),e=r,t&&vE(e.prototype,t),n&&vE(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}();function _E(t){return(_E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function wE(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=_E(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=_E(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==_E(t)?t:String(t)}(i.key),i)}}function xE(t,n,e){n=AE(n);var i=t,n=EE()?Reflect.construct(n,e||[],AE(t).constructor):n.apply(t,e);if(n&&("object"===_E(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return SE(i)}function EE(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(EE=function(){return!!t})()}function SE(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function TE(){return(TE="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,n,e){var i=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=AE(t)););return t}(t,n);if(i)return(i=Object.getOwnPropertyDescriptor(i,n)).get?i.get.call(arguments.length<3?t:e):i.value}).apply(this,arguments)}function AE(t){return(AE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ME(t,n){return(ME=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var E2=function(){var t,n=i,e=Ix;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");function i(t){var n;if(this instanceof i)return(n=xE(this,i,[t])).mi=E.LOCATION_MARKER,n.cf=t.url,n.Zt=void 0!==t.size?t.size:20,n.Or=void 0!==t.level?t.level:1,n.ft=void 0!==t.opacity?t.opacity:1,n.V0=t.buildingID,n.$m=0,n.nn=n.nn.bind(SE(n)),n.G0=n.G0.bind(SE(n)),n;throw new TypeError("Cannot call a class as a function")}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&ME(n,e),n=i,(e=[{key:"buildingID",get:function(){return this.V0}},{key:"level",get:function(){return this.Or},set:function(t){this.Or!==t&&(this.Or=t,t=this.yr(p),this.remove(),this.addTo(t))}},{key:"opacity",get:function(){return this.ft},set:function(t){this.ft=t,this.Ph&&this.lf()}},{key:"url",get:function(){return this.cf},set:function(t){this.cf=t,this.lf()}},{key:"size",get:function(){return this.Zt},set:function(t){this.Zt=t,this.nn()}},{key:"moveTo",value:function(t){if(this.V0!==t.buildingID){this.V0=t.buildingID,this.Or=t.level;var n=this.yr(p);if(!n)return!1;this.remove(),this.addTo(n)}else t.level&&(this.level=t.level);return TE(AE(i.prototype),"moveTo",this).call(this,t)}},{key:"rotateTo",value:function(t){var n=this,e=this.yr(p);if(!e)return!1;var i,r=t.duration||.5,o=this.Lt.rotation.y,s=t.heading%360*u.DEG2RAD,a=0,s=o+(a=s-o!=0?Math.sin(s-o)/Math.abs(Math.sin(s-o))*Math.acos(Math.cos(s-o)):a);t.animate?(this.wi.has("rotation")?(i=this.wi.get("rotation")).finish():(i=new Rr({src:[o],dest:[s]}),this.wi.set("rotation",i)),i.Qn(r).qn(function(t){n.Lt&&(n.Lt.rotation.y=t.destination[0],n.$m=t.destination[0],e.enableUpdateRender())}).Kn(function(){e.$i.Ji(i),e.enableUpdateRender(),t.finish&&t.finish()}),e.$i.Zi(i.Vn())):this.Lt&&(this.Lt.rotation.y=s,this.$m=s,e.enableUpdateRender())}},{key:"addTo",value:function(t){var n=this.ki(t);n&&(TE(AE(i.prototype),"addTo",this).call(this,n),t.on("zoom",this.nn),t.on("resize",this.nn),t.on("viewChanged",this.nn))}},{key:"remove",value:function(){this.stop();var t=this.yr(p);if(!t)return!1;t.off("zoom",this.nn),t.off("resize",this.nn),t.off("viewChanged",this.nn),TE(AE(i.prototype),"remove",this).call(this)}},{key:"getRenderNode",value:function(){return this.Lt}}])&&wE(n.prototype,e),t&&wE(n,t),Object.defineProperty(n,"prototype",{writable:!1}),i}(),R2=(Object.assign(E2.prototype,{qc:function(){var t,n,e=this.yr(p);return!!e&&(n=new gE,t=this.Qr(e),this.Lt=new $a(n,t),this.Lt.renderOrder=1,(this.Lt.mapNode=this).G0(),this.Lt.rotation.set(0,this.$m,-Math.PI,"XYZ"),this.Lt.updateMatrixWorld(!0),n=e.Nt.Bp(this.Lt,this.Zt),this.Lt.scale.set(n,n,n),this.Lt.visible=this.Jt,this.Pn.Co.add(this.Lt),this.Ph=!0)},nn:function(){var t,n,e=this.yr(p);!e||(n=this.Lt.position,t=!1,t=!!(isNaN(n.x)||isNaN(n.y)||isNaN(n.z)||"number"!=typeof n.x||"number"!=typeof n.y||"number"!=typeof n.z)||t)||(n=e.Nt.Bp(this.Lt,this.Zt),this.Lt.scale.set(n,n,n),e.enableUpdateRender())},G0:function(){var t,n=this.yr(p);n&&(t=this.ki(n))&&(this.Lt.position.set(this.wt-n.x,t.nt+this.nt,-this.xt+n.y),this.needUpdateBound=!0,n.enableUpdateRender())},Qr:function(n){var e=this;return n.Nt.no.xu({url:this.cf,flipY:!1,opacity:this.ft},function(){var t;e.Lt&&(t=n.Nt.Bp(e.Lt,e.Zt),e.Lt.scale.set(t,t,t),n.enableUpdateRender())})},lf:function(){var t=this.yr(p);if(!t)return!1;this.Lt.material.map&&this.Lt.material.map.dispose(),this.Lt.material.dispose(),this.Lt.material=this.Qr(t),this.Lt.material.needsUpdate=!0,t.enableUpdateRender()},ki:function(t){return(this.V0?t.getBuilding(this.V0):t).getFloor(this.Or)}}),E2),N2={EDGES_LINES_TYPE:"EDGES_LINES_TYPE"},OE=(Object.freeze(N2),N2),LE={NONE:0,ALL:1,TOP:2};function RE(t,n){ra.call(this),this.type="EdgesGeometry",this.parameters={thresholdAngle:n},n=void 0!==n?n:1;for(var e,i,r,o,s=[],a=Math.cos(St.DEG2RAD*n),u=[0,0],c={},h=["a","b","c"],f=(t.isBufferGeometry?(o=new Us).fromBufferGeometry(t):o=t.clone(),o.mergeVertices(),o.computeFaceNormals(),o.vertices),l=o.faces,d=0,v=l.length;d<v;d++)for(var p=l[d],m=0;m<3;m++)e=p[h[m]],i=p[h[(m+1)%3]],u[0]=Math.min(e,i),u[1]=Math.max(e,i),void 0===c[r=u[0]+","+u[1]]?c[r]={index1:u[0],index2:u[1],face1:d,face2:void 0}:c[r].face2=d;for(r in c){var y,b=c[r];(void 0===b.face2||l[b.face1].normal.dot(l[b.face2].normal)<=a)&&(y=f[b.index1],s.push(y.x,y.y,y.z),y=f[b.index2],s.push(y.x,y.y,y.z))}this.setAttribute("position",new x(s,3))}function NE(t){return(NE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function PE(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=NE(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=NE(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==NE(t)?t:String(t)}(i.key),i)}}function FE(t,n,e){n=IE(n);var i=t,n=jE()?Reflect.construct(n,e||[],IE(t).constructor):n.apply(t,e);if(n&&("object"===NE(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function jE(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(jE=function(){return!!t})()}function IE(t){return(IE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function CE(t,n){return(CE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}(RE.prototype=Object.create(ra.prototype)).constructor=RE;var i=function(){var t,n=i,e=Fg;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");function i(t){var n;if(this instanceof i)return(n=FE(this,i,[t])).mi=OE.EDGES_LINES_TYPE,n.vd=void 0!==t.lineType?t.lineType:LE.TOP,n.t1=void 0!==t.lineAlpha?t.lineAlpha:1,n.Hd=void 0!==t.lineColor?t.lineColor:"#FF0000",n;throw new TypeError("Cannot call a class as a function")}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&CE(n,e),n=i,(e=[{key:"lineColor",get:function(){return this.Hd},set:function(t){this.Hd!==t&&(this.Hd=t,this.lf())}},{key:"lineAlpha",get:function(){return this.t1},set:function(t){this.t1!==t&&(this.t1=t,this.lf())}}])&&PE(n.prototype,e),t&&PE(n,t),Object.defineProperty(n,"prototype",{writable:!1}),i}(),DE=(Object.assign(i.prototype,{Id:function(t){var t=new RE(t),n=this.yr(p);if(!n)return!1;var n=n.Nt,e=this.yr(v),n=n.no.Iu(this.Hd,this.t1*e.ft);this.Lt=new Hd(t,n),this.Ph=!0},lf:function(){var t,n=this.yr(p);n&&(t=this.yr(v),this.Lt.material=n.Nt.no.Iu(this.Hd,this.t1*t.ft))}}),i);function kE(t){return(kE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function UE(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=kE(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=kE(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==kE(t)?t:String(t)}(i.key),i)}}function BE(t,n,e){n=VE(n);var i=t,n=GE()?Reflect.construct(n,e||[],VE(t).constructor):n.apply(t,e);if(n&&("object"===kE(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return HE(i)}function GE(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(GE=function(){return!!t})()}function HE(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function XE(){return(XE="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,n,e){var i=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=VE(t)););return t}(t,n);if(i)return(i=Object.getOwnPropertyDescriptor(i,n)).get?i.get.call(arguments.length<3?t:e):i.value}).apply(this,arguments)}function VE(t){return(VE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function zE(t,n){return(zE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var Gw=function(){var t,n=i,e=Fg;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");function i(t){var n;if(!(this instanceof i))throw new TypeError("Cannot call a class as a function");if((n=BE(this,i,[t])).mi=E.EXTRUDE_MARKER,n.ft=void 0!==t.opacity?t.opacity:1,n.Yl=void 0!==t.color?t.color:"#FF0000",n.n1=void 0!==t.extrudeHeight?t.extrudeHeight:1,n.dd=n.n1,n.Lh=void 0!==t.points?Object.assign(t.points):[],Array.isArray(n.Lh[0]))for(var e=0;e<n.Lh.length;e++)n.Lh[e].constructor===Array&&(lm.polygonArea(n.Lh[e])<0&&n.Lh[e].reverse(),lm.closedPoints(n.Lh[e]));else n.Lh.constructor===Array&&(lm.polygonArea(n.Lh)<0&&n.Lh.reverse(),lm.closedPoints(n.Lh));return n.e1=new DE({lineType:t.edgeMode,lineColor:void 0!==t.edgeColor?t.edgeColor:n.Yl,lineAlpha:void 0!==t.edgeOpacity?t.edgeOpacity:n.ft}),n.e1.Pn=HE(n),n}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&zE(n,e),n=i,(e=[{key:"x",get:function(){return this.wt}},{key:"y",get:function(){return this.xt}},{key:"color",get:function(){return this.Yl},set:function(t){this.Yl!==t&&(this.Yl=t,this.i1())}},{key:"opacity",get:function(){return this.ft},set:function(t){this.ft!==t&&(this.ft=t,this.i1())}},{key:"edgeColor",get:function(){return this.e1.Hd},set:function(t){this.e1.lineColor=t}},{key:"edgeOpacity",get:function(){return this.e1.t1},set:function(t){this.e1.lineAlpha=t}},{key:"extrudeHeight",get:function(){return this.n1},set:function(t){this.n1!==t&&(this.n1=t,this.Lt.scale.setZ(this.n1/this.dd))}},{key:"points",get:function(){return this.Lh},set:function(t){this.Lh=t,this.Lh.constructor===Array&&(lm.polygonArea(this.Lh)<0&&this.Lh.reverse(),lm.closedPoints(this.Lh)),this.Lt&&(t=this.yr(p))&&(this.Lt.parent.remove(this.Lt),this.Lt.traverse(function(t){t instanceof $a&&(t.geometry.dispose(),t.material=void 0,t.geometry=void 0)}),this.Lt.mapNode=void 0,this.Lt=void 0,this.qc(),this.parent.scene.add(this.Lt),t.enableUpdateRender())}},{key:"dispose",value:function(){this.e1&&this.e1.dispose(),XE(VE(i.prototype),"dispose",this).call(this)}},{key:"getRenderNode",value:function(){return this.Lt}},{key:"setType",value:function(t){this.mi=t}}])&&UE(n.prototype,e),t&&UE(n,t),Object.defineProperty(n,"prototype",{writable:!1}),i}(),Aw=(Object.assign(Gw.prototype,{qc:function(){var t,n,e,i,r,o=this.yr(p);return!!o&&(t=o.Nt,n=this.yr(v),e=new Mt(o.x,o.y),r=sE.createShape(this.Lh,e),i={depth:this.dd},Uy(r=sE.createExtrudeBufferGeometry(r,i),t.no.Iu(this.Yl,this.ft*n.ft),this),this.Lt.position.set(0,this.nt,0),this.e1.vd===LE.TOP?this.o1(e):this.e1.vd===LE.ALL&&this.rv(r),this.Ph=!0,o.enableUpdateRender(),this.Ph)},o1:function(t){t=new rm(sE.createShape(this.Lh,t));this.rv(t),this.e1.Lt.position.setZ(this.dd),t.dispose()},rv:function(t){this.e1.Id(t),this.Lt.add(this.e1.Lt)},i1:function(){var t,n=this.yr(p);n&&(t=this.yr(v),this.Lt.material=n.Nt.no.Iu(this.Yl,this.ft*t.ft),n.enableUpdateRender())},lf:function(){this.i1(),this.e1.lf()},G0:function(){this.Lt.position.set(0,this.nt,0),this.yr(p).enableUpdateRender()}}),Gw),Zw=t(32),WE=t.n(Zw),e2=t(33),YE=t.n(e2);function QE(t){return(QE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ZE(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,tS(i.key),i)}}function qE(t,n,e){n=iS(n);var i=t,n=KE()?Reflect.construct(n,e||[],iS(t).constructor):n.apply(t,e);if(n&&("object"===QE(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return JE(i)}function KE(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(KE=function(){return!!t})()}function JE(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function $E(t,n,e,i){return($E="undefined"!=typeof Reflect&&Reflect.set?Reflect.set:function(t,n,e,i){var r,t=eS(t,n);if(t){if((r=Object.getOwnPropertyDescriptor(t,n)).set)return r.set.call(i,e),!0;if(!r.writable)return!1}if(r=Object.getOwnPropertyDescriptor(i,n)){if(!r.writable)return!1;r.value=e,Object.defineProperty(i,n,r)}else t=i,r=e,!((i=tS(i=n))in t?Object.defineProperty(t,i,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[i]=r);return!0})(t,n,e,i)}function tS(t){t=function(t,n){if("object"!=QE(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=QE(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==QE(t)?t:String(t)}function nS(){return(nS="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,n,e){var i=eS(t,n);if(i)return(i=Object.getOwnPropertyDescriptor(i,n)).get?i.get.call(arguments.length<3?t:e):i.value}).apply(this,arguments)}function eS(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=iS(t)););return t}function iS(t){return(iS=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function rS(t,n){return(rS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}tv=function(){var t,n=s,e=Fg;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");function s(t,n){var e;if(this instanceof s)return(e=qE(this,s,[n=n||{}])).mi=E.HEAT_MAP_MARKER,e.gn=t,e.hm=n.backgroundColor,e.ft=n.opacity,e.ld=void 0!==n.radius?n.radius:30,e.s1=void 0!==n.valueRange?void 0!==n.valueRange.max?void 0!==n.valueRange.min?n.valueRange:{max:n.valueRange.max,min:0}:void 0!==n.valueRange.min?{max:100,min:n.valueRange.min}:{max:100,min:0}:{max:100,min:0},e.s1.min>=e.s1.max&&(e.s1={max:100,min:0}),e.a1=void 0!==n.quality?n.quality:1024,e.Dh=void 0===n.isPlane||n.isPlane,e.u1=e.Dh,e.c1=void 0!==n.gradient?n.gradient:{.45:"rgb(0,0,255)",.55:"rgb(0,255,255)",.65:"rgb(0,255,0)",.95:"yellow",1:"rgb(255,0,0)"},e.lt=n.maxOpacity,void 0===e.lt&&(e.lt=1),void 0!==e.ft&&(e.lt=e.ft),e.dt=n.minOpacity,void 0===e.dt&&(e.dt=0),e.ht=n.blur,void 0===e.ht&&(e.ht=.85),e.h1=n.scaleRadius,void 0===e.h1&&(e.h1=!0),e.nt=n.height,void 0===e.nt&&(e.nt=1),e.Dh||(e.h1=!0),e.Lh=[],e.f1=null,e.G=null,e.l1=null,e.d1=0,e.Bm=null,e.Uh=null,e.m1=void 0,e.b1=null,e.g1=null,e._1=null,e.w1=null,e.E1=null,e.S1=null,e.T1=e.T1.bind(JE(e)),e.A1=11,e.M1=22,e.O1=null,e;throw new TypeError("Cannot call a class as a function")}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&rS(n,e),n=s,(e=[{key:"bound",get:function(){var t,n;return!0===this.needUpdateBound&&null!==this.Bm&&(this.ai.reset(),t=this.Bm.getLayers(E.MODEL_LAYER)[0],!1===this.Dh?(n=this.Bm.getLayers(E.EXTENT_LAYER)[0],t&&this.ai.expand(t.bound),n&&this.ai.expand(n.bound)):t&&this.ai.expand(t.bound),this.needUpdateBound=!1),this.ai.clone()}},{key:"x",get:function(){return this.wt}},{key:"y",get:function(){return this.xt}},{key:"height",get:function(){return this.nt},set:function(t){this.u1&&(this.nt=t,this.G0())}},{key:"opacity",get:function(){return this.ft},set:function(t){this.ft=t,this.lt=this.ft,this.b1&&this.b1.configure({radius:this.ld,valueRange:this.s1,maxOpacity:this.lt,minOpacity:this.dt,gradient:this.c1,blur:this.ht})}},{key:"valueRange",get:function(){return this.s1},set:function(t){void 0!==t.max&&(this.s1.max=t.max),void 0!==t.min&&(this.s1.min=t.min),this.s1.min>=this.s1.max&&(this.s1={max:100,min:0})}},{key:"level",get:function(){return this.Bm.level}},{key:"visible",get:function(){return nS(iS(s.prototype),"visible",this)},set:function(t){if(this.Jt!==t){var n=iS(s.prototype),e=t,i=!0;if(!$E(n,"visible",e,this||n)&&i)throw new TypeError("failed to set property");this.Dh?this.Jt&&this.L1()&&(this.Lh.length=0,this.R1(),this.update()):(t?this.Pn.kh(this.Uh):this.Pn.kh(null),this.gn.enableUpdateRender())}}},{key:"simulate",value:function(t){this.d1=t}},{key:"clearDataSource",value:function(){this.G=null,this.Lh=[]}},{key:"addPoint",value:function(t,n,e){var i;t&&n&&e&&(i=this.Bm.getLayers(E.EXTENT_LAYER)[0].bound,t=this.N1(t,n,i))&&(t.x=Math.round(t.x),t.y=Math.round(t.y),t.value=e,t.radius=this.ld,this.Lh.push(t))}},{key:"addDataSource",value:function(t){this.G=t,this.Lh=[]}},{key:"update",value:function(){var t;0===this.Lh.length&&null!=this.G&&(t=(t=this.Bm.getExtendByCoords(this.G[0]))||this.Bm.getLayers(E.EXTENT_LAYER)[0],this.h1?this.P1(t.bound):this.R1()),this.b1.setData({max:this.s1.max,min:this.s1.min,data:this.Lh}),this.F1(),this.Dh?this.h1?(t=this.Lt.material.map,this.Lt.material.map=this.Uh,this.Lt.material.map.needsUpdate=!0,this.Lt.material.needsUpdate=!0,t.dispose()):this.j1():this.Pn.kh(this.Uh),this.gn.enableUpdateRender()}},{key:"addTo",value:function(t){this.Bm=t;var n=null;if(null===this.G)n=this.Bm.getLayers(E.EXTENT_LAYER)[0].Ot[0];else{for(var e=[],i=(n=(n=this.Bm.getExtendByCoords(this.G[0]))||this.Bm.getLayers(E.EXTENT_LAYER)[0].Ot[0]).G.yi[0],r=0;r<this.G.length;r++)z.Te(this.G[r],i,i.length)&&e.push(this.G[r]);this.G=e}var o=n.bound,o=(this.g1=n.bound,this._1=n,st.a.environment===B.a.WX?this.l1=X2.textureCanvas[0]:this.l1=document.createElement("canvas"),0!=this.d1&&this.I1(this.d1),null!=this.G&&(this.h1?(this.f1=this.C1(o),this.l1.width=this.f1.width,this.l1.height=this.f1.height,this.P1(o)):(n=this.D1(),this.U1(n),this.S1=this.C1(this.w1),st.a.environment===B.a.WX?this.E1=X2.textureCanvas[0]:this.E1=document.createElement("canvas"),this.E1.width=this.S1.width,this.E1.height=this.S1.height,this.P1(this.w1,n))),{radius:this.ld,valueRange:this.s1,maxOpacity:this.lt,minOpacity:this.dt,gradient:this.c1,blur:this.ht});this.h1?o.canvas=this.l1:o.canvas=this.E1,st.a.environment==B.a.WX?this.b1=YE.a.create(o):this.b1=WE.a.create(o),null!==this.G&&this.b1.setData({max:this.s1.max,min:this.s1.min,data:this.Lh}),nS(iS(s.prototype),"addTo",this).call(this,t),this.needUpdateBound=!0}},{key:"remove",value:function(){this.h1||(this.gn.off("zoom",this.T1),this.gn.off("levelChanged",this.T1),this.gn.off("visibleLevelsLoaded",this.T1),this.gn.off("move",this.T1),this.gn.off("viewChanged",this.T1),this.gn.off("resize",this.T1)),nS(iS(s.prototype),"remove",this).call(this)}},{key:"dispose",value:function(){nS(iS(s.prototype),"dispose",this).call(this),this.Bm=null,this.Uh&&this.Uh.dispose(),this.Uh=null}}])&&ZE(n.prototype,e),t&&ZE(n,t),Object.defineProperty(n,"prototype",{writable:!1}),s}(),Object.assign(tv.prototype,{F1:function(){var t,n,e=this;st.a.environment===B.a.WX?(this.h1||this.B1(),t=this.l1.toDataURL("image/png"),this.Uh?this.image&&(this.image.crossOrigin="Anonymous",this.image.onload=function(){e.Uh.image=e.image,e.gn.enableUpdateRender()},this.image.src=t):(n=new l,(this.Uh=n).minFilter=zn,st.a.textureHelper.createImage({url:t,onload:function(t){e.Uh.image=t,e.Uh.needsUpdate=!0,e.image=t,e.gn.enableUpdateRender()}}))):(this.h1||this.B1(),this.Uh=new l(this.H1(this.l1)))},X1:function(){var t=new Ia(16777215);return t.opacity=1,t.transparent=!0,t.map=this.Uh,t.map&&(t.map.needsUpdate=!0),t.depthTest=!1,t.needsUpdate=!0,t},qc:function(){if(!this.Ph){var t,n,e=(null!==this.G&&this.Bm.getExtendByCoords(this.G[0])||this.Bm.getLayers(E.EXTENT_LAYER)[0].Ot[0]).Lt;if(e)if(this.Uh=null,this.F1(),this.Dh)this.h1?(t=e.userData,e.userData={},n=e.clone(),e.userData=t,n.name="heatMap",n.scale.z=.001,n.position.y+=this.nt,e=this.X1(),n.material=e,this.Lt=n,this.Lt.mapNode=this):this.j1(),this.Ph=!0;else{this.Ph=!0;for(var i=this.Bm.getModelMeshs(),r=0;r<i.length;r++)if(i[r]){this.Ph=!0;break}}this.yr(p).enableUpdateRender(),this.h1||(this.gn.on("zoom",this.T1),this.gn.on("levelChanged",this.T1),this.gn.on("visibleLevelsLoaded",this.T1),this.gn.on("move",this.T1),this.gn.on("viewChanged",this.T1),this.gn.on("resize",this.T1))}return this.Ph},B1:function(){var t,n,e;this.Dh?this.l1=this.E1:(this.f1=this.C1(this.g1),n=this.f1.width,e=this.f1.height,this.l1.width=n,this.l1.height=e,(t=this.l1.getContext("2d")).clearRect(0,0,n,e),n=(this.w1.min.x-this.g1.min.x)/(this.g1.max.x-this.g1.min.x)*n,e=(this.g1.max.y-this.w1.max.y)/(this.g1.max.y-this.g1.min.y)*e,t.drawImage(this.E1,n,e,+this.E1.width,+this.E1.height))},G0:function(){this.Lt.position.y=this.nt,this.yr(p).enableUpdateRender()},N1:function(t,n,e){t={x:(t-e.min.x)/(e.max.x-e.min.x),y:(e.max.y-n)/(e.max.y-e.min.y)};return this.h1?(t.x=t.x*this.f1.width,t.y=t.y*this.f1.height):(t.x=t.x*this.S1.width,t.y=t.y*this.S1.height),t},V1:function(){var t,n;return st.a.environment===B.a.WX?[t=st.a.window.screenWidth/2.54,t]:(t=[],void 0!==window.screen.deviceXDPI?(t[0]=window.screen.deviceXDPI,t[1]=window.screen.deviceYDPI):((n=document.createElement("DIV")).style.cssText="width:1in;height:1in;position:absolute;left:0px;top:0px;z-index:99;visibility:hidden",document.body.appendChild(n),t[0]=parseInt(n.offsetWidth),t[1]=parseInt(n.offsetHeight),n.parentNode.removeChild(n)),t)},C1:function(t){var n,e=t.max.x-t.min.x,t=t.max.y-t.min.y,i=null;return this.h1?(i={width:Math.round(e),height:Math.round(t)},n=this.V1(),i.width=parseInt(i.width*n[0]/25.4),i.height=parseInt(i.height*n[1]/25.4),n=1,(i.width>=this.a1||i.height>=this.a1)&&(i.width>=i.height?(n=i.height/i.width,i.width=this.a1,i.height=parseInt(this.a1*n)):(n=i.width/i.height,i.height=this.a1,i.width=parseInt(this.a1*n)))):(n=this.z1(),i={width:Math.round(e/n),height:Math.round(t/n)}),i},H1:function(t){var n=St.floorPowerOfTwo(t.width),e=St.floorPowerOfTwo(t.height),i=(this.h1||(e<n?4096<n&&(i=n/4096,n=4096,e/=i):4096<e&&(i=e/4096,e=4096,n/=i)),void 0===this.m1&&(this.m1=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),this.m1.width=n,this.m1.height=e,this.m1.getContext("2d"));return void 0!==this.hm&&(i.fillStyle=this.hm,i.fillRect(0,0,n,e)),i.drawImage(t,0,0,n,e),this.m1},P1:function(t,n){for(var e=null,e=n||this.G,i=0;i<e.length;i++){var r,o=this.N1(e[i].x,e[i].y,t);if(!o)return!0;o.x=Math.round(o.x),o.y=Math.round(o.y),o.value=e[i].value,this.h1?(r=this.f1.width/this.g1.size.x,o.radius=this.ld*r):o.radius=this.ld,this.Lh.push(o)}},I1:function(t){this.G=[];for(var n=this._1.G.yi[0];this.G.length<t;){var e=Math.floor(this.g1.min.x+Math.random()*this.g1.size.x+1),i=Math.floor(this.g1.min.y+Math.random()*this.g1.size.y+1),r=this.s1.min+Math.floor(Math.random()*(this.s1.max-this.s1.min)+1);z.Te({x:e,y:i},n,n.length)&&this.G.push({x:e,y:i,value:r})}},T1:function(){this.Ph&&null!==this.G&&this.Jt&&this.L1()&&(this.Lh.length=0,this.R1(),this.update())},L1:function(){for(var t=!1,n=Array.from(this.gn.getRenderManager().getRenderList().keys()),e=this.Bm.parent,i=0;i<n.length;i++){var r=n[i].split("%A%B%C%D");if(""+r[0]==""+e.buildingID&&""+r[1]==""+this.Bm.level){t=!0;break}}return t},R1:function(){var t=this.D1();this.U1(t),this.S1=this.C1(this.w1),this.P1(this.w1,t),this.b1.gt.setDimensions(this.S1.width,this.S1.height)},U1:function(t){this.w1=new Fi;for(var n=null,e=null,i=null,r=null,o=this.z1()*this.ld,s=0;s<t.length;s++)(null===n||n>t[s].x)&&(n=t[s].x),(null===e||e>t[s].y)&&(e=t[s].y),(null===i||i<t[s].x)&&(i=t[s].x),(null===r||r<t[s].y)&&(r=t[s].y);this.w1.expandByCoords([{x:n-o,y:e-o},{x:n-o,y:r+o},{x:i+o,y:r+o},{x:i+o,y:e-o}])},D1:function(){for(var t=[],n=this.G,e=this.z1()*this.ld,i=0;i<n.length;i++)for(var r=M1.circleBuilder(e,n[i],32),o=0;o<r.length;o++)if(this.W1(r[o])){t.push(n[i]);break}return t},W1:function(t){var t=new Tt(t.x-this.gn.x,this.Bm.height,this.gn.y-t.y),n=this.gn.camera,t=t.applyMatrix4(n.matrixWorldInverse).applyMatrix4(n.projectionMatrix);return!(1<Math.abs(t.x)||1<Math.abs(t.y)||1<Math.abs(t.z))},z1:function(){var t={x:st.a.document.body.clientWidth/2,y:st.a.document.body.clientHeight/2,z:this.Bm.height+this.nt,buildingID:this.Bm.parent.buildingID},n={x:t.x+1,y:t.y,z:this.Bm.height+this.nt,buildingID:this.Bm.parent.buildingID},t=dr.coordsScreenToMap(this.gn,t),n=dr.coordsScreenToMap(this.gn,n),t=Math.sqrt((t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y));return this.gn.getZoom()<this.A1?76.43745851702988:t},j1:function(t){this.Lt&&this.Lt.parent&&(this.Lt.parent.remove(this.Lt),null!=(n=this.Lt.material.map)&&n.dispose(),this.Lt.geometry.dispose(),this.Lt.geometry=void 0,this.Lt.material.dispose(),this.Lt.material=void 0,this.Lt=void 0);var n=!1;t||(t=this.w1,n=!0);var e=new $a(new ma(t.size.x,t.size.y,1,1),void 0),t=(e.name="heatMap",e.position.y=this.nt,e.position.x=t.center.x-this.gn.x,e.position.z=-t.center.y+this.gn.y,e.rotation.set(-Math.PI/2,0,0,"XYZ"),this.X1());null!==this.O1&&(t.clippingPlanes=this.O1,t.clipping=!0),e.material=t,this.Lt=e,this.Lt.mapNode=this,n&&this.Pn.scene.add(this.Lt)},Y1:function(t){for(var n=[],e=[],i=0;i<t.length;i++)n.push({x:t[i].x,y:t[i].y});z.isClockwise(n[0],n[1],n[2])||(n=n.reverse());for(var r=0;r<n.length-1;r++){var o=n[r],s=n[r+1],a=(o.x+s.x)/2-this.gn.x,u=-(o.y+s.y)/2+this.gn.y,o=Gy(z.getAngle({p1:o,p2:s}),{x:a,y:0,z:u},this),s=new Gt,a=new Tt,u=new Tt;a.set(0,0,1).applyQuaternion(o.quaternion),u.copy(o.position),s.setFromNormalAndCoplanarPoint(a,u),e.push(s),o.parent.remove(o)}return e}}),Jd=tv;function oS(t){return(oS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function sS(t,n){var e,i,r,o,s="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(s)return i=!(e=!0),{s:function(){s=s.call(t)},n:function(){var t=s.next();return e=t.done,t},e:function(t){i=!0,r=t},f:function(){try{e||null==s.return||s.return()}finally{if(i)throw r}}};if(Array.isArray(t)||(s=function(t,n){var e;if(t)return"string"==typeof t?aS(t,n):"Map"===(e="Object"===(e=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?aS(t,n):void 0}(t))||n&&t&&"number"==typeof t.length)return s&&(t=s),o=0,{s:n=function(){},n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:n};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function aS(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function uS(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=oS(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=oS(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==oS(t)?t:String(t)}(i.key),i)}}function cS(t,n,e){n=dS(n);var i=t,n=hS()?Reflect.construct(n,e||[],dS(t).constructor):n.apply(t,e);if(n&&("object"===oS(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return fS(i)}function hS(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(hS=function(){return!!t})()}function fS(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function lS(){return(lS="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,n,e){var i=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=dS(t)););return t}(t,n);if(i)return(i=Object.getOwnPropertyDescriptor(i,n)).get?i.get.call(arguments.length<3?t:e):i.value}).apply(this,arguments)}function dS(t){return(dS=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function vS(t,n){return(vS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}$d=function(){var t,n=i,e=Ix;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");function i(t){var n;if(this instanceof i)return(n=cS(this,i,[t])).mi=E.DYNAMIC_MODEL_MARKER,n.pi=void 0!==t.id?t.id:St.generateUUID(),n.Q1=St.generateUUID(),n.Kl=void 0!==t.fadeIn&&t.fadeIn,n.tf=void 0!==t.fadeOut&&t.fadeOut,n.ft=void 0!==t.opacity?t.opacity:null,n.Z1=void 0!==t.scale?t.scale:1,n.q1=t.tilt,n.cf=t.url,n.qd=t.heading,n.Hn=t.callback,n.K1=new Map,n.K1.set(n.ROOT,t.color),n.vf=null,n.$f=[],n.e0=null,n.i0=null,n.Zl=n.Zl.bind(fS(n)),n;throw new TypeError("Cannot call a class as a function")}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&vS(n,e),n=i,(e=[{key:"FID",get:function(){return this.Q1}},{key:"color",get:function(){return this.getModelColor()},set:function(t){this.modifyModelColor(t)}},{key:"scale",get:function(){return this.Z1},set:function(t){this.Z1=t,this.zo()}},{key:"tilt",get:function(){return this.q1}},{key:"heading",get:function(){return this.qd}},{key:"opacity",get:function(){return this.ft},set:function(t){this.ft=t,this.lf()}},{key:"modifyModelColor",value:function(t,n){n=n||this.ROOT,this.K1.set(n,t),this.lf()}},{key:"getModelColor",value:function(t){return t=t||this.ROOT,this.K1.get(t)}},{key:"rotateTo",value:function(t){var n,e,i,r,o=this,s=this.yr(p);return!!s&&(n=t.heading%360*u.DEG2RAD,t.animate?(e=t.duration||.5,i=this.Lt.rotation.y,this.wi.has("rotation")?r=this.wi.get("rotation"):(r=new Rr,this.wi.set("rotation",r)),r.Wn([i]).Yn([n]).Qn(e).qn(function(t){o.Lt.rotation.y=t.destination[0],o.qd=t.destination[0]*u.RAD2DEG,s.enableUpdateRender()}).Kn(function(){o.Lt.rotation.y=n,o.qd=n*u.RAD2DEG,s.enableUpdateRender(),t.finish&&t.finish()}),s.$i.Zi(r.Vn())):(this.Lt.rotation.y=n,this.qd=t.heading,s.enableUpdateRender(),t.finish&&t.finish()),this.wi.get("rotation"))}},{key:"startAction",value:function(t,n){var e=this.$f[t],n=(e&&(n&&(e.clampWhenFinished=!0,e.loop=2200),this.e0&&this.e0===t?(e.time=this.i0,e.paused=!1,e.play(),this.e0=null,this.i0=null):(this.e0!==t&&(this.e0=null,this.i0=null),e.reset().setEffectiveTimeScale(1).setEffectiveWeight(1).play())),this.yr(p));n&&n.on("beforeRender",this.Zl)}},{key:"getAction",value:function(){return this.$f}},{key:"getClip",value:function(t){return this.$f[t].pf}},{key:"getMixer",value:function(){return this.vf}},{key:"stopAction",value:function(t){var n=this.yr(p),n=(n&&n.off("beforeRender",this.Zl),this.$f[t]);n&&(n.paused=!0,this.e0=t,this.i0=n.time)}},{key:"getActionNames",value:function(){return Object.keys(this.$f)}},{key:"remove",value:function(){this.stop(),this.Lt&&this.Lt.bloom&&this.Lt.bloom.remove(this);var t,n=this.yr(p);n&&this.vf&&n.$i.T0(this.vf),n&&(t=this.K1.get(this.ROOT),this.J1(this.Lt,t,function(t){n.Nt.no._u(t,t.material)})),lS(dS(i.prototype),"remove",this).call(this)}},{key:"dispose",value:function(){lS(dS(i.prototype),"dispose",this).call(this),this.remove(),this.Lt&&(this.Lt.mapNode=void 0,this.Lt=void 0),this.Ph=!1,this.ty()}},{key:"getRenderNode",value:function(){return this.Lt}}])&&uS(n.prototype,e),t&&uS(n,t),Object.defineProperty(n,"prototype",{writable:!1}),i}(),Object.assign($d.prototype,{ROOT:"root",qc:function(){var r,o=this;if(!this.Ph)return!!(r=this.yr(p))&&(this.Ph=!0,r.Nt.Uv.Ra(this.cf,function(t){if(o.Ph){if(o.Lt=t.scene,o.Lt.visible=o.Jt,o.qd&&(o.Lt.rotation.y=o.qd%360*u.DEG2RAD),o.q1&&(o.Lt.rotation.x=o.q1%360*u.DEG2RAD),o.zo(),(o.Lt.mapNode=o).Pn.Co.add(o.Lt),0<t.animations.length){o.vf=new kb(o.Lt);var n,e=sS(t.animations);try{for(e.s();!(n=e.n()).done;){var i=n.value;o.$f[i.name]=o.vf.clipAction(i)}}catch(t){e.e(t)}finally{e.f()}r.$i.g0(o.vf)}o.lf(),o.G0(),o.Kl&&o.nf({src:[0],dest:[1],duration:1}),r.enableUpdateRender(),o.Hn&&o.Hn(o)}},function(){}),!0)},nf:function(t){var n,i=this,r=this.yr(p);r&&(n=new Rr({src:t.src||[0],dest:t.dest||[1]}),this.wi.set("faceIn",n),n.Qn(t.duration||1).qn(function(t){var e=t.destination[0];i.Lt.traverse(function(t){var n;t instanceof $a&&(t.material.transparent=!0,n=t.material.userData.sourceOpacity,r.getMapOptions().materialMode===ls.REAL?t.material.uniforms.opacity.value=n*e:t.material.opacity=n*e,r.enableUpdateRender())})}).Kn(function(){t.callback&&t.callback(),r.$i.Ji(n),r.enableUpdateNode()}).Vn(),r.$i.Zi(n))},zo:function(){if(this.Lt){var t=this.yr(p);if(!t)return!1;this.Lt.scale.copy(this.Lt.userData.sourceScale).multiplyScalar(this.Z1),t.enableUpdateRender()}},lf:function(){var r,o,t,s=this;this.Lt&&(r=this.yr(p),o=this.yr(v),t=this.K1.get(this.ROOT),this.J1(this.Lt,t,function(t,n){var e=s.Jr(t.material,o,{color:n});if(r.Ai.materialMode===ls.REAL){n=r.Nt.no.$r(e);n.userData=t.material.userData,t.material=n,r.Nt.no.gu(t,n)}else if(Array.isArray(t.material.length))for(var i=0;i<t.material.length;i++)t.material[i].depthWrite=!0,t.material[i]=r.Nt.no.eo(t.material[i],e);else t.material.depthWrite=!0,t.material=r.Nt.no.eo(t.material,e)}),r.enableUpdateRender())},J1:function(t,n,e){var i=this.K1.get(t.name);if(i&&(n=i),"Mesh"===t.type||"SkinnedMesh"===t.type)e(t,n);else for(var r=0;r<t.children.length;r++)this.J1(t.children[r],n,e)},Jr:function(t,n,e){var i={};return this.yr(p).Ai.materialMode===ls.REAL?t.constructor===W0?(t.userData.sourceOpacity=t.opacity,t.userData.sourceTransparent=t.transparent,i={color:t.color.getHex(),USE_EMISSIVEMAP:!!t.emissiveMap,USE_METALNESSMAP:!!t.metalnessMap,USE_NORMALMAP:!!t.normalMap,TANGENTSPACE_NORMALMAP:!!t.normalMap,USE_ROUGHNESSMAP:!!t.roughnessMap,USE_MAP:!!t.map,USE_AOMAP:!!t.aoMap,map:r(t.map,null),aoMap:r(t.aoMap,null),emissive:t.emissive.getHex(),emissiveMap:r(t.emissiveMap,null),metalness:r(t.metalness,0),metalnessMap:r(t.metalnessMap,null),roughness:r(t.roughness,1),roughnessMap:r(t.roughnessMap,null),normalScale:r(t.normalScale,new Mt(1,1)),normalMap:r(t.normalMap,null),vertexColors:t.vertexColors,side:t.side,skinning:t.skinning}):t.constructor===_0&&(i={USE_EMISSIVEMAP:t.defines.USE_EMISSIVEMAP,USE_MAP:t.defines.USE_MAP,USE_AOMAP:t.defines.USE_AOMAP,USE_METALNESSMAP:t.defines.USE_METALNESSMAP,USE_NORMALMAP:t.defines.USE_NORMALMAP,TANGENTSPACE_NORMALMAP:t.defines.TANGENTSPACE_NORMALMAP,USE_ROUGHNESSMAP:t.defines.USE_ROUGHNESSMAP,aoMap:r(t.uniforms.aoMap.value,null),map:r(t.uniforms.map.value,null),color:t.uniforms.diffuse.value.getHex(),emissive:t.uniforms.emissive.value.getHex(),emissiveMap:r(t.uniforms.emissiveMap.value,null),metalness:r(t.uniforms.metalness.value,0),metalnessMap:r(t.uniforms.metalnessMap.value,null),roughness:r(t.uniforms.roughness.value,1),roughnessMap:r(t.uniforms.roughnessMap.value,null),normalScale:r(t.uniforms.normalScale.value,new Mt(1,1)),normalMap:r(t.uniforms.normalMap.value,null),vertexColors:t.vertexColors,side:t.side,skinning:t.skinning}):(void 0===t.userData.sourceOpacity&&(t.userData.sourceOpacity=t.opacity),void 0===t.userData.sourceTransparent&&(t.userData.sourceTransparent=t.transparent)),e.color&&(i.color=e.color),i.opacity=null!==this.ft?this.ft*n.ft:void 0!==t.userData.sourceOpacity?t.userData.sourceOpacity*n.ft:t.opacity*n.ft,i.transparent=t.userData.sourceTransparent||i.opacity<1,i;function r(t,n){return void 0!==t?t:n}},Zl:function(){var t=this.yr(p);t&&t.enableUpdateRender()},ny:function(t){if(t._interpolant&&(t._interpolant.length=0),t.bf){for(var n=0;n<t.bf.length;n++)t.bf[n].parameterPositions=null,t.bf[n].resultBuffer=null,t.bf[n].sampleValues=null,t.bf[n]=null;t.bf=null}if(t.gf){for(var e=0;e<t.gf.length;e++)t.gf[e].binding=null,t.gf[e].buffer=null,t.gf[e]=null;t.gf=null}if(t.pf&&t.pf.tracks&&t.pf.tracks){for(var i=0;i<t.pf.tracks.length;i++)t.pf.tracks[i].times=null,t.pf.tracks[i].values=null,t.pf.tracks[i]=null;t.pf.tracks=null,t.pf=null}},ty:function(){for(var t in this.$f)this.ny(this.$f[t]),this.$f[t]=null;if(this.$f=[],this.vf){for(var n=0;n<this.vf.mc.length;n++)this.vf.mc[n].buffer=null;this.vf.mc=null,this.vf.zf=null,this.vf.us=null,this.vf.stats=null,this.vf.Yf=null,this.vf.$f=null,this.vf=null}}}),e=$d;function pS(t){return(pS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function mS(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=pS(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=pS(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==pS(t)?t:String(t)}(i.key),i)}}function yS(t,n,e){n=gS(n);var i=t,n=bS()?Reflect.construct(n,e||[],gS(t).constructor):n.apply(t,e);if(n&&("object"===pS(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return _S(i)}function bS(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(bS=function(){return!!t})()}function gS(t){return(gS=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function _S(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function wS(t,n){return(wS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}jy=function(){var t,n=i,e=Ix;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");function i(t){var n;if(this instanceof i)return(n=yS(this,i,[t])).pi=null,n.mi=E.DOM_MARKER,n.ey=void 0!==t.fontsize?t.fontsize:16,n.iy=t.content,n.oy=t.domWidth,n.sy=t.domHeight,n.Qm=void 0!==t.anchor?t.anchor:pr.CENTER,n.ft=void 0!==t.opacity?t.opacity:1,n.Zo=void 0!==t.collision&&t.collision,n.wm=!1,n.Lt=null,n.Ph=!1,n.Or=null,n.V0=null,n.Bm=null,n.uy=null,n.hy=n.hy.bind(_S(n)),n.Bh=null,n.qc(),n;throw new TypeError("Cannot call a class as a function")}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&wS(n,e),n=i,(e=[{key:"isInputElement",get:function(){for(var t=["input","textarea"],n=!1,e=0;e<t.length;e++)if(0<=this.Lt.element.childNodes[0].innerHTML.toLocaleLowerCase().indexOf(t[e])){n=!0;break}return n}},{key:"content",get:function(){return this.iy},set:function(t){this.iy=t,"string"==typeof this.iy?this.Lt.element.childNodes[0].innerHTML=""+this.iy:this.Lt.element.childNodes[0].appendChild(this.iy)}},{key:"visible",get:function(){return this.Jt},set:function(t){this.Jt=t,this.Lt&&(this.Jt?this.Lt.element.childNodes[0].style.display="block":this.Lt.element.childNodes[0].style.display="none")}},{key:"opacity",get:function(){return this.ft},set:function(t){this.ft=t,this.Lt.element.childNodes[0].style.opacity=this.ft}},{key:"level",get:function(){return this.Or}},{key:"remove",value:function(){this.stop(),this.isInputElement&&(this.Bm.Pn.Pn.getInteracations().controls.enabled=!0),this.Bh.remove(this),this.Pn&&this.Pn.remove(this),this.Lt.parent.remove(this.Lt),this.Pn=void 0}},{key:"addTo",value:function(t){var n,e=t.Pn.Pn,i=(null===e.en.gt&&e.en.qc(),this.Or=t.level,this.Bm=t,this.V0=t.parent.buildingID,this.Lt.position.set(this.wt-e.x,t.height+this.nt,-this.xt+e.y),e.getBuilding(""+t.parent.buildingID));t.level!==i.level&&(e.en.Pl(this.Or,""+t.parent.buildingID)?this.Lt.element.childNodes[0].style.opacity=t.ft:this.Lt.element.childNodes[0].style.display="none"),e.en.add(this),this.Bh=t.getOrCreateLayer(this.mi),this.Bh.add(this),this.isInputElement&&(n=null,this.ly=function(){n=e.getInteracations().controls.enabled,e.getInteracations().controls.enabled=!1,e.getInteracations().controls.resetState()},this.vy=function(){null!==n&&(e.getInteracations().controls.enabled=n,e.getInteracations().controls.resetState(),n=null)},this.Lt.element.childNodes[0].addEventListener("mouseenter",this.ly),this.Lt.element.childNodes[0].addEventListener("mouseleave",this.vy))}},{key:"dispose",value:function(){this.remove(),this.Lt&&(this.isInputElement&&(this.Lt.element.childNodes[0].removeEventListener("mouseenter",this.ly),this.Lt.element.childNodes[0].removeEventListener("mouseleave",this.vy)),this.Lt.mapNode=void 0,this.Lt=void 0),this.Ph=!1}},{key:"getRenderNode",value:function(){return this.Lt}}])&&mS(n.prototype,e),t&&mS(n,t),Object.defineProperty(n,"prototype",{writable:!1}),i}(),Object.assign(jy.prototype,{qc:function(){var t=document.createElement("div"),n=document.createElement("div"),e=(n.style.position="absolute",!(n.style.pointerEvents="all")),i=(void 0===this.oy||void 0===this.sy?e=!0:(n.style.width=this.oy+"px",n.style.height=this.sy+"px"),n.style.fontSize=this.ey+"px",n.style.opacity=this.ft,e||(i=this.py(),n.style.top=i.top,n.style.left=i.left),"string"==typeof this.iy?n.innerHTML=this.iy:n.appendChild(this.iy),t.appendChild(n),new hx(t));return this.Lt=i,(this.Lt.mapNode=this).Ph=!0,this.pi=this.Lt.uuid,e&&this.bm(),!0},bm:function(){var e=this,i=null,r=document.createElement("div"),o=this.Lt.element.childNodes[0];r.style.position="absolute",void 0===this.oy?r.style.width="fit-content":r.style.width=this.oy+"px",void 0===this.sy?r.style.height="fit-content":r.style.height=this.sy+"px",r.style.fontSize=this.ey+"px",r.innerHTML=o.innerHTML,document.body.appendChild(r),function t(){{var n;r.parentNode?(null!==i&&clearTimeout(i),n=r.getBoundingClientRect(),e.oy=n.width,e.sy=n.height,n=e.py(),o.style.width=e.oy+"px",o.style.height=e.sy+"px",o.style.top=n.top,o.style.left=n.left,r.parentNode.removeChild(r)):i=setTimeout(t(),1)}}()},py:function(){var t,n;switch(this.Qm){case pr.CENTER:t=-this.oy/2,n=-this.sy/2;break;case pr.RIGHT_BOTTOM:t=-this.oy,n=-this.sy;break;case pr.LEFT_BOTTOM:t=0,n=-this.sy;break;case pr.RIGHT_TOP:t=-this.oy,n=0;break;case pr.LEFT_TOP:n=t=0;break;case pr.RIGHT:t=-this.oy,n=-this.sy/2;break;case pr.LEFT:t=0,n=-this.sy/2;break;case pr.BOTTOM:t=-this.oy/2,n=-this.sy;break;case pr.TOP:t=-this.oy/2,n=0}return this.uy={left:t,top:n},{left:t+"px",top:n+"px"}},_m:function(){var t=this.Pn.Pn;if(!this.uy)return null;var n=t.camera;this.Lt.updateMatrixWorld(!0);var n=(new Tt).setFromMatrixPosition(this.Lt.matrixWorld).applyMatrix4(n.matrixWorldInverse).applyMatrix4(n.projectionMatrix),e=t.jt.renderer.domElement.clientWidth,t=t.jt.renderer.domElement.clientHeight,i=n.x,n=n.y;return{leftTop:new Mt(i-this.oy/e,n+this.sy/t),rightDown:new Mt(i+this.oy/e,n-this.sy/t)}},hy:function(t){var n,e=this.Pn.Pn,i={};for(n in t)i[n]=t[n];i.offsetX=t.clientX,i.offsetY=t.clientY,e.Dr.Hn(i)},lf:function(){this.Lt.element.childNodes[0].style.opacity=this.Bm.ft}}),Zy=jy;function xS(t){return(xS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ES(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=xS(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=xS(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==xS(t)?t:String(t)}(i.key),i)}}fb=function(){function n(t){if(!(this instanceof n))throw new TypeError("Cannot call a class as a function");this.my=t.origon,this.zh=t.target,this.yy=null,this.by=null,this.gy=null,this._y=null,this.wy=null,this.xy=null,this.Ey=null,this.Sy=null,this.qc()}var t,e,i;return t=n,(e=[{key:"transform",value:function(t){var n=t.x-this.yy.x,t=t.y-this.yy.y,e=this.by.x*n+this.by.y*t,n=this.gy.x*n+this.gy.y*t,t=e/this._y.x,e=n/this._y.y,n=t*this.Sy.x,t=e*this.Sy.y;return{x:this.wy.x+this.xy.x*n+this.Ey.x*t,y:this.wy.y+this.xy.y*n+this.Ey.y*t}}}])&&ES(t.prototype,e),i&&ES(t,i),Object.defineProperty(t,"prototype",{writable:!1}),n}(),Object.assign(fb.prototype,{qc:function(){!Array.isArray(this.my)||!Array.isArray(this.zh)||this.my.length<3||this.zh.length<3||(this.yy=this.my[0],this.by={x:this.my[1].x-this.my[0].x,y:this.my[1].y-this.my[0].y},this.gy={x:this.my[2].x-this.my[0].x,y:this.my[2].y-this.my[0].y},this._y={x:z.Xe(this.by),y:z.Xe(this.gy)},this.wy=this.zh[0],this.xy={x:this.zh[1].x-this.zh[0].x,y:this.zh[1].y-this.zh[0].y},this.Ey={x:this.zh[2].x-this.zh[0].x,y:this.zh[2].y-this.zh[0].y},this.Sy={x:z.Xe(this.xy),y:z.Xe(this.Ey)},this.by.x/=this._y.x,this.by.y/=this._y.x,this.gy.x/=this._y.y,this.gy.y/=this._y.y,this.xy.x/=this.Sy.x,this.xy.y/=this.Sy.x,this.Ey.x/=this.Sy.y,this.Ey.y/=this.Sy.y)}}),c2=fb;function SS(t){return(SS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function TS(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=SS(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=SS(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==SS(t)?t:String(t)}(i.key),i)}}var E2=function(){function n(t){if(!(this instanceof n))throw new TypeError("Cannot call a class as a function");this.Lh=t.points,this.n1=t.extrudeHeight,this.nt=t.height,this.Ty=t.types,void 0===this.Ty&&(this.Ty=[E.EXTENT_LAYER,E.FACILITY_LAYER,E.LABEL_LAYER,E.MODEL_LAYER,E.EXTERNAL_MODEL_LAYER]),this.Kr=t.showRegion,void 0===this.Kr&&(this.Kr="inside"),this.Bm=null,this.gn=null,this.ai=new Fi,this.Ay=[],this.Yl=void 0,this.ft=void 0}var t,e,i;return t=n,(e=[{key:"points",get:function(){return this.Lh},set:function(t){this.Lh=t,this.remove(),this.addTo(this.Bm)}},{key:"types",get:function(){return this.Ty}},{key:"showRegion",get:function(){return this.Kr},set:function(t){this.Kr=t,this.remove(),this.addTo(this.Bm)}},{key:"addTo",value:function(t){this.ai.reset(),this.ai.expandByCoords(this.Lh),this.Bm=t,this.gn=t.parent.parent,this.gn.getRenderManager().renderer.localClippingEnabled=!0,this.qc()}},{key:"remove",value:function(){for(var o=this,t=function(){for(var r=o.Bm.getLayers(o.Ty[s])[0],t=0;t<r.children.length;t++)!function(e){if(""+o.Ty[s]==""+E.FACILITY_LAYER||""+o.Ty[s]==""+E.LABEL_LAYER)r.children[e].visible=!0;else if(""+o.Ty[s]==""+E.EXTENT_LAYER||""+o.Ty[s]==""+E.MODEL_LAYER){if(""+o.Ty[s]==""+E.MODEL_LAYER&&(r.children[e].Zr=null,r.children[e].Kr=null,r.children[e].n0=!1),r.children[e].visible=!0,r.children[e].Lt){var t=r.children[e].Lt.material.clone();if(t.clippingPlanes=null,t.clipping=null,t.clipIntersection=!1,r.children[e].Lt.material.dispose(),r.children[e].Lt.material=t,""+o.Ty[s]==""+E.MODEL_LAYER)if(r.children[e].io.top&&((t=r.children[e].io.top).material.clippingPlanes=null,t.material.clipping=null,t.material.clipIntersection=!1),r.children[e].lh){var n=r.children[e].lh;n.material.clippingPlanes=null,n.material.clipping=null,n.material.clipIntersection=!1;for(var i=0;i<n.children.length;i++)n.children[i].material.clippingPlanes=null,n.children[i].material.clipping=null,n.children[i].material.clipIntersection=!1}}}else""+o.Ty[s]==""+E.EXTERNAL_MODEL_LAYER&&(r.children[e].visible=!0,r.children[e].Zr=null,r.children[e].Kr=null,r.children[e].t0=null,r.children[e].n0=!1,r.children[e].Lt)&&r.children[e].pl&&r.children[e].Lt.traverse(function(t){var n;"Mesh"===t.type&&((n=r.children[e].qr(t.material)).clippingPlanes=null,n.clipping=null,n.clipIntersection=!1,t.material.dispose(),t.material=n,o.gn.enableUpdateNode())})}(t)},s=0;s<this.Ty.length;s++)t()}}])&&TS(t.prototype,e),i&&TS(t,i),Object.defineProperty(t,"prototype",{writable:!1}),n}(),N2=(Object.assign(E2.prototype,{qc:function(){z.qe(this.Lh[0],this.Lh[1],this.Lh[2])||(this.Lh=this.Lh.reverse());for(var t=this.Bm.getLayers(),n=0;n<t.length;n++)this.Pl(t[n].type)&&this.My(t[n].children,t[n].type)},Pl:function(t){for(var n=!1,e=0;e<this.Ty.length;e++)if(""+t==""+this.Ty[e]){n=!0;break}return n},Oy:function(t){var n=t.getBound();return{yi:[[{x:n.minX,y:n.minY},{x:n.minX,y:n.maxY},{x:n.maxX,y:n.maxY},{x:n.maxX,y:n.minY},{x:n.minX,y:n.minY}]],getBound:function(){return{min:{x:n.minX,y:n.minY},max:{x:n.maxX,y:n.maxY}}}}},My:function(t,n){if(n===E.FACILITY_LAYER||n===E.LABEL_LAYER)for(var e=0;e<t.length;e++)"inside"===this.Kr?z.Te({x:t[e].x,y:t[e].y},this.Lh,this.Lh.length)?t[e].visible=!0:t[e].visible=!1:z.Te({x:t[e].x,y:t[e].y},this.Lh,this.Lh.length)?t[e].visible=!1:t[e].visible=!0;else if(n===E.MODEL_LAYER||n===E.EXTENT_LAYER||n===E.EXTERNAL_MODEL_LAYER){for(var i=0;i<t.length;i++){var r=null;if(n===E.MODEL_LAYER||n===E.EXTENT_LAYER)"inside"===this.Kr?t[i].visible=!1:t[i].visible=!0,r=t[i].G;else{if(!t[i].Lt){t[i].t0=this;continue}"inside"===this.Kr?t[i].visible=!1:t[i].visible=!0,r=this.Oy(t[i])}"all"===(r=this.fi(r)).result?void 0===this.nt?"inside"===this.Kr?t[i].visible=!0:t[i].visible=!1:(t[i].visible=!0,"outside"===this.Kr&&this.Ly(t[i],null)):"include"===r.result?(t[i].visible=!0,this.Ay.push({model:t[i],lines:r.points})):"no"===r.result&&(void 0===this.nt?"inside"===this.Kr&&(t[i].visible=!1):(t[i].visible=!0,"inside"===this.Kr&&this.Ly(t[i],null)))}this.Ry()}},_0:function(t){var n=null,e=this.Oy(t),e=this.fi(e);"all"===e.result?void 0===this.nt?"inside"===this.Kr?t.visible=!0:t.visible=!1:(t.visible=!0,"outside"===this.Kr&&this.Ly(t,null)):"include"===e.result?(t.visible=!0,n={model:t,lines:e.points}):"no"===e.result&&(void 0===this.nt?"inside"===this.Kr&&(t.visible=!1):(t.visible=!0,"inside"===this.Kr&&this.Ly(t,null))),this.Ry(n)},Ry:function(t){if(t)this.Ly(t.model,t.lines);else for(var n=0;n<this.Ay.length;n++)this.Ly(this.Ay[n].model,this.Ay[n].lines)},Ly:function(l,d){var v=this,i=function(){var t=[];if(null!==d)for(var n=0;n<d.length;n++){var e,i=(d[n].p1.x+d[n].p2.x)/2-v.gn.x,r=-(d[n].p1.y+d[n].p2.y)/2+v.gn.y,o=z.getAngle(d[n]);null!==o&&(o=Gy(o,{x:i,y:0,z:r},l),i=new Gt,r=new Tt,e=new Tt,r.set(0,0,1).applyQuaternion(o.quaternion),e.copy(o.position),i.setFromNormalAndCoplanarPoint(r,e),t.push(i),o.parent.remove(o),"outside"===v.Kr)&&i.negate()}else if(l.parent.type!==E.EXTENT_LAYER){var s=[v.nt];void 0!==v.n1&&s.push(v.nt+v.n1);for(var a=0;a<s.length;a++){var u=l.x-v.gn.x,c=-l.y+v.gn.y,u=Gy(void 0,{x:u,y:s[a],z:c},l),c=(void 0===v.n1?u.rotation.x=-Math.PI/2:u.rotation.x=0===a?-Math.PI/2:Math.PI/2,new Gt),h=new Tt,f=new Tt;h.set(0,0,1).applyQuaternion(u.quaternion),f.copy(u.position),f.y=f.y+v.Bm.height,c.setFromNormalAndCoplanarPoint(h,f),t.push(c),u.parent.remove(u),void 0!==v.n1&&c.negate()}}return t}();if(l.Zr=i,l.Kr=this.Kr,null===d&&void 0!==this.nt&&void 0!==this.n1&&(l.n0=!0),l.Lt)if(l.parent.type===E.MODEL_LAYER||l.parent.type===E.EXTENT_LAYER){if(n(l.Lt),l.parent.type===E.MODEL_LAYER&&(l.io.top&&n(l.io.top),l.lh)){n(l.lh);for(var t=0;t<l.lh.children.length;t++)n(l.lh.children[t])}}else l.pl&&l.Lt.traverse(function(t){"Mesh"===t.type&&n(t,l)});function n(t,n){var e=null;(e=n?n.qr(t.material):t.material.clone()).clippingPlanes=i,e.clipping=!0,"outside"===v.Kr&&null!==d&&(e.clipIntersection=!0),null===d&&void 0!==v.nt&&void 0!==v.n1&&(e.clipIntersection=!0),t.material.dispose(),t.material=e,v.gn.enableUpdateNode()}},fi:function(t){var n=t.getBound();if(!z._e(this.ai.X,this.ai.H,n.min,n.max))return{result:"no"};for(var e=t.yi,i=!0,r=0;r<e.length;r++){for(var o=e[r],s=0;s<o.length;s++)if(!z.Te(o[s],this.Lh,this.Lh.length)){i=!1;break}if(!i)break}if(i)return{result:"all"};for(var a=[],u=!0,c=0;c<this.Lh.length;c++)for(var h=0,f=e.length;h<f;h++)z.Te(this.Lh[c],e[h],e[h].length-1)?0===c?a.push({p1:this.Lh[c],p2:this.Lh[c+1]}):a.push({p1:this.Lh[c-1],p2:this.Lh[c]}):u=!1;if(u)return a.push({p1:this.Lh[this.Lh.length-1],p2:this.Lh[0]}),{result:"include",points:a};for(var l=this.Lh.length-1,d=0;d<l;d++)for(var v=this.Lh[d],p=this.Lh[d+1],m=0,y=e.length;m<y;m++)for(var b=0,g=e[m].length-1;b<g;b++){var _=e[m][b],w=e[m][b+1];if(z.we(v,p,_,w)){R(v,p)&&a.push({p1:v,p2:p});break}}for(var x=this.Lh[this.Lh.length-1],E=this.Lh[0],S=0,T=e.length;S<T;S++)for(var A=0,M=e[S].length-1;A<M;A++){var O=e[S][A],L=e[S][A+1];if(z.we(x,E,O,L)){R(x,E)&&a.push({p1:x,p2:E});break}}return 0===a.length?{result:"no"}:{result:"include",points:a};function R(t,n){for(var e=!0,i=0;i<a.length;i++)if(t.x===a[i].p1.x&&t.y===a[i].p1.y&&n.x===a[i].p2.x&&n.y===a[i].p2.y){e=!1;break}return e}}}),E2),AS={Default:1,Legacy:2,Classic:4,Custom:8};function MS(t){return(MS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function OS(t,n,e){return(n=RS(n))in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function LS(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,RS(i.key),i)}}function RS(t){t=function(t,n){if("object"!=MS(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=MS(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==MS(t)?t:String(t)}i=function(){function e(t,n){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");this.Ny=t,this.Py=n,this.Fy=OS(OS(OS({},AS.Default,{FMExtentLayer:[{name:"DirectionalLight",color:11579568,intensity:.95,position:{x:58,y:65,z:40},id:0},{name:"AmbientLight",color:11579568,intensity:.85,id:1},{name:"DirectionalLight",color:6447714,intensity:.65,position:{x:-100,y:0,z:45},id:2}],FMDynamicModelLayer:[{name:"DirectionalLight",color:11579568,intensity:.95,position:{x:58,y:65,z:45},id:0},{name:"AmbientLight",color:11579568,intensity:.85,id:1},{name:"DirectionalLight",color:6447714,position:{x:-100,y:0,z:45},intensity:.45,id:2}],FMModelLayer:[{name:"DirectionalLight",color:11645361,intensity:.95,position:{x:58,y:65,z:40},id:0},{name:"AmbientLight",color:11645361,intensity:.85,id:1},{name:"DirectionalLight",color:6513507,position:{x:-100,y:0,z:45},intensity:.65,id:2}],FMExternalModelLayer:[{name:"DirectionalLight",color:11579568,intensity:.95,position:{x:58,y:65,z:45},id:0},{name:"AmbientLight",color:11579568,intensity:.85,id:1},{name:"DirectionalLight",color:6447714,position:{x:-100,y:0,z:45},intensity:.45,id:2}]}),AS.Legacy,{FMExtentLayer:[{name:"DirectionalLight",color:8947848,intensity:1.2,position:{x:-1,y:1,z:1},id:0},{name:"AmbientLight",color:7631988,intensity:1,id:1},{name:"DirectionalLight",color:3355443,intensity:1,position:{x:-.5,y:1,z:-1},id:2}],FMExternalModelLayer:[{name:"DirectionalLight",color:8947848,intensity:1.2,position:{x:-1,y:1,z:1},id:0},{name:"AmbientLight",color:16777215,intensity:.46,id:1},{name:"DirectionalLight",color:3355443,position:{x:-.5,y:1,z:-1},intensity:1,id:2}],FMModelLayer:[{name:"DirectionalLight",color:8947848,intensity:1.2,position:{x:-1,y:1,z:1},id:0},{name:"AmbientLight",color:7631988,intensity:1,id:1},{name:"DirectionalLight",color:3355443,position:{x:-.5,y:1,z:-1},intensity:1,id:2}],FMDynamicModelLayer:[{name:"DirectionalLight",color:8947848,intensity:1.2,position:{x:-1,y:1,z:1},id:0},{name:"AmbientLight",color:7631988,intensity:1,id:1},{name:"DirectionalLight",color:3355443,position:{x:-.5,y:1,z:-1},intensity:1,id:2}]}),AS.Classic,{FMExtentLayer:[{name:"DirectionalLight",color:8947848,intensity:1.2,position:{x:-1,y:1,z:1},id:0},{name:"AmbientLight",color:7631988,intensity:1,id:1},{name:"DirectionalLight",color:3355443,intensity:1,position:{x:-.5,y:1,z:-1},id:2}],FMExternalModelLayer:[{name:"DirectionalLight",color:8947848,intensity:1.2,position:{x:-1,y:1,z:1},id:0},{name:"AmbientLight",color:16777215,intensity:.46,id:1},{name:"DirectionalLight",color:3355443,position:{x:-.5,y:1,z:-1},intensity:1,id:2}],FMModelLayer:[{name:"DirectionalLight",color:8947848,intensity:1.2,position:{x:-1,y:1,z:1},id:0},{name:"AmbientLight",color:7631988,intensity:1,id:1},{name:"DirectionalLight",color:3355443,position:{x:-.5,y:1,z:-1},intensity:1,id:2}],FMDynamicModelLayer:[{name:"DirectionalLight",color:8947848,intensity:.9,position:{x:-1,y:1,z:1},id:0},{name:"AmbientLight",color:16777215,intensity:.33,id:1},{name:"DirectionalLight",color:3355443,position:{x:-.5,y:1,z:-1},intensity:1,id:2}]})}var t,n,i;return t=e,(n=[{key:"getConfig",value:function(){return this.Ny==AS.Custom?this.Py:this.Fy[this.Ny]}}])&&LS(t.prototype,n),i&&LS(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();function NS(t){return(NS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function PS(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=NS(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=NS(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==NS(t)?t:String(t)}(i.key),i)}}Gw=function(){function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this.gn=null,this.It={},this.jn=(new Date).getTime(),this.Gn=this.Gn.bind(this)}var n,e,i;return n=t,(e=[{key:"replace",value:function(t,n,e){this.getTextureNames(t).indexOf(n)<0?console.warn(n+"不是一个包含视频或gif的纹理,无法替换"):(this.jy(t.FID,n),0<=e.indexOf(".mp4")||0<=e.indexOf(".webm")||0<=e.indexOf(".ogg")?this.Al(e,t,n):0<=e.indexOf(".gif")?this.yl(e,t,n):(0<=e.indexOf(".jpg")||0<=e.indexOf(".png"))&&this.Iy(e,t,n),t.multiMediaTool.replace(n),null===this.gn&&(this.gn=t.parent.parent.parent.parent,this.gn.on("update",this.Gn)))}},{key:"reset",value:function(t,n){this.jy(t.FID,n),t.multiMediaTool.reset(n)}},{key:"dispose",value:function(){for(var t in this.It){var n=t.split("_");this.reset(this.It[t].externalModel,n[1])}this.gn.off("update",this.Gn)}},{key:"getTextureNames",value:function(t){return t.multiMediaTool.textureNames}}])&&PS(n.prototype,e),i&&PS(n,i),Object.defineProperty(n,"prototype",{writable:!1}),t}(),Object.assign(Gw.prototype,{jy:function(t,n){var e=this.It[t+"_"+n];if(e&&"video"===e.type)document.getElementById(e.texture.video_id).parentNode.removeChild(document.getElementById(e.texture.video_id)),e.texture.dispose();else if(e&&"gif"===e.type)for(var i=0;i<e.canvasArray.length;i++)e.canvasArray[i].getContext("2d").clearRect(0,0,e.canvasArray[i].width,e.canvasArray[i].height);delete this.It[t+"_"+n]},Iy:function(t,n,e){var i=this,r=new Image;r.crossOrigin="Anonymous",r.onload=function(){var t=document.createElement("canvas");t.width=512,t.height=512,t.getContext("2d").drawImage(r,0,0,512,512),i.It[n.FID+"_"+e]={type:"gif",canvascount:0,externalModel:n,canvasArray:[t],isnewupdate:!0}},r.src=t},Al:function(t,i,r){var o=this,n=(this.Sl=t,null),e=document.createElement("div"),s=(e.style.display="none","xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var n=16*Math.random()|0;return("x"==t?n:3&n|8).toString(16)}));e.setAttribute("id",s+"_div"),e.innerHTML='<video id="'+s+'" loop crossOrigin="anonymous" muted><source src="'+t+'"></video>',document.body.appendChild(e),function t(){var e=document.getElementById(s);e?(null!==n&&clearTimeout(n),e.addEventListener("loadeddata",function(t){var n=new Xb(e);n.video_id=s+"_div",n.name=r,i.isGltf&&(n.flipY=!1),o.It[i.FID+"_"+r]={type:"video",externalModel:i,texture:n,isnewupdate:!0},e.play()})):n=setTimeout(t,0)}()},yl:function(t,n,e){var i=this,r=document.createElement("div"),o=(r.style.display="none",document.body.appendChild(r),new Image);o.crossOrigin="Anonymous",o.onload=function(){i.It[n.FID+"_"+e]={type:"gif",canvascount:0,externalModel:n,canvasArray:[],isnewupdate:!0},r.appendChild(o);var t=new Ub.a({gif:o});t.load(function(){i.bl(t,n.FID,e,r)})},o.src=t},bl:function(e,i,r,o){var s=this,a=null,u=e.get_length(),c=1;this.It[i+"_"+r].canvascount=0,function t(){{var n;u<c?(document.body.removeChild(o),null!==a&&clearTimeout(a)):(e.move_to(c),(n=document.createElement("canvas")).width=512,n.height=512,n.getContext("2d").drawImage(e.get_canvas(),0,0,512,512),s.It[i+"_"+r].canvasArray.push(n),c++,a=setTimeout(t,0))}}()},Cy:function(a){var r=this,t=a.getRenderNode();function n(t){var n=a.multiMediaTool.oldMaterial[t.name];if(Array.isArray(n))for(var e=0;e<n.length;e++){var i,r=u(t.material[e],n[e]);r&&(r.iscanvasinfo?(i=r.info,t.material[e].map.image=i.canvasArray[i.canvascount],t.material[e].map.needsUpdate=!0):(t.material[e].dispose(),t.material[e]=r))}else{var o,s=u(t.material,n);s&&(s.iscanvasinfo?(o=s.info,t.material.map.image=o.canvasArray[o.canvascount],t.material.map.needsUpdate=!0):(t.material.dispose(),t.material=s))}}function u(t,n){var e,i="",n=(n.uniforms&&n.uniforms.map&&n.uniforms.map.value?i=n.uniforms.map.value.name:n.map&&(i=""+n.map.name).indexOf(".gif")<0&&i.indexOf(".mp4")<0&&i.indexOf(".webm")<0&&i.indexOf(".ogg")<0&&(i=""+n.name),r.It[a.FID+"_"+i]);return n?"video"===n.type?!t.isupdate||n.isnewupdate?(n.isnewupdate=!1,(e=new Ia({map:n.texture.clone()})).isBasic=!0,e.isupdate=!0,e.updatename=i,e):null:"gif"===n.type?n.canvasArray[n.canvascount]?!t.isupdate||n.isnewupdate?(n.isnewupdate=!1,e=new xh(n.canvasArray[n.canvascount]),a.isGltf&&(e.flipY=!1),e.repeat.set(1,1),e.name=i,e.magFilter=Qn,e.minFilter=1008,(t=new Ia({map:e})).updatename=i,t.isBasic=!0,t.isupdate=!0,t):{iscanvasinfo:!0,info:n}:null:void 0:null}t&&(a.isGltf?t.traverse(function(t){"Mesh"===t.type&&n(t)}):n(t))},Gn:function(){var t,n,e=(new Date).getTime(),i=e-this.jn,r=(50<=i&&(this.jn=e),[]);for(t in this.It)(function(t){for(var n=!0,e=0;e<r.length;e++)if(r[e].FID===t){n=!1;break}return n})(t.split("_")[0])&&this.It[t]&&r.push(this.It[t].externalModel),"gif"===this.It[t].type&&50<=i&&((n=this.It[t]).canvascount<n.canvasArray.length-1?n.canvascount++:n.canvascount=0);for(var o=0;o<r.length;o++)this.Cy(r[o])}}),Zw=Gw;function FS(t){return(FS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function jS(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=FS(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=FS(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==FS(t)?t:String(t)}(i.key),i)}}var IS=function(){function r(t,n,e,i){if(!(this instanceof r))throw new TypeError("Cannot call a class as a function");this.x=t,this.y=n,this.width=e,this.height=i}var t,n,e;return t=r,(n=[{key:"contains",value:function(t){return t.x>=this.x&&t.y>=this.y&&t.x<this.x+this.width&&t.y<this.y+this.height}},{key:"intersects",value:function(t){return this.x<t.x+t.width&&this.x+this.width>t.x&&this.y<t.y+t.height&&this.y+this.height>t.y}}])&&jS(t.prototype,n),e&&jS(t,e),Object.defineProperty(t,"prototype",{writable:!1}),r}();function CS(t){return(CS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function DS(t,n){var e,i,r,o,s="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(s)return i=!(e=!0),{s:function(){s=s.call(t)},n:function(){var t=s.next();return e=t.done,t},e:function(t){i=!0,r=t},f:function(){try{e||null==s.return||s.return()}finally{if(i)throw r}}};if(Array.isArray(t)||(s=function(t,n){var e;if(t)return"string"==typeof t?kS(t,n):"Map"===(e="Object"===(e=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?kS(t,n):void 0}(t))||n&&t&&"number"==typeof t.length)return s&&(t=s),o=0,{s:n=function(){},n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:n};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function kS(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function US(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=CS(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=CS(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==CS(t)?t:String(t)}(i.key),i)}}var BS=function(){function c(t){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1,e=2<arguments.length&&void 0!==arguments[2]?arguments[2]:8,i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:0,r=this,o=c;if(!(r instanceof o))throw new TypeError("Cannot call a class as a function");this.bound=t,this.maxPoints=n,this.maxDepth=e,this.depth=i,this.points=[],this.nodes=[]}var t,n,e;return t=c,(n=[{key:"insert",value:function(t){if(this.bound.contains(t)){if(this.points.length<this.maxPoints||this.depth>=this.maxDepth)return this.points.push(t),!0;0===this.nodes.length&&this.split();var n,e=DS(this.nodes);try{for(e.s();!(n=e.n()).done;)if(n.value.insert(t))return!0}catch(t){e.e(t)}finally{e.f()}}return!1}},{key:"split",value:function(){var t,n=this.bound.x,e=this.bound.y,i=this.bound.width/2,r=this.bound.height/2,o=(this.nodes.push(new c(new IS(n,e,i,r),this.maxPoints,this.maxDepth,this.depth+1)),this.nodes.push(new c(new IS(n+i,e,i,r),this.maxPoints,this.maxDepth,this.depth+1)),this.nodes.push(new c(new IS(n,e+r,i,r),this.maxPoints,this.maxDepth,this.depth+1)),this.nodes.push(new c(new IS(n+i,e+r,i,r),this.maxPoints,this.maxDepth,this.depth+1)),DS(this.points));try{for(o.s();!(t=o.n()).done;){var s,a=t.value,u=DS(this.nodes);try{for(u.s();!(s=u.n()).done;)s.value.insert(a)}catch(t){u.e(t)}finally{u.f()}}}catch(t){o.e(t)}finally{o.f()}this.points=[]}},{key:"query",value:function(t){var n=[];if(this.bound.intersects(t)){var e,i=DS(this.points);try{for(i.s();!(e=i.n()).done;){var r=e.value;t.contains(r)&&n.push(r)}}catch(t){i.e(t)}finally{i.f()}var o,s=DS(this.nodes);try{for(s.s();!(o=s.n()).done;)var a=o.value,n=n.concat(a.query(t))}catch(t){s.e(t)}finally{s.f()}}return n}}])&&US(t.prototype,n),e&&US(t,e),Object.defineProperty(t,"prototype",{writable:!1}),c}();function GS(t){return(GS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function HS(t,n){var e,i,r,o,s="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(s)return i=!(e=!0),{s:function(){s=s.call(t)},n:function(){var t=s.next();return e=t.done,t},e:function(t){i=!0,r=t},f:function(){try{e||null==s.return||s.return()}finally{if(i)throw r}}};if(Array.isArray(t)||(s=function(t,n){var e;if(t)return"string"==typeof t?XS(t,n):"Map"===(e="Object"===(e=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?XS(t,n):void 0}(t))||n&&t&&"number"==typeof t.length)return s&&(t=s),o=0,{s:n=function(){},n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:n};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function XS(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function VS(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=GS(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=GS(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==GS(t)?t:String(t)}(i.key),i)}}var zS=function(){function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function")}var n,e,i;return n=t,(e=[{key:"scatterPoints",value:function(t,n){for(var e=n.min.x,i=n.min.y,r=n.max.x-n.min.x,n=n.max.y-n.min.y,e=new IS(e,i,r,n),o=new BS(e),s=0;s<t.length;s++)o.insert(t[s]);return o}},{key:"clusterPoints",value:function(t,n,e,i){var r=[];i&&t.sort(function(t,n){return n.weight-t.weight});for(var o=0;o<t.length;o++){var s=t[o];if(!s.clustered){s=(s=n.query(new IS(s.x-e/2,s.y-e/2,e,e))).filter(function(t){return!0!==t.clustered});if(0!=s.length){var a,u=HS(s);try{for(u.s();!(a=u.n()).done;)a.value.clustered=!0}catch(t){u.e(t)}finally{u.f()}r.push(s)}}}return r}},{key:"getClusterCenter",value:function(t){for(var n=1<arguments.length&&void 0!==arguments[1]&&arguments[1],e=[],i=0;i<t.length;i++){var r,o,s=t[i].length,a={};s<=0||(r=t[i][0].level,o=t[i][0].buildingID,(a=n?this.get_centroid(t[i],n):this.get_centroid(t[i])).level=r,a.buildingID=o,a.num=s,e.push(a))}return e}},{key:"get_centroid",value:function(t){var n=1<arguments.length&&void 0!==arguments[1]&&arguments[1],e={};if(0!=t.length){var i=0,r=0,o=0;if(n){for(var s=0;s<t.length;s++){var a=t[s];i+=a.x*a.weight,r+=a.y*a.weight,o+=a.weight}if(0==o)return e;i/=o,r/=o}else{for(var u=0;u<t.length;u++){var c=t[u];i+=c.x,r+=c.y}i/=t.length,r/=t.length}e={x:i,y:r}}return e}}])&&VS(n.prototype,e),i&&VS(n,i),Object.defineProperty(n,"prototype",{writable:!1}),t}();function WS(t,n){var e,i,r,o,s="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(s)return i=!(e=!0),{s:function(){s=s.call(t)},n:function(){var t=s.next();return e=t.done,t},e:function(t){i=!0,r=t},f:function(){try{e||null==s.return||s.return()}finally{if(i)throw r}}};if(Array.isArray(t)||(s=function(t,n){var e;if(t)return"string"==typeof t?YS(t,n):"Map"===(e="Object"===(e=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?YS(t,n):void 0}(t))||n&&t&&"number"==typeof t.length)return s&&(t=s),o=0,{s:n=function(){},n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:n};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function YS(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function QS(t){return(QS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ZS(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=QS(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=QS(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==QS(t)?t:String(t)}(i.key),i)}}var t=function(){function n(t){if(!(this instanceof n))throw new TypeError("Cannot call a class as a function");this.gn=t.map,this.Dy=t.gridSize,void 0===this.Dy&&(this.Dy=100),this.Lh=t.points,this.M1=t.maxZoom,void 0===this.M1&&(this.M1=20),this.ky=t.renderClusterMarker,this.Uy=t.renderMarker,this.iy=t.content,this.By=null,this.Gy=new zS,this.Hy=null,this.V0=t.buildingID,void 0===this.V0&&(this.V0=this.gn.getMapOptions().buildingID),this.Or=t.level,this.ai=null,this.T1=this.T1.bind(this),this.Gn=this.Gn.bind(this),this.Xy=[],this.Vy="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6QAACDFJREFUeF7Fmw2MXFUVx3/nzczOdrtt3LZaSYFEDdBqMFKgIUESqhVaxS4xYIJBRVZaMKxktYvT7XZ3ust+0G3aKrVAaJvYBqM0JkitfIjWmDUW6xeU+AFVI2CBCrSpbdmZ2feOuW936n5137vvvdk9yWQ+3vmf8z//e+/7uPeOMFW2Rc9DWYLwMeCjwAeBuUDtMIVTwNvAP4DDwJ+A52iS1ytJUSoZnIc1wylWIHwJ+Dgw3zLfm0A/ym5qeZLVUrLEB7pXToBNeiMO3wKuCmQRzuEgHvezRh4P5x7OK3kBNutH8NiKsCwcBUsv5VmUJprlRUvkhO7JCtCnDQgbgTlJkJskxnGUZpplZ9w8yQnQpx0I6+MSssIrnTRLmxVmjHMyAvTpduCuOERiYB+kWb4WFR9fgE3ag0cuKoFEcA69rJG1UWLFE6BHb8ch9jiMQnwcRvkyOdltGyu6AN26EIfngSrbpBXyH8DjMlrkrzbxowvQqz8HPmGTbAp8D5ATK07RBOjVepREb0gSE0e4kZz8OGw8ewEe0xRH+CNwadgkAX7l29tMQvEOU2QxeRkME89egPu0Hond+r8G9iH04/GaT9ThfNR/XvgscHUY8uf0EeppkSfCxIgiwE+BFWGCT+DzEg7NgeS6dSUefcDFkfIIT7BO6sNg7QTo0vkoLwGzwwQf43OYNDeQk1dCYXv1Qgb5ScShdpJBLiIvx4Jy2QnQqZ8DfhQUdILj/yTFlbSIed4Pb906F5dDwAfCg4Y9hZW0yr4gnJ0AHdoJtAYFHXdcWMF6ecoaZwCduhzlSWuseU5oD35OsBNgg5pLX6ixdZaw8Axtcr11ASMBHfo0ynWWMfbRLiuDMLYCmMufmdKysa/SHvOxdYM2ADtskgLP0y6BXO0EyKu5ZC2wIPIuKS5nvfzFAjPetVMX4fJ7YIZFnKPkJZCrnQDtehx4jwWJNxD/bGwmPKNbXmtRXgbebxHkBBukLsjfToA2fWt4Jjcobvn4URw+RF4GwgIm9GvULHX83bL3vUOHmFnnSc1WgH8BFwYFHXH8BIN8mO6YU9steh5p/mzZ+16lQwK52gnQqr8FrrQQwNziLqdDnrbCjHVu1eVgfSn8HfdJIFdbAX6I8nnLYrbRJY2WmNHu6/QB4G7LGHvpkkCudgKs1VYEczNkY2+hLKTH8i6wnCGv8yhiriLzbJICbXRLIFc7AVr0UyjPWBIx7nvoEbM6ZG853YNwqzVQuI5u+VkQzk6AnNYh/uUo8Ow6LrHSQq/0BBEadTynaxG6rTBDzv8hy8Xk5UQQ1k4AE22tPoryhaDAEx5XNjODdYGXxbxW8y5dCN+IlAe+R6/cFgZrL0BOl6EEdq1Jkv8B+DZpDtAlr47yu1fPR/x5xnuAxWEKOIfPNdwv/WHw9gKYqPfqr4BrwiSYxMc8Gr/gd9che+/wsrn98Bqd5Ck2SugJm6gCfBJ4NqYAlYE7XEGvmOeGUBZNABN6je4FbgqVZeqctrHJ7p4jugBmvHr+Tg6bh6NKSvEyBa7gATlpkyS6AEO94DOoP2833ebisIQ+MSdYK4sngEn1Td3or9VPpymNbJFtUSjEF8BkvUf34/DpKARiY5QdbJU7osZJRoAmnYOHWexYGJVIRFw/dSwNuwo0UY5kBBjqBZcI/rTVzIjF2MJe1xKL2S5v2AJH+icngIn6dV0uYFaOko07vsKCOixlq/wmTvEGmzjRVKPerlR204QIt7jfkR/ELb4iApigzt26WaEpCYJjYwhs9LaJ2X+YiCXeA8qspFEfRy0XUYJKUvbpd4MXO4LCVO4cMDLyKq1xMpgxavYFJ2F/82ZwOZvkdBLBzjZUksHGxbpLL0kJBxO4XS44cFVpu5gN1IlaxYZAmWX6Tr1WHQ7EYu1xk/uQRFmVDkxbcQH8k+KdmhOwmw77fx99yH1QKrYJc0oEMLVkVuv3FW4JbJLRDs8NPixJ7TafMPWUCUCjzs4UeVHhgpAiuE6KS4vbYy6sBiSbOgGA9CpdqvCLMAKo0uw9IpvC+MbxmVIB/KFwhz6mcPNkpBWOuAtYFOchJ6woUy9Ag16mwqQTFyrc6j4ij4YtIo7flAtgyKYbdD+cc/7ghcGdZheKaJzCwmKnS4CrxfwZagJzlPrCrnCbHMMWOZnftAhgCGUbtN8bsyNUlEPFXbIkicLCxpg+Ab6iN6gwah+fwPWFXRJl8TVsveP8KitAXh3eJoNLhjOk8UhRQ6rMoqrAL4FFw98PFYssYxbV/vczmJlelxoGSVFiLiXy4kWu9BzABAVQ4YvUkKamOstMz/MLyaiSQnAw7x7if3bQlMcxz+U2XNrMtIymaUwJ+93ynysVz0cJLoon5h1KjsPAQIHTDHKGPZyJe7KML8DNmmIW86tS1KnHzHKBfrGmAEPf2MjP5muKk54yS4ocRDjqZLjWc6jVQbJnG8tIZ+IYK382ccxvRhSH00WX4/yXN9krRiBriy1AdrVe5LoswKMgUPILDWMeUkpzrKpAHod/Fx12ZBze55cXxjz/OpnBIZtSXivslCNhYGN9YgvAKp2XcbmAFFWmu8tQ+7h+y08mxtBwMOM8jUvRfw8ygzE9QUmp4PjDwqVYKvEKu6NtwYkvgCFthkEtc7IZZqtSrUIWjypD0gghRoiRYpSHxVAxBf/8MCTEUO8xv5fNtPRw4b64DkVRCiIMFEqc5BTvRO3+JkUyAoxqORWaqOY0VZSoQsiYV9Z0V9NyptjM8AkR8EUyRMpd3whVwvVbV3ALZliZX8wrQ5GZFNnCQNyTX5ny/wAFqGhfpVfGKAAAAABJRU5ErkJggg==",this.qc(),this.Dt=new nx}var t,e,i;return t=n,(e=[{key:"dispose",value:function(){for(var t=0;t<this.Xy.length;t++)this.Xy[t].marker.remove(),delete this.Xy[t];this.Xy.length=0,this.zy(),this.Lh.length=0,this.Hy=void 0,this.gn.off("zoom",this.T1),this.gn.off("move",this.T1),this.gn.off("viewChanged",this.T1),this.gn.off("resize",this.T1)}},{key:"on",value:function(t,n){this.Dt.Kp(t,n)}}])&&ZS(t.prototype,e),i&&ZS(t,i),Object.defineProperty(t,"prototype",{writable:!1}),n}(),e2=(Object.assign(t.prototype,{qc:function(){this.ki().getLayers(fengmap.FMType.EXTENT_LAYER)[0]?(this.ai=this.ki().getLayers(fengmap.FMType.EXTENT_LAYER)[0].bound,this.Wy(),this.Yy(!0),this.gn.on("zoom",this.T1),this.gn.on("move",this.T1),this.gn.on("viewChanged",this.T1),this.gn.on("resize",this.T1)):this.gn.on("update",this.Gn)},Wy:function(){this.Hy=this.Gy.scatterPoints(this.Lh,this.ai)},Yy:function(t){if(this.gn.getZoom()<this.M1){for(var n=0;n<this.Lh.length&&this.Lh[n].clustered;n++)this.Lh[n].clustered=null;var e=this.Qy();t&&(this.By=this.Zy(this.qy(this.Lh,this.Hy,e))),null!==this.By&&(t=this.D1(this.By),this.Ky(t))}else{e=this.D1(this.Lh);this.Ky(e)}},D1:function(t){for(var n=[],e=0;e<t.length;e++)this.W1(t[e])&&n.push(t[e]);return n},Ky:function(i){var r=this;if(0===this.Xy.length)for(var t=0;t<i.length;t++)this.Jy(i[t]);else{for(var n=[],e=[],o=0;o<i.length;o++){var s,a=d(i[o]);null!==a&&((s=this.Xy[a]).marker.moveTo({x:i[o].x,y:i[o].y}),s.marker.getRenderNode().point=i[o],n.push(s),this.Xy.splice(a,1),e.push(o),this.ky)&&(a={marker:s.marker,count:i[o].num},this.ky(a))}i=v(e);for(var u=e.length=0;u<i.length&&0!==this.Xy.length;u++){var c,h=d(i[u],!0);null!==h&&((h=this.Xy.splice(h,1)[0]).marker.moveTo({x:i[u].x,y:i[u].y}),"multiple"===h.type?(h.marker.getRenderNode().point=i[u],h.num=i[u].num,this.ky?(h.marker.content="<div></div>",c={marker:h.marker,count:i[u].num},this.ky(c)):h.marker.content=this.$y(i[u].num)):this.Uy&&(c={x:i[u].x,y:i[u].y},this.Uy(c)),e.push(u),n.push(h))}i=v(e);for(var f=e.length=0;f<i.length;f++)this.Jy(i[f],n);for(var l=0;l<this.Xy.length;l++)this.Xy[l].marker.remove();this.Xy.length=0,this.Xy=n}function d(t,n){for(var e=null,i=0;i<r.Xy.length;i++)if(void 0===t.num||1===t.num){if("single"===r.Xy[i].type){e=i;break}}else if(n){if("multiple"===r.Xy[i].type){e=i;break}}else if(r.Xy[i].num===t.num){e=i;break}return e}function v(t){for(var n=[],e=0;e<i.length;e++)!function(t,n){for(var e=!0,i=0;i<t.length;i++)if(t[i]===n){e=!1;break}return e}(t,e)||n.push(i[e]);return n}},$y:function(t){return void 0===this.iy?'<div style="background: rgba(73,102,245,0.8);height: 50px;width: 50px;border: 2px solid #3F5BC0;border-radius: 25px;box-shadow: rgb(255, 204, 204) 0px 0px 5px;line-height: 50px;color: rgb(255, 255, 255);font-size: 14px;text-align: center;">'+t+"</div>":this.iy.replace("${num}",""+t)},Jy:function(t,n){var e,i;1<t.num?this.ky?(i={marker:e=this.tb(t,"<div></div>"),count:t.num},this.ky(i),(n||this.Xy).push({type:"multiple",num:t.num,marker:e})):(i=this.tb(t,this.$y(t.num),42,42),(n||this.Xy).push({type:"multiple",num:t.num,marker:i})):(e=null,e=this.Uy&&(i={x:t.x,y:t.y},this.Uy(i),e=i.marker)||new fengmap.FMImageMarker({url:this.Vy,collision:!1,x:t.x,y:t.y}),i=this.ki(),e.addTo(i),(n||this.Xy).push({type:"single",num:t.num,marker:e}))},tb:function(t,n,e,i){var r=this,o=new fengmap.FMDomMarker({x:t.x,y:t.y,collision:!1,domWidth:e,domHeight:i,anchor:fengmap.FMMarkerAnchor.BOTTOM,content:n}),e=this.ki();return o.addTo(e),o.getRenderNode().point=t,o.getRenderNode().element.addEventListener("click",function(t){var n=r.V0,e=(n===r.gn.getMapOptions().buildingID&&(n=null),o.getRenderNode().point);r.Dt.Ct({type:"click",buildingID:n,coords:{x:e.x,y:e.y},level:r.Or,target:o,markers:s(e.markers)})}),o.getRenderNode().element.addEventListener("touchend",function(t){var n=r.V0,e=(n===r.gn.getMapOptions().buildingID&&(n=null),o.getRenderNode().point);r.Dt.Ct({type:"click",buildingID:n,coords:{x:e.x,y:e.y},level:r.Or,target:o,markers:s(e.markers)})}),o;function s(t){for(var n=[],e=0;e<t.length;e++)n.push({x:t[e].x,y:t[e].y});return n}},Qy:function(){var t={x:document.body.clientWidth/2,y:document.body.clientHeight/2},n={x:t.x+this.Dy,y:t.y},t=fengmap.FMUtil.coordsScreenToMap(this.gn,t),n=fengmap.FMUtil.coordsScreenToMap(this.gn,n);return Math.sqrt((t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y))},qy:function(t,n,e){for(var i=[],r=0;r<t.length;r++){var o=t[r];if(!o.clustered){o=(o=n.query(new IS(o.x-e/2,o.y-e/2,e,e))).filter(function(t){return!0!==t.clustered});if(0!=o.length){var s,a=WS(o);try{for(a.s();!(s=a.n()).done;)s.value.clustered=!0}catch(t){a.e(t)}finally{a.f()}i.push(o)}}}return i},Zy:function(t){for(var n=[],e=0;e<t.length;e++){var i=0,r=0,o=t[e].length;if(!(o<=0)){for(var s=t[e][0].level,a=t[e][0].buildingID,u=0;u<o;u++)i+=t[e][u].x,r+=t[e][u].y;n.push({x:i/o,y:r/o,level:s,buildingID:a,num:o,markers:t[e]})}}return n},T1:function(t){var n;this.L1()&&(n=!1,"zoom"===t.type&&(n=!0),this.Yy(n))},L1:function(){for(var t=!1,n=Array.from(this.gn.getRenderManager().getRenderList().keys()),e=0;e<n.length;e++){var i=n[e].split("%A%B%C%D");if(""+i[0]==""+this.V0&&""+i[1]==""+this.Or){t=!0;break}}return t},W1:function(t){var n=this.ki(),n=new Tt(t.x-this.gn.x,n.height,this.gn.y-t.y),t=this.gn.camera,n=n.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix);return!(1<Math.abs(n.x)||1<Math.abs(n.y)||1<Math.abs(n.z))},zy:function(){!function t(n){n.points.length=0;for(var e=0;e<n.nodes.length;e++)t(n.nodes[e]),delete n.nodes[e];n.nodes.length=0}(this.Hy)},ki:function(){return this.gn.getBuilding(this.V0).getFloor(this.Or)},Gn:function(){this.ki().getLayers(fengmap.FMType.EXTENT_LAYER)[0]&&(this.qc(),this.gn.off("update",this.Gn))}}),t),qS={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","gl_FragColor = opacity * texel;","}"].join("\n")};function KS(t){return(KS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function JS(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=KS(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=KS(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==KS(t)?t:String(t)}(i.key),i)}}function $S(t,n,e){return n&&JS(t.prototype,n),e&&JS(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function t3(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}var n3,e3,i3=$S(function t(){t3(this,t),this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1});function r3(t){return(r3="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o3(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=r3(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=r3(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==r3(t)?t:String(t)}(i.key),i)}}function s3(t,n,e){n=u3(n);var i=t,n=a3()?Reflect.construct(n,e||[],u3(t).constructor):n.apply(t,e);if(n&&("object"===r3(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function a3(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(a3=function(){return!!t})()}function u3(t){return(u3=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function c3(t,n){return(c3=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}Object.assign(i3.prototype,{setSize:function(){},render:function(){console.error("THREE.Pass: .render() must be implemented in derived pass.")}}),i3.FullScreenQuad=(n3=new vt(-1,1,1,-1,0,1),e3=new ma(2,2),tv=$S(function t(n){t3(this,t),this.nb=new $a(e3,n)}),Object.defineProperty(tv.prototype,"material",{get:function(){return this.nb.material},set:function(t){this.nb.material=t}}),Object.assign(tv.prototype,{render:function(t){t.render(this.nb,n3)}}),tv);var h3=function(){var t,n,e=r,i=i3;if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");function r(t,n){var e;if(this instanceof r)return(e=s3(this,r)).textureID=void 0!==n?n:"tDiffuse",t instanceof Ea?(e.uniforms=t.uniforms,e.material=t):t&&(e.uniforms=_a.clone(t.uniforms),e.material=new Ea({defines:Object.assign({},t.defines),uniforms:e.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader})),e.fsQuad=new i3.FullScreenQuad(e.material),e;throw new TypeError("Cannot call a class as a function")}return e.prototype=Object.create(i&&i.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),i&&c3(e,i),e=r,t&&o3(e.prototype,t),n&&o3(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}();function f3(t){return(f3="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function l3(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=f3(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=f3(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==f3(t)?t:String(t)}(i.key),i)}}function d3(t,n,e){return n&&l3(t.prototype,n),e&&l3(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function v3(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function p3(t,n,e){n=y3(n);var i=t,n=m3()?Reflect.construct(n,e||[],y3(t).constructor):n.apply(t,e);if(n&&("object"===f3(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function m3(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(m3=function(){return!!t})()}function y3(t){return(y3=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function b3(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),n&&g3(t,n)}function g3(t,n){return(g3=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}Object.assign(h3.prototype,{render:function(t,n,e){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=e.texture),this.fsQuad.material=this.material,this.renderToScreen?t.setRenderTarget(null):(t.setRenderTarget(n),this.clear&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil)),this.fsQuad.render(t)}});var _3=function(){function i(t,n){var e;return v3(this,i),(e=p3(this,i)).scene=t,e.camera=n,e.clear=!0,e.needsSwap=!1,e.inverse=!1,e}return b3(i,i3),d3(i)}(),w3=(Object.assign(_3.prototype,{render:function(t,n,e){var i,r,o=t.getContext(),s=t.state;s.buffers.color.setMask(!1),s.buffers.depth.setMask(!1),s.buffers.color.setLocked(!0),s.buffers.depth.setLocked(!0),r=this.inverse?(i=0,1):(i=1,0),s.buffers.stencil.setTest(!0),s.buffers.stencil.setOp(o.REPLACE,o.REPLACE,o.REPLACE),s.buffers.stencil.setFunc(o.ALWAYS,i,4294967295),s.buffers.stencil.setClear(r),t.setRenderTarget(e),this.clear&&t.clear(),t.render(this.scene,this.camera),t.setRenderTarget(n),this.clear&&t.clear(),t.render(this.scene,this.camera),s.buffers.color.setLocked(!1),s.buffers.depth.setLocked(!1),s.buffers.stencil.setFunc(o.EQUAL,1,4294967295),s.buffers.stencil.setOp(o.KEEP,o.KEEP,o.KEEP)}}),function(){function n(){var t;return v3(this,n),(t=p3(this,n)).needsSwap=!1,t}return b3(n,i3),d3(n)}());function x3(t){this.autoStart=void 0===t||t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}function E3(t){return(E3="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function S3(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=E3(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=E3(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==E3(t)?t:String(t)}(i.key),i)}}function T3(t,n,e){return n&&S3(t.prototype,n),e&&S3(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function A3(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}Object.assign(w3.prototype,{render:function(t){t.state.buffers.stencil.setTest(!1)}}),Object.assign(x3.prototype,{start:function(){this.startTime=("undefined"==typeof performance?Date:performance).now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0},stop:function(){this.getElapsedTime(),this.running=!1,this.autoStart=!1},getElapsedTime:function(){return this.getDelta(),this.elapsedTime},getDelta:function(){var t,n=0;return this.autoStart&&!this.running?(this.start(),0):(this.running&&(n=((t=("undefined"==typeof performance?Date:performance).now())-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=n),n)}});var M3,O3,L3=T3(function t(n,e){var i,r;A3(this,t),this.renderer=n,void 0===e?(i={minFilter:Qn,magFilter:Qn,format:fe,stencilBuffer:!1},r=n.getSize(new Mt),this.eb=n.getPixelRatio(),this.tt=r.width,this.nt=r.height,(e=new Gc(this.tt*this.eb,this.nt*this.eb,i)).texture.name="EffectComposer.rt1"):(this.eb=1,this.tt=e.width,this.nt=e.height),this.renderTarget1=e,this.renderTarget2=e.clone(),this.renderTarget2.texture.name="EffectComposer.rt2",this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2,this.renderToScreen=!0,this.passes=[],void 0===h3&&console.error("THREE.EffectComposer relies on ShaderPass"),this.copyPass=new h3(qS),this.clock=new x3}),R3=(Object.assign(L3.prototype,{swapBuffers:function(){var t=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=t},clearPass:function(){for(var t=0;t<this.passes.length;t++)this.passes[t].scene=null,this.passes[t].camera=null},addPass:function(t){this.passes.push(t),t.setSize(this.tt*this.eb,this.nt*this.eb)},insertPass:function(t,n){this.passes.splice(n,0,t)},isLastEnabledPass:function(t){for(var n=t+1;n<this.passes.length;n++)if(this.passes[n].enabled)return!1;return!0},render:function(t){void 0===t&&(t=this.clock.getDelta());for(var n,e,i,r=this.renderer.getRenderTarget(),o=!1,s=this.passes.length,a=0;a<s;a++)!1!==(i=this.passes[a]).enabled&&(i.renderToScreen=this.renderToScreen&&this.isLastEnabledPass(a),i.render(this.renderer,this.writeBuffer,this.readBuffer,t,o),i.needsSwap&&(o&&(n=this.renderer.getContext(),(e=this.renderer.state.buffers.stencil).setFunc(n.NOTEQUAL,1,4294967295),this.copyPass.render(this.renderer,this.writeBuffer,this.readBuffer,t),e.setFunc(n.EQUAL,1,4294967295)),this.swapBuffers()),void 0!==_3)&&(i instanceof _3?o=!0:i instanceof w3&&(o=!1));this.renderer.setRenderTarget(r)},reset:function(t){var n;void 0===t&&(n=this.renderer.getSize(new Mt),this.eb=this.renderer.getPixelRatio(),this.tt=n.width,this.nt=n.height,(t=this.renderTarget1.clone()).setSize(this.tt*this.eb,this.nt*this.eb)),this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.renderTarget1=t,this.renderTarget2=t.clone(),this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2},setSize:function(t,n){this.tt=t,this.nt=n;var e=this.tt*this.eb,i=this.nt*this.eb;this.renderTarget1.setSize(e,i),this.renderTarget2.setSize(e,i);for(var r=0;r<this.passes.length;r++)this.passes[r].setSize(e,i)},setPixelRatio:function(t){this.eb=t,this.setSize(this.tt,this.nt)}}),T3(function t(){A3(this,t),this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1})),N3=(Object.assign(R3.prototype,{setSize:function(){},render:function(){console.error("THREE.Pass: .render() must be implemented in derived pass.")}}),R3.FullScreenQuad=(M3=new vt(-1,1,1,-1,0,1),O3=new ma(2,2),$d=T3(function t(n){A3(this,t),this.nb=new $a(O3,n)}),Object.defineProperty($d.prototype,"material",{get:function(){return this.nb.material},set:function(t){this.nb.material=t}}),Object.assign($d.prototype,{dispose:function(){this.nb.geometry.dispose()},render:function(t){t.render(this.nb,M3)}}),$d),{uLayer:{value:0},uPrevDepthTexture:{value:null},uScreenSize:{value:new Mt(1,1)},uDepthPeel:{value:1},uDepthOffset:{value:1e-5}}),P3="\nvarying vec2 vUv;\nvoid main(){\n vUv = uv;\n gl_Position = vec4(position.xy, 0., 1.);\n}\n";function F3(t){t.fragmentShader=t.fragmentShader.replace("#include <packing>",""),t.fragmentShader="\n\t\t\t\t\t#include <packing>\n\n\t\t\t\t\t".concat(t.fragmentShader,"\n\t\t\t\t"),j3(t),t.fragmentShader=t.fragmentShader.replace(/}(\s*)$/g,"\n if(uDepthPeel != 0) {\n #ifdef STANDARD\n gl_FragColor.a = diffuseColor.a;\n #else\n gl_FragColor.a = opacity;\n #endif\n gl_FragColor.rgb *= gl_FragColor.a;\n }\n }\n ")}function j3(t){t.uniforms.uScreenSize=N3.uScreenSize,t.uniforms.uPrevDepthTexture=N3.uPrevDepthTexture,t.uniforms.uLayer=N3.uLayer,t.uniforms.uDepthOffset=N3.uDepthOffset,t.uniforms.uDepthPeel=N3.uDepthPeel,t.vertexShader=t.vertexShader.replace("void main() {","\n varying vec2 vFMHighPrecisionZW;\n void main() {"),t.vertexShader=t.vertexShader.replace(/}$/gm,"\n vFMHighPrecisionZW = gl_Position.zw;\n }\n "),t.fragmentShader="\n\t\t\t\t\tuniform vec2 uScreenSize;\n\t\t\t\t\tuniform sampler2D uPrevDepthTexture;\n\t\t\t\t\tuniform int uLayer;\n\t\t\t\t\tuniform int uDepthPeel;\n\t\t\t\t\tuniform float uDepthOffset;\n varying vec2 vFMHighPrecisionZW;\n\t\t\t\t\t".concat(t.fragmentShader,"\n\t\t\t\t"),t.fragmentShader=t.fragmentShader.replace(/}(\s*)$/g,"\n if(uDepthPeel == 0) return;\n\n if(uLayer != 0 ){\n vec2 screenPos = gl_FragCoord.xy * uScreenSize;\n float prevDepth = unpackRGBAToDepth(texture2D(uPrevDepthTexture, screenPos));\n float fragCoordZ = 0.5 * vFMHighPrecisionZW[0] / vFMHighPrecisionZW[1] + 0.5;\n if(prevDepth + uDepthOffset - fragCoordZ >= 0. ){\n discard;\n }\n }\n}")}function I3(t,n,e){Gc.call(this,t,n,e),this.samples=4}function C3(t){return(C3="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function D3(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=C3(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=C3(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==C3(t)?t:String(t)}(i.key),i)}}function k3(t,n,e){n=B3(n);var i=t,n=U3()?Reflect.construct(n,e||[],B3(t).constructor):n.apply(t,e);if(n&&("object"===C3(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function U3(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(U3=function(){return!!t})()}function B3(t){return(B3=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function G3(t,n){return(G3=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}I3.prototype=Object.assign(Object.create(Gc.prototype),{constructor:I3,isWebGLMultisampleRenderTarget:!0,copy:function(t){return Gc.prototype.copy.call(this,t),this.samples=t.samples,this}});var H3=function(){var t,n=h,e=R3;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");function h(){var t,n,e,i,r,o,s,a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},u=this,c=h;if(u instanceof c)return u=k3(this,h),c=a.scene,t=a.camera,n=a.renderer,e=a.samples,i=a.layers,r=a.mode,o=a.w,s=a.h,a=a.type,u.gt=n,u.Co=c,u.kt=t,u.ib=null!=e?e:4,u.rb=r,u.mi=a,u.ob=[],u.sb=null!=i?i:2,u.ab=new Mt(o,s),u.ub=new Ea({uniforms:{uTextureA:{value:null},uTextureB:{value:null},uBlit:{value:0}},vertexShader:P3,fragmentShader:"\n varying vec2 vUv;\n uniform sampler2D uTextureA;\n uniform sampler2D uTextureB;\n\n void main(){\n vec4 src = texture2D(uTextureA, vUv);\n vec4 dst = texture2D(uTextureB, vUv);\n\n float a1 = 1.-src.a;\n gl_FragColor.a = src.a + a1 * dst.a;\n gl_FragColor.rgb = src.rgb + a1 * dst.rgb;\n gl_FragColor.rgb /= gl_FragColor.a;\n }\n ",transparent:!0,depthTest:!1,depthWrite:!1}),u.cb=new Hc,u.cb.depthPacking=vi,u.cb.onBeforeCompile=j3,u.hb=new R3.FullScreenQuad(u.ub),u.clearDepth=!1,u.needsSwap=!1,u.fb=new Map,u.da=!0,u.initTargets(),u;throw new TypeError("Cannot call a class as a function")}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&G3(n,e),n=h,(e=[{key:"enable",get:function(){return this.da},set:function(t){(this.da=t)?(N3.uDepthPeel.value=1,this.fb.forEach(function(t){t=t.mesh;t.material&&(t.material.userData.transparent=!1)})):(N3.uDepthPeel.value=0,this.restoreState()),this.fb.clear()}},{key:"restoreState",value:function(){this.fb.forEach(function(t){t=t.mesh;t.material&&(delete t.userData.transparent,t.material.needsUpdate=!0)}),this.fb.clear()}},{key:"initTargets",value:function(){for(var t=this.ab,n=0;n<5;n++){var e=2<=n&&0<this.ib?I3:Gc,i=new e(t.x,t.y,{minFilter:zn,magFilter:zn,type:ie,format:fe});e===I3&&(i.samples=this.ib),this.ob.push(i)}}},{key:"setSize",value:function(){var t=new Mt;this.gt.getDrawingBufferSize(t);for(var n=0;n<5;n++)this.ob[n].setSize(t.x,t.y);this.ab.x=t.x,this.ab.y=t.y,N3.uScreenSize.value.set(1/t.x,1/t.y)}},{key:"dispose",value:function(){for(var t=0;t<5;t++)this.ob[t].dispose()}},{key:"clearTarget",value:function(t,n,e){t.setRenderTarget(n),t.setClearColor(e[0],e[1]),t.clear()}},{key:"clearAllTarget",value:function(t,n){var e=this.ob,i=t.getClearColor().clone(),r=t.getClearAlpha();this.clearTarget(t,e[0],[16777215,1]),this.clearTarget(t,e[1],[16777215,1]),this.clearTarget(t,e[2],[0,0]),this.clearTarget(t,e[3],[0,0]),this.clearTarget(t,n,[i,r])}},{key:"_buildTransparentObjects",value:function(t){var i=this,n={model:E.MODEL_LAYER,extent:E.EXTENT_LAYER,externalModel:E.EXTERNAL_MODEL_LAYER,dynamicModel:E.DYNAMIC_MODEL_MARKER};t.children.forEach(function(t){var e=i.mi.includes(n[t.name]);t.traverse(function(t){var n=null==(n=t.material)||null==(n=n.userData)?void 0:n.sourceTransparent;e&&t.visible&&"Mesh"===t.type&&0===t.renderOrder&&t.material.transparent&&!1!==n&&(t.userData.transparent=!1,t.visible&&t.material.transparent&&(i.fb.has(t.uuid)||i.fb.set(t.uuid,{mesh:t,onBeforeCompile:t.material.onBeforeCompile})),t.material.onBeforeCompile=F3,t.material.needsUpdate=!0)})})}},{key:"render",value:function(t,n,e){this.clearAllTarget(t,e);for(var i=t.getClearColor().getHex(),r=t.getClearAlpha(),o=this.Co,s=this.kt,a=this.sb,u=this.ob,c=this.cb,h=this.ub,f=(this.restoreState(),t.setRenderTarget(e),t.setClearColor(i,r),t.clear(),t.render(o,s),this._buildTransparentObjects(this.Co),N3.uLayer.value=0,o.overrideMaterial=c,t.setRenderTarget(u[0]),t.setClearColor(16777215,1),t.clear(),t.render(o,s),o.overrideMaterial=null,t.setRenderTarget(u[2]),t.setClearColor(0,0),t.clear(),t.render(o,s),{0:2,1:4,2:3}),l={0:3,1:2,2:4},d={0:4,1:3,2:2},v=0;v<a;v++){var p=(v+1)%2,m=f[v%3],y=l[v%3],b=d[v%3];N3.uPrevDepthTexture.value=u[v%2].texture,N3.uLayer.value=v+1,o.overrideMaterial=c,t.setRenderTarget(u[p]),t.setClearColor(16777215,1),t.clear(),t.render(o,s),o.overrideMaterial=null,t.setRenderTarget(u[y]),t.setClearColor(0,0),t.clear(),t.render(o,s),h.uniforms.uTextureA.value=u[m].texture,h.uniforms.uTextureB.value=u[y].texture,t.setRenderTarget(u[b]),t.setClearColor(0,0),t.clear(),this.hb.render(t)}N3.uPrevDepthTexture.value=null,t.setRenderTarget(this.renderToScreen?null:e),this.hb.render(t),t.setClearColor(i,r)}},{key:"setPass",value:function(t,n){t&&(this.Co=t),n&&(this.kt=n)}}])&&D3(n.prototype,e),t&&D3(n,t),Object.defineProperty(n,"prototype",{writable:!1}),h}(),X3={uniforms:{tDiffuse:{value:null},resolution:{value:new Mt(1/1024,1/512)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["precision highp float;","","uniform sampler2D tDiffuse;","","uniform vec2 resolution;","","varying vec2 vUv;","","// FXAA 3.11 implementation by NVIDIA, ported to WebGL by Agost Biro (biro@archilogic.com)","","//----------------------------------------------------------------------------------","// File: es3-keplerFXAAassetsshaders/FXAA_DefaultES.frag","// SDK Version: v3.00","// Email: gameworks@nvidia.com","// Site: http://developer.nvidia.com/","//","// Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.","//","// Redistribution and use in source and binary forms, with or without","// modification, are permitted provided that the following conditions","// are met:","// * Redistributions of source code must retain the above copyright","// notice, this list of conditions and the following disclaimer.","// * Redistributions in binary form must reproduce the above copyright","// notice, this list of conditions and the following disclaimer in the","// documentation and/or other materials provided with the distribution.","// * Neither the name of NVIDIA CORPORATION nor the names of its","// contributors may be used to endorse or promote products derived","// from this software without specific prior written permission.","//","// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY","// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE","// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR","// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR","// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,","// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,","// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR","// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY","// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT","// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE","// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.","//","//----------------------------------------------------------------------------------","","#define FXAA_PC 1","#define FXAA_GLSL_100 1","#define FXAA_QUALITY_PRESET 12","","#define FXAA_GREEN_AS_LUMA 1","","/*--------------------------------------------------------------------------*/","#ifndef FXAA_PC_CONSOLE"," //"," // The console algorithm for PC is included"," // for developers targeting really low spec machines."," // Likely better to just run FXAA_PC, and use a really low preset."," //"," #define FXAA_PC_CONSOLE 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_GLSL_120"," #define FXAA_GLSL_120 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_GLSL_130"," #define FXAA_GLSL_130 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_HLSL_3"," #define FXAA_HLSL_3 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_HLSL_4"," #define FXAA_HLSL_4 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_HLSL_5"," #define FXAA_HLSL_5 0","#endif","/*==========================================================================*/","#ifndef FXAA_GREEN_AS_LUMA"," //"," // For those using non-linear color,"," // and either not able to get luma in alpha, or not wanting to,"," // this enables FXAA to run using green as a proxy for luma."," // So with this enabled, no need to pack luma in alpha."," //"," // This will turn off AA on anything which lacks some amount of green."," // Pure red and blue or combination of only R and B, will get no AA."," //"," // Might want to lower the settings for both,"," // fxaaConsoleEdgeThresholdMin"," // fxaaQualityEdgeThresholdMin"," // In order to insure AA does not get turned off on colors"," // which contain a minor amount of green."," //"," // 1 = On."," // 0 = Off."," //"," #define FXAA_GREEN_AS_LUMA 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_EARLY_EXIT"," //"," // Controls algorithm's early exit path."," // On PS3 turning this ON adds 2 cycles to the shader."," // On 360 turning this OFF adds 10ths of a millisecond to the shader."," // Turning this off on console will result in a more blurry image."," // So this defaults to on."," //"," // 1 = On."," // 0 = Off."," //"," #define FXAA_EARLY_EXIT 1","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_DISCARD"," //"," // Only valid for PC OpenGL currently."," // Probably will not work when FXAA_GREEN_AS_LUMA = 1."," //"," // 1 = Use discard on pixels which don't need AA."," // For APIs which enable concurrent TEX+ROP from same surface."," // 0 = Return unchanged color on pixels which don't need AA."," //"," #define FXAA_DISCARD 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_FAST_PIXEL_OFFSET"," //"," // Used for GLSL 120 only."," //"," // 1 = GL API supports fast pixel offsets"," // 0 = do not use fast pixel offsets"," //"," #ifdef GL_EXT_gpu_shader4"," #define FXAA_FAST_PIXEL_OFFSET 1"," #endif"," #ifdef GL_NV_gpu_shader5"," #define FXAA_FAST_PIXEL_OFFSET 1"," #endif"," #ifdef GL_ARB_gpu_shader5"," #define FXAA_FAST_PIXEL_OFFSET 1"," #endif"," #ifndef FXAA_FAST_PIXEL_OFFSET"," #define FXAA_FAST_PIXEL_OFFSET 0"," #endif","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_GATHER4_ALPHA"," //"," // 1 = API supports gather4 on alpha channel."," // 0 = API does not support gather4 on alpha channel."," //"," #if (FXAA_HLSL_5 == 1)"," #define FXAA_GATHER4_ALPHA 1"," #endif"," #ifdef GL_ARB_gpu_shader5"," #define FXAA_GATHER4_ALPHA 1"," #endif"," #ifdef GL_NV_gpu_shader5"," #define FXAA_GATHER4_ALPHA 1"," #endif"," #ifndef FXAA_GATHER4_ALPHA"," #define FXAA_GATHER4_ALPHA 0"," #endif","#endif","","","/*============================================================================"," FXAA QUALITY - TUNING KNOBS","------------------------------------------------------------------------------","NOTE the other tuning knobs are now in the shader function inputs!","============================================================================*/","#ifndef FXAA_QUALITY_PRESET"," //"," // Choose the quality preset."," // This needs to be compiled into the shader as it effects code."," // Best option to include multiple presets is to"," // in each shader define the preset, then include this file."," //"," // OPTIONS"," // -----------------------------------------------------------------------"," // 10 to 15 - default medium dither (10=fastest, 15=highest quality)"," // 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality)"," // 39 - no dither, very expensive"," //"," // NOTES"," // -----------------------------------------------------------------------"," // 12 = slightly faster then FXAA 3.9 and higher edge quality (default)"," // 13 = about same speed as FXAA 3.9 and better than 12"," // 23 = closest to FXAA 3.9 visually and performance wise"," // _ = the lowest digit is directly related to performance"," // _ = the highest digit is directly related to style"," //"," #define FXAA_QUALITY_PRESET 12","#endif","","","/*============================================================================",""," FXAA QUALITY - PRESETS","","============================================================================*/","","/*============================================================================"," FXAA QUALITY - MEDIUM DITHER PRESETS","============================================================================*/","#if (FXAA_QUALITY_PRESET == 10)"," #define FXAA_QUALITY_PS 3"," #define FXAA_QUALITY_P0 1.5"," #define FXAA_QUALITY_P1 3.0"," #define FXAA_QUALITY_P2 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 11)"," #define FXAA_QUALITY_PS 4"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 3.0"," #define FXAA_QUALITY_P3 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 12)"," #define FXAA_QUALITY_PS 5"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 4.0"," #define FXAA_QUALITY_P4 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 13)"," #define FXAA_QUALITY_PS 6"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 4.0"," #define FXAA_QUALITY_P5 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 14)"," #define FXAA_QUALITY_PS 7"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 4.0"," #define FXAA_QUALITY_P6 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 15)"," #define FXAA_QUALITY_PS 8"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 4.0"," #define FXAA_QUALITY_P7 12.0","#endif","","/*============================================================================"," FXAA QUALITY - LOW DITHER PRESETS","============================================================================*/","#if (FXAA_QUALITY_PRESET == 20)"," #define FXAA_QUALITY_PS 3"," #define FXAA_QUALITY_P0 1.5"," #define FXAA_QUALITY_P1 2.0"," #define FXAA_QUALITY_P2 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 21)"," #define FXAA_QUALITY_PS 4"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 22)"," #define FXAA_QUALITY_PS 5"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 23)"," #define FXAA_QUALITY_PS 6"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 24)"," #define FXAA_QUALITY_PS 7"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 3.0"," #define FXAA_QUALITY_P6 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 25)"," #define FXAA_QUALITY_PS 8"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 4.0"," #define FXAA_QUALITY_P7 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 26)"," #define FXAA_QUALITY_PS 9"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 4.0"," #define FXAA_QUALITY_P8 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 27)"," #define FXAA_QUALITY_PS 10"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 4.0"," #define FXAA_QUALITY_P9 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 28)"," #define FXAA_QUALITY_PS 11"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 2.0"," #define FXAA_QUALITY_P9 4.0"," #define FXAA_QUALITY_P10 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 29)"," #define FXAA_QUALITY_PS 12"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 2.0"," #define FXAA_QUALITY_P9 2.0"," #define FXAA_QUALITY_P10 4.0"," #define FXAA_QUALITY_P11 8.0","#endif","","/*============================================================================"," FXAA QUALITY - EXTREME QUALITY","============================================================================*/","#if (FXAA_QUALITY_PRESET == 39)"," #define FXAA_QUALITY_PS 12"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.0"," #define FXAA_QUALITY_P2 1.0"," #define FXAA_QUALITY_P3 1.0"," #define FXAA_QUALITY_P4 1.0"," #define FXAA_QUALITY_P5 1.5"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 2.0"," #define FXAA_QUALITY_P9 2.0"," #define FXAA_QUALITY_P10 4.0"," #define FXAA_QUALITY_P11 8.0","#endif","","","","/*============================================================================",""," API PORTING","","============================================================================*/","#if (FXAA_GLSL_100 == 1) || (FXAA_GLSL_120 == 1) || (FXAA_GLSL_130 == 1)"," #define FxaaBool bool"," #define FxaaDiscard discard"," #define FxaaFloat float"," #define FxaaFloat2 vec2"," #define FxaaFloat3 vec3"," #define FxaaFloat4 vec4"," #define FxaaHalf float"," #define FxaaHalf2 vec2"," #define FxaaHalf3 vec3"," #define FxaaHalf4 vec4"," #define FxaaInt2 ivec2"," #define FxaaSat(x) clamp(x, 0.0, 1.0)"," #define FxaaTex sampler2D","#else"," #define FxaaBool bool"," #define FxaaDiscard clip(-1)"," #define FxaaFloat float"," #define FxaaFloat2 float2"," #define FxaaFloat3 float3"," #define FxaaFloat4 float4"," #define FxaaHalf half"," #define FxaaHalf2 half2"," #define FxaaHalf3 half3"," #define FxaaHalf4 half4"," #define FxaaSat(x) saturate(x)","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_GLSL_100 == 1)"," #define FxaaTexTop(t, p) texture2D(t, p, 0.0)"," #define FxaaTexOff(t, p, o, r) texture2D(t, p + (o * r), 0.0)","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_GLSL_120 == 1)"," // Requires,"," // #version 120"," // And at least,"," // #extension GL_EXT_gpu_shader4 : enable"," // (or set FXAA_FAST_PIXEL_OFFSET 1 to work like DX9)"," #define FxaaTexTop(t, p) texture2DLod(t, p, 0.0)"," #if (FXAA_FAST_PIXEL_OFFSET == 1)"," #define FxaaTexOff(t, p, o, r) texture2DLodOffset(t, p, 0.0, o)"," #else"," #define FxaaTexOff(t, p, o, r) texture2DLod(t, p + (o * r), 0.0)"," #endif"," #if (FXAA_GATHER4_ALPHA == 1)"," // use #extension GL_ARB_gpu_shader5 : enable"," #define FxaaTexAlpha4(t, p) textureGather(t, p, 3)"," #define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)"," #define FxaaTexGreen4(t, p) textureGather(t, p, 1)"," #define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)"," #endif","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_GLSL_130 == 1)",' // Requires "#version 130" or better'," #define FxaaTexTop(t, p) textureLod(t, p, 0.0)"," #define FxaaTexOff(t, p, o, r) textureLodOffset(t, p, 0.0, o)"," #if (FXAA_GATHER4_ALPHA == 1)"," // use #extension GL_ARB_gpu_shader5 : enable"," #define FxaaTexAlpha4(t, p) textureGather(t, p, 3)"," #define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)"," #define FxaaTexGreen4(t, p) textureGather(t, p, 1)"," #define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)"," #endif","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_HLSL_3 == 1)"," #define FxaaInt2 float2"," #define FxaaTex sampler2D"," #define FxaaTexTop(t, p) tex2Dlod(t, float4(p, 0.0, 0.0))"," #define FxaaTexOff(t, p, o, r) tex2Dlod(t, float4(p + (o * r), 0, 0))","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_HLSL_4 == 1)"," #define FxaaInt2 int2"," struct FxaaTex { SamplerState smpl; Texture2D tex; };"," #define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)"," #define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_HLSL_5 == 1)"," #define FxaaInt2 int2"," struct FxaaTex { SamplerState smpl; Texture2D tex; };"," #define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)"," #define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)"," #define FxaaTexAlpha4(t, p) t.tex.GatherAlpha(t.smpl, p)"," #define FxaaTexOffAlpha4(t, p, o) t.tex.GatherAlpha(t.smpl, p, o)"," #define FxaaTexGreen4(t, p) t.tex.GatherGreen(t.smpl, p)"," #define FxaaTexOffGreen4(t, p, o) t.tex.GatherGreen(t.smpl, p, o)","#endif","","","/*============================================================================"," GREEN AS LUMA OPTION SUPPORT FUNCTION","============================================================================*/","#if (FXAA_GREEN_AS_LUMA == 0)"," FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.w; }","#else"," FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; }","#endif","","","","","/*============================================================================",""," FXAA3 QUALITY - PC","","============================================================================*/","#if (FXAA_PC == 1)","/*--------------------------------------------------------------------------*/","FxaaFloat4 FxaaPixelShader("," //"," // Use noperspective interpolation here (turn off perspective interpolation)."," // {xy} = center of pixel"," FxaaFloat2 pos,"," //"," // Used only for FXAA Console, and not used on the 360 version."," // Use noperspective interpolation here (turn off perspective interpolation)."," // {xy_} = upper left of pixel"," // {_zw} = lower right of pixel"," FxaaFloat4 fxaaConsolePosPos,"," //"," // Input color texture."," // {rgb_} = color in linear or perceptual color space"," // if (FXAA_GREEN_AS_LUMA == 0)"," // {__a} = luma in perceptual color space (not linear)"," FxaaTex tex,"," //"," // Only used on the optimized 360 version of FXAA Console.",' // For everything but 360, just use the same input here as for "tex".'," // For 360, same texture, just alias with a 2nd sampler."," // This sampler needs to have an exponent bias of -1."," FxaaTex fxaaConsole360TexExpBiasNegOne,"," //"," // Only used on the optimized 360 version of FXAA Console.",' // For everything but 360, just use the same input here as for "tex".'," // For 360, same texture, just alias with a 3nd sampler."," // This sampler needs to have an exponent bias of -2."," FxaaTex fxaaConsole360TexExpBiasNegTwo,"," //"," // Only used on FXAA Quality."," // This must be from a constant/uniform."," // {x_} = 1.0/screenWidthInPixels"," // {_y} = 1.0/screenHeightInPixels"," FxaaFloat2 fxaaQualityRcpFrame,"," //"," // Only used on FXAA Console."," // This must be from a constant/uniform."," // This effects sub-pixel AA quality and inversely sharpness."," // Where N ranges between,"," // N = 0.50 (default)"," // N = 0.33 (sharper)"," // {x__} = -N/screenWidthInPixels"," // {_y_} = -N/screenHeightInPixels"," // {_z_} = N/screenWidthInPixels"," // {__w} = N/screenHeightInPixels"," FxaaFloat4 fxaaConsoleRcpFrameOpt,"," //"," // Only used on FXAA Console."," // Not used on 360, but used on PS3 and PC."," // This must be from a constant/uniform."," // {x__} = -2.0/screenWidthInPixels"," // {_y_} = -2.0/screenHeightInPixels"," // {_z_} = 2.0/screenWidthInPixels"," // {__w} = 2.0/screenHeightInPixels"," FxaaFloat4 fxaaConsoleRcpFrameOpt2,"," //"," // Only used on FXAA Console."," // Only used on 360 in place of fxaaConsoleRcpFrameOpt2."," // This must be from a constant/uniform."," // {x__} = 8.0/screenWidthInPixels"," // {_y_} = 8.0/screenHeightInPixels"," // {_z_} = -4.0/screenWidthInPixels"," // {__w} = -4.0/screenHeightInPixels"," FxaaFloat4 fxaaConsole360RcpFrameOpt2,"," //"," // Only used on FXAA Quality."," // This used to be the FXAA_QUALITY_SUBPIX define."," // It is here now to allow easier tuning."," // Choose the amount of sub-pixel aliasing removal."," // This can effect sharpness."," // 1.00 - upper limit (softer)"," // 0.75 - default amount of filtering"," // 0.50 - lower limit (sharper, less sub-pixel aliasing removal)"," // 0.25 - almost off"," // 0.00 - completely off"," FxaaFloat fxaaQualitySubpix,"," //"," // Only used on FXAA Quality."," // This used to be the FXAA_QUALITY_EDGE_THRESHOLD define."," // It is here now to allow easier tuning."," // The minimum amount of local contrast required to apply algorithm."," // 0.333 - too little (faster)"," // 0.250 - low quality"," // 0.166 - default"," // 0.125 - high quality"," // 0.063 - overkill (slower)"," FxaaFloat fxaaQualityEdgeThreshold,"," //"," // Only used on FXAA Quality."," // This used to be the FXAA_QUALITY_EDGE_THRESHOLD_MIN define."," // It is here now to allow easier tuning."," // Trims the algorithm from processing darks."," // 0.0833 - upper limit (default, the start of visible unfiltered edges)"," // 0.0625 - high quality (faster)"," // 0.0312 - visible limit (slower)"," // Special notes when using FXAA_GREEN_AS_LUMA,"," // Likely want to set this to zero."," // As colors that are mostly not-green"," // will appear very dark in the green channel!"," // Tune by looking at mostly non-green content,"," // then start at zero and increase until aliasing is a problem."," FxaaFloat fxaaQualityEdgeThresholdMin,"," //"," // Only used on FXAA Console."," // This used to be the FXAA_CONSOLE_EDGE_SHARPNESS define."," // It is here now to allow easier tuning."," // This does not effect PS3, as this needs to be compiled in."," // Use FXAA_CONSOLE_PS3_EDGE_SHARPNESS for PS3."," // Due to the PS3 being ALU bound,"," // there are only three safe values here: 2 and 4 and 8."," // These options use the shaders ability to a free *|/ by 2|4|8."," // For all other platforms can be a non-power of two."," // 8.0 is sharper (default!!!)"," // 4.0 is softer"," // 2.0 is really soft (good only for vector graphics inputs)"," FxaaFloat fxaaConsoleEdgeSharpness,"," //"," // Only used on FXAA Console."," // This used to be the FXAA_CONSOLE_EDGE_THRESHOLD define."," // It is here now to allow easier tuning."," // This does not effect PS3, as this needs to be compiled in."," // Use FXAA_CONSOLE_PS3_EDGE_THRESHOLD for PS3."," // Due to the PS3 being ALU bound,"," // there are only two safe values here: 1/4 and 1/8."," // These options use the shaders ability to a free *|/ by 2|4|8."," // The console setting has a different mapping than the quality setting."," // Other platforms can use other values."," // 0.125 leaves less aliasing, but is softer (default!!!)"," // 0.25 leaves more aliasing, and is sharper"," FxaaFloat fxaaConsoleEdgeThreshold,"," //"," // Only used on FXAA Console."," // This used to be the FXAA_CONSOLE_EDGE_THRESHOLD_MIN define."," // It is here now to allow easier tuning."," // Trims the algorithm from processing darks."," // The console setting has a different mapping than the quality setting."," // This only applies when FXAA_EARLY_EXIT is 1."," // This does not apply to PS3,"," // PS3 was simplified to avoid more shader instructions."," // 0.06 - faster but more aliasing in darks"," // 0.05 - default"," // 0.04 - slower and less aliasing in darks"," // Special notes when using FXAA_GREEN_AS_LUMA,"," // Likely want to set this to zero."," // As colors that are mostly not-green"," // will appear very dark in the green channel!"," // Tune by looking at mostly non-green content,"," // then start at zero and increase until aliasing is a problem."," FxaaFloat fxaaConsoleEdgeThresholdMin,"," //"," // Extra constants for 360 FXAA Console only."," // Use zeros or anything else for other platforms."," // These must be in physical constant registers and NOT immediates."," // Immediates will result in compiler un-optimizing."," // {xyzw} = float4(1.0, -1.0, 0.25, -0.25)"," FxaaFloat4 fxaaConsole360ConstDir",") {","/*--------------------------------------------------------------------------*/"," FxaaFloat2 posM;"," posM.x = pos.x;"," posM.y = pos.y;"," #if (FXAA_GATHER4_ALPHA == 1)"," #if (FXAA_DISCARD == 0)"," FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);"," #if (FXAA_GREEN_AS_LUMA == 0)"," #define lumaM rgbyM.w"," #else"," #define lumaM rgbyM.y"," #endif"," #endif"," #if (FXAA_GREEN_AS_LUMA == 0)"," FxaaFloat4 luma4A = FxaaTexAlpha4(tex, posM);"," FxaaFloat4 luma4B = FxaaTexOffAlpha4(tex, posM, FxaaInt2(-1, -1));"," #else"," FxaaFloat4 luma4A = FxaaTexGreen4(tex, posM);"," FxaaFloat4 luma4B = FxaaTexOffGreen4(tex, posM, FxaaInt2(-1, -1));"," #endif"," #if (FXAA_DISCARD == 1)"," #define lumaM luma4A.w"," #endif"," #define lumaE luma4A.z"," #define lumaS luma4A.x"," #define lumaSE luma4A.y"," #define lumaNW luma4B.w"," #define lumaN luma4B.z"," #define lumaW luma4B.x"," #else"," FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);"," #if (FXAA_GREEN_AS_LUMA == 0)"," #define lumaM rgbyM.w"," #else"," #define lumaM rgbyM.y"," #endif"," #if (FXAA_GLSL_100 == 1)"," FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 0.0, 1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0, 0.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 0.0,-1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0, 0.0), fxaaQualityRcpFrame.xy));"," #else"," FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy));"," #endif"," #endif","/*--------------------------------------------------------------------------*/"," FxaaFloat maxSM = max(lumaS, lumaM);"," FxaaFloat minSM = min(lumaS, lumaM);"," FxaaFloat maxESM = max(lumaE, maxSM);"," FxaaFloat minESM = min(lumaE, minSM);"," FxaaFloat maxWN = max(lumaN, lumaW);"," FxaaFloat minWN = min(lumaN, lumaW);"," FxaaFloat rangeMax = max(maxWN, maxESM);"," FxaaFloat rangeMin = min(minWN, minESM);"," FxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold;"," FxaaFloat range = rangeMax - rangeMin;"," FxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled);"," FxaaBool earlyExit = range < rangeMaxClamped;","/*--------------------------------------------------------------------------*/"," if(earlyExit)"," #if (FXAA_DISCARD == 1)"," FxaaDiscard;"," #else"," return rgbyM;"," #endif","/*--------------------------------------------------------------------------*/"," #if (FXAA_GATHER4_ALPHA == 0)"," #if (FXAA_GLSL_100 == 1)"," FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0,-1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0, 1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0,-1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0, 1.0), fxaaQualityRcpFrame.xy));"," #else"," FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));"," #endif"," #else"," FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(1, -1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));"," #endif","/*--------------------------------------------------------------------------*/"," FxaaFloat lumaNS = lumaN + lumaS;"," FxaaFloat lumaWE = lumaW + lumaE;"," FxaaFloat subpixRcpRange = 1.0/range;"," FxaaFloat subpixNSWE = lumaNS + lumaWE;"," FxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS;"," FxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE;","/*--------------------------------------------------------------------------*/"," FxaaFloat lumaNESE = lumaNE + lumaSE;"," FxaaFloat lumaNWNE = lumaNW + lumaNE;"," FxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE;"," FxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE;","/*--------------------------------------------------------------------------*/"," FxaaFloat lumaNWSW = lumaNW + lumaSW;"," FxaaFloat lumaSWSE = lumaSW + lumaSE;"," FxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2);"," FxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2);"," FxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW;"," FxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE;"," FxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4;"," FxaaFloat edgeVert = abs(edgeVert3) + edgeVert4;","/*--------------------------------------------------------------------------*/"," FxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE;"," FxaaFloat lengthSign = fxaaQualityRcpFrame.x;"," FxaaBool horzSpan = edgeHorz >= edgeVert;"," FxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE;","/*--------------------------------------------------------------------------*/"," if(!horzSpan) lumaN = lumaW;"," if(!horzSpan) lumaS = lumaE;"," if(horzSpan) lengthSign = fxaaQualityRcpFrame.y;"," FxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM;","/*--------------------------------------------------------------------------*/"," FxaaFloat gradientN = lumaN - lumaM;"," FxaaFloat gradientS = lumaS - lumaM;"," FxaaFloat lumaNN = lumaN + lumaM;"," FxaaFloat lumaSS = lumaS + lumaM;"," FxaaBool pairN = abs(gradientN) >= abs(gradientS);"," FxaaFloat gradient = max(abs(gradientN), abs(gradientS));"," if(pairN) lengthSign = -lengthSign;"," FxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange);","/*--------------------------------------------------------------------------*/"," FxaaFloat2 posB;"," posB.x = posM.x;"," posB.y = posM.y;"," FxaaFloat2 offNP;"," offNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;"," offNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;"," if(!horzSpan) posB.x += lengthSign * 0.5;"," if( horzSpan) posB.y += lengthSign * 0.5;","/*--------------------------------------------------------------------------*/"," FxaaFloat2 posN;"," posN.x = posB.x - offNP.x * FXAA_QUALITY_P0;"," posN.y = posB.y - offNP.y * FXAA_QUALITY_P0;"," FxaaFloat2 posP;"," posP.x = posB.x + offNP.x * FXAA_QUALITY_P0;"," posP.y = posB.y + offNP.y * FXAA_QUALITY_P0;"," FxaaFloat subpixD = ((-2.0)*subpixC) + 3.0;"," FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN));"," FxaaFloat subpixE = subpixC * subpixC;"," FxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP));","/*--------------------------------------------------------------------------*/"," if(!pairN) lumaNN = lumaSS;"," FxaaFloat gradientScaled = gradient * 1.0/4.0;"," FxaaFloat lumaMM = lumaM - lumaNN * 0.5;"," FxaaFloat subpixF = subpixD * subpixE;"," FxaaBool lumaMLTZero = lumaMM < 0.0;","/*--------------------------------------------------------------------------*/"," lumaEndN -= lumaNN * 0.5;"," lumaEndP -= lumaNN * 0.5;"," FxaaBool doneN = abs(lumaEndN) >= gradientScaled;"," FxaaBool doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P1;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P1;"," FxaaBool doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P1;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P1;","/*--------------------------------------------------------------------------*/"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P2;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P2;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P2;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P2;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 3)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P3;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P3;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P3;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P3;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 4)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P4;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P4;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P4;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P4;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 5)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P5;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P5;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P5;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P5;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 6)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P6;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P6;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P6;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P6;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 7)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P7;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P7;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P7;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P7;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 8)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P8;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P8;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P8;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P8;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 9)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P9;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P9;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P9;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P9;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 10)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P10;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P10;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P10;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P10;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 11)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P11;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P11;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P11;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P11;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 12)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P12;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P12;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P12;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P12;","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }","/*--------------------------------------------------------------------------*/"," FxaaFloat dstN = posM.x - posN.x;"," FxaaFloat dstP = posP.x - posM.x;"," if(!horzSpan) dstN = posM.y - posN.y;"," if(!horzSpan) dstP = posP.y - posM.y;","/*--------------------------------------------------------------------------*/"," FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero;"," FxaaFloat spanLength = (dstP + dstN);"," FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero;"," FxaaFloat spanLengthRcp = 1.0/spanLength;","/*--------------------------------------------------------------------------*/"," FxaaBool directionN = dstN < dstP;"," FxaaFloat dst = min(dstN, dstP);"," FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP;"," FxaaFloat subpixG = subpixF * subpixF;"," FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5;"," FxaaFloat subpixH = subpixG * fxaaQualitySubpix;","/*--------------------------------------------------------------------------*/"," FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0;"," FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH);"," if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign;"," if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign;"," #if (FXAA_DISCARD == 1)"," return FxaaTexTop(tex, posM);"," #else"," return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM);"," #endif","}","/*==========================================================================*/","#endif","","void main() {"," gl_FragColor = FxaaPixelShader("," vUv,"," vec4(0.0),"," tDiffuse,"," tDiffuse,"," tDiffuse,"," resolution,"," vec4(0.0),"," vec4(0.0),"," vec4(0.0),"," 0.75,"," 0.166,"," 0.0833,"," 0.0,"," 0.0,"," 0.0,"," vec4(0.0)"," );",""," // TODO avoid querying texture twice for same texel"," gl_FragColor.a = texture2D(tDiffuse, vUv).a;","}"].join("\n")};function V3(t){return(V3="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function z3(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=V3(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=V3(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==V3(t)?t:String(t)}(i.key),i)}}function W3(t,n){return n?(n.copy(t),n):t.clone()}function Y3(t,n){return t.equals(n)}var jy=function(){function s(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},n=this,e=s;if(!(n instanceof e))throw new TypeError("Cannot call a class as a function");this.lb=new Ns,this.es=t;var n=this.es,e=n.renderManager,n=n.map,i={minFilter:Qn,magFilter:Qn,format:fe,stencilBuffer:!1},r=e.renderer.domElement.parentElement.clientWidth*e.renderer.getPixelRatio(),o=e.renderer.domElement.parentElement.clientHeight*e.renderer.getPixelRatio(),i=new Gc(r,o,i);this.vb=new L3(e.renderer,i),this.pb=new H3({w:r,h:o,scene:this.lb,camera:n.camera,renderer:e.renderer,layers:t.layers,mode:t.mode,type:t.type}),this.mb=new h3(X3),this.mb.uniforms.resolution.value.set(1/r,1/o),this.vb.addPass(this.pb),this.vb.addPass(this.mb),this.handleResize=this.handleResize.bind(this),this.handleViewChange=this.handleViewChange.bind(this),this.handleViewModeChanged=this.handleViewModeChanged.bind(this),this.da=!0,this.yb=-1,n.on("resize",this.handleResize),n.on("viewChanged",this.handleViewChange),n.on("viewModeChanged",this.handleViewModeChanged)}var t,n,e;return t=s,(n=[{key:"enable",get:function(){return this.da},set:function(t){this.da=t,this.pb.enable=t,this.lb.children.length=0}},{key:"handleViewModeChanged",value:function(){this.pb.setPass(void 0,this.es.map.camera)}},{key:"handleViewChange",value:function(){var t=this;this.es.mode!=ix.RUNTIME&&(this.enable=!1,clearTimeout(this.yb),this.yb=setTimeout(function(){t.enable=!0,t.es.map.enableUpdateRender()},500))}},{key:"handleResize",value:function(){var t=this.es.renderManager;this.vb.setSize(t.renderer.domElement.parentElement.clientWidth,t.renderer.domElement.parentElement.clientHeight)}},{key:"render",value:function(){var n=this,e=this.es.renderManager,i=!1,r=[];this.da?(this.lb.children.length=0,e.It.forEach(function(t){"model"!==t.name&&"extent"!=t.name&&"externalModel"!=t.name&&"dynamicModel"!=t.name||(("externalModel"!==t.name||"externalModel"===t.name&&i)&&0<t.children.length&&("DirectionalLight"===t.children[0].type||"AmbientLight"===t.children[0].type)&&(t.children[0].visible=!1,t.children[1].visible=!1,t.children[2].visible=!1),"externalModel"!==t.name||i||(i=!0,t.traverse(function(t){"PointLight"===t.type&&r.push(t),"Mesh"===t.type&&(t.userData.resetLight=!0)})),"model"!==t.name&&"extent"!==t.name||t.traverse(function(t){"Mesh"===t.type&&(t.userData.resetLight=!0,t.onBeforeRender=function(){r.forEach(function(t){t.userData.intensity=t.intensity,t.intensity=0})},t.onAfterRender=function(){r.forEach(function(t){t.intensity=t.userData.intensity,delete t.userData.intensity})})}),n.lb.add(t))}),this.pb.setPass(this.lb),this.vb.render(),e.renderer.setRenderTarget(null),e.It.forEach(function(t){"model"!==t.name&&"externalModel"!==t.name&&"extent"!==t.name&&"dynamicModel"!==t.name&&e.renderer.render(t,e.gn.kt)})):e.It.forEach(function(t){"externalModel"!==t.name&&0<t.children.length&&("DirectionalLight"===t.children[0].type||"AmbientLight"===t.children[0].type)&&(t.children[0].visible=!0,t.children[1].visible=!0,t.children[2].visible=!0),e.renderer.render(t,e.gn.kt)})}}])&&z3(t.prototype,n),e&&z3(t,e),Object.defineProperty(t,"prototype",{writable:!1}),s}(),Q3={WHITE:new lt(16777215),BLACK:new lt(0),TRANSPARENT:new lt(0,0,0)},Z3={clone:W3,equals:Y3,ZERO:new Mt(0,0)},q3={clone:W3,equals:Y3,ZERO:new Tt(0,0)};function K3(t,n){return null!=t?t:n}K3.EMPTY_OBJECT=Object.freeze({});var y=K3;function J3(t){return(J3="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function $3(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=J3(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=J3(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==J3(t)?t:String(t)}(i.key),i)}}var tT=function(){function e(t,n){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");this.bb=n,this.gb=new Mt(0,0),this._b=q3.clone(y(t.eyeOffset,q3.ZERO)),this.wb=y(t.verticalOrigin,T0.CENTER),this.xb=y(t.horizontalOrigin,S0.CENTER),this.Z1=y(t.scale,1)}var t,n,i;return t=e,(n=[{key:"horizontalOrigin",get:function(){return this.xb},set:function(t){this.xb=t}},{key:"verticalOrigin",get:function(){return this.wb},set:function(t){this.wb=t}},{key:"image",get:function(){return this.Eb},set:function(t){this.setImage(t,t)}},{key:"setImage",value:function(t,n){this.Sb=-1,this.Tb=void 0,this.Eb=t,this.Ab=n,I(this.bb.Mb)&&this._loadImage()}},{key:"_loadImage",value:function(){var t,e=this,i=this.bb.Mb,r=this.Eb,o=this.Ab;I(o)&&(t=i.addImage(r,o)),I(this.Ob=t)&&t.then(function(t){var n;e.Eb===r&&e.Ab===o&&(n=i.textureCoordinates[t],e.Lb=i.texture.width*n.width,e.Rb=i.texture.height*n.height,e.Sb=t,e.Nb=!0,e.Ab=void 0,e.Ob=void 0,I(t=(n=e).bb))&&(t._updateBillboard(n),n.C0=!0)}).catch(function(t){console.error("Error loading image for billboard: ".concat(t)),e.Ob=void 0})}},{key:"_setTranslate",value:function(t){var n=this.gb;Z3.equals(n,t)||Z3.clone(t,n)}}])&&$3(t.prototype,n),i&&$3(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();function nT(t){var n;this.name="DeveloperError",this.message=t;try{throw new Error}catch(t){n=t.stack}this.stack=n}I(Object.create)&&((nT.prototype=Object.create(Error.prototype)).constructor=nT),nT.prototype.toString=function(){var t="".concat(this.name,": ").concat(this.message);return I(this.stack)&&(t+="\n".concat(this.stack.toString())),t},nT.throwInstantiationError=function(){throw new nT("This function defines an interface and should not be called directly.")};var m=nT;function eT(t){return(eT="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var iT={};function rT(t,n,e){return"Expected ".concat(e," to be typeof ").concat(n,", actual typeof was ").concat(t)}iT.typeOf={},iT.defined=function(t,n){if(!I(n))throw new m("".concat(t," is required, actual value was undefined"))},iT.typeOf.func=function(t,n){if("function"!=typeof n)throw new m(rT(eT(n),"function",t))},iT.typeOf.string=function(t,n){if("string"!=typeof n)throw new m(rT(eT(n),"string",t))},iT.typeOf.number=function(t,n){if("number"!=typeof n)throw new m(rT(eT(n),"number",t))},iT.typeOf.number.lessThan=function(t,n,e){if(iT.typeOf.number(t,n),e<=n)throw new m("Expected ".concat(t," to be less than ").concat(e,", actual value was ").concat(n))},iT.typeOf.number.lessThanOrEquals=function(t,n,e){if(iT.typeOf.number(t,n),e<n)throw new m("Expected ".concat(t," to be less than or equal to ").concat(e,", actual value was ").concat(n))},iT.typeOf.number.greaterThan=function(t,n,e){if(iT.typeOf.number(t,n),n<=e)throw new m("Expected ".concat(t," to be greater than ").concat(e,", actual value was ").concat(n))},iT.typeOf.number.greaterThanOrEquals=function(t,n,e){if(iT.typeOf.number(t,n),n<e)throw new m("Expected ".concat(t," to be greater than or equal to ").concat(e,", actual value was ").concat(n))},iT.typeOf.object=function(t,n){if("object"!==eT(n))throw new m(rT(eT(n),"object",t))},iT.typeOf.bool=function(t,n){if("boolean"!=typeof n)throw new m(rT(eT(n),"boolean",t))},iT.typeOf.bigint=function(t,n){if("bigint"!=typeof n)throw new m(rT(eT(n),"bigint",t))},iT.typeOf.number.equals=function(t,n,e,i){if(iT.typeOf.number(t,e),iT.typeOf.number(n,i),e!==i)throw new m("".concat(t," must be equal to ").concat(n,", the actual values are ").concat(e," and ").concat(i))};var U=iT;function oT(t){return(oT="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function sT(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=oT(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=oT(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==oT(t)?t:String(t)}(i.key),i)}}var aT=Math.PI/180,G=function(){function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function")}var n,e,i;return n=t,i=[{key:"equalsEpsilon",value:function(t,n,e,i){if(!I(t))throw new m("left is required.");if(!I(n))throw new m("right is required.");e=y(e,0),i=y(i,e);var r=Math.abs(t-n);return r<=i||r<=e*Math.max(Math.abs(t),Math.abs(n))}},{key:"toRadians",value:function(t){if(I(t))return t*aT;throw new m("degrees is required.")}}],(e=null)&&sT(n.prototype,e),i&&sT(n,i),Object.defineProperty(n,"prototype",{writable:!1}),t}();function c(t,n,e){this.x=y(t,0),this.y=y(n,0),this.z=y(e,0)}c.fromSpherical=function(t,n){U.typeOf.object("spherical",t),I(n)||(n=new c);var e=t.clock,i=t.cone,t=y(t.magnitude,1),r=t*Math.sin(i);return n.x=r*Math.cos(e),n.y=r*Math.sin(e),n.z=t*Math.cos(i),n},c.fromElements=function(t,n,e,i){return I(i)?(i.x=t,i.y=n,i.z=e,i):new c(t,n,e)},c.fromCartesian4=c.clone=function(t,n){if(I(t))return I(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n):new c(t.x,t.y,t.z)},c.packedLength=3,c.pack=function(t,n,e){return U.typeOf.object("value",t),U.defined("array",n),e=y(e,0),n[e++]=t.x,n[e++]=t.y,n[e]=t.z,n},c.unpack=function(t,n,e){return U.defined("array",t),n=y(n,0),(e=I(e)?e:new c).x=t[n++],e.y=t[n++],e.z=t[n],e},c.packArray=function(t,n){U.defined("array",t);var e=t.length,i=3*e;if(I(n)){if(!Array.isArray(n)&&n.length!==i)throw new m("If result is a typed array, it must have exactly array.length * 3 elements");n.length!==i&&(n.length=i)}else n=new Array(i);for(var r=0;r<e;++r)c.pack(t[r],n,3*r);return n},c.unpackArray=function(t,n){if(U.defined("array",t),U.typeOf.number.greaterThanOrEquals("array.length",t.length,3),t.length%3!=0)throw new m("array length must be a multiple of 3.");var e=t.length;I(n)?n.length=e/3:n=new Array(e/3);for(var i=0;i<e;i+=3){var r=i/3;n[r]=c.unpack(t,i,n[r])}return n},c.fromArray=c.unpack,c.maximumComponent=function(t){return U.typeOf.object("cartesian",t),Math.max(t.x,t.y,t.z)},c.minimumComponent=function(t){return U.typeOf.object("cartesian",t),Math.min(t.x,t.y,t.z)},c.minimumByComponent=function(t,n,e){return U.typeOf.object("first",t),U.typeOf.object("second",n),U.typeOf.object("result",e),e.x=Math.min(t.x,n.x),e.y=Math.min(t.y,n.y),e.z=Math.min(t.z,n.z),e},c.maximumByComponent=function(t,n,e){return U.typeOf.object("first",t),U.typeOf.object("second",n),U.typeOf.object("result",e),e.x=Math.max(t.x,n.x),e.y=Math.max(t.y,n.y),e.z=Math.max(t.z,n.z),e},c.clamp=function(t,n,e,i){U.typeOf.object("value",t),U.typeOf.object("min",n),U.typeOf.object("max",e),U.typeOf.object("result",i);var r=G.clamp(t.x,n.x,e.x),o=G.clamp(t.y,n.y,e.y),t=G.clamp(t.z,n.z,e.z);return i.x=r,i.y=o,i.z=t,i},c.magnitudeSquared=function(t){return U.typeOf.object("cartesian",t),t.x*t.x+t.y*t.y+t.z*t.z},c.magnitude=function(t){return Math.sqrt(c.magnitudeSquared(t))};var uT=new c,cT=(c.distance=function(t,n){return U.typeOf.object("left",t),U.typeOf.object("right",n),c.subtract(t,n,uT),c.magnitude(uT)},c.distanceSquared=function(t,n){return U.typeOf.object("left",t),U.typeOf.object("right",n),c.subtract(t,n,uT),c.magnitudeSquared(uT)},c.normalize=function(t,n){U.typeOf.object("cartesian",t),U.typeOf.object("result",n);var e=c.magnitude(t);if(n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,isNaN(n.x)||isNaN(n.y)||isNaN(n.z))throw new m("normalized result is not a number");return n},c.dot=function(t,n){return U.typeOf.object("left",t),U.typeOf.object("right",n),t.x*n.x+t.y*n.y+t.z*n.z},c.multiplyComponents=function(t,n,e){return U.typeOf.object("left",t),U.typeOf.object("right",n),U.typeOf.object("result",e),e.x=t.x*n.x,e.y=t.y*n.y,e.z=t.z*n.z,e},c.divideComponents=function(t,n,e){return U.typeOf.object("left",t),U.typeOf.object("right",n),U.typeOf.object("result",e),e.x=t.x/n.x,e.y=t.y/n.y,e.z=t.z/n.z,e},c.add=function(t,n,e){return U.typeOf.object("left",t),U.typeOf.object("right",n),U.typeOf.object("result",e),e.x=t.x+n.x,e.y=t.y+n.y,e.z=t.z+n.z,e},c.subtract=function(t,n,e){return U.typeOf.object("left",t),U.typeOf.object("right",n),U.typeOf.object("result",e),e.x=t.x-n.x,e.y=t.y-n.y,e.z=t.z-n.z,e},c.multiplyByScalar=function(t,n,e){return U.typeOf.object("cartesian",t),U.typeOf.number("scalar",n),U.typeOf.object("result",e),e.x=t.x*n,e.y=t.y*n,e.z=t.z*n,e},c.divideByScalar=function(t,n,e){return U.typeOf.object("cartesian",t),U.typeOf.number("scalar",n),U.typeOf.object("result",e),e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e},c.negate=function(t,n){return U.typeOf.object("cartesian",t),U.typeOf.object("result",n),n.x=-t.x,n.y=-t.y,n.z=-t.z,n},c.abs=function(t,n){return U.typeOf.object("cartesian",t),U.typeOf.object("result",n),n.x=Math.abs(t.x),n.y=Math.abs(t.y),n.z=Math.abs(t.z),n},new c),hT=(c.lerp=function(t,n,e,i){return U.typeOf.object("start",t),U.typeOf.object("end",n),U.typeOf.number("t",e),U.typeOf.object("result",i),c.multiplyByScalar(n,e,cT),i=c.multiplyByScalar(t,1-e,i),c.add(cT,i,i)},new c),fT=new c,lT=(c.angleBetween=function(t,n){U.typeOf.object("left",t),U.typeOf.object("right",n),c.normalize(t,hT),c.normalize(n,fT);t=c.dot(hT,fT),n=c.magnitude(c.cross(hT,fT,hT));return Math.atan2(n,t)},new c),dT=(c.mostOrthogonalAxis=function(t,n){U.typeOf.object("cartesian",t),U.typeOf.object("result",n);t=c.normalize(t,lT);return c.abs(t,t),n=t.x<=t.y?t.x<=t.z?c.clone(c.UNIT_X,n):c.clone(c.UNIT_Z,n):t.y<=t.z?c.clone(c.UNIT_Y,n):c.clone(c.UNIT_Z,n)},c.projectVector=function(t,n,e){U.defined("a",t),U.defined("b",n),U.defined("result",e);t=c.dot(t,n)/c.dot(n,n);return c.multiplyByScalar(n,t,e)},c.equals=function(t,n){return t===n||I(t)&&I(n)&&t.x===n.x&&t.y===n.y&&t.z===n.z},c.equalsArray=function(t,n,e){return t.x===n[e]&&t.y===n[e+1]&&t.z===n[e+2]},c.equalsEpsilon=function(t,n,e,i){return t===n||I(t)&&I(n)&&G.equalsEpsilon(t.x,n.x,e,i)&&G.equalsEpsilon(t.y,n.y,e,i)&&G.equalsEpsilon(t.z,n.z,e,i)},c.cross=function(t,n,e){U.typeOf.object("left",t),U.typeOf.object("right",n),U.typeOf.object("result",e);var i=t.x,r=t.y,t=t.z,o=n.x,s=n.y,n=n.z,a=t*o-i*n,i=i*s-r*o;return e.x=r*n-t*s,e.y=a,e.z=i,e},c.midpoint=function(t,n,e){return U.typeOf.object("left",t),U.typeOf.object("right",n),U.typeOf.object("result",e),e.x=.5*(t.x+n.x),e.y=.5*(t.y+n.y),e.z=.5*(t.z+n.z),e},c.fromDegrees=function(t,n,e,i,r){return U.typeOf.number("longitude",t),U.typeOf.number("latitude",n),t=G.toRadians(t),n=G.toRadians(n),c.fromRadians(t,n,e,i,r)},new c),vT=new c,pT=new c(40680631590769,40680631590769,40408299984661.445),b=(c.fromRadians=function(t,n,e,i,r){U.typeOf.number("longitude",t),U.typeOf.number("latitude",n),e=y(e,0);var i=I(i)?i.radiiSquared:pT,o=Math.cos(n),o=(dT.x=o*Math.cos(t),dT.y=o*Math.sin(t),dT.z=Math.sin(n),dT=c.normalize(dT,dT),c.multiplyComponents(i,dT,vT),Math.sqrt(c.dot(dT,vT)));return vT=c.divideByScalar(vT,o,vT),dT=c.multiplyByScalar(dT,e,dT),I(r)||(r=new c),c.add(vT,dT,r)},c.fromDegreesArray=function(t,n,e){if(U.defined("coordinates",t),t.length<2||t.length%2!=0)throw new m("the number of coordinates must be a multiple of 2 and at least 2");var i=t.length;I(e)?e.length=i/2:e=new Array(i/2);for(var r=0;r<i;r+=2){var o=t[r],s=t[r+1],a=r/2;e[a]=c.fromDegrees(o,s,0,n,e[a])}return e},c.fromRadiansArray=function(t,n,e){if(U.defined("coordinates",t),t.length<2||t.length%2!=0)throw new m("the number of coordinates must be a multiple of 2 and at least 2");var i=t.length;I(e)?e.length=i/2:e=new Array(i/2);for(var r=0;r<i;r+=2){var o=t[r],s=t[r+1],a=r/2;e[a]=c.fromRadians(o,s,0,n,e[a])}return e},c.fromDegreesArrayHeights=function(t,n,e){if(U.defined("coordinates",t),t.length<3||t.length%3!=0)throw new m("the number of coordinates must be a multiple of 3 and at least 3");var i=t.length;I(e)?e.length=i/3:e=new Array(i/3);for(var r=0;r<i;r+=3){var o=t[r],s=t[r+1],a=t[r+2],u=r/3;e[u]=c.fromDegrees(o,s,a,n,e[u])}return e},c.fromRadiansArrayHeights=function(t,n,e){if(U.defined("coordinates",t),t.length<3||t.length%3!=0)throw new m("the number of coordinates must be a multiple of 3 and at least 3");var i=t.length;I(e)?e.length=i/3:e=new Array(i/3);for(var r=0;r<i;r+=3){var o=t[r],s=t[r+1],a=t[r+2],u=r/3;e[u]=c.fromRadians(o,s,a,n,e[u])}return e},c.ZERO=Object.freeze(new c(0,0,0)),c.ONE=Object.freeze(new c(1,1,1)),c.UNIT_X=Object.freeze(new c(1,0,0)),c.UNIT_Y=Object.freeze(new c(0,1,0)),c.UNIT_Z=Object.freeze(new c(0,0,1)),c.prototype.clone=function(t){return c.clone(this,t)},c.prototype.equals=function(t){return c.equals(this,t)},c.prototype.equalsEpsilon=function(t,n,e){return c.equalsEpsilon(this,t,n,e)},c.prototype.toString=function(){return"(".concat(this.x,", ").concat(this.y,", ").concat(this.z,")")},c);function o(t,n,e,i){this.x=y(t,0),this.y=y(n,0),this.z=y(e,0),this.w=y(i,0)}o.fromElements=function(t,n,e,i,r){return I(r)?(r.x=t,r.y=n,r.z=e,r.w=i,r):new o(t,n,e,i)},o.fromColor=function(t,n){return U.typeOf.object("color",t),I(n)?(n.x=t.red,n.y=t.green,n.z=t.blue,n.w=t.alpha,n):new o(t.red,t.green,t.blue,t.alpha)},o.clone=function(t,n){if(I(t))return I(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n.w=t.w,n):new o(t.x,t.y,t.z,t.w)},o.packedLength=4,o.pack=function(t,n,e){return U.typeOf.object("value",t),U.defined("array",n),e=y(e,0),n[e++]=t.x,n[e++]=t.y,n[e++]=t.z,n[e]=t.w,n},o.unpack=function(t,n,e){return U.defined("array",t),n=y(n,0),(e=I(e)?e:new o).x=t[n++],e.y=t[n++],e.z=t[n++],e.w=t[n],e},o.packArray=function(t,n){U.defined("array",t);var e=t.length,i=4*e;if(I(n)){if(!Array.isArray(n)&&n.length!==i)throw new m("If result is a typed array, it must have exactly array.length * 4 elements");n.length!==i&&(n.length=i)}else n=new Array(i);for(var r=0;r<e;++r)o.pack(t[r],n,4*r);return n},o.unpackArray=function(t,n){if(U.defined("array",t),U.typeOf.number.greaterThanOrEquals("array.length",t.length,4),t.length%4!=0)throw new m("array length must be a multiple of 4.");var e=t.length;I(n)?n.length=e/4:n=new Array(e/4);for(var i=0;i<e;i+=4){var r=i/4;n[r]=o.unpack(t,i,n[r])}return n},o.fromArray=o.unpack,o.maximumComponent=function(t){return U.typeOf.object("cartesian",t),Math.max(t.x,t.y,t.z,t.w)},o.minimumComponent=function(t){return U.typeOf.object("cartesian",t),Math.min(t.x,t.y,t.z,t.w)},o.minimumByComponent=function(t,n,e){return U.typeOf.object("first",t),U.typeOf.object("second",n),U.typeOf.object("result",e),e.x=Math.min(t.x,n.x),e.y=Math.min(t.y,n.y),e.z=Math.min(t.z,n.z),e.w=Math.min(t.w,n.w),e},o.maximumByComponent=function(t,n,e){return U.typeOf.object("first",t),U.typeOf.object("second",n),U.typeOf.object("result",e),e.x=Math.max(t.x,n.x),e.y=Math.max(t.y,n.y),e.z=Math.max(t.z,n.z),e.w=Math.max(t.w,n.w),e},o.clamp=function(t,n,e,i){U.typeOf.object("value",t),U.typeOf.object("min",n),U.typeOf.object("max",e),U.typeOf.object("result",i);var r=G.clamp(t.x,n.x,e.x),o=G.clamp(t.y,n.y,e.y),s=G.clamp(t.z,n.z,e.z),t=G.clamp(t.w,n.w,e.w);return i.x=r,i.y=o,i.z=s,i.w=t,i},o.magnitudeSquared=function(t){return U.typeOf.object("cartesian",t),t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w},o.magnitude=function(t){return Math.sqrt(o.magnitudeSquared(t))};var mT=new o,yT=(o.distance=function(t,n){return U.typeOf.object("left",t),U.typeOf.object("right",n),o.subtract(t,n,mT),o.magnitude(mT)},o.distanceSquared=function(t,n){return U.typeOf.object("left",t),U.typeOf.object("right",n),o.subtract(t,n,mT),o.magnitudeSquared(mT)},o.normalize=function(t,n){U.typeOf.object("cartesian",t),U.typeOf.object("result",n);var e=o.magnitude(t);if(n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,n.w=t.w/e,isNaN(n.x)||isNaN(n.y)||isNaN(n.z)||isNaN(n.w))throw new m("normalized result is not a number");return n},o.dot=function(t,n){return U.typeOf.object("left",t),U.typeOf.object("right",n),t.x*n.x+t.y*n.y+t.z*n.z+t.w*n.w},o.multiplyComponents=function(t,n,e){return U.typeOf.object("left",t),U.typeOf.object("right",n),U.typeOf.object("result",e),e.x=t.x*n.x,e.y=t.y*n.y,e.z=t.z*n.z,e.w=t.w*n.w,e},o.divideComponents=function(t,n,e){return U.typeOf.object("left",t),U.typeOf.object("right",n),U.typeOf.object("result",e),e.x=t.x/n.x,e.y=t.y/n.y,e.z=t.z/n.z,e.w=t.w/n.w,e},o.add=function(t,n,e){return U.typeOf.object("left",t),U.typeOf.object("right",n),U.typeOf.object("result",e),e.x=t.x+n.x,e.y=t.y+n.y,e.z=t.z+n.z,e.w=t.w+n.w,e},o.subtract=function(t,n,e){return U.typeOf.object("left",t),U.typeOf.object("right",n),U.typeOf.object("result",e),e.x=t.x-n.x,e.y=t.y-n.y,e.z=t.z-n.z,e.w=t.w-n.w,e},o.multiplyByScalar=function(t,n,e){return U.typeOf.object("cartesian",t),U.typeOf.number("scalar",n),U.typeOf.object("result",e),e.x=t.x*n,e.y=t.y*n,e.z=t.z*n,e.w=t.w*n,e},o.divideByScalar=function(t,n,e){return U.typeOf.object("cartesian",t),U.typeOf.number("scalar",n),U.typeOf.object("result",e),e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e.w=t.w/n,e},o.negate=function(t,n){return U.typeOf.object("cartesian",t),U.typeOf.object("result",n),n.x=-t.x,n.y=-t.y,n.z=-t.z,n.w=-t.w,n},o.abs=function(t,n){return U.typeOf.object("cartesian",t),U.typeOf.object("result",n),n.x=Math.abs(t.x),n.y=Math.abs(t.y),n.z=Math.abs(t.z),n.w=Math.abs(t.w),n},new o),bT=(o.lerp=function(t,n,e,i){return U.typeOf.object("start",t),U.typeOf.object("end",n),U.typeOf.number("t",e),U.typeOf.object("result",i),o.multiplyByScalar(n,e,yT),i=o.multiplyByScalar(t,1-e,i),o.add(yT,i,i)},new o),gT=(o.mostOrthogonalAxis=function(t,n){U.typeOf.object("cartesian",t),U.typeOf.object("result",n);t=o.normalize(t,bT);return o.abs(t,t),n=t.x<=t.y?t.x<=t.z?t.x<=t.w?o.clone(o.UNIT_X,n):o.clone(o.UNIT_W,n):t.z<=t.w?o.clone(o.UNIT_Z,n):o.clone(o.UNIT_W,n):t.y<=t.z?t.y<=t.w?o.clone(o.UNIT_Y,n):o.clone(o.UNIT_W,n):t.z<=t.w?o.clone(o.UNIT_Z,n):o.clone(o.UNIT_W,n)},o.equals=function(t,n){return t===n||I(t)&&I(n)&&t.x===n.x&&t.y===n.y&&t.z===n.z&&t.w===n.w},o.equalsArray=function(t,n,e){return t.x===n[e]&&t.y===n[e+1]&&t.z===n[e+2]&&t.w===n[e+3]},o.equalsEpsilon=function(t,n,e,i){return t===n||I(t)&&I(n)&&G.equalsEpsilon(t.x,n.x,e,i)&&G.equalsEpsilon(t.y,n.y,e,i)&&G.equalsEpsilon(t.z,n.z,e,i)&&G.equalsEpsilon(t.w,n.w,e,i)},o.ZERO=Object.freeze(new o(0,0,0,0)),o.ONE=Object.freeze(new o(1,1,1,1)),o.UNIT_X=Object.freeze(new o(1,0,0,0)),o.UNIT_Y=Object.freeze(new o(0,1,0,0)),o.UNIT_Z=Object.freeze(new o(0,0,1,0)),o.UNIT_W=Object.freeze(new o(0,0,0,1)),o.prototype.clone=function(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.prototype.equalsEpsilon=function(t,n,e){return o.equalsEpsilon(this,t,n,e)},o.prototype.toString=function(){return"(".concat(this.x,", ").concat(this.y,", ").concat(this.z,", ").concat(this.w,")")},new Float32Array(1)),_T=new Uint8Array(gT.buffer),fb=new Uint32Array([287454020]),wT=68===new Uint8Array(fb.buffer)[0],xT=(o.packFloat=function(t,n){return U.typeOf.number("value",t),I(n)||(n=new o),gT[0]=t,wT?(n.x=_T[0],n.y=_T[1],n.z=_T[2],n.w=_T[3]):(n.x=_T[3],n.y=_T[2],n.z=_T[1],n.w=_T[0]),n},o.unpackFloat=function(t){return U.typeOf.object("packedFloat",t),wT?(_T[0]=t.x,_T[1]=t.y,_T[2]=t.z,_T[3]=t.w):(_T[0]=t.w,_T[1]=t.z,_T[2]=t.y,_T[3]=t.x),gT[0]},o);function g(t,n,e,i,r,o,s,a,u){this[0]=y(t,0),this[1]=y(i,0),this[2]=y(s,0),this[3]=y(n,0),this[4]=y(r,0),this[5]=y(a,0),this[6]=y(e,0),this[7]=y(o,0),this[8]=y(u,0)}g.packedLength=9,g.pack=function(t,n,e){return U.typeOf.object("value",t),U.defined("array",n),e=y(e,0),n[e++]=t[0],n[e++]=t[1],n[e++]=t[2],n[e++]=t[3],n[e++]=t[4],n[e++]=t[5],n[e++]=t[6],n[e++]=t[7],n[e++]=t[8],n},g.unpack=function(t,n,e){return U.defined("array",t),n=y(n,0),(e=I(e)?e:new g)[0]=t[n++],e[1]=t[n++],e[2]=t[n++],e[3]=t[n++],e[4]=t[n++],e[5]=t[n++],e[6]=t[n++],e[7]=t[n++],e[8]=t[n++],e},g.packArray=function(t,n){U.defined("array",t);var e=t.length,i=9*e;if(I(n)){if(!Array.isArray(n)&&n.length!==i)throw new m("If result is a typed array, it must have exactly array.length * 9 elements");n.length!==i&&(n.length=i)}else n=new Array(i);for(var r=0;r<e;++r)g.pack(t[r],n,9*r);return n},g.unpackArray=function(t,n){if(U.defined("array",t),U.typeOf.number.greaterThanOrEquals("array.length",t.length,9),t.length%9!=0)throw new m("array length must be a multiple of 9.");var e=t.length;I(n)?n.length=e/9:n=new Array(e/9);for(var i=0;i<e;i+=9){var r=i/9;n[r]=g.unpack(t,i,n[r])}return n},g.clone=function(t,n){if(I(t))return I(n)?(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n):new g(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8])},g.fromArray=g.unpack,g.fromColumnMajorArray=function(t,n){return U.defined("values",t),g.clone(t,n)},g.fromRowMajorArray=function(t,n){return U.defined("values",t),I(n)?(n[0]=t[0],n[1]=t[3],n[2]=t[6],n[3]=t[1],n[4]=t[4],n[5]=t[7],n[6]=t[2],n[7]=t[5],n[8]=t[8],n):new g(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},g.fromQuaternion=function(t,n){U.typeOf.object("quaternion",t);var e=t.x*t.x,i=t.x*t.y,r=t.x*t.z,o=t.x*t.w,s=t.y*t.y,a=t.y*t.z,u=t.y*t.w,c=t.z*t.z,h=t.z*t.w,t=t.w*t.w,f=e-s-c+t,l=2*(i-h),d=2*(r+u),i=2*(i+h),h=s-e-c+t,v=2*(a-o),r=2*(r-u),u=2*(a+o),a=-e-s+c+t;return I(n)?(n[0]=f,n[1]=i,n[2]=r,n[3]=l,n[4]=h,n[5]=u,n[6]=d,n[7]=v,n[8]=a,n):new g(f,l,d,i,h,v,r,u,a)},g.fromHeadingPitchRoll=function(t,n){U.typeOf.object("headingPitchRoll",t);var e=Math.cos(-t.pitch),i=Math.cos(-t.heading),r=Math.cos(t.roll),o=Math.sin(-t.pitch),s=Math.sin(-t.heading),t=Math.sin(t.roll),a=e*i,u=-r*s+t*o*i,c=t*s+r*o*i,h=e*s,f=r*i+t*o*s,i=-t*i+r*o*s,s=-o,o=t*e,t=r*e;return I(n)?(n[0]=a,n[1]=h,n[2]=s,n[3]=u,n[4]=f,n[5]=o,n[6]=c,n[7]=i,n[8]=t,n):new g(a,u,c,h,f,i,s,o,t)},g.fromScale=function(t,n){return U.typeOf.object("scale",t),I(n)?(n[0]=t.x,n[1]=0,n[2]=0,n[3]=0,n[4]=t.y,n[5]=0,n[6]=0,n[7]=0,n[8]=t.z,n):new g(t.x,0,0,0,t.y,0,0,0,t.z)},g.fromUniformScale=function(t,n){return U.typeOf.number("scale",t),I(n)?(n[0]=t,n[1]=0,n[2]=0,n[3]=0,n[4]=t,n[5]=0,n[6]=0,n[7]=0,n[8]=t,n):new g(t,0,0,0,t,0,0,0,t)},g.fromCrossProduct=function(t,n){return U.typeOf.object("vector",t),I(n)?(n[0]=0,n[1]=t.z,n[2]=-t.y,n[3]=-t.z,n[4]=0,n[5]=t.x,n[6]=t.y,n[7]=-t.x,n[8]=0,n):new g(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},g.fromRotationX=function(t,n){U.typeOf.number("angle",t);var e=Math.cos(t),t=Math.sin(t);return I(n)?(n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=e,n[5]=t,n[6]=0,n[7]=-t,n[8]=e,n):new g(1,0,0,0,e,-t,0,t,e)},g.fromRotationY=function(t,n){U.typeOf.number("angle",t);var e=Math.cos(t),t=Math.sin(t);return I(n)?(n[0]=e,n[1]=0,n[2]=-t,n[3]=0,n[4]=1,n[5]=0,n[6]=t,n[7]=0,n[8]=e,n):new g(e,0,t,0,1,0,-t,0,e)},g.fromRotationZ=function(t,n){U.typeOf.number("angle",t);var e=Math.cos(t),t=Math.sin(t);return I(n)?(n[0]=e,n[1]=t,n[2]=0,n[3]=-t,n[4]=e,n[5]=0,n[6]=0,n[7]=0,n[8]=1,n):new g(e,-t,0,t,e,0,0,0,1)},g.toArray=function(t,n){return U.typeOf.object("matrix",t),I(n)?(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},g.getElementIndex=function(t,n){return U.typeOf.number.greaterThanOrEquals("row",n,0),U.typeOf.number.lessThanOrEquals("row",n,2),U.typeOf.number.greaterThanOrEquals("column",t,0),U.typeOf.number.lessThanOrEquals("column",t,2),3*t+n},g.getColumn=function(t,n,e){U.typeOf.object("matrix",t),U.typeOf.number.greaterThanOrEquals("index",n,0),U.typeOf.number.lessThanOrEquals("index",n,2),U.typeOf.object("result",e);var n=3*n,i=t[n],r=t[1+n],t=t[2+n];return e.x=i,e.y=r,e.z=t,e},g.setColumn=function(t,n,e,i){U.typeOf.object("matrix",t),U.typeOf.number.greaterThanOrEquals("index",n,0),U.typeOf.number.lessThanOrEquals("index",n,2),U.typeOf.object("cartesian",e),U.typeOf.object("result",i);n*=3;return(i=g.clone(t,i))[n]=e.x,i[1+n]=e.y,i[2+n]=e.z,i},g.getRow=function(t,n,e){U.typeOf.object("matrix",t),U.typeOf.number.greaterThanOrEquals("index",n,0),U.typeOf.number.lessThanOrEquals("index",n,2),U.typeOf.object("result",e);var i=t[n],r=t[n+3],t=t[n+6];return e.x=i,e.y=r,e.z=t,e},g.setRow=function(t,n,e,i){return U.typeOf.object("matrix",t),U.typeOf.number.greaterThanOrEquals("index",n,0),U.typeOf.number.lessThanOrEquals("index",n,2),U.typeOf.object("cartesian",e),U.typeOf.object("result",i),(i=g.clone(t,i))[n]=e.x,i[n+3]=e.y,i[n+6]=e.z,i};var ET=new b,ST=(g.setScale=function(t,n,e){U.typeOf.object("matrix",t),U.typeOf.object("scale",n),U.typeOf.object("result",e);var i=g.getScale(t,ET),r=n.x/i.x,o=n.y/i.y,n=n.z/i.z;return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*o,e[4]=t[4]*o,e[5]=t[5]*o,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e},new b),TT=(g.setUniformScale=function(t,n,e){U.typeOf.object("matrix",t),U.typeOf.number("scale",n),U.typeOf.object("result",e);var i=g.getScale(t,ST),r=n/i.x,o=n/i.y,n=n/i.z;return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*o,e[4]=t[4]*o,e[5]=t[5]*o,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e},new b),AT=(g.getScale=function(t,n){return U.typeOf.object("matrix",t),U.typeOf.object("result",n),n.x=b.magnitude(b.fromElements(t[0],t[1],t[2],TT)),n.y=b.magnitude(b.fromElements(t[3],t[4],t[5],TT)),n.z=b.magnitude(b.fromElements(t[6],t[7],t[8],TT)),n},new b),MT=(g.getMaximumScale=function(t){return g.getScale(t,AT),b.maximumComponent(AT)},new b),OT=(g.setRotation=function(t,n,e){U.typeOf.object("matrix",t),U.typeOf.object("result",e);t=g.getScale(t,MT);return e[0]=n[0]*t.x,e[1]=n[1]*t.x,e[2]=n[2]*t.x,e[3]=n[3]*t.y,e[4]=n[4]*t.y,e[5]=n[5]*t.y,e[6]=n[6]*t.z,e[7]=n[7]*t.z,e[8]=n[8]*t.z,e},new b);g.getRotation=function(t,n){U.typeOf.object("matrix",t),U.typeOf.object("result",n);var e=g.getScale(t,OT);return n[0]=t[0]/e.x,n[1]=t[1]/e.x,n[2]=t[2]/e.x,n[3]=t[3]/e.y,n[4]=t[4]/e.y,n[5]=t[5]/e.y,n[6]=t[6]/e.z,n[7]=t[7]/e.z,n[8]=t[8]/e.z,n},g.multiply=function(t,n,e){U.typeOf.object("left",t),U.typeOf.object("right",n),U.typeOf.object("result",e);var i=t[0]*n[0]+t[3]*n[1]+t[6]*n[2],r=t[1]*n[0]+t[4]*n[1]+t[7]*n[2],o=t[2]*n[0]+t[5]*n[1]+t[8]*n[2],s=t[0]*n[3]+t[3]*n[4]+t[6]*n[5],a=t[1]*n[3]+t[4]*n[4]+t[7]*n[5],u=t[2]*n[3]+t[5]*n[4]+t[8]*n[5],c=t[0]*n[6]+t[3]*n[7]+t[6]*n[8],h=t[1]*n[6]+t[4]*n[7]+t[7]*n[8],t=t[2]*n[6]+t[5]*n[7]+t[8]*n[8];return e[0]=i,e[1]=r,e[2]=o,e[3]=s,e[4]=a,e[5]=u,e[6]=c,e[7]=h,e[8]=t,e},g.add=function(t,n,e){return U.typeOf.object("left",t),U.typeOf.object("right",n),U.typeOf.object("result",e),e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e},g.subtract=function(t,n,e){return U.typeOf.object("left",t),U.typeOf.object("right",n),U.typeOf.object("result",e),e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e},g.multiplyByVector=function(t,n,e){U.typeOf.object("matrix",t),U.typeOf.object("cartesian",n),U.typeOf.object("result",e);var i=n.x,r=n.y,n=n.z,o=t[0]*i+t[3]*r+t[6]*n,s=t[1]*i+t[4]*r+t[7]*n,i=t[2]*i+t[5]*r+t[8]*n;return e.x=o,e.y=s,e.z=i,e},g.multiplyByScalar=function(t,n,e){return U.typeOf.object("matrix",t),U.typeOf.number("scalar",n),U.typeOf.object("result",e),e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e},g.multiplyByScale=function(t,n,e){return U.typeOf.object("matrix",t),U.typeOf.object("scale",n),U.typeOf.object("result",e),e[0]=t[0]*n.x,e[1]=t[1]*n.x,e[2]=t[2]*n.x,e[3]=t[3]*n.y,e[4]=t[4]*n.y,e[5]=t[5]*n.y,e[6]=t[6]*n.z,e[7]=t[7]*n.z,e[8]=t[8]*n.z,e},g.multiplyByUniformScale=function(t,n,e){return U.typeOf.object("matrix",t),U.typeOf.number("scale",n),U.typeOf.object("result",e),e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e},g.negate=function(t,n){return U.typeOf.object("matrix",t),U.typeOf.object("result",n),n[0]=-t[0],n[1]=-t[1],n[2]=-t[2],n[3]=-t[3],n[4]=-t[4],n[5]=-t[5],n[6]=-t[6],n[7]=-t[7],n[8]=-t[8],n},g.transpose=function(t,n){U.typeOf.object("matrix",t),U.typeOf.object("result",n);var e=t[0],i=t[3],r=t[6],o=t[1],s=t[4],a=t[7],u=t[2],c=t[5],t=t[8];return n[0]=e,n[1]=i,n[2]=r,n[3]=o,n[4]=s,n[5]=a,n[6]=u,n[7]=c,n[8]=t,n};var LT=[1,0,0],RT=[2,2,1];var NT=new g,PT=new g,FT=(g.computeEigenDecomposition=function(t,n){U.typeOf.object("matrix",t);for(var e=G.EPSILON20,i=0,r=0,o=(n=I(n)?n:{}).unitary=g.clone(g.IDENTITY,n.unitary),s=n.diagonal=g.clone(t,n.diagonal),a=e*function(t){for(var n=0,e=0;e<9;++e){var i=t[e];n+=i*i}return Math.sqrt(n)}(s);r<10&&function(t){for(var n=0,e=0;e<3;++e){var i=t[g.getElementIndex(RT[e],LT[e])];n+=2*i*i}return Math.sqrt(n)}(s)>a;){b=y=m=p=v=d=l=f=h=c=u=void 0;for(var u=s,c=NT,h=G.EPSILON15,f=0,l=1,d=0;d<3;++d){var v=Math.abs(u[g.getElementIndex(RT[d],LT[d])]);f<v&&(l=d,f=v)}var p=1,m=0,y=LT[l],b=RT[l];Math.abs(u[g.getElementIndex(b,y)])>h&&(m=(h=(h=(u[g.getElementIndex(b,b)]-u[g.getElementIndex(y,y)])/2/u[g.getElementIndex(b,y)])<0?-1/(-h+Math.sqrt(1+h*h)):1/(h+Math.sqrt(1+h*h)))*(p=1/Math.sqrt(1+h*h))),(c=g.clone(g.IDENTITY,c))[g.getElementIndex(y,y)]=c[g.getElementIndex(b,b)]=p,c[g.getElementIndex(b,y)]=m,c[g.getElementIndex(y,b)]=-m,g.transpose(NT,PT),g.multiply(s,NT,s),g.multiply(PT,s,s),g.multiply(o,NT,o),2<++i&&(++r,i=0)}return n},g.abs=function(t,n){return U.typeOf.object("matrix",t),U.typeOf.object("result",n),n[0]=Math.abs(t[0]),n[1]=Math.abs(t[1]),n[2]=Math.abs(t[2]),n[3]=Math.abs(t[3]),n[4]=Math.abs(t[4]),n[5]=Math.abs(t[5]),n[6]=Math.abs(t[6]),n[7]=Math.abs(t[7]),n[8]=Math.abs(t[8]),n},g.determinant=function(t){U.typeOf.object("matrix",t);var n=t[0],e=t[3],i=t[6],r=t[1],o=t[4],s=t[7],a=t[2],u=t[5],t=t[8];return n*(o*t-u*s)+r*(u*i-e*t)+a*(e*s-o*i)},g.inverse=function(t,n){U.typeOf.object("matrix",t),U.typeOf.object("result",n);var e=t[0],i=t[1],r=t[2],o=t[3],s=t[4],a=t[5],u=t[6],c=t[7],h=t[8],t=g.determinant(t);if(Math.abs(t)<=G.EPSILON15)throw new m("matrix is not invertible");return n[0]=s*h-c*a,n[1]=c*r-i*h,n[2]=i*a-s*r,n[3]=u*a-o*h,n[4]=e*h-u*r,n[5]=o*r-e*a,n[6]=o*c-u*s,n[7]=u*i-e*c,n[8]=e*s-o*i,g.multiplyByScalar(n,1/t,n)},new g),jT=(g.inverseTranspose=function(t,n){return U.typeOf.object("matrix",t),U.typeOf.object("result",n),g.inverse(g.transpose(t,FT),n)},g.equals=function(t,n){return t===n||I(t)&&I(n)&&t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]&&t[4]===n[4]&&t[5]===n[5]&&t[6]===n[6]&&t[7]===n[7]&&t[8]===n[8]},g.equalsEpsilon=function(t,n,e){return e=y(e,0),t===n||I(t)&&I(n)&&Math.abs(t[0]-n[0])<=e&&Math.abs(t[1]-n[1])<=e&&Math.abs(t[2]-n[2])<=e&&Math.abs(t[3]-n[3])<=e&&Math.abs(t[4]-n[4])<=e&&Math.abs(t[5]-n[5])<=e&&Math.abs(t[6]-n[6])<=e&&Math.abs(t[7]-n[7])<=e&&Math.abs(t[8]-n[8])<=e},g.IDENTITY=Object.freeze(new g(1,0,0,0,1,0,0,0,1)),g.ZERO=Object.freeze(new g(0,0,0,0,0,0,0,0,0)),g.COLUMN0ROW0=0,g.COLUMN0ROW1=1,g.COLUMN0ROW2=2,g.COLUMN1ROW0=3,g.COLUMN1ROW1=4,g.COLUMN1ROW2=5,g.COLUMN2ROW0=6,g.COLUMN2ROW1=7,g.COLUMN2ROW2=8,Object.defineProperties(g.prototype,{length:{get:function(){return g.packedLength}}}),g.prototype.clone=function(t){return g.clone(this,t)},g.prototype.equals=function(t){return g.equals(this,t)},g.equalsArray=function(t,n,e){return t[0]===n[e]&&t[1]===n[e+1]&&t[2]===n[e+2]&&t[3]===n[e+3]&&t[4]===n[e+4]&&t[5]===n[e+5]&&t[6]===n[e+6]&&t[7]===n[e+7]&&t[8]===n[e+8]},g.prototype.equalsEpsilon=function(t,n){return g.equalsEpsilon(this,t,n)},g.prototype.toString=function(){return"(".concat(this[0],", ").concat(this[3],", ").concat(this[6],")\n")+"(".concat(this[1],", ").concat(this[4],", ").concat(this[7],")\n")+"(".concat(this[2],", ").concat(this[5],", ").concat(this[8],")")},g);function IT(t){var n;this.name="RuntimeError",this.message=t;try{throw new Error}catch(t){n=t.stack}this.stack=n}I(Object.create)&&((IT.prototype=Object.create(Error.prototype)).constructor=IT),IT.prototype.toString=function(){var t="".concat(this.name,": ").concat(this.message);return I(this.stack)&&(t+="\n".concat(this.stack.toString())),t};var CT=IT;function H(t,n,e,i,r,o,s,a,u,c,h,f,l,d,v,p){this[0]=y(t,0),this[1]=y(r,0),this[2]=y(u,0),this[3]=y(l,0),this[4]=y(n,0),this[5]=y(o,0),this[6]=y(c,0),this[7]=y(d,0),this[8]=y(e,0),this[9]=y(s,0),this[10]=y(h,0),this[11]=y(v,0),this[12]=y(i,0),this[13]=y(a,0),this[14]=y(f,0),this[15]=y(p,0)}H.packedLength=16,H.pack=function(t,n,e){return U.typeOf.object("value",t),U.defined("array",n),e=y(e,0),n[e++]=t[0],n[e++]=t[1],n[e++]=t[2],n[e++]=t[3],n[e++]=t[4],n[e++]=t[5],n[e++]=t[6],n[e++]=t[7],n[e++]=t[8],n[e++]=t[9],n[e++]=t[10],n[e++]=t[11],n[e++]=t[12],n[e++]=t[13],n[e++]=t[14],n[e]=t[15],n},H.unpack=function(t,n,e){return U.defined("array",t),n=y(n,0),(e=I(e)?e:new H)[0]=t[n++],e[1]=t[n++],e[2]=t[n++],e[3]=t[n++],e[4]=t[n++],e[5]=t[n++],e[6]=t[n++],e[7]=t[n++],e[8]=t[n++],e[9]=t[n++],e[10]=t[n++],e[11]=t[n++],e[12]=t[n++],e[13]=t[n++],e[14]=t[n++],e[15]=t[n],e},H.packArray=function(t,n){U.defined("array",t);var e=t.length,i=16*e;if(I(n)){if(!Array.isArray(n)&&n.length!==i)throw new m("If result is a typed array, it must have exactly array.length * 16 elements");n.length!==i&&(n.length=i)}else n=new Array(i);for(var r=0;r<e;++r)H.pack(t[r],n,16*r);return n},H.unpackArray=function(t,n){if(U.defined("array",t),U.typeOf.number.greaterThanOrEquals("array.length",t.length,16),t.length%16!=0)throw new m("array length must be a multiple of 16.");var e=t.length;I(n)?n.length=e/16:n=new Array(e/16);for(var i=0;i<e;i+=16){var r=i/16;n[r]=H.unpack(t,i,n[r])}return n},H.clone=function(t,n){if(I(t))return I(n)?(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n):new H(t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15])},H.fromArray=H.unpack,H.fromColumnMajorArray=function(t,n){return U.defined("values",t),H.clone(t,n)},H.fromRowMajorArray=function(t,n){return U.defined("values",t),I(n)?(n[0]=t[0],n[1]=t[4],n[2]=t[8],n[3]=t[12],n[4]=t[1],n[5]=t[5],n[6]=t[9],n[7]=t[13],n[8]=t[2],n[9]=t[6],n[10]=t[10],n[11]=t[14],n[12]=t[3],n[13]=t[7],n[14]=t[11],n[15]=t[15],n):new H(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},H.fromRotationTranslation=function(t,n,e){return U.typeOf.object("rotation",t),n=y(n,b.ZERO),I(e)?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=0,e[4]=t[3],e[5]=t[4],e[6]=t[5],e[7]=0,e[8]=t[6],e[9]=t[7],e[10]=t[8],e[11]=0,e[12]=n.x,e[13]=n.y,e[14]=n.z,e[15]=1,e):new H(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)},H.fromTranslationQuaternionRotationScale=function(t,n,e,i){U.typeOf.object("translation",t),U.typeOf.object("rotation",n),U.typeOf.object("scale",e),I(i)||(i=new H);var r=e.x,o=e.y,e=e.z,s=n.x*n.x,a=n.x*n.y,u=n.x*n.z,c=n.x*n.w,h=n.y*n.y,f=n.y*n.z,l=n.y*n.w,d=n.z*n.z,v=n.z*n.w,n=n.w*n.w,p=2*(a-v),m=2*(u+l),a=2*(a+v),v=h-s-d+n,y=2*(f-c),u=2*(u-l),l=2*(f+c),f=-s-h+d+n;return i[0]=(s-h-d+n)*r,i[1]=a*r,i[2]=u*r,i[3]=0,i[4]=p*o,i[5]=v*o,i[6]=l*o,i[7]=0,i[8]=m*e,i[9]=y*e,i[10]=f*e,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,i},H.fromTranslationRotationScale=function(t,n){return U.typeOf.object("translationRotationScale",t),H.fromTranslationQuaternionRotationScale(t.translation,t.rotation,t.scale,n)},H.fromTranslation=function(t,n){return U.typeOf.object("translation",t),H.fromRotationTranslation(jT.IDENTITY,t,n)},H.fromScale=function(t,n){return U.typeOf.object("scale",t),I(n)?(n[0]=t.x,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=t.y,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=t.z,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n):new H(t.x,0,0,0,0,t.y,0,0,0,0,t.z,0,0,0,0,1)},H.fromUniformScale=function(t,n){return U.typeOf.number("scale",t),I(n)?(n[0]=t,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=t,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=t,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n):new H(t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1)},H.fromRotation=function(t,n){return U.typeOf.object("rotation",t),(n=I(n)?n:new H)[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=0,n[4]=t[3],n[5]=t[4],n[6]=t[5],n[7]=0,n[8]=t[6],n[9]=t[7],n[10]=t[8],n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n};var DT=new b,kT=new b,UT=new b,BT=(H.fromCamera=function(t,n){U.typeOf.object("camera",t);var e=t.position,i=t.direction,t=t.up,i=(U.typeOf.object("camera.position",e),U.typeOf.object("camera.direction",i),U.typeOf.object("camera.up",t),b.normalize(i,DT),b.normalize(b.cross(DT,t,kT),kT),b.normalize(b.cross(kT,DT,UT),UT),kT.x),t=kT.y,r=kT.z,o=DT.x,s=DT.y,a=DT.z,u=UT.x,c=UT.y,h=UT.z,f=e.x,l=e.y,e=e.z,d=i*-f+t*-l+r*-e,v=u*-f+c*-l+h*-e,f=o*f+s*l+a*e;return I(n)?(n[0]=i,n[1]=u,n[2]=-o,n[3]=0,n[4]=t,n[5]=c,n[6]=-s,n[7]=0,n[8]=r,n[9]=h,n[10]=-a,n[11]=0,n[12]=d,n[13]=v,n[14]=f,n[15]=1,n):new H(i,t,r,d,u,c,h,v,-o,-s,-a,f,0,0,0,1)},H.computePerspectiveFieldOfView=function(t,n,e,i,r){U.typeOf.number.greaterThan("fovY",t,0),U.typeOf.number.lessThan("fovY",t,Math.PI),U.typeOf.number.greaterThan("near",e,0),U.typeOf.number.greaterThan("far",i,0),U.typeOf.object("result",r);var t=1/Math.tan(.5*t),o=(i+e)/(e-i),e=2*i*e/(e-i);return r[0]=t/n,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=t,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=o,r[11]=-1,r[12]=0,r[13]=0,r[14]=e,r[15]=0,r},H.computeOrthographicOffCenter=function(t,n,e,i,r,o,s){U.typeOf.number("left",t),U.typeOf.number("right",n),U.typeOf.number("bottom",e),U.typeOf.number("top",i),U.typeOf.number("near",r),U.typeOf.number("far",o),U.typeOf.object("result",s);var a=1/(n-t),u=1/(i-e),c=1/(o-r),n=-(n+t)*a,t=-(i+e)*u,i=-(o+r)*c;return u*=2,c*=-2,s[0]=a*=2,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=u,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=c,s[11]=0,s[12]=n,s[13]=t,s[14]=i,s[15]=1,s},H.computePerspectiveOffCenter=function(t,n,e,i,r,o,s){U.typeOf.number("left",t),U.typeOf.number("right",n),U.typeOf.number("bottom",e),U.typeOf.number("top",i),U.typeOf.number("near",r),U.typeOf.number("far",o),U.typeOf.object("result",s);var a=2*r/(i-e),u=(n+t)/(n-t),i=(i+e)/(i-e),e=-(o+r)/(o-r),o=-2*o*r/(o-r);return s[0]=2*r/(n-t),s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=a,s[6]=0,s[7]=0,s[8]=u,s[9]=i,s[10]=e,s[11]=-1,s[12]=0,s[13]=0,s[14]=o,s[15]=0,s},H.computeInfinitePerspectiveOffCenter=function(t,n,e,i,r,o){U.typeOf.number("left",t),U.typeOf.number("right",n),U.typeOf.number("bottom",e),U.typeOf.number("top",i),U.typeOf.number("near",r),U.typeOf.object("result",o);var s=2*r/(i-e),a=(n+t)/(n-t),i=(i+e)/(i-e),e=-2*r;return o[0]=2*r/(n-t),o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=a,o[9]=i,o[10]=-1,o[11]=-1,o[12]=0,o[13]=0,o[14]=e,o[15]=0,o},H.computeViewportTransformation=function(t,n,e,i){I(i)||(i=new H),t=y(t,y.EMPTY_OBJECT);var r=y(t.x,0),o=y(t.y,0),s=y(t.width,0),t=y(t.height,0),s=(n=y(n,0),.5*s),t=.5*t,e=.5*((e=y(e,1))-n),a=t,u=e,r=r+s,o=o+t,t=n+e;return i[0]=s,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=a,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=u,i[11]=0,i[12]=r,i[13]=o,i[14]=t,i[15]=1,i},H.computeView=function(t,n,e,i,r){return U.typeOf.object("position",t),U.typeOf.object("direction",n),U.typeOf.object("up",e),U.typeOf.object("right",i),U.typeOf.object("result",r),r[0]=i.x,r[1]=e.x,r[2]=-n.x,r[3]=0,r[4]=i.y,r[5]=e.y,r[6]=-n.y,r[7]=0,r[8]=i.z,r[9]=e.z,r[10]=-n.z,r[11]=0,r[12]=-b.dot(i,t),r[13]=-b.dot(e,t),r[14]=b.dot(n,t),r[15]=1,r},H.toArray=function(t,n){return U.typeOf.object("matrix",t),I(n)?(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]},H.getElementIndex=function(t,n){return U.typeOf.number.greaterThanOrEquals("row",n,0),U.typeOf.number.lessThanOrEquals("row",n,3),U.typeOf.number.greaterThanOrEquals("column",t,0),U.typeOf.number.lessThanOrEquals("column",t,3),4*t+n},H.getColumn=function(t,n,e){U.typeOf.object("matrix",t),U.typeOf.number.greaterThanOrEquals("index",n,0),U.typeOf.number.lessThanOrEquals("index",n,3),U.typeOf.object("result",e);var n=4*n,i=t[n],r=t[1+n],o=t[2+n],t=t[3+n];return e.x=i,e.y=r,e.z=o,e.w=t,e},H.setColumn=function(t,n,e,i){U.typeOf.object("matrix",t),U.typeOf.number.greaterThanOrEquals("index",n,0),U.typeOf.number.lessThanOrEquals("index",n,3),U.typeOf.object("cartesian",e),U.typeOf.object("result",i);n*=4;return(i=H.clone(t,i))[n]=e.x,i[1+n]=e.y,i[2+n]=e.z,i[3+n]=e.w,i},H.getRow=function(t,n,e){U.typeOf.object("matrix",t),U.typeOf.number.greaterThanOrEquals("index",n,0),U.typeOf.number.lessThanOrEquals("index",n,3),U.typeOf.object("result",e);var i=t[n],r=t[n+4],o=t[n+8],t=t[n+12];return e.x=i,e.y=r,e.z=o,e.w=t,e},H.setRow=function(t,n,e,i){return U.typeOf.object("matrix",t),U.typeOf.number.greaterThanOrEquals("index",n,0),U.typeOf.number.lessThanOrEquals("index",n,3),U.typeOf.object("cartesian",e),U.typeOf.object("result",i),(i=H.clone(t,i))[n]=e.x,i[n+4]=e.y,i[n+8]=e.z,i[n+12]=e.w,i},H.setTranslation=function(t,n,e){return U.typeOf.object("matrix",t),U.typeOf.object("translation",n),U.typeOf.object("result",e),e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=n.x,e[13]=n.y,e[14]=n.z,e[15]=t[15],e},new b),GT=(H.setScale=function(t,n,e){U.typeOf.object("matrix",t),U.typeOf.object("scale",n),U.typeOf.object("result",e);var i=H.getScale(t,BT),r=n.x/i.x,o=n.y/i.y,n=n.z/i.z;return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3],e[4]=t[4]*o,e[5]=t[5]*o,e[6]=t[6]*o,e[7]=t[7],e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},new b),HT=(H.setUniformScale=function(t,n,e){U.typeOf.object("matrix",t),U.typeOf.number("scale",n),U.typeOf.object("result",e);var i=H.getScale(t,GT),r=n/i.x,o=n/i.y,n=n/i.z;return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3],e[4]=t[4]*o,e[5]=t[5]*o,e[6]=t[6]*o,e[7]=t[7],e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},new b),XT=(H.getScale=function(t,n){return U.typeOf.object("matrix",t),U.typeOf.object("result",n),n.x=b.magnitude(b.fromElements(t[0],t[1],t[2],HT)),n.y=b.magnitude(b.fromElements(t[4],t[5],t[6],HT)),n.z=b.magnitude(b.fromElements(t[8],t[9],t[10],HT)),n},new b),VT=(H.getMaximumScale=function(t){return H.getScale(t,XT),b.maximumComponent(XT)},new b),zT=(H.setRotation=function(t,n,e){U.typeOf.object("matrix",t),U.typeOf.object("result",e);var i=H.getScale(t,VT);return e[0]=n[0]*i.x,e[1]=n[1]*i.x,e[2]=n[2]*i.x,e[3]=t[3],e[4]=n[3]*i.y,e[5]=n[4]*i.y,e[6]=n[5]*i.y,e[7]=t[7],e[8]=n[6]*i.z,e[9]=n[7]*i.z,e[10]=n[8]*i.z,e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},new b),WT=(H.getRotation=function(t,n){U.typeOf.object("matrix",t),U.typeOf.object("result",n);var e=H.getScale(t,zT);return n[0]=t[0]/e.x,n[1]=t[1]/e.x,n[2]=t[2]/e.x,n[3]=t[4]/e.y,n[4]=t[5]/e.y,n[5]=t[6]/e.y,n[6]=t[8]/e.z,n[7]=t[9]/e.z,n[8]=t[10]/e.z,n},H.multiply=function(t,n,e){U.typeOf.object("left",t),U.typeOf.object("right",n),U.typeOf.object("result",e);var i=t[0],r=t[1],o=t[2],s=t[3],a=t[4],u=t[5],c=t[6],h=t[7],f=t[8],l=t[9],d=t[10],v=t[11],p=t[12],m=t[13],y=t[14],t=t[15],b=n[0],g=n[1],_=n[2],w=n[3],x=n[4],E=n[5],S=n[6],T=n[7],A=n[8],M=n[9],O=n[10],L=n[11],R=n[12],N=n[13],P=n[14],n=n[15],F=r*b+u*g+l*_+m*w,j=o*b+c*g+d*_+y*w,I=s*b+h*g+v*_+t*w,C=i*x+a*E+f*S+p*T,D=r*x+u*E+l*S+m*T,k=o*x+c*E+d*S+y*T,x=s*x+h*E+v*S+t*T,E=i*A+a*M+f*O+p*L,S=r*A+u*M+l*O+m*L,T=o*A+c*M+d*O+y*L,A=s*A+h*M+v*O+t*L,M=i*R+a*N+f*P+p*n,O=r*R+u*N+l*P+m*n,L=o*R+c*N+d*P+y*n,r=s*R+h*N+v*P+t*n;return e[0]=i*b+a*g+f*_+p*w,e[1]=F,e[2]=j,e[3]=I,e[4]=C,e[5]=D,e[6]=k,e[7]=x,e[8]=E,e[9]=S,e[10]=T,e[11]=A,e[12]=M,e[13]=O,e[14]=L,e[15]=r,e},H.add=function(t,n,e){return U.typeOf.object("left",t),U.typeOf.object("right",n),U.typeOf.object("result",e),e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e[9]=t[9]+n[9],e[10]=t[10]+n[10],e[11]=t[11]+n[11],e[12]=t[12]+n[12],e[13]=t[13]+n[13],e[14]=t[14]+n[14],e[15]=t[15]+n[15],e},H.subtract=function(t,n,e){return U.typeOf.object("left",t),U.typeOf.object("right",n),U.typeOf.object("result",e),e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e[9]=t[9]-n[9],e[10]=t[10]-n[10],e[11]=t[11]-n[11],e[12]=t[12]-n[12],e[13]=t[13]-n[13],e[14]=t[14]-n[14],e[15]=t[15]-n[15],e},H.multiplyTransformation=function(t,n,e){U.typeOf.object("left",t),U.typeOf.object("right",n),U.typeOf.object("result",e);var i=t[0],r=t[1],o=t[2],s=t[4],a=t[5],u=t[6],c=t[8],h=t[9],f=t[10],l=t[12],d=t[13],t=t[14],v=n[0],p=n[1],m=n[2],y=n[4],b=n[5],g=n[6],_=n[8],w=n[9],x=n[10],E=n[12],S=n[13],n=n[14],T=r*v+a*p+h*m,A=o*v+u*p+f*m,M=i*y+s*b+c*g,O=r*y+a*b+h*g,y=o*y+u*b+f*g,b=i*_+s*w+c*x,g=r*_+a*w+h*x,_=o*_+u*w+f*x,w=i*E+s*S+c*n+l,x=r*E+a*S+h*n+d,l=o*E+u*S+f*n+t;return e[0]=i*v+s*p+c*m,e[1]=T,e[2]=A,e[3]=0,e[4]=M,e[5]=O,e[6]=y,e[7]=0,e[8]=b,e[9]=g,e[10]=_,e[11]=0,e[12]=w,e[13]=x,e[14]=l,e[15]=1,e},H.multiplyByMatrix3=function(t,n,e){U.typeOf.object("matrix",t),U.typeOf.object("rotation",n),U.typeOf.object("result",e);var i=t[0],r=t[1],o=t[2],s=t[4],a=t[5],u=t[6],c=t[8],h=t[9],f=t[10],l=n[0],d=n[1],v=n[2],p=n[3],m=n[4],y=n[5],b=n[6],g=n[7],n=n[8],_=r*l+a*d+h*v,w=o*l+u*d+f*v,x=i*p+s*m+c*y,E=r*p+a*m+h*y,p=o*p+u*m+f*y,m=i*b+s*g+c*n,y=r*b+a*g+h*n,r=o*b+u*g+f*n;return e[0]=i*l+s*d+c*v,e[1]=_,e[2]=w,e[3]=0,e[4]=x,e[5]=E,e[6]=p,e[7]=0,e[8]=m,e[9]=y,e[10]=r,e[11]=0,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},H.multiplyByTranslation=function(t,n,e){U.typeOf.object("matrix",t),U.typeOf.object("translation",n),U.typeOf.object("result",e);var i=n.x,r=n.y,n=n.z,o=i*t[0]+r*t[4]+n*t[8]+t[12],s=i*t[1]+r*t[5]+n*t[9]+t[13],i=i*t[2]+r*t[6]+n*t[10]+t[14];return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=o,e[13]=s,e[14]=i,e[15]=t[15],e},H.multiplyByScale=function(t,n,e){U.typeOf.object("matrix",t),U.typeOf.object("scale",n),U.typeOf.object("result",e);var i=n.x,r=n.y,n=n.z;return 1===i&&1===r&&1===n?H.clone(t,e):(e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=t[3],e[4]=r*t[4],e[5]=r*t[5],e[6]=r*t[6],e[7]=t[7],e[8]=n*t[8],e[9]=n*t[9],e[10]=n*t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e)},H.multiplyByUniformScale=function(t,n,e){return U.typeOf.object("matrix",t),U.typeOf.number("scale",n),U.typeOf.object("result",e),e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3],e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7],e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},H.multiplyByVector=function(t,n,e){U.typeOf.object("matrix",t),U.typeOf.object("cartesian",n),U.typeOf.object("result",e);var i=n.x,r=n.y,o=n.z,n=n.w,s=t[0]*i+t[4]*r+t[8]*o+t[12]*n,a=t[1]*i+t[5]*r+t[9]*o+t[13]*n,u=t[2]*i+t[6]*r+t[10]*o+t[14]*n,i=t[3]*i+t[7]*r+t[11]*o+t[15]*n;return e.x=s,e.y=a,e.z=u,e.w=i,e},H.multiplyByPointAsVector=function(t,n,e){U.typeOf.object("matrix",t),U.typeOf.object("cartesian",n),U.typeOf.object("result",e);var i=n.x,r=n.y,n=n.z,o=t[0]*i+t[4]*r+t[8]*n,s=t[1]*i+t[5]*r+t[9]*n,i=t[2]*i+t[6]*r+t[10]*n;return e.x=o,e.y=s,e.z=i,e},H.multiplyByPoint=function(t,n,e){U.typeOf.object("matrix",t),U.typeOf.object("cartesian",n),U.typeOf.object("result",e);var i=n.x,r=n.y,n=n.z,o=t[0]*i+t[4]*r+t[8]*n+t[12],s=t[1]*i+t[5]*r+t[9]*n+t[13],i=t[2]*i+t[6]*r+t[10]*n+t[14];return e.x=o,e.y=s,e.z=i,e},H.multiplyByScalar=function(t,n,e){return U.typeOf.object("matrix",t),U.typeOf.number("scalar",n),U.typeOf.object("result",e),e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12]*n,e[13]=t[13]*n,e[14]=t[14]*n,e[15]=t[15]*n,e},H.negate=function(t,n){return U.typeOf.object("matrix",t),U.typeOf.object("result",n),n[0]=-t[0],n[1]=-t[1],n[2]=-t[2],n[3]=-t[3],n[4]=-t[4],n[5]=-t[5],n[6]=-t[6],n[7]=-t[7],n[8]=-t[8],n[9]=-t[9],n[10]=-t[10],n[11]=-t[11],n[12]=-t[12],n[13]=-t[13],n[14]=-t[14],n[15]=-t[15],n},H.transpose=function(t,n){U.typeOf.object("matrix",t),U.typeOf.object("result",n);var e=t[1],i=t[2],r=t[3],o=t[6],s=t[7],a=t[11];return n[0]=t[0],n[1]=t[4],n[2]=t[8],n[3]=t[12],n[4]=e,n[5]=t[5],n[6]=t[9],n[7]=t[13],n[8]=i,n[9]=o,n[10]=t[10],n[11]=t[14],n[12]=r,n[13]=s,n[14]=a,n[15]=t[15],n},H.abs=function(t,n){return U.typeOf.object("matrix",t),U.typeOf.object("result",n),n[0]=Math.abs(t[0]),n[1]=Math.abs(t[1]),n[2]=Math.abs(t[2]),n[3]=Math.abs(t[3]),n[4]=Math.abs(t[4]),n[5]=Math.abs(t[5]),n[6]=Math.abs(t[6]),n[7]=Math.abs(t[7]),n[8]=Math.abs(t[8]),n[9]=Math.abs(t[9]),n[10]=Math.abs(t[10]),n[11]=Math.abs(t[11]),n[12]=Math.abs(t[12]),n[13]=Math.abs(t[13]),n[14]=Math.abs(t[14]),n[15]=Math.abs(t[15]),n},H.equals=function(t,n){return t===n||I(t)&&I(n)&&t[12]===n[12]&&t[13]===n[13]&&t[14]===n[14]&&t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[4]===n[4]&&t[5]===n[5]&&t[6]===n[6]&&t[8]===n[8]&&t[9]===n[9]&&t[10]===n[10]&&t[3]===n[3]&&t[7]===n[7]&&t[11]===n[11]&&t[15]===n[15]},H.equalsEpsilon=function(t,n,e){return e=y(e,0),t===n||I(t)&&I(n)&&Math.abs(t[0]-n[0])<=e&&Math.abs(t[1]-n[1])<=e&&Math.abs(t[2]-n[2])<=e&&Math.abs(t[3]-n[3])<=e&&Math.abs(t[4]-n[4])<=e&&Math.abs(t[5]-n[5])<=e&&Math.abs(t[6]-n[6])<=e&&Math.abs(t[7]-n[7])<=e&&Math.abs(t[8]-n[8])<=e&&Math.abs(t[9]-n[9])<=e&&Math.abs(t[10]-n[10])<=e&&Math.abs(t[11]-n[11])<=e&&Math.abs(t[12]-n[12])<=e&&Math.abs(t[13]-n[13])<=e&&Math.abs(t[14]-n[14])<=e&&Math.abs(t[15]-n[15])<=e},H.getTranslation=function(t,n){return U.typeOf.object("matrix",t),U.typeOf.object("result",n),n.x=t[12],n.y=t[13],n.z=t[14],n},H.getMatrix3=function(t,n){return U.typeOf.object("matrix",t),U.typeOf.object("result",n),n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[4],n[4]=t[5],n[5]=t[6],n[6]=t[8],n[7]=t[9],n[8]=t[10],n},new jT),YT=new jT,QT=new xT,ZT=new xT(0,0,0,1),qT=(H.inverse=function(t,n){U.typeOf.object("matrix",t),U.typeOf.object("result",n);var e=t[0],i=t[4],r=t[8],o=t[12],s=t[1],a=t[5],u=t[9],c=t[13],h=t[2],f=t[6],l=t[10],d=t[14],v=t[3],p=t[7],m=t[11],y=t[15],b=l*y,g=d*m,_=f*y,w=d*p,x=f*m,E=l*p,S=h*y,T=d*v,A=h*m,M=l*v,O=h*p,L=f*v,R=b*a+w*u+x*c-(g*a+_*u+E*c),N=g*s+S*u+M*c-(b*s+T*u+A*c),P=_*s+T*a+O*c-(w*s+S*a+L*c),F=E*s+A*a+L*u-(x*s+M*a+O*u),j=g*i+_*r+E*o-(b*i+w*r+x*o),I=b*e+T*r+A*o-(g*e+S*r+M*o),C=w*e+S*i+L*o-(_*e+T*i+O*o),D=x*e+M*i+O*r-(E*e+A*i+L*r),k=(b=r*c)*p+(w=o*a)*m+(x=i*u)*y-((g=o*u)*p+(_=i*c)*m+(E=r*a)*y),c=g*v+(S=e*c)*m+(M=r*s)*y-(b*v+(T=o*s)*m+(A=e*u)*y),u=_*v+T*p+(O=e*a)*y-(w*v+S*p+(L=i*s)*y),a=E*v+A*p+L*m-(x*v+M*p+O*m),s=_*l+E*d+g*f-(x*d+b*f+w*l),y=A*d+b*h+T*l-(S*l+M*d+g*h),v=S*f+L*d+w*h-(O*d+_*h+T*f),p=O*l+x*h+M*f-(A*f+L*l+E*h),m=e*R+i*N+r*P+o*F;if(Math.abs(m)<G.EPSILON21){if(jT.equalsEpsilon(H.getMatrix3(t,WT),YT,G.EPSILON7)&&xT.equals(H.getRow(t,3,QT),ZT))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-t[12],n[13]=-t[13],n[14]=-t[14],n[15]=1,n;throw new CT("matrix is not invertible because its determinate is zero.")}return n[0]=R*(m=1/m),n[1]=N*m,n[2]=P*m,n[3]=F*m,n[4]=j*m,n[5]=I*m,n[6]=C*m,n[7]=D*m,n[8]=k*m,n[9]=c*m,n[10]=u*m,n[11]=a*m,n[12]=s*m,n[13]=y*m,n[14]=v*m,n[15]=p*m,n},H.inverseTransformation=function(t,n){U.typeOf.object("matrix",t),U.typeOf.object("result",n);var e=t[0],i=t[1],r=t[2],o=t[4],s=t[5],a=t[6],u=t[8],c=t[9],h=t[10],f=t[12],l=t[13],t=t[14],d=-e*f-i*l-r*t,v=-o*f-s*l-a*t,f=-u*f-c*l-h*t;return n[0]=e,n[1]=o,n[2]=u,n[3]=0,n[4]=i,n[5]=s,n[6]=c,n[7]=0,n[8]=r,n[9]=a,n[10]=h,n[11]=0,n[12]=d,n[13]=v,n[14]=f,n[15]=1,n},new H),KT=(H.inverseTranspose=function(t,n){return U.typeOf.object("matrix",t),U.typeOf.object("result",n),H.inverse(H.transpose(t,qT),n)},H.IDENTITY=Object.freeze(new H(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),H.ZERO=Object.freeze(new H(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),H.COLUMN0ROW0=0,H.COLUMN0ROW1=1,H.COLUMN0ROW2=2,H.COLUMN0ROW3=3,H.COLUMN1ROW0=4,H.COLUMN1ROW1=5,H.COLUMN1ROW2=6,H.COLUMN1ROW3=7,H.COLUMN2ROW0=8,H.COLUMN2ROW1=9,H.COLUMN2ROW2=10,H.COLUMN2ROW3=11,H.COLUMN3ROW0=12,H.COLUMN3ROW1=13,H.COLUMN3ROW2=14,H.COLUMN3ROW3=15,Object.defineProperties(H.prototype,{length:{get:function(){return H.packedLength}}}),H.prototype.clone=function(t){return H.clone(this,t)},H.prototype.equals=function(t){return H.equals(this,t)},H.equalsArray=function(t,n,e){return t[0]===n[e]&&t[1]===n[e+1]&&t[2]===n[e+2]&&t[3]===n[e+3]&&t[4]===n[e+4]&&t[5]===n[e+5]&&t[6]===n[e+6]&&t[7]===n[e+7]&&t[8]===n[e+8]&&t[9]===n[e+9]&&t[10]===n[e+10]&&t[11]===n[e+11]&&t[12]===n[e+12]&&t[13]===n[e+13]&&t[14]===n[e+14]&&t[15]===n[e+15]},H.prototype.equalsEpsilon=function(t,n){return H.equalsEpsilon(this,t,n)},H.prototype.toString=function(){return"(".concat(this[0],", ").concat(this[4],", ").concat(this[8],", ").concat(this[12],")\n")+"(".concat(this[1],", ").concat(this[5],", ").concat(this[9],", ").concat(this[13],")\n")+"(".concat(this[2],", ").concat(this[6],", ").concat(this[10],", ").concat(this[14],")\n")+"(".concat(this[3],", ").concat(this[7],", ").concat(this[11],", ").concat(this[15],")")},H);function JT(t){t=y(t,y.EMPTY_OBJECT),this.left=t.left,this.Pb=void 0,this.right=t.right,this.Fb=void 0,this.top=t.top,this.jb=void 0,this.bottom=t.bottom,this.Ib=void 0,this.near=y(t.near,1),this.Cb=this.near,this.far=y(t.far,5e8),this.Db=this.far,this.kb=new KT,this.Ub=new KT}function $T(t){if(!(I(t.right)&&I(t.left)&&I(t.top)&&I(t.bottom)&&I(t.near)&&I(t.far)))throw new m("right, left, top, bottom, near, or far parameters are not set.");var n=t.top,e=t.bottom,i=t.right,r=t.left,o=t.near,s=t.far;if(n!==t.jb||e!==t.Ib||r!==t.Pb||i!==t.Fb||o!==t.Cb||s!==t.Db){if(t.near<=0||t.near>t.far)throw new m("near must be greater than zero and less than far.");t.Pb=r,t.Fb=i,t.jb=n,t.Ib=e,t.Cb=o,t.Db=s,t.kb=KT.computePerspectiveOffCenter(r,i,e,n,o,s,t.kb),t.Ub=KT.computeInfinitePerspectiveOffCenter(r,i,e,n,o,t.Ub)}}Object.defineProperties(JT.prototype,{projectionMatrix:{get:function(){return $T(this),this.kb}},infiniteProjectionMatrix:{get:function(){return $T(this),this.Ub}}}),JT.prototype.getPixelDimensions=function(t,n,e,i,r){if($T(this),!I(t)||!I(n))throw new m("Both drawingBufferWidth and drawingBufferHeight are required.");if(t<=0)throw new m("drawingBufferWidth must be greater than zero.");if(n<=0)throw new m("drawingBufferHeight must be greater than zero.");if(!I(e))throw new m("distance is required.");if(!I(i))throw new m("pixelRatio is required");if(i<=0)throw new m("pixelRatio must be greater than zero.");var o,s;if(I(r))return o=1/this.near,n=2*i*e*(s=this.top*o)/n,s=this.right*o,r.x=2*i*e*s/t,r.y=n,r;throw new m("A result object is required.")},JT.prototype.clone=function(t){return(t=I(t)?t:new JT).right=this.right,t.left=this.left,t.top=this.top,t.bottom=this.bottom,t.near=this.near,t.far=this.far,t.Pb=void 0,t.Fb=void 0,t.jb=void 0,t.Ib=void 0,t.Cb=void 0,t.Db=void 0,t},JT.prototype.equals=function(t){return I(t)&&t instanceof JT&&this.right===t.right&&this.left===t.left&&this.top===t.top&&this.bottom===t.bottom&&this.near===t.near&&this.far===t.far},JT.prototype.equalsEpsilon=function(t,n,e){return t===this||I(t)&&t instanceof JT&&G.equalsEpsilon(this.right,t.right,n,e)&&G.equalsEpsilon(this.left,t.left,n,e)&&G.equalsEpsilon(this.top,t.top,n,e)&&G.equalsEpsilon(this.bottom,t.bottom,n,e)&&G.equalsEpsilon(this.near,t.near,n,e)&&G.equalsEpsilon(this.far,t.far,n,e)};var tA=JT;function nA(t){t=y(t,y.EMPTY_OBJECT),this.Bb=new tA,this.fov=t.fov,this.Gb=void 0,this.Hb=void 0,this.Xb=void 0,this.aspectRatio=t.aspectRatio,this.Vb=void 0,this.near=y(t.near,1),this.Cb=this.near,this.far=y(t.far,5e8),this.Db=this.far,this.xOffset=y(t.xOffset,0),this.zb=this.xOffset,this.yOffset=y(t.yOffset,0),this.Wb=this.yOffset}function eA(t){if(!(I(t.fov)&&I(t.aspectRatio)&&I(t.near)&&I(t.far)))throw new m("fov, aspectRatio, near, or far parameters are not set.");var n=t.Bb;if(t.fov!==t.Gb||t.aspectRatio!==t.Vb||t.near!==t.Cb||t.far!==t.Db||t.xOffset!==t.zb||t.yOffset!==t.Wb){if(t.fov<0||t.fov>=Math.PI)throw new m("fov must be in the range [0, PI).");if(t.aspectRatio<0)throw new m("aspectRatio must be positive.");if(t.near<0||t.near>t.far)throw new m("near must be greater than zero and less than far.");t.Vb=t.aspectRatio,t.Gb=t.fov,t.Hb=t.fov,t.Cb=t.near,t.Db=t.far,t.Xb=2*Math.tan(.5*t.Hb),t.zb=t.xOffset,t.Wb=t.yOffset,n.top=t.near*Math.tan(.5*t.Hb),n.bottom=-n.top,n.right=t.aspectRatio*n.top,n.left=-n.right,n.near=t.near,n.far=t.far,n.right+=t.xOffset,n.left+=t.xOffset,n.top+=t.yOffset,n.bottom+=t.yOffset}}nA.packedLength=6,nA.prototype.update=function(){eA(this)},nA.pack=function(t,n,e){return U.typeOf.object("value",t),U.defined("array",n),e=y(e,0),n[e++]=t.fov,n[e++]=t.aspectRatio,n[e++]=t.near,n[e++]=t.far,n[e++]=t.xOffset,n[e]=t.yOffset,n},nA.unpack=function(t,n,e){return U.defined("array",t),n=y(n,0),(e=I(e)?e:new nA).fov=t[n++],e.aspectRatio=t[n++],e.near=t[n++],e.far=t[n++],e.xOffset=t[n++],e.yOffset=t[n],e},Object.defineProperties(nA.prototype,{projectionMatrix:{get:function(){return eA(this),this.Bb.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return eA(this),this.Bb.infiniteProjectionMatrix}},fovy:{get:function(){return eA(this),this.Hb}},sseDenominator:{get:function(){return eA(this),this.Xb}},offCenterFrustum:{get:function(){return eA(this),this.Bb}}}),nA.prototype.computeCullingVolume=function(t,n,e){return eA(this),this.Bb.computeCullingVolume(t,n,e)},nA.prototype.getPixelDimensions=function(t,n,e,i,r){return eA(this),this.Bb.getPixelDimensions(t,n,e,i,r)},nA.prototype.clone=function(t){return(t=I(t)?t:new nA).aspectRatio=this.aspectRatio,t.fov=this.fov,t.near=this.near,t.far=this.far,t.Vb=void 0,t.Gb=void 0,t.Cb=void 0,t.Db=void 0,this.Bb.clone(t.Bb),t},nA.prototype.equals=function(t){return!!(I(t)&&t instanceof nA)&&(eA(this),eA(t),this.fov===t.fov)&&this.aspectRatio===t.aspectRatio&&this.Bb.equals(t.Bb)},nA.prototype.equalsEpsilon=function(t,n,e){return!!(I(t)&&t instanceof nA)&&(eA(this),eA(t),G.equalsEpsilon(this.fov,t.fov,n,e))&&G.equalsEpsilon(this.aspectRatio,t.aspectRatio,n,e)&&this.Bb.equalsEpsilon(t.Bb,n,e)};var iA=nA;function rA(t){t=y(t,y.EMPTY_OBJECT),this.left=t.left,this.Pb=void 0,this.right=t.right,this.Fb=void 0,this.top=t.top,this.jb=void 0,this.bottom=t.bottom,this.Ib=void 0,this.near=y(t.near,1),this.Cb=this.near,this.far=y(t.far,5e8),this.Db=this.far,this.Yb=new KT}function oA(t){if(!(I(t.right)&&I(t.left)&&I(t.top)&&I(t.bottom)&&I(t.near)&&I(t.far)))throw new m("right, left, top, bottom, near, or far parameters are not set.");if(t.top!==t.jb||t.bottom!==t.Ib||t.left!==t.Pb||t.right!==t.Fb||t.near!==t.Cb||t.far!==t.Db){if(t.left>t.right)throw new m("right must be greater than left.");if(t.bottom>t.top)throw new m("top must be greater than bottom.");if(t.near<=0||t.near>t.far)throw new m("near must be greater than zero and less than far.");t.Pb=t.left,t.Fb=t.right,t.jb=t.top,t.Ib=t.bottom,t.Cb=t.near,t.Db=t.far,t.Yb=KT.computeOrthographicOffCenter(t.left,t.right,t.bottom,t.top,t.near,t.far,t.Yb)}}Object.defineProperties(rA.prototype,{projectionMatrix:{get:function(){return oA(this),this.Yb}}});var sA=new b,aA=new b,uA=new b,cA=new b,hA=(rA.prototype.computeCullingVolume=function(t,n,e){if(!I(t))throw new m("position is required.");if(!I(n))throw new m("direction is required.");var i,r,o,s,a,u,c,h,f;if(I(e))return i=this._cullingVolume.planes,r=this.top,o=this.bottom,s=this.right,h=this.left,c=this.near,a=this.far,u=b.cross(n,e,sA),b.normalize(u,u),b.multiplyByScalar(n,c,c=aA),b.add(t,c,c),b.multiplyByScalar(u,h,h=uA),b.add(c,h,h),(f=I(f=i[0])?f:i[0]=new xT).x=u.x,f.y=u.y,f.z=u.z,f.w=-b.dot(u,h),b.multiplyByScalar(u,s,h),b.add(c,h,h),(f=I(f=i[1])?f:i[1]=new xT).x=-u.x,f.y=-u.y,f.z=-u.z,f.w=-b.dot(b.negate(u,cA),h),b.multiplyByScalar(e,o,h),b.add(c,h,h),(f=I(f=i[2])?f:i[2]=new xT).x=e.x,f.y=e.y,f.z=e.z,f.w=-b.dot(e,h),b.multiplyByScalar(e,r,h),b.add(c,h,h),(f=I(f=i[3])?f:i[3]=new xT).x=-e.x,f.y=-e.y,f.z=-e.z,f.w=-b.dot(b.negate(e,cA),h),(f=I(f=i[4])?f:i[4]=new xT).x=n.x,f.y=n.y,f.z=n.z,f.w=-b.dot(n,c),b.multiplyByScalar(n,a,h),b.add(t,h,h),(f=I(f=i[5])?f:i[5]=new xT).x=-n.x,f.y=-n.y,f.z=-n.z,f.w=-b.dot(b.negate(n,cA),h),this._cullingVolume;throw new m("up is required.")},rA.prototype.getPixelDimensions=function(t,n,e,i,r){if(oA(this),!I(t)||!I(n))throw new m("Both drawingBufferWidth and drawingBufferHeight are required.");if(t<=0)throw new m("drawingBufferWidth must be greater than zero.");if(n<=0)throw new m("drawingBufferHeight must be greater than zero.");if(!I(e))throw new m("distance is required.");if(!I(i))throw new m("pixelRatio is required.");if(i<=0)throw new m("pixelRatio must be greater than zero.");if(I(r))return e=this.right-this.left,n=i*(this.top-this.bottom)/n,r.x=i*e/t,r.y=n,r;throw new m("A result object is required.")},rA.prototype.clone=function(t){return(t=I(t)?t:new rA).left=this.left,t.right=this.right,t.top=this.top,t.bottom=this.bottom,t.near=this.near,t.far=this.far,t.Pb=void 0,t.Fb=void 0,t.jb=void 0,t.Ib=void 0,t.Cb=void 0,t.Db=void 0,t},rA.prototype.equals=function(t){return I(t)&&t instanceof rA&&this.right===t.right&&this.left===t.left&&this.top===t.top&&this.bottom===t.bottom&&this.near===t.near&&this.far===t.far},rA.prototype.equalsEpsilon=function(t,n,e){return t===this||I(t)&&t instanceof rA&&G.equalsEpsilon(this.right,t.right,n,e)&&G.equalsEpsilon(this.left,t.left,n,e)&&G.equalsEpsilon(this.top,t.top,n,e)&&G.equalsEpsilon(this.bottom,t.bottom,n,e)&&G.equalsEpsilon(this.near,t.near,n,e)&&G.equalsEpsilon(this.far,t.far,n,e)},rA);function fA(t){t=y(t,y.EMPTY_OBJECT),this.Bb=new hA,this.width=t.width,this.tt=void 0,this.aspectRatio=t.aspectRatio,this.Vb=void 0,this.near=y(t.near,1),this.Cb=this.near,this.far=y(t.far,5e8),this.Db=this.far,this.zoom=t.zoom||1,this.Oh=this.zoom}function lA(t){if(!(I(t.width)&&I(t.aspectRatio)&&I(t.near)&&I(t.far)&&I(t.zoom)))throw new m("width, aspectRatio, near, or far parameters are not set.");var n=t.Bb;if(t.width!==t.tt||t.aspectRatio!==t.Vb||t.near!==t.Cb||t.far!==t.Db||t.zoom!==t.Oh){if(t.aspectRatio<0)throw new m("aspectRatio must be positive.");if(t.near<0||t.near>t.far)throw new m("near must be greater than zero and less than far.");t.Vb=t.aspectRatio,t.tt=t.width,t.Cb=t.near,t.Db=t.far;var e=1/t.aspectRatio,i=t.width/(2*t.zoom),e=e*t.width/(2*t.zoom),r=0-i,o=0+e,e=0-e;n.right=0+i,n.left=r,n.top=o,n.bottom=e,n.near=t.near,n.far=t.far}}fA.packedLength=4,fA.pack=function(t,n,e){return U.typeOf.object("value",t),U.defined("array",n),e=y(e,0),n[e++]=t.width,n[e++]=t.aspectRatio,n[e++]=t.near,n[e]=t.far,n},fA.unpack=function(t,n,e){return U.defined("array",t),n=y(n,0),(e=I(e)?e:new fA).width=t[n++],e.aspectRatio=t[n++],e.near=t[n++],e.far=t[n],e},Object.defineProperties(fA.prototype,{projectionMatrix:{get:function(){return lA(this),this.Bb.projectionMatrix}},offCenterFrustum:{get:function(){return lA(this),this.Bb}}}),fA.prototype.computeCullingVolume=function(t,n,e){return lA(this),this.Bb.computeCullingVolume(t,n,e)},fA.prototype.getPixelDimensions=function(t,n,e,i,r){return lA(this),this.Bb.getPixelDimensions(t,n,e,i,r)},fA.prototype.clone=function(t){return(t=I(t)?t:new fA).aspectRatio=this.aspectRatio,t.width=this.width,t.near=this.near,t.far=this.far,t.Vb=void 0,t.tt=void 0,t.Cb=void 0,t.Db=void 0,this.Bb.clone(t.Bb),t},fA.prototype.equals=function(t){return!!(I(t)&&t instanceof fA)&&(lA(this),lA(t),this.width===t.width)&&this.aspectRatio===t.aspectRatio&&this.Bb.equals(t.Bb)},fA.prototype.update=function(){lA(this)},fA.prototype.equalsEpsilon=function(t,n,e){return!!(I(t)&&t instanceof fA)&&(lA(this),lA(t),G.equalsEpsilon(this.width,t.width,n,e))&&G.equalsEpsilon(this.aspectRatio,t.aspectRatio,n,e)&&this.Bb.equalsEpsilon(t.Bb,n,e)};var dA=fA;function vA(t,n,e,i){"number"==typeof e&&(i=e,e=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),R.call(this,t,n,e),this.meshPerAttribute=i||1}function pA(t){return(pA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function mA(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=pA(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=pA(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==pA(t)?t:String(t)}(i.key),i)}}vA.prototype=Object.assign(Object.create(R.prototype),{constructor:vA,isInstancedBufferAttribute:!0,copy:function(t){return R.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this}});var yA=function(){function n(t){if(!(this instanceof n))throw new TypeError("Cannot call a class as a function");this.label=t,this.viewportV2=new Mt}var t,e,i;return t=n,(e=[{key:"frustum",get:function(){return this.label.N0.map.camera.isOrthographicCamera?this.frustumO:this.frustumP}},{key:"getGeometry",value:function(){for(var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],n=new jg,e=(n.instanceCount=t.length,[]),i=[],r=[],o=[],s=[],a=[],u=0;u<t.length;u++){var c=t[u],h=c.bottomLeft,f=c.eyeOffset,l=c.imageHeight,d=c.imageWidth,v=c.imageRectangleSize,p=c.scale,c=c.translate;e.push(h.x,h.y),i.push(f.x,f.y,f.z),r.push(d,l),o.push(v.width,v.height),a.push(c.x,c.y),s.push(p)}return n.setAttribute("bottomLeft",new vA(new Float32Array(e),2)),n.setAttribute("eyeOffset",new vA(new Float32Array(i),3)),n.setAttribute("imageSize",new vA(new Float32Array(r),2)),n.setAttribute("imageRectangle",new vA(new Float32Array(o),2)),n.setAttribute("scale",new vA(new Float32Array(s),1)),n.setAttribute("translate",new vA(new Float32Array(a),2)),n.setIndex([0,1,2,0,2,3]),n.setAttribute("direction",new R(new Float32Array([0,0,1,0,1,1,0,1]),2)),n}},{key:"_getUniform",value:function(t,n){var e=this.label.N0,i=e.map.camera,e=e.map.jt.renderer,r=new xh(t.canvas),e=(r.minFilter=Qn,r.magFilter=Qn,i.updateMatrix(),i.updateProjectionMatrix(),e.getDrawingBufferSize(this.viewportV2),this.frustumP=new iA({fov:G.toRadians(i.fov||60),aspectRatio:this.viewportV2.x/this.viewportV2.y,near:i.near,far:i.far}),this.frustumO=new dA({width:e.domElement.clientWidth,aspectRatio:e.domElement.clientWidth/e.domElement.clientHeight,near:i.near,far:i.far,zoom:i.zoom}),i.isOrthographicCamera?this.frustumO:this.frustumP),e=(e.update(),e.Bb),o=t.fillColor,t=t.fontSize;return{isHalo:{value:n},outlineColor:{value:this.label.outlineColor},outlineWidth:{value:this.label.outlineWidth},halo_blur:{value:1},czm_orthographicIn3D:{value:i.isOrthographicCamera?1:0},czm_currentFrustum:{value:[i.near,i.far]},czm_viewport:{value:[0,0,this.viewportV2.x,this.viewportV2.y]},czm_frustumPlanes:{value:[e.top,e.bottom,e.left,e.right]},czm_projection:{value:i.projectionMatrix},czm_viewMatrix:{value:i.matrixWorldInverse},u_atlas:{value:r},u_device_pixel_ratio:{value:this.label.pixelRatio},fontSize:{value:+t},fillColor:{value:o},pixelOffset:{value:this.label.pixelOffset},origin:{value:[S0.LEFT,this.label.verticalOrigin]}}}},{key:"init",value:function(t,n){var e,i=this;this.label.rootNode&&((e=new $a(this.getGeometry(t),new Gl({uniforms:this._getUniform(t[0],n),fragmentShader:"\nprecision highp float;\nprecision highp int;\n\n#define SDF_EDGE 0.75\n#define SDF_PX 8.0\n\nuniform sampler2D u_atlas;\nuniform vec3 fillColor;\nuniform float fontSize;\nuniform float u_device_pixel_ratio;\n\nuniform float isHalo;\nuniform float halo_blur;\nuniform vec3 outlineColor;\nuniform float outlineWidth;\n\nvarying vec2 v_textureCoordinates;\n\nvoid main() {\n float buff = (256.0 - 64.0) / 256.0;\n float fontScale = fontSize / 24.0;\n float EDGE_GAMMA = 0.105 / u_device_pixel_ratio;\n float gamma = EDGE_GAMMA / (fontScale);\n\n vec3 color = fillColor;\n\n if (isHalo > 0. ) {\n color = outlineColor;\n gamma = (halo_blur * 1.19 / SDF_PX + EDGE_GAMMA) / fontScale ;\n buff = (6.0 - outlineWidth / fontScale) / SDF_PX;\n }\n\n float dist = texture2D(u_atlas, v_textureCoordinates).a;\n float alpha = smoothstep(buff - gamma, buff + gamma, dist);\n\n gl_FragColor = vec4(color, alpha);\n\n if(isHalo > 0. && gl_FragColor.a < 0.95) {\n discard;\n }\n}\n",vertexShader:"\nuniform float czm_orthographicIn3D;\nuniform float u_device_pixel_ratio;\nuniform vec4 czm_viewport;\nuniform vec4 czm_frustumPlanes;\nuniform vec2 czm_currentFrustum;\nuniform mat4 czm_projection;\nuniform mat4 modelViewMatrix;\nuniform vec2 pixelOffset;\n\nattribute vec2 direction;\nuniform vec2 origin;\nattribute vec2 imageSize;\nattribute vec2 translate;\nattribute float scale;\n\nattribute vec3 eyeOffset;\nattribute vec2 bottomLeft;\nattribute vec2 imageRectangle;\n\nvarying vec2 v_textureCoordinates;\n\n/**\n * 计算屏幕上每个像素对应多少米\n * @param {vec4} positionEC 表示相机位置到目标点的向量\n * @param {float} pixelRatio 像素比例值\n */\nfloat czm_metersPerPixel(vec4 positionEC, float pixelRatio) {\n float width = czm_viewport.z;\n float height = czm_viewport.w;\n float pixelWidth;\n float pixelHeight;\n\n float top = czm_frustumPlanes.x;\n float bottom = czm_frustumPlanes.y;\n float left = czm_frustumPlanes.z;\n float right = czm_frustumPlanes.w;\n\n if (czm_orthographicIn3D == 1.0)\n {\n float frustumWidth = right - left;\n float frustumHeight = top - bottom;\n pixelWidth = frustumWidth / width;\n pixelHeight = frustumHeight / height;\n }\n else\n {\n float distanceToPixel = -positionEC.z;\n float inverseNear = 1.0 / czm_currentFrustum.x;\n float tanTheta = top * inverseNear;\n pixelHeight = 2.0 * distanceToPixel * tanTheta / height;\n tanTheta = right * inverseNear;\n pixelWidth = 2.0 * distanceToPixel * tanTheta / width;\n }\n\n return max(pixelWidth, pixelHeight) * pixelRatio;\n}\n\nfloat czm_metersPerPixel(vec4 positionEC) {\n return czm_metersPerPixel(positionEC, u_device_pixel_ratio);\n}\n\nfloat czm_branchFreeTernary(bool comparison, float a, float b) {\n float useA = float(comparison);\n return a * useA + b * (1.0 - useA);\n}\n\nvec4 addScreenSpaceOffset(\n vec4 positionEC,\n vec2 imageSize,\n float scale,\n vec2 direction,\n vec2 origin,\n vec2 translate,\n vec2 pixelOffset,\n vec3 alignedAxis,\n bool validAlignedAxis,\n float rotation,\n bool sizeInMeters,\n out mat2 rotationMatrix,\n out float mpp\n ) {\n vec2 halfSize = imageSize * scale * 0.5;\n halfSize *= ((direction * 2.0) - 1.0);\n vec2 originTranslate = origin * abs(halfSize);\n\n mpp = czm_metersPerPixel(positionEC);\n positionEC.xy += (originTranslate + halfSize) * czm_branchFreeTernary(sizeInMeters, 1.0, mpp);\n positionEC.xy += (translate + pixelOffset) * mpp;\n return positionEC;\n}\n\nvoid main() {\n vec4 positionEC = modelViewMatrix * vec4(0.,0.,0., 1.0);\n\n float mpp;\n mat2 rotationMatrix;\n bool validAlignedAxis = false;\n float rotation = 0.0;\n bool sizeInMeters = false;\n\n vec3 alignedAxis = vec3(0.0);\n positionEC = addScreenSpaceOffset(\n positionEC,\n imageSize,\n scale,\n direction,\n origin,\n translate,\n pixelOffset,\n alignedAxis,\n validAlignedAxis,\n rotation,\n sizeInMeters,\n rotationMatrix,\n mpp\n );\n gl_Position = czm_projection * positionEC;\n\n\n vec2 textureCoordinatesBottomLeft = bottomLeft;\n vec2 textureCoordinatesRange = imageRectangle;\n vec2 textureCoordinates = textureCoordinatesBottomLeft + direction * textureCoordinatesRange;\n v_textureCoordinates = textureCoordinates;\n}\n",transparent:!0,wireframe:!1,depthTest:!1}))).onBeforeRender=function(){var t=i.label.N0,n=t.map.camera,t=t.map.jt.renderer,t=(t.getDrawingBufferSize(i.viewportV2),i.frustumP.fov=G.toRadians(n.fov||60),i.frustumP.aspectRatio=i.viewportV2.x/i.viewportV2.y,i.frustumP.near=n.near,i.frustumP.far=n.far,i.frustumO.aspectRatio=t.domElement.clientWidth/t.domElement.clientHeight,i.frustumO.near=n.near,i.frustumO.far=n.far,i.frustumO.width=t.domElement.clientWidth,i.frustumO.zoom=n.zoom,n.isOrthographicCamera?i.frustumO:i.frustumP),t=(t.update(),t.Bb);e.material.uniforms.czm_currentFrustum.value=[n.near,n.far],e.material.uniforms.czm_viewport.value=[0,0,i.viewportV2.x,i.viewportV2.y],e.material.uniforms.czm_projection.value=n.projectionMatrix,e.material.uniforms.czm_frustumPlanes.value=[t.top,t.bottom,t.left,t.right],e.material.uniforms.czm_orthographicIn3D.value=n.isOrthographicCamera?1:0,e.material.uniforms.pixelOffset.value=i.label.pixelOffset,e.material.uniforms.origin.value=[S0.LEFT,i.label.verticalOrigin],e.material.uniforms.fillColor.value=i.label.U0,e.material.uniforms.u_device_pixel_ratio.value=i.label.pixelRatio},e.renderOrder=n?-1:1,t=n?"labelMeshInstance":"labelOutlineMeshInstance",this.label.rootNode.add(e),(this.label[t]=this).mesh=e)}}])&&mA(t.prototype,e),i&&mA(t,i),Object.defineProperty(t,"prototype",{writable:!1}),n}();function bA(t){return(bA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function gA(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=bA(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=bA(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==bA(t)?t:String(t)}(i.key),i)}}var _A,wA=function(){function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this.Qb=[],this.Zb=[],this.label=null}var n,e,i;return n=t,(e=[{key:"add",value:function(){var t=new tT(0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},this);return t.qb=this.Qb.length,this.Qb.push(t),t}},{key:"createMeshInstance",value:function(t){if(0!=t.length){this.label.C0=!1;for(var n=[],e=0;e<t.length;e++){var i=t[e],r=i.scale,o=i.pixelOffset,s=i.pickPrimitive,a=i.gb,u=i.wb,c=i.xb,h=i._b,f=i.Sb;if(-1===f)break;var f=this.Mb.textureCoordinates[f],l=f.width,d=f.height,v=f.x,f=f.y,p=this.Mb.Uh.width,m=this.Mb.Uh.height,p=Math.round(y(i.width,p*l)),m=Math.round(y(i.height,m*d));n.push({fontSize:s.ey,Eb:i.Eb,bottomLeft:{x:v,y:f},imageRectangleSize:{width:l,height:d},fillColor:i.color,show:1,scale:r,pixelOffset:o,imageWidth:p,imageHeight:m,eyeOffset:h,translate:{x:a.x,y:a.y},verticalOrigin:u,horizontalOrigin:c,canvas:this.Mb.texture.canvas})}new yA(this.label).init(n,!1),new yA(this.label).init(n,!0)}}},{key:"_updateBillboard",value:function(t){this.Zb.push(t)}},{key:"update",value:function(){var t=this.Zb.length,n=this.Mb.textureCoordinates;if(0!==n.length){for(var e=0;e<t;++e)this.Zb[e].C0=!1;this.createMeshInstance(this.Zb),this.Zb.length=0}}}])&&gA(n.prototype,e),i&&gA(n,i),Object.defineProperty(n,"prototype",{writable:!1}),t}(),xA=Object.freeze({FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2}),EA=Object.freeze({FONT_SIZE:48,PADDING:10,RADIUS:12,CUTOFF:.25});function SA(t,n){if(!I(t))throw new m("text is required.");var e,i,r,o,s,a,u,c,h,f,l,d,v,p;if(""!==t)return n=y(n,y.EMPTY_OBJECT),e=y(n.font,"10px sans-serif"),i=y(n.stroke,!1),r=y(n.fill,!0),o=y(n.strokeWidth,1),s=y(n.backgroundColor,Q3.TRANSPARENT),v=2*(a=y(n.padding,0)),(u=document.createElement("canvas")).width=1,u.height=1,u.style.font=e,c=u.getContext("2d",{willReadFrequently:!0}),I(_A)||(I(c.imageSmoothingEnabled)?_A="imageSmoothingEnabled":I(c.mozImageSmoothingEnabled)?_A="mozImageSmoothingEnabled":I(c.webkitImageSmoothingEnabled)?_A="webkitImageSmoothingEnabled":I(c.msImageSmoothingEnabled)&&(_A="msImageSmoothingEnabled")),c.font=e,c.lineJoin="round",c.lineWidth=o,c[_A]=!1,p=(function(t){if(null!==(t=t.match(/\b\d+(?=px\b)/)))return parseInt(t[0])}(e)||0)/(/[\u4e00-\u9fa5]/.test(t)?11:15),c.textBaseline="Alphabetic",u.style.visibility="hidden",document.body.appendChild(u),d=function(t,n,e,i,r){var o=t.measureText(n);if(!/\S/.test(n))return{width:o.width,height:0,ascent:0,descent:0,minx:0};for(var s,a,u,c=document.defaultView.getComputedStyle(t.canvas).getPropertyValue("font-size").replace("px","")||EA.FONT_SIZE,h=document.createElement("canvas"),f=o.width+100|0,l=3*c,c=l/2,d=(h.width=f,h.height=l,h.getContext("2d")),v=(d.font=e,d.fillStyle="white",d.fillRect(0,0,h.width+1,h.height+1),i&&(d.strokeStyle="black",d.lineWidth=t.lineWidth,d.strokeText(n,50,c)),r&&(d.fillStyle="black",d.fillText(n,50,c)),d.getImageData(0,0,f,l).data),p=v.length,m=4*f,y=0;y<p;++y)if(255!==v[y]){a=y/m|0;break}for(y=p-1;0<=y;--y)if(255!==v[y]){u=y/m|0;break}var b=-1;for(y=0;y<f&&-1===b;++y)for(s=0;s<l;++s){var g=4*y+s*m;if(255!==v[g]||255!==v[1+g]||255!==v[2+g]||255!==v[3+g]){b=y;break}}return{width:o.width,height:u-a,ascent:c-a,descent:u-c,minx:b-50}}(c,t,e,i,r),u.dimensions=d,document.body.removeChild(u),u.style.visibility="",h=-d.minx,f=Math.ceil(d.width)+h+v,d=(l=d.height+v)-(l-d.ascent+a)+v-p,u.width=f,u.height=l,c.font=e,c.lineJoin="round",c.lineWidth=o,c[_A]=!1,s!==Q3.TRANSPARENT&&(c.fillStyle=s.getStyle(),c.fillRect(0,0,u.width,u.height)),i&&(v=y(n.strokeColor,Q3.BLACK),c.strokeStyle=v.getStyle(),c.strokeText(t,h+a,d)),r&&(p=y(n.fillColor,Q3.WHITE),c.fillStyle=p.getStyle(),c.fillText(t,h+a,d)),u}function TA(t){return(TA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function AA(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=TA(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=TA(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==TA(t)?t:String(t)}(i.key),i)}}function MA(t,n,e){return n&&AA(t.prototype,n),e&&AA(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var OA=MA(function t(n,e,i){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this.labelCollection=n,this.index=e,this.dimensions=i}),LA=1e20;function RA(t,n,e,i,r,o,s){for(var a=0;a<n;a++){for(var u=0;u<e;u++)i[u]=t[u*n+a];for(NA(i,r,o,s,e),u=0;u<e;u++)t[u*n+a]=r[u]}for(u=0;u<e;u++){for(a=0;a<n;a++)i[a]=t[u*n+a];for(NA(i,r,o,s,n),a=0;a<n;a++)t[u*n+a]=Math.sqrt(r[a])}}function NA(t,n,e,i,r){i[e[0]=0]=-LA,i[1]=+LA;for(var o=1,s=0;o<r;o++){for(var a=(t[o]+o*o-(t[e[s]]+e[s]*e[s]))/(2*o-2*e[s]);a<=i[s];)s--,a=(t[o]+o*o-(t[e[s]]+e[s]*e[s]))/(2*o-2*e[s]);e[++s]=o,i[s]=a,i[s+1]=+LA}for(s=o=0;o<r;o++){for(;i[s+1]<o;)s++;n[o]=(o-e[s])*(o-e[s])+t[e[s]]}}function PA(t){return(PA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function FA(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=PA(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=PA(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==PA(t)?t:String(t)}(i.key),i)}}function jA(t,n,e){return n&&FA(t.prototype,n),e&&FA(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var IA=jA(function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this.textureInfo=null,this.dimensions=null});function CA(t){return(CA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function DA(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=CA(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=CA(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==CA(t)?t:String(t)}(i.key),i)}}function kA(t,n,e){return n&&DA(t.prototype,n),e&&DA(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var UA=kA(function t(n,e,i,r){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this.x=y(n,0),this.y=y(e,0),this.width=y(i,0),this.height=y(r,0)}),BA={},GA=0,HA=256;function XA(t,n){return document.defaultView.getComputedStyle(t,null).getPropertyValue(n)}function VA(t,n){n.textureInfo=void 0,n.dimensions=void 0;var e=n.billboard;e&&(e.show=!1,e.image=void 0,e.Kb&&(e.Kb(),e.Kb=void 0),n.billboard=void 0)}var zA={};function WA(t){var n,e,i=BA[t.Jb];i||((n=document.createElement("div")).style.position="absolute",n.style.opacity=0,n.style.font=t.Jb,document.body.appendChild(n),e=parseFloat(XA(n,"line-height")),isNaN(e)&&(e=void 0),i={family:XA(n,"font-family"),size:XA(n,"font-size").replace("px",""),style:XA(n,"font-style"),weight:XA(n,"font-weight"),lineHeight:e},document.body.removeChild(n),GA<HA&&(BA[t.Jb]=i,GA++)),t.Hm=i.family,t.ey=i.size,t.$b=i.style,t.tg=i.weight,t.ng=i.lineHeight}function YA(t,n,e,i){var r,o,n="".concat(n.$b," ").concat(n.tg," ").concat(EA.FONT_SIZE,"px ").concat(n.Hm),n=(t=t,s=Q3.WHITE,u=Q3.WHITE,r=0,o=xA.FILL,i=i,zA.font=n,zA.fillColor=s,zA.strokeColor=u,zA.strokeWidth=r,zA.padding=EA.PADDING,i===T0.CENTER?zA.textBaseline="middle":i===T0.TOP?zA.textBaseline="top":zA.textBaseline="bottom",zA.fill=o===xA.FILL||o===xA.FILL_AND_OUTLINE,zA.stroke=o===xA.OUTLINE||o===xA.FILL_AND_OUTLINE,zA.backgroundColor=Q3.BLACK,SA(t,zA)),s=new OA(e,-1,n.dimensions);if(0<n.width&&0<n.height){for(var a=function(t,n){var e,i,r,o,s,a=null==(n=n||{}).cutoff?.25:n.cutoff,u=null==n.radius?8:n.radius,c=n.channel||0;if(ArrayBuffer.isView(t)||Array.isArray(t)){if(!n.width||!n.height)throw Error("For raw data width and height should be provided by options");e=n.width,i=n.height,r=t,s=n.stride||Math.floor(t.length/e/i)}else window.HTMLCanvasElement&&t instanceof window.HTMLCanvasElement?(d=(l=t).getContext("2d"),e=l.width,i=l.height,r=(v=d.getImageData(0,0,e,i)).data,s=4):window.CanvasRenderingContext2D&&t instanceof window.CanvasRenderingContext2D?(e=(l=t.canvas).width,i=l.height,r=(v=(d=t).getImageData(0,0,e,i)).data,s=4):window.ImageData&&t instanceof window.ImageData&&(e=(v=t).width,i=t.height,r=v.data,s=4);if(n=Math.max(e,i),window.Uint8ClampedArray&&r instanceof window.Uint8ClampedArray||window.Uint8Array&&r instanceof window.Uint8Array)for(o=r,r=Array(e*i),p=0,m=Math.floor(o.length/s);p<m;p++)r[p]=o[p*s+c]/255;else if(1!==s)throw Error("Raw data can have only 1 value per pixel");for(var h=Array(e*i),f=Array(e*i),l=Array(n),d=Array(n),t=Array(n+1),v=Array(n),p=0,m=e*i;p<m;p++){var y=r[p];h[p]=1===y?0:0===y?LA:Math.pow(Math.max(0,.5-y),2),f[p]=1===y?LA:0===y?0:Math.pow(Math.max(0,y-.5),2)}RA(h,e,i,l,d,v,t),RA(f,e,i,l,d,v,t);var b=new(window.Float32Array?Float32Array:Array)(e*i);for(p=0,m=e*i;p<m;p++)b[p]=Math.min(Math.max(1-((h[p]-f[p])/u+a),0),1);return b}(n,{cutoff:EA.CUTOFF,radius:EA.RADIUS}),u=n.getContext("2d"),c=n.width,h=n.height,f=u.getImageData(0,0,c,h),l=0;l<c;l++)for(var d=0;d<h;d++){var v=d*c+l,p=255*a[v],v=4*v;f.data[0+v]=p,f.data[1+v]=p,f.data[2+v]=p,f.data[3+v]=p}u.putImageData(f,0,0)}return{glyphTextureInfo:s,canvas:n}}function QA(t,n,e){return n===S0.CENTER?-t/2:n===S0.RIGHT?-(t+e.x):e.x}var ZA=new Mt,qA=new Mt,KA=new UA(1,1,1,1);function JA(t){var n=t.eg,e=t.L0,i=0,r=0,o=[],s=Number.NEGATIVE_INFINITY,a=0,u=1,c=n.length,h=t.ig,f=Z3.clone(I(h)?t._backgroundPadding:Z3.ZERO,qA);for(f.x/=t.rg,f.y/=t.rg,j=0;j<c;++j)"\n"===e.charAt(j)?(o.push(i),++u,i=0):(b=(y=n[j]).dimensions,a=Math.max(a,b.height-b.descent),s=Math.max(s,b.descent),i+=b.width-b.minx,j<c-1&&(i+=n[j+1].dimensions.minx),r=Math.max(r,i));o.push(i);for(var l,d,v,p,m,y,b,g=a+s,_=t.totalScale,w=t.xb,x=t.wb,E=t.Ym,S=0,T=o[S],A=QA(T,w,f),M=(l=r,d=T,E=E,v=f,p=0,p=(M=w)===S0.CENTER?-l/2:M===S0.RIGHT?-(l+v.x):v.x,E===Hl.Left?p+=0:E===Hl.Right?p+=l-d+v.x:p+=l/2-d/2,p),O=(T<r&&1<o.length&&(A=M),(I(t.ng)?t.ng:1.2*t.ey)/t.rg),L=O*(u-1),R=r,N=g+L,P=(I(h)&&(R+=2*f.x,N+=2*f.y,h.og=w),ZA.x=A*_,!(ZA.y=0)),F=0,j=0;j<c;++j)"\n"===e.charAt(j)?(F+=O,A=QA(o[++S],w,f),ZA.x=A*_,P=!0):(b=(y=n[j]).dimensions,x===T0.TOP?(ZA.y=b.height-a-f.y,ZA.y+=EA.PADDING):x===T0.CENTER?ZA.y=(L+b.height-a)/2:(x===T0.BASELINE?ZA.y=L:ZA.y=L+s+f.y,ZA.y-=EA.PADDING),ZA.y=(ZA.y-b.descent-F)*_,P&&(ZA.x-=EA.PADDING*_,P=!1),I(y.billboard)&&(y.billboard._setTranslate(ZA),y.billboard.sg.x=R,y.billboard.sg.y=N,y.billboard.og=w),j<c-1&&(m=n[j+1],ZA.x+=(b.width-b.minx+m.dimensions.minx)*_));I(h)&&0<e.split("\n").join("").length&&(A=w===S0.CENTER?-r/2-f.x:w===S0.RIGHT?-(r+2*f.x):0,ZA.x=A*_,x===T0.TOP?ZA.y=g-a-s:x===T0.CENTER?ZA.y=(g-a)/2-s:x===T0.BASELINE?ZA.y=-f.y-s:ZA.y=0,ZA.y=ZA.y*_,h.width=R,h.height=N,h._setTranslate(ZA),h.ag=Z3.clone(ZA,h.ag))}function $A(t){return($A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function tM(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=$A(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=$A(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==$A(t)?t:String(t)}(i.key),i)}}var nM=function(){function r(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},n=1<arguments.length?arguments[1]:void 0,e=this,i=r;if(!(e instanceof i))throw new TypeError("Cannot call a class as a function");this.N0=n,this.k0=!1,this.L0="",this.Jb='16px \'"Microsoft Yahei","微软雅黑",Tahoma,Arial\'',this.U0=[0,0,0],this.eg=[],this.style=xA.FILL,this.xb=S0.CENTER,this.wb=T0.CENTER,this.Z1=y(t.scale,1),this.ug=t.pixelOffset||[0,0],this._b=q3.clone(y(t.eyeOffset,q3.ZERO)),this.outlineColor=[0,0,0],this.outlineWidth=0,WA(this)}var t,n,e;return t=r,(n=[{key:"horizontalOrigin",get:function(){return this.xb}},{key:"verticalOrigin",get:function(){return this.wb}},{key:"text",get:function(){return this.L0},set:function(t){if(this.L0!==t){if(this.L0="",-1<t.indexOf("%rn%")){for(var n=t.split("%rn%"),e=0;e<n.length;e++)this.L0+=n[e],this.L0+="\n";this.L0=this.L0.slice(0,this.L0.length-1)}else this.L0=t;this.k0=!0}}},{key:"font",get:function(){return this.Jb},set:function(t){this.Jb!==t&&(this.Jb=t,this.k0=!0,WA(this))}},{key:"pixelOffset",get:function(){return this.ug},set:function(n){this.ug=n,this.N0.bb.Qb.forEach(function(t){t.pixelOffset=n})}},{key:"totalScale",get:function(){return this.Z1*this.rg}},{key:"getScreenSpaceBoundingBox",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{x:0,y:0},n=1<arguments.length?arguments[1]:void 0,e=this,i=0,r=0,o=0,s=0,a=e.totalScale,u=e.ig;if(I(u))i=t.x+u.gb.x,r=t.y-u.gb.y,o=u.width*a,s=u.height*a,e.verticalOrigin===T0.BOTTOM||e.verticalOrigin===T0.BASELINE?r-=s:e.verticalOrigin===T0.CENTER&&(r-=.5*s);else{for(var i=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY,c=0,h=0,f=e.eg,l=f.length,d=0;d<l;++d){var v,p,m=f[d],y=m.billboard;I(y)&&(v=t.x+y.gb.x,y=t.y-y.gb.y,p=m.dimensions.width*a,m=m.dimensions.height*a,e.verticalOrigin===T0.BOTTOM||e.verticalOrigin===T0.BASELINE?y-=m:e.verticalOrigin===T0.CENTER&&(y-=.5*m),e.wb===T0.TOP?y+=EA.PADDING*a:e.wb!==T0.BOTTOM&&e.wb!==T0.BASELINE||(y-=EA.PADDING*a),i=Math.min(i,v),r=Math.min(r,y),c=Math.max(c,v+p),h=Math.max(h,y+m))}o=c-i,s=h-r}return(n=I(n)?n:new UA).x=i,n.y=r,n.width=o,n.height=s,n}}])&&tM(t.prototype,n),e&&tM(t,e),Object.defineProperty(t,"prototype",{writable:!1}),r}();var eM=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var n=16*Math.random()|0;return("x"===t?n:3&n|8).toString(16)})},E2=Object.freeze({DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGBA_ASTC_4x4_WEBGL:37808,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGBA_BPTC_UNORM:36492,HALF_FLOAT_OES:36193,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047}),Gw={DEPTH_COMPONENT:E2.DEPTH_COMPONENT,DEPTH_STENCIL:E2.DEPTH_STENCIL,ALPHA:E2.ALPHA,RED:E2.RED,RG:E2.RG,RGB:E2.RGB,RGBA:E2.RGBA,LUMINANCE:E2.LUMINANCE,LUMINANCE_ALPHA:E2.LUMINANCE_ALPHA,RGB_DXT1:E2.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:E2.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:E2.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:E2.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:E2.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:E2.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:E2.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:E2.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGBA_ASTC:E2.COMPRESSED_RGBA_ASTC_4x4_WEBGL,RGB_ETC1:E2.COMPRESSED_RGB_ETC1_WEBGL,RGB8_ETC2:E2.COMPRESSED_RGB8_ETC2,RGBA8_ETC2_EAC:E2.COMPRESSED_RGBA8_ETC2_EAC,RGBA_BC7:E2.COMPRESSED_RGBA_BPTC_UNORM},iM=Object.freeze(Gw);function rM(t){return(rM="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function oM(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=rM(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=rM(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==rM(t)?t:String(t)}(i.key),i)}}var sM=function(){function i(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},n=this,e=i;if(!(n instanceof e))throw new TypeError("Cannot call a class as a function");this.pi=eM(),this.width=t.width,this.height=t.height,this.canvas=document.createElement("canvas"),this.canvas.width=this.width,this.canvas.height=this.height,this.ctx=this.canvas.getContext("2d")}var t,n,e;return t=i,(n=[{key:"copyFrom",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},n=y(t.xOffset,0),e=y(t.yOffset,0),t=t.source,i=this.canvas.height,r=t.width,o=t.height,t=t.getContext("2d").getImageData(0,0,r,o);this.ctx.putImageData(t,n,i-o-e)}}])&&oM(t.prototype,n),e&&oM(t,e),Object.defineProperty(t,"prototype",{writable:!1}),i}();function aM(t){return(aM="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function uM(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=aM(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=aM(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==aM(t)?t:String(t)}(i.key),i)}}function cM(t,n,e){return n&&uM(t.prototype,n),e&&uM(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var hM=cM(function t(n,e,i,r,o){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this.bottomLeft=y(n,Z3.ZERO),this.topRight=y(e,Z3.ZERO),this.childNode1=i,this.childNode2=r,this.imageIndex=o});function fM(t,n,e){var i=function t(n,e,i){var r,o;if(I(e))return I(e.childNode1)||I(e.childNode2)?t(n,e.childNode1,i)||t(n,e.childNode2,i):I(e.imageIndex)||(o=e.topRight.x-e.bottomLeft.x,r=e.topRight.y-e.bottomLeft.y,o-=i.width,r-=i.height,o<0)||r<0?void 0:0==o&&0==r?e:(r<o?(e.childNode1=new hM(new Mt(e.bottomLeft.x,e.bottomLeft.y),new Mt(e.bottomLeft.x+i.width,e.topRight.y)),(r=e.bottomLeft.x+i.width+n.cg)<e.topRight.x&&(e.childNode2=new hM(new Mt(r,e.bottomLeft.y),new Mt(e.topRight.x,e.topRight.y)))):(e.childNode1=new hM(new Mt(e.bottomLeft.x,e.bottomLeft.y),new Mt(e.topRight.x,e.bottomLeft.y+i.height)),(o=e.bottomLeft.y+i.height+n.cg)<e.topRight.y&&(e.childNode2=new hM(new Mt(e.bottomLeft.x,o),new Mt(e.topRight.x,e.topRight.y)))),t(n,e.childNode1,i))}(t,t.us,n);if(I(i)){i.imageIndex=e;var r=t.Uh.width,o=t.Uh.height,s=i.topRight.x-i.bottomLeft.x,a=i.topRight.y-i.bottomLeft.y,u=i.bottomLeft.x/r,c=i.bottomLeft.y/o;t.hg[e]=new UA(u,c,s/r,a/o),t.Uh.copyFrom({source:n,xOffset:i.bottomLeft.x,yOffset:i.bottomLeft.y})}else{var h=t,u=n,c=h.numberOfImages,s=h.cg;if(0<c){for(var c=h.Uh.width,r=h.Uh.height,f=2*(c+u.width+s),l=2*(r+u.height+s),d=c/f,v=r/l,c=new hM(new Mt(c+s,s),new Mt(f,r)),c=new hM(new Mt,new Mt(f,r),h.us,c),r=new hM(new Mt(s,r+s),new Mt(f,l)),c=new hM(new Mt,new Mt(f,l),c,r),p=0;p<h.hg.length;p++){var m=h.hg[p];I(m)&&(m.x*=d,m.y*=v,m.width*=d,m.height*=v)}r=new sM({context:h._context,width:f,height:l,pixelFormat:h.fg});r.copyFrom({source:h.Uh.canvas}),h.Uh=r,h.us=c}else{f=2*(u.width+2*s),l=2*(u.height+2*s);f<h.lg.x&&(f=h.lg.x),l<h.lg.y&&(l=h.lg.y),h.Uh=h.Uh&&h.Uh.destroy(),h.Uh=new sM({context:h._context,width:f,height:l,pixelFormat:h.fg}),h.us=new hM(new Mt(s,s),new Mt(f,l))}fM(t,n,e)}t.dg=eM()}function lM(t){return(lM="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function dM(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=lM(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=lM(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==lM(t)?t:String(t)}(i.key),i)}}var vM=new Mt(16,16),pM=function(){function i(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},n=this,e=i;if(!(n instanceof e))throw new TypeError("Cannot call a class as a function");n=y(t.borderWidthInPixels,1),e=y(t.initialSize,vM);this.fg=y(t.pixelFormat,iM.RGBA),this.cg=n,this.hg=[],this.dg=eM(),this.vg={},this.pg={},this.lg=e,this.us=void 0}var t,n,e;return t=i,(n=[{key:"numberOfImages",get:function(){return this.hg.length}},{key:"textureCoordinates",get:function(){return this.hg}},{key:"texture",get:function(){return this.Uh}},{key:"addImageSync",value:function(t,n){if(!I(t))throw new m("id is required.");var e,i;if(I(n))return I(e=this.pg[t])||(n=n,e=!I(i=this)||i.isDestroyed()?-1:(fM(i,n,n=i.numberOfImages),n),this.vg[t]=Promise.resolve(e),this.pg[t]=e),e;throw new m("image is required.")}},{key:"isDestroyed",value:function(){return!1}},{key:"addImage",value:function(t){var n=this.vg[t];return I(n)||(this.vg[t]=n),n}}])&&dM(t.prototype,n),e&&dM(t,e),Object.defineProperty(t,"prototype",{writable:!1}),i}();function mM(t){return(mM="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function yM(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){t=function(t,n){if("object"!=mM(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=mM(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==mM(t)?t:String(t)}(i.key),i)}}var bM,t=function(){function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this.map=null,this.D0={},this.mg=[],this._v=[],this.Mb=new pM,this.bb=new wA,this.bb.Mb=this.Mb}var n,e,i;return n=t,(e=[{key:"add",value:function(t){t=new nM(t,this);return this._v.push(t),this.bb.label=t}},{key:"update",value:function(){for(var t=this._v.length,n=0;n<t;n++){var e=this._v[n];if(e.k0){b=y=m=p=d=l=f=v=i=c=u=a=s=h=o=r=void 0;var i,r=this,o=e,s=h=o.L0,a=h.length,u=o.eg,c=u.length;if(o.rg=o.ey/EA.FONT_SIZE,a<c)for(i=a;i<c;++i)VA(0,u[i]);u.length=a;for(var h=o._showBackground&&0<h.split("\n").join("").length,f=o.ig,l=r._backgroundBillboardCollection,d=(h?(I(f)||(f=l.add({collection:r,image:"ID_WHITE_PIXEL",imageSubRegion:KA}),o.ig=f),f.color=o.hm,f.show=o.oh,f.position=o._position,f.eyeOffset=o._b,f.pixelOffset=o.ug,f.horizontalOrigin=S0.LEFT,f.verticalOrigin=o.wb,f.heightReference=o._heightReference,f.scale=o.totalScale,f.pickPrimitive=o,f.id=o.pi,f.translucencyByDistance=o._translucencyByDistance,f.pixelOffsetScaleByDistance=o._pixelOffsetScaleByDistance,f.scaleByDistance=o._scaleByDistance,f.distanceDisplayCondition=o._distanceDisplayCondition,f.disableDepthTestDistance=o._disableDepthTestDistance):I(f)&&(l.remove(f),o.ig=f=void 0),r.D0),v=0;v<a;++v){var p=s[v],m=o.wb,y=JSON.stringify([p,o.Hm,o.$b,o.tg,+m]),b=d[y];I(b)||(b=(m=YA(p,o,r,m)).glyphTextureInfo,d[y]=b," "!==p&&(b.index=r.Mb.addImageSync(y,m.canvas))),I(p=u[v])?-1===b.index?VA(0,p):I(p.textureInfo)&&(p.textureInfo=void 0):(p=new IA,u[v]=p),p.textureInfo=b,p.dimensions=b.dimensions,-1!==b.index&&(m=p.billboard,b=r.mg,I(m)||(0<b.length?m=b.pop():((m=r.bb.add({collection:r})).sg=new Mt,m.ag=new Mt),p.billboard=m),m.show=o.oh,m.position=o._position,m.eyeOffset=o._b,m.pixelOffset=o.ug,m.horizontalOrigin=S0.LEFT,m.verticalOrigin=o.wb,m.heightReference=o._heightReference,m.scale=o.totalScale,m.pickPrimitive=o,m.id=o.pi,m.image=y,m.translucencyByDistance=o._translucencyByDistance,m.pixelOffsetScaleByDistance=o._pixelOffsetScaleByDistance,m.scaleByDistance=o._scaleByDistance,m.distanceDisplayCondition=o._distanceDisplayCondition,m.disableDepthTestDistance=o._disableDepthTestDistance,m.yg=o.yg,m.outlineColor=o.outlineColor,o.style===xA.FILL_AND_OUTLINE?(m.color=o.U0,m.outlineWidth=o.outlineWidth):o.style===xA.FILL?(m.color=o.U0,m.outlineWidth=0):o.style===xA.OUTLINE&&(m.color=Q3.TRANSPARENT,m.outlineWidth=o.outlineWidth))}o.bg=!0,e.k0=!1}e.bg&&(JA(e),e.bg=!1)}this.bb.update()}}])&&yM(n.prototype,e),i&&yM(n,i),Object.defineProperty(n,"prototype",{writable:!1}),t}(),gM=(st.a.DepthPeelingRenderer=jy,st.a.LabelCollection=t,{FMMouseMode:Zo,VERSION:_,BUILD:S,FMMap:p,FMType:E,FMViewMode:xi,FMShadingMode:ls,FMInfoMode:vr,FMTextAlign:Hl,FMLineType:E_,FMLabelField:a1,FMMarkerAnchor:pr,FMEdgeMode:LE,FMDepthPeelingMode:ix,FMOverviewMode:Nm,FMEnterTriggerMode:ex,FMUtil:dr,FMCalculator:M1,FMCoordsTransformer:c2,FMImageMarker:ib,FMMarker:Fg,FMTextMarker:bb,FMPolygonMarker:m2,FMLocationMarker:R2,FMHeatMap:Jd,FMDynamicModel:e,FMLineMarker:j_,FMDomMarker:Zy,FMExtrudeMarker:Aw,FMSegment:x_,FMMarkerLayer:$1,FMBound:Fi,FMOrientedBound:n,FMRectangle:S1,FMMarkerFun:P2,FMMapMask:N2,FMLight:i,FMLightMode:AS,FMDynamicTextureTool:Zw,FMMarkerCluster:e2}),tv=Uh.a.global(),_M=void 0!==tv?tv.fengmap:{};for(bM in null==_M&&(_M={}),gM)_M[bM]=gM[bM];void 0!==tv&&(tv.fengmap=_M);s.default=_M}]).default});