aframe-master.min.js.map 3.3 MB

1
  1. {"version":3,"sources":["node_modules/browser-pack/_prelude.js","node_modules/super-three/build/three.js","node_modules/super-three/examples/js/lights/LightProbeGenerator.js","node_modules/super-three/examples/js/loaders/DRACOLoader.js","node_modules/super-three/examples/js/loaders/GLTFLoader.js","node_modules/super-three/examples/js/loaders/MTLLoader.js","node_modules/super-three/examples/js/loaders/OBJLoader.js","node_modules/super-three/examples/js/utils/BufferGeometryUtils.js","node_modules/three-bmfont-text/index.js","package.json","src/components/hand-tracking-controls.js","src/components/layer.js","src/style/aframe.css","src/style/rStats.css","src/utils/ios-orientationchange-blank-bug.js","node_modules/an-array/index.js","node_modules/as-number/index.js","node_modules/base64-js/index.js","node_modules/browserify-css/browser.js","node_modules/buffer-equal/index.js","node_modules/buffer/index.js","node_modules/custom-event-polyfill/polyfill.js","node_modules/debug/browser.js","node_modules/debug/debug.js","node_modules/deep-assign/index.js","node_modules/define-properties/index.js","node_modules/document-register-element/build/document-register-element.js","node_modules/dtype/index.js","node_modules/es-abstract/GetIntrinsic.js","node_modules/es-abstract/es5.js","node_modules/es-abstract/helpers/assertRecord.js","node_modules/es-abstract/helpers/isFinite.js","node_modules/es-abstract/helpers/isNaN.js","node_modules/es-abstract/helpers/mod.js","node_modules/es-abstract/helpers/sign.js","node_modules/es-to-primitive/es5.js","node_modules/es-to-primitive/helpers/isPrimitive.js","node_modules/flatten-vertex-data/index.js","node_modules/for-each/index.js","node_modules/function-bind/implementation.js","node_modules/function-bind/index.js","node_modules/global/window.js","node_modules/has/src/index.js","node_modules/ieee754/index.js","node_modules/inherits/inherits_browser.js","node_modules/is-buffer/index.js","node_modules/is-callable/index.js","node_modules/is-function/index.js","node_modules/is-obj/index.js","node_modules/isarray/index.js","node_modules/layout-bmfont-text/index.js","node_modules/load-bmfont/browser.js","node_modules/load-bmfont/lib/is-binary.js","node_modules/object-assign/index.js","node_modules/object-keys/implementation.js","node_modules/object-keys/index.js","node_modules/object-keys/isArguments.js","node_modules/parse-bmfont-ascii/index.js","node_modules/parse-bmfont-binary/index.js","node_modules/parse-bmfont-xml/lib/browser.js","node_modules/parse-bmfont-xml/lib/parse-attribs.js","node_modules/parse-headers/parse-headers.js","node_modules/present/lib/present-browser.js","node_modules/process/browser.js","node_modules/promise-polyfill/Promise.js","node_modules/quad-indices/index.js","node_modules/string.prototype.trim/implementation.js","node_modules/string.prototype.trim/index.js","node_modules/string.prototype.trim/polyfill.js","node_modules/string.prototype.trim/shim.js","node_modules/super-animejs/lib/anime.js","node_modules/three-bmfont-text/lib/utils.js","node_modules/three-bmfont-text/lib/vertices.js","node_modules/three-buffer-vertex-data/index.js","node_modules/timers-browserify/main.js","node_modules/webvr-polyfill/build/webvr-polyfill.js","node_modules/word-wrapper/index.js","node_modules/xhr/index.js","node_modules/xml-parse-from-string/index.js","node_modules/xtend/immutable.js","src/components/animation.js","src/components/camera.js","src/components/cursor.js","src/components/daydream-controls.js","src/components/gearvr-controls.js","src/components/generic-tracked-controller-controls.js","src/components/geometry.js","src/components/gltf-model.js","src/components/hand-controls.js","src/components/hide-on-enter-ar.js","src/components/hp-mixed-reality-controls.js","src/components/index.js","src/components/laser-controls.js","src/components/light.js","src/components/line.js","src/components/link.js","src/components/look-controls.js","src/components/magicleap-controls.js","src/components/material.js","src/components/obj-model.js","src/components/oculus-go-controls.js","src/components/oculus-touch-controls.js","src/components/position.js","src/components/raycaster.js","src/components/rotation.js","src/components/scale.js","src/components/scene/ar-hit-test.js","src/components/scene/background.js","src/components/scene/debug.js","src/components/scene/device-orientation-permission-ui.js","src/components/scene/embedded.js","src/components/scene/fog.js","src/components/scene/inspector.js","src/components/scene/keyboard-shortcuts.js","src/components/scene/pool.js","src/components/scene/screenshot.js","src/components/scene/stats.js","src/components/scene/vr-mode-ui.js","src/components/shadow.js","src/components/sound.js","src/components/text.js","src/components/tracked-controls-webvr.js","src/components/tracked-controls-webxr.js","src/components/tracked-controls.js","src/components/valve-index-controls.js","src/components/visible.js","src/components/vive-controls.js","src/components/vive-focus-controls.js","src/components/wasd-controls.js","src/components/windows-motion-controls.js","src/constants/index.js","src/constants/keyboardevent.js","src/core/a-assets.js","src/core/a-cubemap.js","src/core/a-entity.js","src/core/a-mixin.js","src/core/a-node.js","src/core/a-register-element.js","src/core/component.js","src/core/geometry.js","src/core/propertyTypes.js","src/core/scene/a-scene.js","src/core/scene/loadingScreen.js","src/core/scene/metaTags.js","src/core/scene/postMessage.js","src/core/scene/scenes.js","src/core/scene/wakelock.js","src/core/schema.js","src/core/shader.js","src/core/system.js","src/extras/components/index.js","src/extras/components/pivot.js","src/extras/primitives/getMeshMixin.js","src/extras/primitives/index.js","src/extras/primitives/primitives.js","src/extras/primitives/primitives/a-camera.js","src/extras/primitives/primitives/a-cursor.js","src/extras/primitives/primitives/a-curvedimage.js","src/extras/primitives/primitives/a-gltf-model.js","src/extras/primitives/primitives/a-image.js","src/extras/primitives/primitives/a-light.js","src/extras/primitives/primitives/a-link.js","src/extras/primitives/primitives/a-obj-model.js","src/extras/primitives/primitives/a-sky.js","src/extras/primitives/primitives/a-sound.js","src/extras/primitives/primitives/a-text.js","src/extras/primitives/primitives/a-video.js","src/extras/primitives/primitives/a-videosphere.js","src/extras/primitives/primitives/meshPrimitives.js","src/geometries/box.js","src/geometries/circle.js","src/geometries/cone.js","src/geometries/cylinder.js","src/geometries/dodecahedron.js","src/geometries/icosahedron.js","src/geometries/index.js","src/geometries/octahedron.js","src/geometries/plane.js","src/geometries/ring.js","src/geometries/sphere.js","src/geometries/tetrahedron.js","src/geometries/torus.js","src/geometries/torusKnot.js","src/geometries/triangle.js","src/index.js","src/lib/rStatsAframe.js","src/lib/three.js","src/shaders/flat.js","src/shaders/index.js","src/shaders/ios10hls.js","src/shaders/msdf.js","src/shaders/sdf.js","src/shaders/shadow.js","src/shaders/standard.js","src/systems/camera.js","src/systems/geometry.js","src/systems/gltf-model.js","src/systems/index.js","src/systems/light.js","src/systems/material.js","src/systems/renderer.js","src/systems/shadow.js","src/systems/tracked-controls-webvr.js","src/systems/tracked-controls-webxr.js","src/systems/webxr.js","src/utils/bind.js","src/utils/coordinates.js","src/utils/debug.js","src/utils/device.js","src/utils/entity.js","src/utils/forceCanvasResizeSafariMobile.js","src/utils/index.js","src/utils/is-ie11.js","src/utils/isIOSOlderThan10.js","src/utils/material.js","src/utils/object-pool.js","src/utils/split.js","src/utils/src-loader.js","src/utils/styleParser.js","src/utils/tracked-controls.js","vendor/DeviceOrientationControls.js","vendor/rStats.extras.js","vendor/rStats.js","vendor/starts-with-polyfill.js","vendor/wakelock/util.js","vendor/wakelock/wakelock.js"],"names":["anArray","arr","BYTES_PER_ELEMENT","str","call","buffer","Array","isArray","Object","prototype","toString","module","exports","num","def","getLens","b64","len","length","Error","validLen","indexOf","byteLength","lens","placeHoldersLen","_byteLength","toByteArray","tmp","Arr","curByte","i","revLookup","charCodeAt","tripletToBase64","lookup","encodeChunk","uint8","start","end","output","push","join","fromByteArray","extraBytes","parts","len2","Uint8Array","code","createLink","href","attributes","head","document","getElementsByTagName","link","createElement","rel","key","hasOwnProperty","value","setAttribute","appendChild","createStyle","cssText","style","type","sheet","innerHTML","styleSheet","createTextNode","Buffer","require","a","b","isBuffer","equals","typedArraySupport","__proto__","foo","subarray","e","kMaxLength","TYPED_ARRAY_SUPPORT","createBuffer","that","RangeError","arg","encodingOrOffset","this","allocUnsafe","from","TypeError","ArrayBuffer","fromArrayBuffer","fromString","fromObject","assertSize","size","alloc","fill","encoding","undefined","checked","string","isEncoding","actual","write","slice","fromArrayLike","array","byteOffset","obj","copy","isnan","data","SlowBuffer","isView","loweredCase","utf8ToBytes","base64ToBytes","toLowerCase","slowToString","hexSlice","utf8Slice","asciiSlice","latin1Slice","base64Slice","utf16leSlice","swap","n","m","bidirectionalIndexOf","val","dir","isNaN","arrayIndexOf","lastIndexOf","read","buf","indexSize","readUInt16BE","arrLength","valLength","String","foundIndex","found","j","hexWrite","offset","Number","remaining","strLen","parsed","parseInt","substr","utf8Write","blitBuffer","asciiWrite","asciiToBytes","latin1Write","base64Write","ucs2Write","utf16leToBytes","base64","Math","min","res","firstByte","codePoint","bytesPerSequence","secondByte","thirdByte","fourthByte","tempCodePoint","decodeCodePointsArray","codePoints","MAX_ARGUMENTS_LENGTH","fromCharCode","apply","ret","out","toHex","bytes","checkOffset","ext","checkInt","max","objectWriteUInt16","littleEndian","objectWriteUInt32","checkIEEE754","writeFloat","noAssert","ieee754","writeDouble","base64clean","stringtrim","replace","INVALID_BASE64_RE","trim","units","Infinity","leadSurrogate","byteArray","c","hi","lo","src","dst","INSPECT_MAX_BYTES","global","poolSize","_augment","Symbol","species","defineProperty","configurable","allocUnsafeSlow","_isBuffer","compare","x","y","concat","list","pos","swap16","swap32","swap64","arguments","inspect","match","target","thisStart","thisEnd","thisCopy","targetCopy","includes","isFinite","toJSON","_arr","newBuf","sliceLen","readUIntLE","mul","readUIntBE","readUInt8","readUInt16LE","readUInt32LE","readUInt32BE","readIntLE","pow","readIntBE","readInt8","readInt16LE","readInt16BE","readInt32LE","readInt32BE","readFloatLE","readFloatBE","readDoubleLE","readDoubleBE","writeUIntLE","writeUIntBE","writeUInt8","floor","writeUInt16LE","writeUInt16BE","writeUInt32LE","writeUInt32BE","writeIntLE","limit","sub","writeIntBE","writeInt8","writeInt16LE","writeInt16BE","writeInt32LE","writeInt32BE","writeFloatLE","writeFloatBE","writeDoubleLE","writeDoubleBE","targetStart","set","window","ce","CustomEvent","cancelable","preventDefault","defaultPrevented","event","params","evt","origPrevent","bubbles","createEvent","initCustomEvent","detail","get","Event","useColors","documentElement","console","firebug","exception","table","navigator","userAgent","RegExp","$1","formatArgs","args","namespace","color","index","lastC","splice","log","Function","save","namespaces","storage","removeItem","debug","load","r","localstorage","localStorage","chrome","local","colors","formatters","v","JSON","stringify","enable","selectColor","prevColor","disabled","enabled","self","coerce","format","formatter","bind","fn","split","skips","names","disable","name","test","stack","message","toObject","assignKey","to","isObj","assign","getOwnPropertySymbols","symbols","propIsEnumerable","propertyIsEnumerable","s","keys","hasSymbols","toStr","origDefineProperty","isFunction","arePropertyDescriptorsSupported","enumerable","_","supportsDescriptors","object","predicate","writable","defineProperties","map","predicates","props","t","st","gt","ot","it","w","at","ut","F","querySelectorAll","E","R","nodeName","toUpperCase","ft","lt","currentTarget","attrChange","attrName","Y","attributeChangedCallback","prevValue","newValue","f","ct","$","ht","G","removeEventListener","p","u","o","vt","pt","U","Z","dt","P","nt","observe","X","Q","tt","addEventListener","d","h","createdCallback","created","I","S","contains","mt","rt","et","random","l","g","T","N","C","isPrototypeOf","k","L","getOwnPropertyDescriptor","A","getOwnPropertyNames","O","getPrototypeOf","M","setPrototypeOf","D","create","yt","H","MutationObserver","WebKitMutationObserver","B","HTMLElement","Element","Node","nodeType","q","cloneNode","getAttribute","z","removeAttribute","W","characterData","attributeOldValue","V","J","requestAnimationFrame","webkitRequestAnimationFrame","mozRequestAnimationFrame","msRequestAnimationFrame","setTimeout","K","dispatchEvent","hasAttribute","propertyName","className","addedNodes","removedNodes","attributeName","oldValue","childList","subtree","shift","innerHTMLHelper","dtype","Int8Array","Int16Array","Int32Array","Uint16Array","Uint32Array","Float32Array","Float64Array","Uint8ClampedArray","ThrowTypeError","iterator","getProto","generator","generatorFunction","asyncFn","asyncFunction","constructor","asyncGen","asyncGenFunction","asyncGenIterator","TypedArray","INTRINSICS","$ %Array%","$ %ArrayBuffer%","$ %ArrayBufferPrototype%","$ %ArrayIteratorPrototype%","$ %ArrayPrototype%","$ %ArrayProto_entries%","entries","$ %ArrayProto_forEach%","forEach","$ %ArrayProto_keys%","$ %ArrayProto_values%","values","$ %AsyncFromSyncIteratorPrototype%","$ %AsyncFunction%","$ %AsyncFunctionPrototype%","$ %AsyncGenerator%","$ %AsyncGeneratorFunction%","$ %AsyncGeneratorPrototype%","$ %AsyncIteratorPrototype%","asyncIterator","$ %Atomics%","Atomics","$ %Boolean%","Boolean","$ %BooleanPrototype%","$ %DataView%","DataView","$ %DataViewPrototype%","$ %Date%","Date","$ %DatePrototype%","$ %decodeURI%","decodeURI","$ %decodeURIComponent%","decodeURIComponent","$ %encodeURI%","encodeURI","$ %encodeURIComponent%","encodeURIComponent","$ %Error%","$ %ErrorPrototype%","$ %eval%","eval","$ %EvalError%","EvalError","$ %EvalErrorPrototype%","$ %Float32Array%","$ %Float32ArrayPrototype%","$ %Float64Array%","$ %Float64ArrayPrototype%","$ %Function%","$ %FunctionPrototype%","$ %Generator%","$ %GeneratorFunction%","$ %GeneratorPrototype%","$ %Int8Array%","$ %Int8ArrayPrototype%","$ %Int16Array%","$ %Int16ArrayPrototype%","$ %Int32Array%","$ %Int32ArrayPrototype%","$ %isFinite%","$ %isNaN%","$ %IteratorPrototype%","$ %JSON%","$ %JSONParse%","parse","$ %Map%","Map","$ %MapIteratorPrototype%","$ %MapPrototype%","$ %Math%","$ %Number%","$ %NumberPrototype%","$ %Object%","$ %ObjectPrototype%","$ %ObjProto_toString%","$ %ObjProto_valueOf%","valueOf","$ %parseFloat%","parseFloat","$ %parseInt%","$ %Promise%","Promise","$ %PromisePrototype%","$ %PromiseProto_then%","then","$ %Promise_all%","all","$ %Promise_reject%","reject","$ %Promise_resolve%","resolve","$ %Proxy%","Proxy","$ %RangeError%","$ %RangeErrorPrototype%","$ %ReferenceError%","ReferenceError","$ %ReferenceErrorPrototype%","$ %Reflect%","Reflect","$ %RegExp%","$ %RegExpPrototype%","$ %Set%","Set","$ %SetIteratorPrototype%","$ %SetPrototype%","$ %SharedArrayBuffer%","SharedArrayBuffer","$ %SharedArrayBufferPrototype%","$ %String%","$ %StringIteratorPrototype%","$ %StringPrototype%","$ %Symbol%","$ %SymbolPrototype%","$ %SyntaxError%","SyntaxError","$ %SyntaxErrorPrototype%","$ %ThrowTypeError%","$ %TypedArray%","$ %TypedArrayPrototype%","$ %TypeError%","$ %TypeErrorPrototype%","$ %Uint8Array%","$ %Uint8ArrayPrototype%","$ %Uint8ClampedArray%","$ %Uint8ClampedArrayPrototype%","$ %Uint16Array%","$ %Uint16ArrayPrototype%","$ %Uint32Array%","$ %Uint32ArrayPrototype%","$ %URIError%","URIError","$ %URIErrorPrototype%","$ %WeakMap%","WeakMap","$ %WeakMapPrototype%","$ %WeakSet%","WeakSet","$ %WeakSetPrototype%","allowMissing","GetIntrinsic","$Object","$TypeError","$String","assertRecord","$isNaN","$isFinite","sign","mod","IsCallable","toPrimitive","has","ES5","ToPrimitive","ToBoolean","ToNumber","ToInteger","number","abs","ToInt32","ToUint32","ToUint16","posInt","ToString","ToObject","CheckObjectCoercible","optMessage","SameValue","Type","IsPropertyDescriptor","Desc","allowed","[[Configurable]]","[[Enumerable]]","[[Get]]","[[Set]]","[[Value]]","[[Writable]]","isData","IsAccessor","IsAccessorDescriptor","IsDataDescriptor","IsGenericDescriptor","FromPropertyDescriptor","ToPropertyDescriptor","Obj","desc","getter","setter","$SyntaxError","Property Descriptor","ES","recordType","argumentName","modulo","remain","isPrimitive","isCallable","ES5internalSlots","[[DefaultValue]]","actualHint","methods","input","flattenVertexData","dim","dstLength","NaN","Ctor","forEachArray","receiver","forEachString","charAt","forEachObject","thisArg","ERROR_MESSAGE","funcType","bound","binder","result","boundLength","boundArgs","Empty","implementation","win","isLE","mLen","nBytes","eLen","eMax","eBias","nBits","LN2","ctor","superCtor","super_","TempCtor","isSlowBuffer","fnToStr","constructorRegex","isES6ClassFn","fnStr","tryFunctionObject","fnClass","genClass","hasToStringTag","toStringTag","strClass","alert","confirm","prompt","TextLayout","opt","glyphs","_measure","computeMetrics","update","addGetter","wrapper","getGlyphById","font","id","chars","glyphIdx","findChar","getXHeight","X_HEIGHTS","idx","height","getMGlyph","M_WIDTHS","getCapHeight","CAP_HEIGHTS","getKerning","left","right","kernings","kern","first","second","amount","getAlignType","align","ALIGN_CENTER","ALIGN_RIGHT","ALIGN_LEFT","wordWrap","xtend","TAB_ID","SPACE_ID","measure","_opt","tabSize","text","_setupSpaceGlyphs","lines","minWidth","width","maxLineWidth","reduce","prev","line","lineHeight","common","baseline","base","descender","letterSpacing","_width","_height","_descender","_baseline","_xHeight","_capHeight","_lineHeight","_ascender","lineIndex","lastGlyph","lineWidth","glyph","getGlyph","tx","position","xadvance","_linesTotal","_fallbackSpaceGlyph","_fallbackTabGlyph","space","tabWidth","xoffset","yoffset","curPen","curWidth","count","nextPen","nextWidth","isArrayBuffer","getBinaryOpts","xml2","responseType","XMLHttpRequest","req","overrideMimeType","xhr","noop","parseASCII","parseXML","readBinary","isBinaryFormat","cb","uri","binary","err","body","statusCode","headers","equal","HEADER","substring","shouldUseNative","test1","test2","test3","letter","source","keysShim","isArgs","isEnumerable","hasDontEnumBug","hasProtoEnumBug","dontEnums","equalsConstructorPrototype","excludedKeys","$applicationCache","$console","$external","$frame","$frameElement","$frames","$innerHeight","$innerWidth","$onmozfullscreenchange","$onmozfullscreenerror","$outerHeight","$outerWidth","$pageXOffset","$pageYOffset","$parent","$scrollLeft","$scrollTop","$scrollX","$scrollY","$self","$webkitIndexedDB","$webkitStorageInfo","$window","hasAutomationEqualityBug","equalsConstructorPrototypeIfNotBuggy","isObject","isArguments","isString","theKeys","skipProto","skipConstructor","origKeys","originalKeys","shim","callee","splitLine","parseData","parseIntList","pages","lineData","file","readBlock","blockID","blockSize","info","readInfo","readCommon","readPages","readChars","readKernings","bitField","smooth","unicode","italic","bold","fixedHeight","charset","stretchH","aa","padding","spacing","outline","face","readStringNT","scaleW","scaleH","packed","alphaChnl","redChnl","greenChnl","blueChnl","readNameNT","char","off","page","chnl","every","byte","getAttribs","element","getAttribList","dict","attrib","mapName","nodeValue","attribs","NAME_MAP","parseAttributes","parseFromString","scaleh","scalew","stretchh","lineheight","alphachnl","redchnl","greenchnl","bluechnl","xmlRoot","pageRoot","childTag","children","child","GLYPH_DESIGNER_ERROR","row","performance","present","dateNow","now","getTime","navigationStart","timing","performanceNow","noConflict","conflict","defaultSetTimout","defaultClearTimeout","runTimeout","fun","cachedSetTimeout","runClearTimeout","marker","cachedClearTimeout","clearTimeout","cleanUpNextTick","draining","currentQueue","queue","queueIndex","drainQueue","timeout","run","Item","process","nextTick","title","browser","env","argv","version","versions","on","addListener","once","removeListener","removeAllListeners","emit","prependListener","prependOnceListener","listeners","binding","cwd","chdir","umask","root","_state","_value","_deferreds","doResolve","handle","deferred","me","asap","onFulfilled","onRejected","finale","Handler","done","reason","ex","setTimeoutFunc","setImmediate","race","_setImmediateFn","CW","CCW","clockwise","numIndices","indices","leftWhitespace","rightWhitespace","define","getPolyfill","boundTrim","zeroWidthSpace","polyfill","minMax","stringContains","applyArguments","func","parseEasingParameters","easingFunctionRegex","exec","spring","duration","solver","progress","zeta","exp","w0","cos","wd","sin","getDuration","cached","cache","springs","elapsed","rest","mass","is","und","stiffness","damping","velocity","sqrt","elastic","amplitude","period","PI","asin","steps","round","parseEasings","easing","fnc","ease","penner","bezier","selectString","filterArray","callback","auxArrayFilter","flattenArray","toArray","NodeList","HTMLCollection","arrayContains","some","cloneObject","clone","replaceObjectProps","o1","o2","mergeObjects","rgbToRgba","rgbValue","rgb","rgbRegex","hexToRgba","hexValue","hex","hexToRgbaHexRegex","hexToRgbaRgbRegex","hslToRgba","hslValue","hue2rgb","hsl","hslToRgbaHsl1Regex","hslToRgbaHsl2Regex","colorToRgb","getUnit","unitRegex","getTransformUnit","propName","getFunctionValue","animatable","total","el","prop","convertPxToUnit","unit","CSS","tempEl","tagName","parentEl","parentNode","factor","offsetWidth","removeChild","convertedUnit","getCSSValue","uppercasePropName","getComputedStyle","getPropertyValue","getAnimationType","dom","inp","svg","validTransforms","getElementTransforms","transform","transforms","transformRegex","getTransformValue","defaultVal","getOriginalTargetValue","getRelativeValue","operator","operatorRegex","validateValue","col","originalUnit","unitLess","whitespaceRegex","getDistance","p1","p2","getCircleLength","getRectLength","getLineLength","getPolylineLength","previousPos","points","totalLength","numberOfItems","currentPos","getItem","getPolygonLength","getTotalLength","setDashoffset","pathLength","getParentSvgEl","getParentSvg","pathEl","svgData","parentSvgEl","rect","getBoundingClientRect","viewBoxAttr","viewBox","getPath","path","percent","property","getPathProgress","point","getPointAtLength","p0","atan2","decomposeValue","pth","original","numbers","valueRegex","strings","parseTargets","targets","item","getAnimatables","normalizePropertyTweens","tweenSettings","settings","springRegex","propArray","delay","endDelay","flattenKeyframes","keyframes","propertyNames","properties","newKey","getProperties","tweens","normalizeTweenValues","tween","normalizeTweens","previousTween","tweenValue","toUnit","originalValue","previousValue","fromUnit","isPath","isColor","setTargetsValue","animatables","valueUnit","animType","setProgressValue","createAnimation","lastTween","getAnimations","getInstanceTimings","animations","animLength","getTlOffset","anim","timelineOffset","timings","createNewInstance","instanceSettings","defaultInstanceSettings","defaultTweenSettings","instanceID","handleVisibilityChange","hidden","activeInstances","activeInstance","pause","pausedInstances","i$1","len$1","play","anime","makePromise","_resolve","toggleInstanceDirection","instance","reversed","adjustTime","time","resetTime","startTime","lastTime","currentTime","speed","seekCild","seek","syncInstanceChildren","reversePlayback","childrenLength","setAnimationsProgress","insTime","animationsLength","tweenLength","eased","toNumbersLength","toNumber","fromNumber","stringsLength","n$1","currentValue","setCallback","passThrough","countIteration","setInstanceProgress","engineTime","insDuration","insDelay","insEndDelay","began","changeBegan","changeCompleted","direction","paused","completed","promise","reset","loop","tick","raf","engine","reverse","restart","finished","autoplay","removeTargetsFromAnimations","targetsArray","removeTargets","childAnimations","stagger","grid","axis","fromIndex","fromFirst","fromCenter","fromLast","isRange","val1","val2","maxValue","fromX","fromY","toX","toY","distanceX","distanceY","timeline","tl","add","instanceParams","ins","tlIndex","insParams","tlDuration","begin","loopBegin","changeBegin","change","changeComplete","loopComplete","complete","hexRegex","rgbPrefixRegex","hslRegex","SVGElement","HTMLInputElement","aA1","aA2","calcBezier","aT","getSlope","binarySubdivide","aX","aA","aB","mX1","mX2","currentX","currentT","newtonRaphsonIterate","aGuessT","currentSlope","mY1","mY2","getTForX","intervalStart","currentSample","lastSample","kSplineTableSize","sampleValues","kSampleStepSize","dist","guessForT","initialSlope","curves","In","Out","InOut","eases","linear","coords","css","attribute","manual","last","step","activeInstancesLength","instanceIndex","cancelAnimationFrame","running","remove","convertPx","bounds","positions","itemSize","box","computeBox","computeSphere","minX","minY","maxX","maxY","center","radius","uvs","texWidth","texHeight","flipY","bitmap","bw","bh","u0","v1","u1","v0","setIndex","geometry","isR69","newAttrib","updateAttribute","addAttribute","flatten","THREE","BufferAttribute","needsUpdate","rebuildAttribute","attribLength","warned","attr","Timeout","clearFn","_id","_clearFn","immediateIds","nextImmediateId","setInterval","clearInterval","close","unref","ref","enroll","msecs","_idleTimeoutId","_idleTimeout","unenroll","_unrefActive","active","_onTimeout","clearImmediate","factory","amd","WebVRPolyfill","config","extend","DefaultConfig","polyfillDisplays","hasNative","native","getVRDisplays","VRFrameData","VRDisplay","PROVIDE_MOBILE_VRDISPLAY","isMobile","displays","fireVRDisplayConnect_","commonjsGlobal","copyArray","dest","cardboardVrDisplay","WGLUPreserveGLState","gl","bindings","boundValues","activeTexture","TEXTURE_BINDING_2D","TEXTURE_BINDING_CUBE_MAP","textureUnit","TEXTURE0","TEXTURE31","error","getParameter","ACTIVE_TEXTURE","boundValue","ARRAY_BUFFER_BINDING","bindBuffer","ARRAY_BUFFER","COLOR_CLEAR_VALUE","clearColor","COLOR_WRITEMASK","colorMask","CURRENT_PROGRAM","useProgram","ELEMENT_ARRAY_BUFFER_BINDING","ELEMENT_ARRAY_BUFFER","FRAMEBUFFER_BINDING","bindFramebuffer","FRAMEBUFFER","RENDERBUFFER_BINDING","bindRenderbuffer","RENDERBUFFER","bindTexture","TEXTURE_2D","TEXTURE_CUBE_MAP","VIEWPORT","viewport","BLEND","CULL_FACE","DEPTH_TEST","SCISSOR_TEST","STENCIL_TEST","CardboardDistorter","cardboardUI","bufferScale","dirtySubmitFrameBindings","ctxAttribs","getContextAttributes","instanceExt","getExtension","meshWidth","meshHeight","bufferWidth","drawingBufferWidth","bufferHeight","drawingBufferHeight","realBindFramebuffer","realEnable","realDisable","realColorMask","realClearColor","realViewport","isIOS","realCanvasWidth","canvas","realCanvasHeight","isPatched","lastBoundFramebuffer","cullFace","depthTest","blend","scissorTest","stencilTest","texCoord","program","linkProgram","distortionVS","distortionFS","uniforms","getProgramUniforms","viewportOffsetScale","setTextureBounds","vertexBuffer","indexBuffer","indexCount","renderTarget","createTexture","framebuffer","createFramebuffer","depthStencilBuffer","depthBuffer","stencilBuffer","depth","stencil","createRenderbuffer","patch","onResize","CardboardUI","uiVS","uiFS","gearOffset","gearVertexCount","arrowOffset","arrowVertexCount","projMat","listener","Distortion","coefficients","Device","getScreenWidth","getScreenHeight","widthMeters","heightMeters","bevelMeters","DeviceInfo","deviceParams","additionalViewers","viewer","Viewers","CardboardV2","updateDeviceParams","distortion","distortionCoefficients","CardboardViewer","label","fov","interLensDistance","baselineLensDistance","screenLensDistance","inverseCoefficients","Dpdb","url","onDeviceParamsUpdated","dpdb","DPDB_CACHE","recalculateDeviceParams_","open","loading","status","response","send","DeviceParams","xdpi","ydpi","bevelMm","SensorSample","sample","timestampS","ComplementaryFilter","kFilter","isDebug","currentAccelMeasurement","currentGyroMeasurement","previousGyroMeasurement","filterQ","Quaternion","previousFilterQ","accelQ","isOrientationInitialized","estimatedGravity","Vector3","measuredGravity","gyroIntegralQ","PosePredictor","predictionTimeS","previousQ","previousTimestampS","deltaQ","outQ","FusionPoseSensor","predictionTime","yawOnly","accelerometer","gyroscope","filter","posePredictor","isFirefoxAndroid","chromeVersion","getChromeVersion","isDeviceMotionInRadians","isWithoutDeviceMotion","isChromeWithoutDeviceMotion","isSafariWithoutDeviceMotion","filterToWorldQ","setFromAxisAngle","inverseWorldToScreenQ","worldToScreenQ","originalPoseAdjustQ","orientation","setScreenTransform_","isLandscapeMode","multiply","resetQ","orientationOut_","RotateInstructions","loadIcon_","overlay","top","bottom","backgroundColor","fontFamily","zIndex","img","icon","marginLeft","marginTop","textAlign","fontSize","margin","snackbar","boxSizing","snackbarText","float","snackbarButton","fontWeight","textTransform","borderLeft","paddingLeft","textDecoration","hide","ViewerSelector","defaultViewer","selectedKey","VIEWER_KEY","DEFAULT_VIEWER","dialog","createDialog_","onChangeCallbacks_","leftProjectionMatrix","leftViewMatrix","rightProjectionMatrix","rightViewMatrix","pose","VRDisplayCapabilities","hasPosition","hasExternalDisplay","canPresent","maxLayers","hasOrientation","deprecateWarning","USE_WAKELOCK","wakelock","isPolyfilled","displayId","nextDisplayId","displayName","depthNear","depthFar","isPresenting","capabilities","stageParameters","waitingForPresent_","layer_","originalParent_","fullscreenElement_","fullscreenWrapper_","fullscreenElementCachedStyle_","fullscreenEventTarget_","fullscreenChangeHandler_","fullscreenErrorHandler_","wakelock_","NoSleep$1","CardboardVRDisplay","config$$1","defaults","MOBILE_WAKE_LOCK","bufferScale_","BUFFER_SCALE","poseSensor_","PoseSensor","distorter_","cardboardUI_","dpdb_","DPDB_URL","onDeviceParamsUpdated_","deviceInfo_","getDeviceParams","ADDITIONAL_VIEWERS","viewerSelector_","onChange","onViewerChanged_","setViewer","getCurrentViewer","ROTATE_INSTRUCTIONS_DISABLED","rotateInstructions_","onResize_","classCallCheck","Constructor","createClass","descriptor","protoProps","staticProps","slicedToArray","sliceIterator","_n","_d","_e","_s","_i","next","dataUri","mimeType","lerp","platform","isWebViewAndroid","isSafari","_match$1$split","_match$1$split2","branch","build","isR7","rtn","isTimestampDeltaValid","timestampDeltaS","screen","devicePixelRatio","requestFullscreen","webkitRequestFullscreen","mozRequestFullScreen","msRequestFullscreen","exitFullscreen","webkitExitFullscreen","mozCancelFullScreen","msExitFullscreen","getFullscreenElement","fullscreenElement","webkitFullscreenElement","mozFullScreenElement","msFullscreenElement","vertexSource","fragmentSource","attribLocationMap","vertexShader","createShader","VERTEX_SHADER","shaderSource","compileShader","fragmentShader","FRAGMENT_SHADER","createProgram","attachShader","attribName","bindAttribLocation","deleteShader","uniformCount","getProgramParameter","ACTIVE_UNIFORMS","uniformName","getActiveUniform","getUniformLocation","orthoMatrix","near","far","lr","bt","nf","check","vendor","opera","safariCssSizeWorkaround","frameDataFromPose","mat4_perspectiveFromFieldOfView","upTan","tan","upDegrees","piOver180","rad45","downTan","downDegrees","leftTan","leftDegrees","rightTan","rightDegrees","xScale","yScale","mat4_fromRotationTranslation","x2","y2","z2","xx","xy","xz","yy","yz","zz","wx","wy","wz","mat4_translate","a00","a01","a02","a03","a10","a11","a12","a13","a20","a21","a22","a23","mat4_invert","a30","a31","a32","a33","b00","b01","b02","b03","b04","b05","b06","b07","b08","b09","b10","b11","det","updateEyeMatrices","projection","view","vrDisplay","defaultOrientation","defaultPosition","frameData","timestamp","_getFieldOfView","_getEyeOffset","isInsideCrossOriginIFrame","isFramed","refOrigin","getOriginFromUrl","referrer","thisOrigin","location","domainIdx","protoSepIdx","domainEndIdx","getQuaternionAngle","quat","warn","acos","warnOnce","observedWarnings","deprecated","suggested","glPreserveState","destroy","unpatch","deleteProgram","deleteBuffer","deleteTexture","deleteFramebuffer","deleteRenderbuffer","glState","clear","COLOR_BUFFER_BIT","texImage2D","alpha","RGBA","RGB","UNSIGNED_BYTE","texParameteri","TEXTURE_MAG_FILTER","LINEAR","TEXTURE_MIN_FILTER","TEXTURE_WRAP_S","CLAMP_TO_EDGE","TEXTURE_WRAP_T","framebufferTexture2D","COLOR_ATTACHMENT0","renderbufferStorage","DEPTH_STENCIL","framebufferRenderbuffer","DEPTH_STENCIL_ATTACHMENT","DEPTH_COMPONENT16","DEPTH_ATTACHMENT","STENCIL_INDEX8","STENCIL_ATTACHMENT","checkFramebufferStatus","FRAMEBUFFER_COMPLETE","pname","leftBounds","rightBounds","submitFrame","positionDivisor","texCoordDivisor","getVertexAttrib","VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE","enableVertexAttribArray","vertexAttribPointer","FLOAT","vertexAttribDivisorANGLE","uniform1i","diffuse","uniform4fv","drawElements","TRIANGLES","UNSIGNED_SHORT","renderNoState","preserveDrawingBuffer","updateDeviceInfo","deviceInfo","vertices","computeMeshVertices_","bufferData","STATIC_DRAW","computeMeshIndices_","lensFrustum","getLeftEyeVisibleTanAngles","noLensFrustum","getLeftEyeNoLensTanAngles","getLeftEyeVisibleScreenRect","vidx","distortInverse","halfwidth","halfheight","iidx","getOwnPropertyDescriptor_","proto","DEG2RAD","kInnerRadius","listen","optionsCallback","backCallback","midline","clientWidth","clientX","kButtonWidthDp","clientY","clientHeight","addGearSegment","theta","angle","buttonScale","addArrowVertex","buttonBorder","physicalPixels","scalingRatio","dps","buttonSize","segmentTheta","angledLineWidth","render","uniform4f","uniformMatrix4fv","projectionMat","drawArrays","TRIANGLE_STRIP","r0","r1","dr0","distort","dr1","r2","degToRad","radToDeg","normalize","scalar","invScalar","multiplyScalar","applyQuaternion","qx","qy","qz","qw","ix","iy","iz","iw","dot","crossVectors","ax","ay","az","bx","by","bz","quaternion","setFromEulerXYZ","c1","c2","c3","s1","s2","s3","setFromEulerYXZ","halfAngle","multiplyQuaternions","qax","qay","qaz","qaw","qbx","qby","qbz","qbw","inverse","slerp","qb","cosHalfTheta","halfTheta","sinHalfTheta","ratioA","ratioB","setFromUnitVectors","vFrom","vTo","DEFAULT_ANDROID","DEFAULT_IOS","CardboardV1","device","determineDevice_","getDevice","metersPerPixelX","metersPerPixelY","getDistortedFieldOfViewLeftEye","eyeToScreenDistance","outerDist","innerDist","bottomDist","topDist","outerAngle","atan","innerAngle","bottomAngle","topAngle","fovLeft","fovTop","fovRight","fovBottom","halfWidth","halfHeight","verticalLensOffset","centerX","centerY","centerZ","screenLeft","screenTop","screenRight","screenBottom","undistortedFrustum","eyeX","eyeY","getFieldOfViewLeftEye","opt_isUndistorted","getUndistortedFieldOfViewLeftEye","getFieldOfViewRightEye","getUndistortedParams_","getUndistortedViewportLeftEye","screenWidth","screenHeight","xPxPerTanAngle","yPxPerTanAngle","eyePosX","eyePosY","halfLensDistance","maxFov","viewerMax","devices","rules","mdmh","ua","dpi","ac","last_updated","newDeviceParams","calcDeviceParams_","db","matched","rule","ruleMatches_","resX","resY","sensorSample","addAccelMeasurement","vector","addGyroMeasurement","deltaT","run_","accelToQuaternion_","gyroDeltaQ","gyroToQuaternionDelta_","invFilterQ","toFixed","targetQ","getOrientation","accel","normAccel","gyro","getPrediction","currentQ","angularSpeed","predictAngle","getPosition","_deviceOrientationQ","deviceOrientationFixQ","deviceOrientationFilterToWorldQ","filterOrientation","resetPose","onDeviceOrientation_","beta","gamma","onDeviceMotion_","deviceMotion","updateDeviceMotion_","accGravity","accelerationIncludingGravity","rotRate","rotationRate","timeStamp","deltaS","onOrientationChange_","screenOrientation","onMessage_","deviceMotionEvent","onDeviceMotionCallback_","onOrientationChangeCallback_","onMessageCallback_","onDeviceOrientationCallback_","stop","X_AXIS","Z_AXIS","SENSOR_TO_VR","sensor","fusionSensor","_out","api","errors","_sensorQ","_outQ","_onSensorRead","_onSensorError","init","RelativeOrientationSensor","frequency","referenceFrame","useDeviceMotion","K_FILTER","PREDICTION_TIME_S","YAW_ONLY","DEBUG","show","parent","parentElement","display","querySelector","showTemporarily","ms","timer","disableShowTemporarily","getSelectedKey_","fireOnChange_","onSave_","setItem","options","container","classList","background","overflow","boxShadow","createH1_","createChoice_","createButton_","h1","marginBottom","div","onclick","button","border","NoSleep","commonjsGlobal$$1","modules","__webpack_require__","moduleId","installedModules","__esModule","_classCallCheck","_createClass","mediaFile","oldIOS","MSStream","noSleepTimer","noSleepVideo","defaultLeftBounds","defaultRightBounds","caf","getFrameData","_getPose","getPose","_resetPose","getImmediatePose","wrapForFullscreen","cssProperties","insertBefore","firstChild","removeFullscreenWrapper","requestPresent","layers","wasPresenting","incomingLayer","layer","updatePresent_","predistorted","onFullscreenChange","actualFullscreenElement","lock","catch","beginPresent_","unlock","disableWakeLock","endPresent_","removeFullscreenListeners_","fireVRDisplayPresentChange_","onFullscreenError","addFullscreenListeners_","enableWakeLock","exitPresent","getLayers","changeHandler","errorHandler","fullscreenEnabled","webkitFullscreenEnabled","mozFullScreenEnabled","msFullscreenEnabled","getEyeParameters","whichEye","CARDBOARD_UI_DISABLED","DIRTY_SUBMIT_FRAME_BINDINGS","Eye","LEFT","RIGHT","linearVelocity","linearAcceleration","angularVelocity","angularAcceleration","fieldOfView","eyeParams","renderWidth","renderHeight","newParams","updateBounds_","getContext","stopPropagation","orientationHandler","vrdisplaypresentchangeHandler","fireVRDisplayDeviceParamsChange_","lastWidth","lastHeight","vrdisplay","getPolyfillDisplays","_polyfillDisplaysPopulated","NativeVRFrameData","nativeFrameData","nativeGetFrameData","_this","nativeDisplays","webvrPolyfill","freeze","default","require$$0","idxOf","chr","isWhitespace","whitespace","pre","lineStart","isNewline","newline","lineEnd","measured","greedy","mode","testWidth","MAX_VALUE","newLine","newlineChar","nextStart","monospace","isEmpty","initParams","createXHR","_createXHR","readystatechange","readyState","loadFunc","getBody","responseText","getXml","isJson","errorFunc","timeoutTimer","failureResponse","aborted","useXDR","method","rawRequest","getAllResponseHeaders","parseHeaders","called","cors","XDomainRequest","sync","json","onreadystatechange","onload","onerror","onprogress","onabort","ontimeout","username","password","withCredentials","abort","setRequestHeader","beforeSend","responseXML","firefoxBugTakenEffect","DOMParser","ActiveXObject","xmlDoc","async","loadXML","getPropertyType","component","componentName","components","schema","toRadians","addEventListeners","eventNames","handler","removeEventListeners","getRawProperty","splitDot","setRawProperty","targetValue","startsWith","TYPE_COLOR","splitCache","isRawProperty","STRING_COMPONENTS","STRING_OBJECT3D","registerComponent","utils","colorHelperFrom","Color","colorHelperTo","getComponentProperty","entity","setComponentProperty","PROP_POSITION","PROP_ROTATION","PROP_SCALE","Component","dur","elasticity","startEvents","pauseEvents","resumeEvents","multiple","eventDetail","animation","animationIsPlaying","onStartEvent","beginAnimation","pauseAnimation","resumeAnimation","fromColor","toColor","updateConfigForDefault","updateConfigForRawColor","oldData","createAndStartAnimation","pausedWasPlaying","updateConfig","stopRelatedAnimations","waitComponentInitRawProperty","setColorConfig","lastValue","isBoolean","isNumber","aframeProperty","updateConfigForVector","coordinates","object3D","propType","wait","spectator","zoom","camera","PerspectiveCamera","setObject3D","aspect","innerWidth","innerHeight","updateProjectionMatrix","updateActiveCamera","updateSpectatorCamera","system","activeCameraEl","setActiveCamera","disableActiveCamera","spectatorCameraEl","setSpectatorCamera","disableSpectatorCamera","removeObject3D","EVENTS","CLICK","FUSING","MOUSEENTER","MOUSEDOWN","MOUSELEAVE","MOUSEUP","STATES","HOVERING","HOVERED","CANVAS_EVENTS","DOWN","UP","WEBXR_EVENTS","CANVAS_HOVER_CLASS","dependencies","downEvents","fuse","fuseTimeout","mouseCursorStylesEnabled","upEvents","rayOrigin","oneOf","cursorDownEl","intersectedEl","canvasBounds","isCursorDown","updateCanvasBounds","debounce","sceneEl","intersectedEventDetail","cursorEl","onCursorDown","onCursorUp","onIntersection","onIntersectionCleared","onMouseMove","onEnterVR","updateMouseEventListeners","removeState","addCanvasListeners","downEvent","upEvent","mouse","Vector2","origin","rayCasterConfig","updateMatrixWorld","touches","isPerspectiveCamera","setFromMatrixPosition","matrixWorld","unproject","isOrthographicCamera","transformDirection","raycaster","checkIntersections","twoWayEmit","intersection","currentIntersection","els","intersections","getIntersection","distance","clearCurrentIntersection","setIntersection","clearedEls","xrSession","addState","ignoreRemaining","evtName","trackedControlsUtils","checkControllerPresentAndSetup","emitIfAxesChanged","onButtonEvent","DAYDREAM_CONTROLLER_MODEL_BASE_URL","DAYDREAM_CONTROLLER_MODEL_OBJ_URL","DAYDREAM_CONTROLLER_MODEL_OBJ_MTL","isWebXRAvailable","GAMEPAD_ID_WEBXR","GAMEPAD_ID_WEBVR","GAMEPAD_ID_PREFIX","INPUT_MAPPING_WEBVR","axes","trackpad","buttons","INPUT_MAPPING_WEBXR","touchpad","INPUT_MAPPING","hand","buttonColor","buttonTouchedColor","buttonHighlightColor","model","orientationOffset","armModel","mapping","bindMethods","onModelLoaded","onControllersUpdate","checkIfControllerPresent","removeControllersUpdateListener","onAxisMoved","onButtonChanged","onButtonDown","onButtonUp","onButtonTouchStart","onButtonTouchEnd","controllerPresent","lastControllerCheck","controllerEventsActive","addControllersUpdateListener","injectTrackedControls","idPrefix","mtl","buttonMeshes","controllerObject3D","menu","getObjectByName","state","updateModel","buttonName","updateButtonModel","material","GEARVR_CONTROLLER_MODEL_BASE_URL","GEARVR_CONTROLLER_MODEL_OBJ_URL","GEARVR_CONTROLLER_MODEL_OBJ_MTL","trigger","thumbstick","defaultModel","defaultModelColor","wasControllerConnected","rendererSystem","systems","renderer","iterateControllerProfiles","initDefaultModel","modelEl","primitive","geometries","geometryNames","dummyGeometry","BufferGeometry","schemaChange","skipCache","previousData","mesh","unuseGeometry","getOrCreateGeometry","getObject3D","Mesh","MeshStandardMaterial","metalness","roughness","updateSchema","currentGeometryType","newGeometryType","extendSchema","dracoLoader","getDRACOLoader","meshoptDecoder","getMeshoptDecoder","loader","GLTFLoader","setDRACOLoader","ready","setMeshoptDecoder","gltfModel","scene","scenes","getGestureEventName","gesture","eventName","isViveController","trackedControls","controller","profiles","MODEL_URLS","toonLeft","toonRight","lowPolyLeft","lowPolyRight","highPolyLeft","highPolyRight","ANIMATIONS","pointThumb","fist","hold","thumbUp","handModelStyle","pressedButtons","touchedButtons","setCrossOrigin","onGripDown","handleButton","onGripUp","onTrackpadDown","onTrackpadUp","onTrackpadTouchStart","onTrackpadTouchEnd","onTriggerDown","onTriggerUp","onTriggerTouchStart","onTriggerTouchEnd","onGripTouchStart","onGripTouchEnd","onThumbstickDown","onThumbstickUp","onAorXTouchStart","onAorXTouchEnd","onBorYTouchStart","onBorYTouchEnd","onSurfaceTouchStart","onSurfaceTouchEnd","onControllerConnected","onControllerDisconnected","visible","delta","mixer","previousHand","controlConfiguration","handColor","handmodelUrl","gltf","handModelOrientation","AnimationMixer","clips","rotation","lastGesture","isPressed","isTouched","determineGesture","animateGesture","emitGestureEvents","isGripActive","grip","isSurfaceActive","surface","isTrackpadActive","isTriggerActive","isABXYActive","AorX","BorY","getClip","clip","playAnimation","fromAction","toAction","stopAllAction","clipAction","clampWhenFinished","LoopRepeat","repetitions","timeScale","weight","crossFadeTo","register","GAMEPAD_ID","HP_MIXEDL_REALITY_MODEL_GLB_BASE_URL","HP_MIXED_REALITY_POSITION_OFFSET","HP_MIXED_REALITY_ROTATION_OFFSET","_x","_y","_z","_order","previousButtonValues","controllerIndex","analogValue","createRay","controllerConfig","raycasterConfig","showLine","modelReady","cursor","hideRay","controlsConfiguration","daydream-controls","gearvr-controls","generic-tracked-controller-controls","hp-mixed-reality-controls","magicleap-controls","oculus-go-controls","oculus-touch-controls","valve-index-controls","vive-controls","vive-focus-controls","windows-motion-controls","diff","CubeLoader","CubeTextureLoader","probeCache","if","envMap","groundColor","decay","intensity","penumbra","castShadow","shadowBias","shadowCameraFar","shadowCameraFov","shadowCameraNear","shadowCameraTop","shadowCameraRight","shadowCameraBottom","shadowCameraLeft","shadowCameraVisible","shadowMapHeight","shadowMapWidth","shadowRadius","light","defaultTarget","registerLight","diffData","shadowsLoaded","applyColorCorrection","hasLoaded","onSetTarget","updateProbeMap","updateShadow","setLight","newLight","getLight","translateY","cameraHelper","CameraHelper","shadow","bias","mapSize","OrthographicCamera","getHex","AmbientLight","DirectionalLight","HemisphereLight","PointLight","SpotLight","LightProbe","tempLightProbe","srcLoader","validateCubemapSrc","urls","cube","LightProbeGenerator","fromCubeTexture","targetEl","isEqualVec3","opacity","LineBasicMaterial","transparent","Line","geoNeedsUpdate","positionArray","computeBoundingSphere","setStyle","registerShader","borderColor","highlighted","highlightedColor","image","peekMode","titleColor","visualAspectEnabled","navigate","previousQuaternion","quaternionClone","hiddenEls","strokeColor","initVisualAspect","updateEventListener","updatePeekMode","sphereEl","hideAll","showAll","isPlaying","semiSphereEl","textEl","visualAspectInitialized","segments","shader","pano","side","phiStart","segmentsWidth","segmentsHeight","phiLength","thetaStart","thetaLength","borderEnabled","cameraWorldPosition","elWorldPosition","scale","cameraPortalOrientation","matrix","decompose","distanceTo","lookAt","calculateCameraPortalOrientation","peekCameraPortalOrientation","traverse","cameraEl","mat4","Matrix4","cameraPosition","portalNormal","portalPosition","extractRotation","applyMatrix4","localToWorld","PI_2","magicWindowTrackingEnabled","pointerLockEnabled","reverseMouseDrag","reverseTouchDrag","touchEnabled","mouseEnabled","deltaYaw","previousHMDPosition","hmdQuaternion","magicWindowAbsoluteEuler","Euler","magicWindowDeltaEuler","magicWindowObject","Object3D","deltaRotation","savedPose","pointerLocked","setupMouseControls","previousMouseEvent","setupMagicWindowControls","magicWindowControls","isMobileDeviceRequestingDesktopSite","DeviceOrientationControls","DeviceOrientationEvent","requestPermission","permissionGranted","updateGrabCursor","exitPointerLock","updateOrientation","onMouseDown","onMouseUp","onTouchStart","onTouchMove","onTouchEnd","onExitVR","onPointerLockChange","onPointerLockError","mouseDown","pitchObject","yawObject","canvasEl","checkHeadsetConnected","updateMagicWindowOrientation","setFromQuaternion","previousMagicWindowYaw","movementX","movementY","mozMovementX","mozMovementY","screenX","screenY","showGrabbingCursor","requestPointerLock","mozRequestPointerLock","hideGrabbingCursor","touchStart","pageX","pageY","touchStarted","deltaY","saveCameraPose","hasWebXR","matrixAutoUpdate","updateMatrix","restoreCameraPose","pointerLockElement","mozPointerLockElement","enableGrabCursor","disableGrabCursor","hasSavedPose","GAMEPAD_ID_SUFFIX","GAMEPAD_ID_COMPOSITE","MAGICLEAP_CONTROLLER_MODEL_GLB_URL","setButtonColor","parseSide","BackSide","DoubleSide","FrontSide","parseVertexColors","coloring","FaceColors","VertexColors","NoColors","parseBlending","blending","NoBlending","AdditiveBlending","SubtractiveBlending","MultiplyBlending","NormalBlending","disposeMaterial","dispose","unregisterMaterial","shaders","shaderNames","alphaTest","depthWrite","flatShading","npot","repeat","vertexColors","dithering","updateShader","updateMaterial","currentShader","newShader","updateBehavior","tickTime","tickProperties","addBehavior","removeBehavior","shaderName","shaderInstance","Shader","setMaterial","oldDataHasKeys","defaultMaterial","MeshBasicMaterial","registerMaterial","waitForMesh","objLoader","OBJLoader","mtlLoader","MTLLoader","manager","crossOrigin","applyMaterial","resetMesh","loadObj","objUrl","mtlUrl","BASE_PATH","setResourcePath","materials","preload","setMaterials","objModel","isMesh","emissive","emissiveMap","OCULUS_GO_CONTROLLER_MODEL_URL","TOUCH_CONTROLLER_MODEL_BASE_URL","OCULUS_TOUCH_WEBVR","modelUrl","modelPivotOffset","modelPivotRotation","OCULUS_TOUCH_WEBXR","OCULUS_TOUCH_CONFIG","CONTROLLER_DEFAULT","CONTROLLER_PROPERTIES","oculus-touch","oculus-touch-v2","oculus-touch-v3","buttonTouchColor","controllerType","loadModel","controllerId","displayModel","trackedControlsSystem","webXRId","webVRId","handTrackingEnabled","originalXRotationTrigger","originalXPositionGrip","xbutton","abutton","ybutton","bbutton","OBSERVER_SELECTOR_RE","OBSERVER_CONFIG","INTERSECT","INTERSECTION","INTERSECT_CLEAR","INTERSECTION_CLEAR","autoRefresh","interval","objects","lineColor","lineOpacity","useWorldCoordinates","clearedIntersectedEls","unitLineEndVec3","intersectedEls","newIntersectedEls","newIntersections","prevCheckTime","prevIntersectedEls","rawIntersections","Raycaster","updateOriginDirection","setDirty","updateLine","observer","dirty","lineEndVec3","otherLineEndVec3","intersectedDetail","intersectedClearedDetail","intersectionClearedDetail","intersectionDetail","drawLine","clearAllIntersections","disconnect","refreshObjects","flattenObject3DMaps","tock","intersectObjects","lineLength","originVec3","endVec3","isEntity","object3DMap","order","zeroScale","HitTest","hitTestSourceDetails","xrHitTestSource","xr","sessionStart","warnAboutHitTest","arrowURL","CAM_LAYER","applyPose","tempVec3","tempQuaternion","tempFakePose","previousFrameAnchors","anchorToObject3D","session","getSession","requestHitTestSource","profile","requestHitTestSourceForTransientInput","transient","anchorFromLastHitTestResult","hitTest","lastHitTest","object3DOptions","entry","entryObject","anchor","delete","createAnchor","doHit","frame","hitTestResults","results","refSpace","getReferenceSpace","xrViewerPose","getViewerPose","getHitTestResultsForTransientInput","getHitTestResults","updateAnchorPoses","trackedAnchors","anchorPose","anchorSpace","hitTestCache","footprintDepth","imageDataArray","imageData","ImageData","textureCache","orthoCam","textureTarget","WebGLRenderTarget","basicMaterial","context","imageSmoothingEnabled","canvasTexture","CanvasTexture","webxrData","optionalFeaturesArray","optionalFeatures","hasPosedOnce","bboxMesh","requestReferenceSpace","viewerSpace","transientHitTest","inputSource","targetRaySpace","bboxOffset","makeBBox","bboxNeedsUpdate","PlaneGeometry","rotateX","rotateY","bbox","Box3","updateFootprint","tempImageData","oldRenderTarget","oldBackground","isXREnabled","getRenderTarget","setRenderTarget","overrideMaterial","readRenderTargetPixels","putImageData","shadowColor","shadowBlur","drawImage","getImageData","texture","TextureLoader","setFromObject","getCenter","getSize","updateLights","estimate","probeLight","directionalLight","directionalLightPosition","intensityScalar","primaryLightIntensity","sh","fromArray","sphericalHarmonicsCoefficients","setRGB","primaryLightDirection","COMPONENTS","generateEnvironment","pmremGenerator","PMREMGenerator","compileCubemapShader","cubeRenderTarget","WebGLCubeRenderTarget","RGBFormat","generateMipmaps","minFilter","LinearMipmapLinearFilter","lightProbeTarget","cubeCamera","CubeCamera","needsEnvironmentUpdate","timeSinceUpdate","requestLightProbe","startLightProbe","stopLightProbe","xrLightProbe","ownDirectionalLight","environment","setupLightsForLightingEstimation","needsLightProbeUpdate","setupLightProbe","glBinding","XRWebGLBinding","lightProbe","updateXRCubeMap","cubeMap","getReflectionCubeMap","__webglTexture","getLightEstimate","fromCubemap","createPermissionDialog","denyText","allowText","dialogText","onAllowClicked","onDenyClicked","buttonsContainer","denyButton","acceptButton","DIALOG_BUTTONS_CONTAINER_CLASS","DIALOG_BUTTON_CLASS","DIALOG_DENY_BUTTON_CLASS","constants","AFRAME_INJECTED","DIALOG_ALLOW_BUTTON_CLASS","createDialog","createAlertDialog","closeText","onOkClicked","okButton","DIALOG_OK_BUTTON_CLASS","buttonsContainerEl","modalContainer","dialogTextContainer","MODAL_CLASS","DIALOG_CLASS","DIALOG_TEXT_CONTAINER_CLASS","DIALOG_TEXT_CLASS","deviceMotionMessage","httpsMessage","denyButtonText","allowButtonText","cancelButtonText","hostname","protocol","showHTTPAlert","onDeviceMotionDialogAllowClicked","onDeviceMotionDialogDenyClicked","devicePermissionDialogEl","httpAlertEl","enterVREl","removeFullScreenStyles","addFullScreenStyles","getFog","fog","FogExp2","density","Fog","isScene","updateMaterials","getFuzzyPatchVersion","pkg","INSPECTOR_DEV_URL","INSPECTOR_RELEASE_URL","INSPECTOR_URL","INSPECTOR_VERSION","LOADING_MESSAGE","LOADING_ERROR_MESSAGE","firstPlay","onKeydown","onMessage","initOverlay","urlParam","getUrlParameter","openInspector","loadingMessageEl","keyCode","ctrlKey","altKey","getModifierState","showLoader","hideLoader","focusEl","script","AFRAME","INSPECTOR","inspectorInjected","shouldCaptureKeyEvent","enterVR","exitVR","onKeyup","enterVREnabled","mixin","dynamic","initPool","availableEls","usedEls","createEntity","wrapPlay","playMethod","requestEntity","returnEntity","setup","cubeMapSize","MAX_CUBE_MAP_TEXTURE_SIZE","RawShaderMaterial","quad","PlaneBufferGeometry","ctx","onKeyDown","sRGBEncoding","LinearFilter","magFilter","wrapS","ClampToEdgeWrapping","wrapT","RGBAFormat","UnsignedByteType","resize","shortcutPressed","shiftKey","capture","setCapture","getWorldPosition","getWorldQuaternion","isVREnabled","renderCapture","saveCapture","getCanvas","pixels","autoClear","flipPixelsVertically","flippedPixels","toBlob","blob","fileName","linkEl","URL","createObjectURL","click","createStats","threeStats","ThreeStats","aframeStats","AFrameStats","plugins","RStats","fps","caption","below","groups","HIDDEN_CLASS","stats","statsEl","hideBound","showBound","createEnterVRButton","onClick","vrButton","ENTER_VR_CLASS","ENTER_VR_BTN_CLASS","applyStickyHoverFix","createEnterARButton","arButton","ENTER_AR_CLASS","ENTER_AR_BTN_CLASS","createOrientationModal","modal","ORIENTATION_MODAL_CLASS","exit","buttonEl","enterVRButton","enterARButton","insideLoader","enterAREl","orientationModalEl","updateEnterInterfaces","toggleOrientationModalIfNeeded","onEnterVRButtonClick","onEnterARButtonClick","onModalClick","enterAR","uiElement","toggleEnterVRButtonIfNeeded","toggleEnterARButtonIfNeeded","checkARSupport","isLandscape","cast","receive","onMeshChanged","setShadowMapEnabled","updateDescendants","node","receiveShadow","distanceModel","maxDistance","positional","refDistance","rolloffFactor","volume","audioLoader","AudioLoader","pool","Group","loaded","mustPlay","playSoundBound","playSound","sound","srcChanged","setupSound","setDistanceModel","setMaxDistance","setRefDistance","setRolloffFactor","setLoop","setVolume","isPaused","setBuffer","Cache","evtDetail","stopSound","oldEvt","audioListener","AudioListener","PositionalAudio","Audio","onEnded","pauseSound","processSound","loadFont","yOffset","loadBMFont","ch","loadTexture","ImageLoader","shaderObject","computeWidth","wrapPixels","wrapCount","widthFactor","computeFontWidthFactor","sum","digitsum","digits","PromiseCache","promiseGenerator","createTextGeometry","coreShader","DEFAULT_WIDTH","MAX_ANISOTROPY","FONT_BASE_URL","FONTS","aileronsemibold","dejavu","exo2bold","exo2semibold","kelsonsans","monoid","mozillavr","roboto","sourcecodepro","MSDF_FONTS","DEFAULT_FONT","fontWidthFactors","textures","protocolRe","fontImage","negate","whiteSpace","xOffset","zOffset","shaderData","createOrUpdateMaterial","currentFont","Texture","anisotropy","updateFont","updateGeometry","updateLayout","hasChangedShader","NewShader","fontSrc","lookupFont","fontImgSrc","getFontImageSrc","initMesh","fontObj","imageSrc","LoaderUtils","extractUrlBase","geometryComponent","layout","textRenderWidth","textScale","ascender","geometryUpdateBase","geometryUpdateData","newLineRegex","tabRegex","controllerUtils","DEFAULT_CAMERA_HEIGHT","DEFAULT_HANDEDNESS","EYES_TO_ELBOW","FOREARM","EMPTY_DAYDREAM_TOUCHES","AXISMOVE","BUTTONCHANGED","BUTTONDOWN","BUTTONUP","TOUCHSTART","TOUCHEND","autoHide","headElement","buttonStates","changedAxes","targetControllerNumber","axisMoveEventDetail","changed","deltaControllerPosition","controllerQuaternion","controllerEuler","updateGamepad","buttonEventDetails","updatePose","updateButtons","defaultUserHeight","getHeadElement","findMatchingControllerWebVR","controllers","applyArmModel","controllerPosition","headEl","headObject3D","userHeight","applyAxisAngle","up","applyEuler","standingMatrix","getStandingMatrix","compose","multiplyMatrices","rotateZ","buttonState","pressed","touched","handleAxes","handlePress","handleTouch","handleValue","controllerAxes","previousAxis","previousButtonState","updateController","isControllerPresent","gamepad","handedness","findMatchingControllerWebXR","referenceSpace","elements","INDEX_CONTROLLER_MODEL_BASE_URL","INDEX_CONTROLLER_MODEL_URL","INDEX_CONTROLLER_POSITION_OFFSET_WEBVR","INDEX_CONTROLLER_POSITION_OFFSET_WEBXR","INDEX_CONTROLLER_ROTATION_OFFSET_WEBVR","INDEX_CONTROLLER_ROTATION_OFFSET_WEBXR","INDEX_CONTROLLER_ROTATION_OFFSET","INDEX_CONTROLLER_POSITION_OFFSET","triggerOriginalRotationX","VIVE_CONTROLLER_MODEL_OBJ_URL","VIVE_CONTROLLER_MODEL_OBJ_MTL","VIVE_FOCUS_CONTROLLER_MODEL_URL","triggerPressed","trackpadPressed","pressedName","isEmptyObject","KEYCODE_TO_CODE","keyboardevent","CLAMP_VELOCITY","MAX_DELTA","KEYS","acceleration","adAxis","adEnabled","adInverted","fly","wsAxis","wsEnabled","wsInverted","onBlur","onContextMenu","onFocus","onKeyUp","onVisibilityChange","attachVisibilityEventListeners","updateVelocity","getMovementVector","removeKeyEventListeners","removeVisibilityEventListeners","attachKeyEventListeners","adSign","wsSign","scaledEasing","KeyA","ArrowLeft","KeyD","ArrowRight","KeyW","ArrowUp","KeyS","ArrowDown","directionVector","rotationEuler","xRotation","oncontextmenu","MODEL_BASE_URL","MODEL_FILENAMES","GAMEPAD_ID_PATTERN","axisMeshNames","buttonMeshNames","pointingPoseMeshName","squeeze","pair","hideDisconnected","onModelError","setModelVisibility","loadedMeshInfo","axisMeshes","createdFromMesh","updateControllerModel","sourceUrl","createControllerModelUrl","forceDefault","filename","trackedControlsComponent","hasNativeWebXRImplementation","defaultUrl","getImmediateChildByName","object3d","meshName","meshInfo","rootNode","controllerModel","unpressed","calculateRayOriginFromMesh","lerpAxisTransform","axisValue","axisMeshInfo","lerpValue","setRotationFromQuaternion","lerpVectors","lerpButtonTransform","buttonValue","buttonMeshInfo","numAxes","modelVisible","38","37","40","39","87","65","83","68","mediaElementLoaded","checkProgress","secondsBuffered","buffered","fixUpMediaElement","mediaEl","newMediaEl","extractDomain","host","domain","inferResponseType","getFileNameFromURL","dotLastIndex","search","parser","query","filePath","ANode","registerElement","fileLoader","FileLoader","isAssets","attachedCallback","mediaEls","imgEl","imgEls","srcObject","detachedCallback","isAssetItem","setResponseType","loadedBytes","totalBytes","srcs","validate","checkComponentDefined","attrValue","isComponentMixedIn","mixinEls","inMixin","mergeComponentData","extraData","styleParser","isComponent","MULTIPLE_COMPONENT_DELIMITER","getRotation","entityEl","rotationObj","AEntity","OBJECT3D_COMPONENTS","ONCE","initializingComponents","componentsToUpdate","states","oldVal","newVal","justInitialized","setEntityAttribute","assetsEl","addToParent","removeComponent","removeFromParent","oldObj","getOrCreateObject3D","attachedToParent","updateComponents","getChildEntities","childEntities","initComponent","isDependency","componentId","componentInfo","initComponentDependencies","initialized","tryRemoveLater","extraComponents","componentCache","getExtraComponents","updateComponent","getDOMAttribute","clobber","updateProperties","resetProperty","mixinUpdate","entities","computedMixinStr","componentsUpdated","newMixins","oldMixins","mixinEl","mixinIds","updateMixins","handleMixinUpdate","oldMixinIds","getElementById","singlePropUpdate","arg1","arg2","newAttrValue","delimiterIndex","isDebugMode","flushToDOM","recursive","stateIndex","inspector","isMixin","cacheAttribute","updateEntities","closestScene","cacheAttributes","parseAttrValueForCache","isNode","mixins","closest","selector","matches","mozMatchesSelector","msMatchesSelector","oMatchesSelector","webkitMatchesSelector","childFilter","childrenLoaded","getChildren","newMixinIdArray","oldMixinIdArray","newMixinIds","unregisterMixin","registerMixin","compositedMixinIds","mixinId","addTagName","knownTags","wrapANodeMethods","newObj","wrapMethods","copyProperties","wrapAEntityMethods","ANodeMethods","AEntityMethods","targetObj","methodList","derivedObj","baseObj","methodName","wrapMethod","derivedMethod","baseMethod","destination","isANode","isAEntity","propVal","eventsBind","events","copyData","sourceData","parsedProperty","isObjectOrArray","extendProperties","isObjectBased","hasBehavior","wrapPause","pauseMethod","eventsDetach","shouldPlay","eventsAttach","parseProperties","parseProperty","processSchema","isSingleProp","isSingleProperty","stringifyProperties","stringifyProperty","aframeScript","currentScript","upperCaseRegExp","objectPools","isSinglePropertyObject","objectPool","nextData","use","removeUnusedKeys","previousOldData","parsingAttrValue","throttledEmitComponentChanged","throttle","prevData","silent","updateCachedAttrValue","tempObject","recycle","clearObject","parsedValue","isDefault","callUpdateHandler","initialOldData","buildData","mayNeedSchemaUpdate","schemaChangeKeys","hasComponentChanged","deepEqual","isPositionRotationScale","schemaAddon","extendedSchema","newData","componentDefined","defaultValue","mixinData","registrationOrderWarnings","definition","NewComponent","schemaIsSingleProp","compareDocumentPosition","DOCUMENT_POSITION_FOLLOWING","createPool","Geometry","registerGeometry","NewGeometry","registerPropertyType","propertyTypes","defaultParse","defaultStringify","arrayParse","arrayStringify","assetParse","parsedUrl","urlRegex","boolParse","intParse","numberParse","selectorParse","nonCharRegex","selectorAllParse","selectorStringify","selectorAllStringify","srcParse","vecParse","isValidDefaultValue","isValidDefaultCoordinate","possibleCoordinates","dimensions","getCanvasSize","embedded","maxSize","isVR","offsetHeight","getMaxSize","aspectRatio","pixelRatio","navigationUI","setupCanvas","onFullScreenChange","activeElement","blur","focus","dataset","aframeCanvas","initMetaTags","inject","initWakelock","loadingScreen","re","initPostMessageAPI","AScene","clock","Clock","isAR","Scene","onAfterRender","systemNames","behaviors","originalHTML","setupRenderer","onVRPresentChangeBound","onVRPresentChange","enterVRBound","exitVRBound","exitVRTrueBound","pointerRestrictedBound","pointerRestricted","pointerUnrestrictedBound","pointerUnrestricted","attachedCallbackPostCamera","initSystems","initSystem","sceneIndex","behavior","behaviorArr","behaviorType","getPointerLockElement","errorMessage","useAR","enterVRSuccess","hasNativeWebVRImplementation","getVRDisplay","enterVRFailure","xrInit","vrManager","refspace","webxr","sessionReferenceSpaceType","setReferenceSpaceType","xrMode","sessionConfiguration","requestSession","layersEnabled","requiredFeatures","setSession","setDevice","presentationAttributes","highRefreshRate","foveationLevel","exitVRSuccess","forceCanvasResizeSafariMobile","setPixelRatio","exitVRFailure","getComputedAttribute","componentPropValue","isVRPresenting","maxCanvasSize","setSize","rendererAttr","rendererAttrString","rendererConfig","antialias","logarithmicDepthBuffer","powerPreference","precision","maxCanvasWidth","maxCanvasHeight","WebGLRenderer","sortObjects","setPoseTarget","renderStarted","mark","setAnimationLoop","timeDelta","getDelta","elapsedTime","savedBackground","getSceneCanvasSize","setupTitle","titleEl","LOADER_TITLE_CLASS","ATTR_NAME","loaderScene","sphereGeometry","sphereMaterial","sphereMesh1","sphereMesh2","sphereMesh3","loaderAttribute","dotsColor","loaderEnabled","SphereGeometry","getElapsedTime","Meta","attrs","exists","Link","createTag","tagObj","meta","MOBILE_HEAD_TAGS","content","MOBILE_IOS_HEAD_TAGS","createAndInjectTag","tag","headScriptEl","headTags","postMessageAPIHandler","isIframed","Wakelock","request","release","processPropertyDefinition","propDefinition","isCustomType","typeName","PropertyTypes","propNames","propData","getPartialData","propValue","stringifiedData","propertyToThreeMapping","int","vec2","vec3","vec4","initVariables","raw","ShaderMaterial","varType","variables","updateVariables","materialKey","parseValue","setMapOnTextureLoad","updateMapMaterialFromData","Vector4","ImageUtils","System","rawData","registerSystem","NewSystem","findAllScenes","originalPosition","originalRotation","originalParent","originalGroup","outerGroup","addMapping","htmlAttrName","materialMappings","standard","defaultComponents","mappings","addComponentMapping","definePrimitive","registerPrimitive","extendDeep","primitives","defaultAttributes","defaultComponentsFromPrimitive","deprecatedMappings","resolveMappingCollisions","newAttribute","extension","isUndefined","isPureObject","mixinComponents","getComponentPropertyPath","look-controls","wasd-controls","look-controls-enabled","pointer-lock-enabled","wasd-controls-enabled","reverse-mouse-drag","getMeshMixin","radiusOuter","radiusInner","segmentsTheta","fuse-timeout","segmentsRadial","openEnded","open-ended","theta-length","theta-start","ground-color","envmap","meshMixin","obj-model","meshPrimitives","segments-height","segments-width","unCamelCase","geometryName","geometryHyphened","segmentsDepth","BoxGeometry","CircleGeometry","radiusBottom","radiusTop","CylinderGeometry","DodecahedronGeometry","IcosahedronGeometry","OctahedronGeometry","segmentsPhi","RingGeometry","TetrahedronGeometry","arc","radiusTubular","segmentsTubular","TorusGeometry","TorusKnotGeometry","rotateVector","uvMinVector","uvMaxVector","uvScaleVector","vertexA","vertexB","vertexC","normal","triangle","uvA","uvB","uvC","normals","Triangle","getNormal","subVectors","divide","Float32BufferAttribute","getVRDevices","isIOSOlderThan10","polyfillConfig","cordova","webvrpolyfill","isIE11","isBrowserEnvironment","AComponent","ANIME","coreComponents","_update","_rS","getEntityCount","getEntriesByName","_scene","_start","_end","_attach","attach","te","fractions","DRACOLoader","getMaterialData","materialData","wireframe","wireframeLinewidth","textureSrc","updateMap","isWebGL2AVailable","VERTEX_SHADER_WEBGL1","VERTEX_SHADER_WEBGL2","FRAGMENT_SHADER_WEBGL1","FRAGMENT_SHADER_WEBGL2","alphaToCoverage","ShadowMaterial","emissiveIntensity","normalMap","normalScale","ambientOcclusionMap","aoMapIntensity","ambientOcclusionMapIntensity","displacementMap","displacementScale","displacementBias","texturePromises","ambientOcclusionTextureOffset","ambientOcclusionTextureRepeat","displacementTextureOffset","displacementTextureRepeat","metalnessMap","metalnessTextureOffset","metalnessTextureRepeat","normalTextureOffset","normalTextureRepeat","roughnessMap","roughnessTextureOffset","roughnessTextureRepeat","sphericalEnvMap","updateDistortionMap","updateEnvMap","isLoadingEnvMap","EquirectangularReflectionMapping","handleTextureEvents","removeDefaultCamera","defaultCamera","DEFAULT_CAMERA_ATTR","unwrapRender","wrapRender","initialCameraFound","numUserCameras","numUserCamerasChecked","setupInitialCamera","cameraEls","createDefaultCamera","checkUserCamera","cameraData","defaultCameraEl","newActiveCameraEl","newCameraEl","newCamera","previousCamera","defaultCameraWrapper","originalRender","spectatorCamera","createGeometry","geometryType","GeometryClass","geometryInstance","decrementCacheCount","cacheCount","hash","incrementCacheCount","clearCache","cachedGeometry","fetchScript","dracoDecoderPath","meshoptDecoderPath","setDecoderPath","MeshoptDecoder","DEFAULT_LIGHT_ATTR","defaultLightsEnabled","defaultLights","userDefinedLights","setupDefaultLights","removeDefaultLights","ambientLight","calculateVideoCacheHash","videoEl","videoAttributes","sort","loadImageTexture","doLoadImageTexture","resolveTexture","setTextureProperties","statusText","createVideoEl","fixVideoAttributes","controls","isHLS","textureCounts","onMaterialTextureLoaded","clearTextureCache","loadImageCb","loadImage","loadVideoCb","loadVideo","loadCanvas","childElementCount","validateSrc","handleImageTextureLoaded","handleVideoTextureLoaded","videoTextureResult","hashVideo","VideoTexture","needsCorrectionBGRA","needsCorrectionFlipY","uuid","isTexture","isOculusBrowser","physicallyCorrectLights","colorManagement","gammaOutput","outputEncoding","colorOrTexture","convertSRGBToLinear","SHADOW_MAP_TYPE_MAP","basic","BasicShadowMap","pcf","PCFShadowMap","pcfsoft","PCFSoftShadowMap","autoUpdate","shadowMapEnabled","shadowMap","isChrome","updateControllerList","throttledUpdateControllerList","gamepads","prevCount","getGamepads","oldControllers","oldControllersLength","updateReferenceSpace","warnIfFeatureNotRequested","inputSources","referenceSpaceType","overlayElement","domOverlay","wasFeatureRequested","feature","optIntro","msg","prependedArgs","defaultVec","coordinate","vec","parseIfString","OBJECT","COORDINATE_KEYS","isCoordinates","regex","isCoordinate","toVector3","getDebugNamespaceType","chunks","getDebugNamespaceColor","debugLib","ls","logs","supportsVRSession","supportsARSession","isTablet","mockUserAgent","isMobileVR","isFirefoxReality","isSessionSupported","supported","supportsSession","_isMobile","isNodeEnvironment","delimiter","propertyPathCache","splitName","deepAssign","objectAssign","isGearVR","isOculusGo","functionToThrottle","minimumInterval","optionalContext","sinceLastTime","throttleTick","immediate","later","callNow","arrayPool","keysA","keysB","valA","valB","targetObject","aVal","bVal","bKey","isComparingObjects","metaKey","splitString","getElData","copyAttribute","matchingElements","allElements","getInternetExplorerVersion","appName","RepeatWrapping","HLS_MIMETYPES","COLOR_MAPS","materialName","dataName","checkSetMap","materialSrcs","setMap","longType","slot","shortType","wrap","defaultObjectFactory","EMPTY_SLOT","objectFactory","objToUse","nextFreeSlot","objPool","grow","currentLength","isImageCb","isVideoCb","checkIsImage","isImage","validatedUrls","aCubemap","cubemapSrcRegex","parseUrl","validateAndGetQuerySelector","parsedSrc","onResult","contentType","getResponseHeader","checkIsImageFallback","onLoad","onError","tester","Image","toCamelCase","DASH_REGEX","upperCase","transformKeysToCamelCase","camelKey","styleParse","getKeyValueChunks","styleStringify","keyCount","parsedData","hasUnclosedUrl","nextSplit","chunk","isControllerPresentWebVR","queryObject","filterControllerIndex","isControllerPresentWebXR","handTracking","filterIdExact","filterIdPrefix","filterHand","matchingControllerOccurence","targetControllerMatch","NUM_HANDS","iterateProfiles","controllerMatch","AXIS_LABELS","isPresent","axesMapping","buttonType","scope","reorder","deviceOrientation","alphaOffset","onDeviceOrientationChangeEvent","onScreenOrientationChangeEvent","setObjectQuaternion","zee","euler","q0","q1","orient","setFromEuler","connect","glStats","_h","_totalDrawArraysCalls","_totalDrawElementsCalls","_totalBindTexures","_totalUseProgramCalls","_totalFaces","_totalVertices","_totalPoints","WebGLRenderingContext","POINTS","allcalls","over","drawelements","drawarrays","memory","programs","calls","triangles","renderer.info.memory.geometries","renderer.info.memory.textures","renderer.info.programs","renderer.info.render.calls","renderer.info.render.triangles","renderer.info.render.points","BrowserStats","_size","log1024","_usedJSHeapSize","usedJSHeapSize","_totalJSHeapSize","totalJSHeapSize","_values","average","avgMs","_groups","_fractions","nowOffset","rStats","iterateKeys","importCSS","Graph","_dom","_defArg","_draw","alarm","_current","_max","_ctx","_canvas","_alarmCanvas","_elHeight","_dotCanvas","_def","_dotCtx","fillStyle","fillRect","globalAlpha","_alarmCtx","_elWidth","draw","StackGraph","_num","th","_colours","PerfCounter","group","_average","_accumValue","_accumSamples","_accumStart","_averageValue","_time","_settings","userTimingAPI","_started","_tick","_spanValueText","_graph","_frame","_total","interpolate","_set","_spanId","_spanValue","textContent","_div","_perf","idArg","_perfCounters","graph","colours","_cssRStats","CSSPath","_base","toggle","legend","searchString","Util","isIFrame","appendQueryParameter","getQueryParameter","AndroidWakeLock","video","iOSWak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AAM,IAAMA,GAE1F1J,OAAOC,QAAU4vC;;ArExzCjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACl9nCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3jBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnzHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9eA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxyBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACl0BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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IAGpBC,EAAYF,oBAAoB0D,GAAa,GACzCxD,GAAa5/C,EAAG1H,KAAKsnD,IAGzBA,EAAYF,oBAAoBC,GAAS,KACxB3/C,EAAG1H,KAAKsnD,KAU3ByE,cAAe,SAAU1E,EAASyD,EAAa33C,GAC7C,GAAI24C,GACAE,EAEAC,EADArG,EAAO1gF,KAAKwiC,GAAGq+C,YAAY,OAG/B,IAAKH,EAAL,CAgBA,GAbAA,EAAKwE,MAAM8B,gBAGXJ,EAAO5mF,KAAK2mF,QAAQxE,GACpB4E,EAAWrG,EAAKwE,MAAM+B,WAAWL,GACjCG,EAASG,mBAAoB,EAC7BH,EAASl5C,KAAO6H,MAAMyxC,WACtBJ,EAASK,YAAc,EACvBL,EAASM,UAAYp5C,GAAW,EAAI,EACpC84C,EAASx7C,KAAO0C,EAAU24C,EAAK9oD,SAAW,EAC1CipD,EAASO,OAAS,GAGb1B,GAAezD,IAAYyD,EAK9B,MAHAlF,GAAKwE,MAAM8B,oBAEXD,GAASh8C,MAKX67C,GAAO5mF,KAAK2mF,QAAQf,GACpBkB,EAAapG,EAAKwE,MAAM+B,WAAWL,GACnCE,EAAWQ,OAAS,IACpBR,EAAW/7C,OACXg8C,EAASh8C,OACT+7C,EAAWS,YAAYR,EAAU,KAAM;;A9ElY3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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X,QAASjQ,YAAa,eAAgBI,UAAW,eAGnDyQ,uBACEZ,QAASjQ,YAAa,eAAgB,eAAgBI,UAAW,aAAc,eAGjF0Q,2BACEb,QAASjQ,YAAa,eAAgBI,UAAW,cACjDmC,WAAYwN,UAAU;;AjF1H5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AkFtZA,GAAIv4E,MAAOjR,QAAQ,iBACf00E,MAAQ10E,QAAQ,YAChBwqF,KAAO9V,MAAM8V,KACb56E,MAAQ5P,QAAQ,kBAChBy0E,kBAAoBz0E,QAAQ,qBAAqBy0E,kBACjD99B,MAAQ32C,QAAQ,gBAEhBq8D,SAAW1lB,MAAM9wC,KAAKw2D,SACtBnH,KAAOtlD,MAAM,yBACb66E,WAAa,GAAI9zC,OAAM+zC,kBAEvBC,aAKJvuF,QAAOC,QAAQ+4E,UAAYX,kBAAkB,SAC3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AAM,IAIhB,QAASk1I,eACP,GAAIn1E,GAAQ,IAEZtnE,MAAK46H,QAAU,WACRtzD,IACHA,EAAQ/wB,YAAY,WAClBnqC,OAAOunD,SAASl2D,KAAO,IACvB0a,WAAW/L,OAAOq5D,KAAM,IACvB,QAIPzlE,KAAK66H,QAAU,WACTvzD,IACF9wB,cAAc8wB,GACdA,EAAQ,OAMd,QAASo1E,eACP,GAAI/uI,GAAYD,UAAUC,WAAaD,UAAUmhD,QAAUziD,OAAO0iD,KAClE,OAAInhD,GAAU7E,MAAM,YAAc6E,EAAU7E,MAAM,SACzC2zI,YAEAF,gBAtDX,GAAIJ,MAAOp9I,QAAQ,YA0DnB5D,QAAOC,QAAUshJ","file":"bundle.js","sourcesContent":["(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()","/**\n * @license\n * Copyright 2010-2021 Three.js Authors\n * SPDX-License-Identifier: MIT\n */\n(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\n\ttypeof define === 'function' && define.amd ? define(['exports'], factory) :\n\t(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.THREE = {}));\n}(this, (function (exports) { 'use strict';\n\n\tconst REVISION = '133';\n\tconst MOUSE = {\n\t\tLEFT: 0,\n\t\tMIDDLE: 1,\n\t\tRIGHT: 2,\n\t\tROTATE: 0,\n\t\tDOLLY: 1,\n\t\tPAN: 2\n\t};\n\tconst TOUCH = {\n\t\tROTATE: 0,\n\t\tPAN: 1,\n\t\tDOLLY_PAN: 2,\n\t\tDOLLY_ROTATE: 3\n\t};\n\tconst CullFaceNone = 0;\n\tconst CullFaceBack = 1;\n\tconst CullFaceFront = 2;\n\tconst CullFaceFrontBack = 3;\n\tconst BasicShadowMap = 0;\n\tconst PCFShadowMap = 1;\n\tconst PCFSoftShadowMap = 2;\n\tconst VSMShadowMap = 3;\n\tconst FrontSide = 0;\n\tconst BackSide = 1;\n\tconst DoubleSide = 2;\n\tconst FlatShading = 1;\n\tconst SmoothShading = 2;\n\tconst NoBlending = 0;\n\tconst NormalBlending = 1;\n\tconst AdditiveBlending = 2;\n\tconst SubtractiveBlending = 3;\n\tconst MultiplyBlending = 4;\n\tconst CustomBlending = 5;\n\tconst AddEquation = 100;\n\tconst SubtractEquation = 101;\n\tconst ReverseSubtractEquation = 102;\n\tconst MinEquation = 103;\n\tconst MaxEquation = 104;\n\tconst ZeroFactor = 200;\n\tconst OneFactor = 201;\n\tconst SrcColorFactor = 202;\n\tconst OneMinusSrcColorFactor = 203;\n\tconst SrcAlphaFactor = 204;\n\tconst OneMinusSrcAlphaFactor = 205;\n\tconst DstAlphaFactor = 206;\n\tconst OneMinusDstAlphaFactor = 207;\n\tconst DstColorFactor = 208;\n\tconst OneMinusDstColorFactor = 209;\n\tconst SrcAlphaSaturateFactor = 210;\n\tconst NeverDepth = 0;\n\tconst AlwaysDepth = 1;\n\tconst LessDepth = 2;\n\tconst LessEqualDepth = 3;\n\tconst EqualDepth = 4;\n\tconst GreaterEqualDepth = 5;\n\tconst GreaterDepth = 6;\n\tconst NotEqualDepth = 7;\n\tconst MultiplyOperation = 0;\n\tconst MixOperation = 1;\n\tconst AddOperation = 2;\n\tconst NoToneMapping = 0;\n\tconst LinearToneMapping = 1;\n\tconst ReinhardToneMapping = 2;\n\tconst CineonToneMapping = 3;\n\tconst ACESFilmicToneMapping = 4;\n\tconst CustomToneMapping = 5;\n\tconst UVMapping = 300;\n\tconst CubeReflectionMapping = 301;\n\tconst CubeRefractionMapping = 302;\n\tconst EquirectangularReflectionMapping = 303;\n\tconst EquirectangularRefractionMapping = 304;\n\tconst CubeUVReflectionMapping = 306;\n\tconst CubeUVRefractionMapping = 307;\n\tconst RepeatWrapping = 1000;\n\tconst ClampToEdgeWrapping = 1001;\n\tconst MirroredRepeatWrapping = 1002;\n\tconst NearestFilter = 1003;\n\tconst NearestMipmapNearestFilter = 1004;\n\tconst NearestMipMapNearestFilter = 1004;\n\tconst NearestMipmapLinearFilter = 1005;\n\tconst NearestMipMapLinearFilter = 1005;\n\tconst LinearFilter = 1006;\n\tconst LinearMipmapNearestFilter = 1007;\n\tconst LinearMipMapNearestFilter = 1007;\n\tconst LinearMipmapLinearFilter = 1008;\n\tconst LinearMipMapLinearFilter = 1008;\n\tconst UnsignedByteType = 1009;\n\tconst ByteType = 1010;\n\tconst ShortType = 1011;\n\tconst UnsignedShortType = 1012;\n\tconst IntType = 1013;\n\tconst UnsignedIntType = 1014;\n\tconst FloatType = 1015;\n\tconst HalfFloatType = 1016;\n\tconst UnsignedShort4444Type = 1017;\n\tconst UnsignedShort5551Type = 1018;\n\tconst UnsignedShort565Type = 1019;\n\tconst UnsignedInt248Type = 1020;\n\tconst AlphaFormat = 1021;\n\tconst RGBFormat = 1022;\n\tconst RGBAFormat = 1023;\n\tconst LuminanceFormat = 1024;\n\tconst LuminanceAlphaFormat = 1025;\n\tconst RGBEFormat = RGBAFormat;\n\tconst DepthFormat = 1026;\n\tconst DepthStencilFormat = 1027;\n\tconst RedFormat = 1028;\n\tconst RedIntegerFormat = 1029;\n\tconst RGFormat = 1030;\n\tconst RGIntegerFormat = 1031;\n\tconst RGBIntegerFormat = 1032;\n\tconst RGBAIntegerFormat = 1033;\n\tconst RGB_S3TC_DXT1_Format = 33776;\n\tconst RGBA_S3TC_DXT1_Format = 33777;\n\tconst RGBA_S3TC_DXT3_Format = 33778;\n\tconst RGBA_S3TC_DXT5_Format = 33779;\n\tconst RGB_PVRTC_4BPPV1_Format = 35840;\n\tconst RGB_PVRTC_2BPPV1_Format = 35841;\n\tconst RGBA_PVRTC_4BPPV1_Format = 35842;\n\tconst RGBA_PVRTC_2BPPV1_Format = 35843;\n\tconst RGB_ETC1_Format = 36196;\n\tconst RGB_ETC2_Format = 37492;\n\tconst RGBA_ETC2_EAC_Format = 37496;\n\tconst RGBA_ASTC_4x4_Format = 37808;\n\tconst RGBA_ASTC_5x4_Format = 37809;\n\tconst RGBA_ASTC_5x5_Format = 37810;\n\tconst RGBA_ASTC_6x5_Format = 37811;\n\tconst RGBA_ASTC_6x6_Format = 37812;\n\tconst RGBA_ASTC_8x5_Format = 37813;\n\tconst RGBA_ASTC_8x6_Format = 37814;\n\tconst RGBA_ASTC_8x8_Format = 37815;\n\tconst RGBA_ASTC_10x5_Format = 37816;\n\tconst RGBA_ASTC_10x6_Format = 37817;\n\tconst RGBA_ASTC_10x8_Format = 37818;\n\tconst RGBA_ASTC_10x10_Format = 37819;\n\tconst RGBA_ASTC_12x10_Format = 37820;\n\tconst RGBA_ASTC_12x12_Format = 37821;\n\tconst RGBA_BPTC_Format = 36492;\n\tconst SRGB8_ALPHA8_ASTC_4x4_Format = 37840;\n\tconst SRGB8_ALPHA8_ASTC_5x4_Format = 37841;\n\tconst SRGB8_ALPHA8_ASTC_5x5_Format = 37842;\n\tconst SRGB8_ALPHA8_ASTC_6x5_Format = 37843;\n\tconst SRGB8_ALPHA8_ASTC_6x6_Format = 37844;\n\tconst SRGB8_ALPHA8_ASTC_8x5_Format = 37845;\n\tconst SRGB8_ALPHA8_ASTC_8x6_Format = 37846;\n\tconst SRGB8_ALPHA8_ASTC_8x8_Format = 37847;\n\tconst SRGB8_ALPHA8_ASTC_10x5_Format = 37848;\n\tconst SRGB8_ALPHA8_ASTC_10x6_Format = 37849;\n\tconst SRGB8_ALPHA8_ASTC_10x8_Format = 37850;\n\tconst SRGB8_ALPHA8_ASTC_10x10_Format = 37851;\n\tconst SRGB8_ALPHA8_ASTC_12x10_Format = 37852;\n\tconst SRGB8_ALPHA8_ASTC_12x12_Format = 37853;\n\tconst LoopOnce = 2200;\n\tconst LoopRepeat = 2201;\n\tconst LoopPingPong = 2202;\n\tconst InterpolateDiscrete = 2300;\n\tconst InterpolateLinear = 2301;\n\tconst InterpolateSmooth = 2302;\n\tconst ZeroCurvatureEnding = 2400;\n\tconst ZeroSlopeEnding = 2401;\n\tconst WrapAroundEnding = 2402;\n\tconst NormalAnimationBlendMode = 2500;\n\tconst AdditiveAnimationBlendMode = 2501;\n\tconst TrianglesDrawMode = 0;\n\tconst TriangleStripDrawMode = 1;\n\tconst TriangleFanDrawMode = 2;\n\tconst LinearEncoding = 3000;\n\tconst sRGBEncoding = 3001;\n\tconst GammaEncoding = 3007;\n\tconst RGBEEncoding = 3002;\n\tconst LogLuvEncoding = 3003;\n\tconst RGBM7Encoding = 3004;\n\tconst RGBM16Encoding = 3005;\n\tconst RGBDEncoding = 3006;\n\tconst BasicDepthPacking = 3200;\n\tconst RGBADepthPacking = 3201;\n\tconst TangentSpaceNormalMap = 0;\n\tconst ObjectSpaceNormalMap = 1;\n\tconst ZeroStencilOp = 0;\n\tconst KeepStencilOp = 7680;\n\tconst ReplaceStencilOp = 7681;\n\tconst IncrementStencilOp = 7682;\n\tconst DecrementStencilOp = 7683;\n\tconst IncrementWrapStencilOp = 34055;\n\tconst DecrementWrapStencilOp = 34056;\n\tconst InvertStencilOp = 5386;\n\tconst NeverStencilFunc = 512;\n\tconst LessStencilFunc = 513;\n\tconst EqualStencilFunc = 514;\n\tconst LessEqualStencilFunc = 515;\n\tconst GreaterStencilFunc = 516;\n\tconst NotEqualStencilFunc = 517;\n\tconst GreaterEqualStencilFunc = 518;\n\tconst AlwaysStencilFunc = 519;\n\tconst StaticDrawUsage = 35044;\n\tconst DynamicDrawUsage = 35048;\n\tconst StreamDrawUsage = 35040;\n\tconst StaticReadUsage = 35045;\n\tconst DynamicReadUsage = 35049;\n\tconst StreamReadUsage = 35041;\n\tconst StaticCopyUsage = 35046;\n\tconst DynamicCopyUsage = 35050;\n\tconst StreamCopyUsage = 35042;\n\tconst GLSL1 = '100';\n\tconst GLSL3 = '300 es';\n\n\t/**\n\t * https://github.com/mrdoob/eventdispatcher.js/\n\t */\n\tclass EventDispatcher {\n\t\taddEventListener(type, listener) {\n\t\t\tif (this._listeners === undefined) this._listeners = {};\n\t\t\tconst listeners = this._listeners;\n\n\t\t\tif (listeners[type] === undefined) {\n\t\t\t\tlisteners[type] = [];\n\t\t\t}\n\n\t\t\tif (listeners[type].indexOf(listener) === -1) {\n\t\t\t\tlisteners[type].push(listener);\n\t\t\t}\n\t\t}\n\n\t\thasEventListener(type, listener) {\n\t\t\tif (this._listeners === undefined) return false;\n\t\t\tconst listeners = this._listeners;\n\t\t\treturn listeners[type] !== undefined && listeners[type].indexOf(listener) !== -1;\n\t\t}\n\n\t\tremoveEventListener(type, listener) {\n\t\t\tif (this._listeners === undefined) return;\n\t\t\tconst listeners = this._listeners;\n\t\t\tconst listenerArray = listeners[type];\n\n\t\t\tif (listenerArray !== undefined) {\n\t\t\t\tconst index = listenerArray.indexOf(listener);\n\n\t\t\t\tif (index !== -1) {\n\t\t\t\t\tlistenerArray.splice(index, 1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tdispatchEvent(event) {\n\t\t\tif (this._listeners === undefined) return;\n\t\t\tconst listeners = this._listeners;\n\t\t\tconst listenerArray = listeners[event.type];\n\n\t\t\tif (listenerArray !== undefined) {\n\t\t\t\tevent.target = this; // Make a copy, in case listeners are removed while iterating.\n\n\t\t\t\tconst array = listenerArray.slice(0);\n\n\t\t\t\tfor (let i = 0, l = array.length; i < l; i++) {\n\t\t\t\t\tarray[i].call(this, event);\n\t\t\t\t}\n\n\t\t\t\tevent.target = null;\n\t\t\t}\n\t\t}\n\n\t}\n\n\tlet _seed = 1234567;\n\tconst DEG2RAD = Math.PI / 180;\n\tconst RAD2DEG = 180 / Math.PI; //\n\n\tconst _lut = [];\n\n\tfor (let i = 0; i < 256; i++) {\n\t\t_lut[i] = (i < 16 ? '0' : '') + i.toString(16);\n\t}\n\n\tconst hasRandomUUID = typeof crypto !== 'undefined' && 'randomUUID' in crypto;\n\n\tfunction generateUUID() {\n\t\tif (hasRandomUUID) {\n\t\t\treturn crypto.randomUUID().toUpperCase();\n\t\t} // TODO Remove this code when crypto.randomUUID() is available everywhere\n\t\t// http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/21963136#21963136\n\n\n\t\tconst d0 = Math.random() * 0xffffffff | 0;\n\t\tconst d1 = Math.random() * 0xffffffff | 0;\n\t\tconst d2 = Math.random() * 0xffffffff | 0;\n\t\tconst d3 = Math.random() * 0xffffffff | 0;\n\t\tconst uuid = _lut[d0 & 0xff] + _lut[d0 >> 8 & 0xff] + _lut[d0 >> 16 & 0xff] + _lut[d0 >> 24 & 0xff] + '-' + _lut[d1 & 0xff] + _lut[d1 >> 8 & 0xff] + '-' + _lut[d1 >> 16 & 0x0f | 0x40] + _lut[d1 >> 24 & 0xff] + '-' + _lut[d2 & 0x3f | 0x80] + _lut[d2 >> 8 & 0xff] + '-' + _lut[d2 >> 16 & 0xff] + _lut[d2 >> 24 & 0xff] + _lut[d3 & 0xff] + _lut[d3 >> 8 & 0xff] + _lut[d3 >> 16 & 0xff] + _lut[d3 >> 24 & 0xff]; // .toUpperCase() here flattens concatenated strings to save heap memory space.\n\n\t\treturn uuid.toUpperCase();\n\t}\n\n\tfunction clamp(value, min, max) {\n\t\treturn Math.max(min, Math.min(max, value));\n\t} // compute euclidian modulo of m % n\n\t// https://en.wikipedia.org/wiki/Modulo_operation\n\n\n\tfunction euclideanModulo(n, m) {\n\t\treturn (n % m + m) % m;\n\t} // Linear mapping from range <a1, a2> to range <b1, b2>\n\n\n\tfunction mapLinear(x, a1, a2, b1, b2) {\n\t\treturn b1 + (x - a1) * (b2 - b1) / (a2 - a1);\n\t} // https://www.gamedev.net/tutorials/programming/general-and-gameplay-programming/inverse-lerp-a-super-useful-yet-often-overlooked-function-r5230/\n\n\n\tfunction inverseLerp(x, y, value) {\n\t\tif (x !== y) {\n\t\t\treturn (value - x) / (y - x);\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t} // https://en.wikipedia.org/wiki/Linear_interpolation\n\n\n\tfunction lerp(x, y, t) {\n\t\treturn (1 - t) * x + t * y;\n\t} // http://www.rorydriscoll.com/2016/03/07/frame-rate-independent-damping-using-lerp/\n\n\n\tfunction damp(x, y, lambda, dt) {\n\t\treturn lerp(x, y, 1 - Math.exp(-lambda * dt));\n\t} // https://www.desmos.com/calculator/vcsjnyz7x4\n\n\n\tfunction pingpong(x, length = 1) {\n\t\treturn length - Math.abs(euclideanModulo(x, length * 2) - length);\n\t} // http://en.wikipedia.org/wiki/Smoothstep\n\n\n\tfunction smoothstep(x, min, max) {\n\t\tif (x <= min) return 0;\n\t\tif (x >= max) return 1;\n\t\tx = (x - min) / (max - min);\n\t\treturn x * x * (3 - 2 * x);\n\t}\n\n\tfunction smootherstep(x, min, max) {\n\t\tif (x <= min) return 0;\n\t\tif (x >= max) return 1;\n\t\tx = (x - min) / (max - min);\n\t\treturn x * x * x * (x * (x * 6 - 15) + 10);\n\t} // Random integer from <low, high> interval\n\n\n\tfunction randInt(low, high) {\n\t\treturn low + Math.floor(Math.random() * (high - low + 1));\n\t} // Random float from <low, high> interval\n\n\n\tfunction randFloat(low, high) {\n\t\treturn low + Math.random() * (high - low);\n\t} // Random float from <-range/2, range/2> interval\n\n\n\tfunction randFloatSpread(range) {\n\t\treturn range * (0.5 - Math.random());\n\t} // Deterministic pseudo-random float in the interval [ 0, 1 ]\n\n\n\tfunction seededRandom(s) {\n\t\tif (s !== undefined) _seed = s % 2147483647; // Park-Miller algorithm\n\n\t\t_seed = _seed * 16807 % 2147483647;\n\t\treturn (_seed - 1) / 2147483646;\n\t}\n\n\tfunction degToRad(degrees) {\n\t\treturn degrees * DEG2RAD;\n\t}\n\n\tfunction radToDeg(radians) {\n\t\treturn radians * RAD2DEG;\n\t}\n\n\tfunction isPowerOfTwo(value) {\n\t\treturn (value & value - 1) === 0 && value !== 0;\n\t}\n\n\tfunction ceilPowerOfTwo(value) {\n\t\treturn Math.pow(2, Math.ceil(Math.log(value) / Math.LN2));\n\t}\n\n\tfunction floorPowerOfTwo(value) {\n\t\treturn Math.pow(2, Math.floor(Math.log(value) / Math.LN2));\n\t}\n\n\tfunction setQuaternionFromProperEuler(q, a, b, c, order) {\n\t\t// Intrinsic Proper Euler Angles - see https://en.wikipedia.org/wiki/Euler_angles\n\t\t// rotations are applied to the axes in the order specified by 'order'\n\t\t// rotation by angle 'a' is applied first, then by angle 'b', then by angle 'c'\n\t\t// angles are in radians\n\t\tconst cos = Math.cos;\n\t\tconst sin = Math.sin;\n\t\tconst c2 = cos(b / 2);\n\t\tconst s2 = sin(b / 2);\n\t\tconst c13 = cos((a + c) / 2);\n\t\tconst s13 = sin((a + c) / 2);\n\t\tconst c1_3 = cos((a - c) / 2);\n\t\tconst s1_3 = sin((a - c) / 2);\n\t\tconst c3_1 = cos((c - a) / 2);\n\t\tconst s3_1 = sin((c - a) / 2);\n\n\t\tswitch (order) {\n\t\t\tcase 'XYX':\n\t\t\t\tq.set(c2 * s13, s2 * c1_3, s2 * s1_3, c2 * c13);\n\t\t\t\tbreak;\n\n\t\t\tcase 'YZY':\n\t\t\t\tq.set(s2 * s1_3, c2 * s13, s2 * c1_3, c2 * c13);\n\t\t\t\tbreak;\n\n\t\t\tcase 'ZXZ':\n\t\t\t\tq.set(s2 * c1_3, s2 * s1_3, c2 * s13, c2 * c13);\n\t\t\t\tbreak;\n\n\t\t\tcase 'XZX':\n\t\t\t\tq.set(c2 * s13, s2 * s3_1, s2 * c3_1, c2 * c13);\n\t\t\t\tbreak;\n\n\t\t\tcase 'YXY':\n\t\t\t\tq.set(s2 * c3_1, c2 * s13, s2 * s3_1, c2 * c13);\n\t\t\t\tbreak;\n\n\t\t\tcase 'ZYZ':\n\t\t\t\tq.set(s2 * s3_1, s2 * c3_1, c2 * s13, c2 * c13);\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tconsole.warn('THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: ' + order);\n\t\t}\n\t}\n\n\tvar MathUtils = /*#__PURE__*/Object.freeze({\n\t\t__proto__: null,\n\t\tDEG2RAD: DEG2RAD,\n\t\tRAD2DEG: RAD2DEG,\n\t\tgenerateUUID: generateUUID,\n\t\tclamp: clamp,\n\t\teuclideanModulo: euclideanModulo,\n\t\tmapLinear: mapLinear,\n\t\tinverseLerp: inverseLerp,\n\t\tlerp: lerp,\n\t\tdamp: damp,\n\t\tpingpong: pingpong,\n\t\tsmoothstep: smoothstep,\n\t\tsmootherstep: smootherstep,\n\t\trandInt: randInt,\n\t\trandFloat: randFloat,\n\t\trandFloatSpread: randFloatSpread,\n\t\tseededRandom: seededRandom,\n\t\tdegToRad: degToRad,\n\t\tradToDeg: radToDeg,\n\t\tisPowerOfTwo: isPowerOfTwo,\n\t\tceilPowerOfTwo: ceilPowerOfTwo,\n\t\tfloorPowerOfTwo: floorPowerOfTwo,\n\t\tsetQuaternionFromProperEuler: setQuaternionFromProperEuler\n\t});\n\n\tclass Vector2 {\n\t\tconstructor(x = 0, y = 0) {\n\t\t\tthis.x = x;\n\t\t\tthis.y = y;\n\t\t}\n\n\t\tget width() {\n\t\t\treturn this.x;\n\t\t}\n\n\t\tset width(value) {\n\t\t\tthis.x = value;\n\t\t}\n\n\t\tget height() {\n\t\t\treturn this.y;\n\t\t}\n\n\t\tset height(value) {\n\t\t\tthis.y = value;\n\t\t}\n\n\t\tset(x, y) {\n\t\t\tthis.x = x;\n\t\t\tthis.y = y;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetScalar(scalar) {\n\t\t\tthis.x = scalar;\n\t\t\tthis.y = scalar;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetX(x) {\n\t\t\tthis.x = x;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetY(y) {\n\t\t\tthis.y = y;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetComponent(index, value) {\n\t\t\tswitch (index) {\n\t\t\t\tcase 0:\n\t\t\t\t\tthis.x = value;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 1:\n\t\t\t\t\tthis.y = value;\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Error('index is out of range: ' + index);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tgetComponent(index) {\n\t\t\tswitch (index) {\n\t\t\t\tcase 0:\n\t\t\t\t\treturn this.x;\n\n\t\t\t\tcase 1:\n\t\t\t\t\treturn this.y;\n\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Error('index is out of range: ' + index);\n\t\t\t}\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new this.constructor(this.x, this.y);\n\t\t}\n\n\t\tcopy(v) {\n\t\t\tthis.x = v.x;\n\t\t\tthis.y = v.y;\n\t\t\treturn this;\n\t\t}\n\n\t\tadd(v, w) {\n\t\t\tif (w !== undefined) {\n\t\t\t\tconsole.warn('THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead.');\n\t\t\t\treturn this.addVectors(v, w);\n\t\t\t}\n\n\t\t\tthis.x += v.x;\n\t\t\tthis.y += v.y;\n\t\t\treturn this;\n\t\t}\n\n\t\taddScalar(s) {\n\t\t\tthis.x += s;\n\t\t\tthis.y += s;\n\t\t\treturn this;\n\t\t}\n\n\t\taddVectors(a, b) {\n\t\t\tthis.x = a.x + b.x;\n\t\t\tthis.y = a.y + b.y;\n\t\t\treturn this;\n\t\t}\n\n\t\taddScaledVector(v, s) {\n\t\t\tthis.x += v.x * s;\n\t\t\tthis.y += v.y * s;\n\t\t\treturn this;\n\t\t}\n\n\t\tsub(v, w) {\n\t\t\tif (w !== undefined) {\n\t\t\t\tconsole.warn('THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.');\n\t\t\t\treturn this.subVectors(v, w);\n\t\t\t}\n\n\t\t\tthis.x -= v.x;\n\t\t\tthis.y -= v.y;\n\t\t\treturn this;\n\t\t}\n\n\t\tsubScalar(s) {\n\t\t\tthis.x -= s;\n\t\t\tthis.y -= s;\n\t\t\treturn this;\n\t\t}\n\n\t\tsubVectors(a, b) {\n\t\t\tthis.x = a.x - b.x;\n\t\t\tthis.y = a.y - b.y;\n\t\t\treturn this;\n\t\t}\n\n\t\tmultiply(v) {\n\t\t\tthis.x *= v.x;\n\t\t\tthis.y *= v.y;\n\t\t\treturn this;\n\t\t}\n\n\t\tmultiplyScalar(scalar) {\n\t\t\tthis.x *= scalar;\n\t\t\tthis.y *= scalar;\n\t\t\treturn this;\n\t\t}\n\n\t\tdivide(v) {\n\t\t\tthis.x /= v.x;\n\t\t\tthis.y /= v.y;\n\t\t\treturn this;\n\t\t}\n\n\t\tdivideScalar(scalar) {\n\t\t\treturn this.multiplyScalar(1 / scalar);\n\t\t}\n\n\t\tapplyMatrix3(m) {\n\t\t\tconst x = this.x,\n\t\t\t\t\t\ty = this.y;\n\t\t\tconst e = m.elements;\n\t\t\tthis.x = e[0] * x + e[3] * y + e[6];\n\t\t\tthis.y = e[1] * x + e[4] * y + e[7];\n\t\t\treturn this;\n\t\t}\n\n\t\tmin(v) {\n\t\t\tthis.x = Math.min(this.x, v.x);\n\t\t\tthis.y = Math.min(this.y, v.y);\n\t\t\treturn this;\n\t\t}\n\n\t\tmax(v) {\n\t\t\tthis.x = Math.max(this.x, v.x);\n\t\t\tthis.y = Math.max(this.y, v.y);\n\t\t\treturn this;\n\t\t}\n\n\t\tclamp(min, max) {\n\t\t\t// assumes min < max, componentwise\n\t\t\tthis.x = Math.max(min.x, Math.min(max.x, this.x));\n\t\t\tthis.y = Math.max(min.y, Math.min(max.y, this.y));\n\t\t\treturn this;\n\t\t}\n\n\t\tclampScalar(minVal, maxVal) {\n\t\t\tthis.x = Math.max(minVal, Math.min(maxVal, this.x));\n\t\t\tthis.y = Math.max(minVal, Math.min(maxVal, this.y));\n\t\t\treturn this;\n\t\t}\n\n\t\tclampLength(min, max) {\n\t\t\tconst length = this.length();\n\t\t\treturn this.divideScalar(length || 1).multiplyScalar(Math.max(min, Math.min(max, length)));\n\t\t}\n\n\t\tfloor() {\n\t\t\tthis.x = Math.floor(this.x);\n\t\t\tthis.y = Math.floor(this.y);\n\t\t\treturn this;\n\t\t}\n\n\t\tceil() {\n\t\t\tthis.x = Math.ceil(this.x);\n\t\t\tthis.y = Math.ceil(this.y);\n\t\t\treturn this;\n\t\t}\n\n\t\tround() {\n\t\t\tthis.x = Math.round(this.x);\n\t\t\tthis.y = Math.round(this.y);\n\t\t\treturn this;\n\t\t}\n\n\t\troundToZero() {\n\t\t\tthis.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x);\n\t\t\tthis.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y);\n\t\t\treturn this;\n\t\t}\n\n\t\tnegate() {\n\t\t\tthis.x = -this.x;\n\t\t\tthis.y = -this.y;\n\t\t\treturn this;\n\t\t}\n\n\t\tdot(v) {\n\t\t\treturn this.x * v.x + this.y * v.y;\n\t\t}\n\n\t\tcross(v) {\n\t\t\treturn this.x * v.y - this.y * v.x;\n\t\t}\n\n\t\tlengthSq() {\n\t\t\treturn this.x * this.x + this.y * this.y;\n\t\t}\n\n\t\tlength() {\n\t\t\treturn Math.sqrt(this.x * this.x + this.y * this.y);\n\t\t}\n\n\t\tmanhattanLength() {\n\t\t\treturn Math.abs(this.x) + Math.abs(this.y);\n\t\t}\n\n\t\tnormalize() {\n\t\t\treturn this.divideScalar(this.length() || 1);\n\t\t}\n\n\t\tangle() {\n\t\t\t// computes the angle in radians with respect to the positive x-axis\n\t\t\tconst angle = Math.atan2(-this.y, -this.x) + Math.PI;\n\t\t\treturn angle;\n\t\t}\n\n\t\tdistanceTo(v) {\n\t\t\treturn Math.sqrt(this.distanceToSquared(v));\n\t\t}\n\n\t\tdistanceToSquared(v) {\n\t\t\tconst dx = this.x - v.x,\n\t\t\t\t\t\tdy = this.y - v.y;\n\t\t\treturn dx * dx + dy * dy;\n\t\t}\n\n\t\tmanhattanDistanceTo(v) {\n\t\t\treturn Math.abs(this.x - v.x) + Math.abs(this.y - v.y);\n\t\t}\n\n\t\tsetLength(length) {\n\t\t\treturn this.normalize().multiplyScalar(length);\n\t\t}\n\n\t\tlerp(v, alpha) {\n\t\t\tthis.x += (v.x - this.x) * alpha;\n\t\t\tthis.y += (v.y - this.y) * alpha;\n\t\t\treturn this;\n\t\t}\n\n\t\tlerpVectors(v1, v2, alpha) {\n\t\t\tthis.x = v1.x + (v2.x - v1.x) * alpha;\n\t\t\tthis.y = v1.y + (v2.y - v1.y) * alpha;\n\t\t\treturn this;\n\t\t}\n\n\t\tequals(v) {\n\t\t\treturn v.x === this.x && v.y === this.y;\n\t\t}\n\n\t\tfromArray(array, offset = 0) {\n\t\t\tthis.x = array[offset];\n\t\t\tthis.y = array[offset + 1];\n\t\t\treturn this;\n\t\t}\n\n\t\ttoArray(array = [], offset = 0) {\n\t\t\tarray[offset] = this.x;\n\t\t\tarray[offset + 1] = this.y;\n\t\t\treturn array;\n\t\t}\n\n\t\tfromBufferAttribute(attribute, index, offset) {\n\t\t\tif (offset !== undefined) {\n\t\t\t\tconsole.warn('THREE.Vector2: offset has been removed from .fromBufferAttribute().');\n\t\t\t}\n\n\t\t\tthis.x = attribute.getX(index);\n\t\t\tthis.y = attribute.getY(index);\n\t\t\treturn this;\n\t\t}\n\n\t\trotateAround(center, angle) {\n\t\t\tconst c = Math.cos(angle),\n\t\t\t\t\t\ts = Math.sin(angle);\n\t\t\tconst x = this.x - center.x;\n\t\t\tconst y = this.y - center.y;\n\t\t\tthis.x = x * c - y * s + center.x;\n\t\t\tthis.y = x * s + y * c + center.y;\n\t\t\treturn this;\n\t\t}\n\n\t\trandom() {\n\t\t\tthis.x = Math.random();\n\t\t\tthis.y = Math.random();\n\t\t\treturn this;\n\t\t}\n\n\t\t*[Symbol.iterator]() {\n\t\t\tyield this.x;\n\t\t\tyield this.y;\n\t\t}\n\n\t}\n\n\tVector2.prototype.isVector2 = true;\n\n\tclass Matrix3 {\n\t\tconstructor() {\n\t\t\tthis.elements = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n\n\t\t\tif (arguments.length > 0) {\n\t\t\t\tconsole.error('THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.');\n\t\t\t}\n\t\t}\n\n\t\tset(n11, n12, n13, n21, n22, n23, n31, n32, n33) {\n\t\t\tconst te = this.elements;\n\t\t\tte[0] = n11;\n\t\t\tte[1] = n21;\n\t\t\tte[2] = n31;\n\t\t\tte[3] = n12;\n\t\t\tte[4] = n22;\n\t\t\tte[5] = n32;\n\t\t\tte[6] = n13;\n\t\t\tte[7] = n23;\n\t\t\tte[8] = n33;\n\t\t\treturn this;\n\t\t}\n\n\t\tidentity() {\n\t\t\tthis.set(1, 0, 0, 0, 1, 0, 0, 0, 1);\n\t\t\treturn this;\n\t\t}\n\n\t\tcopy(m) {\n\t\t\tconst te = this.elements;\n\t\t\tconst me = m.elements;\n\t\t\tte[0] = me[0];\n\t\t\tte[1] = me[1];\n\t\t\tte[2] = me[2];\n\t\t\tte[3] = me[3];\n\t\t\tte[4] = me[4];\n\t\t\tte[5] = me[5];\n\t\t\tte[6] = me[6];\n\t\t\tte[7] = me[7];\n\t\t\tte[8] = me[8];\n\t\t\treturn this;\n\t\t}\n\n\t\textractBasis(xAxis, yAxis, zAxis) {\n\t\t\txAxis.setFromMatrix3Column(this, 0);\n\t\t\tyAxis.setFromMatrix3Column(this, 1);\n\t\t\tzAxis.setFromMatrix3Column(this, 2);\n\t\t\treturn this;\n\t\t}\n\n\t\tsetFromMatrix4(m) {\n\t\t\tconst me = m.elements;\n\t\t\tthis.set(me[0], me[4], me[8], me[1], me[5], me[9], me[2], me[6], me[10]);\n\t\t\treturn this;\n\t\t}\n\n\t\tmultiply(m) {\n\t\t\treturn this.multiplyMatrices(this, m);\n\t\t}\n\n\t\tpremultiply(m) {\n\t\t\treturn this.multiplyMatrices(m, this);\n\t\t}\n\n\t\tmultiplyMatrices(a, b) {\n\t\t\tconst ae = a.elements;\n\t\t\tconst be = b.elements;\n\t\t\tconst te = this.elements;\n\t\t\tconst a11 = ae[0],\n\t\t\t\t\t\ta12 = ae[3],\n\t\t\t\t\t\ta13 = ae[6];\n\t\t\tconst a21 = ae[1],\n\t\t\t\t\t\ta22 = ae[4],\n\t\t\t\t\t\ta23 = ae[7];\n\t\t\tconst a31 = ae[2],\n\t\t\t\t\t\ta32 = ae[5],\n\t\t\t\t\t\ta33 = ae[8];\n\t\t\tconst b11 = be[0],\n\t\t\t\t\t\tb12 = be[3],\n\t\t\t\t\t\tb13 = be[6];\n\t\t\tconst b21 = be[1],\n\t\t\t\t\t\tb22 = be[4],\n\t\t\t\t\t\tb23 = be[7];\n\t\t\tconst b31 = be[2],\n\t\t\t\t\t\tb32 = be[5],\n\t\t\t\t\t\tb33 = be[8];\n\t\t\tte[0] = a11 * b11 + a12 * b21 + a13 * b31;\n\t\t\tte[3] = a11 * b12 + a12 * b22 + a13 * b32;\n\t\t\tte[6] = a11 * b13 + a12 * b23 + a13 * b33;\n\t\t\tte[1] = a21 * b11 + a22 * b21 + a23 * b31;\n\t\t\tte[4] = a21 * b12 + a22 * b22 + a23 * b32;\n\t\t\tte[7] = a21 * b13 + a22 * b23 + a23 * b33;\n\t\t\tte[2] = a31 * b11 + a32 * b21 + a33 * b31;\n\t\t\tte[5] = a31 * b12 + a32 * b22 + a33 * b32;\n\t\t\tte[8] = a31 * b13 + a32 * b23 + a33 * b33;\n\t\t\treturn this;\n\t\t}\n\n\t\tmultiplyScalar(s) {\n\t\t\tconst te = this.elements;\n\t\t\tte[0] *= s;\n\t\t\tte[3] *= s;\n\t\t\tte[6] *= s;\n\t\t\tte[1] *= s;\n\t\t\tte[4] *= s;\n\t\t\tte[7] *= s;\n\t\t\tte[2] *= s;\n\t\t\tte[5] *= s;\n\t\t\tte[8] *= s;\n\t\t\treturn this;\n\t\t}\n\n\t\tdeterminant() {\n\t\t\tconst te = this.elements;\n\t\t\tconst a = te[0],\n\t\t\t\t\t\tb = te[1],\n\t\t\t\t\t\tc = te[2],\n\t\t\t\t\t\td = te[3],\n\t\t\t\t\t\te = te[4],\n\t\t\t\t\t\tf = te[5],\n\t\t\t\t\t\tg = te[6],\n\t\t\t\t\t\th = te[7],\n\t\t\t\t\t\ti = te[8];\n\t\t\treturn a * e * i - a * f * h - b * d * i + b * f * g + c * d * h - c * e * g;\n\t\t}\n\n\t\tinvert() {\n\t\t\tconst te = this.elements,\n\t\t\t\t\t\tn11 = te[0],\n\t\t\t\t\t\tn21 = te[1],\n\t\t\t\t\t\tn31 = te[2],\n\t\t\t\t\t\tn12 = te[3],\n\t\t\t\t\t\tn22 = te[4],\n\t\t\t\t\t\tn32 = te[5],\n\t\t\t\t\t\tn13 = te[6],\n\t\t\t\t\t\tn23 = te[7],\n\t\t\t\t\t\tn33 = te[8],\n\t\t\t\t\t\tt11 = n33 * n22 - n32 * n23,\n\t\t\t\t\t\tt12 = n32 * n13 - n33 * n12,\n\t\t\t\t\t\tt13 = n23 * n12 - n22 * n13,\n\t\t\t\t\t\tdet = n11 * t11 + n21 * t12 + n31 * t13;\n\t\t\tif (det === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0);\n\t\t\tconst detInv = 1 / det;\n\t\t\tte[0] = t11 * detInv;\n\t\t\tte[1] = (n31 * n23 - n33 * n21) * detInv;\n\t\t\tte[2] = (n32 * n21 - n31 * n22) * detInv;\n\t\t\tte[3] = t12 * detInv;\n\t\t\tte[4] = (n33 * n11 - n31 * n13) * detInv;\n\t\t\tte[5] = (n31 * n12 - n32 * n11) * detInv;\n\t\t\tte[6] = t13 * detInv;\n\t\t\tte[7] = (n21 * n13 - n23 * n11) * detInv;\n\t\t\tte[8] = (n22 * n11 - n21 * n12) * detInv;\n\t\t\treturn this;\n\t\t}\n\n\t\ttranspose() {\n\t\t\tlet tmp;\n\t\t\tconst m = this.elements;\n\t\t\ttmp = m[1];\n\t\t\tm[1] = m[3];\n\t\t\tm[3] = tmp;\n\t\t\ttmp = m[2];\n\t\t\tm[2] = m[6];\n\t\t\tm[6] = tmp;\n\t\t\ttmp = m[5];\n\t\t\tm[5] = m[7];\n\t\t\tm[7] = tmp;\n\t\t\treturn this;\n\t\t}\n\n\t\tgetNormalMatrix(matrix4) {\n\t\t\treturn this.setFromMatrix4(matrix4).invert().transpose();\n\t\t}\n\n\t\ttransposeIntoArray(r) {\n\t\t\tconst m = this.elements;\n\t\t\tr[0] = m[0];\n\t\t\tr[1] = m[3];\n\t\t\tr[2] = m[6];\n\t\t\tr[3] = m[1];\n\t\t\tr[4] = m[4];\n\t\t\tr[5] = m[7];\n\t\t\tr[6] = m[2];\n\t\t\tr[7] = m[5];\n\t\t\tr[8] = m[8];\n\t\t\treturn this;\n\t\t}\n\n\t\tsetUvTransform(tx, ty, sx, sy, rotation, cx, cy) {\n\t\t\tconst c = Math.cos(rotation);\n\t\t\tconst s = Math.sin(rotation);\n\t\t\tthis.set(sx * c, sx * s, -sx * (c * cx + s * cy) + cx + tx, -sy * s, sy * c, -sy * (-s * cx + c * cy) + cy + ty, 0, 0, 1);\n\t\t\treturn this;\n\t\t}\n\n\t\tscale(sx, sy) {\n\t\t\tconst te = this.elements;\n\t\t\tte[0] *= sx;\n\t\t\tte[3] *= sx;\n\t\t\tte[6] *= sx;\n\t\t\tte[1] *= sy;\n\t\t\tte[4] *= sy;\n\t\t\tte[7] *= sy;\n\t\t\treturn this;\n\t\t}\n\n\t\trotate(theta) {\n\t\t\tconst c = Math.cos(theta);\n\t\t\tconst s = Math.sin(theta);\n\t\t\tconst te = this.elements;\n\t\t\tconst a11 = te[0],\n\t\t\t\t\t\ta12 = te[3],\n\t\t\t\t\t\ta13 = te[6];\n\t\t\tconst a21 = te[1],\n\t\t\t\t\t\ta22 = te[4],\n\t\t\t\t\t\ta23 = te[7];\n\t\t\tte[0] = c * a11 + s * a21;\n\t\t\tte[3] = c * a12 + s * a22;\n\t\t\tte[6] = c * a13 + s * a23;\n\t\t\tte[1] = -s * a11 + c * a21;\n\t\t\tte[4] = -s * a12 + c * a22;\n\t\t\tte[7] = -s * a13 + c * a23;\n\t\t\treturn this;\n\t\t}\n\n\t\ttranslate(tx, ty) {\n\t\t\tconst te = this.elements;\n\t\t\tte[0] += tx * te[2];\n\t\t\tte[3] += tx * te[5];\n\t\t\tte[6] += tx * te[8];\n\t\t\tte[1] += ty * te[2];\n\t\t\tte[4] += ty * te[5];\n\t\t\tte[7] += ty * te[8];\n\t\t\treturn this;\n\t\t}\n\n\t\tequals(matrix) {\n\t\t\tconst te = this.elements;\n\t\t\tconst me = matrix.elements;\n\n\t\t\tfor (let i = 0; i < 9; i++) {\n\t\t\t\tif (te[i] !== me[i]) return false;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tfromArray(array, offset = 0) {\n\t\t\tfor (let i = 0; i < 9; i++) {\n\t\t\t\tthis.elements[i] = array[i + offset];\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\ttoArray(array = [], offset = 0) {\n\t\t\tconst te = this.elements;\n\t\t\tarray[offset] = te[0];\n\t\t\tarray[offset + 1] = te[1];\n\t\t\tarray[offset + 2] = te[2];\n\t\t\tarray[offset + 3] = te[3];\n\t\t\tarray[offset + 4] = te[4];\n\t\t\tarray[offset + 5] = te[5];\n\t\t\tarray[offset + 6] = te[6];\n\t\t\tarray[offset + 7] = te[7];\n\t\t\tarray[offset + 8] = te[8];\n\t\t\treturn array;\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new this.constructor().fromArray(this.elements);\n\t\t}\n\n\t}\n\n\tMatrix3.prototype.isMatrix3 = true;\n\n\tfunction arrayMax(array) {\n\t\tif (array.length === 0) return -Infinity;\n\t\tlet max = array[0];\n\n\t\tfor (let i = 1, l = array.length; i < l; ++i) {\n\t\t\tif (array[i] > max) max = array[i];\n\t\t}\n\n\t\treturn max;\n\t}\n\n\tconst TYPED_ARRAYS = {\n\t\tInt8Array: Int8Array,\n\t\tUint8Array: Uint8Array,\n\t\tUint8ClampedArray: Uint8ClampedArray,\n\t\tInt16Array: Int16Array,\n\t\tUint16Array: Uint16Array,\n\t\tInt32Array: Int32Array,\n\t\tUint32Array: Uint32Array,\n\t\tFloat32Array: Float32Array,\n\t\tFloat64Array: Float64Array\n\t};\n\n\tfunction getTypedArray(type, buffer) {\n\t\treturn new TYPED_ARRAYS[type](buffer);\n\t}\n\n\tfunction createElementNS(name) {\n\t\treturn document.createElementNS('http://www.w3.org/1999/xhtml', name);\n\t}\n\n\tlet _canvas;\n\n\tclass ImageUtils {\n\t\tstatic getDataURL(image) {\n\t\t\tif (/^data:/i.test(image.src)) {\n\t\t\t\treturn image.src;\n\t\t\t}\n\n\t\t\tif (typeof HTMLCanvasElement == 'undefined') {\n\t\t\t\treturn image.src;\n\t\t\t}\n\n\t\t\tlet canvas;\n\n\t\t\tif (image instanceof HTMLCanvasElement) {\n\t\t\t\tcanvas = image;\n\t\t\t} else {\n\t\t\t\tif (_canvas === undefined) _canvas = createElementNS('canvas');\n\t\t\t\t_canvas.width = image.width;\n\t\t\t\t_canvas.height = image.height;\n\n\t\t\t\tconst context = _canvas.getContext('2d');\n\n\t\t\t\tif (image instanceof ImageData) {\n\t\t\t\t\tcontext.putImageData(image, 0, 0);\n\t\t\t\t} else {\n\t\t\t\t\tcontext.drawImage(image, 0, 0, image.width, image.height);\n\t\t\t\t}\n\n\t\t\t\tcanvas = _canvas;\n\t\t\t}\n\n\t\t\tif (canvas.width > 2048 || canvas.height > 2048) {\n\t\t\t\tconsole.warn('THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons', image);\n\t\t\t\treturn canvas.toDataURL('image/jpeg', 0.6);\n\t\t\t} else {\n\t\t\t\treturn canvas.toDataURL('image/png');\n\t\t\t}\n\t\t}\n\n\t}\n\n\tlet textureId = 0;\n\n\tclass Texture extends EventDispatcher {\n\t\tconstructor(image = Texture.DEFAULT_IMAGE, mapping = Texture.DEFAULT_MAPPING, wrapS = ClampToEdgeWrapping, wrapT = ClampToEdgeWrapping, magFilter = LinearFilter, minFilter = LinearMipmapLinearFilter, format = RGBAFormat, type = UnsignedByteType, anisotropy = 1, encoding = LinearEncoding) {\n\t\t\tsuper();\n\t\t\tObject.defineProperty(this, 'id', {\n\t\t\t\tvalue: textureId++\n\t\t\t});\n\t\t\tthis.uuid = generateUUID();\n\t\t\tthis.name = '';\n\t\t\tthis.image = image;\n\t\t\tthis.mipmaps = [];\n\t\t\tthis.mapping = mapping;\n\t\t\tthis.wrapS = wrapS;\n\t\t\tthis.wrapT = wrapT;\n\t\t\tthis.magFilter = magFilter;\n\t\t\tthis.minFilter = minFilter;\n\t\t\tthis.anisotropy = anisotropy;\n\t\t\tthis.format = format;\n\t\t\tthis.internalFormat = null;\n\t\t\tthis.type = type;\n\t\t\tthis.offset = new Vector2(0, 0);\n\t\t\tthis.repeat = new Vector2(1, 1);\n\t\t\tthis.center = new Vector2(0, 0);\n\t\t\tthis.rotation = 0;\n\t\t\tthis.matrixAutoUpdate = true;\n\t\t\tthis.matrix = new Matrix3();\n\t\t\tthis.generateMipmaps = true;\n\t\t\tthis.premultiplyAlpha = false;\n\t\t\tthis.flipY = true;\n\t\t\tthis.unpackAlignment = 4; // valid values: 1, 2, 4, 8 (see http://www.khronos.org/opengles/sdk/docs/man/xhtml/glPixelStorei.xml)\n\t\t\t// Values of encoding !== THREE.LinearEncoding only supported on map, envMap and emissiveMap.\n\t\t\t//\n\t\t\t// Also changing the encoding after already used by a Material will not automatically make the Material\n\t\t\t// update. You need to explicitly call Material.needsUpdate to trigger it to recompile.\n\n\t\t\tthis.encoding = encoding;\n\t\t\tthis.version = 0;\n\t\t\tthis.onUpdate = null;\n\t\t\tthis.isRenderTargetTexture = false;\n\t\t}\n\n\t\tupdateMatrix() {\n\t\t\tthis.matrix.setUvTransform(this.offset.x, this.offset.y, this.repeat.x, this.repeat.y, this.rotation, this.center.x, this.center.y);\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new this.constructor().copy(this);\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tthis.name = source.name;\n\t\t\tthis.image = source.image;\n\t\t\tthis.mipmaps = source.mipmaps.slice(0);\n\t\t\tthis.mapping = source.mapping;\n\t\t\tthis.wrapS = source.wrapS;\n\t\t\tthis.wrapT = source.wrapT;\n\t\t\tthis.magFilter = source.magFilter;\n\t\t\tthis.minFilter = source.minFilter;\n\t\t\tthis.anisotropy = source.anisotropy;\n\t\t\tthis.format = source.format;\n\t\t\tthis.internalFormat = source.internalFormat;\n\t\t\tthis.type = source.type;\n\t\t\tthis.offset.copy(source.offset);\n\t\t\tthis.repeat.copy(source.repeat);\n\t\t\tthis.center.copy(source.center);\n\t\t\tthis.rotation = source.rotation;\n\t\t\tthis.matrixAutoUpdate = source.matrixAutoUpdate;\n\t\t\tthis.matrix.copy(source.matrix);\n\t\t\tthis.generateMipmaps = source.generateMipmaps;\n\t\t\tthis.premultiplyAlpha = source.premultiplyAlpha;\n\t\t\tthis.flipY = source.flipY;\n\t\t\tthis.unpackAlignment = source.unpackAlignment;\n\t\t\tthis.encoding = source.encoding;\n\t\t\treturn this;\n\t\t}\n\n\t\ttoJSON(meta) {\n\t\t\tconst isRootObject = meta === undefined || typeof meta === 'string';\n\n\t\t\tif (!isRootObject && meta.textures[this.uuid] !== undefined) {\n\t\t\t\treturn meta.textures[this.uuid];\n\t\t\t}\n\n\t\t\tconst output = {\n\t\t\t\tmetadata: {\n\t\t\t\t\tversion: 4.5,\n\t\t\t\t\ttype: 'Texture',\n\t\t\t\t\tgenerator: 'Texture.toJSON'\n\t\t\t\t},\n\t\t\t\tuuid: this.uuid,\n\t\t\t\tname: this.name,\n\t\t\t\tmapping: this.mapping,\n\t\t\t\trepeat: [this.repeat.x, this.repeat.y],\n\t\t\t\toffset: [this.offset.x, this.offset.y],\n\t\t\t\tcenter: [this.center.x, this.center.y],\n\t\t\t\trotation: this.rotation,\n\t\t\t\twrap: [this.wrapS, this.wrapT],\n\t\t\t\tformat: this.format,\n\t\t\t\ttype: this.type,\n\t\t\t\tencoding: this.encoding,\n\t\t\t\tminFilter: this.minFilter,\n\t\t\t\tmagFilter: this.magFilter,\n\t\t\t\tanisotropy: this.anisotropy,\n\t\t\t\tflipY: this.flipY,\n\t\t\t\tpremultiplyAlpha: this.premultiplyAlpha,\n\t\t\t\tunpackAlignment: this.unpackAlignment\n\t\t\t};\n\n\t\t\tif (this.image !== undefined) {\n\t\t\t\t// TODO: Move to THREE.Image\n\t\t\t\tconst image = this.image;\n\n\t\t\t\tif (image.uuid === undefined) {\n\t\t\t\t\timage.uuid = generateUUID(); // UGH\n\t\t\t\t}\n\n\t\t\t\tif (!isRootObject && meta.images[image.uuid] === undefined) {\n\t\t\t\t\tlet url;\n\n\t\t\t\t\tif (Array.isArray(image)) {\n\t\t\t\t\t\t// process array of images e.g. CubeTexture\n\t\t\t\t\t\turl = [];\n\n\t\t\t\t\t\tfor (let i = 0, l = image.length; i < l; i++) {\n\t\t\t\t\t\t\t// check cube texture with data textures\n\t\t\t\t\t\t\tif (image[i].isDataTexture) {\n\t\t\t\t\t\t\t\turl.push(serializeImage(image[i].image));\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\turl.push(serializeImage(image[i]));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// process single image\n\t\t\t\t\t\turl = serializeImage(image);\n\t\t\t\t\t}\n\n\t\t\t\t\tmeta.images[image.uuid] = {\n\t\t\t\t\t\tuuid: image.uuid,\n\t\t\t\t\t\turl: url\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\toutput.image = image.uuid;\n\t\t\t}\n\n\t\t\tif (!isRootObject) {\n\t\t\t\tmeta.textures[this.uuid] = output;\n\t\t\t}\n\n\t\t\treturn output;\n\t\t}\n\n\t\tdispose() {\n\t\t\tthis.dispatchEvent({\n\t\t\t\ttype: 'dispose'\n\t\t\t});\n\t\t}\n\n\t\ttransformUv(uv) {\n\t\t\tif (this.mapping !== UVMapping) return uv;\n\t\t\tuv.applyMatrix3(this.matrix);\n\n\t\t\tif (uv.x < 0 || uv.x > 1) {\n\t\t\t\tswitch (this.wrapS) {\n\t\t\t\t\tcase RepeatWrapping:\n\t\t\t\t\t\tuv.x = uv.x - Math.floor(uv.x);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase ClampToEdgeWrapping:\n\t\t\t\t\t\tuv.x = uv.x < 0 ? 0 : 1;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase MirroredRepeatWrapping:\n\t\t\t\t\t\tif (Math.abs(Math.floor(uv.x) % 2) === 1) {\n\t\t\t\t\t\t\tuv.x = Math.ceil(uv.x) - uv.x;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tuv.x = uv.x - Math.floor(uv.x);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (uv.y < 0 || uv.y > 1) {\n\t\t\t\tswitch (this.wrapT) {\n\t\t\t\t\tcase RepeatWrapping:\n\t\t\t\t\t\tuv.y = uv.y - Math.floor(uv.y);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase ClampToEdgeWrapping:\n\t\t\t\t\t\tuv.y = uv.y < 0 ? 0 : 1;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase MirroredRepeatWrapping:\n\t\t\t\t\t\tif (Math.abs(Math.floor(uv.y) % 2) === 1) {\n\t\t\t\t\t\t\tuv.y = Math.ceil(uv.y) - uv.y;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tuv.y = uv.y - Math.floor(uv.y);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.flipY) {\n\t\t\t\tuv.y = 1 - uv.y;\n\t\t\t}\n\n\t\t\treturn uv;\n\t\t}\n\n\t\tset needsUpdate(value) {\n\t\t\tif (value === true) this.version++;\n\t\t}\n\n\t}\n\n\tTexture.DEFAULT_IMAGE = undefined;\n\tTexture.DEFAULT_MAPPING = UVMapping;\n\tTexture.prototype.isTexture = true;\n\n\tfunction serializeImage(image) {\n\t\tif (typeof HTMLImageElement !== 'undefined' && image instanceof HTMLImageElement || typeof HTMLCanvasElement !== 'undefined' && image instanceof HTMLCanvasElement || typeof ImageBitmap !== 'undefined' && image instanceof ImageBitmap) {\n\t\t\t// default images\n\t\t\treturn ImageUtils.getDataURL(image);\n\t\t} else {\n\t\t\tif (image.data) {\n\t\t\t\t// images of DataTexture\n\t\t\t\treturn {\n\t\t\t\t\tdata: Array.prototype.slice.call(image.data),\n\t\t\t\t\twidth: image.width,\n\t\t\t\t\theight: image.height,\n\t\t\t\t\ttype: image.data.constructor.name\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tconsole.warn('THREE.Texture: Unable to serialize Texture.');\n\t\t\t\treturn {};\n\t\t\t}\n\t\t}\n\t}\n\n\tclass Vector4 {\n\t\tconstructor(x = 0, y = 0, z = 0, w = 1) {\n\t\t\tthis.x = x;\n\t\t\tthis.y = y;\n\t\t\tthis.z = z;\n\t\t\tthis.w = w;\n\t\t}\n\n\t\tget width() {\n\t\t\treturn this.z;\n\t\t}\n\n\t\tset width(value) {\n\t\t\tthis.z = value;\n\t\t}\n\n\t\tget height() {\n\t\t\treturn this.w;\n\t\t}\n\n\t\tset height(value) {\n\t\t\tthis.w = value;\n\t\t}\n\n\t\tset(x, y, z, w) {\n\t\t\tthis.x = x;\n\t\t\tthis.y = y;\n\t\t\tthis.z = z;\n\t\t\tthis.w = w;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetScalar(scalar) {\n\t\t\tthis.x = scalar;\n\t\t\tthis.y = scalar;\n\t\t\tthis.z = scalar;\n\t\t\tthis.w = scalar;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetX(x) {\n\t\t\tthis.x = x;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetY(y) {\n\t\t\tthis.y = y;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetZ(z) {\n\t\t\tthis.z = z;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetW(w) {\n\t\t\tthis.w = w;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetComponent(index, value) {\n\t\t\tswitch (index) {\n\t\t\t\tcase 0:\n\t\t\t\t\tthis.x = value;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 1:\n\t\t\t\t\tthis.y = value;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 2:\n\t\t\t\t\tthis.z = value;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 3:\n\t\t\t\t\tthis.w = value;\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Error('index is out of range: ' + index);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tgetComponent(index) {\n\t\t\tswitch (index) {\n\t\t\t\tcase 0:\n\t\t\t\t\treturn this.x;\n\n\t\t\t\tcase 1:\n\t\t\t\t\treturn this.y;\n\n\t\t\t\tcase 2:\n\t\t\t\t\treturn this.z;\n\n\t\t\t\tcase 3:\n\t\t\t\t\treturn this.w;\n\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Error('index is out of range: ' + index);\n\t\t\t}\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new this.constructor(this.x, this.y, this.z, this.w);\n\t\t}\n\n\t\tcopy(v) {\n\t\t\tthis.x = v.x;\n\t\t\tthis.y = v.y;\n\t\t\tthis.z = v.z;\n\t\t\tthis.w = v.w !== undefined ? v.w : 1;\n\t\t\treturn this;\n\t\t}\n\n\t\tadd(v, w) {\n\t\t\tif (w !== undefined) {\n\t\t\t\tconsole.warn('THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead.');\n\t\t\t\treturn this.addVectors(v, w);\n\t\t\t}\n\n\t\t\tthis.x += v.x;\n\t\t\tthis.y += v.y;\n\t\t\tthis.z += v.z;\n\t\t\tthis.w += v.w;\n\t\t\treturn this;\n\t\t}\n\n\t\taddScalar(s) {\n\t\t\tthis.x += s;\n\t\t\tthis.y += s;\n\t\t\tthis.z += s;\n\t\t\tthis.w += s;\n\t\t\treturn this;\n\t\t}\n\n\t\taddVectors(a, b) {\n\t\t\tthis.x = a.x + b.x;\n\t\t\tthis.y = a.y + b.y;\n\t\t\tthis.z = a.z + b.z;\n\t\t\tthis.w = a.w + b.w;\n\t\t\treturn this;\n\t\t}\n\n\t\taddScaledVector(v, s) {\n\t\t\tthis.x += v.x * s;\n\t\t\tthis.y += v.y * s;\n\t\t\tthis.z += v.z * s;\n\t\t\tthis.w += v.w * s;\n\t\t\treturn this;\n\t\t}\n\n\t\tsub(v, w) {\n\t\t\tif (w !== undefined) {\n\t\t\t\tconsole.warn('THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.');\n\t\t\t\treturn this.subVectors(v, w);\n\t\t\t}\n\n\t\t\tthis.x -= v.x;\n\t\t\tthis.y -= v.y;\n\t\t\tthis.z -= v.z;\n\t\t\tthis.w -= v.w;\n\t\t\treturn this;\n\t\t}\n\n\t\tsubScalar(s) {\n\t\t\tthis.x -= s;\n\t\t\tthis.y -= s;\n\t\t\tthis.z -= s;\n\t\t\tthis.w -= s;\n\t\t\treturn this;\n\t\t}\n\n\t\tsubVectors(a, b) {\n\t\t\tthis.x = a.x - b.x;\n\t\t\tthis.y = a.y - b.y;\n\t\t\tthis.z = a.z - b.z;\n\t\t\tthis.w = a.w - b.w;\n\t\t\treturn this;\n\t\t}\n\n\t\tmultiply(v) {\n\t\t\tthis.x *= v.x;\n\t\t\tthis.y *= v.y;\n\t\t\tthis.z *= v.z;\n\t\t\tthis.w *= v.w;\n\t\t\treturn this;\n\t\t}\n\n\t\tmultiplyScalar(scalar) {\n\t\t\tthis.x *= scalar;\n\t\t\tthis.y *= scalar;\n\t\t\tthis.z *= scalar;\n\t\t\tthis.w *= scalar;\n\t\t\treturn this;\n\t\t}\n\n\t\tapplyMatrix4(m) {\n\t\t\tconst x = this.x,\n\t\t\t\t\t\ty = this.y,\n\t\t\t\t\t\tz = this.z,\n\t\t\t\t\t\tw = this.w;\n\t\t\tconst e = m.elements;\n\t\t\tthis.x = e[0] * x + e[4] * y + e[8] * z + e[12] * w;\n\t\t\tthis.y = e[1] * x + e[5] * y + e[9] * z + e[13] * w;\n\t\t\tthis.z = e[2] * x + e[6] * y + e[10] * z + e[14] * w;\n\t\t\tthis.w = e[3] * x + e[7] * y + e[11] * z + e[15] * w;\n\t\t\treturn this;\n\t\t}\n\n\t\tdivideScalar(scalar) {\n\t\t\treturn this.multiplyScalar(1 / scalar);\n\t\t}\n\n\t\tsetAxisAngleFromQuaternion(q) {\n\t\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToAngle/index.htm\n\t\t\t// q is assumed to be normalized\n\t\t\tthis.w = 2 * Math.acos(q.w);\n\t\t\tconst s = Math.sqrt(1 - q.w * q.w);\n\n\t\t\tif (s < 0.0001) {\n\t\t\t\tthis.x = 1;\n\t\t\t\tthis.y = 0;\n\t\t\t\tthis.z = 0;\n\t\t\t} else {\n\t\t\t\tthis.x = q.x / s;\n\t\t\t\tthis.y = q.y / s;\n\t\t\t\tthis.z = q.z / s;\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tsetAxisAngleFromRotationMatrix(m) {\n\t\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToAngle/index.htm\n\t\t\t// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\t\t\tlet angle, x, y, z; // variables for result\n\n\t\t\tconst epsilon = 0.01,\n\t\t\t\t\t\t// margin to allow for rounding errors\n\t\t\tepsilon2 = 0.1,\n\t\t\t\t\t\t// margin to distinguish between 0 and 180 degrees\n\t\t\tte = m.elements,\n\t\t\t\t\t\tm11 = te[0],\n\t\t\t\t\t\tm12 = te[4],\n\t\t\t\t\t\tm13 = te[8],\n\t\t\t\t\t\tm21 = te[1],\n\t\t\t\t\t\tm22 = te[5],\n\t\t\t\t\t\tm23 = te[9],\n\t\t\t\t\t\tm31 = te[2],\n\t\t\t\t\t\tm32 = te[6],\n\t\t\t\t\t\tm33 = te[10];\n\n\t\t\tif (Math.abs(m12 - m21) < epsilon && Math.abs(m13 - m31) < epsilon && Math.abs(m23 - m32) < epsilon) {\n\t\t\t\t// singularity found\n\t\t\t\t// first check for identity matrix which must have +1 for all terms\n\t\t\t\t// in leading diagonal and zero in other terms\n\t\t\t\tif (Math.abs(m12 + m21) < epsilon2 && Math.abs(m13 + m31) < epsilon2 && Math.abs(m23 + m32) < epsilon2 && Math.abs(m11 + m22 + m33 - 3) < epsilon2) {\n\t\t\t\t\t// this singularity is identity matrix so angle = 0\n\t\t\t\t\tthis.set(1, 0, 0, 0);\n\t\t\t\t\treturn this; // zero angle, arbitrary axis\n\t\t\t\t} // otherwise this singularity is angle = 180\n\n\n\t\t\t\tangle = Math.PI;\n\t\t\t\tconst xx = (m11 + 1) / 2;\n\t\t\t\tconst yy = (m22 + 1) / 2;\n\t\t\t\tconst zz = (m33 + 1) / 2;\n\t\t\t\tconst xy = (m12 + m21) / 4;\n\t\t\t\tconst xz = (m13 + m31) / 4;\n\t\t\t\tconst yz = (m23 + m32) / 4;\n\n\t\t\t\tif (xx > yy && xx > zz) {\n\t\t\t\t\t// m11 is the largest diagonal term\n\t\t\t\t\tif (xx < epsilon) {\n\t\t\t\t\t\tx = 0;\n\t\t\t\t\t\ty = 0.707106781;\n\t\t\t\t\t\tz = 0.707106781;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tx = Math.sqrt(xx);\n\t\t\t\t\t\ty = xy / x;\n\t\t\t\t\t\tz = xz / x;\n\t\t\t\t\t}\n\t\t\t\t} else if (yy > zz) {\n\t\t\t\t\t// m22 is the largest diagonal term\n\t\t\t\t\tif (yy < epsilon) {\n\t\t\t\t\t\tx = 0.707106781;\n\t\t\t\t\t\ty = 0;\n\t\t\t\t\t\tz = 0.707106781;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ty = Math.sqrt(yy);\n\t\t\t\t\t\tx = xy / y;\n\t\t\t\t\t\tz = yz / y;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// m33 is the largest diagonal term so base result on this\n\t\t\t\t\tif (zz < epsilon) {\n\t\t\t\t\t\tx = 0.707106781;\n\t\t\t\t\t\ty = 0.707106781;\n\t\t\t\t\t\tz = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tz = Math.sqrt(zz);\n\t\t\t\t\t\tx = xz / z;\n\t\t\t\t\t\ty = yz / z;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis.set(x, y, z, angle);\n\t\t\t\treturn this; // return 180 deg rotation\n\t\t\t} // as we have reached here there are no singularities so we can handle normally\n\n\n\t\t\tlet s = Math.sqrt((m32 - m23) * (m32 - m23) + (m13 - m31) * (m13 - m31) + (m21 - m12) * (m21 - m12)); // used to normalize\n\n\t\t\tif (Math.abs(s) < 0.001) s = 1; // prevent divide by zero, should not happen if matrix is orthogonal and should be\n\t\t\t// caught by singularity test above, but I've left it in just in case\n\n\t\t\tthis.x = (m32 - m23) / s;\n\t\t\tthis.y = (m13 - m31) / s;\n\t\t\tthis.z = (m21 - m12) / s;\n\t\t\tthis.w = Math.acos((m11 + m22 + m33 - 1) / 2);\n\t\t\treturn this;\n\t\t}\n\n\t\tmin(v) {\n\t\t\tthis.x = Math.min(this.x, v.x);\n\t\t\tthis.y = Math.min(this.y, v.y);\n\t\t\tthis.z = Math.min(this.z, v.z);\n\t\t\tthis.w = Math.min(this.w, v.w);\n\t\t\treturn this;\n\t\t}\n\n\t\tmax(v) {\n\t\t\tthis.x = Math.max(this.x, v.x);\n\t\t\tthis.y = Math.max(this.y, v.y);\n\t\t\tthis.z = Math.max(this.z, v.z);\n\t\t\tthis.w = Math.max(this.w, v.w);\n\t\t\treturn this;\n\t\t}\n\n\t\tclamp(min, max) {\n\t\t\t// assumes min < max, componentwise\n\t\t\tthis.x = Math.max(min.x, Math.min(max.x, this.x));\n\t\t\tthis.y = Math.max(min.y, Math.min(max.y, this.y));\n\t\t\tthis.z = Math.max(min.z, Math.min(max.z, this.z));\n\t\t\tthis.w = Math.max(min.w, Math.min(max.w, this.w));\n\t\t\treturn this;\n\t\t}\n\n\t\tclampScalar(minVal, maxVal) {\n\t\t\tthis.x = Math.max(minVal, Math.min(maxVal, this.x));\n\t\t\tthis.y = Math.max(minVal, Math.min(maxVal, this.y));\n\t\t\tthis.z = Math.max(minVal, Math.min(maxVal, this.z));\n\t\t\tthis.w = Math.max(minVal, Math.min(maxVal, this.w));\n\t\t\treturn this;\n\t\t}\n\n\t\tclampLength(min, max) {\n\t\t\tconst length = this.length();\n\t\t\treturn this.divideScalar(length || 1).multiplyScalar(Math.max(min, Math.min(max, length)));\n\t\t}\n\n\t\tfloor() {\n\t\t\tthis.x = Math.floor(this.x);\n\t\t\tthis.y = Math.floor(this.y);\n\t\t\tthis.z = Math.floor(this.z);\n\t\t\tthis.w = Math.floor(this.w);\n\t\t\treturn this;\n\t\t}\n\n\t\tceil() {\n\t\t\tthis.x = Math.ceil(this.x);\n\t\t\tthis.y = Math.ceil(this.y);\n\t\t\tthis.z = Math.ceil(this.z);\n\t\t\tthis.w = Math.ceil(this.w);\n\t\t\treturn this;\n\t\t}\n\n\t\tround() {\n\t\t\tthis.x = Math.round(this.x);\n\t\t\tthis.y = Math.round(this.y);\n\t\t\tthis.z = Math.round(this.z);\n\t\t\tthis.w = Math.round(this.w);\n\t\t\treturn this;\n\t\t}\n\n\t\troundToZero() {\n\t\t\tthis.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x);\n\t\t\tthis.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y);\n\t\t\tthis.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z);\n\t\t\tthis.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w);\n\t\t\treturn this;\n\t\t}\n\n\t\tnegate() {\n\t\t\tthis.x = -this.x;\n\t\t\tthis.y = -this.y;\n\t\t\tthis.z = -this.z;\n\t\t\tthis.w = -this.w;\n\t\t\treturn this;\n\t\t}\n\n\t\tdot(v) {\n\t\t\treturn this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w;\n\t\t}\n\n\t\tlengthSq() {\n\t\t\treturn this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w;\n\t\t}\n\n\t\tlength() {\n\t\t\treturn Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w);\n\t\t}\n\n\t\tmanhattanLength() {\n\t\t\treturn Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w);\n\t\t}\n\n\t\tnormalize() {\n\t\t\treturn this.divideScalar(this.length() || 1);\n\t\t}\n\n\t\tsetLength(length) {\n\t\t\treturn this.normalize().multiplyScalar(length);\n\t\t}\n\n\t\tlerp(v, alpha) {\n\t\t\tthis.x += (v.x - this.x) * alpha;\n\t\t\tthis.y += (v.y - this.y) * alpha;\n\t\t\tthis.z += (v.z - this.z) * alpha;\n\t\t\tthis.w += (v.w - this.w) * alpha;\n\t\t\treturn this;\n\t\t}\n\n\t\tlerpVectors(v1, v2, alpha) {\n\t\t\tthis.x = v1.x + (v2.x - v1.x) * alpha;\n\t\t\tthis.y = v1.y + (v2.y - v1.y) * alpha;\n\t\t\tthis.z = v1.z + (v2.z - v1.z) * alpha;\n\t\t\tthis.w = v1.w + (v2.w - v1.w) * alpha;\n\t\t\treturn this;\n\t\t}\n\n\t\tequals(v) {\n\t\t\treturn v.x === this.x && v.y === this.y && v.z === this.z && v.w === this.w;\n\t\t}\n\n\t\tfromArray(array, offset = 0) {\n\t\t\tthis.x = array[offset];\n\t\t\tthis.y = array[offset + 1];\n\t\t\tthis.z = array[offset + 2];\n\t\t\tthis.w = array[offset + 3];\n\t\t\treturn this;\n\t\t}\n\n\t\ttoArray(array = [], offset = 0) {\n\t\t\tarray[offset] = this.x;\n\t\t\tarray[offset + 1] = this.y;\n\t\t\tarray[offset + 2] = this.z;\n\t\t\tarray[offset + 3] = this.w;\n\t\t\treturn array;\n\t\t}\n\n\t\tfromBufferAttribute(attribute, index, offset) {\n\t\t\tif (offset !== undefined) {\n\t\t\t\tconsole.warn('THREE.Vector4: offset has been removed from .fromBufferAttribute().');\n\t\t\t}\n\n\t\t\tthis.x = attribute.getX(index);\n\t\t\tthis.y = attribute.getY(index);\n\t\t\tthis.z = attribute.getZ(index);\n\t\t\tthis.w = attribute.getW(index);\n\t\t\treturn this;\n\t\t}\n\n\t\trandom() {\n\t\t\tthis.x = Math.random();\n\t\t\tthis.y = Math.random();\n\t\t\tthis.z = Math.random();\n\t\t\tthis.w = Math.random();\n\t\t\treturn this;\n\t\t}\n\n\t\t*[Symbol.iterator]() {\n\t\t\tyield this.x;\n\t\t\tyield this.y;\n\t\t\tyield this.z;\n\t\t\tyield this.w;\n\t\t}\n\n\t}\n\n\tVector4.prototype.isVector4 = true;\n\n\t/*\n\t In options, we can specify:\n\t * Texture parameters for an auto-generated target texture\n\t * depthBuffer/stencilBuffer: Booleans to indicate if we should generate these buffers\n\t*/\n\n\tclass WebGLRenderTarget extends EventDispatcher {\n\t\tconstructor(width, height, options = {}) {\n\t\t\tsuper();\n\t\t\tthis.width = width;\n\t\t\tthis.height = height;\n\t\t\tthis.depth = 1;\n\t\t\tthis.scissor = new Vector4(0, 0, width, height);\n\t\t\tthis.scissorTest = false;\n\t\t\tthis.viewport = new Vector4(0, 0, width, height);\n\t\t\tthis.texture = new Texture(undefined, options.mapping, options.wrapS, options.wrapT, options.magFilter, options.minFilter, options.format, options.type, options.anisotropy, options.encoding);\n\t\t\tthis.texture.isRenderTargetTexture = true;\n\t\t\tthis.texture.image = {\n\t\t\t\twidth: width,\n\t\t\t\theight: height,\n\t\t\t\tdepth: 1\n\t\t\t};\n\t\t\tthis.texture.generateMipmaps = options.generateMipmaps !== undefined ? options.generateMipmaps : false;\n\t\t\tthis.texture.internalFormat = options.internalFormat !== undefined ? options.internalFormat : null;\n\t\t\tthis.texture.minFilter = options.minFilter !== undefined ? options.minFilter : LinearFilter;\n\t\t\tthis.depthBuffer = options.depthBuffer !== undefined ? options.depthBuffer : true;\n\t\t\tthis.stencilBuffer = options.stencilBuffer !== undefined ? options.stencilBuffer : false;\n\t\t\tthis.depthTexture = options.depthTexture !== undefined ? options.depthTexture : null;\n\t\t}\n\n\t\tsetTexture(texture) {\n\t\t\ttexture.image = {\n\t\t\t\twidth: this.width,\n\t\t\t\theight: this.height,\n\t\t\t\tdepth: this.depth\n\t\t\t};\n\t\t\tthis.texture = texture;\n\t\t}\n\n\t\tsetSize(width, height, depth = 1) {\n\t\t\tif (this.width !== width || this.height !== height || this.depth !== depth) {\n\t\t\t\tthis.width = width;\n\t\t\t\tthis.height = height;\n\t\t\t\tthis.depth = depth;\n\t\t\t\tthis.texture.image.width = width;\n\t\t\t\tthis.texture.image.height = height;\n\t\t\t\tthis.texture.image.depth = depth;\n\t\t\t\tthis.dispose();\n\t\t\t}\n\n\t\t\tthis.viewport.set(0, 0, width, height);\n\t\t\tthis.scissor.set(0, 0, width, height);\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new this.constructor().copy(this);\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tthis.width = source.width;\n\t\t\tthis.height = source.height;\n\t\t\tthis.depth = source.depth;\n\t\t\tthis.viewport.copy(source.viewport);\n\t\t\tthis.texture = source.texture.clone();\n\t\t\tthis.texture.image = { ...this.texture.image\n\t\t\t}; // See #20328.\n\n\t\t\tthis.depthBuffer = source.depthBuffer;\n\t\t\tthis.stencilBuffer = source.stencilBuffer;\n\t\t\tthis.depthTexture = source.depthTexture;\n\t\t\treturn this;\n\t\t}\n\n\t\tdispose() {\n\t\t\tthis.dispatchEvent({\n\t\t\t\ttype: 'dispose'\n\t\t\t});\n\t\t}\n\n\t}\n\n\tWebGLRenderTarget.prototype.isWebGLRenderTarget = true;\n\n\tclass WebGLMultipleRenderTargets extends WebGLRenderTarget {\n\t\tconstructor(width, height, count) {\n\t\t\tsuper(width, height);\n\t\t\tconst texture = this.texture;\n\t\t\tthis.texture = [];\n\n\t\t\tfor (let i = 0; i < count; i++) {\n\t\t\t\tthis.texture[i] = texture.clone();\n\t\t\t}\n\t\t}\n\n\t\tsetSize(width, height, depth = 1) {\n\t\t\tif (this.width !== width || this.height !== height || this.depth !== depth) {\n\t\t\t\tthis.width = width;\n\t\t\t\tthis.height = height;\n\t\t\t\tthis.depth = depth;\n\n\t\t\t\tfor (let i = 0, il = this.texture.length; i < il; i++) {\n\t\t\t\t\tthis.texture[i].image.width = width;\n\t\t\t\t\tthis.texture[i].image.height = height;\n\t\t\t\t\tthis.texture[i].image.depth = depth;\n\t\t\t\t}\n\n\t\t\t\tthis.dispose();\n\t\t\t}\n\n\t\t\tthis.viewport.set(0, 0, width, height);\n\t\t\tthis.scissor.set(0, 0, width, height);\n\t\t\treturn this;\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tthis.dispose();\n\t\t\tthis.width = source.width;\n\t\t\tthis.height = source.height;\n\t\t\tthis.depth = source.depth;\n\t\t\tthis.viewport.set(0, 0, this.width, this.height);\n\t\t\tthis.scissor.set(0, 0, this.width, this.height);\n\t\t\tthis.depthBuffer = source.depthBuffer;\n\t\t\tthis.stencilBuffer = source.stencilBuffer;\n\t\t\tthis.depthTexture = source.depthTexture;\n\t\t\tthis.texture.length = 0;\n\n\t\t\tfor (let i = 0, il = source.texture.length; i < il; i++) {\n\t\t\t\tthis.texture[i] = source.texture[i].clone();\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tWebGLMultipleRenderTargets.prototype.isWebGLMultipleRenderTargets = true;\n\n\tclass WebGLMultisampleRenderTarget extends WebGLRenderTarget {\n\t\tconstructor(width, height, options) {\n\t\t\tsuper(width, height, options);\n\t\t\tthis.samples = 4;\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy.call(this, source);\n\t\t\tthis.samples = source.samples;\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tWebGLMultisampleRenderTarget.prototype.isWebGLMultisampleRenderTarget = true;\n\n\tclass Quaternion {\n\t\tconstructor(x = 0, y = 0, z = 0, w = 1) {\n\t\t\tthis._x = x;\n\t\t\tthis._y = y;\n\t\t\tthis._z = z;\n\t\t\tthis._w = w;\n\t\t}\n\n\t\tstatic slerp(qa, qb, qm, t) {\n\t\t\tconsole.warn('THREE.Quaternion: Static .slerp() has been deprecated. Use qm.slerpQuaternions( qa, qb, t ) instead.');\n\t\t\treturn qm.slerpQuaternions(qa, qb, t);\n\t\t}\n\n\t\tstatic slerpFlat(dst, dstOffset, src0, srcOffset0, src1, srcOffset1, t) {\n\t\t\t// fuzz-free, array-based Quaternion SLERP operation\n\t\t\tlet x0 = src0[srcOffset0 + 0],\n\t\t\t\t\ty0 = src0[srcOffset0 + 1],\n\t\t\t\t\tz0 = src0[srcOffset0 + 2],\n\t\t\t\t\tw0 = src0[srcOffset0 + 3];\n\t\t\tconst x1 = src1[srcOffset1 + 0],\n\t\t\t\t\t\ty1 = src1[srcOffset1 + 1],\n\t\t\t\t\t\tz1 = src1[srcOffset1 + 2],\n\t\t\t\t\t\tw1 = src1[srcOffset1 + 3];\n\n\t\t\tif (t === 0) {\n\t\t\t\tdst[dstOffset + 0] = x0;\n\t\t\t\tdst[dstOffset + 1] = y0;\n\t\t\t\tdst[dstOffset + 2] = z0;\n\t\t\t\tdst[dstOffset + 3] = w0;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (t === 1) {\n\t\t\t\tdst[dstOffset + 0] = x1;\n\t\t\t\tdst[dstOffset + 1] = y1;\n\t\t\t\tdst[dstOffset + 2] = z1;\n\t\t\t\tdst[dstOffset + 3] = w1;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (w0 !== w1 || x0 !== x1 || y0 !== y1 || z0 !== z1) {\n\t\t\t\tlet s = 1 - t;\n\t\t\t\tconst cos = x0 * x1 + y0 * y1 + z0 * z1 + w0 * w1,\n\t\t\t\t\t\t\tdir = cos >= 0 ? 1 : -1,\n\t\t\t\t\t\t\tsqrSin = 1 - cos * cos; // Skip the Slerp for tiny steps to avoid numeric problems:\n\n\t\t\t\tif (sqrSin > Number.EPSILON) {\n\t\t\t\t\tconst sin = Math.sqrt(sqrSin),\n\t\t\t\t\t\t\t\tlen = Math.atan2(sin, cos * dir);\n\t\t\t\t\ts = Math.sin(s * len) / sin;\n\t\t\t\t\tt = Math.sin(t * len) / sin;\n\t\t\t\t}\n\n\t\t\t\tconst tDir = t * dir;\n\t\t\t\tx0 = x0 * s + x1 * tDir;\n\t\t\t\ty0 = y0 * s + y1 * tDir;\n\t\t\t\tz0 = z0 * s + z1 * tDir;\n\t\t\t\tw0 = w0 * s + w1 * tDir; // Normalize in case we just did a lerp:\n\n\t\t\t\tif (s === 1 - t) {\n\t\t\t\t\tconst f = 1 / Math.sqrt(x0 * x0 + y0 * y0 + z0 * z0 + w0 * w0);\n\t\t\t\t\tx0 *= f;\n\t\t\t\t\ty0 *= f;\n\t\t\t\t\tz0 *= f;\n\t\t\t\t\tw0 *= f;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tdst[dstOffset] = x0;\n\t\t\tdst[dstOffset + 1] = y0;\n\t\t\tdst[dstOffset + 2] = z0;\n\t\t\tdst[dstOffset + 3] = w0;\n\t\t}\n\n\t\tstatic multiplyQuaternionsFlat(dst, dstOffset, src0, srcOffset0, src1, srcOffset1) {\n\t\t\tconst x0 = src0[srcOffset0];\n\t\t\tconst y0 = src0[srcOffset0 + 1];\n\t\t\tconst z0 = src0[srcOffset0 + 2];\n\t\t\tconst w0 = src0[srcOffset0 + 3];\n\t\t\tconst x1 = src1[srcOffset1];\n\t\t\tconst y1 = src1[srcOffset1 + 1];\n\t\t\tconst z1 = src1[srcOffset1 + 2];\n\t\t\tconst w1 = src1[srcOffset1 + 3];\n\t\t\tdst[dstOffset] = x0 * w1 + w0 * x1 + y0 * z1 - z0 * y1;\n\t\t\tdst[dstOffset + 1] = y0 * w1 + w0 * y1 + z0 * x1 - x0 * z1;\n\t\t\tdst[dstOffset + 2] = z0 * w1 + w0 * z1 + x0 * y1 - y0 * x1;\n\t\t\tdst[dstOffset + 3] = w0 * w1 - x0 * x1 - y0 * y1 - z0 * z1;\n\t\t\treturn dst;\n\t\t}\n\n\t\tget x() {\n\t\t\treturn this._x;\n\t\t}\n\n\t\tset x(value) {\n\t\t\tthis._x = value;\n\n\t\t\tthis._onChangeCallback();\n\t\t}\n\n\t\tget y() {\n\t\t\treturn this._y;\n\t\t}\n\n\t\tset y(value) {\n\t\t\tthis._y = value;\n\n\t\t\tthis._onChangeCallback();\n\t\t}\n\n\t\tget z() {\n\t\t\treturn this._z;\n\t\t}\n\n\t\tset z(value) {\n\t\t\tthis._z = value;\n\n\t\t\tthis._onChangeCallback();\n\t\t}\n\n\t\tget w() {\n\t\t\treturn this._w;\n\t\t}\n\n\t\tset w(value) {\n\t\t\tthis._w = value;\n\n\t\t\tthis._onChangeCallback();\n\t\t}\n\n\t\tset(x, y, z, w) {\n\t\t\tthis._x = x;\n\t\t\tthis._y = y;\n\t\t\tthis._z = z;\n\t\t\tthis._w = w;\n\n\t\t\tthis._onChangeCallback();\n\n\t\t\treturn this;\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new this.constructor(this._x, this._y, this._z, this._w);\n\t\t}\n\n\t\tcopy(quaternion) {\n\t\t\tthis._x = quaternion.x;\n\t\t\tthis._y = quaternion.y;\n\t\t\tthis._z = quaternion.z;\n\t\t\tthis._w = quaternion.w;\n\n\t\t\tthis._onChangeCallback();\n\n\t\t\treturn this;\n\t\t}\n\n\t\tsetFromEuler(euler, update) {\n\t\t\tif (!(euler && euler.isEuler)) {\n\t\t\t\tthrow new Error('THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.');\n\t\t\t}\n\n\t\t\tconst x = euler._x,\n\t\t\t\t\t\ty = euler._y,\n\t\t\t\t\t\tz = euler._z,\n\t\t\t\t\t\torder = euler._order; // http://www.mathworks.com/matlabcentral/fileexchange/\n\t\t\t// \t20696-function-to-convert-between-dcm-euler-angles-quaternions-and-euler-vectors/\n\t\t\t//\tcontent/SpinCalc.m\n\n\t\t\tconst cos = Math.cos;\n\t\t\tconst sin = Math.sin;\n\t\t\tconst c1 = cos(x / 2);\n\t\t\tconst c2 = cos(y / 2);\n\t\t\tconst c3 = cos(z / 2);\n\t\t\tconst s1 = sin(x / 2);\n\t\t\tconst s2 = sin(y / 2);\n\t\t\tconst s3 = sin(z / 2);\n\n\t\t\tswitch (order) {\n\t\t\t\tcase 'XYZ':\n\t\t\t\t\tthis._x = s1 * c2 * c3 + c1 * s2 * s3;\n\t\t\t\t\tthis._y = c1 * s2 * c3 - s1 * c2 * s3;\n\t\t\t\t\tthis._z = c1 * c2 * s3 + s1 * s2 * c3;\n\t\t\t\t\tthis._w = c1 * c2 * c3 - s1 * s2 * s3;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'YXZ':\n\t\t\t\t\tthis._x = s1 * c2 * c3 + c1 * s2 * s3;\n\t\t\t\t\tthis._y = c1 * s2 * c3 - s1 * c2 * s3;\n\t\t\t\t\tthis._z = c1 * c2 * s3 - s1 * s2 * c3;\n\t\t\t\t\tthis._w = c1 * c2 * c3 + s1 * s2 * s3;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'ZXY':\n\t\t\t\t\tthis._x = s1 * c2 * c3 - c1 * s2 * s3;\n\t\t\t\t\tthis._y = c1 * s2 * c3 + s1 * c2 * s3;\n\t\t\t\t\tthis._z = c1 * c2 * s3 + s1 * s2 * c3;\n\t\t\t\t\tthis._w = c1 * c2 * c3 - s1 * s2 * s3;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'ZYX':\n\t\t\t\t\tthis._x = s1 * c2 * c3 - c1 * s2 * s3;\n\t\t\t\t\tthis._y = c1 * s2 * c3 + s1 * c2 * s3;\n\t\t\t\t\tthis._z = c1 * c2 * s3 - s1 * s2 * c3;\n\t\t\t\t\tthis._w = c1 * c2 * c3 + s1 * s2 * s3;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'YZX':\n\t\t\t\t\tthis._x = s1 * c2 * c3 + c1 * s2 * s3;\n\t\t\t\t\tthis._y = c1 * s2 * c3 + s1 * c2 * s3;\n\t\t\t\t\tthis._z = c1 * c2 * s3 - s1 * s2 * c3;\n\t\t\t\t\tthis._w = c1 * c2 * c3 - s1 * s2 * s3;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'XZY':\n\t\t\t\t\tthis._x = s1 * c2 * c3 - c1 * s2 * s3;\n\t\t\t\t\tthis._y = c1 * s2 * c3 - s1 * c2 * s3;\n\t\t\t\t\tthis._z = c1 * c2 * s3 + s1 * s2 * c3;\n\t\t\t\t\tthis._w = c1 * c2 * c3 + s1 * s2 * s3;\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tconsole.warn('THREE.Quaternion: .setFromEuler() encountered an unknown order: ' + order);\n\t\t\t}\n\n\t\t\tif (update !== false) this._onChangeCallback();\n\t\t\treturn this;\n\t\t}\n\n\t\tsetFromAxisAngle(axis, angle) {\n\t\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/angleToQuaternion/index.htm\n\t\t\t// assumes axis is normalized\n\t\t\tconst halfAngle = angle / 2,\n\t\t\t\t\t\ts = Math.sin(halfAngle);\n\t\t\tthis._x = axis.x * s;\n\t\t\tthis._y = axis.y * s;\n\t\t\tthis._z = axis.z * s;\n\t\t\tthis._w = Math.cos(halfAngle);\n\n\t\t\tthis._onChangeCallback();\n\n\t\t\treturn this;\n\t\t}\n\n\t\tsetFromRotationMatrix(m) {\n\t\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm\n\t\t\t// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\t\t\tconst te = m.elements,\n\t\t\t\t\t\tm11 = te[0],\n\t\t\t\t\t\tm12 = te[4],\n\t\t\t\t\t\tm13 = te[8],\n\t\t\t\t\t\tm21 = te[1],\n\t\t\t\t\t\tm22 = te[5],\n\t\t\t\t\t\tm23 = te[9],\n\t\t\t\t\t\tm31 = te[2],\n\t\t\t\t\t\tm32 = te[6],\n\t\t\t\t\t\tm33 = te[10],\n\t\t\t\t\t\ttrace = m11 + m22 + m33;\n\n\t\t\tif (trace > 0) {\n\t\t\t\tconst s = 0.5 / Math.sqrt(trace + 1.0);\n\t\t\t\tthis._w = 0.25 / s;\n\t\t\t\tthis._x = (m32 - m23) * s;\n\t\t\t\tthis._y = (m13 - m31) * s;\n\t\t\t\tthis._z = (m21 - m12) * s;\n\t\t\t} else if (m11 > m22 && m11 > m33) {\n\t\t\t\tconst s = 2.0 * Math.sqrt(1.0 + m11 - m22 - m33);\n\t\t\t\tthis._w = (m32 - m23) / s;\n\t\t\t\tthis._x = 0.25 * s;\n\t\t\t\tthis._y = (m12 + m21) / s;\n\t\t\t\tthis._z = (m13 + m31) / s;\n\t\t\t} else if (m22 > m33) {\n\t\t\t\tconst s = 2.0 * Math.sqrt(1.0 + m22 - m11 - m33);\n\t\t\t\tthis._w = (m13 - m31) / s;\n\t\t\t\tthis._x = (m12 + m21) / s;\n\t\t\t\tthis._y = 0.25 * s;\n\t\t\t\tthis._z = (m23 + m32) / s;\n\t\t\t} else {\n\t\t\t\tconst s = 2.0 * Math.sqrt(1.0 + m33 - m11 - m22);\n\t\t\t\tthis._w = (m21 - m12) / s;\n\t\t\t\tthis._x = (m13 + m31) / s;\n\t\t\t\tthis._y = (m23 + m32) / s;\n\t\t\t\tthis._z = 0.25 * s;\n\t\t\t}\n\n\t\t\tthis._onChangeCallback();\n\n\t\t\treturn this;\n\t\t}\n\n\t\tsetFromUnitVectors(vFrom, vTo) {\n\t\t\t// assumes direction vectors vFrom and vTo are normalized\n\t\t\tlet r = vFrom.dot(vTo) + 1;\n\n\t\t\tif (r < Number.EPSILON) {\n\t\t\t\t// vFrom and vTo point in opposite directions\n\t\t\t\tr = 0;\n\n\t\t\t\tif (Math.abs(vFrom.x) > Math.abs(vFrom.z)) {\n\t\t\t\t\tthis._x = -vFrom.y;\n\t\t\t\t\tthis._y = vFrom.x;\n\t\t\t\t\tthis._z = 0;\n\t\t\t\t\tthis._w = r;\n\t\t\t\t} else {\n\t\t\t\t\tthis._x = 0;\n\t\t\t\t\tthis._y = -vFrom.z;\n\t\t\t\t\tthis._z = vFrom.y;\n\t\t\t\t\tthis._w = r;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// crossVectors( vFrom, vTo ); // inlined to avoid cyclic dependency on Vector3\n\t\t\t\tthis._x = vFrom.y * vTo.z - vFrom.z * vTo.y;\n\t\t\t\tthis._y = vFrom.z * vTo.x - vFrom.x * vTo.z;\n\t\t\t\tthis._z = vFrom.x * vTo.y - vFrom.y * vTo.x;\n\t\t\t\tthis._w = r;\n\t\t\t}\n\n\t\t\treturn this.normalize();\n\t\t}\n\n\t\tangleTo(q) {\n\t\t\treturn 2 * Math.acos(Math.abs(clamp(this.dot(q), -1, 1)));\n\t\t}\n\n\t\trotateTowards(q, step) {\n\t\t\tconst angle = this.angleTo(q);\n\t\t\tif (angle === 0) return this;\n\t\t\tconst t = Math.min(1, step / angle);\n\t\t\tthis.slerp(q, t);\n\t\t\treturn this;\n\t\t}\n\n\t\tidentity() {\n\t\t\treturn this.set(0, 0, 0, 1);\n\t\t}\n\n\t\tinvert() {\n\t\t\t// quaternion is assumed to have unit length\n\t\t\treturn this.conjugate();\n\t\t}\n\n\t\tconjugate() {\n\t\t\tthis._x *= -1;\n\t\t\tthis._y *= -1;\n\t\t\tthis._z *= -1;\n\n\t\t\tthis._onChangeCallback();\n\n\t\t\treturn this;\n\t\t}\n\n\t\tdot(v) {\n\t\t\treturn this._x * v._x + this._y * v._y + this._z * v._z + this._w * v._w;\n\t\t}\n\n\t\tlengthSq() {\n\t\t\treturn this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w;\n\t\t}\n\n\t\tlength() {\n\t\t\treturn Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w);\n\t\t}\n\n\t\tnormalize() {\n\t\t\tlet l = this.length();\n\n\t\t\tif (l === 0) {\n\t\t\t\tthis._x = 0;\n\t\t\t\tthis._y = 0;\n\t\t\t\tthis._z = 0;\n\t\t\t\tthis._w = 1;\n\t\t\t} else {\n\t\t\t\tl = 1 / l;\n\t\t\t\tthis._x = this._x * l;\n\t\t\t\tthis._y = this._y * l;\n\t\t\t\tthis._z = this._z * l;\n\t\t\t\tthis._w = this._w * l;\n\t\t\t}\n\n\t\t\tthis._onChangeCallback();\n\n\t\t\treturn this;\n\t\t}\n\n\t\tmultiply(q, p) {\n\t\t\tif (p !== undefined) {\n\t\t\t\tconsole.warn('THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead.');\n\t\t\t\treturn this.multiplyQuaternions(q, p);\n\t\t\t}\n\n\t\t\treturn this.multiplyQuaternions(this, q);\n\t\t}\n\n\t\tpremultiply(q) {\n\t\t\treturn this.multiplyQuaternions(q, this);\n\t\t}\n\n\t\tmultiplyQuaternions(a, b) {\n\t\t\t// from http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/code/index.htm\n\t\t\tconst qax = a._x,\n\t\t\t\t\t\tqay = a._y,\n\t\t\t\t\t\tqaz = a._z,\n\t\t\t\t\t\tqaw = a._w;\n\t\t\tconst qbx = b._x,\n\t\t\t\t\t\tqby = b._y,\n\t\t\t\t\t\tqbz = b._z,\n\t\t\t\t\t\tqbw = b._w;\n\t\t\tthis._x = qax * qbw + qaw * qbx + qay * qbz - qaz * qby;\n\t\t\tthis._y = qay * qbw + qaw * qby + qaz * qbx - qax * qbz;\n\t\t\tthis._z = qaz * qbw + qaw * qbz + qax * qby - qay * qbx;\n\t\t\tthis._w = qaw * qbw - qax * qbx - qay * qby - qaz * qbz;\n\n\t\t\tthis._onChangeCallback();\n\n\t\t\treturn this;\n\t\t}\n\n\t\tslerp(qb, t) {\n\t\t\tif (t === 0) return this;\n\t\t\tif (t === 1) return this.copy(qb);\n\t\t\tconst x = this._x,\n\t\t\t\t\t\ty = this._y,\n\t\t\t\t\t\tz = this._z,\n\t\t\t\t\t\tw = this._w; // http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/slerp/\n\n\t\t\tlet cosHalfTheta = w * qb._w + x * qb._x + y * qb._y + z * qb._z;\n\n\t\t\tif (cosHalfTheta < 0) {\n\t\t\t\tthis._w = -qb._w;\n\t\t\t\tthis._x = -qb._x;\n\t\t\t\tthis._y = -qb._y;\n\t\t\t\tthis._z = -qb._z;\n\t\t\t\tcosHalfTheta = -cosHalfTheta;\n\t\t\t} else {\n\t\t\t\tthis.copy(qb);\n\t\t\t}\n\n\t\t\tif (cosHalfTheta >= 1.0) {\n\t\t\t\tthis._w = w;\n\t\t\t\tthis._x = x;\n\t\t\t\tthis._y = y;\n\t\t\t\tthis._z = z;\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\tconst sqrSinHalfTheta = 1.0 - cosHalfTheta * cosHalfTheta;\n\n\t\t\tif (sqrSinHalfTheta <= Number.EPSILON) {\n\t\t\t\tconst s = 1 - t;\n\t\t\t\tthis._w = s * w + t * this._w;\n\t\t\t\tthis._x = s * x + t * this._x;\n\t\t\t\tthis._y = s * y + t * this._y;\n\t\t\t\tthis._z = s * z + t * this._z;\n\t\t\t\tthis.normalize();\n\n\t\t\t\tthis._onChangeCallback();\n\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\tconst sinHalfTheta = Math.sqrt(sqrSinHalfTheta);\n\t\t\tconst halfTheta = Math.atan2(sinHalfTheta, cosHalfTheta);\n\t\t\tconst ratioA = Math.sin((1 - t) * halfTheta) / sinHalfTheta,\n\t\t\t\t\t\tratioB = Math.sin(t * halfTheta) / sinHalfTheta;\n\t\t\tthis._w = w * ratioA + this._w * ratioB;\n\t\t\tthis._x = x * ratioA + this._x * ratioB;\n\t\t\tthis._y = y * ratioA + this._y * ratioB;\n\t\t\tthis._z = z * ratioA + this._z * ratioB;\n\n\t\t\tthis._onChangeCallback();\n\n\t\t\treturn this;\n\t\t}\n\n\t\tslerpQuaternions(qa, qb, t) {\n\t\t\tthis.copy(qa).slerp(qb, t);\n\t\t}\n\n\t\trandom() {\n\t\t\t// Derived from http://planning.cs.uiuc.edu/node198.html\n\t\t\t// Note, this source uses w, x, y, z ordering,\n\t\t\t// so we swap the order below.\n\t\t\tconst u1 = Math.random();\n\t\t\tconst sqrt1u1 = Math.sqrt(1 - u1);\n\t\t\tconst sqrtu1 = Math.sqrt(u1);\n\t\t\tconst u2 = 2 * Math.PI * Math.random();\n\t\t\tconst u3 = 2 * Math.PI * Math.random();\n\t\t\treturn this.set(sqrt1u1 * Math.cos(u2), sqrtu1 * Math.sin(u3), sqrtu1 * Math.cos(u3), sqrt1u1 * Math.sin(u2));\n\t\t}\n\n\t\tequals(quaternion) {\n\t\t\treturn quaternion._x === this._x && quaternion._y === this._y && quaternion._z === this._z && quaternion._w === this._w;\n\t\t}\n\n\t\tfromArray(array, offset = 0) {\n\t\t\tthis._x = array[offset];\n\t\t\tthis._y = array[offset + 1];\n\t\t\tthis._z = array[offset + 2];\n\t\t\tthis._w = array[offset + 3];\n\n\t\t\tthis._onChangeCallback();\n\n\t\t\treturn this;\n\t\t}\n\n\t\ttoArray(array = [], offset = 0) {\n\t\t\tarray[offset] = this._x;\n\t\t\tarray[offset + 1] = this._y;\n\t\t\tarray[offset + 2] = this._z;\n\t\t\tarray[offset + 3] = this._w;\n\t\t\treturn array;\n\t\t}\n\n\t\tfromBufferAttribute(attribute, index) {\n\t\t\tthis._x = attribute.getX(index);\n\t\t\tthis._y = attribute.getY(index);\n\t\t\tthis._z = attribute.getZ(index);\n\t\t\tthis._w = attribute.getW(index);\n\t\t\treturn this;\n\t\t}\n\n\t\t_onChange(callback) {\n\t\t\tthis._onChangeCallback = callback;\n\t\t\treturn this;\n\t\t}\n\n\t\t_onChangeCallback() {}\n\n\t}\n\n\tQuaternion.prototype.isQuaternion = true;\n\n\tclass Vector3 {\n\t\tconstructor(x = 0, y = 0, z = 0) {\n\t\t\tthis.x = x;\n\t\t\tthis.y = y;\n\t\t\tthis.z = z;\n\t\t}\n\n\t\tset(x, y, z) {\n\t\t\tif (z === undefined) z = this.z; // sprite.scale.set(x,y)\n\n\t\t\tthis.x = x;\n\t\t\tthis.y = y;\n\t\t\tthis.z = z;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetScalar(scalar) {\n\t\t\tthis.x = scalar;\n\t\t\tthis.y = scalar;\n\t\t\tthis.z = scalar;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetX(x) {\n\t\t\tthis.x = x;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetY(y) {\n\t\t\tthis.y = y;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetZ(z) {\n\t\t\tthis.z = z;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetComponent(index, value) {\n\t\t\tswitch (index) {\n\t\t\t\tcase 0:\n\t\t\t\t\tthis.x = value;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 1:\n\t\t\t\t\tthis.y = value;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 2:\n\t\t\t\t\tthis.z = value;\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Error('index is out of range: ' + index);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tgetComponent(index) {\n\t\t\tswitch (index) {\n\t\t\t\tcase 0:\n\t\t\t\t\treturn this.x;\n\n\t\t\t\tcase 1:\n\t\t\t\t\treturn this.y;\n\n\t\t\t\tcase 2:\n\t\t\t\t\treturn this.z;\n\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Error('index is out of range: ' + index);\n\t\t\t}\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new this.constructor(this.x, this.y, this.z);\n\t\t}\n\n\t\tcopy(v) {\n\t\t\tthis.x = v.x;\n\t\t\tthis.y = v.y;\n\t\t\tthis.z = v.z;\n\t\t\treturn this;\n\t\t}\n\n\t\tadd(v, w) {\n\t\t\tif (w !== undefined) {\n\t\t\t\tconsole.warn('THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead.');\n\t\t\t\treturn this.addVectors(v, w);\n\t\t\t}\n\n\t\t\tthis.x += v.x;\n\t\t\tthis.y += v.y;\n\t\t\tthis.z += v.z;\n\t\t\treturn this;\n\t\t}\n\n\t\taddScalar(s) {\n\t\t\tthis.x += s;\n\t\t\tthis.y += s;\n\t\t\tthis.z += s;\n\t\t\treturn this;\n\t\t}\n\n\t\taddVectors(a, b) {\n\t\t\tthis.x = a.x + b.x;\n\t\t\tthis.y = a.y + b.y;\n\t\t\tthis.z = a.z + b.z;\n\t\t\treturn this;\n\t\t}\n\n\t\taddScaledVector(v, s) {\n\t\t\tthis.x += v.x * s;\n\t\t\tthis.y += v.y * s;\n\t\t\tthis.z += v.z * s;\n\t\t\treturn this;\n\t\t}\n\n\t\tsub(v, w) {\n\t\t\tif (w !== undefined) {\n\t\t\t\tconsole.warn('THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.');\n\t\t\t\treturn this.subVectors(v, w);\n\t\t\t}\n\n\t\t\tthis.x -= v.x;\n\t\t\tthis.y -= v.y;\n\t\t\tthis.z -= v.z;\n\t\t\treturn this;\n\t\t}\n\n\t\tsubScalar(s) {\n\t\t\tthis.x -= s;\n\t\t\tthis.y -= s;\n\t\t\tthis.z -= s;\n\t\t\treturn this;\n\t\t}\n\n\t\tsubVectors(a, b) {\n\t\t\tthis.x = a.x - b.x;\n\t\t\tthis.y = a.y - b.y;\n\t\t\tthis.z = a.z - b.z;\n\t\t\treturn this;\n\t\t}\n\n\t\tmultiply(v, w) {\n\t\t\tif (w !== undefined) {\n\t\t\t\tconsole.warn('THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead.');\n\t\t\t\treturn this.multiplyVectors(v, w);\n\t\t\t}\n\n\t\t\tthis.x *= v.x;\n\t\t\tthis.y *= v.y;\n\t\t\tthis.z *= v.z;\n\t\t\treturn this;\n\t\t}\n\n\t\tmultiplyScalar(scalar) {\n\t\t\tthis.x *= scalar;\n\t\t\tthis.y *= scalar;\n\t\t\tthis.z *= scalar;\n\t\t\treturn this;\n\t\t}\n\n\t\tmultiplyVectors(a, b) {\n\t\t\tthis.x = a.x * b.x;\n\t\t\tthis.y = a.y * b.y;\n\t\t\tthis.z = a.z * b.z;\n\t\t\treturn this;\n\t\t}\n\n\t\tapplyEuler(euler) {\n\t\t\tif (!(euler && euler.isEuler)) {\n\t\t\t\tconsole.error('THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order.');\n\t\t\t}\n\n\t\t\treturn this.applyQuaternion(_quaternion$4.setFromEuler(euler));\n\t\t}\n\n\t\tapplyAxisAngle(axis, angle) {\n\t\t\treturn this.applyQuaternion(_quaternion$4.setFromAxisAngle(axis, angle));\n\t\t}\n\n\t\tapplyMatrix3(m) {\n\t\t\tconst x = this.x,\n\t\t\t\t\t\ty = this.y,\n\t\t\t\t\t\tz = this.z;\n\t\t\tconst e = m.elements;\n\t\t\tthis.x = e[0] * x + e[3] * y + e[6] * z;\n\t\t\tthis.y = e[1] * x + e[4] * y + e[7] * z;\n\t\t\tthis.z = e[2] * x + e[5] * y + e[8] * z;\n\t\t\treturn this;\n\t\t}\n\n\t\tapplyNormalMatrix(m) {\n\t\t\treturn this.applyMatrix3(m).normalize();\n\t\t}\n\n\t\tapplyMatrix4(m) {\n\t\t\tconst x = this.x,\n\t\t\t\t\t\ty = this.y,\n\t\t\t\t\t\tz = this.z;\n\t\t\tconst e = m.elements;\n\t\t\tconst w = 1 / (e[3] * x + e[7] * y + e[11] * z + e[15]);\n\t\t\tthis.x = (e[0] * x + e[4] * y + e[8] * z + e[12]) * w;\n\t\t\tthis.y = (e[1] * x + e[5] * y + e[9] * z + e[13]) * w;\n\t\t\tthis.z = (e[2] * x + e[6] * y + e[10] * z + e[14]) * w;\n\t\t\treturn this;\n\t\t}\n\n\t\tapplyQuaternion(q) {\n\t\t\tconst x = this.x,\n\t\t\t\t\t\ty = this.y,\n\t\t\t\t\t\tz = this.z;\n\t\t\tconst qx = q.x,\n\t\t\t\t\t\tqy = q.y,\n\t\t\t\t\t\tqz = q.z,\n\t\t\t\t\t\tqw = q.w; // calculate quat * vector\n\n\t\t\tconst ix = qw * x + qy * z - qz * y;\n\t\t\tconst iy = qw * y + qz * x - qx * z;\n\t\t\tconst iz = qw * z + qx * y - qy * x;\n\t\t\tconst iw = -qx * x - qy * y - qz * z; // calculate result * inverse quat\n\n\t\t\tthis.x = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n\t\t\tthis.y = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n\t\t\tthis.z = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n\t\t\treturn this;\n\t\t}\n\n\t\tproject(camera) {\n\t\t\treturn this.applyMatrix4(camera.matrixWorldInverse).applyMatrix4(camera.projectionMatrix);\n\t\t}\n\n\t\tunproject(camera) {\n\t\t\treturn this.applyMatrix4(camera.projectionMatrixInverse).applyMatrix4(camera.matrixWorld);\n\t\t}\n\n\t\ttransformDirection(m) {\n\t\t\t// input: THREE.Matrix4 affine matrix\n\t\t\t// vector interpreted as a direction\n\t\t\tconst x = this.x,\n\t\t\t\t\t\ty = this.y,\n\t\t\t\t\t\tz = this.z;\n\t\t\tconst e = m.elements;\n\t\t\tthis.x = e[0] * x + e[4] * y + e[8] * z;\n\t\t\tthis.y = e[1] * x + e[5] * y + e[9] * z;\n\t\t\tthis.z = e[2] * x + e[6] * y + e[10] * z;\n\t\t\treturn this.normalize();\n\t\t}\n\n\t\tdivide(v) {\n\t\t\tthis.x /= v.x;\n\t\t\tthis.y /= v.y;\n\t\t\tthis.z /= v.z;\n\t\t\treturn this;\n\t\t}\n\n\t\tdivideScalar(scalar) {\n\t\t\treturn this.multiplyScalar(1 / scalar);\n\t\t}\n\n\t\tmin(v) {\n\t\t\tthis.x = Math.min(this.x, v.x);\n\t\t\tthis.y = Math.min(this.y, v.y);\n\t\t\tthis.z = Math.min(this.z, v.z);\n\t\t\treturn this;\n\t\t}\n\n\t\tmax(v) {\n\t\t\tthis.x = Math.max(this.x, v.x);\n\t\t\tthis.y = Math.max(this.y, v.y);\n\t\t\tthis.z = Math.max(this.z, v.z);\n\t\t\treturn this;\n\t\t}\n\n\t\tclamp(min, max) {\n\t\t\t// assumes min < max, componentwise\n\t\t\tthis.x = Math.max(min.x, Math.min(max.x, this.x));\n\t\t\tthis.y = Math.max(min.y, Math.min(max.y, this.y));\n\t\t\tthis.z = Math.max(min.z, Math.min(max.z, this.z));\n\t\t\treturn this;\n\t\t}\n\n\t\tclampScalar(minVal, maxVal) {\n\t\t\tthis.x = Math.max(minVal, Math.min(maxVal, this.x));\n\t\t\tthis.y = Math.max(minVal, Math.min(maxVal, this.y));\n\t\t\tthis.z = Math.max(minVal, Math.min(maxVal, this.z));\n\t\t\treturn this;\n\t\t}\n\n\t\tclampLength(min, max) {\n\t\t\tconst length = this.length();\n\t\t\treturn this.divideScalar(length || 1).multiplyScalar(Math.max(min, Math.min(max, length)));\n\t\t}\n\n\t\tfloor() {\n\t\t\tthis.x = Math.floor(this.x);\n\t\t\tthis.y = Math.floor(this.y);\n\t\t\tthis.z = Math.floor(this.z);\n\t\t\treturn this;\n\t\t}\n\n\t\tceil() {\n\t\t\tthis.x = Math.ceil(this.x);\n\t\t\tthis.y = Math.ceil(this.y);\n\t\t\tthis.z = Math.ceil(this.z);\n\t\t\treturn this;\n\t\t}\n\n\t\tround() {\n\t\t\tthis.x = Math.round(this.x);\n\t\t\tthis.y = Math.round(this.y);\n\t\t\tthis.z = Math.round(this.z);\n\t\t\treturn this;\n\t\t}\n\n\t\troundToZero() {\n\t\t\tthis.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x);\n\t\t\tthis.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y);\n\t\t\tthis.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z);\n\t\t\treturn this;\n\t\t}\n\n\t\tnegate() {\n\t\t\tthis.x = -this.x;\n\t\t\tthis.y = -this.y;\n\t\t\tthis.z = -this.z;\n\t\t\treturn this;\n\t\t}\n\n\t\tdot(v) {\n\t\t\treturn this.x * v.x + this.y * v.y + this.z * v.z;\n\t\t} // TODO lengthSquared?\n\n\n\t\tlengthSq() {\n\t\t\treturn this.x * this.x + this.y * this.y + this.z * this.z;\n\t\t}\n\n\t\tlength() {\n\t\t\treturn Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);\n\t\t}\n\n\t\tmanhattanLength() {\n\t\t\treturn Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z);\n\t\t}\n\n\t\tnormalize() {\n\t\t\treturn this.divideScalar(this.length() || 1);\n\t\t}\n\n\t\tsetLength(length) {\n\t\t\treturn this.normalize().multiplyScalar(length);\n\t\t}\n\n\t\tlerp(v, alpha) {\n\t\t\tthis.x += (v.x - this.x) * alpha;\n\t\t\tthis.y += (v.y - this.y) * alpha;\n\t\t\tthis.z += (v.z - this.z) * alpha;\n\t\t\treturn this;\n\t\t}\n\n\t\tlerpVectors(v1, v2, alpha) {\n\t\t\tthis.x = v1.x + (v2.x - v1.x) * alpha;\n\t\t\tthis.y = v1.y + (v2.y - v1.y) * alpha;\n\t\t\tthis.z = v1.z + (v2.z - v1.z) * alpha;\n\t\t\treturn this;\n\t\t}\n\n\t\tcross(v, w) {\n\t\t\tif (w !== undefined) {\n\t\t\t\tconsole.warn('THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead.');\n\t\t\t\treturn this.crossVectors(v, w);\n\t\t\t}\n\n\t\t\treturn this.crossVectors(this, v);\n\t\t}\n\n\t\tcrossVectors(a, b) {\n\t\t\tconst ax = a.x,\n\t\t\t\t\t\tay = a.y,\n\t\t\t\t\t\taz = a.z;\n\t\t\tconst bx = b.x,\n\t\t\t\t\t\tby = b.y,\n\t\t\t\t\t\tbz = b.z;\n\t\t\tthis.x = ay * bz - az * by;\n\t\t\tthis.y = az * bx - ax * bz;\n\t\t\tthis.z = ax * by - ay * bx;\n\t\t\treturn this;\n\t\t}\n\n\t\tprojectOnVector(v) {\n\t\t\tconst denominator = v.lengthSq();\n\t\t\tif (denominator === 0) return this.set(0, 0, 0);\n\t\t\tconst scalar = v.dot(this) / denominator;\n\t\t\treturn this.copy(v).multiplyScalar(scalar);\n\t\t}\n\n\t\tprojectOnPlane(planeNormal) {\n\t\t\t_vector$c.copy(this).projectOnVector(planeNormal);\n\n\t\t\treturn this.sub(_vector$c);\n\t\t}\n\n\t\treflect(normal) {\n\t\t\t// reflect incident vector off plane orthogonal to normal\n\t\t\t// normal is assumed to have unit length\n\t\t\treturn this.sub(_vector$c.copy(normal).multiplyScalar(2 * this.dot(normal)));\n\t\t}\n\n\t\tangleTo(v) {\n\t\t\tconst denominator = Math.sqrt(this.lengthSq() * v.lengthSq());\n\t\t\tif (denominator === 0) return Math.PI / 2;\n\t\t\tconst theta = this.dot(v) / denominator; // clamp, to handle numerical problems\n\n\t\t\treturn Math.acos(clamp(theta, -1, 1));\n\t\t}\n\n\t\tdistanceTo(v) {\n\t\t\treturn Math.sqrt(this.distanceToSquared(v));\n\t\t}\n\n\t\tdistanceToSquared(v) {\n\t\t\tconst dx = this.x - v.x,\n\t\t\t\t\t\tdy = this.y - v.y,\n\t\t\t\t\t\tdz = this.z - v.z;\n\t\t\treturn dx * dx + dy * dy + dz * dz;\n\t\t}\n\n\t\tmanhattanDistanceTo(v) {\n\t\t\treturn Math.abs(this.x - v.x) + Math.abs(this.y - v.y) + Math.abs(this.z - v.z);\n\t\t}\n\n\t\tsetFromSpherical(s) {\n\t\t\treturn this.setFromSphericalCoords(s.radius, s.phi, s.theta);\n\t\t}\n\n\t\tsetFromSphericalCoords(radius, phi, theta) {\n\t\t\tconst sinPhiRadius = Math.sin(phi) * radius;\n\t\t\tthis.x = sinPhiRadius * Math.sin(theta);\n\t\t\tthis.y = Math.cos(phi) * radius;\n\t\t\tthis.z = sinPhiRadius * Math.cos(theta);\n\t\t\treturn this;\n\t\t}\n\n\t\tsetFromCylindrical(c) {\n\t\t\treturn this.setFromCylindricalCoords(c.radius, c.theta, c.y);\n\t\t}\n\n\t\tsetFromCylindricalCoords(radius, theta, y) {\n\t\t\tthis.x = radius * Math.sin(theta);\n\t\t\tthis.y = y;\n\t\t\tthis.z = radius * Math.cos(theta);\n\t\t\treturn this;\n\t\t}\n\n\t\tsetFromMatrixPosition(m) {\n\t\t\tconst e = m.elements;\n\t\t\tthis.x = e[12];\n\t\t\tthis.y = e[13];\n\t\t\tthis.z = e[14];\n\t\t\treturn this;\n\t\t}\n\n\t\tsetFromMatrixScale(m) {\n\t\t\tconst sx = this.setFromMatrixColumn(m, 0).length();\n\t\t\tconst sy = this.setFromMatrixColumn(m, 1).length();\n\t\t\tconst sz = this.setFromMatrixColumn(m, 2).length();\n\t\t\tthis.x = sx;\n\t\t\tthis.y = sy;\n\t\t\tthis.z = sz;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetFromMatrixColumn(m, index) {\n\t\t\treturn this.fromArray(m.elements, index * 4);\n\t\t}\n\n\t\tsetFromMatrix3Column(m, index) {\n\t\t\treturn this.fromArray(m.elements, index * 3);\n\t\t}\n\n\t\tequals(v) {\n\t\t\treturn v.x === this.x && v.y === this.y && v.z === this.z;\n\t\t}\n\n\t\tfromArray(array, offset = 0) {\n\t\t\tthis.x = array[offset];\n\t\t\tthis.y = array[offset + 1];\n\t\t\tthis.z = array[offset + 2];\n\t\t\treturn this;\n\t\t}\n\n\t\ttoArray(array = [], offset = 0) {\n\t\t\tarray[offset] = this.x;\n\t\t\tarray[offset + 1] = this.y;\n\t\t\tarray[offset + 2] = this.z;\n\t\t\treturn array;\n\t\t}\n\n\t\tfromBufferAttribute(attribute, index, offset) {\n\t\t\tif (offset !== undefined) {\n\t\t\t\tconsole.warn('THREE.Vector3: offset has been removed from .fromBufferAttribute().');\n\t\t\t}\n\n\t\t\tthis.x = attribute.getX(index);\n\t\t\tthis.y = attribute.getY(index);\n\t\t\tthis.z = attribute.getZ(index);\n\t\t\treturn this;\n\t\t}\n\n\t\trandom() {\n\t\t\tthis.x = Math.random();\n\t\t\tthis.y = Math.random();\n\t\t\tthis.z = Math.random();\n\t\t\treturn this;\n\t\t}\n\n\t\trandomDirection() {\n\t\t\t// Derived from https://mathworld.wolfram.com/SpherePointPicking.html\n\t\t\tconst u = (Math.random() - 0.5) * 2;\n\t\t\tconst t = Math.random() * Math.PI * 2;\n\t\t\tconst f = Math.sqrt(1 - u ** 2);\n\t\t\tthis.x = f * Math.cos(t);\n\t\t\tthis.y = f * Math.sin(t);\n\t\t\tthis.z = u;\n\t\t\treturn this;\n\t\t}\n\n\t\t*[Symbol.iterator]() {\n\t\t\tyield this.x;\n\t\t\tyield this.y;\n\t\t\tyield this.z;\n\t\t}\n\n\t}\n\n\tVector3.prototype.isVector3 = true;\n\n\tconst _vector$c = /*@__PURE__*/new Vector3();\n\n\tconst _quaternion$4 = /*@__PURE__*/new Quaternion();\n\n\tclass Box3 {\n\t\tconstructor(min = new Vector3(+Infinity, +Infinity, +Infinity), max = new Vector3(-Infinity, -Infinity, -Infinity)) {\n\t\t\tthis.min = min;\n\t\t\tthis.max = max;\n\t\t}\n\n\t\tset(min, max) {\n\t\t\tthis.min.copy(min);\n\t\t\tthis.max.copy(max);\n\t\t\treturn this;\n\t\t}\n\n\t\tsetFromArray(array) {\n\t\t\tlet minX = +Infinity;\n\t\t\tlet minY = +Infinity;\n\t\t\tlet minZ = +Infinity;\n\t\t\tlet maxX = -Infinity;\n\t\t\tlet maxY = -Infinity;\n\t\t\tlet maxZ = -Infinity;\n\n\t\t\tfor (let i = 0, l = array.length; i < l; i += 3) {\n\t\t\t\tconst x = array[i];\n\t\t\t\tconst y = array[i + 1];\n\t\t\t\tconst z = array[i + 2];\n\t\t\t\tif (x < minX) minX = x;\n\t\t\t\tif (y < minY) minY = y;\n\t\t\t\tif (z < minZ) minZ = z;\n\t\t\t\tif (x > maxX) maxX = x;\n\t\t\t\tif (y > maxY) maxY = y;\n\t\t\t\tif (z > maxZ) maxZ = z;\n\t\t\t}\n\n\t\t\tthis.min.set(minX, minY, minZ);\n\t\t\tthis.max.set(maxX, maxY, maxZ);\n\t\t\treturn this;\n\t\t}\n\n\t\tsetFromBufferAttribute(attribute) {\n\t\t\tlet minX = +Infinity;\n\t\t\tlet minY = +Infinity;\n\t\t\tlet minZ = +Infinity;\n\t\t\tlet maxX = -Infinity;\n\t\t\tlet maxY = -Infinity;\n\t\t\tlet maxZ = -Infinity;\n\n\t\t\tfor (let i = 0, l = attribute.count; i < l; i++) {\n\t\t\t\tconst x = attribute.getX(i);\n\t\t\t\tconst y = attribute.getY(i);\n\t\t\t\tconst z = attribute.getZ(i);\n\t\t\t\tif (x < minX) minX = x;\n\t\t\t\tif (y < minY) minY = y;\n\t\t\t\tif (z < minZ) minZ = z;\n\t\t\t\tif (x > maxX) maxX = x;\n\t\t\t\tif (y > maxY) maxY = y;\n\t\t\t\tif (z > maxZ) maxZ = z;\n\t\t\t}\n\n\t\t\tthis.min.set(minX, minY, minZ);\n\t\t\tthis.max.set(maxX, maxY, maxZ);\n\t\t\treturn this;\n\t\t}\n\n\t\tsetFromPoints(points) {\n\t\t\tthis.makeEmpty();\n\n\t\t\tfor (let i = 0, il = points.length; i < il; i++) {\n\t\t\t\tthis.expandByPoint(points[i]);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tsetFromCenterAndSize(center, size) {\n\t\t\tconst halfSize = _vector$b.copy(size).multiplyScalar(0.5);\n\n\t\t\tthis.min.copy(center).sub(halfSize);\n\t\t\tthis.max.copy(center).add(halfSize);\n\t\t\treturn this;\n\t\t}\n\n\t\tsetFromObject(object) {\n\t\t\tthis.makeEmpty();\n\t\t\treturn this.expandByObject(object);\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new this.constructor().copy(this);\n\t\t}\n\n\t\tcopy(box) {\n\t\t\tthis.min.copy(box.min);\n\t\t\tthis.max.copy(box.max);\n\t\t\treturn this;\n\t\t}\n\n\t\tmakeEmpty() {\n\t\t\tthis.min.x = this.min.y = this.min.z = +Infinity;\n\t\t\tthis.max.x = this.max.y = this.max.z = -Infinity;\n\t\t\treturn this;\n\t\t}\n\n\t\tisEmpty() {\n\t\t\t// this is a more robust check for empty than ( volume <= 0 ) because volume can get positive with two negative axes\n\t\t\treturn this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z;\n\t\t}\n\n\t\tgetCenter(target) {\n\t\t\treturn this.isEmpty() ? target.set(0, 0, 0) : target.addVectors(this.min, this.max).multiplyScalar(0.5);\n\t\t}\n\n\t\tgetSize(target) {\n\t\t\treturn this.isEmpty() ? target.set(0, 0, 0) : target.subVectors(this.max, this.min);\n\t\t}\n\n\t\texpandByPoint(point) {\n\t\t\tthis.min.min(point);\n\t\t\tthis.max.max(point);\n\t\t\treturn this;\n\t\t}\n\n\t\texpandByVector(vector) {\n\t\t\tthis.min.sub(vector);\n\t\t\tthis.max.add(vector);\n\t\t\treturn this;\n\t\t}\n\n\t\texpandByScalar(scalar) {\n\t\t\tthis.min.addScalar(-scalar);\n\t\t\tthis.max.addScalar(scalar);\n\t\t\treturn this;\n\t\t}\n\n\t\texpandByObject(object) {\n\t\t\t// Computes the world-axis-aligned bounding box of an object (including its children),\n\t\t\t// accounting for both the object's, and children's, world transforms\n\t\t\tobject.updateWorldMatrix(false, false);\n\t\t\tconst geometry = object.geometry;\n\n\t\t\tif (geometry !== undefined) {\n\t\t\t\tif (geometry.boundingBox === null) {\n\t\t\t\t\tgeometry.computeBoundingBox();\n\t\t\t\t}\n\n\t\t\t\t_box$3.copy(geometry.boundingBox);\n\n\t\t\t\t_box$3.applyMatrix4(object.matrixWorld);\n\n\t\t\t\tthis.union(_box$3);\n\t\t\t}\n\n\t\t\tconst children = object.children;\n\n\t\t\tfor (let i = 0, l = children.length; i < l; i++) {\n\t\t\t\tthis.expandByObject(children[i]);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tcontainsPoint(point) {\n\t\t\treturn point.x < this.min.x || point.x > this.max.x || point.y < this.min.y || point.y > this.max.y || point.z < this.min.z || point.z > this.max.z ? false : true;\n\t\t}\n\n\t\tcontainsBox(box) {\n\t\t\treturn this.min.x <= box.min.x && box.max.x <= this.max.x && this.min.y <= box.min.y && box.max.y <= this.max.y && this.min.z <= box.min.z && box.max.z <= this.max.z;\n\t\t}\n\n\t\tgetParameter(point, target) {\n\t\t\t// This can potentially have a divide by zero if the box\n\t\t\t// has a size dimension of 0.\n\t\t\treturn target.set((point.x - this.min.x) / (this.max.x - this.min.x), (point.y - this.min.y) / (this.max.y - this.min.y), (point.z - this.min.z) / (this.max.z - this.min.z));\n\t\t}\n\n\t\tintersectsBox(box) {\n\t\t\t// using 6 splitting planes to rule out intersections.\n\t\t\treturn box.max.x < this.min.x || box.min.x > this.max.x || box.max.y < this.min.y || box.min.y > this.max.y || box.max.z < this.min.z || box.min.z > this.max.z ? false : true;\n\t\t}\n\n\t\tintersectsSphere(sphere) {\n\t\t\t// Find the point on the AABB closest to the sphere center.\n\t\t\tthis.clampPoint(sphere.center, _vector$b); // If that point is inside the sphere, the AABB and sphere intersect.\n\n\t\t\treturn _vector$b.distanceToSquared(sphere.center) <= sphere.radius * sphere.radius;\n\t\t}\n\n\t\tintersectsPlane(plane) {\n\t\t\t// We compute the minimum and maximum dot product values. If those values\n\t\t\t// are on the same side (back or front) of the plane, then there is no intersection.\n\t\t\tlet min, max;\n\n\t\t\tif (plane.normal.x > 0) {\n\t\t\t\tmin = plane.normal.x * this.min.x;\n\t\t\t\tmax = plane.normal.x * this.max.x;\n\t\t\t} else {\n\t\t\t\tmin = plane.normal.x * this.max.x;\n\t\t\t\tmax = plane.normal.x * this.min.x;\n\t\t\t}\n\n\t\t\tif (plane.normal.y > 0) {\n\t\t\t\tmin += plane.normal.y * this.min.y;\n\t\t\t\tmax += plane.normal.y * this.max.y;\n\t\t\t} else {\n\t\t\t\tmin += plane.normal.y * this.max.y;\n\t\t\t\tmax += plane.normal.y * this.min.y;\n\t\t\t}\n\n\t\t\tif (plane.normal.z > 0) {\n\t\t\t\tmin += plane.normal.z * this.min.z;\n\t\t\t\tmax += plane.normal.z * this.max.z;\n\t\t\t} else {\n\t\t\t\tmin += plane.normal.z * this.max.z;\n\t\t\t\tmax += plane.normal.z * this.min.z;\n\t\t\t}\n\n\t\t\treturn min <= -plane.constant && max >= -plane.constant;\n\t\t}\n\n\t\tintersectsTriangle(triangle) {\n\t\t\tif (this.isEmpty()) {\n\t\t\t\treturn false;\n\t\t\t} // compute box center and extents\n\n\n\t\t\tthis.getCenter(_center);\n\n\t\t\t_extents.subVectors(this.max, _center); // translate triangle to aabb origin\n\n\n\t\t\t_v0$2.subVectors(triangle.a, _center);\n\n\t\t\t_v1$7.subVectors(triangle.b, _center);\n\n\t\t\t_v2$3.subVectors(triangle.c, _center); // compute edge vectors for triangle\n\n\n\t\t\t_f0.subVectors(_v1$7, _v0$2);\n\n\t\t\t_f1.subVectors(_v2$3, _v1$7);\n\n\t\t\t_f2.subVectors(_v0$2, _v2$3); // test against axes that are given by cross product combinations of the edges of the triangle and the edges of the aabb\n\t\t\t// make an axis testing of each of the 3 sides of the aabb against each of the 3 sides of the triangle = 9 axis of separation\n\t\t\t// axis_ij = u_i x f_j (u0, u1, u2 = face normals of aabb = x,y,z axes vectors since aabb is axis aligned)\n\n\n\t\t\tlet axes = [0, -_f0.z, _f0.y, 0, -_f1.z, _f1.y, 0, -_f2.z, _f2.y, _f0.z, 0, -_f0.x, _f1.z, 0, -_f1.x, _f2.z, 0, -_f2.x, -_f0.y, _f0.x, 0, -_f1.y, _f1.x, 0, -_f2.y, _f2.x, 0];\n\n\t\t\tif (!satForAxes(axes, _v0$2, _v1$7, _v2$3, _extents)) {\n\t\t\t\treturn false;\n\t\t\t} // test 3 face normals from the aabb\n\n\n\t\t\taxes = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n\n\t\t\tif (!satForAxes(axes, _v0$2, _v1$7, _v2$3, _extents)) {\n\t\t\t\treturn false;\n\t\t\t} // finally testing the face normal of the triangle\n\t\t\t// use already existing triangle edge vectors here\n\n\n\t\t\t_triangleNormal.crossVectors(_f0, _f1);\n\n\t\t\taxes = [_triangleNormal.x, _triangleNormal.y, _triangleNormal.z];\n\t\t\treturn satForAxes(axes, _v0$2, _v1$7, _v2$3, _extents);\n\t\t}\n\n\t\tclampPoint(point, target) {\n\t\t\treturn target.copy(point).clamp(this.min, this.max);\n\t\t}\n\n\t\tdistanceToPoint(point) {\n\t\t\tconst clampedPoint = _vector$b.copy(point).clamp(this.min, this.max);\n\n\t\t\treturn clampedPoint.sub(point).length();\n\t\t}\n\n\t\tgetBoundingSphere(target) {\n\t\t\tthis.getCenter(target.center);\n\t\t\ttarget.radius = this.getSize(_vector$b).length() * 0.5;\n\t\t\treturn target;\n\t\t}\n\n\t\tintersect(box) {\n\t\t\tthis.min.max(box.min);\n\t\t\tthis.max.min(box.max); // ensure that if there is no overlap, the result is fully empty, not slightly empty with non-inf/+inf values that will cause subsequence intersects to erroneously return valid values.\n\n\t\t\tif (this.isEmpty()) this.makeEmpty();\n\t\t\treturn this;\n\t\t}\n\n\t\tunion(box) {\n\t\t\tthis.min.min(box.min);\n\t\t\tthis.max.max(box.max);\n\t\t\treturn this;\n\t\t}\n\n\t\tapplyMatrix4(matrix) {\n\t\t\t// transform of empty box is an empty box.\n\t\t\tif (this.isEmpty()) return this; // NOTE: I am using a binary pattern to specify all 2^3 combinations below\n\n\t\t\t_points[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(matrix); // 000\n\n\n\t\t\t_points[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(matrix); // 001\n\n\n\t\t\t_points[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(matrix); // 010\n\n\n\t\t\t_points[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(matrix); // 011\n\n\n\t\t\t_points[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(matrix); // 100\n\n\n\t\t\t_points[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(matrix); // 101\n\n\n\t\t\t_points[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(matrix); // 110\n\n\n\t\t\t_points[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(matrix); // 111\n\n\n\t\t\tthis.setFromPoints(_points);\n\t\t\treturn this;\n\t\t}\n\n\t\ttranslate(offset) {\n\t\t\tthis.min.add(offset);\n\t\t\tthis.max.add(offset);\n\t\t\treturn this;\n\t\t}\n\n\t\tequals(box) {\n\t\t\treturn box.min.equals(this.min) && box.max.equals(this.max);\n\t\t}\n\n\t}\n\n\tBox3.prototype.isBox3 = true;\n\tconst _points = [/*@__PURE__*/new Vector3(), /*@__PURE__*/new Vector3(), /*@__PURE__*/new Vector3(), /*@__PURE__*/new Vector3(), /*@__PURE__*/new Vector3(), /*@__PURE__*/new Vector3(), /*@__PURE__*/new Vector3(), /*@__PURE__*/new Vector3()];\n\n\tconst _vector$b = /*@__PURE__*/new Vector3();\n\n\tconst _box$3 = /*@__PURE__*/new Box3(); // triangle centered vertices\n\n\n\tconst _v0$2 = /*@__PURE__*/new Vector3();\n\n\tconst _v1$7 = /*@__PURE__*/new Vector3();\n\n\tconst _v2$3 = /*@__PURE__*/new Vector3(); // triangle edge vectors\n\n\n\tconst _f0 = /*@__PURE__*/new Vector3();\n\n\tconst _f1 = /*@__PURE__*/new Vector3();\n\n\tconst _f2 = /*@__PURE__*/new Vector3();\n\n\tconst _center = /*@__PURE__*/new Vector3();\n\n\tconst _extents = /*@__PURE__*/new Vector3();\n\n\tconst _triangleNormal = /*@__PURE__*/new Vector3();\n\n\tconst _testAxis = /*@__PURE__*/new Vector3();\n\n\tfunction satForAxes(axes, v0, v1, v2, extents) {\n\t\tfor (let i = 0, j = axes.length - 3; i <= j; i += 3) {\n\t\t\t_testAxis.fromArray(axes, i); // project the aabb onto the seperating axis\n\n\n\t\t\tconst r = extents.x * Math.abs(_testAxis.x) + extents.y * Math.abs(_testAxis.y) + extents.z * Math.abs(_testAxis.z); // project all 3 vertices of the triangle onto the seperating axis\n\n\t\t\tconst p0 = v0.dot(_testAxis);\n\t\t\tconst p1 = v1.dot(_testAxis);\n\t\t\tconst p2 = v2.dot(_testAxis); // actual test, basically see if either of the most extreme of the triangle points intersects r\n\n\t\t\tif (Math.max(-Math.max(p0, p1, p2), Math.min(p0, p1, p2)) > r) {\n\t\t\t\t// points of the projected triangle are outside the projected half-length of the aabb\n\t\t\t\t// the axis is seperating and we can exit\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tconst _box$2 = /*@__PURE__*/new Box3();\n\n\tconst _v1$6 = /*@__PURE__*/new Vector3();\n\n\tconst _toFarthestPoint = /*@__PURE__*/new Vector3();\n\n\tconst _toPoint = /*@__PURE__*/new Vector3();\n\n\tclass Sphere {\n\t\tconstructor(center = new Vector3(), radius = -1) {\n\t\t\tthis.center = center;\n\t\t\tthis.radius = radius;\n\t\t}\n\n\t\tset(center, radius) {\n\t\t\tthis.center.copy(center);\n\t\t\tthis.radius = radius;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetFromPoints(points, optionalCenter) {\n\t\t\tconst center = this.center;\n\n\t\t\tif (optionalCenter !== undefined) {\n\t\t\t\tcenter.copy(optionalCenter);\n\t\t\t} else {\n\t\t\t\t_box$2.setFromPoints(points).getCenter(center);\n\t\t\t}\n\n\t\t\tlet maxRadiusSq = 0;\n\n\t\t\tfor (let i = 0, il = points.length; i < il; i++) {\n\t\t\t\tmaxRadiusSq = Math.max(maxRadiusSq, center.distanceToSquared(points[i]));\n\t\t\t}\n\n\t\t\tthis.radius = Math.sqrt(maxRadiusSq);\n\t\t\treturn this;\n\t\t}\n\n\t\tcopy(sphere) {\n\t\t\tthis.center.copy(sphere.center);\n\t\t\tthis.radius = sphere.radius;\n\t\t\treturn this;\n\t\t}\n\n\t\tisEmpty() {\n\t\t\treturn this.radius < 0;\n\t\t}\n\n\t\tmakeEmpty() {\n\t\t\tthis.center.set(0, 0, 0);\n\t\t\tthis.radius = -1;\n\t\t\treturn this;\n\t\t}\n\n\t\tcontainsPoint(point) {\n\t\t\treturn point.distanceToSquared(this.center) <= this.radius * this.radius;\n\t\t}\n\n\t\tdistanceToPoint(point) {\n\t\t\treturn point.distanceTo(this.center) - this.radius;\n\t\t}\n\n\t\tintersectsSphere(sphere) {\n\t\t\tconst radiusSum = this.radius + sphere.radius;\n\t\t\treturn sphere.center.distanceToSquared(this.center) <= radiusSum * radiusSum;\n\t\t}\n\n\t\tintersectsBox(box) {\n\t\t\treturn box.intersectsSphere(this);\n\t\t}\n\n\t\tintersectsPlane(plane) {\n\t\t\treturn Math.abs(plane.distanceToPoint(this.center)) <= this.radius;\n\t\t}\n\n\t\tclampPoint(point, target) {\n\t\t\tconst deltaLengthSq = this.center.distanceToSquared(point);\n\t\t\ttarget.copy(point);\n\n\t\t\tif (deltaLengthSq > this.radius * this.radius) {\n\t\t\t\ttarget.sub(this.center).normalize();\n\t\t\t\ttarget.multiplyScalar(this.radius).add(this.center);\n\t\t\t}\n\n\t\t\treturn target;\n\t\t}\n\n\t\tgetBoundingBox(target) {\n\t\t\tif (this.isEmpty()) {\n\t\t\t\t// Empty sphere produces empty bounding box\n\t\t\t\ttarget.makeEmpty();\n\t\t\t\treturn target;\n\t\t\t}\n\n\t\t\ttarget.set(this.center, this.center);\n\t\t\ttarget.expandByScalar(this.radius);\n\t\t\treturn target;\n\t\t}\n\n\t\tapplyMatrix4(matrix) {\n\t\t\tthis.center.applyMatrix4(matrix);\n\t\t\tthis.radius = this.radius * matrix.getMaxScaleOnAxis();\n\t\t\treturn this;\n\t\t}\n\n\t\ttranslate(offset) {\n\t\t\tthis.center.add(offset);\n\t\t\treturn this;\n\t\t}\n\n\t\texpandByPoint(point) {\n\t\t\t// from https://github.com/juj/MathGeoLib/blob/2940b99b99cfe575dd45103ef20f4019dee15b54/src/Geometry/Sphere.cpp#L649-L671\n\t\t\t_toPoint.subVectors(point, this.center);\n\n\t\t\tconst lengthSq = _toPoint.lengthSq();\n\n\t\t\tif (lengthSq > this.radius * this.radius) {\n\t\t\t\tconst length = Math.sqrt(lengthSq);\n\t\t\t\tconst missingRadiusHalf = (length - this.radius) * 0.5; // Nudge this sphere towards the target point. Add half the missing distance to radius,\n\t\t\t\t// and the other half to position. This gives a tighter enclosure, instead of if\n\t\t\t\t// the whole missing distance were just added to radius.\n\n\t\t\t\tthis.center.add(_toPoint.multiplyScalar(missingRadiusHalf / length));\n\t\t\t\tthis.radius += missingRadiusHalf;\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tunion(sphere) {\n\t\t\t// from https://github.com/juj/MathGeoLib/blob/2940b99b99cfe575dd45103ef20f4019dee15b54/src/Geometry/Sphere.cpp#L759-L769\n\t\t\t// To enclose another sphere into this sphere, we only need to enclose two points:\n\t\t\t// 1) Enclose the farthest point on the other sphere into this sphere.\n\t\t\t// 2) Enclose the opposite point of the farthest point into this sphere.\n\t\t\t_toFarthestPoint.subVectors(sphere.center, this.center).normalize().multiplyScalar(sphere.radius);\n\n\t\t\tthis.expandByPoint(_v1$6.copy(sphere.center).add(_toFarthestPoint));\n\t\t\tthis.expandByPoint(_v1$6.copy(sphere.center).sub(_toFarthestPoint));\n\t\t\treturn this;\n\t\t}\n\n\t\tequals(sphere) {\n\t\t\treturn sphere.center.equals(this.center) && sphere.radius === this.radius;\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new this.constructor().copy(this);\n\t\t}\n\n\t}\n\n\tconst _vector$a = /*@__PURE__*/new Vector3();\n\n\tconst _segCenter = /*@__PURE__*/new Vector3();\n\n\tconst _segDir = /*@__PURE__*/new Vector3();\n\n\tconst _diff = /*@__PURE__*/new Vector3();\n\n\tconst _edge1 = /*@__PURE__*/new Vector3();\n\n\tconst _edge2 = /*@__PURE__*/new Vector3();\n\n\tconst _normal$1 = /*@__PURE__*/new Vector3();\n\n\tclass Ray {\n\t\tconstructor(origin = new Vector3(), direction = new Vector3(0, 0, -1)) {\n\t\t\tthis.origin = origin;\n\t\t\tthis.direction = direction;\n\t\t}\n\n\t\tset(origin, direction) {\n\t\t\tthis.origin.copy(origin);\n\t\t\tthis.direction.copy(direction);\n\t\t\treturn this;\n\t\t}\n\n\t\tcopy(ray) {\n\t\t\tthis.origin.copy(ray.origin);\n\t\t\tthis.direction.copy(ray.direction);\n\t\t\treturn this;\n\t\t}\n\n\t\tat(t, target) {\n\t\t\treturn target.copy(this.direction).multiplyScalar(t).add(this.origin);\n\t\t}\n\n\t\tlookAt(v) {\n\t\t\tthis.direction.copy(v).sub(this.origin).normalize();\n\t\t\treturn this;\n\t\t}\n\n\t\trecast(t) {\n\t\t\tthis.origin.copy(this.at(t, _vector$a));\n\t\t\treturn this;\n\t\t}\n\n\t\tclosestPointToPoint(point, target) {\n\t\t\ttarget.subVectors(point, this.origin);\n\t\t\tconst directionDistance = target.dot(this.direction);\n\n\t\t\tif (directionDistance < 0) {\n\t\t\t\treturn target.copy(this.origin);\n\t\t\t}\n\n\t\t\treturn target.copy(this.direction).multiplyScalar(directionDistance).add(this.origin);\n\t\t}\n\n\t\tdistanceToPoint(point) {\n\t\t\treturn Math.sqrt(this.distanceSqToPoint(point));\n\t\t}\n\n\t\tdistanceSqToPoint(point) {\n\t\t\tconst directionDistance = _vector$a.subVectors(point, this.origin).dot(this.direction); // point behind the ray\n\n\n\t\t\tif (directionDistance < 0) {\n\t\t\t\treturn this.origin.distanceToSquared(point);\n\t\t\t}\n\n\t\t\t_vector$a.copy(this.direction).multiplyScalar(directionDistance).add(this.origin);\n\n\t\t\treturn _vector$a.distanceToSquared(point);\n\t\t}\n\n\t\tdistanceSqToSegment(v0, v1, optionalPointOnRay, optionalPointOnSegment) {\n\t\t\t// from http://www.geometrictools.com/GTEngine/Include/Mathematics/GteDistRaySegment.h\n\t\t\t// It returns the min distance between the ray and the segment\n\t\t\t// defined by v0 and v1\n\t\t\t// It can also set two optional targets :\n\t\t\t// - The closest point on the ray\n\t\t\t// - The closest point on the segment\n\t\t\t_segCenter.copy(v0).add(v1).multiplyScalar(0.5);\n\n\t\t\t_segDir.copy(v1).sub(v0).normalize();\n\n\t\t\t_diff.copy(this.origin).sub(_segCenter);\n\n\t\t\tconst segExtent = v0.distanceTo(v1) * 0.5;\n\t\t\tconst a01 = -this.direction.dot(_segDir);\n\n\t\t\tconst b0 = _diff.dot(this.direction);\n\n\t\t\tconst b1 = -_diff.dot(_segDir);\n\n\t\t\tconst c = _diff.lengthSq();\n\n\t\t\tconst det = Math.abs(1 - a01 * a01);\n\t\t\tlet s0, s1, sqrDist, extDet;\n\n\t\t\tif (det > 0) {\n\t\t\t\t// The ray and segment are not parallel.\n\t\t\t\ts0 = a01 * b1 - b0;\n\t\t\t\ts1 = a01 * b0 - b1;\n\t\t\t\textDet = segExtent * det;\n\n\t\t\t\tif (s0 >= 0) {\n\t\t\t\t\tif (s1 >= -extDet) {\n\t\t\t\t\t\tif (s1 <= extDet) {\n\t\t\t\t\t\t\t// region 0\n\t\t\t\t\t\t\t// Minimum at interior points of ray and segment.\n\t\t\t\t\t\t\tconst invDet = 1 / det;\n\t\t\t\t\t\t\ts0 *= invDet;\n\t\t\t\t\t\t\ts1 *= invDet;\n\t\t\t\t\t\t\tsqrDist = s0 * (s0 + a01 * s1 + 2 * b0) + s1 * (a01 * s0 + s1 + 2 * b1) + c;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// region 1\n\t\t\t\t\t\t\ts1 = segExtent;\n\t\t\t\t\t\t\ts0 = Math.max(0, -(a01 * s1 + b0));\n\t\t\t\t\t\t\tsqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// region 5\n\t\t\t\t\t\ts1 = -segExtent;\n\t\t\t\t\t\ts0 = Math.max(0, -(a01 * s1 + b0));\n\t\t\t\t\t\tsqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (s1 <= -extDet) {\n\t\t\t\t\t\t// region 4\n\t\t\t\t\t\ts0 = Math.max(0, -(-a01 * segExtent + b0));\n\t\t\t\t\t\ts1 = s0 > 0 ? -segExtent : Math.min(Math.max(-segExtent, -b1), segExtent);\n\t\t\t\t\t\tsqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c;\n\t\t\t\t\t} else if (s1 <= extDet) {\n\t\t\t\t\t\t// region 3\n\t\t\t\t\t\ts0 = 0;\n\t\t\t\t\t\ts1 = Math.min(Math.max(-segExtent, -b1), segExtent);\n\t\t\t\t\t\tsqrDist = s1 * (s1 + 2 * b1) + c;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// region 2\n\t\t\t\t\t\ts0 = Math.max(0, -(a01 * segExtent + b0));\n\t\t\t\t\t\ts1 = s0 > 0 ? segExtent : Math.min(Math.max(-segExtent, -b1), segExtent);\n\t\t\t\t\t\tsqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Ray and segment are parallel.\n\t\t\t\ts1 = a01 > 0 ? -segExtent : segExtent;\n\t\t\t\ts0 = Math.max(0, -(a01 * s1 + b0));\n\t\t\t\tsqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c;\n\t\t\t}\n\n\t\t\tif (optionalPointOnRay) {\n\t\t\t\toptionalPointOnRay.copy(this.direction).multiplyScalar(s0).add(this.origin);\n\t\t\t}\n\n\t\t\tif (optionalPointOnSegment) {\n\t\t\t\toptionalPointOnSegment.copy(_segDir).multiplyScalar(s1).add(_segCenter);\n\t\t\t}\n\n\t\t\treturn sqrDist;\n\t\t}\n\n\t\tintersectSphere(sphere, target) {\n\t\t\t_vector$a.subVectors(sphere.center, this.origin);\n\n\t\t\tconst tca = _vector$a.dot(this.direction);\n\n\t\t\tconst d2 = _vector$a.dot(_vector$a) - tca * tca;\n\t\t\tconst radius2 = sphere.radius * sphere.radius;\n\t\t\tif (d2 > radius2) return null;\n\t\t\tconst thc = Math.sqrt(radius2 - d2); // t0 = first intersect point - entrance on front of sphere\n\n\t\t\tconst t0 = tca - thc; // t1 = second intersect point - exit point on back of sphere\n\n\t\t\tconst t1 = tca + thc; // test to see if both t0 and t1 are behind the ray - if so, return null\n\n\t\t\tif (t0 < 0 && t1 < 0) return null; // test to see if t0 is behind the ray:\n\t\t\t// if it is, the ray is inside the sphere, so return the second exit point scaled by t1,\n\t\t\t// in order to always return an intersect point that is in front of the ray.\n\n\t\t\tif (t0 < 0) return this.at(t1, target); // else t0 is in front of the ray, so return the first collision point scaled by t0\n\n\t\t\treturn this.at(t0, target);\n\t\t}\n\n\t\tintersectsSphere(sphere) {\n\t\t\treturn this.distanceSqToPoint(sphere.center) <= sphere.radius * sphere.radius;\n\t\t}\n\n\t\tdistanceToPlane(plane) {\n\t\t\tconst denominator = plane.normal.dot(this.direction);\n\n\t\t\tif (denominator === 0) {\n\t\t\t\t// line is coplanar, return origin\n\t\t\t\tif (plane.distanceToPoint(this.origin) === 0) {\n\t\t\t\t\treturn 0;\n\t\t\t\t} // Null is preferable to undefined since undefined means.... it is undefined\n\n\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst t = -(this.origin.dot(plane.normal) + plane.constant) / denominator; // Return if the ray never intersects the plane\n\n\t\t\treturn t >= 0 ? t : null;\n\t\t}\n\n\t\tintersectPlane(plane, target) {\n\t\t\tconst t = this.distanceToPlane(plane);\n\n\t\t\tif (t === null) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\treturn this.at(t, target);\n\t\t}\n\n\t\tintersectsPlane(plane) {\n\t\t\t// check if the ray lies on the plane first\n\t\t\tconst distToPoint = plane.distanceToPoint(this.origin);\n\n\t\t\tif (distToPoint === 0) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tconst denominator = plane.normal.dot(this.direction);\n\n\t\t\tif (denominator * distToPoint < 0) {\n\t\t\t\treturn true;\n\t\t\t} // ray origin is behind the plane (and is pointing behind it)\n\n\n\t\t\treturn false;\n\t\t}\n\n\t\tintersectBox(box, target) {\n\t\t\tlet tmin, tmax, tymin, tymax, tzmin, tzmax;\n\t\t\tconst invdirx = 1 / this.direction.x,\n\t\t\t\t\t\tinvdiry = 1 / this.direction.y,\n\t\t\t\t\t\tinvdirz = 1 / this.direction.z;\n\t\t\tconst origin = this.origin;\n\n\t\t\tif (invdirx >= 0) {\n\t\t\t\ttmin = (box.min.x - origin.x) * invdirx;\n\t\t\t\ttmax = (box.max.x - origin.x) * invdirx;\n\t\t\t} else {\n\t\t\t\ttmin = (box.max.x - origin.x) * invdirx;\n\t\t\t\ttmax = (box.min.x - origin.x) * invdirx;\n\t\t\t}\n\n\t\t\tif (invdiry >= 0) {\n\t\t\t\ttymin = (box.min.y - origin.y) * invdiry;\n\t\t\t\ttymax = (box.max.y - origin.y) * invdiry;\n\t\t\t} else {\n\t\t\t\ttymin = (box.max.y - origin.y) * invdiry;\n\t\t\t\ttymax = (box.min.y - origin.y) * invdiry;\n\t\t\t}\n\n\t\t\tif (tmin > tymax || tymin > tmax) return null; // These lines also handle the case where tmin or tmax is NaN\n\t\t\t// (result of 0 * Infinity). x !== x returns true if x is NaN\n\n\t\t\tif (tymin > tmin || tmin !== tmin) tmin = tymin;\n\t\t\tif (tymax < tmax || tmax !== tmax) tmax = tymax;\n\n\t\t\tif (invdirz >= 0) {\n\t\t\t\ttzmin = (box.min.z - origin.z) * invdirz;\n\t\t\t\ttzmax = (box.max.z - origin.z) * invdirz;\n\t\t\t} else {\n\t\t\t\ttzmin = (box.max.z - origin.z) * invdirz;\n\t\t\t\ttzmax = (box.min.z - origin.z) * invdirz;\n\t\t\t}\n\n\t\t\tif (tmin > tzmax || tzmin > tmax) return null;\n\t\t\tif (tzmin > tmin || tmin !== tmin) tmin = tzmin;\n\t\t\tif (tzmax < tmax || tmax !== tmax) tmax = tzmax; //return point closest to the ray (positive side)\n\n\t\t\tif (tmax < 0) return null;\n\t\t\treturn this.at(tmin >= 0 ? tmin : tmax, target);\n\t\t}\n\n\t\tintersectsBox(box) {\n\t\t\treturn this.intersectBox(box, _vector$a) !== null;\n\t\t}\n\n\t\tintersectTriangle(a, b, c, backfaceCulling, target) {\n\t\t\t// Compute the offset origin, edges, and normal.\n\t\t\t// from http://www.geometrictools.com/GTEngine/Include/Mathematics/GteIntrRay3Triangle3.h\n\t\t\t_edge1.subVectors(b, a);\n\n\t\t\t_edge2.subVectors(c, a);\n\n\t\t\t_normal$1.crossVectors(_edge1, _edge2); // Solve Q + t*D = b1*E1 + b2*E2 (Q = kDiff, D = ray direction,\n\t\t\t// E1 = kEdge1, E2 = kEdge2, N = Cross(E1,E2)) by\n\t\t\t//\t |Dot(D,N)|*b1 = sign(Dot(D,N))*Dot(D,Cross(Q,E2))\n\t\t\t//\t |Dot(D,N)|*b2 = sign(Dot(D,N))*Dot(D,Cross(E1,Q))\n\t\t\t//\t |Dot(D,N)|*t = -sign(Dot(D,N))*Dot(Q,N)\n\n\n\t\t\tlet DdN = this.direction.dot(_normal$1);\n\t\t\tlet sign;\n\n\t\t\tif (DdN > 0) {\n\t\t\t\tif (backfaceCulling) return null;\n\t\t\t\tsign = 1;\n\t\t\t} else if (DdN < 0) {\n\t\t\t\tsign = -1;\n\t\t\t\tDdN = -DdN;\n\t\t\t} else {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t_diff.subVectors(this.origin, a);\n\n\t\t\tconst DdQxE2 = sign * this.direction.dot(_edge2.crossVectors(_diff, _edge2)); // b1 < 0, no intersection\n\n\t\t\tif (DdQxE2 < 0) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst DdE1xQ = sign * this.direction.dot(_edge1.cross(_diff)); // b2 < 0, no intersection\n\n\t\t\tif (DdE1xQ < 0) {\n\t\t\t\treturn null;\n\t\t\t} // b1+b2 > 1, no intersection\n\n\n\t\t\tif (DdQxE2 + DdE1xQ > DdN) {\n\t\t\t\treturn null;\n\t\t\t} // Line intersects triangle, check if ray does.\n\n\n\t\t\tconst QdN = -sign * _diff.dot(_normal$1); // t < 0, no intersection\n\n\n\t\t\tif (QdN < 0) {\n\t\t\t\treturn null;\n\t\t\t} // Ray intersects triangle.\n\n\n\t\t\treturn this.at(QdN / DdN, target);\n\t\t}\n\n\t\tapplyMatrix4(matrix4) {\n\t\t\tthis.origin.applyMatrix4(matrix4);\n\t\t\tthis.direction.transformDirection(matrix4);\n\t\t\treturn this;\n\t\t}\n\n\t\tequals(ray) {\n\t\t\treturn ray.origin.equals(this.origin) && ray.direction.equals(this.direction);\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new this.constructor().copy(this);\n\t\t}\n\n\t}\n\n\tclass Matrix4 {\n\t\tconstructor() {\n\t\t\tthis.elements = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];\n\n\t\t\tif (arguments.length > 0) {\n\t\t\t\tconsole.error('THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.');\n\t\t\t}\n\t\t}\n\n\t\tset(n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44) {\n\t\t\tconst te = this.elements;\n\t\t\tte[0] = n11;\n\t\t\tte[4] = n12;\n\t\t\tte[8] = n13;\n\t\t\tte[12] = n14;\n\t\t\tte[1] = n21;\n\t\t\tte[5] = n22;\n\t\t\tte[9] = n23;\n\t\t\tte[13] = n24;\n\t\t\tte[2] = n31;\n\t\t\tte[6] = n32;\n\t\t\tte[10] = n33;\n\t\t\tte[14] = n34;\n\t\t\tte[3] = n41;\n\t\t\tte[7] = n42;\n\t\t\tte[11] = n43;\n\t\t\tte[15] = n44;\n\t\t\treturn this;\n\t\t}\n\n\t\tidentity() {\n\t\t\tthis.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);\n\t\t\treturn this;\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new Matrix4().fromArray(this.elements);\n\t\t}\n\n\t\tcopy(m) {\n\t\t\tconst te = this.elements;\n\t\t\tconst me = m.elements;\n\t\t\tte[0] = me[0];\n\t\t\tte[1] = me[1];\n\t\t\tte[2] = me[2];\n\t\t\tte[3] = me[3];\n\t\t\tte[4] = me[4];\n\t\t\tte[5] = me[5];\n\t\t\tte[6] = me[6];\n\t\t\tte[7] = me[7];\n\t\t\tte[8] = me[8];\n\t\t\tte[9] = me[9];\n\t\t\tte[10] = me[10];\n\t\t\tte[11] = me[11];\n\t\t\tte[12] = me[12];\n\t\t\tte[13] = me[13];\n\t\t\tte[14] = me[14];\n\t\t\tte[15] = me[15];\n\t\t\treturn this;\n\t\t}\n\n\t\tcopyPosition(m) {\n\t\t\tconst te = this.elements,\n\t\t\t\t\t\tme = m.elements;\n\t\t\tte[12] = me[12];\n\t\t\tte[13] = me[13];\n\t\t\tte[14] = me[14];\n\t\t\treturn this;\n\t\t}\n\n\t\tsetFromMatrix3(m) {\n\t\t\tconst me = m.elements;\n\t\t\tthis.set(me[0], me[3], me[6], 0, me[1], me[4], me[7], 0, me[2], me[5], me[8], 0, 0, 0, 0, 1);\n\t\t\treturn this;\n\t\t}\n\n\t\textractBasis(xAxis, yAxis, zAxis) {\n\t\t\txAxis.setFromMatrixColumn(this, 0);\n\t\t\tyAxis.setFromMatrixColumn(this, 1);\n\t\t\tzAxis.setFromMatrixColumn(this, 2);\n\t\t\treturn this;\n\t\t}\n\n\t\tmakeBasis(xAxis, yAxis, zAxis) {\n\t\t\tthis.set(xAxis.x, yAxis.x, zAxis.x, 0, xAxis.y, yAxis.y, zAxis.y, 0, xAxis.z, yAxis.z, zAxis.z, 0, 0, 0, 0, 1);\n\t\t\treturn this;\n\t\t}\n\n\t\textractRotation(m) {\n\t\t\t// this method does not support reflection matrices\n\t\t\tconst te = this.elements;\n\t\t\tconst me = m.elements;\n\n\t\t\tconst scaleX = 1 / _v1$5.setFromMatrixColumn(m, 0).length();\n\n\t\t\tconst scaleY = 1 / _v1$5.setFromMatrixColumn(m, 1).length();\n\n\t\t\tconst scaleZ = 1 / _v1$5.setFromMatrixColumn(m, 2).length();\n\n\t\t\tte[0] = me[0] * scaleX;\n\t\t\tte[1] = me[1] * scaleX;\n\t\t\tte[2] = me[2] * scaleX;\n\t\t\tte[3] = 0;\n\t\t\tte[4] = me[4] * scaleY;\n\t\t\tte[5] = me[5] * scaleY;\n\t\t\tte[6] = me[6] * scaleY;\n\t\t\tte[7] = 0;\n\t\t\tte[8] = me[8] * scaleZ;\n\t\t\tte[9] = me[9] * scaleZ;\n\t\t\tte[10] = me[10] * scaleZ;\n\t\t\tte[11] = 0;\n\t\t\tte[12] = 0;\n\t\t\tte[13] = 0;\n\t\t\tte[14] = 0;\n\t\t\tte[15] = 1;\n\t\t\treturn this;\n\t\t}\n\n\t\tmakeRotationFromEuler(euler) {\n\t\t\tif (!(euler && euler.isEuler)) {\n\t\t\t\tconsole.error('THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.');\n\t\t\t}\n\n\t\t\tconst te = this.elements;\n\t\t\tconst x = euler.x,\n\t\t\t\t\t\ty = euler.y,\n\t\t\t\t\t\tz = euler.z;\n\t\t\tconst a = Math.cos(x),\n\t\t\t\t\t\tb = Math.sin(x);\n\t\t\tconst c = Math.cos(y),\n\t\t\t\t\t\td = Math.sin(y);\n\t\t\tconst e = Math.cos(z),\n\t\t\t\t\t\tf = Math.sin(z);\n\n\t\t\tif (euler.order === 'XYZ') {\n\t\t\t\tconst ae = a * e,\n\t\t\t\t\t\t\taf = a * f,\n\t\t\t\t\t\t\tbe = b * e,\n\t\t\t\t\t\t\tbf = b * f;\n\t\t\t\tte[0] = c * e;\n\t\t\t\tte[4] = -c * f;\n\t\t\t\tte[8] = d;\n\t\t\t\tte[1] = af + be * d;\n\t\t\t\tte[5] = ae - bf * d;\n\t\t\t\tte[9] = -b * c;\n\t\t\t\tte[2] = bf - ae * d;\n\t\t\t\tte[6] = be + af * d;\n\t\t\t\tte[10] = a * c;\n\t\t\t} else if (euler.order === 'YXZ') {\n\t\t\t\tconst ce = c * e,\n\t\t\t\t\t\t\tcf = c * f,\n\t\t\t\t\t\t\tde = d * e,\n\t\t\t\t\t\t\tdf = d * f;\n\t\t\t\tte[0] = ce + df * b;\n\t\t\t\tte[4] = de * b - cf;\n\t\t\t\tte[8] = a * d;\n\t\t\t\tte[1] = a * f;\n\t\t\t\tte[5] = a * e;\n\t\t\t\tte[9] = -b;\n\t\t\t\tte[2] = cf * b - de;\n\t\t\t\tte[6] = df + ce * b;\n\t\t\t\tte[10] = a * c;\n\t\t\t} else if (euler.order === 'ZXY') {\n\t\t\t\tconst ce = c * e,\n\t\t\t\t\t\t\tcf = c * f,\n\t\t\t\t\t\t\tde = d * e,\n\t\t\t\t\t\t\tdf = d * f;\n\t\t\t\tte[0] = ce - df * b;\n\t\t\t\tte[4] = -a * f;\n\t\t\t\tte[8] = de + cf * b;\n\t\t\t\tte[1] = cf + de * b;\n\t\t\t\tte[5] = a * e;\n\t\t\t\tte[9] = df - ce * b;\n\t\t\t\tte[2] = -a * d;\n\t\t\t\tte[6] = b;\n\t\t\t\tte[10] = a * c;\n\t\t\t} else if (euler.order === 'ZYX') {\n\t\t\t\tconst ae = a * e,\n\t\t\t\t\t\t\taf = a * f,\n\t\t\t\t\t\t\tbe = b * e,\n\t\t\t\t\t\t\tbf = b * f;\n\t\t\t\tte[0] = c * e;\n\t\t\t\tte[4] = be * d - af;\n\t\t\t\tte[8] = ae * d + bf;\n\t\t\t\tte[1] = c * f;\n\t\t\t\tte[5] = bf * d + ae;\n\t\t\t\tte[9] = af * d - be;\n\t\t\t\tte[2] = -d;\n\t\t\t\tte[6] = b * c;\n\t\t\t\tte[10] = a * c;\n\t\t\t} else if (euler.order === 'YZX') {\n\t\t\t\tconst ac = a * c,\n\t\t\t\t\t\t\tad = a * d,\n\t\t\t\t\t\t\tbc = b * c,\n\t\t\t\t\t\t\tbd = b * d;\n\t\t\t\tte[0] = c * e;\n\t\t\t\tte[4] = bd - ac * f;\n\t\t\t\tte[8] = bc * f + ad;\n\t\t\t\tte[1] = f;\n\t\t\t\tte[5] = a * e;\n\t\t\t\tte[9] = -b * e;\n\t\t\t\tte[2] = -d * e;\n\t\t\t\tte[6] = ad * f + bc;\n\t\t\t\tte[10] = ac - bd * f;\n\t\t\t} else if (euler.order === 'XZY') {\n\t\t\t\tconst ac = a * c,\n\t\t\t\t\t\t\tad = a * d,\n\t\t\t\t\t\t\tbc = b * c,\n\t\t\t\t\t\t\tbd = b * d;\n\t\t\t\tte[0] = c * e;\n\t\t\t\tte[4] = -f;\n\t\t\t\tte[8] = d * e;\n\t\t\t\tte[1] = ac * f + bd;\n\t\t\t\tte[5] = a * e;\n\t\t\t\tte[9] = ad * f - bc;\n\t\t\t\tte[2] = bc * f - ad;\n\t\t\t\tte[6] = b * e;\n\t\t\t\tte[10] = bd * f + ac;\n\t\t\t} // bottom row\n\n\n\t\t\tte[3] = 0;\n\t\t\tte[7] = 0;\n\t\t\tte[11] = 0; // last column\n\n\t\t\tte[12] = 0;\n\t\t\tte[13] = 0;\n\t\t\tte[14] = 0;\n\t\t\tte[15] = 1;\n\t\t\treturn this;\n\t\t}\n\n\t\tmakeRotationFromQuaternion(q) {\n\t\t\treturn this.compose(_zero, q, _one);\n\t\t}\n\n\t\tlookAt(eye, target, up) {\n\t\t\tconst te = this.elements;\n\n\t\t\t_z.subVectors(eye, target);\n\n\t\t\tif (_z.lengthSq() === 0) {\n\t\t\t\t// eye and target are in the same position\n\t\t\t\t_z.z = 1;\n\t\t\t}\n\n\t\t\t_z.normalize();\n\n\t\t\t_x.crossVectors(up, _z);\n\n\t\t\tif (_x.lengthSq() === 0) {\n\t\t\t\t// up and z are parallel\n\t\t\t\tif (Math.abs(up.z) === 1) {\n\t\t\t\t\t_z.x += 0.0001;\n\t\t\t\t} else {\n\t\t\t\t\t_z.z += 0.0001;\n\t\t\t\t}\n\n\t\t\t\t_z.normalize();\n\n\t\t\t\t_x.crossVectors(up, _z);\n\t\t\t}\n\n\t\t\t_x.normalize();\n\n\t\t\t_y.crossVectors(_z, _x);\n\n\t\t\tte[0] = _x.x;\n\t\t\tte[4] = _y.x;\n\t\t\tte[8] = _z.x;\n\t\t\tte[1] = _x.y;\n\t\t\tte[5] = _y.y;\n\t\t\tte[9] = _z.y;\n\t\t\tte[2] = _x.z;\n\t\t\tte[6] = _y.z;\n\t\t\tte[10] = _z.z;\n\t\t\treturn this;\n\t\t}\n\n\t\tmultiply(m, n) {\n\t\t\tif (n !== undefined) {\n\t\t\t\tconsole.warn('THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead.');\n\t\t\t\treturn this.multiplyMatrices(m, n);\n\t\t\t}\n\n\t\t\treturn this.multiplyMatrices(this, m);\n\t\t}\n\n\t\tpremultiply(m) {\n\t\t\treturn this.multiplyMatrices(m, this);\n\t\t}\n\n\t\tmultiplyMatrices(a, b) {\n\t\t\tconst ae = a.elements;\n\t\t\tconst be = b.elements;\n\t\t\tconst te = this.elements;\n\t\t\tconst a11 = ae[0],\n\t\t\t\t\t\ta12 = ae[4],\n\t\t\t\t\t\ta13 = ae[8],\n\t\t\t\t\t\ta14 = ae[12];\n\t\t\tconst a21 = ae[1],\n\t\t\t\t\t\ta22 = ae[5],\n\t\t\t\t\t\ta23 = ae[9],\n\t\t\t\t\t\ta24 = ae[13];\n\t\t\tconst a31 = ae[2],\n\t\t\t\t\t\ta32 = ae[6],\n\t\t\t\t\t\ta33 = ae[10],\n\t\t\t\t\t\ta34 = ae[14];\n\t\t\tconst a41 = ae[3],\n\t\t\t\t\t\ta42 = ae[7],\n\t\t\t\t\t\ta43 = ae[11],\n\t\t\t\t\t\ta44 = ae[15];\n\t\t\tconst b11 = be[0],\n\t\t\t\t\t\tb12 = be[4],\n\t\t\t\t\t\tb13 = be[8],\n\t\t\t\t\t\tb14 = be[12];\n\t\t\tconst b21 = be[1],\n\t\t\t\t\t\tb22 = be[5],\n\t\t\t\t\t\tb23 = be[9],\n\t\t\t\t\t\tb24 = be[13];\n\t\t\tconst b31 = be[2],\n\t\t\t\t\t\tb32 = be[6],\n\t\t\t\t\t\tb33 = be[10],\n\t\t\t\t\t\tb34 = be[14];\n\t\t\tconst b41 = be[3],\n\t\t\t\t\t\tb42 = be[7],\n\t\t\t\t\t\tb43 = be[11],\n\t\t\t\t\t\tb44 = be[15];\n\t\t\tte[0] = a11 * b11 + a12 * b21 + a13 * b31 + a14 * b41;\n\t\t\tte[4] = a11 * b12 + a12 * b22 + a13 * b32 + a14 * b42;\n\t\t\tte[8] = a11 * b13 + a12 * b23 + a13 * b33 + a14 * b43;\n\t\t\tte[12] = a11 * b14 + a12 * b24 + a13 * b34 + a14 * b44;\n\t\t\tte[1] = a21 * b11 + a22 * b21 + a23 * b31 + a24 * b41;\n\t\t\tte[5] = a21 * b12 + a22 * b22 + a23 * b32 + a24 * b42;\n\t\t\tte[9] = a21 * b13 + a22 * b23 + a23 * b33 + a24 * b43;\n\t\t\tte[13] = a21 * b14 + a22 * b24 + a23 * b34 + a24 * b44;\n\t\t\tte[2] = a31 * b11 + a32 * b21 + a33 * b31 + a34 * b41;\n\t\t\tte[6] = a31 * b12 + a32 * b22 + a33 * b32 + a34 * b42;\n\t\t\tte[10] = a31 * b13 + a32 * b23 + a33 * b33 + a34 * b43;\n\t\t\tte[14] = a31 * b14 + a32 * b24 + a33 * b34 + a34 * b44;\n\t\t\tte[3] = a41 * b11 + a42 * b21 + a43 * b31 + a44 * b41;\n\t\t\tte[7] = a41 * b12 + a42 * b22 + a43 * b32 + a44 * b42;\n\t\t\tte[11] = a41 * b13 + a42 * b23 + a43 * b33 + a44 * b43;\n\t\t\tte[15] = a41 * b14 + a42 * b24 + a43 * b34 + a44 * b44;\n\t\t\treturn this;\n\t\t}\n\n\t\tmultiplyScalar(s) {\n\t\t\tconst te = this.elements;\n\t\t\tte[0] *= s;\n\t\t\tte[4] *= s;\n\t\t\tte[8] *= s;\n\t\t\tte[12] *= s;\n\t\t\tte[1] *= s;\n\t\t\tte[5] *= s;\n\t\t\tte[9] *= s;\n\t\t\tte[13] *= s;\n\t\t\tte[2] *= s;\n\t\t\tte[6] *= s;\n\t\t\tte[10] *= s;\n\t\t\tte[14] *= s;\n\t\t\tte[3] *= s;\n\t\t\tte[7] *= s;\n\t\t\tte[11] *= s;\n\t\t\tte[15] *= s;\n\t\t\treturn this;\n\t\t}\n\n\t\tdeterminant() {\n\t\t\tconst te = this.elements;\n\t\t\tconst n11 = te[0],\n\t\t\t\t\t\tn12 = te[4],\n\t\t\t\t\t\tn13 = te[8],\n\t\t\t\t\t\tn14 = te[12];\n\t\t\tconst n21 = te[1],\n\t\t\t\t\t\tn22 = te[5],\n\t\t\t\t\t\tn23 = te[9],\n\t\t\t\t\t\tn24 = te[13];\n\t\t\tconst n31 = te[2],\n\t\t\t\t\t\tn32 = te[6],\n\t\t\t\t\t\tn33 = te[10],\n\t\t\t\t\t\tn34 = te[14];\n\t\t\tconst n41 = te[3],\n\t\t\t\t\t\tn42 = te[7],\n\t\t\t\t\t\tn43 = te[11],\n\t\t\t\t\t\tn44 = te[15]; //TODO: make this more efficient\n\t\t\t//( based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm )\n\n\t\t\treturn n41 * (+n14 * n23 * n32 - n13 * n24 * n32 - n14 * n22 * n33 + n12 * n24 * n33 + n13 * n22 * n34 - n12 * n23 * n34) + n42 * (+n11 * n23 * n34 - n11 * n24 * n33 + n14 * n21 * n33 - n13 * n21 * n34 + n13 * n24 * n31 - n14 * n23 * n31) + n43 * (+n11 * n24 * n32 - n11 * n22 * n34 - n14 * n21 * n32 + n12 * n21 * n34 + n14 * n22 * n31 - n12 * n24 * n31) + n44 * (-n13 * n22 * n31 - n11 * n23 * n32 + n11 * n22 * n33 + n13 * n21 * n32 - n12 * n21 * n33 + n12 * n23 * n31);\n\t\t}\n\n\t\ttranspose() {\n\t\t\tconst te = this.elements;\n\t\t\tlet tmp;\n\t\t\ttmp = te[1];\n\t\t\tte[1] = te[4];\n\t\t\tte[4] = tmp;\n\t\t\ttmp = te[2];\n\t\t\tte[2] = te[8];\n\t\t\tte[8] = tmp;\n\t\t\ttmp = te[6];\n\t\t\tte[6] = te[9];\n\t\t\tte[9] = tmp;\n\t\t\ttmp = te[3];\n\t\t\tte[3] = te[12];\n\t\t\tte[12] = tmp;\n\t\t\ttmp = te[7];\n\t\t\tte[7] = te[13];\n\t\t\tte[13] = tmp;\n\t\t\ttmp = te[11];\n\t\t\tte[11] = te[14];\n\t\t\tte[14] = tmp;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetPosition(x, y, z) {\n\t\t\tconst te = this.elements;\n\n\t\t\tif (x.isVector3) {\n\t\t\t\tte[12] = x.x;\n\t\t\t\tte[13] = x.y;\n\t\t\t\tte[14] = x.z;\n\t\t\t} else {\n\t\t\t\tte[12] = x;\n\t\t\t\tte[13] = y;\n\t\t\t\tte[14] = z;\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tinvert() {\n\t\t\t// based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm\n\t\t\tconst te = this.elements,\n\t\t\t\t\t\tn11 = te[0],\n\t\t\t\t\t\tn21 = te[1],\n\t\t\t\t\t\tn31 = te[2],\n\t\t\t\t\t\tn41 = te[3],\n\t\t\t\t\t\tn12 = te[4],\n\t\t\t\t\t\tn22 = te[5],\n\t\t\t\t\t\tn32 = te[6],\n\t\t\t\t\t\tn42 = te[7],\n\t\t\t\t\t\tn13 = te[8],\n\t\t\t\t\t\tn23 = te[9],\n\t\t\t\t\t\tn33 = te[10],\n\t\t\t\t\t\tn43 = te[11],\n\t\t\t\t\t\tn14 = te[12],\n\t\t\t\t\t\tn24 = te[13],\n\t\t\t\t\t\tn34 = te[14],\n\t\t\t\t\t\tn44 = te[15],\n\t\t\t\t\t\tt11 = n23 * n34 * n42 - n24 * n33 * n42 + n24 * n32 * n43 - n22 * n34 * n43 - n23 * n32 * n44 + n22 * n33 * n44,\n\t\t\t\t\t\tt12 = n14 * n33 * n42 - n13 * n34 * n42 - n14 * n32 * n43 + n12 * n34 * n43 + n13 * n32 * n44 - n12 * n33 * n44,\n\t\t\t\t\t\tt13 = n13 * n24 * n42 - n14 * n23 * n42 + n14 * n22 * n43 - n12 * n24 * n43 - n13 * n22 * n44 + n12 * n23 * n44,\n\t\t\t\t\t\tt14 = n14 * n23 * n32 - n13 * n24 * n32 - n14 * n22 * n33 + n12 * n24 * n33 + n13 * n22 * n34 - n12 * n23 * n34;\n\t\t\tconst det = n11 * t11 + n21 * t12 + n31 * t13 + n41 * t14;\n\t\t\tif (det === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);\n\t\t\tconst detInv = 1 / det;\n\t\t\tte[0] = t11 * detInv;\n\t\t\tte[1] = (n24 * n33 * n41 - n23 * n34 * n41 - n24 * n31 * n43 + n21 * n34 * n43 + n23 * n31 * n44 - n21 * n33 * n44) * detInv;\n\t\t\tte[2] = (n22 * n34 * n41 - n24 * n32 * n41 + n24 * n31 * n42 - n21 * n34 * n42 - n22 * n31 * n44 + n21 * n32 * n44) * detInv;\n\t\t\tte[3] = (n23 * n32 * n41 - n22 * n33 * n41 - n23 * n31 * n42 + n21 * n33 * n42 + n22 * n31 * n43 - n21 * n32 * n43) * detInv;\n\t\t\tte[4] = t12 * detInv;\n\t\t\tte[5] = (n13 * n34 * n41 - n14 * n33 * n41 + n14 * n31 * n43 - n11 * n34 * n43 - n13 * n31 * n44 + n11 * n33 * n44) * detInv;\n\t\t\tte[6] = (n14 * n32 * n41 - n12 * n34 * n41 - n14 * n31 * n42 + n11 * n34 * n42 + n12 * n31 * n44 - n11 * n32 * n44) * detInv;\n\t\t\tte[7] = (n12 * n33 * n41 - n13 * n32 * n41 + n13 * n31 * n42 - n11 * n33 * n42 - n12 * n31 * n43 + n11 * n32 * n43) * detInv;\n\t\t\tte[8] = t13 * detInv;\n\t\t\tte[9] = (n14 * n23 * n41 - n13 * n24 * n41 - n14 * n21 * n43 + n11 * n24 * n43 + n13 * n21 * n44 - n11 * n23 * n44) * detInv;\n\t\t\tte[10] = (n12 * n24 * n41 - n14 * n22 * n41 + n14 * n21 * n42 - n11 * n24 * n42 - n12 * n21 * n44 + n11 * n22 * n44) * detInv;\n\t\t\tte[11] = (n13 * n22 * n41 - n12 * n23 * n41 - n13 * n21 * n42 + n11 * n23 * n42 + n12 * n21 * n43 - n11 * n22 * n43) * detInv;\n\t\t\tte[12] = t14 * detInv;\n\t\t\tte[13] = (n13 * n24 * n31 - n14 * n23 * n31 + n14 * n21 * n33 - n11 * n24 * n33 - n13 * n21 * n34 + n11 * n23 * n34) * detInv;\n\t\t\tte[14] = (n14 * n22 * n31 - n12 * n24 * n31 - n14 * n21 * n32 + n11 * n24 * n32 + n12 * n21 * n34 - n11 * n22 * n34) * detInv;\n\t\t\tte[15] = (n12 * n23 * n31 - n13 * n22 * n31 + n13 * n21 * n32 - n11 * n23 * n32 - n12 * n21 * n33 + n11 * n22 * n33) * detInv;\n\t\t\treturn this;\n\t\t}\n\n\t\tscale(v) {\n\t\t\tconst te = this.elements;\n\t\t\tconst x = v.x,\n\t\t\t\t\t\ty = v.y,\n\t\t\t\t\t\tz = v.z;\n\t\t\tte[0] *= x;\n\t\t\tte[4] *= y;\n\t\t\tte[8] *= z;\n\t\t\tte[1] *= x;\n\t\t\tte[5] *= y;\n\t\t\tte[9] *= z;\n\t\t\tte[2] *= x;\n\t\t\tte[6] *= y;\n\t\t\tte[10] *= z;\n\t\t\tte[3] *= x;\n\t\t\tte[7] *= y;\n\t\t\tte[11] *= z;\n\t\t\treturn this;\n\t\t}\n\n\t\tgetMaxScaleOnAxis() {\n\t\t\tconst te = this.elements;\n\t\t\tconst scaleXSq = te[0] * te[0] + te[1] * te[1] + te[2] * te[2];\n\t\t\tconst scaleYSq = te[4] * te[4] + te[5] * te[5] + te[6] * te[6];\n\t\t\tconst scaleZSq = te[8] * te[8] + te[9] * te[9] + te[10] * te[10];\n\t\t\treturn Math.sqrt(Math.max(scaleXSq, scaleYSq, scaleZSq));\n\t\t}\n\n\t\tmakeTranslation(x, y, z) {\n\t\t\tthis.set(1, 0, 0, x, 0, 1, 0, y, 0, 0, 1, z, 0, 0, 0, 1);\n\t\t\treturn this;\n\t\t}\n\n\t\tmakeRotationX(theta) {\n\t\t\tconst c = Math.cos(theta),\n\t\t\t\t\t\ts = Math.sin(theta);\n\t\t\tthis.set(1, 0, 0, 0, 0, c, -s, 0, 0, s, c, 0, 0, 0, 0, 1);\n\t\t\treturn this;\n\t\t}\n\n\t\tmakeRotationY(theta) {\n\t\t\tconst c = Math.cos(theta),\n\t\t\t\t\t\ts = Math.sin(theta);\n\t\t\tthis.set(c, 0, s, 0, 0, 1, 0, 0, -s, 0, c, 0, 0, 0, 0, 1);\n\t\t\treturn this;\n\t\t}\n\n\t\tmakeRotationZ(theta) {\n\t\t\tconst c = Math.cos(theta),\n\t\t\t\t\t\ts = Math.sin(theta);\n\t\t\tthis.set(c, -s, 0, 0, s, c, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);\n\t\t\treturn this;\n\t\t}\n\n\t\tmakeRotationAxis(axis, angle) {\n\t\t\t// Based on http://www.gamedev.net/reference/articles/article1199.asp\n\t\t\tconst c = Math.cos(angle);\n\t\t\tconst s = Math.sin(angle);\n\t\t\tconst t = 1 - c;\n\t\t\tconst x = axis.x,\n\t\t\t\t\t\ty = axis.y,\n\t\t\t\t\t\tz = axis.z;\n\t\t\tconst tx = t * x,\n\t\t\t\t\t\tty = t * y;\n\t\t\tthis.set(tx * x + c, tx * y - s * z, tx * z + s * y, 0, tx * y + s * z, ty * y + c, ty * z - s * x, 0, tx * z - s * y, ty * z + s * x, t * z * z + c, 0, 0, 0, 0, 1);\n\t\t\treturn this;\n\t\t}\n\n\t\tmakeScale(x, y, z) {\n\t\t\tthis.set(x, 0, 0, 0, 0, y, 0, 0, 0, 0, z, 0, 0, 0, 0, 1);\n\t\t\treturn this;\n\t\t}\n\n\t\tmakeShear(xy, xz, yx, yz, zx, zy) {\n\t\t\tthis.set(1, yx, zx, 0, xy, 1, zy, 0, xz, yz, 1, 0, 0, 0, 0, 1);\n\t\t\treturn this;\n\t\t}\n\n\t\tcompose(position, quaternion, scale) {\n\t\t\tconst te = this.elements;\n\t\t\tconst x = quaternion._x,\n\t\t\t\t\t\ty = quaternion._y,\n\t\t\t\t\t\tz = quaternion._z,\n\t\t\t\t\t\tw = quaternion._w;\n\t\t\tconst x2 = x + x,\n\t\t\t\t\t\ty2 = y + y,\n\t\t\t\t\t\tz2 = z + z;\n\t\t\tconst xx = x * x2,\n\t\t\t\t\t\txy = x * y2,\n\t\t\t\t\t\txz = x * z2;\n\t\t\tconst yy = y * y2,\n\t\t\t\t\t\tyz = y * z2,\n\t\t\t\t\t\tzz = z * z2;\n\t\t\tconst wx = w * x2,\n\t\t\t\t\t\twy = w * y2,\n\t\t\t\t\t\twz = w * z2;\n\t\t\tconst sx = scale.x,\n\t\t\t\t\t\tsy = scale.y,\n\t\t\t\t\t\tsz = scale.z;\n\t\t\tte[0] = (1 - (yy + zz)) * sx;\n\t\t\tte[1] = (xy + wz) * sx;\n\t\t\tte[2] = (xz - wy) * sx;\n\t\t\tte[3] = 0;\n\t\t\tte[4] = (xy - wz) * sy;\n\t\t\tte[5] = (1 - (xx + zz)) * sy;\n\t\t\tte[6] = (yz + wx) * sy;\n\t\t\tte[7] = 0;\n\t\t\tte[8] = (xz + wy) * sz;\n\t\t\tte[9] = (yz - wx) * sz;\n\t\t\tte[10] = (1 - (xx + yy)) * sz;\n\t\t\tte[11] = 0;\n\t\t\tte[12] = position.x;\n\t\t\tte[13] = position.y;\n\t\t\tte[14] = position.z;\n\t\t\tte[15] = 1;\n\t\t\treturn this;\n\t\t}\n\n\t\tdecompose(position, quaternion, scale) {\n\t\t\tconst te = this.elements;\n\n\t\t\tlet sx = _v1$5.set(te[0], te[1], te[2]).length();\n\n\t\t\tconst sy = _v1$5.set(te[4], te[5], te[6]).length();\n\n\t\t\tconst sz = _v1$5.set(te[8], te[9], te[10]).length(); // if determine is negative, we need to invert one scale\n\n\n\t\t\tconst det = this.determinant();\n\t\t\tif (det < 0) sx = -sx;\n\t\t\tposition.x = te[12];\n\t\t\tposition.y = te[13];\n\t\t\tposition.z = te[14]; // scale the rotation part\n\n\t\t\t_m1$2.copy(this);\n\n\t\t\tconst invSX = 1 / sx;\n\t\t\tconst invSY = 1 / sy;\n\t\t\tconst invSZ = 1 / sz;\n\t\t\t_m1$2.elements[0] *= invSX;\n\t\t\t_m1$2.elements[1] *= invSX;\n\t\t\t_m1$2.elements[2] *= invSX;\n\t\t\t_m1$2.elements[4] *= invSY;\n\t\t\t_m1$2.elements[5] *= invSY;\n\t\t\t_m1$2.elements[6] *= invSY;\n\t\t\t_m1$2.elements[8] *= invSZ;\n\t\t\t_m1$2.elements[9] *= invSZ;\n\t\t\t_m1$2.elements[10] *= invSZ;\n\t\t\tquaternion.setFromRotationMatrix(_m1$2);\n\t\t\tscale.x = sx;\n\t\t\tscale.y = sy;\n\t\t\tscale.z = sz;\n\t\t\treturn this;\n\t\t}\n\n\t\tmakePerspective(left, right, top, bottom, near, far) {\n\t\t\tif (far === undefined) {\n\t\t\t\tconsole.warn('THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.');\n\t\t\t}\n\n\t\t\tconst te = this.elements;\n\t\t\tconst x = 2 * near / (right - left);\n\t\t\tconst y = 2 * near / (top - bottom);\n\t\t\tconst a = (right + left) / (right - left);\n\t\t\tconst b = (top + bottom) / (top - bottom);\n\t\t\tconst c = -(far + near) / (far - near);\n\t\t\tconst d = -2 * far * near / (far - near);\n\t\t\tte[0] = x;\n\t\t\tte[4] = 0;\n\t\t\tte[8] = a;\n\t\t\tte[12] = 0;\n\t\t\tte[1] = 0;\n\t\t\tte[5] = y;\n\t\t\tte[9] = b;\n\t\t\tte[13] = 0;\n\t\t\tte[2] = 0;\n\t\t\tte[6] = 0;\n\t\t\tte[10] = c;\n\t\t\tte[14] = d;\n\t\t\tte[3] = 0;\n\t\t\tte[7] = 0;\n\t\t\tte[11] = -1;\n\t\t\tte[15] = 0;\n\t\t\treturn this;\n\t\t}\n\n\t\tmakeOrthographic(left, right, top, bottom, near, far) {\n\t\t\tconst te = this.elements;\n\t\t\tconst w = 1.0 / (right - left);\n\t\t\tconst h = 1.0 / (top - bottom);\n\t\t\tconst p = 1.0 / (far - near);\n\t\t\tconst x = (right + left) * w;\n\t\t\tconst y = (top + bottom) * h;\n\t\t\tconst z = (far + near) * p;\n\t\t\tte[0] = 2 * w;\n\t\t\tte[4] = 0;\n\t\t\tte[8] = 0;\n\t\t\tte[12] = -x;\n\t\t\tte[1] = 0;\n\t\t\tte[5] = 2 * h;\n\t\t\tte[9] = 0;\n\t\t\tte[13] = -y;\n\t\t\tte[2] = 0;\n\t\t\tte[6] = 0;\n\t\t\tte[10] = -2 * p;\n\t\t\tte[14] = -z;\n\t\t\tte[3] = 0;\n\t\t\tte[7] = 0;\n\t\t\tte[11] = 0;\n\t\t\tte[15] = 1;\n\t\t\treturn this;\n\t\t}\n\n\t\tequals(matrix) {\n\t\t\tconst te = this.elements;\n\t\t\tconst me = matrix.elements;\n\n\t\t\tfor (let i = 0; i < 16; i++) {\n\t\t\t\tif (te[i] !== me[i]) return false;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tfromArray(array, offset = 0) {\n\t\t\tfor (let i = 0; i < 16; i++) {\n\t\t\t\tthis.elements[i] = array[i + offset];\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\ttoArray(array = [], offset = 0) {\n\t\t\tconst te = this.elements;\n\t\t\tarray[offset] = te[0];\n\t\t\tarray[offset + 1] = te[1];\n\t\t\tarray[offset + 2] = te[2];\n\t\t\tarray[offset + 3] = te[3];\n\t\t\tarray[offset + 4] = te[4];\n\t\t\tarray[offset + 5] = te[5];\n\t\t\tarray[offset + 6] = te[6];\n\t\t\tarray[offset + 7] = te[7];\n\t\t\tarray[offset + 8] = te[8];\n\t\t\tarray[offset + 9] = te[9];\n\t\t\tarray[offset + 10] = te[10];\n\t\t\tarray[offset + 11] = te[11];\n\t\t\tarray[offset + 12] = te[12];\n\t\t\tarray[offset + 13] = te[13];\n\t\t\tarray[offset + 14] = te[14];\n\t\t\tarray[offset + 15] = te[15];\n\t\t\treturn array;\n\t\t}\n\n\t}\n\n\tMatrix4.prototype.isMatrix4 = true;\n\n\tconst _v1$5 = /*@__PURE__*/new Vector3();\n\n\tconst _m1$2 = /*@__PURE__*/new Matrix4();\n\n\tconst _zero = /*@__PURE__*/new Vector3(0, 0, 0);\n\n\tconst _one = /*@__PURE__*/new Vector3(1, 1, 1);\n\n\tconst _x = /*@__PURE__*/new Vector3();\n\n\tconst _y = /*@__PURE__*/new Vector3();\n\n\tconst _z = /*@__PURE__*/new Vector3();\n\n\tconst _matrix$1 = /*@__PURE__*/new Matrix4();\n\n\tconst _quaternion$3 = /*@__PURE__*/new Quaternion();\n\n\tclass Euler {\n\t\tconstructor(x = 0, y = 0, z = 0, order = Euler.DefaultOrder) {\n\t\t\tthis._x = x;\n\t\t\tthis._y = y;\n\t\t\tthis._z = z;\n\t\t\tthis._order = order;\n\t\t}\n\n\t\tget x() {\n\t\t\treturn this._x;\n\t\t}\n\n\t\tset x(value) {\n\t\t\tthis._x = value;\n\n\t\t\tthis._onChangeCallback();\n\t\t}\n\n\t\tget y() {\n\t\t\treturn this._y;\n\t\t}\n\n\t\tset y(value) {\n\t\t\tthis._y = value;\n\n\t\t\tthis._onChangeCallback();\n\t\t}\n\n\t\tget z() {\n\t\t\treturn this._z;\n\t\t}\n\n\t\tset z(value) {\n\t\t\tthis._z = value;\n\n\t\t\tthis._onChangeCallback();\n\t\t}\n\n\t\tget order() {\n\t\t\treturn this._order;\n\t\t}\n\n\t\tset order(value) {\n\t\t\tthis._order = value;\n\n\t\t\tthis._onChangeCallback();\n\t\t}\n\n\t\tset(x, y, z, order = this._order) {\n\t\t\tthis._x = x;\n\t\t\tthis._y = y;\n\t\t\tthis._z = z;\n\t\t\tthis._order = order;\n\n\t\t\tthis._onChangeCallback();\n\n\t\t\treturn this;\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new this.constructor(this._x, this._y, this._z, this._order);\n\t\t}\n\n\t\tcopy(euler) {\n\t\t\tthis._x = euler._x;\n\t\t\tthis._y = euler._y;\n\t\t\tthis._z = euler._z;\n\t\t\tthis._order = euler._order;\n\n\t\t\tthis._onChangeCallback();\n\n\t\t\treturn this;\n\t\t}\n\n\t\tsetFromRotationMatrix(m, order = this._order, update = true) {\n\t\t\t// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\t\t\tconst te = m.elements;\n\t\t\tconst m11 = te[0],\n\t\t\t\t\t\tm12 = te[4],\n\t\t\t\t\t\tm13 = te[8];\n\t\t\tconst m21 = te[1],\n\t\t\t\t\t\tm22 = te[5],\n\t\t\t\t\t\tm23 = te[9];\n\t\t\tconst m31 = te[2],\n\t\t\t\t\t\tm32 = te[6],\n\t\t\t\t\t\tm33 = te[10];\n\n\t\t\tswitch (order) {\n\t\t\t\tcase 'XYZ':\n\t\t\t\t\tthis._y = Math.asin(clamp(m13, -1, 1));\n\n\t\t\t\t\tif (Math.abs(m13) < 0.9999999) {\n\t\t\t\t\t\tthis._x = Math.atan2(-m23, m33);\n\t\t\t\t\t\tthis._z = Math.atan2(-m12, m11);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis._x = Math.atan2(m32, m22);\n\t\t\t\t\t\tthis._z = 0;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'YXZ':\n\t\t\t\t\tthis._x = Math.asin(-clamp(m23, -1, 1));\n\n\t\t\t\t\tif (Math.abs(m23) < 0.9999999) {\n\t\t\t\t\t\tthis._y = Math.atan2(m13, m33);\n\t\t\t\t\t\tthis._z = Math.atan2(m21, m22);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis._y = Math.atan2(-m31, m11);\n\t\t\t\t\t\tthis._z = 0;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'ZXY':\n\t\t\t\t\tthis._x = Math.asin(clamp(m32, -1, 1));\n\n\t\t\t\t\tif (Math.abs(m32) < 0.9999999) {\n\t\t\t\t\t\tthis._y = Math.atan2(-m31, m33);\n\t\t\t\t\t\tthis._z = Math.atan2(-m12, m22);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis._y = 0;\n\t\t\t\t\t\tthis._z = Math.atan2(m21, m11);\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'ZYX':\n\t\t\t\t\tthis._y = Math.asin(-clamp(m31, -1, 1));\n\n\t\t\t\t\tif (Math.abs(m31) < 0.9999999) {\n\t\t\t\t\t\tthis._x = Math.atan2(m32, m33);\n\t\t\t\t\t\tthis._z = Math.atan2(m21, m11);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis._x = 0;\n\t\t\t\t\t\tthis._z = Math.atan2(-m12, m22);\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'YZX':\n\t\t\t\t\tthis._z = Math.asin(clamp(m21, -1, 1));\n\n\t\t\t\t\tif (Math.abs(m21) < 0.9999999) {\n\t\t\t\t\t\tthis._x = Math.atan2(-m23, m22);\n\t\t\t\t\t\tthis._y = Math.atan2(-m31, m11);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis._x = 0;\n\t\t\t\t\t\tthis._y = Math.atan2(m13, m33);\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'XZY':\n\t\t\t\t\tthis._z = Math.asin(-clamp(m12, -1, 1));\n\n\t\t\t\t\tif (Math.abs(m12) < 0.9999999) {\n\t\t\t\t\t\tthis._x = Math.atan2(m32, m22);\n\t\t\t\t\t\tthis._y = Math.atan2(m13, m11);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis._x = Math.atan2(-m23, m33);\n\t\t\t\t\t\tthis._y = 0;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tconsole.warn('THREE.Euler: .setFromRotationMatrix() encountered an unknown order: ' + order);\n\t\t\t}\n\n\t\t\tthis._order = order;\n\t\t\tif (update === true) this._onChangeCallback();\n\t\t\treturn this;\n\t\t}\n\n\t\tsetFromQuaternion(q, order, update) {\n\t\t\t_matrix$1.makeRotationFromQuaternion(q);\n\n\t\t\treturn this.setFromRotationMatrix(_matrix$1, order, update);\n\t\t}\n\n\t\tsetFromVector3(v, order = this._order) {\n\t\t\treturn this.set(v.x, v.y, v.z, order);\n\t\t}\n\n\t\treorder(newOrder) {\n\t\t\t// WARNING: this discards revolution information -bhouston\n\t\t\t_quaternion$3.setFromEuler(this);\n\n\t\t\treturn this.setFromQuaternion(_quaternion$3, newOrder);\n\t\t}\n\n\t\tequals(euler) {\n\t\t\treturn euler._x === this._x && euler._y === this._y && euler._z === this._z && euler._order === this._order;\n\t\t}\n\n\t\tfromArray(array) {\n\t\t\tthis._x = array[0];\n\t\t\tthis._y = array[1];\n\t\t\tthis._z = array[2];\n\t\t\tif (array[3] !== undefined) this._order = array[3];\n\n\t\t\tthis._onChangeCallback();\n\n\t\t\treturn this;\n\t\t}\n\n\t\ttoArray(array = [], offset = 0) {\n\t\t\tarray[offset] = this._x;\n\t\t\tarray[offset + 1] = this._y;\n\t\t\tarray[offset + 2] = this._z;\n\t\t\tarray[offset + 3] = this._order;\n\t\t\treturn array;\n\t\t}\n\n\t\ttoVector3(optionalResult) {\n\t\t\tif (optionalResult) {\n\t\t\t\treturn optionalResult.set(this._x, this._y, this._z);\n\t\t\t} else {\n\t\t\t\treturn new Vector3(this._x, this._y, this._z);\n\t\t\t}\n\t\t}\n\n\t\t_onChange(callback) {\n\t\t\tthis._onChangeCallback = callback;\n\t\t\treturn this;\n\t\t}\n\n\t\t_onChangeCallback() {}\n\n\t}\n\n\tEuler.prototype.isEuler = true;\n\tEuler.DefaultOrder = 'XYZ';\n\tEuler.RotationOrders = ['XYZ', 'YZX', 'ZXY', 'XZY', 'YXZ', 'ZYX'];\n\n\tclass Layers {\n\t\tconstructor() {\n\t\t\tthis.mask = 1 | 0;\n\t\t}\n\n\t\tset(channel) {\n\t\t\tthis.mask = 1 << channel | 0;\n\t\t}\n\n\t\tenable(channel) {\n\t\t\tthis.mask |= 1 << channel | 0;\n\t\t}\n\n\t\tenableAll() {\n\t\t\tthis.mask = 0xffffffff | 0;\n\t\t}\n\n\t\ttoggle(channel) {\n\t\t\tthis.mask ^= 1 << channel | 0;\n\t\t}\n\n\t\tdisable(channel) {\n\t\t\tthis.mask &= ~(1 << channel | 0);\n\t\t}\n\n\t\tdisableAll() {\n\t\t\tthis.mask = 0;\n\t\t}\n\n\t\ttest(layers) {\n\t\t\treturn (this.mask & layers.mask) !== 0;\n\t\t}\n\n\t}\n\n\tlet _object3DId = 0;\n\n\tconst _v1$4 = /*@__PURE__*/new Vector3();\n\n\tconst _q1 = /*@__PURE__*/new Quaternion();\n\n\tconst _m1$1 = /*@__PURE__*/new Matrix4();\n\n\tconst _target = /*@__PURE__*/new Vector3();\n\n\tconst _position$3 = /*@__PURE__*/new Vector3();\n\n\tconst _scale$2 = /*@__PURE__*/new Vector3();\n\n\tconst _quaternion$2 = /*@__PURE__*/new Quaternion();\n\n\tconst _xAxis = /*@__PURE__*/new Vector3(1, 0, 0);\n\n\tconst _yAxis = /*@__PURE__*/new Vector3(0, 1, 0);\n\n\tconst _zAxis = /*@__PURE__*/new Vector3(0, 0, 1);\n\n\tconst _addedEvent = {\n\t\ttype: 'added'\n\t};\n\tconst _removedEvent = {\n\t\ttype: 'removed'\n\t};\n\n\tclass Object3D extends EventDispatcher {\n\t\tconstructor() {\n\t\t\tsuper();\n\t\t\tObject.defineProperty(this, 'id', {\n\t\t\t\tvalue: _object3DId++\n\t\t\t});\n\t\t\tthis.uuid = generateUUID();\n\t\t\tthis.name = '';\n\t\t\tthis.type = 'Object3D';\n\t\t\tthis.parent = null;\n\t\t\tthis.children = [];\n\t\t\tthis.up = Object3D.DefaultUp.clone();\n\t\t\tconst position = new Vector3();\n\t\t\tconst rotation = new Euler();\n\t\t\tconst quaternion = new Quaternion();\n\t\t\tconst scale = new Vector3(1, 1, 1);\n\n\t\t\tfunction onRotationChange() {\n\t\t\t\tquaternion.setFromEuler(rotation, false);\n\t\t\t}\n\n\t\t\tfunction onQuaternionChange() {\n\t\t\t\trotation.setFromQuaternion(quaternion, undefined, false);\n\t\t\t}\n\n\t\t\trotation._onChange(onRotationChange);\n\n\t\t\tquaternion._onChange(onQuaternionChange);\n\n\t\t\tObject.defineProperties(this, {\n\t\t\t\tposition: {\n\t\t\t\t\tconfigurable: true,\n\t\t\t\t\tenumerable: true,\n\t\t\t\t\tvalue: position\n\t\t\t\t},\n\t\t\t\trotation: {\n\t\t\t\t\tconfigurable: true,\n\t\t\t\t\tenumerable: true,\n\t\t\t\t\tvalue: rotation\n\t\t\t\t},\n\t\t\t\tquaternion: {\n\t\t\t\t\tconfigurable: true,\n\t\t\t\t\tenumerable: true,\n\t\t\t\t\tvalue: quaternion\n\t\t\t\t},\n\t\t\t\tscale: {\n\t\t\t\t\tconfigurable: true,\n\t\t\t\t\tenumerable: true,\n\t\t\t\t\tvalue: scale\n\t\t\t\t},\n\t\t\t\tmodelViewMatrix: {\n\t\t\t\t\tvalue: new Matrix4()\n\t\t\t\t},\n\t\t\t\tnormalMatrix: {\n\t\t\t\t\tvalue: new Matrix3()\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis.matrix = new Matrix4();\n\t\t\tthis.matrixWorld = new Matrix4();\n\t\t\tthis.matrixAutoUpdate = Object3D.DefaultMatrixAutoUpdate;\n\t\t\tthis.matrixWorldNeedsUpdate = false;\n\t\t\tthis.layers = new Layers();\n\t\t\tthis.visible = true;\n\t\t\tthis.castShadow = false;\n\t\t\tthis.receiveShadow = false;\n\t\t\tthis.frustumCulled = true;\n\t\t\tthis.renderOrder = 0;\n\t\t\tthis.animations = [];\n\t\t\tthis.userData = {};\n\t\t}\n\n\t\tonBeforeRender() {}\n\n\t\tonAfterRender() {}\n\n\t\tapplyMatrix4(matrix) {\n\t\t\tif (this.matrixAutoUpdate) this.updateMatrix();\n\t\t\tthis.matrix.premultiply(matrix);\n\t\t\tthis.matrix.decompose(this.position, this.quaternion, this.scale);\n\t\t}\n\n\t\tapplyQuaternion(q) {\n\t\t\tthis.quaternion.premultiply(q);\n\t\t\treturn this;\n\t\t}\n\n\t\tsetRotationFromAxisAngle(axis, angle) {\n\t\t\t// assumes axis is normalized\n\t\t\tthis.quaternion.setFromAxisAngle(axis, angle);\n\t\t}\n\n\t\tsetRotationFromEuler(euler) {\n\t\t\tthis.quaternion.setFromEuler(euler, true);\n\t\t}\n\n\t\tsetRotationFromMatrix(m) {\n\t\t\t// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\t\t\tthis.quaternion.setFromRotationMatrix(m);\n\t\t}\n\n\t\tsetRotationFromQuaternion(q) {\n\t\t\t// assumes q is normalized\n\t\t\tthis.quaternion.copy(q);\n\t\t}\n\n\t\trotateOnAxis(axis, angle) {\n\t\t\t// rotate object on axis in object space\n\t\t\t// axis is assumed to be normalized\n\t\t\t_q1.setFromAxisAngle(axis, angle);\n\n\t\t\tthis.quaternion.multiply(_q1);\n\t\t\treturn this;\n\t\t}\n\n\t\trotateOnWorldAxis(axis, angle) {\n\t\t\t// rotate object on axis in world space\n\t\t\t// axis is assumed to be normalized\n\t\t\t// method assumes no rotated parent\n\t\t\t_q1.setFromAxisAngle(axis, angle);\n\n\t\t\tthis.quaternion.premultiply(_q1);\n\t\t\treturn this;\n\t\t}\n\n\t\trotateX(angle) {\n\t\t\treturn this.rotateOnAxis(_xAxis, angle);\n\t\t}\n\n\t\trotateY(angle) {\n\t\t\treturn this.rotateOnAxis(_yAxis, angle);\n\t\t}\n\n\t\trotateZ(angle) {\n\t\t\treturn this.rotateOnAxis(_zAxis, angle);\n\t\t}\n\n\t\ttranslateOnAxis(axis, distance) {\n\t\t\t// translate object by distance along axis in object space\n\t\t\t// axis is assumed to be normalized\n\t\t\t_v1$4.copy(axis).applyQuaternion(this.quaternion);\n\n\t\t\tthis.position.add(_v1$4.multiplyScalar(distance));\n\t\t\treturn this;\n\t\t}\n\n\t\ttranslateX(distance) {\n\t\t\treturn this.translateOnAxis(_xAxis, distance);\n\t\t}\n\n\t\ttranslateY(distance) {\n\t\t\treturn this.translateOnAxis(_yAxis, distance);\n\t\t}\n\n\t\ttranslateZ(distance) {\n\t\t\treturn this.translateOnAxis(_zAxis, distance);\n\t\t}\n\n\t\tlocalToWorld(vector) {\n\t\t\treturn vector.applyMatrix4(this.matrixWorld);\n\t\t}\n\n\t\tworldToLocal(vector) {\n\t\t\treturn vector.applyMatrix4(_m1$1.copy(this.matrixWorld).invert());\n\t\t}\n\n\t\tlookAt(x, y, z) {\n\t\t\t// This method does not support objects having non-uniformly-scaled parent(s)\n\t\t\tif (x.isVector3) {\n\t\t\t\t_target.copy(x);\n\t\t\t} else {\n\t\t\t\t_target.set(x, y, z);\n\t\t\t}\n\n\t\t\tconst parent = this.parent;\n\t\t\tthis.updateWorldMatrix(true, false);\n\n\t\t\t_position$3.setFromMatrixPosition(this.matrixWorld);\n\n\t\t\tif (this.isCamera || this.isLight) {\n\t\t\t\t_m1$1.lookAt(_position$3, _target, this.up);\n\t\t\t} else {\n\t\t\t\t_m1$1.lookAt(_target, _position$3, this.up);\n\t\t\t}\n\n\t\t\tthis.quaternion.setFromRotationMatrix(_m1$1);\n\n\t\t\tif (parent) {\n\t\t\t\t_m1$1.extractRotation(parent.matrixWorld);\n\n\t\t\t\t_q1.setFromRotationMatrix(_m1$1);\n\n\t\t\t\tthis.quaternion.premultiply(_q1.invert());\n\t\t\t}\n\t\t}\n\n\t\tadd(object) {\n\t\t\tif (arguments.length > 1) {\n\t\t\t\tfor (let i = 0; i < arguments.length; i++) {\n\t\t\t\t\tthis.add(arguments[i]);\n\t\t\t\t}\n\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\tif (object === this) {\n\t\t\t\tconsole.error('THREE.Object3D.add: object can\\'t be added as a child of itself.', object);\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\tif (object && object.isObject3D) {\n\t\t\t\tif (object.parent !== null) {\n\t\t\t\t\tobject.parent.remove(object);\n\t\t\t\t}\n\n\t\t\t\tobject.parent = this;\n\t\t\t\tthis.children.push(object);\n\t\t\t\tobject.dispatchEvent(_addedEvent);\n\t\t\t} else {\n\t\t\t\tconsole.error('THREE.Object3D.add: object not an instance of THREE.Object3D.', object);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tremove(object) {\n\t\t\tif (arguments.length > 1) {\n\t\t\t\tfor (let i = 0; i < arguments.length; i++) {\n\t\t\t\t\tthis.remove(arguments[i]);\n\t\t\t\t}\n\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\tconst index = this.children.indexOf(object);\n\n\t\t\tif (index !== -1) {\n\t\t\t\tobject.parent = null;\n\t\t\t\tthis.children.splice(index, 1);\n\t\t\t\tobject.dispatchEvent(_removedEvent);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tremoveFromParent() {\n\t\t\tconst parent = this.parent;\n\n\t\t\tif (parent !== null) {\n\t\t\t\tparent.remove(this);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tclear() {\n\t\t\tfor (let i = 0; i < this.children.length; i++) {\n\t\t\t\tconst object = this.children[i];\n\t\t\t\tobject.parent = null;\n\t\t\t\tobject.dispatchEvent(_removedEvent);\n\t\t\t}\n\n\t\t\tthis.children.length = 0;\n\t\t\treturn this;\n\t\t}\n\n\t\tattach(object) {\n\t\t\t// adds object as a child of this, while maintaining the object's world transform\n\t\t\tthis.updateWorldMatrix(true, false);\n\n\t\t\t_m1$1.copy(this.matrixWorld).invert();\n\n\t\t\tif (object.parent !== null) {\n\t\t\t\tobject.parent.updateWorldMatrix(true, false);\n\n\t\t\t\t_m1$1.multiply(object.parent.matrixWorld);\n\t\t\t}\n\n\t\t\tobject.applyMatrix4(_m1$1);\n\t\t\tthis.add(object);\n\t\t\tobject.updateWorldMatrix(false, true);\n\t\t\treturn this;\n\t\t}\n\n\t\tgetObjectById(id) {\n\t\t\treturn this.getObjectByProperty('id', id);\n\t\t}\n\n\t\tgetObjectByName(name) {\n\t\t\treturn this.getObjectByProperty('name', name);\n\t\t}\n\n\t\tgetObjectByProperty(name, value) {\n\t\t\tif (this[name] === value) return this;\n\n\t\t\tfor (let i = 0, l = this.children.length; i < l; i++) {\n\t\t\t\tconst child = this.children[i];\n\t\t\t\tconst object = child.getObjectByProperty(name, value);\n\n\t\t\t\tif (object !== undefined) {\n\t\t\t\t\treturn object;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn undefined;\n\t\t}\n\n\t\tgetWorldPosition(target) {\n\t\t\tthis.updateWorldMatrix(true, false);\n\t\t\treturn target.setFromMatrixPosition(this.matrixWorld);\n\t\t}\n\n\t\tgetWorldQuaternion(target) {\n\t\t\tthis.updateWorldMatrix(true, false);\n\t\t\tthis.matrixWorld.decompose(_position$3, target, _scale$2);\n\t\t\treturn target;\n\t\t}\n\n\t\tgetWorldScale(target) {\n\t\t\tthis.updateWorldMatrix(true, false);\n\t\t\tthis.matrixWorld.decompose(_position$3, _quaternion$2, target);\n\t\t\treturn target;\n\t\t}\n\n\t\tgetWorldDirection(target) {\n\t\t\tthis.updateWorldMatrix(true, false);\n\t\t\tconst e = this.matrixWorld.elements;\n\t\t\treturn target.set(e[8], e[9], e[10]).normalize();\n\t\t}\n\n\t\traycast() {}\n\n\t\ttraverse(callback) {\n\t\t\tcallback(this);\n\t\t\tconst children = this.children;\n\n\t\t\tfor (let i = 0, l = children.length; i < l; i++) {\n\t\t\t\tchildren[i].traverse(callback);\n\t\t\t}\n\t\t}\n\n\t\ttraverseVisible(callback) {\n\t\t\tif (this.visible === false) return;\n\t\t\tcallback(this);\n\t\t\tconst children = this.children;\n\n\t\t\tfor (let i = 0, l = children.length; i < l; i++) {\n\t\t\t\tchildren[i].traverseVisible(callback);\n\t\t\t}\n\t\t}\n\n\t\ttraverseAncestors(callback) {\n\t\t\tconst parent = this.parent;\n\n\t\t\tif (parent !== null) {\n\t\t\t\tcallback(parent);\n\t\t\t\tparent.traverseAncestors(callback);\n\t\t\t}\n\t\t}\n\n\t\tupdateMatrix() {\n\t\t\tthis.matrix.compose(this.position, this.quaternion, this.scale);\n\t\t\tthis.matrixWorldNeedsUpdate = true;\n\t\t}\n\n\t\tupdateMatrixWorld(force) {\n\t\t\tif (this.matrixAutoUpdate) this.updateMatrix();\n\n\t\t\tif (this.matrixWorldNeedsUpdate || force) {\n\t\t\t\tif (this.parent === null) {\n\t\t\t\t\tthis.matrixWorld.copy(this.matrix);\n\t\t\t\t} else {\n\t\t\t\t\tthis.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix);\n\t\t\t\t}\n\n\t\t\t\tthis.matrixWorldNeedsUpdate = false;\n\t\t\t\tforce = true;\n\t\t\t} // update children\n\n\n\t\t\tconst children = this.children;\n\n\t\t\tfor (let i = 0, l = children.length; i < l; i++) {\n\t\t\t\tchildren[i].updateMatrixWorld(force);\n\t\t\t}\n\t\t}\n\n\t\tupdateWorldMatrix(updateParents, updateChildren) {\n\t\t\tconst parent = this.parent;\n\n\t\t\tif (updateParents === true && parent !== null) {\n\t\t\t\tparent.updateWorldMatrix(true, false);\n\t\t\t}\n\n\t\t\tif (this.matrixAutoUpdate) this.updateMatrix();\n\n\t\t\tif (this.parent === null) {\n\t\t\t\tthis.matrixWorld.copy(this.matrix);\n\t\t\t} else {\n\t\t\t\tthis.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix);\n\t\t\t} // update children\n\n\n\t\t\tif (updateChildren === true) {\n\t\t\t\tconst children = this.children;\n\n\t\t\t\tfor (let i = 0, l = children.length; i < l; i++) {\n\t\t\t\t\tchildren[i].updateWorldMatrix(false, true);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\ttoJSON(meta) {\n\t\t\t// meta is a string when called from JSON.stringify\n\t\t\tconst isRootObject = meta === undefined || typeof meta === 'string';\n\t\t\tconst output = {}; // meta is a hash used to collect geometries, materials.\n\t\t\t// not providing it implies that this is the root object\n\t\t\t// being serialized.\n\n\t\t\tif (isRootObject) {\n\t\t\t\t// initialize meta obj\n\t\t\t\tmeta = {\n\t\t\t\t\tgeometries: {},\n\t\t\t\t\tmaterials: {},\n\t\t\t\t\ttextures: {},\n\t\t\t\t\timages: {},\n\t\t\t\t\tshapes: {},\n\t\t\t\t\tskeletons: {},\n\t\t\t\t\tanimations: {}\n\t\t\t\t};\n\t\t\t\toutput.metadata = {\n\t\t\t\t\tversion: 4.5,\n\t\t\t\t\ttype: 'Object',\n\t\t\t\t\tgenerator: 'Object3D.toJSON'\n\t\t\t\t};\n\t\t\t} // standard Object3D serialization\n\n\n\t\t\tconst object = {};\n\t\t\tobject.uuid = this.uuid;\n\t\t\tobject.type = this.type;\n\t\t\tif (this.name !== '') object.name = this.name;\n\t\t\tif (this.castShadow === true) object.castShadow = true;\n\t\t\tif (this.receiveShadow === true) object.receiveShadow = true;\n\t\t\tif (this.visible === false) object.visible = false;\n\t\t\tif (this.frustumCulled === false) object.frustumCulled = false;\n\t\t\tif (this.renderOrder !== 0) object.renderOrder = this.renderOrder;\n\t\t\tif (JSON.stringify(this.userData) !== '{}') object.userData = this.userData;\n\t\t\tobject.layers = this.layers.mask;\n\t\t\tobject.matrix = this.matrix.toArray();\n\t\t\tif (this.matrixAutoUpdate === false) object.matrixAutoUpdate = false; // object specific properties\n\n\t\t\tif (this.isInstancedMesh) {\n\t\t\t\tobject.type = 'InstancedMesh';\n\t\t\t\tobject.count = this.count;\n\t\t\t\tobject.instanceMatrix = this.instanceMatrix.toJSON();\n\t\t\t\tif (this.instanceColor !== null) object.instanceColor = this.instanceColor.toJSON();\n\t\t\t} //\n\n\n\t\t\tfunction serialize(library, element) {\n\t\t\t\tif (library[element.uuid] === undefined) {\n\t\t\t\t\tlibrary[element.uuid] = element.toJSON(meta);\n\t\t\t\t}\n\n\t\t\t\treturn element.uuid;\n\t\t\t}\n\n\t\t\tif (this.isScene) {\n\t\t\t\tif (this.background) {\n\t\t\t\t\tif (this.background.isColor) {\n\t\t\t\t\t\tobject.background = this.background.toJSON();\n\t\t\t\t\t} else if (this.background.isTexture) {\n\t\t\t\t\t\tobject.background = this.background.toJSON(meta).uuid;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (this.environment && this.environment.isTexture) {\n\t\t\t\t\tobject.environment = this.environment.toJSON(meta).uuid;\n\t\t\t\t}\n\t\t\t} else if (this.isMesh || this.isLine || this.isPoints) {\n\t\t\t\tobject.geometry = serialize(meta.geometries, this.geometry);\n\t\t\t\tconst parameters = this.geometry.parameters;\n\n\t\t\t\tif (parameters !== undefined && parameters.shapes !== undefined) {\n\t\t\t\t\tconst shapes = parameters.shapes;\n\n\t\t\t\t\tif (Array.isArray(shapes)) {\n\t\t\t\t\t\tfor (let i = 0, l = shapes.length; i < l; i++) {\n\t\t\t\t\t\t\tconst shape = shapes[i];\n\t\t\t\t\t\t\tserialize(meta.shapes, shape);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tserialize(meta.shapes, shapes);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.isSkinnedMesh) {\n\t\t\t\tobject.bindMode = this.bindMode;\n\t\t\t\tobject.bindMatrix = this.bindMatrix.toArray();\n\n\t\t\t\tif (this.skeleton !== undefined) {\n\t\t\t\t\tserialize(meta.skeletons, this.skeleton);\n\t\t\t\t\tobject.skeleton = this.skeleton.uuid;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.material !== undefined) {\n\t\t\t\tif (Array.isArray(this.material)) {\n\t\t\t\t\tconst uuids = [];\n\n\t\t\t\t\tfor (let i = 0, l = this.material.length; i < l; i++) {\n\t\t\t\t\t\tuuids.push(serialize(meta.materials, this.material[i]));\n\t\t\t\t\t}\n\n\t\t\t\t\tobject.material = uuids;\n\t\t\t\t} else {\n\t\t\t\t\tobject.material = serialize(meta.materials, this.material);\n\t\t\t\t}\n\t\t\t} //\n\n\n\t\t\tif (this.children.length > 0) {\n\t\t\t\tobject.children = [];\n\n\t\t\t\tfor (let i = 0; i < this.children.length; i++) {\n\t\t\t\t\tobject.children.push(this.children[i].toJSON(meta).object);\n\t\t\t\t}\n\t\t\t} //\n\n\n\t\t\tif (this.animations.length > 0) {\n\t\t\t\tobject.animations = [];\n\n\t\t\t\tfor (let i = 0; i < this.animations.length; i++) {\n\t\t\t\t\tconst animation = this.animations[i];\n\t\t\t\t\tobject.animations.push(serialize(meta.animations, animation));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (isRootObject) {\n\t\t\t\tconst geometries = extractFromCache(meta.geometries);\n\t\t\t\tconst materials = extractFromCache(meta.materials);\n\t\t\t\tconst textures = extractFromCache(meta.textures);\n\t\t\t\tconst images = extractFromCache(meta.images);\n\t\t\t\tconst shapes = extractFromCache(meta.shapes);\n\t\t\t\tconst skeletons = extractFromCache(meta.skeletons);\n\t\t\t\tconst animations = extractFromCache(meta.animations);\n\t\t\t\tif (geometries.length > 0) output.geometries = geometries;\n\t\t\t\tif (materials.length > 0) output.materials = materials;\n\t\t\t\tif (textures.length > 0) output.textures = textures;\n\t\t\t\tif (images.length > 0) output.images = images;\n\t\t\t\tif (shapes.length > 0) output.shapes = shapes;\n\t\t\t\tif (skeletons.length > 0) output.skeletons = skeletons;\n\t\t\t\tif (animations.length > 0) output.animations = animations;\n\t\t\t}\n\n\t\t\toutput.object = object;\n\t\t\treturn output; // extract data from the cache hash\n\t\t\t// remove metadata on each item\n\t\t\t// and return as array\n\n\t\t\tfunction extractFromCache(cache) {\n\t\t\t\tconst values = [];\n\n\t\t\t\tfor (const key in cache) {\n\t\t\t\t\tconst data = cache[key];\n\t\t\t\t\tdelete data.metadata;\n\t\t\t\t\tvalues.push(data);\n\t\t\t\t}\n\n\t\t\t\treturn values;\n\t\t\t}\n\t\t}\n\n\t\tclone(recursive) {\n\t\t\treturn new this.constructor().copy(this, recursive);\n\t\t}\n\n\t\tcopy(source, recursive = true) {\n\t\t\tthis.name = source.name;\n\t\t\tthis.up.copy(source.up);\n\t\t\tthis.position.copy(source.position);\n\t\t\tthis.rotation.order = source.rotation.order;\n\t\t\tthis.quaternion.copy(source.quaternion);\n\t\t\tthis.scale.copy(source.scale);\n\t\t\tthis.matrix.copy(source.matrix);\n\t\t\tthis.matrixWorld.copy(source.matrixWorld);\n\t\t\tthis.matrixAutoUpdate = source.matrixAutoUpdate;\n\t\t\tthis.matrixWorldNeedsUpdate = source.matrixWorldNeedsUpdate;\n\t\t\tthis.layers.mask = source.layers.mask;\n\t\t\tthis.visible = source.visible;\n\t\t\tthis.castShadow = source.castShadow;\n\t\t\tthis.receiveShadow = source.receiveShadow;\n\t\t\tthis.frustumCulled = source.frustumCulled;\n\t\t\tthis.renderOrder = source.renderOrder;\n\t\t\tthis.userData = JSON.parse(JSON.stringify(source.userData));\n\n\t\t\tif (recursive === true) {\n\t\t\t\tfor (let i = 0; i < source.children.length; i++) {\n\t\t\t\t\tconst child = source.children[i];\n\t\t\t\t\tthis.add(child.clone());\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tObject3D.DefaultUp = new Vector3(0, 1, 0);\n\tObject3D.DefaultMatrixAutoUpdate = true;\n\tObject3D.prototype.isObject3D = true;\n\n\tconst _v0$1 = /*@__PURE__*/new Vector3();\n\n\tconst _v1$3 = /*@__PURE__*/new Vector3();\n\n\tconst _v2$2 = /*@__PURE__*/new Vector3();\n\n\tconst _v3$1 = /*@__PURE__*/new Vector3();\n\n\tconst _vab = /*@__PURE__*/new Vector3();\n\n\tconst _vac = /*@__PURE__*/new Vector3();\n\n\tconst _vbc = /*@__PURE__*/new Vector3();\n\n\tconst _vap = /*@__PURE__*/new Vector3();\n\n\tconst _vbp = /*@__PURE__*/new Vector3();\n\n\tconst _vcp = /*@__PURE__*/new Vector3();\n\n\tclass Triangle {\n\t\tconstructor(a = new Vector3(), b = new Vector3(), c = new Vector3()) {\n\t\t\tthis.a = a;\n\t\t\tthis.b = b;\n\t\t\tthis.c = c;\n\t\t}\n\n\t\tstatic getNormal(a, b, c, target) {\n\t\t\ttarget.subVectors(c, b);\n\n\t\t\t_v0$1.subVectors(a, b);\n\n\t\t\ttarget.cross(_v0$1);\n\t\t\tconst targetLengthSq = target.lengthSq();\n\n\t\t\tif (targetLengthSq > 0) {\n\t\t\t\treturn target.multiplyScalar(1 / Math.sqrt(targetLengthSq));\n\t\t\t}\n\n\t\t\treturn target.set(0, 0, 0);\n\t\t} // static/instance method to calculate barycentric coordinates\n\t\t// based on: http://www.blackpawn.com/texts/pointinpoly/default.html\n\n\n\t\tstatic getBarycoord(point, a, b, c, target) {\n\t\t\t_v0$1.subVectors(c, a);\n\n\t\t\t_v1$3.subVectors(b, a);\n\n\t\t\t_v2$2.subVectors(point, a);\n\n\t\t\tconst dot00 = _v0$1.dot(_v0$1);\n\n\t\t\tconst dot01 = _v0$1.dot(_v1$3);\n\n\t\t\tconst dot02 = _v0$1.dot(_v2$2);\n\n\t\t\tconst dot11 = _v1$3.dot(_v1$3);\n\n\t\t\tconst dot12 = _v1$3.dot(_v2$2);\n\n\t\t\tconst denom = dot00 * dot11 - dot01 * dot01; // collinear or singular triangle\n\n\t\t\tif (denom === 0) {\n\t\t\t\t// arbitrary location outside of triangle?\n\t\t\t\t// not sure if this is the best idea, maybe should be returning undefined\n\t\t\t\treturn target.set(-2, -1, -1);\n\t\t\t}\n\n\t\t\tconst invDenom = 1 / denom;\n\t\t\tconst u = (dot11 * dot02 - dot01 * dot12) * invDenom;\n\t\t\tconst v = (dot00 * dot12 - dot01 * dot02) * invDenom; // barycentric coordinates must always sum to 1\n\n\t\t\treturn target.set(1 - u - v, v, u);\n\t\t}\n\n\t\tstatic containsPoint(point, a, b, c) {\n\t\t\tthis.getBarycoord(point, a, b, c, _v3$1);\n\t\t\treturn _v3$1.x >= 0 && _v3$1.y >= 0 && _v3$1.x + _v3$1.y <= 1;\n\t\t}\n\n\t\tstatic getUV(point, p1, p2, p3, uv1, uv2, uv3, target) {\n\t\t\tthis.getBarycoord(point, p1, p2, p3, _v3$1);\n\t\t\ttarget.set(0, 0);\n\t\t\ttarget.addScaledVector(uv1, _v3$1.x);\n\t\t\ttarget.addScaledVector(uv2, _v3$1.y);\n\t\t\ttarget.addScaledVector(uv3, _v3$1.z);\n\t\t\treturn target;\n\t\t}\n\n\t\tstatic isFrontFacing(a, b, c, direction) {\n\t\t\t_v0$1.subVectors(c, b);\n\n\t\t\t_v1$3.subVectors(a, b); // strictly front facing\n\n\n\t\t\treturn _v0$1.cross(_v1$3).dot(direction) < 0 ? true : false;\n\t\t}\n\n\t\tset(a, b, c) {\n\t\t\tthis.a.copy(a);\n\t\t\tthis.b.copy(b);\n\t\t\tthis.c.copy(c);\n\t\t\treturn this;\n\t\t}\n\n\t\tsetFromPointsAndIndices(points, i0, i1, i2) {\n\t\t\tthis.a.copy(points[i0]);\n\t\t\tthis.b.copy(points[i1]);\n\t\t\tthis.c.copy(points[i2]);\n\t\t\treturn this;\n\t\t}\n\n\t\tsetFromAttributeAndIndices(attribute, i0, i1, i2) {\n\t\t\tthis.a.fromBufferAttribute(attribute, i0);\n\t\t\tthis.b.fromBufferAttribute(attribute, i1);\n\t\t\tthis.c.fromBufferAttribute(attribute, i2);\n\t\t\treturn this;\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new this.constructor().copy(this);\n\t\t}\n\n\t\tcopy(triangle) {\n\t\t\tthis.a.copy(triangle.a);\n\t\t\tthis.b.copy(triangle.b);\n\t\t\tthis.c.copy(triangle.c);\n\t\t\treturn this;\n\t\t}\n\n\t\tgetArea() {\n\t\t\t_v0$1.subVectors(this.c, this.b);\n\n\t\t\t_v1$3.subVectors(this.a, this.b);\n\n\t\t\treturn _v0$1.cross(_v1$3).length() * 0.5;\n\t\t}\n\n\t\tgetMidpoint(target) {\n\t\t\treturn target.addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3);\n\t\t}\n\n\t\tgetNormal(target) {\n\t\t\treturn Triangle.getNormal(this.a, this.b, this.c, target);\n\t\t}\n\n\t\tgetPlane(target) {\n\t\t\treturn target.setFromCoplanarPoints(this.a, this.b, this.c);\n\t\t}\n\n\t\tgetBarycoord(point, target) {\n\t\t\treturn Triangle.getBarycoord(point, this.a, this.b, this.c, target);\n\t\t}\n\n\t\tgetUV(point, uv1, uv2, uv3, target) {\n\t\t\treturn Triangle.getUV(point, this.a, this.b, this.c, uv1, uv2, uv3, target);\n\t\t}\n\n\t\tcontainsPoint(point) {\n\t\t\treturn Triangle.containsPoint(point, this.a, this.b, this.c);\n\t\t}\n\n\t\tisFrontFacing(direction) {\n\t\t\treturn Triangle.isFrontFacing(this.a, this.b, this.c, direction);\n\t\t}\n\n\t\tintersectsBox(box) {\n\t\t\treturn box.intersectsTriangle(this);\n\t\t}\n\n\t\tclosestPointToPoint(p, target) {\n\t\t\tconst a = this.a,\n\t\t\t\t\t\tb = this.b,\n\t\t\t\t\t\tc = this.c;\n\t\t\tlet v, w; // algorithm thanks to Real-Time Collision Detection by Christer Ericson,\n\t\t\t// published by Morgan Kaufmann Publishers, (c) 2005 Elsevier Inc.,\n\t\t\t// under the accompanying license; see chapter 5.1.5 for detailed explanation.\n\t\t\t// basically, we're distinguishing which of the voronoi regions of the triangle\n\t\t\t// the point lies in with the minimum amount of redundant computation.\n\n\t\t\t_vab.subVectors(b, a);\n\n\t\t\t_vac.subVectors(c, a);\n\n\t\t\t_vap.subVectors(p, a);\n\n\t\t\tconst d1 = _vab.dot(_vap);\n\n\t\t\tconst d2 = _vac.dot(_vap);\n\n\t\t\tif (d1 <= 0 && d2 <= 0) {\n\t\t\t\t// vertex region of A; barycentric coords (1, 0, 0)\n\t\t\t\treturn target.copy(a);\n\t\t\t}\n\n\t\t\t_vbp.subVectors(p, b);\n\n\t\t\tconst d3 = _vab.dot(_vbp);\n\n\t\t\tconst d4 = _vac.dot(_vbp);\n\n\t\t\tif (d3 >= 0 && d4 <= d3) {\n\t\t\t\t// vertex region of B; barycentric coords (0, 1, 0)\n\t\t\t\treturn target.copy(b);\n\t\t\t}\n\n\t\t\tconst vc = d1 * d4 - d3 * d2;\n\n\t\t\tif (vc <= 0 && d1 >= 0 && d3 <= 0) {\n\t\t\t\tv = d1 / (d1 - d3); // edge region of AB; barycentric coords (1-v, v, 0)\n\n\t\t\t\treturn target.copy(a).addScaledVector(_vab, v);\n\t\t\t}\n\n\t\t\t_vcp.subVectors(p, c);\n\n\t\t\tconst d5 = _vab.dot(_vcp);\n\n\t\t\tconst d6 = _vac.dot(_vcp);\n\n\t\t\tif (d6 >= 0 && d5 <= d6) {\n\t\t\t\t// vertex region of C; barycentric coords (0, 0, 1)\n\t\t\t\treturn target.copy(c);\n\t\t\t}\n\n\t\t\tconst vb = d5 * d2 - d1 * d6;\n\n\t\t\tif (vb <= 0 && d2 >= 0 && d6 <= 0) {\n\t\t\t\tw = d2 / (d2 - d6); // edge region of AC; barycentric coords (1-w, 0, w)\n\n\t\t\t\treturn target.copy(a).addScaledVector(_vac, w);\n\t\t\t}\n\n\t\t\tconst va = d3 * d6 - d5 * d4;\n\n\t\t\tif (va <= 0 && d4 - d3 >= 0 && d5 - d6 >= 0) {\n\t\t\t\t_vbc.subVectors(c, b);\n\n\t\t\t\tw = (d4 - d3) / (d4 - d3 + (d5 - d6)); // edge region of BC; barycentric coords (0, 1-w, w)\n\n\t\t\t\treturn target.copy(b).addScaledVector(_vbc, w); // edge region of BC\n\t\t\t} // face region\n\n\n\t\t\tconst denom = 1 / (va + vb + vc); // u = va * denom\n\n\t\t\tv = vb * denom;\n\t\t\tw = vc * denom;\n\t\t\treturn target.copy(a).addScaledVector(_vab, v).addScaledVector(_vac, w);\n\t\t}\n\n\t\tequals(triangle) {\n\t\t\treturn triangle.a.equals(this.a) && triangle.b.equals(this.b) && triangle.c.equals(this.c);\n\t\t}\n\n\t}\n\n\tlet materialId = 0;\n\n\tclass Material extends EventDispatcher {\n\t\tconstructor() {\n\t\t\tsuper();\n\t\t\tObject.defineProperty(this, 'id', {\n\t\t\t\tvalue: materialId++\n\t\t\t});\n\t\t\tthis.uuid = generateUUID();\n\t\t\tthis.name = '';\n\t\t\tthis.type = 'Material';\n\t\t\tthis.fog = true;\n\t\t\tthis.blending = NormalBlending;\n\t\t\tthis.side = FrontSide;\n\t\t\tthis.vertexColors = false;\n\t\t\tthis.opacity = 1;\n\t\t\tthis.format = RGBAFormat;\n\t\t\tthis.transparent = false;\n\t\t\tthis.blendSrc = SrcAlphaFactor;\n\t\t\tthis.blendDst = OneMinusSrcAlphaFactor;\n\t\t\tthis.blendEquation = AddEquation;\n\t\t\tthis.blendSrcAlpha = null;\n\t\t\tthis.blendDstAlpha = null;\n\t\t\tthis.blendEquationAlpha = null;\n\t\t\tthis.depthFunc = LessEqualDepth;\n\t\t\tthis.depthTest = true;\n\t\t\tthis.depthWrite = true;\n\t\t\tthis.stencilWriteMask = 0xff;\n\t\t\tthis.stencilFunc = AlwaysStencilFunc;\n\t\t\tthis.stencilRef = 0;\n\t\t\tthis.stencilFuncMask = 0xff;\n\t\t\tthis.stencilFail = KeepStencilOp;\n\t\t\tthis.stencilZFail = KeepStencilOp;\n\t\t\tthis.stencilZPass = KeepStencilOp;\n\t\t\tthis.stencilWrite = false;\n\t\t\tthis.clippingPlanes = null;\n\t\t\tthis.clipIntersection = false;\n\t\t\tthis.clipShadows = false;\n\t\t\tthis.shadowSide = null;\n\t\t\tthis.colorWrite = true;\n\t\t\tthis.precision = null; // override the renderer's default precision for this material\n\n\t\t\tthis.polygonOffset = false;\n\t\t\tthis.polygonOffsetFactor = 0;\n\t\t\tthis.polygonOffsetUnits = 0;\n\t\t\tthis.dithering = false;\n\t\t\tthis.alphaToCoverage = false;\n\t\t\tthis.premultipliedAlpha = false;\n\t\t\tthis.visible = true;\n\t\t\tthis.toneMapped = true;\n\t\t\tthis.userData = {};\n\t\t\tthis.version = 0;\n\t\t\tthis._alphaTest = 0;\n\t\t}\n\n\t\tget alphaTest() {\n\t\t\treturn this._alphaTest;\n\t\t}\n\n\t\tset alphaTest(value) {\n\t\t\tif (this._alphaTest > 0 !== value > 0) {\n\t\t\t\tthis.version++;\n\t\t\t}\n\n\t\t\tthis._alphaTest = value;\n\t\t}\n\n\t\tonBuild() {}\n\n\t\tonBeforeRender() {}\n\n\t\tonBeforeCompile() {}\n\n\t\tcustomProgramCacheKey() {\n\t\t\treturn this.onBeforeCompile.toString();\n\t\t}\n\n\t\tsetValues(values) {\n\t\t\tif (values === undefined) return;\n\n\t\t\tfor (const key in values) {\n\t\t\t\tconst newValue = values[key];\n\n\t\t\t\tif (newValue === undefined) {\n\t\t\t\t\tconsole.warn('THREE.Material: \\'' + key + '\\' parameter is undefined.');\n\t\t\t\t\tcontinue;\n\t\t\t\t} // for backward compatability if shading is set in the constructor\n\n\n\t\t\t\tif (key === 'shading') {\n\t\t\t\t\tconsole.warn('THREE.' + this.type + ': .shading has been removed. Use the boolean .flatShading instead.');\n\t\t\t\t\tthis.flatShading = newValue === FlatShading ? true : false;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tconst currentValue = this[key];\n\n\t\t\t\tif (currentValue === undefined) {\n\t\t\t\t\tconsole.warn('THREE.' + this.type + ': \\'' + key + '\\' is not a property of this material.');\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (currentValue && currentValue.isColor) {\n\t\t\t\t\tcurrentValue.set(newValue);\n\t\t\t\t} else if (currentValue && currentValue.isVector3 && newValue && newValue.isVector3) {\n\t\t\t\t\tcurrentValue.copy(newValue);\n\t\t\t\t} else {\n\t\t\t\t\tthis[key] = newValue;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\ttoJSON(meta) {\n\t\t\tconst isRoot = meta === undefined || typeof meta === 'string';\n\n\t\t\tif (isRoot) {\n\t\t\t\tmeta = {\n\t\t\t\t\ttextures: {},\n\t\t\t\t\timages: {}\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tconst data = {\n\t\t\t\tmetadata: {\n\t\t\t\t\tversion: 4.5,\n\t\t\t\t\ttype: 'Material',\n\t\t\t\t\tgenerator: 'Material.toJSON'\n\t\t\t\t}\n\t\t\t}; // standard Material serialization\n\n\t\t\tdata.uuid = this.uuid;\n\t\t\tdata.type = this.type;\n\t\t\tif (this.name !== '') data.name = this.name;\n\t\t\tif (this.color && this.color.isColor) data.color = this.color.getHex();\n\t\t\tif (this.roughness !== undefined) data.roughness = this.roughness;\n\t\t\tif (this.metalness !== undefined) data.metalness = this.metalness;\n\t\t\tif (this.sheen !== undefined) data.sheen = this.sheen;\n\t\t\tif (this.sheenTint && this.sheenTint.isColor) data.sheenTint = this.sheenTint.getHex();\n\t\t\tif (this.sheenRoughness !== undefined) data.sheenRoughness = this.sheenRoughness;\n\t\t\tif (this.emissive && this.emissive.isColor) data.emissive = this.emissive.getHex();\n\t\t\tif (this.emissiveIntensity && this.emissiveIntensity !== 1) data.emissiveIntensity = this.emissiveIntensity;\n\t\t\tif (this.specular && this.specular.isColor) data.specular = this.specular.getHex();\n\t\t\tif (this.specularIntensity !== undefined) data.specularIntensity = this.specularIntensity;\n\t\t\tif (this.specularTint && this.specularTint.isColor) data.specularTint = this.specularTint.getHex();\n\t\t\tif (this.shininess !== undefined) data.shininess = this.shininess;\n\t\t\tif (this.clearcoat !== undefined) data.clearcoat = this.clearcoat;\n\t\t\tif (this.clearcoatRoughness !== undefined) data.clearcoatRoughness = this.clearcoatRoughness;\n\n\t\t\tif (this.clearcoatMap && this.clearcoatMap.isTexture) {\n\t\t\t\tdata.clearcoatMap = this.clearcoatMap.toJSON(meta).uuid;\n\t\t\t}\n\n\t\t\tif (this.clearcoatRoughnessMap && this.clearcoatRoughnessMap.isTexture) {\n\t\t\t\tdata.clearcoatRoughnessMap = this.clearcoatRoughnessMap.toJSON(meta).uuid;\n\t\t\t}\n\n\t\t\tif (this.clearcoatNormalMap && this.clearcoatNormalMap.isTexture) {\n\t\t\t\tdata.clearcoatNormalMap = this.clearcoatNormalMap.toJSON(meta).uuid;\n\t\t\t\tdata.clearcoatNormalScale = this.clearcoatNormalScale.toArray();\n\t\t\t}\n\n\t\t\tif (this.map && this.map.isTexture) data.map = this.map.toJSON(meta).uuid;\n\t\t\tif (this.matcap && this.matcap.isTexture) data.matcap = this.matcap.toJSON(meta).uuid;\n\t\t\tif (this.alphaMap && this.alphaMap.isTexture) data.alphaMap = this.alphaMap.toJSON(meta).uuid;\n\n\t\t\tif (this.lightMap && this.lightMap.isTexture) {\n\t\t\t\tdata.lightMap = this.lightMap.toJSON(meta).uuid;\n\t\t\t\tdata.lightMapIntensity = this.lightMapIntensity;\n\t\t\t}\n\n\t\t\tif (this.aoMap && this.aoMap.isTexture) {\n\t\t\t\tdata.aoMap = this.aoMap.toJSON(meta).uuid;\n\t\t\t\tdata.aoMapIntensity = this.aoMapIntensity;\n\t\t\t}\n\n\t\t\tif (this.bumpMap && this.bumpMap.isTexture) {\n\t\t\t\tdata.bumpMap = this.bumpMap.toJSON(meta).uuid;\n\t\t\t\tdata.bumpScale = this.bumpScale;\n\t\t\t}\n\n\t\t\tif (this.normalMap && this.normalMap.isTexture) {\n\t\t\t\tdata.normalMap = this.normalMap.toJSON(meta).uuid;\n\t\t\t\tdata.normalMapType = this.normalMapType;\n\t\t\t\tdata.normalScale = this.normalScale.toArray();\n\t\t\t}\n\n\t\t\tif (this.displacementMap && this.displacementMap.isTexture) {\n\t\t\t\tdata.displacementMap = this.displacementMap.toJSON(meta).uuid;\n\t\t\t\tdata.displacementScale = this.displacementScale;\n\t\t\t\tdata.displacementBias = this.displacementBias;\n\t\t\t}\n\n\t\t\tif (this.roughnessMap && this.roughnessMap.isTexture) data.roughnessMap = this.roughnessMap.toJSON(meta).uuid;\n\t\t\tif (this.metalnessMap && this.metalnessMap.isTexture) data.metalnessMap = this.metalnessMap.toJSON(meta).uuid;\n\t\t\tif (this.emissiveMap && this.emissiveMap.isTexture) data.emissiveMap = this.emissiveMap.toJSON(meta).uuid;\n\t\t\tif (this.specularMap && this.specularMap.isTexture) data.specularMap = this.specularMap.toJSON(meta).uuid;\n\t\t\tif (this.specularIntensityMap && this.specularIntensityMap.isTexture) data.specularIntensityMap = this.specularIntensityMap.toJSON(meta).uuid;\n\t\t\tif (this.specularTintMap && this.specularTintMap.isTexture) data.specularTintMap = this.specularTintMap.toJSON(meta).uuid;\n\n\t\t\tif (this.envMap && this.envMap.isTexture) {\n\t\t\t\tdata.envMap = this.envMap.toJSON(meta).uuid;\n\t\t\t\tif (this.combine !== undefined) data.combine = this.combine;\n\t\t\t}\n\n\t\t\tif (this.envMapIntensity !== undefined) data.envMapIntensity = this.envMapIntensity;\n\t\t\tif (this.reflectivity !== undefined) data.reflectivity = this.reflectivity;\n\t\t\tif (this.refractionRatio !== undefined) data.refractionRatio = this.refractionRatio;\n\n\t\t\tif (this.gradientMap && this.gradientMap.isTexture) {\n\t\t\t\tdata.gradientMap = this.gradientMap.toJSON(meta).uuid;\n\t\t\t}\n\n\t\t\tif (this.transmission !== undefined) data.transmission = this.transmission;\n\t\t\tif (this.transmissionMap && this.transmissionMap.isTexture) data.transmissionMap = this.transmissionMap.toJSON(meta).uuid;\n\t\t\tif (this.thickness !== undefined) data.thickness = this.thickness;\n\t\t\tif (this.thicknessMap && this.thicknessMap.isTexture) data.thicknessMap = this.thicknessMap.toJSON(meta).uuid;\n\t\t\tif (this.attenuationDistance !== undefined) data.attenuationDistance = this.attenuationDistance;\n\t\t\tif (this.attenuationTint !== undefined) data.attenuationTint = this.attenuationTint.getHex();\n\t\t\tif (this.size !== undefined) data.size = this.size;\n\t\t\tif (this.shadowSide !== null) data.shadowSide = this.shadowSide;\n\t\t\tif (this.sizeAttenuation !== undefined) data.sizeAttenuation = this.sizeAttenuation;\n\t\t\tif (this.blending !== NormalBlending) data.blending = this.blending;\n\t\t\tif (this.side !== FrontSide) data.side = this.side;\n\t\t\tif (this.vertexColors) data.vertexColors = true;\n\t\t\tif (this.opacity < 1) data.opacity = this.opacity;\n\t\t\tif (this.format !== RGBAFormat) data.format = this.format;\n\t\t\tif (this.transparent === true) data.transparent = this.transparent;\n\t\t\tdata.depthFunc = this.depthFunc;\n\t\t\tdata.depthTest = this.depthTest;\n\t\t\tdata.depthWrite = this.depthWrite;\n\t\t\tdata.colorWrite = this.colorWrite;\n\t\t\tdata.stencilWrite = this.stencilWrite;\n\t\t\tdata.stencilWriteMask = this.stencilWriteMask;\n\t\t\tdata.stencilFunc = this.stencilFunc;\n\t\t\tdata.stencilRef = this.stencilRef;\n\t\t\tdata.stencilFuncMask = this.stencilFuncMask;\n\t\t\tdata.stencilFail = this.stencilFail;\n\t\t\tdata.stencilZFail = this.stencilZFail;\n\t\t\tdata.stencilZPass = this.stencilZPass; // rotation (SpriteMaterial)\n\n\t\t\tif (this.rotation && this.rotation !== 0) data.rotation = this.rotation;\n\t\t\tif (this.polygonOffset === true) data.polygonOffset = true;\n\t\t\tif (this.polygonOffsetFactor !== 0) data.polygonOffsetFactor = this.polygonOffsetFactor;\n\t\t\tif (this.polygonOffsetUnits !== 0) data.polygonOffsetUnits = this.polygonOffsetUnits;\n\t\t\tif (this.linewidth && this.linewidth !== 1) data.linewidth = this.linewidth;\n\t\t\tif (this.dashSize !== undefined) data.dashSize = this.dashSize;\n\t\t\tif (this.gapSize !== undefined) data.gapSize = this.gapSize;\n\t\t\tif (this.scale !== undefined) data.scale = this.scale;\n\t\t\tif (this.dithering === true) data.dithering = true;\n\t\t\tif (this.alphaTest > 0) data.alphaTest = this.alphaTest;\n\t\t\tif (this.alphaToCoverage === true) data.alphaToCoverage = this.alphaToCoverage;\n\t\t\tif (this.premultipliedAlpha === true) data.premultipliedAlpha = this.premultipliedAlpha;\n\t\t\tif (this.wireframe === true) data.wireframe = this.wireframe;\n\t\t\tif (this.wireframeLinewidth > 1) data.wireframeLinewidth = this.wireframeLinewidth;\n\t\t\tif (this.wireframeLinecap !== 'round') data.wireframeLinecap = this.wireframeLinecap;\n\t\t\tif (this.wireframeLinejoin !== 'round') data.wireframeLinejoin = this.wireframeLinejoin;\n\t\t\tif (this.flatShading === true) data.flatShading = this.flatShading;\n\t\t\tif (this.visible === false) data.visible = false;\n\t\t\tif (this.toneMapped === false) data.toneMapped = false;\n\t\t\tif (JSON.stringify(this.userData) !== '{}') data.userData = this.userData; // TODO: Copied from Object3D.toJSON\n\n\t\t\tfunction extractFromCache(cache) {\n\t\t\t\tconst values = [];\n\n\t\t\t\tfor (const key in cache) {\n\t\t\t\t\tconst data = cache[key];\n\t\t\t\t\tdelete data.metadata;\n\t\t\t\t\tvalues.push(data);\n\t\t\t\t}\n\n\t\t\t\treturn values;\n\t\t\t}\n\n\t\t\tif (isRoot) {\n\t\t\t\tconst textures = extractFromCache(meta.textures);\n\t\t\t\tconst images = extractFromCache(meta.images);\n\t\t\t\tif (textures.length > 0) data.textures = textures;\n\t\t\t\tif (images.length > 0) data.images = images;\n\t\t\t}\n\n\t\t\treturn data;\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new this.constructor().copy(this);\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tthis.name = source.name;\n\t\t\tthis.fog = source.fog;\n\t\t\tthis.blending = source.blending;\n\t\t\tthis.side = source.side;\n\t\t\tthis.vertexColors = source.vertexColors;\n\t\t\tthis.opacity = source.opacity;\n\t\t\tthis.format = source.format;\n\t\t\tthis.transparent = source.transparent;\n\t\t\tthis.blendSrc = source.blendSrc;\n\t\t\tthis.blendDst = source.blendDst;\n\t\t\tthis.blendEquation = source.blendEquation;\n\t\t\tthis.blendSrcAlpha = source.blendSrcAlpha;\n\t\t\tthis.blendDstAlpha = source.blendDstAlpha;\n\t\t\tthis.blendEquationAlpha = source.blendEquationAlpha;\n\t\t\tthis.depthFunc = source.depthFunc;\n\t\t\tthis.depthTest = source.depthTest;\n\t\t\tthis.depthWrite = source.depthWrite;\n\t\t\tthis.stencilWriteMask = source.stencilWriteMask;\n\t\t\tthis.stencilFunc = source.stencilFunc;\n\t\t\tthis.stencilRef = source.stencilRef;\n\t\t\tthis.stencilFuncMask = source.stencilFuncMask;\n\t\t\tthis.stencilFail = source.stencilFail;\n\t\t\tthis.stencilZFail = source.stencilZFail;\n\t\t\tthis.stencilZPass = source.stencilZPass;\n\t\t\tthis.stencilWrite = source.stencilWrite;\n\t\t\tconst srcPlanes = source.clippingPlanes;\n\t\t\tlet dstPlanes = null;\n\n\t\t\tif (srcPlanes !== null) {\n\t\t\t\tconst n = srcPlanes.length;\n\t\t\t\tdstPlanes = new Array(n);\n\n\t\t\t\tfor (let i = 0; i !== n; ++i) {\n\t\t\t\t\tdstPlanes[i] = srcPlanes[i].clone();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.clippingPlanes = dstPlanes;\n\t\t\tthis.clipIntersection = source.clipIntersection;\n\t\t\tthis.clipShadows = source.clipShadows;\n\t\t\tthis.shadowSide = source.shadowSide;\n\t\t\tthis.colorWrite = source.colorWrite;\n\t\t\tthis.precision = source.precision;\n\t\t\tthis.polygonOffset = source.polygonOffset;\n\t\t\tthis.polygonOffsetFactor = source.polygonOffsetFactor;\n\t\t\tthis.polygonOffsetUnits = source.polygonOffsetUnits;\n\t\t\tthis.dithering = source.dithering;\n\t\t\tthis.alphaTest = source.alphaTest;\n\t\t\tthis.alphaToCoverage = source.alphaToCoverage;\n\t\t\tthis.premultipliedAlpha = source.premultipliedAlpha;\n\t\t\tthis.visible = source.visible;\n\t\t\tthis.toneMapped = source.toneMapped;\n\t\t\tthis.userData = JSON.parse(JSON.stringify(source.userData));\n\t\t\treturn this;\n\t\t}\n\n\t\tdispose() {\n\t\t\tthis.dispatchEvent({\n\t\t\t\ttype: 'dispose'\n\t\t\t});\n\t\t}\n\n\t\tset needsUpdate(value) {\n\t\t\tif (value === true) this.version++;\n\t\t}\n\n\t}\n\n\tMaterial.prototype.isMaterial = true;\n\n\tconst _colorKeywords = {\n\t\t'aliceblue': 0xF0F8FF,\n\t\t'antiquewhite': 0xFAEBD7,\n\t\t'aqua': 0x00FFFF,\n\t\t'aquamarine': 0x7FFFD4,\n\t\t'azure': 0xF0FFFF,\n\t\t'beige': 0xF5F5DC,\n\t\t'bisque': 0xFFE4C4,\n\t\t'black': 0x000000,\n\t\t'blanchedalmond': 0xFFEBCD,\n\t\t'blue': 0x0000FF,\n\t\t'blueviolet': 0x8A2BE2,\n\t\t'brown': 0xA52A2A,\n\t\t'burlywood': 0xDEB887,\n\t\t'cadetblue': 0x5F9EA0,\n\t\t'chartreuse': 0x7FFF00,\n\t\t'chocolate': 0xD2691E,\n\t\t'coral': 0xFF7F50,\n\t\t'cornflowerblue': 0x6495ED,\n\t\t'cornsilk': 0xFFF8DC,\n\t\t'crimson': 0xDC143C,\n\t\t'cyan': 0x00FFFF,\n\t\t'darkblue': 0x00008B,\n\t\t'darkcyan': 0x008B8B,\n\t\t'darkgoldenrod': 0xB8860B,\n\t\t'darkgray': 0xA9A9A9,\n\t\t'darkgreen': 0x006400,\n\t\t'darkgrey': 0xA9A9A9,\n\t\t'darkkhaki': 0xBDB76B,\n\t\t'darkmagenta': 0x8B008B,\n\t\t'darkolivegreen': 0x556B2F,\n\t\t'darkorange': 0xFF8C00,\n\t\t'darkorchid': 0x9932CC,\n\t\t'darkred': 0x8B0000,\n\t\t'darksalmon': 0xE9967A,\n\t\t'darkseagreen': 0x8FBC8F,\n\t\t'darkslateblue': 0x483D8B,\n\t\t'darkslategray': 0x2F4F4F,\n\t\t'darkslategrey': 0x2F4F4F,\n\t\t'darkturquoise': 0x00CED1,\n\t\t'darkviolet': 0x9400D3,\n\t\t'deeppink': 0xFF1493,\n\t\t'deepskyblue': 0x00BFFF,\n\t\t'dimgray': 0x696969,\n\t\t'dimgrey': 0x696969,\n\t\t'dodgerblue': 0x1E90FF,\n\t\t'firebrick': 0xB22222,\n\t\t'floralwhite': 0xFFFAF0,\n\t\t'forestgreen': 0x228B22,\n\t\t'fuchsia': 0xFF00FF,\n\t\t'gainsboro': 0xDCDCDC,\n\t\t'ghostwhite': 0xF8F8FF,\n\t\t'gold': 0xFFD700,\n\t\t'goldenrod': 0xDAA520,\n\t\t'gray': 0x808080,\n\t\t'green': 0x008000,\n\t\t'greenyellow': 0xADFF2F,\n\t\t'grey': 0x808080,\n\t\t'honeydew': 0xF0FFF0,\n\t\t'hotpink': 0xFF69B4,\n\t\t'indianred': 0xCD5C5C,\n\t\t'indigo': 0x4B0082,\n\t\t'ivory': 0xFFFFF0,\n\t\t'khaki': 0xF0E68C,\n\t\t'lavender': 0xE6E6FA,\n\t\t'lavenderblush': 0xFFF0F5,\n\t\t'lawngreen': 0x7CFC00,\n\t\t'lemonchiffon': 0xFFFACD,\n\t\t'lightblue': 0xADD8E6,\n\t\t'lightcoral': 0xF08080,\n\t\t'lightcyan': 0xE0FFFF,\n\t\t'lightgoldenrodyellow': 0xFAFAD2,\n\t\t'lightgray': 0xD3D3D3,\n\t\t'lightgreen': 0x90EE90,\n\t\t'lightgrey': 0xD3D3D3,\n\t\t'lightpink': 0xFFB6C1,\n\t\t'lightsalmon': 0xFFA07A,\n\t\t'lightseagreen': 0x20B2AA,\n\t\t'lightskyblue': 0x87CEFA,\n\t\t'lightslategray': 0x778899,\n\t\t'lightslategrey': 0x778899,\n\t\t'lightsteelblue': 0xB0C4DE,\n\t\t'lightyellow': 0xFFFFE0,\n\t\t'lime': 0x00FF00,\n\t\t'limegreen': 0x32CD32,\n\t\t'linen': 0xFAF0E6,\n\t\t'magenta': 0xFF00FF,\n\t\t'maroon': 0x800000,\n\t\t'mediumaquamarine': 0x66CDAA,\n\t\t'mediumblue': 0x0000CD,\n\t\t'mediumorchid': 0xBA55D3,\n\t\t'mediumpurple': 0x9370DB,\n\t\t'mediumseagreen': 0x3CB371,\n\t\t'mediumslateblue': 0x7B68EE,\n\t\t'mediumspringgreen': 0x00FA9A,\n\t\t'mediumturquoise': 0x48D1CC,\n\t\t'mediumvioletred': 0xC71585,\n\t\t'midnightblue': 0x191970,\n\t\t'mintcream': 0xF5FFFA,\n\t\t'mistyrose': 0xFFE4E1,\n\t\t'moccasin': 0xFFE4B5,\n\t\t'navajowhite': 0xFFDEAD,\n\t\t'navy': 0x000080,\n\t\t'oldlace': 0xFDF5E6,\n\t\t'olive': 0x808000,\n\t\t'olivedrab': 0x6B8E23,\n\t\t'orange': 0xFFA500,\n\t\t'orangered': 0xFF4500,\n\t\t'orchid': 0xDA70D6,\n\t\t'palegoldenrod': 0xEEE8AA,\n\t\t'palegreen': 0x98FB98,\n\t\t'paleturquoise': 0xAFEEEE,\n\t\t'palevioletred': 0xDB7093,\n\t\t'papayawhip': 0xFFEFD5,\n\t\t'peachpuff': 0xFFDAB9,\n\t\t'peru': 0xCD853F,\n\t\t'pink': 0xFFC0CB,\n\t\t'plum': 0xDDA0DD,\n\t\t'powderblue': 0xB0E0E6,\n\t\t'purple': 0x800080,\n\t\t'rebeccapurple': 0x663399,\n\t\t'red': 0xFF0000,\n\t\t'rosybrown': 0xBC8F8F,\n\t\t'royalblue': 0x4169E1,\n\t\t'saddlebrown': 0x8B4513,\n\t\t'salmon': 0xFA8072,\n\t\t'sandybrown': 0xF4A460,\n\t\t'seagreen': 0x2E8B57,\n\t\t'seashell': 0xFFF5EE,\n\t\t'sienna': 0xA0522D,\n\t\t'silver': 0xC0C0C0,\n\t\t'skyblue': 0x87CEEB,\n\t\t'slateblue': 0x6A5ACD,\n\t\t'slategray': 0x708090,\n\t\t'slategrey': 0x708090,\n\t\t'snow': 0xFFFAFA,\n\t\t'springgreen': 0x00FF7F,\n\t\t'steelblue': 0x4682B4,\n\t\t'tan': 0xD2B48C,\n\t\t'teal': 0x008080,\n\t\t'thistle': 0xD8BFD8,\n\t\t'tomato': 0xFF6347,\n\t\t'turquoise': 0x40E0D0,\n\t\t'violet': 0xEE82EE,\n\t\t'wheat': 0xF5DEB3,\n\t\t'white': 0xFFFFFF,\n\t\t'whitesmoke': 0xF5F5F5,\n\t\t'yellow': 0xFFFF00,\n\t\t'yellowgreen': 0x9ACD32\n\t};\n\tconst _hslA = {\n\t\th: 0,\n\t\ts: 0,\n\t\tl: 0\n\t};\n\tconst _hslB = {\n\t\th: 0,\n\t\ts: 0,\n\t\tl: 0\n\t};\n\n\tfunction hue2rgb(p, q, t) {\n\t\tif (t < 0) t += 1;\n\t\tif (t > 1) t -= 1;\n\t\tif (t < 1 / 6) return p + (q - p) * 6 * t;\n\t\tif (t < 1 / 2) return q;\n\t\tif (t < 2 / 3) return p + (q - p) * 6 * (2 / 3 - t);\n\t\treturn p;\n\t}\n\n\tfunction SRGBToLinear(c) {\n\t\treturn c < 0.04045 ? c * 0.0773993808 : Math.pow(c * 0.9478672986 + 0.0521327014, 2.4);\n\t}\n\n\tfunction LinearToSRGB(c) {\n\t\treturn c < 0.0031308 ? c * 12.92 : 1.055 * Math.pow(c, 0.41666) - 0.055;\n\t}\n\n\tclass Color {\n\t\tconstructor(r, g, b) {\n\t\t\tif (g === undefined && b === undefined) {\n\t\t\t\t// r is THREE.Color, hex or string\n\t\t\t\treturn this.set(r);\n\t\t\t}\n\n\t\t\treturn this.setRGB(r, g, b);\n\t\t}\n\n\t\tset(value) {\n\t\t\tif (value && value.isColor) {\n\t\t\t\tthis.copy(value);\n\t\t\t} else if (typeof value === 'number') {\n\t\t\t\tthis.setHex(value);\n\t\t\t} else if (typeof value === 'string') {\n\t\t\t\tthis.setStyle(value);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tsetScalar(scalar) {\n\t\t\tthis.r = scalar;\n\t\t\tthis.g = scalar;\n\t\t\tthis.b = scalar;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetHex(hex) {\n\t\t\thex = Math.floor(hex);\n\t\t\tthis.r = (hex >> 16 & 255) / 255;\n\t\t\tthis.g = (hex >> 8 & 255) / 255;\n\t\t\tthis.b = (hex & 255) / 255;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetRGB(r, g, b) {\n\t\t\tthis.r = r;\n\t\t\tthis.g = g;\n\t\t\tthis.b = b;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetHSL(h, s, l) {\n\t\t\t// h,s,l ranges are in 0.0 - 1.0\n\t\t\th = euclideanModulo(h, 1);\n\t\t\ts = clamp(s, 0, 1);\n\t\t\tl = clamp(l, 0, 1);\n\n\t\t\tif (s === 0) {\n\t\t\t\tthis.r = this.g = this.b = l;\n\t\t\t} else {\n\t\t\t\tconst p = l <= 0.5 ? l * (1 + s) : l + s - l * s;\n\t\t\t\tconst q = 2 * l - p;\n\t\t\t\tthis.r = hue2rgb(q, p, h + 1 / 3);\n\t\t\t\tthis.g = hue2rgb(q, p, h);\n\t\t\t\tthis.b = hue2rgb(q, p, h - 1 / 3);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tsetStyle(style) {\n\t\t\tfunction handleAlpha(string) {\n\t\t\t\tif (string === undefined) return;\n\n\t\t\t\tif (parseFloat(string) < 1) {\n\t\t\t\t\tconsole.warn('THREE.Color: Alpha component of ' + style + ' will be ignored.');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet m;\n\n\t\t\tif (m = /^((?:rgb|hsl)a?)\\(([^\\)]*)\\)/.exec(style)) {\n\t\t\t\t// rgb / hsl\n\t\t\t\tlet color;\n\t\t\t\tconst name = m[1];\n\t\t\t\tconst components = m[2];\n\n\t\t\t\tswitch (name) {\n\t\t\t\t\tcase 'rgb':\n\t\t\t\t\tcase 'rgba':\n\t\t\t\t\t\tif (color = /^\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec(components)) {\n\t\t\t\t\t\t\t// rgb(255,0,0) rgba(255,0,0,0.5)\n\t\t\t\t\t\t\tthis.r = Math.min(255, parseInt(color[1], 10)) / 255;\n\t\t\t\t\t\t\tthis.g = Math.min(255, parseInt(color[2], 10)) / 255;\n\t\t\t\t\t\t\tthis.b = Math.min(255, parseInt(color[3], 10)) / 255;\n\t\t\t\t\t\t\thandleAlpha(color[4]);\n\t\t\t\t\t\t\treturn this;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (color = /^\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec(components)) {\n\t\t\t\t\t\t\t// rgb(100%,0%,0%) rgba(100%,0%,0%,0.5)\n\t\t\t\t\t\t\tthis.r = Math.min(100, parseInt(color[1], 10)) / 100;\n\t\t\t\t\t\t\tthis.g = Math.min(100, parseInt(color[2], 10)) / 100;\n\t\t\t\t\t\t\tthis.b = Math.min(100, parseInt(color[3], 10)) / 100;\n\t\t\t\t\t\t\thandleAlpha(color[4]);\n\t\t\t\t\t\t\treturn this;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'hsl':\n\t\t\t\t\tcase 'hsla':\n\t\t\t\t\t\tif (color = /^\\s*(\\d*\\.?\\d+)\\s*,\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec(components)) {\n\t\t\t\t\t\t\t// hsl(120,50%,50%) hsla(120,50%,50%,0.5)\n\t\t\t\t\t\t\tconst h = parseFloat(color[1]) / 360;\n\t\t\t\t\t\t\tconst s = parseInt(color[2], 10) / 100;\n\t\t\t\t\t\t\tconst l = parseInt(color[3], 10) / 100;\n\t\t\t\t\t\t\thandleAlpha(color[4]);\n\t\t\t\t\t\t\treturn this.setHSL(h, s, l);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else if (m = /^\\#([A-Fa-f\\d]+)$/.exec(style)) {\n\t\t\t\t// hex color\n\t\t\t\tconst hex = m[1];\n\t\t\t\tconst size = hex.length;\n\n\t\t\t\tif (size === 3) {\n\t\t\t\t\t// #ff0\n\t\t\t\t\tthis.r = parseInt(hex.charAt(0) + hex.charAt(0), 16) / 255;\n\t\t\t\t\tthis.g = parseInt(hex.charAt(1) + hex.charAt(1), 16) / 255;\n\t\t\t\t\tthis.b = parseInt(hex.charAt(2) + hex.charAt(2), 16) / 255;\n\t\t\t\t\treturn this;\n\t\t\t\t} else if (size === 6) {\n\t\t\t\t\t// #ff0000\n\t\t\t\t\tthis.r = parseInt(hex.charAt(0) + hex.charAt(1), 16) / 255;\n\t\t\t\t\tthis.g = parseInt(hex.charAt(2) + hex.charAt(3), 16) / 255;\n\t\t\t\t\tthis.b = parseInt(hex.charAt(4) + hex.charAt(5), 16) / 255;\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (style && style.length > 0) {\n\t\t\t\treturn this.setColorName(style);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tsetColorName(style) {\n\t\t\t// color keywords\n\t\t\tconst hex = _colorKeywords[style.toLowerCase()];\n\n\t\t\tif (hex !== undefined) {\n\t\t\t\t// red\n\t\t\t\tthis.setHex(hex);\n\t\t\t} else {\n\t\t\t\t// unknown color\n\t\t\t\tconsole.warn('THREE.Color: Unknown color ' + style);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new this.constructor(this.r, this.g, this.b);\n\t\t}\n\n\t\tcopy(color) {\n\t\t\tthis.r = color.r;\n\t\t\tthis.g = color.g;\n\t\t\tthis.b = color.b;\n\t\t\treturn this;\n\t\t}\n\n\t\tcopyGammaToLinear(color, gammaFactor = 2.0) {\n\t\t\tthis.r = Math.pow(color.r, gammaFactor);\n\t\t\tthis.g = Math.pow(color.g, gammaFactor);\n\t\t\tthis.b = Math.pow(color.b, gammaFactor);\n\t\t\treturn this;\n\t\t}\n\n\t\tcopyLinearToGamma(color, gammaFactor = 2.0) {\n\t\t\tconst safeInverse = gammaFactor > 0 ? 1.0 / gammaFactor : 1.0;\n\t\t\tthis.r = Math.pow(color.r, safeInverse);\n\t\t\tthis.g = Math.pow(color.g, safeInverse);\n\t\t\tthis.b = Math.pow(color.b, safeInverse);\n\t\t\treturn this;\n\t\t}\n\n\t\tconvertGammaToLinear(gammaFactor) {\n\t\t\tthis.copyGammaToLinear(this, gammaFactor);\n\t\t\treturn this;\n\t\t}\n\n\t\tconvertLinearToGamma(gammaFactor) {\n\t\t\tthis.copyLinearToGamma(this, gammaFactor);\n\t\t\treturn this;\n\t\t}\n\n\t\tcopySRGBToLinear(color) {\n\t\t\tthis.r = SRGBToLinear(color.r);\n\t\t\tthis.g = SRGBToLinear(color.g);\n\t\t\tthis.b = SRGBToLinear(color.b);\n\t\t\treturn this;\n\t\t}\n\n\t\tcopyLinearToSRGB(color) {\n\t\t\tthis.r = LinearToSRGB(color.r);\n\t\t\tthis.g = LinearToSRGB(color.g);\n\t\t\tthis.b = LinearToSRGB(color.b);\n\t\t\treturn this;\n\t\t}\n\n\t\tconvertSRGBToLinear() {\n\t\t\tthis.copySRGBToLinear(this);\n\t\t\treturn this;\n\t\t}\n\n\t\tconvertLinearToSRGB() {\n\t\t\tthis.copyLinearToSRGB(this);\n\t\t\treturn this;\n\t\t}\n\n\t\tgetHex() {\n\t\t\treturn this.r * 255 << 16 ^ this.g * 255 << 8 ^ this.b * 255 << 0;\n\t\t}\n\n\t\tgetHexString() {\n\t\t\treturn ('000000' + this.getHex().toString(16)).slice(-6);\n\t\t}\n\n\t\tgetHSL(target) {\n\t\t\t// h,s,l ranges are in 0.0 - 1.0\n\t\t\tconst r = this.r,\n\t\t\t\t\t\tg = this.g,\n\t\t\t\t\t\tb = this.b;\n\t\t\tconst max = Math.max(r, g, b);\n\t\t\tconst min = Math.min(r, g, b);\n\t\t\tlet hue, saturation;\n\t\t\tconst lightness = (min + max) / 2.0;\n\n\t\t\tif (min === max) {\n\t\t\t\thue = 0;\n\t\t\t\tsaturation = 0;\n\t\t\t} else {\n\t\t\t\tconst delta = max - min;\n\t\t\t\tsaturation = lightness <= 0.5 ? delta / (max + min) : delta / (2 - max - min);\n\n\t\t\t\tswitch (max) {\n\t\t\t\t\tcase r:\n\t\t\t\t\t\thue = (g - b) / delta + (g < b ? 6 : 0);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase g:\n\t\t\t\t\t\thue = (b - r) / delta + 2;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase b:\n\t\t\t\t\t\thue = (r - g) / delta + 4;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\thue /= 6;\n\t\t\t}\n\n\t\t\ttarget.h = hue;\n\t\t\ttarget.s = saturation;\n\t\t\ttarget.l = lightness;\n\t\t\treturn target;\n\t\t}\n\n\t\tgetStyle() {\n\t\t\treturn 'rgb(' + (this.r * 255 | 0) + ',' + (this.g * 255 | 0) + ',' + (this.b * 255 | 0) + ')';\n\t\t}\n\n\t\toffsetHSL(h, s, l) {\n\t\t\tthis.getHSL(_hslA);\n\t\t\t_hslA.h += h;\n\t\t\t_hslA.s += s;\n\t\t\t_hslA.l += l;\n\t\t\tthis.setHSL(_hslA.h, _hslA.s, _hslA.l);\n\t\t\treturn this;\n\t\t}\n\n\t\tadd(color) {\n\t\t\tthis.r += color.r;\n\t\t\tthis.g += color.g;\n\t\t\tthis.b += color.b;\n\t\t\treturn this;\n\t\t}\n\n\t\taddColors(color1, color2) {\n\t\t\tthis.r = color1.r + color2.r;\n\t\t\tthis.g = color1.g + color2.g;\n\t\t\tthis.b = color1.b + color2.b;\n\t\t\treturn this;\n\t\t}\n\n\t\taddScalar(s) {\n\t\t\tthis.r += s;\n\t\t\tthis.g += s;\n\t\t\tthis.b += s;\n\t\t\treturn this;\n\t\t}\n\n\t\tsub(color) {\n\t\t\tthis.r = Math.max(0, this.r - color.r);\n\t\t\tthis.g = Math.max(0, this.g - color.g);\n\t\t\tthis.b = Math.max(0, this.b - color.b);\n\t\t\treturn this;\n\t\t}\n\n\t\tmultiply(color) {\n\t\t\tthis.r *= color.r;\n\t\t\tthis.g *= color.g;\n\t\t\tthis.b *= color.b;\n\t\t\treturn this;\n\t\t}\n\n\t\tmultiplyScalar(s) {\n\t\t\tthis.r *= s;\n\t\t\tthis.g *= s;\n\t\t\tthis.b *= s;\n\t\t\treturn this;\n\t\t}\n\n\t\tlerp(color, alpha) {\n\t\t\tthis.r += (color.r - this.r) * alpha;\n\t\t\tthis.g += (color.g - this.g) * alpha;\n\t\t\tthis.b += (color.b - this.b) * alpha;\n\t\t\treturn this;\n\t\t}\n\n\t\tlerpColors(color1, color2, alpha) {\n\t\t\tthis.r = color1.r + (color2.r - color1.r) * alpha;\n\t\t\tthis.g = color1.g + (color2.g - color1.g) * alpha;\n\t\t\tthis.b = color1.b + (color2.b - color1.b) * alpha;\n\t\t\treturn this;\n\t\t}\n\n\t\tlerpHSL(color, alpha) {\n\t\t\tthis.getHSL(_hslA);\n\t\t\tcolor.getHSL(_hslB);\n\t\t\tconst h = lerp(_hslA.h, _hslB.h, alpha);\n\t\t\tconst s = lerp(_hslA.s, _hslB.s, alpha);\n\t\t\tconst l = lerp(_hslA.l, _hslB.l, alpha);\n\t\t\tthis.setHSL(h, s, l);\n\t\t\treturn this;\n\t\t}\n\n\t\tequals(c) {\n\t\t\treturn c.r === this.r && c.g === this.g && c.b === this.b;\n\t\t}\n\n\t\tfromArray(array, offset = 0) {\n\t\t\tthis.r = array[offset];\n\t\t\tthis.g = array[offset + 1];\n\t\t\tthis.b = array[offset + 2];\n\t\t\treturn this;\n\t\t}\n\n\t\ttoArray(array = [], offset = 0) {\n\t\t\tarray[offset] = this.r;\n\t\t\tarray[offset + 1] = this.g;\n\t\t\tarray[offset + 2] = this.b;\n\t\t\treturn array;\n\t\t}\n\n\t\tfromBufferAttribute(attribute, index) {\n\t\t\tthis.r = attribute.getX(index);\n\t\t\tthis.g = attribute.getY(index);\n\t\t\tthis.b = attribute.getZ(index);\n\n\t\t\tif (attribute.normalized === true) {\n\t\t\t\t// assuming Uint8Array\n\t\t\t\tthis.r /= 255;\n\t\t\t\tthis.g /= 255;\n\t\t\t\tthis.b /= 255;\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\ttoJSON() {\n\t\t\treturn this.getHex();\n\t\t}\n\n\t}\n\n\tColor.NAMES = _colorKeywords;\n\tColor.prototype.isColor = true;\n\tColor.prototype.r = 1;\n\tColor.prototype.g = 1;\n\tColor.prototype.b = 1;\n\n\t/**\n\t * parameters = {\n\t *\tcolor: <hex>,\n\t *\topacity: <float>,\n\t *\tmap: new THREE.Texture( <Image> ),\n\t *\n\t *\tlightMap: new THREE.Texture( <Image> ),\n\t *\tlightMapIntensity: <float>\n\t *\n\t *\taoMap: new THREE.Texture( <Image> ),\n\t *\taoMapIntensity: <float>\n\t *\n\t *\tspecularMap: new THREE.Texture( <Image> ),\n\t *\n\t *\talphaMap: new THREE.Texture( <Image> ),\n\t *\n\t *\tenvMap: new THREE.CubeTexture( [posx, negx, posy, negy, posz, negz] ),\n\t *\tcombine: THREE.Multiply,\n\t *\treflectivity: <float>,\n\t *\trefractionRatio: <float>,\n\t *\n\t *\tdepthTest: <bool>,\n\t *\tdepthWrite: <bool>,\n\t *\n\t *\twireframe: <boolean>,\n\t *\twireframeLinewidth: <float>,\n\t * }\n\t */\n\n\tclass MeshBasicMaterial extends Material {\n\t\tconstructor(parameters) {\n\t\t\tsuper();\n\t\t\tthis.type = 'MeshBasicMaterial';\n\t\t\tthis.color = new Color(0xffffff); // emissive\n\n\t\t\tthis.map = null;\n\t\t\tthis.lightMap = null;\n\t\t\tthis.lightMapIntensity = 1.0;\n\t\t\tthis.aoMap = null;\n\t\t\tthis.aoMapIntensity = 1.0;\n\t\t\tthis.specularMap = null;\n\t\t\tthis.alphaMap = null;\n\t\t\tthis.envMap = null;\n\t\t\tthis.combine = MultiplyOperation;\n\t\t\tthis.reflectivity = 1;\n\t\t\tthis.refractionRatio = 0.98;\n\t\t\tthis.wireframe = false;\n\t\t\tthis.wireframeLinewidth = 1;\n\t\t\tthis.wireframeLinecap = 'round';\n\t\t\tthis.wireframeLinejoin = 'round';\n\t\t\tthis.setValues(parameters);\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.color.copy(source.color);\n\t\t\tthis.map = source.map;\n\t\t\tthis.lightMap = source.lightMap;\n\t\t\tthis.lightMapIntensity = source.lightMapIntensity;\n\t\t\tthis.aoMap = source.aoMap;\n\t\t\tthis.aoMapIntensity = source.aoMapIntensity;\n\t\t\tthis.specularMap = source.specularMap;\n\t\t\tthis.alphaMap = source.alphaMap;\n\t\t\tthis.envMap = source.envMap;\n\t\t\tthis.combine = source.combine;\n\t\t\tthis.reflectivity = source.reflectivity;\n\t\t\tthis.refractionRatio = source.refractionRatio;\n\t\t\tthis.wireframe = source.wireframe;\n\t\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\t\t\tthis.wireframeLinecap = source.wireframeLinecap;\n\t\t\tthis.wireframeLinejoin = source.wireframeLinejoin;\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tMeshBasicMaterial.prototype.isMeshBasicMaterial = true;\n\n\tconst _vector$9 = /*@__PURE__*/new Vector3();\n\n\tconst _vector2$1 = /*@__PURE__*/new Vector2();\n\n\tclass BufferAttribute {\n\t\tconstructor(array, itemSize, normalized) {\n\t\t\tif (Array.isArray(array)) {\n\t\t\t\tthrow new TypeError('THREE.BufferAttribute: array should be a Typed Array.');\n\t\t\t}\n\n\t\t\tthis.name = '';\n\t\t\tthis.array = array;\n\t\t\tthis.itemSize = itemSize;\n\t\t\tthis.count = array !== undefined ? array.length / itemSize : 0;\n\t\t\tthis.normalized = normalized === true;\n\t\t\tthis.usage = StaticDrawUsage;\n\t\t\tthis.updateRange = {\n\t\t\t\toffset: 0,\n\t\t\t\tcount: -1\n\t\t\t};\n\t\t\tthis.version = 0;\n\t\t}\n\n\t\tonUploadCallback() {}\n\n\t\tset needsUpdate(value) {\n\t\t\tif (value === true) this.version++;\n\t\t}\n\n\t\tsetUsage(value) {\n\t\t\tthis.usage = value;\n\t\t\treturn this;\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tthis.name = source.name;\n\t\t\tthis.array = new source.array.constructor(source.array);\n\t\t\tthis.itemSize = source.itemSize;\n\t\t\tthis.count = source.count;\n\t\t\tthis.normalized = source.normalized;\n\t\t\tthis.usage = source.usage;\n\t\t\treturn this;\n\t\t}\n\n\t\tcopyAt(index1, attribute, index2) {\n\t\t\tindex1 *= this.itemSize;\n\t\t\tindex2 *= attribute.itemSize;\n\n\t\t\tfor (let i = 0, l = this.itemSize; i < l; i++) {\n\t\t\t\tthis.array[index1 + i] = attribute.array[index2 + i];\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tcopyArray(array) {\n\t\t\tthis.array.set(array);\n\t\t\treturn this;\n\t\t}\n\n\t\tcopyColorsArray(colors) {\n\t\t\tconst array = this.array;\n\t\t\tlet offset = 0;\n\n\t\t\tfor (let i = 0, l = colors.length; i < l; i++) {\n\t\t\t\tlet color = colors[i];\n\n\t\t\t\tif (color === undefined) {\n\t\t\t\t\tconsole.warn('THREE.BufferAttribute.copyColorsArray(): color is undefined', i);\n\t\t\t\t\tcolor = new Color();\n\t\t\t\t}\n\n\t\t\t\tarray[offset++] = color.r;\n\t\t\t\tarray[offset++] = color.g;\n\t\t\t\tarray[offset++] = color.b;\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tcopyVector2sArray(vectors) {\n\t\t\tconst array = this.array;\n\t\t\tlet offset = 0;\n\n\t\t\tfor (let i = 0, l = vectors.length; i < l; i++) {\n\t\t\t\tlet vector = vectors[i];\n\n\t\t\t\tif (vector === undefined) {\n\t\t\t\t\tconsole.warn('THREE.BufferAttribute.copyVector2sArray(): vector is undefined', i);\n\t\t\t\t\tvector = new Vector2();\n\t\t\t\t}\n\n\t\t\t\tarray[offset++] = vector.x;\n\t\t\t\tarray[offset++] = vector.y;\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tcopyVector3sArray(vectors) {\n\t\t\tconst array = this.array;\n\t\t\tlet offset = 0;\n\n\t\t\tfor (let i = 0, l = vectors.length; i < l; i++) {\n\t\t\t\tlet vector = vectors[i];\n\n\t\t\t\tif (vector === undefined) {\n\t\t\t\t\tconsole.warn('THREE.BufferAttribute.copyVector3sArray(): vector is undefined', i);\n\t\t\t\t\tvector = new Vector3();\n\t\t\t\t}\n\n\t\t\t\tarray[offset++] = vector.x;\n\t\t\t\tarray[offset++] = vector.y;\n\t\t\t\tarray[offset++] = vector.z;\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tcopyVector4sArray(vectors) {\n\t\t\tconst array = this.array;\n\t\t\tlet offset = 0;\n\n\t\t\tfor (let i = 0, l = vectors.length; i < l; i++) {\n\t\t\t\tlet vector = vectors[i];\n\n\t\t\t\tif (vector === undefined) {\n\t\t\t\t\tconsole.warn('THREE.BufferAttribute.copyVector4sArray(): vector is undefined', i);\n\t\t\t\t\tvector = new Vector4();\n\t\t\t\t}\n\n\t\t\t\tarray[offset++] = vector.x;\n\t\t\t\tarray[offset++] = vector.y;\n\t\t\t\tarray[offset++] = vector.z;\n\t\t\t\tarray[offset++] = vector.w;\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tapplyMatrix3(m) {\n\t\t\tif (this.itemSize === 2) {\n\t\t\t\tfor (let i = 0, l = this.count; i < l; i++) {\n\t\t\t\t\t_vector2$1.fromBufferAttribute(this, i);\n\n\t\t\t\t\t_vector2$1.applyMatrix3(m);\n\n\t\t\t\t\tthis.setXY(i, _vector2$1.x, _vector2$1.y);\n\t\t\t\t}\n\t\t\t} else if (this.itemSize === 3) {\n\t\t\t\tfor (let i = 0, l = this.count; i < l; i++) {\n\t\t\t\t\t_vector$9.fromBufferAttribute(this, i);\n\n\t\t\t\t\t_vector$9.applyMatrix3(m);\n\n\t\t\t\t\tthis.setXYZ(i, _vector$9.x, _vector$9.y, _vector$9.z);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tapplyMatrix4(m) {\n\t\t\tfor (let i = 0, l = this.count; i < l; i++) {\n\t\t\t\t_vector$9.x = this.getX(i);\n\t\t\t\t_vector$9.y = this.getY(i);\n\t\t\t\t_vector$9.z = this.getZ(i);\n\n\t\t\t\t_vector$9.applyMatrix4(m);\n\n\t\t\t\tthis.setXYZ(i, _vector$9.x, _vector$9.y, _vector$9.z);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tapplyNormalMatrix(m) {\n\t\t\tfor (let i = 0, l = this.count; i < l; i++) {\n\t\t\t\t_vector$9.x = this.getX(i);\n\t\t\t\t_vector$9.y = this.getY(i);\n\t\t\t\t_vector$9.z = this.getZ(i);\n\n\t\t\t\t_vector$9.applyNormalMatrix(m);\n\n\t\t\t\tthis.setXYZ(i, _vector$9.x, _vector$9.y, _vector$9.z);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\ttransformDirection(m) {\n\t\t\tfor (let i = 0, l = this.count; i < l; i++) {\n\t\t\t\t_vector$9.x = this.getX(i);\n\t\t\t\t_vector$9.y = this.getY(i);\n\t\t\t\t_vector$9.z = this.getZ(i);\n\n\t\t\t\t_vector$9.transformDirection(m);\n\n\t\t\t\tthis.setXYZ(i, _vector$9.x, _vector$9.y, _vector$9.z);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tset(value, offset = 0) {\n\t\t\tthis.array.set(value, offset);\n\t\t\treturn this;\n\t\t}\n\n\t\tgetX(index) {\n\t\t\treturn this.array[index * this.itemSize];\n\t\t}\n\n\t\tsetX(index, x) {\n\t\t\tthis.array[index * this.itemSize] = x;\n\t\t\treturn this;\n\t\t}\n\n\t\tgetY(index) {\n\t\t\treturn this.array[index * this.itemSize + 1];\n\t\t}\n\n\t\tsetY(index, y) {\n\t\t\tthis.array[index * this.itemSize + 1] = y;\n\t\t\treturn this;\n\t\t}\n\n\t\tgetZ(index) {\n\t\t\treturn this.array[index * this.itemSize + 2];\n\t\t}\n\n\t\tsetZ(index, z) {\n\t\t\tthis.array[index * this.itemSize + 2] = z;\n\t\t\treturn this;\n\t\t}\n\n\t\tgetW(index) {\n\t\t\treturn this.array[index * this.itemSize + 3];\n\t\t}\n\n\t\tsetW(index, w) {\n\t\t\tthis.array[index * this.itemSize + 3] = w;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetXY(index, x, y) {\n\t\t\tindex *= this.itemSize;\n\t\t\tthis.array[index + 0] = x;\n\t\t\tthis.array[index + 1] = y;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetXYZ(index, x, y, z) {\n\t\t\tindex *= this.itemSize;\n\t\t\tthis.array[index + 0] = x;\n\t\t\tthis.array[index + 1] = y;\n\t\t\tthis.array[index + 2] = z;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetXYZW(index, x, y, z, w) {\n\t\t\tindex *= this.itemSize;\n\t\t\tthis.array[index + 0] = x;\n\t\t\tthis.array[index + 1] = y;\n\t\t\tthis.array[index + 2] = z;\n\t\t\tthis.array[index + 3] = w;\n\t\t\treturn this;\n\t\t}\n\n\t\tonUpload(callback) {\n\t\t\tthis.onUploadCallback = callback;\n\t\t\treturn this;\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new this.constructor(this.array, this.itemSize).copy(this);\n\t\t}\n\n\t\ttoJSON() {\n\t\t\tconst data = {\n\t\t\t\titemSize: this.itemSize,\n\t\t\t\ttype: this.array.constructor.name,\n\t\t\t\tarray: Array.prototype.slice.call(this.array),\n\t\t\t\tnormalized: this.normalized\n\t\t\t};\n\t\t\tif (this.name !== '') data.name = this.name;\n\t\t\tif (this.usage !== StaticDrawUsage) data.usage = this.usage;\n\t\t\tif (this.updateRange.offset !== 0 || this.updateRange.count !== -1) data.updateRange = this.updateRange;\n\t\t\treturn data;\n\t\t}\n\n\t}\n\n\tBufferAttribute.prototype.isBufferAttribute = true; //\n\n\tclass Int8BufferAttribute extends BufferAttribute {\n\t\tconstructor(array, itemSize, normalized) {\n\t\t\tsuper(new Int8Array(array), itemSize, normalized);\n\t\t}\n\n\t}\n\n\tclass Uint8BufferAttribute extends BufferAttribute {\n\t\tconstructor(array, itemSize, normalized) {\n\t\t\tsuper(new Uint8Array(array), itemSize, normalized);\n\t\t}\n\n\t}\n\n\tclass Uint8ClampedBufferAttribute extends BufferAttribute {\n\t\tconstructor(array, itemSize, normalized) {\n\t\t\tsuper(new Uint8ClampedArray(array), itemSize, normalized);\n\t\t}\n\n\t}\n\n\tclass Int16BufferAttribute extends BufferAttribute {\n\t\tconstructor(array, itemSize, normalized) {\n\t\t\tsuper(new Int16Array(array), itemSize, normalized);\n\t\t}\n\n\t}\n\n\tclass Uint16BufferAttribute extends BufferAttribute {\n\t\tconstructor(array, itemSize, normalized) {\n\t\t\tsuper(new Uint16Array(array), itemSize, normalized);\n\t\t}\n\n\t}\n\n\tclass Int32BufferAttribute extends BufferAttribute {\n\t\tconstructor(array, itemSize, normalized) {\n\t\t\tsuper(new Int32Array(array), itemSize, normalized);\n\t\t}\n\n\t}\n\n\tclass Uint32BufferAttribute extends BufferAttribute {\n\t\tconstructor(array, itemSize, normalized) {\n\t\t\tsuper(new Uint32Array(array), itemSize, normalized);\n\t\t}\n\n\t}\n\n\tclass Float16BufferAttribute extends BufferAttribute {\n\t\tconstructor(array, itemSize, normalized) {\n\t\t\tsuper(new Uint16Array(array), itemSize, normalized);\n\t\t}\n\n\t}\n\n\tFloat16BufferAttribute.prototype.isFloat16BufferAttribute = true;\n\n\tclass Float32BufferAttribute extends BufferAttribute {\n\t\tconstructor(array, itemSize, normalized) {\n\t\t\tsuper(new Float32Array(array), itemSize, normalized);\n\t\t}\n\n\t}\n\n\tclass Float64BufferAttribute extends BufferAttribute {\n\t\tconstructor(array, itemSize, normalized) {\n\t\t\tsuper(new Float64Array(array), itemSize, normalized);\n\t\t}\n\n\t} //\n\n\tlet _id = 0;\n\n\tconst _m1 = /*@__PURE__*/new Matrix4();\n\n\tconst _obj = /*@__PURE__*/new Object3D();\n\n\tconst _offset = /*@__PURE__*/new Vector3();\n\n\tconst _box$1 = /*@__PURE__*/new Box3();\n\n\tconst _boxMorphTargets = /*@__PURE__*/new Box3();\n\n\tconst _vector$8 = /*@__PURE__*/new Vector3();\n\n\tclass BufferGeometry extends EventDispatcher {\n\t\tconstructor() {\n\t\t\tsuper();\n\t\t\tObject.defineProperty(this, 'id', {\n\t\t\t\tvalue: _id++\n\t\t\t});\n\t\t\tthis.uuid = generateUUID();\n\t\t\tthis.name = '';\n\t\t\tthis.type = 'BufferGeometry';\n\t\t\tthis.index = null;\n\t\t\tthis.attributes = {};\n\t\t\tthis.morphAttributes = {};\n\t\t\tthis.morphTargetsRelative = false;\n\t\t\tthis.groups = [];\n\t\t\tthis.boundingBox = null;\n\t\t\tthis.boundingSphere = null;\n\t\t\tthis.drawRange = {\n\t\t\t\tstart: 0,\n\t\t\t\tcount: Infinity\n\t\t\t};\n\t\t\tthis.userData = {};\n\t\t}\n\n\t\tgetIndex() {\n\t\t\treturn this.index;\n\t\t}\n\n\t\tsetIndex(index) {\n\t\t\tif (Array.isArray(index)) {\n\t\t\t\tthis.index = new (arrayMax(index) > 65535 ? Uint32BufferAttribute : Uint16BufferAttribute)(index, 1);\n\t\t\t} else {\n\t\t\t\tthis.index = index;\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tgetAttribute(name) {\n\t\t\treturn this.attributes[name];\n\t\t}\n\n\t\tsetAttribute(name, attribute) {\n\t\t\tthis.attributes[name] = attribute;\n\t\t\treturn this;\n\t\t}\n\n\t\tdeleteAttribute(name) {\n\t\t\tdelete this.attributes[name];\n\t\t\treturn this;\n\t\t}\n\n\t\thasAttribute(name) {\n\t\t\treturn this.attributes[name] !== undefined;\n\t\t}\n\n\t\taddGroup(start, count, materialIndex = 0) {\n\t\t\tthis.groups.push({\n\t\t\t\tstart: start,\n\t\t\t\tcount: count,\n\t\t\t\tmaterialIndex: materialIndex\n\t\t\t});\n\t\t}\n\n\t\tclearGroups() {\n\t\t\tthis.groups = [];\n\t\t}\n\n\t\tsetDrawRange(start, count) {\n\t\t\tthis.drawRange.start = start;\n\t\t\tthis.drawRange.count = count;\n\t\t}\n\n\t\tapplyMatrix4(matrix) {\n\t\t\tconst position = this.attributes.position;\n\n\t\t\tif (position !== undefined) {\n\t\t\t\tposition.applyMatrix4(matrix);\n\t\t\t\tposition.needsUpdate = true;\n\t\t\t}\n\n\t\t\tconst normal = this.attributes.normal;\n\n\t\t\tif (normal !== undefined) {\n\t\t\t\tconst normalMatrix = new Matrix3().getNormalMatrix(matrix);\n\t\t\t\tnormal.applyNormalMatrix(normalMatrix);\n\t\t\t\tnormal.needsUpdate = true;\n\t\t\t}\n\n\t\t\tconst tangent = this.attributes.tangent;\n\n\t\t\tif (tangent !== undefined) {\n\t\t\t\ttangent.transformDirection(matrix);\n\t\t\t\ttangent.needsUpdate = true;\n\t\t\t}\n\n\t\t\tif (this.boundingBox !== null) {\n\t\t\t\tthis.computeBoundingBox();\n\t\t\t}\n\n\t\t\tif (this.boundingSphere !== null) {\n\t\t\t\tthis.computeBoundingSphere();\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tapplyQuaternion(q) {\n\t\t\t_m1.makeRotationFromQuaternion(q);\n\n\t\t\tthis.applyMatrix4(_m1);\n\t\t\treturn this;\n\t\t}\n\n\t\trotateX(angle) {\n\t\t\t// rotate geometry around world x-axis\n\t\t\t_m1.makeRotationX(angle);\n\n\t\t\tthis.applyMatrix4(_m1);\n\t\t\treturn this;\n\t\t}\n\n\t\trotateY(angle) {\n\t\t\t// rotate geometry around world y-axis\n\t\t\t_m1.makeRotationY(angle);\n\n\t\t\tthis.applyMatrix4(_m1);\n\t\t\treturn this;\n\t\t}\n\n\t\trotateZ(angle) {\n\t\t\t// rotate geometry around world z-axis\n\t\t\t_m1.makeRotationZ(angle);\n\n\t\t\tthis.applyMatrix4(_m1);\n\t\t\treturn this;\n\t\t}\n\n\t\ttranslate(x, y, z) {\n\t\t\t// translate geometry\n\t\t\t_m1.makeTranslation(x, y, z);\n\n\t\t\tthis.applyMatrix4(_m1);\n\t\t\treturn this;\n\t\t}\n\n\t\tscale(x, y, z) {\n\t\t\t// scale geometry\n\t\t\t_m1.makeScale(x, y, z);\n\n\t\t\tthis.applyMatrix4(_m1);\n\t\t\treturn this;\n\t\t}\n\n\t\tlookAt(vector) {\n\t\t\t_obj.lookAt(vector);\n\n\t\t\t_obj.updateMatrix();\n\n\t\t\tthis.applyMatrix4(_obj.matrix);\n\t\t\treturn this;\n\t\t}\n\n\t\tcenter() {\n\t\t\tthis.computeBoundingBox();\n\t\t\tthis.boundingBox.getCenter(_offset).negate();\n\t\t\tthis.translate(_offset.x, _offset.y, _offset.z);\n\t\t\treturn this;\n\t\t}\n\n\t\tsetFromPoints(points) {\n\t\t\tconst position = [];\n\n\t\t\tfor (let i = 0, l = points.length; i < l; i++) {\n\t\t\t\tconst point = points[i];\n\t\t\t\tposition.push(point.x, point.y, point.z || 0);\n\t\t\t}\n\n\t\t\tthis.setAttribute('position', new Float32BufferAttribute(position, 3));\n\t\t\treturn this;\n\t\t}\n\n\t\tcomputeBoundingBox() {\n\t\t\tif (this.boundingBox === null) {\n\t\t\t\tthis.boundingBox = new Box3();\n\t\t\t}\n\n\t\t\tconst position = this.attributes.position;\n\t\t\tconst morphAttributesPosition = this.morphAttributes.position;\n\n\t\t\tif (position && position.isGLBufferAttribute) {\n\t\t\t\tconsole.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set \"mesh.frustumCulled\" to \"false\".', this);\n\t\t\t\tthis.boundingBox.set(new Vector3(-Infinity, -Infinity, -Infinity), new Vector3(+Infinity, +Infinity, +Infinity));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (position !== undefined) {\n\t\t\t\tthis.boundingBox.setFromBufferAttribute(position); // process morph attributes if present\n\n\t\t\t\tif (morphAttributesPosition) {\n\t\t\t\t\tfor (let i = 0, il = morphAttributesPosition.length; i < il; i++) {\n\t\t\t\t\t\tconst morphAttribute = morphAttributesPosition[i];\n\n\t\t\t\t\t\t_box$1.setFromBufferAttribute(morphAttribute);\n\n\t\t\t\t\t\tif (this.morphTargetsRelative) {\n\t\t\t\t\t\t\t_vector$8.addVectors(this.boundingBox.min, _box$1.min);\n\n\t\t\t\t\t\t\tthis.boundingBox.expandByPoint(_vector$8);\n\n\t\t\t\t\t\t\t_vector$8.addVectors(this.boundingBox.max, _box$1.max);\n\n\t\t\t\t\t\t\tthis.boundingBox.expandByPoint(_vector$8);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthis.boundingBox.expandByPoint(_box$1.min);\n\t\t\t\t\t\t\tthis.boundingBox.expandByPoint(_box$1.max);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.boundingBox.makeEmpty();\n\t\t\t}\n\n\t\t\tif (isNaN(this.boundingBox.min.x) || isNaN(this.boundingBox.min.y) || isNaN(this.boundingBox.min.z)) {\n\t\t\t\tconsole.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The \"position\" attribute is likely to have NaN values.', this);\n\t\t\t}\n\t\t}\n\n\t\tcomputeBoundingSphere() {\n\t\t\tif (this.boundingSphere === null) {\n\t\t\t\tthis.boundingSphere = new Sphere();\n\t\t\t}\n\n\t\t\tconst position = this.attributes.position;\n\t\t\tconst morphAttributesPosition = this.morphAttributes.position;\n\n\t\t\tif (position && position.isGLBufferAttribute) {\n\t\t\t\tconsole.error('THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set \"mesh.frustumCulled\" to \"false\".', this);\n\t\t\t\tthis.boundingSphere.set(new Vector3(), Infinity);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (position) {\n\t\t\t\t// first, find the center of the bounding sphere\n\t\t\t\tconst center = this.boundingSphere.center;\n\n\t\t\t\t_box$1.setFromBufferAttribute(position); // process morph attributes if present\n\n\n\t\t\t\tif (morphAttributesPosition) {\n\t\t\t\t\tfor (let i = 0, il = morphAttributesPosition.length; i < il; i++) {\n\t\t\t\t\t\tconst morphAttribute = morphAttributesPosition[i];\n\n\t\t\t\t\t\t_boxMorphTargets.setFromBufferAttribute(morphAttribute);\n\n\t\t\t\t\t\tif (this.morphTargetsRelative) {\n\t\t\t\t\t\t\t_vector$8.addVectors(_box$1.min, _boxMorphTargets.min);\n\n\t\t\t\t\t\t\t_box$1.expandByPoint(_vector$8);\n\n\t\t\t\t\t\t\t_vector$8.addVectors(_box$1.max, _boxMorphTargets.max);\n\n\t\t\t\t\t\t\t_box$1.expandByPoint(_vector$8);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t_box$1.expandByPoint(_boxMorphTargets.min);\n\n\t\t\t\t\t\t\t_box$1.expandByPoint(_boxMorphTargets.max);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t_box$1.getCenter(center); // second, try to find a boundingSphere with a radius smaller than the\n\t\t\t\t// boundingSphere of the boundingBox: sqrt(3) smaller in the best case\n\n\n\t\t\t\tlet maxRadiusSq = 0;\n\n\t\t\t\tfor (let i = 0, il = position.count; i < il; i++) {\n\t\t\t\t\t_vector$8.fromBufferAttribute(position, i);\n\n\t\t\t\t\tmaxRadiusSq = Math.max(maxRadiusSq, center.distanceToSquared(_vector$8));\n\t\t\t\t} // process morph attributes if present\n\n\n\t\t\t\tif (morphAttributesPosition) {\n\t\t\t\t\tfor (let i = 0, il = morphAttributesPosition.length; i < il; i++) {\n\t\t\t\t\t\tconst morphAttribute = morphAttributesPosition[i];\n\t\t\t\t\t\tconst morphTargetsRelative = this.morphTargetsRelative;\n\n\t\t\t\t\t\tfor (let j = 0, jl = morphAttribute.count; j < jl; j++) {\n\t\t\t\t\t\t\t_vector$8.fromBufferAttribute(morphAttribute, j);\n\n\t\t\t\t\t\t\tif (morphTargetsRelative) {\n\t\t\t\t\t\t\t\t_offset.fromBufferAttribute(position, j);\n\n\t\t\t\t\t\t\t\t_vector$8.add(_offset);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tmaxRadiusSq = Math.max(maxRadiusSq, center.distanceToSquared(_vector$8));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis.boundingSphere.radius = Math.sqrt(maxRadiusSq);\n\n\t\t\t\tif (isNaN(this.boundingSphere.radius)) {\n\t\t\t\t\tconsole.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The \"position\" attribute is likely to have NaN values.', this);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tcomputeTangents() {\n\t\t\tconst index = this.index;\n\t\t\tconst attributes = this.attributes; // based on http://www.terathon.com/code/tangent.html\n\t\t\t// (per vertex tangents)\n\n\t\t\tif (index === null || attributes.position === undefined || attributes.normal === undefined || attributes.uv === undefined) {\n\t\t\t\tconsole.error('THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst indices = index.array;\n\t\t\tconst positions = attributes.position.array;\n\t\t\tconst normals = attributes.normal.array;\n\t\t\tconst uvs = attributes.uv.array;\n\t\t\tconst nVertices = positions.length / 3;\n\n\t\t\tif (attributes.tangent === undefined) {\n\t\t\t\tthis.setAttribute('tangent', new BufferAttribute(new Float32Array(4 * nVertices), 4));\n\t\t\t}\n\n\t\t\tconst tangents = attributes.tangent.array;\n\t\t\tconst tan1 = [],\n\t\t\t\t\t\ttan2 = [];\n\n\t\t\tfor (let i = 0; i < nVertices; i++) {\n\t\t\t\ttan1[i] = new Vector3();\n\t\t\t\ttan2[i] = new Vector3();\n\t\t\t}\n\n\t\t\tconst vA = new Vector3(),\n\t\t\t\t\t\tvB = new Vector3(),\n\t\t\t\t\t\tvC = new Vector3(),\n\t\t\t\t\t\tuvA = new Vector2(),\n\t\t\t\t\t\tuvB = new Vector2(),\n\t\t\t\t\t\tuvC = new Vector2(),\n\t\t\t\t\t\tsdir = new Vector3(),\n\t\t\t\t\t\ttdir = new Vector3();\n\n\t\t\tfunction handleTriangle(a, b, c) {\n\t\t\t\tvA.fromArray(positions, a * 3);\n\t\t\t\tvB.fromArray(positions, b * 3);\n\t\t\t\tvC.fromArray(positions, c * 3);\n\t\t\t\tuvA.fromArray(uvs, a * 2);\n\t\t\t\tuvB.fromArray(uvs, b * 2);\n\t\t\t\tuvC.fromArray(uvs, c * 2);\n\t\t\t\tvB.sub(vA);\n\t\t\t\tvC.sub(vA);\n\t\t\t\tuvB.sub(uvA);\n\t\t\t\tuvC.sub(uvA);\n\t\t\t\tconst r = 1.0 / (uvB.x * uvC.y - uvC.x * uvB.y); // silently ignore degenerate uv triangles having coincident or colinear vertices\n\n\t\t\t\tif (!isFinite(r)) return;\n\t\t\t\tsdir.copy(vB).multiplyScalar(uvC.y).addScaledVector(vC, -uvB.y).multiplyScalar(r);\n\t\t\t\ttdir.copy(vC).multiplyScalar(uvB.x).addScaledVector(vB, -uvC.x).multiplyScalar(r);\n\t\t\t\ttan1[a].add(sdir);\n\t\t\t\ttan1[b].add(sdir);\n\t\t\t\ttan1[c].add(sdir);\n\t\t\t\ttan2[a].add(tdir);\n\t\t\t\ttan2[b].add(tdir);\n\t\t\t\ttan2[c].add(tdir);\n\t\t\t}\n\n\t\t\tlet groups = this.groups;\n\n\t\t\tif (groups.length === 0) {\n\t\t\t\tgroups = [{\n\t\t\t\t\tstart: 0,\n\t\t\t\t\tcount: indices.length\n\t\t\t\t}];\n\t\t\t}\n\n\t\t\tfor (let i = 0, il = groups.length; i < il; ++i) {\n\t\t\t\tconst group = groups[i];\n\t\t\t\tconst start = group.start;\n\t\t\t\tconst count = group.count;\n\n\t\t\t\tfor (let j = start, jl = start + count; j < jl; j += 3) {\n\t\t\t\t\thandleTriangle(indices[j + 0], indices[j + 1], indices[j + 2]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst tmp = new Vector3(),\n\t\t\t\t\t\ttmp2 = new Vector3();\n\t\t\tconst n = new Vector3(),\n\t\t\t\t\t\tn2 = new Vector3();\n\n\t\t\tfunction handleVertex(v) {\n\t\t\t\tn.fromArray(normals, v * 3);\n\t\t\t\tn2.copy(n);\n\t\t\t\tconst t = tan1[v]; // Gram-Schmidt orthogonalize\n\n\t\t\t\ttmp.copy(t);\n\t\t\t\ttmp.sub(n.multiplyScalar(n.dot(t))).normalize(); // Calculate handedness\n\n\t\t\t\ttmp2.crossVectors(n2, t);\n\t\t\t\tconst test = tmp2.dot(tan2[v]);\n\t\t\t\tconst w = test < 0.0 ? -1.0 : 1.0;\n\t\t\t\ttangents[v * 4] = tmp.x;\n\t\t\t\ttangents[v * 4 + 1] = tmp.y;\n\t\t\t\ttangents[v * 4 + 2] = tmp.z;\n\t\t\t\ttangents[v * 4 + 3] = w;\n\t\t\t}\n\n\t\t\tfor (let i = 0, il = groups.length; i < il; ++i) {\n\t\t\t\tconst group = groups[i];\n\t\t\t\tconst start = group.start;\n\t\t\t\tconst count = group.count;\n\n\t\t\t\tfor (let j = start, jl = start + count; j < jl; j += 3) {\n\t\t\t\t\thandleVertex(indices[j + 0]);\n\t\t\t\t\thandleVertex(indices[j + 1]);\n\t\t\t\t\thandleVertex(indices[j + 2]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tcomputeVertexNormals() {\n\t\t\tconst index = this.index;\n\t\t\tconst positionAttribute = this.getAttribute('position');\n\n\t\t\tif (positionAttribute !== undefined) {\n\t\t\t\tlet normalAttribute = this.getAttribute('normal');\n\n\t\t\t\tif (normalAttribute === undefined) {\n\t\t\t\t\tnormalAttribute = new BufferAttribute(new Float32Array(positionAttribute.count * 3), 3);\n\t\t\t\t\tthis.setAttribute('normal', normalAttribute);\n\t\t\t\t} else {\n\t\t\t\t\t// reset existing normals to zero\n\t\t\t\t\tfor (let i = 0, il = normalAttribute.count; i < il; i++) {\n\t\t\t\t\t\tnormalAttribute.setXYZ(i, 0, 0, 0);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst pA = new Vector3(),\n\t\t\t\t\t\t\tpB = new Vector3(),\n\t\t\t\t\t\t\tpC = new Vector3();\n\t\t\t\tconst nA = new Vector3(),\n\t\t\t\t\t\t\tnB = new Vector3(),\n\t\t\t\t\t\t\tnC = new Vector3();\n\t\t\t\tconst cb = new Vector3(),\n\t\t\t\t\t\t\tab = new Vector3(); // indexed elements\n\n\t\t\t\tif (index) {\n\t\t\t\t\tfor (let i = 0, il = index.count; i < il; i += 3) {\n\t\t\t\t\t\tconst vA = index.getX(i + 0);\n\t\t\t\t\t\tconst vB = index.getX(i + 1);\n\t\t\t\t\t\tconst vC = index.getX(i + 2);\n\t\t\t\t\t\tpA.fromBufferAttribute(positionAttribute, vA);\n\t\t\t\t\t\tpB.fromBufferAttribute(positionAttribute, vB);\n\t\t\t\t\t\tpC.fromBufferAttribute(positionAttribute, vC);\n\t\t\t\t\t\tcb.subVectors(pC, pB);\n\t\t\t\t\t\tab.subVectors(pA, pB);\n\t\t\t\t\t\tcb.cross(ab);\n\t\t\t\t\t\tnA.fromBufferAttribute(normalAttribute, vA);\n\t\t\t\t\t\tnB.fromBufferAttribute(normalAttribute, vB);\n\t\t\t\t\t\tnC.fromBufferAttribute(normalAttribute, vC);\n\t\t\t\t\t\tnA.add(cb);\n\t\t\t\t\t\tnB.add(cb);\n\t\t\t\t\t\tnC.add(cb);\n\t\t\t\t\t\tnormalAttribute.setXYZ(vA, nA.x, nA.y, nA.z);\n\t\t\t\t\t\tnormalAttribute.setXYZ(vB, nB.x, nB.y, nB.z);\n\t\t\t\t\t\tnormalAttribute.setXYZ(vC, nC.x, nC.y, nC.z);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// non-indexed elements (unconnected triangle soup)\n\t\t\t\t\tfor (let i = 0, il = positionAttribute.count; i < il; i += 3) {\n\t\t\t\t\t\tpA.fromBufferAttribute(positionAttribute, i + 0);\n\t\t\t\t\t\tpB.fromBufferAttribute(positionAttribute, i + 1);\n\t\t\t\t\t\tpC.fromBufferAttribute(positionAttribute, i + 2);\n\t\t\t\t\t\tcb.subVectors(pC, pB);\n\t\t\t\t\t\tab.subVectors(pA, pB);\n\t\t\t\t\t\tcb.cross(ab);\n\t\t\t\t\t\tnormalAttribute.setXYZ(i + 0, cb.x, cb.y, cb.z);\n\t\t\t\t\t\tnormalAttribute.setXYZ(i + 1, cb.x, cb.y, cb.z);\n\t\t\t\t\t\tnormalAttribute.setXYZ(i + 2, cb.x, cb.y, cb.z);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis.normalizeNormals();\n\t\t\t\tnormalAttribute.needsUpdate = true;\n\t\t\t}\n\t\t}\n\n\t\tmerge(geometry, offset) {\n\t\t\tif (!(geometry && geometry.isBufferGeometry)) {\n\t\t\t\tconsole.error('THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.', geometry);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (offset === undefined) {\n\t\t\t\toffset = 0;\n\t\t\t\tconsole.warn('THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. ' + 'Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge.');\n\t\t\t}\n\n\t\t\tconst attributes = this.attributes;\n\n\t\t\tfor (const key in attributes) {\n\t\t\t\tif (geometry.attributes[key] === undefined) continue;\n\t\t\t\tconst attribute1 = attributes[key];\n\t\t\t\tconst attributeArray1 = attribute1.array;\n\t\t\t\tconst attribute2 = geometry.attributes[key];\n\t\t\t\tconst attributeArray2 = attribute2.array;\n\t\t\t\tconst attributeOffset = attribute2.itemSize * offset;\n\t\t\t\tconst length = Math.min(attributeArray2.length, attributeArray1.length - attributeOffset);\n\n\t\t\t\tfor (let i = 0, j = attributeOffset; i < length; i++, j++) {\n\t\t\t\t\tattributeArray1[j] = attributeArray2[i];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tnormalizeNormals() {\n\t\t\tconst normals = this.attributes.normal;\n\n\t\t\tfor (let i = 0, il = normals.count; i < il; i++) {\n\t\t\t\t_vector$8.fromBufferAttribute(normals, i);\n\n\t\t\t\t_vector$8.normalize();\n\n\t\t\t\tnormals.setXYZ(i, _vector$8.x, _vector$8.y, _vector$8.z);\n\t\t\t}\n\t\t}\n\n\t\ttoNonIndexed() {\n\t\t\tfunction convertBufferAttribute(attribute, indices) {\n\t\t\t\tconst array = attribute.array;\n\t\t\t\tconst itemSize = attribute.itemSize;\n\t\t\t\tconst normalized = attribute.normalized;\n\t\t\t\tconst array2 = new array.constructor(indices.length * itemSize);\n\t\t\t\tlet index = 0,\n\t\t\t\t\t\tindex2 = 0;\n\n\t\t\t\tfor (let i = 0, l = indices.length; i < l; i++) {\n\t\t\t\t\tif (attribute.isInterleavedBufferAttribute) {\n\t\t\t\t\t\tindex = indices[i] * attribute.data.stride + attribute.offset;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tindex = indices[i] * itemSize;\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (let j = 0; j < itemSize; j++) {\n\t\t\t\t\t\tarray2[index2++] = array[index++];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn new BufferAttribute(array2, itemSize, normalized);\n\t\t\t} //\n\n\n\t\t\tif (this.index === null) {\n\t\t\t\tconsole.warn('THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed.');\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\tconst geometry2 = new BufferGeometry();\n\t\t\tconst indices = this.index.array;\n\t\t\tconst attributes = this.attributes; // attributes\n\n\t\t\tfor (const name in attributes) {\n\t\t\t\tconst attribute = attributes[name];\n\t\t\t\tconst newAttribute = convertBufferAttribute(attribute, indices);\n\t\t\t\tgeometry2.setAttribute(name, newAttribute);\n\t\t\t} // morph attributes\n\n\n\t\t\tconst morphAttributes = this.morphAttributes;\n\n\t\t\tfor (const name in morphAttributes) {\n\t\t\t\tconst morphArray = [];\n\t\t\t\tconst morphAttribute = morphAttributes[name]; // morphAttribute: array of Float32BufferAttributes\n\n\t\t\t\tfor (let i = 0, il = morphAttribute.length; i < il; i++) {\n\t\t\t\t\tconst attribute = morphAttribute[i];\n\t\t\t\t\tconst newAttribute = convertBufferAttribute(attribute, indices);\n\t\t\t\t\tmorphArray.push(newAttribute);\n\t\t\t\t}\n\n\t\t\t\tgeometry2.morphAttributes[name] = morphArray;\n\t\t\t}\n\n\t\t\tgeometry2.morphTargetsRelative = this.morphTargetsRelative; // groups\n\n\t\t\tconst groups = this.groups;\n\n\t\t\tfor (let i = 0, l = groups.length; i < l; i++) {\n\t\t\t\tconst group = groups[i];\n\t\t\t\tgeometry2.addGroup(group.start, group.count, group.materialIndex);\n\t\t\t}\n\n\t\t\treturn geometry2;\n\t\t}\n\n\t\ttoJSON() {\n\t\t\tconst data = {\n\t\t\t\tmetadata: {\n\t\t\t\t\tversion: 4.5,\n\t\t\t\t\ttype: 'BufferGeometry',\n\t\t\t\t\tgenerator: 'BufferGeometry.toJSON'\n\t\t\t\t}\n\t\t\t}; // standard BufferGeometry serialization\n\n\t\t\tdata.uuid = this.uuid;\n\t\t\tdata.type = this.type;\n\t\t\tif (this.name !== '') data.name = this.name;\n\t\t\tif (Object.keys(this.userData).length > 0) data.userData = this.userData;\n\n\t\t\tif (this.parameters !== undefined) {\n\t\t\t\tconst parameters = this.parameters;\n\n\t\t\t\tfor (const key in parameters) {\n\t\t\t\t\tif (parameters[key] !== undefined) data[key] = parameters[key];\n\t\t\t\t}\n\n\t\t\t\treturn data;\n\t\t\t} // for simplicity the code assumes attributes are not shared across geometries, see #15811\n\n\n\t\t\tdata.data = {\n\t\t\t\tattributes: {}\n\t\t\t};\n\t\t\tconst index = this.index;\n\n\t\t\tif (index !== null) {\n\t\t\t\tdata.data.index = {\n\t\t\t\t\ttype: index.array.constructor.name,\n\t\t\t\t\tarray: Array.prototype.slice.call(index.array)\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tconst attributes = this.attributes;\n\n\t\t\tfor (const key in attributes) {\n\t\t\t\tconst attribute = attributes[key];\n\t\t\t\tdata.data.attributes[key] = attribute.toJSON(data.data);\n\t\t\t}\n\n\t\t\tconst morphAttributes = {};\n\t\t\tlet hasMorphAttributes = false;\n\n\t\t\tfor (const key in this.morphAttributes) {\n\t\t\t\tconst attributeArray = this.morphAttributes[key];\n\t\t\t\tconst array = [];\n\n\t\t\t\tfor (let i = 0, il = attributeArray.length; i < il; i++) {\n\t\t\t\t\tconst attribute = attributeArray[i];\n\t\t\t\t\tarray.push(attribute.toJSON(data.data));\n\t\t\t\t}\n\n\t\t\t\tif (array.length > 0) {\n\t\t\t\t\tmorphAttributes[key] = array;\n\t\t\t\t\thasMorphAttributes = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (hasMorphAttributes) {\n\t\t\t\tdata.data.morphAttributes = morphAttributes;\n\t\t\t\tdata.data.morphTargetsRelative = this.morphTargetsRelative;\n\t\t\t}\n\n\t\t\tconst groups = this.groups;\n\n\t\t\tif (groups.length > 0) {\n\t\t\t\tdata.data.groups = JSON.parse(JSON.stringify(groups));\n\t\t\t}\n\n\t\t\tconst boundingSphere = this.boundingSphere;\n\n\t\t\tif (boundingSphere !== null) {\n\t\t\t\tdata.data.boundingSphere = {\n\t\t\t\t\tcenter: boundingSphere.center.toArray(),\n\t\t\t\t\tradius: boundingSphere.radius\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn data;\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new this.constructor().copy(this);\n\t\t}\n\n\t\tcopy(source) {\n\t\t\t// reset\n\t\t\tthis.index = null;\n\t\t\tthis.attributes = {};\n\t\t\tthis.morphAttributes = {};\n\t\t\tthis.groups = [];\n\t\t\tthis.boundingBox = null;\n\t\t\tthis.boundingSphere = null; // used for storing cloned, shared data\n\n\t\t\tconst data = {}; // name\n\n\t\t\tthis.name = source.name; // index\n\n\t\t\tconst index = source.index;\n\n\t\t\tif (index !== null) {\n\t\t\t\tthis.setIndex(index.clone(data));\n\t\t\t} // attributes\n\n\n\t\t\tconst attributes = source.attributes;\n\n\t\t\tfor (const name in attributes) {\n\t\t\t\tconst attribute = attributes[name];\n\t\t\t\tthis.setAttribute(name, attribute.clone(data));\n\t\t\t} // morph attributes\n\n\n\t\t\tconst morphAttributes = source.morphAttributes;\n\n\t\t\tfor (const name in morphAttributes) {\n\t\t\t\tconst array = [];\n\t\t\t\tconst morphAttribute = morphAttributes[name]; // morphAttribute: array of Float32BufferAttributes\n\n\t\t\t\tfor (let i = 0, l = morphAttribute.length; i < l; i++) {\n\t\t\t\t\tarray.push(morphAttribute[i].clone(data));\n\t\t\t\t}\n\n\t\t\t\tthis.morphAttributes[name] = array;\n\t\t\t}\n\n\t\t\tthis.morphTargetsRelative = source.morphTargetsRelative; // groups\n\n\t\t\tconst groups = source.groups;\n\n\t\t\tfor (let i = 0, l = groups.length; i < l; i++) {\n\t\t\t\tconst group = groups[i];\n\t\t\t\tthis.addGroup(group.start, group.count, group.materialIndex);\n\t\t\t} // bounding box\n\n\n\t\t\tconst boundingBox = source.boundingBox;\n\n\t\t\tif (boundingBox !== null) {\n\t\t\t\tthis.boundingBox = boundingBox.clone();\n\t\t\t} // bounding sphere\n\n\n\t\t\tconst boundingSphere = source.boundingSphere;\n\n\t\t\tif (boundingSphere !== null) {\n\t\t\t\tthis.boundingSphere = boundingSphere.clone();\n\t\t\t} // draw range\n\n\n\t\t\tthis.drawRange.start = source.drawRange.start;\n\t\t\tthis.drawRange.count = source.drawRange.count; // user data\n\n\t\t\tthis.userData = source.userData; // geometry generator parameters\n\n\t\t\tif (source.parameters !== undefined) this.parameters = Object.assign({}, source.parameters);\n\t\t\treturn this;\n\t\t}\n\n\t\tdispose() {\n\t\t\tthis.dispatchEvent({\n\t\t\t\ttype: 'dispose'\n\t\t\t});\n\t\t}\n\n\t}\n\n\tBufferGeometry.prototype.isBufferGeometry = true;\n\n\tconst _inverseMatrix$2 = /*@__PURE__*/new Matrix4();\n\n\tconst _ray$2 = /*@__PURE__*/new Ray();\n\n\tconst _sphere$3 = /*@__PURE__*/new Sphere();\n\n\tconst _vA$1 = /*@__PURE__*/new Vector3();\n\n\tconst _vB$1 = /*@__PURE__*/new Vector3();\n\n\tconst _vC$1 = /*@__PURE__*/new Vector3();\n\n\tconst _tempA = /*@__PURE__*/new Vector3();\n\n\tconst _tempB = /*@__PURE__*/new Vector3();\n\n\tconst _tempC = /*@__PURE__*/new Vector3();\n\n\tconst _morphA = /*@__PURE__*/new Vector3();\n\n\tconst _morphB = /*@__PURE__*/new Vector3();\n\n\tconst _morphC = /*@__PURE__*/new Vector3();\n\n\tconst _uvA$1 = /*@__PURE__*/new Vector2();\n\n\tconst _uvB$1 = /*@__PURE__*/new Vector2();\n\n\tconst _uvC$1 = /*@__PURE__*/new Vector2();\n\n\tconst _intersectionPoint = /*@__PURE__*/new Vector3();\n\n\tconst _intersectionPointWorld = /*@__PURE__*/new Vector3();\n\n\tclass Mesh extends Object3D {\n\t\tconstructor(geometry = new BufferGeometry(), material = new MeshBasicMaterial()) {\n\t\t\tsuper();\n\t\t\tthis.type = 'Mesh';\n\t\t\tthis.geometry = geometry;\n\t\t\tthis.material = material;\n\t\t\tthis.updateMorphTargets();\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\n\t\t\tif (source.morphTargetInfluences !== undefined) {\n\t\t\t\tthis.morphTargetInfluences = source.morphTargetInfluences.slice();\n\t\t\t}\n\n\t\t\tif (source.morphTargetDictionary !== undefined) {\n\t\t\t\tthis.morphTargetDictionary = Object.assign({}, source.morphTargetDictionary);\n\t\t\t}\n\n\t\t\tthis.material = source.material;\n\t\t\tthis.geometry = source.geometry;\n\t\t\treturn this;\n\t\t}\n\n\t\tupdateMorphTargets() {\n\t\t\tconst geometry = this.geometry;\n\n\t\t\tif (geometry.isBufferGeometry) {\n\t\t\t\tconst morphAttributes = geometry.morphAttributes;\n\t\t\t\tconst keys = Object.keys(morphAttributes);\n\n\t\t\t\tif (keys.length > 0) {\n\t\t\t\t\tconst morphAttribute = morphAttributes[keys[0]];\n\n\t\t\t\t\tif (morphAttribute !== undefined) {\n\t\t\t\t\t\tthis.morphTargetInfluences = [];\n\t\t\t\t\t\tthis.morphTargetDictionary = {};\n\n\t\t\t\t\t\tfor (let m = 0, ml = morphAttribute.length; m < ml; m++) {\n\t\t\t\t\t\t\tconst name = morphAttribute[m].name || String(m);\n\t\t\t\t\t\t\tthis.morphTargetInfluences.push(0);\n\t\t\t\t\t\t\tthis.morphTargetDictionary[name] = m;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst morphTargets = geometry.morphTargets;\n\n\t\t\t\tif (morphTargets !== undefined && morphTargets.length > 0) {\n\t\t\t\t\tconsole.error('THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\traycast(raycaster, intersects) {\n\t\t\tconst geometry = this.geometry;\n\t\t\tconst material = this.material;\n\t\t\tconst matrixWorld = this.matrixWorld;\n\t\t\tif (material === undefined) return; // Checking boundingSphere distance to ray\n\n\t\t\tif (geometry.boundingSphere === null) geometry.computeBoundingSphere();\n\n\t\t\t_sphere$3.copy(geometry.boundingSphere);\n\n\t\t\t_sphere$3.applyMatrix4(matrixWorld);\n\n\t\t\tif (raycaster.ray.intersectsSphere(_sphere$3) === false) return; //\n\n\t\t\t_inverseMatrix$2.copy(matrixWorld).invert();\n\n\t\t\t_ray$2.copy(raycaster.ray).applyMatrix4(_inverseMatrix$2); // Check boundingBox before continuing\n\n\n\t\t\tif (geometry.boundingBox !== null) {\n\t\t\t\tif (_ray$2.intersectsBox(geometry.boundingBox) === false) return;\n\t\t\t}\n\n\t\t\tlet intersection;\n\n\t\t\tif (geometry.isBufferGeometry) {\n\t\t\t\tconst index = geometry.index;\n\t\t\t\tconst position = geometry.attributes.position;\n\t\t\t\tconst morphPosition = geometry.morphAttributes.position;\n\t\t\t\tconst morphTargetsRelative = geometry.morphTargetsRelative;\n\t\t\t\tconst uv = geometry.attributes.uv;\n\t\t\t\tconst uv2 = geometry.attributes.uv2;\n\t\t\t\tconst groups = geometry.groups;\n\t\t\t\tconst drawRange = geometry.drawRange;\n\n\t\t\t\tif (index !== null) {\n\t\t\t\t\t// indexed buffer geometry\n\t\t\t\t\tif (Array.isArray(material)) {\n\t\t\t\t\t\tfor (let i = 0, il = groups.length; i < il; i++) {\n\t\t\t\t\t\t\tconst group = groups[i];\n\t\t\t\t\t\t\tconst groupMaterial = material[group.materialIndex];\n\t\t\t\t\t\t\tconst start = Math.max(group.start, drawRange.start);\n\t\t\t\t\t\t\tconst end = Math.min(index.count, Math.min(group.start + group.count, drawRange.start + drawRange.count));\n\n\t\t\t\t\t\t\tfor (let j = start, jl = end; j < jl; j += 3) {\n\t\t\t\t\t\t\t\tconst a = index.getX(j);\n\t\t\t\t\t\t\t\tconst b = index.getX(j + 1);\n\t\t\t\t\t\t\t\tconst c = index.getX(j + 2);\n\t\t\t\t\t\t\t\tintersection = checkBufferGeometryIntersection(this, groupMaterial, raycaster, _ray$2, position, morphPosition, morphTargetsRelative, uv, uv2, a, b, c);\n\n\t\t\t\t\t\t\t\tif (intersection) {\n\t\t\t\t\t\t\t\t\tintersection.faceIndex = Math.floor(j / 3); // triangle number in indexed buffer semantics\n\n\t\t\t\t\t\t\t\t\tintersection.face.materialIndex = group.materialIndex;\n\t\t\t\t\t\t\t\t\tintersects.push(intersection);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst start = Math.max(0, drawRange.start);\n\t\t\t\t\t\tconst end = Math.min(index.count, drawRange.start + drawRange.count);\n\n\t\t\t\t\t\tfor (let i = start, il = end; i < il; i += 3) {\n\t\t\t\t\t\t\tconst a = index.getX(i);\n\t\t\t\t\t\t\tconst b = index.getX(i + 1);\n\t\t\t\t\t\t\tconst c = index.getX(i + 2);\n\t\t\t\t\t\t\tintersection = checkBufferGeometryIntersection(this, material, raycaster, _ray$2, position, morphPosition, morphTargetsRelative, uv, uv2, a, b, c);\n\n\t\t\t\t\t\t\tif (intersection) {\n\t\t\t\t\t\t\t\tintersection.faceIndex = Math.floor(i / 3); // triangle number in indexed buffer semantics\n\n\t\t\t\t\t\t\t\tintersects.push(intersection);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (position !== undefined) {\n\t\t\t\t\t// non-indexed buffer geometry\n\t\t\t\t\tif (Array.isArray(material)) {\n\t\t\t\t\t\tfor (let i = 0, il = groups.length; i < il; i++) {\n\t\t\t\t\t\t\tconst group = groups[i];\n\t\t\t\t\t\t\tconst groupMaterial = material[group.materialIndex];\n\t\t\t\t\t\t\tconst start = Math.max(group.start, drawRange.start);\n\t\t\t\t\t\t\tconst end = Math.min(position.count, Math.min(group.start + group.count, drawRange.start + drawRange.count));\n\n\t\t\t\t\t\t\tfor (let j = start, jl = end; j < jl; j += 3) {\n\t\t\t\t\t\t\t\tconst a = j;\n\t\t\t\t\t\t\t\tconst b = j + 1;\n\t\t\t\t\t\t\t\tconst c = j + 2;\n\t\t\t\t\t\t\t\tintersection = checkBufferGeometryIntersection(this, groupMaterial, raycaster, _ray$2, position, morphPosition, morphTargetsRelative, uv, uv2, a, b, c);\n\n\t\t\t\t\t\t\t\tif (intersection) {\n\t\t\t\t\t\t\t\t\tintersection.faceIndex = Math.floor(j / 3); // triangle number in non-indexed buffer semantics\n\n\t\t\t\t\t\t\t\t\tintersection.face.materialIndex = group.materialIndex;\n\t\t\t\t\t\t\t\t\tintersects.push(intersection);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst start = Math.max(0, drawRange.start);\n\t\t\t\t\t\tconst end = Math.min(position.count, drawRange.start + drawRange.count);\n\n\t\t\t\t\t\tfor (let i = start, il = end; i < il; i += 3) {\n\t\t\t\t\t\t\tconst a = i;\n\t\t\t\t\t\t\tconst b = i + 1;\n\t\t\t\t\t\t\tconst c = i + 2;\n\t\t\t\t\t\t\tintersection = checkBufferGeometryIntersection(this, material, raycaster, _ray$2, position, morphPosition, morphTargetsRelative, uv, uv2, a, b, c);\n\n\t\t\t\t\t\t\tif (intersection) {\n\t\t\t\t\t\t\t\tintersection.faceIndex = Math.floor(i / 3); // triangle number in non-indexed buffer semantics\n\n\t\t\t\t\t\t\t\tintersects.push(intersection);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (geometry.isGeometry) {\n\t\t\t\tconsole.error('THREE.Mesh.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.');\n\t\t\t}\n\t\t}\n\n\t}\n\n\tMesh.prototype.isMesh = true;\n\n\tfunction checkIntersection(object, material, raycaster, ray, pA, pB, pC, point) {\n\t\tlet intersect;\n\n\t\tif (material.side === BackSide) {\n\t\t\tintersect = ray.intersectTriangle(pC, pB, pA, true, point);\n\t\t} else {\n\t\t\tintersect = ray.intersectTriangle(pA, pB, pC, material.side !== DoubleSide, point);\n\t\t}\n\n\t\tif (intersect === null) return null;\n\n\t\t_intersectionPointWorld.copy(point);\n\n\t\t_intersectionPointWorld.applyMatrix4(object.matrixWorld);\n\n\t\tconst distance = raycaster.ray.origin.distanceTo(_intersectionPointWorld);\n\t\tif (distance < raycaster.near || distance > raycaster.far) return null;\n\t\treturn {\n\t\t\tdistance: distance,\n\t\t\tpoint: _intersectionPointWorld.clone(),\n\t\t\tobject: object\n\t\t};\n\t}\n\n\tfunction checkBufferGeometryIntersection(object, material, raycaster, ray, position, morphPosition, morphTargetsRelative, uv, uv2, a, b, c) {\n\t\t_vA$1.fromBufferAttribute(position, a);\n\n\t\t_vB$1.fromBufferAttribute(position, b);\n\n\t\t_vC$1.fromBufferAttribute(position, c);\n\n\t\tconst morphInfluences = object.morphTargetInfluences;\n\n\t\tif (morphPosition && morphInfluences) {\n\t\t\t_morphA.set(0, 0, 0);\n\n\t\t\t_morphB.set(0, 0, 0);\n\n\t\t\t_morphC.set(0, 0, 0);\n\n\t\t\tfor (let i = 0, il = morphPosition.length; i < il; i++) {\n\t\t\t\tconst influence = morphInfluences[i];\n\t\t\t\tconst morphAttribute = morphPosition[i];\n\t\t\t\tif (influence === 0) continue;\n\n\t\t\t\t_tempA.fromBufferAttribute(morphAttribute, a);\n\n\t\t\t\t_tempB.fromBufferAttribute(morphAttribute, b);\n\n\t\t\t\t_tempC.fromBufferAttribute(morphAttribute, c);\n\n\t\t\t\tif (morphTargetsRelative) {\n\t\t\t\t\t_morphA.addScaledVector(_tempA, influence);\n\n\t\t\t\t\t_morphB.addScaledVector(_tempB, influence);\n\n\t\t\t\t\t_morphC.addScaledVector(_tempC, influence);\n\t\t\t\t} else {\n\t\t\t\t\t_morphA.addScaledVector(_tempA.sub(_vA$1), influence);\n\n\t\t\t\t\t_morphB.addScaledVector(_tempB.sub(_vB$1), influence);\n\n\t\t\t\t\t_morphC.addScaledVector(_tempC.sub(_vC$1), influence);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t_vA$1.add(_morphA);\n\n\t\t\t_vB$1.add(_morphB);\n\n\t\t\t_vC$1.add(_morphC);\n\t\t}\n\n\t\tif (object.isSkinnedMesh) {\n\t\t\tobject.boneTransform(a, _vA$1);\n\t\t\tobject.boneTransform(b, _vB$1);\n\t\t\tobject.boneTransform(c, _vC$1);\n\t\t}\n\n\t\tconst intersection = checkIntersection(object, material, raycaster, ray, _vA$1, _vB$1, _vC$1, _intersectionPoint);\n\n\t\tif (intersection) {\n\t\t\tif (uv) {\n\t\t\t\t_uvA$1.fromBufferAttribute(uv, a);\n\n\t\t\t\t_uvB$1.fromBufferAttribute(uv, b);\n\n\t\t\t\t_uvC$1.fromBufferAttribute(uv, c);\n\n\t\t\t\tintersection.uv = Triangle.getUV(_intersectionPoint, _vA$1, _vB$1, _vC$1, _uvA$1, _uvB$1, _uvC$1, new Vector2());\n\t\t\t}\n\n\t\t\tif (uv2) {\n\t\t\t\t_uvA$1.fromBufferAttribute(uv2, a);\n\n\t\t\t\t_uvB$1.fromBufferAttribute(uv2, b);\n\n\t\t\t\t_uvC$1.fromBufferAttribute(uv2, c);\n\n\t\t\t\tintersection.uv2 = Triangle.getUV(_intersectionPoint, _vA$1, _vB$1, _vC$1, _uvA$1, _uvB$1, _uvC$1, new Vector2());\n\t\t\t}\n\n\t\t\tconst face = {\n\t\t\t\ta: a,\n\t\t\t\tb: b,\n\t\t\t\tc: c,\n\t\t\t\tnormal: new Vector3(),\n\t\t\t\tmaterialIndex: 0\n\t\t\t};\n\t\t\tTriangle.getNormal(_vA$1, _vB$1, _vC$1, face.normal);\n\t\t\tintersection.face = face;\n\t\t}\n\n\t\treturn intersection;\n\t}\n\n\tclass BoxGeometry extends BufferGeometry {\n\t\tconstructor(width = 1, height = 1, depth = 1, widthSegments = 1, heightSegments = 1, depthSegments = 1) {\n\t\t\tsuper();\n\t\t\tthis.type = 'BoxGeometry';\n\t\t\tthis.parameters = {\n\t\t\t\twidth: width,\n\t\t\t\theight: height,\n\t\t\t\tdepth: depth,\n\t\t\t\twidthSegments: widthSegments,\n\t\t\t\theightSegments: heightSegments,\n\t\t\t\tdepthSegments: depthSegments\n\t\t\t};\n\t\t\tconst scope = this; // segments\n\n\t\t\twidthSegments = Math.floor(widthSegments);\n\t\t\theightSegments = Math.floor(heightSegments);\n\t\t\tdepthSegments = Math.floor(depthSegments); // buffers\n\n\t\t\tconst indices = [];\n\t\t\tconst vertices = [];\n\t\t\tconst normals = [];\n\t\t\tconst uvs = []; // helper variables\n\n\t\t\tlet numberOfVertices = 0;\n\t\t\tlet groupStart = 0; // build each side of the box geometry\n\n\t\t\tbuildPlane('z', 'y', 'x', -1, -1, depth, height, width, depthSegments, heightSegments, 0); // px\n\n\t\t\tbuildPlane('z', 'y', 'x', 1, -1, depth, height, -width, depthSegments, heightSegments, 1); // nx\n\n\t\t\tbuildPlane('x', 'z', 'y', 1, 1, width, depth, height, widthSegments, depthSegments, 2); // py\n\n\t\t\tbuildPlane('x', 'z', 'y', 1, -1, width, depth, -height, widthSegments, depthSegments, 3); // ny\n\n\t\t\tbuildPlane('x', 'y', 'z', 1, -1, width, height, depth, widthSegments, heightSegments, 4); // pz\n\n\t\t\tbuildPlane('x', 'y', 'z', -1, -1, width, height, -depth, widthSegments, heightSegments, 5); // nz\n\t\t\t// build geometry\n\n\t\t\tthis.setIndex(indices);\n\t\t\tthis.setAttribute('position', new Float32BufferAttribute(vertices, 3));\n\t\t\tthis.setAttribute('normal', new Float32BufferAttribute(normals, 3));\n\t\t\tthis.setAttribute('uv', new Float32BufferAttribute(uvs, 2));\n\n\t\t\tfunction buildPlane(u, v, w, udir, vdir, width, height, depth, gridX, gridY, materialIndex) {\n\t\t\t\tconst segmentWidth = width / gridX;\n\t\t\t\tconst segmentHeight = height / gridY;\n\t\t\t\tconst widthHalf = width / 2;\n\t\t\t\tconst heightHalf = height / 2;\n\t\t\t\tconst depthHalf = depth / 2;\n\t\t\t\tconst gridX1 = gridX + 1;\n\t\t\t\tconst gridY1 = gridY + 1;\n\t\t\t\tlet vertexCounter = 0;\n\t\t\t\tlet groupCount = 0;\n\t\t\t\tconst vector = new Vector3(); // generate vertices, normals and uvs\n\n\t\t\t\tfor (let iy = 0; iy < gridY1; iy++) {\n\t\t\t\t\tconst y = iy * segmentHeight - heightHalf;\n\n\t\t\t\t\tfor (let ix = 0; ix < gridX1; ix++) {\n\t\t\t\t\t\tconst x = ix * segmentWidth - widthHalf; // set values to correct vector component\n\n\t\t\t\t\t\tvector[u] = x * udir;\n\t\t\t\t\t\tvector[v] = y * vdir;\n\t\t\t\t\t\tvector[w] = depthHalf; // now apply vector to vertex buffer\n\n\t\t\t\t\t\tvertices.push(vector.x, vector.y, vector.z); // set values to correct vector component\n\n\t\t\t\t\t\tvector[u] = 0;\n\t\t\t\t\t\tvector[v] = 0;\n\t\t\t\t\t\tvector[w] = depth > 0 ? 1 : -1; // now apply vector to normal buffer\n\n\t\t\t\t\t\tnormals.push(vector.x, vector.y, vector.z); // uvs\n\n\t\t\t\t\t\tuvs.push(ix / gridX);\n\t\t\t\t\t\tuvs.push(1 - iy / gridY); // counters\n\n\t\t\t\t\t\tvertexCounter += 1;\n\t\t\t\t\t}\n\t\t\t\t} // indices\n\t\t\t\t// 1. you need three indices to draw a single face\n\t\t\t\t// 2. a single segment consists of two faces\n\t\t\t\t// 3. so we need to generate six (2*3) indices per segment\n\n\n\t\t\t\tfor (let iy = 0; iy < gridY; iy++) {\n\t\t\t\t\tfor (let ix = 0; ix < gridX; ix++) {\n\t\t\t\t\t\tconst a = numberOfVertices + ix + gridX1 * iy;\n\t\t\t\t\t\tconst b = numberOfVertices + ix + gridX1 * (iy + 1);\n\t\t\t\t\t\tconst c = numberOfVertices + (ix + 1) + gridX1 * (iy + 1);\n\t\t\t\t\t\tconst d = numberOfVertices + (ix + 1) + gridX1 * iy; // faces\n\n\t\t\t\t\t\tindices.push(a, b, d);\n\t\t\t\t\t\tindices.push(b, c, d); // increase counter\n\n\t\t\t\t\t\tgroupCount += 6;\n\t\t\t\t\t}\n\t\t\t\t} // add a group to the geometry. this will ensure multi material support\n\n\n\t\t\t\tscope.addGroup(groupStart, groupCount, materialIndex); // calculate new start value for groups\n\n\t\t\t\tgroupStart += groupCount; // update total number of vertices\n\n\t\t\t\tnumberOfVertices += vertexCounter;\n\t\t\t}\n\t\t}\n\n\t\tstatic fromJSON(data) {\n\t\t\treturn new BoxGeometry(data.width, data.height, data.depth, data.widthSegments, data.heightSegments, data.depthSegments);\n\t\t}\n\n\t}\n\n\t/**\n\t * Uniform Utilities\n\t */\n\tfunction cloneUniforms(src) {\n\t\tconst dst = {};\n\n\t\tfor (const u in src) {\n\t\t\tdst[u] = {};\n\n\t\t\tfor (const p in src[u]) {\n\t\t\t\tconst property = src[u][p];\n\n\t\t\t\tif (property && (property.isColor || property.isMatrix3 || property.isMatrix4 || property.isVector2 || property.isVector3 || property.isVector4 || property.isTexture || property.isQuaternion)) {\n\t\t\t\t\tdst[u][p] = property.clone();\n\t\t\t\t} else if (Array.isArray(property)) {\n\t\t\t\t\tdst[u][p] = property.slice();\n\t\t\t\t} else {\n\t\t\t\t\tdst[u][p] = property;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn dst;\n\t}\n\tfunction mergeUniforms(uniforms) {\n\t\tconst merged = {};\n\n\t\tfor (let u = 0; u < uniforms.length; u++) {\n\t\t\tconst tmp = cloneUniforms(uniforms[u]);\n\n\t\t\tfor (const p in tmp) {\n\t\t\t\tmerged[p] = tmp[p];\n\t\t\t}\n\t\t}\n\n\t\treturn merged;\n\t} // Legacy\n\n\tconst UniformsUtils = {\n\t\tclone: cloneUniforms,\n\t\tmerge: mergeUniforms\n\t};\n\n\tvar default_vertex = \"void main() {\\n\\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\\n}\";\n\n\tvar default_fragment = \"void main() {\\n\\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\\n}\";\n\n\t/**\n\t * parameters = {\n\t *\tdefines: { \"label\" : \"value\" },\n\t *\tuniforms: { \"parameter1\": { value: 1.0 }, \"parameter2\": { value2: 2 } },\n\t *\n\t *\tfragmentShader: <string>,\n\t *\tvertexShader: <string>,\n\t *\n\t *\twireframe: <boolean>,\n\t *\twireframeLinewidth: <float>,\n\t *\n\t *\tlights: <bool>\n\t * }\n\t */\n\n\tclass ShaderMaterial extends Material {\n\t\tconstructor(parameters) {\n\t\t\tsuper();\n\t\t\tthis.type = 'ShaderMaterial';\n\t\t\tthis.defines = {};\n\t\t\tthis.uniforms = {};\n\t\t\tthis.vertexShader = default_vertex;\n\t\t\tthis.fragmentShader = default_fragment;\n\t\t\tthis.linewidth = 1;\n\t\t\tthis.wireframe = false;\n\t\t\tthis.wireframeLinewidth = 1;\n\t\t\tthis.fog = false; // set to use scene fog\n\n\t\t\tthis.lights = false; // set to use scene lights\n\n\t\t\tthis.clipping = false; // set to use user-defined clipping planes\n\n\t\t\tthis.extensions = {\n\t\t\t\tderivatives: false,\n\t\t\t\t// set to use derivatives\n\t\t\t\tfragDepth: false,\n\t\t\t\t// set to use fragment depth values\n\t\t\t\tdrawBuffers: false,\n\t\t\t\t// set to use draw buffers\n\t\t\t\tshaderTextureLOD: false // set to use shader texture LOD\n\n\t\t\t}; // When rendered geometry doesn't include these attributes but the material does,\n\t\t\t// use these default values in WebGL. This avoids errors when buffer data is missing.\n\n\t\t\tthis.defaultAttributeValues = {\n\t\t\t\t'color': [1, 1, 1],\n\t\t\t\t'uv': [0, 0],\n\t\t\t\t'uv2': [0, 0]\n\t\t\t};\n\t\t\tthis.index0AttributeName = undefined;\n\t\t\tthis.uniformsNeedUpdate = false;\n\t\t\tthis.glslVersion = null;\n\n\t\t\tif (parameters !== undefined) {\n\t\t\t\tif (parameters.attributes !== undefined) {\n\t\t\t\t\tconsole.error('THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead.');\n\t\t\t\t}\n\n\t\t\t\tthis.setValues(parameters);\n\t\t\t}\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.fragmentShader = source.fragmentShader;\n\t\t\tthis.vertexShader = source.vertexShader;\n\t\t\tthis.uniforms = cloneUniforms(source.uniforms);\n\t\t\tthis.defines = Object.assign({}, source.defines);\n\t\t\tthis.wireframe = source.wireframe;\n\t\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\t\t\tthis.lights = source.lights;\n\t\t\tthis.clipping = source.clipping;\n\t\t\tthis.extensions = Object.assign({}, source.extensions);\n\t\t\tthis.glslVersion = source.glslVersion;\n\t\t\treturn this;\n\t\t}\n\n\t\ttoJSON(meta) {\n\t\t\tconst data = super.toJSON(meta);\n\t\t\tdata.glslVersion = this.glslVersion;\n\t\t\tdata.uniforms = {};\n\n\t\t\tfor (const name in this.uniforms) {\n\t\t\t\tconst uniform = this.uniforms[name];\n\t\t\t\tconst value = uniform.value;\n\n\t\t\t\tif (value && value.isTexture) {\n\t\t\t\t\tdata.uniforms[name] = {\n\t\t\t\t\t\ttype: 't',\n\t\t\t\t\t\tvalue: value.toJSON(meta).uuid\n\t\t\t\t\t};\n\t\t\t\t} else if (value && value.isColor) {\n\t\t\t\t\tdata.uniforms[name] = {\n\t\t\t\t\t\ttype: 'c',\n\t\t\t\t\t\tvalue: value.getHex()\n\t\t\t\t\t};\n\t\t\t\t} else if (value && value.isVector2) {\n\t\t\t\t\tdata.uniforms[name] = {\n\t\t\t\t\t\ttype: 'v2',\n\t\t\t\t\t\tvalue: value.toArray()\n\t\t\t\t\t};\n\t\t\t\t} else if (value && value.isVector3) {\n\t\t\t\t\tdata.uniforms[name] = {\n\t\t\t\t\t\ttype: 'v3',\n\t\t\t\t\t\tvalue: value.toArray()\n\t\t\t\t\t};\n\t\t\t\t} else if (value && value.isVector4) {\n\t\t\t\t\tdata.uniforms[name] = {\n\t\t\t\t\t\ttype: 'v4',\n\t\t\t\t\t\tvalue: value.toArray()\n\t\t\t\t\t};\n\t\t\t\t} else if (value && value.isMatrix3) {\n\t\t\t\t\tdata.uniforms[name] = {\n\t\t\t\t\t\ttype: 'm3',\n\t\t\t\t\t\tvalue: value.toArray()\n\t\t\t\t\t};\n\t\t\t\t} else if (value && value.isMatrix4) {\n\t\t\t\t\tdata.uniforms[name] = {\n\t\t\t\t\t\ttype: 'm4',\n\t\t\t\t\t\tvalue: value.toArray()\n\t\t\t\t\t};\n\t\t\t\t} else {\n\t\t\t\t\tdata.uniforms[name] = {\n\t\t\t\t\t\tvalue: value\n\t\t\t\t\t}; // note: the array variants v2v, v3v, v4v, m4v and tv are not supported so far\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (Object.keys(this.defines).length > 0) data.defines = this.defines;\n\t\t\tdata.vertexShader = this.vertexShader;\n\t\t\tdata.fragmentShader = this.fragmentShader;\n\t\t\tconst extensions = {};\n\n\t\t\tfor (const key in this.extensions) {\n\t\t\t\tif (this.extensions[key] === true) extensions[key] = true;\n\t\t\t}\n\n\t\t\tif (Object.keys(extensions).length > 0) data.extensions = extensions;\n\t\t\treturn data;\n\t\t}\n\n\t}\n\n\tShaderMaterial.prototype.isShaderMaterial = true;\n\n\tclass Camera extends Object3D {\n\t\tconstructor() {\n\t\t\tsuper();\n\t\t\tthis.type = 'Camera';\n\t\t\tthis.matrixWorldInverse = new Matrix4();\n\t\t\tthis.projectionMatrix = new Matrix4();\n\t\t\tthis.projectionMatrixInverse = new Matrix4();\n\t\t}\n\n\t\tcopy(source, recursive) {\n\t\t\tsuper.copy(source, recursive);\n\t\t\tthis.matrixWorldInverse.copy(source.matrixWorldInverse);\n\t\t\tthis.projectionMatrix.copy(source.projectionMatrix);\n\t\t\tthis.projectionMatrixInverse.copy(source.projectionMatrixInverse);\n\t\t\treturn this;\n\t\t}\n\n\t\tgetWorldDirection(target) {\n\t\t\tthis.updateWorldMatrix(true, false);\n\t\t\tconst e = this.matrixWorld.elements;\n\t\t\treturn target.set(-e[8], -e[9], -e[10]).normalize();\n\t\t}\n\n\t\tupdateMatrixWorld(force) {\n\t\t\tsuper.updateMatrixWorld(force);\n\t\t\tthis.matrixWorldInverse.copy(this.matrixWorld).invert();\n\t\t}\n\n\t\tupdateWorldMatrix(updateParents, updateChildren) {\n\t\t\tsuper.updateWorldMatrix(updateParents, updateChildren);\n\t\t\tthis.matrixWorldInverse.copy(this.matrixWorld).invert();\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new this.constructor().copy(this);\n\t\t}\n\n\t}\n\n\tCamera.prototype.isCamera = true;\n\n\tclass PerspectiveCamera extends Camera {\n\t\tconstructor(fov = 50, aspect = 1, near = 0.1, far = 2000) {\n\t\t\tsuper();\n\t\t\tthis.type = 'PerspectiveCamera';\n\t\t\tthis.fov = fov;\n\t\t\tthis.zoom = 1;\n\t\t\tthis.near = near;\n\t\t\tthis.far = far;\n\t\t\tthis.focus = 10;\n\t\t\tthis.aspect = aspect;\n\t\t\tthis.view = null;\n\t\t\tthis.filmGauge = 35; // width of the film (default in millimeters)\n\n\t\t\tthis.filmOffset = 0; // horizontal film offset (same unit as gauge)\n\n\t\t\tthis.updateProjectionMatrix();\n\t\t}\n\n\t\tcopy(source, recursive) {\n\t\t\tsuper.copy(source, recursive);\n\t\t\tthis.fov = source.fov;\n\t\t\tthis.zoom = source.zoom;\n\t\t\tthis.near = source.near;\n\t\t\tthis.far = source.far;\n\t\t\tthis.focus = source.focus;\n\t\t\tthis.aspect = source.aspect;\n\t\t\tthis.view = source.view === null ? null : Object.assign({}, source.view);\n\t\t\tthis.filmGauge = source.filmGauge;\n\t\t\tthis.filmOffset = source.filmOffset;\n\t\t\treturn this;\n\t\t}\n\t\t/**\n\t\t * Sets the FOV by focal length in respect to the current .filmGauge.\n\t\t *\n\t\t * The default film gauge is 35, so that the focal length can be specified for\n\t\t * a 35mm (full frame) camera.\n\t\t *\n\t\t * Values for focal length and film gauge must have the same unit.\n\t\t */\n\n\n\t\tsetFocalLength(focalLength) {\n\t\t\t/** see {@link http://www.bobatkins.com/photography/technical/field_of_view.html} */\n\t\t\tconst vExtentSlope = 0.5 * this.getFilmHeight() / focalLength;\n\t\t\tthis.fov = RAD2DEG * 2 * Math.atan(vExtentSlope);\n\t\t\tthis.updateProjectionMatrix();\n\t\t}\n\t\t/**\n\t\t * Calculates the focal length from the current .fov and .filmGauge.\n\t\t */\n\n\n\t\tgetFocalLength() {\n\t\t\tconst vExtentSlope = Math.tan(DEG2RAD * 0.5 * this.fov);\n\t\t\treturn 0.5 * this.getFilmHeight() / vExtentSlope;\n\t\t}\n\n\t\tgetEffectiveFOV() {\n\t\t\treturn RAD2DEG * 2 * Math.atan(Math.tan(DEG2RAD * 0.5 * this.fov) / this.zoom);\n\t\t}\n\n\t\tgetFilmWidth() {\n\t\t\t// film not completely covered in portrait format (aspect < 1)\n\t\t\treturn this.filmGauge * Math.min(this.aspect, 1);\n\t\t}\n\n\t\tgetFilmHeight() {\n\t\t\t// film not completely covered in landscape format (aspect > 1)\n\t\t\treturn this.filmGauge / Math.max(this.aspect, 1);\n\t\t}\n\t\t/**\n\t\t * Sets an offset in a larger frustum. This is useful for multi-window or\n\t\t * multi-monitor/multi-machine setups.\n\t\t *\n\t\t * For example, if you have 3x2 monitors and each monitor is 1920x1080 and\n\t\t * the monitors are in grid like this\n\t\t *\n\t\t *\t +---+---+---+\n\t\t *\t | A | B | C |\n\t\t *\t +---+---+---+\n\t\t *\t | D | E | F |\n\t\t *\t +---+---+---+\n\t\t *\n\t\t * then for each monitor you would call it like this\n\t\t *\n\t\t *\t const w = 1920;\n\t\t *\t const h = 1080;\n\t\t *\t const fullWidth = w * 3;\n\t\t *\t const fullHeight = h * 2;\n\t\t *\n\t\t *\t --A--\n\t\t *\t camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 0, w, h );\n\t\t *\t --B--\n\t\t *\t camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 0, w, h );\n\t\t *\t --C--\n\t\t *\t camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 0, w, h );\n\t\t *\t --D--\n\t\t *\t camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 1, w, h );\n\t\t *\t --E--\n\t\t *\t camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 1, w, h );\n\t\t *\t --F--\n\t\t *\t camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 1, w, h );\n\t\t *\n\t\t *\t Note there is no reason monitors have to be the same size or in a grid.\n\t\t */\n\n\n\t\tsetViewOffset(fullWidth, fullHeight, x, y, width, height) {\n\t\t\tthis.aspect = fullWidth / fullHeight;\n\n\t\t\tif (this.view === null) {\n\t\t\t\tthis.view = {\n\t\t\t\t\tenabled: true,\n\t\t\t\t\tfullWidth: 1,\n\t\t\t\t\tfullHeight: 1,\n\t\t\t\t\toffsetX: 0,\n\t\t\t\t\toffsetY: 0,\n\t\t\t\t\twidth: 1,\n\t\t\t\t\theight: 1\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tthis.view.enabled = true;\n\t\t\tthis.view.fullWidth = fullWidth;\n\t\t\tthis.view.fullHeight = fullHeight;\n\t\t\tthis.view.offsetX = x;\n\t\t\tthis.view.offsetY = y;\n\t\t\tthis.view.width = width;\n\t\t\tthis.view.height = height;\n\t\t\tthis.updateProjectionMatrix();\n\t\t}\n\n\t\tclearViewOffset() {\n\t\t\tif (this.view !== null) {\n\t\t\t\tthis.view.enabled = false;\n\t\t\t}\n\n\t\t\tthis.updateProjectionMatrix();\n\t\t}\n\n\t\tupdateProjectionMatrix() {\n\t\t\tconst near = this.near;\n\t\t\tlet top = near * Math.tan(DEG2RAD * 0.5 * this.fov) / this.zoom;\n\t\t\tlet height = 2 * top;\n\t\t\tlet width = this.aspect * height;\n\t\t\tlet left = -0.5 * width;\n\t\t\tconst view = this.view;\n\n\t\t\tif (this.view !== null && this.view.enabled) {\n\t\t\t\tconst fullWidth = view.fullWidth,\n\t\t\t\t\t\t\tfullHeight = view.fullHeight;\n\t\t\t\tleft += view.offsetX * width / fullWidth;\n\t\t\t\ttop -= view.offsetY * height / fullHeight;\n\t\t\t\twidth *= view.width / fullWidth;\n\t\t\t\theight *= view.height / fullHeight;\n\t\t\t}\n\n\t\t\tconst skew = this.filmOffset;\n\t\t\tif (skew !== 0) left += near * skew / this.getFilmWidth();\n\t\t\tthis.projectionMatrix.makePerspective(left, left + width, top, top - height, near, this.far);\n\t\t\tthis.projectionMatrixInverse.copy(this.projectionMatrix).invert();\n\t\t}\n\n\t\ttoJSON(meta) {\n\t\t\tconst data = super.toJSON(meta);\n\t\t\tdata.object.fov = this.fov;\n\t\t\tdata.object.zoom = this.zoom;\n\t\t\tdata.object.near = this.near;\n\t\t\tdata.object.far = this.far;\n\t\t\tdata.object.focus = this.focus;\n\t\t\tdata.object.aspect = this.aspect;\n\t\t\tif (this.view !== null) data.object.view = Object.assign({}, this.view);\n\t\t\tdata.object.filmGauge = this.filmGauge;\n\t\t\tdata.object.filmOffset = this.filmOffset;\n\t\t\treturn data;\n\t\t}\n\n\t}\n\n\tPerspectiveCamera.prototype.isPerspectiveCamera = true;\n\n\tconst fov = 90,\n\t\t\t\taspect = 1;\n\n\tclass CubeCamera extends Object3D {\n\t\tconstructor(near, far, renderTarget) {\n\t\t\tsuper();\n\t\t\tthis.type = 'CubeCamera';\n\n\t\t\tif (renderTarget.isWebGLCubeRenderTarget !== true) {\n\t\t\t\tconsole.error('THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.renderTarget = renderTarget;\n\t\t\tconst cameraPX = new PerspectiveCamera(fov, aspect, near, far);\n\t\t\tcameraPX.layers = this.layers;\n\t\t\tcameraPX.up.set(0, -1, 0);\n\t\t\tcameraPX.lookAt(new Vector3(1, 0, 0));\n\t\t\tthis.add(cameraPX);\n\t\t\tconst cameraNX = new PerspectiveCamera(fov, aspect, near, far);\n\t\t\tcameraNX.layers = this.layers;\n\t\t\tcameraNX.up.set(0, -1, 0);\n\t\t\tcameraNX.lookAt(new Vector3(-1, 0, 0));\n\t\t\tthis.add(cameraNX);\n\t\t\tconst cameraPY = new PerspectiveCamera(fov, aspect, near, far);\n\t\t\tcameraPY.layers = this.layers;\n\t\t\tcameraPY.up.set(0, 0, 1);\n\t\t\tcameraPY.lookAt(new Vector3(0, 1, 0));\n\t\t\tthis.add(cameraPY);\n\t\t\tconst cameraNY = new PerspectiveCamera(fov, aspect, near, far);\n\t\t\tcameraNY.layers = this.layers;\n\t\t\tcameraNY.up.set(0, 0, -1);\n\t\t\tcameraNY.lookAt(new Vector3(0, -1, 0));\n\t\t\tthis.add(cameraNY);\n\t\t\tconst cameraPZ = new PerspectiveCamera(fov, aspect, near, far);\n\t\t\tcameraPZ.layers = this.layers;\n\t\t\tcameraPZ.up.set(0, -1, 0);\n\t\t\tcameraPZ.lookAt(new Vector3(0, 0, 1));\n\t\t\tthis.add(cameraPZ);\n\t\t\tconst cameraNZ = new PerspectiveCamera(fov, aspect, near, far);\n\t\t\tcameraNZ.layers = this.layers;\n\t\t\tcameraNZ.up.set(0, -1, 0);\n\t\t\tcameraNZ.lookAt(new Vector3(0, 0, -1));\n\t\t\tthis.add(cameraNZ);\n\t\t}\n\n\t\tupdate(renderer, scene) {\n\t\t\tif (this.parent === null) this.updateMatrixWorld();\n\t\t\tconst renderTarget = this.renderTarget;\n\t\t\tconst [cameraPX, cameraNX, cameraPY, cameraNY, cameraPZ, cameraNZ] = this.children;\n\t\t\tconst currentXrEnabled = renderer.xr.enabled;\n\t\t\tconst currentRenderTarget = renderer.getRenderTarget();\n\t\t\trenderer.xr.enabled = false;\n\t\t\tconst generateMipmaps = renderTarget.texture.generateMipmaps;\n\t\t\trenderTarget.texture.generateMipmaps = false;\n\t\t\trenderer.setRenderTarget(renderTarget, 0);\n\t\t\trenderer.render(scene, cameraPX);\n\t\t\trenderer.setRenderTarget(renderTarget, 1);\n\t\t\trenderer.render(scene, cameraNX);\n\t\t\trenderer.setRenderTarget(renderTarget, 2);\n\t\t\trenderer.render(scene, cameraPY);\n\t\t\trenderer.setRenderTarget(renderTarget, 3);\n\t\t\trenderer.render(scene, cameraNY);\n\t\t\trenderer.setRenderTarget(renderTarget, 4);\n\t\t\trenderer.render(scene, cameraPZ);\n\t\t\trenderTarget.texture.generateMipmaps = generateMipmaps;\n\t\t\trenderer.setRenderTarget(renderTarget, 5);\n\t\t\trenderer.render(scene, cameraNZ);\n\t\t\trenderer.setRenderTarget(currentRenderTarget);\n\t\t\trenderer.xr.enabled = currentXrEnabled;\n\t\t}\n\n\t}\n\n\tclass CubeTexture extends Texture {\n\t\tconstructor(images, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding) {\n\t\t\timages = images !== undefined ? images : [];\n\t\t\tmapping = mapping !== undefined ? mapping : CubeReflectionMapping;\n\t\t\tsuper(images, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding);\n\t\t\tthis.flipY = false;\n\t\t}\n\n\t\tget images() {\n\t\t\treturn this.image;\n\t\t}\n\n\t\tset images(value) {\n\t\t\tthis.image = value;\n\t\t}\n\n\t}\n\n\tCubeTexture.prototype.isCubeTexture = true;\n\n\tclass WebGLCubeRenderTarget extends WebGLRenderTarget {\n\t\tconstructor(size, options, dummy) {\n\t\t\tif (Number.isInteger(options)) {\n\t\t\t\tconsole.warn('THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )');\n\t\t\t\toptions = dummy;\n\t\t\t}\n\n\t\t\tsuper(size, size, options);\n\t\t\toptions = options || {}; // By convention -- likely based on the RenderMan spec from the 1990's -- cube maps are specified by WebGL (and three.js)\n\t\t\t// in a coordinate system in which positive-x is to the right when looking up the positive-z axis -- in other words,\n\t\t\t// in a left-handed coordinate system. By continuing this convention, preexisting cube maps continued to render correctly.\n\t\t\t// three.js uses a right-handed coordinate system. So environment maps used in three.js appear to have px and nx swapped\n\t\t\t// and the flag isRenderTargetTexture controls this conversion. The flip is not required when using WebGLCubeRenderTarget.texture\n\t\t\t// as a cube texture (this is detected when isRenderTargetTexture is set to true for cube textures).\n\n\t\t\tthis.texture = new CubeTexture(undefined, options.mapping, options.wrapS, options.wrapT, options.magFilter, options.minFilter, options.format, options.type, options.anisotropy, options.encoding);\n\t\t\tthis.texture.isRenderTargetTexture = true;\n\t\t\tthis.texture.generateMipmaps = options.generateMipmaps !== undefined ? options.generateMipmaps : false;\n\t\t\tthis.texture.minFilter = options.minFilter !== undefined ? options.minFilter : LinearFilter;\n\t\t\tthis.texture._needsFlipEnvMap = false;\n\t\t}\n\n\t\tfromEquirectangularTexture(renderer, texture) {\n\t\t\tthis.texture.type = texture.type;\n\t\t\tthis.texture.format = RGBAFormat; // see #18859\n\n\t\t\tthis.texture.encoding = texture.encoding;\n\t\t\tthis.texture.generateMipmaps = texture.generateMipmaps;\n\t\t\tthis.texture.minFilter = texture.minFilter;\n\t\t\tthis.texture.magFilter = texture.magFilter;\n\t\t\tconst shader = {\n\t\t\t\tuniforms: {\n\t\t\t\t\ttEquirect: {\n\t\t\t\t\t\tvalue: null\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tvertexShader:\n\t\t\t\t/* glsl */\n\t\t\t\t`\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include <begin_vertex>\n\t\t\t\t\t#include <project_vertex>\n\n\t\t\t\t}\n\t\t\t`,\n\t\t\t\tfragmentShader:\n\t\t\t\t/* glsl */\n\t\t\t\t`\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include <common>\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t`\n\t\t\t};\n\t\t\tconst geometry = new BoxGeometry(5, 5, 5);\n\t\t\tconst material = new ShaderMaterial({\n\t\t\t\tname: 'CubemapFromEquirect',\n\t\t\t\tuniforms: cloneUniforms(shader.uniforms),\n\t\t\t\tvertexShader: shader.vertexShader,\n\t\t\t\tfragmentShader: shader.fragmentShader,\n\t\t\t\tside: BackSide,\n\t\t\t\tblending: NoBlending\n\t\t\t});\n\t\t\tmaterial.uniforms.tEquirect.value = texture;\n\t\t\tconst mesh = new Mesh(geometry, material);\n\t\t\tconst currentMinFilter = texture.minFilter; // Avoid blurred poles\n\n\t\t\tif (texture.minFilter === LinearMipmapLinearFilter) texture.minFilter = LinearFilter;\n\t\t\tconst camera = new CubeCamera(1, 10, this);\n\t\t\tcamera.update(renderer, mesh);\n\t\t\ttexture.minFilter = currentMinFilter;\n\t\t\tmesh.geometry.dispose();\n\t\t\tmesh.material.dispose();\n\t\t\treturn this;\n\t\t}\n\n\t\tclear(renderer, color, depth, stencil) {\n\t\t\tconst currentRenderTarget = renderer.getRenderTarget();\n\n\t\t\tfor (let i = 0; i < 6; i++) {\n\t\t\t\trenderer.setRenderTarget(this, i);\n\t\t\t\trenderer.clear(color, depth, stencil);\n\t\t\t}\n\n\t\t\trenderer.setRenderTarget(currentRenderTarget);\n\t\t}\n\n\t}\n\n\tWebGLCubeRenderTarget.prototype.isWebGLCubeRenderTarget = true;\n\n\tconst _vector1 = /*@__PURE__*/new Vector3();\n\n\tconst _vector2 = /*@__PURE__*/new Vector3();\n\n\tconst _normalMatrix = /*@__PURE__*/new Matrix3();\n\n\tclass Plane {\n\t\tconstructor(normal = new Vector3(1, 0, 0), constant = 0) {\n\t\t\t// normal is assumed to be normalized\n\t\t\tthis.normal = normal;\n\t\t\tthis.constant = constant;\n\t\t}\n\n\t\tset(normal, constant) {\n\t\t\tthis.normal.copy(normal);\n\t\t\tthis.constant = constant;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetComponents(x, y, z, w) {\n\t\t\tthis.normal.set(x, y, z);\n\t\t\tthis.constant = w;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetFromNormalAndCoplanarPoint(normal, point) {\n\t\t\tthis.normal.copy(normal);\n\t\t\tthis.constant = -point.dot(this.normal);\n\t\t\treturn this;\n\t\t}\n\n\t\tsetFromCoplanarPoints(a, b, c) {\n\t\t\tconst normal = _vector1.subVectors(c, b).cross(_vector2.subVectors(a, b)).normalize(); // Q: should an error be thrown if normal is zero (e.g. degenerate plane)?\n\n\n\t\t\tthis.setFromNormalAndCoplanarPoint(normal, a);\n\t\t\treturn this;\n\t\t}\n\n\t\tcopy(plane) {\n\t\t\tthis.normal.copy(plane.normal);\n\t\t\tthis.constant = plane.constant;\n\t\t\treturn this;\n\t\t}\n\n\t\tnormalize() {\n\t\t\t// Note: will lead to a divide by zero if the plane is invalid.\n\t\t\tconst inverseNormalLength = 1.0 / this.normal.length();\n\t\t\tthis.normal.multiplyScalar(inverseNormalLength);\n\t\t\tthis.constant *= inverseNormalLength;\n\t\t\treturn this;\n\t\t}\n\n\t\tnegate() {\n\t\t\tthis.constant *= -1;\n\t\t\tthis.normal.negate();\n\t\t\treturn this;\n\t\t}\n\n\t\tdistanceToPoint(point) {\n\t\t\treturn this.normal.dot(point) + this.constant;\n\t\t}\n\n\t\tdistanceToSphere(sphere) {\n\t\t\treturn this.distanceToPoint(sphere.center) - sphere.radius;\n\t\t}\n\n\t\tprojectPoint(point, target) {\n\t\t\treturn target.copy(this.normal).multiplyScalar(-this.distanceToPoint(point)).add(point);\n\t\t}\n\n\t\tintersectLine(line, target) {\n\t\t\tconst direction = line.delta(_vector1);\n\t\t\tconst denominator = this.normal.dot(direction);\n\n\t\t\tif (denominator === 0) {\n\t\t\t\t// line is coplanar, return origin\n\t\t\t\tif (this.distanceToPoint(line.start) === 0) {\n\t\t\t\t\treturn target.copy(line.start);\n\t\t\t\t} // Unsure if this is the correct method to handle this case.\n\n\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst t = -(line.start.dot(this.normal) + this.constant) / denominator;\n\n\t\t\tif (t < 0 || t > 1) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\treturn target.copy(direction).multiplyScalar(t).add(line.start);\n\t\t}\n\n\t\tintersectsLine(line) {\n\t\t\t// Note: this tests if a line intersects the plane, not whether it (or its end-points) are coplanar with it.\n\t\t\tconst startSign = this.distanceToPoint(line.start);\n\t\t\tconst endSign = this.distanceToPoint(line.end);\n\t\t\treturn startSign < 0 && endSign > 0 || endSign < 0 && startSign > 0;\n\t\t}\n\n\t\tintersectsBox(box) {\n\t\t\treturn box.intersectsPlane(this);\n\t\t}\n\n\t\tintersectsSphere(sphere) {\n\t\t\treturn sphere.intersectsPlane(this);\n\t\t}\n\n\t\tcoplanarPoint(target) {\n\t\t\treturn target.copy(this.normal).multiplyScalar(-this.constant);\n\t\t}\n\n\t\tapplyMatrix4(matrix, optionalNormalMatrix) {\n\t\t\tconst normalMatrix = optionalNormalMatrix || _normalMatrix.getNormalMatrix(matrix);\n\n\t\t\tconst referencePoint = this.coplanarPoint(_vector1).applyMatrix4(matrix);\n\t\t\tconst normal = this.normal.applyMatrix3(normalMatrix).normalize();\n\t\t\tthis.constant = -referencePoint.dot(normal);\n\t\t\treturn this;\n\t\t}\n\n\t\ttranslate(offset) {\n\t\t\tthis.constant -= offset.dot(this.normal);\n\t\t\treturn this;\n\t\t}\n\n\t\tequals(plane) {\n\t\t\treturn plane.normal.equals(this.normal) && plane.constant === this.constant;\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new this.constructor().copy(this);\n\t\t}\n\n\t}\n\n\tPlane.prototype.isPlane = true;\n\n\tconst _sphere$2 = /*@__PURE__*/new Sphere();\n\n\tconst _vector$7 = /*@__PURE__*/new Vector3();\n\n\tclass Frustum {\n\t\tconstructor(p0 = new Plane(), p1 = new Plane(), p2 = new Plane(), p3 = new Plane(), p4 = new Plane(), p5 = new Plane()) {\n\t\t\tthis.planes = [p0, p1, p2, p3, p4, p5];\n\t\t}\n\n\t\tset(p0, p1, p2, p3, p4, p5) {\n\t\t\tconst planes = this.planes;\n\t\t\tplanes[0].copy(p0);\n\t\t\tplanes[1].copy(p1);\n\t\t\tplanes[2].copy(p2);\n\t\t\tplanes[3].copy(p3);\n\t\t\tplanes[4].copy(p4);\n\t\t\tplanes[5].copy(p5);\n\t\t\treturn this;\n\t\t}\n\n\t\tcopy(frustum) {\n\t\t\tconst planes = this.planes;\n\n\t\t\tfor (let i = 0; i < 6; i++) {\n\t\t\t\tplanes[i].copy(frustum.planes[i]);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tsetFromProjectionMatrix(m) {\n\t\t\tconst planes = this.planes;\n\t\t\tconst me = m.elements;\n\t\t\tconst me0 = me[0],\n\t\t\t\t\t\tme1 = me[1],\n\t\t\t\t\t\tme2 = me[2],\n\t\t\t\t\t\tme3 = me[3];\n\t\t\tconst me4 = me[4],\n\t\t\t\t\t\tme5 = me[5],\n\t\t\t\t\t\tme6 = me[6],\n\t\t\t\t\t\tme7 = me[7];\n\t\t\tconst me8 = me[8],\n\t\t\t\t\t\tme9 = me[9],\n\t\t\t\t\t\tme10 = me[10],\n\t\t\t\t\t\tme11 = me[11];\n\t\t\tconst me12 = me[12],\n\t\t\t\t\t\tme13 = me[13],\n\t\t\t\t\t\tme14 = me[14],\n\t\t\t\t\t\tme15 = me[15];\n\t\t\tplanes[0].setComponents(me3 - me0, me7 - me4, me11 - me8, me15 - me12).normalize();\n\t\t\tplanes[1].setComponents(me3 + me0, me7 + me4, me11 + me8, me15 + me12).normalize();\n\t\t\tplanes[2].setComponents(me3 + me1, me7 + me5, me11 + me9, me15 + me13).normalize();\n\t\t\tplanes[3].setComponents(me3 - me1, me7 - me5, me11 - me9, me15 - me13).normalize();\n\t\t\tplanes[4].setComponents(me3 - me2, me7 - me6, me11 - me10, me15 - me14).normalize();\n\t\t\tplanes[5].setComponents(me3 + me2, me7 + me6, me11 + me10, me15 + me14).normalize();\n\t\t\treturn this;\n\t\t}\n\n\t\tintersectsObject(object) {\n\t\t\tconst geometry = object.geometry;\n\t\t\tif (geometry.boundingSphere === null) geometry.computeBoundingSphere();\n\n\t\t\t_sphere$2.copy(geometry.boundingSphere).applyMatrix4(object.matrixWorld);\n\n\t\t\treturn this.intersectsSphere(_sphere$2);\n\t\t}\n\n\t\tintersectsSprite(sprite) {\n\t\t\t_sphere$2.center.set(0, 0, 0);\n\n\t\t\t_sphere$2.radius = 0.7071067811865476;\n\n\t\t\t_sphere$2.applyMatrix4(sprite.matrixWorld);\n\n\t\t\treturn this.intersectsSphere(_sphere$2);\n\t\t}\n\n\t\tintersectsSphere(sphere) {\n\t\t\tconst planes = this.planes;\n\t\t\tconst center = sphere.center;\n\t\t\tconst negRadius = -sphere.radius;\n\n\t\t\tfor (let i = 0; i < 6; i++) {\n\t\t\t\tconst distance = planes[i].distanceToPoint(center);\n\n\t\t\t\tif (distance < negRadius) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tintersectsBox(box) {\n\t\t\tconst planes = this.planes;\n\n\t\t\tfor (let i = 0; i < 6; i++) {\n\t\t\t\tconst plane = planes[i]; // corner at max distance\n\n\t\t\t\t_vector$7.x = plane.normal.x > 0 ? box.max.x : box.min.x;\n\t\t\t\t_vector$7.y = plane.normal.y > 0 ? box.max.y : box.min.y;\n\t\t\t\t_vector$7.z = plane.normal.z > 0 ? box.max.z : box.min.z;\n\n\t\t\t\tif (plane.distanceToPoint(_vector$7) < 0) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tcontainsPoint(point) {\n\t\t\tconst planes = this.planes;\n\n\t\t\tfor (let i = 0; i < 6; i++) {\n\t\t\t\tif (planes[i].distanceToPoint(point) < 0) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new this.constructor().copy(this);\n\t\t}\n\n\t}\n\n\tfunction WebGLAnimation() {\n\t\tlet context = null;\n\t\tlet isAnimating = false;\n\t\tlet animationLoop = null;\n\t\tlet requestId = null;\n\n\t\tfunction onAnimationFrame(time, frame) {\n\t\t\tanimationLoop(time, frame);\n\t\t\trequestId = context.requestAnimationFrame(onAnimationFrame);\n\t\t}\n\n\t\treturn {\n\t\t\tstart: function () {\n\t\t\t\tif (isAnimating === true) return;\n\t\t\t\tif (animationLoop === null) return;\n\t\t\t\trequestId = context.requestAnimationFrame(onAnimationFrame);\n\t\t\t\tisAnimating = true;\n\t\t\t},\n\t\t\tstop: function () {\n\t\t\t\tcontext.cancelAnimationFrame(requestId);\n\t\t\t\tisAnimating = false;\n\t\t\t},\n\t\t\tsetAnimationLoop: function (callback) {\n\t\t\t\tanimationLoop = callback;\n\t\t\t},\n\t\t\tsetContext: function (value) {\n\t\t\t\tcontext = value;\n\t\t\t}\n\t\t};\n\t}\n\n\tfunction WebGLAttributes(gl, capabilities) {\n\t\tconst isWebGL2 = capabilities.isWebGL2;\n\t\tconst buffers = new WeakMap();\n\n\t\tfunction createBuffer(attribute, bufferType) {\n\t\t\tconst array = attribute.array;\n\t\t\tconst usage = attribute.usage;\n\t\t\tconst buffer = gl.createBuffer();\n\t\t\tgl.bindBuffer(bufferType, buffer);\n\t\t\tgl.bufferData(bufferType, array, usage);\n\t\t\tattribute.onUploadCallback();\n\t\t\tlet type = gl.FLOAT;\n\n\t\t\tif (array instanceof Float32Array) {\n\t\t\t\ttype = gl.FLOAT;\n\t\t\t} else if (array instanceof Float64Array) {\n\t\t\t\tconsole.warn('THREE.WebGLAttributes: Unsupported data buffer format: Float64Array.');\n\t\t\t} else if (array instanceof Uint16Array) {\n\t\t\t\tif (attribute.isFloat16BufferAttribute) {\n\t\t\t\t\tif (isWebGL2) {\n\t\t\t\t\t\ttype = gl.HALF_FLOAT;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconsole.warn('THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.');\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\ttype = gl.UNSIGNED_SHORT;\n\t\t\t\t}\n\t\t\t} else if (array instanceof Int16Array) {\n\t\t\t\ttype = gl.SHORT;\n\t\t\t} else if (array instanceof Uint32Array) {\n\t\t\t\ttype = gl.UNSIGNED_INT;\n\t\t\t} else if (array instanceof Int32Array) {\n\t\t\t\ttype = gl.INT;\n\t\t\t} else if (array instanceof Int8Array) {\n\t\t\t\ttype = gl.BYTE;\n\t\t\t} else if (array instanceof Uint8Array) {\n\t\t\t\ttype = gl.UNSIGNED_BYTE;\n\t\t\t} else if (array instanceof Uint8ClampedArray) {\n\t\t\t\ttype = gl.UNSIGNED_BYTE;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tbuffer: buffer,\n\t\t\t\ttype: type,\n\t\t\t\tbytesPerElement: array.BYTES_PER_ELEMENT,\n\t\t\t\tversion: attribute.version\n\t\t\t};\n\t\t}\n\n\t\tfunction updateBuffer(buffer, attribute, bufferType) {\n\t\t\tconst array = attribute.array;\n\t\t\tconst updateRange = attribute.updateRange;\n\t\t\tgl.bindBuffer(bufferType, buffer);\n\n\t\t\tif (updateRange.count === -1) {\n\t\t\t\t// Not using update ranges\n\t\t\t\tgl.bufferSubData(bufferType, 0, array);\n\t\t\t} else {\n\t\t\t\tif (isWebGL2) {\n\t\t\t\t\tgl.bufferSubData(bufferType, updateRange.offset * array.BYTES_PER_ELEMENT, array, updateRange.offset, updateRange.count);\n\t\t\t\t} else {\n\t\t\t\t\tgl.bufferSubData(bufferType, updateRange.offset * array.BYTES_PER_ELEMENT, array.subarray(updateRange.offset, updateRange.offset + updateRange.count));\n\t\t\t\t}\n\n\t\t\t\tupdateRange.count = -1; // reset range\n\t\t\t}\n\t\t} //\n\n\n\t\tfunction get(attribute) {\n\t\t\tif (attribute.isInterleavedBufferAttribute) attribute = attribute.data;\n\t\t\treturn buffers.get(attribute);\n\t\t}\n\n\t\tfunction remove(attribute) {\n\t\t\tif (attribute.isInterleavedBufferAttribute) attribute = attribute.data;\n\t\t\tconst data = buffers.get(attribute);\n\n\t\t\tif (data) {\n\t\t\t\tgl.deleteBuffer(data.buffer);\n\t\t\t\tbuffers.delete(attribute);\n\t\t\t}\n\t\t}\n\n\t\tfunction update(attribute, bufferType) {\n\t\t\tif (attribute.isGLBufferAttribute) {\n\t\t\t\tconst cached = buffers.get(attribute);\n\n\t\t\t\tif (!cached || cached.version < attribute.version) {\n\t\t\t\t\tbuffers.set(attribute, {\n\t\t\t\t\t\tbuffer: attribute.buffer,\n\t\t\t\t\t\ttype: attribute.type,\n\t\t\t\t\t\tbytesPerElement: attribute.elementSize,\n\t\t\t\t\t\tversion: attribute.version\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (attribute.isInterleavedBufferAttribute) attribute = attribute.data;\n\t\t\tconst data = buffers.get(attribute);\n\n\t\t\tif (data === undefined) {\n\t\t\t\tbuffers.set(attribute, createBuffer(attribute, bufferType));\n\t\t\t} else if (data.version < attribute.version) {\n\t\t\t\tupdateBuffer(data.buffer, attribute, bufferType);\n\t\t\t\tdata.version = attribute.version;\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tget: get,\n\t\t\tremove: remove,\n\t\t\tupdate: update\n\t\t};\n\t}\n\n\tclass PlaneGeometry extends BufferGeometry {\n\t\tconstructor(width = 1, height = 1, widthSegments = 1, heightSegments = 1) {\n\t\t\tsuper();\n\t\t\tthis.type = 'PlaneGeometry';\n\t\t\tthis.parameters = {\n\t\t\t\twidth: width,\n\t\t\t\theight: height,\n\t\t\t\twidthSegments: widthSegments,\n\t\t\t\theightSegments: heightSegments\n\t\t\t};\n\t\t\tconst width_half = width / 2;\n\t\t\tconst height_half = height / 2;\n\t\t\tconst gridX = Math.floor(widthSegments);\n\t\t\tconst gridY = Math.floor(heightSegments);\n\t\t\tconst gridX1 = gridX + 1;\n\t\t\tconst gridY1 = gridY + 1;\n\t\t\tconst segment_width = width / gridX;\n\t\t\tconst segment_height = height / gridY; //\n\n\t\t\tconst indices = [];\n\t\t\tconst vertices = [];\n\t\t\tconst normals = [];\n\t\t\tconst uvs = [];\n\n\t\t\tfor (let iy = 0; iy < gridY1; iy++) {\n\t\t\t\tconst y = iy * segment_height - height_half;\n\n\t\t\t\tfor (let ix = 0; ix < gridX1; ix++) {\n\t\t\t\t\tconst x = ix * segment_width - width_half;\n\t\t\t\t\tvertices.push(x, -y, 0);\n\t\t\t\t\tnormals.push(0, 0, 1);\n\t\t\t\t\tuvs.push(ix / gridX);\n\t\t\t\t\tuvs.push(1 - iy / gridY);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (let iy = 0; iy < gridY; iy++) {\n\t\t\t\tfor (let ix = 0; ix < gridX; ix++) {\n\t\t\t\t\tconst a = ix + gridX1 * iy;\n\t\t\t\t\tconst b = ix + gridX1 * (iy + 1);\n\t\t\t\t\tconst c = ix + 1 + gridX1 * (iy + 1);\n\t\t\t\t\tconst d = ix + 1 + gridX1 * iy;\n\t\t\t\t\tindices.push(a, b, d);\n\t\t\t\t\tindices.push(b, c, d);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.setIndex(indices);\n\t\t\tthis.setAttribute('position', new Float32BufferAttribute(vertices, 3));\n\t\t\tthis.setAttribute('normal', new Float32BufferAttribute(normals, 3));\n\t\t\tthis.setAttribute('uv', new Float32BufferAttribute(uvs, 2));\n\t\t}\n\n\t\tstatic fromJSON(data) {\n\t\t\treturn new PlaneGeometry(data.width, data.height, data.widthSegments, data.heightSegments);\n\t\t}\n\n\t}\n\n\tvar alphamap_fragment = \"#ifdef USE_ALPHAMAP\\n\\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\\n#endif\";\n\n\tvar alphamap_pars_fragment = \"#ifdef USE_ALPHAMAP\\n\\tuniform sampler2D alphaMap;\\n#endif\";\n\n\tvar alphatest_fragment = \"#ifdef USE_ALPHATEST\\n\\tif ( diffuseColor.a < alphaTest ) discard;\\n#endif\";\n\n\tvar alphatest_pars_fragment = \"#ifdef USE_ALPHATEST\\n\\tuniform float alphaTest;\\n#endif\";\n\n\tvar aomap_fragment = \"#ifdef USE_AOMAP\\n\\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\\n\\treflectedLight.indirectDiffuse *= ambientOcclusion;\\n\\t#if defined( USE_ENVMAP ) && defined( STANDARD )\\n\\t\\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\\n\\t\\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\\n\\t#endif\\n#endif\";\n\n\tvar aomap_pars_fragment = \"#ifdef USE_AOMAP\\n\\tuniform sampler2D aoMap;\\n\\tuniform float aoMapIntensity;\\n#endif\";\n\n\tvar begin_vertex = \"vec3 transformed = vec3( position );\";\n\n\tvar beginnormal_vertex = \"vec3 objectNormal = vec3( normal );\\n#ifdef USE_TANGENT\\n\\tvec3 objectTangent = vec3( tangent.xyz );\\n#endif\";\n\n\tvar bsdfs = \"vec3 BRDF_Lambert( const in vec3 diffuseColor ) {\\n\\treturn RECIPROCAL_PI * diffuseColor;\\n}\\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\\n\\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\\n\\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\\n}\\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\\n\\tfloat a2 = pow2( alpha );\\n\\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\\n\\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\\n\\treturn 0.5 / max( gv + gl, EPSILON );\\n}\\nfloat D_GGX( const in float alpha, const in float dotNH ) {\\n\\tfloat a2 = pow2( alpha );\\n\\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\\n\\treturn RECIPROCAL_PI * a2 / pow2( denom );\\n}\\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float roughness ) {\\n\\tfloat alpha = pow2( roughness );\\n\\tvec3 halfDir = normalize( lightDir + viewDir );\\n\\tfloat dotNL = saturate( dot( normal, lightDir ) );\\n\\tfloat dotNV = saturate( dot( normal, viewDir ) );\\n\\tfloat dotNH = saturate( dot( normal, halfDir ) );\\n\\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\\n\\tvec3 F = F_Schlick( f0, f90, dotVH );\\n\\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\\n\\tfloat D = D_GGX( alpha, dotNH );\\n\\treturn F * ( V * D );\\n}\\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\\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\\tfloat dotNV = saturate( dot( N, V ) );\\n\\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\\n\\tuv = uv * LUT_SCALE + LUT_BIAS;\\n\\treturn uv;\\n}\\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\\n\\tfloat l = length( f );\\n\\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\\n}\\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\\n\\tfloat x = dot( v1, v2 );\\n\\tfloat y = abs( x );\\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\\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\\n\\treturn cross( v1, v2 ) * theta_sintheta;\\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\\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\\n\\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\\n\\tvec3 lightNormal = cross( v1, v2 );\\n\\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\\n\\tvec3 T1, T2;\\n\\tT1 = normalize( V - N * dot( V, N ) );\\n\\tT2 = - cross( N, T1 );\\n\\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\\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\\tcoords[ 0 ] = normalize( coords[ 0 ] );\\n\\tcoords[ 1 ] = normalize( coords[ 1 ] );\\n\\tcoords[ 2 ] = normalize( coords[ 2 ] );\\n\\tcoords[ 3 ] = normalize( coords[ 3 ] );\\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\\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\\n\\treturn vec3( result );\\n}\\nfloat G_BlinnPhong_Implicit( ) {\\n\\treturn 0.25;\\n}\\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\\n\\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\\n}\\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\\n\\tvec3 halfDir = normalize( lightDir + viewDir );\\n\\tfloat dotNH = saturate( dot( normal, halfDir ) );\\n\\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\\n\\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\\n\\tfloat G = G_BlinnPhong_Implicit( );\\n\\tfloat D = D_BlinnPhong( shininess, dotNH );\\n\\treturn F * ( G * D );\\n}\\n#if defined( USE_SHEEN )\\nfloat D_Charlie( float roughness, float dotNH ) {\\n\\tfloat alpha = pow2( roughness );\\n\\tfloat invAlpha = 1.0 / alpha;\\n\\tfloat cos2h = dotNH * dotNH;\\n\\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\\n\\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\\n}\\nfloat V_Neubelt( float dotNV, float dotNL ) {\\n\\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\\n}\\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenTint, const in float sheenRoughness ) {\\n\\tvec3 halfDir = normalize( lightDir + viewDir );\\n\\tfloat dotNL = saturate( dot( normal, lightDir ) );\\n\\tfloat dotNV = saturate( dot( normal, viewDir ) );\\n\\tfloat dotNH = saturate( dot( normal, halfDir ) );\\n\\tfloat D = D_Charlie( sheenRoughness, dotNH );\\n\\tfloat V = V_Neubelt( dotNV, dotNL );\\n\\treturn sheenTint * ( D * V );\\n}\\n#endif\";\n\n\tvar bumpmap_pars_fragment = \"#ifdef USE_BUMPMAP\\n\\tuniform sampler2D bumpMap;\\n\\tuniform float bumpScale;\\n\\tvec2 dHdxy_fwd() {\\n\\t\\tvec2 dSTdx = dFdx( vUv );\\n\\t\\tvec2 dSTdy = dFdy( vUv );\\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\\t\\treturn vec2( dBx, dBy );\\n\\t}\\n\\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\\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;\\n\\t\\tvec3 R1 = cross( vSigmaY, vN );\\n\\t\\tvec3 R2 = cross( vN, vSigmaX );\\n\\t\\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\\n\\t\\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\\n\\t\\treturn normalize( abs( fDet ) * surf_norm - vGrad );\\n\\t}\\n#endif\";\n\n\tvar clipping_planes_fragment = \"#if NUM_CLIPPING_PLANES > 0\\n\\tvec4 plane;\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\\n\\t\\tplane = clippingPlanes[ i ];\\n\\t\\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\\n\\t}\\n\\t#pragma unroll_loop_end\\n\\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\\n\\t\\tbool clipped = true;\\n\\t\\t#pragma unroll_loop_start\\n\\t\\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\\n\\t\\t\\tplane = clippingPlanes[ i ];\\n\\t\\t\\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\\n\\t\\t}\\n\\t\\t#pragma unroll_loop_end\\n\\t\\tif ( clipped ) discard;\\n\\t#endif\\n#endif\";\n\n\tvar clipping_planes_pars_fragment = \"#if NUM_CLIPPING_PLANES > 0\\n\\tvarying vec3 vClipPosition;\\n\\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\\n#endif\";\n\n\tvar clipping_planes_pars_vertex = \"#if NUM_CLIPPING_PLANES > 0\\n\\tvarying vec3 vClipPosition;\\n#endif\";\n\n\tvar clipping_planes_vertex = \"#if NUM_CLIPPING_PLANES > 0\\n\\tvClipPosition = - mvPosition.xyz;\\n#endif\";\n\n\tvar color_fragment = \"#if defined( USE_COLOR_ALPHA )\\n\\tdiffuseColor *= vColor;\\n#elif defined( USE_COLOR )\\n\\tdiffuseColor.rgb *= vColor;\\n#endif\";\n\n\tvar color_pars_fragment = \"#if defined( USE_COLOR_ALPHA )\\n\\tvarying vec4 vColor;\\n#elif defined( USE_COLOR )\\n\\tvarying vec3 vColor;\\n#endif\";\n\n\tvar color_pars_vertex = \"#if defined( USE_COLOR_ALPHA )\\n\\tvarying vec4 vColor;\\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\\n\\tvarying vec3 vColor;\\n#endif\";\n\n\tvar color_vertex = \"#if defined( USE_COLOR_ALPHA )\\n\\tvColor = vec4( 1.0 );\\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\\n\\tvColor = vec3( 1.0 );\\n#endif\\n#ifdef USE_COLOR\\n\\tvColor *= color;\\n#endif\\n#ifdef USE_INSTANCING_COLOR\\n\\tvColor.xyz *= instanceColor.xyz;\\n#endif\";\n\n\tvar common = \"#define PI 3.141592653589793\\n#define PI2 6.283185307179586\\n#define PI_HALF 1.5707963267948966\\n#define RECIPROCAL_PI 0.3183098861837907\\n#define RECIPROCAL_PI2 0.15915494309189535\\n#define EPSILON 1e-6\\n#ifndef saturate\\n#define saturate( a ) clamp( a, 0.0, 1.0 )\\n#endif\\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\\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 max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\\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#ifdef HIGH_PRECISION\\n\\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\\n#else\\n\\tfloat precisionSafeLength( vec3 v ) {\\n\\t\\tfloat maxComponent = max3( abs( v ) );\\n\\t\\treturn length( v / maxComponent ) * maxComponent;\\n\\t}\\n#endif\\nstruct IncidentLight {\\n\\tvec3 color;\\n\\tvec3 direction;\\n\\tbool visible;\\n};\\nstruct ReflectedLight {\\n\\tvec3 directDiffuse;\\n\\tvec3 directSpecular;\\n\\tvec3 indirectDiffuse;\\n\\tvec3 indirectSpecular;\\n};\\nstruct GeometricContext {\\n\\tvec3 position;\\n\\tvec3 normal;\\n\\tvec3 viewDir;\\n#ifdef USE_CLEARCOAT\\n\\tvec3 clearcoatNormal;\\n#endif\\n};\\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\\n\\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\\n}\\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\\n\\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\\n}\\nmat3 transposeMat3( const in mat3 m ) {\\n\\tmat3 tmp;\\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\\treturn tmp;\\n}\\nfloat linearToRelativeLuminance( const in vec3 color ) {\\n\\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\\n\\treturn dot( weights, color.rgb );\\n}\\nbool isPerspectiveMatrix( mat4 m ) {\\n\\treturn m[ 2 ][ 3 ] == - 1.0;\\n}\\nvec2 equirectUv( in vec3 dir ) {\\n\\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\\n\\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\\n\\treturn vec2( u, v );\\n}\";\n\n\tvar cube_uv_reflection_fragment = \"#ifdef ENVMAP_TYPE_CUBE_UV\\n\\t#define cubeUV_maxMipLevel 8.0\\n\\t#define cubeUV_minMipLevel 4.0\\n\\t#define cubeUV_maxTileSize 256.0\\n\\t#define cubeUV_minTileSize 16.0\\n\\tfloat getFace( vec3 direction ) {\\n\\t\\tvec3 absDirection = abs( direction );\\n\\t\\tfloat face = - 1.0;\\n\\t\\tif ( absDirection.x > absDirection.z ) {\\n\\t\\t\\tif ( absDirection.x > absDirection.y )\\n\\t\\t\\t\\tface = direction.x > 0.0 ? 0.0 : 3.0;\\n\\t\\t\\telse\\n\\t\\t\\t\\tface = direction.y > 0.0 ? 1.0 : 4.0;\\n\\t\\t} else {\\n\\t\\t\\tif ( absDirection.z > absDirection.y )\\n\\t\\t\\t\\tface = direction.z > 0.0 ? 2.0 : 5.0;\\n\\t\\t\\telse\\n\\t\\t\\t\\tface = direction.y > 0.0 ? 1.0 : 4.0;\\n\\t\\t}\\n\\t\\treturn face;\\n\\t}\\n\\tvec2 getUV( vec3 direction, float face ) {\\n\\t\\tvec2 uv;\\n\\t\\tif ( face == 0.0 ) {\\n\\t\\t\\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\\n\\t\\t} else if ( face == 1.0 ) {\\n\\t\\t\\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\\n\\t\\t} else if ( face == 2.0 ) {\\n\\t\\t\\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\\n\\t\\t} else if ( face == 3.0 ) {\\n\\t\\t\\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\\n\\t\\t} else if ( face == 4.0 ) {\\n\\t\\t\\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\\n\\t\\t} else {\\n\\t\\t\\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\\n\\t\\t}\\n\\t\\treturn 0.5 * ( uv + 1.0 );\\n\\t}\\n\\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\\n\\t\\tfloat face = getFace( direction );\\n\\t\\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\\n\\t\\tmipInt = max( mipInt, cubeUV_minMipLevel );\\n\\t\\tfloat faceSize = exp2( mipInt );\\n\\t\\tfloat texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize );\\n\\t\\tvec2 uv = getUV( direction, face ) * ( faceSize - 1.0 );\\n\\t\\tvec2 f = fract( uv );\\n\\t\\tuv += 0.5 - f;\\n\\t\\tif ( face > 2.0 ) {\\n\\t\\t\\tuv.y += faceSize;\\n\\t\\t\\tface -= 3.0;\\n\\t\\t}\\n\\t\\tuv.x += face * faceSize;\\n\\t\\tif ( mipInt < cubeUV_maxMipLevel ) {\\n\\t\\t\\tuv.y += 2.0 * cubeUV_maxTileSize;\\n\\t\\t}\\n\\t\\tuv.y += filterInt * 2.0 * cubeUV_minTileSize;\\n\\t\\tuv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize );\\n\\t\\tuv *= texelSize;\\n\\t\\tvec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\\n\\t\\tuv.x += texelSize;\\n\\t\\tvec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\\n\\t\\tuv.y += texelSize;\\n\\t\\tvec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\\n\\t\\tuv.x -= texelSize;\\n\\t\\tvec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\\n\\t\\tvec3 tm = mix( tl, tr, f.x );\\n\\t\\tvec3 bm = mix( bl, br, f.x );\\n\\t\\treturn mix( tm, bm, f.y );\\n\\t}\\n\\t#define r0 1.0\\n\\t#define v0 0.339\\n\\t#define m0 - 2.0\\n\\t#define r1 0.8\\n\\t#define v1 0.276\\n\\t#define m1 - 1.0\\n\\t#define r4 0.4\\n\\t#define v4 0.046\\n\\t#define m4 2.0\\n\\t#define r5 0.305\\n\\t#define v5 0.016\\n\\t#define m5 3.0\\n\\t#define r6 0.21\\n\\t#define v6 0.0038\\n\\t#define m6 4.0\\n\\tfloat roughnessToMip( float roughness ) {\\n\\t\\tfloat mip = 0.0;\\n\\t\\tif ( roughness >= r1 ) {\\n\\t\\t\\tmip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0;\\n\\t\\t} else if ( roughness >= r4 ) {\\n\\t\\t\\tmip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1;\\n\\t\\t} else if ( roughness >= r5 ) {\\n\\t\\t\\tmip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4;\\n\\t\\t} else if ( roughness >= r6 ) {\\n\\t\\t\\tmip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5;\\n\\t\\t} else {\\n\\t\\t\\tmip = - 2.0 * log2( 1.16 * roughness );\\t\\t}\\n\\t\\treturn mip;\\n\\t}\\n\\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\\n\\t\\tfloat mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel );\\n\\t\\tfloat mipF = fract( mip );\\n\\t\\tfloat mipInt = floor( mip );\\n\\t\\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\\n\\t\\tif ( mipF == 0.0 ) {\\n\\t\\t\\treturn vec4( color0, 1.0 );\\n\\t\\t} else {\\n\\t\\t\\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\\n\\t\\t\\treturn vec4( mix( color0, color1, mipF ), 1.0 );\\n\\t\\t}\\n\\t}\\n#endif\";\n\n\tvar defaultnormal_vertex = \"vec3 transformedNormal = objectNormal;\\n#ifdef USE_INSTANCING\\n\\tmat3 m = mat3( instanceMatrix );\\n\\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\\n\\ttransformedNormal = m * transformedNormal;\\n#endif\\ntransformedNormal = normalMatrix * transformedNormal;\\n#ifdef FLIP_SIDED\\n\\ttransformedNormal = - transformedNormal;\\n#endif\\n#ifdef USE_TANGENT\\n\\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\\n\\t#ifdef FLIP_SIDED\\n\\t\\ttransformedTangent = - transformedTangent;\\n\\t#endif\\n#endif\";\n\n\tvar displacementmap_pars_vertex = \"#ifdef USE_DISPLACEMENTMAP\\n\\tuniform sampler2D displacementMap;\\n\\tuniform float displacementScale;\\n\\tuniform float displacementBias;\\n#endif\";\n\n\tvar displacementmap_vertex = \"#ifdef USE_DISPLACEMENTMAP\\n\\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\\n#endif\";\n\n\tvar emissivemap_fragment = \"#ifdef USE_EMISSIVEMAP\\n\\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\\n\\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\\n\\ttotalEmissiveRadiance *= emissiveColor.rgb;\\n#endif\";\n\n\tvar emissivemap_pars_fragment = \"#ifdef USE_EMISSIVEMAP\\n\\tuniform sampler2D emissiveMap;\\n#endif\";\n\n\tvar encodings_fragment = \"gl_FragColor = linearToOutputTexel( gl_FragColor );\";\n\n\tvar encodings_pars_fragment = \"\\nvec4 LinearToLinear( in vec4 value ) {\\n\\treturn value;\\n}\\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\\n\\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\\n}\\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\\n\\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\\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}\\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}\\nvec4 RGBEToLinear( in vec4 value ) {\\n\\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\\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}\\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\\n\\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\\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}\\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\\n\\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\\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\\tD = clamp( floor( D ) / 255.0, 0.0, 1.0 );\\n\\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\\n}\\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}\\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\n\tvar envmap_fragment = \"#ifdef USE_ENVMAP\\n\\t#ifdef ENV_WORLDPOS\\n\\t\\tvec3 cameraToFrag;\\n\\t\\tif ( isOrthographic ) {\\n\\t\\t\\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\\n\\t\\t} else {\\n\\t\\t\\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\\n\\t\\t}\\n\\t\\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\\n\\t\\t#ifdef ENVMAP_MODE_REFLECTION\\n\\t\\t\\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\\n\\t\\t#else\\n\\t\\t\\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\\n\\t\\t#endif\\n\\t#else\\n\\t\\tvec3 reflectVec = vReflect;\\n\\t#endif\\n\\t#ifdef ENVMAP_TYPE_CUBE\\n\\t\\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\\n\\t\\tenvColor = envMapTexelToLinear( envColor );\\n\\t#elif defined( ENVMAP_TYPE_CUBE_UV )\\n\\t\\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\\n\\t#else\\n\\t\\tvec4 envColor = vec4( 0.0 );\\n\\t#endif\\n\\t#ifdef ENVMAP_BLENDING_MULTIPLY\\n\\t\\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\\n\\t#elif defined( ENVMAP_BLENDING_MIX )\\n\\t\\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\\n\\t#elif defined( ENVMAP_BLENDING_ADD )\\n\\t\\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\\n\\t#endif\\n#endif\";\n\n\tvar envmap_common_pars_fragment = \"#ifdef USE_ENVMAP\\n\\tuniform float envMapIntensity;\\n\\tuniform float flipEnvMap;\\n\\tuniform int maxMipLevel;\\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\n\tvar envmap_pars_fragment = \"#ifdef USE_ENVMAP\\n\\tuniform float reflectivity;\\n\\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\\n\\t\\t#define ENV_WORLDPOS\\n\\t#endif\\n\\t#ifdef ENV_WORLDPOS\\n\\t\\tvarying vec3 vWorldPosition;\\n\\t\\tuniform float refractionRatio;\\n\\t#else\\n\\t\\tvarying vec3 vReflect;\\n\\t#endif\\n#endif\";\n\n\tvar envmap_pars_vertex = \"#ifdef USE_ENVMAP\\n\\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\\n\\t\\t#define ENV_WORLDPOS\\n\\t#endif\\n\\t#ifdef ENV_WORLDPOS\\n\\t\\t\\n\\t\\tvarying vec3 vWorldPosition;\\n\\t#else\\n\\t\\tvarying vec3 vReflect;\\n\\t\\tuniform float refractionRatio;\\n\\t#endif\\n#endif\";\n\n\tvar envmap_vertex = \"#ifdef USE_ENVMAP\\n\\t#ifdef ENV_WORLDPOS\\n\\t\\tvWorldPosition = worldPosition.xyz;\\n\\t#else\\n\\t\\tvec3 cameraToVertex;\\n\\t\\tif ( isOrthographic ) {\\n\\t\\t\\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\\n\\t\\t} else {\\n\\t\\t\\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\\n\\t\\t}\\n\\t\\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\\n\\t\\t#ifdef ENVMAP_MODE_REFLECTION\\n\\t\\t\\tvReflect = reflect( cameraToVertex, worldNormal );\\n\\t\\t#else\\n\\t\\t\\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\\n\\t\\t#endif\\n\\t#endif\\n#endif\";\n\n\tvar fog_vertex = \"#ifdef USE_FOG\\n\\tvFogDepth = - mvPosition.z;\\n#endif\";\n\n\tvar fog_pars_vertex = \"#ifdef USE_FOG\\n\\tvarying float vFogDepth;\\n#endif\";\n\n\tvar fog_fragment = \"#ifdef USE_FOG\\n\\t#ifdef FOG_EXP2\\n\\t\\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\\n\\t#else\\n\\t\\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\\n\\t#endif\\n\\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\\n#endif\";\n\n\tvar fog_pars_fragment = \"#ifdef USE_FOG\\n\\tuniform vec3 fogColor;\\n\\tvarying float vFogDepth;\\n\\t#ifdef FOG_EXP2\\n\\t\\tuniform float fogDensity;\\n\\t#else\\n\\t\\tuniform float fogNear;\\n\\t\\tuniform float fogFar;\\n\\t#endif\\n#endif\";\n\n\tvar gradientmap_pars_fragment = \"#ifdef USE_GRADIENTMAP\\n\\tuniform sampler2D gradientMap;\\n#endif\\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\\n\\tfloat dotNL = dot( normal, lightDirection );\\n\\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\\n\\t#ifdef USE_GRADIENTMAP\\n\\t\\treturn texture2D( gradientMap, coord ).rgb;\\n\\t#else\\n\\t\\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\\n\\t#endif\\n}\";\n\n\tvar lightmap_fragment = \"#ifdef USE_LIGHTMAP\\n\\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\\n\\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\\n\\t#ifndef PHYSICALLY_CORRECT_LIGHTS\\n\\t\\tlightMapIrradiance *= PI;\\n\\t#endif\\n\\treflectedLight.indirectDiffuse += lightMapIrradiance;\\n#endif\";\n\n\tvar lightmap_pars_fragment = \"#ifdef USE_LIGHTMAP\\n\\tuniform sampler2D lightMap;\\n\\tuniform float lightMapIntensity;\\n#endif\";\n\n\tvar lights_lambert_vertex = \"vec3 diffuse = vec3( 1.0 );\\nGeometricContext geometry;\\ngeometry.position = mvPosition.xyz;\\ngeometry.normal = normalize( transformedNormal );\\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\\nGeometricContext backGeometry;\\nbackGeometry.position = geometry.position;\\nbackGeometry.normal = -geometry.normal;\\nbackGeometry.viewDir = geometry.viewDir;\\nvLightFront = vec3( 0.0 );\\nvIndirectFront = vec3( 0.0 );\\n#ifdef DOUBLE_SIDED\\n\\tvLightBack = vec3( 0.0 );\\n\\tvIndirectBack = vec3( 0.0 );\\n#endif\\nIncidentLight directLight;\\nfloat dotNL;\\nvec3 directLightColor_Diffuse;\\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry.normal );\\n#ifdef DOUBLE_SIDED\\n\\tvIndirectBack += getAmbientLightIrradiance( ambientLightColor );\\n\\tvIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry.normal );\\n#endif\\n#if NUM_POINT_LIGHTS > 0\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\\n\\t\\tgetPointLightInfo( pointLights[ i ], geometry, directLight );\\n\\t\\tdotNL = dot( geometry.normal, directLight.direction );\\n\\t\\tdirectLightColor_Diffuse = directLight.color;\\n\\t\\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\\n\\t\\t#ifdef DOUBLE_SIDED\\n\\t\\t\\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\\n\\t\\t#endif\\n\\t}\\n\\t#pragma unroll_loop_end\\n#endif\\n#if NUM_SPOT_LIGHTS > 0\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\\n\\t\\tgetSpotLightInfo( spotLights[ i ], geometry, directLight );\\n\\t\\tdotNL = dot( geometry.normal, directLight.direction );\\n\\t\\tdirectLightColor_Diffuse = directLight.color;\\n\\t\\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\\n\\t\\t#ifdef DOUBLE_SIDED\\n\\t\\t\\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\\n\\t\\t#endif\\n\\t}\\n\\t#pragma unroll_loop_end\\n#endif\\n#if NUM_DIR_LIGHTS > 0\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\\n\\t\\tgetDirectionalLightInfo( directionalLights[ i ], geometry, directLight );\\n\\t\\tdotNL = dot( geometry.normal, directLight.direction );\\n\\t\\tdirectLightColor_Diffuse = directLight.color;\\n\\t\\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\\n\\t\\t#ifdef DOUBLE_SIDED\\n\\t\\t\\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\\n\\t\\t#endif\\n\\t}\\n\\t#pragma unroll_loop_end\\n#endif\\n#if NUM_HEMI_LIGHTS > 0\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\\n\\t\\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\\n\\t\\t#ifdef DOUBLE_SIDED\\n\\t\\t\\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry.normal );\\n\\t\\t#endif\\n\\t}\\n\\t#pragma unroll_loop_end\\n#endif\";\n\n\tvar lights_pars_begin = \"uniform bool receiveShadow;\\nuniform vec3 ambientLightColor;\\nuniform vec3 lightProbe[ 9 ];\\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\\n\\tfloat x = normal.x, y = normal.y, z = normal.z;\\n\\tvec3 result = shCoefficients[ 0 ] * 0.886227;\\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\\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\\treturn result;\\n}\\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\\n\\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\\n\\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\\n\\treturn irradiance;\\n}\\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\\n\\tvec3 irradiance = ambientLightColor;\\n\\treturn irradiance;\\n}\\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\\n\\t#if defined ( PHYSICALLY_CORRECT_LIGHTS )\\n\\t\\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\\n\\t\\tif ( cutoffDistance > 0.0 ) {\\n\\t\\t\\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\\n\\t\\t}\\n\\t\\treturn distanceFalloff;\\n\\t#else\\n\\t\\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\\n\\t\\t\\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\\n\\t\\t}\\n\\t\\treturn 1.0;\\n\\t#endif\\n}\\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\\n\\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\\n}\\n#if NUM_DIR_LIGHTS > 0\\n\\tstruct DirectionalLight {\\n\\t\\tvec3 direction;\\n\\t\\tvec3 color;\\n\\t};\\n\\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\\n\\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight light ) {\\n\\t\\tlight.color = directionalLight.color;\\n\\t\\tlight.direction = directionalLight.direction;\\n\\t\\tlight.visible = true;\\n\\t}\\n#endif\\n#if NUM_POINT_LIGHTS > 0\\n\\tstruct PointLight {\\n\\t\\tvec3 position;\\n\\t\\tvec3 color;\\n\\t\\tfloat distance;\\n\\t\\tfloat decay;\\n\\t};\\n\\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\\n\\tvoid getPointLightInfo( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight light ) {\\n\\t\\tvec3 lVector = pointLight.position - geometry.position;\\n\\t\\tlight.direction = normalize( lVector );\\n\\t\\tfloat lightDistance = length( lVector );\\n\\t\\tlight.color = pointLight.color;\\n\\t\\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\\n\\t\\tlight.visible = ( light.color != vec3( 0.0 ) );\\n\\t}\\n#endif\\n#if NUM_SPOT_LIGHTS > 0\\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\\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\\n\\tvoid getSpotLightInfo( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight light ) {\\n\\t\\tvec3 lVector = spotLight.position - geometry.position;\\n\\t\\tlight.direction = normalize( lVector );\\n\\t\\tfloat angleCos = dot( light.direction, spotLight.direction );\\n\\t\\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\\n\\t\\tif ( spotAttenuation > 0.0 ) {\\n\\t\\t\\tfloat lightDistance = length( lVector );\\n\\t\\t\\tlight.color = spotLight.color * spotAttenuation;\\n\\t\\t\\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\\n\\t\\t\\tlight.visible = ( light.color != vec3( 0.0 ) );\\n\\t\\t} else {\\n\\t\\t\\tlight.color = vec3( 0.0 );\\n\\t\\t\\tlight.visible = false;\\n\\t\\t}\\n\\t}\\n#endif\\n#if NUM_RECT_AREA_LIGHTS > 0\\n\\tstruct RectAreaLight {\\n\\t\\tvec3 color;\\n\\t\\tvec3 position;\\n\\t\\tvec3 halfWidth;\\n\\t\\tvec3 halfHeight;\\n\\t};\\n\\tuniform sampler2D ltc_1;\\tuniform sampler2D ltc_2;\\n\\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\\n#endif\\n#if NUM_HEMI_LIGHTS > 0\\n\\tstruct HemisphereLight {\\n\\t\\tvec3 direction;\\n\\t\\tvec3 skyColor;\\n\\t\\tvec3 groundColor;\\n\\t};\\n\\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\\n\\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\\n\\t\\tfloat dotNL = dot( normal, hemiLight.direction );\\n\\t\\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\\n\\t\\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\\n\\t\\treturn irradiance;\\n\\t}\\n#endif\";\n\n\tvar envmap_physical_pars_fragment = \"#if defined( USE_ENVMAP )\\n\\t#ifdef ENVMAP_MODE_REFRACTION\\n\\t\\tuniform float refractionRatio;\\n\\t#endif\\n\\tvec3 getIBLIrradiance( const in vec3 normal ) {\\n\\t\\t#if defined( ENVMAP_TYPE_CUBE_UV )\\n\\t\\t\\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\\n\\t\\t\\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\\n\\t\\t\\treturn PI * envMapColor.rgb * envMapIntensity;\\n\\t\\t#else\\n\\t\\t\\treturn vec3( 0.0 );\\n\\t\\t#endif\\n\\t}\\n\\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\\n\\t\\t#if defined( ENVMAP_TYPE_CUBE_UV )\\n\\t\\t\\tvec3 reflectVec;\\n\\t\\t\\t#ifdef ENVMAP_MODE_REFLECTION\\n\\t\\t\\t\\treflectVec = reflect( - viewDir, normal );\\n\\t\\t\\t\\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\\n\\t\\t\\t#else\\n\\t\\t\\t\\treflectVec = refract( - viewDir, normal, refractionRatio );\\n\\t\\t\\t#endif\\n\\t\\t\\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\\n\\t\\t\\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\\n\\t\\t\\treturn envMapColor.rgb * envMapIntensity;\\n\\t\\t#else\\n\\t\\t\\treturn vec3( 0.0 );\\n\\t\\t#endif\\n\\t}\\n#endif\";\n\n\tvar lights_toon_fragment = \"ToonMaterial material;\\nmaterial.diffuseColor = diffuseColor.rgb;\";\n\n\tvar lights_toon_pars_fragment = \"varying vec3 vViewPosition;\\nstruct ToonMaterial {\\n\\tvec3 diffuseColor;\\n};\\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\\n\\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\\n\\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\\n}\\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\\n\\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\\n}\\n#define RE_Direct\\t\\t\\t\\tRE_Direct_Toon\\n#define RE_IndirectDiffuse\\t\\tRE_IndirectDiffuse_Toon\\n#define Material_LightProbeLOD( material )\\t(0)\";\n\n\tvar lights_phong_fragment = \"BlinnPhongMaterial material;\\nmaterial.diffuseColor = diffuseColor.rgb;\\nmaterial.specularColor = specular;\\nmaterial.specularShininess = shininess;\\nmaterial.specularStrength = specularStrength;\";\n\n\tvar lights_phong_pars_fragment = \"varying vec3 vViewPosition;\\nstruct BlinnPhongMaterial {\\n\\tvec3 diffuseColor;\\n\\tvec3 specularColor;\\n\\tfloat specularShininess;\\n\\tfloat specularStrength;\\n};\\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\\n\\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\\n\\tvec3 irradiance = dotNL * directLight.color;\\n\\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\\n\\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength;\\n}\\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\\n\\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\\n}\\n#define RE_Direct\\t\\t\\t\\tRE_Direct_BlinnPhong\\n#define RE_IndirectDiffuse\\t\\tRE_IndirectDiffuse_BlinnPhong\\n#define Material_LightProbeLOD( material )\\t(0)\";\n\n\tvar lights_physical_fragment = \"PhysicalMaterial material;\\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\\nmaterial.roughness = min( material.roughness, 1.0 );\\n#ifdef IOR\\n\\t#ifdef SPECULAR\\n\\t\\tfloat specularIntensityFactor = specularIntensity;\\n\\t\\tvec3 specularTintFactor = specularTint;\\n\\t\\t#ifdef USE_SPECULARINTENSITYMAP\\n\\t\\t\\tspecularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a;\\n\\t\\t#endif\\n\\t\\t#ifdef USE_SPECULARTINTMAP\\n\\t\\t\\tspecularTintFactor *= specularTintMapTexelToLinear( texture2D( specularTintMap, vUv ) ).rgb;\\n\\t\\t#endif\\n\\t\\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\\n\\t#else\\n\\t\\tfloat specularIntensityFactor = 1.0;\\n\\t\\tvec3 specularTintFactor = vec3( 1.0 );\\n\\t\\tmaterial.specularF90 = 1.0;\\n\\t#endif\\n\\tmaterial.specularColor = mix( min( pow2( ( ior - 1.0 ) / ( ior + 1.0 ) ) * specularTintFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\\n#else\\n\\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\\n\\tmaterial.specularF90 = 1.0;\\n#endif\\n#ifdef USE_CLEARCOAT\\n\\tmaterial.clearcoat = clearcoat;\\n\\tmaterial.clearcoatRoughness = clearcoatRoughness;\\n\\tmaterial.clearcoatF0 = vec3( 0.04 );\\n\\tmaterial.clearcoatF90 = 1.0;\\n\\t#ifdef USE_CLEARCOATMAP\\n\\t\\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\\n\\t#endif\\n\\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\\n\\t\\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\\n\\t#endif\\n\\tmaterial.clearcoat = saturate( material.clearcoat );\\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\\n\\tmaterial.clearcoatRoughness += geometryRoughness;\\n\\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\\n#endif\\n#ifdef USE_SHEEN\\n\\tmaterial.sheenTint = sheenTint;\\n\\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\\n#endif\";\n\n\tvar lights_physical_pars_fragment = \"struct PhysicalMaterial {\\n\\tvec3 diffuseColor;\\n\\tfloat roughness;\\n\\tvec3 specularColor;\\n\\tfloat specularF90;\\n\\t#ifdef USE_CLEARCOAT\\n\\t\\tfloat clearcoat;\\n\\t\\tfloat clearcoatRoughness;\\n\\t\\tvec3 clearcoatF0;\\n\\t\\tfloat clearcoatF90;\\n\\t#endif\\n\\t#ifdef USE_SHEEN\\n\\t\\tvec3 sheenTint;\\n\\t\\tfloat sheenRoughness;\\n\\t#endif\\n};\\nvec3 clearcoatSpecular = vec3( 0.0 );\\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\\n\\tfloat dotNV = saturate( dot( normal, viewDir ) );\\n\\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\\n\\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\\n\\tvec4 r = roughness * c0 + c1;\\n\\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\\n\\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\\n\\treturn fab;\\n}\\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\\n\\tvec2 fab = DFGApprox( normal, viewDir, roughness );\\n\\treturn specularColor * fab.x + specularF90 * fab.y;\\n}\\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\\n\\tvec2 fab = DFGApprox( normal, viewDir, roughness );\\n\\tvec3 FssEss = specularColor * fab.x + specularF90 * fab.y;\\n\\tfloat Ess = fab.x + fab.y;\\n\\tfloat Ems = 1.0 - Ess;\\n\\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\\n\\tsingleScatter += FssEss;\\n\\tmultiScatter += Fms * Ems;\\n}\\n#if NUM_RECT_AREA_LIGHTS > 0\\n\\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\\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.roughness;\\n\\t\\tvec3 rectCoords[ 4 ];\\n\\t\\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\\t\\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\\n\\t\\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\\n\\t\\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\\n\\t\\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\\n\\t\\tvec4 t1 = texture2D( ltc_1, uv );\\n\\t\\tvec4 t2 = texture2D( ltc_2, uv );\\n\\t\\tmat3 mInv = mat3(\\n\\t\\t\\tvec3( t1.x, 0, t1.y ),\\n\\t\\t\\tvec3(\t\t0, 1,\t\t0 ),\\n\\t\\t\\tvec3( t1.z, 0, t1.w )\\n\\t\\t);\\n\\t\\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\\n\\t\\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\\n\\t\\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\\n\\t}\\n#endif\\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\\n\\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\\n\\tvec3 irradiance = dotNL * directLight.color;\\n\\t#ifdef USE_CLEARCOAT\\n\\t\\tfloat dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\\n\\t\\tvec3 ccIrradiance = dotNLcc * directLight.color;\\n\\t\\tclearcoatSpecular += ccIrradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\\n\\t#endif\\n\\t#ifdef USE_SHEEN\\n\\t\\treflectedLight.directSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenTint, material.sheenRoughness );\\n\\t#endif\\n\\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.roughness );\\n\\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\\n}\\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\\n\\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\\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\\t#ifdef USE_CLEARCOAT\\n\\t\\tclearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\\n\\t#endif\\n\\tvec3 singleScattering = vec3( 0.0 );\\n\\tvec3 multiScattering = vec3( 0.0 );\\n\\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\\n\\tcomputeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\\n\\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\\n\\treflectedLight.indirectSpecular += radiance * singleScattering;\\n\\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\\n\\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\\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\\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\\n\\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\\n}\";\n\n\tvar lights_fragment_begin = \"\\nGeometricContext geometry;\\ngeometry.position = - vViewPosition;\\ngeometry.normal = normal;\\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\\n#ifdef USE_CLEARCOAT\\n\\tgeometry.clearcoatNormal = clearcoatNormal;\\n#endif\\nIncidentLight directLight;\\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\\n\\tPointLight pointLight;\\n\\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\\n\\tPointLightShadow pointLightShadow;\\n\\t#endif\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\\n\\t\\tpointLight = pointLights[ i ];\\n\\t\\tgetPointLightInfo( pointLight, geometry, directLight );\\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\\t\\tRE_Direct( directLight, geometry, material, reflectedLight );\\n\\t}\\n\\t#pragma unroll_loop_end\\n#endif\\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\\n\\tSpotLight spotLight;\\n\\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\\n\\tSpotLightShadow spotLightShadow;\\n\\t#endif\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\\n\\t\\tspotLight = spotLights[ i ];\\n\\t\\tgetSpotLightInfo( spotLight, geometry, directLight );\\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\\t\\tRE_Direct( directLight, geometry, material, reflectedLight );\\n\\t}\\n\\t#pragma unroll_loop_end\\n#endif\\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\\n\\tDirectionalLight directionalLight;\\n\\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\\n\\tDirectionalLightShadow directionalLightShadow;\\n\\t#endif\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\\n\\t\\tdirectionalLight = directionalLights[ i ];\\n\\t\\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\\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\\t\\tRE_Direct( directLight, geometry, material, reflectedLight );\\n\\t}\\n\\t#pragma unroll_loop_end\\n#endif\\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\\n\\tRectAreaLight rectAreaLight;\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\\n\\t\\trectAreaLight = rectAreaLights[ i ];\\n\\t\\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\\n\\t}\\n\\t#pragma unroll_loop_end\\n#endif\\n#if defined( RE_IndirectDiffuse )\\n\\tvec3 iblIrradiance = vec3( 0.0 );\\n\\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\\n\\tirradiance += getLightProbeIrradiance( lightProbe, geometry.normal );\\n\\t#if ( NUM_HEMI_LIGHTS > 0 )\\n\\t\\t#pragma unroll_loop_start\\n\\t\\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\\n\\t\\t\\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\\n\\t\\t}\\n\\t\\t#pragma unroll_loop_end\\n\\t#endif\\n#endif\\n#if defined( RE_IndirectSpecular )\\n\\tvec3 radiance = vec3( 0.0 );\\n\\tvec3 clearcoatRadiance = vec3( 0.0 );\\n#endif\";\n\n\tvar lights_fragment_maps = \"#if defined( RE_IndirectDiffuse )\\n\\t#ifdef USE_LIGHTMAP\\n\\t\\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\\n\\t\\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\\n\\t\\t#ifndef PHYSICALLY_CORRECT_LIGHTS\\n\\t\\t\\tlightMapIrradiance *= PI;\\n\\t\\t#endif\\n\\t\\tirradiance += lightMapIrradiance;\\n\\t#endif\\n\\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\\n\\t\\tiblIrradiance += getIBLIrradiance( geometry.normal );\\n\\t#endif\\n#endif\\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\\n\\tradiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );\\n\\t#ifdef USE_CLEARCOAT\\n\\t\\tclearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );\\n\\t#endif\\n#endif\";\n\n\tvar lights_fragment_end = \"#if defined( RE_IndirectDiffuse )\\n\\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\\n#endif\\n#if defined( RE_IndirectSpecular )\\n\\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\\n#endif\";\n\n\tvar logdepthbuf_fragment = \"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\\n\\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\\n#endif\";\n\n\tvar logdepthbuf_pars_fragment = \"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\\n\\tuniform float logDepthBufFC;\\n\\tvarying float vFragDepth;\\n\\tvarying float vIsPerspective;\\n#endif\";\n\n\tvar logdepthbuf_pars_vertex = \"#ifdef USE_LOGDEPTHBUF\\n\\t#ifdef USE_LOGDEPTHBUF_EXT\\n\\t\\tvarying float vFragDepth;\\n\\t\\tvarying float vIsPerspective;\\n\\t#else\\n\\t\\tuniform float logDepthBufFC;\\n\\t#endif\\n#endif\";\n\n\tvar logdepthbuf_vertex = \"#ifdef USE_LOGDEPTHBUF\\n\\t#ifdef USE_LOGDEPTHBUF_EXT\\n\\t\\tvFragDepth = 1.0 + gl_Position.w;\\n\\t\\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\\n\\t#else\\n\\t\\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\\n\\t\\t\\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\\n\\t\\t\\tgl_Position.z *= gl_Position.w;\\n\\t\\t}\\n\\t#endif\\n#endif\";\n\n\tvar map_fragment = \"#ifdef USE_MAP\\n\\tvec4 texelColor = texture2D( map, vUv );\\n\\ttexelColor = mapTexelToLinear( texelColor );\\n\\tdiffuseColor *= texelColor;\\n#endif\";\n\n\tvar map_pars_fragment = \"#ifdef USE_MAP\\n\\tuniform sampler2D map;\\n#endif\";\n\n\tvar map_particle_fragment = \"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\\n\\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\\n#endif\\n#ifdef USE_MAP\\n\\tvec4 mapTexel = texture2D( map, uv );\\n\\tdiffuseColor *= mapTexelToLinear( mapTexel );\\n#endif\\n#ifdef USE_ALPHAMAP\\n\\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\\n#endif\";\n\n\tvar map_particle_pars_fragment = \"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\\n\\tuniform mat3 uvTransform;\\n#endif\\n#ifdef USE_MAP\\n\\tuniform sampler2D map;\\n#endif\\n#ifdef USE_ALPHAMAP\\n\\tuniform sampler2D alphaMap;\\n#endif\";\n\n\tvar metalnessmap_fragment = \"float metalnessFactor = metalness;\\n#ifdef USE_METALNESSMAP\\n\\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\\n\\tmetalnessFactor *= texelMetalness.b;\\n#endif\";\n\n\tvar metalnessmap_pars_fragment = \"#ifdef USE_METALNESSMAP\\n\\tuniform sampler2D metalnessMap;\\n#endif\";\n\n\tvar morphnormal_vertex = \"#ifdef USE_MORPHNORMALS\\n\\tobjectNormal *= morphTargetBaseInfluence;\\n\\t#ifdef MORPHTARGETS_TEXTURE\\n\\t\\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\\n\\t\\t\\tif ( morphTargetInfluences[ i ] > 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1, 2 ) * morphTargetInfluences[ i ];\\n\\t\\t}\\n\\t#else\\n\\t\\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\\n\\t\\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\\n\\t\\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\\n\\t\\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\\n\\t#endif\\n#endif\";\n\n\tvar morphtarget_pars_vertex = \"#ifdef USE_MORPHTARGETS\\n\\tuniform float morphTargetBaseInfluence;\\n\\t#ifdef MORPHTARGETS_TEXTURE\\n\\t\\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\\n\\t\\tuniform sampler2DArray morphTargetsTexture;\\n\\t\\tuniform vec2 morphTargetsTextureSize;\\n\\t\\tvec3 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset, const in int stride ) {\\n\\t\\t\\tfloat texelIndex = float( vertexIndex * stride + offset );\\n\\t\\t\\tfloat y = floor( texelIndex / morphTargetsTextureSize.x );\\n\\t\\t\\tfloat x = texelIndex - y * morphTargetsTextureSize.x;\\n\\t\\t\\tvec3 morphUV = vec3( ( x + 0.5 ) / morphTargetsTextureSize.x, y / morphTargetsTextureSize.y, morphTargetIndex );\\n\\t\\t\\treturn texture( morphTargetsTexture, morphUV ).xyz;\\n\\t\\t}\\n\\t#else\\n\\t\\t#ifndef USE_MORPHNORMALS\\n\\t\\t\\tuniform float morphTargetInfluences[ 8 ];\\n\\t\\t#else\\n\\t\\t\\tuniform float morphTargetInfluences[ 4 ];\\n\\t\\t#endif\\n\\t#endif\\n#endif\";\n\n\tvar morphtarget_vertex = \"#ifdef USE_MORPHTARGETS\\n\\ttransformed *= morphTargetBaseInfluence;\\n\\t#ifdef MORPHTARGETS_TEXTURE\\n\\t\\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\\n\\t\\t\\t#ifndef USE_MORPHNORMALS\\n\\t\\t\\t\\tif ( morphTargetInfluences[ i ] > 0.0 ) transformed += getMorph( gl_VertexID, i, 0, 1 ) * morphTargetInfluences[ i ];\\n\\t\\t\\t#else\\n\\t\\t\\t\\tif ( morphTargetInfluences[ i ] > 0.0 ) transformed += getMorph( gl_VertexID, i, 0, 2 ) * morphTargetInfluences[ i ];\\n\\t\\t\\t#endif\\n\\t\\t}\\n\\t#else\\n\\t\\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\\n\\t\\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\\n\\t\\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\\n\\t\\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\\n\\t\\t#ifndef USE_MORPHNORMALS\\n\\t\\t\\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\\n\\t\\t\\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\\n\\t\\t\\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\\n\\t\\t\\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\\n\\t\\t#endif\\n\\t#endif\\n#endif\";\n\n\tvar normal_fragment_begin = \"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\\n#ifdef FLAT_SHADED\\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#else\\n\\tvec3 normal = normalize( vNormal );\\n\\t#ifdef DOUBLE_SIDED\\n\\t\\tnormal = normal * faceDirection;\\n\\t#endif\\n\\t#ifdef USE_TANGENT\\n\\t\\tvec3 tangent = normalize( vTangent );\\n\\t\\tvec3 bitangent = normalize( vBitangent );\\n\\t\\t#ifdef DOUBLE_SIDED\\n\\t\\t\\ttangent = tangent * faceDirection;\\n\\t\\t\\tbitangent = bitangent * faceDirection;\\n\\t\\t#endif\\n\\t\\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\\n\\t\\t\\tmat3 vTBN = mat3( tangent, bitangent, normal );\\n\\t\\t#endif\\n\\t#endif\\n#endif\\nvec3 geometryNormal = normal;\";\n\n\tvar normal_fragment_maps = \"#ifdef OBJECTSPACE_NORMALMAP\\n\\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\\n\\t#ifdef FLIP_SIDED\\n\\t\\tnormal = - normal;\\n\\t#endif\\n\\t#ifdef DOUBLE_SIDED\\n\\t\\tnormal = normal * faceDirection;\\n\\t#endif\\n\\tnormal = normalize( normalMatrix * normal );\\n#elif defined( TANGENTSPACE_NORMALMAP )\\n\\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\\n\\tmapN.xy *= normalScale;\\n\\t#ifdef USE_TANGENT\\n\\t\\tnormal = normalize( vTBN * mapN );\\n\\t#else\\n\\t\\tnormal = perturbNormal2Arb( - vViewPosition, normal, mapN, faceDirection );\\n\\t#endif\\n#elif defined( USE_BUMPMAP )\\n\\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\\n#endif\";\n\n\tvar normal_pars_fragment = \"#ifndef FLAT_SHADED\\n\\tvarying vec3 vNormal;\\n\\t#ifdef USE_TANGENT\\n\\t\\tvarying vec3 vTangent;\\n\\t\\tvarying vec3 vBitangent;\\n\\t#endif\\n#endif\";\n\n\tvar normal_pars_vertex = \"#ifndef FLAT_SHADED\\n\\tvarying vec3 vNormal;\\n\\t#ifdef USE_TANGENT\\n\\t\\tvarying vec3 vTangent;\\n\\t\\tvarying vec3 vBitangent;\\n\\t#endif\\n#endif\";\n\n\tvar normal_vertex = \"#ifndef FLAT_SHADED\\n\\tvNormal = normalize( transformedNormal );\\n\\t#ifdef USE_TANGENT\\n\\t\\tvTangent = normalize( transformedTangent );\\n\\t\\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\\n\\t#endif\\n#endif\";\n\n\tvar normalmap_pars_fragment = \"#ifdef USE_NORMALMAP\\n\\tuniform sampler2D normalMap;\\n\\tuniform vec2 normalScale;\\n#endif\\n#ifdef OBJECTSPACE_NORMALMAP\\n\\tuniform mat3 normalMatrix;\\n#endif\\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\\n\\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) {\\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\\t\\tvec3 N = surf_norm;\\n\\t\\tvec3 q1perp = cross( q1, N );\\n\\t\\tvec3 q0perp = cross( N, q0 );\\n\\t\\tvec3 T = q1perp * st0.x + q0perp * st1.x;\\n\\t\\tvec3 B = q1perp * st0.y + q0perp * st1.y;\\n\\t\\tfloat det = max( dot( T, T ), dot( B, B ) );\\n\\t\\tfloat scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det );\\n\\t\\treturn normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z );\\n\\t}\\n#endif\";\n\n\tvar clearcoat_normal_fragment_begin = \"#ifdef USE_CLEARCOAT\\n\\tvec3 clearcoatNormal = geometryNormal;\\n#endif\";\n\n\tvar clearcoat_normal_fragment_maps = \"#ifdef USE_CLEARCOAT_NORMALMAP\\n\\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\\n\\tclearcoatMapN.xy *= clearcoatNormalScale;\\n\\t#ifdef USE_TANGENT\\n\\t\\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\\n\\t#else\\n\\t\\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection );\\n\\t#endif\\n#endif\";\n\n\tvar clearcoat_pars_fragment = \"#ifdef USE_CLEARCOATMAP\\n\\tuniform sampler2D clearcoatMap;\\n#endif\\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\\n\\tuniform sampler2D clearcoatRoughnessMap;\\n#endif\\n#ifdef USE_CLEARCOAT_NORMALMAP\\n\\tuniform sampler2D clearcoatNormalMap;\\n\\tuniform vec2 clearcoatNormalScale;\\n#endif\";\n\n\tvar output_fragment = \"#ifdef OPAQUE\\ndiffuseColor.a = 1.0;\\n#endif\\n#ifdef USE_TRANSMISSION\\ndiffuseColor.a *= transmissionAlpha + 0.1;\\n#endif\\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );\";\n\n\tvar packing = \"vec3 packNormalToRGB( const in vec3 normal ) {\\n\\treturn normalize( normal ) * 0.5 + 0.5;\\n}\\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\\n\\treturn 2.0 * rgb.xyz - 1.0;\\n}\\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\\nconst float ShiftRight8 = 1. / 256.;\\nvec4 packDepthToRGBA( const in float v ) {\\n\\tvec4 r = vec4( fract( v * PackFactors ), v );\\n\\tr.yzw -= r.xyz * ShiftRight8;\\treturn r * PackUpscale;\\n}\\nfloat unpackRGBAToDepth( const in vec4 v ) {\\n\\treturn dot( v, UnpackFactors );\\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}\\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}\\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\n\tvar premultiplied_alpha_fragment = \"#ifdef PREMULTIPLIED_ALPHA\\n\\tgl_FragColor.rgb *= gl_FragColor.a;\\n#endif\";\n\n\tvar project_vertex = \"vec4 mvPosition = vec4( transformed, 1.0 );\\n#ifdef USE_INSTANCING\\n\\tmvPosition = instanceMatrix * mvPosition;\\n#endif\\nmvPosition = modelViewMatrix * mvPosition;\\ngl_Position = projectionMatrix * mvPosition;\";\n\n\tvar dithering_fragment = \"#ifdef DITHERING\\n\\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\\n#endif\";\n\n\tvar dithering_pars_fragment = \"#ifdef DITHERING\\n\\tvec3 dithering( vec3 color ) {\\n\\t\\tfloat grid_position = rand( gl_FragCoord.xy );\\n\\t\\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\\n\\t\\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\\n\\t\\treturn color + dither_shift_RGB;\\n\\t}\\n#endif\";\n\n\tvar roughnessmap_fragment = \"float roughnessFactor = roughness;\\n#ifdef USE_ROUGHNESSMAP\\n\\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\\n\\troughnessFactor *= texelRoughness.g;\\n#endif\";\n\n\tvar roughnessmap_pars_fragment = \"#ifdef USE_ROUGHNESSMAP\\n\\tuniform sampler2D roughnessMap;\\n#endif\";\n\n\tvar shadowmap_pars_fragment = \"#ifdef USE_SHADOWMAP\\n\\t#if NUM_DIR_LIGHT_SHADOWS > 0\\n\\t\\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\\n\\t\\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\\n\\t\\tstruct DirectionalLightShadow {\\n\\t\\t\\tfloat shadowBias;\\n\\t\\t\\tfloat shadowNormalBias;\\n\\t\\t\\tfloat shadowRadius;\\n\\t\\t\\tvec2 shadowMapSize;\\n\\t\\t};\\n\\t\\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\\n\\t#endif\\n\\t#if NUM_SPOT_LIGHT_SHADOWS > 0\\n\\t\\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\\n\\t\\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\\n\\t\\tstruct SpotLightShadow {\\n\\t\\t\\tfloat shadowBias;\\n\\t\\t\\tfloat shadowNormalBias;\\n\\t\\t\\tfloat shadowRadius;\\n\\t\\t\\tvec2 shadowMapSize;\\n\\t\\t};\\n\\t\\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\\n\\t#endif\\n\\t#if NUM_POINT_LIGHT_SHADOWS > 0\\n\\t\\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\\n\\t\\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\\n\\t\\tstruct PointLightShadow {\\n\\t\\t\\tfloat shadowBias;\\n\\t\\t\\tfloat shadowNormalBias;\\n\\t\\t\\tfloat shadowRadius;\\n\\t\\t\\tvec2 shadowMapSize;\\n\\t\\t\\tfloat shadowCameraNear;\\n\\t\\t\\tfloat shadowCameraFar;\\n\\t\\t};\\n\\t\\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\\n\\t#endif\\n\\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\\n\\t\\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\\n\\t}\\n\\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\\n\\t\\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\\n\\t}\\n\\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\\n\\t\\tfloat occlusion = 1.0;\\n\\t\\tvec2 distribution = texture2DDistribution( shadow, uv );\\n\\t\\tfloat hard_shadow = step( compare , distribution.x );\\n\\t\\tif (hard_shadow != 1.0 ) {\\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 );\\t\\t\\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\\t\\t\\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\\n\\t\\t}\\n\\t\\treturn occlusion;\\n\\t}\\n\\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\\n\\t\\tfloat shadow = 1.0;\\n\\t\\tshadowCoord.xyz /= shadowCoord.w;\\n\\t\\tshadowCoord.z += shadowBias;\\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\\t\\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\\n\\t\\tbool frustumTest = all( frustumTestVec );\\n\\t\\tif ( frustumTest ) {\\n\\t\\t#if defined( SHADOWMAP_TYPE_PCF )\\n\\t\\t\\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\\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\\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\\t\\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\\n\\t\\t\\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\\n\\t\\t\\tfloat dx = texelSize.x;\\n\\t\\t\\tfloat dy = texelSize.y;\\n\\t\\t\\tvec2 uv = shadowCoord.xy;\\n\\t\\t\\tvec2 f = fract( uv * shadowMapSize + 0.5 );\\n\\t\\t\\tuv -= f * texelSize;\\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\ttexture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\\n\\t\\t\\t\\t\\t\\t\tf.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\ttexture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\\n\\t\\t\\t\\t\\t\\t\tf.x ),\\n\\t\\t\\t\\t\\t f.y )\\n\\t\\t\\t) * ( 1.0 / 9.0 );\\n\\t\\t#elif defined( SHADOWMAP_TYPE_VSM )\\n\\t\\t\\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\\n\\t\\t#else\\n\\t\\t\\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\\n\\t\\t#endif\\n\\t\\t}\\n\\t\\treturn shadow;\\n\\t}\\n\\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\\n\\t\\tvec3 absV = abs( v );\\n\\t\\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\\n\\t\\tabsV *= scaleToCube;\\n\\t\\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\\n\\t\\tvec2 planar = v.xy;\\n\\t\\tfloat almostATexel = 1.5 * texelSizeY;\\n\\t\\tfloat almostOne = 1.0 - almostATexel;\\n\\t\\tif ( absV.z >= almostOne ) {\\n\\t\\t\\tif ( v.z > 0.0 )\\n\\t\\t\\t\\tplanar.x = 4.0 - v.x;\\n\\t\\t} else if ( absV.x >= almostOne ) {\\n\\t\\t\\tfloat signX = sign( v.x );\\n\\t\\t\\tplanar.x = v.z * signX + 2.0 * signX;\\n\\t\\t} else if ( absV.y >= almostOne ) {\\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\\t\\t}\\n\\t\\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\\n\\t}\\n\\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\\n\\t\\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\\n\\t\\tvec3 lightToPosition = shadowCoord.xyz;\\n\\t\\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\\t\\tdp += shadowBias;\\n\\t\\tvec3 bd3D = normalize( lightToPosition );\\n\\t\\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\\n\\t\\t\\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\\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\\t\\t#else\\n\\t\\t\\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\\n\\t\\t#endif\\n\\t}\\n#endif\";\n\n\tvar shadowmap_pars_vertex = \"#ifdef USE_SHADOWMAP\\n\\t#if NUM_DIR_LIGHT_SHADOWS > 0\\n\\t\\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\\n\\t\\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\\n\\t\\tstruct DirectionalLightShadow {\\n\\t\\t\\tfloat shadowBias;\\n\\t\\t\\tfloat shadowNormalBias;\\n\\t\\t\\tfloat shadowRadius;\\n\\t\\t\\tvec2 shadowMapSize;\\n\\t\\t};\\n\\t\\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\\n\\t#endif\\n\\t#if NUM_SPOT_LIGHT_SHADOWS > 0\\n\\t\\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\\n\\t\\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\\n\\t\\tstruct SpotLightShadow {\\n\\t\\t\\tfloat shadowBias;\\n\\t\\t\\tfloat shadowNormalBias;\\n\\t\\t\\tfloat shadowRadius;\\n\\t\\t\\tvec2 shadowMapSize;\\n\\t\\t};\\n\\t\\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\\n\\t#endif\\n\\t#if NUM_POINT_LIGHT_SHADOWS > 0\\n\\t\\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\\n\\t\\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\\n\\t\\tstruct PointLightShadow {\\n\\t\\t\\tfloat shadowBias;\\n\\t\\t\\tfloat shadowNormalBias;\\n\\t\\t\\tfloat shadowRadius;\\n\\t\\t\\tvec2 shadowMapSize;\\n\\t\\t\\tfloat shadowCameraNear;\\n\\t\\t\\tfloat shadowCameraFar;\\n\\t\\t};\\n\\t\\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\\n\\t#endif\\n#endif\";\n\n\tvar shadowmap_vertex = \"#ifdef USE_SHADOWMAP\\n\\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\\n\\t\\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\\n\\t\\tvec4 shadowWorldPosition;\\n\\t#endif\\n\\t#if NUM_DIR_LIGHT_SHADOWS > 0\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\\n\\t\\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\\n\\t\\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\\n\\t}\\n\\t#pragma unroll_loop_end\\n\\t#endif\\n\\t#if NUM_SPOT_LIGHT_SHADOWS > 0\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\\n\\t\\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );\\n\\t\\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition;\\n\\t}\\n\\t#pragma unroll_loop_end\\n\\t#endif\\n\\t#if NUM_POINT_LIGHT_SHADOWS > 0\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\\n\\t\\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\\n\\t\\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\\n\\t}\\n\\t#pragma unroll_loop_end\\n\\t#endif\\n#endif\";\n\n\tvar shadowmask_pars_fragment = \"float getShadowMask() {\\n\\tfloat shadow = 1.0;\\n\\t#ifdef USE_SHADOWMAP\\n\\t#if NUM_DIR_LIGHT_SHADOWS > 0\\n\\tDirectionalLightShadow directionalLight;\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\\n\\t\\tdirectionalLight = directionalLightShadows[ i ];\\n\\t\\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\\n\\t}\\n\\t#pragma unroll_loop_end\\n\\t#endif\\n\\t#if NUM_SPOT_LIGHT_SHADOWS > 0\\n\\tSpotLightShadow spotLight;\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\\n\\t\\tspotLight = spotLightShadows[ i ];\\n\\t\\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\\n\\t}\\n\\t#pragma unroll_loop_end\\n\\t#endif\\n\\t#if NUM_POINT_LIGHT_SHADOWS > 0\\n\\tPointLightShadow pointLight;\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\\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\\t}\\n\\t#pragma unroll_loop_end\\n\\t#endif\\n\\t#endif\\n\\treturn shadow;\\n}\";\n\n\tvar skinbase_vertex = \"#ifdef USE_SKINNING\\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#endif\";\n\n\tvar skinning_pars_vertex = \"#ifdef USE_SKINNING\\n\\tuniform mat4 bindMatrix;\\n\\tuniform mat4 bindMatrixInverse;\\n\\t#ifdef BONE_TEXTURE\\n\\t\\tuniform highp sampler2D boneTexture;\\n\\t\\tuniform int boneTextureSize;\\n\\t\\tmat4 getBoneMatrix( const in float i ) {\\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\\t\\t\\tfloat dx = 1.0 / float( boneTextureSize );\\n\\t\\t\\tfloat dy = 1.0 / float( boneTextureSize );\\n\\t\\t\\ty = dy * ( y + 0.5 );\\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\\t\\t\\tmat4 bone = mat4( v1, v2, v3, v4 );\\n\\t\\t\\treturn bone;\\n\\t\\t}\\n\\t#else\\n\\t\\tuniform mat4 boneMatrices[ MAX_BONES ];\\n\\t\\tmat4 getBoneMatrix( const in float i ) {\\n\\t\\t\\tmat4 bone = boneMatrices[ int(i) ];\\n\\t\\t\\treturn bone;\\n\\t\\t}\\n\\t#endif\\n#endif\";\n\n\tvar skinning_vertex = \"#ifdef USE_SKINNING\\n\\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\\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\\ttransformed = ( bindMatrixInverse * skinned ).xyz;\\n#endif\";\n\n\tvar skinnormal_vertex = \"#ifdef USE_SKINNING\\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\\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\\n\\t#ifdef USE_TANGENT\\n\\t\\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\\n\\t#endif\\n#endif\";\n\n\tvar specularmap_fragment = \"float specularStrength;\\n#ifdef USE_SPECULARMAP\\n\\tvec4 texelSpecular = texture2D( specularMap, vUv );\\n\\tspecularStrength = texelSpecular.r;\\n#else\\n\\tspecularStrength = 1.0;\\n#endif\";\n\n\tvar specularmap_pars_fragment = \"#ifdef USE_SPECULARMAP\\n\\tuniform sampler2D specularMap;\\n#endif\";\n\n\tvar tonemapping_fragment = \"#if defined( TONE_MAPPING )\\n\\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\\n#endif\";\n\n\tvar tonemapping_pars_fragment = \"#ifndef saturate\\n#define saturate( a ) clamp( a, 0.0, 1.0 )\\n#endif\\nuniform float toneMappingExposure;\\nvec3 LinearToneMapping( vec3 color ) {\\n\\treturn toneMappingExposure * color;\\n}\\nvec3 ReinhardToneMapping( vec3 color ) {\\n\\tcolor *= toneMappingExposure;\\n\\treturn saturate( color / ( vec3( 1.0 ) + color ) );\\n}\\nvec3 OptimizedCineonToneMapping( vec3 color ) {\\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}\\nvec3 RRTAndODTFit( vec3 v ) {\\n\\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\\n\\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\\n\\treturn a / b;\\n}\\nvec3 ACESFilmicToneMapping( vec3 color ) {\\n\\tconst mat3 ACESInputMat = mat3(\\n\\t\\tvec3( 0.59719, 0.07600, 0.02840 ),\\t\\tvec3( 0.35458, 0.90834, 0.13383 ),\\n\\t\\tvec3( 0.04823, 0.01566, 0.83777 )\\n\\t);\\n\\tconst mat3 ACESOutputMat = mat3(\\n\\t\\tvec3(\t1.60475, -0.10208, -0.00327 ),\\t\\tvec3( -0.53108,\t1.10813, -0.07276 ),\\n\\t\\tvec3( -0.07367, -0.00605,\t1.07602 )\\n\\t);\\n\\tcolor *= toneMappingExposure / 0.6;\\n\\tcolor = ACESInputMat * color;\\n\\tcolor = RRTAndODTFit( color );\\n\\tcolor = ACESOutputMat * color;\\n\\treturn saturate( color );\\n}\\nvec3 CustomToneMapping( vec3 color ) { return color; }\";\n\n\tvar transmission_fragment = \"#ifdef USE_TRANSMISSION\\n\\tfloat transmissionAlpha = 1.0;\\n\\tfloat transmissionFactor = transmission;\\n\\tfloat thicknessFactor = thickness;\\n\\t#ifdef USE_TRANSMISSIONMAP\\n\\t\\ttransmissionFactor *= texture2D( transmissionMap, vUv ).r;\\n\\t#endif\\n\\t#ifdef USE_THICKNESSMAP\\n\\t\\tthicknessFactor *= texture2D( thicknessMap, vUv ).g;\\n\\t#endif\\n\\tvec3 pos = vWorldPosition;\\n\\tvec3 v = normalize( cameraPosition - pos );\\n\\tvec3 n = inverseTransformDirection( normal, viewMatrix );\\n\\tvec4 transmission = getIBLVolumeRefraction(\\n\\t\\tn, v, roughnessFactor, material.diffuseColor, material.specularColor, material.specularF90,\\n\\t\\tpos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor,\\n\\t\\tattenuationTint, attenuationDistance );\\n\\ttotalDiffuse = mix( totalDiffuse, transmission.rgb, transmissionFactor );\\n\\ttransmissionAlpha = mix( transmissionAlpha, transmission.a, transmissionFactor );\\n#endif\";\n\n\tvar transmission_pars_fragment = \"#ifdef USE_TRANSMISSION\\n\\tuniform float transmission;\\n\\tuniform float thickness;\\n\\tuniform float attenuationDistance;\\n\\tuniform vec3 attenuationTint;\\n\\t#ifdef USE_TRANSMISSIONMAP\\n\\t\\tuniform sampler2D transmissionMap;\\n\\t#endif\\n\\t#ifdef USE_THICKNESSMAP\\n\\t\\tuniform sampler2D thicknessMap;\\n\\t#endif\\n\\tuniform vec2 transmissionSamplerSize;\\n\\tuniform sampler2D transmissionSamplerMap;\\n\\tuniform mat4 modelMatrix;\\n\\tuniform mat4 projectionMatrix;\\n\\tvarying vec3 vWorldPosition;\\n\\tvec3 getVolumeTransmissionRay( vec3 n, vec3 v, float thickness, float ior, mat4 modelMatrix ) {\\n\\t\\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\\n\\t\\tvec3 modelScale;\\n\\t\\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\\n\\t\\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\\n\\t\\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\\n\\t\\treturn normalize( refractionVector ) * thickness * modelScale;\\n\\t}\\n\\tfloat applyIorToRoughness( float roughness, float ior ) {\\n\\t\\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\\n\\t}\\n\\tvec4 getTransmissionSample( vec2 fragCoord, float roughness, float ior ) {\\n\\t\\tfloat framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\\n\\t\\t#ifdef TEXTURE_LOD_EXT\\n\\t\\t\\treturn texture2DLodEXT( transmissionSamplerMap, fragCoord.xy, framebufferLod );\\n\\t\\t#else\\n\\t\\t\\treturn texture2D( transmissionSamplerMap, fragCoord.xy, framebufferLod );\\n\\t\\t#endif\\n\\t}\\n\\tvec3 applyVolumeAttenuation( vec3 radiance, float transmissionDistance, vec3 attenuationColor, float attenuationDistance ) {\\n\\t\\tif ( attenuationDistance == 0.0 ) {\\n\\t\\t\\treturn radiance;\\n\\t\\t} else {\\n\\t\\t\\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\\n\\t\\t\\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\\t\\t\\treturn transmittance * radiance;\\n\\t\\t}\\n\\t}\\n\\tvec4 getIBLVolumeRefraction( vec3 n, vec3 v, float roughness, vec3 diffuseColor, vec3 specularColor, float specularF90,\\n\\t\\tvec3 position, mat4 modelMatrix, mat4 viewMatrix, mat4 projMatrix, float ior, float thickness,\\n\\t\\tvec3 attenuationColor, float attenuationDistance ) {\\n\\t\\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\\n\\t\\tvec3 refractedRayExit = position + transmissionRay;\\n\\t\\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\\n\\t\\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\\n\\t\\trefractionCoords += 1.0;\\n\\t\\trefractionCoords /= 2.0;\\n\\t\\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\\n\\t\\tvec3 attenuatedColor = applyVolumeAttenuation( transmittedLight.rgb, length( transmissionRay ), attenuationColor, attenuationDistance );\\n\\t\\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\\n\\t\\treturn vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a );\\n\\t}\\n#endif\";\n\n\tvar uv_pars_fragment = \"#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\\n\\tvarying vec2 vUv;\\n#endif\";\n\n\tvar uv_pars_vertex = \"#ifdef USE_UV\\n\\t#ifdef UVS_VERTEX_ONLY\\n\\t\\tvec2 vUv;\\n\\t#else\\n\\t\\tvarying vec2 vUv;\\n\\t#endif\\n\\tuniform mat3 uvTransform;\\n#endif\";\n\n\tvar uv_vertex = \"#ifdef USE_UV\\n\\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\\n#endif\";\n\n\tvar uv2_pars_fragment = \"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\\n\\tvarying vec2 vUv2;\\n#endif\";\n\n\tvar uv2_pars_vertex = \"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\\n\\tattribute vec2 uv2;\\n\\tvarying vec2 vUv2;\\n\\tuniform mat3 uv2Transform;\\n#endif\";\n\n\tvar uv2_vertex = \"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\\n\\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\\n#endif\";\n\n\tvar worldpos_vertex = \"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION )\\n\\tvec4 worldPosition = vec4( transformed, 1.0 );\\n\\t#ifdef USE_INSTANCING\\n\\t\\tworldPosition = instanceMatrix * worldPosition;\\n\\t#endif\\n\\tworldPosition = modelMatrix * worldPosition;\\n#endif\";\n\n\tconst vertex$g = \"varying vec2 vUv;\\nuniform mat3 uvTransform;\\nvoid main() {\\n\\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\\n\\tgl_Position = vec4( position.xy, 1.0, 1.0 );\\n}\";\n\tconst fragment$g = \"uniform sampler2D t2D;\\nvarying vec2 vUv;\\nvoid main() {\\n\\tvec4 texColor = texture2D( t2D, vUv );\\n\\tgl_FragColor = mapTexelToLinear( texColor );\\n\\t#include <tonemapping_fragment>\\n\\t#include <encodings_fragment>\\n}\";\n\n\tconst vertex$f = \"varying vec3 vWorldDirection;\\n#include <common>\\nvoid main() {\\n\\tvWorldDirection = transformDirection( position, modelMatrix );\\n\\t#include <begin_vertex>\\n\\t#include <project_vertex>\\n\\tgl_Position.z = gl_Position.w;\\n}\";\n\tconst fragment$f = \"#include <envmap_common_pars_fragment>\\nuniform float opacity;\\nvarying vec3 vWorldDirection;\\n#include <cube_uv_reflection_fragment>\\nvoid main() {\\n\\tvec3 vReflect = vWorldDirection;\\n\\t#include <envmap_fragment>\\n\\tgl_FragColor = envColor;\\n\\tgl_FragColor.a *= opacity;\\n\\t#include <tonemapping_fragment>\\n\\t#include <encodings_fragment>\\n}\";\n\n\tconst vertex$e = \"#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>\\nvarying vec2 vHighPrecisionZW;\\nvoid main() {\\n\\t#include <uv_vertex>\\n\\t#include <skinbase_vertex>\\n\\t#ifdef USE_DISPLACEMENTMAP\\n\\t\\t#include <beginnormal_vertex>\\n\\t\\t#include <morphnormal_vertex>\\n\\t\\t#include <skinnormal_vertex>\\n\\t#endif\\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\\tvHighPrecisionZW = gl_Position.zw;\\n}\";\n\tconst fragment$e = \"#if DEPTH_PACKING == 3200\\n\\tuniform float opacity;\\n#endif\\n#include <common>\\n#include <packing>\\n#include <uv_pars_fragment>\\n#include <map_pars_fragment>\\n#include <alphamap_pars_fragment>\\n#include <alphatest_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvarying vec2 vHighPrecisionZW;\\nvoid main() {\\n\\t#include <clipping_planes_fragment>\\n\\tvec4 diffuseColor = vec4( 1.0 );\\n\\t#if DEPTH_PACKING == 3200\\n\\t\\tdiffuseColor.a = opacity;\\n\\t#endif\\n\\t#include <map_fragment>\\n\\t#include <alphamap_fragment>\\n\\t#include <alphatest_fragment>\\n\\t#include <logdepthbuf_fragment>\\n\\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\\n\\t#if DEPTH_PACKING == 3200\\n\\t\\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\\n\\t#elif DEPTH_PACKING == 3201\\n\\t\\tgl_FragColor = packDepthToRGBA( fragCoordZ );\\n\\t#endif\\n}\";\n\n\tconst vertex$d = \"#define DISTANCE\\nvarying vec3 vWorldPosition;\\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>\\nvoid main() {\\n\\t#include <uv_vertex>\\n\\t#include <skinbase_vertex>\\n\\t#ifdef USE_DISPLACEMENTMAP\\n\\t\\t#include <beginnormal_vertex>\\n\\t\\t#include <morphnormal_vertex>\\n\\t\\t#include <skinnormal_vertex>\\n\\t#endif\\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\\tvWorldPosition = worldPosition.xyz;\\n}\";\n\tconst fragment$d = \"#define DISTANCE\\nuniform vec3 referencePosition;\\nuniform float nearDistance;\\nuniform float farDistance;\\nvarying vec3 vWorldPosition;\\n#include <common>\\n#include <packing>\\n#include <uv_pars_fragment>\\n#include <map_pars_fragment>\\n#include <alphamap_pars_fragment>\\n#include <alphatest_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main () {\\n\\t#include <clipping_planes_fragment>\\n\\tvec4 diffuseColor = vec4( 1.0 );\\n\\t#include <map_fragment>\\n\\t#include <alphamap_fragment>\\n\\t#include <alphatest_fragment>\\n\\tfloat dist = length( vWorldPosition - referencePosition );\\n\\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\\n\\tdist = saturate( dist );\\n\\tgl_FragColor = packDepthToRGBA( dist );\\n}\";\n\n\tconst vertex$c = \"varying vec3 vWorldDirection;\\n#include <common>\\nvoid main() {\\n\\tvWorldDirection = transformDirection( position, modelMatrix );\\n\\t#include <begin_vertex>\\n\\t#include <project_vertex>\\n}\";\n\tconst fragment$c = \"uniform sampler2D tEquirect;\\nvarying vec3 vWorldDirection;\\n#include <common>\\nvoid main() {\\n\\tvec3 direction = normalize( vWorldDirection );\\n\\tvec2 sampleUV = equirectUv( direction );\\n\\tvec4 texColor = texture2D( tEquirect, sampleUV );\\n\\tgl_FragColor = mapTexelToLinear( texColor );\\n\\t#include <tonemapping_fragment>\\n\\t#include <encodings_fragment>\\n}\";\n\n\tconst vertex$b = \"uniform float scale;\\nattribute float lineDistance;\\nvarying float vLineDistance;\\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>\\nvoid main() {\\n\\tvLineDistance = scale * lineDistance;\\n\\t#include <color_vertex>\\n\\t#include <begin_vertex>\\n\\t#include <morphtarget_vertex>\\n\\t#include <project_vertex>\\n\\t#include <logdepthbuf_vertex>\\n\\t#include <clipping_planes_vertex>\\n\\t#include <fog_vertex>\\n}\";\n\tconst fragment$b = \"uniform vec3 diffuse;\\nuniform float opacity;\\nuniform float dashSize;\\nuniform float totalSize;\\nvarying float vLineDistance;\\n#include <common>\\n#include <color_pars_fragment>\\n#include <fog_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\\t#include <clipping_planes_fragment>\\n\\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\\n\\t\\tdiscard;\\n\\t}\\n\\tvec3 outgoingLight = vec3( 0.0 );\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\t#include <logdepthbuf_fragment>\\n\\t#include <color_fragment>\\n\\toutgoingLight = diffuseColor.rgb;\\n\\t#include <output_fragment>\\n\\t#include <tonemapping_fragment>\\n\\t#include <encodings_fragment>\\n\\t#include <fog_fragment>\\n\\t#include <premultiplied_alpha_fragment>\\n}\";\n\n\tconst vertex$a = \"#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>\\nvoid main() {\\n\\t#include <uv_vertex>\\n\\t#include <uv2_vertex>\\n\\t#include <color_vertex>\\n\\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\\n\\t\\t#include <beginnormal_vertex>\\n\\t\\t#include <morphnormal_vertex>\\n\\t\\t#include <skinbase_vertex>\\n\\t\\t#include <skinnormal_vertex>\\n\\t\\t#include <defaultnormal_vertex>\\n\\t#endif\\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\\t#include <worldpos_vertex>\\n\\t#include <envmap_vertex>\\n\\t#include <fog_vertex>\\n}\";\n\tconst fragment$a = \"uniform vec3 diffuse;\\nuniform float opacity;\\n#ifndef FLAT_SHADED\\n\\tvarying vec3 vNormal;\\n#endif\\n#include <common>\\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 <alphatest_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>\\nvoid main() {\\n\\t#include <clipping_planes_fragment>\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\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\\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\\n\\t#ifdef USE_LIGHTMAP\\n\\t\\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\\n\\t\\treflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\\n\\t#else\\n\\t\\treflectedLight.indirectDiffuse += vec3( 1.0 );\\n\\t#endif\\n\\t#include <aomap_fragment>\\n\\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\\n\\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\\n\\t#include <envmap_fragment>\\n\\t#include <output_fragment>\\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\tconst vertex$9 = \"#define LAMBERT\\nvarying vec3 vLightFront;\\nvarying vec3 vIndirectFront;\\n#ifdef DOUBLE_SIDED\\n\\tvarying vec3 vLightBack;\\n\\tvarying vec3 vIndirectBack;\\n#endif\\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>\\nvoid main() {\\n\\t#include <uv_vertex>\\n\\t#include <uv2_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\\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\\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\tconst fragment$9 = \"uniform vec3 diffuse;\\nuniform vec3 emissive;\\nuniform float opacity;\\nvarying vec3 vLightFront;\\nvarying vec3 vIndirectFront;\\n#ifdef DOUBLE_SIDED\\n\\tvarying vec3 vLightBack;\\n\\tvarying vec3 vIndirectBack;\\n#endif\\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 <alphatest_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>\\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\\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\\t#ifdef DOUBLE_SIDED\\n\\t\\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\\n\\t#else\\n\\t\\treflectedLight.indirectDiffuse += vIndirectFront;\\n\\t#endif\\n\\t#include <lightmap_fragment>\\n\\treflectedLight.indirectDiffuse *= BRDF_Lambert( diffuseColor.rgb );\\n\\t#ifdef DOUBLE_SIDED\\n\\t\\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\\n\\t#else\\n\\t\\treflectedLight.directDiffuse = vLightFront;\\n\\t#endif\\n\\treflectedLight.directDiffuse *= BRDF_Lambert( diffuseColor.rgb ) * getShadowMask();\\n\\t#include <aomap_fragment>\\n\\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\\n\\t#include <envmap_fragment>\\n\\t#include <output_fragment>\\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\tconst vertex$8 = \"#define MATCAP\\nvarying vec3 vViewPosition;\\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 <normal_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\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\\t#include <normal_vertex>\\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\\t#include <fog_vertex>\\n\\tvViewPosition = - mvPosition.xyz;\\n}\";\n\tconst fragment$8 = \"#define MATCAP\\nuniform vec3 diffuse;\\nuniform float opacity;\\nuniform sampler2D matcap;\\nvarying vec3 vViewPosition;\\n#include <common>\\n#include <dithering_pars_fragment>\\n#include <color_pars_fragment>\\n#include <uv_pars_fragment>\\n#include <map_pars_fragment>\\n#include <alphamap_pars_fragment>\\n#include <alphatest_pars_fragment>\\n#include <fog_pars_fragment>\\n#include <normal_pars_fragment>\\n#include <bumpmap_pars_fragment>\\n#include <normalmap_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\\t#include <clipping_planes_fragment>\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\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\\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;\\n\\t#ifdef USE_MATCAP\\n\\t\\tvec4 matcapColor = texture2D( matcap, uv );\\n\\t\\tmatcapColor = matcapTexelToLinear( matcapColor );\\n\\t#else\\n\\t\\tvec4 matcapColor = vec4( 1.0 );\\n\\t#endif\\n\\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\\n\\t#include <output_fragment>\\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\tconst vertex$7 = \"#define NORMAL\\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\\n\\tvarying vec3 vViewPosition;\\n#endif\\n#include <common>\\n#include <uv_pars_vertex>\\n#include <displacementmap_pars_vertex>\\n#include <normal_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\\t#include <uv_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\\t#include <normal_vertex>\\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#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\\n\\tvViewPosition = - mvPosition.xyz;\\n#endif\\n}\";\n\tconst fragment$7 = \"#define NORMAL\\nuniform float opacity;\\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\\n\\tvarying vec3 vViewPosition;\\n#endif\\n#include <packing>\\n#include <uv_pars_fragment>\\n#include <normal_pars_fragment>\\n#include <bumpmap_pars_fragment>\\n#include <normalmap_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\\t#include <clipping_planes_fragment>\\n\\t#include <logdepthbuf_fragment>\\n\\t#include <normal_fragment_begin>\\n\\t#include <normal_fragment_maps>\\n\\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\\n}\";\n\n\tconst vertex$6 = \"#define PHONG\\nvarying vec3 vViewPosition;\\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 <normal_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>\\nvoid main() {\\n\\t#include <uv_vertex>\\n\\t#include <uv2_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\\t#include <normal_vertex>\\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\\tvViewPosition = - mvPosition.xyz;\\n\\t#include <worldpos_vertex>\\n\\t#include <envmap_vertex>\\n\\t#include <shadowmap_vertex>\\n\\t#include <fog_vertex>\\n}\";\n\tconst fragment$6 = \"#define PHONG\\nuniform vec3 diffuse;\\nuniform vec3 emissive;\\nuniform vec3 specular;\\nuniform float shininess;\\nuniform float opacity;\\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 <alphatest_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 <normal_pars_fragment>\\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>\\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\\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\\t#include <lights_phong_fragment>\\n\\t#include <lights_fragment_begin>\\n\\t#include <lights_fragment_maps>\\n\\t#include <lights_fragment_end>\\n\\t#include <aomap_fragment>\\n\\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\\n\\t#include <envmap_fragment>\\n\\t#include <output_fragment>\\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\tconst vertex$5 = \"#define STANDARD\\nvarying vec3 vViewPosition;\\n#ifdef USE_TRANSMISSION\\n\\tvarying vec3 vWorldPosition;\\n#endif\\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 <normal_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>\\nvoid main() {\\n\\t#include <uv_vertex>\\n\\t#include <uv2_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\\t#include <normal_vertex>\\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\\tvViewPosition = - mvPosition.xyz;\\n\\t#include <worldpos_vertex>\\n\\t#include <shadowmap_vertex>\\n\\t#include <fog_vertex>\\n#ifdef USE_TRANSMISSION\\n\\tvWorldPosition = worldPosition.xyz;\\n#endif\\n}\";\n\tconst fragment$5 = \"#define STANDARD\\n#ifdef PHYSICAL\\n\\t#define IOR\\n\\t#define SPECULAR\\n#endif\\nuniform vec3 diffuse;\\nuniform vec3 emissive;\\nuniform float roughness;\\nuniform float metalness;\\nuniform float opacity;\\n#ifdef IOR\\n\\tuniform float ior;\\n#endif\\n#ifdef SPECULAR\\n\\tuniform float specularIntensity;\\n\\tuniform vec3 specularTint;\\n\\t#ifdef USE_SPECULARINTENSITYMAP\\n\\t\\tuniform sampler2D specularIntensityMap;\\n\\t#endif\\n\\t#ifdef USE_SPECULARTINTMAP\\n\\t\\tuniform sampler2D specularTintMap;\\n\\t#endif\\n#endif\\n#ifdef USE_CLEARCOAT\\n\\tuniform float clearcoat;\\n\\tuniform float clearcoatRoughness;\\n#endif\\n#ifdef USE_SHEEN\\n\\tuniform vec3 sheenTint;\\n\\tuniform float sheenRoughness;\\n#endif\\nvarying vec3 vViewPosition;\\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 <alphatest_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 <normal_pars_fragment>\\n#include <lights_physical_pars_fragment>\\n#include <transmission_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>\\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\\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\\t#include <lights_physical_fragment>\\n\\t#include <lights_fragment_begin>\\n\\t#include <lights_fragment_maps>\\n\\t#include <lights_fragment_end>\\n\\t#include <aomap_fragment>\\n\\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\\n\\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\\n\\t#include <transmission_fragment>\\n\\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\\n\\t#ifdef USE_CLEARCOAT\\n\\t\\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\\n\\t\\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\\n\\t\\toutgoingLight = outgoingLight * ( 1.0 - clearcoat * Fcc ) + clearcoatSpecular * clearcoat;\\n\\t#endif\\n\\t#include <output_fragment>\\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\tconst vertex$4 = \"#define TOON\\nvarying vec3 vViewPosition;\\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 <normal_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>\\nvoid main() {\\n\\t#include <uv_vertex>\\n\\t#include <uv2_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\\t#include <normal_vertex>\\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\\tvViewPosition = - mvPosition.xyz;\\n\\t#include <worldpos_vertex>\\n\\t#include <shadowmap_vertex>\\n\\t#include <fog_vertex>\\n}\";\n\tconst fragment$4 = \"#define TOON\\nuniform vec3 diffuse;\\nuniform vec3 emissive;\\nuniform float opacity;\\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 <alphatest_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 <normal_pars_fragment>\\n#include <lights_toon_pars_fragment>\\n#include <shadowmap_pars_fragment>\\n#include <bumpmap_pars_fragment>\\n#include <normalmap_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\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\\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\\t#include <emissivemap_fragment>\\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\\t#include <aomap_fragment>\\n\\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\\n\\t#include <output_fragment>\\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\tconst vertex$3 = \"uniform float size;\\nuniform float scale;\\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>\\nvoid main() {\\n\\t#include <color_vertex>\\n\\t#include <begin_vertex>\\n\\t#include <morphtarget_vertex>\\n\\t#include <project_vertex>\\n\\tgl_PointSize = size;\\n\\t#ifdef USE_SIZEATTENUATION\\n\\t\\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\\n\\t\\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\\n\\t#endif\\n\\t#include <logdepthbuf_vertex>\\n\\t#include <clipping_planes_vertex>\\n\\t#include <worldpos_vertex>\\n\\t#include <fog_vertex>\\n}\";\n\tconst fragment$3 = \"uniform vec3 diffuse;\\nuniform float opacity;\\n#include <common>\\n#include <color_pars_fragment>\\n#include <map_particle_pars_fragment>\\n#include <alphatest_pars_fragment>\\n#include <fog_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\\t#include <clipping_planes_fragment>\\n\\tvec3 outgoingLight = vec3( 0.0 );\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\t#include <logdepthbuf_fragment>\\n\\t#include <map_particle_fragment>\\n\\t#include <color_fragment>\\n\\t#include <alphatest_fragment>\\n\\toutgoingLight = diffuseColor.rgb;\\n\\t#include <output_fragment>\\n\\t#include <tonemapping_fragment>\\n\\t#include <encodings_fragment>\\n\\t#include <fog_fragment>\\n\\t#include <premultiplied_alpha_fragment>\\n}\";\n\n\tconst vertex$2 = \"#include <common>\\n#include <fog_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <shadowmap_pars_vertex>\\nvoid main() {\\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\\t#include <begin_vertex>\\n\\t#include <morphtarget_vertex>\\n\\t#include <skinning_vertex>\\n\\t#include <project_vertex>\\n\\t#include <worldpos_vertex>\\n\\t#include <shadowmap_vertex>\\n\\t#include <fog_vertex>\\n}\";\n\tconst fragment$2 = \"uniform vec3 color;\\nuniform float opacity;\\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>\\nvoid main() {\\n\\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\\n\\t#include <tonemapping_fragment>\\n\\t#include <encodings_fragment>\\n\\t#include <fog_fragment>\\n}\";\n\n\tconst vertex$1 = \"uniform float rotation;\\nuniform vec2 center;\\n#include <common>\\n#include <uv_pars_vertex>\\n#include <fog_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\\t#include <uv_vertex>\\n\\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\\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\\t#ifndef USE_SIZEATTENUATION\\n\\t\\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\\n\\t\\tif ( isPerspective ) scale *= - mvPosition.z;\\n\\t#endif\\n\\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\\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\\tmvPosition.xy += rotatedPosition;\\n\\tgl_Position = projectionMatrix * mvPosition;\\n\\t#include <logdepthbuf_vertex>\\n\\t#include <clipping_planes_vertex>\\n\\t#include <fog_vertex>\\n}\";\n\tconst fragment$1 = \"uniform vec3 diffuse;\\nuniform float opacity;\\n#include <common>\\n#include <uv_pars_fragment>\\n#include <map_pars_fragment>\\n#include <alphamap_pars_fragment>\\n#include <alphatest_pars_fragment>\\n#include <fog_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\\t#include <clipping_planes_fragment>\\n\\tvec3 outgoingLight = vec3( 0.0 );\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\t#include <logdepthbuf_fragment>\\n\\t#include <map_fragment>\\n\\t#include <alphamap_fragment>\\n\\t#include <alphatest_fragment>\\n\\toutgoingLight = diffuseColor.rgb;\\n\\t#include <output_fragment>\\n\\t#include <tonemapping_fragment>\\n\\t#include <encodings_fragment>\\n\\t#include <fog_fragment>\\n}\";\n\n\tconst ShaderChunk = {\n\t\talphamap_fragment: alphamap_fragment,\n\t\talphamap_pars_fragment: alphamap_pars_fragment,\n\t\talphatest_fragment: alphatest_fragment,\n\t\talphatest_pars_fragment: alphatest_pars_fragment,\n\t\taomap_fragment: aomap_fragment,\n\t\taomap_pars_fragment: aomap_pars_fragment,\n\t\tbegin_vertex: begin_vertex,\n\t\tbeginnormal_vertex: beginnormal_vertex,\n\t\tbsdfs: bsdfs,\n\t\tbumpmap_pars_fragment: bumpmap_pars_fragment,\n\t\tclipping_planes_fragment: clipping_planes_fragment,\n\t\tclipping_planes_pars_fragment: clipping_planes_pars_fragment,\n\t\tclipping_planes_pars_vertex: clipping_planes_pars_vertex,\n\t\tclipping_planes_vertex: clipping_planes_vertex,\n\t\tcolor_fragment: color_fragment,\n\t\tcolor_pars_fragment: color_pars_fragment,\n\t\tcolor_pars_vertex: color_pars_vertex,\n\t\tcolor_vertex: color_vertex,\n\t\tcommon: common,\n\t\tcube_uv_reflection_fragment: cube_uv_reflection_fragment,\n\t\tdefaultnormal_vertex: defaultnormal_vertex,\n\t\tdisplacementmap_pars_vertex: displacementmap_pars_vertex,\n\t\tdisplacementmap_vertex: displacementmap_vertex,\n\t\temissivemap_fragment: emissivemap_fragment,\n\t\temissivemap_pars_fragment: emissivemap_pars_fragment,\n\t\tencodings_fragment: encodings_fragment,\n\t\tencodings_pars_fragment: encodings_pars_fragment,\n\t\tenvmap_fragment: envmap_fragment,\n\t\tenvmap_common_pars_fragment: envmap_common_pars_fragment,\n\t\tenvmap_pars_fragment: envmap_pars_fragment,\n\t\tenvmap_pars_vertex: envmap_pars_vertex,\n\t\tenvmap_physical_pars_fragment: envmap_physical_pars_fragment,\n\t\tenvmap_vertex: envmap_vertex,\n\t\tfog_vertex: fog_vertex,\n\t\tfog_pars_vertex: fog_pars_vertex,\n\t\tfog_fragment: fog_fragment,\n\t\tfog_pars_fragment: fog_pars_fragment,\n\t\tgradientmap_pars_fragment: gradientmap_pars_fragment,\n\t\tlightmap_fragment: lightmap_fragment,\n\t\tlightmap_pars_fragment: lightmap_pars_fragment,\n\t\tlights_lambert_vertex: lights_lambert_vertex,\n\t\tlights_pars_begin: lights_pars_begin,\n\t\tlights_toon_fragment: lights_toon_fragment,\n\t\tlights_toon_pars_fragment: lights_toon_pars_fragment,\n\t\tlights_phong_fragment: lights_phong_fragment,\n\t\tlights_phong_pars_fragment: lights_phong_pars_fragment,\n\t\tlights_physical_fragment: lights_physical_fragment,\n\t\tlights_physical_pars_fragment: lights_physical_pars_fragment,\n\t\tlights_fragment_begin: lights_fragment_begin,\n\t\tlights_fragment_maps: lights_fragment_maps,\n\t\tlights_fragment_end: lights_fragment_end,\n\t\tlogdepthbuf_fragment: logdepthbuf_fragment,\n\t\tlogdepthbuf_pars_fragment: logdepthbuf_pars_fragment,\n\t\tlogdepthbuf_pars_vertex: logdepthbuf_pars_vertex,\n\t\tlogdepthbuf_vertex: logdepthbuf_vertex,\n\t\tmap_fragment: map_fragment,\n\t\tmap_pars_fragment: map_pars_fragment,\n\t\tmap_particle_fragment: map_particle_fragment,\n\t\tmap_particle_pars_fragment: map_particle_pars_fragment,\n\t\tmetalnessmap_fragment: metalnessmap_fragment,\n\t\tmetalnessmap_pars_fragment: metalnessmap_pars_fragment,\n\t\tmorphnormal_vertex: morphnormal_vertex,\n\t\tmorphtarget_pars_vertex: morphtarget_pars_vertex,\n\t\tmorphtarget_vertex: morphtarget_vertex,\n\t\tnormal_fragment_begin: normal_fragment_begin,\n\t\tnormal_fragment_maps: normal_fragment_maps,\n\t\tnormal_pars_fragment: normal_pars_fragment,\n\t\tnormal_pars_vertex: normal_pars_vertex,\n\t\tnormal_vertex: normal_vertex,\n\t\tnormalmap_pars_fragment: normalmap_pars_fragment,\n\t\tclearcoat_normal_fragment_begin: clearcoat_normal_fragment_begin,\n\t\tclearcoat_normal_fragment_maps: clearcoat_normal_fragment_maps,\n\t\tclearcoat_pars_fragment: clearcoat_pars_fragment,\n\t\toutput_fragment: output_fragment,\n\t\tpacking: packing,\n\t\tpremultiplied_alpha_fragment: premultiplied_alpha_fragment,\n\t\tproject_vertex: project_vertex,\n\t\tdithering_fragment: dithering_fragment,\n\t\tdithering_pars_fragment: dithering_pars_fragment,\n\t\troughnessmap_fragment: roughnessmap_fragment,\n\t\troughnessmap_pars_fragment: roughnessmap_pars_fragment,\n\t\tshadowmap_pars_fragment: shadowmap_pars_fragment,\n\t\tshadowmap_pars_vertex: shadowmap_pars_vertex,\n\t\tshadowmap_vertex: shadowmap_vertex,\n\t\tshadowmask_pars_fragment: shadowmask_pars_fragment,\n\t\tskinbase_vertex: skinbase_vertex,\n\t\tskinning_pars_vertex: skinning_pars_vertex,\n\t\tskinning_vertex: skinning_vertex,\n\t\tskinnormal_vertex: skinnormal_vertex,\n\t\tspecularmap_fragment: specularmap_fragment,\n\t\tspecularmap_pars_fragment: specularmap_pars_fragment,\n\t\ttonemapping_fragment: tonemapping_fragment,\n\t\ttonemapping_pars_fragment: tonemapping_pars_fragment,\n\t\ttransmission_fragment: transmission_fragment,\n\t\ttransmission_pars_fragment: transmission_pars_fragment,\n\t\tuv_pars_fragment: uv_pars_fragment,\n\t\tuv_pars_vertex: uv_pars_vertex,\n\t\tuv_vertex: uv_vertex,\n\t\tuv2_pars_fragment: uv2_pars_fragment,\n\t\tuv2_pars_vertex: uv2_pars_vertex,\n\t\tuv2_vertex: uv2_vertex,\n\t\tworldpos_vertex: worldpos_vertex,\n\t\tbackground_vert: vertex$g,\n\t\tbackground_frag: fragment$g,\n\t\tcube_vert: vertex$f,\n\t\tcube_frag: fragment$f,\n\t\tdepth_vert: vertex$e,\n\t\tdepth_frag: fragment$e,\n\t\tdistanceRGBA_vert: vertex$d,\n\t\tdistanceRGBA_frag: fragment$d,\n\t\tequirect_vert: vertex$c,\n\t\tequirect_frag: fragment$c,\n\t\tlinedashed_vert: vertex$b,\n\t\tlinedashed_frag: fragment$b,\n\t\tmeshbasic_vert: vertex$a,\n\t\tmeshbasic_frag: fragment$a,\n\t\tmeshlambert_vert: vertex$9,\n\t\tmeshlambert_frag: fragment$9,\n\t\tmeshmatcap_vert: vertex$8,\n\t\tmeshmatcap_frag: fragment$8,\n\t\tmeshnormal_vert: vertex$7,\n\t\tmeshnormal_frag: fragment$7,\n\t\tmeshphong_vert: vertex$6,\n\t\tmeshphong_frag: fragment$6,\n\t\tmeshphysical_vert: vertex$5,\n\t\tmeshphysical_frag: fragment$5,\n\t\tmeshtoon_vert: vertex$4,\n\t\tmeshtoon_frag: fragment$4,\n\t\tpoints_vert: vertex$3,\n\t\tpoints_frag: fragment$3,\n\t\tshadow_vert: vertex$2,\n\t\tshadow_frag: fragment$2,\n\t\tsprite_vert: vertex$1,\n\t\tsprite_frag: fragment$1\n\t};\n\n\t/**\n\t * Uniforms library for shared webgl shaders\n\t */\n\n\tconst UniformsLib = {\n\t\tcommon: {\n\t\t\tdiffuse: {\n\t\t\t\tvalue: new Color(0xffffff)\n\t\t\t},\n\t\t\topacity: {\n\t\t\t\tvalue: 1.0\n\t\t\t},\n\t\t\tmap: {\n\t\t\t\tvalue: null\n\t\t\t},\n\t\t\tuvTransform: {\n\t\t\t\tvalue: new Matrix3()\n\t\t\t},\n\t\t\tuv2Transform: {\n\t\t\t\tvalue: new Matrix3()\n\t\t\t},\n\t\t\talphaMap: {\n\t\t\t\tvalue: null\n\t\t\t},\n\t\t\talphaTest: {\n\t\t\t\tvalue: 0\n\t\t\t}\n\t\t},\n\t\tspecularmap: {\n\t\t\tspecularMap: {\n\t\t\t\tvalue: null\n\t\t\t}\n\t\t},\n\t\tenvmap: {\n\t\t\tenvMap: {\n\t\t\t\tvalue: null\n\t\t\t},\n\t\t\tflipEnvMap: {\n\t\t\t\tvalue: -1\n\t\t\t},\n\t\t\treflectivity: {\n\t\t\t\tvalue: 1.0\n\t\t\t},\n\t\t\t// basic, lambert, phong\n\t\t\tior: {\n\t\t\t\tvalue: 1.5\n\t\t\t},\n\t\t\t// standard, physical\n\t\t\trefractionRatio: {\n\t\t\t\tvalue: 0.98\n\t\t\t},\n\t\t\tmaxMipLevel: {\n\t\t\t\tvalue: 0\n\t\t\t}\n\t\t},\n\t\taomap: {\n\t\t\taoMap: {\n\t\t\t\tvalue: null\n\t\t\t},\n\t\t\taoMapIntensity: {\n\t\t\t\tvalue: 1\n\t\t\t}\n\t\t},\n\t\tlightmap: {\n\t\t\tlightMap: {\n\t\t\t\tvalue: null\n\t\t\t},\n\t\t\tlightMapIntensity: {\n\t\t\t\tvalue: 1\n\t\t\t}\n\t\t},\n\t\temissivemap: {\n\t\t\temissiveMap: {\n\t\t\t\tvalue: null\n\t\t\t}\n\t\t},\n\t\tbumpmap: {\n\t\t\tbumpMap: {\n\t\t\t\tvalue: null\n\t\t\t},\n\t\t\tbumpScale: {\n\t\t\t\tvalue: 1\n\t\t\t}\n\t\t},\n\t\tnormalmap: {\n\t\t\tnormalMap: {\n\t\t\t\tvalue: null\n\t\t\t},\n\t\t\tnormalScale: {\n\t\t\t\tvalue: new Vector2(1, 1)\n\t\t\t}\n\t\t},\n\t\tdisplacementmap: {\n\t\t\tdisplacementMap: {\n\t\t\t\tvalue: null\n\t\t\t},\n\t\t\tdisplacementScale: {\n\t\t\t\tvalue: 1\n\t\t\t},\n\t\t\tdisplacementBias: {\n\t\t\t\tvalue: 0\n\t\t\t}\n\t\t},\n\t\troughnessmap: {\n\t\t\troughnessMap: {\n\t\t\t\tvalue: null\n\t\t\t}\n\t\t},\n\t\tmetalnessmap: {\n\t\t\tmetalnessMap: {\n\t\t\t\tvalue: null\n\t\t\t}\n\t\t},\n\t\tgradientmap: {\n\t\t\tgradientMap: {\n\t\t\t\tvalue: null\n\t\t\t}\n\t\t},\n\t\tfog: {\n\t\t\tfogDensity: {\n\t\t\t\tvalue: 0.00025\n\t\t\t},\n\t\t\tfogNear: {\n\t\t\t\tvalue: 1\n\t\t\t},\n\t\t\tfogFar: {\n\t\t\t\tvalue: 2000\n\t\t\t},\n\t\t\tfogColor: {\n\t\t\t\tvalue: new Color(0xffffff)\n\t\t\t}\n\t\t},\n\t\tlights: {\n\t\t\tambientLightColor: {\n\t\t\t\tvalue: []\n\t\t\t},\n\t\t\tlightProbe: {\n\t\t\t\tvalue: []\n\t\t\t},\n\t\t\tdirectionalLights: {\n\t\t\t\tvalue: [],\n\t\t\t\tproperties: {\n\t\t\t\t\tdirection: {},\n\t\t\t\t\tcolor: {}\n\t\t\t\t}\n\t\t\t},\n\t\t\tdirectionalLightShadows: {\n\t\t\t\tvalue: [],\n\t\t\t\tproperties: {\n\t\t\t\t\tshadowBias: {},\n\t\t\t\t\tshadowNormalBias: {},\n\t\t\t\t\tshadowRadius: {},\n\t\t\t\t\tshadowMapSize: {}\n\t\t\t\t}\n\t\t\t},\n\t\t\tdirectionalShadowMap: {\n\t\t\t\tvalue: []\n\t\t\t},\n\t\t\tdirectionalShadowMatrix: {\n\t\t\t\tvalue: []\n\t\t\t},\n\t\t\tspotLights: {\n\t\t\t\tvalue: [],\n\t\t\t\tproperties: {\n\t\t\t\t\tcolor: {},\n\t\t\t\t\tposition: {},\n\t\t\t\t\tdirection: {},\n\t\t\t\t\tdistance: {},\n\t\t\t\t\tconeCos: {},\n\t\t\t\t\tpenumbraCos: {},\n\t\t\t\t\tdecay: {}\n\t\t\t\t}\n\t\t\t},\n\t\t\tspotLightShadows: {\n\t\t\t\tvalue: [],\n\t\t\t\tproperties: {\n\t\t\t\t\tshadowBias: {},\n\t\t\t\t\tshadowNormalBias: {},\n\t\t\t\t\tshadowRadius: {},\n\t\t\t\t\tshadowMapSize: {}\n\t\t\t\t}\n\t\t\t},\n\t\t\tspotShadowMap: {\n\t\t\t\tvalue: []\n\t\t\t},\n\t\t\tspotShadowMatrix: {\n\t\t\t\tvalue: []\n\t\t\t},\n\t\t\tpointLights: {\n\t\t\t\tvalue: [],\n\t\t\t\tproperties: {\n\t\t\t\t\tcolor: {},\n\t\t\t\t\tposition: {},\n\t\t\t\t\tdecay: {},\n\t\t\t\t\tdistance: {}\n\t\t\t\t}\n\t\t\t},\n\t\t\tpointLightShadows: {\n\t\t\t\tvalue: [],\n\t\t\t\tproperties: {\n\t\t\t\t\tshadowBias: {},\n\t\t\t\t\tshadowNormalBias: {},\n\t\t\t\t\tshadowRadius: {},\n\t\t\t\t\tshadowMapSize: {},\n\t\t\t\t\tshadowCameraNear: {},\n\t\t\t\t\tshadowCameraFar: {}\n\t\t\t\t}\n\t\t\t},\n\t\t\tpointShadowMap: {\n\t\t\t\tvalue: []\n\t\t\t},\n\t\t\tpointShadowMatrix: {\n\t\t\t\tvalue: []\n\t\t\t},\n\t\t\themisphereLights: {\n\t\t\t\tvalue: [],\n\t\t\t\tproperties: {\n\t\t\t\t\tdirection: {},\n\t\t\t\t\tskyColor: {},\n\t\t\t\t\tgroundColor: {}\n\t\t\t\t}\n\t\t\t},\n\t\t\t// TODO (abelnation): RectAreaLight BRDF data needs to be moved from example to main src\n\t\t\trectAreaLights: {\n\t\t\t\tvalue: [],\n\t\t\t\tproperties: {\n\t\t\t\t\tcolor: {},\n\t\t\t\t\tposition: {},\n\t\t\t\t\twidth: {},\n\t\t\t\t\theight: {}\n\t\t\t\t}\n\t\t\t},\n\t\t\tltc_1: {\n\t\t\t\tvalue: null\n\t\t\t},\n\t\t\tltc_2: {\n\t\t\t\tvalue: null\n\t\t\t}\n\t\t},\n\t\tpoints: {\n\t\t\tdiffuse: {\n\t\t\t\tvalue: new Color(0xffffff)\n\t\t\t},\n\t\t\topacity: {\n\t\t\t\tvalue: 1.0\n\t\t\t},\n\t\t\tsize: {\n\t\t\t\tvalue: 1.0\n\t\t\t},\n\t\t\tscale: {\n\t\t\t\tvalue: 1.0\n\t\t\t},\n\t\t\tmap: {\n\t\t\t\tvalue: null\n\t\t\t},\n\t\t\talphaMap: {\n\t\t\t\tvalue: null\n\t\t\t},\n\t\t\talphaTest: {\n\t\t\t\tvalue: 0\n\t\t\t},\n\t\t\tuvTransform: {\n\t\t\t\tvalue: new Matrix3()\n\t\t\t}\n\t\t},\n\t\tsprite: {\n\t\t\tdiffuse: {\n\t\t\t\tvalue: new Color(0xffffff)\n\t\t\t},\n\t\t\topacity: {\n\t\t\t\tvalue: 1.0\n\t\t\t},\n\t\t\tcenter: {\n\t\t\t\tvalue: new Vector2(0.5, 0.5)\n\t\t\t},\n\t\t\trotation: {\n\t\t\t\tvalue: 0.0\n\t\t\t},\n\t\t\tmap: {\n\t\t\t\tvalue: null\n\t\t\t},\n\t\t\talphaMap: {\n\t\t\t\tvalue: null\n\t\t\t},\n\t\t\talphaTest: {\n\t\t\t\tvalue: 0\n\t\t\t},\n\t\t\tuvTransform: {\n\t\t\t\tvalue: new Matrix3()\n\t\t\t}\n\t\t}\n\t};\n\n\tconst ShaderLib = {\n\t\tbasic: {\n\t\t\tuniforms: mergeUniforms([UniformsLib.common, UniformsLib.specularmap, UniformsLib.envmap, UniformsLib.aomap, UniformsLib.lightmap, UniformsLib.fog]),\n\t\t\tvertexShader: ShaderChunk.meshbasic_vert,\n\t\t\tfragmentShader: ShaderChunk.meshbasic_frag\n\t\t},\n\t\tlambert: {\n\t\t\tuniforms: mergeUniforms([UniformsLib.common, UniformsLib.specularmap, UniformsLib.envmap, UniformsLib.aomap, UniformsLib.lightmap, UniformsLib.emissivemap, UniformsLib.fog, UniformsLib.lights, {\n\t\t\t\temissive: {\n\t\t\t\t\tvalue: new Color(0x000000)\n\t\t\t\t}\n\t\t\t}]),\n\t\t\tvertexShader: ShaderChunk.meshlambert_vert,\n\t\t\tfragmentShader: ShaderChunk.meshlambert_frag\n\t\t},\n\t\tphong: {\n\t\t\tuniforms: mergeUniforms([UniformsLib.common, UniformsLib.specularmap, UniformsLib.envmap, UniformsLib.aomap, UniformsLib.lightmap, UniformsLib.emissivemap, UniformsLib.bumpmap, UniformsLib.normalmap, UniformsLib.displacementmap, UniformsLib.fog, UniformsLib.lights, {\n\t\t\t\temissive: {\n\t\t\t\t\tvalue: new Color(0x000000)\n\t\t\t\t},\n\t\t\t\tspecular: {\n\t\t\t\t\tvalue: new Color(0x111111)\n\t\t\t\t},\n\t\t\t\tshininess: {\n\t\t\t\t\tvalue: 30\n\t\t\t\t}\n\t\t\t}]),\n\t\t\tvertexShader: ShaderChunk.meshphong_vert,\n\t\t\tfragmentShader: ShaderChunk.meshphong_frag\n\t\t},\n\t\tstandard: {\n\t\t\tuniforms: mergeUniforms([UniformsLib.common, UniformsLib.envmap, UniformsLib.aomap, UniformsLib.lightmap, UniformsLib.emissivemap, UniformsLib.bumpmap, UniformsLib.normalmap, UniformsLib.displacementmap, UniformsLib.roughnessmap, UniformsLib.metalnessmap, UniformsLib.fog, UniformsLib.lights, {\n\t\t\t\temissive: {\n\t\t\t\t\tvalue: new Color(0x000000)\n\t\t\t\t},\n\t\t\t\troughness: {\n\t\t\t\t\tvalue: 1.0\n\t\t\t\t},\n\t\t\t\tmetalness: {\n\t\t\t\t\tvalue: 0.0\n\t\t\t\t},\n\t\t\t\tenvMapIntensity: {\n\t\t\t\t\tvalue: 1\n\t\t\t\t} // temporary\n\n\t\t\t}]),\n\t\t\tvertexShader: ShaderChunk.meshphysical_vert,\n\t\t\tfragmentShader: ShaderChunk.meshphysical_frag\n\t\t},\n\t\ttoon: {\n\t\t\tuniforms: mergeUniforms([UniformsLib.common, UniformsLib.aomap, UniformsLib.lightmap, UniformsLib.emissivemap, UniformsLib.bumpmap, UniformsLib.normalmap, UniformsLib.displacementmap, UniformsLib.gradientmap, UniformsLib.fog, UniformsLib.lights, {\n\t\t\t\temissive: {\n\t\t\t\t\tvalue: new Color(0x000000)\n\t\t\t\t}\n\t\t\t}]),\n\t\t\tvertexShader: ShaderChunk.meshtoon_vert,\n\t\t\tfragmentShader: ShaderChunk.meshtoon_frag\n\t\t},\n\t\tmatcap: {\n\t\t\tuniforms: mergeUniforms([UniformsLib.common, UniformsLib.bumpmap, UniformsLib.normalmap, UniformsLib.displacementmap, UniformsLib.fog, {\n\t\t\t\tmatcap: {\n\t\t\t\t\tvalue: null\n\t\t\t\t}\n\t\t\t}]),\n\t\t\tvertexShader: ShaderChunk.meshmatcap_vert,\n\t\t\tfragmentShader: ShaderChunk.meshmatcap_frag\n\t\t},\n\t\tpoints: {\n\t\t\tuniforms: mergeUniforms([UniformsLib.points, UniformsLib.fog]),\n\t\t\tvertexShader: ShaderChunk.points_vert,\n\t\t\tfragmentShader: ShaderChunk.points_frag\n\t\t},\n\t\tdashed: {\n\t\t\tuniforms: mergeUniforms([UniformsLib.common, UniformsLib.fog, {\n\t\t\t\tscale: {\n\t\t\t\t\tvalue: 1\n\t\t\t\t},\n\t\t\t\tdashSize: {\n\t\t\t\t\tvalue: 1\n\t\t\t\t},\n\t\t\t\ttotalSize: {\n\t\t\t\t\tvalue: 2\n\t\t\t\t}\n\t\t\t}]),\n\t\t\tvertexShader: ShaderChunk.linedashed_vert,\n\t\t\tfragmentShader: ShaderChunk.linedashed_frag\n\t\t},\n\t\tdepth: {\n\t\t\tuniforms: mergeUniforms([UniformsLib.common, UniformsLib.displacementmap]),\n\t\t\tvertexShader: ShaderChunk.depth_vert,\n\t\t\tfragmentShader: ShaderChunk.depth_frag\n\t\t},\n\t\tnormal: {\n\t\t\tuniforms: mergeUniforms([UniformsLib.common, UniformsLib.bumpmap, UniformsLib.normalmap, UniformsLib.displacementmap, {\n\t\t\t\topacity: {\n\t\t\t\t\tvalue: 1.0\n\t\t\t\t}\n\t\t\t}]),\n\t\t\tvertexShader: ShaderChunk.meshnormal_vert,\n\t\t\tfragmentShader: ShaderChunk.meshnormal_frag\n\t\t},\n\t\tsprite: {\n\t\t\tuniforms: mergeUniforms([UniformsLib.sprite, UniformsLib.fog]),\n\t\t\tvertexShader: ShaderChunk.sprite_vert,\n\t\t\tfragmentShader: ShaderChunk.sprite_frag\n\t\t},\n\t\tbackground: {\n\t\t\tuniforms: {\n\t\t\t\tuvTransform: {\n\t\t\t\t\tvalue: new Matrix3()\n\t\t\t\t},\n\t\t\t\tt2D: {\n\t\t\t\t\tvalue: null\n\t\t\t\t}\n\t\t\t},\n\t\t\tvertexShader: ShaderChunk.background_vert,\n\t\t\tfragmentShader: ShaderChunk.background_frag\n\t\t},\n\n\t\t/* -------------------------------------------------------------------------\n\t\t//\tCube map shader\n\t\t ------------------------------------------------------------------------- */\n\t\tcube: {\n\t\t\tuniforms: mergeUniforms([UniformsLib.envmap, {\n\t\t\t\topacity: {\n\t\t\t\t\tvalue: 1.0\n\t\t\t\t}\n\t\t\t}]),\n\t\t\tvertexShader: ShaderChunk.cube_vert,\n\t\t\tfragmentShader: ShaderChunk.cube_frag\n\t\t},\n\t\tequirect: {\n\t\t\tuniforms: {\n\t\t\t\ttEquirect: {\n\t\t\t\t\tvalue: null\n\t\t\t\t}\n\t\t\t},\n\t\t\tvertexShader: ShaderChunk.equirect_vert,\n\t\t\tfragmentShader: ShaderChunk.equirect_frag\n\t\t},\n\t\tdistanceRGBA: {\n\t\t\tuniforms: mergeUniforms([UniformsLib.common, UniformsLib.displacementmap, {\n\t\t\t\treferencePosition: {\n\t\t\t\t\tvalue: new Vector3()\n\t\t\t\t},\n\t\t\t\tnearDistance: {\n\t\t\t\t\tvalue: 1\n\t\t\t\t},\n\t\t\t\tfarDistance: {\n\t\t\t\t\tvalue: 1000\n\t\t\t\t}\n\t\t\t}]),\n\t\t\tvertexShader: ShaderChunk.distanceRGBA_vert,\n\t\t\tfragmentShader: ShaderChunk.distanceRGBA_frag\n\t\t},\n\t\tshadow: {\n\t\t\tuniforms: mergeUniforms([UniformsLib.lights, UniformsLib.fog, {\n\t\t\t\tcolor: {\n\t\t\t\t\tvalue: new Color(0x00000)\n\t\t\t\t},\n\t\t\t\topacity: {\n\t\t\t\t\tvalue: 1.0\n\t\t\t\t}\n\t\t\t}]),\n\t\t\tvertexShader: ShaderChunk.shadow_vert,\n\t\t\tfragmentShader: ShaderChunk.shadow_frag\n\t\t}\n\t};\n\tShaderLib.physical = {\n\t\tuniforms: mergeUniforms([ShaderLib.standard.uniforms, {\n\t\t\tclearcoat: {\n\t\t\t\tvalue: 0\n\t\t\t},\n\t\t\tclearcoatMap: {\n\t\t\t\tvalue: null\n\t\t\t},\n\t\t\tclearcoatRoughness: {\n\t\t\t\tvalue: 0\n\t\t\t},\n\t\t\tclearcoatRoughnessMap: {\n\t\t\t\tvalue: null\n\t\t\t},\n\t\t\tclearcoatNormalScale: {\n\t\t\t\tvalue: new Vector2(1, 1)\n\t\t\t},\n\t\t\tclearcoatNormalMap: {\n\t\t\t\tvalue: null\n\t\t\t},\n\t\t\tsheen: {\n\t\t\t\tvalue: 0\n\t\t\t},\n\t\t\tsheenTint: {\n\t\t\t\tvalue: new Color(0x000000)\n\t\t\t},\n\t\t\tsheenRoughness: {\n\t\t\t\tvalue: 0\n\t\t\t},\n\t\t\ttransmission: {\n\t\t\t\tvalue: 0\n\t\t\t},\n\t\t\ttransmissionMap: {\n\t\t\t\tvalue: null\n\t\t\t},\n\t\t\ttransmissionSamplerSize: {\n\t\t\t\tvalue: new Vector2()\n\t\t\t},\n\t\t\ttransmissionSamplerMap: {\n\t\t\t\tvalue: null\n\t\t\t},\n\t\t\tthickness: {\n\t\t\t\tvalue: 0\n\t\t\t},\n\t\t\tthicknessMap: {\n\t\t\t\tvalue: null\n\t\t\t},\n\t\t\tattenuationDistance: {\n\t\t\t\tvalue: 0\n\t\t\t},\n\t\t\tattenuationTint: {\n\t\t\t\tvalue: new Color(0x000000)\n\t\t\t},\n\t\t\tspecularIntensity: {\n\t\t\t\tvalue: 0\n\t\t\t},\n\t\t\tspecularIntensityMap: {\n\t\t\t\tvalue: null\n\t\t\t},\n\t\t\tspecularTint: {\n\t\t\t\tvalue: new Color(1, 1, 1)\n\t\t\t},\n\t\t\tspecularTintMap: {\n\t\t\t\tvalue: null\n\t\t\t}\n\t\t}]),\n\t\tvertexShader: ShaderChunk.meshphysical_vert,\n\t\tfragmentShader: ShaderChunk.meshphysical_frag\n\t};\n\n\tfunction WebGLBackground(renderer, cubemaps, state, objects, premultipliedAlpha) {\n\t\tconst clearColor = new Color(0x000000);\n\t\tlet clearAlpha = 0;\n\t\tlet planeMesh;\n\t\tlet boxMesh;\n\t\tlet currentBackground = null;\n\t\tlet currentBackgroundVersion = 0;\n\t\tlet currentTonemapping = null;\n\n\t\tfunction render(renderList, scene) {\n\t\t\tlet forceClear = false;\n\t\t\tlet background = scene.isScene === true ? scene.background : null;\n\n\t\t\tif (background && background.isTexture) {\n\t\t\t\tbackground = cubemaps.get(background);\n\t\t\t} // Ignore background in AR\n\t\t\t// TODO: Reconsider this.\n\n\n\t\t\tconst xr = renderer.xr;\n\t\t\tconst session = xr.getSession && xr.getSession();\n\n\t\t\tif (session && session.environmentBlendMode === 'additive') {\n\t\t\t\tbackground = null;\n\t\t\t}\n\n\t\t\tif (background === null) {\n\t\t\t\tsetClear(clearColor, clearAlpha);\n\t\t\t} else if (background && background.isColor) {\n\t\t\t\tsetClear(background, 1);\n\t\t\t\tforceClear = true;\n\t\t\t}\n\n\t\t\tif (renderer.autoClear || forceClear) {\n\t\t\t\trenderer.clear(renderer.autoClearColor, renderer.autoClearDepth, renderer.autoClearStencil);\n\t\t\t}\n\n\t\t\tif (background && (background.isCubeTexture || background.mapping === CubeUVReflectionMapping)) {\n\t\t\t\tif (boxMesh === undefined) {\n\t\t\t\t\tboxMesh = new Mesh(new BoxGeometry(1, 1, 1), new ShaderMaterial({\n\t\t\t\t\t\tname: 'BackgroundCubeMaterial',\n\t\t\t\t\t\tuniforms: cloneUniforms(ShaderLib.cube.uniforms),\n\t\t\t\t\t\tvertexShader: ShaderLib.cube.vertexShader,\n\t\t\t\t\t\tfragmentShader: ShaderLib.cube.fragmentShader,\n\t\t\t\t\t\tside: BackSide,\n\t\t\t\t\t\tdepthTest: false,\n\t\t\t\t\t\tdepthWrite: false,\n\t\t\t\t\t\tfog: false\n\t\t\t\t\t}));\n\t\t\t\t\tboxMesh.geometry.deleteAttribute('normal');\n\t\t\t\t\tboxMesh.geometry.deleteAttribute('uv');\n\n\t\t\t\t\tboxMesh.onBeforeRender = function (renderer, scene, camera) {\n\t\t\t\t\t\tthis.matrixWorld.copyPosition(camera.matrixWorld);\n\t\t\t\t\t}; // enable code injection for non-built-in material\n\n\n\t\t\t\t\tObject.defineProperty(boxMesh.material, 'envMap', {\n\t\t\t\t\t\tget: function () {\n\t\t\t\t\t\t\treturn this.uniforms.envMap.value;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\tobjects.update(boxMesh);\n\t\t\t\t}\n\n\t\t\t\tboxMesh.material.uniforms.envMap.value = background;\n\t\t\t\tboxMesh.material.uniforms.flipEnvMap.value = background.isCubeTexture && background.isRenderTargetTexture === false ? -1 : 1;\n\n\t\t\t\tif (currentBackground !== background || currentBackgroundVersion !== background.version || currentTonemapping !== renderer.toneMapping) {\n\t\t\t\t\tboxMesh.material.needsUpdate = true;\n\t\t\t\t\tcurrentBackground = background;\n\t\t\t\t\tcurrentBackgroundVersion = background.version;\n\t\t\t\t\tcurrentTonemapping = renderer.toneMapping;\n\t\t\t\t} // push to the pre-sorted opaque render list\n\n\n\t\t\t\trenderList.unshift(boxMesh, boxMesh.geometry, boxMesh.material, 0, 0, null);\n\t\t\t} else if (background && background.isTexture) {\n\t\t\t\tif (planeMesh === undefined) {\n\t\t\t\t\tplaneMesh = new Mesh(new PlaneGeometry(2, 2), new ShaderMaterial({\n\t\t\t\t\t\tname: 'BackgroundMaterial',\n\t\t\t\t\t\tuniforms: cloneUniforms(ShaderLib.background.uniforms),\n\t\t\t\t\t\tvertexShader: ShaderLib.background.vertexShader,\n\t\t\t\t\t\tfragmentShader: ShaderLib.background.fragmentShader,\n\t\t\t\t\t\tside: FrontSide,\n\t\t\t\t\t\tdepthTest: false,\n\t\t\t\t\t\tdepthWrite: false,\n\t\t\t\t\t\tfog: false\n\t\t\t\t\t}));\n\t\t\t\t\tplaneMesh.geometry.deleteAttribute('normal'); // enable code injection for non-built-in material\n\n\t\t\t\t\tObject.defineProperty(planeMesh.material, 'map', {\n\t\t\t\t\t\tget: function () {\n\t\t\t\t\t\t\treturn this.uniforms.t2D.value;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\tobjects.update(planeMesh);\n\t\t\t\t}\n\n\t\t\t\tplaneMesh.material.uniforms.t2D.value = background;\n\n\t\t\t\tif (background.matrixAutoUpdate === true) {\n\t\t\t\t\tbackground.updateMatrix();\n\t\t\t\t}\n\n\t\t\t\tplaneMesh.material.uniforms.uvTransform.value.copy(background.matrix);\n\n\t\t\t\tif (currentBackground !== background || currentBackgroundVersion !== background.version || currentTonemapping !== renderer.toneMapping) {\n\t\t\t\t\tplaneMesh.material.needsUpdate = true;\n\t\t\t\t\tcurrentBackground = background;\n\t\t\t\t\tcurrentBackgroundVersion = background.version;\n\t\t\t\t\tcurrentTonemapping = renderer.toneMapping;\n\t\t\t\t} // push to the pre-sorted opaque render list\n\n\n\t\t\t\trenderList.unshift(planeMesh, planeMesh.geometry, planeMesh.material, 0, 0, null);\n\t\t\t}\n\t\t}\n\n\t\tfunction setClear(color, alpha) {\n\t\t\tstate.buffers.color.setClear(color.r, color.g, color.b, alpha, premultipliedAlpha);\n\t\t}\n\n\t\treturn {\n\t\t\tgetClearColor: function () {\n\t\t\t\treturn clearColor;\n\t\t\t},\n\t\t\tsetClearColor: function (color, alpha = 1) {\n\t\t\t\tclearColor.set(color);\n\t\t\t\tclearAlpha = alpha;\n\t\t\t\tsetClear(clearColor, clearAlpha);\n\t\t\t},\n\t\t\tgetClearAlpha: function () {\n\t\t\t\treturn clearAlpha;\n\t\t\t},\n\t\t\tsetClearAlpha: function (alpha) {\n\t\t\t\tclearAlpha = alpha;\n\t\t\t\tsetClear(clearColor, clearAlpha);\n\t\t\t},\n\t\t\trender: render\n\t\t};\n\t}\n\n\tfunction WebGLBindingStates(gl, extensions, attributes, capabilities) {\n\t\tconst maxVertexAttributes = gl.getParameter(gl.MAX_VERTEX_ATTRIBS);\n\t\tconst extension = capabilities.isWebGL2 ? null : extensions.get('OES_vertex_array_object');\n\t\tconst vaoAvailable = capabilities.isWebGL2 || extension !== null;\n\t\tconst bindingStates = {};\n\t\tconst defaultState = createBindingState(null);\n\t\tlet currentState = defaultState;\n\n\t\tfunction setup(object, material, program, geometry, index) {\n\t\t\tlet updateBuffers = false;\n\n\t\t\tif (vaoAvailable) {\n\t\t\t\tconst state = getBindingState(geometry, program, material);\n\n\t\t\t\tif (currentState !== state) {\n\t\t\t\t\tcurrentState = state;\n\t\t\t\t\tbindVertexArrayObject(currentState.object);\n\t\t\t\t}\n\n\t\t\t\tupdateBuffers = needsUpdate(geometry, index);\n\t\t\t\tif (updateBuffers) saveCache(geometry, index);\n\t\t\t} else {\n\t\t\t\tconst wireframe = material.wireframe === true;\n\n\t\t\t\tif (currentState.geometry !== geometry.id || currentState.program !== program.id || currentState.wireframe !== wireframe) {\n\t\t\t\t\tcurrentState.geometry = geometry.id;\n\t\t\t\t\tcurrentState.program = program.id;\n\t\t\t\t\tcurrentState.wireframe = wireframe;\n\t\t\t\t\tupdateBuffers = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (object.isInstancedMesh === true) {\n\t\t\t\tupdateBuffers = true;\n\t\t\t}\n\n\t\t\tif (index !== null) {\n\t\t\t\tattributes.update(index, gl.ELEMENT_ARRAY_BUFFER);\n\t\t\t}\n\n\t\t\tif (updateBuffers) {\n\t\t\t\tsetupVertexAttributes(object, material, program, geometry);\n\n\t\t\t\tif (index !== null) {\n\t\t\t\t\tgl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, attributes.get(index).buffer);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction createVertexArrayObject() {\n\t\t\tif (capabilities.isWebGL2) return gl.createVertexArray();\n\t\t\treturn extension.createVertexArrayOES();\n\t\t}\n\n\t\tfunction bindVertexArrayObject(vao) {\n\t\t\tif (capabilities.isWebGL2) return gl.bindVertexArray(vao);\n\t\t\treturn extension.bindVertexArrayOES(vao);\n\t\t}\n\n\t\tfunction deleteVertexArrayObject(vao) {\n\t\t\tif (capabilities.isWebGL2) return gl.deleteVertexArray(vao);\n\t\t\treturn extension.deleteVertexArrayOES(vao);\n\t\t}\n\n\t\tfunction getBindingState(geometry, program, material) {\n\t\t\tconst wireframe = material.wireframe === true;\n\t\t\tlet programMap = bindingStates[geometry.id];\n\n\t\t\tif (programMap === undefined) {\n\t\t\t\tprogramMap = {};\n\t\t\t\tbindingStates[geometry.id] = programMap;\n\t\t\t}\n\n\t\t\tlet stateMap = programMap[program.id];\n\n\t\t\tif (stateMap === undefined) {\n\t\t\t\tstateMap = {};\n\t\t\t\tprogramMap[program.id] = stateMap;\n\t\t\t}\n\n\t\t\tlet state = stateMap[wireframe];\n\n\t\t\tif (state === undefined) {\n\t\t\t\tstate = createBindingState(createVertexArrayObject());\n\t\t\t\tstateMap[wireframe] = state;\n\t\t\t}\n\n\t\t\treturn state;\n\t\t}\n\n\t\tfunction createBindingState(vao) {\n\t\t\tconst newAttributes = [];\n\t\t\tconst enabledAttributes = [];\n\t\t\tconst attributeDivisors = [];\n\n\t\t\tfor (let i = 0; i < maxVertexAttributes; i++) {\n\t\t\t\tnewAttributes[i] = 0;\n\t\t\t\tenabledAttributes[i] = 0;\n\t\t\t\tattributeDivisors[i] = 0;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t// for backward compatibility on non-VAO support browser\n\t\t\t\tgeometry: null,\n\t\t\t\tprogram: null,\n\t\t\t\twireframe: false,\n\t\t\t\tnewAttributes: newAttributes,\n\t\t\t\tenabledAttributes: enabledAttributes,\n\t\t\t\tattributeDivisors: attributeDivisors,\n\t\t\t\tobject: vao,\n\t\t\t\tattributes: {},\n\t\t\t\tindex: null\n\t\t\t};\n\t\t}\n\n\t\tfunction needsUpdate(geometry, index) {\n\t\t\tconst cachedAttributes = currentState.attributes;\n\t\t\tconst geometryAttributes = geometry.attributes;\n\t\t\tlet attributesNum = 0;\n\n\t\t\tfor (const key in geometryAttributes) {\n\t\t\t\tconst cachedAttribute = cachedAttributes[key];\n\t\t\t\tconst geometryAttribute = geometryAttributes[key];\n\t\t\t\tif (cachedAttribute === undefined) return true;\n\t\t\t\tif (cachedAttribute.attribute !== geometryAttribute) return true;\n\t\t\t\tif (cachedAttribute.data !== geometryAttribute.data) return true;\n\t\t\t\tattributesNum++;\n\t\t\t}\n\n\t\t\tif (currentState.attributesNum !== attributesNum) return true;\n\t\t\tif (currentState.index !== index) return true;\n\t\t\treturn false;\n\t\t}\n\n\t\tfunction saveCache(geometry, index) {\n\t\t\tconst cache = {};\n\t\t\tconst attributes = geometry.attributes;\n\t\t\tlet attributesNum = 0;\n\n\t\t\tfor (const key in attributes) {\n\t\t\t\tconst attribute = attributes[key];\n\t\t\t\tconst data = {};\n\t\t\t\tdata.attribute = attribute;\n\n\t\t\t\tif (attribute.data) {\n\t\t\t\t\tdata.data = attribute.data;\n\t\t\t\t}\n\n\t\t\t\tcache[key] = data;\n\t\t\t\tattributesNum++;\n\t\t\t}\n\n\t\t\tcurrentState.attributes = cache;\n\t\t\tcurrentState.attributesNum = attributesNum;\n\t\t\tcurrentState.index = index;\n\t\t}\n\n\t\tfunction initAttributes() {\n\t\t\tconst newAttributes = currentState.newAttributes;\n\n\t\t\tfor (let i = 0, il = newAttributes.length; i < il; i++) {\n\t\t\t\tnewAttributes[i] = 0;\n\t\t\t}\n\t\t}\n\n\t\tfunction enableAttribute(attribute) {\n\t\t\tenableAttributeAndDivisor(attribute, 0);\n\t\t}\n\n\t\tfunction enableAttributeAndDivisor(attribute, meshPerAttribute) {\n\t\t\tconst newAttributes = currentState.newAttributes;\n\t\t\tconst enabledAttributes = currentState.enabledAttributes;\n\t\t\tconst attributeDivisors = currentState.attributeDivisors;\n\t\t\tnewAttributes[attribute] = 1;\n\n\t\t\tif (enabledAttributes[attribute] === 0) {\n\t\t\t\tgl.enableVertexAttribArray(attribute);\n\t\t\t\tenabledAttributes[attribute] = 1;\n\t\t\t}\n\n\t\t\tif (attributeDivisors[attribute] !== meshPerAttribute) {\n\t\t\t\tconst extension = capabilities.isWebGL2 ? gl : extensions.get('ANGLE_instanced_arrays');\n\t\t\t\textension[capabilities.isWebGL2 ? 'vertexAttribDivisor' : 'vertexAttribDivisorANGLE'](attribute, meshPerAttribute);\n\t\t\t\tattributeDivisors[attribute] = meshPerAttribute;\n\t\t\t}\n\t\t}\n\n\t\tfunction disableUnusedAttributes() {\n\t\t\tconst newAttributes = currentState.newAttributes;\n\t\t\tconst enabledAttributes = currentState.enabledAttributes;\n\n\t\t\tfor (let i = 0, il = enabledAttributes.length; i < il; i++) {\n\t\t\t\tif (enabledAttributes[i] !== newAttributes[i]) {\n\t\t\t\t\tgl.disableVertexAttribArray(i);\n\t\t\t\t\tenabledAttributes[i] = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction vertexAttribPointer(index, size, type, normalized, stride, offset) {\n\t\t\tif (capabilities.isWebGL2 === true && (type === gl.INT || type === gl.UNSIGNED_INT)) {\n\t\t\t\tgl.vertexAttribIPointer(index, size, type, stride, offset);\n\t\t\t} else {\n\t\t\t\tgl.vertexAttribPointer(index, size, type, normalized, stride, offset);\n\t\t\t}\n\t\t}\n\n\t\tfunction setupVertexAttributes(object, material, program, geometry) {\n\t\t\tif (capabilities.isWebGL2 === false && (object.isInstancedMesh || geometry.isInstancedBufferGeometry)) {\n\t\t\t\tif (extensions.get('ANGLE_instanced_arrays') === null) return;\n\t\t\t}\n\n\t\t\tinitAttributes();\n\t\t\tconst geometryAttributes = geometry.attributes;\n\t\t\tconst programAttributes = program.getAttributes();\n\t\t\tconst materialDefaultAttributeValues = material.defaultAttributeValues;\n\n\t\t\tfor (const name in programAttributes) {\n\t\t\t\tconst programAttribute = programAttributes[name];\n\n\t\t\t\tif (programAttribute.location >= 0) {\n\t\t\t\t\tlet geometryAttribute = geometryAttributes[name];\n\n\t\t\t\t\tif (geometryAttribute === undefined) {\n\t\t\t\t\t\tif (name === 'instanceMatrix' && object.instanceMatrix) geometryAttribute = object.instanceMatrix;\n\t\t\t\t\t\tif (name === 'instanceColor' && object.instanceColor) geometryAttribute = object.instanceColor;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (geometryAttribute !== undefined) {\n\t\t\t\t\t\tconst normalized = geometryAttribute.normalized;\n\t\t\t\t\t\tconst size = geometryAttribute.itemSize;\n\t\t\t\t\t\tconst attribute = attributes.get(geometryAttribute); // TODO Attribute may not be available on context restore\n\n\t\t\t\t\t\tif (attribute === undefined) continue;\n\t\t\t\t\t\tconst buffer = attribute.buffer;\n\t\t\t\t\t\tconst type = attribute.type;\n\t\t\t\t\t\tconst bytesPerElement = attribute.bytesPerElement;\n\n\t\t\t\t\t\tif (geometryAttribute.isInterleavedBufferAttribute) {\n\t\t\t\t\t\t\tconst data = geometryAttribute.data;\n\t\t\t\t\t\t\tconst stride = data.stride;\n\t\t\t\t\t\t\tconst offset = geometryAttribute.offset;\n\n\t\t\t\t\t\t\tif (data && data.isInstancedInterleavedBuffer) {\n\t\t\t\t\t\t\t\tfor (let i = 0; i < programAttribute.locationSize; i++) {\n\t\t\t\t\t\t\t\t\tenableAttributeAndDivisor(programAttribute.location + i, data.meshPerAttribute);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (object.isInstancedMesh !== true && geometry._maxInstanceCount === undefined) {\n\t\t\t\t\t\t\t\t\tgeometry._maxInstanceCount = data.meshPerAttribute * data.count;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tfor (let i = 0; i < programAttribute.locationSize; i++) {\n\t\t\t\t\t\t\t\t\tenableAttribute(programAttribute.location + i);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tgl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n\n\t\t\t\t\t\t\tfor (let i = 0; i < programAttribute.locationSize; i++) {\n\t\t\t\t\t\t\t\tvertexAttribPointer(programAttribute.location + i, size / programAttribute.locationSize, type, normalized, stride * bytesPerElement, (offset + size / programAttribute.locationSize * i) * bytesPerElement);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (geometryAttribute.isInstancedBufferAttribute) {\n\t\t\t\t\t\t\t\tfor (let i = 0; i < programAttribute.locationSize; i++) {\n\t\t\t\t\t\t\t\t\tenableAttributeAndDivisor(programAttribute.location + i, geometryAttribute.meshPerAttribute);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (object.isInstancedMesh !== true && geometry._maxInstanceCount === undefined) {\n\t\t\t\t\t\t\t\t\tgeometry._maxInstanceCount = geometryAttribute.meshPerAttribute * geometryAttribute.count;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tfor (let i = 0; i < programAttribute.locationSize; i++) {\n\t\t\t\t\t\t\t\t\tenableAttribute(programAttribute.location + i);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tgl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n\n\t\t\t\t\t\t\tfor (let i = 0; i < programAttribute.locationSize; i++) {\n\t\t\t\t\t\t\t\tvertexAttribPointer(programAttribute.location + i, size / programAttribute.locationSize, type, normalized, size * bytesPerElement, size / programAttribute.locationSize * i * bytesPerElement);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (materialDefaultAttributeValues !== undefined) {\n\t\t\t\t\t\tconst value = materialDefaultAttributeValues[name];\n\n\t\t\t\t\t\tif (value !== undefined) {\n\t\t\t\t\t\t\tswitch (value.length) {\n\t\t\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t\t\tgl.vertexAttrib2fv(programAttribute.location, value);\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\t\t\tgl.vertexAttrib3fv(programAttribute.location, value);\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase 4:\n\t\t\t\t\t\t\t\t\tgl.vertexAttrib4fv(programAttribute.location, value);\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\tgl.vertexAttrib1fv(programAttribute.location, value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tdisableUnusedAttributes();\n\t\t}\n\n\t\tfunction dispose() {\n\t\t\treset();\n\n\t\t\tfor (const geometryId in bindingStates) {\n\t\t\t\tconst programMap = bindingStates[geometryId];\n\n\t\t\t\tfor (const programId in programMap) {\n\t\t\t\t\tconst stateMap = programMap[programId];\n\n\t\t\t\t\tfor (const wireframe in stateMap) {\n\t\t\t\t\t\tdeleteVertexArrayObject(stateMap[wireframe].object);\n\t\t\t\t\t\tdelete stateMap[wireframe];\n\t\t\t\t\t}\n\n\t\t\t\t\tdelete programMap[programId];\n\t\t\t\t}\n\n\t\t\t\tdelete bindingStates[geometryId];\n\t\t\t}\n\t\t}\n\n\t\tfunction releaseStatesOfGeometry(geometry) {\n\t\t\tif (bindingStates[geometry.id] === undefined) return;\n\t\t\tconst programMap = bindingStates[geometry.id];\n\n\t\t\tfor (const programId in programMap) {\n\t\t\t\tconst stateMap = programMap[programId];\n\n\t\t\t\tfor (const wireframe in stateMap) {\n\t\t\t\t\tdeleteVertexArrayObject(stateMap[wireframe].object);\n\t\t\t\t\tdelete stateMap[wireframe];\n\t\t\t\t}\n\n\t\t\t\tdelete programMap[programId];\n\t\t\t}\n\n\t\t\tdelete bindingStates[geometry.id];\n\t\t}\n\n\t\tfunction releaseStatesOfProgram(program) {\n\t\t\tfor (const geometryId in bindingStates) {\n\t\t\t\tconst programMap = bindingStates[geometryId];\n\t\t\t\tif (programMap[program.id] === undefined) continue;\n\t\t\t\tconst stateMap = programMap[program.id];\n\n\t\t\t\tfor (const wireframe in stateMap) {\n\t\t\t\t\tdeleteVertexArrayObject(stateMap[wireframe].object);\n\t\t\t\t\tdelete stateMap[wireframe];\n\t\t\t\t}\n\n\t\t\t\tdelete programMap[program.id];\n\t\t\t}\n\t\t}\n\n\t\tfunction reset() {\n\t\t\tresetDefaultState();\n\t\t\tif (currentState === defaultState) return;\n\t\t\tcurrentState = defaultState;\n\t\t\tbindVertexArrayObject(currentState.object);\n\t\t} // for backward-compatilibity\n\n\n\t\tfunction resetDefaultState() {\n\t\t\tdefaultState.geometry = null;\n\t\t\tdefaultState.program = null;\n\t\t\tdefaultState.wireframe = false;\n\t\t}\n\n\t\treturn {\n\t\t\tsetup: setup,\n\t\t\treset: reset,\n\t\t\tresetDefaultState: resetDefaultState,\n\t\t\tdispose: dispose,\n\t\t\treleaseStatesOfGeometry: releaseStatesOfGeometry,\n\t\t\treleaseStatesOfProgram: releaseStatesOfProgram,\n\t\t\tinitAttributes: initAttributes,\n\t\t\tenableAttribute: enableAttribute,\n\t\t\tdisableUnusedAttributes: disableUnusedAttributes\n\t\t};\n\t}\n\n\tfunction WebGLBufferRenderer(gl, extensions, info, capabilities) {\n\t\tconst isWebGL2 = capabilities.isWebGL2;\n\t\tlet mode;\n\n\t\tfunction setMode(value) {\n\t\t\tmode = value;\n\t\t}\n\n\t\tfunction render(start, count) {\n\t\t\tgl.drawArrays(mode, start, count);\n\t\t\tinfo.update(count, mode, 1);\n\t\t}\n\n\t\tfunction renderInstances(start, count, primcount) {\n\t\t\tif (primcount === 0) return;\n\t\t\tlet extension, methodName;\n\n\t\t\tif (isWebGL2) {\n\t\t\t\textension = gl;\n\t\t\t\tmethodName = 'drawArraysInstanced';\n\t\t\t} else {\n\t\t\t\textension = extensions.get('ANGLE_instanced_arrays');\n\t\t\t\tmethodName = 'drawArraysInstancedANGLE';\n\n\t\t\t\tif (extension === null) {\n\t\t\t\t\tconsole.error('THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\textension[methodName](mode, start, count, primcount);\n\t\t\tinfo.update(count, mode, primcount);\n\t\t} //\n\n\n\t\tthis.setMode = setMode;\n\t\tthis.render = render;\n\t\tthis.renderInstances = renderInstances;\n\t}\n\n\tfunction WebGLCapabilities(gl, extensions, parameters) {\n\t\tlet maxAnisotropy;\n\n\t\tfunction getMaxAnisotropy() {\n\t\t\tif (maxAnisotropy !== undefined) return maxAnisotropy;\n\n\t\t\tif (extensions.has('EXT_texture_filter_anisotropic') === true) {\n\t\t\t\tconst extension = extensions.get('EXT_texture_filter_anisotropic');\n\t\t\t\tmaxAnisotropy = gl.getParameter(extension.MAX_TEXTURE_MAX_ANISOTROPY_EXT);\n\t\t\t} else {\n\t\t\t\tmaxAnisotropy = 0;\n\t\t\t}\n\n\t\t\treturn maxAnisotropy;\n\t\t}\n\n\t\tfunction getMaxPrecision(precision) {\n\t\t\tif (precision === 'highp') {\n\t\t\t\tif (gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.HIGH_FLOAT).precision > 0 && gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_FLOAT).precision > 0) {\n\t\t\t\t\treturn 'highp';\n\t\t\t\t}\n\n\t\t\t\tprecision = 'mediump';\n\t\t\t}\n\n\t\t\tif (precision === 'mediump') {\n\t\t\t\tif (gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.MEDIUM_FLOAT).precision > 0 && gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.MEDIUM_FLOAT).precision > 0) {\n\t\t\t\t\treturn 'mediump';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn 'lowp';\n\t\t}\n\t\t/* eslint-disable no-undef */\n\n\n\t\tconst isWebGL2 = typeof WebGL2RenderingContext !== 'undefined' && gl instanceof WebGL2RenderingContext || typeof WebGL2ComputeRenderingContext !== 'undefined' && gl instanceof WebGL2ComputeRenderingContext;\n\t\t/* eslint-enable no-undef */\n\n\t\tlet precision = parameters.precision !== undefined ? parameters.precision : 'highp';\n\t\tconst maxPrecision = getMaxPrecision(precision);\n\n\t\tif (maxPrecision !== precision) {\n\t\t\tconsole.warn('THREE.WebGLRenderer:', precision, 'not supported, using', maxPrecision, 'instead.');\n\t\t\tprecision = maxPrecision;\n\t\t}\n\n\t\tconst drawBuffers = isWebGL2 || extensions.has('WEBGL_draw_buffers');\n\t\tconst logarithmicDepthBuffer = parameters.logarithmicDepthBuffer === true;\n\t\tconst maxTextures = gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS);\n\t\tconst maxVertexTextures = gl.getParameter(gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS);\n\t\tconst maxTextureSize = gl.getParameter(gl.MAX_TEXTURE_SIZE);\n\t\tconst maxCubemapSize = gl.getParameter(gl.MAX_CUBE_MAP_TEXTURE_SIZE);\n\t\tconst maxAttributes = gl.getParameter(gl.MAX_VERTEX_ATTRIBS);\n\t\tconst maxVertexUniforms = gl.getParameter(gl.MAX_VERTEX_UNIFORM_VECTORS);\n\t\tconst maxVaryings = gl.getParameter(gl.MAX_VARYING_VECTORS);\n\t\tconst maxFragmentUniforms = gl.getParameter(gl.MAX_FRAGMENT_UNIFORM_VECTORS);\n\t\tconst vertexTextures = maxVertexTextures > 0;\n\t\tconst floatFragmentTextures = isWebGL2 || extensions.has('OES_texture_float');\n\t\tconst floatVertexTextures = vertexTextures && floatFragmentTextures;\n\t\tconst maxSamples = isWebGL2 ? gl.getParameter(gl.MAX_SAMPLES) : 0;\n\t\treturn {\n\t\t\tisWebGL2: isWebGL2,\n\t\t\tdrawBuffers: drawBuffers,\n\t\t\tgetMaxAnisotropy: getMaxAnisotropy,\n\t\t\tgetMaxPrecision: getMaxPrecision,\n\t\t\tprecision: precision,\n\t\t\tlogarithmicDepthBuffer: logarithmicDepthBuffer,\n\t\t\tmaxTextures: maxTextures,\n\t\t\tmaxVertexTextures: maxVertexTextures,\n\t\t\tmaxTextureSize: maxTextureSize,\n\t\t\tmaxCubemapSize: maxCubemapSize,\n\t\t\tmaxAttributes: maxAttributes,\n\t\t\tmaxVertexUniforms: maxVertexUniforms,\n\t\t\tmaxVaryings: maxVaryings,\n\t\t\tmaxFragmentUniforms: maxFragmentUniforms,\n\t\t\tvertexTextures: vertexTextures,\n\t\t\tfloatFragmentTextures: floatFragmentTextures,\n\t\t\tfloatVertexTextures: floatVertexTextures,\n\t\t\tmaxSamples: maxSamples\n\t\t};\n\t}\n\n\tfunction WebGLClipping(properties) {\n\t\tconst scope = this;\n\t\tlet globalState = null,\n\t\t\t\tnumGlobalPlanes = 0,\n\t\t\t\tlocalClippingEnabled = false,\n\t\t\t\trenderingShadows = false;\n\t\tconst plane = new Plane(),\n\t\t\t\t\tviewNormalMatrix = new Matrix3(),\n\t\t\t\t\tuniform = {\n\t\t\tvalue: null,\n\t\t\tneedsUpdate: false\n\t\t};\n\t\tthis.uniform = uniform;\n\t\tthis.numPlanes = 0;\n\t\tthis.numIntersection = 0;\n\n\t\tthis.init = function (planes, enableLocalClipping, camera) {\n\t\t\tconst enabled = planes.length !== 0 || enableLocalClipping || // enable state of previous frame - the clipping code has to\n\t\t\t// run another frame in order to reset the state:\n\t\t\tnumGlobalPlanes !== 0 || localClippingEnabled;\n\t\t\tlocalClippingEnabled = enableLocalClipping;\n\t\t\tglobalState = projectPlanes(planes, camera, 0);\n\t\t\tnumGlobalPlanes = planes.length;\n\t\t\treturn enabled;\n\t\t};\n\n\t\tthis.beginShadows = function () {\n\t\t\trenderingShadows = true;\n\t\t\tprojectPlanes(null);\n\t\t};\n\n\t\tthis.endShadows = function () {\n\t\t\trenderingShadows = false;\n\t\t\tresetGlobalState();\n\t\t};\n\n\t\tthis.setState = function (material, camera, useCache) {\n\t\t\tconst planes = material.clippingPlanes,\n\t\t\t\t\t\tclipIntersection = material.clipIntersection,\n\t\t\t\t\t\tclipShadows = material.clipShadows;\n\t\t\tconst materialProperties = properties.get(material);\n\n\t\t\tif (!localClippingEnabled || planes === null || planes.length === 0 || renderingShadows && !clipShadows) {\n\t\t\t\t// there's no local clipping\n\t\t\t\tif (renderingShadows) {\n\t\t\t\t\t// there's no global clipping\n\t\t\t\t\tprojectPlanes(null);\n\t\t\t\t} else {\n\t\t\t\t\tresetGlobalState();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst nGlobal = renderingShadows ? 0 : numGlobalPlanes,\n\t\t\t\t\t\t\tlGlobal = nGlobal * 4;\n\t\t\t\tlet dstArray = materialProperties.clippingState || null;\n\t\t\t\tuniform.value = dstArray; // ensure unique state\n\n\t\t\t\tdstArray = projectPlanes(planes, camera, lGlobal, useCache);\n\n\t\t\t\tfor (let i = 0; i !== lGlobal; ++i) {\n\t\t\t\t\tdstArray[i] = globalState[i];\n\t\t\t\t}\n\n\t\t\t\tmaterialProperties.clippingState = dstArray;\n\t\t\t\tthis.numIntersection = clipIntersection ? this.numPlanes : 0;\n\t\t\t\tthis.numPlanes += nGlobal;\n\t\t\t}\n\t\t};\n\n\t\tfunction resetGlobalState() {\n\t\t\tif (uniform.value !== globalState) {\n\t\t\t\tuniform.value = globalState;\n\t\t\t\tuniform.needsUpdate = numGlobalPlanes > 0;\n\t\t\t}\n\n\t\t\tscope.numPlanes = numGlobalPlanes;\n\t\t\tscope.numIntersection = 0;\n\t\t}\n\n\t\tfunction projectPlanes(planes, camera, dstOffset, skipTransform) {\n\t\t\tconst nPlanes = planes !== null ? planes.length : 0;\n\t\t\tlet dstArray = null;\n\n\t\t\tif (nPlanes !== 0) {\n\t\t\t\tdstArray = uniform.value;\n\n\t\t\t\tif (skipTransform !== true || dstArray === null) {\n\t\t\t\t\tconst flatSize = dstOffset + nPlanes * 4,\n\t\t\t\t\t\t\t\tviewMatrix = camera.matrixWorldInverse;\n\t\t\t\t\tviewNormalMatrix.getNormalMatrix(viewMatrix);\n\n\t\t\t\t\tif (dstArray === null || dstArray.length < flatSize) {\n\t\t\t\t\t\tdstArray = new Float32Array(flatSize);\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (let i = 0, i4 = dstOffset; i !== nPlanes; ++i, i4 += 4) {\n\t\t\t\t\t\tplane.copy(planes[i]).applyMatrix4(viewMatrix, viewNormalMatrix);\n\t\t\t\t\t\tplane.normal.toArray(dstArray, i4);\n\t\t\t\t\t\tdstArray[i4 + 3] = plane.constant;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tuniform.value = dstArray;\n\t\t\t\tuniform.needsUpdate = true;\n\t\t\t}\n\n\t\t\tscope.numPlanes = nPlanes;\n\t\t\tscope.numIntersection = 0;\n\t\t\treturn dstArray;\n\t\t}\n\t}\n\n\tfunction WebGLCubeMaps(renderer) {\n\t\tlet cubemaps = new WeakMap();\n\n\t\tfunction mapTextureMapping(texture, mapping) {\n\t\t\tif (mapping === EquirectangularReflectionMapping) {\n\t\t\t\ttexture.mapping = CubeReflectionMapping;\n\t\t\t} else if (mapping === EquirectangularRefractionMapping) {\n\t\t\t\ttexture.mapping = CubeRefractionMapping;\n\t\t\t}\n\n\t\t\treturn texture;\n\t\t}\n\n\t\tfunction get(texture) {\n\t\t\tif (texture && texture.isTexture && texture.isRenderTargetTexture === false) {\n\t\t\t\tconst mapping = texture.mapping;\n\n\t\t\t\tif (mapping === EquirectangularReflectionMapping || mapping === EquirectangularRefractionMapping) {\n\t\t\t\t\tif (cubemaps.has(texture)) {\n\t\t\t\t\t\tconst cubemap = cubemaps.get(texture).texture;\n\t\t\t\t\t\treturn mapTextureMapping(cubemap, texture.mapping);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst image = texture.image;\n\n\t\t\t\t\t\tif (image && image.height > 0) {\n\t\t\t\t\t\t\tconst currentRenderTarget = renderer.getRenderTarget();\n\t\t\t\t\t\t\tconst renderTarget = new WebGLCubeRenderTarget(image.height / 2);\n\t\t\t\t\t\t\trenderTarget.fromEquirectangularTexture(renderer, texture);\n\t\t\t\t\t\t\tcubemaps.set(texture, renderTarget);\n\t\t\t\t\t\t\trenderer.setRenderTarget(currentRenderTarget);\n\t\t\t\t\t\t\ttexture.addEventListener('dispose', onTextureDispose);\n\t\t\t\t\t\t\treturn mapTextureMapping(renderTarget.texture, texture.mapping);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// image not yet ready. try the conversion next frame\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn texture;\n\t\t}\n\n\t\tfunction onTextureDispose(event) {\n\t\t\tconst texture = event.target;\n\t\t\ttexture.removeEventListener('dispose', onTextureDispose);\n\t\t\tconst cubemap = cubemaps.get(texture);\n\n\t\t\tif (cubemap !== undefined) {\n\t\t\t\tcubemaps.delete(texture);\n\t\t\t\tcubemap.dispose();\n\t\t\t}\n\t\t}\n\n\t\tfunction dispose() {\n\t\t\tcubemaps = new WeakMap();\n\t\t}\n\n\t\treturn {\n\t\t\tget: get,\n\t\t\tdispose: dispose\n\t\t};\n\t}\n\n\tclass OrthographicCamera extends Camera {\n\t\tconstructor(left = -1, right = 1, top = 1, bottom = -1, near = 0.1, far = 2000) {\n\t\t\tsuper();\n\t\t\tthis.type = 'OrthographicCamera';\n\t\t\tthis.zoom = 1;\n\t\t\tthis.view = null;\n\t\t\tthis.left = left;\n\t\t\tthis.right = right;\n\t\t\tthis.top = top;\n\t\t\tthis.bottom = bottom;\n\t\t\tthis.near = near;\n\t\t\tthis.far = far;\n\t\t\tthis.updateProjectionMatrix();\n\t\t}\n\n\t\tcopy(source, recursive) {\n\t\t\tsuper.copy(source, recursive);\n\t\t\tthis.left = source.left;\n\t\t\tthis.right = source.right;\n\t\t\tthis.top = source.top;\n\t\t\tthis.bottom = source.bottom;\n\t\t\tthis.near = source.near;\n\t\t\tthis.far = source.far;\n\t\t\tthis.zoom = source.zoom;\n\t\t\tthis.view = source.view === null ? null : Object.assign({}, source.view);\n\t\t\treturn this;\n\t\t}\n\n\t\tsetViewOffset(fullWidth, fullHeight, x, y, width, height) {\n\t\t\tif (this.view === null) {\n\t\t\t\tthis.view = {\n\t\t\t\t\tenabled: true,\n\t\t\t\t\tfullWidth: 1,\n\t\t\t\t\tfullHeight: 1,\n\t\t\t\t\toffsetX: 0,\n\t\t\t\t\toffsetY: 0,\n\t\t\t\t\twidth: 1,\n\t\t\t\t\theight: 1\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tthis.view.enabled = true;\n\t\t\tthis.view.fullWidth = fullWidth;\n\t\t\tthis.view.fullHeight = fullHeight;\n\t\t\tthis.view.offsetX = x;\n\t\t\tthis.view.offsetY = y;\n\t\t\tthis.view.width = width;\n\t\t\tthis.view.height = height;\n\t\t\tthis.updateProjectionMatrix();\n\t\t}\n\n\t\tclearViewOffset() {\n\t\t\tif (this.view !== null) {\n\t\t\t\tthis.view.enabled = false;\n\t\t\t}\n\n\t\t\tthis.updateProjectionMatrix();\n\t\t}\n\n\t\tupdateProjectionMatrix() {\n\t\t\tconst dx = (this.right - this.left) / (2 * this.zoom);\n\t\t\tconst dy = (this.top - this.bottom) / (2 * this.zoom);\n\t\t\tconst cx = (this.right + this.left) / 2;\n\t\t\tconst cy = (this.top + this.bottom) / 2;\n\t\t\tlet left = cx - dx;\n\t\t\tlet right = cx + dx;\n\t\t\tlet top = cy + dy;\n\t\t\tlet bottom = cy - dy;\n\n\t\t\tif (this.view !== null && this.view.enabled) {\n\t\t\t\tconst scaleW = (this.right - this.left) / this.view.fullWidth / this.zoom;\n\t\t\t\tconst scaleH = (this.top - this.bottom) / this.view.fullHeight / this.zoom;\n\t\t\t\tleft += scaleW * this.view.offsetX;\n\t\t\t\tright = left + scaleW * this.view.width;\n\t\t\t\ttop -= scaleH * this.view.offsetY;\n\t\t\t\tbottom = top - scaleH * this.view.height;\n\t\t\t}\n\n\t\t\tthis.projectionMatrix.makeOrthographic(left, right, top, bottom, this.near, this.far);\n\t\t\tthis.projectionMatrixInverse.copy(this.projectionMatrix).invert();\n\t\t}\n\n\t\ttoJSON(meta) {\n\t\t\tconst data = super.toJSON(meta);\n\t\t\tdata.object.zoom = this.zoom;\n\t\t\tdata.object.left = this.left;\n\t\t\tdata.object.right = this.right;\n\t\t\tdata.object.top = this.top;\n\t\t\tdata.object.bottom = this.bottom;\n\t\t\tdata.object.near = this.near;\n\t\t\tdata.object.far = this.far;\n\t\t\tif (this.view !== null) data.object.view = Object.assign({}, this.view);\n\t\t\treturn data;\n\t\t}\n\n\t}\n\n\tOrthographicCamera.prototype.isOrthographicCamera = true;\n\n\tclass RawShaderMaterial extends ShaderMaterial {\n\t\tconstructor(parameters) {\n\t\t\tsuper(parameters);\n\t\t\tthis.type = 'RawShaderMaterial';\n\t\t}\n\n\t}\n\n\tRawShaderMaterial.prototype.isRawShaderMaterial = true;\n\n\tconst LOD_MIN = 4;\n\tconst LOD_MAX = 8;\n\tconst SIZE_MAX = Math.pow(2, LOD_MAX); // The standard deviations (radians) associated with the extra mips. These are\n\t// chosen to approximate a Trowbridge-Reitz distribution function times the\n\t// geometric shadowing function. These sigma values squared must match the\n\t// variance #defines in cube_uv_reflection_fragment.glsl.js.\n\n\tconst EXTRA_LOD_SIGMA = [0.125, 0.215, 0.35, 0.446, 0.526, 0.582];\n\tconst TOTAL_LODS = LOD_MAX - LOD_MIN + 1 + EXTRA_LOD_SIGMA.length; // The maximum length of the blur for loop. Smaller sigmas will use fewer\n\t// samples and exit early, but not recompile the shader.\n\n\tconst MAX_SAMPLES = 20;\n\tconst ENCODINGS = {\n\t\t[LinearEncoding]: 0,\n\t\t[sRGBEncoding]: 1,\n\t\t[RGBEEncoding]: 2,\n\t\t[RGBM7Encoding]: 3,\n\t\t[RGBM16Encoding]: 4,\n\t\t[RGBDEncoding]: 5,\n\t\t[GammaEncoding]: 6\n\t};\n\n\tconst _flatCamera = /*@__PURE__*/new OrthographicCamera();\n\n\tconst {\n\t\t_lodPlanes,\n\t\t_sizeLods,\n\t\t_sigmas\n\t} = /*@__PURE__*/_createPlanes();\n\n\tconst _clearColor = /*@__PURE__*/new Color();\n\n\tlet _oldTarget = null; // Golden Ratio\n\n\tconst PHI = (1 + Math.sqrt(5)) / 2;\n\tconst INV_PHI = 1 / PHI; // Vertices of a dodecahedron (except the opposites, which represent the\n\t// same axis), used as axis directions evenly spread on a sphere.\n\n\tconst _axisDirections = [/*@__PURE__*/new Vector3(1, 1, 1), /*@__PURE__*/new Vector3(-1, 1, 1), /*@__PURE__*/new Vector3(1, 1, -1), /*@__PURE__*/new Vector3(-1, 1, -1), /*@__PURE__*/new Vector3(0, PHI, INV_PHI), /*@__PURE__*/new Vector3(0, PHI, -INV_PHI), /*@__PURE__*/new Vector3(INV_PHI, 0, PHI), /*@__PURE__*/new Vector3(-INV_PHI, 0, PHI), /*@__PURE__*/new Vector3(PHI, INV_PHI, 0), /*@__PURE__*/new Vector3(-PHI, INV_PHI, 0)];\n\t/**\n\t * This class generates a Prefiltered, Mipmapped Radiance Environment Map\n\t * (PMREM) from a cubeMap environment texture. This allows different levels of\n\t * blur to be quickly accessed based on material roughness. It is packed into a\n\t * special CubeUV format that allows us to perform custom interpolation so that\n\t * we can support nonlinear formats such as RGBE. Unlike a traditional mipmap\n\t * chain, it only goes down to the LOD_MIN level (above), and then creates extra\n\t * even more filtered 'mips' at the same LOD_MIN resolution, associated with\n\t * higher roughness levels. In this way we maintain resolution to smoothly\n\t * interpolate diffuse lighting while limiting sampling computation.\n\t *\n\t * Paper: Fast, Accurate Image-Based Lighting\n\t * https://drive.google.com/file/d/15y8r_UpKlU9SvV4ILb0C3qCPecS8pvLz/view\n\t*/\n\n\tclass PMREMGenerator {\n\t\tconstructor(renderer) {\n\t\t\tthis._renderer = renderer;\n\t\t\tthis._pingPongRenderTarget = null;\n\t\t\tthis._blurMaterial = _getBlurShader(MAX_SAMPLES);\n\t\t\tthis._equirectShader = null;\n\t\t\tthis._cubemapShader = null;\n\n\t\t\tthis._compileMaterial(this._blurMaterial);\n\t\t}\n\t\t/**\n\t\t * Generates a PMREM from a supplied Scene, which can be faster than using an\n\t\t * image if networking bandwidth is low. Optional sigma specifies a blur radius\n\t\t * in radians to be applied to the scene before PMREM generation. Optional near\n\t\t * and far planes ensure the scene is rendered in its entirety (the cubeCamera\n\t\t * is placed at the origin).\n\t\t */\n\n\n\t\tfromScene(scene, sigma = 0, near = 0.1, far = 100) {\n\t\t\t_oldTarget = this._renderer.getRenderTarget();\n\n\t\t\tconst cubeUVRenderTarget = this._allocateTargets();\n\n\t\t\tthis._sceneToCubeUV(scene, near, far, cubeUVRenderTarget);\n\n\t\t\tif (sigma > 0) {\n\t\t\t\tthis._blur(cubeUVRenderTarget, 0, 0, sigma);\n\t\t\t}\n\n\t\t\tthis._applyPMREM(cubeUVRenderTarget);\n\n\t\t\tthis._cleanup(cubeUVRenderTarget);\n\n\t\t\treturn cubeUVRenderTarget;\n\t\t}\n\t\t/**\n\t\t * Generates a PMREM from an equirectangular texture, which can be either LDR\n\t\t * (RGBFormat) or HDR (RGBEFormat). The ideal input image size is 1k (1024 x 512),\n\t\t * as this matches best with the 256 x 256 cubemap output.\n\t\t */\n\n\n\t\tfromEquirectangular(equirectangular) {\n\t\t\treturn this._fromTexture(equirectangular);\n\t\t}\n\t\t/**\n\t\t * Generates a PMREM from an cubemap texture, which can be either LDR\n\t\t * (RGBFormat) or HDR (RGBEFormat). The ideal input cube size is 256 x 256,\n\t\t * as this matches best with the 256 x 256 cubemap output.\n\t\t */\n\n\n\t\tfromCubemap(cubemap) {\n\t\t\treturn this._fromTexture(cubemap);\n\t\t}\n\t\t/**\n\t\t * Pre-compiles the cubemap shader. You can get faster start-up by invoking this method during\n\t\t * your texture's network fetch for increased concurrency.\n\t\t */\n\n\n\t\tcompileCubemapShader() {\n\t\t\tif (this._cubemapShader === null) {\n\t\t\t\tthis._cubemapShader = _getCubemapShader();\n\n\t\t\t\tthis._compileMaterial(this._cubemapShader);\n\t\t\t}\n\t\t}\n\t\t/**\n\t\t * Pre-compiles the equirectangular shader. You can get faster start-up by invoking this method during\n\t\t * your texture's network fetch for increased concurrency.\n\t\t */\n\n\n\t\tcompileEquirectangularShader() {\n\t\t\tif (this._equirectShader === null) {\n\t\t\t\tthis._equirectShader = _getEquirectShader();\n\n\t\t\t\tthis._compileMaterial(this._equirectShader);\n\t\t\t}\n\t\t}\n\t\t/**\n\t\t * Disposes of the PMREMGenerator's internal memory. Note that PMREMGenerator is a static class,\n\t\t * so you should not need more than one PMREMGenerator object. If you do, calling dispose() on\n\t\t * one of them will cause any others to also become unusable.\n\t\t */\n\n\n\t\tdispose() {\n\t\t\tthis._blurMaterial.dispose();\n\n\t\t\tif (this._cubemapShader !== null) this._cubemapShader.dispose();\n\t\t\tif (this._equirectShader !== null) this._equirectShader.dispose();\n\n\t\t\tfor (let i = 0; i < _lodPlanes.length; i++) {\n\t\t\t\t_lodPlanes[i].dispose();\n\t\t\t}\n\t\t} // private interface\n\n\n\t\t_cleanup(outputTarget) {\n\t\t\tthis._pingPongRenderTarget.dispose();\n\n\t\t\tthis._renderer.setRenderTarget(_oldTarget);\n\n\t\t\toutputTarget.scissorTest = false;\n\n\t\t\t_setViewport(outputTarget, 0, 0, outputTarget.width, outputTarget.height);\n\t\t}\n\n\t\t_fromTexture(texture) {\n\t\t\t_oldTarget = this._renderer.getRenderTarget();\n\n\t\t\tconst cubeUVRenderTarget = this._allocateTargets(texture);\n\n\t\t\tthis._textureToCubeUV(texture, cubeUVRenderTarget);\n\n\t\t\tthis._applyPMREM(cubeUVRenderTarget);\n\n\t\t\tthis._cleanup(cubeUVRenderTarget);\n\n\t\t\treturn cubeUVRenderTarget;\n\t\t}\n\n\t\t_allocateTargets(texture) {\n\t\t\t// warning: null texture is valid\n\t\t\tconst params = {\n\t\t\t\tmagFilter: NearestFilter,\n\t\t\t\tminFilter: NearestFilter,\n\t\t\t\tgenerateMipmaps: false,\n\t\t\t\ttype: UnsignedByteType,\n\t\t\t\tformat: RGBEFormat,\n\t\t\t\tencoding: _isLDR(texture) ? texture.encoding : RGBEEncoding,\n\t\t\t\tdepthBuffer: false\n\t\t\t};\n\n\t\t\tconst cubeUVRenderTarget = _createRenderTarget(params);\n\n\t\t\tcubeUVRenderTarget.depthBuffer = texture ? false : true;\n\t\t\tthis._pingPongRenderTarget = _createRenderTarget(params);\n\t\t\treturn cubeUVRenderTarget;\n\t\t}\n\n\t\t_compileMaterial(material) {\n\t\t\tconst tmpMesh = new Mesh(_lodPlanes[0], material);\n\n\t\t\tthis._renderer.compile(tmpMesh, _flatCamera);\n\t\t}\n\n\t\t_sceneToCubeUV(scene, near, far, cubeUVRenderTarget) {\n\t\t\tconst fov = 90;\n\t\t\tconst aspect = 1;\n\t\t\tconst cubeCamera = new PerspectiveCamera(fov, aspect, near, far);\n\t\t\tconst upSign = [1, -1, 1, 1, 1, 1];\n\t\t\tconst forwardSign = [1, 1, 1, -1, -1, -1];\n\t\t\tconst renderer = this._renderer;\n\t\t\tconst originalAutoClear = renderer.autoClear;\n\t\t\tconst outputEncoding = renderer.outputEncoding;\n\t\t\tconst toneMapping = renderer.toneMapping;\n\t\t\trenderer.getClearColor(_clearColor);\n\t\t\trenderer.toneMapping = NoToneMapping;\n\t\t\trenderer.outputEncoding = LinearEncoding;\n\t\t\trenderer.autoClear = false;\n\t\t\tconst backgroundMaterial = new MeshBasicMaterial({\n\t\t\t\tname: 'PMREM.Background',\n\t\t\t\tside: BackSide,\n\t\t\t\tdepthWrite: false,\n\t\t\t\tdepthTest: false\n\t\t\t});\n\t\t\tconst backgroundBox = new Mesh(new BoxGeometry(), backgroundMaterial);\n\t\t\tlet useSolidColor = false;\n\t\t\tconst background = scene.background;\n\n\t\t\tif (background) {\n\t\t\t\tif (background.isColor) {\n\t\t\t\t\tbackgroundMaterial.color.copy(background);\n\t\t\t\t\tscene.background = null;\n\t\t\t\t\tuseSolidColor = true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tbackgroundMaterial.color.copy(_clearColor);\n\t\t\t\tuseSolidColor = true;\n\t\t\t}\n\n\t\t\tfor (let i = 0; i < 6; i++) {\n\t\t\t\tconst col = i % 3;\n\n\t\t\t\tif (col == 0) {\n\t\t\t\t\tcubeCamera.up.set(0, upSign[i], 0);\n\t\t\t\t\tcubeCamera.lookAt(forwardSign[i], 0, 0);\n\t\t\t\t} else if (col == 1) {\n\t\t\t\t\tcubeCamera.up.set(0, 0, upSign[i]);\n\t\t\t\t\tcubeCamera.lookAt(0, forwardSign[i], 0);\n\t\t\t\t} else {\n\t\t\t\t\tcubeCamera.up.set(0, upSign[i], 0);\n\t\t\t\t\tcubeCamera.lookAt(0, 0, forwardSign[i]);\n\t\t\t\t}\n\n\t\t\t\t_setViewport(cubeUVRenderTarget, col * SIZE_MAX, i > 2 ? SIZE_MAX : 0, SIZE_MAX, SIZE_MAX);\n\n\t\t\t\trenderer.setRenderTarget(cubeUVRenderTarget);\n\n\t\t\t\tif (useSolidColor) {\n\t\t\t\t\trenderer.render(backgroundBox, cubeCamera);\n\t\t\t\t}\n\n\t\t\t\trenderer.render(scene, cubeCamera);\n\t\t\t}\n\n\t\t\tbackgroundBox.geometry.dispose();\n\t\t\tbackgroundBox.material.dispose();\n\t\t\trenderer.toneMapping = toneMapping;\n\t\t\trenderer.outputEncoding = outputEncoding;\n\t\t\trenderer.autoClear = originalAutoClear;\n\t\t\tscene.background = background;\n\t\t}\n\n\t\t_setEncoding(uniform, texture) {\n\t\t\tif (this._renderer.capabilities.isWebGL2 === true && texture.format === RGBAFormat && texture.type === UnsignedByteType && texture.encoding === sRGBEncoding) {\n\t\t\t\tuniform.value = ENCODINGS[LinearEncoding];\n\t\t\t} else {\n\t\t\t\tuniform.value = ENCODINGS[texture.encoding];\n\t\t\t}\n\t\t}\n\n\t\t_textureToCubeUV(texture, cubeUVRenderTarget) {\n\t\t\tconst renderer = this._renderer;\n\n\t\t\tif (texture.isCubeTexture) {\n\t\t\t\tif (this._cubemapShader == null) {\n\t\t\t\t\tthis._cubemapShader = _getCubemapShader();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (this._equirectShader == null) {\n\t\t\t\t\tthis._equirectShader = _getEquirectShader();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst material = texture.isCubeTexture ? this._cubemapShader : this._equirectShader;\n\t\t\tconst mesh = new Mesh(_lodPlanes[0], material);\n\t\t\tconst uniforms = material.uniforms;\n\t\t\tuniforms['envMap'].value = texture;\n\n\t\t\tif (!texture.isCubeTexture) {\n\t\t\t\tuniforms['texelSize'].value.set(1.0 / texture.image.width, 1.0 / texture.image.height);\n\t\t\t}\n\n\t\t\tthis._setEncoding(uniforms['inputEncoding'], texture);\n\n\t\t\tthis._setEncoding(uniforms['outputEncoding'], cubeUVRenderTarget.texture);\n\n\t\t\t_setViewport(cubeUVRenderTarget, 0, 0, 3 * SIZE_MAX, 2 * SIZE_MAX);\n\n\t\t\trenderer.setRenderTarget(cubeUVRenderTarget);\n\t\t\trenderer.render(mesh, _flatCamera);\n\t\t}\n\n\t\t_applyPMREM(cubeUVRenderTarget) {\n\t\t\tconst renderer = this._renderer;\n\t\t\tconst autoClear = renderer.autoClear;\n\t\t\trenderer.autoClear = false;\n\n\t\t\tfor (let i = 1; i < TOTAL_LODS; i++) {\n\t\t\t\tconst sigma = Math.sqrt(_sigmas[i] * _sigmas[i] - _sigmas[i - 1] * _sigmas[i - 1]);\n\t\t\t\tconst poleAxis = _axisDirections[(i - 1) % _axisDirections.length];\n\n\t\t\t\tthis._blur(cubeUVRenderTarget, i - 1, i, sigma, poleAxis);\n\t\t\t}\n\n\t\t\trenderer.autoClear = autoClear;\n\t\t}\n\t\t/**\n\t\t * This is a two-pass Gaussian blur for a cubemap. Normally this is done\n\t\t * vertically and horizontally, but this breaks down on a cube. Here we apply\n\t\t * the blur latitudinally (around the poles), and then longitudinally (towards\n\t\t * the poles) to approximate the orthogonally-separable blur. It is least\n\t\t * accurate at the poles, but still does a decent job.\n\t\t */\n\n\n\t\t_blur(cubeUVRenderTarget, lodIn, lodOut, sigma, poleAxis) {\n\t\t\tconst pingPongRenderTarget = this._pingPongRenderTarget;\n\n\t\t\tthis._halfBlur(cubeUVRenderTarget, pingPongRenderTarget, lodIn, lodOut, sigma, 'latitudinal', poleAxis);\n\n\t\t\tthis._halfBlur(pingPongRenderTarget, cubeUVRenderTarget, lodOut, lodOut, sigma, 'longitudinal', poleAxis);\n\t\t}\n\n\t\t_halfBlur(targetIn, targetOut, lodIn, lodOut, sigmaRadians, direction, poleAxis) {\n\t\t\tconst renderer = this._renderer;\n\t\t\tconst blurMaterial = this._blurMaterial;\n\n\t\t\tif (direction !== 'latitudinal' && direction !== 'longitudinal') {\n\t\t\t\tconsole.error('blur direction must be either latitudinal or longitudinal!');\n\t\t\t} // Number of standard deviations at which to cut off the discrete approximation.\n\n\n\t\t\tconst STANDARD_DEVIATIONS = 3;\n\t\t\tconst blurMesh = new Mesh(_lodPlanes[lodOut], blurMaterial);\n\t\t\tconst blurUniforms = blurMaterial.uniforms;\n\t\t\tconst pixels = _sizeLods[lodIn] - 1;\n\t\t\tconst radiansPerPixel = isFinite(sigmaRadians) ? Math.PI / (2 * pixels) : 2 * Math.PI / (2 * MAX_SAMPLES - 1);\n\t\t\tconst sigmaPixels = sigmaRadians / radiansPerPixel;\n\t\t\tconst samples = isFinite(sigmaRadians) ? 1 + Math.floor(STANDARD_DEVIATIONS * sigmaPixels) : MAX_SAMPLES;\n\n\t\t\tif (samples > MAX_SAMPLES) {\n\t\t\t\tconsole.warn(`sigmaRadians, ${sigmaRadians}, is too large and will clip, as it requested ${samples} samples when the maximum is set to ${MAX_SAMPLES}`);\n\t\t\t}\n\n\t\t\tconst weights = [];\n\t\t\tlet sum = 0;\n\n\t\t\tfor (let i = 0; i < MAX_SAMPLES; ++i) {\n\t\t\t\tconst x = i / sigmaPixels;\n\t\t\t\tconst weight = Math.exp(-x * x / 2);\n\t\t\t\tweights.push(weight);\n\n\t\t\t\tif (i == 0) {\n\t\t\t\t\tsum += weight;\n\t\t\t\t} else if (i < samples) {\n\t\t\t\t\tsum += 2 * weight;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (let i = 0; i < weights.length; i++) {\n\t\t\t\tweights[i] = weights[i] / sum;\n\t\t\t}\n\n\t\t\tblurUniforms['envMap'].value = targetIn.texture;\n\t\t\tblurUniforms['samples'].value = samples;\n\t\t\tblurUniforms['weights'].value = weights;\n\t\t\tblurUniforms['latitudinal'].value = direction === 'latitudinal';\n\n\t\t\tif (poleAxis) {\n\t\t\t\tblurUniforms['poleAxis'].value = poleAxis;\n\t\t\t}\n\n\t\t\tblurUniforms['dTheta'].value = radiansPerPixel;\n\t\t\tblurUniforms['mipInt'].value = LOD_MAX - lodIn;\n\n\t\t\tthis._setEncoding(blurUniforms['inputEncoding'], targetIn.texture);\n\n\t\t\tthis._setEncoding(blurUniforms['outputEncoding'], targetIn.texture);\n\n\t\t\tconst outputSize = _sizeLods[lodOut];\n\t\t\tconst x = 3 * Math.max(0, SIZE_MAX - 2 * outputSize);\n\t\t\tconst y = (lodOut === 0 ? 0 : 2 * SIZE_MAX) + 2 * outputSize * (lodOut > LOD_MAX - LOD_MIN ? lodOut - LOD_MAX + LOD_MIN : 0);\n\n\t\t\t_setViewport(targetOut, x, y, 3 * outputSize, 2 * outputSize);\n\n\t\t\trenderer.setRenderTarget(targetOut);\n\t\t\trenderer.render(blurMesh, _flatCamera);\n\t\t}\n\n\t}\n\n\tfunction _isLDR(texture) {\n\t\tif (texture === undefined || texture.type !== UnsignedByteType) return false;\n\t\treturn texture.encoding === LinearEncoding || texture.encoding === sRGBEncoding || texture.encoding === GammaEncoding;\n\t}\n\n\tfunction _createPlanes() {\n\t\tconst _lodPlanes = [];\n\t\tconst _sizeLods = [];\n\t\tconst _sigmas = [];\n\t\tlet lod = LOD_MAX;\n\n\t\tfor (let i = 0; i < TOTAL_LODS; i++) {\n\t\t\tconst sizeLod = Math.pow(2, lod);\n\n\t\t\t_sizeLods.push(sizeLod);\n\n\t\t\tlet sigma = 1.0 / sizeLod;\n\n\t\t\tif (i > LOD_MAX - LOD_MIN) {\n\t\t\t\tsigma = EXTRA_LOD_SIGMA[i - LOD_MAX + LOD_MIN - 1];\n\t\t\t} else if (i == 0) {\n\t\t\t\tsigma = 0;\n\t\t\t}\n\n\t\t\t_sigmas.push(sigma);\n\n\t\t\tconst texelSize = 1.0 / (sizeLod - 1);\n\t\t\tconst min = -texelSize / 2;\n\t\t\tconst max = 1 + texelSize / 2;\n\t\t\tconst uv1 = [min, min, max, min, max, max, min, min, max, max, min, max];\n\t\t\tconst cubeFaces = 6;\n\t\t\tconst vertices = 6;\n\t\t\tconst positionSize = 3;\n\t\t\tconst uvSize = 2;\n\t\t\tconst faceIndexSize = 1;\n\t\t\tconst position = new Float32Array(positionSize * vertices * cubeFaces);\n\t\t\tconst uv = new Float32Array(uvSize * vertices * cubeFaces);\n\t\t\tconst faceIndex = new Float32Array(faceIndexSize * vertices * cubeFaces);\n\n\t\t\tfor (let face = 0; face < cubeFaces; face++) {\n\t\t\t\tconst x = face % 3 * 2 / 3 - 1;\n\t\t\t\tconst y = face > 2 ? 0 : -1;\n\t\t\t\tconst coordinates = [x, y, 0, x + 2 / 3, y, 0, x + 2 / 3, y + 1, 0, x, y, 0, x + 2 / 3, y + 1, 0, x, y + 1, 0];\n\t\t\t\tposition.set(coordinates, positionSize * vertices * face);\n\t\t\t\tuv.set(uv1, uvSize * vertices * face);\n\t\t\t\tconst fill = [face, face, face, face, face, face];\n\t\t\t\tfaceIndex.set(fill, faceIndexSize * vertices * face);\n\t\t\t}\n\n\t\t\tconst planes = new BufferGeometry();\n\t\t\tplanes.setAttribute('position', new BufferAttribute(position, positionSize));\n\t\t\tplanes.setAttribute('uv', new BufferAttribute(uv, uvSize));\n\t\t\tplanes.setAttribute('faceIndex', new BufferAttribute(faceIndex, faceIndexSize));\n\n\t\t\t_lodPlanes.push(planes);\n\n\t\t\tif (lod > LOD_MIN) {\n\t\t\t\tlod--;\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\t_lodPlanes,\n\t\t\t_sizeLods,\n\t\t\t_sigmas\n\t\t};\n\t}\n\n\tfunction _createRenderTarget(params) {\n\t\tconst cubeUVRenderTarget = new WebGLRenderTarget(3 * SIZE_MAX, 3 * SIZE_MAX, params);\n\t\tcubeUVRenderTarget.texture.mapping = CubeUVReflectionMapping;\n\t\tcubeUVRenderTarget.texture.name = 'PMREM.cubeUv';\n\t\tcubeUVRenderTarget.scissorTest = true;\n\t\treturn cubeUVRenderTarget;\n\t}\n\n\tfunction _setViewport(target, x, y, width, height) {\n\t\ttarget.viewport.set(x, y, width, height);\n\t\ttarget.scissor.set(x, y, width, height);\n\t}\n\n\tfunction _getBlurShader(maxSamples) {\n\t\tconst weights = new Float32Array(maxSamples);\n\t\tconst poleAxis = new Vector3(0, 1, 0);\n\t\tconst shaderMaterial = new RawShaderMaterial({\n\t\t\tname: 'SphericalGaussianBlur',\n\t\t\tdefines: {\n\t\t\t\t'n': maxSamples\n\t\t\t},\n\t\t\tuniforms: {\n\t\t\t\t'envMap': {\n\t\t\t\t\tvalue: null\n\t\t\t\t},\n\t\t\t\t'samples': {\n\t\t\t\t\tvalue: 1\n\t\t\t\t},\n\t\t\t\t'weights': {\n\t\t\t\t\tvalue: weights\n\t\t\t\t},\n\t\t\t\t'latitudinal': {\n\t\t\t\t\tvalue: false\n\t\t\t\t},\n\t\t\t\t'dTheta': {\n\t\t\t\t\tvalue: 0\n\t\t\t\t},\n\t\t\t\t'mipInt': {\n\t\t\t\t\tvalue: 0\n\t\t\t\t},\n\t\t\t\t'poleAxis': {\n\t\t\t\t\tvalue: poleAxis\n\t\t\t\t},\n\t\t\t\t'inputEncoding': {\n\t\t\t\t\tvalue: ENCODINGS[LinearEncoding]\n\t\t\t\t},\n\t\t\t\t'outputEncoding': {\n\t\t\t\t\tvalue: ENCODINGS[LinearEncoding]\n\t\t\t\t}\n\t\t\t},\n\t\t\tvertexShader: _getCommonVertexShader(),\n\t\t\tfragmentShader:\n\t\t\t/* glsl */\n\t\t\t`\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t${_getEncodings()}\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include <cube_uv_reflection_fragment>\n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t`,\n\t\t\tblending: NoBlending,\n\t\t\tdepthTest: false,\n\t\t\tdepthWrite: false\n\t\t});\n\t\treturn shaderMaterial;\n\t}\n\n\tfunction _getEquirectShader() {\n\t\tconst texelSize = new Vector2(1, 1);\n\t\tconst shaderMaterial = new RawShaderMaterial({\n\t\t\tname: 'EquirectangularToCubeUV',\n\t\t\tuniforms: {\n\t\t\t\t'envMap': {\n\t\t\t\t\tvalue: null\n\t\t\t\t},\n\t\t\t\t'texelSize': {\n\t\t\t\t\tvalue: texelSize\n\t\t\t\t},\n\t\t\t\t'inputEncoding': {\n\t\t\t\t\tvalue: ENCODINGS[LinearEncoding]\n\t\t\t\t},\n\t\t\t\t'outputEncoding': {\n\t\t\t\t\tvalue: ENCODINGS[LinearEncoding]\n\t\t\t\t}\n\t\t\t},\n\t\t\tvertexShader: _getCommonVertexShader(),\n\t\t\tfragmentShader:\n\t\t\t/* glsl */\n\t\t\t`\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform vec2 texelSize;\n\n\t\t\t${_getEncodings()}\n\n\t\t\t#include <common>\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tvec2 f = fract( uv / texelSize - 0.5 );\n\t\t\t\tuv -= f * texelSize;\n\t\t\t\tvec3 tl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.x += texelSize.x;\n\t\t\t\tvec3 tr = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.y += texelSize.y;\n\t\t\t\tvec3 br = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.x -= texelSize.x;\n\t\t\t\tvec3 bl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\n\t\t\t\tvec3 tm = mix( tl, tr, f.x );\n\t\t\t\tvec3 bm = mix( bl, br, f.x );\n\t\t\t\tgl_FragColor.rgb = mix( tm, bm, f.y );\n\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t`,\n\t\t\tblending: NoBlending,\n\t\t\tdepthTest: false,\n\t\t\tdepthWrite: false\n\t\t});\n\t\treturn shaderMaterial;\n\t}\n\n\tfunction _getCubemapShader() {\n\t\tconst shaderMaterial = new RawShaderMaterial({\n\t\t\tname: 'CubemapToCubeUV',\n\t\t\tuniforms: {\n\t\t\t\t'envMap': {\n\t\t\t\t\tvalue: null\n\t\t\t\t},\n\t\t\t\t'inputEncoding': {\n\t\t\t\t\tvalue: ENCODINGS[LinearEncoding]\n\t\t\t\t},\n\t\t\t\t'outputEncoding': {\n\t\t\t\t\tvalue: ENCODINGS[LinearEncoding]\n\t\t\t\t}\n\t\t\t},\n\t\t\tvertexShader: _getCommonVertexShader(),\n\t\t\tfragmentShader:\n\t\t\t/* glsl */\n\t\t\t`\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\t${_getEncodings()}\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb = envMapTexelToLinear( textureCube( envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ) ) ).rgb;\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t`,\n\t\t\tblending: NoBlending,\n\t\t\tdepthTest: false,\n\t\t\tdepthWrite: false\n\t\t});\n\t\treturn shaderMaterial;\n\t}\n\n\tfunction _getCommonVertexShader() {\n\t\treturn (\n\t\t\t/* glsl */\n\t\t\t`\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute vec3 position;\n\t\tattribute vec2 uv;\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t`\n\t\t);\n\t}\n\n\tfunction _getEncodings() {\n\t\treturn (\n\t\t\t/* glsl */\n\t\t\t`\n\n\t\tuniform int inputEncoding;\n\t\tuniform int outputEncoding;\n\n\t\t#include <encodings_pars_fragment>\n\n\t\tvec4 inputTexelToLinear( vec4 value ) {\n\n\t\t\tif ( inputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( inputEncoding == 1 ) {\n\n\t\t\t\treturn sRGBToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 2 ) {\n\n\t\t\t\treturn RGBEToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 3 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 7.0 );\n\n\t\t\t} else if ( inputEncoding == 4 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 16.0 );\n\n\t\t\t} else if ( inputEncoding == 5 ) {\n\n\t\t\t\treturn RGBDToLinear( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn GammaToLinear( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 linearToOutputTexel( vec4 value ) {\n\n\t\t\tif ( outputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( outputEncoding == 1 ) {\n\n\t\t\t\treturn LinearTosRGB( value );\n\n\t\t\t} else if ( outputEncoding == 2 ) {\n\n\t\t\t\treturn LinearToRGBE( value );\n\n\t\t\t} else if ( outputEncoding == 3 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 7.0 );\n\n\t\t\t} else if ( outputEncoding == 4 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 16.0 );\n\n\t\t\t} else if ( outputEncoding == 5 ) {\n\n\t\t\t\treturn LinearToRGBD( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn LinearToGamma( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 envMapTexelToLinear( vec4 color ) {\n\n\t\t\treturn inputTexelToLinear( color );\n\n\t\t}\n\t`\n\t\t);\n\t}\n\n\tfunction WebGLCubeUVMaps(renderer) {\n\t\tlet cubeUVmaps = new WeakMap();\n\t\tlet pmremGenerator = null;\n\n\t\tfunction get(texture) {\n\t\t\tif (texture && texture.isTexture && texture.isRenderTargetTexture === false) {\n\t\t\t\tconst mapping = texture.mapping;\n\t\t\t\tconst isEquirectMap = mapping === EquirectangularReflectionMapping || mapping === EquirectangularRefractionMapping;\n\t\t\t\tconst isCubeMap = mapping === CubeReflectionMapping || mapping === CubeRefractionMapping;\n\n\t\t\t\tif (isEquirectMap || isCubeMap) {\n\t\t\t\t\t// equirect/cube map to cubeUV conversion\n\t\t\t\t\tif (cubeUVmaps.has(texture)) {\n\t\t\t\t\t\treturn cubeUVmaps.get(texture).texture;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst image = texture.image;\n\n\t\t\t\t\t\tif (isEquirectMap && image && image.height > 0 || isCubeMap && image && isCubeTextureComplete(image)) {\n\t\t\t\t\t\t\tconst currentRenderTarget = renderer.getRenderTarget();\n\t\t\t\t\t\t\tif (pmremGenerator === null) pmremGenerator = new PMREMGenerator(renderer);\n\t\t\t\t\t\t\tconst renderTarget = isEquirectMap ? pmremGenerator.fromEquirectangular(texture) : pmremGenerator.fromCubemap(texture);\n\t\t\t\t\t\t\tcubeUVmaps.set(texture, renderTarget);\n\t\t\t\t\t\t\trenderer.setRenderTarget(currentRenderTarget);\n\t\t\t\t\t\t\ttexture.addEventListener('dispose', onTextureDispose);\n\t\t\t\t\t\t\treturn renderTarget.texture;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// image not yet ready. try the conversion next frame\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn texture;\n\t\t}\n\n\t\tfunction isCubeTextureComplete(image) {\n\t\t\tlet count = 0;\n\t\t\tconst length = 6;\n\n\t\t\tfor (let i = 0; i < length; i++) {\n\t\t\t\tif (image[i] !== undefined) count++;\n\t\t\t}\n\n\t\t\treturn count === length;\n\t\t}\n\n\t\tfunction onTextureDispose(event) {\n\t\t\tconst texture = event.target;\n\t\t\ttexture.removeEventListener('dispose', onTextureDispose);\n\t\t\tconst cubemapUV = cubeUVmaps.get(texture);\n\n\t\t\tif (cubemapUV !== undefined) {\n\t\t\t\tcubeUVmaps.delete(texture);\n\t\t\t\tcubemapUV.dispose();\n\t\t\t}\n\t\t}\n\n\t\tfunction dispose() {\n\t\t\tcubeUVmaps = new WeakMap();\n\n\t\t\tif (pmremGenerator !== null) {\n\t\t\t\tpmremGenerator.dispose();\n\t\t\t\tpmremGenerator = null;\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tget: get,\n\t\t\tdispose: dispose\n\t\t};\n\t}\n\n\tfunction WebGLExtensions(gl) {\n\t\tconst extensions = {};\n\n\t\tfunction getExtension(name) {\n\t\t\tif (extensions[name] !== undefined) {\n\t\t\t\treturn extensions[name];\n\t\t\t}\n\n\t\t\tlet extension;\n\n\t\t\tswitch (name) {\n\t\t\t\tcase 'WEBGL_depth_texture':\n\t\t\t\t\textension = gl.getExtension('WEBGL_depth_texture') || gl.getExtension('MOZ_WEBGL_depth_texture') || gl.getExtension('WEBKIT_WEBGL_depth_texture');\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'EXT_texture_filter_anisotropic':\n\t\t\t\t\textension = gl.getExtension('EXT_texture_filter_anisotropic') || gl.getExtension('MOZ_EXT_texture_filter_anisotropic') || gl.getExtension('WEBKIT_EXT_texture_filter_anisotropic');\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'WEBGL_compressed_texture_s3tc':\n\t\t\t\t\textension = gl.getExtension('WEBGL_compressed_texture_s3tc') || gl.getExtension('MOZ_WEBGL_compressed_texture_s3tc') || gl.getExtension('WEBKIT_WEBGL_compressed_texture_s3tc');\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'WEBGL_compressed_texture_pvrtc':\n\t\t\t\t\textension = gl.getExtension('WEBGL_compressed_texture_pvrtc') || gl.getExtension('WEBKIT_WEBGL_compressed_texture_pvrtc');\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\textension = gl.getExtension(name);\n\t\t\t}\n\n\t\t\textensions[name] = extension;\n\t\t\treturn extension;\n\t\t}\n\n\t\treturn {\n\t\t\thas: function (name) {\n\t\t\t\treturn getExtension(name) !== null;\n\t\t\t},\n\t\t\tinit: function (capabilities) {\n\t\t\t\tif (capabilities.isWebGL2) {\n\t\t\t\t\tgetExtension('EXT_color_buffer_float');\n\t\t\t\t} else {\n\t\t\t\t\tgetExtension('WEBGL_depth_texture');\n\t\t\t\t\tgetExtension('OES_texture_float');\n\t\t\t\t\tgetExtension('OES_texture_half_float');\n\t\t\t\t\tgetExtension('OES_texture_half_float_linear');\n\t\t\t\t\tgetExtension('OES_standard_derivatives');\n\t\t\t\t\tgetExtension('OES_element_index_uint');\n\t\t\t\t\tgetExtension('OES_vertex_array_object');\n\t\t\t\t\tgetExtension('ANGLE_instanced_arrays');\n\t\t\t\t}\n\n\t\t\t\tgetExtension('OES_texture_float_linear');\n\t\t\t\tgetExtension('EXT_color_buffer_half_float');\n\t\t\t},\n\t\t\tget: function (name) {\n\t\t\t\tconst extension = getExtension(name);\n\n\t\t\t\tif (extension === null) {\n\t\t\t\t\tconsole.warn('THREE.WebGLRenderer: ' + name + ' extension not supported.');\n\t\t\t\t}\n\n\t\t\t\treturn extension;\n\t\t\t}\n\t\t};\n\t}\n\n\tfunction WebGLGeometries(gl, attributes, info, bindingStates) {\n\t\tconst geometries = {};\n\t\tconst wireframeAttributes = new WeakMap();\n\n\t\tfunction onGeometryDispose(event) {\n\t\t\tconst geometry = event.target;\n\n\t\t\tif (geometry.index !== null) {\n\t\t\t\tattributes.remove(geometry.index);\n\t\t\t}\n\n\t\t\tfor (const name in geometry.attributes) {\n\t\t\t\tattributes.remove(geometry.attributes[name]);\n\t\t\t}\n\n\t\t\tgeometry.removeEventListener('dispose', onGeometryDispose);\n\t\t\tdelete geometries[geometry.id];\n\t\t\tconst attribute = wireframeAttributes.get(geometry);\n\n\t\t\tif (attribute) {\n\t\t\t\tattributes.remove(attribute);\n\t\t\t\twireframeAttributes.delete(geometry);\n\t\t\t}\n\n\t\t\tbindingStates.releaseStatesOfGeometry(geometry);\n\n\t\t\tif (geometry.isInstancedBufferGeometry === true) {\n\t\t\t\tdelete geometry._maxInstanceCount;\n\t\t\t} //\n\n\n\t\t\tinfo.memory.geometries--;\n\t\t}\n\n\t\tfunction get(object, geometry) {\n\t\t\tif (geometries[geometry.id] === true) return geometry;\n\t\t\tgeometry.addEventListener('dispose', onGeometryDispose);\n\t\t\tgeometries[geometry.id] = true;\n\t\t\tinfo.memory.geometries++;\n\t\t\treturn geometry;\n\t\t}\n\n\t\tfunction update(geometry) {\n\t\t\tconst geometryAttributes = geometry.attributes; // Updating index buffer in VAO now. See WebGLBindingStates.\n\n\t\t\tfor (const name in geometryAttributes) {\n\t\t\t\tattributes.update(geometryAttributes[name], gl.ARRAY_BUFFER);\n\t\t\t} // morph targets\n\n\n\t\t\tconst morphAttributes = geometry.morphAttributes;\n\n\t\t\tfor (const name in morphAttributes) {\n\t\t\t\tconst array = morphAttributes[name];\n\n\t\t\t\tfor (let i = 0, l = array.length; i < l; i++) {\n\t\t\t\t\tattributes.update(array[i], gl.ARRAY_BUFFER);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction updateWireframeAttribute(geometry) {\n\t\t\tconst indices = [];\n\t\t\tconst geometryIndex = geometry.index;\n\t\t\tconst geometryPosition = geometry.attributes.position;\n\t\t\tlet version = 0;\n\n\t\t\tif (geometryIndex !== null) {\n\t\t\t\tconst array = geometryIndex.array;\n\t\t\t\tversion = geometryIndex.version;\n\n\t\t\t\tfor (let i = 0, l = array.length; i < l; i += 3) {\n\t\t\t\t\tconst a = array[i + 0];\n\t\t\t\t\tconst b = array[i + 1];\n\t\t\t\t\tconst c = array[i + 2];\n\t\t\t\t\tindices.push(a, b, b, c, c, a);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst array = geometryPosition.array;\n\t\t\t\tversion = geometryPosition.version;\n\n\t\t\t\tfor (let i = 0, l = array.length / 3 - 1; i < l; i += 3) {\n\t\t\t\t\tconst a = i + 0;\n\t\t\t\t\tconst b = i + 1;\n\t\t\t\t\tconst c = i + 2;\n\t\t\t\t\tindices.push(a, b, b, c, c, a);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst attribute = new (arrayMax(indices) > 65535 ? Uint32BufferAttribute : Uint16BufferAttribute)(indices, 1);\n\t\t\tattribute.version = version; // Updating index buffer in VAO now. See WebGLBindingStates\n\t\t\t//\n\n\t\t\tconst previousAttribute = wireframeAttributes.get(geometry);\n\t\t\tif (previousAttribute) attributes.remove(previousAttribute); //\n\n\t\t\twireframeAttributes.set(geometry, attribute);\n\t\t}\n\n\t\tfunction getWireframeAttribute(geometry) {\n\t\t\tconst currentAttribute = wireframeAttributes.get(geometry);\n\n\t\t\tif (currentAttribute) {\n\t\t\t\tconst geometryIndex = geometry.index;\n\n\t\t\t\tif (geometryIndex !== null) {\n\t\t\t\t\t// if the attribute is obsolete, create a new one\n\t\t\t\t\tif (currentAttribute.version < geometryIndex.version) {\n\t\t\t\t\t\tupdateWireframeAttribute(geometry);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tupdateWireframeAttribute(geometry);\n\t\t\t}\n\n\t\t\treturn wireframeAttributes.get(geometry);\n\t\t}\n\n\t\treturn {\n\t\t\tget: get,\n\t\t\tupdate: update,\n\t\t\tgetWireframeAttribute: getWireframeAttribute\n\t\t};\n\t}\n\n\tfunction WebGLIndexedBufferRenderer(gl, extensions, info, capabilities) {\n\t\tconst isWebGL2 = capabilities.isWebGL2;\n\t\tlet mode;\n\n\t\tfunction setMode(value) {\n\t\t\tmode = value;\n\t\t}\n\n\t\tlet type, bytesPerElement;\n\n\t\tfunction setIndex(value) {\n\t\t\ttype = value.type;\n\t\t\tbytesPerElement = value.bytesPerElement;\n\t\t}\n\n\t\tfunction render(start, count) {\n\t\t\tgl.drawElements(mode, count, type, start * bytesPerElement);\n\t\t\tinfo.update(count, mode, 1);\n\t\t}\n\n\t\tfunction renderInstances(start, count, primcount) {\n\t\t\tif (primcount === 0) return;\n\t\t\tlet extension, methodName;\n\n\t\t\tif (isWebGL2) {\n\t\t\t\textension = gl;\n\t\t\t\tmethodName = 'drawElementsInstanced';\n\t\t\t} else {\n\t\t\t\textension = extensions.get('ANGLE_instanced_arrays');\n\t\t\t\tmethodName = 'drawElementsInstancedANGLE';\n\n\t\t\t\tif (extension === null) {\n\t\t\t\t\tconsole.error('THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\textension[methodName](mode, count, type, start * bytesPerElement, primcount);\n\t\t\tinfo.update(count, mode, primcount);\n\t\t} //\n\n\n\t\tthis.setMode = setMode;\n\t\tthis.setIndex = setIndex;\n\t\tthis.render = render;\n\t\tthis.renderInstances = renderInstances;\n\t}\n\n\tfunction WebGLInfo(gl) {\n\t\tconst memory = {\n\t\t\tgeometries: 0,\n\t\t\ttextures: 0\n\t\t};\n\t\tconst render = {\n\t\t\tframe: 0,\n\t\t\tcalls: 0,\n\t\t\ttriangles: 0,\n\t\t\tpoints: 0,\n\t\t\tlines: 0\n\t\t};\n\n\t\tfunction update(count, mode, instanceCount) {\n\t\t\trender.calls++;\n\n\t\t\tswitch (mode) {\n\t\t\t\tcase gl.TRIANGLES:\n\t\t\t\t\trender.triangles += instanceCount * (count / 3);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase gl.LINES:\n\t\t\t\t\trender.lines += instanceCount * (count / 2);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase gl.LINE_STRIP:\n\t\t\t\t\trender.lines += instanceCount * (count - 1);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase gl.LINE_LOOP:\n\t\t\t\t\trender.lines += instanceCount * count;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase gl.POINTS:\n\t\t\t\t\trender.points += instanceCount * count;\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tconsole.error('THREE.WebGLInfo: Unknown draw mode:', mode);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tfunction reset() {\n\t\t\trender.frame++;\n\t\t\trender.calls = 0;\n\t\t\trender.triangles = 0;\n\t\t\trender.points = 0;\n\t\t\trender.lines = 0;\n\t\t}\n\n\t\treturn {\n\t\t\tmemory: memory,\n\t\t\trender: render,\n\t\t\tprograms: null,\n\t\t\tautoReset: true,\n\t\t\treset: reset,\n\t\t\tupdate: update\n\t\t};\n\t}\n\n\tclass DataTexture2DArray extends Texture {\n\t\tconstructor(data = null, width = 1, height = 1, depth = 1) {\n\t\t\tsuper(null);\n\t\t\tthis.image = {\n\t\t\t\tdata,\n\t\t\t\twidth,\n\t\t\t\theight,\n\t\t\t\tdepth\n\t\t\t};\n\t\t\tthis.magFilter = NearestFilter;\n\t\t\tthis.minFilter = NearestFilter;\n\t\t\tthis.wrapR = ClampToEdgeWrapping;\n\t\t\tthis.generateMipmaps = false;\n\t\t\tthis.flipY = false;\n\t\t\tthis.unpackAlignment = 1;\n\t\t\tthis.needsUpdate = true;\n\t\t}\n\n\t}\n\n\tDataTexture2DArray.prototype.isDataTexture2DArray = true;\n\n\tfunction numericalSort(a, b) {\n\t\treturn a[0] - b[0];\n\t}\n\n\tfunction absNumericalSort(a, b) {\n\t\treturn Math.abs(b[1]) - Math.abs(a[1]);\n\t}\n\n\tfunction denormalize(morph, attribute) {\n\t\tlet denominator = 1;\n\t\tconst array = attribute.isInterleavedBufferAttribute ? attribute.data.array : attribute.array;\n\t\tif (array instanceof Int8Array) denominator = 127;else if (array instanceof Int16Array) denominator = 32767;else if (array instanceof Int32Array) denominator = 2147483647;else console.error('THREE.WebGLMorphtargets: Unsupported morph attribute data type: ', array);\n\t\tmorph.divideScalar(denominator);\n\t}\n\n\tfunction WebGLMorphtargets(gl, capabilities, textures) {\n\t\tconst influencesList = {};\n\t\tconst morphInfluences = new Float32Array(8);\n\t\tconst morphTextures = new WeakMap();\n\t\tconst morph = new Vector3();\n\t\tconst workInfluences = [];\n\n\t\tfor (let i = 0; i < 8; i++) {\n\t\t\tworkInfluences[i] = [i, 0];\n\t\t}\n\n\t\tfunction update(object, geometry, material, program) {\n\t\t\tconst objectInfluences = object.morphTargetInfluences;\n\n\t\t\tif (capabilities.isWebGL2 === true) {\n\t\t\t\t// instead of using attributes, the WebGL 2 code path encodes morph targets\n\t\t\t\t// into an array of data textures. Each layer represents a single morph target.\n\t\t\t\tconst numberOfMorphTargets = geometry.morphAttributes.position.length;\n\t\t\t\tlet entry = morphTextures.get(geometry);\n\n\t\t\t\tif (entry === undefined || entry.count !== numberOfMorphTargets) {\n\t\t\t\t\tif (entry !== undefined) entry.texture.dispose();\n\t\t\t\t\tconst hasMorphNormals = geometry.morphAttributes.normal !== undefined;\n\t\t\t\t\tconst morphTargets = geometry.morphAttributes.position;\n\t\t\t\t\tconst morphNormals = geometry.morphAttributes.normal || [];\n\t\t\t\t\tconst numberOfVertices = geometry.attributes.position.count;\n\t\t\t\t\tconst numberOfVertexData = hasMorphNormals === true ? 2 : 1; // (v,n) vs. (v)\n\n\t\t\t\t\tlet width = numberOfVertices * numberOfVertexData;\n\t\t\t\t\tlet height = 1;\n\n\t\t\t\t\tif (width > capabilities.maxTextureSize) {\n\t\t\t\t\t\theight = Math.ceil(width / capabilities.maxTextureSize);\n\t\t\t\t\t\twidth = capabilities.maxTextureSize;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst buffer = new Float32Array(width * height * 4 * numberOfMorphTargets);\n\t\t\t\t\tconst texture = new DataTexture2DArray(buffer, width, height, numberOfMorphTargets);\n\t\t\t\t\ttexture.format = RGBAFormat; // using RGBA since RGB might be emulated (and is thus slower)\n\n\t\t\t\t\ttexture.type = FloatType; // fill buffer\n\n\t\t\t\t\tconst vertexDataStride = numberOfVertexData * 4;\n\n\t\t\t\t\tfor (let i = 0; i < numberOfMorphTargets; i++) {\n\t\t\t\t\t\tconst morphTarget = morphTargets[i];\n\t\t\t\t\t\tconst morphNormal = morphNormals[i];\n\t\t\t\t\t\tconst offset = width * height * 4 * i;\n\n\t\t\t\t\t\tfor (let j = 0; j < morphTarget.count; j++) {\n\t\t\t\t\t\t\tmorph.fromBufferAttribute(morphTarget, j);\n\t\t\t\t\t\t\tif (morphTarget.normalized === true) denormalize(morph, morphTarget);\n\t\t\t\t\t\t\tconst stride = j * vertexDataStride;\n\t\t\t\t\t\t\tbuffer[offset + stride + 0] = morph.x;\n\t\t\t\t\t\t\tbuffer[offset + stride + 1] = morph.y;\n\t\t\t\t\t\t\tbuffer[offset + stride + 2] = morph.z;\n\t\t\t\t\t\t\tbuffer[offset + stride + 3] = 0;\n\n\t\t\t\t\t\t\tif (hasMorphNormals === true) {\n\t\t\t\t\t\t\t\tmorph.fromBufferAttribute(morphNormal, j);\n\t\t\t\t\t\t\t\tif (morphNormal.normalized === true) denormalize(morph, morphNormal);\n\t\t\t\t\t\t\t\tbuffer[offset + stride + 4] = morph.x;\n\t\t\t\t\t\t\t\tbuffer[offset + stride + 5] = morph.y;\n\t\t\t\t\t\t\t\tbuffer[offset + stride + 6] = morph.z;\n\t\t\t\t\t\t\t\tbuffer[offset + stride + 7] = 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tentry = {\n\t\t\t\t\t\tcount: numberOfMorphTargets,\n\t\t\t\t\t\ttexture: texture,\n\t\t\t\t\t\tsize: new Vector2(width, height)\n\t\t\t\t\t};\n\t\t\t\t\tmorphTextures.set(geometry, entry);\n\t\t\t\t} //\n\n\n\t\t\t\tlet morphInfluencesSum = 0;\n\n\t\t\t\tfor (let i = 0; i < objectInfluences.length; i++) {\n\t\t\t\t\tmorphInfluencesSum += objectInfluences[i];\n\t\t\t\t}\n\n\t\t\t\tconst morphBaseInfluence = geometry.morphTargetsRelative ? 1 : 1 - morphInfluencesSum;\n\t\t\t\tprogram.getUniforms().setValue(gl, 'morphTargetBaseInfluence', morphBaseInfluence);\n\t\t\t\tprogram.getUniforms().setValue(gl, 'morphTargetInfluences', objectInfluences);\n\t\t\t\tprogram.getUniforms().setValue(gl, 'morphTargetsTexture', entry.texture, textures);\n\t\t\t\tprogram.getUniforms().setValue(gl, 'morphTargetsTextureSize', entry.size);\n\t\t\t} else {\n\t\t\t\t// When object doesn't have morph target influences defined, we treat it as a 0-length array\n\t\t\t\t// This is important to make sure we set up morphTargetBaseInfluence / morphTargetInfluences\n\t\t\t\tconst length = objectInfluences === undefined ? 0 : objectInfluences.length;\n\t\t\t\tlet influences = influencesList[geometry.id];\n\n\t\t\t\tif (influences === undefined || influences.length !== length) {\n\t\t\t\t\t// initialise list\n\t\t\t\t\tinfluences = [];\n\n\t\t\t\t\tfor (let i = 0; i < length; i++) {\n\t\t\t\t\t\tinfluences[i] = [i, 0];\n\t\t\t\t\t}\n\n\t\t\t\t\tinfluencesList[geometry.id] = influences;\n\t\t\t\t} // Collect influences\n\n\n\t\t\t\tfor (let i = 0; i < length; i++) {\n\t\t\t\t\tconst influence = influences[i];\n\t\t\t\t\tinfluence[0] = i;\n\t\t\t\t\tinfluence[1] = objectInfluences[i];\n\t\t\t\t}\n\n\t\t\t\tinfluences.sort(absNumericalSort);\n\n\t\t\t\tfor (let i = 0; i < 8; i++) {\n\t\t\t\t\tif (i < length && influences[i][1]) {\n\t\t\t\t\t\tworkInfluences[i][0] = influences[i][0];\n\t\t\t\t\t\tworkInfluences[i][1] = influences[i][1];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tworkInfluences[i][0] = Number.MAX_SAFE_INTEGER;\n\t\t\t\t\t\tworkInfluences[i][1] = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tworkInfluences.sort(numericalSort);\n\t\t\t\tconst morphTargets = geometry.morphAttributes.position;\n\t\t\t\tconst morphNormals = geometry.morphAttributes.normal;\n\t\t\t\tlet morphInfluencesSum = 0;\n\n\t\t\t\tfor (let i = 0; i < 8; i++) {\n\t\t\t\t\tconst influence = workInfluences[i];\n\t\t\t\t\tconst index = influence[0];\n\t\t\t\t\tconst value = influence[1];\n\n\t\t\t\t\tif (index !== Number.MAX_SAFE_INTEGER && value) {\n\t\t\t\t\t\tif (morphTargets && geometry.getAttribute('morphTarget' + i) !== morphTargets[index]) {\n\t\t\t\t\t\t\tgeometry.setAttribute('morphTarget' + i, morphTargets[index]);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (morphNormals && geometry.getAttribute('morphNormal' + i) !== morphNormals[index]) {\n\t\t\t\t\t\t\tgeometry.setAttribute('morphNormal' + i, morphNormals[index]);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmorphInfluences[i] = value;\n\t\t\t\t\t\tmorphInfluencesSum += value;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (morphTargets && geometry.hasAttribute('morphTarget' + i) === true) {\n\t\t\t\t\t\t\tgeometry.deleteAttribute('morphTarget' + i);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (morphNormals && geometry.hasAttribute('morphNormal' + i) === true) {\n\t\t\t\t\t\t\tgeometry.deleteAttribute('morphNormal' + i);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmorphInfluences[i] = 0;\n\t\t\t\t\t}\n\t\t\t\t} // GLSL shader uses formula baseinfluence * base + sum(target * influence)\n\t\t\t\t// This allows us to switch between absolute morphs and relative morphs without changing shader code\n\t\t\t\t// When baseinfluence = 1 - sum(influence), the above is equivalent to sum((target - base) * influence)\n\n\n\t\t\t\tconst morphBaseInfluence = geometry.morphTargetsRelative ? 1 : 1 - morphInfluencesSum;\n\t\t\t\tprogram.getUniforms().setValue(gl, 'morphTargetBaseInfluence', morphBaseInfluence);\n\t\t\t\tprogram.getUniforms().setValue(gl, 'morphTargetInfluences', morphInfluences);\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tupdate: update\n\t\t};\n\t}\n\n\tfunction WebGLObjects(gl, geometries, attributes, info) {\n\t\tlet updateMap = new WeakMap();\n\n\t\tfunction update(object) {\n\t\t\tconst frame = info.render.frame;\n\t\t\tconst geometry = object.geometry;\n\t\t\tconst buffergeometry = geometries.get(object, geometry); // Update once per frame\n\n\t\t\tif (updateMap.get(buffergeometry) !== frame) {\n\t\t\t\tgeometries.update(buffergeometry);\n\t\t\t\tupdateMap.set(buffergeometry, frame);\n\t\t\t}\n\n\t\t\tif (object.isInstancedMesh) {\n\t\t\t\tif (object.hasEventListener('dispose', onInstancedMeshDispose) === false) {\n\t\t\t\t\tobject.addEventListener('dispose', onInstancedMeshDispose);\n\t\t\t\t}\n\n\t\t\t\tattributes.update(object.instanceMatrix, gl.ARRAY_BUFFER);\n\n\t\t\t\tif (object.instanceColor !== null) {\n\t\t\t\t\tattributes.update(object.instanceColor, gl.ARRAY_BUFFER);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn buffergeometry;\n\t\t}\n\n\t\tfunction dispose() {\n\t\t\tupdateMap = new WeakMap();\n\t\t}\n\n\t\tfunction onInstancedMeshDispose(event) {\n\t\t\tconst instancedMesh = event.target;\n\t\t\tinstancedMesh.removeEventListener('dispose', onInstancedMeshDispose);\n\t\t\tattributes.remove(instancedMesh.instanceMatrix);\n\t\t\tif (instancedMesh.instanceColor !== null) attributes.remove(instancedMesh.instanceColor);\n\t\t}\n\n\t\treturn {\n\t\t\tupdate: update,\n\t\t\tdispose: dispose\n\t\t};\n\t}\n\n\tclass DataTexture3D extends Texture {\n\t\tconstructor(data = null, width = 1, height = 1, depth = 1) {\n\t\t\t// We're going to add .setXXX() methods for setting properties later.\n\t\t\t// Users can still set in DataTexture3D directly.\n\t\t\t//\n\t\t\t//\tconst texture = new THREE.DataTexture3D( data, width, height, depth );\n\t\t\t// \ttexture.anisotropy = 16;\n\t\t\t//\n\t\t\t// See #14839\n\t\t\tsuper(null);\n\t\t\tthis.image = {\n\t\t\t\tdata,\n\t\t\t\twidth,\n\t\t\t\theight,\n\t\t\t\tdepth\n\t\t\t};\n\t\t\tthis.magFilter = NearestFilter;\n\t\t\tthis.minFilter = NearestFilter;\n\t\t\tthis.wrapR = ClampToEdgeWrapping;\n\t\t\tthis.generateMipmaps = false;\n\t\t\tthis.flipY = false;\n\t\t\tthis.unpackAlignment = 1;\n\t\t\tthis.needsUpdate = true;\n\t\t}\n\n\t}\n\n\tDataTexture3D.prototype.isDataTexture3D = true;\n\n\t/**\n\t * Uniforms of a program.\n\t * Those form a tree structure with a special top-level container for the root,\n\t * which you get by calling 'new WebGLUniforms( gl, program )'.\n\t *\n\t *\n\t * Properties of inner nodes including the top-level container:\n\t *\n\t * .seq - array of nested uniforms\n\t * .map - nested uniforms by name\n\t *\n\t *\n\t * Methods of all nodes except the top-level container:\n\t *\n\t * .setValue( gl, value, [textures] )\n\t *\n\t * \t\tuploads a uniform value(s)\n\t *\t\tthe 'textures' parameter is needed for sampler uniforms\n\t *\n\t *\n\t * Static methods of the top-level container (textures factorizations):\n\t *\n\t * .upload( gl, seq, values, textures )\n\t *\n\t * \t\tsets uniforms in 'seq' to 'values[id].value'\n\t *\n\t * .seqWithValue( seq, values ) : filteredSeq\n\t *\n\t * \t\tfilters 'seq' entries with corresponding entry in values\n\t *\n\t *\n\t * Methods of the top-level container (textures factorizations):\n\t *\n\t * .setValue( gl, name, value, textures )\n\t *\n\t * \t\tsets uniform with\tname 'name' to 'value'\n\t *\n\t * .setOptional( gl, obj, prop )\n\t *\n\t * \t\tlike .set for an optional property of the object\n\t *\n\t */\n\tconst emptyTexture = new Texture();\n\tconst emptyTexture2dArray = new DataTexture2DArray();\n\tconst emptyTexture3d = new DataTexture3D();\n\tconst emptyCubeTexture = new CubeTexture(); // --- Utilities ---\n\t// Array Caches (provide typed arrays for temporary by size)\n\n\tconst arrayCacheF32 = [];\n\tconst arrayCacheI32 = []; // Float32Array caches used for uploading Matrix uniforms\n\n\tconst mat4array = new Float32Array(16);\n\tconst mat3array = new Float32Array(9);\n\tconst mat2array = new Float32Array(4); // Flattening for arrays of vectors and matrices\n\n\tfunction flatten(array, nBlocks, blockSize) {\n\t\tconst firstElem = array[0];\n\t\tif (firstElem <= 0 || firstElem > 0) return array; // unoptimized: ! isNaN( firstElem )\n\t\t// see http://jacksondunstan.com/articles/983\n\n\t\tconst n = nBlocks * blockSize;\n\t\tlet r = arrayCacheF32[n];\n\n\t\tif (r === undefined) {\n\t\t\tr = new Float32Array(n);\n\t\t\tarrayCacheF32[n] = r;\n\t\t}\n\n\t\tif (nBlocks !== 0) {\n\t\t\tfirstElem.toArray(r, 0);\n\n\t\t\tfor (let i = 1, offset = 0; i !== nBlocks; ++i) {\n\t\t\t\toffset += blockSize;\n\t\t\t\tarray[i].toArray(r, offset);\n\t\t\t}\n\t\t}\n\n\t\treturn r;\n\t}\n\n\tfunction arraysEqual(a, b) {\n\t\tif (a.length !== b.length) return false;\n\n\t\tfor (let i = 0, l = a.length; i < l; i++) {\n\t\t\tif (a[i] !== b[i]) return false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tfunction copyArray(a, b) {\n\t\tfor (let i = 0, l = b.length; i < l; i++) {\n\t\t\ta[i] = b[i];\n\t\t}\n\t} // Texture unit allocation\n\n\n\tfunction allocTexUnits(textures, n) {\n\t\tlet r = arrayCacheI32[n];\n\n\t\tif (r === undefined) {\n\t\t\tr = new Int32Array(n);\n\t\t\tarrayCacheI32[n] = r;\n\t\t}\n\n\t\tfor (let i = 0; i !== n; ++i) {\n\t\t\tr[i] = textures.allocateTextureUnit();\n\t\t}\n\n\t\treturn r;\n\t} // --- Setters ---\n\t// Note: Defining these methods externally, because they come in a bunch\n\t// and this way their names minify.\n\t// Single scalar\n\n\n\tfunction setValueV1f(gl, v) {\n\t\tconst cache = this.cache;\n\t\tif (cache[0] === v) return;\n\t\tgl.uniform1f(this.addr, v);\n\t\tcache[0] = v;\n\t} // Single float vector (from flat array or THREE.VectorN)\n\n\n\tfunction setValueV2f(gl, v) {\n\t\tconst cache = this.cache;\n\n\t\tif (v.x !== undefined) {\n\t\t\tif (cache[0] !== v.x || cache[1] !== v.y) {\n\t\t\t\tgl.uniform2f(this.addr, v.x, v.y);\n\t\t\t\tcache[0] = v.x;\n\t\t\t\tcache[1] = v.y;\n\t\t\t}\n\t\t} else {\n\t\t\tif (arraysEqual(cache, v)) return;\n\t\t\tgl.uniform2fv(this.addr, v);\n\t\t\tcopyArray(cache, v);\n\t\t}\n\t}\n\n\tfunction setValueV3f(gl, v) {\n\t\tconst cache = this.cache;\n\n\t\tif (v.x !== undefined) {\n\t\t\tif (cache[0] !== v.x || cache[1] !== v.y || cache[2] !== v.z) {\n\t\t\t\tgl.uniform3f(this.addr, v.x, v.y, v.z);\n\t\t\t\tcache[0] = v.x;\n\t\t\t\tcache[1] = v.y;\n\t\t\t\tcache[2] = v.z;\n\t\t\t}\n\t\t} else if (v.r !== undefined) {\n\t\t\tif (cache[0] !== v.r || cache[1] !== v.g || cache[2] !== v.b) {\n\t\t\t\tgl.uniform3f(this.addr, v.r, v.g, v.b);\n\t\t\t\tcache[0] = v.r;\n\t\t\t\tcache[1] = v.g;\n\t\t\t\tcache[2] = v.b;\n\t\t\t}\n\t\t} else {\n\t\t\tif (arraysEqual(cache, v)) return;\n\t\t\tgl.uniform3fv(this.addr, v);\n\t\t\tcopyArray(cache, v);\n\t\t}\n\t}\n\n\tfunction setValueV4f(gl, v) {\n\t\tconst cache = this.cache;\n\n\t\tif (v.x !== undefined) {\n\t\t\tif (cache[0] !== v.x || cache[1] !== v.y || cache[2] !== v.z || cache[3] !== v.w) {\n\t\t\t\tgl.uniform4f(this.addr, v.x, v.y, v.z, v.w);\n\t\t\t\tcache[0] = v.x;\n\t\t\t\tcache[1] = v.y;\n\t\t\t\tcache[2] = v.z;\n\t\t\t\tcache[3] = v.w;\n\t\t\t}\n\t\t} else {\n\t\t\tif (arraysEqual(cache, v)) return;\n\t\t\tgl.uniform4fv(this.addr, v);\n\t\t\tcopyArray(cache, v);\n\t\t}\n\t} // Single matrix (from flat array or THREE.MatrixN)\n\n\n\tfunction setValueM2(gl, v) {\n\t\tconst cache = this.cache;\n\t\tconst elements = v.elements;\n\n\t\tif (elements === undefined) {\n\t\t\tif (arraysEqual(cache, v)) return;\n\t\t\tgl.uniformMatrix2fv(this.addr, false, v);\n\t\t\tcopyArray(cache, v);\n\t\t} else {\n\t\t\tif (arraysEqual(cache, elements)) return;\n\t\t\tmat2array.set(elements);\n\t\t\tgl.uniformMatrix2fv(this.addr, false, mat2array);\n\t\t\tcopyArray(cache, elements);\n\t\t}\n\t}\n\n\tfunction setValueM3(gl, v) {\n\t\tconst cache = this.cache;\n\t\tconst elements = v.elements;\n\n\t\tif (elements === undefined) {\n\t\t\tif (arraysEqual(cache, v)) return;\n\t\t\tgl.uniformMatrix3fv(this.addr, false, v);\n\t\t\tcopyArray(cache, v);\n\t\t} else {\n\t\t\tif (arraysEqual(cache, elements)) return;\n\t\t\tmat3array.set(elements);\n\t\t\tgl.uniformMatrix3fv(this.addr, false, mat3array);\n\t\t\tcopyArray(cache, elements);\n\t\t}\n\t}\n\n\tfunction setValueM4(gl, v) {\n\t\tconst cache = this.cache;\n\t\tconst elements = v.elements;\n\n\t\tif (elements === undefined) {\n\t\t\tif (arraysEqual(cache, v)) return;\n\t\t\tgl.uniformMatrix4fv(this.addr, false, v);\n\t\t\tcopyArray(cache, v);\n\t\t} else {\n\t\t\tif (arraysEqual(cache, elements)) return;\n\t\t\tmat4array.set(elements);\n\t\t\tgl.uniformMatrix4fv(this.addr, false, mat4array);\n\t\t\tcopyArray(cache, elements);\n\t\t}\n\t} // Single integer / boolean\n\n\n\tfunction setValueV1i(gl, v) {\n\t\tconst cache = this.cache;\n\t\tif (cache[0] === v) return;\n\t\tgl.uniform1i(this.addr, v);\n\t\tcache[0] = v;\n\t} // Single integer / boolean vector (from flat array)\n\n\n\tfunction setValueV2i(gl, v) {\n\t\tconst cache = this.cache;\n\t\tif (arraysEqual(cache, v)) return;\n\t\tgl.uniform2iv(this.addr, v);\n\t\tcopyArray(cache, v);\n\t}\n\n\tfunction setValueV3i(gl, v) {\n\t\tconst cache = this.cache;\n\t\tif (arraysEqual(cache, v)) return;\n\t\tgl.uniform3iv(this.addr, v);\n\t\tcopyArray(cache, v);\n\t}\n\n\tfunction setValueV4i(gl, v) {\n\t\tconst cache = this.cache;\n\t\tif (arraysEqual(cache, v)) return;\n\t\tgl.uniform4iv(this.addr, v);\n\t\tcopyArray(cache, v);\n\t} // Single unsigned integer\n\n\n\tfunction setValueV1ui(gl, v) {\n\t\tconst cache = this.cache;\n\t\tif (cache[0] === v) return;\n\t\tgl.uniform1ui(this.addr, v);\n\t\tcache[0] = v;\n\t} // Single unsigned integer vector (from flat array)\n\n\n\tfunction setValueV2ui(gl, v) {\n\t\tconst cache = this.cache;\n\t\tif (arraysEqual(cache, v)) return;\n\t\tgl.uniform2uiv(this.addr, v);\n\t\tcopyArray(cache, v);\n\t}\n\n\tfunction setValueV3ui(gl, v) {\n\t\tconst cache = this.cache;\n\t\tif (arraysEqual(cache, v)) return;\n\t\tgl.uniform3uiv(this.addr, v);\n\t\tcopyArray(cache, v);\n\t}\n\n\tfunction setValueV4ui(gl, v) {\n\t\tconst cache = this.cache;\n\t\tif (arraysEqual(cache, v)) return;\n\t\tgl.uniform4uiv(this.addr, v);\n\t\tcopyArray(cache, v);\n\t} // Single texture (2D / Cube)\n\n\n\tfunction setValueT1(gl, v, textures) {\n\t\tconst cache = this.cache;\n\t\tconst unit = textures.allocateTextureUnit();\n\n\t\tif (cache[0] !== unit) {\n\t\t\tgl.uniform1i(this.addr, unit);\n\t\t\tcache[0] = unit;\n\t\t}\n\n\t\ttextures.safeSetTexture2D(v || emptyTexture, unit);\n\t}\n\n\tfunction setValueT3D1(gl, v, textures) {\n\t\tconst cache = this.cache;\n\t\tconst unit = textures.allocateTextureUnit();\n\n\t\tif (cache[0] !== unit) {\n\t\t\tgl.uniform1i(this.addr, unit);\n\t\t\tcache[0] = unit;\n\t\t}\n\n\t\ttextures.setTexture3D(v || emptyTexture3d, unit);\n\t}\n\n\tfunction setValueT6(gl, v, textures) {\n\t\tconst cache = this.cache;\n\t\tconst unit = textures.allocateTextureUnit();\n\n\t\tif (cache[0] !== unit) {\n\t\t\tgl.uniform1i(this.addr, unit);\n\t\t\tcache[0] = unit;\n\t\t}\n\n\t\ttextures.safeSetTextureCube(v || emptyCubeTexture, unit);\n\t}\n\n\tfunction setValueT2DArray1(gl, v, textures) {\n\t\tconst cache = this.cache;\n\t\tconst unit = textures.allocateTextureUnit();\n\n\t\tif (cache[0] !== unit) {\n\t\t\tgl.uniform1i(this.addr, unit);\n\t\t\tcache[0] = unit;\n\t\t}\n\n\t\ttextures.setTexture2DArray(v || emptyTexture2dArray, unit);\n\t} // Helper to pick the right setter for the singular case\n\n\n\tfunction getSingularSetter(type) {\n\t\tswitch (type) {\n\t\t\tcase 0x1406:\n\t\t\t\treturn setValueV1f;\n\t\t\t// FLOAT\n\n\t\t\tcase 0x8b50:\n\t\t\t\treturn setValueV2f;\n\t\t\t// _VEC2\n\n\t\t\tcase 0x8b51:\n\t\t\t\treturn setValueV3f;\n\t\t\t// _VEC3\n\n\t\t\tcase 0x8b52:\n\t\t\t\treturn setValueV4f;\n\t\t\t// _VEC4\n\n\t\t\tcase 0x8b5a:\n\t\t\t\treturn setValueM2;\n\t\t\t// _MAT2\n\n\t\t\tcase 0x8b5b:\n\t\t\t\treturn setValueM3;\n\t\t\t// _MAT3\n\n\t\t\tcase 0x8b5c:\n\t\t\t\treturn setValueM4;\n\t\t\t// _MAT4\n\n\t\t\tcase 0x1404:\n\t\t\tcase 0x8b56:\n\t\t\t\treturn setValueV1i;\n\t\t\t// INT, BOOL\n\n\t\t\tcase 0x8b53:\n\t\t\tcase 0x8b57:\n\t\t\t\treturn setValueV2i;\n\t\t\t// _VEC2\n\n\t\t\tcase 0x8b54:\n\t\t\tcase 0x8b58:\n\t\t\t\treturn setValueV3i;\n\t\t\t// _VEC3\n\n\t\t\tcase 0x8b55:\n\t\t\tcase 0x8b59:\n\t\t\t\treturn setValueV4i;\n\t\t\t// _VEC4\n\n\t\t\tcase 0x1405:\n\t\t\t\treturn setValueV1ui;\n\t\t\t// UINT\n\n\t\t\tcase 0x8dc6:\n\t\t\t\treturn setValueV2ui;\n\t\t\t// _VEC2\n\n\t\t\tcase 0x8dc7:\n\t\t\t\treturn setValueV3ui;\n\t\t\t// _VEC3\n\n\t\t\tcase 0x8dc8:\n\t\t\t\treturn setValueV4ui;\n\t\t\t// _VEC4\n\n\t\t\tcase 0x8b5e: // SAMPLER_2D\n\n\t\t\tcase 0x8d66: // SAMPLER_EXTERNAL_OES\n\n\t\t\tcase 0x8dca: // INT_SAMPLER_2D\n\n\t\t\tcase 0x8dd2: // UNSIGNED_INT_SAMPLER_2D\n\n\t\t\tcase 0x8b62:\n\t\t\t\t// SAMPLER_2D_SHADOW\n\t\t\t\treturn setValueT1;\n\n\t\t\tcase 0x8b5f: // SAMPLER_3D\n\n\t\t\tcase 0x8dcb: // INT_SAMPLER_3D\n\n\t\t\tcase 0x8dd3:\n\t\t\t\t// UNSIGNED_INT_SAMPLER_3D\n\t\t\t\treturn setValueT3D1;\n\n\t\t\tcase 0x8b60: // SAMPLER_CUBE\n\n\t\t\tcase 0x8dcc: // INT_SAMPLER_CUBE\n\n\t\t\tcase 0x8dd4: // UNSIGNED_INT_SAMPLER_CUBE\n\n\t\t\tcase 0x8dc5:\n\t\t\t\t// SAMPLER_CUBE_SHADOW\n\t\t\t\treturn setValueT6;\n\n\t\t\tcase 0x8dc1: // SAMPLER_2D_ARRAY\n\n\t\t\tcase 0x8dcf: // INT_SAMPLER_2D_ARRAY\n\n\t\t\tcase 0x8dd7: // UNSIGNED_INT_SAMPLER_2D_ARRAY\n\n\t\t\tcase 0x8dc4:\n\t\t\t\t// SAMPLER_2D_ARRAY_SHADOW\n\t\t\t\treturn setValueT2DArray1;\n\t\t}\n\t} // Array of scalars\n\n\n\tfunction setValueV1fArray(gl, v) {\n\t\tgl.uniform1fv(this.addr, v);\n\t} // Array of vectors (from flat array or array of THREE.VectorN)\n\n\n\tfunction setValueV2fArray(gl, v) {\n\t\tconst data = flatten(v, this.size, 2);\n\t\tgl.uniform2fv(this.addr, data);\n\t}\n\n\tfunction setValueV3fArray(gl, v) {\n\t\tconst data = flatten(v, this.size, 3);\n\t\tgl.uniform3fv(this.addr, data);\n\t}\n\n\tfunction setValueV4fArray(gl, v) {\n\t\tconst data = flatten(v, this.size, 4);\n\t\tgl.uniform4fv(this.addr, data);\n\t} // Array of matrices (from flat array or array of THREE.MatrixN)\n\n\n\tfunction setValueM2Array(gl, v) {\n\t\tconst data = flatten(v, this.size, 4);\n\t\tgl.uniformMatrix2fv(this.addr, false, data);\n\t}\n\n\tfunction setValueM3Array(gl, v) {\n\t\tconst data = flatten(v, this.size, 9);\n\t\tgl.uniformMatrix3fv(this.addr, false, data);\n\t}\n\n\tfunction setValueM4Array(gl, v) {\n\t\tconst data = flatten(v, this.size, 16);\n\t\tgl.uniformMatrix4fv(this.addr, false, data);\n\t} // Array of integer / boolean\n\n\n\tfunction setValueV1iArray(gl, v) {\n\t\tgl.uniform1iv(this.addr, v);\n\t} // Array of integer / boolean vectors (from flat array)\n\n\n\tfunction setValueV2iArray(gl, v) {\n\t\tgl.uniform2iv(this.addr, v);\n\t}\n\n\tfunction setValueV3iArray(gl, v) {\n\t\tgl.uniform3iv(this.addr, v);\n\t}\n\n\tfunction setValueV4iArray(gl, v) {\n\t\tgl.uniform4iv(this.addr, v);\n\t} // Array of unsigned integer\n\n\n\tfunction setValueV1uiArray(gl, v) {\n\t\tgl.uniform1uiv(this.addr, v);\n\t} // Array of unsigned integer vectors (from flat array)\n\n\n\tfunction setValueV2uiArray(gl, v) {\n\t\tgl.uniform2uiv(this.addr, v);\n\t}\n\n\tfunction setValueV3uiArray(gl, v) {\n\t\tgl.uniform3uiv(this.addr, v);\n\t}\n\n\tfunction setValueV4uiArray(gl, v) {\n\t\tgl.uniform4uiv(this.addr, v);\n\t} // Array of textures (2D / Cube)\n\n\n\tfunction setValueT1Array(gl, v, textures) {\n\t\tconst n = v.length;\n\t\tconst units = allocTexUnits(textures, n);\n\t\tgl.uniform1iv(this.addr, units);\n\n\t\tfor (let i = 0; i !== n; ++i) {\n\t\t\ttextures.safeSetTexture2D(v[i] || emptyTexture, units[i]);\n\t\t}\n\t}\n\n\tfunction setValueT6Array(gl, v, textures) {\n\t\tconst n = v.length;\n\t\tconst units = allocTexUnits(textures, n);\n\t\tgl.uniform1iv(this.addr, units);\n\n\t\tfor (let i = 0; i !== n; ++i) {\n\t\t\ttextures.safeSetTextureCube(v[i] || emptyCubeTexture, units[i]);\n\t\t}\n\t} // Helper to pick the right setter for a pure (bottom-level) array\n\n\n\tfunction getPureArraySetter(type) {\n\t\tswitch (type) {\n\t\t\tcase 0x1406:\n\t\t\t\treturn setValueV1fArray;\n\t\t\t// FLOAT\n\n\t\t\tcase 0x8b50:\n\t\t\t\treturn setValueV2fArray;\n\t\t\t// _VEC2\n\n\t\t\tcase 0x8b51:\n\t\t\t\treturn setValueV3fArray;\n\t\t\t// _VEC3\n\n\t\t\tcase 0x8b52:\n\t\t\t\treturn setValueV4fArray;\n\t\t\t// _VEC4\n\n\t\t\tcase 0x8b5a:\n\t\t\t\treturn setValueM2Array;\n\t\t\t// _MAT2\n\n\t\t\tcase 0x8b5b:\n\t\t\t\treturn setValueM3Array;\n\t\t\t// _MAT3\n\n\t\t\tcase 0x8b5c:\n\t\t\t\treturn setValueM4Array;\n\t\t\t// _MAT4\n\n\t\t\tcase 0x1404:\n\t\t\tcase 0x8b56:\n\t\t\t\treturn setValueV1iArray;\n\t\t\t// INT, BOOL\n\n\t\t\tcase 0x8b53:\n\t\t\tcase 0x8b57:\n\t\t\t\treturn setValueV2iArray;\n\t\t\t// _VEC2\n\n\t\t\tcase 0x8b54:\n\t\t\tcase 0x8b58:\n\t\t\t\treturn setValueV3iArray;\n\t\t\t// _VEC3\n\n\t\t\tcase 0x8b55:\n\t\t\tcase 0x8b59:\n\t\t\t\treturn setValueV4iArray;\n\t\t\t// _VEC4\n\n\t\t\tcase 0x1405:\n\t\t\t\treturn setValueV1uiArray;\n\t\t\t// UINT\n\n\t\t\tcase 0x8dc6:\n\t\t\t\treturn setValueV2uiArray;\n\t\t\t// _VEC2\n\n\t\t\tcase 0x8dc7:\n\t\t\t\treturn setValueV3uiArray;\n\t\t\t// _VEC3\n\n\t\t\tcase 0x8dc8:\n\t\t\t\treturn setValueV4uiArray;\n\t\t\t// _VEC4\n\n\t\t\tcase 0x8b5e: // SAMPLER_2D\n\n\t\t\tcase 0x8d66: // SAMPLER_EXTERNAL_OES\n\n\t\t\tcase 0x8dca: // INT_SAMPLER_2D\n\n\t\t\tcase 0x8dd2: // UNSIGNED_INT_SAMPLER_2D\n\n\t\t\tcase 0x8b62:\n\t\t\t\t// SAMPLER_2D_SHADOW\n\t\t\t\treturn setValueT1Array;\n\n\t\t\tcase 0x8b60: // SAMPLER_CUBE\n\n\t\t\tcase 0x8dcc: // INT_SAMPLER_CUBE\n\n\t\t\tcase 0x8dd4: // UNSIGNED_INT_SAMPLER_CUBE\n\n\t\t\tcase 0x8dc5:\n\t\t\t\t// SAMPLER_CUBE_SHADOW\n\t\t\t\treturn setValueT6Array;\n\t\t}\n\t} // --- Uniform Classes ---\n\n\n\tfunction SingleUniform(id, activeInfo, addr) {\n\t\tthis.id = id;\n\t\tthis.addr = addr;\n\t\tthis.cache = [];\n\t\tthis.setValue = getSingularSetter(activeInfo.type); // this.path = activeInfo.name; // DEBUG\n\t}\n\n\tfunction PureArrayUniform(id, activeInfo, addr) {\n\t\tthis.id = id;\n\t\tthis.addr = addr;\n\t\tthis.cache = [];\n\t\tthis.size = activeInfo.size;\n\t\tthis.setValue = getPureArraySetter(activeInfo.type); // this.path = activeInfo.name; // DEBUG\n\t}\n\n\tPureArrayUniform.prototype.updateCache = function (data) {\n\t\tconst cache = this.cache;\n\n\t\tif (data instanceof Float32Array && cache.length !== data.length) {\n\t\t\tthis.cache = new Float32Array(data.length);\n\t\t}\n\n\t\tcopyArray(cache, data);\n\t};\n\n\tfunction StructuredUniform(id) {\n\t\tthis.id = id;\n\t\tthis.seq = [];\n\t\tthis.map = {};\n\t}\n\n\tStructuredUniform.prototype.setValue = function (gl, value, textures) {\n\t\tconst seq = this.seq;\n\n\t\tfor (let i = 0, n = seq.length; i !== n; ++i) {\n\t\t\tconst u = seq[i];\n\t\t\tu.setValue(gl, value[u.id], textures);\n\t\t}\n\t}; // --- Top-level ---\n\t// Parser - builds up the property tree from the path strings\n\n\n\tconst RePathPart = /(\\w+)(\\])?(\\[|\\.)?/g; // extracts\n\t// \t- the identifier (member name or array index)\n\t//\t- followed by an optional right bracket (found when array index)\n\t//\t- followed by an optional left bracket or dot (type of subscript)\n\t//\n\t// Note: These portions can be read in a non-overlapping fashion and\n\t// allow straightforward parsing of the hierarchy that WebGL encodes\n\t// in the uniform names.\n\n\tfunction addUniform(container, uniformObject) {\n\t\tcontainer.seq.push(uniformObject);\n\t\tcontainer.map[uniformObject.id] = uniformObject;\n\t}\n\n\tfunction parseUniform(activeInfo, addr, container) {\n\t\tconst path = activeInfo.name,\n\t\t\t\t\tpathLength = path.length; // reset RegExp object, because of the early exit of a previous run\n\n\t\tRePathPart.lastIndex = 0;\n\n\t\twhile (true) {\n\t\t\tconst match = RePathPart.exec(path),\n\t\t\t\t\t\tmatchEnd = RePathPart.lastIndex;\n\t\t\tlet id = match[1];\n\t\t\tconst idIsIndex = match[2] === ']',\n\t\t\t\t\t\tsubscript = match[3];\n\t\t\tif (idIsIndex) id = id | 0; // convert to integer\n\n\t\t\tif (subscript === undefined || subscript === '[' && matchEnd + 2 === pathLength) {\n\t\t\t\t// bare name or \"pure\" bottom-level array \"[0]\" suffix\n\t\t\t\taddUniform(container, subscript === undefined ? new SingleUniform(id, activeInfo, addr) : new PureArrayUniform(id, activeInfo, addr));\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\t// step into inner node / create it in case it doesn't exist\n\t\t\t\tconst map = container.map;\n\t\t\t\tlet next = map[id];\n\n\t\t\t\tif (next === undefined) {\n\t\t\t\t\tnext = new StructuredUniform(id);\n\t\t\t\t\taddUniform(container, next);\n\t\t\t\t}\n\n\t\t\t\tcontainer = next;\n\t\t\t}\n\t\t}\n\t} // Root Container\n\n\n\tfunction WebGLUniforms(gl, program) {\n\t\tthis.seq = [];\n\t\tthis.map = {};\n\t\tconst n = gl.getProgramParameter(program, gl.ACTIVE_UNIFORMS);\n\n\t\tfor (let i = 0; i < n; ++i) {\n\t\t\tconst info = gl.getActiveUniform(program, i),\n\t\t\t\t\t\taddr = gl.getUniformLocation(program, info.name);\n\t\t\tparseUniform(info, addr, this);\n\t\t}\n\t}\n\n\tWebGLUniforms.prototype.setValue = function (gl, name, value, textures) {\n\t\tconst u = this.map[name];\n\t\tif (u !== undefined) u.setValue(gl, value, textures);\n\t};\n\n\tWebGLUniforms.prototype.setOptional = function (gl, object, name) {\n\t\tconst v = object[name];\n\t\tif (v !== undefined) this.setValue(gl, name, v);\n\t}; // Static interface\n\n\n\tWebGLUniforms.upload = function (gl, seq, values, textures) {\n\t\tfor (let i = 0, n = seq.length; i !== n; ++i) {\n\t\t\tconst u = seq[i],\n\t\t\t\t\t\tv = values[u.id];\n\n\t\t\tif (v.needsUpdate !== false) {\n\t\t\t\t// note: always updating when .needsUpdate is undefined\n\t\t\t\tu.setValue(gl, v.value, textures);\n\t\t\t}\n\t\t}\n\t};\n\n\tWebGLUniforms.seqWithValue = function (seq, values) {\n\t\tconst r = [];\n\n\t\tfor (let i = 0, n = seq.length; i !== n; ++i) {\n\t\t\tconst u = seq[i];\n\t\t\tif (u.id in values) r.push(u);\n\t\t}\n\n\t\treturn r;\n\t};\n\n\tfunction WebGLShader(gl, type, string) {\n\t\tconst shader = gl.createShader(type);\n\t\tgl.shaderSource(shader, string);\n\t\tgl.compileShader(shader);\n\t\treturn shader;\n\t}\n\n\tlet programIdCount = 0;\n\n\tfunction addLineNumbers(string) {\n\t\tconst lines = string.split('\\n');\n\n\t\tfor (let i = 0; i < lines.length; i++) {\n\t\t\tlines[i] = i + 1 + ': ' + lines[i];\n\t\t}\n\n\t\treturn lines.join('\\n');\n\t}\n\n\tfunction getEncodingComponents(encoding) {\n\t\tswitch (encoding) {\n\t\t\tcase LinearEncoding:\n\t\t\t\treturn ['Linear', '( value )'];\n\n\t\t\tcase sRGBEncoding:\n\t\t\t\treturn ['sRGB', '( value )'];\n\n\t\t\tcase RGBEEncoding:\n\t\t\t\treturn ['RGBE', '( value )'];\n\n\t\t\tcase RGBM7Encoding:\n\t\t\t\treturn ['RGBM', '( value, 7.0 )'];\n\n\t\t\tcase RGBM16Encoding:\n\t\t\t\treturn ['RGBM', '( value, 16.0 )'];\n\n\t\t\tcase RGBDEncoding:\n\t\t\t\treturn ['RGBD', '( value, 256.0 )'];\n\n\t\t\tcase GammaEncoding:\n\t\t\t\treturn ['Gamma', '( value, float( GAMMA_FACTOR ) )'];\n\n\t\t\tcase LogLuvEncoding:\n\t\t\t\treturn ['LogLuv', '( value )'];\n\n\t\t\tdefault:\n\t\t\t\tconsole.warn('THREE.WebGLProgram: Unsupported encoding:', encoding);\n\t\t\t\treturn ['Linear', '( value )'];\n\t\t}\n\t}\n\n\tfunction getShaderErrors(gl, shader, type) {\n\t\tconst status = gl.getShaderParameter(shader, gl.COMPILE_STATUS);\n\t\tconst errors = gl.getShaderInfoLog(shader).trim();\n\t\tif (status && errors === '') return ''; // --enable-privileged-webgl-extension\n\t\t// console.log( '**' + type + '**', gl.getExtension( 'WEBGL_debug_shaders' ).getTranslatedShaderSource( shader ) );\n\n\t\treturn type.toUpperCase() + '\\n\\n' + errors + '\\n\\n' + addLineNumbers(gl.getShaderSource(shader));\n\t}\n\n\tfunction getTexelDecodingFunction(functionName, encoding) {\n\t\tconst components = getEncodingComponents(encoding);\n\t\treturn 'vec4 ' + functionName + '( vec4 value ) { return ' + components[0] + 'ToLinear' + components[1] + '; }';\n\t}\n\n\tfunction getTexelEncodingFunction(functionName, encoding) {\n\t\tconst components = getEncodingComponents(encoding);\n\t\treturn 'vec4 ' + functionName + '( vec4 value ) { return LinearTo' + components[0] + components[1] + '; }';\n\t}\n\n\tfunction getToneMappingFunction(functionName, toneMapping) {\n\t\tlet toneMappingName;\n\n\t\tswitch (toneMapping) {\n\t\t\tcase LinearToneMapping:\n\t\t\t\ttoneMappingName = 'Linear';\n\t\t\t\tbreak;\n\n\t\t\tcase ReinhardToneMapping:\n\t\t\t\ttoneMappingName = 'Reinhard';\n\t\t\t\tbreak;\n\n\t\t\tcase CineonToneMapping:\n\t\t\t\ttoneMappingName = 'OptimizedCineon';\n\t\t\t\tbreak;\n\n\t\t\tcase ACESFilmicToneMapping:\n\t\t\t\ttoneMappingName = 'ACESFilmic';\n\t\t\t\tbreak;\n\n\t\t\tcase CustomToneMapping:\n\t\t\t\ttoneMappingName = 'Custom';\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tconsole.warn('THREE.WebGLProgram: Unsupported toneMapping:', toneMapping);\n\t\t\t\ttoneMappingName = 'Linear';\n\t\t}\n\n\t\treturn 'vec3 ' + functionName + '( vec3 color ) { return ' + toneMappingName + 'ToneMapping( color ); }';\n\t}\n\n\tfunction generateExtensions(parameters) {\n\t\tconst chunks = [parameters.extensionDerivatives || parameters.envMapCubeUV || parameters.bumpMap || parameters.tangentSpaceNormalMap || parameters.clearcoatNormalMap || parameters.flatShading || parameters.shaderID === 'physical' ? '#extension GL_OES_standard_derivatives : enable' : '', (parameters.extensionFragDepth || parameters.logarithmicDepthBuffer) && parameters.rendererExtensionFragDepth ? '#extension GL_EXT_frag_depth : enable' : '', parameters.extensionDrawBuffers && parameters.rendererExtensionDrawBuffers ? '#extension GL_EXT_draw_buffers : require' : '', (parameters.extensionShaderTextureLOD || parameters.envMap || parameters.transmission) && parameters.rendererExtensionShaderTextureLod ? '#extension GL_EXT_shader_texture_lod : enable' : ''];\n\t\treturn chunks.filter(filterEmptyLine).join('\\n');\n\t}\n\n\tfunction generateDefines(defines) {\n\t\tconst chunks = [];\n\n\t\tfor (const name in defines) {\n\t\t\tconst value = defines[name];\n\t\t\tif (value === false) continue;\n\t\t\tchunks.push('#define ' + name + ' ' + value);\n\t\t}\n\n\t\treturn chunks.join('\\n');\n\t}\n\n\tfunction fetchAttributeLocations(gl, program) {\n\t\tconst attributes = {};\n\t\tconst n = gl.getProgramParameter(program, gl.ACTIVE_ATTRIBUTES);\n\n\t\tfor (let i = 0; i < n; i++) {\n\t\t\tconst info = gl.getActiveAttrib(program, i);\n\t\t\tconst name = info.name;\n\t\t\tlet locationSize = 1;\n\t\t\tif (info.type === gl.FLOAT_MAT2) locationSize = 2;\n\t\t\tif (info.type === gl.FLOAT_MAT3) locationSize = 3;\n\t\t\tif (info.type === gl.FLOAT_MAT4) locationSize = 4; // console.log( 'THREE.WebGLProgram: ACTIVE VERTEX ATTRIBUTE:', name, i );\n\n\t\t\tattributes[name] = {\n\t\t\t\ttype: info.type,\n\t\t\t\tlocation: gl.getAttribLocation(program, name),\n\t\t\t\tlocationSize: locationSize\n\t\t\t};\n\t\t}\n\n\t\treturn attributes;\n\t}\n\n\tfunction filterEmptyLine(string) {\n\t\treturn string !== '';\n\t}\n\n\tfunction replaceLightNums(string, parameters) {\n\t\treturn string.replace(/NUM_DIR_LIGHTS/g, parameters.numDirLights).replace(/NUM_SPOT_LIGHTS/g, parameters.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g, parameters.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g, parameters.numPointLights).replace(/NUM_HEMI_LIGHTS/g, parameters.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g, parameters.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS/g, parameters.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g, parameters.numPointLightShadows);\n\t}\n\n\tfunction replaceClippingPlaneNums(string, parameters) {\n\t\treturn string.replace(/NUM_CLIPPING_PLANES/g, parameters.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g, parameters.numClippingPlanes - parameters.numClipIntersection);\n\t} // Resolve Includes\n\n\n\tconst includePattern = /^[ \\t]*#include +<([\\w\\d./]+)>/gm;\n\n\tfunction resolveIncludes(string) {\n\t\treturn string.replace(includePattern, includeReplacer);\n\t}\n\n\tfunction includeReplacer(match, include) {\n\t\tconst string = ShaderChunk[include];\n\n\t\tif (string === undefined) {\n\t\t\tthrow new Error('Can not resolve #include <' + include + '>');\n\t\t}\n\n\t\treturn resolveIncludes(string);\n\t} // Unroll Loops\n\n\n\tconst deprecatedUnrollLoopPattern = /#pragma unroll_loop[\\s]+?for \\( int i \\= (\\d+)\\; i < (\\d+)\\; i \\+\\+ \\) \\{([\\s\\S]+?)(?=\\})\\}/g;\n\tconst unrollLoopPattern = /#pragma unroll_loop_start\\s+for\\s*\\(\\s*int\\s+i\\s*=\\s*(\\d+)\\s*;\\s*i\\s*<\\s*(\\d+)\\s*;\\s*i\\s*\\+\\+\\s*\\)\\s*{([\\s\\S]+?)}\\s+#pragma unroll_loop_end/g;\n\n\tfunction unrollLoops(string) {\n\t\treturn string.replace(unrollLoopPattern, loopReplacer).replace(deprecatedUnrollLoopPattern, deprecatedLoopReplacer);\n\t}\n\n\tfunction deprecatedLoopReplacer(match, start, end, snippet) {\n\t\tconsole.warn('WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead.');\n\t\treturn loopReplacer(match, start, end, snippet);\n\t}\n\n\tfunction loopReplacer(match, start, end, snippet) {\n\t\tlet string = '';\n\n\t\tfor (let i = parseInt(start); i < parseInt(end); i++) {\n\t\t\tstring += snippet.replace(/\\[\\s*i\\s*\\]/g, '[ ' + i + ' ]').replace(/UNROLLED_LOOP_INDEX/g, i);\n\t\t}\n\n\t\treturn string;\n\t} //\n\n\n\tfunction generatePrecision(parameters) {\n\t\tlet precisionstring = 'precision ' + parameters.precision + ' float;\\nprecision ' + parameters.precision + ' int;';\n\n\t\tif (parameters.precision === 'highp') {\n\t\t\tprecisionstring += '\\n#define HIGH_PRECISION';\n\t\t} else if (parameters.precision === 'mediump') {\n\t\t\tprecisionstring += '\\n#define MEDIUM_PRECISION';\n\t\t} else if (parameters.precision === 'lowp') {\n\t\t\tprecisionstring += '\\n#define LOW_PRECISION';\n\t\t}\n\n\t\treturn precisionstring;\n\t}\n\n\tfunction generateShadowMapTypeDefine(parameters) {\n\t\tlet shadowMapTypeDefine = 'SHADOWMAP_TYPE_BASIC';\n\n\t\tif (parameters.shadowMapType === PCFShadowMap) {\n\t\t\tshadowMapTypeDefine = 'SHADOWMAP_TYPE_PCF';\n\t\t} else if (parameters.shadowMapType === PCFSoftShadowMap) {\n\t\t\tshadowMapTypeDefine = 'SHADOWMAP_TYPE_PCF_SOFT';\n\t\t} else if (parameters.shadowMapType === VSMShadowMap) {\n\t\t\tshadowMapTypeDefine = 'SHADOWMAP_TYPE_VSM';\n\t\t}\n\n\t\treturn shadowMapTypeDefine;\n\t}\n\n\tfunction generateEnvMapTypeDefine(parameters) {\n\t\tlet envMapTypeDefine = 'ENVMAP_TYPE_CUBE';\n\n\t\tif (parameters.envMap) {\n\t\t\tswitch (parameters.envMapMode) {\n\t\t\t\tcase CubeReflectionMapping:\n\t\t\t\tcase CubeRefractionMapping:\n\t\t\t\t\tenvMapTypeDefine = 'ENVMAP_TYPE_CUBE';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase CubeUVReflectionMapping:\n\t\t\t\tcase CubeUVRefractionMapping:\n\t\t\t\t\tenvMapTypeDefine = 'ENVMAP_TYPE_CUBE_UV';\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn envMapTypeDefine;\n\t}\n\n\tfunction generateEnvMapModeDefine(parameters) {\n\t\tlet envMapModeDefine = 'ENVMAP_MODE_REFLECTION';\n\n\t\tif (parameters.envMap) {\n\t\t\tswitch (parameters.envMapMode) {\n\t\t\t\tcase CubeRefractionMapping:\n\t\t\t\tcase CubeUVRefractionMapping:\n\t\t\t\t\tenvMapModeDefine = 'ENVMAP_MODE_REFRACTION';\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn envMapModeDefine;\n\t}\n\n\tfunction generateEnvMapBlendingDefine(parameters) {\n\t\tlet envMapBlendingDefine = 'ENVMAP_BLENDING_NONE';\n\n\t\tif (parameters.envMap) {\n\t\t\tswitch (parameters.combine) {\n\t\t\t\tcase MultiplyOperation:\n\t\t\t\t\tenvMapBlendingDefine = 'ENVMAP_BLENDING_MULTIPLY';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase MixOperation:\n\t\t\t\t\tenvMapBlendingDefine = 'ENVMAP_BLENDING_MIX';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase AddOperation:\n\t\t\t\t\tenvMapBlendingDefine = 'ENVMAP_BLENDING_ADD';\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn envMapBlendingDefine;\n\t}\n\n\tfunction WebGLProgram(renderer, cacheKey, parameters, bindingStates) {\n\t\t// TODO Send this event to Three.js DevTools\n\t\t// console.log( 'WebGLProgram', cacheKey );\n\t\tconst gl = renderer.getContext();\n\t\tconst defines = parameters.defines;\n\t\tlet vertexShader = parameters.vertexShader;\n\t\tlet fragmentShader = parameters.fragmentShader;\n\t\tconst shadowMapTypeDefine = generateShadowMapTypeDefine(parameters);\n\t\tconst envMapTypeDefine = generateEnvMapTypeDefine(parameters);\n\t\tconst envMapModeDefine = generateEnvMapModeDefine(parameters);\n\t\tconst envMapBlendingDefine = generateEnvMapBlendingDefine(parameters);\n\t\tconst gammaFactorDefine = renderer.gammaFactor > 0 ? renderer.gammaFactor : 1.0;\n\t\tconst customExtensions = parameters.isWebGL2 ? '' : generateExtensions(parameters);\n\t\tconst customDefines = generateDefines(defines);\n\t\tconst program = gl.createProgram();\n\t\tlet prefixVertex, prefixFragment;\n\t\tlet versionString = parameters.glslVersion ? '#version ' + parameters.glslVersion + '\\n' : '';\n\n\t\tif (parameters.isRawShaderMaterial) {\n\t\t\tprefixVertex = [customDefines].filter(filterEmptyLine).join('\\n');\n\n\t\t\tif (prefixVertex.length > 0) {\n\t\t\t\tprefixVertex += '\\n';\n\t\t\t}\n\n\t\t\tprefixFragment = [customExtensions, customDefines].filter(filterEmptyLine).join('\\n');\n\n\t\t\tif (prefixFragment.length > 0) {\n\t\t\t\tprefixFragment += '\\n';\n\t\t\t}\n\t\t} else {\n\t\t\tprefixVertex = [generatePrecision(parameters), '#define SHADER_NAME ' + parameters.shaderName, customDefines, parameters.instancing ? '#define USE_INSTANCING' : '', parameters.instancingColor ? '#define USE_INSTANCING_COLOR' : '', parameters.supportsVertexTextures ? '#define VERTEX_TEXTURES' : '', '#define GAMMA_FACTOR ' + gammaFactorDefine, '#define MAX_BONES ' + parameters.maxBones, parameters.useFog && parameters.fog ? '#define USE_FOG' : '', parameters.useFog && parameters.fogExp2 ? '#define FOG_EXP2' : '', parameters.map ? '#define USE_MAP' : '', parameters.envMap ? '#define USE_ENVMAP' : '', parameters.envMap ? '#define ' + envMapModeDefine : '', parameters.lightMap ? '#define USE_LIGHTMAP' : '', parameters.aoMap ? '#define USE_AOMAP' : '', parameters.emissiveMap ? '#define USE_EMISSIVEMAP' : '', parameters.bumpMap ? '#define USE_BUMPMAP' : '', parameters.normalMap ? '#define USE_NORMALMAP' : '', parameters.normalMap && parameters.objectSpaceNormalMap ? '#define OBJECTSPACE_NORMALMAP' : '', parameters.normalMap && parameters.tangentSpaceNormalMap ? '#define TANGENTSPACE_NORMALMAP' : '', parameters.clearcoatMap ? '#define USE_CLEARCOATMAP' : '', parameters.clearcoatRoughnessMap ? '#define USE_CLEARCOAT_ROUGHNESSMAP' : '', parameters.clearcoatNormalMap ? '#define USE_CLEARCOAT_NORMALMAP' : '', parameters.displacementMap && parameters.supportsVertexTextures ? '#define USE_DISPLACEMENTMAP' : '', parameters.specularMap ? '#define USE_SPECULARMAP' : '', parameters.specularIntensityMap ? '#define USE_SPECULARINTENSITYMAP' : '', parameters.specularTintMap ? '#define USE_SPECULARTINTMAP' : '', parameters.roughnessMap ? '#define USE_ROUGHNESSMAP' : '', parameters.metalnessMap ? '#define USE_METALNESSMAP' : '', parameters.alphaMap ? '#define USE_ALPHAMAP' : '', parameters.transmission ? '#define USE_TRANSMISSION' : '', parameters.transmissionMap ? '#define USE_TRANSMISSIONMAP' : '', parameters.thicknessMap ? '#define USE_THICKNESSMAP' : '', parameters.vertexTangents ? '#define USE_TANGENT' : '', parameters.vertexColors ? '#define USE_COLOR' : '', parameters.vertexAlphas ? '#define USE_COLOR_ALPHA' : '', parameters.vertexUvs ? '#define USE_UV' : '', parameters.uvsVertexOnly ? '#define UVS_VERTEX_ONLY' : '', parameters.flatShading ? '#define FLAT_SHADED' : '', parameters.skinning ? '#define USE_SKINNING' : '', parameters.useVertexTexture ? '#define BONE_TEXTURE' : '', parameters.morphTargets ? '#define USE_MORPHTARGETS' : '', parameters.morphNormals && parameters.flatShading === false ? '#define USE_MORPHNORMALS' : '', parameters.morphTargets && parameters.isWebGL2 ? '#define MORPHTARGETS_TEXTURE' : '', parameters.morphTargets && parameters.isWebGL2 ? '#define MORPHTARGETS_COUNT ' + parameters.morphTargetsCount : '', parameters.doubleSided ? '#define DOUBLE_SIDED' : '', parameters.flipSided ? '#define FLIP_SIDED' : '', parameters.shadowMapEnabled ? '#define USE_SHADOWMAP' : '', parameters.shadowMapEnabled ? '#define ' + shadowMapTypeDefine : '', parameters.sizeAttenuation ? '#define USE_SIZEATTENUATION' : '', parameters.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '', parameters.logarithmicDepthBuffer && parameters.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', '\tattribute mat4 instanceMatrix;', '#endif', '#ifdef USE_INSTANCING_COLOR', '\tattribute vec3 instanceColor;', '#endif', 'attribute vec3 position;', 'attribute vec3 normal;', 'attribute vec2 uv;', '#ifdef USE_TANGENT', '\tattribute vec4 tangent;', '#endif', '#if defined( USE_COLOR_ALPHA )', '\tattribute vec4 color;', '#elif defined( USE_COLOR )', '\tattribute vec3 color;', '#endif', '#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )', '\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(filterEmptyLine).join('\\n');\n\t\t\tprefixFragment = [customExtensions, generatePrecision(parameters), '#define SHADER_NAME ' + parameters.shaderName, customDefines, '#define GAMMA_FACTOR ' + gammaFactorDefine, parameters.useFog && parameters.fog ? '#define USE_FOG' : '', parameters.useFog && parameters.fogExp2 ? '#define FOG_EXP2' : '', parameters.map ? '#define USE_MAP' : '', parameters.matcap ? '#define USE_MATCAP' : '', parameters.envMap ? '#define USE_ENVMAP' : '', parameters.envMap ? '#define ' + envMapTypeDefine : '', parameters.envMap ? '#define ' + envMapModeDefine : '', parameters.envMap ? '#define ' + envMapBlendingDefine : '', parameters.lightMap ? '#define USE_LIGHTMAP' : '', parameters.aoMap ? '#define USE_AOMAP' : '', parameters.emissiveMap ? '#define USE_EMISSIVEMAP' : '', parameters.bumpMap ? '#define USE_BUMPMAP' : '', parameters.normalMap ? '#define USE_NORMALMAP' : '', parameters.normalMap && parameters.objectSpaceNormalMap ? '#define OBJECTSPACE_NORMALMAP' : '', parameters.normalMap && parameters.tangentSpaceNormalMap ? '#define TANGENTSPACE_NORMALMAP' : '', parameters.clearcoat ? '#define USE_CLEARCOAT' : '', parameters.clearcoatMap ? '#define USE_CLEARCOATMAP' : '', parameters.clearcoatRoughnessMap ? '#define USE_CLEARCOAT_ROUGHNESSMAP' : '', parameters.clearcoatNormalMap ? '#define USE_CLEARCOAT_NORMALMAP' : '', parameters.specularMap ? '#define USE_SPECULARMAP' : '', parameters.specularIntensityMap ? '#define USE_SPECULARINTENSITYMAP' : '', parameters.specularTintMap ? '#define USE_SPECULARTINTMAP' : '', parameters.roughnessMap ? '#define USE_ROUGHNESSMAP' : '', parameters.metalnessMap ? '#define USE_METALNESSMAP' : '', parameters.alphaMap ? '#define USE_ALPHAMAP' : '', parameters.alphaTest ? '#define USE_ALPHATEST' : '', parameters.sheen ? '#define USE_SHEEN' : '', parameters.transmission ? '#define USE_TRANSMISSION' : '', parameters.transmissionMap ? '#define USE_TRANSMISSIONMAP' : '', parameters.thicknessMap ? '#define USE_THICKNESSMAP' : '', parameters.vertexTangents ? '#define USE_TANGENT' : '', parameters.vertexColors || parameters.instancingColor ? '#define USE_COLOR' : '', parameters.vertexAlphas ? '#define USE_COLOR_ALPHA' : '', parameters.vertexUvs ? '#define USE_UV' : '', parameters.uvsVertexOnly ? '#define UVS_VERTEX_ONLY' : '', parameters.gradientMap ? '#define USE_GRADIENTMAP' : '', parameters.flatShading ? '#define FLAT_SHADED' : '', parameters.doubleSided ? '#define DOUBLE_SIDED' : '', parameters.flipSided ? '#define FLIP_SIDED' : '', parameters.shadowMapEnabled ? '#define USE_SHADOWMAP' : '', parameters.shadowMapEnabled ? '#define ' + shadowMapTypeDefine : '', parameters.premultipliedAlpha ? '#define PREMULTIPLIED_ALPHA' : '', parameters.physicallyCorrectLights ? '#define PHYSICALLY_CORRECT_LIGHTS' : '', parameters.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '', parameters.logarithmicDepthBuffer && parameters.rendererExtensionFragDepth ? '#define USE_LOGDEPTHBUF_EXT' : '', (parameters.extensionShaderTextureLOD || parameters.envMap) && parameters.rendererExtensionShaderTextureLod ? '#define TEXTURE_LOD_EXT' : '', 'uniform mat4 viewMatrix;', 'uniform vec3 cameraPosition;', 'uniform bool isOrthographic;', parameters.toneMapping !== NoToneMapping ? '#define TONE_MAPPING' : '', parameters.toneMapping !== NoToneMapping ? ShaderChunk['tonemapping_pars_fragment'] : '', // this code is required here because it is used by the toneMapping() function defined below\n\t\t\tparameters.toneMapping !== NoToneMapping ? getToneMappingFunction('toneMapping', parameters.toneMapping) : '', parameters.dithering ? '#define DITHERING' : '', parameters.format === RGBFormat ? '#define OPAQUE' : '', ShaderChunk['encodings_pars_fragment'], // this code is required here because it is used by the various encoding/decoding function defined below\n\t\t\tparameters.map ? getTexelDecodingFunction('mapTexelToLinear', parameters.mapEncoding) : '', parameters.matcap ? getTexelDecodingFunction('matcapTexelToLinear', parameters.matcapEncoding) : '', parameters.envMap ? getTexelDecodingFunction('envMapTexelToLinear', parameters.envMapEncoding) : '', parameters.emissiveMap ? getTexelDecodingFunction('emissiveMapTexelToLinear', parameters.emissiveMapEncoding) : '', parameters.specularTintMap ? getTexelDecodingFunction('specularTintMapTexelToLinear', parameters.specularTintMapEncoding) : '', parameters.lightMap ? getTexelDecodingFunction('lightMapTexelToLinear', parameters.lightMapEncoding) : '', getTexelEncodingFunction('linearToOutputTexel', parameters.outputEncoding), parameters.depthPacking ? '#define DEPTH_PACKING ' + parameters.depthPacking : '', '\\n'].filter(filterEmptyLine).join('\\n');\n\t\t}\n\n\t\tvertexShader = resolveIncludes(vertexShader);\n\t\tvertexShader = replaceLightNums(vertexShader, parameters);\n\t\tvertexShader = replaceClippingPlaneNums(vertexShader, parameters);\n\t\tfragmentShader = resolveIncludes(fragmentShader);\n\t\tfragmentShader = replaceLightNums(fragmentShader, parameters);\n\t\tfragmentShader = replaceClippingPlaneNums(fragmentShader, parameters);\n\t\tvertexShader = unrollLoops(vertexShader);\n\t\tfragmentShader = unrollLoops(fragmentShader);\n\n\t\tif (parameters.isWebGL2 && parameters.isRawShaderMaterial !== true) {\n\t\t\t// GLSL 3.0 conversion for built-in materials and ShaderMaterial\n\t\t\tversionString = '#version 300 es\\n';\n\t\t\tprefixVertex = ['precision mediump sampler2DArray;', '#define attribute in', '#define varying out', '#define texture2D texture'].join('\\n') + '\\n' + prefixVertex;\n\t\t\tprefixFragment = ['#define varying in', parameters.glslVersion === GLSL3 ? '' : 'out highp vec4 pc_fragColor;', parameters.glslVersion === GLSL3 ? '' : '#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' + prefixFragment;\n\t\t}\n\n\t\tconst vertexGlsl = versionString + prefixVertex + vertexShader;\n\t\tconst fragmentGlsl = versionString + prefixFragment + fragmentShader; // console.log( '*VERTEX*', vertexGlsl );\n\t\t// console.log( '*FRAGMENT*', fragmentGlsl );\n\n\t\tconst glVertexShader = WebGLShader(gl, gl.VERTEX_SHADER, vertexGlsl);\n\t\tconst glFragmentShader = WebGLShader(gl, gl.FRAGMENT_SHADER, fragmentGlsl);\n\t\tgl.attachShader(program, glVertexShader);\n\t\tgl.attachShader(program, glFragmentShader); // Force a particular attribute to index 0.\n\n\t\tif (parameters.index0AttributeName !== undefined) {\n\t\t\tgl.bindAttribLocation(program, 0, parameters.index0AttributeName);\n\t\t} else if (parameters.morphTargets === true) {\n\t\t\t// programs with morphTargets displace position out of attribute 0\n\t\t\tgl.bindAttribLocation(program, 0, 'position');\n\t\t}\n\n\t\tgl.linkProgram(program); // check for link errors\n\n\t\tif (renderer.debug.checkShaderErrors) {\n\t\t\tconst programLog = gl.getProgramInfoLog(program).trim();\n\t\t\tconst vertexLog = gl.getShaderInfoLog(glVertexShader).trim();\n\t\t\tconst fragmentLog = gl.getShaderInfoLog(glFragmentShader).trim();\n\t\t\tlet runnable = true;\n\t\t\tlet haveDiagnostics = true;\n\n\t\t\tif (gl.getProgramParameter(program, gl.LINK_STATUS) === false) {\n\t\t\t\trunnable = false;\n\t\t\t\tconst vertexErrors = getShaderErrors(gl, glVertexShader, 'vertex');\n\t\t\t\tconst fragmentErrors = getShaderErrors(gl, glFragmentShader, 'fragment');\n\t\t\t\tconsole.error('THREE.WebGLProgram: Shader Error ' + gl.getError() + ' - ' + 'VALIDATE_STATUS ' + gl.getProgramParameter(program, gl.VALIDATE_STATUS) + '\\n\\n' + 'Program Info Log: ' + programLog + '\\n' + vertexErrors + '\\n' + fragmentErrors);\n\t\t\t} else if (programLog !== '') {\n\t\t\t\tconsole.warn('THREE.WebGLProgram: Program Info Log:', programLog);\n\t\t\t} else if (vertexLog === '' || fragmentLog === '') {\n\t\t\t\thaveDiagnostics = false;\n\t\t\t}\n\n\t\t\tif (haveDiagnostics) {\n\t\t\t\tthis.diagnostics = {\n\t\t\t\t\trunnable: runnable,\n\t\t\t\t\tprogramLog: programLog,\n\t\t\t\t\tvertexShader: {\n\t\t\t\t\t\tlog: vertexLog,\n\t\t\t\t\t\tprefix: prefixVertex\n\t\t\t\t\t},\n\t\t\t\t\tfragmentShader: {\n\t\t\t\t\t\tlog: fragmentLog,\n\t\t\t\t\t\tprefix: prefixFragment\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\t} // Clean up\n\t\t// Crashes in iOS9 and iOS10. #18402\n\t\t// gl.detachShader( program, glVertexShader );\n\t\t// gl.detachShader( program, glFragmentShader );\n\n\n\t\tgl.deleteShader(glVertexShader);\n\t\tgl.deleteShader(glFragmentShader); // set up caching for uniform locations\n\n\t\tlet cachedUniforms;\n\n\t\tthis.getUniforms = function () {\n\t\t\tif (cachedUniforms === undefined) {\n\t\t\t\tcachedUniforms = new WebGLUniforms(gl, program);\n\t\t\t}\n\n\t\t\treturn cachedUniforms;\n\t\t}; // set up caching for attribute locations\n\n\n\t\tlet cachedAttributes;\n\n\t\tthis.getAttributes = function () {\n\t\t\tif (cachedAttributes === undefined) {\n\t\t\t\tcachedAttributes = fetchAttributeLocations(gl, program);\n\t\t\t}\n\n\t\t\treturn cachedAttributes;\n\t\t}; // free resource\n\n\n\t\tthis.destroy = function () {\n\t\t\tbindingStates.releaseStatesOfProgram(this);\n\t\t\tgl.deleteProgram(program);\n\t\t\tthis.program = undefined;\n\t\t}; //\n\n\n\t\tthis.name = parameters.shaderName;\n\t\tthis.id = programIdCount++;\n\t\tthis.cacheKey = cacheKey;\n\t\tthis.usedTimes = 1;\n\t\tthis.program = program;\n\t\tthis.vertexShader = glVertexShader;\n\t\tthis.fragmentShader = glFragmentShader;\n\t\treturn this;\n\t}\n\n\tfunction WebGLPrograms(renderer, cubemaps, cubeuvmaps, extensions, capabilities, bindingStates, clipping) {\n\t\tconst programs = [];\n\t\tconst isWebGL2 = capabilities.isWebGL2;\n\t\tconst logarithmicDepthBuffer = capabilities.logarithmicDepthBuffer;\n\t\tconst floatVertexTextures = capabilities.floatVertexTextures;\n\t\tconst maxVertexUniforms = capabilities.maxVertexUniforms;\n\t\tconst vertexTextures = capabilities.vertexTextures;\n\t\tlet precision = capabilities.precision;\n\t\tconst shaderIDs = {\n\t\t\tMeshDepthMaterial: 'depth',\n\t\t\tMeshDistanceMaterial: 'distanceRGBA',\n\t\t\tMeshNormalMaterial: 'normal',\n\t\t\tMeshBasicMaterial: 'basic',\n\t\t\tMeshLambertMaterial: 'lambert',\n\t\t\tMeshPhongMaterial: 'phong',\n\t\t\tMeshToonMaterial: 'toon',\n\t\t\tMeshStandardMaterial: 'physical',\n\t\t\tMeshPhysicalMaterial: 'physical',\n\t\t\tMeshMatcapMaterial: 'matcap',\n\t\t\tLineBasicMaterial: 'basic',\n\t\t\tLineDashedMaterial: 'dashed',\n\t\t\tPointsMaterial: 'points',\n\t\t\tShadowMaterial: 'shadow',\n\t\t\tSpriteMaterial: 'sprite'\n\t\t};\n\t\tconst parameterNames = ['precision', 'isWebGL2', 'supportsVertexTextures', 'outputEncoding', 'instancing', 'instancingColor', 'map', 'mapEncoding', 'matcap', 'matcapEncoding', 'envMap', 'envMapMode', 'envMapEncoding', 'envMapCubeUV', 'lightMap', 'lightMapEncoding', 'aoMap', 'emissiveMap', 'emissiveMapEncoding', 'bumpMap', 'normalMap', 'objectSpaceNormalMap', 'tangentSpaceNormalMap', 'clearcoat', 'clearcoatMap', 'clearcoatRoughnessMap', 'clearcoatNormalMap', 'displacementMap', 'specularMap', 'specularIntensityMap', 'specularTintMap', 'specularTintMapEncoding', 'roughnessMap', 'metalnessMap', 'gradientMap', 'alphaMap', 'alphaTest', 'combine', 'vertexColors', 'vertexAlphas', 'vertexTangents', 'vertexUvs', 'uvsVertexOnly', 'fog', 'useFog', 'fogExp2', 'flatShading', 'sizeAttenuation', 'logarithmicDepthBuffer', 'skinning', 'maxBones', 'useVertexTexture', 'morphTargets', 'morphNormals', 'morphTargetsCount', 'premultipliedAlpha', 'numDirLights', 'numPointLights', 'numSpotLights', 'numHemiLights', 'numRectAreaLights', 'numDirLightShadows', 'numPointLightShadows', 'numSpotLightShadows', 'shadowMapEnabled', 'shadowMapType', 'toneMapping', 'physicallyCorrectLights', 'doubleSided', 'flipSided', 'numClippingPlanes', 'numClipIntersection', 'depthPacking', 'dithering', 'format', 'sheen', 'transmission', 'transmissionMap', 'thicknessMap'];\n\n\t\tfunction getMaxBones(object) {\n\t\t\tconst skeleton = object.skeleton;\n\t\t\tconst bones = skeleton.bones;\n\n\t\t\tif (floatVertexTextures) {\n\t\t\t\treturn 1024;\n\t\t\t} else {\n\t\t\t\t// default for when object is not specified\n\t\t\t\t// ( for example when prebuilding shader to be used with multiple objects )\n\t\t\t\t//\n\t\t\t\t//\t- leave some extra space for other uniforms\n\t\t\t\t//\t- limit here is ANGLE's 254 max uniform vectors\n\t\t\t\t//\t\t(up to 54 should be safe)\n\t\t\t\tconst nVertexUniforms = maxVertexUniforms;\n\t\t\t\tconst nVertexMatrices = Math.floor((nVertexUniforms - 20) / 4);\n\t\t\t\tconst maxBones = Math.min(nVertexMatrices, bones.length);\n\n\t\t\t\tif (maxBones < bones.length) {\n\t\t\t\t\tconsole.warn('THREE.WebGLRenderer: Skeleton has ' + bones.length + ' bones. This GPU supports ' + maxBones + '.');\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\n\t\t\t\treturn maxBones;\n\t\t\t}\n\t\t}\n\n\t\tfunction getTextureEncodingFromMap(map) {\n\t\t\tlet encoding;\n\n\t\t\tif (map && map.isTexture) {\n\t\t\t\tencoding = map.encoding;\n\t\t\t} else if (map && map.isWebGLRenderTarget) {\n\t\t\t\tconsole.warn('THREE.WebGLPrograms.getTextureEncodingFromMap: don\\'t use render targets as textures. Use their .texture property instead.');\n\t\t\t\tencoding = map.texture.encoding;\n\t\t\t} else {\n\t\t\t\tencoding = LinearEncoding;\n\t\t\t}\n\n\t\t\tif (isWebGL2 && map && map.isTexture && map.format === RGBAFormat && map.type === UnsignedByteType && map.encoding === sRGBEncoding) {\n\t\t\t\tencoding = LinearEncoding; // disable inline decode for sRGB textures in WebGL 2\n\t\t\t}\n\n\t\t\treturn encoding;\n\t\t}\n\n\t\tfunction getParameters(material, lights, shadows, scene, object) {\n\t\t\tconst fog = scene.fog;\n\t\t\tconst environment = material.isMeshStandardMaterial ? scene.environment : null;\n\t\t\tconst envMap = (material.isMeshStandardMaterial ? cubeuvmaps : cubemaps).get(material.envMap || environment);\n\t\t\tconst shaderID = shaderIDs[material.type]; // heuristics to create shader parameters according to lights in the scene\n\t\t\t// (not to blow over maxLights budget)\n\n\t\t\tconst maxBones = object.isSkinnedMesh ? getMaxBones(object) : 0;\n\n\t\t\tif (material.precision !== null) {\n\t\t\t\tprecision = capabilities.getMaxPrecision(material.precision);\n\n\t\t\t\tif (precision !== material.precision) {\n\t\t\t\t\tconsole.warn('THREE.WebGLProgram.getParameters:', material.precision, 'not supported, using', precision, 'instead.');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet vertexShader, fragmentShader;\n\n\t\t\tif (shaderID) {\n\t\t\t\tconst shader = ShaderLib[shaderID];\n\t\t\t\tvertexShader = shader.vertexShader;\n\t\t\t\tfragmentShader = shader.fragmentShader;\n\t\t\t} else {\n\t\t\t\tvertexShader = material.vertexShader;\n\t\t\t\tfragmentShader = material.fragmentShader;\n\t\t\t}\n\n\t\t\tconst currentRenderTarget = renderer.getRenderTarget();\n\t\t\tconst useAlphaTest = material.alphaTest > 0;\n\t\t\tconst useClearcoat = material.clearcoat > 0;\n\t\t\tconst parameters = {\n\t\t\t\tisWebGL2: isWebGL2,\n\t\t\t\tshaderID: shaderID,\n\t\t\t\tshaderName: material.type,\n\t\t\t\tvertexShader: vertexShader,\n\t\t\t\tfragmentShader: fragmentShader,\n\t\t\t\tdefines: material.defines,\n\t\t\t\tisRawShaderMaterial: material.isRawShaderMaterial === true,\n\t\t\t\tglslVersion: material.glslVersion,\n\t\t\t\tprecision: precision,\n\t\t\t\tinstancing: object.isInstancedMesh === true,\n\t\t\t\tinstancingColor: object.isInstancedMesh === true && object.instanceColor !== null,\n\t\t\t\tsupportsVertexTextures: vertexTextures,\n\t\t\t\toutputEncoding: currentRenderTarget !== null ? getTextureEncodingFromMap(currentRenderTarget.texture) : renderer.outputEncoding,\n\t\t\t\tmap: !!material.map,\n\t\t\t\tmapEncoding: getTextureEncodingFromMap(material.map),\n\t\t\t\tmatcap: !!material.matcap,\n\t\t\t\tmatcapEncoding: getTextureEncodingFromMap(material.matcap),\n\t\t\t\tenvMap: !!envMap,\n\t\t\t\tenvMapMode: envMap && envMap.mapping,\n\t\t\t\tenvMapEncoding: getTextureEncodingFromMap(envMap),\n\t\t\t\tenvMapCubeUV: !!envMap && (envMap.mapping === CubeUVReflectionMapping || envMap.mapping === CubeUVRefractionMapping),\n\t\t\t\tlightMap: !!material.lightMap,\n\t\t\t\tlightMapEncoding: getTextureEncodingFromMap(material.lightMap),\n\t\t\t\taoMap: !!material.aoMap,\n\t\t\t\temissiveMap: !!material.emissiveMap,\n\t\t\t\temissiveMapEncoding: getTextureEncodingFromMap(material.emissiveMap),\n\t\t\t\tbumpMap: !!material.bumpMap,\n\t\t\t\tnormalMap: !!material.normalMap,\n\t\t\t\tobjectSpaceNormalMap: material.normalMapType === ObjectSpaceNormalMap,\n\t\t\t\ttangentSpaceNormalMap: material.normalMapType === TangentSpaceNormalMap,\n\t\t\t\tclearcoat: useClearcoat,\n\t\t\t\tclearcoatMap: useClearcoat && !!material.clearcoatMap,\n\t\t\t\tclearcoatRoughnessMap: useClearcoat && !!material.clearcoatRoughnessMap,\n\t\t\t\tclearcoatNormalMap: useClearcoat && !!material.clearcoatNormalMap,\n\t\t\t\tdisplacementMap: !!material.displacementMap,\n\t\t\t\troughnessMap: !!material.roughnessMap,\n\t\t\t\tmetalnessMap: !!material.metalnessMap,\n\t\t\t\tspecularMap: !!material.specularMap,\n\t\t\t\tspecularIntensityMap: !!material.specularIntensityMap,\n\t\t\t\tspecularTintMap: !!material.specularTintMap,\n\t\t\t\tspecularTintMapEncoding: getTextureEncodingFromMap(material.specularTintMap),\n\t\t\t\talphaMap: !!material.alphaMap,\n\t\t\t\talphaTest: useAlphaTest,\n\t\t\t\tgradientMap: !!material.gradientMap,\n\t\t\t\tsheen: material.sheen > 0,\n\t\t\t\ttransmission: material.transmission > 0,\n\t\t\t\ttransmissionMap: !!material.transmissionMap,\n\t\t\t\tthicknessMap: !!material.thicknessMap,\n\t\t\t\tcombine: material.combine,\n\t\t\t\tvertexTangents: !!material.normalMap && !!object.geometry && !!object.geometry.attributes.tangent,\n\t\t\t\tvertexColors: material.vertexColors,\n\t\t\t\tvertexAlphas: material.vertexColors === true && !!object.geometry && !!object.geometry.attributes.color && object.geometry.attributes.color.itemSize === 4,\n\t\t\t\tvertexUvs: !!material.map || !!material.bumpMap || !!material.normalMap || !!material.specularMap || !!material.alphaMap || !!material.emissiveMap || !!material.roughnessMap || !!material.metalnessMap || !!material.clearcoatMap || !!material.clearcoatRoughnessMap || !!material.clearcoatNormalMap || !!material.displacementMap || !!material.transmissionMap || !!material.thicknessMap || !!material.specularIntensityMap || !!material.specularTintMap,\n\t\t\t\tuvsVertexOnly: !(!!material.map || !!material.bumpMap || !!material.normalMap || !!material.specularMap || !!material.alphaMap || !!material.emissiveMap || !!material.roughnessMap || !!material.metalnessMap || !!material.clearcoatNormalMap || material.transmission > 0 || !!material.transmissionMap || !!material.thicknessMap || !!material.specularIntensityMap || !!material.specularTintMap) && !!material.displacementMap,\n\t\t\t\tfog: !!fog,\n\t\t\t\tuseFog: material.fog,\n\t\t\t\tfogExp2: fog && fog.isFogExp2,\n\t\t\t\tflatShading: !!material.flatShading,\n\t\t\t\tsizeAttenuation: material.sizeAttenuation,\n\t\t\t\tlogarithmicDepthBuffer: logarithmicDepthBuffer,\n\t\t\t\tskinning: object.isSkinnedMesh === true && maxBones > 0,\n\t\t\t\tmaxBones: maxBones,\n\t\t\t\tuseVertexTexture: floatVertexTextures,\n\t\t\t\tmorphTargets: !!object.geometry && !!object.geometry.morphAttributes.position,\n\t\t\t\tmorphNormals: !!object.geometry && !!object.geometry.morphAttributes.normal,\n\t\t\t\tmorphTargetsCount: !!object.geometry && !!object.geometry.morphAttributes.position ? object.geometry.morphAttributes.position.length : 0,\n\t\t\t\tnumDirLights: lights.directional.length,\n\t\t\t\tnumPointLights: lights.point.length,\n\t\t\t\tnumSpotLights: lights.spot.length,\n\t\t\t\tnumRectAreaLights: lights.rectArea.length,\n\t\t\t\tnumHemiLights: lights.hemi.length,\n\t\t\t\tnumDirLightShadows: lights.directionalShadowMap.length,\n\t\t\t\tnumPointLightShadows: lights.pointShadowMap.length,\n\t\t\t\tnumSpotLightShadows: lights.spotShadowMap.length,\n\t\t\t\tnumClippingPlanes: clipping.numPlanes,\n\t\t\t\tnumClipIntersection: clipping.numIntersection,\n\t\t\t\tformat: material.format,\n\t\t\t\tdithering: material.dithering,\n\t\t\t\tshadowMapEnabled: renderer.shadowMap.enabled && shadows.length > 0,\n\t\t\t\tshadowMapType: renderer.shadowMap.type,\n\t\t\t\ttoneMapping: material.toneMapped ? renderer.toneMapping : NoToneMapping,\n\t\t\t\tphysicallyCorrectLights: renderer.physicallyCorrectLights,\n\t\t\t\tpremultipliedAlpha: material.premultipliedAlpha,\n\t\t\t\tdoubleSided: material.side === DoubleSide,\n\t\t\t\tflipSided: material.side === BackSide,\n\t\t\t\tdepthPacking: material.depthPacking !== undefined ? material.depthPacking : false,\n\t\t\t\tindex0AttributeName: material.index0AttributeName,\n\t\t\t\textensionDerivatives: material.extensions && material.extensions.derivatives,\n\t\t\t\textensionFragDepth: material.extensions && material.extensions.fragDepth,\n\t\t\t\textensionDrawBuffers: material.extensions && material.extensions.drawBuffers,\n\t\t\t\textensionShaderTextureLOD: material.extensions && material.extensions.shaderTextureLOD,\n\t\t\t\trendererExtensionFragDepth: isWebGL2 || extensions.has('EXT_frag_depth'),\n\t\t\t\trendererExtensionDrawBuffers: isWebGL2 || extensions.has('WEBGL_draw_buffers'),\n\t\t\t\trendererExtensionShaderTextureLod: isWebGL2 || extensions.has('EXT_shader_texture_lod'),\n\t\t\t\tcustomProgramCacheKey: material.customProgramCacheKey()\n\t\t\t};\n\t\t\treturn parameters;\n\t\t}\n\n\t\tfunction getProgramCacheKey(parameters) {\n\t\t\tconst array = [];\n\n\t\t\tif (parameters.shaderID) {\n\t\t\t\tarray.push(parameters.shaderID);\n\t\t\t} else {\n\t\t\t\tarray.push(parameters.fragmentShader);\n\t\t\t\tarray.push(parameters.vertexShader);\n\t\t\t}\n\n\t\t\tif (parameters.defines !== undefined) {\n\t\t\t\tfor (const name in parameters.defines) {\n\t\t\t\t\tarray.push(name);\n\t\t\t\t\tarray.push(parameters.defines[name]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (parameters.isRawShaderMaterial === false) {\n\t\t\t\tfor (let i = 0; i < parameterNames.length; i++) {\n\t\t\t\t\tarray.push(parameters[parameterNames[i]]);\n\t\t\t\t}\n\n\t\t\t\tarray.push(renderer.outputEncoding);\n\t\t\t\tarray.push(renderer.gammaFactor);\n\t\t\t}\n\n\t\t\tarray.push(parameters.customProgramCacheKey);\n\t\t\treturn array.join();\n\t\t}\n\n\t\tfunction getUniforms(material) {\n\t\t\tconst shaderID = shaderIDs[material.type];\n\t\t\tlet uniforms;\n\n\t\t\tif (shaderID) {\n\t\t\t\tconst shader = ShaderLib[shaderID];\n\t\t\t\tuniforms = UniformsUtils.clone(shader.uniforms);\n\t\t\t} else {\n\t\t\t\tuniforms = material.uniforms;\n\t\t\t}\n\n\t\t\treturn uniforms;\n\t\t}\n\n\t\tfunction acquireProgram(parameters, cacheKey) {\n\t\t\tlet program; // Check if code has been already compiled\n\n\t\t\tfor (let p = 0, pl = programs.length; p < pl; p++) {\n\t\t\t\tconst preexistingProgram = programs[p];\n\n\t\t\t\tif (preexistingProgram.cacheKey === cacheKey) {\n\t\t\t\t\tprogram = preexistingProgram;\n\t\t\t\t\t++program.usedTimes;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (program === undefined) {\n\t\t\t\tprogram = new WebGLProgram(renderer, cacheKey, parameters, bindingStates);\n\t\t\t\tprograms.push(program);\n\t\t\t}\n\n\t\t\treturn program;\n\t\t}\n\n\t\tfunction releaseProgram(program) {\n\t\t\tif (--program.usedTimes === 0) {\n\t\t\t\t// Remove from unordered set\n\t\t\t\tconst i = programs.indexOf(program);\n\t\t\t\tprograms[i] = programs[programs.length - 1];\n\t\t\t\tprograms.pop(); // Free WebGL resources\n\n\t\t\t\tprogram.destroy();\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tgetParameters: getParameters,\n\t\t\tgetProgramCacheKey: getProgramCacheKey,\n\t\t\tgetUniforms: getUniforms,\n\t\t\tacquireProgram: acquireProgram,\n\t\t\treleaseProgram: releaseProgram,\n\t\t\t// Exposed for resource monitoring & error feedback via renderer.info:\n\t\t\tprograms: programs\n\t\t};\n\t}\n\n\tfunction WebGLProperties() {\n\t\tlet properties = new WeakMap();\n\n\t\tfunction get(object) {\n\t\t\tlet map = properties.get(object);\n\n\t\t\tif (map === undefined) {\n\t\t\t\tmap = {};\n\t\t\t\tproperties.set(object, map);\n\t\t\t}\n\n\t\t\treturn map;\n\t\t}\n\n\t\tfunction remove(object) {\n\t\t\tproperties.delete(object);\n\t\t}\n\n\t\tfunction update(object, key, value) {\n\t\t\tproperties.get(object)[key] = value;\n\t\t}\n\n\t\tfunction dispose() {\n\t\t\tproperties = new WeakMap();\n\t\t}\n\n\t\treturn {\n\t\t\tget: get,\n\t\t\tremove: remove,\n\t\t\tupdate: update,\n\t\t\tdispose: dispose\n\t\t};\n\t}\n\n\tfunction painterSortStable(a, b) {\n\t\tif (a.groupOrder !== b.groupOrder) {\n\t\t\treturn a.groupOrder - b.groupOrder;\n\t\t} else if (a.renderOrder !== b.renderOrder) {\n\t\t\treturn a.renderOrder - b.renderOrder;\n\t\t} else if (a.program !== b.program) {\n\t\t\treturn a.program.id - b.program.id;\n\t\t} else if (a.material.id !== b.material.id) {\n\t\t\treturn a.material.id - b.material.id;\n\t\t} else if (a.z !== b.z) {\n\t\t\treturn a.z - b.z;\n\t\t} else {\n\t\t\treturn a.id - b.id;\n\t\t}\n\t}\n\n\tfunction reversePainterSortStable(a, b) {\n\t\tif (a.groupOrder !== b.groupOrder) {\n\t\t\treturn a.groupOrder - b.groupOrder;\n\t\t} else if (a.renderOrder !== b.renderOrder) {\n\t\t\treturn a.renderOrder - b.renderOrder;\n\t\t} else if (a.z !== b.z) {\n\t\t\treturn b.z - a.z;\n\t\t} else {\n\t\t\treturn a.id - b.id;\n\t\t}\n\t}\n\n\tfunction WebGLRenderList(properties) {\n\t\tconst renderItems = [];\n\t\tlet renderItemsIndex = 0;\n\t\tconst opaque = [];\n\t\tconst transmissive = [];\n\t\tconst transparent = [];\n\t\tconst defaultProgram = {\n\t\t\tid: -1\n\t\t};\n\n\t\tfunction init() {\n\t\t\trenderItemsIndex = 0;\n\t\t\topaque.length = 0;\n\t\t\ttransmissive.length = 0;\n\t\t\ttransparent.length = 0;\n\t\t}\n\n\t\tfunction getNextRenderItem(object, geometry, material, groupOrder, z, group) {\n\t\t\tlet renderItem = renderItems[renderItemsIndex];\n\t\t\tconst materialProperties = properties.get(material);\n\n\t\t\tif (renderItem === undefined) {\n\t\t\t\trenderItem = {\n\t\t\t\t\tid: object.id,\n\t\t\t\t\tobject: object,\n\t\t\t\t\tgeometry: geometry,\n\t\t\t\t\tmaterial: material,\n\t\t\t\t\tprogram: materialProperties.program || defaultProgram,\n\t\t\t\t\tgroupOrder: groupOrder,\n\t\t\t\t\trenderOrder: object.renderOrder,\n\t\t\t\t\tz: z,\n\t\t\t\t\tgroup: group\n\t\t\t\t};\n\t\t\t\trenderItems[renderItemsIndex] = renderItem;\n\t\t\t} else {\n\t\t\t\trenderItem.id = object.id;\n\t\t\t\trenderItem.object = object;\n\t\t\t\trenderItem.geometry = geometry;\n\t\t\t\trenderItem.material = material;\n\t\t\t\trenderItem.program = materialProperties.program || defaultProgram;\n\t\t\t\trenderItem.groupOrder = groupOrder;\n\t\t\t\trenderItem.renderOrder = object.renderOrder;\n\t\t\t\trenderItem.z = z;\n\t\t\t\trenderItem.group = group;\n\t\t\t}\n\n\t\t\trenderItemsIndex++;\n\t\t\treturn renderItem;\n\t\t}\n\n\t\tfunction push(object, geometry, material, groupOrder, z, group) {\n\t\t\tconst renderItem = getNextRenderItem(object, geometry, material, groupOrder, z, group);\n\n\t\t\tif (material.transmission > 0.0) {\n\t\t\t\ttransmissive.push(renderItem);\n\t\t\t} else if (material.transparent === true) {\n\t\t\t\ttransparent.push(renderItem);\n\t\t\t} else {\n\t\t\t\topaque.push(renderItem);\n\t\t\t}\n\t\t}\n\n\t\tfunction unshift(object, geometry, material, groupOrder, z, group) {\n\t\t\tconst renderItem = getNextRenderItem(object, geometry, material, groupOrder, z, group);\n\n\t\t\tif (material.transmission > 0.0) {\n\t\t\t\ttransmissive.unshift(renderItem);\n\t\t\t} else if (material.transparent === true) {\n\t\t\t\ttransparent.unshift(renderItem);\n\t\t\t} else {\n\t\t\t\topaque.unshift(renderItem);\n\t\t\t}\n\t\t}\n\n\t\tfunction sort(customOpaqueSort, customTransparentSort) {\n\t\t\tif (opaque.length > 1) opaque.sort(customOpaqueSort || painterSortStable);\n\t\t\tif (transmissive.length > 1) transmissive.sort(customTransparentSort || reversePainterSortStable);\n\t\t\tif (transparent.length > 1) transparent.sort(customTransparentSort || reversePainterSortStable);\n\t\t}\n\n\t\tfunction finish() {\n\t\t\t// Clear references from inactive renderItems in the list\n\t\t\tfor (let i = renderItemsIndex, il = renderItems.length; i < il; i++) {\n\t\t\t\tconst renderItem = renderItems[i];\n\t\t\t\tif (renderItem.id === null) break;\n\t\t\t\trenderItem.id = null;\n\t\t\t\trenderItem.object = null;\n\t\t\t\trenderItem.geometry = null;\n\t\t\t\trenderItem.material = null;\n\t\t\t\trenderItem.program = null;\n\t\t\t\trenderItem.group = null;\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\topaque: opaque,\n\t\t\ttransmissive: transmissive,\n\t\t\ttransparent: transparent,\n\t\t\tinit: init,\n\t\t\tpush: push,\n\t\t\tunshift: unshift,\n\t\t\tfinish: finish,\n\t\t\tsort: sort\n\t\t};\n\t}\n\n\tfunction WebGLRenderLists(properties) {\n\t\tlet lists = new WeakMap();\n\n\t\tfunction get(scene, renderCallDepth) {\n\t\t\tlet list;\n\n\t\t\tif (lists.has(scene) === false) {\n\t\t\t\tlist = new WebGLRenderList(properties);\n\t\t\t\tlists.set(scene, [list]);\n\t\t\t} else {\n\t\t\t\tif (renderCallDepth >= lists.get(scene).length) {\n\t\t\t\t\tlist = new WebGLRenderList(properties);\n\t\t\t\t\tlists.get(scene).push(list);\n\t\t\t\t} else {\n\t\t\t\t\tlist = lists.get(scene)[renderCallDepth];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn list;\n\t\t}\n\n\t\tfunction dispose() {\n\t\t\tlists = new WeakMap();\n\t\t}\n\n\t\treturn {\n\t\t\tget: get,\n\t\t\tdispose: dispose\n\t\t};\n\t}\n\n\tfunction UniformsCache() {\n\t\tconst lights = {};\n\t\treturn {\n\t\t\tget: function (light) {\n\t\t\t\tif (lights[light.id] !== undefined) {\n\t\t\t\t\treturn lights[light.id];\n\t\t\t\t}\n\n\t\t\t\tlet uniforms;\n\n\t\t\t\tswitch (light.type) {\n\t\t\t\t\tcase 'DirectionalLight':\n\t\t\t\t\t\tuniforms = {\n\t\t\t\t\t\t\tdirection: new Vector3(),\n\t\t\t\t\t\t\tcolor: new Color()\n\t\t\t\t\t\t};\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'SpotLight':\n\t\t\t\t\t\tuniforms = {\n\t\t\t\t\t\t\tposition: new Vector3(),\n\t\t\t\t\t\t\tdirection: new Vector3(),\n\t\t\t\t\t\t\tcolor: new Color(),\n\t\t\t\t\t\t\tdistance: 0,\n\t\t\t\t\t\t\tconeCos: 0,\n\t\t\t\t\t\t\tpenumbraCos: 0,\n\t\t\t\t\t\t\tdecay: 0\n\t\t\t\t\t\t};\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'PointLight':\n\t\t\t\t\t\tuniforms = {\n\t\t\t\t\t\t\tposition: new Vector3(),\n\t\t\t\t\t\t\tcolor: new Color(),\n\t\t\t\t\t\t\tdistance: 0,\n\t\t\t\t\t\t\tdecay: 0\n\t\t\t\t\t\t};\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'HemisphereLight':\n\t\t\t\t\t\tuniforms = {\n\t\t\t\t\t\t\tdirection: new Vector3(),\n\t\t\t\t\t\t\tskyColor: new Color(),\n\t\t\t\t\t\t\tgroundColor: new Color()\n\t\t\t\t\t\t};\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'RectAreaLight':\n\t\t\t\t\t\tuniforms = {\n\t\t\t\t\t\t\tcolor: new Color(),\n\t\t\t\t\t\t\tposition: new Vector3(),\n\t\t\t\t\t\t\thalfWidth: new Vector3(),\n\t\t\t\t\t\t\thalfHeight: new Vector3()\n\t\t\t\t\t\t};\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tlights[light.id] = uniforms;\n\t\t\t\treturn uniforms;\n\t\t\t}\n\t\t};\n\t}\n\n\tfunction ShadowUniformsCache() {\n\t\tconst lights = {};\n\t\treturn {\n\t\t\tget: function (light) {\n\t\t\t\tif (lights[light.id] !== undefined) {\n\t\t\t\t\treturn lights[light.id];\n\t\t\t\t}\n\n\t\t\t\tlet uniforms;\n\n\t\t\t\tswitch (light.type) {\n\t\t\t\t\tcase 'DirectionalLight':\n\t\t\t\t\t\tuniforms = {\n\t\t\t\t\t\t\tshadowBias: 0,\n\t\t\t\t\t\t\tshadowNormalBias: 0,\n\t\t\t\t\t\t\tshadowRadius: 1,\n\t\t\t\t\t\t\tshadowMapSize: new Vector2()\n\t\t\t\t\t\t};\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'SpotLight':\n\t\t\t\t\t\tuniforms = {\n\t\t\t\t\t\t\tshadowBias: 0,\n\t\t\t\t\t\t\tshadowNormalBias: 0,\n\t\t\t\t\t\t\tshadowRadius: 1,\n\t\t\t\t\t\t\tshadowMapSize: new Vector2()\n\t\t\t\t\t\t};\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'PointLight':\n\t\t\t\t\t\tuniforms = {\n\t\t\t\t\t\t\tshadowBias: 0,\n\t\t\t\t\t\t\tshadowNormalBias: 0,\n\t\t\t\t\t\t\tshadowRadius: 1,\n\t\t\t\t\t\t\tshadowMapSize: new Vector2(),\n\t\t\t\t\t\t\tshadowCameraNear: 1,\n\t\t\t\t\t\t\tshadowCameraFar: 1000\n\t\t\t\t\t\t};\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t// TODO (abelnation): set RectAreaLight shadow uniforms\n\t\t\t\t}\n\n\t\t\t\tlights[light.id] = uniforms;\n\t\t\t\treturn uniforms;\n\t\t\t}\n\t\t};\n\t}\n\n\tlet nextVersion = 0;\n\n\tfunction shadowCastingLightsFirst(lightA, lightB) {\n\t\treturn (lightB.castShadow ? 1 : 0) - (lightA.castShadow ? 1 : 0);\n\t}\n\n\tfunction WebGLLights(extensions, capabilities) {\n\t\tconst cache = new UniformsCache();\n\t\tconst shadowCache = ShadowUniformsCache();\n\t\tconst state = {\n\t\t\tversion: 0,\n\t\t\thash: {\n\t\t\t\tdirectionalLength: -1,\n\t\t\t\tpointLength: -1,\n\t\t\t\tspotLength: -1,\n\t\t\t\trectAreaLength: -1,\n\t\t\t\themiLength: -1,\n\t\t\t\tnumDirectionalShadows: -1,\n\t\t\t\tnumPointShadows: -1,\n\t\t\t\tnumSpotShadows: -1\n\t\t\t},\n\t\t\tambient: [0, 0, 0],\n\t\t\tprobe: [],\n\t\t\tdirectional: [],\n\t\t\tdirectionalShadow: [],\n\t\t\tdirectionalShadowMap: [],\n\t\t\tdirectionalShadowMatrix: [],\n\t\t\tspot: [],\n\t\t\tspotShadow: [],\n\t\t\tspotShadowMap: [],\n\t\t\tspotShadowMatrix: [],\n\t\t\trectArea: [],\n\t\t\trectAreaLTC1: null,\n\t\t\trectAreaLTC2: null,\n\t\t\tpoint: [],\n\t\t\tpointShadow: [],\n\t\t\tpointShadowMap: [],\n\t\t\tpointShadowMatrix: [],\n\t\t\themi: []\n\t\t};\n\n\t\tfor (let i = 0; i < 9; i++) state.probe.push(new Vector3());\n\n\t\tconst vector3 = new Vector3();\n\t\tconst matrix4 = new Matrix4();\n\t\tconst matrix42 = new Matrix4();\n\n\t\tfunction setup(lights, physicallyCorrectLights) {\n\t\t\tlet r = 0,\n\t\t\t\t\tg = 0,\n\t\t\t\t\tb = 0;\n\n\t\t\tfor (let i = 0; i < 9; i++) state.probe[i].set(0, 0, 0);\n\n\t\t\tlet directionalLength = 0;\n\t\t\tlet pointLength = 0;\n\t\t\tlet spotLength = 0;\n\t\t\tlet rectAreaLength = 0;\n\t\t\tlet hemiLength = 0;\n\t\t\tlet numDirectionalShadows = 0;\n\t\t\tlet numPointShadows = 0;\n\t\t\tlet numSpotShadows = 0;\n\t\t\tlights.sort(shadowCastingLightsFirst); // artist-friendly light intensity scaling factor\n\n\t\t\tconst scaleFactor = physicallyCorrectLights !== true ? Math.PI : 1;\n\n\t\t\tfor (let i = 0, l = lights.length; i < l; i++) {\n\t\t\t\tconst light = lights[i];\n\t\t\t\tconst color = light.color;\n\t\t\t\tconst intensity = light.intensity;\n\t\t\t\tconst distance = light.distance;\n\t\t\t\tconst shadowMap = light.shadow && light.shadow.map ? light.shadow.map.texture : null;\n\n\t\t\t\tif (light.isAmbientLight) {\n\t\t\t\t\tr += color.r * intensity * scaleFactor;\n\t\t\t\t\tg += color.g * intensity * scaleFactor;\n\t\t\t\t\tb += color.b * intensity * scaleFactor;\n\t\t\t\t} else if (light.isLightProbe) {\n\t\t\t\t\tfor (let j = 0; j < 9; j++) {\n\t\t\t\t\t\tstate.probe[j].addScaledVector(light.sh.coefficients[j], intensity);\n\t\t\t\t\t}\n\t\t\t\t} else if (light.isDirectionalLight) {\n\t\t\t\t\tconst uniforms = cache.get(light);\n\t\t\t\t\tuniforms.color.copy(light.color).multiplyScalar(light.intensity * scaleFactor);\n\n\t\t\t\t\tif (light.castShadow) {\n\t\t\t\t\t\tconst shadow = light.shadow;\n\t\t\t\t\t\tconst shadowUniforms = shadowCache.get(light);\n\t\t\t\t\t\tshadowUniforms.shadowBias = shadow.bias;\n\t\t\t\t\t\tshadowUniforms.shadowNormalBias = shadow.normalBias;\n\t\t\t\t\t\tshadowUniforms.shadowRadius = shadow.radius;\n\t\t\t\t\t\tshadowUniforms.shadowMapSize = shadow.mapSize;\n\t\t\t\t\t\tstate.directionalShadow[directionalLength] = shadowUniforms;\n\t\t\t\t\t\tstate.directionalShadowMap[directionalLength] = shadowMap;\n\t\t\t\t\t\tstate.directionalShadowMatrix[directionalLength] = light.shadow.matrix;\n\t\t\t\t\t\tnumDirectionalShadows++;\n\t\t\t\t\t}\n\n\t\t\t\t\tstate.directional[directionalLength] = uniforms;\n\t\t\t\t\tdirectionalLength++;\n\t\t\t\t} else if (light.isSpotLight) {\n\t\t\t\t\tconst uniforms = cache.get(light);\n\t\t\t\t\tuniforms.position.setFromMatrixPosition(light.matrixWorld);\n\t\t\t\t\tuniforms.color.copy(color).multiplyScalar(intensity * scaleFactor);\n\t\t\t\t\tuniforms.distance = distance;\n\t\t\t\t\tuniforms.coneCos = Math.cos(light.angle);\n\t\t\t\t\tuniforms.penumbraCos = Math.cos(light.angle * (1 - light.penumbra));\n\t\t\t\t\tuniforms.decay = light.decay;\n\n\t\t\t\t\tif (light.castShadow) {\n\t\t\t\t\t\tconst shadow = light.shadow;\n\t\t\t\t\t\tconst shadowUniforms = shadowCache.get(light);\n\t\t\t\t\t\tshadowUniforms.shadowBias = shadow.bias;\n\t\t\t\t\t\tshadowUniforms.shadowNormalBias = shadow.normalBias;\n\t\t\t\t\t\tshadowUniforms.shadowRadius = shadow.radius;\n\t\t\t\t\t\tshadowUniforms.shadowMapSize = shadow.mapSize;\n\t\t\t\t\t\tstate.spotShadow[spotLength] = shadowUniforms;\n\t\t\t\t\t\tstate.spotShadowMap[spotLength] = shadowMap;\n\t\t\t\t\t\tstate.spotShadowMatrix[spotLength] = light.shadow.matrix;\n\t\t\t\t\t\tnumSpotShadows++;\n\t\t\t\t\t}\n\n\t\t\t\t\tstate.spot[spotLength] = uniforms;\n\t\t\t\t\tspotLength++;\n\t\t\t\t} else if (light.isRectAreaLight) {\n\t\t\t\t\tconst uniforms = cache.get(light); // (a) intensity is the total visible light emitted\n\t\t\t\t\t//uniforms.color.copy( color ).multiplyScalar( intensity / ( light.width * light.height * Math.PI ) );\n\t\t\t\t\t// (b) intensity is the brightness of the light\n\n\t\t\t\t\tuniforms.color.copy(color).multiplyScalar(intensity);\n\t\t\t\t\tuniforms.halfWidth.set(light.width * 0.5, 0.0, 0.0);\n\t\t\t\t\tuniforms.halfHeight.set(0.0, light.height * 0.5, 0.0);\n\t\t\t\t\tstate.rectArea[rectAreaLength] = uniforms;\n\t\t\t\t\trectAreaLength++;\n\t\t\t\t} else if (light.isPointLight) {\n\t\t\t\t\tconst uniforms = cache.get(light);\n\t\t\t\t\tuniforms.color.copy(light.color).multiplyScalar(light.intensity * scaleFactor);\n\t\t\t\t\tuniforms.distance = light.distance;\n\t\t\t\t\tuniforms.decay = light.decay;\n\n\t\t\t\t\tif (light.castShadow) {\n\t\t\t\t\t\tconst shadow = light.shadow;\n\t\t\t\t\t\tconst shadowUniforms = shadowCache.get(light);\n\t\t\t\t\t\tshadowUniforms.shadowBias = shadow.bias;\n\t\t\t\t\t\tshadowUniforms.shadowNormalBias = shadow.normalBias;\n\t\t\t\t\t\tshadowUniforms.shadowRadius = shadow.radius;\n\t\t\t\t\t\tshadowUniforms.shadowMapSize = shadow.mapSize;\n\t\t\t\t\t\tshadowUniforms.shadowCameraNear = shadow.camera.near;\n\t\t\t\t\t\tshadowUniforms.shadowCameraFar = shadow.camera.far;\n\t\t\t\t\t\tstate.pointShadow[pointLength] = shadowUniforms;\n\t\t\t\t\t\tstate.pointShadowMap[pointLength] = shadowMap;\n\t\t\t\t\t\tstate.pointShadowMatrix[pointLength] = light.shadow.matrix;\n\t\t\t\t\t\tnumPointShadows++;\n\t\t\t\t\t}\n\n\t\t\t\t\tstate.point[pointLength] = uniforms;\n\t\t\t\t\tpointLength++;\n\t\t\t\t} else if (light.isHemisphereLight) {\n\t\t\t\t\tconst uniforms = cache.get(light);\n\t\t\t\t\tuniforms.skyColor.copy(light.color).multiplyScalar(intensity * scaleFactor);\n\t\t\t\t\tuniforms.groundColor.copy(light.groundColor).multiplyScalar(intensity * scaleFactor);\n\t\t\t\t\tstate.hemi[hemiLength] = uniforms;\n\t\t\t\t\themiLength++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (rectAreaLength > 0) {\n\t\t\t\tif (capabilities.isWebGL2) {\n\t\t\t\t\t// WebGL 2\n\t\t\t\t\tstate.rectAreaLTC1 = UniformsLib.LTC_FLOAT_1;\n\t\t\t\t\tstate.rectAreaLTC2 = UniformsLib.LTC_FLOAT_2;\n\t\t\t\t} else {\n\t\t\t\t\t// WebGL 1\n\t\t\t\t\tif (extensions.has('OES_texture_float_linear') === true) {\n\t\t\t\t\t\tstate.rectAreaLTC1 = UniformsLib.LTC_FLOAT_1;\n\t\t\t\t\t\tstate.rectAreaLTC2 = UniformsLib.LTC_FLOAT_2;\n\t\t\t\t\t} else if (extensions.has('OES_texture_half_float_linear') === true) {\n\t\t\t\t\t\tstate.rectAreaLTC1 = UniformsLib.LTC_HALF_1;\n\t\t\t\t\t\tstate.rectAreaLTC2 = UniformsLib.LTC_HALF_2;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconsole.error('THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tstate.ambient[0] = r;\n\t\t\tstate.ambient[1] = g;\n\t\t\tstate.ambient[2] = b;\n\t\t\tconst hash = state.hash;\n\n\t\t\tif (hash.directionalLength !== directionalLength || hash.pointLength !== pointLength || hash.spotLength !== spotLength || hash.rectAreaLength !== rectAreaLength || hash.hemiLength !== hemiLength || hash.numDirectionalShadows !== numDirectionalShadows || hash.numPointShadows !== numPointShadows || hash.numSpotShadows !== numSpotShadows) {\n\t\t\t\tstate.directional.length = directionalLength;\n\t\t\t\tstate.spot.length = spotLength;\n\t\t\t\tstate.rectArea.length = rectAreaLength;\n\t\t\t\tstate.point.length = pointLength;\n\t\t\t\tstate.hemi.length = hemiLength;\n\t\t\t\tstate.directionalShadow.length = numDirectionalShadows;\n\t\t\t\tstate.directionalShadowMap.length = numDirectionalShadows;\n\t\t\t\tstate.pointShadow.length = numPointShadows;\n\t\t\t\tstate.pointShadowMap.length = numPointShadows;\n\t\t\t\tstate.spotShadow.length = numSpotShadows;\n\t\t\t\tstate.spotShadowMap.length = numSpotShadows;\n\t\t\t\tstate.directionalShadowMatrix.length = numDirectionalShadows;\n\t\t\t\tstate.pointShadowMatrix.length = numPointShadows;\n\t\t\t\tstate.spotShadowMatrix.length = numSpotShadows;\n\t\t\t\thash.directionalLength = directionalLength;\n\t\t\t\thash.pointLength = pointLength;\n\t\t\t\thash.spotLength = spotLength;\n\t\t\t\thash.rectAreaLength = rectAreaLength;\n\t\t\t\thash.hemiLength = hemiLength;\n\t\t\t\thash.numDirectionalShadows = numDirectionalShadows;\n\t\t\t\thash.numPointShadows = numPointShadows;\n\t\t\t\thash.numSpotShadows = numSpotShadows;\n\t\t\t\tstate.version = nextVersion++;\n\t\t\t}\n\t\t}\n\n\t\tfunction setupView(lights, camera) {\n\t\t\tlet directionalLength = 0;\n\t\t\tlet pointLength = 0;\n\t\t\tlet spotLength = 0;\n\t\t\tlet rectAreaLength = 0;\n\t\t\tlet hemiLength = 0;\n\t\t\tconst viewMatrix = camera.matrixWorldInverse;\n\n\t\t\tfor (let i = 0, l = lights.length; i < l; i++) {\n\t\t\t\tconst light = lights[i];\n\n\t\t\t\tif (light.isDirectionalLight) {\n\t\t\t\t\tconst uniforms = state.directional[directionalLength];\n\t\t\t\t\tuniforms.direction.setFromMatrixPosition(light.matrixWorld);\n\t\t\t\t\tvector3.setFromMatrixPosition(light.target.matrixWorld);\n\t\t\t\t\tuniforms.direction.sub(vector3);\n\t\t\t\t\tuniforms.direction.transformDirection(viewMatrix);\n\t\t\t\t\tdirectionalLength++;\n\t\t\t\t} else if (light.isSpotLight) {\n\t\t\t\t\tconst uniforms = state.spot[spotLength];\n\t\t\t\t\tuniforms.position.setFromMatrixPosition(light.matrixWorld);\n\t\t\t\t\tuniforms.position.applyMatrix4(viewMatrix);\n\t\t\t\t\tuniforms.direction.setFromMatrixPosition(light.matrixWorld);\n\t\t\t\t\tvector3.setFromMatrixPosition(light.target.matrixWorld);\n\t\t\t\t\tuniforms.direction.sub(vector3);\n\t\t\t\t\tuniforms.direction.transformDirection(viewMatrix);\n\t\t\t\t\tspotLength++;\n\t\t\t\t} else if (light.isRectAreaLight) {\n\t\t\t\t\tconst uniforms = state.rectArea[rectAreaLength];\n\t\t\t\t\tuniforms.position.setFromMatrixPosition(light.matrixWorld);\n\t\t\t\t\tuniforms.position.applyMatrix4(viewMatrix); // extract local rotation of light to derive width/height half vectors\n\n\t\t\t\t\tmatrix42.identity();\n\t\t\t\t\tmatrix4.copy(light.matrixWorld);\n\t\t\t\t\tmatrix4.premultiply(viewMatrix);\n\t\t\t\t\tmatrix42.extractRotation(matrix4);\n\t\t\t\t\tuniforms.halfWidth.set(light.width * 0.5, 0.0, 0.0);\n\t\t\t\t\tuniforms.halfHeight.set(0.0, light.height * 0.5, 0.0);\n\t\t\t\t\tuniforms.halfWidth.applyMatrix4(matrix42);\n\t\t\t\t\tuniforms.halfHeight.applyMatrix4(matrix42);\n\t\t\t\t\trectAreaLength++;\n\t\t\t\t} else if (light.isPointLight) {\n\t\t\t\t\tconst uniforms = state.point[pointLength];\n\t\t\t\t\tuniforms.position.setFromMatrixPosition(light.matrixWorld);\n\t\t\t\t\tuniforms.position.applyMatrix4(viewMatrix);\n\t\t\t\t\tpointLength++;\n\t\t\t\t} else if (light.isHemisphereLight) {\n\t\t\t\t\tconst uniforms = state.hemi[hemiLength];\n\t\t\t\t\tuniforms.direction.setFromMatrixPosition(light.matrixWorld);\n\t\t\t\t\tuniforms.direction.transformDirection(viewMatrix);\n\t\t\t\t\tuniforms.direction.normalize();\n\t\t\t\t\themiLength++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tsetup: setup,\n\t\t\tsetupView: setupView,\n\t\t\tstate: state\n\t\t};\n\t}\n\n\tfunction WebGLRenderState(extensions, capabilities) {\n\t\tconst lights = new WebGLLights(extensions, capabilities);\n\t\tconst lightsArray = [];\n\t\tconst shadowsArray = [];\n\n\t\tfunction init() {\n\t\t\tlightsArray.length = 0;\n\t\t\tshadowsArray.length = 0;\n\t\t}\n\n\t\tfunction pushLight(light) {\n\t\t\tlightsArray.push(light);\n\t\t}\n\n\t\tfunction pushShadow(shadowLight) {\n\t\t\tshadowsArray.push(shadowLight);\n\t\t}\n\n\t\tfunction setupLights(physicallyCorrectLights) {\n\t\t\tlights.setup(lightsArray, physicallyCorrectLights);\n\t\t}\n\n\t\tfunction setupLightsView(camera) {\n\t\t\tlights.setupView(lightsArray, camera);\n\t\t}\n\n\t\tconst state = {\n\t\t\tlightsArray: lightsArray,\n\t\t\tshadowsArray: shadowsArray,\n\t\t\tlights: lights\n\t\t};\n\t\treturn {\n\t\t\tinit: init,\n\t\t\tstate: state,\n\t\t\tsetupLights: setupLights,\n\t\t\tsetupLightsView: setupLightsView,\n\t\t\tpushLight: pushLight,\n\t\t\tpushShadow: pushShadow\n\t\t};\n\t}\n\n\tfunction WebGLRenderStates(extensions, capabilities) {\n\t\tlet renderStates = new WeakMap();\n\n\t\tfunction get(scene, renderCallDepth = 0) {\n\t\t\tlet renderState;\n\n\t\t\tif (renderStates.has(scene) === false) {\n\t\t\t\trenderState = new WebGLRenderState(extensions, capabilities);\n\t\t\t\trenderStates.set(scene, [renderState]);\n\t\t\t} else {\n\t\t\t\tif (renderCallDepth >= renderStates.get(scene).length) {\n\t\t\t\t\trenderState = new WebGLRenderState(extensions, capabilities);\n\t\t\t\t\trenderStates.get(scene).push(renderState);\n\t\t\t\t} else {\n\t\t\t\t\trenderState = renderStates.get(scene)[renderCallDepth];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn renderState;\n\t\t}\n\n\t\tfunction dispose() {\n\t\t\trenderStates = new WeakMap();\n\t\t}\n\n\t\treturn {\n\t\t\tget: get,\n\t\t\tdispose: dispose\n\t\t};\n\t}\n\n\t/**\n\t * parameters = {\n\t *\n\t *\topacity: <float>,\n\t *\n\t *\tmap: new THREE.Texture( <Image> ),\n\t *\n\t *\talphaMap: new THREE.Texture( <Image> ),\n\t *\n\t *\tdisplacementMap: new THREE.Texture( <Image> ),\n\t *\tdisplacementScale: <float>,\n\t *\tdisplacementBias: <float>,\n\t *\n\t *\twireframe: <boolean>,\n\t *\twireframeLinewidth: <float>\n\t * }\n\t */\n\n\tclass MeshDepthMaterial extends Material {\n\t\tconstructor(parameters) {\n\t\t\tsuper();\n\t\t\tthis.type = 'MeshDepthMaterial';\n\t\t\tthis.depthPacking = BasicDepthPacking;\n\t\t\tthis.map = null;\n\t\t\tthis.alphaMap = null;\n\t\t\tthis.displacementMap = null;\n\t\t\tthis.displacementScale = 1;\n\t\t\tthis.displacementBias = 0;\n\t\t\tthis.wireframe = false;\n\t\t\tthis.wireframeLinewidth = 1;\n\t\t\tthis.fog = false;\n\t\t\tthis.setValues(parameters);\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.depthPacking = source.depthPacking;\n\t\t\tthis.map = source.map;\n\t\t\tthis.alphaMap = source.alphaMap;\n\t\t\tthis.displacementMap = source.displacementMap;\n\t\t\tthis.displacementScale = source.displacementScale;\n\t\t\tthis.displacementBias = source.displacementBias;\n\t\t\tthis.wireframe = source.wireframe;\n\t\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tMeshDepthMaterial.prototype.isMeshDepthMaterial = true;\n\n\t/**\n\t * parameters = {\n\t *\n\t *\treferencePosition: <float>,\n\t *\tnearDistance: <float>,\n\t *\tfarDistance: <float>,\n\t *\n\t *\tmap: new THREE.Texture( <Image> ),\n\t *\n\t *\talphaMap: new THREE.Texture( <Image> ),\n\t *\n\t *\tdisplacementMap: new THREE.Texture( <Image> ),\n\t *\tdisplacementScale: <float>,\n\t *\tdisplacementBias: <float>\n\t *\n\t * }\n\t */\n\n\tclass MeshDistanceMaterial extends Material {\n\t\tconstructor(parameters) {\n\t\t\tsuper();\n\t\t\tthis.type = 'MeshDistanceMaterial';\n\t\t\tthis.referencePosition = new Vector3();\n\t\t\tthis.nearDistance = 1;\n\t\t\tthis.farDistance = 1000;\n\t\t\tthis.map = null;\n\t\t\tthis.alphaMap = null;\n\t\t\tthis.displacementMap = null;\n\t\t\tthis.displacementScale = 1;\n\t\t\tthis.displacementBias = 0;\n\t\t\tthis.fog = false;\n\t\t\tthis.setValues(parameters);\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.referencePosition.copy(source.referencePosition);\n\t\t\tthis.nearDistance = source.nearDistance;\n\t\t\tthis.farDistance = source.farDistance;\n\t\t\tthis.map = source.map;\n\t\t\tthis.alphaMap = source.alphaMap;\n\t\t\tthis.displacementMap = source.displacementMap;\n\t\t\tthis.displacementScale = source.displacementScale;\n\t\t\tthis.displacementBias = source.displacementBias;\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tMeshDistanceMaterial.prototype.isMeshDistanceMaterial = true;\n\n\tconst vertex = \"void main() {\\n\\tgl_Position = vec4( position, 1.0 );\\n}\";\n\tconst fragment = \"uniform sampler2D shadow_pass;\\nuniform vec2 resolution;\\nuniform float radius;\\nuniform float samples;\\n#include <packing>\\nvoid main() {\\n\\tfloat mean = 0.0;\\n\\tfloat squared_mean = 0.0;\\n\\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\\n\\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\\n\\tfor ( float i = 0.0; i < samples; i ++ ) {\\n\\t\\tfloat uvOffset = uvStart + i * uvStride;\\n\\t\\t#ifdef HORIZONTAL_PASS\\n\\t\\t\\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\\n\\t\\t\\tmean += distribution.x;\\n\\t\\t\\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\\n\\t\\t#else\\n\\t\\t\\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\\n\\t\\t\\tmean += depth;\\n\\t\\t\\tsquared_mean += depth * depth;\\n\\t\\t#endif\\n\\t}\\n\\tmean = mean / samples;\\n\\tsquared_mean = squared_mean / samples;\\n\\tfloat std_dev = sqrt( squared_mean - mean * mean );\\n\\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\\n}\";\n\n\tfunction WebGLShadowMap(_renderer, _objects, _capabilities) {\n\t\tlet _frustum = new Frustum();\n\n\t\tconst _shadowMapSize = new Vector2(),\n\t\t\t\t\t_viewportSize = new Vector2(),\n\t\t\t\t\t_viewport = new Vector4(),\n\t\t\t\t\t_depthMaterial = new MeshDepthMaterial({\n\t\t\tdepthPacking: RGBADepthPacking\n\t\t}),\n\t\t\t\t\t_distanceMaterial = new MeshDistanceMaterial(),\n\t\t\t\t\t_materialCache = {},\n\t\t\t\t\t_maxTextureSize = _capabilities.maxTextureSize;\n\n\t\tconst shadowSide = {\n\t\t\t0: BackSide,\n\t\t\t1: FrontSide,\n\t\t\t2: DoubleSide\n\t\t};\n\t\tconst shadowMaterialVertical = new ShaderMaterial({\n\t\t\tuniforms: {\n\t\t\t\tshadow_pass: {\n\t\t\t\t\tvalue: null\n\t\t\t\t},\n\t\t\t\tresolution: {\n\t\t\t\t\tvalue: new Vector2()\n\t\t\t\t},\n\t\t\t\tradius: {\n\t\t\t\t\tvalue: 4.0\n\t\t\t\t},\n\t\t\t\tsamples: {\n\t\t\t\t\tvalue: 8.0\n\t\t\t\t}\n\t\t\t},\n\t\t\tvertexShader: vertex,\n\t\t\tfragmentShader: fragment\n\t\t});\n\t\tconst shadowMaterialHorizontal = shadowMaterialVertical.clone();\n\t\tshadowMaterialHorizontal.defines.HORIZONTAL_PASS = 1;\n\t\tconst fullScreenTri = new BufferGeometry();\n\t\tfullScreenTri.setAttribute('position', new BufferAttribute(new Float32Array([-1, -1, 0.5, 3, -1, 0.5, -1, 3, 0.5]), 3));\n\t\tconst fullScreenMesh = new Mesh(fullScreenTri, shadowMaterialVertical);\n\t\tconst scope = this;\n\t\tthis.enabled = false;\n\t\tthis.autoUpdate = true;\n\t\tthis.needsUpdate = false;\n\t\tthis.type = PCFShadowMap;\n\n\t\tthis.render = function (lights, scene, camera) {\n\t\t\tif (scope.enabled === false) return;\n\t\t\tif (scope.autoUpdate === false && scope.needsUpdate === false) return;\n\t\t\tif (lights.length === 0) return;\n\n\t\t\tconst currentRenderTarget = _renderer.getRenderTarget();\n\n\t\t\tconst activeCubeFace = _renderer.getActiveCubeFace();\n\n\t\t\tconst activeMipmapLevel = _renderer.getActiveMipmapLevel();\n\n\t\t\tconst _state = _renderer.state; // Set GL state for depth map.\n\n\t\t\t_state.setBlending(NoBlending);\n\n\t\t\t_state.buffers.color.setClear(1, 1, 1, 1);\n\n\t\t\t_state.buffers.depth.setTest(true);\n\n\t\t\t_state.setScissorTest(false); // render depth map\n\n\n\t\t\tfor (let i = 0, il = lights.length; i < il; i++) {\n\t\t\t\tconst light = lights[i];\n\t\t\t\tconst shadow = light.shadow;\n\n\t\t\t\tif (shadow === undefined) {\n\t\t\t\t\tconsole.warn('THREE.WebGLShadowMap:', light, 'has no shadow.');\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (shadow.autoUpdate === false && shadow.needsUpdate === false) continue;\n\n\t\t\t\t_shadowMapSize.copy(shadow.mapSize);\n\n\t\t\t\tconst shadowFrameExtents = shadow.getFrameExtents();\n\n\t\t\t\t_shadowMapSize.multiply(shadowFrameExtents);\n\n\t\t\t\t_viewportSize.copy(shadow.mapSize);\n\n\t\t\t\tif (_shadowMapSize.x > _maxTextureSize || _shadowMapSize.y > _maxTextureSize) {\n\t\t\t\t\tif (_shadowMapSize.x > _maxTextureSize) {\n\t\t\t\t\t\t_viewportSize.x = Math.floor(_maxTextureSize / shadowFrameExtents.x);\n\t\t\t\t\t\t_shadowMapSize.x = _viewportSize.x * shadowFrameExtents.x;\n\t\t\t\t\t\tshadow.mapSize.x = _viewportSize.x;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (_shadowMapSize.y > _maxTextureSize) {\n\t\t\t\t\t\t_viewportSize.y = Math.floor(_maxTextureSize / shadowFrameExtents.y);\n\t\t\t\t\t\t_shadowMapSize.y = _viewportSize.y * shadowFrameExtents.y;\n\t\t\t\t\t\tshadow.mapSize.y = _viewportSize.y;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (shadow.map === null && !shadow.isPointLightShadow && this.type === VSMShadowMap) {\n\t\t\t\t\tconst pars = {\n\t\t\t\t\t\tminFilter: LinearFilter,\n\t\t\t\t\t\tmagFilter: LinearFilter,\n\t\t\t\t\t\tformat: RGBAFormat\n\t\t\t\t\t};\n\t\t\t\t\tshadow.map = new WebGLRenderTarget(_shadowMapSize.x, _shadowMapSize.y, pars);\n\t\t\t\t\tshadow.map.texture.name = light.name + '.shadowMap';\n\t\t\t\t\tshadow.mapPass = new WebGLRenderTarget(_shadowMapSize.x, _shadowMapSize.y, pars);\n\t\t\t\t\tshadow.camera.updateProjectionMatrix();\n\t\t\t\t}\n\n\t\t\t\tif (shadow.map === null) {\n\t\t\t\t\tconst pars = {\n\t\t\t\t\t\tminFilter: NearestFilter,\n\t\t\t\t\t\tmagFilter: NearestFilter,\n\t\t\t\t\t\tformat: RGBAFormat\n\t\t\t\t\t};\n\t\t\t\t\tshadow.map = new WebGLRenderTarget(_shadowMapSize.x, _shadowMapSize.y, pars);\n\t\t\t\t\tshadow.map.texture.name = light.name + '.shadowMap';\n\t\t\t\t\tshadow.camera.updateProjectionMatrix();\n\t\t\t\t}\n\n\t\t\t\t_renderer.setRenderTarget(shadow.map);\n\n\t\t\t\t_renderer.clear();\n\n\t\t\t\tconst viewportCount = shadow.getViewportCount();\n\n\t\t\t\tfor (let vp = 0; vp < viewportCount; vp++) {\n\t\t\t\t\tconst viewport = shadow.getViewport(vp);\n\n\t\t\t\t\t_viewport.set(_viewportSize.x * viewport.x, _viewportSize.y * viewport.y, _viewportSize.x * viewport.z, _viewportSize.y * viewport.w);\n\n\t\t\t\t\t_state.viewport(_viewport);\n\n\t\t\t\t\tshadow.updateMatrices(light, vp);\n\t\t\t\t\t_frustum = shadow.getFrustum();\n\t\t\t\t\trenderObject(scene, camera, shadow.camera, light, this.type);\n\t\t\t\t} // do blur pass for VSM\n\n\n\t\t\t\tif (!shadow.isPointLightShadow && this.type === VSMShadowMap) {\n\t\t\t\t\tVSMPass(shadow, camera);\n\t\t\t\t}\n\n\t\t\t\tshadow.needsUpdate = false;\n\t\t\t}\n\n\t\t\tscope.needsUpdate = false;\n\n\t\t\t_renderer.setRenderTarget(currentRenderTarget, activeCubeFace, activeMipmapLevel);\n\t\t};\n\n\t\tfunction VSMPass(shadow, camera) {\n\t\t\tconst geometry = _objects.update(fullScreenMesh); // vertical pass\n\n\n\t\t\tshadowMaterialVertical.uniforms.shadow_pass.value = shadow.map.texture;\n\t\t\tshadowMaterialVertical.uniforms.resolution.value = shadow.mapSize;\n\t\t\tshadowMaterialVertical.uniforms.radius.value = shadow.radius;\n\t\t\tshadowMaterialVertical.uniforms.samples.value = shadow.blurSamples;\n\n\t\t\t_renderer.setRenderTarget(shadow.mapPass);\n\n\t\t\t_renderer.clear();\n\n\t\t\t_renderer.renderBufferDirect(camera, null, geometry, shadowMaterialVertical, fullScreenMesh, null); // horizontal pass\n\n\n\t\t\tshadowMaterialHorizontal.uniforms.shadow_pass.value = shadow.mapPass.texture;\n\t\t\tshadowMaterialHorizontal.uniforms.resolution.value = shadow.mapSize;\n\t\t\tshadowMaterialHorizontal.uniforms.radius.value = shadow.radius;\n\t\t\tshadowMaterialHorizontal.uniforms.samples.value = shadow.blurSamples;\n\n\t\t\t_renderer.setRenderTarget(shadow.map);\n\n\t\t\t_renderer.clear();\n\n\t\t\t_renderer.renderBufferDirect(camera, null, geometry, shadowMaterialHorizontal, fullScreenMesh, null);\n\t\t}\n\n\t\tfunction getDepthMaterial(object, geometry, material, light, shadowCameraNear, shadowCameraFar, type) {\n\t\t\tlet result = null;\n\t\t\tconst customMaterial = light.isPointLight === true ? object.customDistanceMaterial : object.customDepthMaterial;\n\n\t\t\tif (customMaterial !== undefined) {\n\t\t\t\tresult = customMaterial;\n\t\t\t} else {\n\t\t\t\tresult = light.isPointLight === true ? _distanceMaterial : _depthMaterial;\n\t\t\t}\n\n\t\t\tif (_renderer.localClippingEnabled && material.clipShadows === true && material.clippingPlanes.length !== 0 || material.displacementMap && material.displacementScale !== 0 || material.alphaMap && material.alphaTest > 0) {\n\t\t\t\t// in this case we need a unique material instance reflecting the\n\t\t\t\t// appropriate state\n\t\t\t\tconst keyA = result.uuid,\n\t\t\t\t\t\t\tkeyB = material.uuid;\n\t\t\t\tlet materialsForVariant = _materialCache[keyA];\n\n\t\t\t\tif (materialsForVariant === undefined) {\n\t\t\t\t\tmaterialsForVariant = {};\n\t\t\t\t\t_materialCache[keyA] = materialsForVariant;\n\t\t\t\t}\n\n\t\t\t\tlet cachedMaterial = materialsForVariant[keyB];\n\n\t\t\t\tif (cachedMaterial === undefined) {\n\t\t\t\t\tcachedMaterial = result.clone();\n\t\t\t\t\tmaterialsForVariant[keyB] = cachedMaterial;\n\t\t\t\t}\n\n\t\t\t\tresult = cachedMaterial;\n\t\t\t}\n\n\t\t\tresult.visible = material.visible;\n\t\t\tresult.wireframe = material.wireframe;\n\n\t\t\tif (type === VSMShadowMap) {\n\t\t\t\tresult.side = material.shadowSide !== null ? material.shadowSide : material.side;\n\t\t\t} else {\n\t\t\t\tresult.side = material.shadowSide !== null ? material.shadowSide : shadowSide[material.side];\n\t\t\t}\n\n\t\t\tresult.alphaMap = material.alphaMap;\n\t\t\tresult.alphaTest = material.alphaTest;\n\t\t\tresult.clipShadows = material.clipShadows;\n\t\t\tresult.clippingPlanes = material.clippingPlanes;\n\t\t\tresult.clipIntersection = material.clipIntersection;\n\t\t\tresult.displacementMap = material.displacementMap;\n\t\t\tresult.displacementScale = material.displacementScale;\n\t\t\tresult.displacementBias = material.displacementBias;\n\t\t\tresult.wireframeLinewidth = material.wireframeLinewidth;\n\t\t\tresult.linewidth = material.linewidth;\n\n\t\t\tif (light.isPointLight === true && result.isMeshDistanceMaterial === true) {\n\t\t\t\tresult.referencePosition.setFromMatrixPosition(light.matrixWorld);\n\t\t\t\tresult.nearDistance = shadowCameraNear;\n\t\t\t\tresult.farDistance = shadowCameraFar;\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}\n\n\t\tfunction renderObject(object, camera, shadowCamera, light, type) {\n\t\t\tif (object.visible === false) return;\n\t\t\tconst visible = object.layers.test(camera.layers);\n\n\t\t\tif (visible && (object.isMesh || object.isLine || object.isPoints)) {\n\t\t\t\tif ((object.castShadow || object.receiveShadow && type === VSMShadowMap) && (!object.frustumCulled || _frustum.intersectsObject(object))) {\n\t\t\t\t\tobject.modelViewMatrix.multiplyMatrices(shadowCamera.matrixWorldInverse, object.matrixWorld);\n\n\t\t\t\t\tconst geometry = _objects.update(object);\n\n\t\t\t\t\tconst material = object.material;\n\n\t\t\t\t\tif (Array.isArray(material)) {\n\t\t\t\t\t\tconst groups = geometry.groups;\n\n\t\t\t\t\t\tfor (let k = 0, kl = groups.length; k < kl; k++) {\n\t\t\t\t\t\t\tconst group = groups[k];\n\t\t\t\t\t\t\tconst groupMaterial = material[group.materialIndex];\n\n\t\t\t\t\t\t\tif (groupMaterial && groupMaterial.visible) {\n\t\t\t\t\t\t\t\tconst depthMaterial = getDepthMaterial(object, geometry, groupMaterial, light, shadowCamera.near, shadowCamera.far, type);\n\n\t\t\t\t\t\t\t\t_renderer.renderBufferDirect(shadowCamera, null, geometry, depthMaterial, object, group);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (material.visible) {\n\t\t\t\t\t\tconst depthMaterial = getDepthMaterial(object, geometry, material, light, shadowCamera.near, shadowCamera.far, type);\n\n\t\t\t\t\t\t_renderer.renderBufferDirect(shadowCamera, null, geometry, depthMaterial, object, null);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst children = object.children;\n\n\t\t\tfor (let i = 0, l = children.length; i < l; i++) {\n\t\t\t\trenderObject(children[i], camera, shadowCamera, light, type);\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction WebGLState(gl, extensions, capabilities) {\n\t\tconst isWebGL2 = capabilities.isWebGL2;\n\n\t\tfunction ColorBuffer() {\n\t\t\tlet locked = false;\n\t\t\tconst color = new Vector4();\n\t\t\tlet currentColorMask = null;\n\t\t\tconst currentColorClear = new Vector4(0, 0, 0, 0);\n\t\t\treturn {\n\t\t\t\tsetMask: function (colorMask) {\n\t\t\t\t\tif (currentColorMask !== colorMask && !locked) {\n\t\t\t\t\t\tgl.colorMask(colorMask, colorMask, colorMask, colorMask);\n\t\t\t\t\t\tcurrentColorMask = colorMask;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tsetLocked: function (lock) {\n\t\t\t\t\tlocked = lock;\n\t\t\t\t},\n\t\t\t\tsetClear: function (r, g, b, a, premultipliedAlpha) {\n\t\t\t\t\tif (premultipliedAlpha === true) {\n\t\t\t\t\t\tr *= a;\n\t\t\t\t\t\tg *= a;\n\t\t\t\t\t\tb *= a;\n\t\t\t\t\t}\n\n\t\t\t\t\tcolor.set(r, g, b, a);\n\n\t\t\t\t\tif (currentColorClear.equals(color) === false) {\n\t\t\t\t\t\tgl.clearColor(r, g, b, a);\n\t\t\t\t\t\tcurrentColorClear.copy(color);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\treset: function () {\n\t\t\t\t\tlocked = false;\n\t\t\t\t\tcurrentColorMask = null;\n\t\t\t\t\tcurrentColorClear.set(-1, 0, 0, 0); // set to invalid state\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t\tfunction DepthBuffer() {\n\t\t\tlet locked = false;\n\t\t\tlet currentDepthMask = null;\n\t\t\tlet currentDepthFunc = null;\n\t\t\tlet currentDepthClear = null;\n\t\t\treturn {\n\t\t\t\tsetTest: function (depthTest) {\n\t\t\t\t\tif (depthTest) {\n\t\t\t\t\t\tenable(gl.DEPTH_TEST);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdisable(gl.DEPTH_TEST);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tsetMask: function (depthMask) {\n\t\t\t\t\tif (currentDepthMask !== depthMask && !locked) {\n\t\t\t\t\t\tgl.depthMask(depthMask);\n\t\t\t\t\t\tcurrentDepthMask = depthMask;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tsetFunc: function (depthFunc) {\n\t\t\t\t\tif (currentDepthFunc !== depthFunc) {\n\t\t\t\t\t\tif (depthFunc) {\n\t\t\t\t\t\t\tswitch (depthFunc) {\n\t\t\t\t\t\t\t\tcase NeverDepth:\n\t\t\t\t\t\t\t\t\tgl.depthFunc(gl.NEVER);\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase AlwaysDepth:\n\t\t\t\t\t\t\t\t\tgl.depthFunc(gl.ALWAYS);\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase LessDepth:\n\t\t\t\t\t\t\t\t\tgl.depthFunc(gl.LESS);\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase LessEqualDepth:\n\t\t\t\t\t\t\t\t\tgl.depthFunc(gl.LEQUAL);\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase EqualDepth:\n\t\t\t\t\t\t\t\t\tgl.depthFunc(gl.EQUAL);\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase GreaterEqualDepth:\n\t\t\t\t\t\t\t\t\tgl.depthFunc(gl.GEQUAL);\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase GreaterDepth:\n\t\t\t\t\t\t\t\t\tgl.depthFunc(gl.GREATER);\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase NotEqualDepth:\n\t\t\t\t\t\t\t\t\tgl.depthFunc(gl.NOTEQUAL);\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\tgl.depthFunc(gl.LEQUAL);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tgl.depthFunc(gl.LEQUAL);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcurrentDepthFunc = depthFunc;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tsetLocked: function (lock) {\n\t\t\t\t\tlocked = lock;\n\t\t\t\t},\n\t\t\t\tsetClear: function (depth) {\n\t\t\t\t\tif (currentDepthClear !== depth) {\n\t\t\t\t\t\tgl.clearDepth(depth);\n\t\t\t\t\t\tcurrentDepthClear = depth;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\treset: function () {\n\t\t\t\t\tlocked = false;\n\t\t\t\t\tcurrentDepthMask = null;\n\t\t\t\t\tcurrentDepthFunc = null;\n\t\t\t\t\tcurrentDepthClear = null;\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t\tfunction StencilBuffer() {\n\t\t\tlet locked = false;\n\t\t\tlet currentStencilMask = null;\n\t\t\tlet currentStencilFunc = null;\n\t\t\tlet currentStencilRef = null;\n\t\t\tlet currentStencilFuncMask = null;\n\t\t\tlet currentStencilFail = null;\n\t\t\tlet currentStencilZFail = null;\n\t\t\tlet currentStencilZPass = null;\n\t\t\tlet currentStencilClear = null;\n\t\t\treturn {\n\t\t\t\tsetTest: function (stencilTest) {\n\t\t\t\t\tif (!locked) {\n\t\t\t\t\t\tif (stencilTest) {\n\t\t\t\t\t\t\tenable(gl.STENCIL_TEST);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdisable(gl.STENCIL_TEST);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tsetMask: function (stencilMask) {\n\t\t\t\t\tif (currentStencilMask !== stencilMask && !locked) {\n\t\t\t\t\t\tgl.stencilMask(stencilMask);\n\t\t\t\t\t\tcurrentStencilMask = stencilMask;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tsetFunc: function (stencilFunc, stencilRef, stencilMask) {\n\t\t\t\t\tif (currentStencilFunc !== stencilFunc || currentStencilRef !== stencilRef || currentStencilFuncMask !== stencilMask) {\n\t\t\t\t\t\tgl.stencilFunc(stencilFunc, stencilRef, stencilMask);\n\t\t\t\t\t\tcurrentStencilFunc = stencilFunc;\n\t\t\t\t\t\tcurrentStencilRef = stencilRef;\n\t\t\t\t\t\tcurrentStencilFuncMask = stencilMask;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tsetOp: function (stencilFail, stencilZFail, stencilZPass) {\n\t\t\t\t\tif (currentStencilFail !== stencilFail || currentStencilZFail !== stencilZFail || currentStencilZPass !== stencilZPass) {\n\t\t\t\t\t\tgl.stencilOp(stencilFail, stencilZFail, stencilZPass);\n\t\t\t\t\t\tcurrentStencilFail = stencilFail;\n\t\t\t\t\t\tcurrentStencilZFail = stencilZFail;\n\t\t\t\t\t\tcurrentStencilZPass = stencilZPass;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tsetLocked: function (lock) {\n\t\t\t\t\tlocked = lock;\n\t\t\t\t},\n\t\t\t\tsetClear: function (stencil) {\n\t\t\t\t\tif (currentStencilClear !== stencil) {\n\t\t\t\t\t\tgl.clearStencil(stencil);\n\t\t\t\t\t\tcurrentStencilClear = stencil;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\treset: function () {\n\t\t\t\t\tlocked = false;\n\t\t\t\t\tcurrentStencilMask = null;\n\t\t\t\t\tcurrentStencilFunc = null;\n\t\t\t\t\tcurrentStencilRef = null;\n\t\t\t\t\tcurrentStencilFuncMask = null;\n\t\t\t\t\tcurrentStencilFail = null;\n\t\t\t\t\tcurrentStencilZFail = null;\n\t\t\t\t\tcurrentStencilZPass = null;\n\t\t\t\t\tcurrentStencilClear = null;\n\t\t\t\t}\n\t\t\t};\n\t\t} //\n\n\n\t\tconst colorBuffer = new ColorBuffer();\n\t\tconst depthBuffer = new DepthBuffer();\n\t\tconst stencilBuffer = new StencilBuffer();\n\t\tlet enabledCapabilities = {};\n\t\tlet xrFramebuffer = null;\n\t\tlet currentBoundFramebuffers = {};\n\t\tlet currentProgram = null;\n\t\tlet currentBlendingEnabled = false;\n\t\tlet currentBlending = null;\n\t\tlet currentBlendEquation = null;\n\t\tlet currentBlendSrc = null;\n\t\tlet currentBlendDst = null;\n\t\tlet currentBlendEquationAlpha = null;\n\t\tlet currentBlendSrcAlpha = null;\n\t\tlet currentBlendDstAlpha = null;\n\t\tlet currentPremultipledAlpha = false;\n\t\tlet currentFlipSided = null;\n\t\tlet currentCullFace = null;\n\t\tlet currentLineWidth = null;\n\t\tlet currentPolygonOffsetFactor = null;\n\t\tlet currentPolygonOffsetUnits = null;\n\t\tconst maxTextures = gl.getParameter(gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS);\n\t\tlet lineWidthAvailable = false;\n\t\tlet version = 0;\n\t\tconst glVersion = gl.getParameter(gl.VERSION);\n\n\t\tif (glVersion.indexOf('WebGL') !== -1) {\n\t\t\tversion = parseFloat(/^WebGL (\\d)/.exec(glVersion)[1]);\n\t\t\tlineWidthAvailable = version >= 1.0;\n\t\t} else if (glVersion.indexOf('OpenGL ES') !== -1) {\n\t\t\tversion = parseFloat(/^OpenGL ES (\\d)/.exec(glVersion)[1]);\n\t\t\tlineWidthAvailable = version >= 2.0;\n\t\t}\n\n\t\tlet currentTextureSlot = null;\n\t\tlet currentBoundTextures = {};\n\t\tconst scissorParam = gl.getParameter(gl.SCISSOR_BOX);\n\t\tconst viewportParam = gl.getParameter(gl.VIEWPORT);\n\t\tconst currentScissor = new Vector4().fromArray(scissorParam);\n\t\tconst currentViewport = new Vector4().fromArray(viewportParam);\n\n\t\tfunction createTexture(type, target, count) {\n\t\t\tconst data = new Uint8Array(4); // 4 is required to match default unpack alignment of 4.\n\n\t\t\tconst texture = gl.createTexture();\n\t\t\tgl.bindTexture(type, texture);\n\t\t\tgl.texParameteri(type, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n\t\t\tgl.texParameteri(type, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n\n\t\t\tfor (let i = 0; i < count; i++) {\n\t\t\t\tgl.texImage2D(target + i, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, data);\n\t\t\t}\n\n\t\t\treturn texture;\n\t\t}\n\n\t\tconst emptyTextures = {};\n\t\temptyTextures[gl.TEXTURE_2D] = createTexture(gl.TEXTURE_2D, gl.TEXTURE_2D, 1);\n\t\temptyTextures[gl.TEXTURE_CUBE_MAP] = createTexture(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_CUBE_MAP_POSITIVE_X, 6); // init\n\n\t\tcolorBuffer.setClear(0, 0, 0, 1);\n\t\tdepthBuffer.setClear(1);\n\t\tstencilBuffer.setClear(0);\n\t\tenable(gl.DEPTH_TEST);\n\t\tdepthBuffer.setFunc(LessEqualDepth);\n\t\tsetFlipSided(false);\n\t\tsetCullFace(CullFaceBack);\n\t\tenable(gl.CULL_FACE);\n\t\tsetBlending(NoBlending); //\n\n\t\tfunction enable(id) {\n\t\t\tif (enabledCapabilities[id] !== true) {\n\t\t\t\tgl.enable(id);\n\t\t\t\tenabledCapabilities[id] = true;\n\t\t\t}\n\t\t}\n\n\t\tfunction disable(id) {\n\t\t\tif (enabledCapabilities[id] !== false) {\n\t\t\t\tgl.disable(id);\n\t\t\t\tenabledCapabilities[id] = false;\n\t\t\t}\n\t\t}\n\n\t\tfunction bindXRFramebuffer(framebuffer) {\n\t\t\tif (framebuffer !== xrFramebuffer) {\n\t\t\t\tgl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);\n\t\t\t\txrFramebuffer = framebuffer;\n\t\t\t}\n\t\t}\n\n\t\tfunction bindFramebuffer(target, framebuffer) {\n\t\t\tif (framebuffer === null && xrFramebuffer !== null) framebuffer = xrFramebuffer; // use active XR framebuffer if available\n\n\t\t\tif (currentBoundFramebuffers[target] !== framebuffer) {\n\t\t\t\tgl.bindFramebuffer(target, framebuffer);\n\t\t\t\tcurrentBoundFramebuffers[target] = framebuffer;\n\n\t\t\t\tif (isWebGL2) {\n\t\t\t\t\t// gl.DRAW_FRAMEBUFFER is equivalent to gl.FRAMEBUFFER\n\t\t\t\t\tif (target === gl.DRAW_FRAMEBUFFER) {\n\t\t\t\t\t\tcurrentBoundFramebuffers[gl.FRAMEBUFFER] = framebuffer;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (target === gl.FRAMEBUFFER) {\n\t\t\t\t\t\tcurrentBoundFramebuffers[gl.DRAW_FRAMEBUFFER] = framebuffer;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tfunction useProgram(program) {\n\t\t\tif (currentProgram !== program) {\n\t\t\t\tgl.useProgram(program);\n\t\t\t\tcurrentProgram = program;\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tconst equationToGL = {\n\t\t\t[AddEquation]: gl.FUNC_ADD,\n\t\t\t[SubtractEquation]: gl.FUNC_SUBTRACT,\n\t\t\t[ReverseSubtractEquation]: gl.FUNC_REVERSE_SUBTRACT\n\t\t};\n\n\t\tif (isWebGL2) {\n\t\t\tequationToGL[MinEquation] = gl.MIN;\n\t\t\tequationToGL[MaxEquation] = gl.MAX;\n\t\t} else {\n\t\t\tconst extension = extensions.get('EXT_blend_minmax');\n\n\t\t\tif (extension !== null) {\n\t\t\t\tequationToGL[MinEquation] = extension.MIN_EXT;\n\t\t\t\tequationToGL[MaxEquation] = extension.MAX_EXT;\n\t\t\t}\n\t\t}\n\n\t\tconst factorToGL = {\n\t\t\t[ZeroFactor]: gl.ZERO,\n\t\t\t[OneFactor]: gl.ONE,\n\t\t\t[SrcColorFactor]: gl.SRC_COLOR,\n\t\t\t[SrcAlphaFactor]: gl.SRC_ALPHA,\n\t\t\t[SrcAlphaSaturateFactor]: gl.SRC_ALPHA_SATURATE,\n\t\t\t[DstColorFactor]: gl.DST_COLOR,\n\t\t\t[DstAlphaFactor]: gl.DST_ALPHA,\n\t\t\t[OneMinusSrcColorFactor]: gl.ONE_MINUS_SRC_COLOR,\n\t\t\t[OneMinusSrcAlphaFactor]: gl.ONE_MINUS_SRC_ALPHA,\n\t\t\t[OneMinusDstColorFactor]: gl.ONE_MINUS_DST_COLOR,\n\t\t\t[OneMinusDstAlphaFactor]: gl.ONE_MINUS_DST_ALPHA\n\t\t};\n\n\t\tfunction setBlending(blending, blendEquation, blendSrc, blendDst, blendEquationAlpha, blendSrcAlpha, blendDstAlpha, premultipliedAlpha) {\n\t\t\tif (blending === NoBlending) {\n\t\t\t\tif (currentBlendingEnabled === true) {\n\t\t\t\t\tdisable(gl.BLEND);\n\t\t\t\t\tcurrentBlendingEnabled = false;\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (currentBlendingEnabled === false) {\n\t\t\t\tenable(gl.BLEND);\n\t\t\t\tcurrentBlendingEnabled = true;\n\t\t\t}\n\n\t\t\tif (blending !== CustomBlending) {\n\t\t\t\tif (blending !== currentBlending || premultipliedAlpha !== currentPremultipledAlpha) {\n\t\t\t\t\tif (currentBlendEquation !== AddEquation || currentBlendEquationAlpha !== AddEquation) {\n\t\t\t\t\t\tgl.blendEquation(gl.FUNC_ADD);\n\t\t\t\t\t\tcurrentBlendEquation = AddEquation;\n\t\t\t\t\t\tcurrentBlendEquationAlpha = AddEquation;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (premultipliedAlpha) {\n\t\t\t\t\t\tswitch (blending) {\n\t\t\t\t\t\t\tcase NormalBlending:\n\t\t\t\t\t\t\t\tgl.blendFuncSeparate(gl.ONE, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA);\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase AdditiveBlending:\n\t\t\t\t\t\t\t\tgl.blendFunc(gl.ONE, gl.ONE);\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase SubtractiveBlending:\n\t\t\t\t\t\t\t\tgl.blendFuncSeparate(gl.ZERO, gl.ZERO, gl.ONE_MINUS_SRC_COLOR, gl.ONE_MINUS_SRC_ALPHA);\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase MultiplyBlending:\n\t\t\t\t\t\t\t\tgl.blendFuncSeparate(gl.ZERO, gl.SRC_COLOR, gl.ZERO, gl.SRC_ALPHA);\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tconsole.error('THREE.WebGLState: Invalid blending: ', blending);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tswitch (blending) {\n\t\t\t\t\t\t\tcase NormalBlending:\n\t\t\t\t\t\t\t\tgl.blendFuncSeparate(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA);\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase AdditiveBlending:\n\t\t\t\t\t\t\t\tgl.blendFunc(gl.SRC_ALPHA, gl.ONE);\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase SubtractiveBlending:\n\t\t\t\t\t\t\t\tgl.blendFunc(gl.ZERO, gl.ONE_MINUS_SRC_COLOR);\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase MultiplyBlending:\n\t\t\t\t\t\t\t\tgl.blendFunc(gl.ZERO, gl.SRC_COLOR);\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tconsole.error('THREE.WebGLState: Invalid blending: ', blending);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tcurrentBlendSrc = null;\n\t\t\t\t\tcurrentBlendDst = null;\n\t\t\t\t\tcurrentBlendSrcAlpha = null;\n\t\t\t\t\tcurrentBlendDstAlpha = null;\n\t\t\t\t\tcurrentBlending = blending;\n\t\t\t\t\tcurrentPremultipledAlpha = premultipliedAlpha;\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t} // custom blending\n\n\n\t\t\tblendEquationAlpha = blendEquationAlpha || blendEquation;\n\t\t\tblendSrcAlpha = blendSrcAlpha || blendSrc;\n\t\t\tblendDstAlpha = blendDstAlpha || blendDst;\n\n\t\t\tif (blendEquation !== currentBlendEquation || blendEquationAlpha !== currentBlendEquationAlpha) {\n\t\t\t\tgl.blendEquationSeparate(equationToGL[blendEquation], equationToGL[blendEquationAlpha]);\n\t\t\t\tcurrentBlendEquation = blendEquation;\n\t\t\t\tcurrentBlendEquationAlpha = blendEquationAlpha;\n\t\t\t}\n\n\t\t\tif (blendSrc !== currentBlendSrc || blendDst !== currentBlendDst || blendSrcAlpha !== currentBlendSrcAlpha || blendDstAlpha !== currentBlendDstAlpha) {\n\t\t\t\tgl.blendFuncSeparate(factorToGL[blendSrc], factorToGL[blendDst], factorToGL[blendSrcAlpha], factorToGL[blendDstAlpha]);\n\t\t\t\tcurrentBlendSrc = blendSrc;\n\t\t\t\tcurrentBlendDst = blendDst;\n\t\t\t\tcurrentBlendSrcAlpha = blendSrcAlpha;\n\t\t\t\tcurrentBlendDstAlpha = blendDstAlpha;\n\t\t\t}\n\n\t\t\tcurrentBlending = blending;\n\t\t\tcurrentPremultipledAlpha = null;\n\t\t}\n\n\t\tfunction setMaterial(material, frontFaceCW) {\n\t\t\tmaterial.side === DoubleSide ? disable(gl.CULL_FACE) : enable(gl.CULL_FACE);\n\t\t\tlet flipSided = material.side === BackSide;\n\t\t\tif (frontFaceCW) flipSided = !flipSided;\n\t\t\tsetFlipSided(flipSided);\n\t\t\tmaterial.blending === NormalBlending && material.transparent === false ? setBlending(NoBlending) : setBlending(material.blending, material.blendEquation, material.blendSrc, material.blendDst, material.blendEquationAlpha, material.blendSrcAlpha, material.blendDstAlpha, material.premultipliedAlpha);\n\t\t\tdepthBuffer.setFunc(material.depthFunc);\n\t\t\tdepthBuffer.setTest(material.depthTest);\n\t\t\tdepthBuffer.setMask(material.depthWrite);\n\t\t\tcolorBuffer.setMask(material.colorWrite);\n\t\t\tconst stencilWrite = material.stencilWrite;\n\t\t\tstencilBuffer.setTest(stencilWrite);\n\n\t\t\tif (stencilWrite) {\n\t\t\t\tstencilBuffer.setMask(material.stencilWriteMask);\n\t\t\t\tstencilBuffer.setFunc(material.stencilFunc, material.stencilRef, material.stencilFuncMask);\n\t\t\t\tstencilBuffer.setOp(material.stencilFail, material.stencilZFail, material.stencilZPass);\n\t\t\t}\n\n\t\t\tsetPolygonOffset(material.polygonOffset, material.polygonOffsetFactor, material.polygonOffsetUnits);\n\t\t\tmaterial.alphaToCoverage === true ? enable(gl.SAMPLE_ALPHA_TO_COVERAGE) : disable(gl.SAMPLE_ALPHA_TO_COVERAGE);\n\t\t} //\n\n\n\t\tfunction setFlipSided(flipSided) {\n\t\t\tif (currentFlipSided !== flipSided) {\n\t\t\t\tif (flipSided) {\n\t\t\t\t\tgl.frontFace(gl.CW);\n\t\t\t\t} else {\n\t\t\t\t\tgl.frontFace(gl.CCW);\n\t\t\t\t}\n\n\t\t\t\tcurrentFlipSided = flipSided;\n\t\t\t}\n\t\t}\n\n\t\tfunction setCullFace(cullFace) {\n\t\t\tif (cullFace !== CullFaceNone) {\n\t\t\t\tenable(gl.CULL_FACE);\n\n\t\t\t\tif (cullFace !== currentCullFace) {\n\t\t\t\t\tif (cullFace === CullFaceBack) {\n\t\t\t\t\t\tgl.cullFace(gl.BACK);\n\t\t\t\t\t} else if (cullFace === CullFaceFront) {\n\t\t\t\t\t\tgl.cullFace(gl.FRONT);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tgl.cullFace(gl.FRONT_AND_BACK);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdisable(gl.CULL_FACE);\n\t\t\t}\n\n\t\t\tcurrentCullFace = cullFace;\n\t\t}\n\n\t\tfunction setLineWidth(width) {\n\t\t\tif (width !== currentLineWidth) {\n\t\t\t\tif (lineWidthAvailable) gl.lineWidth(width);\n\t\t\t\tcurrentLineWidth = width;\n\t\t\t}\n\t\t}\n\n\t\tfunction setPolygonOffset(polygonOffset, factor, units) {\n\t\t\tif (polygonOffset) {\n\t\t\t\tenable(gl.POLYGON_OFFSET_FILL);\n\n\t\t\t\tif (currentPolygonOffsetFactor !== factor || currentPolygonOffsetUnits !== units) {\n\t\t\t\t\tgl.polygonOffset(factor, units);\n\t\t\t\t\tcurrentPolygonOffsetFactor = factor;\n\t\t\t\t\tcurrentPolygonOffsetUnits = units;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdisable(gl.POLYGON_OFFSET_FILL);\n\t\t\t}\n\t\t}\n\n\t\tfunction setScissorTest(scissorTest) {\n\t\t\tif (scissorTest) {\n\t\t\t\tenable(gl.SCISSOR_TEST);\n\t\t\t} else {\n\t\t\t\tdisable(gl.SCISSOR_TEST);\n\t\t\t}\n\t\t} // texture\n\n\n\t\tfunction activeTexture(webglSlot) {\n\t\t\tif (webglSlot === undefined) webglSlot = gl.TEXTURE0 + maxTextures - 1;\n\n\t\t\tif (currentTextureSlot !== webglSlot) {\n\t\t\t\tgl.activeTexture(webglSlot);\n\t\t\t\tcurrentTextureSlot = webglSlot;\n\t\t\t}\n\t\t}\n\n\t\tfunction bindTexture(webglType, webglTexture) {\n\t\t\tif (currentTextureSlot === null) {\n\t\t\t\tactiveTexture();\n\t\t\t}\n\n\t\t\tlet boundTexture = currentBoundTextures[currentTextureSlot];\n\n\t\t\tif (boundTexture === undefined) {\n\t\t\t\tboundTexture = {\n\t\t\t\t\ttype: undefined,\n\t\t\t\t\ttexture: undefined\n\t\t\t\t};\n\t\t\t\tcurrentBoundTextures[currentTextureSlot] = boundTexture;\n\t\t\t}\n\n\t\t\tif (boundTexture.type !== webglType || boundTexture.texture !== webglTexture) {\n\t\t\t\tgl.bindTexture(webglType, webglTexture || emptyTextures[webglType]);\n\t\t\t\tboundTexture.type = webglType;\n\t\t\t\tboundTexture.texture = webglTexture;\n\t\t\t}\n\t\t}\n\n\t\tfunction unbindTexture() {\n\t\t\tconst boundTexture = currentBoundTextures[currentTextureSlot];\n\n\t\t\tif (boundTexture !== undefined && boundTexture.type !== undefined) {\n\t\t\t\tgl.bindTexture(boundTexture.type, null);\n\t\t\t\tboundTexture.type = undefined;\n\t\t\t\tboundTexture.texture = undefined;\n\t\t\t}\n\t\t}\n\n\t\tfunction compressedTexImage2D() {\n\t\t\ttry {\n\t\t\t\tgl.compressedTexImage2D.apply(gl, arguments);\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error('THREE.WebGLState:', error);\n\t\t\t}\n\t\t}\n\n\t\tfunction texImage2D() {\n\t\t\ttry {\n\t\t\t\tgl.texImage2D.apply(gl, arguments);\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error('THREE.WebGLState:', error);\n\t\t\t}\n\t\t}\n\n\t\tfunction texImage3D() {\n\t\t\ttry {\n\t\t\t\tgl.texImage3D.apply(gl, arguments);\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error('THREE.WebGLState:', error);\n\t\t\t}\n\t\t} //\n\n\n\t\tfunction scissor(scissor) {\n\t\t\tif (currentScissor.equals(scissor) === false) {\n\t\t\t\tgl.scissor(scissor.x, scissor.y, scissor.z, scissor.w);\n\t\t\t\tcurrentScissor.copy(scissor);\n\t\t\t}\n\t\t}\n\n\t\tfunction viewport(viewport) {\n\t\t\tif (currentViewport.equals(viewport) === false) {\n\t\t\t\tgl.viewport(viewport.x, viewport.y, viewport.z, viewport.w);\n\t\t\t\tcurrentViewport.copy(viewport);\n\t\t\t}\n\t\t} //\n\n\n\t\tfunction reset() {\n\t\t\t// reset state\n\t\t\tgl.disable(gl.BLEND);\n\t\t\tgl.disable(gl.CULL_FACE);\n\t\t\tgl.disable(gl.DEPTH_TEST);\n\t\t\tgl.disable(gl.POLYGON_OFFSET_FILL);\n\t\t\tgl.disable(gl.SCISSOR_TEST);\n\t\t\tgl.disable(gl.STENCIL_TEST);\n\t\t\tgl.disable(gl.SAMPLE_ALPHA_TO_COVERAGE);\n\t\t\tgl.blendEquation(gl.FUNC_ADD);\n\t\t\tgl.blendFunc(gl.ONE, gl.ZERO);\n\t\t\tgl.blendFuncSeparate(gl.ONE, gl.ZERO, gl.ONE, gl.ZERO);\n\t\t\tgl.colorMask(true, true, true, true);\n\t\t\tgl.clearColor(0, 0, 0, 0);\n\t\t\tgl.depthMask(true);\n\t\t\tgl.depthFunc(gl.LESS);\n\t\t\tgl.clearDepth(1);\n\t\t\tgl.stencilMask(0xffffffff);\n\t\t\tgl.stencilFunc(gl.ALWAYS, 0, 0xffffffff);\n\t\t\tgl.stencilOp(gl.KEEP, gl.KEEP, gl.KEEP);\n\t\t\tgl.clearStencil(0);\n\t\t\tgl.cullFace(gl.BACK);\n\t\t\tgl.frontFace(gl.CCW);\n\t\t\tgl.polygonOffset(0, 0);\n\t\t\tgl.activeTexture(gl.TEXTURE0);\n\t\t\tgl.bindFramebuffer(gl.FRAMEBUFFER, null);\n\n\t\t\tif (isWebGL2 === true) {\n\t\t\t\tgl.bindFramebuffer(gl.DRAW_FRAMEBUFFER, null);\n\t\t\t\tgl.bindFramebuffer(gl.READ_FRAMEBUFFER, null);\n\t\t\t}\n\n\t\t\tgl.useProgram(null);\n\t\t\tgl.lineWidth(1);\n\t\t\tgl.scissor(0, 0, gl.canvas.width, gl.canvas.height);\n\t\t\tgl.viewport(0, 0, gl.canvas.width, gl.canvas.height); // reset internals\n\n\t\t\tenabledCapabilities = {};\n\t\t\tcurrentTextureSlot = null;\n\t\t\tcurrentBoundTextures = {};\n\t\t\txrFramebuffer = null;\n\t\t\tcurrentBoundFramebuffers = {};\n\t\t\tcurrentProgram = null;\n\t\t\tcurrentBlendingEnabled = false;\n\t\t\tcurrentBlending = null;\n\t\t\tcurrentBlendEquation = null;\n\t\t\tcurrentBlendSrc = null;\n\t\t\tcurrentBlendDst = null;\n\t\t\tcurrentBlendEquationAlpha = null;\n\t\t\tcurrentBlendSrcAlpha = null;\n\t\t\tcurrentBlendDstAlpha = null;\n\t\t\tcurrentPremultipledAlpha = false;\n\t\t\tcurrentFlipSided = null;\n\t\t\tcurrentCullFace = null;\n\t\t\tcurrentLineWidth = null;\n\t\t\tcurrentPolygonOffsetFactor = null;\n\t\t\tcurrentPolygonOffsetUnits = null;\n\t\t\tcurrentScissor.set(0, 0, gl.canvas.width, gl.canvas.height);\n\t\t\tcurrentViewport.set(0, 0, gl.canvas.width, gl.canvas.height);\n\t\t\tcolorBuffer.reset();\n\t\t\tdepthBuffer.reset();\n\t\t\tstencilBuffer.reset();\n\t\t}\n\n\t\treturn {\n\t\t\tbuffers: {\n\t\t\t\tcolor: colorBuffer,\n\t\t\t\tdepth: depthBuffer,\n\t\t\t\tstencil: stencilBuffer\n\t\t\t},\n\t\t\tenable: enable,\n\t\t\tdisable: disable,\n\t\t\tbindFramebuffer: bindFramebuffer,\n\t\t\tbindXRFramebuffer: bindXRFramebuffer,\n\t\t\tuseProgram: useProgram,\n\t\t\tsetBlending: setBlending,\n\t\t\tsetMaterial: setMaterial,\n\t\t\tsetFlipSided: setFlipSided,\n\t\t\tsetCullFace: setCullFace,\n\t\t\tsetLineWidth: setLineWidth,\n\t\t\tsetPolygonOffset: setPolygonOffset,\n\t\t\tsetScissorTest: setScissorTest,\n\t\t\tactiveTexture: activeTexture,\n\t\t\tbindTexture: bindTexture,\n\t\t\tunbindTexture: unbindTexture,\n\t\t\tcompressedTexImage2D: compressedTexImage2D,\n\t\t\ttexImage2D: texImage2D,\n\t\t\ttexImage3D: texImage3D,\n\t\t\tscissor: scissor,\n\t\t\tviewport: viewport,\n\t\t\treset: reset\n\t\t};\n\t}\n\n\tfunction WebGLTextures(_gl, extensions, state, properties, capabilities, utils, info) {\n\t\tconst isWebGL2 = capabilities.isWebGL2;\n\t\tconst maxTextures = capabilities.maxTextures;\n\t\tconst maxCubemapSize = capabilities.maxCubemapSize;\n\t\tconst maxTextureSize = capabilities.maxTextureSize;\n\t\tconst maxSamples = capabilities.maxSamples;\n\n\t\tconst _videoTextures = new WeakMap();\n\n\t\tlet _canvas; // cordova iOS (as of 5.0) still uses UIWebView, which provides OffscreenCanvas,\n\t\t// also OffscreenCanvas.getContext(\"webgl\"), but not OffscreenCanvas.getContext(\"2d\")!\n\t\t// Some implementations may only implement OffscreenCanvas partially (e.g. lacking 2d).\n\n\n\t\tlet useOffscreenCanvas = false;\n\n\t\ttry {\n\t\t\tuseOffscreenCanvas = typeof OffscreenCanvas !== 'undefined' && new OffscreenCanvas(1, 1).getContext('2d') !== null;\n\t\t} catch (err) {// Ignore any errors\n\t\t}\n\n\t\tfunction createCanvas(width, height) {\n\t\t\t// Use OffscreenCanvas when available. Specially needed in web workers\n\t\t\treturn useOffscreenCanvas ? new OffscreenCanvas(width, height) : createElementNS('canvas');\n\t\t}\n\n\t\tfunction resizeImage(image, needsPowerOfTwo, needsNewCanvas, maxSize) {\n\t\t\tlet scale = 1; // handle case if texture exceeds max size\n\n\t\t\tif (image.width > maxSize || image.height > maxSize) {\n\t\t\t\tscale = maxSize / Math.max(image.width, image.height);\n\t\t\t} // only perform resize if necessary\n\n\n\t\t\tif (scale < 1 || needsPowerOfTwo === true) {\n\t\t\t\t// only perform resize for certain image types\n\t\t\t\tif (typeof HTMLImageElement !== 'undefined' && image instanceof HTMLImageElement || typeof HTMLCanvasElement !== 'undefined' && image instanceof HTMLCanvasElement || typeof ImageBitmap !== 'undefined' && image instanceof ImageBitmap) {\n\t\t\t\t\tconst floor = needsPowerOfTwo ? floorPowerOfTwo : Math.floor;\n\t\t\t\t\tconst width = floor(scale * image.width);\n\t\t\t\t\tconst height = floor(scale * image.height);\n\t\t\t\t\tif (_canvas === undefined) _canvas = createCanvas(width, height); // cube textures can't reuse the same canvas\n\n\t\t\t\t\tconst canvas = needsNewCanvas ? createCanvas(width, height) : _canvas;\n\t\t\t\t\tcanvas.width = width;\n\t\t\t\t\tcanvas.height = height;\n\t\t\t\t\tconst context = canvas.getContext('2d');\n\t\t\t\t\tcontext.drawImage(image, 0, 0, width, height);\n\t\t\t\t\tconsole.warn('THREE.WebGLRenderer: Texture has been resized from (' + image.width + 'x' + image.height + ') to (' + width + 'x' + height + ').');\n\t\t\t\t\treturn canvas;\n\t\t\t\t} else {\n\t\t\t\t\tif ('data' in image) {\n\t\t\t\t\t\tconsole.warn('THREE.WebGLRenderer: Image in DataTexture is too big (' + image.width + 'x' + image.height + ').');\n\t\t\t\t\t}\n\n\t\t\t\t\treturn image;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn image;\n\t\t}\n\n\t\tfunction isPowerOfTwo$1(image) {\n\t\t\treturn isPowerOfTwo(image.width) && isPowerOfTwo(image.height);\n\t\t}\n\n\t\tfunction textureNeedsPowerOfTwo(texture) {\n\t\t\tif (isWebGL2) return false;\n\t\t\treturn texture.wrapS !== ClampToEdgeWrapping || texture.wrapT !== ClampToEdgeWrapping || texture.minFilter !== NearestFilter && texture.minFilter !== LinearFilter;\n\t\t}\n\n\t\tfunction textureNeedsGenerateMipmaps(texture, supportsMips) {\n\t\t\treturn texture.generateMipmaps && supportsMips && texture.minFilter !== NearestFilter && texture.minFilter !== LinearFilter;\n\t\t}\n\n\t\tfunction generateMipmap(target, texture, width, height, depth = 1) {\n\t\t\t_gl.generateMipmap(target);\n\n\t\t\tconst textureProperties = properties.get(texture);\n\t\t\ttextureProperties.__maxMipLevel = Math.log2(Math.max(width, height, depth));\n\t\t}\n\n\t\tfunction getInternalFormat(internalFormatName, glFormat, glType, encoding) {\n\t\t\tif (isWebGL2 === false) return glFormat;\n\n\t\t\tif (internalFormatName !== null) {\n\t\t\t\tif (_gl[internalFormatName] !== undefined) return _gl[internalFormatName];\n\t\t\t\tconsole.warn('THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format \\'' + internalFormatName + '\\'');\n\t\t\t}\n\n\t\t\tlet internalFormat = glFormat;\n\n\t\t\tif (glFormat === _gl.RED) {\n\t\t\t\tif (glType === _gl.FLOAT) internalFormat = _gl.R32F;\n\t\t\t\tif (glType === _gl.HALF_FLOAT) internalFormat = _gl.R16F;\n\t\t\t\tif (glType === _gl.UNSIGNED_BYTE) internalFormat = _gl.R8;\n\t\t\t}\n\n\t\t\tif (glFormat === _gl.RGB) {\n\t\t\t\tif (glType === _gl.FLOAT) internalFormat = _gl.RGB32F;\n\t\t\t\tif (glType === _gl.HALF_FLOAT) internalFormat = _gl.RGB16F;\n\t\t\t\tif (glType === _gl.UNSIGNED_BYTE) internalFormat = _gl.RGB8;\n\t\t\t}\n\n\t\t\tif (glFormat === _gl.RGBA) {\n\t\t\t\tif (glType === _gl.FLOAT) internalFormat = _gl.RGBA32F;\n\t\t\t\tif (glType === _gl.HALF_FLOAT) internalFormat = _gl.RGBA16F;\n\t\t\t\tif (glType === _gl.UNSIGNED_BYTE) internalFormat = encoding === sRGBEncoding ? _gl.SRGB8_ALPHA8 : _gl.RGBA8;\n\t\t\t}\n\n\t\t\tif (internalFormat === _gl.R16F || internalFormat === _gl.R32F || internalFormat === _gl.RGBA16F || internalFormat === _gl.RGBA32F) {\n\t\t\t\textensions.get('EXT_color_buffer_float');\n\t\t\t}\n\n\t\t\treturn internalFormat;\n\t\t} // Fallback filters for non-power-of-2 textures\n\n\n\t\tfunction filterFallback(f) {\n\t\t\tif (f === NearestFilter || f === NearestMipmapNearestFilter || f === NearestMipmapLinearFilter) {\n\t\t\t\treturn _gl.NEAREST;\n\t\t\t}\n\n\t\t\treturn _gl.LINEAR;\n\t\t} //\n\n\n\t\tfunction onTextureDispose(event) {\n\t\t\tconst texture = event.target;\n\t\t\ttexture.removeEventListener('dispose', onTextureDispose);\n\t\t\tdeallocateTexture(texture);\n\n\t\t\tif (texture.isVideoTexture) {\n\t\t\t\t_videoTextures.delete(texture);\n\t\t\t}\n\n\t\t\tinfo.memory.textures--;\n\t\t}\n\n\t\tfunction onRenderTargetDispose(event) {\n\t\t\tconst renderTarget = event.target;\n\t\t\trenderTarget.removeEventListener('dispose', onRenderTargetDispose);\n\t\t\tdeallocateRenderTarget(renderTarget);\n\t\t} //\n\n\n\t\tfunction deallocateTexture(texture) {\n\t\t\tconst textureProperties = properties.get(texture);\n\t\t\tif (textureProperties.__webglInit === undefined) return;\n\n\t\t\t_gl.deleteTexture(textureProperties.__webglTexture);\n\n\t\t\tproperties.remove(texture);\n\t\t}\n\n\t\tfunction deallocateRenderTarget(renderTarget) {\n\t\t\tconst texture = renderTarget.texture;\n\t\t\tconst renderTargetProperties = properties.get(renderTarget);\n\t\t\tconst textureProperties = properties.get(texture);\n\t\t\tif (!renderTarget) return;\n\n\t\t\tif (textureProperties.__webglTexture !== undefined) {\n\t\t\t\t_gl.deleteTexture(textureProperties.__webglTexture);\n\n\t\t\t\tinfo.memory.textures--;\n\t\t\t}\n\n\t\t\tif (renderTarget.depthTexture) {\n\t\t\t\trenderTarget.depthTexture.dispose();\n\t\t\t}\n\n\t\t\tif (renderTarget.isWebGLCubeRenderTarget) {\n\t\t\t\tfor (let i = 0; i < 6; i++) {\n\t\t\t\t\t_gl.deleteFramebuffer(renderTargetProperties.__webglFramebuffer[i]);\n\n\t\t\t\t\tif (renderTargetProperties.__webglDepthbuffer) _gl.deleteRenderbuffer(renderTargetProperties.__webglDepthbuffer[i]);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t_gl.deleteFramebuffer(renderTargetProperties.__webglFramebuffer);\n\n\t\t\t\tif (renderTargetProperties.__webglDepthbuffer) _gl.deleteRenderbuffer(renderTargetProperties.__webglDepthbuffer);\n\t\t\t\tif (renderTargetProperties.__webglMultisampledFramebuffer) _gl.deleteFramebuffer(renderTargetProperties.__webglMultisampledFramebuffer);\n\t\t\t\tif (renderTargetProperties.__webglColorRenderbuffer) _gl.deleteRenderbuffer(renderTargetProperties.__webglColorRenderbuffer);\n\t\t\t\tif (renderTargetProperties.__webglDepthRenderbuffer) _gl.deleteRenderbuffer(renderTargetProperties.__webglDepthRenderbuffer);\n\t\t\t}\n\n\t\t\tif (renderTarget.isWebGLMultipleRenderTargets) {\n\t\t\t\tfor (let i = 0, il = texture.length; i < il; i++) {\n\t\t\t\t\tconst attachmentProperties = properties.get(texture[i]);\n\n\t\t\t\t\tif (attachmentProperties.__webglTexture) {\n\t\t\t\t\t\t_gl.deleteTexture(attachmentProperties.__webglTexture);\n\n\t\t\t\t\t\tinfo.memory.textures--;\n\t\t\t\t\t}\n\n\t\t\t\t\tproperties.remove(texture[i]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tproperties.remove(texture);\n\t\t\tproperties.remove(renderTarget);\n\t\t} //\n\n\n\t\tlet textureUnits = 0;\n\n\t\tfunction resetTextureUnits() {\n\t\t\ttextureUnits = 0;\n\t\t}\n\n\t\tfunction allocateTextureUnit() {\n\t\t\tconst textureUnit = textureUnits;\n\n\t\t\tif (textureUnit >= maxTextures) {\n\t\t\t\tconsole.warn('THREE.WebGLTextures: Trying to use ' + textureUnit + ' texture units while this GPU supports only ' + maxTextures);\n\t\t\t}\n\n\t\t\ttextureUnits += 1;\n\t\t\treturn textureUnit;\n\t\t} //\n\n\n\t\tfunction setTexture2D(texture, slot) {\n\t\t\tconst textureProperties = properties.get(texture);\n\t\t\tif (texture.isVideoTexture) updateVideoTexture(texture);\n\n\t\t\tif (texture.version > 0 && textureProperties.__version !== texture.version) {\n\t\t\t\tconst image = texture.image;\n\n\t\t\t\tif (image === undefined) {\n\t\t\t\t\tconsole.warn('THREE.WebGLRenderer: Texture marked for update but image is undefined');\n\t\t\t\t} else if (image.complete === false) {\n\t\t\t\t\tconsole.warn('THREE.WebGLRenderer: Texture marked for update but image is incomplete');\n\t\t\t\t} else {\n\t\t\t\t\tuploadTexture(textureProperties, texture, slot);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tstate.activeTexture(_gl.TEXTURE0 + slot);\n\t\t\tstate.bindTexture(_gl.TEXTURE_2D, textureProperties.__webglTexture);\n\t\t}\n\n\t\tfunction setTexture2DArray(texture, slot) {\n\t\t\tconst textureProperties = properties.get(texture);\n\n\t\t\tif (texture.version > 0 && textureProperties.__version !== texture.version) {\n\t\t\t\tuploadTexture(textureProperties, texture, slot);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tstate.activeTexture(_gl.TEXTURE0 + slot);\n\t\t\tstate.bindTexture(_gl.TEXTURE_2D_ARRAY, textureProperties.__webglTexture);\n\t\t}\n\n\t\tfunction setTexture3D(texture, slot) {\n\t\t\tconst textureProperties = properties.get(texture);\n\n\t\t\tif (texture.version > 0 && textureProperties.__version !== texture.version) {\n\t\t\t\tuploadTexture(textureProperties, texture, slot);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tstate.activeTexture(_gl.TEXTURE0 + slot);\n\t\t\tstate.bindTexture(_gl.TEXTURE_3D, textureProperties.__webglTexture);\n\t\t}\n\n\t\tfunction setTextureCube(texture, slot) {\n\t\t\tconst textureProperties = properties.get(texture);\n\n\t\t\tif (texture.version > 0 && textureProperties.__version !== texture.version) {\n\t\t\t\tuploadCubeTexture(textureProperties, texture, slot);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tstate.activeTexture(_gl.TEXTURE0 + slot);\n\t\t\tstate.bindTexture(_gl.TEXTURE_CUBE_MAP, textureProperties.__webglTexture);\n\t\t}\n\n\t\tconst wrappingToGL = {\n\t\t\t[RepeatWrapping]: _gl.REPEAT,\n\t\t\t[ClampToEdgeWrapping]: _gl.CLAMP_TO_EDGE,\n\t\t\t[MirroredRepeatWrapping]: _gl.MIRRORED_REPEAT\n\t\t};\n\t\tconst filterToGL = {\n\t\t\t[NearestFilter]: _gl.NEAREST,\n\t\t\t[NearestMipmapNearestFilter]: _gl.NEAREST_MIPMAP_NEAREST,\n\t\t\t[NearestMipmapLinearFilter]: _gl.NEAREST_MIPMAP_LINEAR,\n\t\t\t[LinearFilter]: _gl.LINEAR,\n\t\t\t[LinearMipmapNearestFilter]: _gl.LINEAR_MIPMAP_NEAREST,\n\t\t\t[LinearMipmapLinearFilter]: _gl.LINEAR_MIPMAP_LINEAR\n\t\t};\n\n\t\tfunction setTextureParameters(textureType, texture, supportsMips) {\n\t\t\tif (supportsMips) {\n\t\t\t\t_gl.texParameteri(textureType, _gl.TEXTURE_WRAP_S, wrappingToGL[texture.wrapS]);\n\n\t\t\t\t_gl.texParameteri(textureType, _gl.TEXTURE_WRAP_T, wrappingToGL[texture.wrapT]);\n\n\t\t\t\tif (textureType === _gl.TEXTURE_3D || textureType === _gl.TEXTURE_2D_ARRAY) {\n\t\t\t\t\t_gl.texParameteri(textureType, _gl.TEXTURE_WRAP_R, wrappingToGL[texture.wrapR]);\n\t\t\t\t}\n\n\t\t\t\t_gl.texParameteri(textureType, _gl.TEXTURE_MAG_FILTER, filterToGL[texture.magFilter]);\n\n\t\t\t\t_gl.texParameteri(textureType, _gl.TEXTURE_MIN_FILTER, filterToGL[texture.minFilter]);\n\t\t\t} else {\n\t\t\t\t_gl.texParameteri(textureType, _gl.TEXTURE_WRAP_S, _gl.CLAMP_TO_EDGE);\n\n\t\t\t\t_gl.texParameteri(textureType, _gl.TEXTURE_WRAP_T, _gl.CLAMP_TO_EDGE);\n\n\t\t\t\tif (textureType === _gl.TEXTURE_3D || textureType === _gl.TEXTURE_2D_ARRAY) {\n\t\t\t\t\t_gl.texParameteri(textureType, _gl.TEXTURE_WRAP_R, _gl.CLAMP_TO_EDGE);\n\t\t\t\t}\n\n\t\t\t\tif (texture.wrapS !== ClampToEdgeWrapping || texture.wrapT !== ClampToEdgeWrapping) {\n\t\t\t\t\tconsole.warn('THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.');\n\t\t\t\t}\n\n\t\t\t\t_gl.texParameteri(textureType, _gl.TEXTURE_MAG_FILTER, filterFallback(texture.magFilter));\n\n\t\t\t\t_gl.texParameteri(textureType, _gl.TEXTURE_MIN_FILTER, filterFallback(texture.minFilter));\n\n\t\t\t\tif (texture.minFilter !== NearestFilter && texture.minFilter !== LinearFilter) {\n\t\t\t\t\tconsole.warn('THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (extensions.has('EXT_texture_filter_anisotropic') === true) {\n\t\t\t\tconst extension = extensions.get('EXT_texture_filter_anisotropic');\n\t\t\t\tif (texture.type === FloatType && extensions.has('OES_texture_float_linear') === false) return; // verify extension for WebGL 1 and WebGL 2\n\n\t\t\t\tif (isWebGL2 === false && texture.type === HalfFloatType && extensions.has('OES_texture_half_float_linear') === false) return; // verify extension for WebGL 1 only\n\n\t\t\t\tif (texture.anisotropy > 1 || properties.get(texture).__currentAnisotropy) {\n\t\t\t\t\t_gl.texParameterf(textureType, extension.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(texture.anisotropy, capabilities.getMaxAnisotropy()));\n\n\t\t\t\t\tproperties.get(texture).__currentAnisotropy = texture.anisotropy;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction initTexture(textureProperties, texture) {\n\t\t\tif (textureProperties.__webglInit === undefined) {\n\t\t\t\ttextureProperties.__webglInit = true;\n\t\t\t\ttexture.addEventListener('dispose', onTextureDispose);\n\t\t\t\ttextureProperties.__webglTexture = _gl.createTexture();\n\t\t\t\tinfo.memory.textures++;\n\t\t\t}\n\t\t}\n\n\t\tfunction uploadTexture(textureProperties, texture, slot) {\n\t\t\tlet textureType = _gl.TEXTURE_2D;\n\t\t\tif (texture.isDataTexture2DArray) textureType = _gl.TEXTURE_2D_ARRAY;\n\t\t\tif (texture.isDataTexture3D) textureType = _gl.TEXTURE_3D;\n\t\t\tinitTexture(textureProperties, texture);\n\t\t\tstate.activeTexture(_gl.TEXTURE0 + slot);\n\t\t\tstate.bindTexture(textureType, textureProperties.__webglTexture);\n\n\t\t\t_gl.pixelStorei(_gl.UNPACK_FLIP_Y_WEBGL, texture.flipY);\n\n\t\t\t_gl.pixelStorei(_gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, texture.premultiplyAlpha);\n\n\t\t\t_gl.pixelStorei(_gl.UNPACK_ALIGNMENT, texture.unpackAlignment);\n\n\t\t\t_gl.pixelStorei(_gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, _gl.NONE);\n\n\t\t\tconst needsPowerOfTwo = textureNeedsPowerOfTwo(texture) && isPowerOfTwo$1(texture.image) === false;\n\t\t\tconst image = resizeImage(texture.image, needsPowerOfTwo, false, maxTextureSize);\n\t\t\tconst supportsMips = isPowerOfTwo$1(image) || isWebGL2,\n\t\t\t\t\t\tglFormat = utils.convert(texture.format);\n\t\t\tlet glType = utils.convert(texture.type),\n\t\t\t\t\tglInternalFormat = getInternalFormat(texture.internalFormat, glFormat, glType, texture.encoding);\n\t\t\tsetTextureParameters(textureType, texture, supportsMips);\n\t\t\tlet mipmap;\n\t\t\tconst mipmaps = texture.mipmaps;\n\n\t\t\tif (texture.isDepthTexture) {\n\t\t\t\t// populate depth texture with dummy data\n\t\t\t\tglInternalFormat = _gl.DEPTH_COMPONENT;\n\n\t\t\t\tif (isWebGL2) {\n\t\t\t\t\tif (texture.type === FloatType) {\n\t\t\t\t\t\tglInternalFormat = _gl.DEPTH_COMPONENT32F;\n\t\t\t\t\t} else if (texture.type === UnsignedIntType) {\n\t\t\t\t\t\tglInternalFormat = _gl.DEPTH_COMPONENT24;\n\t\t\t\t\t} else if (texture.type === UnsignedInt248Type) {\n\t\t\t\t\t\tglInternalFormat = _gl.DEPTH24_STENCIL8;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tglInternalFormat = _gl.DEPTH_COMPONENT16; // WebGL2 requires sized internalformat for glTexImage2D\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (texture.type === FloatType) {\n\t\t\t\t\t\tconsole.error('WebGLRenderer: Floating point depth texture requires WebGL2.');\n\t\t\t\t\t}\n\t\t\t\t} // validation checks for WebGL 1\n\n\n\t\t\t\tif (texture.format === DepthFormat && glInternalFormat === _gl.DEPTH_COMPONENT) {\n\t\t\t\t\t// The error INVALID_OPERATION is generated by texImage2D if format and internalformat are\n\t\t\t\t\t// DEPTH_COMPONENT and type is not UNSIGNED_SHORT or UNSIGNED_INT\n\t\t\t\t\t// (https://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/)\n\t\t\t\t\tif (texture.type !== UnsignedShortType && texture.type !== UnsignedIntType) {\n\t\t\t\t\t\tconsole.warn('THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture.');\n\t\t\t\t\t\ttexture.type = UnsignedShortType;\n\t\t\t\t\t\tglType = utils.convert(texture.type);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (texture.format === DepthStencilFormat && glInternalFormat === _gl.DEPTH_COMPONENT) {\n\t\t\t\t\t// Depth stencil textures need the DEPTH_STENCIL internal format\n\t\t\t\t\t// (https://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/)\n\t\t\t\t\tglInternalFormat = _gl.DEPTH_STENCIL; // The error INVALID_OPERATION is generated by texImage2D if format and internalformat are\n\t\t\t\t\t// DEPTH_STENCIL and type is not UNSIGNED_INT_24_8_WEBGL.\n\t\t\t\t\t// (https://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/)\n\n\t\t\t\t\tif (texture.type !== UnsignedInt248Type) {\n\t\t\t\t\t\tconsole.warn('THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture.');\n\t\t\t\t\t\ttexture.type = UnsignedInt248Type;\n\t\t\t\t\t\tglType = utils.convert(texture.type);\n\t\t\t\t\t}\n\t\t\t\t} //\n\n\n\t\t\t\tstate.texImage2D(_gl.TEXTURE_2D, 0, glInternalFormat, image.width, image.height, 0, glFormat, glType, null);\n\t\t\t} else if (texture.isDataTexture) {\n\t\t\t\t// use manually created mipmaps if available\n\t\t\t\t// if there are no manual mipmaps\n\t\t\t\t// set 0 level mipmap and then use GL to generate other mipmap levels\n\t\t\t\tif (mipmaps.length > 0 && supportsMips) {\n\t\t\t\t\tfor (let i = 0, il = mipmaps.length; i < il; i++) {\n\t\t\t\t\t\tmipmap = mipmaps[i];\n\t\t\t\t\t\tstate.texImage2D(_gl.TEXTURE_2D, i, glInternalFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data);\n\t\t\t\t\t}\n\n\t\t\t\t\ttexture.generateMipmaps = false;\n\t\t\t\t\ttextureProperties.__maxMipLevel = mipmaps.length - 1;\n\t\t\t\t} else {\n\t\t\t\t\tstate.texImage2D(_gl.TEXTURE_2D, 0, glInternalFormat, image.width, image.height, 0, glFormat, glType, image.data);\n\t\t\t\t\ttextureProperties.__maxMipLevel = 0;\n\t\t\t\t}\n\t\t\t} else if (texture.isCompressedTexture) {\n\t\t\t\tfor (let i = 0, il = mipmaps.length; i < il; i++) {\n\t\t\t\t\tmipmap = mipmaps[i];\n\n\t\t\t\t\tif (texture.format !== RGBAFormat && texture.format !== RGBFormat) {\n\t\t\t\t\t\tif (glFormat !== null) {\n\t\t\t\t\t\t\tstate.compressedTexImage2D(_gl.TEXTURE_2D, i, glInternalFormat, mipmap.width, mipmap.height, 0, mipmap.data);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconsole.warn('THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()');\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tstate.texImage2D(_gl.TEXTURE_2D, i, glInternalFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\ttextureProperties.__maxMipLevel = mipmaps.length - 1;\n\t\t\t} else if (texture.isDataTexture2DArray) {\n\t\t\t\tstate.texImage3D(_gl.TEXTURE_2D_ARRAY, 0, glInternalFormat, image.width, image.height, image.depth, 0, glFormat, glType, image.data);\n\t\t\t\ttextureProperties.__maxMipLevel = 0;\n\t\t\t} else if (texture.isDataTexture3D) {\n\t\t\t\tstate.texImage3D(_gl.TEXTURE_3D, 0, glInternalFormat, image.width, image.height, image.depth, 0, glFormat, glType, image.data);\n\t\t\t\ttextureProperties.__maxMipLevel = 0;\n\t\t\t} else {\n\t\t\t\t// regular Texture (image, video, canvas)\n\t\t\t\t// use manually created mipmaps if available\n\t\t\t\t// if there are no manual mipmaps\n\t\t\t\t// set 0 level mipmap and then use GL to generate other mipmap levels\n\t\t\t\tif (mipmaps.length > 0 && supportsMips) {\n\t\t\t\t\tfor (let i = 0, il = mipmaps.length; i < il; i++) {\n\t\t\t\t\t\tmipmap = mipmaps[i];\n\t\t\t\t\t\tstate.texImage2D(_gl.TEXTURE_2D, i, glInternalFormat, glFormat, glType, mipmap);\n\t\t\t\t\t}\n\n\t\t\t\t\ttexture.generateMipmaps = false;\n\t\t\t\t\ttextureProperties.__maxMipLevel = mipmaps.length - 1;\n\t\t\t\t} else {\n\t\t\t\t\tstate.texImage2D(_gl.TEXTURE_2D, 0, glInternalFormat, glFormat, glType, image);\n\t\t\t\t\ttextureProperties.__maxMipLevel = 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (textureNeedsGenerateMipmaps(texture, supportsMips)) {\n\t\t\t\tgenerateMipmap(textureType, texture, image.width, image.height);\n\t\t\t}\n\n\t\t\ttextureProperties.__version = texture.version;\n\t\t\tif (texture.onUpdate) texture.onUpdate(texture);\n\t\t}\n\n\t\tfunction uploadCubeTexture(textureProperties, texture, slot) {\n\t\t\tif (texture.image.length !== 6) return;\n\t\t\tinitTexture(textureProperties, texture);\n\t\t\tstate.activeTexture(_gl.TEXTURE0 + slot);\n\t\t\tstate.bindTexture(_gl.TEXTURE_CUBE_MAP, textureProperties.__webglTexture);\n\n\t\t\t_gl.pixelStorei(_gl.UNPACK_FLIP_Y_WEBGL, texture.flipY);\n\n\t\t\t_gl.pixelStorei(_gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, texture.premultiplyAlpha);\n\n\t\t\t_gl.pixelStorei(_gl.UNPACK_ALIGNMENT, texture.unpackAlignment);\n\n\t\t\t_gl.pixelStorei(_gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, _gl.NONE);\n\n\t\t\tconst isCompressed = texture && (texture.isCompressedTexture || texture.image[0].isCompressedTexture);\n\t\t\tconst isDataTexture = texture.image[0] && texture.image[0].isDataTexture;\n\t\t\tconst cubeImage = [];\n\n\t\t\tfor (let i = 0; i < 6; i++) {\n\t\t\t\tif (!isCompressed && !isDataTexture) {\n\t\t\t\t\tcubeImage[i] = resizeImage(texture.image[i], false, true, maxCubemapSize);\n\t\t\t\t} else {\n\t\t\t\t\tcubeImage[i] = isDataTexture ? texture.image[i].image : texture.image[i];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst image = cubeImage[0],\n\t\t\t\t\t\tsupportsMips = isPowerOfTwo$1(image) || isWebGL2,\n\t\t\t\t\t\tglFormat = utils.convert(texture.format),\n\t\t\t\t\t\tglType = utils.convert(texture.type),\n\t\t\t\t\t\tglInternalFormat = getInternalFormat(texture.internalFormat, glFormat, glType, texture.encoding);\n\t\t\tsetTextureParameters(_gl.TEXTURE_CUBE_MAP, texture, supportsMips);\n\t\t\tlet mipmaps;\n\n\t\t\tif (isCompressed) {\n\t\t\t\tfor (let i = 0; i < 6; i++) {\n\t\t\t\t\tmipmaps = cubeImage[i].mipmaps;\n\n\t\t\t\t\tfor (let j = 0; j < mipmaps.length; j++) {\n\t\t\t\t\t\tconst mipmap = mipmaps[j];\n\n\t\t\t\t\t\tif (texture.format !== RGBAFormat && texture.format !== RGBFormat) {\n\t\t\t\t\t\t\tif (glFormat !== null) {\n\t\t\t\t\t\t\t\tstate.compressedTexImage2D(_gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j, glInternalFormat, mipmap.width, mipmap.height, 0, mipmap.data);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tconsole.warn('THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tstate.texImage2D(_gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j, glInternalFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\ttextureProperties.__maxMipLevel = mipmaps.length - 1;\n\t\t\t} else {\n\t\t\t\tmipmaps = texture.mipmaps;\n\n\t\t\t\tfor (let i = 0; i < 6; i++) {\n\t\t\t\t\tif (isDataTexture) {\n\t\t\t\t\t\tstate.texImage2D(_gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, glInternalFormat, cubeImage[i].width, cubeImage[i].height, 0, glFormat, glType, cubeImage[i].data);\n\n\t\t\t\t\t\tfor (let j = 0; j < mipmaps.length; j++) {\n\t\t\t\t\t\t\tconst mipmap = mipmaps[j];\n\t\t\t\t\t\t\tconst mipmapImage = mipmap.image[i].image;\n\t\t\t\t\t\t\tstate.texImage2D(_gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j + 1, glInternalFormat, mipmapImage.width, mipmapImage.height, 0, glFormat, glType, mipmapImage.data);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tstate.texImage2D(_gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, glInternalFormat, glFormat, glType, cubeImage[i]);\n\n\t\t\t\t\t\tfor (let j = 0; j < mipmaps.length; j++) {\n\t\t\t\t\t\t\tconst mipmap = mipmaps[j];\n\t\t\t\t\t\t\tstate.texImage2D(_gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j + 1, glInternalFormat, glFormat, glType, mipmap.image[i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\ttextureProperties.__maxMipLevel = mipmaps.length;\n\t\t\t}\n\n\t\t\tif (textureNeedsGenerateMipmaps(texture, supportsMips)) {\n\t\t\t\t// We assume images for cube map have the same size.\n\t\t\t\tgenerateMipmap(_gl.TEXTURE_CUBE_MAP, texture, image.width, image.height);\n\t\t\t}\n\n\t\t\ttextureProperties.__version = texture.version;\n\t\t\tif (texture.onUpdate) texture.onUpdate(texture);\n\t\t} // Render targets\n\t\t// Setup storage for target texture and bind it to correct framebuffer\n\n\n\t\tfunction setupFrameBufferTexture(framebuffer, renderTarget, texture, attachment, textureTarget) {\n\t\t\tconst glFormat = utils.convert(texture.format);\n\t\t\tconst glType = utils.convert(texture.type);\n\t\t\tconst glInternalFormat = getInternalFormat(texture.internalFormat, glFormat, glType, texture.encoding);\n\n\t\t\tif (textureTarget === _gl.TEXTURE_3D || textureTarget === _gl.TEXTURE_2D_ARRAY) {\n\t\t\t\tstate.texImage3D(textureTarget, 0, glInternalFormat, renderTarget.width, renderTarget.height, renderTarget.depth, 0, glFormat, glType, null);\n\t\t\t} else {\n\t\t\t\tstate.texImage2D(textureTarget, 0, glInternalFormat, renderTarget.width, renderTarget.height, 0, glFormat, glType, null);\n\t\t\t}\n\n\t\t\tstate.bindFramebuffer(_gl.FRAMEBUFFER, framebuffer);\n\n\t\t\t_gl.framebufferTexture2D(_gl.FRAMEBUFFER, attachment, textureTarget, properties.get(texture).__webglTexture, 0);\n\n\t\t\tstate.bindFramebuffer(_gl.FRAMEBUFFER, null);\n\t\t} // Setup storage for internal depth/stencil buffers and bind to correct framebuffer\n\n\n\t\tfunction setupRenderBufferStorage(renderbuffer, renderTarget, isMultisample) {\n\t\t\t_gl.bindRenderbuffer(_gl.RENDERBUFFER, renderbuffer);\n\n\t\t\tif (renderTarget.depthBuffer && !renderTarget.stencilBuffer) {\n\t\t\t\tlet glInternalFormat = _gl.DEPTH_COMPONENT16;\n\n\t\t\t\tif (isMultisample) {\n\t\t\t\t\tconst depthTexture = renderTarget.depthTexture;\n\n\t\t\t\t\tif (depthTexture && depthTexture.isDepthTexture) {\n\t\t\t\t\t\tif (depthTexture.type === FloatType) {\n\t\t\t\t\t\t\tglInternalFormat = _gl.DEPTH_COMPONENT32F;\n\t\t\t\t\t\t} else if (depthTexture.type === UnsignedIntType) {\n\t\t\t\t\t\t\tglInternalFormat = _gl.DEPTH_COMPONENT24;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tconst samples = getRenderTargetSamples(renderTarget);\n\n\t\t\t\t\t_gl.renderbufferStorageMultisample(_gl.RENDERBUFFER, samples, glInternalFormat, renderTarget.width, renderTarget.height);\n\t\t\t\t} else {\n\t\t\t\t\t_gl.renderbufferStorage(_gl.RENDERBUFFER, glInternalFormat, renderTarget.width, renderTarget.height);\n\t\t\t\t}\n\n\t\t\t\t_gl.framebufferRenderbuffer(_gl.FRAMEBUFFER, _gl.DEPTH_ATTACHMENT, _gl.RENDERBUFFER, renderbuffer);\n\t\t\t} else if (renderTarget.depthBuffer && renderTarget.stencilBuffer) {\n\t\t\t\tif (isMultisample) {\n\t\t\t\t\tconst samples = getRenderTargetSamples(renderTarget);\n\n\t\t\t\t\t_gl.renderbufferStorageMultisample(_gl.RENDERBUFFER, samples, _gl.DEPTH24_STENCIL8, renderTarget.width, renderTarget.height);\n\t\t\t\t} else {\n\t\t\t\t\t_gl.renderbufferStorage(_gl.RENDERBUFFER, _gl.DEPTH_STENCIL, renderTarget.width, renderTarget.height);\n\t\t\t\t}\n\n\t\t\t\t_gl.framebufferRenderbuffer(_gl.FRAMEBUFFER, _gl.DEPTH_STENCIL_ATTACHMENT, _gl.RENDERBUFFER, renderbuffer);\n\t\t\t} else {\n\t\t\t\t// Use the first texture for MRT so far\n\t\t\t\tconst texture = renderTarget.isWebGLMultipleRenderTargets === true ? renderTarget.texture[0] : renderTarget.texture;\n\t\t\t\tconst glFormat = utils.convert(texture.format);\n\t\t\t\tconst glType = utils.convert(texture.type);\n\t\t\t\tconst glInternalFormat = getInternalFormat(texture.internalFormat, glFormat, glType, texture.encoding);\n\n\t\t\t\tif (isMultisample) {\n\t\t\t\t\tconst samples = getRenderTargetSamples(renderTarget);\n\n\t\t\t\t\t_gl.renderbufferStorageMultisample(_gl.RENDERBUFFER, samples, glInternalFormat, renderTarget.width, renderTarget.height);\n\t\t\t\t} else {\n\t\t\t\t\t_gl.renderbufferStorage(_gl.RENDERBUFFER, glInternalFormat, renderTarget.width, renderTarget.height);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t_gl.bindRenderbuffer(_gl.RENDERBUFFER, null);\n\t\t} // Setup resources for a Depth Texture for a FBO (needs an extension)\n\n\n\t\tfunction setupDepthTexture(framebuffer, renderTarget) {\n\t\t\tconst isCube = renderTarget && renderTarget.isWebGLCubeRenderTarget;\n\t\t\tif (isCube) throw new Error('Depth Texture with cube render targets is not supported');\n\t\t\tstate.bindFramebuffer(_gl.FRAMEBUFFER, framebuffer);\n\n\t\t\tif (!(renderTarget.depthTexture && renderTarget.depthTexture.isDepthTexture)) {\n\t\t\t\tthrow new Error('renderTarget.depthTexture must be an instance of THREE.DepthTexture');\n\t\t\t} // upload an empty depth texture with framebuffer size\n\n\n\t\t\tif (!properties.get(renderTarget.depthTexture).__webglTexture || renderTarget.depthTexture.image.width !== renderTarget.width || renderTarget.depthTexture.image.height !== renderTarget.height) {\n\t\t\t\trenderTarget.depthTexture.image.width = renderTarget.width;\n\t\t\t\trenderTarget.depthTexture.image.height = renderTarget.height;\n\t\t\t\trenderTarget.depthTexture.needsUpdate = true;\n\t\t\t}\n\n\t\t\tsetTexture2D(renderTarget.depthTexture, 0);\n\n\t\t\tconst webglDepthTexture = properties.get(renderTarget.depthTexture).__webglTexture;\n\n\t\t\tif (renderTarget.depthTexture.format === DepthFormat) {\n\t\t\t\t_gl.framebufferTexture2D(_gl.FRAMEBUFFER, _gl.DEPTH_ATTACHMENT, _gl.TEXTURE_2D, webglDepthTexture, 0);\n\t\t\t} else if (renderTarget.depthTexture.format === DepthStencilFormat) {\n\t\t\t\t_gl.framebufferTexture2D(_gl.FRAMEBUFFER, _gl.DEPTH_STENCIL_ATTACHMENT, _gl.TEXTURE_2D, webglDepthTexture, 0);\n\t\t\t} else {\n\t\t\t\tthrow new Error('Unknown depthTexture format');\n\t\t\t}\n\t\t} // Setup GL resources for a non-texture depth buffer\n\n\n\t\tfunction setupDepthRenderbuffer(renderTarget) {\n\t\t\tconst renderTargetProperties = properties.get(renderTarget);\n\t\t\tconst isCube = renderTarget.isWebGLCubeRenderTarget === true;\n\n\t\t\tif (renderTarget.depthTexture) {\n\t\t\t\tif (isCube) throw new Error('target.depthTexture not supported in Cube render targets');\n\t\t\t\tsetupDepthTexture(renderTargetProperties.__webglFramebuffer, renderTarget);\n\t\t\t} else {\n\t\t\t\tif (isCube) {\n\t\t\t\t\trenderTargetProperties.__webglDepthbuffer = [];\n\n\t\t\t\t\tfor (let i = 0; i < 6; i++) {\n\t\t\t\t\t\tstate.bindFramebuffer(_gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer[i]);\n\t\t\t\t\t\trenderTargetProperties.__webglDepthbuffer[i] = _gl.createRenderbuffer();\n\t\t\t\t\t\tsetupRenderBufferStorage(renderTargetProperties.__webglDepthbuffer[i], renderTarget, false);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tstate.bindFramebuffer(_gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer);\n\t\t\t\t\trenderTargetProperties.__webglDepthbuffer = _gl.createRenderbuffer();\n\t\t\t\t\tsetupRenderBufferStorage(renderTargetProperties.__webglDepthbuffer, renderTarget, false);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tstate.bindFramebuffer(_gl.FRAMEBUFFER, null);\n\t\t} // Set up GL resources for the render target\n\n\n\t\tfunction setupRenderTarget(renderTarget) {\n\t\t\tconst texture = renderTarget.texture;\n\t\t\tconst renderTargetProperties = properties.get(renderTarget);\n\t\t\tconst textureProperties = properties.get(texture);\n\t\t\trenderTarget.addEventListener('dispose', onRenderTargetDispose);\n\n\t\t\tif (renderTarget.isWebGLMultipleRenderTargets !== true) {\n\t\t\t\ttextureProperties.__webglTexture = _gl.createTexture();\n\t\t\t\ttextureProperties.__version = texture.version;\n\t\t\t\tinfo.memory.textures++;\n\t\t\t}\n\n\t\t\tconst isCube = renderTarget.isWebGLCubeRenderTarget === true;\n\t\t\tconst isMultipleRenderTargets = renderTarget.isWebGLMultipleRenderTargets === true;\n\t\t\tconst isMultisample = renderTarget.isWebGLMultisampleRenderTarget === true;\n\t\t\tconst isRenderTarget3D = texture.isDataTexture3D || texture.isDataTexture2DArray;\n\t\t\tconst supportsMips = isPowerOfTwo$1(renderTarget) || isWebGL2; // Handles WebGL2 RGBFormat fallback - #18858\n\n\t\t\tif (isWebGL2 && texture.format === RGBFormat && (texture.type === FloatType || texture.type === HalfFloatType)) {\n\t\t\t\ttexture.format = RGBAFormat;\n\t\t\t\tconsole.warn('THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.');\n\t\t\t} // Setup framebuffer\n\n\n\t\t\tif (isCube) {\n\t\t\t\trenderTargetProperties.__webglFramebuffer = [];\n\n\t\t\t\tfor (let i = 0; i < 6; i++) {\n\t\t\t\t\trenderTargetProperties.__webglFramebuffer[i] = _gl.createFramebuffer();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\trenderTargetProperties.__webglFramebuffer = _gl.createFramebuffer();\n\n\t\t\t\tif (isMultipleRenderTargets) {\n\t\t\t\t\tif (capabilities.drawBuffers) {\n\t\t\t\t\t\tconst textures = renderTarget.texture;\n\n\t\t\t\t\t\tfor (let i = 0, il = textures.length; i < il; i++) {\n\t\t\t\t\t\t\tconst attachmentProperties = properties.get(textures[i]);\n\n\t\t\t\t\t\t\tif (attachmentProperties.__webglTexture === undefined) {\n\t\t\t\t\t\t\t\tattachmentProperties.__webglTexture = _gl.createTexture();\n\t\t\t\t\t\t\t\tinfo.memory.textures++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconsole.warn('THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.');\n\t\t\t\t\t}\n\t\t\t\t} else if (isMultisample) {\n\t\t\t\t\tif (isWebGL2) {\n\t\t\t\t\t\trenderTargetProperties.__webglMultisampledFramebuffer = _gl.createFramebuffer();\n\t\t\t\t\t\trenderTargetProperties.__webglColorRenderbuffer = _gl.createRenderbuffer();\n\n\t\t\t\t\t\t_gl.bindRenderbuffer(_gl.RENDERBUFFER, renderTargetProperties.__webglColorRenderbuffer);\n\n\t\t\t\t\t\tconst glFormat = utils.convert(texture.format);\n\t\t\t\t\t\tconst glType = utils.convert(texture.type);\n\t\t\t\t\t\tconst glInternalFormat = getInternalFormat(texture.internalFormat, glFormat, glType, texture.encoding);\n\t\t\t\t\t\tconst samples = getRenderTargetSamples(renderTarget);\n\n\t\t\t\t\t\t_gl.renderbufferStorageMultisample(_gl.RENDERBUFFER, samples, glInternalFormat, renderTarget.width, renderTarget.height);\n\n\t\t\t\t\t\tstate.bindFramebuffer(_gl.FRAMEBUFFER, renderTargetProperties.__webglMultisampledFramebuffer);\n\n\t\t\t\t\t\t_gl.framebufferRenderbuffer(_gl.FRAMEBUFFER, _gl.COLOR_ATTACHMENT0, _gl.RENDERBUFFER, renderTargetProperties.__webglColorRenderbuffer);\n\n\t\t\t\t\t\t_gl.bindRenderbuffer(_gl.RENDERBUFFER, null);\n\n\t\t\t\t\t\tif (renderTarget.depthBuffer) {\n\t\t\t\t\t\t\trenderTargetProperties.__webglDepthRenderbuffer = _gl.createRenderbuffer();\n\t\t\t\t\t\t\tsetupRenderBufferStorage(renderTargetProperties.__webglDepthRenderbuffer, renderTarget, true);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tstate.bindFramebuffer(_gl.FRAMEBUFFER, null);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconsole.warn('THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} // Setup color buffer\n\n\n\t\t\tif (isCube) {\n\t\t\t\tstate.bindTexture(_gl.TEXTURE_CUBE_MAP, textureProperties.__webglTexture);\n\t\t\t\tsetTextureParameters(_gl.TEXTURE_CUBE_MAP, texture, supportsMips);\n\n\t\t\t\tfor (let i = 0; i < 6; i++) {\n\t\t\t\t\tsetupFrameBufferTexture(renderTargetProperties.__webglFramebuffer[i], renderTarget, texture, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i);\n\t\t\t\t}\n\n\t\t\t\tif (textureNeedsGenerateMipmaps(texture, supportsMips)) {\n\t\t\t\t\tgenerateMipmap(_gl.TEXTURE_CUBE_MAP, texture, renderTarget.width, renderTarget.height);\n\t\t\t\t}\n\n\t\t\t\tstate.unbindTexture();\n\t\t\t} else if (isMultipleRenderTargets) {\n\t\t\t\tconst textures = renderTarget.texture;\n\n\t\t\t\tfor (let i = 0, il = textures.length; i < il; i++) {\n\t\t\t\t\tconst attachment = textures[i];\n\t\t\t\t\tconst attachmentProperties = properties.get(attachment);\n\t\t\t\t\tstate.bindTexture(_gl.TEXTURE_2D, attachmentProperties.__webglTexture);\n\t\t\t\t\tsetTextureParameters(_gl.TEXTURE_2D, attachment, supportsMips);\n\t\t\t\t\tsetupFrameBufferTexture(renderTargetProperties.__webglFramebuffer, renderTarget, attachment, _gl.COLOR_ATTACHMENT0 + i, _gl.TEXTURE_2D);\n\n\t\t\t\t\tif (textureNeedsGenerateMipmaps(attachment, supportsMips)) {\n\t\t\t\t\t\tgenerateMipmap(_gl.TEXTURE_2D, attachment, renderTarget.width, renderTarget.height);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tstate.unbindTexture();\n\t\t\t} else {\n\t\t\t\tlet glTextureType = _gl.TEXTURE_2D;\n\n\t\t\t\tif (isRenderTarget3D) {\n\t\t\t\t\t// Render targets containing layers, i.e: Texture 3D and 2d arrays\n\t\t\t\t\tif (isWebGL2) {\n\t\t\t\t\t\tconst isTexture3D = texture.isDataTexture3D;\n\t\t\t\t\t\tglTextureType = isTexture3D ? _gl.TEXTURE_3D : _gl.TEXTURE_2D_ARRAY;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconsole.warn('THREE.DataTexture3D and THREE.DataTexture2DArray only supported with WebGL2.');\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tstate.bindTexture(glTextureType, textureProperties.__webglTexture);\n\t\t\t\tsetTextureParameters(glTextureType, texture, supportsMips);\n\t\t\t\tsetupFrameBufferTexture(renderTargetProperties.__webglFramebuffer, renderTarget, texture, _gl.COLOR_ATTACHMENT0, glTextureType);\n\n\t\t\t\tif (textureNeedsGenerateMipmaps(texture, supportsMips)) {\n\t\t\t\t\tgenerateMipmap(glTextureType, texture, renderTarget.width, renderTarget.height, renderTarget.depth);\n\t\t\t\t}\n\n\t\t\t\tstate.unbindTexture();\n\t\t\t} // Setup depth and stencil buffers\n\n\n\t\t\tif (renderTarget.depthBuffer) {\n\t\t\t\tsetupDepthRenderbuffer(renderTarget);\n\t\t\t}\n\t\t}\n\n\t\tfunction updateRenderTargetMipmap(renderTarget) {\n\t\t\tconst supportsMips = isPowerOfTwo$1(renderTarget) || isWebGL2;\n\t\t\tconst textures = renderTarget.isWebGLMultipleRenderTargets === true ? renderTarget.texture : [renderTarget.texture];\n\n\t\t\tfor (let i = 0, il = textures.length; i < il; i++) {\n\t\t\t\tconst texture = textures[i];\n\n\t\t\t\tif (textureNeedsGenerateMipmaps(texture, supportsMips)) {\n\t\t\t\t\tconst target = renderTarget.isWebGLCubeRenderTarget ? _gl.TEXTURE_CUBE_MAP : _gl.TEXTURE_2D;\n\n\t\t\t\t\tconst webglTexture = properties.get(texture).__webglTexture;\n\n\t\t\t\t\tstate.bindTexture(target, webglTexture);\n\t\t\t\t\tgenerateMipmap(target, texture, renderTarget.width, renderTarget.height);\n\t\t\t\t\tstate.unbindTexture();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction updateMultisampleRenderTarget(renderTarget) {\n\t\t\tif (renderTarget.isWebGLMultisampleRenderTarget) {\n\t\t\t\tif (isWebGL2) {\n\t\t\t\t\tconst width = renderTarget.width;\n\t\t\t\t\tconst height = renderTarget.height;\n\t\t\t\t\tlet mask = _gl.COLOR_BUFFER_BIT;\n\t\t\t\t\tif (renderTarget.depthBuffer) mask |= _gl.DEPTH_BUFFER_BIT;\n\t\t\t\t\tif (renderTarget.stencilBuffer) mask |= _gl.STENCIL_BUFFER_BIT;\n\t\t\t\t\tconst renderTargetProperties = properties.get(renderTarget);\n\t\t\t\t\tstate.bindFramebuffer(_gl.READ_FRAMEBUFFER, renderTargetProperties.__webglMultisampledFramebuffer);\n\t\t\t\t\tstate.bindFramebuffer(_gl.DRAW_FRAMEBUFFER, renderTargetProperties.__webglFramebuffer);\n\n\t\t\t\t\t_gl.blitFramebuffer(0, 0, width, height, 0, 0, width, height, mask, _gl.NEAREST);\n\n\t\t\t\t\tstate.bindFramebuffer(_gl.READ_FRAMEBUFFER, null);\n\t\t\t\t\tstate.bindFramebuffer(_gl.DRAW_FRAMEBUFFER, renderTargetProperties.__webglMultisampledFramebuffer);\n\t\t\t\t} else {\n\t\t\t\t\tconsole.warn('THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction getRenderTargetSamples(renderTarget) {\n\t\t\treturn isWebGL2 && renderTarget.isWebGLMultisampleRenderTarget ? Math.min(maxSamples, renderTarget.samples) : 0;\n\t\t}\n\n\t\tfunction updateVideoTexture(texture) {\n\t\t\tconst frame = info.render.frame; // Check the last frame we updated the VideoTexture\n\n\t\t\tif (_videoTextures.get(texture) !== frame) {\n\t\t\t\t_videoTextures.set(texture, frame);\n\n\t\t\t\ttexture.update();\n\t\t\t}\n\t\t} // backwards compatibility\n\n\n\t\tlet warnedTexture2D = false;\n\t\tlet warnedTextureCube = false;\n\n\t\tfunction safeSetTexture2D(texture, slot) {\n\t\t\tif (texture && texture.isWebGLRenderTarget) {\n\t\t\t\tif (warnedTexture2D === false) {\n\t\t\t\t\tconsole.warn('THREE.WebGLTextures.safeSetTexture2D: don\\'t use render targets as textures. Use their .texture property instead.');\n\t\t\t\t\twarnedTexture2D = true;\n\t\t\t\t}\n\n\t\t\t\ttexture = texture.texture;\n\t\t\t}\n\n\t\t\tsetTexture2D(texture, slot);\n\t\t}\n\n\t\tfunction safeSetTextureCube(texture, slot) {\n\t\t\tif (texture && texture.isWebGLCubeRenderTarget) {\n\t\t\t\tif (warnedTextureCube === false) {\n\t\t\t\t\tconsole.warn('THREE.WebGLTextures.safeSetTextureCube: don\\'t use cube render targets as textures. Use their .texture property instead.');\n\t\t\t\t\twarnedTextureCube = true;\n\t\t\t\t}\n\n\t\t\t\ttexture = texture.texture;\n\t\t\t}\n\n\t\t\tsetTextureCube(texture, slot);\n\t\t} //\n\n\n\t\tthis.allocateTextureUnit = allocateTextureUnit;\n\t\tthis.resetTextureUnits = resetTextureUnits;\n\t\tthis.setTexture2D = setTexture2D;\n\t\tthis.setTexture2DArray = setTexture2DArray;\n\t\tthis.setTexture3D = setTexture3D;\n\t\tthis.setTextureCube = setTextureCube;\n\t\tthis.setupRenderTarget = setupRenderTarget;\n\t\tthis.updateRenderTargetMipmap = updateRenderTargetMipmap;\n\t\tthis.updateMultisampleRenderTarget = updateMultisampleRenderTarget;\n\t\tthis.safeSetTexture2D = safeSetTexture2D;\n\t\tthis.safeSetTextureCube = safeSetTextureCube;\n\t}\n\n\tfunction WebGLUtils(gl, extensions, capabilities) {\n\t\tconst isWebGL2 = capabilities.isWebGL2;\n\n\t\tfunction convert(p) {\n\t\t\tlet extension;\n\t\t\tif (p === UnsignedByteType) return gl.UNSIGNED_BYTE;\n\t\t\tif (p === UnsignedShort4444Type) return gl.UNSIGNED_SHORT_4_4_4_4;\n\t\t\tif (p === UnsignedShort5551Type) return gl.UNSIGNED_SHORT_5_5_5_1;\n\t\t\tif (p === UnsignedShort565Type) return gl.UNSIGNED_SHORT_5_6_5;\n\t\t\tif (p === ByteType) return gl.BYTE;\n\t\t\tif (p === ShortType) return gl.SHORT;\n\t\t\tif (p === UnsignedShortType) return gl.UNSIGNED_SHORT;\n\t\t\tif (p === IntType) return gl.INT;\n\t\t\tif (p === UnsignedIntType) return gl.UNSIGNED_INT;\n\t\t\tif (p === FloatType) return gl.FLOAT;\n\n\t\t\tif (p === HalfFloatType) {\n\t\t\t\tif (isWebGL2) return gl.HALF_FLOAT;\n\t\t\t\textension = extensions.get('OES_texture_half_float');\n\n\t\t\t\tif (extension !== null) {\n\t\t\t\t\treturn extension.HALF_FLOAT_OES;\n\t\t\t\t} else {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (p === AlphaFormat) return gl.ALPHA;\n\t\t\tif (p === RGBFormat) return gl.RGB;\n\t\t\tif (p === RGBAFormat) return gl.RGBA;\n\t\t\tif (p === LuminanceFormat) return gl.LUMINANCE;\n\t\t\tif (p === LuminanceAlphaFormat) return gl.LUMINANCE_ALPHA;\n\t\t\tif (p === DepthFormat) return gl.DEPTH_COMPONENT;\n\t\t\tif (p === DepthStencilFormat) return gl.DEPTH_STENCIL;\n\t\t\tif (p === RedFormat) return gl.RED; // WebGL2 formats.\n\n\t\t\tif (p === RedIntegerFormat) return gl.RED_INTEGER;\n\t\t\tif (p === RGFormat) return gl.RG;\n\t\t\tif (p === RGIntegerFormat) return gl.RG_INTEGER;\n\t\t\tif (p === RGBIntegerFormat) return gl.RGB_INTEGER;\n\t\t\tif (p === RGBAIntegerFormat) return gl.RGBA_INTEGER;\n\n\t\t\tif (p === RGB_S3TC_DXT1_Format || p === RGBA_S3TC_DXT1_Format || p === RGBA_S3TC_DXT3_Format || p === RGBA_S3TC_DXT5_Format) {\n\t\t\t\textension = extensions.get('WEBGL_compressed_texture_s3tc');\n\n\t\t\t\tif (extension !== null) {\n\t\t\t\t\tif (p === RGB_S3TC_DXT1_Format) return extension.COMPRESSED_RGB_S3TC_DXT1_EXT;\n\t\t\t\t\tif (p === RGBA_S3TC_DXT1_Format) return extension.COMPRESSED_RGBA_S3TC_DXT1_EXT;\n\t\t\t\t\tif (p === RGBA_S3TC_DXT3_Format) return extension.COMPRESSED_RGBA_S3TC_DXT3_EXT;\n\t\t\t\t\tif (p === RGBA_S3TC_DXT5_Format) return extension.COMPRESSED_RGBA_S3TC_DXT5_EXT;\n\t\t\t\t} else {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (p === RGB_PVRTC_4BPPV1_Format || p === RGB_PVRTC_2BPPV1_Format || p === RGBA_PVRTC_4BPPV1_Format || p === RGBA_PVRTC_2BPPV1_Format) {\n\t\t\t\textension = extensions.get('WEBGL_compressed_texture_pvrtc');\n\n\t\t\t\tif (extension !== null) {\n\t\t\t\t\tif (p === RGB_PVRTC_4BPPV1_Format) return extension.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;\n\t\t\t\t\tif (p === RGB_PVRTC_2BPPV1_Format) return extension.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;\n\t\t\t\t\tif (p === RGBA_PVRTC_4BPPV1_Format) return extension.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;\n\t\t\t\t\tif (p === RGBA_PVRTC_2BPPV1_Format) return extension.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG;\n\t\t\t\t} else {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (p === RGB_ETC1_Format) {\n\t\t\t\textension = extensions.get('WEBGL_compressed_texture_etc1');\n\n\t\t\t\tif (extension !== null) {\n\t\t\t\t\treturn extension.COMPRESSED_RGB_ETC1_WEBGL;\n\t\t\t\t} else {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (p === RGB_ETC2_Format || p === RGBA_ETC2_EAC_Format) {\n\t\t\t\textension = extensions.get('WEBGL_compressed_texture_etc');\n\n\t\t\t\tif (extension !== null) {\n\t\t\t\t\tif (p === RGB_ETC2_Format) return extension.COMPRESSED_RGB8_ETC2;\n\t\t\t\t\tif (p === RGBA_ETC2_EAC_Format) return extension.COMPRESSED_RGBA8_ETC2_EAC;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (p === RGBA_ASTC_4x4_Format || p === RGBA_ASTC_5x4_Format || p === RGBA_ASTC_5x5_Format || p === RGBA_ASTC_6x5_Format || p === RGBA_ASTC_6x6_Format || p === RGBA_ASTC_8x5_Format || p === RGBA_ASTC_8x6_Format || p === RGBA_ASTC_8x8_Format || p === RGBA_ASTC_10x5_Format || p === RGBA_ASTC_10x6_Format || p === RGBA_ASTC_10x8_Format || p === RGBA_ASTC_10x10_Format || p === RGBA_ASTC_12x10_Format || p === RGBA_ASTC_12x12_Format || p === SRGB8_ALPHA8_ASTC_4x4_Format || p === SRGB8_ALPHA8_ASTC_5x4_Format || p === SRGB8_ALPHA8_ASTC_5x5_Format || p === SRGB8_ALPHA8_ASTC_6x5_Format || p === SRGB8_ALPHA8_ASTC_6x6_Format || p === SRGB8_ALPHA8_ASTC_8x5_Format || p === SRGB8_ALPHA8_ASTC_8x6_Format || p === SRGB8_ALPHA8_ASTC_8x8_Format || p === SRGB8_ALPHA8_ASTC_10x5_Format || p === SRGB8_ALPHA8_ASTC_10x6_Format || p === SRGB8_ALPHA8_ASTC_10x8_Format || p === SRGB8_ALPHA8_ASTC_10x10_Format || p === SRGB8_ALPHA8_ASTC_12x10_Format || p === SRGB8_ALPHA8_ASTC_12x12_Format) {\n\t\t\t\textension = extensions.get('WEBGL_compressed_texture_astc');\n\n\t\t\t\tif (extension !== null) {\n\t\t\t\t\t// TODO Complete?\n\t\t\t\t\treturn p;\n\t\t\t\t} else {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (p === RGBA_BPTC_Format) {\n\t\t\t\textension = extensions.get('EXT_texture_compression_bptc');\n\n\t\t\t\tif (extension !== null) {\n\t\t\t\t\t// TODO Complete?\n\t\t\t\t\treturn p;\n\t\t\t\t} else {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (p === UnsignedInt248Type) {\n\t\t\t\tif (isWebGL2) return gl.UNSIGNED_INT_24_8;\n\t\t\t\textension = extensions.get('WEBGL_depth_texture');\n\n\t\t\t\tif (extension !== null) {\n\t\t\t\t\treturn extension.UNSIGNED_INT_24_8_WEBGL;\n\t\t\t\t} else {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tconvert: convert\n\t\t};\n\t}\n\n\tclass Group extends Object3D {\n\t\tconstructor() {\n\t\t\tsuper();\n\t\t\tthis.type = 'Group';\n\t\t}\n\n\t}\n\n\tGroup.prototype.isGroup = true;\n\n\tclass ArrayCamera extends PerspectiveCamera {\n\t\tconstructor(array = []) {\n\t\t\tsuper();\n\t\t\tthis.cameras = array;\n\t\t}\n\n\t}\n\n\tArrayCamera.prototype.isArrayCamera = true;\n\n\t/**\n\t * @author jsantell / https://www.jsantell.com/\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\tvar cameraLPos = new Vector3();\n\tvar cameraRPos = new Vector3();\n\t/**\n\t * Assumes 2 cameras that are parallel and share an X-axis, and that\n\t * the cameras' projection and world matrices have already been set.\n\t * And that near and far planes are identical for both cameras.\n\t * Visualization of this technique: https://computergraphics.stackexchange.com/a/4765\n\t */\n\n\tfunction setProjectionFromUnion(camera, cameraL, cameraR) {\n\t\tcameraLPos.setFromMatrixPosition(cameraL.matrixWorld);\n\t\tcameraRPos.setFromMatrixPosition(cameraR.matrixWorld);\n\t\tvar ipd = cameraLPos.distanceTo(cameraRPos);\n\t\tvar projL = cameraL.projectionMatrix.elements;\n\t\tvar projR = cameraR.projectionMatrix.elements; // VR systems will have identical far and near planes, and\n\t\t// most likely identical top and bottom frustum extents.\n\t\t// Use the left camera for these values.\n\n\t\tvar near = projL[14] / (projL[10] - 1);\n\t\tvar far = projL[14] / (projL[10] + 1);\n\t\tvar topFov = (projL[9] + 1) / projL[5];\n\t\tvar bottomFov = (projL[9] - 1) / projL[5];\n\t\tvar leftFov = (projL[8] - 1) / projL[0];\n\t\tvar rightFov = (projR[8] + 1) / projR[0];\n\t\tvar left = near * leftFov;\n\t\tvar right = near * rightFov; // Calculate the new camera's position offset from the\n\t\t// left camera. xOffset should be roughly half `ipd`.\n\n\t\tvar zOffset = ipd / (-leftFov + rightFov);\n\t\tvar xOffset = zOffset * -leftFov; // TODO: Better way to apply this offset?\n\n\t\tcameraL.matrixWorld.decompose(camera.position, camera.quaternion, camera.scale);\n\t\tcamera.translateX(xOffset);\n\t\tcamera.translateZ(zOffset);\n\t\tcamera.matrixWorld.compose(camera.position, camera.quaternion, camera.scale);\n\t\tcamera.matrixWorldInverse.getInverse(camera.matrixWorld); // Find the union of the frustum values of the cameras and scale\n\t\t// the values so that the near plane's position does not change in world space,\n\t\t// although must now be relative to the new union camera.\n\n\t\tvar near2 = near + zOffset;\n\t\tvar far2 = far + zOffset;\n\t\tvar left2 = left - xOffset;\n\t\tvar right2 = right + (ipd - xOffset);\n\t\tvar top2 = topFov * far / far2 * near2;\n\t\tvar bottom2 = bottomFov * far / far2 * near2;\n\t\tcamera.projectionMatrix.makePerspective(left2, right2, top2, bottom2, near2, far2);\n\t}\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tfunction WebVRManager(renderer) {\n\t\tvar renderWidth, renderHeight;\n\t\tvar scope = this;\n\t\tvar device = null;\n\t\tvar frameData = null;\n\t\tvar poseTarget = null;\n\t\tvar controllers = [];\n\t\tvar standingMatrix = new Matrix4();\n\t\tvar standingMatrixInverse = new Matrix4();\n\t\tvar framebufferScaleFactor = 1.0;\n\t\tvar referenceSpaceType = 'local-floor';\n\n\t\tif (typeof window !== 'undefined' && 'VRFrameData' in window) {\n\t\t\tframeData = new window.VRFrameData();\n\t\t\twindow.addEventListener('vrdisplaypresentchange', onVRDisplayPresentChange, false);\n\t\t}\n\n\t\tvar matrixWorldInverse = new Matrix4();\n\t\tvar tempQuaternion = new Quaternion();\n\t\tvar tempPosition = new Vector3();\n\t\tvar cameraL = new PerspectiveCamera();\n\t\tcameraL.viewport = new Vector4();\n\t\tcameraL.layers.enable(1);\n\t\tvar cameraR = new PerspectiveCamera();\n\t\tcameraR.viewport = new Vector4();\n\t\tcameraR.layers.enable(2);\n\t\tvar cameraVR = new ArrayCamera([cameraL, cameraR]);\n\t\tcameraVR.layers.enable(1);\n\t\tcameraVR.layers.enable(2);\n\t\tvar currentSize = new Vector2(),\n\t\t\t\tcurrentPixelRatio;\n\n\t\tfunction onVRDisplayPresentChange() {\n\t\t\tvar isPresenting = scope.isPresenting = device !== null && device.isPresenting === true;\n\n\t\t\tif (isPresenting) {\n\t\t\t\tvar eyeParameters = device.getEyeParameters('left');\n\t\t\t\trenderWidth = 2 * eyeParameters.renderWidth * framebufferScaleFactor;\n\t\t\t\trenderHeight = eyeParameters.renderHeight * framebufferScaleFactor;\n\t\t\t\tcurrentPixelRatio = renderer.getPixelRatio();\n\t\t\t\trenderer.getSize(currentSize);\n\t\t\t\trenderer.setDrawingBufferSize(renderWidth, renderHeight, 1);\n\t\t\t\tcameraL.viewport.set(0, 0, renderWidth / 2, renderHeight);\n\t\t\t\tcameraR.viewport.set(renderWidth / 2, 0, renderWidth / 2, renderHeight);\n\t\t\t\tanimation.start();\n\t\t\t\tscope.dispatchEvent({\n\t\t\t\t\ttype: 'sessionstart'\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tif (scope.enabled) {\n\t\t\t\t\trenderer.setDrawingBufferSize(currentSize.width, currentSize.height, currentPixelRatio);\n\t\t\t\t}\n\n\t\t\t\tanimation.stop();\n\t\t\t\tscope.dispatchEvent({\n\t\t\t\t\ttype: 'sessionend'\n\t\t\t\t});\n\t\t\t}\n\t\t} //\n\n\n\t\tvar triggers = [];\n\t\tvar grips = [];\n\n\t\tfunction findGamepad(id) {\n\t\t\tvar gamepads = navigator.getGamepads && navigator.getGamepads();\n\n\t\t\tfor (var i = 0, l = gamepads.length; i < l; i++) {\n\t\t\t\tvar gamepad = gamepads[i];\n\n\t\t\t\tif (gamepad && (gamepad.id === 'Daydream Controller' || gamepad.id === 'Gear VR Controller' || gamepad.id === 'Oculus Go Controller' || gamepad.id === 'OpenVR Gamepad' || gamepad.id.startsWith('Oculus Touch') || gamepad.id.startsWith('HTC Vive Focus') || gamepad.id.startsWith('Spatial Controller'))) {\n\t\t\t\t\tvar hand = gamepad.hand;\n\t\t\t\t\tif (id === 0 && (hand === '' || hand === 'right')) return gamepad;\n\t\t\t\t\tif (id === 1 && hand === 'left') return gamepad;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction updateControllers() {\n\t\t\tfor (var i = 0; i < controllers.length; i++) {\n\t\t\t\tvar controller = controllers[i];\n\t\t\t\tvar gamepad = findGamepad(i);\n\n\t\t\t\tif (gamepad !== undefined && gamepad.pose !== undefined) {\n\t\t\t\t\tif (gamepad.pose === null) return; // Pose\n\n\t\t\t\t\tvar pose = gamepad.pose;\n\t\t\t\t\tif (pose.hasPosition === false) controller.position.set(0.2, -0.6, -0.05);\n\t\t\t\t\tif (pose.position !== null) controller.position.fromArray(pose.position);\n\t\t\t\t\tif (pose.orientation !== null) controller.quaternion.fromArray(pose.orientation);\n\t\t\t\t\tcontroller.matrix.compose(controller.position, controller.quaternion, controller.scale);\n\t\t\t\t\tcontroller.matrix.premultiply(standingMatrix);\n\t\t\t\t\tcontroller.matrix.decompose(controller.position, controller.quaternion, controller.scale);\n\t\t\t\t\tcontroller.matrixWorldNeedsUpdate = true;\n\t\t\t\t\tcontroller.visible = true; // Trigger\n\n\t\t\t\t\tvar buttonId = gamepad.id === 'Daydream Controller' ? 0 : 1;\n\t\t\t\t\tif (triggers[i] === undefined) triggers[i] = false;\n\n\t\t\t\t\tif (triggers[i] !== gamepad.buttons[buttonId].pressed) {\n\t\t\t\t\t\ttriggers[i] = gamepad.buttons[buttonId].pressed;\n\n\t\t\t\t\t\tif (triggers[i] === true) {\n\t\t\t\t\t\t\tcontroller.dispatchEvent({\n\t\t\t\t\t\t\t\ttype: 'selectstart'\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tcontroller.dispatchEvent({\n\t\t\t\t\t\t\t\ttype: 'selectend'\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tcontroller.dispatchEvent({\n\t\t\t\t\t\t\t\ttype: 'select'\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t} // Grip\n\n\n\t\t\t\t\tbuttonId = 2;\n\t\t\t\t\tif (grips[i] === undefined) grips[i] = false; // Skip if the grip button doesn't exist on this controller\n\n\t\t\t\t\tif (gamepad.buttons[buttonId] !== undefined) {\n\t\t\t\t\t\tif (grips[i] !== gamepad.buttons[buttonId].pressed) {\n\t\t\t\t\t\t\tgrips[i] = gamepad.buttons[buttonId].pressed;\n\n\t\t\t\t\t\t\tif (grips[i] === true) {\n\t\t\t\t\t\t\t\tcontroller.dispatchEvent({\n\t\t\t\t\t\t\t\t\ttype: 'squeezestart'\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tcontroller.dispatchEvent({\n\t\t\t\t\t\t\t\t\ttype: 'squeezeend'\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\tcontroller.dispatchEvent({\n\t\t\t\t\t\t\t\t\ttype: 'squeeze'\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tcontroller.visible = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction updateViewportFromBounds(viewport, bounds) {\n\t\t\tif (bounds !== null && bounds.length === 4) {\n\t\t\t\tviewport.set(bounds[0] * renderWidth, bounds[1] * renderHeight, bounds[2] * renderWidth, bounds[3] * renderHeight);\n\t\t\t}\n\t\t} //\n\n\n\t\tthis.enabled = false;\n\n\t\tthis.getController = function (id) {\n\t\t\tvar controller = controllers[id];\n\n\t\t\tif (controller === undefined) {\n\t\t\t\tcontroller = new Group();\n\t\t\t\tcontroller.matrixAutoUpdate = false;\n\t\t\t\tcontroller.visible = false;\n\t\t\t\tcontrollers[id] = controller;\n\t\t\t}\n\n\t\t\treturn controller;\n\t\t};\n\n\t\tthis.getDevice = function () {\n\t\t\treturn device;\n\t\t};\n\n\t\tthis.setDevice = function (value) {\n\t\t\tif (value !== undefined) device = value;\n\t\t\tanimation.setContext(value);\n\t\t};\n\n\t\tthis.setFramebufferScaleFactor = function (value) {\n\t\t\tframebufferScaleFactor = value;\n\t\t};\n\n\t\tthis.setReferenceSpaceType = function (value) {\n\t\t\treferenceSpaceType = value;\n\t\t};\n\n\t\tthis.setPoseTarget = function (object) {\n\t\t\tif (object !== undefined) poseTarget = object;\n\t\t};\n\n\t\tthis.getCamera = function (camera) {\n\t\t\tvar userHeight = referenceSpaceType === 'local-floor' ? 1.6 : 0;\n\t\t\tdevice.depthNear = camera.near;\n\t\t\tdevice.depthFar = camera.far;\n\t\t\tdevice.getFrameData(frameData); //\n\n\t\t\tif (referenceSpaceType === 'local-floor') {\n\t\t\t\tvar stageParameters = device.stageParameters;\n\n\t\t\t\tif (stageParameters) {\n\t\t\t\t\tstandingMatrix.fromArray(stageParameters.sittingToStandingTransform);\n\t\t\t\t} else {\n\t\t\t\t\tstandingMatrix.makeTranslation(0, userHeight, 0);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar pose = frameData.pose;\n\t\t\tvar poseObject = poseTarget !== null ? poseTarget : camera; // We want to manipulate poseObject by its position and quaternion components since users may rely on them.\n\n\t\t\tposeObject.matrix.copy(standingMatrix);\n\t\t\tposeObject.matrix.decompose(poseObject.position, poseObject.quaternion, poseObject.scale);\n\n\t\t\tif (pose.orientation !== null) {\n\t\t\t\ttempQuaternion.fromArray(pose.orientation);\n\t\t\t\tposeObject.quaternion.multiply(tempQuaternion);\n\t\t\t}\n\n\t\t\tif (pose.position !== null) {\n\t\t\t\ttempQuaternion.setFromRotationMatrix(standingMatrix);\n\t\t\t\ttempPosition.fromArray(pose.position);\n\t\t\t\ttempPosition.applyQuaternion(tempQuaternion);\n\t\t\t\tposeObject.position.add(tempPosition);\n\t\t\t}\n\n\t\t\tposeObject.updateMatrixWorld();\n\t\t\tvar children = poseObject.children;\n\n\t\t\tfor (var i = 0, l = children.length; i < l; i++) {\n\t\t\t\tchildren[i].updateMatrixWorld(true);\n\t\t\t} //\n\n\n\t\t\tcameraL.near = camera.near;\n\t\t\tcameraR.near = camera.near;\n\t\t\tcameraL.far = camera.far;\n\t\t\tcameraR.far = camera.far;\n\t\t\tcameraL.matrixWorldInverse.fromArray(frameData.leftViewMatrix);\n\t\t\tcameraR.matrixWorldInverse.fromArray(frameData.rightViewMatrix); // TODO (mrdoob) Double check this code\n\n\t\t\tstandingMatrixInverse.getInverse(standingMatrix);\n\n\t\t\tif (referenceSpaceType === 'local-floor') {\n\t\t\t\tcameraL.matrixWorldInverse.multiply(standingMatrixInverse);\n\t\t\t\tcameraR.matrixWorldInverse.multiply(standingMatrixInverse);\n\t\t\t}\n\n\t\t\tvar parent = poseObject.parent;\n\n\t\t\tif (parent !== null) {\n\t\t\t\tmatrixWorldInverse.getInverse(parent.matrixWorld);\n\t\t\t\tcameraL.matrixWorldInverse.multiply(matrixWorldInverse);\n\t\t\t\tcameraR.matrixWorldInverse.multiply(matrixWorldInverse);\n\t\t\t} // envMap and Mirror needs camera.matrixWorld\n\n\n\t\t\tcameraL.matrixWorld.getInverse(cameraL.matrixWorldInverse);\n\t\t\tcameraR.matrixWorld.getInverse(cameraR.matrixWorldInverse);\n\t\t\tcameraL.projectionMatrix.fromArray(frameData.leftProjectionMatrix);\n\t\t\tcameraR.projectionMatrix.fromArray(frameData.rightProjectionMatrix);\n\t\t\tsetProjectionFromUnion(cameraVR, cameraL, cameraR); //\n\n\t\t\tvar layers = device.getLayers();\n\n\t\t\tif (layers.length) {\n\t\t\t\tvar layer = layers[0];\n\t\t\t\tupdateViewportFromBounds(cameraL.viewport, layer.leftBounds);\n\t\t\t\tupdateViewportFromBounds(cameraR.viewport, layer.rightBounds);\n\t\t\t}\n\n\t\t\tupdateControllers();\n\t\t\treturn cameraVR;\n\t\t};\n\n\t\tthis.getStandingMatrix = function () {\n\t\t\treturn standingMatrix;\n\t\t};\n\n\t\tthis.isPresenting = false; // Animation Loop\n\n\t\tvar animation = new WebGLAnimation();\n\n\t\tthis.setAnimationLoop = function (callback) {\n\t\t\tanimation.setAnimationLoop(callback);\n\t\t\tif (this.isPresenting) animation.start();\n\t\t};\n\n\t\tthis.submitFrame = function () {\n\t\t\tif (this.isPresenting) device.submitFrame();\n\t\t};\n\n\t\tthis.dispose = function () {\n\t\t\tif (typeof window !== 'undefined') {\n\t\t\t\twindow.removeEventListener('vrdisplaypresentchange', onVRDisplayPresentChange);\n\t\t\t}\n\t\t}; // DEPRECATED\n\n\n\t\tthis.setFrameOfReferenceType = function () {\n\t\t\tconsole.warn('THREE.WebVRManager: setFrameOfReferenceType() has been deprecated.');\n\t\t};\n\n\t\tthis.addEventListener = function () {\n\t\t\t/* Stub */\n\t\t};\n\t}\n\n\tObject.assign(WebVRManager.prototype, EventDispatcher.prototype);\n\n\tconst _moveEvent = {\n\t\ttype: 'move'\n\t};\n\n\tclass WebXRController {\n\t\tconstructor() {\n\t\t\tthis._targetRay = null;\n\t\t\tthis._grip = null;\n\t\t\tthis._hand = null;\n\t\t}\n\n\t\tgetHandSpace() {\n\t\t\tif (this._hand === null) {\n\t\t\t\tthis._hand = new Group();\n\t\t\t\tthis._hand.matrixAutoUpdate = false;\n\t\t\t\tthis._hand.visible = false;\n\t\t\t\tthis._hand.joints = {};\n\t\t\t\tthis._hand.inputState = {\n\t\t\t\t\tpinching: false\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn this._hand;\n\t\t}\n\n\t\tgetTargetRaySpace() {\n\t\t\tif (this._targetRay === null) {\n\t\t\t\tthis._targetRay = new Group();\n\t\t\t\tthis._targetRay.matrixAutoUpdate = false;\n\t\t\t\tthis._targetRay.visible = false;\n\t\t\t\tthis._targetRay.hasLinearVelocity = false;\n\t\t\t\tthis._targetRay.linearVelocity = new Vector3();\n\t\t\t\tthis._targetRay.hasAngularVelocity = false;\n\t\t\t\tthis._targetRay.angularVelocity = new Vector3();\n\t\t\t}\n\n\t\t\treturn this._targetRay;\n\t\t}\n\n\t\tgetGripSpace() {\n\t\t\tif (this._grip === null) {\n\t\t\t\tthis._grip = new Group();\n\t\t\t\tthis._grip.matrixAutoUpdate = false;\n\t\t\t\tthis._grip.visible = false;\n\t\t\t\tthis._grip.hasLinearVelocity = false;\n\t\t\t\tthis._grip.linearVelocity = new Vector3();\n\t\t\t\tthis._grip.hasAngularVelocity = false;\n\t\t\t\tthis._grip.angularVelocity = new Vector3();\n\t\t\t}\n\n\t\t\treturn this._grip;\n\t\t}\n\n\t\tdispatchEvent(event) {\n\t\t\tif (this._targetRay !== null) {\n\t\t\t\tthis._targetRay.dispatchEvent(event);\n\t\t\t}\n\n\t\t\tif (this._grip !== null) {\n\t\t\t\tthis._grip.dispatchEvent(event);\n\t\t\t}\n\n\t\t\tif (this._hand !== null) {\n\t\t\t\tthis._hand.dispatchEvent(event);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tdisconnect(inputSource) {\n\t\t\tthis.dispatchEvent({\n\t\t\t\ttype: 'disconnected',\n\t\t\t\tdata: inputSource\n\t\t\t});\n\n\t\t\tif (this._targetRay !== null) {\n\t\t\t\tthis._targetRay.visible = false;\n\t\t\t}\n\n\t\t\tif (this._grip !== null) {\n\t\t\t\tthis._grip.visible = false;\n\t\t\t}\n\n\t\t\tif (this._hand !== null) {\n\t\t\t\tthis._hand.visible = false;\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tupdate(inputSource, frame, referenceSpace) {\n\t\t\tlet inputPose = null;\n\t\t\tlet gripPose = null;\n\t\t\tlet handPose = null;\n\t\t\tconst targetRay = this._targetRay;\n\t\t\tconst grip = this._grip;\n\t\t\tconst hand = this._hand;\n\n\t\t\tif (inputSource && frame.session.visibilityState !== 'visible-blurred') {\n\t\t\t\tif (targetRay !== null) {\n\t\t\t\t\tinputPose = frame.getPose(inputSource.targetRaySpace, referenceSpace);\n\n\t\t\t\t\tif (inputPose !== null) {\n\t\t\t\t\t\ttargetRay.matrix.fromArray(inputPose.transform.matrix);\n\t\t\t\t\t\ttargetRay.matrix.decompose(targetRay.position, targetRay.rotation, targetRay.scale);\n\n\t\t\t\t\t\tif (inputPose.linearVelocity) {\n\t\t\t\t\t\t\ttargetRay.hasLinearVelocity = true;\n\t\t\t\t\t\t\ttargetRay.linearVelocity.copy(inputPose.linearVelocity);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttargetRay.hasLinearVelocity = false;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (inputPose.angularVelocity) {\n\t\t\t\t\t\t\ttargetRay.hasAngularVelocity = true;\n\t\t\t\t\t\t\ttargetRay.angularVelocity.copy(inputPose.angularVelocity);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttargetRay.hasAngularVelocity = false;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tthis.dispatchEvent(_moveEvent);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (hand && inputSource.hand) {\n\t\t\t\t\thandPose = true;\n\n\t\t\t\t\tfor (const inputjoint of inputSource.hand.values()) {\n\t\t\t\t\t\t// Update the joints groups with the XRJoint poses\n\t\t\t\t\t\tconst jointPose = frame.getJointPose(inputjoint, referenceSpace);\n\n\t\t\t\t\t\tif (hand.joints[inputjoint.jointName] === undefined) {\n\t\t\t\t\t\t\t// The transform of this joint will be updated with the joint pose on each frame\n\t\t\t\t\t\t\tconst joint = new Group();\n\t\t\t\t\t\t\tjoint.matrixAutoUpdate = false;\n\t\t\t\t\t\t\tjoint.visible = false;\n\t\t\t\t\t\t\thand.joints[inputjoint.jointName] = joint; // ??\n\n\t\t\t\t\t\t\thand.add(joint);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst joint = hand.joints[inputjoint.jointName];\n\n\t\t\t\t\t\tif (jointPose !== null) {\n\t\t\t\t\t\t\tjoint.matrix.fromArray(jointPose.transform.matrix);\n\t\t\t\t\t\t\tjoint.matrix.decompose(joint.position, joint.rotation, joint.scale);\n\t\t\t\t\t\t\tjoint.jointRadius = jointPose.radius;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tjoint.visible = jointPose !== null;\n\t\t\t\t\t} // Custom events\n\t\t\t\t\t// Check pinchz\n\n\n\t\t\t\t\tconst indexTip = hand.joints['index-finger-tip'];\n\t\t\t\t\tconst thumbTip = hand.joints['thumb-tip'];\n\t\t\t\t\tconst distance = indexTip.position.distanceTo(thumbTip.position);\n\t\t\t\t\tconst distanceToPinch = 0.02;\n\t\t\t\t\tconst threshold = 0.005;\n\n\t\t\t\t\tif (hand.inputState.pinching && distance > distanceToPinch + threshold) {\n\t\t\t\t\t\thand.inputState.pinching = false;\n\t\t\t\t\t\tthis.dispatchEvent({\n\t\t\t\t\t\t\ttype: 'pinchend',\n\t\t\t\t\t\t\thandedness: inputSource.handedness,\n\t\t\t\t\t\t\ttarget: this\n\t\t\t\t\t\t});\n\t\t\t\t\t} else if (!hand.inputState.pinching && distance <= distanceToPinch - threshold) {\n\t\t\t\t\t\thand.inputState.pinching = true;\n\t\t\t\t\t\tthis.dispatchEvent({\n\t\t\t\t\t\t\ttype: 'pinchstart',\n\t\t\t\t\t\t\thandedness: inputSource.handedness,\n\t\t\t\t\t\t\ttarget: this\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (grip !== null && inputSource.gripSpace) {\n\t\t\t\t\t\tgripPose = frame.getPose(inputSource.gripSpace, referenceSpace);\n\n\t\t\t\t\t\tif (gripPose !== null) {\n\t\t\t\t\t\t\tgrip.matrix.fromArray(gripPose.transform.matrix);\n\t\t\t\t\t\t\tgrip.matrix.decompose(grip.position, grip.rotation, grip.scale);\n\n\t\t\t\t\t\t\tif (gripPose.linearVelocity) {\n\t\t\t\t\t\t\t\tgrip.hasLinearVelocity = true;\n\t\t\t\t\t\t\t\tgrip.linearVelocity.copy(gripPose.linearVelocity);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tgrip.hasLinearVelocity = false;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (gripPose.angularVelocity) {\n\t\t\t\t\t\t\t\tgrip.hasAngularVelocity = true;\n\t\t\t\t\t\t\t\tgrip.angularVelocity.copy(gripPose.angularVelocity);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tgrip.hasAngularVelocity = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (targetRay !== null) {\n\t\t\t\ttargetRay.visible = inputPose !== null;\n\t\t\t}\n\n\t\t\tif (grip !== null) {\n\t\t\t\tgrip.visible = gripPose !== null;\n\t\t\t}\n\n\t\t\tif (hand !== null) {\n\t\t\t\thand.visible = handPose !== null;\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tclass WebXRManager extends EventDispatcher {\n\t\tconstructor(renderer, gl) {\n\t\t\tsuper();\n\t\t\tconst scope = this;\n\t\t\tconst state = renderer.state;\n\t\t\tlet session = null;\n\t\t\tlet framebufferScaleFactor = 1.0;\n\t\t\tvar poseTarget = null;\n\t\t\tlet referenceSpace = null;\n\t\t\tlet referenceSpaceType = 'local-floor';\n\t\t\tlet pose = null;\n\t\t\tvar layers = [];\n\t\t\tlet glBinding = null;\n\t\t\tlet glFramebuffer = null;\n\t\t\tlet glProjLayer = null;\n\t\t\tlet glBaseLayer = null;\n\t\t\tlet isMultisample = false;\n\t\t\tlet glMultisampledFramebuffer = null;\n\t\t\tlet glColorRenderbuffer = null;\n\t\t\tlet glDepthRenderbuffer = null;\n\t\t\tlet xrFrame = null;\n\t\t\tlet depthStyle = null;\n\t\t\tlet clearStyle = null;\n\t\t\tconst controllers = [];\n\t\t\tconst inputSourcesMap = new Map(); //\n\n\t\t\tconst cameraL = new PerspectiveCamera();\n\t\t\tcameraL.layers.enable(1);\n\t\t\tcameraL.viewport = new Vector4();\n\t\t\tconst cameraR = new PerspectiveCamera();\n\t\t\tcameraR.layers.enable(2);\n\t\t\tcameraR.viewport = new Vector4();\n\t\t\tconst cameras = [cameraL, cameraR];\n\t\t\tconst cameraVR = new ArrayCamera();\n\t\t\tcameraVR.layers.enable(1);\n\t\t\tcameraVR.layers.enable(2);\n\t\t\tlet _currentDepthNear = null;\n\t\t\tlet _currentDepthFar = null; //\n\n\t\t\tthis.cameraAutoUpdate = true;\n\t\t\tthis.layersEnabled = false;\n\t\t\tthis.enabled = false;\n\t\t\tthis.isPresenting = false;\n\n\t\t\tthis.getCameraPose = function () {\n\t\t\t\treturn pose;\n\t\t\t};\n\n\t\t\tthis.getController = function (index) {\n\t\t\t\tlet controller = controllers[index];\n\n\t\t\t\tif (controller === undefined) {\n\t\t\t\t\tcontroller = new WebXRController();\n\t\t\t\t\tcontrollers[index] = controller;\n\t\t\t\t}\n\n\t\t\t\treturn controller.getTargetRaySpace();\n\t\t\t};\n\n\t\t\tthis.getControllerGrip = function (index) {\n\t\t\t\tlet controller = controllers[index];\n\n\t\t\t\tif (controller === undefined) {\n\t\t\t\t\tcontroller = new WebXRController();\n\t\t\t\t\tcontrollers[index] = controller;\n\t\t\t\t}\n\n\t\t\t\treturn controller.getGripSpace();\n\t\t\t};\n\n\t\t\tthis.getHand = function (index) {\n\t\t\t\tlet controller = controllers[index];\n\n\t\t\t\tif (controller === undefined) {\n\t\t\t\t\tcontroller = new WebXRController();\n\t\t\t\t\tcontrollers[index] = controller;\n\t\t\t\t}\n\n\t\t\t\treturn controller.getHandSpace();\n\t\t\t}; //\n\n\n\t\t\tfunction onSessionEvent(event) {\n\t\t\t\tconst controller = inputSourcesMap.get(event.inputSource);\n\n\t\t\t\tif (controller) {\n\t\t\t\t\tcontroller.dispatchEvent({\n\t\t\t\t\t\ttype: event.type,\n\t\t\t\t\t\tdata: event.inputSource\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction onSessionEnd() {\n\t\t\t\tinputSourcesMap.forEach(function (controller, inputSource) {\n\t\t\t\t\tcontroller.disconnect(inputSource);\n\t\t\t\t});\n\t\t\t\tinputSourcesMap.clear();\n\t\t\t\t_currentDepthNear = null;\n\t\t\t\t_currentDepthFar = null; // restore framebuffer/rendering state\n\n\t\t\t\tstate.bindXRFramebuffer(null);\n\t\t\t\trenderer.setRenderTarget(renderer.getRenderTarget());\n\t\t\t\tif (glFramebuffer) gl.deleteFramebuffer(glFramebuffer);\n\t\t\t\tif (glMultisampledFramebuffer) gl.deleteFramebuffer(glMultisampledFramebuffer);\n\t\t\t\tif (glColorRenderbuffer) gl.deleteRenderbuffer(glColorRenderbuffer);\n\t\t\t\tif (glDepthRenderbuffer) gl.deleteRenderbuffer(glDepthRenderbuffer);\n\t\t\t\tglFramebuffer = null;\n\t\t\t\tglMultisampledFramebuffer = null;\n\t\t\t\tglColorRenderbuffer = null;\n\t\t\t\tglDepthRenderbuffer = null;\n\t\t\t\tglBaseLayer = null;\n\t\t\t\tglProjLayer = null;\n\t\t\t\tglBinding = null;\n\t\t\t\tsession = null; //\n\n\t\t\t\tanimation.stop();\n\t\t\t\tscope.isPresenting = false;\n\t\t\t\tscope.dispatchEvent({\n\t\t\t\t\ttype: 'sessionend'\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tthis.setFramebufferScaleFactor = function (value) {\n\t\t\t\tframebufferScaleFactor = value;\n\n\t\t\t\tif (scope.isPresenting === true) {\n\t\t\t\t\tconsole.warn('THREE.WebXRManager: Cannot change framebuffer scale while presenting.');\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.setReferenceSpaceType = function (value) {\n\t\t\t\treferenceSpaceType = value;\n\n\t\t\t\tif (scope.isPresenting === true) {\n\t\t\t\t\tconsole.warn('THREE.WebXRManager: Cannot change reference space type while presenting.');\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.getReferenceSpace = function () {\n\t\t\t\treturn referenceSpace;\n\t\t\t};\n\n\t\t\tthis.getBaseLayer = function () {\n\t\t\t\treturn glProjLayer !== null ? glProjLayer : glBaseLayer;\n\t\t\t};\n\n\t\t\tthis.getBinding = function () {\n\t\t\t\treturn glBinding;\n\t\t\t};\n\n\t\t\tthis.getFrame = function () {\n\t\t\t\treturn xrFrame;\n\t\t\t};\n\n\t\t\tthis.getSession = function () {\n\t\t\t\treturn session;\n\t\t\t};\n\n\t\t\tthis.setSession = async function (value) {\n\t\t\t\tsession = value;\n\n\t\t\t\tif (session !== null) {\n\t\t\t\t\tsession.addEventListener('select', onSessionEvent);\n\t\t\t\t\tsession.addEventListener('selectstart', onSessionEvent);\n\t\t\t\t\tsession.addEventListener('selectend', onSessionEvent);\n\t\t\t\t\tsession.addEventListener('squeeze', onSessionEvent);\n\t\t\t\t\tsession.addEventListener('squeezestart', onSessionEvent);\n\t\t\t\t\tsession.addEventListener('squeezeend', onSessionEvent);\n\t\t\t\t\tsession.addEventListener('end', onSessionEnd);\n\t\t\t\t\tsession.addEventListener('inputsourceschange', onInputSourcesChange);\n\t\t\t\t\tconst attributes = gl.getContextAttributes();\n\n\t\t\t\t\tif (attributes.xrCompatible !== true) {\n\t\t\t\t\t\tawait gl.makeXRCompatible();\n\t\t\t\t\t}\n\n\t\t\t\t\tif (session.renderState.layers === undefined) {\n\t\t\t\t\t\tconst layerInit = {\n\t\t\t\t\t\t\tantialias: attributes.antialias,\n\t\t\t\t\t\t\talpha: attributes.alpha,\n\t\t\t\t\t\t\tdepth: attributes.depth,\n\t\t\t\t\t\t\tstencil: attributes.stencil,\n\t\t\t\t\t\t\tframebufferScaleFactor: framebufferScaleFactor\n\t\t\t\t\t\t};\n\t\t\t\t\t\tglBaseLayer = new XRWebGLLayer(session, gl, layerInit);\n\t\t\t\t\t\tsession.updateRenderState({\n\t\t\t\t\t\t\tbaseLayer: glBaseLayer\n\t\t\t\t\t\t});\n\t\t\t\t\t} else if (gl instanceof WebGLRenderingContext) {\n\t\t\t\t\t\t// Use old style webgl layer because we can't use MSAA\n\t\t\t\t\t\t// WebGL2 support.\n\t\t\t\t\t\tconst layerInit = {\n\t\t\t\t\t\t\tantialias: true,\n\t\t\t\t\t\t\talpha: attributes.alpha,\n\t\t\t\t\t\t\tdepth: attributes.depth,\n\t\t\t\t\t\t\tstencil: attributes.stencil,\n\t\t\t\t\t\t\tframebufferScaleFactor: framebufferScaleFactor\n\t\t\t\t\t\t};\n\t\t\t\t\t\tglBaseLayer = new XRWebGLLayer(session, gl, layerInit);\n\t\t\t\t\t\tsession.updateRenderState({\n\t\t\t\t\t\t\tlayers: [glBaseLayer]\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tisMultisample = attributes.antialias;\n\t\t\t\t\t\tlet depthFormat = null;\n\n\t\t\t\t\t\tif (attributes.depth) {\n\t\t\t\t\t\t\tclearStyle = gl.DEPTH_BUFFER_BIT;\n\t\t\t\t\t\t\tif (attributes.stencil) clearStyle |= gl.STENCIL_BUFFER_BIT;\n\t\t\t\t\t\t\tdepthStyle = attributes.stencil ? gl.DEPTH_STENCIL_ATTACHMENT : gl.DEPTH_ATTACHMENT;\n\t\t\t\t\t\t\tdepthFormat = attributes.stencil ? gl.DEPTH24_STENCIL8 : gl.DEPTH_COMPONENT24;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst projectionlayerInit = {\n\t\t\t\t\t\t\tcolorFormat: attributes.alpha ? gl.RGBA8 : gl.RGB8,\n\t\t\t\t\t\t\tdepthFormat: depthFormat,\n\t\t\t\t\t\t\tscaleFactor: framebufferScaleFactor\n\t\t\t\t\t\t};\n\t\t\t\t\t\tglBinding = new XRWebGLBinding(session, gl);\n\t\t\t\t\t\tglProjLayer = glBinding.createProjectionLayer(projectionlayerInit);\n\t\t\t\t\t\tglFramebuffer = gl.createFramebuffer();\n\t\t\t\t\t\tsession.updateRenderState({\n\t\t\t\t\t\t\tlayers: [glProjLayer]\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tif (isMultisample) {\n\t\t\t\t\t\t\tglMultisampledFramebuffer = gl.createFramebuffer();\n\t\t\t\t\t\t\tglColorRenderbuffer = gl.createRenderbuffer();\n\t\t\t\t\t\t\tgl.bindRenderbuffer(gl.RENDERBUFFER, glColorRenderbuffer);\n\t\t\t\t\t\t\tgl.renderbufferStorageMultisample(gl.RENDERBUFFER, 4, gl.RGBA8, glProjLayer.textureWidth, glProjLayer.textureHeight);\n\t\t\t\t\t\t\tstate.bindFramebuffer(gl.FRAMEBUFFER, glMultisampledFramebuffer);\n\t\t\t\t\t\t\tgl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, glColorRenderbuffer);\n\t\t\t\t\t\t\tgl.bindRenderbuffer(gl.RENDERBUFFER, null);\n\n\t\t\t\t\t\t\tif (depthFormat !== null) {\n\t\t\t\t\t\t\t\tglDepthRenderbuffer = gl.createRenderbuffer();\n\t\t\t\t\t\t\t\tgl.bindRenderbuffer(gl.RENDERBUFFER, glDepthRenderbuffer);\n\t\t\t\t\t\t\t\tgl.renderbufferStorageMultisample(gl.RENDERBUFFER, 4, depthFormat, glProjLayer.textureWidth, glProjLayer.textureHeight);\n\t\t\t\t\t\t\t\tgl.framebufferRenderbuffer(gl.FRAMEBUFFER, depthStyle, gl.RENDERBUFFER, glDepthRenderbuffer);\n\t\t\t\t\t\t\t\tgl.bindRenderbuffer(gl.RENDERBUFFER, null);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tstate.bindFramebuffer(gl.FRAMEBUFFER, null);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treferenceSpace = await session.requestReferenceSpace(referenceSpaceType);\n\t\t\t\t\tanimation.setContext(session);\n\t\t\t\t\tanimation.start();\n\t\t\t\t\tscope.isPresenting = true;\n\t\t\t\t\tscope.dispatchEvent({\n\t\t\t\t\t\ttype: 'sessionstart'\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.addLayer = function (layer) {\n\t\t\t\tif (!window.XRWebGLBinding || !this.layersEnabled || !session) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tlayers.push(layer);\n\t\t\t\tthis.updateLayers();\n\t\t\t};\n\n\t\t\tthis.removeLayer = function (layer) {\n\t\t\t\tif (!window.XRWebGLBinding || !this.layersEnabled || !session) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tlayers.splice(layers.indexOf(layer), 1);\n\t\t\t\tthis.updateLayers();\n\t\t\t};\n\n\t\t\tthis.updateLayers = function () {\n\t\t\t\tvar layersCopy = layers.map(function (x) {\n\t\t\t\t\treturn x;\n\t\t\t\t});\n\t\t\t\tlayersCopy.unshift(session.renderState.layers[0]);\n\t\t\t\tsession.updateRenderState({\n\t\t\t\t\tlayers: layersCopy\n\t\t\t\t});\n\t\t\t};\n\n\t\t\tfunction onInputSourcesChange(event) {\n\t\t\t\tconst inputSources = session.inputSources; // Assign inputSources to available controllers\n\n\t\t\t\tfor (let i = 0; i < controllers.length; i++) {\n\t\t\t\t\tinputSourcesMap.set(inputSources[i], controllers[i]);\n\t\t\t\t} // Notify disconnected\n\n\n\t\t\t\tfor (let i = 0; i < event.removed.length; i++) {\n\t\t\t\t\tconst inputSource = event.removed[i];\n\t\t\t\t\tconst controller = inputSourcesMap.get(inputSource);\n\n\t\t\t\t\tif (controller) {\n\t\t\t\t\t\tcontroller.dispatchEvent({\n\t\t\t\t\t\t\ttype: 'disconnected',\n\t\t\t\t\t\t\tdata: inputSource\n\t\t\t\t\t\t});\n\t\t\t\t\t\tinputSourcesMap.delete(inputSource);\n\t\t\t\t\t}\n\t\t\t\t} // Notify connected\n\n\n\t\t\t\tfor (let i = 0; i < event.added.length; i++) {\n\t\t\t\t\tconst inputSource = event.added[i];\n\t\t\t\t\tconst controller = inputSourcesMap.get(inputSource);\n\n\t\t\t\t\tif (controller) {\n\t\t\t\t\t\tcontroller.dispatchEvent({\n\t\t\t\t\t\t\ttype: 'connected',\n\t\t\t\t\t\t\tdata: inputSource\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} //\n\n\n\t\t\tconst cameraLPos = new Vector3();\n\t\t\tconst cameraRPos = new Vector3();\n\t\t\t/**\n\t\t\t * Assumes 2 cameras that are parallel and share an X-axis, and that\n\t\t\t * the cameras' projection and world matrices have already been set.\n\t\t\t * And that near and far planes are identical for both cameras.\n\t\t\t * Visualization of this technique: https://computergraphics.stackexchange.com/a/4765\n\t\t\t */\n\n\t\t\tfunction setProjectionFromUnion(camera, cameraL, cameraR) {\n\t\t\t\tcameraLPos.setFromMatrixPosition(cameraL.matrixWorld);\n\t\t\t\tcameraRPos.setFromMatrixPosition(cameraR.matrixWorld);\n\t\t\t\tconst ipd = cameraLPos.distanceTo(cameraRPos);\n\t\t\t\tconst projL = cameraL.projectionMatrix.elements;\n\t\t\t\tconst projR = cameraR.projectionMatrix.elements; // VR systems will have identical far and near planes, and\n\t\t\t\t// most likely identical top and bottom frustum extents.\n\t\t\t\t// Use the left camera for these values.\n\n\t\t\t\tconst near = projL[14] / (projL[10] - 1);\n\t\t\t\tconst far = projL[14] / (projL[10] + 1);\n\t\t\t\tconst topFov = (projL[9] + 1) / projL[5];\n\t\t\t\tconst bottomFov = (projL[9] - 1) / projL[5];\n\t\t\t\tconst leftFov = (projL[8] - 1) / projL[0];\n\t\t\t\tconst rightFov = (projR[8] + 1) / projR[0];\n\t\t\t\tconst left = near * leftFov;\n\t\t\t\tconst right = near * rightFov; // Calculate the new camera's position offset from the\n\t\t\t\t// left camera. xOffset should be roughly half `ipd`.\n\n\t\t\t\tconst zOffset = ipd / (-leftFov + rightFov);\n\t\t\t\tconst xOffset = zOffset * -leftFov; // TODO: Better way to apply this offset?\n\n\t\t\t\tcameraL.matrixWorld.decompose(camera.position, camera.quaternion, camera.scale);\n\t\t\t\tcamera.translateX(xOffset);\n\t\t\t\tcamera.translateZ(zOffset);\n\t\t\t\tcamera.matrixWorld.compose(camera.position, camera.quaternion, camera.scale);\n\t\t\t\tcamera.matrixWorldInverse.copy(camera.matrixWorld).invert(); // Find the union of the frustum values of the cameras and scale\n\t\t\t\t// the values so that the near plane's position does not change in world space,\n\t\t\t\t// although must now be relative to the new union camera.\n\n\t\t\t\tconst near2 = near + zOffset;\n\t\t\t\tconst far2 = far + zOffset;\n\t\t\t\tconst left2 = left - xOffset;\n\t\t\t\tconst right2 = right + (ipd - xOffset);\n\t\t\t\tconst top2 = topFov * far / far2 * near2;\n\t\t\t\tconst bottom2 = bottomFov * far / far2 * near2;\n\t\t\t\tcamera.projectionMatrix.makePerspective(left2, right2, top2, bottom2, near2, far2);\n\t\t\t}\n\n\t\t\tfunction updateCamera(camera, parent) {\n\t\t\t\tif (parent === null) {\n\t\t\t\t\tcamera.matrixWorld.copy(camera.matrix);\n\t\t\t\t} else {\n\t\t\t\t\tcamera.matrixWorld.multiplyMatrices(parent.matrixWorld, camera.matrix);\n\t\t\t\t}\n\n\t\t\t\tcamera.matrixWorldInverse.copy(camera.matrixWorld).invert();\n\t\t\t}\n\n\t\t\tthis.setPoseTarget = function (object) {\n\t\t\t\tif (object !== undefined) poseTarget = object;\n\t\t\t};\n\n\t\t\tthis.updateCamera = function (camera) {\n\t\t\t\tif (session === null) return;\n\t\t\t\tcameraVR.near = cameraR.near = cameraL.near = camera.near;\n\t\t\t\tcameraVR.far = cameraR.far = cameraL.far = camera.far;\n\n\t\t\t\tif (_currentDepthNear !== cameraVR.near || _currentDepthFar !== cameraVR.far) {\n\t\t\t\t\t// Note that the new renderState won't apply until the next frame. See #18320\n\t\t\t\t\tsession.updateRenderState({\n\t\t\t\t\t\tdepthNear: cameraVR.near,\n\t\t\t\t\t\tdepthFar: cameraVR.far\n\t\t\t\t\t});\n\t\t\t\t\t_currentDepthNear = cameraVR.near;\n\t\t\t\t\t_currentDepthFar = cameraVR.far;\n\t\t\t\t}\n\n\t\t\t\tconst cameras = cameraVR.cameras;\n\t\t\t\tvar object = poseTarget || camera;\n\t\t\t\tconst parent = object.parent;\n\t\t\t\tupdateCamera(cameraVR, parent);\n\n\t\t\t\tfor (let i = 0; i < cameras.length; i++) {\n\t\t\t\t\tupdateCamera(cameras[i], parent);\n\t\t\t\t}\n\n\t\t\t\tcameraVR.matrixWorld.decompose(cameraVR.position, cameraVR.quaternion, cameraVR.scale); // update user camera and its children\n\n\t\t\t\tobject.matrixWorld.copy(cameraVR.matrixWorld);\n\t\t\t\tobject.matrix.copy(cameraVR.matrix);\n\t\t\t\tobject.matrix.decompose(object.position, object.quaternion, object.scale);\n\t\t\t\tconst children = object.children;\n\n\t\t\t\tfor (let i = 0, l = children.length; i < l; i++) {\n\t\t\t\t\tchildren[i].updateMatrixWorld(true);\n\t\t\t\t} // update projection matrix for proper view frustum culling\n\n\n\t\t\t\tif (cameras.length === 2) {\n\t\t\t\t\tsetProjectionFromUnion(cameraVR, cameraL, cameraR);\n\t\t\t\t} else {\n\t\t\t\t\t// assume single camera setup (AR)\n\t\t\t\t\tcameraVR.projectionMatrix.copy(cameraL.projectionMatrix);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.getCamera = function () {\n\t\t\t\treturn cameraVR;\n\t\t\t};\n\n\t\t\tthis.getFoveation = function () {\n\t\t\t\tif (glProjLayer !== null) {\n\t\t\t\t\treturn glProjLayer.fixedFoveation;\n\t\t\t\t}\n\n\t\t\t\tif (glBaseLayer !== null) {\n\t\t\t\t\treturn glBaseLayer.fixedFoveation;\n\t\t\t\t}\n\n\t\t\t\treturn undefined;\n\t\t\t};\n\n\t\t\tthis.setFoveation = function (foveation) {\n\t\t\t\t// 0 = no foveation = full resolution\n\t\t\t\t// 1 = maximum foveation = the edges render at lower resolution\n\t\t\t\tif (glProjLayer !== null) {\n\t\t\t\t\tglProjLayer.fixedFoveation = foveation;\n\t\t\t\t}\n\n\t\t\t\tif (glBaseLayer !== null && glBaseLayer.fixedFoveation !== undefined) {\n\t\t\t\t\tglBaseLayer.fixedFoveation = foveation;\n\t\t\t\t}\n\t\t\t}; // Animation Loop\n\n\n\t\t\tlet onAnimationFrameCallback = null;\n\n\t\t\tfunction onAnimationFrame(time, frame) {\n\t\t\t\tpose = frame.getViewerPose(referenceSpace);\n\t\t\t\txrFrame = frame;\n\n\t\t\t\tif (pose !== null) {\n\t\t\t\t\tconst views = pose.views;\n\n\t\t\t\t\tif (glBaseLayer !== null) {\n\t\t\t\t\t\tstate.bindXRFramebuffer(glBaseLayer.framebuffer);\n\t\t\t\t\t}\n\n\t\t\t\t\tlet cameraVRNeedsUpdate = false; // check if it's necessary to rebuild cameraVR's camera list\n\n\t\t\t\t\tif (views.length !== cameraVR.cameras.length) {\n\t\t\t\t\t\tcameraVR.cameras.length = 0;\n\t\t\t\t\t\tcameraVRNeedsUpdate = true;\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (let i = 0; i < views.length; i++) {\n\t\t\t\t\t\tconst view = views[i];\n\t\t\t\t\t\tlet viewport = null;\n\n\t\t\t\t\t\tif (glBaseLayer !== null) {\n\t\t\t\t\t\t\tviewport = glBaseLayer.getViewport(view);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst glSubImage = glBinding.getViewSubImage(glProjLayer, view);\n\t\t\t\t\t\t\tstate.bindXRFramebuffer(glFramebuffer);\n\n\t\t\t\t\t\t\tif (glSubImage.depthStencilTexture !== undefined) {\n\t\t\t\t\t\t\t\tgl.framebufferTexture2D(gl.FRAMEBUFFER, depthStyle, gl.TEXTURE_2D, glSubImage.depthStencilTexture, 0);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tgl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, glSubImage.colorTexture, 0);\n\t\t\t\t\t\t\tviewport = glSubImage.viewport;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst camera = cameras[i];\n\t\t\t\t\t\tcamera.matrix.fromArray(view.transform.matrix);\n\t\t\t\t\t\tcamera.projectionMatrix.fromArray(view.projectionMatrix);\n\t\t\t\t\t\tcamera.viewport.set(viewport.x, viewport.y, viewport.width, viewport.height);\n\n\t\t\t\t\t\tif (i === 0) {\n\t\t\t\t\t\t\tcameraVR.matrix.copy(camera.matrix);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (cameraVRNeedsUpdate === true) {\n\t\t\t\t\t\t\tcameraVR.cameras.push(camera);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (isMultisample) {\n\t\t\t\t\t\tstate.bindXRFramebuffer(glMultisampledFramebuffer);\n\t\t\t\t\t\tif (clearStyle !== null) gl.clear(clearStyle);\n\t\t\t\t\t}\n\t\t\t\t} //\n\n\n\t\t\t\tconst inputSources = session.inputSources;\n\n\t\t\t\tfor (let i = 0; i < controllers.length; i++) {\n\t\t\t\t\tconst controller = controllers[i];\n\t\t\t\t\tconst inputSource = inputSources[i];\n\t\t\t\t\tcontroller.update(inputSource, frame, referenceSpace);\n\t\t\t\t}\n\n\t\t\t\tif (onAnimationFrameCallback) onAnimationFrameCallback(time, frame);\n\n\t\t\t\tif (isMultisample) {\n\t\t\t\t\tconst width = glProjLayer.textureWidth;\n\t\t\t\t\tconst height = glProjLayer.textureHeight;\n\t\t\t\t\tstate.bindFramebuffer(gl.READ_FRAMEBUFFER, glMultisampledFramebuffer);\n\t\t\t\t\tstate.bindFramebuffer(gl.DRAW_FRAMEBUFFER, glFramebuffer); // Invalidate the depth here to avoid flush of the depth data to main memory.\n\n\t\t\t\t\tgl.invalidateFramebuffer(gl.READ_FRAMEBUFFER, [depthStyle]);\n\t\t\t\t\tgl.invalidateFramebuffer(gl.DRAW_FRAMEBUFFER, [depthStyle]);\n\t\t\t\t\tgl.blitFramebuffer(0, 0, width, height, 0, 0, width, height, gl.COLOR_BUFFER_BIT, gl.NEAREST); // Invalidate the MSAA buffer because it's not needed anymore.\n\n\t\t\t\t\tgl.invalidateFramebuffer(gl.READ_FRAMEBUFFER, [gl.COLOR_ATTACHMENT0]);\n\t\t\t\t\tstate.bindFramebuffer(gl.READ_FRAMEBUFFER, null);\n\t\t\t\t\tstate.bindFramebuffer(gl.DRAW_FRAMEBUFFER, null);\n\t\t\t\t\tstate.bindFramebuffer(gl.FRAMEBUFFER, glMultisampledFramebuffer);\n\t\t\t\t}\n\n\t\t\t\txrFrame = null;\n\t\t\t}\n\n\t\t\tconst animation = new WebGLAnimation();\n\t\t\tanimation.setAnimationLoop(onAnimationFrame);\n\n\t\t\tthis.setAnimationLoop = function (callback) {\n\t\t\t\tonAnimationFrameCallback = callback;\n\t\t\t};\n\n\t\t\tthis.dispose = function () {};\n\t\t}\n\n\t}\n\n\tfunction WebGLMaterials(properties) {\n\t\tfunction refreshFogUniforms(uniforms, fog) {\n\t\t\tuniforms.fogColor.value.copy(fog.color);\n\n\t\t\tif (fog.isFog) {\n\t\t\t\tuniforms.fogNear.value = fog.near;\n\t\t\t\tuniforms.fogFar.value = fog.far;\n\t\t\t} else if (fog.isFogExp2) {\n\t\t\t\tuniforms.fogDensity.value = fog.density;\n\t\t\t}\n\t\t}\n\n\t\tfunction refreshMaterialUniforms(uniforms, material, pixelRatio, height, transmissionRenderTarget) {\n\t\t\tif (material.isMeshBasicMaterial) {\n\t\t\t\trefreshUniformsCommon(uniforms, material);\n\t\t\t} else if (material.isMeshLambertMaterial) {\n\t\t\t\trefreshUniformsCommon(uniforms, material);\n\t\t\t\trefreshUniformsLambert(uniforms, material);\n\t\t\t} else if (material.isMeshToonMaterial) {\n\t\t\t\trefreshUniformsCommon(uniforms, material);\n\t\t\t\trefreshUniformsToon(uniforms, material);\n\t\t\t} else if (material.isMeshPhongMaterial) {\n\t\t\t\trefreshUniformsCommon(uniforms, material);\n\t\t\t\trefreshUniformsPhong(uniforms, material);\n\t\t\t} else if (material.isMeshStandardMaterial) {\n\t\t\t\trefreshUniformsCommon(uniforms, material);\n\n\t\t\t\tif (material.isMeshPhysicalMaterial) {\n\t\t\t\t\trefreshUniformsPhysical(uniforms, material, transmissionRenderTarget);\n\t\t\t\t} else {\n\t\t\t\t\trefreshUniformsStandard(uniforms, material);\n\t\t\t\t}\n\t\t\t} else if (material.isMeshMatcapMaterial) {\n\t\t\t\trefreshUniformsCommon(uniforms, material);\n\t\t\t\trefreshUniformsMatcap(uniforms, material);\n\t\t\t} else if (material.isMeshDepthMaterial) {\n\t\t\t\trefreshUniformsCommon(uniforms, material);\n\t\t\t\trefreshUniformsDepth(uniforms, material);\n\t\t\t} else if (material.isMeshDistanceMaterial) {\n\t\t\t\trefreshUniformsCommon(uniforms, material);\n\t\t\t\trefreshUniformsDistance(uniforms, material);\n\t\t\t} else if (material.isMeshNormalMaterial) {\n\t\t\t\trefreshUniformsCommon(uniforms, material);\n\t\t\t\trefreshUniformsNormal(uniforms, material);\n\t\t\t} else if (material.isLineBasicMaterial) {\n\t\t\t\trefreshUniformsLine(uniforms, material);\n\n\t\t\t\tif (material.isLineDashedMaterial) {\n\t\t\t\t\trefreshUniformsDash(uniforms, material);\n\t\t\t\t}\n\t\t\t} else if (material.isPointsMaterial) {\n\t\t\t\trefreshUniformsPoints(uniforms, material, pixelRatio, height);\n\t\t\t} else if (material.isSpriteMaterial) {\n\t\t\t\trefreshUniformsSprites(uniforms, material);\n\t\t\t} else if (material.isShadowMaterial) {\n\t\t\t\tuniforms.color.value.copy(material.color);\n\t\t\t\tuniforms.opacity.value = material.opacity;\n\t\t\t} else if (material.isShaderMaterial) {\n\t\t\t\tmaterial.uniformsNeedUpdate = false; // #15581\n\t\t\t}\n\t\t}\n\n\t\tfunction refreshUniformsCommon(uniforms, material) {\n\t\t\tuniforms.opacity.value = material.opacity;\n\n\t\t\tif (material.color) {\n\t\t\t\tuniforms.diffuse.value.copy(material.color);\n\t\t\t}\n\n\t\t\tif (material.emissive) {\n\t\t\t\tuniforms.emissive.value.copy(material.emissive).multiplyScalar(material.emissiveIntensity);\n\t\t\t}\n\n\t\t\tif (material.map) {\n\t\t\t\tuniforms.map.value = material.map;\n\t\t\t}\n\n\t\t\tif (material.alphaMap) {\n\t\t\t\tuniforms.alphaMap.value = material.alphaMap;\n\t\t\t}\n\n\t\t\tif (material.specularMap) {\n\t\t\t\tuniforms.specularMap.value = material.specularMap;\n\t\t\t}\n\n\t\t\tif (material.alphaTest > 0) {\n\t\t\t\tuniforms.alphaTest.value = material.alphaTest;\n\t\t\t}\n\n\t\t\tconst envMap = properties.get(material).envMap;\n\n\t\t\tif (envMap) {\n\t\t\t\tuniforms.envMap.value = envMap;\n\t\t\t\tuniforms.flipEnvMap.value = envMap.isCubeTexture && envMap.isRenderTargetTexture === false ? -1 : 1;\n\t\t\t\tuniforms.reflectivity.value = material.reflectivity;\n\t\t\t\tuniforms.ior.value = material.ior;\n\t\t\t\tuniforms.refractionRatio.value = material.refractionRatio;\n\n\t\t\t\tconst maxMipLevel = properties.get(envMap).__maxMipLevel;\n\n\t\t\t\tif (maxMipLevel !== undefined) {\n\t\t\t\t\tuniforms.maxMipLevel.value = maxMipLevel;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (material.lightMap) {\n\t\t\t\tuniforms.lightMap.value = material.lightMap;\n\t\t\t\tuniforms.lightMapIntensity.value = material.lightMapIntensity;\n\t\t\t}\n\n\t\t\tif (material.aoMap) {\n\t\t\t\tuniforms.aoMap.value = material.aoMap;\n\t\t\t\tuniforms.aoMapIntensity.value = material.aoMapIntensity;\n\t\t\t} // uv repeat and offset setting priorities\n\t\t\t// 1. color map\n\t\t\t// 2. specular map\n\t\t\t// 3. displacementMap map\n\t\t\t// 4. normal map\n\t\t\t// 5. bump map\n\t\t\t// 6. roughnessMap map\n\t\t\t// 7. metalnessMap map\n\t\t\t// 8. alphaMap map\n\t\t\t// 9. emissiveMap map\n\t\t\t// 10. clearcoat map\n\t\t\t// 11. clearcoat normal map\n\t\t\t// 12. clearcoat roughnessMap map\n\t\t\t// 13. specular intensity map\n\t\t\t// 14. specular tint map\n\t\t\t// 15. transmission map\n\t\t\t// 16. thickness map\n\n\n\t\t\tlet uvScaleMap;\n\n\t\t\tif (material.map) {\n\t\t\t\tuvScaleMap = material.map;\n\t\t\t} else if (material.specularMap) {\n\t\t\t\tuvScaleMap = material.specularMap;\n\t\t\t} else if (material.displacementMap) {\n\t\t\t\tuvScaleMap = material.displacementMap;\n\t\t\t} else if (material.normalMap) {\n\t\t\t\tuvScaleMap = material.normalMap;\n\t\t\t} else if (material.bumpMap) {\n\t\t\t\tuvScaleMap = material.bumpMap;\n\t\t\t} else if (material.roughnessMap) {\n\t\t\t\tuvScaleMap = material.roughnessMap;\n\t\t\t} else if (material.metalnessMap) {\n\t\t\t\tuvScaleMap = material.metalnessMap;\n\t\t\t} else if (material.alphaMap) {\n\t\t\t\tuvScaleMap = material.alphaMap;\n\t\t\t} else if (material.emissiveMap) {\n\t\t\t\tuvScaleMap = material.emissiveMap;\n\t\t\t} else if (material.clearcoatMap) {\n\t\t\t\tuvScaleMap = material.clearcoatMap;\n\t\t\t} else if (material.clearcoatNormalMap) {\n\t\t\t\tuvScaleMap = material.clearcoatNormalMap;\n\t\t\t} else if (material.clearcoatRoughnessMap) {\n\t\t\t\tuvScaleMap = material.clearcoatRoughnessMap;\n\t\t\t} else if (material.specularIntensityMap) {\n\t\t\t\tuvScaleMap = material.specularIntensityMap;\n\t\t\t} else if (material.specularTintMap) {\n\t\t\t\tuvScaleMap = material.specularTintMap;\n\t\t\t} else if (material.transmissionMap) {\n\t\t\t\tuvScaleMap = material.transmissionMap;\n\t\t\t} else if (material.thicknessMap) {\n\t\t\t\tuvScaleMap = material.thicknessMap;\n\t\t\t}\n\n\t\t\tif (uvScaleMap !== undefined) {\n\t\t\t\t// backwards compatibility\n\t\t\t\tif (uvScaleMap.isWebGLRenderTarget) {\n\t\t\t\t\tuvScaleMap = uvScaleMap.texture;\n\t\t\t\t}\n\n\t\t\t\tif (uvScaleMap.matrixAutoUpdate === true) {\n\t\t\t\t\tuvScaleMap.updateMatrix();\n\t\t\t\t}\n\n\t\t\t\tuniforms.uvTransform.value.copy(uvScaleMap.matrix);\n\t\t\t} // uv repeat and offset setting priorities for uv2\n\t\t\t// 1. ao map\n\t\t\t// 2. light map\n\n\n\t\t\tlet uv2ScaleMap;\n\n\t\t\tif (material.aoMap) {\n\t\t\t\tuv2ScaleMap = material.aoMap;\n\t\t\t} else if (material.lightMap) {\n\t\t\t\tuv2ScaleMap = material.lightMap;\n\t\t\t}\n\n\t\t\tif (uv2ScaleMap !== undefined) {\n\t\t\t\t// backwards compatibility\n\t\t\t\tif (uv2ScaleMap.isWebGLRenderTarget) {\n\t\t\t\t\tuv2ScaleMap = uv2ScaleMap.texture;\n\t\t\t\t}\n\n\t\t\t\tif (uv2ScaleMap.matrixAutoUpdate === true) {\n\t\t\t\t\tuv2ScaleMap.updateMatrix();\n\t\t\t\t}\n\n\t\t\t\tuniforms.uv2Transform.value.copy(uv2ScaleMap.matrix);\n\t\t\t}\n\t\t}\n\n\t\tfunction refreshUniformsLine(uniforms, material) {\n\t\t\tuniforms.diffuse.value.copy(material.color);\n\t\t\tuniforms.opacity.value = material.opacity;\n\t\t}\n\n\t\tfunction refreshUniformsDash(uniforms, material) {\n\t\t\tuniforms.dashSize.value = material.dashSize;\n\t\t\tuniforms.totalSize.value = material.dashSize + material.gapSize;\n\t\t\tuniforms.scale.value = material.scale;\n\t\t}\n\n\t\tfunction refreshUniformsPoints(uniforms, material, pixelRatio, height) {\n\t\t\tuniforms.diffuse.value.copy(material.color);\n\t\t\tuniforms.opacity.value = material.opacity;\n\t\t\tuniforms.size.value = material.size * pixelRatio;\n\t\t\tuniforms.scale.value = height * 0.5;\n\n\t\t\tif (material.map) {\n\t\t\t\tuniforms.map.value = material.map;\n\t\t\t}\n\n\t\t\tif (material.alphaMap) {\n\t\t\t\tuniforms.alphaMap.value = material.alphaMap;\n\t\t\t}\n\n\t\t\tif (material.alphaTest > 0) {\n\t\t\t\tuniforms.alphaTest.value = material.alphaTest;\n\t\t\t} // uv repeat and offset setting priorities\n\t\t\t// 1. color map\n\t\t\t// 2. alpha map\n\n\n\t\t\tlet uvScaleMap;\n\n\t\t\tif (material.map) {\n\t\t\t\tuvScaleMap = material.map;\n\t\t\t} else if (material.alphaMap) {\n\t\t\t\tuvScaleMap = material.alphaMap;\n\t\t\t}\n\n\t\t\tif (uvScaleMap !== undefined) {\n\t\t\t\tif (uvScaleMap.matrixAutoUpdate === true) {\n\t\t\t\t\tuvScaleMap.updateMatrix();\n\t\t\t\t}\n\n\t\t\t\tuniforms.uvTransform.value.copy(uvScaleMap.matrix);\n\t\t\t}\n\t\t}\n\n\t\tfunction refreshUniformsSprites(uniforms, material) {\n\t\t\tuniforms.diffuse.value.copy(material.color);\n\t\t\tuniforms.opacity.value = material.opacity;\n\t\t\tuniforms.rotation.value = material.rotation;\n\n\t\t\tif (material.map) {\n\t\t\t\tuniforms.map.value = material.map;\n\t\t\t}\n\n\t\t\tif (material.alphaMap) {\n\t\t\t\tuniforms.alphaMap.value = material.alphaMap;\n\t\t\t}\n\n\t\t\tif (material.alphaTest > 0) {\n\t\t\t\tuniforms.alphaTest.value = material.alphaTest;\n\t\t\t} // uv repeat and offset setting priorities\n\t\t\t// 1. color map\n\t\t\t// 2. alpha map\n\n\n\t\t\tlet uvScaleMap;\n\n\t\t\tif (material.map) {\n\t\t\t\tuvScaleMap = material.map;\n\t\t\t} else if (material.alphaMap) {\n\t\t\t\tuvScaleMap = material.alphaMap;\n\t\t\t}\n\n\t\t\tif (uvScaleMap !== undefined) {\n\t\t\t\tif (uvScaleMap.matrixAutoUpdate === true) {\n\t\t\t\t\tuvScaleMap.updateMatrix();\n\t\t\t\t}\n\n\t\t\t\tuniforms.uvTransform.value.copy(uvScaleMap.matrix);\n\t\t\t}\n\t\t}\n\n\t\tfunction refreshUniformsLambert(uniforms, material) {\n\t\t\tif (material.emissiveMap) {\n\t\t\t\tuniforms.emissiveMap.value = material.emissiveMap;\n\t\t\t}\n\t\t}\n\n\t\tfunction refreshUniformsPhong(uniforms, material) {\n\t\t\tuniforms.specular.value.copy(material.specular);\n\t\t\tuniforms.shininess.value = Math.max(material.shininess, 1e-4); // to prevent pow( 0.0, 0.0 )\n\n\t\t\tif (material.emissiveMap) {\n\t\t\t\tuniforms.emissiveMap.value = material.emissiveMap;\n\t\t\t}\n\n\t\t\tif (material.bumpMap) {\n\t\t\t\tuniforms.bumpMap.value = material.bumpMap;\n\t\t\t\tuniforms.bumpScale.value = material.bumpScale;\n\t\t\t\tif (material.side === BackSide) uniforms.bumpScale.value *= -1;\n\t\t\t}\n\n\t\t\tif (material.normalMap) {\n\t\t\t\tuniforms.normalMap.value = material.normalMap;\n\t\t\t\tuniforms.normalScale.value.copy(material.normalScale);\n\t\t\t\tif (material.side === BackSide) uniforms.normalScale.value.negate();\n\t\t\t}\n\n\t\t\tif (material.displacementMap) {\n\t\t\t\tuniforms.displacementMap.value = material.displacementMap;\n\t\t\t\tuniforms.displacementScale.value = material.displacementScale;\n\t\t\t\tuniforms.displacementBias.value = material.displacementBias;\n\t\t\t}\n\t\t}\n\n\t\tfunction refreshUniformsToon(uniforms, material) {\n\t\t\tif (material.gradientMap) {\n\t\t\t\tuniforms.gradientMap.value = material.gradientMap;\n\t\t\t}\n\n\t\t\tif (material.emissiveMap) {\n\t\t\t\tuniforms.emissiveMap.value = material.emissiveMap;\n\t\t\t}\n\n\t\t\tif (material.bumpMap) {\n\t\t\t\tuniforms.bumpMap.value = material.bumpMap;\n\t\t\t\tuniforms.bumpScale.value = material.bumpScale;\n\t\t\t\tif (material.side === BackSide) uniforms.bumpScale.value *= -1;\n\t\t\t}\n\n\t\t\tif (material.normalMap) {\n\t\t\t\tuniforms.normalMap.value = material.normalMap;\n\t\t\t\tuniforms.normalScale.value.copy(material.normalScale);\n\t\t\t\tif (material.side === BackSide) uniforms.normalScale.value.negate();\n\t\t\t}\n\n\t\t\tif (material.displacementMap) {\n\t\t\t\tuniforms.displacementMap.value = material.displacementMap;\n\t\t\t\tuniforms.displacementScale.value = material.displacementScale;\n\t\t\t\tuniforms.displacementBias.value = material.displacementBias;\n\t\t\t}\n\t\t}\n\n\t\tfunction refreshUniformsStandard(uniforms, material) {\n\t\t\tuniforms.roughness.value = material.roughness;\n\t\t\tuniforms.metalness.value = material.metalness;\n\n\t\t\tif (material.roughnessMap) {\n\t\t\t\tuniforms.roughnessMap.value = material.roughnessMap;\n\t\t\t}\n\n\t\t\tif (material.metalnessMap) {\n\t\t\t\tuniforms.metalnessMap.value = material.metalnessMap;\n\t\t\t}\n\n\t\t\tif (material.emissiveMap) {\n\t\t\t\tuniforms.emissiveMap.value = material.emissiveMap;\n\t\t\t}\n\n\t\t\tif (material.bumpMap) {\n\t\t\t\tuniforms.bumpMap.value = material.bumpMap;\n\t\t\t\tuniforms.bumpScale.value = material.bumpScale;\n\t\t\t\tif (material.side === BackSide) uniforms.bumpScale.value *= -1;\n\t\t\t}\n\n\t\t\tif (material.normalMap) {\n\t\t\t\tuniforms.normalMap.value = material.normalMap;\n\t\t\t\tuniforms.normalScale.value.copy(material.normalScale);\n\t\t\t\tif (material.side === BackSide) uniforms.normalScale.value.negate();\n\t\t\t}\n\n\t\t\tif (material.displacementMap) {\n\t\t\t\tuniforms.displacementMap.value = material.displacementMap;\n\t\t\t\tuniforms.displacementScale.value = material.displacementScale;\n\t\t\t\tuniforms.displacementBias.value = material.displacementBias;\n\t\t\t}\n\n\t\t\tconst envMap = properties.get(material).envMap;\n\n\t\t\tif (envMap) {\n\t\t\t\t//uniforms.envMap.value = material.envMap; // part of uniforms common\n\t\t\t\tuniforms.envMapIntensity.value = material.envMapIntensity;\n\t\t\t}\n\t\t}\n\n\t\tfunction refreshUniformsPhysical(uniforms, material, transmissionRenderTarget) {\n\t\t\trefreshUniformsStandard(uniforms, material);\n\t\t\tuniforms.ior.value = material.ior; // also part of uniforms common\n\n\t\t\tif (material.sheen > 0) {\n\t\t\t\tuniforms.sheenTint.value.copy(material.sheenTint).multiplyScalar(material.sheen);\n\t\t\t\tuniforms.sheenRoughness.value = material.sheenRoughness;\n\t\t\t}\n\n\t\t\tif (material.clearcoat > 0) {\n\t\t\t\tuniforms.clearcoat.value = material.clearcoat;\n\t\t\t\tuniforms.clearcoatRoughness.value = material.clearcoatRoughness;\n\n\t\t\t\tif (material.clearcoatMap) {\n\t\t\t\t\tuniforms.clearcoatMap.value = material.clearcoatMap;\n\t\t\t\t}\n\n\t\t\t\tif (material.clearcoatRoughnessMap) {\n\t\t\t\t\tuniforms.clearcoatRoughnessMap.value = material.clearcoatRoughnessMap;\n\t\t\t\t}\n\n\t\t\t\tif (material.clearcoatNormalMap) {\n\t\t\t\t\tuniforms.clearcoatNormalScale.value.copy(material.clearcoatNormalScale);\n\t\t\t\t\tuniforms.clearcoatNormalMap.value = material.clearcoatNormalMap;\n\n\t\t\t\t\tif (material.side === BackSide) {\n\t\t\t\t\t\tuniforms.clearcoatNormalScale.value.negate();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (material.transmission > 0) {\n\t\t\t\tuniforms.transmission.value = material.transmission;\n\t\t\t\tuniforms.transmissionSamplerMap.value = transmissionRenderTarget.texture;\n\t\t\t\tuniforms.transmissionSamplerSize.value.set(transmissionRenderTarget.width, transmissionRenderTarget.height);\n\n\t\t\t\tif (material.transmissionMap) {\n\t\t\t\t\tuniforms.transmissionMap.value = material.transmissionMap;\n\t\t\t\t}\n\n\t\t\t\tuniforms.thickness.value = material.thickness;\n\n\t\t\t\tif (material.thicknessMap) {\n\t\t\t\t\tuniforms.thicknessMap.value = material.thicknessMap;\n\t\t\t\t}\n\n\t\t\t\tuniforms.attenuationDistance.value = material.attenuationDistance;\n\t\t\t\tuniforms.attenuationTint.value.copy(material.attenuationTint);\n\t\t\t}\n\n\t\t\tuniforms.specularIntensity.value = material.specularIntensity;\n\t\t\tuniforms.specularTint.value.copy(material.specularTint);\n\n\t\t\tif (material.specularIntensityMap) {\n\t\t\t\tuniforms.specularIntensityMap.value = material.specularIntensityMap;\n\t\t\t}\n\n\t\t\tif (material.specularTintMap) {\n\t\t\t\tuniforms.specularTintMap.value = material.specularTintMap;\n\t\t\t}\n\t\t}\n\n\t\tfunction refreshUniformsMatcap(uniforms, material) {\n\t\t\tif (material.matcap) {\n\t\t\t\tuniforms.matcap.value = material.matcap;\n\t\t\t}\n\n\t\t\tif (material.bumpMap) {\n\t\t\t\tuniforms.bumpMap.value = material.bumpMap;\n\t\t\t\tuniforms.bumpScale.value = material.bumpScale;\n\t\t\t\tif (material.side === BackSide) uniforms.bumpScale.value *= -1;\n\t\t\t}\n\n\t\t\tif (material.normalMap) {\n\t\t\t\tuniforms.normalMap.value = material.normalMap;\n\t\t\t\tuniforms.normalScale.value.copy(material.normalScale);\n\t\t\t\tif (material.side === BackSide) uniforms.normalScale.value.negate();\n\t\t\t}\n\n\t\t\tif (material.displacementMap) {\n\t\t\t\tuniforms.displacementMap.value = material.displacementMap;\n\t\t\t\tuniforms.displacementScale.value = material.displacementScale;\n\t\t\t\tuniforms.displacementBias.value = material.displacementBias;\n\t\t\t}\n\t\t}\n\n\t\tfunction refreshUniformsDepth(uniforms, material) {\n\t\t\tif (material.displacementMap) {\n\t\t\t\tuniforms.displacementMap.value = material.displacementMap;\n\t\t\t\tuniforms.displacementScale.value = material.displacementScale;\n\t\t\t\tuniforms.displacementBias.value = material.displacementBias;\n\t\t\t}\n\t\t}\n\n\t\tfunction refreshUniformsDistance(uniforms, material) {\n\t\t\tif (material.displacementMap) {\n\t\t\t\tuniforms.displacementMap.value = material.displacementMap;\n\t\t\t\tuniforms.displacementScale.value = material.displacementScale;\n\t\t\t\tuniforms.displacementBias.value = material.displacementBias;\n\t\t\t}\n\n\t\t\tuniforms.referencePosition.value.copy(material.referencePosition);\n\t\t\tuniforms.nearDistance.value = material.nearDistance;\n\t\t\tuniforms.farDistance.value = material.farDistance;\n\t\t}\n\n\t\tfunction refreshUniformsNormal(uniforms, material) {\n\t\t\tif (material.bumpMap) {\n\t\t\t\tuniforms.bumpMap.value = material.bumpMap;\n\t\t\t\tuniforms.bumpScale.value = material.bumpScale;\n\t\t\t\tif (material.side === BackSide) uniforms.bumpScale.value *= -1;\n\t\t\t}\n\n\t\t\tif (material.normalMap) {\n\t\t\t\tuniforms.normalMap.value = material.normalMap;\n\t\t\t\tuniforms.normalScale.value.copy(material.normalScale);\n\t\t\t\tif (material.side === BackSide) uniforms.normalScale.value.negate();\n\t\t\t}\n\n\t\t\tif (material.displacementMap) {\n\t\t\t\tuniforms.displacementMap.value = material.displacementMap;\n\t\t\t\tuniforms.displacementScale.value = material.displacementScale;\n\t\t\t\tuniforms.displacementBias.value = material.displacementBias;\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\trefreshFogUniforms: refreshFogUniforms,\n\t\t\trefreshMaterialUniforms: refreshMaterialUniforms\n\t\t};\n\t}\n\n\tfunction createCanvasElement() {\n\t\tconst canvas = createElementNS('canvas');\n\t\tcanvas.style.display = 'block';\n\t\treturn canvas;\n\t}\n\n\tfunction WebGLRenderer(parameters = {}) {\n\t\tconst _canvas = parameters.canvas !== undefined ? parameters.canvas : createCanvasElement(),\n\t\t\t\t\t_context = parameters.context !== undefined ? parameters.context : null,\n\t\t\t\t\t_alpha = parameters.alpha !== undefined ? parameters.alpha : false,\n\t\t\t\t\t_depth = parameters.depth !== undefined ? parameters.depth : true,\n\t\t\t\t\t_stencil = parameters.stencil !== undefined ? parameters.stencil : true,\n\t\t\t\t\t_antialias = parameters.antialias !== undefined ? parameters.antialias : false,\n\t\t\t\t\t_premultipliedAlpha = parameters.premultipliedAlpha !== undefined ? parameters.premultipliedAlpha : true,\n\t\t\t\t\t_preserveDrawingBuffer = parameters.preserveDrawingBuffer !== undefined ? parameters.preserveDrawingBuffer : false,\n\t\t\t\t\t_powerPreference = parameters.powerPreference !== undefined ? parameters.powerPreference : 'default',\n\t\t\t\t\t_failIfMajorPerformanceCaveat = parameters.failIfMajorPerformanceCaveat !== undefined ? parameters.failIfMajorPerformanceCaveat : false;\n\n\t\tlet currentRenderList = null;\n\t\tlet currentRenderState = null; // render() can be called from within a callback triggered by another render.\n\t\t// We track this so that the nested render call gets its list and state isolated from the parent render call.\n\n\t\tconst renderListStack = [];\n\t\tconst renderStateStack = []; // public properties\n\n\t\tthis.domElement = _canvas; // Debug configuration container\n\n\t\tthis.debug = {\n\t\t\t/**\n\t\t\t * Enables error checking and reporting when shader programs are being compiled\n\t\t\t * @type {boolean}\n\t\t\t */\n\t\t\tcheckShaderErrors: true\n\t\t}; // clearing\n\n\t\tthis.autoClear = true;\n\t\tthis.autoClearColor = true;\n\t\tthis.autoClearDepth = true;\n\t\tthis.autoClearStencil = true; // scene graph\n\n\t\tthis.sortObjects = true; // user-defined clipping\n\n\t\tthis.clippingPlanes = [];\n\t\tthis.localClippingEnabled = false; // physically based shading\n\n\t\tthis.gammaFactor = 2.0; // for backwards compatibility\n\n\t\tthis.outputEncoding = LinearEncoding; // physical lights\n\n\t\tthis.physicallyCorrectLights = false; // tone mapping\n\n\t\tthis.toneMapping = NoToneMapping;\n\t\tthis.toneMappingExposure = 1.0; // internal properties\n\n\t\tconst _this = this;\n\n\t\tlet _isContextLost = false; // internal state cache\n\n\t\tlet _currentActiveCubeFace = 0;\n\t\tlet _currentActiveMipmapLevel = 0;\n\t\tlet _currentRenderTarget = null;\n\n\t\tlet _currentMaterialId = -1;\n\n\t\tlet _currentCamera = null;\n\n\t\tconst _currentViewport = new Vector4();\n\n\t\tconst _currentScissor = new Vector4();\n\n\t\tlet _currentScissorTest = null; //\n\n\t\tlet _width = _canvas.width;\n\t\tlet _height = _canvas.height;\n\t\tlet _pixelRatio = 1;\n\t\tlet _opaqueSort = null;\n\t\tlet _transparentSort = null;\n\n\t\tconst _viewport = new Vector4(0, 0, _width, _height);\n\n\t\tconst _scissor = new Vector4(0, 0, _width, _height);\n\n\t\tlet _scissorTest = false; //\n\n\t\tconst _currentDrawBuffers = []; // frustum\n\n\t\tconst _frustum = new Frustum(); // clipping\n\n\n\t\tlet _clippingEnabled = false;\n\t\tlet _localClippingEnabled = false; // transmission\n\n\t\tlet _transmissionRenderTarget = null; // camera matrices cache\n\n\t\tconst _projScreenMatrix = new Matrix4();\n\n\t\tconst _vector3 = new Vector3();\n\n\t\tconst _emptyScene = {\n\t\t\tbackground: null,\n\t\t\tfog: null,\n\t\t\tenvironment: null,\n\t\t\toverrideMaterial: null,\n\t\t\tisScene: true\n\t\t};\n\n\t\tfunction getTargetPixelRatio() {\n\t\t\treturn _currentRenderTarget === null ? _pixelRatio : 1;\n\t\t} // initialize\n\n\n\t\tlet _gl = _context;\n\n\t\tfunction getContext(contextNames, contextAttributes) {\n\t\t\tfor (let i = 0; i < contextNames.length; i++) {\n\t\t\t\tconst contextName = contextNames[i];\n\n\t\t\t\tconst context = _canvas.getContext(contextName, contextAttributes);\n\n\t\t\t\tif (context !== null) return context;\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\ttry {\n\t\t\tconst contextAttributes = {\n\t\t\t\talpha: _alpha,\n\t\t\t\tdepth: _depth,\n\t\t\t\tstencil: _stencil,\n\t\t\t\tantialias: _antialias,\n\t\t\t\tpremultipliedAlpha: _premultipliedAlpha,\n\t\t\t\tpreserveDrawingBuffer: _preserveDrawingBuffer,\n\t\t\t\tpowerPreference: _powerPreference,\n\t\t\t\tfailIfMajorPerformanceCaveat: _failIfMajorPerformanceCaveat\n\t\t\t}; // event listeners must be registered before WebGL context is created, see #12753\n\n\t\t\t_canvas.addEventListener('webglcontextlost', onContextLost, false);\n\n\t\t\t_canvas.addEventListener('webglcontextrestored', onContextRestore, false);\n\n\t\t\tif (_gl === null) {\n\t\t\t\tconst contextNames = ['webgl2', 'webgl', 'experimental-webgl'];\n\n\t\t\t\tif (_this.isWebGL1Renderer === true) {\n\t\t\t\t\tcontextNames.shift();\n\t\t\t\t}\n\n\t\t\t\t_gl = getContext(contextNames, contextAttributes);\n\n\t\t\t\tif (_gl === null) {\n\t\t\t\t\tif (getContext(contextNames)) {\n\t\t\t\t\t\tthrow new Error('Error creating WebGL context with your selected attributes.');\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new Error('Error creating WebGL context.');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} // Some experimental-webgl implementations do not have getShaderPrecisionFormat\n\n\n\t\t\tif (_gl.getShaderPrecisionFormat === undefined) {\n\t\t\t\t_gl.getShaderPrecisionFormat = function () {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t'rangeMin': 1,\n\t\t\t\t\t\t'rangeMax': 1,\n\t\t\t\t\t\t'precision': 1\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tconsole.error('THREE.WebGLRenderer: ' + error.message);\n\t\t\tthrow error;\n\t\t}\n\n\t\tlet extensions, capabilities, state, info;\n\t\tlet properties, textures, cubemaps, cubeuvmaps, attributes, geometries, objects;\n\t\tlet programCache, materials, renderLists, renderStates, clipping, shadowMap;\n\t\tlet background, morphtargets, bufferRenderer, indexedBufferRenderer;\n\t\tlet utils, bindingStates;\n\n\t\tfunction initGLContext() {\n\t\t\textensions = new WebGLExtensions(_gl);\n\t\t\tcapabilities = new WebGLCapabilities(_gl, extensions, parameters);\n\t\t\textensions.init(capabilities);\n\t\t\tutils = new WebGLUtils(_gl, extensions, capabilities);\n\t\t\tstate = new WebGLState(_gl, extensions, capabilities);\n\t\t\t_currentDrawBuffers[0] = _gl.BACK;\n\t\t\tinfo = new WebGLInfo(_gl);\n\t\t\tproperties = new WebGLProperties();\n\t\t\ttextures = new WebGLTextures(_gl, extensions, state, properties, capabilities, utils, info);\n\t\t\tcubemaps = new WebGLCubeMaps(_this);\n\t\t\tcubeuvmaps = new WebGLCubeUVMaps(_this);\n\t\t\tattributes = new WebGLAttributes(_gl, capabilities);\n\t\t\tbindingStates = new WebGLBindingStates(_gl, extensions, attributes, capabilities);\n\t\t\tgeometries = new WebGLGeometries(_gl, attributes, info, bindingStates);\n\t\t\tobjects = new WebGLObjects(_gl, geometries, attributes, info);\n\t\t\tmorphtargets = new WebGLMorphtargets(_gl, capabilities, textures);\n\t\t\tclipping = new WebGLClipping(properties);\n\t\t\tprogramCache = new WebGLPrograms(_this, cubemaps, cubeuvmaps, extensions, capabilities, bindingStates, clipping);\n\t\t\tmaterials = new WebGLMaterials(properties);\n\t\t\trenderLists = new WebGLRenderLists(properties);\n\t\t\trenderStates = new WebGLRenderStates(extensions, capabilities);\n\t\t\tbackground = new WebGLBackground(_this, cubemaps, state, objects, _premultipliedAlpha);\n\t\t\tshadowMap = new WebGLShadowMap(_this, objects, capabilities);\n\t\t\tbufferRenderer = new WebGLBufferRenderer(_gl, extensions, info, capabilities);\n\t\t\tindexedBufferRenderer = new WebGLIndexedBufferRenderer(_gl, extensions, info, capabilities);\n\t\t\tinfo.programs = programCache.programs;\n\t\t\t_this.capabilities = capabilities;\n\t\t\t_this.extensions = extensions;\n\t\t\t_this.properties = properties;\n\t\t\t_this.renderLists = renderLists;\n\t\t\t_this.shadowMap = shadowMap;\n\t\t\t_this.state = state;\n\t\t\t_this.info = info;\n\t\t}\n\n\t\tinitGLContext();\n\t\tconst xr = typeof navigator !== 'undefined' && 'xr' in navigator ? new WebXRManager(_this, _gl) : new WebVRManager(_this);\n\t\tthis.xr = xr; // API\n\n\t\tthis.getContext = function () {\n\t\t\treturn _gl;\n\t\t};\n\n\t\tthis.getContextAttributes = function () {\n\t\t\treturn _gl.getContextAttributes();\n\t\t};\n\n\t\tthis.forceContextLoss = function () {\n\t\t\tconst extension = extensions.get('WEBGL_lose_context');\n\t\t\tif (extension) extension.loseContext();\n\t\t};\n\n\t\tthis.forceContextRestore = function () {\n\t\t\tconst extension = extensions.get('WEBGL_lose_context');\n\t\t\tif (extension) extension.restoreContext();\n\t\t};\n\n\t\tthis.getPixelRatio = function () {\n\t\t\treturn _pixelRatio;\n\t\t};\n\n\t\tthis.setPixelRatio = function (value) {\n\t\t\tif (value === undefined) return;\n\t\t\t_pixelRatio = value;\n\t\t\tthis.setSize(_width, _height, false);\n\t\t};\n\n\t\tthis.getSize = function (target) {\n\t\t\treturn target.set(_width, _height);\n\t\t};\n\n\t\tthis.setSize = function (width, height, updateStyle) {\n\t\t\tif (xr.isPresenting) {\n\t\t\t\tconsole.warn('THREE.WebGLRenderer: Can\\'t change size while VR device is presenting.');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t_width = width;\n\t\t\t_height = height;\n\t\t\t_canvas.width = Math.floor(width * _pixelRatio);\n\t\t\t_canvas.height = Math.floor(height * _pixelRatio);\n\n\t\t\tif (updateStyle !== false) {\n\t\t\t\t_canvas.style.width = width + 'px';\n\t\t\t\t_canvas.style.height = height + 'px';\n\t\t\t}\n\n\t\t\tthis.setViewport(0, 0, width, height);\n\t\t};\n\n\t\tthis.getDrawingBufferSize = function (target) {\n\t\t\treturn target.set(_width * _pixelRatio, _height * _pixelRatio).floor();\n\t\t};\n\n\t\tthis.setDrawingBufferSize = function (width, height, pixelRatio) {\n\t\t\t_width = width;\n\t\t\t_height = height;\n\t\t\t_pixelRatio = pixelRatio;\n\t\t\t_canvas.width = Math.floor(width * pixelRatio);\n\t\t\t_canvas.height = Math.floor(height * pixelRatio);\n\t\t\tthis.setViewport(0, 0, width, height);\n\t\t};\n\n\t\tthis.getCurrentViewport = function (target) {\n\t\t\treturn target.copy(_currentViewport);\n\t\t};\n\n\t\tthis.getViewport = function (target) {\n\t\t\treturn target.copy(_viewport);\n\t\t};\n\n\t\tthis.setViewport = function (x, y, width, height) {\n\t\t\tif (x.isVector4) {\n\t\t\t\t_viewport.set(x.x, x.y, x.z, x.w);\n\t\t\t} else {\n\t\t\t\t_viewport.set(x, y, width, height);\n\t\t\t}\n\n\t\t\tstate.viewport(_currentViewport.copy(_viewport).multiplyScalar(_pixelRatio).floor());\n\t\t};\n\n\t\tthis.getScissor = function (target) {\n\t\t\treturn target.copy(_scissor);\n\t\t};\n\n\t\tthis.setScissor = function (x, y, width, height) {\n\t\t\tif (x.isVector4) {\n\t\t\t\t_scissor.set(x.x, x.y, x.z, x.w);\n\t\t\t} else {\n\t\t\t\t_scissor.set(x, y, width, height);\n\t\t\t}\n\n\t\t\tstate.scissor(_currentScissor.copy(_scissor).multiplyScalar(_pixelRatio).floor());\n\t\t};\n\n\t\tthis.getScissorTest = function () {\n\t\t\treturn _scissorTest;\n\t\t};\n\n\t\tthis.setScissorTest = function (boolean) {\n\t\t\tstate.setScissorTest(_scissorTest = boolean);\n\t\t};\n\n\t\tthis.setOpaqueSort = function (method) {\n\t\t\t_opaqueSort = method;\n\t\t};\n\n\t\tthis.setTransparentSort = function (method) {\n\t\t\t_transparentSort = method;\n\t\t}; // Clearing\n\n\n\t\tthis.getClearColor = function (target) {\n\t\t\treturn target.copy(background.getClearColor());\n\t\t};\n\n\t\tthis.setClearColor = function () {\n\t\t\tbackground.setClearColor.apply(background, arguments);\n\t\t};\n\n\t\tthis.getClearAlpha = function () {\n\t\t\treturn background.getClearAlpha();\n\t\t};\n\n\t\tthis.setClearAlpha = function () {\n\t\t\tbackground.setClearAlpha.apply(background, arguments);\n\t\t};\n\n\t\tthis.clear = function (color, depth, stencil) {\n\t\t\tlet bits = 0;\n\t\t\tif (color === undefined || color) bits |= _gl.COLOR_BUFFER_BIT;\n\t\t\tif (depth === undefined || depth) bits |= _gl.DEPTH_BUFFER_BIT;\n\t\t\tif (stencil === undefined || stencil) bits |= _gl.STENCIL_BUFFER_BIT;\n\n\t\t\t_gl.clear(bits);\n\t\t};\n\n\t\tthis.clearColor = function () {\n\t\t\tthis.clear(true, false, false);\n\t\t};\n\n\t\tthis.clearDepth = function () {\n\t\t\tthis.clear(false, true, false);\n\t\t};\n\n\t\tthis.clearStencil = function () {\n\t\t\tthis.clear(false, false, true);\n\t\t}; //\n\n\n\t\tthis.dispose = function () {\n\t\t\t_canvas.removeEventListener('webglcontextlost', onContextLost, false);\n\n\t\t\t_canvas.removeEventListener('webglcontextrestored', onContextRestore, false);\n\n\t\t\trenderLists.dispose();\n\t\t\trenderStates.dispose();\n\t\t\tproperties.dispose();\n\t\t\tcubemaps.dispose();\n\t\t\tcubeuvmaps.dispose();\n\t\t\tobjects.dispose();\n\t\t\tbindingStates.dispose();\n\t\t\txr.dispose();\n\t\t\txr.removeEventListener('sessionstart', onXRSessionStart);\n\t\t\txr.removeEventListener('sessionend', onXRSessionEnd);\n\n\t\t\tif (_transmissionRenderTarget) {\n\t\t\t\t_transmissionRenderTarget.dispose();\n\n\t\t\t\t_transmissionRenderTarget = null;\n\t\t\t}\n\n\t\t\tanimation.stop();\n\t\t}; // Events\n\n\n\t\tfunction onContextLost(event) {\n\t\t\tevent.preventDefault();\n\t\t\tconsole.log('THREE.WebGLRenderer: Context Lost.');\n\t\t\t_isContextLost = true;\n\t\t}\n\n\t\tfunction onContextRestore() {\n\t\t\tconsole.log('THREE.WebGLRenderer: Context Restored.');\n\t\t\t_isContextLost = false;\n\t\t\tconst infoAutoReset = info.autoReset;\n\t\t\tconst shadowMapEnabled = shadowMap.enabled;\n\t\t\tconst shadowMapAutoUpdate = shadowMap.autoUpdate;\n\t\t\tconst shadowMapNeedsUpdate = shadowMap.needsUpdate;\n\t\t\tconst shadowMapType = shadowMap.type;\n\t\t\tinitGLContext();\n\t\t\tinfo.autoReset = infoAutoReset;\n\t\t\tshadowMap.enabled = shadowMapEnabled;\n\t\t\tshadowMap.autoUpdate = shadowMapAutoUpdate;\n\t\t\tshadowMap.needsUpdate = shadowMapNeedsUpdate;\n\t\t\tshadowMap.type = shadowMapType;\n\t\t}\n\n\t\tfunction onMaterialDispose(event) {\n\t\t\tconst material = event.target;\n\t\t\tmaterial.removeEventListener('dispose', onMaterialDispose);\n\t\t\tdeallocateMaterial(material);\n\t\t} // Buffer deallocation\n\n\n\t\tfunction deallocateMaterial(material) {\n\t\t\treleaseMaterialProgramReferences(material);\n\t\t\tproperties.remove(material);\n\t\t}\n\n\t\tfunction releaseMaterialProgramReferences(material) {\n\t\t\tconst programs = properties.get(material).programs;\n\n\t\t\tif (programs !== undefined) {\n\t\t\t\tprograms.forEach(function (program) {\n\t\t\t\t\tprogramCache.releaseProgram(program);\n\t\t\t\t});\n\t\t\t}\n\t\t} // Buffer rendering\n\n\n\t\tfunction renderObjectImmediate(object, program) {\n\t\t\tobject.render(function (object) {\n\t\t\t\t_this.renderBufferImmediate(object, program);\n\t\t\t});\n\t\t}\n\n\t\tthis.renderBufferImmediate = function (object, program) {\n\t\t\tbindingStates.initAttributes();\n\t\t\tconst buffers = properties.get(object);\n\t\t\tif (object.hasPositions && !buffers.position) buffers.position = _gl.createBuffer();\n\t\t\tif (object.hasNormals && !buffers.normal) buffers.normal = _gl.createBuffer();\n\t\t\tif (object.hasUvs && !buffers.uv) buffers.uv = _gl.createBuffer();\n\t\t\tif (object.hasColors && !buffers.color) buffers.color = _gl.createBuffer();\n\t\t\tconst programAttributes = program.getAttributes();\n\n\t\t\tif (object.hasPositions) {\n\t\t\t\t_gl.bindBuffer(_gl.ARRAY_BUFFER, buffers.position);\n\n\t\t\t\t_gl.bufferData(_gl.ARRAY_BUFFER, object.positionArray, _gl.DYNAMIC_DRAW);\n\n\t\t\t\tbindingStates.enableAttribute(programAttributes.position.location);\n\n\t\t\t\t_gl.vertexAttribPointer(programAttributes.position.location, 3, _gl.FLOAT, false, 0, 0);\n\t\t\t}\n\n\t\t\tif (object.hasNormals) {\n\t\t\t\t_gl.bindBuffer(_gl.ARRAY_BUFFER, buffers.normal);\n\n\t\t\t\t_gl.bufferData(_gl.ARRAY_BUFFER, object.normalArray, _gl.DYNAMIC_DRAW);\n\n\t\t\t\tbindingStates.enableAttribute(programAttributes.normal.location);\n\n\t\t\t\t_gl.vertexAttribPointer(programAttributes.normal.location, 3, _gl.FLOAT, false, 0, 0);\n\t\t\t}\n\n\t\t\tif (object.hasUvs) {\n\t\t\t\t_gl.bindBuffer(_gl.ARRAY_BUFFER, buffers.uv);\n\n\t\t\t\t_gl.bufferData(_gl.ARRAY_BUFFER, object.uvArray, _gl.DYNAMIC_DRAW);\n\n\t\t\t\tbindingStates.enableAttribute(programAttributes.uv.location);\n\n\t\t\t\t_gl.vertexAttribPointer(programAttributes.uv.location, 2, _gl.FLOAT, false, 0, 0);\n\t\t\t}\n\n\t\t\tif (object.hasColors) {\n\t\t\t\t_gl.bindBuffer(_gl.ARRAY_BUFFER, buffers.color);\n\n\t\t\t\t_gl.bufferData(_gl.ARRAY_BUFFER, object.colorArray, _gl.DYNAMIC_DRAW);\n\n\t\t\t\tbindingStates.enableAttribute(programAttributes.color.location);\n\n\t\t\t\t_gl.vertexAttribPointer(programAttributes.color.location, 3, _gl.FLOAT, false, 0, 0);\n\t\t\t}\n\n\t\t\tbindingStates.disableUnusedAttributes();\n\n\t\t\t_gl.drawArrays(_gl.TRIANGLES, 0, object.count);\n\n\t\t\tobject.count = 0;\n\t\t};\n\n\t\tthis.renderBufferDirect = function (camera, scene, geometry, material, object, group) {\n\t\t\tif (scene === null) scene = _emptyScene; // renderBufferDirect second parameter used to be fog (could be null)\n\n\t\t\tconst frontFaceCW = object.isMesh && object.matrixWorld.determinant() < 0;\n\t\t\tconst program = setProgram(camera, scene, geometry, material, object);\n\t\t\tstate.setMaterial(material, frontFaceCW); //\n\n\t\t\tlet index = geometry.index;\n\t\t\tconst position = geometry.attributes.position; //\n\n\t\t\tif (index === null) {\n\t\t\t\tif (position === undefined || position.count === 0) return;\n\t\t\t} else if (index.count === 0) {\n\t\t\t\treturn;\n\t\t\t} //\n\n\n\t\t\tlet rangeFactor = 1;\n\n\t\t\tif (material.wireframe === true) {\n\t\t\t\tindex = geometries.getWireframeAttribute(geometry);\n\t\t\t\trangeFactor = 2;\n\t\t\t}\n\n\t\t\tbindingStates.setup(object, material, program, geometry, index);\n\t\t\tlet attribute;\n\t\t\tlet renderer = bufferRenderer;\n\n\t\t\tif (index !== null) {\n\t\t\t\tattribute = attributes.get(index);\n\t\t\t\trenderer = indexedBufferRenderer;\n\t\t\t\trenderer.setIndex(attribute);\n\t\t\t} //\n\n\n\t\t\tconst dataCount = index !== null ? index.count : position.count;\n\t\t\tconst rangeStart = geometry.drawRange.start * rangeFactor;\n\t\t\tconst rangeCount = geometry.drawRange.count * rangeFactor;\n\t\t\tconst groupStart = group !== null ? group.start * rangeFactor : 0;\n\t\t\tconst groupCount = group !== null ? group.count * rangeFactor : Infinity;\n\t\t\tconst drawStart = Math.max(rangeStart, groupStart);\n\t\t\tconst drawEnd = Math.min(dataCount, rangeStart + rangeCount, groupStart + groupCount) - 1;\n\t\t\tconst drawCount = Math.max(0, drawEnd - drawStart + 1);\n\t\t\tif (drawCount === 0) return; //\n\n\t\t\tif (object.isMesh) {\n\t\t\t\tif (material.wireframe === true) {\n\t\t\t\t\tstate.setLineWidth(material.wireframeLinewidth * getTargetPixelRatio());\n\t\t\t\t\trenderer.setMode(_gl.LINES);\n\t\t\t\t} else {\n\t\t\t\t\trenderer.setMode(_gl.TRIANGLES);\n\t\t\t\t}\n\t\t\t} else if (object.isLine) {\n\t\t\t\tlet lineWidth = material.linewidth;\n\t\t\t\tif (lineWidth === undefined) lineWidth = 1; // Not using Line*Material\n\n\t\t\t\tstate.setLineWidth(lineWidth * getTargetPixelRatio());\n\n\t\t\t\tif (object.isLineSegments) {\n\t\t\t\t\trenderer.setMode(_gl.LINES);\n\t\t\t\t} else if (object.isLineLoop) {\n\t\t\t\t\trenderer.setMode(_gl.LINE_LOOP);\n\t\t\t\t} else {\n\t\t\t\t\trenderer.setMode(_gl.LINE_STRIP);\n\t\t\t\t}\n\t\t\t} else if (object.isPoints) {\n\t\t\t\trenderer.setMode(_gl.POINTS);\n\t\t\t} else if (object.isSprite) {\n\t\t\t\trenderer.setMode(_gl.TRIANGLES);\n\t\t\t}\n\n\t\t\tif (object.isInstancedMesh) {\n\t\t\t\trenderer.renderInstances(drawStart, drawCount, object.count);\n\t\t\t} else if (geometry.isInstancedBufferGeometry) {\n\t\t\t\tconst instanceCount = Math.min(geometry.instanceCount, geometry._maxInstanceCount);\n\t\t\t\trenderer.renderInstances(drawStart, drawCount, instanceCount);\n\t\t\t} else {\n\t\t\t\trenderer.render(drawStart, drawCount);\n\t\t\t}\n\t\t}; // Compile\n\n\n\t\tthis.compile = function (scene, camera) {\n\t\t\tcurrentRenderState = renderStates.get(scene);\n\t\t\tcurrentRenderState.init();\n\t\t\trenderStateStack.push(currentRenderState);\n\t\t\tscene.traverseVisible(function (object) {\n\t\t\t\tif (object.isLight && object.layers.test(camera.layers)) {\n\t\t\t\t\tcurrentRenderState.pushLight(object);\n\n\t\t\t\t\tif (object.castShadow) {\n\t\t\t\t\t\tcurrentRenderState.pushShadow(object);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\tcurrentRenderState.setupLights(_this.physicallyCorrectLights);\n\t\t\tscene.traverse(function (object) {\n\t\t\t\tconst material = object.material;\n\n\t\t\t\tif (material) {\n\t\t\t\t\tif (Array.isArray(material)) {\n\t\t\t\t\t\tfor (let i = 0; i < material.length; i++) {\n\t\t\t\t\t\t\tconst material2 = material[i];\n\t\t\t\t\t\t\tgetProgram(material2, scene, object);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tgetProgram(material, scene, object);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\trenderStateStack.pop();\n\t\t\tcurrentRenderState = null;\n\t\t}; // Animation Loop\n\n\n\t\tlet onAnimationFrameCallback = null;\n\n\t\tfunction onAnimationFrame(time) {\n\t\t\tif (onAnimationFrameCallback) onAnimationFrameCallback(time);\n\t\t}\n\n\t\tfunction onXRSessionStart() {\n\t\t\tanimation.stop();\n\t\t}\n\n\t\tfunction onXRSessionEnd() {\n\t\t\tanimation.start();\n\t\t}\n\n\t\tconst animation = new WebGLAnimation();\n\t\tanimation.setAnimationLoop(onAnimationFrame);\n\t\tif (typeof window !== 'undefined') animation.setContext(window);\n\n\t\tthis.setAnimationLoop = function (callback) {\n\t\t\tonAnimationFrameCallback = callback;\n\t\t\txr.setAnimationLoop(callback);\n\t\t\tcallback === null ? animation.stop() : animation.start();\n\t\t};\n\n\t\txr.addEventListener('sessionstart', onXRSessionStart);\n\t\txr.addEventListener('sessionend', onXRSessionEnd); // Rendering\n\n\t\tthis.render = function (scene, camera) {\n\t\t\tif (camera !== undefined && camera.isCamera !== true) {\n\t\t\t\tconsole.error('THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (_isContextLost === true) return; // update scene graph\n\n\t\t\tif (scene.autoUpdate === true) scene.updateMatrixWorld(); // update camera matrices and frustum\n\n\t\t\tif (camera.parent === null) camera.updateMatrixWorld();\n\n\t\t\tif (xr.enabled === true && xr.isPresenting === true) {\n\t\t\t\tif (xr.cameraAutoUpdate === true) xr.updateCamera(camera);\n\t\t\t\tcamera = xr.getCamera(); // use XR camera for rendering\n\t\t\t} //\n\n\n\t\t\tif (scene.isScene === true) scene.onBeforeRender(_this, scene, camera, _currentRenderTarget);\n\t\t\tcurrentRenderState = renderStates.get(scene, renderStateStack.length);\n\t\t\tcurrentRenderState.init();\n\t\t\trenderStateStack.push(currentRenderState);\n\n\t\t\t_projScreenMatrix.multiplyMatrices(camera.projectionMatrix, camera.matrixWorldInverse);\n\n\t\t\t_frustum.setFromProjectionMatrix(_projScreenMatrix);\n\n\t\t\t_localClippingEnabled = this.localClippingEnabled;\n\t\t\t_clippingEnabled = clipping.init(this.clippingPlanes, _localClippingEnabled, camera);\n\t\t\tcurrentRenderList = renderLists.get(scene, renderListStack.length);\n\t\t\tcurrentRenderList.init();\n\t\t\trenderListStack.push(currentRenderList);\n\t\t\tprojectObject(scene, camera, 0, _this.sortObjects);\n\t\t\tcurrentRenderList.finish();\n\n\t\t\tif (_this.sortObjects === true) {\n\t\t\t\tcurrentRenderList.sort(_opaqueSort, _transparentSort);\n\t\t\t} //\n\n\n\t\t\tif (_clippingEnabled === true) clipping.beginShadows();\n\t\t\tconst shadowsArray = currentRenderState.state.shadowsArray;\n\t\t\tshadowMap.render(shadowsArray, scene, camera);\n\t\t\tif (_clippingEnabled === true) clipping.endShadows(); //\n\n\t\t\tif (this.info.autoReset === true) this.info.reset(); //\n\n\t\t\tbackground.render(currentRenderList, scene); // render scene\n\n\t\t\tcurrentRenderState.setupLights(_this.physicallyCorrectLights);\n\n\t\t\tif (camera.isArrayCamera) {\n\t\t\t\tconst cameras = camera.cameras;\n\n\t\t\t\tfor (let i = 0, l = cameras.length; i < l; i++) {\n\t\t\t\t\tconst camera2 = cameras[i];\n\t\t\t\t\trenderScene(currentRenderList, scene, camera2, camera2.viewport);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\trenderScene(currentRenderList, scene, camera);\n\t\t\t} //\n\n\n\t\t\tif (_currentRenderTarget !== null) {\n\t\t\t\t// resolve multisample renderbuffers to a single-sample texture if necessary\n\t\t\t\ttextures.updateMultisampleRenderTarget(_currentRenderTarget); // Generate mipmap if we're using any kind of mipmap filtering\n\n\t\t\t\ttextures.updateRenderTargetMipmap(_currentRenderTarget);\n\t\t\t} //\n\n\n\t\t\tif (scene.isScene === true) scene.onAfterRender(_this, scene, camera); // Ensure depth buffer writing is enabled so it can be cleared on next render\n\n\t\t\tstate.buffers.depth.setTest(true);\n\t\t\tstate.buffers.depth.setMask(true);\n\t\t\tstate.buffers.color.setMask(true);\n\t\t\tstate.setPolygonOffset(false);\n\n\t\t\tif (xr.enabled && xr.submitFrame) {\n\t\t\t\txr.submitFrame();\n\t\t\t} // _gl.finish();\n\n\n\t\t\tbindingStates.resetDefaultState();\n\t\t\t_currentMaterialId = -1;\n\t\t\t_currentCamera = null;\n\t\t\trenderStateStack.pop();\n\n\t\t\tif (renderStateStack.length > 0) {\n\t\t\t\tcurrentRenderState = renderStateStack[renderStateStack.length - 1];\n\t\t\t} else {\n\t\t\t\tcurrentRenderState = null;\n\t\t\t}\n\n\t\t\trenderListStack.pop();\n\n\t\t\tif (renderListStack.length > 0) {\n\t\t\t\tcurrentRenderList = renderListStack[renderListStack.length - 1];\n\t\t\t} else {\n\t\t\t\tcurrentRenderList = null;\n\t\t\t}\n\t\t};\n\n\t\tfunction projectObject(object, camera, groupOrder, sortObjects) {\n\t\t\tif (object.visible === false) return;\n\t\t\tconst visible = object.layers.test(camera.layers);\n\n\t\t\tif (visible) {\n\t\t\t\tif (object.isGroup) {\n\t\t\t\t\tgroupOrder = object.renderOrder;\n\t\t\t\t} else if (object.isLOD) {\n\t\t\t\t\tif (object.autoUpdate === true) object.update(camera);\n\t\t\t\t} else if (object.isLight) {\n\t\t\t\t\tcurrentRenderState.pushLight(object);\n\n\t\t\t\t\tif (object.castShadow) {\n\t\t\t\t\t\tcurrentRenderState.pushShadow(object);\n\t\t\t\t\t}\n\t\t\t\t} else if (object.isSprite) {\n\t\t\t\t\tif (!object.frustumCulled || _frustum.intersectsSprite(object)) {\n\t\t\t\t\t\tif (sortObjects) {\n\t\t\t\t\t\t\t_vector3.setFromMatrixPosition(object.matrixWorld).applyMatrix4(_projScreenMatrix);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst geometry = objects.update(object);\n\t\t\t\t\t\tconst material = object.material;\n\n\t\t\t\t\t\tif (material.visible) {\n\t\t\t\t\t\t\tcurrentRenderList.push(object, geometry, material, groupOrder, _vector3.z, null);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (object.isImmediateRenderObject) {\n\t\t\t\t\tif (sortObjects) {\n\t\t\t\t\t\t_vector3.setFromMatrixPosition(object.matrixWorld).applyMatrix4(_projScreenMatrix);\n\t\t\t\t\t}\n\n\t\t\t\t\tcurrentRenderList.push(object, null, object.material, groupOrder, _vector3.z, null);\n\t\t\t\t} else if (object.isMesh || object.isLine || object.isPoints) {\n\t\t\t\t\tif (object.isSkinnedMesh) {\n\t\t\t\t\t\t// update skeleton only once in a frame\n\t\t\t\t\t\tif (object.skeleton.frame !== info.render.frame) {\n\t\t\t\t\t\t\tobject.skeleton.update();\n\t\t\t\t\t\t\tobject.skeleton.frame = info.render.frame;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!object.frustumCulled || _frustum.intersectsObject(object)) {\n\t\t\t\t\t\tif (sortObjects) {\n\t\t\t\t\t\t\t_vector3.setFromMatrixPosition(object.matrixWorld).applyMatrix4(_projScreenMatrix);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst geometry = objects.update(object);\n\t\t\t\t\t\tconst material = object.material;\n\n\t\t\t\t\t\tif (Array.isArray(material)) {\n\t\t\t\t\t\t\tconst groups = geometry.groups;\n\n\t\t\t\t\t\t\tfor (let i = 0, l = groups.length; i < l; i++) {\n\t\t\t\t\t\t\t\tconst group = groups[i];\n\t\t\t\t\t\t\t\tconst groupMaterial = material[group.materialIndex];\n\n\t\t\t\t\t\t\t\tif (groupMaterial && groupMaterial.visible) {\n\t\t\t\t\t\t\t\t\tcurrentRenderList.push(object, geometry, groupMaterial, groupOrder, _vector3.z, group);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (material.visible) {\n\t\t\t\t\t\t\tcurrentRenderList.push(object, geometry, material, groupOrder, _vector3.z, null);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst children = object.children;\n\n\t\t\tfor (let i = 0, l = children.length; i < l; i++) {\n\t\t\t\tprojectObject(children[i], camera, groupOrder, sortObjects);\n\t\t\t}\n\t\t}\n\n\t\tfunction renderScene(currentRenderList, scene, camera, viewport) {\n\t\t\tconst opaqueObjects = currentRenderList.opaque;\n\t\t\tconst transmissiveObjects = currentRenderList.transmissive;\n\t\t\tconst transparentObjects = currentRenderList.transparent;\n\t\t\tcurrentRenderState.setupLightsView(camera);\n\t\t\tif (transmissiveObjects.length > 0) renderTransmissionPass(opaqueObjects, scene, camera);\n\t\t\tif (viewport) state.viewport(_currentViewport.copy(viewport));\n\t\t\tif (opaqueObjects.length > 0) renderObjects(opaqueObjects, scene, camera);\n\t\t\tif (transmissiveObjects.length > 0) renderObjects(transmissiveObjects, scene, camera);\n\t\t\tif (transparentObjects.length > 0) renderObjects(transparentObjects, scene, camera);\n\t\t}\n\n\t\tfunction renderTransmissionPass(opaqueObjects, scene, camera) {\n\t\t\tif (_transmissionRenderTarget === null) {\n\t\t\t\tconst needsAntialias = _antialias === true && capabilities.isWebGL2 === true;\n\t\t\t\tconst renderTargetType = needsAntialias ? WebGLMultisampleRenderTarget : WebGLRenderTarget;\n\t\t\t\t_transmissionRenderTarget = new renderTargetType(1024, 1024, {\n\t\t\t\t\tgenerateMipmaps: true,\n\t\t\t\t\ttype: utils.convert(HalfFloatType) !== null ? HalfFloatType : UnsignedByteType,\n\t\t\t\t\tminFilter: LinearMipmapLinearFilter,\n\t\t\t\t\tmagFilter: NearestFilter,\n\t\t\t\t\twrapS: ClampToEdgeWrapping,\n\t\t\t\t\twrapT: ClampToEdgeWrapping\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tconst currentRenderTarget = _this.getRenderTarget();\n\n\t\t\t_this.setRenderTarget(_transmissionRenderTarget);\n\n\t\t\t_this.clear(); // Turn off the features which can affect the frag color for opaque objects pass.\n\t\t\t// Otherwise they are applied twice in opaque objects pass and transmission objects pass.\n\n\n\t\t\tconst currentToneMapping = _this.toneMapping;\n\t\t\t_this.toneMapping = NoToneMapping;\n\t\t\trenderObjects(opaqueObjects, scene, camera);\n\t\t\t_this.toneMapping = currentToneMapping;\n\t\t\ttextures.updateMultisampleRenderTarget(_transmissionRenderTarget);\n\t\t\ttextures.updateRenderTargetMipmap(_transmissionRenderTarget);\n\n\t\t\t_this.setRenderTarget(currentRenderTarget);\n\t\t}\n\n\t\tfunction renderObjects(renderList, scene, camera) {\n\t\t\tconst overrideMaterial = scene.isScene === true ? scene.overrideMaterial : null;\n\n\t\t\tfor (let i = 0, l = renderList.length; i < l; i++) {\n\t\t\t\tconst renderItem = renderList[i];\n\t\t\t\tconst object = renderItem.object;\n\t\t\t\tconst geometry = renderItem.geometry;\n\t\t\t\tconst material = overrideMaterial === null ? renderItem.material : overrideMaterial;\n\t\t\t\tconst group = renderItem.group;\n\n\t\t\t\tif (object.layers.test(camera.layers)) {\n\t\t\t\t\trenderObject(object, scene, camera, geometry, material, group);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction renderObject(object, scene, camera, geometry, material, group) {\n\t\t\tobject.onBeforeRender(_this, scene, camera, geometry, material, group);\n\t\t\tobject.modelViewMatrix.multiplyMatrices(camera.matrixWorldInverse, object.matrixWorld);\n\t\t\tobject.normalMatrix.getNormalMatrix(object.modelViewMatrix);\n\t\t\tmaterial.onBeforeRender(_this, scene, camera, geometry, object, group);\n\n\t\t\tif (object.isImmediateRenderObject) {\n\t\t\t\tconst program = setProgram(camera, scene, geometry, material, object);\n\t\t\t\tstate.setMaterial(material);\n\t\t\t\tbindingStates.reset();\n\t\t\t\trenderObjectImmediate(object, program);\n\t\t\t} else {\n\t\t\t\tif (material.transparent === true && material.side === DoubleSide) {\n\t\t\t\t\tmaterial.side = BackSide;\n\t\t\t\t\tmaterial.needsUpdate = true;\n\n\t\t\t\t\t_this.renderBufferDirect(camera, scene, geometry, material, object, group);\n\n\t\t\t\t\tmaterial.side = FrontSide;\n\t\t\t\t\tmaterial.needsUpdate = true;\n\n\t\t\t\t\t_this.renderBufferDirect(camera, scene, geometry, material, object, group);\n\n\t\t\t\t\tmaterial.side = DoubleSide;\n\t\t\t\t} else {\n\t\t\t\t\t_this.renderBufferDirect(camera, scene, geometry, material, object, group);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tobject.onAfterRender(_this, scene, camera, geometry, material, group);\n\t\t}\n\n\t\tfunction getProgram(material, scene, object) {\n\t\t\tif (scene.isScene !== true) scene = _emptyScene; // scene could be a Mesh, Line, Points, ...\n\n\t\t\tconst materialProperties = properties.get(material);\n\t\t\tconst lights = currentRenderState.state.lights;\n\t\t\tconst shadowsArray = currentRenderState.state.shadowsArray;\n\t\t\tconst lightsStateVersion = lights.state.version;\n\t\t\tconst parameters = programCache.getParameters(material, lights.state, shadowsArray, scene, object);\n\t\t\tconst programCacheKey = programCache.getProgramCacheKey(parameters);\n\t\t\tlet programs = materialProperties.programs; // always update environment and fog - changing these trigger an getProgram call, but it's possible that the program doesn't change\n\n\t\t\tmaterialProperties.environment = material.isMeshStandardMaterial ? scene.environment : null;\n\t\t\tmaterialProperties.fog = scene.fog;\n\t\t\tmaterialProperties.envMap = (material.isMeshStandardMaterial ? cubeuvmaps : cubemaps).get(material.envMap || materialProperties.environment);\n\n\t\t\tif (programs === undefined) {\n\t\t\t\t// new material\n\t\t\t\tmaterial.addEventListener('dispose', onMaterialDispose);\n\t\t\t\tprograms = new Map();\n\t\t\t\tmaterialProperties.programs = programs;\n\t\t\t}\n\n\t\t\tlet program = programs.get(programCacheKey);\n\n\t\t\tif (program !== undefined) {\n\t\t\t\t// early out if program and light state is identical\n\t\t\t\tif (materialProperties.currentProgram === program && materialProperties.lightsStateVersion === lightsStateVersion) {\n\t\t\t\t\tupdateCommonMaterialProperties(material, parameters);\n\t\t\t\t\treturn program;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tparameters.uniforms = programCache.getUniforms(material);\n\t\t\t\tmaterial.onBuild(parameters, _this);\n\t\t\t\tmaterial.onBeforeCompile(parameters, _this);\n\t\t\t\tprogram = programCache.acquireProgram(parameters, programCacheKey);\n\t\t\t\tprograms.set(programCacheKey, program);\n\t\t\t\tmaterialProperties.uniforms = parameters.uniforms;\n\t\t\t}\n\n\t\t\tconst uniforms = materialProperties.uniforms;\n\n\t\t\tif (!material.isShaderMaterial && !material.isRawShaderMaterial || material.clipping === true) {\n\t\t\t\tuniforms.clippingPlanes = clipping.uniform;\n\t\t\t}\n\n\t\t\tupdateCommonMaterialProperties(material, parameters); // store the light setup it was created for\n\n\t\t\tmaterialProperties.needsLights = materialNeedsLights(material);\n\t\t\tmaterialProperties.lightsStateVersion = lightsStateVersion;\n\n\t\t\tif (materialProperties.needsLights) {\n\t\t\t\t// wire up the material to this renderer's lighting state\n\t\t\t\tuniforms.ambientLightColor.value = lights.state.ambient;\n\t\t\t\tuniforms.lightProbe.value = lights.state.probe;\n\t\t\t\tuniforms.directionalLights.value = lights.state.directional;\n\t\t\t\tuniforms.directionalLightShadows.value = lights.state.directionalShadow;\n\t\t\t\tuniforms.spotLights.value = lights.state.spot;\n\t\t\t\tuniforms.spotLightShadows.value = lights.state.spotShadow;\n\t\t\t\tuniforms.rectAreaLights.value = lights.state.rectArea;\n\t\t\t\tuniforms.ltc_1.value = lights.state.rectAreaLTC1;\n\t\t\t\tuniforms.ltc_2.value = lights.state.rectAreaLTC2;\n\t\t\t\tuniforms.pointLights.value = lights.state.point;\n\t\t\t\tuniforms.pointLightShadows.value = lights.state.pointShadow;\n\t\t\t\tuniforms.hemisphereLights.value = lights.state.hemi;\n\t\t\t\tuniforms.directionalShadowMap.value = lights.state.directionalShadowMap;\n\t\t\t\tuniforms.directionalShadowMatrix.value = lights.state.directionalShadowMatrix;\n\t\t\t\tuniforms.spotShadowMap.value = lights.state.spotShadowMap;\n\t\t\t\tuniforms.spotShadowMatrix.value = lights.state.spotShadowMatrix;\n\t\t\t\tuniforms.pointShadowMap.value = lights.state.pointShadowMap;\n\t\t\t\tuniforms.pointShadowMatrix.value = lights.state.pointShadowMatrix; // TODO (abelnation): add area lights shadow info to uniforms\n\t\t\t}\n\n\t\t\tconst progUniforms = program.getUniforms();\n\t\t\tconst uniformsList = WebGLUniforms.seqWithValue(progUniforms.seq, uniforms);\n\t\t\tmaterialProperties.currentProgram = program;\n\t\t\tmaterialProperties.uniformsList = uniformsList;\n\t\t\treturn program;\n\t\t}\n\n\t\tfunction updateCommonMaterialProperties(material, parameters) {\n\t\t\tconst materialProperties = properties.get(material);\n\t\t\tmaterialProperties.outputEncoding = parameters.outputEncoding;\n\t\t\tmaterialProperties.instancing = parameters.instancing;\n\t\t\tmaterialProperties.skinning = parameters.skinning;\n\t\t\tmaterialProperties.morphTargets = parameters.morphTargets;\n\t\t\tmaterialProperties.morphNormals = parameters.morphNormals;\n\t\t\tmaterialProperties.morphTargetsCount = parameters.morphTargetsCount;\n\t\t\tmaterialProperties.numClippingPlanes = parameters.numClippingPlanes;\n\t\t\tmaterialProperties.numIntersection = parameters.numClipIntersection;\n\t\t\tmaterialProperties.vertexAlphas = parameters.vertexAlphas;\n\t\t\tmaterialProperties.vertexTangents = parameters.vertexTangents;\n\t\t}\n\n\t\tfunction setProgram(camera, scene, geometry, material, object) {\n\t\t\tif (scene.isScene !== true) scene = _emptyScene; // scene could be a Mesh, Line, Points, ...\n\n\t\t\ttextures.resetTextureUnits();\n\t\t\tconst fog = scene.fog;\n\t\t\tconst environment = material.isMeshStandardMaterial ? scene.environment : null;\n\t\t\tconst encoding = _currentRenderTarget === null ? _this.outputEncoding : _currentRenderTarget.texture.encoding;\n\t\t\tconst envMap = (material.isMeshStandardMaterial ? cubeuvmaps : cubemaps).get(material.envMap || environment);\n\t\t\tconst vertexAlphas = material.vertexColors === true && !!geometry && !!geometry.attributes.color && geometry.attributes.color.itemSize === 4;\n\t\t\tconst vertexTangents = !!material.normalMap && !!geometry && !!geometry.attributes.tangent;\n\t\t\tconst morphTargets = !!geometry && !!geometry.morphAttributes.position;\n\t\t\tconst morphNormals = !!geometry && !!geometry.morphAttributes.normal;\n\t\t\tconst morphTargetsCount = !!geometry && !!geometry.morphAttributes.position ? geometry.morphAttributes.position.length : 0;\n\t\t\tconst materialProperties = properties.get(material);\n\t\t\tconst lights = currentRenderState.state.lights;\n\n\t\t\tif (_clippingEnabled === true) {\n\t\t\t\tif (_localClippingEnabled === true || camera !== _currentCamera) {\n\t\t\t\t\tconst useCache = camera === _currentCamera && material.id === _currentMaterialId; // we might want to call this function with some ClippingGroup\n\t\t\t\t\t// object instead of the material, once it becomes feasible\n\t\t\t\t\t// (#8465, #8379)\n\n\t\t\t\t\tclipping.setState(material, camera, useCache);\n\t\t\t\t}\n\t\t\t} //\n\n\n\t\t\tlet needsProgramChange = false;\n\n\t\t\tif (material.version === materialProperties.__version) {\n\t\t\t\tif (materialProperties.needsLights && materialProperties.lightsStateVersion !== lights.state.version) {\n\t\t\t\t\tneedsProgramChange = true;\n\t\t\t\t} else if (materialProperties.outputEncoding !== encoding) {\n\t\t\t\t\tneedsProgramChange = true;\n\t\t\t\t} else if (object.isInstancedMesh && materialProperties.instancing === false) {\n\t\t\t\t\tneedsProgramChange = true;\n\t\t\t\t} else if (!object.isInstancedMesh && materialProperties.instancing === true) {\n\t\t\t\t\tneedsProgramChange = true;\n\t\t\t\t} else if (object.isSkinnedMesh && materialProperties.skinning === false) {\n\t\t\t\t\tneedsProgramChange = true;\n\t\t\t\t} else if (!object.isSkinnedMesh && materialProperties.skinning === true) {\n\t\t\t\t\tneedsProgramChange = true;\n\t\t\t\t} else if (materialProperties.envMap !== envMap) {\n\t\t\t\t\tneedsProgramChange = true;\n\t\t\t\t} else if (material.fog && materialProperties.fog !== fog) {\n\t\t\t\t\tneedsProgramChange = true;\n\t\t\t\t} else if (materialProperties.numClippingPlanes !== undefined && (materialProperties.numClippingPlanes !== clipping.numPlanes || materialProperties.numIntersection !== clipping.numIntersection)) {\n\t\t\t\t\tneedsProgramChange = true;\n\t\t\t\t} else if (materialProperties.vertexAlphas !== vertexAlphas) {\n\t\t\t\t\tneedsProgramChange = true;\n\t\t\t\t} else if (materialProperties.vertexTangents !== vertexTangents) {\n\t\t\t\t\tneedsProgramChange = true;\n\t\t\t\t} else if (materialProperties.morphTargets !== morphTargets) {\n\t\t\t\t\tneedsProgramChange = true;\n\t\t\t\t} else if (materialProperties.morphNormals !== morphNormals) {\n\t\t\t\t\tneedsProgramChange = true;\n\t\t\t\t} else if (capabilities.isWebGL2 === true && materialProperties.morphTargetsCount !== morphTargetsCount) {\n\t\t\t\t\tneedsProgramChange = true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tneedsProgramChange = true;\n\t\t\t\tmaterialProperties.__version = material.version;\n\t\t\t} //\n\n\n\t\t\tlet program = materialProperties.currentProgram;\n\n\t\t\tif (needsProgramChange === true) {\n\t\t\t\tprogram = getProgram(material, scene, object);\n\t\t\t}\n\n\t\t\tlet refreshProgram = false;\n\t\t\tlet refreshMaterial = false;\n\t\t\tlet refreshLights = false;\n\t\t\tconst p_uniforms = program.getUniforms(),\n\t\t\t\t\t\tm_uniforms = materialProperties.uniforms;\n\n\t\t\tif (state.useProgram(program.program)) {\n\t\t\t\trefreshProgram = true;\n\t\t\t\trefreshMaterial = true;\n\t\t\t\trefreshLights = true;\n\t\t\t}\n\n\t\t\tif (material.id !== _currentMaterialId) {\n\t\t\t\t_currentMaterialId = material.id;\n\t\t\t\trefreshMaterial = true;\n\t\t\t}\n\n\t\t\tif (refreshProgram || _currentCamera !== camera) {\n\t\t\t\tp_uniforms.setValue(_gl, 'projectionMatrix', camera.projectionMatrix);\n\n\t\t\t\tif (capabilities.logarithmicDepthBuffer) {\n\t\t\t\t\tp_uniforms.setValue(_gl, 'logDepthBufFC', 2.0 / (Math.log(camera.far + 1.0) / Math.LN2));\n\t\t\t\t}\n\n\t\t\t\tif (_currentCamera !== camera) {\n\t\t\t\t\t_currentCamera = camera; // lighting uniforms depend on the camera so enforce an update\n\t\t\t\t\t// now, in case this material supports lights - or later, when\n\t\t\t\t\t// the next material that does gets activated:\n\n\t\t\t\t\trefreshMaterial = true; // set to true on material change\n\n\t\t\t\t\trefreshLights = true; // remains set until update done\n\t\t\t\t} // load material specific uniforms\n\t\t\t\t// (shader material also gets them for the sake of genericity)\n\n\n\t\t\t\tif (material.isShaderMaterial || material.isMeshPhongMaterial || material.isMeshToonMaterial || material.isMeshStandardMaterial || material.envMap) {\n\t\t\t\t\tconst uCamPos = p_uniforms.map.cameraPosition;\n\n\t\t\t\t\tif (uCamPos !== undefined) {\n\t\t\t\t\t\tuCamPos.setValue(_gl, _vector3.setFromMatrixPosition(camera.matrixWorld));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (material.isMeshPhongMaterial || material.isMeshToonMaterial || material.isMeshLambertMaterial || material.isMeshBasicMaterial || material.isMeshStandardMaterial || material.isShaderMaterial) {\n\t\t\t\t\tp_uniforms.setValue(_gl, 'isOrthographic', camera.isOrthographicCamera === true);\n\t\t\t\t}\n\n\t\t\t\tif (material.isMeshPhongMaterial || material.isMeshToonMaterial || material.isMeshLambertMaterial || material.isMeshBasicMaterial || material.isMeshStandardMaterial || material.isShaderMaterial || material.isShadowMaterial || object.isSkinnedMesh) {\n\t\t\t\t\tp_uniforms.setValue(_gl, 'viewMatrix', camera.matrixWorldInverse);\n\t\t\t\t}\n\t\t\t} // skinning and morph target uniforms must be set even if material didn't change\n\t\t\t// auto-setting of texture unit for bone and morph texture must go before other textures\n\t\t\t// otherwise textures used for skinning and morphing can take over texture units reserved for other material textures\n\n\n\t\t\tif (object.isSkinnedMesh) {\n\t\t\t\tp_uniforms.setOptional(_gl, object, 'bindMatrix');\n\t\t\t\tp_uniforms.setOptional(_gl, object, 'bindMatrixInverse');\n\t\t\t\tconst skeleton = object.skeleton;\n\n\t\t\t\tif (skeleton) {\n\t\t\t\t\tif (capabilities.floatVertexTextures) {\n\t\t\t\t\t\tif (skeleton.boneTexture === null) skeleton.computeBoneTexture();\n\t\t\t\t\t\tp_uniforms.setValue(_gl, 'boneTexture', skeleton.boneTexture, textures);\n\t\t\t\t\t\tp_uniforms.setValue(_gl, 'boneTextureSize', skeleton.boneTextureSize);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tp_uniforms.setOptional(_gl, skeleton, 'boneMatrices');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!!geometry && (geometry.morphAttributes.position !== undefined || geometry.morphAttributes.normal !== undefined)) {\n\t\t\t\tmorphtargets.update(object, geometry, material, program);\n\t\t\t}\n\n\t\t\tif (refreshMaterial || materialProperties.receiveShadow !== object.receiveShadow) {\n\t\t\t\tmaterialProperties.receiveShadow = object.receiveShadow;\n\t\t\t\tp_uniforms.setValue(_gl, 'receiveShadow', object.receiveShadow);\n\t\t\t}\n\n\t\t\tif (refreshMaterial) {\n\t\t\t\tp_uniforms.setValue(_gl, 'toneMappingExposure', _this.toneMappingExposure);\n\n\t\t\t\tif (materialProperties.needsLights) {\n\t\t\t\t\t// the current material requires lighting info\n\t\t\t\t\t// note: all lighting uniforms are always set correctly\n\t\t\t\t\t// they simply reference the renderer's state for their\n\t\t\t\t\t// values\n\t\t\t\t\t//\n\t\t\t\t\t// use the current material's .needsUpdate flags to set\n\t\t\t\t\t// the GL state when required\n\t\t\t\t\tmarkUniformsLightsNeedsUpdate(m_uniforms, refreshLights);\n\t\t\t\t} // refresh uniforms common to several materials\n\n\n\t\t\t\tif (fog && material.fog) {\n\t\t\t\t\tmaterials.refreshFogUniforms(m_uniforms, fog);\n\t\t\t\t}\n\n\t\t\t\tmaterials.refreshMaterialUniforms(m_uniforms, material, _pixelRatio, _height, _transmissionRenderTarget);\n\t\t\t\tWebGLUniforms.upload(_gl, materialProperties.uniformsList, m_uniforms, textures);\n\t\t\t}\n\n\t\t\tif (material.isShaderMaterial && material.uniformsNeedUpdate === true) {\n\t\t\t\tWebGLUniforms.upload(_gl, materialProperties.uniformsList, m_uniforms, textures);\n\t\t\t\tmaterial.uniformsNeedUpdate = false;\n\t\t\t}\n\n\t\t\tif (material.isSpriteMaterial) {\n\t\t\t\tp_uniforms.setValue(_gl, 'center', object.center);\n\t\t\t} // common matrices\n\n\n\t\t\tp_uniforms.setValue(_gl, 'modelViewMatrix', object.modelViewMatrix);\n\t\t\tp_uniforms.setValue(_gl, 'normalMatrix', object.normalMatrix);\n\t\t\tp_uniforms.setValue(_gl, 'modelMatrix', object.matrixWorld);\n\t\t\treturn program;\n\t\t} // If uniforms are marked as clean, they don't need to be loaded to the GPU.\n\n\n\t\tfunction markUniformsLightsNeedsUpdate(uniforms, value) {\n\t\t\tuniforms.ambientLightColor.needsUpdate = value;\n\t\t\tuniforms.lightProbe.needsUpdate = value;\n\t\t\tuniforms.directionalLights.needsUpdate = value;\n\t\t\tuniforms.directionalLightShadows.needsUpdate = value;\n\t\t\tuniforms.pointLights.needsUpdate = value;\n\t\t\tuniforms.pointLightShadows.needsUpdate = value;\n\t\t\tuniforms.spotLights.needsUpdate = value;\n\t\t\tuniforms.spotLightShadows.needsUpdate = value;\n\t\t\tuniforms.rectAreaLights.needsUpdate = value;\n\t\t\tuniforms.hemisphereLights.needsUpdate = value;\n\t\t}\n\n\t\tfunction materialNeedsLights(material) {\n\t\t\treturn material.isMeshLambertMaterial || material.isMeshToonMaterial || material.isMeshPhongMaterial || material.isMeshStandardMaterial || material.isShadowMaterial || material.isShaderMaterial && material.lights === true;\n\t\t}\n\n\t\tthis.setTexture2D = function () {\n\t\t\tvar warned = false; // backwards compatibility: peel texture.texture\n\n\t\t\treturn function setTexture2D(texture, slot) {\n\t\t\t\tif (texture && texture.isWebGLRenderTarget) {\n\t\t\t\t\tif (!warned) {\n\t\t\t\t\t\tconsole.warn(\"THREE.WebGLRenderer.setTexture2D: don't use render targets as textures. Use their .texture property instead.\");\n\t\t\t\t\t\twarned = true;\n\t\t\t\t\t}\n\n\t\t\t\t\ttexture = texture.texture;\n\t\t\t\t}\n\n\t\t\t\ttextures.setTexture2D(texture, slot);\n\t\t\t};\n\t\t}();\n\n\t\tthis.getActiveCubeFace = function () {\n\t\t\treturn _currentActiveCubeFace;\n\t\t};\n\n\t\tthis.getActiveMipmapLevel = function () {\n\t\t\treturn _currentActiveMipmapLevel;\n\t\t};\n\n\t\tthis.getRenderTarget = function () {\n\t\t\treturn _currentRenderTarget;\n\t\t};\n\n\t\tthis.setRenderTarget = function (renderTarget, activeCubeFace = 0, activeMipmapLevel = 0) {\n\t\t\t_currentRenderTarget = renderTarget;\n\t\t\t_currentActiveCubeFace = activeCubeFace;\n\t\t\t_currentActiveMipmapLevel = activeMipmapLevel;\n\n\t\t\tif (renderTarget && properties.get(renderTarget).__webglFramebuffer === undefined) {\n\t\t\t\ttextures.setupRenderTarget(renderTarget);\n\t\t\t}\n\n\t\t\tlet framebuffer = null;\n\t\t\tlet isCube = false;\n\t\t\tlet isRenderTarget3D = false;\n\n\t\t\tif (renderTarget) {\n\t\t\t\tconst texture = renderTarget.texture;\n\n\t\t\t\tif (texture.isDataTexture3D || texture.isDataTexture2DArray) {\n\t\t\t\t\tisRenderTarget3D = true;\n\t\t\t\t}\n\n\t\t\t\tconst __webglFramebuffer = properties.get(renderTarget).__webglFramebuffer;\n\n\t\t\t\tif (renderTarget.isWebGLCubeRenderTarget) {\n\t\t\t\t\tframebuffer = __webglFramebuffer[activeCubeFace];\n\t\t\t\t\tisCube = true;\n\t\t\t\t} else if (renderTarget.isWebGLMultisampleRenderTarget) {\n\t\t\t\t\tframebuffer = properties.get(renderTarget).__webglMultisampledFramebuffer;\n\t\t\t\t} else {\n\t\t\t\t\tframebuffer = __webglFramebuffer;\n\t\t\t\t}\n\n\t\t\t\t_currentViewport.copy(renderTarget.viewport);\n\n\t\t\t\t_currentScissor.copy(renderTarget.scissor);\n\n\t\t\t\t_currentScissorTest = renderTarget.scissorTest;\n\t\t\t} else {\n\t\t\t\t_currentViewport.copy(_viewport).multiplyScalar(_pixelRatio).floor();\n\n\t\t\t\t_currentScissor.copy(_scissor).multiplyScalar(_pixelRatio).floor();\n\n\t\t\t\t_currentScissorTest = _scissorTest;\n\t\t\t}\n\n\t\t\tconst framebufferBound = state.bindFramebuffer(_gl.FRAMEBUFFER, framebuffer);\n\n\t\t\tif (framebufferBound && capabilities.drawBuffers) {\n\t\t\t\tlet needsUpdate = false;\n\n\t\t\t\tif (renderTarget) {\n\t\t\t\t\tif (renderTarget.isWebGLMultipleRenderTargets) {\n\t\t\t\t\t\tconst textures = renderTarget.texture;\n\n\t\t\t\t\t\tif (_currentDrawBuffers.length !== textures.length || _currentDrawBuffers[0] !== _gl.COLOR_ATTACHMENT0) {\n\t\t\t\t\t\t\tfor (let i = 0, il = textures.length; i < il; i++) {\n\t\t\t\t\t\t\t\t_currentDrawBuffers[i] = _gl.COLOR_ATTACHMENT0 + i;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t_currentDrawBuffers.length = textures.length;\n\t\t\t\t\t\t\tneedsUpdate = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (_currentDrawBuffers.length !== 1 || _currentDrawBuffers[0] !== _gl.COLOR_ATTACHMENT0) {\n\t\t\t\t\t\t\t_currentDrawBuffers[0] = _gl.COLOR_ATTACHMENT0;\n\t\t\t\t\t\t\t_currentDrawBuffers.length = 1;\n\t\t\t\t\t\t\tneedsUpdate = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (_currentDrawBuffers.length !== 1 || _currentDrawBuffers[0] !== _gl.BACK) {\n\t\t\t\t\t\t_currentDrawBuffers[0] = _gl.BACK;\n\t\t\t\t\t\t_currentDrawBuffers.length = 1;\n\t\t\t\t\t\tneedsUpdate = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (needsUpdate) {\n\t\t\t\t\tif (capabilities.isWebGL2) {\n\t\t\t\t\t\t_gl.drawBuffers(_currentDrawBuffers);\n\t\t\t\t\t} else {\n\t\t\t\t\t\textensions.get('WEBGL_draw_buffers').drawBuffersWEBGL(_currentDrawBuffers);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tstate.viewport(_currentViewport);\n\t\t\tstate.scissor(_currentScissor);\n\t\t\tstate.setScissorTest(_currentScissorTest);\n\n\t\t\tif (isCube) {\n\t\t\t\tconst textureProperties = properties.get(renderTarget.texture);\n\n\t\t\t\t_gl.framebufferTexture2D(_gl.FRAMEBUFFER, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_CUBE_MAP_POSITIVE_X + activeCubeFace, textureProperties.__webglTexture, activeMipmapLevel);\n\t\t\t} else if (isRenderTarget3D) {\n\t\t\t\tconst textureProperties = properties.get(renderTarget.texture);\n\t\t\t\tconst layer = activeCubeFace || 0;\n\n\t\t\t\t_gl.framebufferTextureLayer(_gl.FRAMEBUFFER, _gl.COLOR_ATTACHMENT0, textureProperties.__webglTexture, activeMipmapLevel || 0, layer);\n\t\t\t}\n\n\t\t\t_currentMaterialId = -1; // reset current material to ensure correct uniform bindings\n\t\t};\n\n\t\tthis.readRenderTargetPixels = function (renderTarget, x, y, width, height, buffer, activeCubeFaceIndex) {\n\t\t\tif (!(renderTarget && renderTarget.isWebGLRenderTarget)) {\n\t\t\t\tconsole.error('THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet framebuffer = properties.get(renderTarget).__webglFramebuffer;\n\n\t\t\tif (renderTarget.isWebGLCubeRenderTarget && activeCubeFaceIndex !== undefined) {\n\t\t\t\tframebuffer = framebuffer[activeCubeFaceIndex];\n\t\t\t}\n\n\t\t\tif (framebuffer) {\n\t\t\t\tstate.bindFramebuffer(_gl.FRAMEBUFFER, framebuffer);\n\n\t\t\t\ttry {\n\t\t\t\t\tconst texture = renderTarget.texture;\n\t\t\t\t\tconst textureFormat = texture.format;\n\t\t\t\t\tconst textureType = texture.type;\n\n\t\t\t\t\tif (textureFormat !== RGBAFormat && utils.convert(textureFormat) !== _gl.getParameter(_gl.IMPLEMENTATION_COLOR_READ_FORMAT)) {\n\t\t\t\t\t\tconsole.error('THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.');\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst halfFloatSupportedByExt = textureType === HalfFloatType && (extensions.has('EXT_color_buffer_half_float') || capabilities.isWebGL2 && extensions.has('EXT_color_buffer_float'));\n\n\t\t\t\t\tif (textureType !== UnsignedByteType && utils.convert(textureType) !== _gl.getParameter(_gl.IMPLEMENTATION_COLOR_READ_TYPE) && // Edge and Chrome Mac < 52 (#9513)\n\t\t\t\t\t!(textureType === FloatType && (capabilities.isWebGL2 || extensions.has('OES_texture_float') || extensions.has('WEBGL_color_buffer_float'))) && // Chrome Mac >= 52 and Firefox\n\t\t\t\t\t!halfFloatSupportedByExt) {\n\t\t\t\t\t\tconsole.error('THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.');\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (_gl.checkFramebufferStatus(_gl.FRAMEBUFFER) === _gl.FRAMEBUFFER_COMPLETE) {\n\t\t\t\t\t\t// the following if statement ensures valid read requests (no out-of-bounds pixels, see #8604)\n\t\t\t\t\t\tif (x >= 0 && x <= renderTarget.width - width && y >= 0 && y <= renderTarget.height - height) {\n\t\t\t\t\t\t\t_gl.readPixels(x, y, width, height, utils.convert(textureFormat), utils.convert(textureType), buffer);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconsole.error('THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.');\n\t\t\t\t\t}\n\t\t\t\t} finally {\n\t\t\t\t\t// restore framebuffer of current render target if necessary\n\t\t\t\t\tconst framebuffer = _currentRenderTarget !== null ? properties.get(_currentRenderTarget).__webglFramebuffer : null;\n\t\t\t\t\tstate.bindFramebuffer(_gl.FRAMEBUFFER, framebuffer);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tthis.copyFramebufferToTexture = function (position, texture, level = 0) {\n\t\t\tconst levelScale = Math.pow(2, -level);\n\t\t\tconst width = Math.floor(texture.image.width * levelScale);\n\t\t\tconst height = Math.floor(texture.image.height * levelScale);\n\t\t\tlet glFormat = utils.convert(texture.format);\n\n\t\t\tif (capabilities.isWebGL2) {\n\t\t\t\t// Workaround for https://bugs.chromium.org/p/chromium/issues/detail?id=1120100\n\t\t\t\t// Not needed in Chrome 93+\n\t\t\t\tif (glFormat === _gl.RGB) glFormat = _gl.RGB8;\n\t\t\t\tif (glFormat === _gl.RGBA) glFormat = _gl.RGBA8;\n\t\t\t}\n\n\t\t\ttextures.setTexture2D(texture, 0);\n\n\t\t\t_gl.copyTexImage2D(_gl.TEXTURE_2D, level, glFormat, position.x, position.y, width, height, 0);\n\n\t\t\tstate.unbindTexture();\n\t\t};\n\n\t\tthis.copyTextureToTexture = function (position, srcTexture, dstTexture, level = 0) {\n\t\t\tconst width = srcTexture.image.width;\n\t\t\tconst height = srcTexture.image.height;\n\t\t\tconst glFormat = utils.convert(dstTexture.format);\n\t\t\tconst glType = utils.convert(dstTexture.type);\n\t\t\ttextures.setTexture2D(dstTexture, 0); // As another texture upload may have changed pixelStorei\n\t\t\t// parameters, make sure they are correct for the dstTexture\n\n\t\t\t_gl.pixelStorei(_gl.UNPACK_FLIP_Y_WEBGL, dstTexture.flipY);\n\n\t\t\t_gl.pixelStorei(_gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, dstTexture.premultiplyAlpha);\n\n\t\t\t_gl.pixelStorei(_gl.UNPACK_ALIGNMENT, dstTexture.unpackAlignment);\n\n\t\t\tif (srcTexture.isDataTexture) {\n\t\t\t\t_gl.texSubImage2D(_gl.TEXTURE_2D, level, position.x, position.y, width, height, glFormat, glType, srcTexture.image.data);\n\t\t\t} else {\n\t\t\t\tif (srcTexture.isCompressedTexture) {\n\t\t\t\t\t_gl.compressedTexSubImage2D(_gl.TEXTURE_2D, level, position.x, position.y, srcTexture.mipmaps[0].width, srcTexture.mipmaps[0].height, glFormat, srcTexture.mipmaps[0].data);\n\t\t\t\t} else {\n\t\t\t\t\t_gl.texSubImage2D(_gl.TEXTURE_2D, level, position.x, position.y, glFormat, glType, srcTexture.image);\n\t\t\t\t}\n\t\t\t} // Generate mipmaps only when copying level 0\n\n\n\t\t\tif (level === 0 && dstTexture.generateMipmaps) _gl.generateMipmap(_gl.TEXTURE_2D);\n\t\t\tstate.unbindTexture();\n\t\t};\n\n\t\tthis.copyTextureToTexture3D = function (sourceBox, position, srcTexture, dstTexture, level = 0) {\n\t\t\tif (_this.isWebGL1Renderer) {\n\t\t\t\tconsole.warn('THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst width = sourceBox.max.x - sourceBox.min.x + 1;\n\t\t\tconst height = sourceBox.max.y - sourceBox.min.y + 1;\n\t\t\tconst depth = sourceBox.max.z - sourceBox.min.z + 1;\n\t\t\tconst glFormat = utils.convert(dstTexture.format);\n\t\t\tconst glType = utils.convert(dstTexture.type);\n\t\t\tlet glTarget;\n\n\t\t\tif (dstTexture.isDataTexture3D) {\n\t\t\t\ttextures.setTexture3D(dstTexture, 0);\n\t\t\t\tglTarget = _gl.TEXTURE_3D;\n\t\t\t} else if (dstTexture.isDataTexture2DArray) {\n\t\t\t\ttextures.setTexture2DArray(dstTexture, 0);\n\t\t\t\tglTarget = _gl.TEXTURE_2D_ARRAY;\n\t\t\t} else {\n\t\t\t\tconsole.warn('THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t_gl.pixelStorei(_gl.UNPACK_FLIP_Y_WEBGL, dstTexture.flipY);\n\n\t\t\t_gl.pixelStorei(_gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, dstTexture.premultiplyAlpha);\n\n\t\t\t_gl.pixelStorei(_gl.UNPACK_ALIGNMENT, dstTexture.unpackAlignment);\n\n\t\t\tconst unpackRowLen = _gl.getParameter(_gl.UNPACK_ROW_LENGTH);\n\n\t\t\tconst unpackImageHeight = _gl.getParameter(_gl.UNPACK_IMAGE_HEIGHT);\n\n\t\t\tconst unpackSkipPixels = _gl.getParameter(_gl.UNPACK_SKIP_PIXELS);\n\n\t\t\tconst unpackSkipRows = _gl.getParameter(_gl.UNPACK_SKIP_ROWS);\n\n\t\t\tconst unpackSkipImages = _gl.getParameter(_gl.UNPACK_SKIP_IMAGES);\n\n\t\t\tconst image = srcTexture.isCompressedTexture ? srcTexture.mipmaps[0] : srcTexture.image;\n\n\t\t\t_gl.pixelStorei(_gl.UNPACK_ROW_LENGTH, image.width);\n\n\t\t\t_gl.pixelStorei(_gl.UNPACK_IMAGE_HEIGHT, image.height);\n\n\t\t\t_gl.pixelStorei(_gl.UNPACK_SKIP_PIXELS, sourceBox.min.x);\n\n\t\t\t_gl.pixelStorei(_gl.UNPACK_SKIP_ROWS, sourceBox.min.y);\n\n\t\t\t_gl.pixelStorei(_gl.UNPACK_SKIP_IMAGES, sourceBox.min.z);\n\n\t\t\tif (srcTexture.isDataTexture || srcTexture.isDataTexture3D) {\n\t\t\t\t_gl.texSubImage3D(glTarget, level, position.x, position.y, position.z, width, height, depth, glFormat, glType, image.data);\n\t\t\t} else {\n\t\t\t\tif (srcTexture.isCompressedTexture) {\n\t\t\t\t\tconsole.warn('THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture.');\n\n\t\t\t\t\t_gl.compressedTexSubImage3D(glTarget, level, position.x, position.y, position.z, width, height, depth, glFormat, image.data);\n\t\t\t\t} else {\n\t\t\t\t\t_gl.texSubImage3D(glTarget, level, position.x, position.y, position.z, width, height, depth, glFormat, glType, image);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t_gl.pixelStorei(_gl.UNPACK_ROW_LENGTH, unpackRowLen);\n\n\t\t\t_gl.pixelStorei(_gl.UNPACK_IMAGE_HEIGHT, unpackImageHeight);\n\n\t\t\t_gl.pixelStorei(_gl.UNPACK_SKIP_PIXELS, unpackSkipPixels);\n\n\t\t\t_gl.pixelStorei(_gl.UNPACK_SKIP_ROWS, unpackSkipRows);\n\n\t\t\t_gl.pixelStorei(_gl.UNPACK_SKIP_IMAGES, unpackSkipImages); // Generate mipmaps only when copying level 0\n\n\n\t\t\tif (level === 0 && dstTexture.generateMipmaps) _gl.generateMipmap(glTarget);\n\t\t\tstate.unbindTexture();\n\t\t};\n\n\t\tthis.initTexture = function (texture) {\n\t\t\ttextures.setTexture2D(texture, 0);\n\t\t\tstate.unbindTexture();\n\t\t};\n\n\t\tthis.resetState = function () {\n\t\t\t_currentActiveCubeFace = 0;\n\t\t\t_currentActiveMipmapLevel = 0;\n\t\t\t_currentRenderTarget = null;\n\t\t\tstate.reset();\n\t\t\tbindingStates.reset();\n\t\t};\n\n\t\tif (typeof __THREE_DEVTOOLS__ !== 'undefined') {\n\t\t\t__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent('observe', {\n\t\t\t\tdetail: this\n\t\t\t})); // eslint-disable-line no-undef\n\n\t\t}\n\t}\n\n\tclass WebGL1Renderer extends WebGLRenderer {}\n\n\tWebGL1Renderer.prototype.isWebGL1Renderer = true;\n\n\tclass FogExp2 {\n\t\tconstructor(color, density = 0.00025) {\n\t\t\tthis.name = '';\n\t\t\tthis.color = new Color(color);\n\t\t\tthis.density = density;\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new FogExp2(this.color, this.density);\n\t\t}\n\n\t\ttoJSON() {\n\t\t\treturn {\n\t\t\t\ttype: 'FogExp2',\n\t\t\t\tcolor: this.color.getHex(),\n\t\t\t\tdensity: this.density\n\t\t\t};\n\t\t}\n\n\t}\n\n\tFogExp2.prototype.isFogExp2 = true;\n\n\tclass Fog {\n\t\tconstructor(color, near = 1, far = 1000) {\n\t\t\tthis.name = '';\n\t\t\tthis.color = new Color(color);\n\t\t\tthis.near = near;\n\t\t\tthis.far = far;\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new Fog(this.color, this.near, this.far);\n\t\t}\n\n\t\ttoJSON() {\n\t\t\treturn {\n\t\t\t\ttype: 'Fog',\n\t\t\t\tcolor: this.color.getHex(),\n\t\t\t\tnear: this.near,\n\t\t\t\tfar: this.far\n\t\t\t};\n\t\t}\n\n\t}\n\n\tFog.prototype.isFog = true;\n\n\tclass Scene extends Object3D {\n\t\tconstructor() {\n\t\t\tsuper();\n\t\t\tthis.type = 'Scene';\n\t\t\tthis.background = null;\n\t\t\tthis.environment = null;\n\t\t\tthis.fog = null;\n\t\t\tthis.overrideMaterial = null;\n\t\t\tthis.autoUpdate = true; // checked by the renderer\n\n\t\t\tif (typeof __THREE_DEVTOOLS__ !== 'undefined') {\n\t\t\t\t__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent('observe', {\n\t\t\t\t\tdetail: this\n\t\t\t\t})); // eslint-disable-line no-undef\n\n\t\t\t}\n\t\t}\n\n\t\tcopy(source, recursive) {\n\t\t\tsuper.copy(source, recursive);\n\t\t\tif (source.background !== null) this.background = source.background.clone();\n\t\t\tif (source.environment !== null) this.environment = source.environment.clone();\n\t\t\tif (source.fog !== null) this.fog = source.fog.clone();\n\t\t\tif (source.overrideMaterial !== null) this.overrideMaterial = source.overrideMaterial.clone();\n\t\t\tthis.autoUpdate = source.autoUpdate;\n\t\t\tthis.matrixAutoUpdate = source.matrixAutoUpdate;\n\t\t\treturn this;\n\t\t}\n\n\t\ttoJSON(meta) {\n\t\t\tconst data = super.toJSON(meta);\n\t\t\tif (this.fog !== null) data.object.fog = this.fog.toJSON();\n\t\t\treturn data;\n\t\t}\n\n\t}\n\n\tScene.prototype.isScene = true;\n\n\tclass InterleavedBuffer {\n\t\tconstructor(array, stride) {\n\t\t\tthis.array = array;\n\t\t\tthis.stride = stride;\n\t\t\tthis.count = array !== undefined ? array.length / stride : 0;\n\t\t\tthis.usage = StaticDrawUsage;\n\t\t\tthis.updateRange = {\n\t\t\t\toffset: 0,\n\t\t\t\tcount: -1\n\t\t\t};\n\t\t\tthis.version = 0;\n\t\t\tthis.uuid = generateUUID();\n\t\t}\n\n\t\tonUploadCallback() {}\n\n\t\tset needsUpdate(value) {\n\t\t\tif (value === true) this.version++;\n\t\t}\n\n\t\tsetUsage(value) {\n\t\t\tthis.usage = value;\n\t\t\treturn this;\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tthis.array = new source.array.constructor(source.array);\n\t\t\tthis.count = source.count;\n\t\t\tthis.stride = source.stride;\n\t\t\tthis.usage = source.usage;\n\t\t\treturn this;\n\t\t}\n\n\t\tcopyAt(index1, attribute, index2) {\n\t\t\tindex1 *= this.stride;\n\t\t\tindex2 *= attribute.stride;\n\n\t\t\tfor (let i = 0, l = this.stride; i < l; i++) {\n\t\t\t\tthis.array[index1 + i] = attribute.array[index2 + i];\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tset(value, offset = 0) {\n\t\t\tthis.array.set(value, offset);\n\t\t\treturn this;\n\t\t}\n\n\t\tclone(data) {\n\t\t\tif (data.arrayBuffers === undefined) {\n\t\t\t\tdata.arrayBuffers = {};\n\t\t\t}\n\n\t\t\tif (this.array.buffer._uuid === undefined) {\n\t\t\t\tthis.array.buffer._uuid = generateUUID();\n\t\t\t}\n\n\t\t\tif (data.arrayBuffers[this.array.buffer._uuid] === undefined) {\n\t\t\t\tdata.arrayBuffers[this.array.buffer._uuid] = this.array.slice(0).buffer;\n\t\t\t}\n\n\t\t\tconst array = new this.array.constructor(data.arrayBuffers[this.array.buffer._uuid]);\n\t\t\tconst ib = new this.constructor(array, this.stride);\n\t\t\tib.setUsage(this.usage);\n\t\t\treturn ib;\n\t\t}\n\n\t\tonUpload(callback) {\n\t\t\tthis.onUploadCallback = callback;\n\t\t\treturn this;\n\t\t}\n\n\t\ttoJSON(data) {\n\t\t\tif (data.arrayBuffers === undefined) {\n\t\t\t\tdata.arrayBuffers = {};\n\t\t\t} // generate UUID for array buffer if necessary\n\n\n\t\t\tif (this.array.buffer._uuid === undefined) {\n\t\t\t\tthis.array.buffer._uuid = generateUUID();\n\t\t\t}\n\n\t\t\tif (data.arrayBuffers[this.array.buffer._uuid] === undefined) {\n\t\t\t\tdata.arrayBuffers[this.array.buffer._uuid] = Array.prototype.slice.call(new Uint32Array(this.array.buffer));\n\t\t\t} //\n\n\n\t\t\treturn {\n\t\t\t\tuuid: this.uuid,\n\t\t\t\tbuffer: this.array.buffer._uuid,\n\t\t\t\ttype: this.array.constructor.name,\n\t\t\t\tstride: this.stride\n\t\t\t};\n\t\t}\n\n\t}\n\n\tInterleavedBuffer.prototype.isInterleavedBuffer = true;\n\n\tconst _vector$6 = /*@__PURE__*/new Vector3();\n\n\tclass InterleavedBufferAttribute {\n\t\tconstructor(interleavedBuffer, itemSize, offset, normalized = false) {\n\t\t\tthis.name = '';\n\t\t\tthis.data = interleavedBuffer;\n\t\t\tthis.itemSize = itemSize;\n\t\t\tthis.offset = offset;\n\t\t\tthis.normalized = normalized === true;\n\t\t}\n\n\t\tget count() {\n\t\t\treturn this.data.count;\n\t\t}\n\n\t\tget array() {\n\t\t\treturn this.data.array;\n\t\t}\n\n\t\tset needsUpdate(value) {\n\t\t\tthis.data.needsUpdate = value;\n\t\t}\n\n\t\tapplyMatrix4(m) {\n\t\t\tfor (let i = 0, l = this.data.count; i < l; i++) {\n\t\t\t\t_vector$6.x = this.getX(i);\n\t\t\t\t_vector$6.y = this.getY(i);\n\t\t\t\t_vector$6.z = this.getZ(i);\n\n\t\t\t\t_vector$6.applyMatrix4(m);\n\n\t\t\t\tthis.setXYZ(i, _vector$6.x, _vector$6.y, _vector$6.z);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tapplyNormalMatrix(m) {\n\t\t\tfor (let i = 0, l = this.count; i < l; i++) {\n\t\t\t\t_vector$6.x = this.getX(i);\n\t\t\t\t_vector$6.y = this.getY(i);\n\t\t\t\t_vector$6.z = this.getZ(i);\n\n\t\t\t\t_vector$6.applyNormalMatrix(m);\n\n\t\t\t\tthis.setXYZ(i, _vector$6.x, _vector$6.y, _vector$6.z);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\ttransformDirection(m) {\n\t\t\tfor (let i = 0, l = this.count; i < l; i++) {\n\t\t\t\t_vector$6.x = this.getX(i);\n\t\t\t\t_vector$6.y = this.getY(i);\n\t\t\t\t_vector$6.z = this.getZ(i);\n\n\t\t\t\t_vector$6.transformDirection(m);\n\n\t\t\t\tthis.setXYZ(i, _vector$6.x, _vector$6.y, _vector$6.z);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tsetX(index, x) {\n\t\t\tthis.data.array[index * this.data.stride + this.offset] = x;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetY(index, y) {\n\t\t\tthis.data.array[index * this.data.stride + this.offset + 1] = y;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetZ(index, z) {\n\t\t\tthis.data.array[index * this.data.stride + this.offset + 2] = z;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetW(index, w) {\n\t\t\tthis.data.array[index * this.data.stride + this.offset + 3] = w;\n\t\t\treturn this;\n\t\t}\n\n\t\tgetX(index) {\n\t\t\treturn this.data.array[index * this.data.stride + this.offset];\n\t\t}\n\n\t\tgetY(index) {\n\t\t\treturn this.data.array[index * this.data.stride + this.offset + 1];\n\t\t}\n\n\t\tgetZ(index) {\n\t\t\treturn this.data.array[index * this.data.stride + this.offset + 2];\n\t\t}\n\n\t\tgetW(index) {\n\t\t\treturn this.data.array[index * this.data.stride + this.offset + 3];\n\t\t}\n\n\t\tsetXY(index, x, y) {\n\t\t\tindex = index * this.data.stride + this.offset;\n\t\t\tthis.data.array[index + 0] = x;\n\t\t\tthis.data.array[index + 1] = y;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetXYZ(index, x, y, z) {\n\t\t\tindex = index * this.data.stride + this.offset;\n\t\t\tthis.data.array[index + 0] = x;\n\t\t\tthis.data.array[index + 1] = y;\n\t\t\tthis.data.array[index + 2] = z;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetXYZW(index, x, y, z, w) {\n\t\t\tindex = index * this.data.stride + this.offset;\n\t\t\tthis.data.array[index + 0] = x;\n\t\t\tthis.data.array[index + 1] = y;\n\t\t\tthis.data.array[index + 2] = z;\n\t\t\tthis.data.array[index + 3] = w;\n\t\t\treturn this;\n\t\t}\n\n\t\tclone(data) {\n\t\t\tif (data === undefined) {\n\t\t\t\tconsole.log('THREE.InterleavedBufferAttribute.clone(): Cloning an interlaved buffer attribute will deinterleave buffer data.');\n\t\t\t\tconst array = [];\n\n\t\t\t\tfor (let i = 0; i < this.count; i++) {\n\t\t\t\t\tconst index = i * this.data.stride + this.offset;\n\n\t\t\t\t\tfor (let j = 0; j < this.itemSize; j++) {\n\t\t\t\t\t\tarray.push(this.data.array[index + j]);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn new BufferAttribute(new this.array.constructor(array), this.itemSize, this.normalized);\n\t\t\t} else {\n\t\t\t\tif (data.interleavedBuffers === undefined) {\n\t\t\t\t\tdata.interleavedBuffers = {};\n\t\t\t\t}\n\n\t\t\t\tif (data.interleavedBuffers[this.data.uuid] === undefined) {\n\t\t\t\t\tdata.interleavedBuffers[this.data.uuid] = this.data.clone(data);\n\t\t\t\t}\n\n\t\t\t\treturn new InterleavedBufferAttribute(data.interleavedBuffers[this.data.uuid], this.itemSize, this.offset, this.normalized);\n\t\t\t}\n\t\t}\n\n\t\ttoJSON(data) {\n\t\t\tif (data === undefined) {\n\t\t\t\tconsole.log('THREE.InterleavedBufferAttribute.toJSON(): Serializing an interlaved buffer attribute will deinterleave buffer data.');\n\t\t\t\tconst array = [];\n\n\t\t\t\tfor (let i = 0; i < this.count; i++) {\n\t\t\t\t\tconst index = i * this.data.stride + this.offset;\n\n\t\t\t\t\tfor (let j = 0; j < this.itemSize; j++) {\n\t\t\t\t\t\tarray.push(this.data.array[index + j]);\n\t\t\t\t\t}\n\t\t\t\t} // deinterleave data and save it as an ordinary buffer attribute for now\n\n\n\t\t\t\treturn {\n\t\t\t\t\titemSize: this.itemSize,\n\t\t\t\t\ttype: this.array.constructor.name,\n\t\t\t\t\tarray: array,\n\t\t\t\t\tnormalized: this.normalized\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\t// save as true interlaved attribtue\n\t\t\t\tif (data.interleavedBuffers === undefined) {\n\t\t\t\t\tdata.interleavedBuffers = {};\n\t\t\t\t}\n\n\t\t\t\tif (data.interleavedBuffers[this.data.uuid] === undefined) {\n\t\t\t\t\tdata.interleavedBuffers[this.data.uuid] = this.data.toJSON(data);\n\t\t\t\t}\n\n\t\t\t\treturn {\n\t\t\t\t\tisInterleavedBufferAttribute: true,\n\t\t\t\t\titemSize: this.itemSize,\n\t\t\t\t\tdata: this.data.uuid,\n\t\t\t\t\toffset: this.offset,\n\t\t\t\t\tnormalized: this.normalized\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t}\n\n\tInterleavedBufferAttribute.prototype.isInterleavedBufferAttribute = true;\n\n\t/**\n\t * parameters = {\n\t *\tcolor: <hex>,\n\t *\tmap: new THREE.Texture( <Image> ),\n\t *\talphaMap: new THREE.Texture( <Image> ),\n\t *\trotation: <float>,\n\t *\tsizeAttenuation: <bool>\n\t * }\n\t */\n\n\tclass SpriteMaterial extends Material {\n\t\tconstructor(parameters) {\n\t\t\tsuper();\n\t\t\tthis.type = 'SpriteMaterial';\n\t\t\tthis.color = new Color(0xffffff);\n\t\t\tthis.map = null;\n\t\t\tthis.alphaMap = null;\n\t\t\tthis.rotation = 0;\n\t\t\tthis.sizeAttenuation = true;\n\t\t\tthis.transparent = true;\n\t\t\tthis.setValues(parameters);\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.color.copy(source.color);\n\t\t\tthis.map = source.map;\n\t\t\tthis.alphaMap = source.alphaMap;\n\t\t\tthis.rotation = source.rotation;\n\t\t\tthis.sizeAttenuation = source.sizeAttenuation;\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tSpriteMaterial.prototype.isSpriteMaterial = true;\n\n\tlet _geometry;\n\n\tconst _intersectPoint = /*@__PURE__*/new Vector3();\n\n\tconst _worldScale = /*@__PURE__*/new Vector3();\n\n\tconst _mvPosition = /*@__PURE__*/new Vector3();\n\n\tconst _alignedPosition = /*@__PURE__*/new Vector2();\n\n\tconst _rotatedPosition = /*@__PURE__*/new Vector2();\n\n\tconst _viewWorldMatrix = /*@__PURE__*/new Matrix4();\n\n\tconst _vA = /*@__PURE__*/new Vector3();\n\n\tconst _vB = /*@__PURE__*/new Vector3();\n\n\tconst _vC = /*@__PURE__*/new Vector3();\n\n\tconst _uvA = /*@__PURE__*/new Vector2();\n\n\tconst _uvB = /*@__PURE__*/new Vector2();\n\n\tconst _uvC = /*@__PURE__*/new Vector2();\n\n\tclass Sprite extends Object3D {\n\t\tconstructor(material) {\n\t\t\tsuper();\n\t\t\tthis.type = 'Sprite';\n\n\t\t\tif (_geometry === undefined) {\n\t\t\t\t_geometry = new BufferGeometry();\n\t\t\t\tconst float32Array = new Float32Array([-0.5, -0.5, 0, 0, 0, 0.5, -0.5, 0, 1, 0, 0.5, 0.5, 0, 1, 1, -0.5, 0.5, 0, 0, 1]);\n\t\t\t\tconst interleavedBuffer = new InterleavedBuffer(float32Array, 5);\n\n\t\t\t\t_geometry.setIndex([0, 1, 2, 0, 2, 3]);\n\n\t\t\t\t_geometry.setAttribute('position', new InterleavedBufferAttribute(interleavedBuffer, 3, 0, false));\n\n\t\t\t\t_geometry.setAttribute('uv', new InterleavedBufferAttribute(interleavedBuffer, 2, 3, false));\n\t\t\t}\n\n\t\t\tthis.geometry = _geometry;\n\t\t\tthis.material = material !== undefined ? material : new SpriteMaterial();\n\t\t\tthis.center = new Vector2(0.5, 0.5);\n\t\t}\n\n\t\traycast(raycaster, intersects) {\n\t\t\tif (raycaster.camera === null) {\n\t\t\t\tconsole.error('THREE.Sprite: \"Raycaster.camera\" needs to be set in order to raycast against sprites.');\n\t\t\t}\n\n\t\t\t_worldScale.setFromMatrixScale(this.matrixWorld);\n\n\t\t\t_viewWorldMatrix.copy(raycaster.camera.matrixWorld);\n\n\t\t\tthis.modelViewMatrix.multiplyMatrices(raycaster.camera.matrixWorldInverse, this.matrixWorld);\n\n\t\t\t_mvPosition.setFromMatrixPosition(this.modelViewMatrix);\n\n\t\t\tif (raycaster.camera.isPerspectiveCamera && this.material.sizeAttenuation === false) {\n\t\t\t\t_worldScale.multiplyScalar(-_mvPosition.z);\n\t\t\t}\n\n\t\t\tconst rotation = this.material.rotation;\n\t\t\tlet sin, cos;\n\n\t\t\tif (rotation !== 0) {\n\t\t\t\tcos = Math.cos(rotation);\n\t\t\t\tsin = Math.sin(rotation);\n\t\t\t}\n\n\t\t\tconst center = this.center;\n\t\t\ttransformVertex(_vA.set(-0.5, -0.5, 0), _mvPosition, center, _worldScale, sin, cos);\n\t\t\ttransformVertex(_vB.set(0.5, -0.5, 0), _mvPosition, center, _worldScale, sin, cos);\n\t\t\ttransformVertex(_vC.set(0.5, 0.5, 0), _mvPosition, center, _worldScale, sin, cos);\n\n\t\t\t_uvA.set(0, 0);\n\n\t\t\t_uvB.set(1, 0);\n\n\t\t\t_uvC.set(1, 1); // check first triangle\n\n\n\t\t\tlet intersect = raycaster.ray.intersectTriangle(_vA, _vB, _vC, false, _intersectPoint);\n\n\t\t\tif (intersect === null) {\n\t\t\t\t// check second triangle\n\t\t\t\ttransformVertex(_vB.set(-0.5, 0.5, 0), _mvPosition, center, _worldScale, sin, cos);\n\n\t\t\t\t_uvB.set(0, 1);\n\n\t\t\t\tintersect = raycaster.ray.intersectTriangle(_vA, _vC, _vB, false, _intersectPoint);\n\n\t\t\t\tif (intersect === null) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst distance = raycaster.ray.origin.distanceTo(_intersectPoint);\n\t\t\tif (distance < raycaster.near || distance > raycaster.far) return;\n\t\t\tintersects.push({\n\t\t\t\tdistance: distance,\n\t\t\t\tpoint: _intersectPoint.clone(),\n\t\t\t\tuv: Triangle.getUV(_intersectPoint, _vA, _vB, _vC, _uvA, _uvB, _uvC, new Vector2()),\n\t\t\t\tface: null,\n\t\t\t\tobject: this\n\t\t\t});\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tif (source.center !== undefined) this.center.copy(source.center);\n\t\t\tthis.material = source.material;\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tSprite.prototype.isSprite = true;\n\n\tfunction transformVertex(vertexPosition, mvPosition, center, scale, sin, cos) {\n\t\t// compute position in camera space\n\t\t_alignedPosition.subVectors(vertexPosition, center).addScalar(0.5).multiply(scale); // to check if rotation is not zero\n\n\n\t\tif (sin !== undefined) {\n\t\t\t_rotatedPosition.x = cos * _alignedPosition.x - sin * _alignedPosition.y;\n\t\t\t_rotatedPosition.y = sin * _alignedPosition.x + cos * _alignedPosition.y;\n\t\t} else {\n\t\t\t_rotatedPosition.copy(_alignedPosition);\n\t\t}\n\n\t\tvertexPosition.copy(mvPosition);\n\t\tvertexPosition.x += _rotatedPosition.x;\n\t\tvertexPosition.y += _rotatedPosition.y; // transform to world space\n\n\t\tvertexPosition.applyMatrix4(_viewWorldMatrix);\n\t}\n\n\tconst _v1$2 = /*@__PURE__*/new Vector3();\n\n\tconst _v2$1 = /*@__PURE__*/new Vector3();\n\n\tclass LOD extends Object3D {\n\t\tconstructor() {\n\t\t\tsuper();\n\t\t\tthis._currentLevel = 0;\n\t\t\tthis.type = 'LOD';\n\t\t\tObject.defineProperties(this, {\n\t\t\t\tlevels: {\n\t\t\t\t\tenumerable: true,\n\t\t\t\t\tvalue: []\n\t\t\t\t},\n\t\t\t\tisLOD: {\n\t\t\t\t\tvalue: true\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis.autoUpdate = true;\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source, false);\n\t\t\tconst levels = source.levels;\n\n\t\t\tfor (let i = 0, l = levels.length; i < l; i++) {\n\t\t\t\tconst level = levels[i];\n\t\t\t\tthis.addLevel(level.object.clone(), level.distance);\n\t\t\t}\n\n\t\t\tthis.autoUpdate = source.autoUpdate;\n\t\t\treturn this;\n\t\t}\n\n\t\taddLevel(object, distance = 0) {\n\t\t\tdistance = Math.abs(distance);\n\t\t\tconst levels = this.levels;\n\t\t\tlet l;\n\n\t\t\tfor (l = 0; l < levels.length; l++) {\n\t\t\t\tif (distance < levels[l].distance) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlevels.splice(l, 0, {\n\t\t\t\tdistance: distance,\n\t\t\t\tobject: object\n\t\t\t});\n\t\t\tthis.add(object);\n\t\t\treturn this;\n\t\t}\n\n\t\tgetCurrentLevel() {\n\t\t\treturn this._currentLevel;\n\t\t}\n\n\t\tgetObjectForDistance(distance) {\n\t\t\tconst levels = this.levels;\n\n\t\t\tif (levels.length > 0) {\n\t\t\t\tlet i, l;\n\n\t\t\t\tfor (i = 1, l = levels.length; i < l; i++) {\n\t\t\t\t\tif (distance < levels[i].distance) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn levels[i - 1].object;\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\traycast(raycaster, intersects) {\n\t\t\tconst levels = this.levels;\n\n\t\t\tif (levels.length > 0) {\n\t\t\t\t_v1$2.setFromMatrixPosition(this.matrixWorld);\n\n\t\t\t\tconst distance = raycaster.ray.origin.distanceTo(_v1$2);\n\t\t\t\tthis.getObjectForDistance(distance).raycast(raycaster, intersects);\n\t\t\t}\n\t\t}\n\n\t\tupdate(camera) {\n\t\t\tconst levels = this.levels;\n\n\t\t\tif (levels.length > 1) {\n\t\t\t\t_v1$2.setFromMatrixPosition(camera.matrixWorld);\n\n\t\t\t\t_v2$1.setFromMatrixPosition(this.matrixWorld);\n\n\t\t\t\tconst distance = _v1$2.distanceTo(_v2$1) / camera.zoom;\n\t\t\t\tlevels[0].object.visible = true;\n\t\t\t\tlet i, l;\n\n\t\t\t\tfor (i = 1, l = levels.length; i < l; i++) {\n\t\t\t\t\tif (distance >= levels[i].distance) {\n\t\t\t\t\t\tlevels[i - 1].object.visible = false;\n\t\t\t\t\t\tlevels[i].object.visible = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis._currentLevel = i - 1;\n\n\t\t\t\tfor (; i < l; i++) {\n\t\t\t\t\tlevels[i].object.visible = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\ttoJSON(meta) {\n\t\t\tconst data = super.toJSON(meta);\n\t\t\tif (this.autoUpdate === false) data.object.autoUpdate = false;\n\t\t\tdata.object.levels = [];\n\t\t\tconst levels = this.levels;\n\n\t\t\tfor (let i = 0, l = levels.length; i < l; i++) {\n\t\t\t\tconst level = levels[i];\n\t\t\t\tdata.object.levels.push({\n\t\t\t\t\tobject: level.object.uuid,\n\t\t\t\t\tdistance: level.distance\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn data;\n\t\t}\n\n\t}\n\n\tconst _basePosition = /*@__PURE__*/new Vector3();\n\n\tconst _skinIndex = /*@__PURE__*/new Vector4();\n\n\tconst _skinWeight = /*@__PURE__*/new Vector4();\n\n\tconst _vector$5 = /*@__PURE__*/new Vector3();\n\n\tconst _matrix = /*@__PURE__*/new Matrix4();\n\n\tclass SkinnedMesh extends Mesh {\n\t\tconstructor(geometry, material) {\n\t\t\tsuper(geometry, material);\n\t\t\tthis.type = 'SkinnedMesh';\n\t\t\tthis.bindMode = 'attached';\n\t\t\tthis.bindMatrix = new Matrix4();\n\t\t\tthis.bindMatrixInverse = new Matrix4();\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.bindMode = source.bindMode;\n\t\t\tthis.bindMatrix.copy(source.bindMatrix);\n\t\t\tthis.bindMatrixInverse.copy(source.bindMatrixInverse);\n\t\t\tthis.skeleton = source.skeleton;\n\t\t\treturn this;\n\t\t}\n\n\t\tbind(skeleton, bindMatrix) {\n\t\t\tthis.skeleton = skeleton;\n\n\t\t\tif (bindMatrix === undefined) {\n\t\t\t\tthis.updateMatrixWorld(true);\n\t\t\t\tthis.skeleton.calculateInverses();\n\t\t\t\tbindMatrix = this.matrixWorld;\n\t\t\t}\n\n\t\t\tthis.bindMatrix.copy(bindMatrix);\n\t\t\tthis.bindMatrixInverse.copy(bindMatrix).invert();\n\t\t}\n\n\t\tpose() {\n\t\t\tthis.skeleton.pose();\n\t\t}\n\n\t\tnormalizeSkinWeights() {\n\t\t\tconst vector = new Vector4();\n\t\t\tconst skinWeight = this.geometry.attributes.skinWeight;\n\n\t\t\tfor (let i = 0, l = skinWeight.count; i < l; i++) {\n\t\t\t\tvector.x = skinWeight.getX(i);\n\t\t\t\tvector.y = skinWeight.getY(i);\n\t\t\t\tvector.z = skinWeight.getZ(i);\n\t\t\t\tvector.w = skinWeight.getW(i);\n\t\t\t\tconst scale = 1.0 / vector.manhattanLength();\n\n\t\t\t\tif (scale !== Infinity) {\n\t\t\t\t\tvector.multiplyScalar(scale);\n\t\t\t\t} else {\n\t\t\t\t\tvector.set(1, 0, 0, 0); // do something reasonable\n\t\t\t\t}\n\n\t\t\t\tskinWeight.setXYZW(i, vector.x, vector.y, vector.z, vector.w);\n\t\t\t}\n\t\t}\n\n\t\tupdateMatrixWorld(force) {\n\t\t\tsuper.updateMatrixWorld(force);\n\n\t\t\tif (this.bindMode === 'attached') {\n\t\t\t\tthis.bindMatrixInverse.copy(this.matrixWorld).invert();\n\t\t\t} else if (this.bindMode === 'detached') {\n\t\t\t\tthis.bindMatrixInverse.copy(this.bindMatrix).invert();\n\t\t\t} else {\n\t\t\t\tconsole.warn('THREE.SkinnedMesh: Unrecognized bindMode: ' + this.bindMode);\n\t\t\t}\n\t\t}\n\n\t\tboneTransform(index, target) {\n\t\t\tconst skeleton = this.skeleton;\n\t\t\tconst geometry = this.geometry;\n\n\t\t\t_skinIndex.fromBufferAttribute(geometry.attributes.skinIndex, index);\n\n\t\t\t_skinWeight.fromBufferAttribute(geometry.attributes.skinWeight, index);\n\n\t\t\t_basePosition.copy(target).applyMatrix4(this.bindMatrix);\n\n\t\t\ttarget.set(0, 0, 0);\n\n\t\t\tfor (let i = 0; i < 4; i++) {\n\t\t\t\tconst weight = _skinWeight.getComponent(i);\n\n\t\t\t\tif (weight !== 0) {\n\t\t\t\t\tconst boneIndex = _skinIndex.getComponent(i);\n\n\t\t\t\t\t_matrix.multiplyMatrices(skeleton.bones[boneIndex].matrixWorld, skeleton.boneInverses[boneIndex]);\n\n\t\t\t\t\ttarget.addScaledVector(_vector$5.copy(_basePosition).applyMatrix4(_matrix), weight);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn target.applyMatrix4(this.bindMatrixInverse);\n\t\t}\n\n\t}\n\n\tSkinnedMesh.prototype.isSkinnedMesh = true;\n\n\tclass Bone extends Object3D {\n\t\tconstructor() {\n\t\t\tsuper();\n\t\t\tthis.type = 'Bone';\n\t\t}\n\n\t}\n\n\tBone.prototype.isBone = true;\n\n\tclass DataTexture extends Texture {\n\t\tconstructor(data = null, width = 1, height = 1, format, type, mapping, wrapS, wrapT, magFilter = NearestFilter, minFilter = NearestFilter, anisotropy, encoding) {\n\t\t\tsuper(null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding);\n\t\t\tthis.image = {\n\t\t\t\tdata: data,\n\t\t\t\twidth: width,\n\t\t\t\theight: height\n\t\t\t};\n\t\t\tthis.magFilter = magFilter;\n\t\t\tthis.minFilter = minFilter;\n\t\t\tthis.generateMipmaps = false;\n\t\t\tthis.flipY = false;\n\t\t\tthis.unpackAlignment = 1;\n\t\t\tthis.needsUpdate = true;\n\t\t}\n\n\t}\n\n\tDataTexture.prototype.isDataTexture = true;\n\n\tconst _offsetMatrix = /*@__PURE__*/new Matrix4();\n\n\tconst _identityMatrix = /*@__PURE__*/new Matrix4();\n\n\tclass Skeleton {\n\t\tconstructor(bones = [], boneInverses = []) {\n\t\t\tthis.uuid = generateUUID();\n\t\t\tthis.bones = bones.slice(0);\n\t\t\tthis.boneInverses = boneInverses;\n\t\t\tthis.boneMatrices = null;\n\t\t\tthis.boneTexture = null;\n\t\t\tthis.boneTextureSize = 0;\n\t\t\tthis.frame = -1;\n\t\t\tthis.init();\n\t\t}\n\n\t\tinit() {\n\t\t\tconst bones = this.bones;\n\t\t\tconst boneInverses = this.boneInverses;\n\t\t\tthis.boneMatrices = new Float32Array(bones.length * 16); // calculate inverse bone matrices if necessary\n\n\t\t\tif (boneInverses.length === 0) {\n\t\t\t\tthis.calculateInverses();\n\t\t\t} else {\n\t\t\t\t// handle special case\n\t\t\t\tif (bones.length !== boneInverses.length) {\n\t\t\t\t\tconsole.warn('THREE.Skeleton: Number of inverse bone matrices does not match amount of bones.');\n\t\t\t\t\tthis.boneInverses = [];\n\n\t\t\t\t\tfor (let i = 0, il = this.bones.length; i < il; i++) {\n\t\t\t\t\t\tthis.boneInverses.push(new Matrix4());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tcalculateInverses() {\n\t\t\tthis.boneInverses.length = 0;\n\n\t\t\tfor (let i = 0, il = this.bones.length; i < il; i++) {\n\t\t\t\tconst inverse = new Matrix4();\n\n\t\t\t\tif (this.bones[i]) {\n\t\t\t\t\tinverse.copy(this.bones[i].matrixWorld).invert();\n\t\t\t\t}\n\n\t\t\t\tthis.boneInverses.push(inverse);\n\t\t\t}\n\t\t}\n\n\t\tpose() {\n\t\t\t// recover the bind-time world matrices\n\t\t\tfor (let i = 0, il = this.bones.length; i < il; i++) {\n\t\t\t\tconst bone = this.bones[i];\n\n\t\t\t\tif (bone) {\n\t\t\t\t\tbone.matrixWorld.copy(this.boneInverses[i]).invert();\n\t\t\t\t}\n\t\t\t} // compute the local matrices, positions, rotations and scales\n\n\n\t\t\tfor (let i = 0, il = this.bones.length; i < il; i++) {\n\t\t\t\tconst bone = this.bones[i];\n\n\t\t\t\tif (bone) {\n\t\t\t\t\tif (bone.parent && bone.parent.isBone) {\n\t\t\t\t\t\tbone.matrix.copy(bone.parent.matrixWorld).invert();\n\t\t\t\t\t\tbone.matrix.multiply(bone.matrixWorld);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbone.matrix.copy(bone.matrixWorld);\n\t\t\t\t\t}\n\n\t\t\t\t\tbone.matrix.decompose(bone.position, bone.quaternion, bone.scale);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tupdate() {\n\t\t\tconst bones = this.bones;\n\t\t\tconst boneInverses = this.boneInverses;\n\t\t\tconst boneMatrices = this.boneMatrices;\n\t\t\tconst boneTexture = this.boneTexture; // flatten bone matrices to array\n\n\t\t\tfor (let i = 0, il = bones.length; i < il; i++) {\n\t\t\t\t// compute the offset between the current and the original transform\n\t\t\t\tconst matrix = bones[i] ? bones[i].matrixWorld : _identityMatrix;\n\n\t\t\t\t_offsetMatrix.multiplyMatrices(matrix, boneInverses[i]);\n\n\t\t\t\t_offsetMatrix.toArray(boneMatrices, i * 16);\n\t\t\t}\n\n\t\t\tif (boneTexture !== null) {\n\t\t\t\tboneTexture.needsUpdate = true;\n\t\t\t}\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new Skeleton(this.bones, this.boneInverses);\n\t\t}\n\n\t\tcomputeBoneTexture() {\n\t\t\t// layout (1 matrix = 4 pixels)\n\t\t\t//\t\t\tRGBA RGBA RGBA RGBA (=> column1, column2, column3, column4)\n\t\t\t//\twith\t8x8\tpixel texture max\t 16 bones * 4 pixels =\t(8 * 8)\n\t\t\t//\t\t\t 16x16 pixel texture max\t 64 bones * 4 pixels = (16 * 16)\n\t\t\t//\t\t\t 32x32 pixel texture max\t256 bones * 4 pixels = (32 * 32)\n\t\t\t//\t\t\t 64x64 pixel texture max 1024 bones * 4 pixels = (64 * 64)\n\t\t\tlet size = Math.sqrt(this.bones.length * 4); // 4 pixels needed for 1 matrix\n\n\t\t\tsize = ceilPowerOfTwo(size);\n\t\t\tsize = Math.max(size, 4);\n\t\t\tconst boneMatrices = new Float32Array(size * size * 4); // 4 floats per RGBA pixel\n\n\t\t\tboneMatrices.set(this.boneMatrices); // copy current values\n\n\t\t\tconst boneTexture = new DataTexture(boneMatrices, size, size, RGBAFormat, FloatType);\n\t\t\tthis.boneMatrices = boneMatrices;\n\t\t\tthis.boneTexture = boneTexture;\n\t\t\tthis.boneTextureSize = size;\n\t\t\treturn this;\n\t\t}\n\n\t\tgetBoneByName(name) {\n\t\t\tfor (let i = 0, il = this.bones.length; i < il; i++) {\n\t\t\t\tconst bone = this.bones[i];\n\n\t\t\t\tif (bone.name === name) {\n\t\t\t\t\treturn bone;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn undefined;\n\t\t}\n\n\t\tdispose() {\n\t\t\tif (this.boneTexture !== null) {\n\t\t\t\tthis.boneTexture.dispose();\n\t\t\t\tthis.boneTexture = null;\n\t\t\t}\n\t\t}\n\n\t\tfromJSON(json, bones) {\n\t\t\tthis.uuid = json.uuid;\n\n\t\t\tfor (let i = 0, l = json.bones.length; i < l; i++) {\n\t\t\t\tconst uuid = json.bones[i];\n\t\t\t\tlet bone = bones[uuid];\n\n\t\t\t\tif (bone === undefined) {\n\t\t\t\t\tconsole.warn('THREE.Skeleton: No bone found with UUID:', uuid);\n\t\t\t\t\tbone = new Bone();\n\t\t\t\t}\n\n\t\t\t\tthis.bones.push(bone);\n\t\t\t\tthis.boneInverses.push(new Matrix4().fromArray(json.boneInverses[i]));\n\t\t\t}\n\n\t\t\tthis.init();\n\t\t\treturn this;\n\t\t}\n\n\t\ttoJSON() {\n\t\t\tconst data = {\n\t\t\t\tmetadata: {\n\t\t\t\t\tversion: 4.5,\n\t\t\t\t\ttype: 'Skeleton',\n\t\t\t\t\tgenerator: 'Skeleton.toJSON'\n\t\t\t\t},\n\t\t\t\tbones: [],\n\t\t\t\tboneInverses: []\n\t\t\t};\n\t\t\tdata.uuid = this.uuid;\n\t\t\tconst bones = this.bones;\n\t\t\tconst boneInverses = this.boneInverses;\n\n\t\t\tfor (let i = 0, l = bones.length; i < l; i++) {\n\t\t\t\tconst bone = bones[i];\n\t\t\t\tdata.bones.push(bone.uuid);\n\t\t\t\tconst boneInverse = boneInverses[i];\n\t\t\t\tdata.boneInverses.push(boneInverse.toArray());\n\t\t\t}\n\n\t\t\treturn data;\n\t\t}\n\n\t}\n\n\tclass InstancedBufferAttribute extends BufferAttribute {\n\t\tconstructor(array, itemSize, normalized, meshPerAttribute = 1) {\n\t\t\tif (typeof normalized === 'number') {\n\t\t\t\tmeshPerAttribute = normalized;\n\t\t\t\tnormalized = false;\n\t\t\t\tconsole.error('THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.');\n\t\t\t}\n\n\t\t\tsuper(array, itemSize, normalized);\n\t\t\tthis.meshPerAttribute = meshPerAttribute;\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.meshPerAttribute = source.meshPerAttribute;\n\t\t\treturn this;\n\t\t}\n\n\t\ttoJSON() {\n\t\t\tconst data = super.toJSON();\n\t\t\tdata.meshPerAttribute = this.meshPerAttribute;\n\t\t\tdata.isInstancedBufferAttribute = true;\n\t\t\treturn data;\n\t\t}\n\n\t}\n\n\tInstancedBufferAttribute.prototype.isInstancedBufferAttribute = true;\n\n\tconst _instanceLocalMatrix = /*@__PURE__*/new Matrix4();\n\n\tconst _instanceWorldMatrix = /*@__PURE__*/new Matrix4();\n\n\tconst _instanceIntersects = [];\n\n\tconst _mesh = /*@__PURE__*/new Mesh();\n\n\tclass InstancedMesh extends Mesh {\n\t\tconstructor(geometry, material, count) {\n\t\t\tsuper(geometry, material);\n\t\t\tthis.instanceMatrix = new InstancedBufferAttribute(new Float32Array(count * 16), 16);\n\t\t\tthis.instanceColor = null;\n\t\t\tthis.count = count;\n\t\t\tthis.frustumCulled = false;\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.instanceMatrix.copy(source.instanceMatrix);\n\t\t\tif (source.instanceColor !== null) this.instanceColor = source.instanceColor.clone();\n\t\t\tthis.count = source.count;\n\t\t\treturn this;\n\t\t}\n\n\t\tgetColorAt(index, color) {\n\t\t\tcolor.fromArray(this.instanceColor.array, index * 3);\n\t\t}\n\n\t\tgetMatrixAt(index, matrix) {\n\t\t\tmatrix.fromArray(this.instanceMatrix.array, index * 16);\n\t\t}\n\n\t\traycast(raycaster, intersects) {\n\t\t\tconst matrixWorld = this.matrixWorld;\n\t\t\tconst raycastTimes = this.count;\n\t\t\t_mesh.geometry = this.geometry;\n\t\t\t_mesh.material = this.material;\n\t\t\tif (_mesh.material === undefined) return;\n\n\t\t\tfor (let instanceId = 0; instanceId < raycastTimes; instanceId++) {\n\t\t\t\t// calculate the world matrix for each instance\n\t\t\t\tthis.getMatrixAt(instanceId, _instanceLocalMatrix);\n\n\t\t\t\t_instanceWorldMatrix.multiplyMatrices(matrixWorld, _instanceLocalMatrix); // the mesh represents this single instance\n\n\n\t\t\t\t_mesh.matrixWorld = _instanceWorldMatrix;\n\n\t\t\t\t_mesh.raycast(raycaster, _instanceIntersects); // process the result of raycast\n\n\n\t\t\t\tfor (let i = 0, l = _instanceIntersects.length; i < l; i++) {\n\t\t\t\t\tconst intersect = _instanceIntersects[i];\n\t\t\t\t\tintersect.instanceId = instanceId;\n\t\t\t\t\tintersect.object = this;\n\t\t\t\t\tintersects.push(intersect);\n\t\t\t\t}\n\n\t\t\t\t_instanceIntersects.length = 0;\n\t\t\t}\n\t\t}\n\n\t\tsetColorAt(index, color) {\n\t\t\tif (this.instanceColor === null) {\n\t\t\t\tthis.instanceColor = new InstancedBufferAttribute(new Float32Array(this.instanceMatrix.count * 3), 3);\n\t\t\t}\n\n\t\t\tcolor.toArray(this.instanceColor.array, index * 3);\n\t\t}\n\n\t\tsetMatrixAt(index, matrix) {\n\t\t\tmatrix.toArray(this.instanceMatrix.array, index * 16);\n\t\t}\n\n\t\tupdateMorphTargets() {}\n\n\t\tdispose() {\n\t\t\tthis.dispatchEvent({\n\t\t\t\ttype: 'dispose'\n\t\t\t});\n\t\t}\n\n\t}\n\n\tInstancedMesh.prototype.isInstancedMesh = true;\n\n\t/**\n\t * parameters = {\n\t *\tcolor: <hex>,\n\t *\topacity: <float>,\n\t *\n\t *\tlinewidth: <float>,\n\t *\tlinecap: \"round\",\n\t *\tlinejoin: \"round\"\n\t * }\n\t */\n\n\tclass LineBasicMaterial extends Material {\n\t\tconstructor(parameters) {\n\t\t\tsuper();\n\t\t\tthis.type = 'LineBasicMaterial';\n\t\t\tthis.color = new Color(0xffffff);\n\t\t\tthis.linewidth = 1;\n\t\t\tthis.linecap = 'round';\n\t\t\tthis.linejoin = 'round';\n\t\t\tthis.setValues(parameters);\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.color.copy(source.color);\n\t\t\tthis.linewidth = source.linewidth;\n\t\t\tthis.linecap = source.linecap;\n\t\t\tthis.linejoin = source.linejoin;\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tLineBasicMaterial.prototype.isLineBasicMaterial = true;\n\n\tconst _start$1 = /*@__PURE__*/new Vector3();\n\n\tconst _end$1 = /*@__PURE__*/new Vector3();\n\n\tconst _inverseMatrix$1 = /*@__PURE__*/new Matrix4();\n\n\tconst _ray$1 = /*@__PURE__*/new Ray();\n\n\tconst _sphere$1 = /*@__PURE__*/new Sphere();\n\n\tclass Line extends Object3D {\n\t\tconstructor(geometry = new BufferGeometry(), material = new LineBasicMaterial()) {\n\t\t\tsuper();\n\t\t\tthis.type = 'Line';\n\t\t\tthis.geometry = geometry;\n\t\t\tthis.material = material;\n\t\t\tthis.updateMorphTargets();\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.material = source.material;\n\t\t\tthis.geometry = source.geometry;\n\t\t\treturn this;\n\t\t}\n\n\t\tcomputeLineDistances() {\n\t\t\tconst geometry = this.geometry;\n\n\t\t\tif (geometry.isBufferGeometry) {\n\t\t\t\t// we assume non-indexed geometry\n\t\t\t\tif (geometry.index === null) {\n\t\t\t\t\tconst positionAttribute = geometry.attributes.position;\n\t\t\t\t\tconst lineDistances = [0];\n\n\t\t\t\t\tfor (let i = 1, l = positionAttribute.count; i < l; i++) {\n\t\t\t\t\t\t_start$1.fromBufferAttribute(positionAttribute, i - 1);\n\n\t\t\t\t\t\t_end$1.fromBufferAttribute(positionAttribute, i);\n\n\t\t\t\t\t\tlineDistances[i] = lineDistances[i - 1];\n\t\t\t\t\t\tlineDistances[i] += _start$1.distanceTo(_end$1);\n\t\t\t\t\t}\n\n\t\t\t\t\tgeometry.setAttribute('lineDistance', new Float32BufferAttribute(lineDistances, 1));\n\t\t\t\t} else {\n\t\t\t\t\tconsole.warn('THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.');\n\t\t\t\t}\n\t\t\t} else if (geometry.isGeometry) {\n\t\t\t\tconsole.error('THREE.Line.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.');\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\traycast(raycaster, intersects) {\n\t\t\tconst geometry = this.geometry;\n\t\t\tconst matrixWorld = this.matrixWorld;\n\t\t\tconst threshold = raycaster.params.Line.threshold;\n\t\t\tconst drawRange = geometry.drawRange; // Checking boundingSphere distance to ray\n\n\t\t\tif (geometry.boundingSphere === null) geometry.computeBoundingSphere();\n\n\t\t\t_sphere$1.copy(geometry.boundingSphere);\n\n\t\t\t_sphere$1.applyMatrix4(matrixWorld);\n\n\t\t\t_sphere$1.radius += threshold;\n\t\t\tif (raycaster.ray.intersectsSphere(_sphere$1) === false) return; //\n\n\t\t\t_inverseMatrix$1.copy(matrixWorld).invert();\n\n\t\t\t_ray$1.copy(raycaster.ray).applyMatrix4(_inverseMatrix$1);\n\n\t\t\tconst localThreshold = threshold / ((this.scale.x + this.scale.y + this.scale.z) / 3);\n\t\t\tconst localThresholdSq = localThreshold * localThreshold;\n\t\t\tconst vStart = new Vector3();\n\t\t\tconst vEnd = new Vector3();\n\t\t\tconst interSegment = new Vector3();\n\t\t\tconst interRay = new Vector3();\n\t\t\tconst step = this.isLineSegments ? 2 : 1;\n\n\t\t\tif (geometry.isBufferGeometry) {\n\t\t\t\tconst index = geometry.index;\n\t\t\t\tconst attributes = geometry.attributes;\n\t\t\t\tconst positionAttribute = attributes.position;\n\n\t\t\t\tif (index !== null) {\n\t\t\t\t\tconst start = Math.max(0, drawRange.start);\n\t\t\t\t\tconst end = Math.min(index.count, drawRange.start + drawRange.count);\n\n\t\t\t\t\tfor (let i = start, l = end - 1; i < l; i += step) {\n\t\t\t\t\t\tconst a = index.getX(i);\n\t\t\t\t\t\tconst b = index.getX(i + 1);\n\t\t\t\t\t\tvStart.fromBufferAttribute(positionAttribute, a);\n\t\t\t\t\t\tvEnd.fromBufferAttribute(positionAttribute, b);\n\n\t\t\t\t\t\tconst distSq = _ray$1.distanceSqToSegment(vStart, vEnd, interRay, interSegment);\n\n\t\t\t\t\t\tif (distSq > localThresholdSq) continue;\n\t\t\t\t\t\tinterRay.applyMatrix4(this.matrixWorld); //Move back to world space for distance calculation\n\n\t\t\t\t\t\tconst distance = raycaster.ray.origin.distanceTo(interRay);\n\t\t\t\t\t\tif (distance < raycaster.near || distance > raycaster.far) continue;\n\t\t\t\t\t\tintersects.push({\n\t\t\t\t\t\t\tdistance: distance,\n\t\t\t\t\t\t\t// What do we want? intersection point on the ray or on the segment??\n\t\t\t\t\t\t\t// point: raycaster.ray.at( distance ),\n\t\t\t\t\t\t\tpoint: interSegment.clone().applyMatrix4(this.matrixWorld),\n\t\t\t\t\t\t\tindex: i,\n\t\t\t\t\t\t\tface: null,\n\t\t\t\t\t\t\tfaceIndex: null,\n\t\t\t\t\t\t\tobject: this\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconst start = Math.max(0, drawRange.start);\n\t\t\t\t\tconst end = Math.min(positionAttribute.count, drawRange.start + drawRange.count);\n\n\t\t\t\t\tfor (let i = start, l = end - 1; i < l; i += step) {\n\t\t\t\t\t\tvStart.fromBufferAttribute(positionAttribute, i);\n\t\t\t\t\t\tvEnd.fromBufferAttribute(positionAttribute, i + 1);\n\n\t\t\t\t\t\tconst distSq = _ray$1.distanceSqToSegment(vStart, vEnd, interRay, interSegment);\n\n\t\t\t\t\t\tif (distSq > localThresholdSq) continue;\n\t\t\t\t\t\tinterRay.applyMatrix4(this.matrixWorld); //Move back to world space for distance calculation\n\n\t\t\t\t\t\tconst distance = raycaster.ray.origin.distanceTo(interRay);\n\t\t\t\t\t\tif (distance < raycaster.near || distance > raycaster.far) continue;\n\t\t\t\t\t\tintersects.push({\n\t\t\t\t\t\t\tdistance: distance,\n\t\t\t\t\t\t\t// What do we want? intersection point on the ray or on the segment??\n\t\t\t\t\t\t\t// point: raycaster.ray.at( distance ),\n\t\t\t\t\t\t\tpoint: interSegment.clone().applyMatrix4(this.matrixWorld),\n\t\t\t\t\t\t\tindex: i,\n\t\t\t\t\t\t\tface: null,\n\t\t\t\t\t\t\tfaceIndex: null,\n\t\t\t\t\t\t\tobject: this\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (geometry.isGeometry) {\n\t\t\t\tconsole.error('THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.');\n\t\t\t}\n\t\t}\n\n\t\tupdateMorphTargets() {\n\t\t\tconst geometry = this.geometry;\n\n\t\t\tif (geometry.isBufferGeometry) {\n\t\t\t\tconst morphAttributes = geometry.morphAttributes;\n\t\t\t\tconst keys = Object.keys(morphAttributes);\n\n\t\t\t\tif (keys.length > 0) {\n\t\t\t\t\tconst morphAttribute = morphAttributes[keys[0]];\n\n\t\t\t\t\tif (morphAttribute !== undefined) {\n\t\t\t\t\t\tthis.morphTargetInfluences = [];\n\t\t\t\t\t\tthis.morphTargetDictionary = {};\n\n\t\t\t\t\t\tfor (let m = 0, ml = morphAttribute.length; m < ml; m++) {\n\t\t\t\t\t\t\tconst name = morphAttribute[m].name || String(m);\n\t\t\t\t\t\t\tthis.morphTargetInfluences.push(0);\n\t\t\t\t\t\t\tthis.morphTargetDictionary[name] = m;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst morphTargets = geometry.morphTargets;\n\n\t\t\t\tif (morphTargets !== undefined && morphTargets.length > 0) {\n\t\t\t\t\tconsole.error('THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}\n\n\tLine.prototype.isLine = true;\n\n\tconst _start = /*@__PURE__*/new Vector3();\n\n\tconst _end = /*@__PURE__*/new Vector3();\n\n\tclass LineSegments extends Line {\n\t\tconstructor(geometry, material) {\n\t\t\tsuper(geometry, material);\n\t\t\tthis.type = 'LineSegments';\n\t\t}\n\n\t\tcomputeLineDistances() {\n\t\t\tconst geometry = this.geometry;\n\n\t\t\tif (geometry.isBufferGeometry) {\n\t\t\t\t// we assume non-indexed geometry\n\t\t\t\tif (geometry.index === null) {\n\t\t\t\t\tconst positionAttribute = geometry.attributes.position;\n\t\t\t\t\tconst lineDistances = [];\n\n\t\t\t\t\tfor (let i = 0, l = positionAttribute.count; i < l; i += 2) {\n\t\t\t\t\t\t_start.fromBufferAttribute(positionAttribute, i);\n\n\t\t\t\t\t\t_end.fromBufferAttribute(positionAttribute, i + 1);\n\n\t\t\t\t\t\tlineDistances[i] = i === 0 ? 0 : lineDistances[i - 1];\n\t\t\t\t\t\tlineDistances[i + 1] = lineDistances[i] + _start.distanceTo(_end);\n\t\t\t\t\t}\n\n\t\t\t\t\tgeometry.setAttribute('lineDistance', new Float32BufferAttribute(lineDistances, 1));\n\t\t\t\t} else {\n\t\t\t\t\tconsole.warn('THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.');\n\t\t\t\t}\n\t\t\t} else if (geometry.isGeometry) {\n\t\t\t\tconsole.error('THREE.LineSegments.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.');\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tLineSegments.prototype.isLineSegments = true;\n\n\tclass LineLoop extends Line {\n\t\tconstructor(geometry, material) {\n\t\t\tsuper(geometry, material);\n\t\t\tthis.type = 'LineLoop';\n\t\t}\n\n\t}\n\n\tLineLoop.prototype.isLineLoop = true;\n\n\t/**\n\t * parameters = {\n\t *\tcolor: <hex>,\n\t *\topacity: <float>,\n\t *\tmap: new THREE.Texture( <Image> ),\n\t *\talphaMap: new THREE.Texture( <Image> ),\n\t *\n\t *\tsize: <float>,\n\t *\tsizeAttenuation: <bool>\n\t *\n\t * }\n\t */\n\n\tclass PointsMaterial extends Material {\n\t\tconstructor(parameters) {\n\t\t\tsuper();\n\t\t\tthis.type = 'PointsMaterial';\n\t\t\tthis.color = new Color(0xffffff);\n\t\t\tthis.map = null;\n\t\t\tthis.alphaMap = null;\n\t\t\tthis.size = 1;\n\t\t\tthis.sizeAttenuation = true;\n\t\t\tthis.setValues(parameters);\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.color.copy(source.color);\n\t\t\tthis.map = source.map;\n\t\t\tthis.alphaMap = source.alphaMap;\n\t\t\tthis.size = source.size;\n\t\t\tthis.sizeAttenuation = source.sizeAttenuation;\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tPointsMaterial.prototype.isPointsMaterial = true;\n\n\tconst _inverseMatrix = /*@__PURE__*/new Matrix4();\n\n\tconst _ray = /*@__PURE__*/new Ray();\n\n\tconst _sphere = /*@__PURE__*/new Sphere();\n\n\tconst _position$2 = /*@__PURE__*/new Vector3();\n\n\tclass Points extends Object3D {\n\t\tconstructor(geometry = new BufferGeometry(), material = new PointsMaterial()) {\n\t\t\tsuper();\n\t\t\tthis.type = 'Points';\n\t\t\tthis.geometry = geometry;\n\t\t\tthis.material = material;\n\t\t\tthis.updateMorphTargets();\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.material = source.material;\n\t\t\tthis.geometry = source.geometry;\n\t\t\treturn this;\n\t\t}\n\n\t\traycast(raycaster, intersects) {\n\t\t\tconst geometry = this.geometry;\n\t\t\tconst matrixWorld = this.matrixWorld;\n\t\t\tconst threshold = raycaster.params.Points.threshold;\n\t\t\tconst drawRange = geometry.drawRange; // Checking boundingSphere distance to ray\n\n\t\t\tif (geometry.boundingSphere === null) geometry.computeBoundingSphere();\n\n\t\t\t_sphere.copy(geometry.boundingSphere);\n\n\t\t\t_sphere.applyMatrix4(matrixWorld);\n\n\t\t\t_sphere.radius += threshold;\n\t\t\tif (raycaster.ray.intersectsSphere(_sphere) === false) return; //\n\n\t\t\t_inverseMatrix.copy(matrixWorld).invert();\n\n\t\t\t_ray.copy(raycaster.ray).applyMatrix4(_inverseMatrix);\n\n\t\t\tconst localThreshold = threshold / ((this.scale.x + this.scale.y + this.scale.z) / 3);\n\t\t\tconst localThresholdSq = localThreshold * localThreshold;\n\n\t\t\tif (geometry.isBufferGeometry) {\n\t\t\t\tconst index = geometry.index;\n\t\t\t\tconst attributes = geometry.attributes;\n\t\t\t\tconst positionAttribute = attributes.position;\n\n\t\t\t\tif (index !== null) {\n\t\t\t\t\tconst start = Math.max(0, drawRange.start);\n\t\t\t\t\tconst end = Math.min(index.count, drawRange.start + drawRange.count);\n\n\t\t\t\t\tfor (let i = start, il = end; i < il; i++) {\n\t\t\t\t\t\tconst a = index.getX(i);\n\n\t\t\t\t\t\t_position$2.fromBufferAttribute(positionAttribute, a);\n\n\t\t\t\t\t\ttestPoint(_position$2, a, localThresholdSq, matrixWorld, raycaster, intersects, this);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconst start = Math.max(0, drawRange.start);\n\t\t\t\t\tconst end = Math.min(positionAttribute.count, drawRange.start + drawRange.count);\n\n\t\t\t\t\tfor (let i = start, l = end; i < l; i++) {\n\t\t\t\t\t\t_position$2.fromBufferAttribute(positionAttribute, i);\n\n\t\t\t\t\t\ttestPoint(_position$2, i, localThresholdSq, matrixWorld, raycaster, intersects, this);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconsole.error('THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.');\n\t\t\t}\n\t\t}\n\n\t\tupdateMorphTargets() {\n\t\t\tconst geometry = this.geometry;\n\n\t\t\tif (geometry.isBufferGeometry) {\n\t\t\t\tconst morphAttributes = geometry.morphAttributes;\n\t\t\t\tconst keys = Object.keys(morphAttributes);\n\n\t\t\t\tif (keys.length > 0) {\n\t\t\t\t\tconst morphAttribute = morphAttributes[keys[0]];\n\n\t\t\t\t\tif (morphAttribute !== undefined) {\n\t\t\t\t\t\tthis.morphTargetInfluences = [];\n\t\t\t\t\t\tthis.morphTargetDictionary = {};\n\n\t\t\t\t\t\tfor (let m = 0, ml = morphAttribute.length; m < ml; m++) {\n\t\t\t\t\t\t\tconst name = morphAttribute[m].name || String(m);\n\t\t\t\t\t\t\tthis.morphTargetInfluences.push(0);\n\t\t\t\t\t\t\tthis.morphTargetDictionary[name] = m;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst morphTargets = geometry.morphTargets;\n\n\t\t\t\tif (morphTargets !== undefined && morphTargets.length > 0) {\n\t\t\t\t\tconsole.error('THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}\n\n\tPoints.prototype.isPoints = true;\n\n\tfunction testPoint(point, index, localThresholdSq, matrixWorld, raycaster, intersects, object) {\n\t\tconst rayPointDistanceSq = _ray.distanceSqToPoint(point);\n\n\t\tif (rayPointDistanceSq < localThresholdSq) {\n\t\t\tconst intersectPoint = new Vector3();\n\n\t\t\t_ray.closestPointToPoint(point, intersectPoint);\n\n\t\t\tintersectPoint.applyMatrix4(matrixWorld);\n\t\t\tconst distance = raycaster.ray.origin.distanceTo(intersectPoint);\n\t\t\tif (distance < raycaster.near || distance > raycaster.far) return;\n\t\t\tintersects.push({\n\t\t\t\tdistance: distance,\n\t\t\t\tdistanceToRay: Math.sqrt(rayPointDistanceSq),\n\t\t\t\tpoint: intersectPoint,\n\t\t\t\tindex: index,\n\t\t\t\tface: null,\n\t\t\t\tobject: object\n\t\t\t});\n\t\t}\n\t}\n\n\tclass VideoTexture extends Texture {\n\t\tconstructor(video, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy) {\n\t\t\tsuper(video, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy);\n\t\t\tthis.format = format !== undefined ? format : RGBFormat;\n\t\t\tthis.minFilter = minFilter !== undefined ? minFilter : LinearFilter;\n\t\t\tthis.magFilter = magFilter !== undefined ? magFilter : LinearFilter;\n\t\t\tthis.generateMipmaps = false;\n\t\t\tconst scope = this;\n\n\t\t\tfunction updateVideo() {\n\t\t\t\tscope.needsUpdate = true;\n\t\t\t\tvideo.requestVideoFrameCallback(updateVideo);\n\t\t\t}\n\n\t\t\tif ('requestVideoFrameCallback' in video) {\n\t\t\t\tvideo.requestVideoFrameCallback(updateVideo);\n\t\t\t}\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new this.constructor(this.image).copy(this);\n\t\t}\n\n\t\tupdate() {\n\t\t\tconst video = this.image;\n\t\t\tconst hasVideoFrameCallback = ('requestVideoFrameCallback' in video);\n\n\t\t\tif (hasVideoFrameCallback === false && video.readyState >= video.HAVE_CURRENT_DATA) {\n\t\t\t\tthis.needsUpdate = true;\n\t\t\t}\n\t\t}\n\n\t}\n\n\tVideoTexture.prototype.isVideoTexture = true;\n\n\tclass CompressedTexture extends Texture {\n\t\tconstructor(mipmaps, width, height, format, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, encoding) {\n\t\t\tsuper(null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding);\n\t\t\tthis.image = {\n\t\t\t\twidth: width,\n\t\t\t\theight: height\n\t\t\t};\n\t\t\tthis.mipmaps = mipmaps; // no flipping for cube textures\n\t\t\t// (also flipping doesn't work for compressed textures )\n\n\t\t\tthis.flipY = false; // can't generate mipmaps for compressed textures\n\t\t\t// mips must be embedded in DDS files\n\n\t\t\tthis.generateMipmaps = false;\n\t\t}\n\n\t}\n\n\tCompressedTexture.prototype.isCompressedTexture = true;\n\n\tclass CanvasTexture extends Texture {\n\t\tconstructor(canvas, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy) {\n\t\t\tsuper(canvas, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy);\n\t\t\tthis.needsUpdate = true;\n\t\t}\n\n\t}\n\n\tCanvasTexture.prototype.isCanvasTexture = true;\n\n\tclass DepthTexture extends Texture {\n\t\tconstructor(width, height, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, format) {\n\t\t\tformat = format !== undefined ? format : DepthFormat;\n\n\t\t\tif (format !== DepthFormat && format !== DepthStencilFormat) {\n\t\t\t\tthrow new Error('DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat');\n\t\t\t}\n\n\t\t\tif (type === undefined && format === DepthFormat) type = UnsignedShortType;\n\t\t\tif (type === undefined && format === DepthStencilFormat) type = UnsignedInt248Type;\n\t\t\tsuper(null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy);\n\t\t\tthis.image = {\n\t\t\t\twidth: width,\n\t\t\t\theight: height\n\t\t\t};\n\t\t\tthis.magFilter = magFilter !== undefined ? magFilter : NearestFilter;\n\t\t\tthis.minFilter = minFilter !== undefined ? minFilter : NearestFilter;\n\t\t\tthis.flipY = false;\n\t\t\tthis.generateMipmaps = false;\n\t\t}\n\n\t}\n\n\tDepthTexture.prototype.isDepthTexture = true;\n\n\tclass CircleGeometry extends BufferGeometry {\n\t\tconstructor(radius = 1, segments = 8, thetaStart = 0, thetaLength = Math.PI * 2) {\n\t\t\tsuper();\n\t\t\tthis.type = 'CircleGeometry';\n\t\t\tthis.parameters = {\n\t\t\t\tradius: radius,\n\t\t\t\tsegments: segments,\n\t\t\t\tthetaStart: thetaStart,\n\t\t\t\tthetaLength: thetaLength\n\t\t\t};\n\t\t\tsegments = Math.max(3, segments); // buffers\n\n\t\t\tconst indices = [];\n\t\t\tconst vertices = [];\n\t\t\tconst normals = [];\n\t\t\tconst uvs = []; // helper variables\n\n\t\t\tconst vertex = new Vector3();\n\t\t\tconst uv = new Vector2(); // center point\n\n\t\t\tvertices.push(0, 0, 0);\n\t\t\tnormals.push(0, 0, 1);\n\t\t\tuvs.push(0.5, 0.5);\n\n\t\t\tfor (let s = 0, i = 3; s <= segments; s++, i += 3) {\n\t\t\t\tconst segment = thetaStart + s / segments * thetaLength; // vertex\n\n\t\t\t\tvertex.x = radius * Math.cos(segment);\n\t\t\t\tvertex.y = radius * Math.sin(segment);\n\t\t\t\tvertices.push(vertex.x, vertex.y, vertex.z); // normal\n\n\t\t\t\tnormals.push(0, 0, 1); // uvs\n\n\t\t\t\tuv.x = (vertices[i] / radius + 1) / 2;\n\t\t\t\tuv.y = (vertices[i + 1] / radius + 1) / 2;\n\t\t\t\tuvs.push(uv.x, uv.y);\n\t\t\t} // indices\n\n\n\t\t\tfor (let i = 1; i <= segments; i++) {\n\t\t\t\tindices.push(i, i + 1, 0);\n\t\t\t} // build geometry\n\n\n\t\t\tthis.setIndex(indices);\n\t\t\tthis.setAttribute('position', new Float32BufferAttribute(vertices, 3));\n\t\t\tthis.setAttribute('normal', new Float32BufferAttribute(normals, 3));\n\t\t\tthis.setAttribute('uv', new Float32BufferAttribute(uvs, 2));\n\t\t}\n\n\t\tstatic fromJSON(data) {\n\t\t\treturn new CircleGeometry(data.radius, data.segments, data.thetaStart, data.thetaLength);\n\t\t}\n\n\t}\n\n\tclass CylinderGeometry extends BufferGeometry {\n\t\tconstructor(radiusTop = 1, radiusBottom = 1, height = 1, radialSegments = 8, heightSegments = 1, openEnded = false, thetaStart = 0, thetaLength = Math.PI * 2) {\n\t\t\tsuper();\n\t\t\tthis.type = 'CylinderGeometry';\n\t\t\tthis.parameters = {\n\t\t\t\tradiusTop: radiusTop,\n\t\t\t\tradiusBottom: radiusBottom,\n\t\t\t\theight: height,\n\t\t\t\tradialSegments: radialSegments,\n\t\t\t\theightSegments: heightSegments,\n\t\t\t\topenEnded: openEnded,\n\t\t\t\tthetaStart: thetaStart,\n\t\t\t\tthetaLength: thetaLength\n\t\t\t};\n\t\t\tconst scope = this;\n\t\t\tradialSegments = Math.floor(radialSegments);\n\t\t\theightSegments = Math.floor(heightSegments); // buffers\n\n\t\t\tconst indices = [];\n\t\t\tconst vertices = [];\n\t\t\tconst normals = [];\n\t\t\tconst uvs = []; // helper variables\n\n\t\t\tlet index = 0;\n\t\t\tconst indexArray = [];\n\t\t\tconst halfHeight = height / 2;\n\t\t\tlet groupStart = 0; // generate geometry\n\n\t\t\tgenerateTorso();\n\n\t\t\tif (openEnded === false) {\n\t\t\t\tif (radiusTop > 0) generateCap(true);\n\t\t\t\tif (radiusBottom > 0) generateCap(false);\n\t\t\t} // build geometry\n\n\n\t\t\tthis.setIndex(indices);\n\t\t\tthis.setAttribute('position', new Float32BufferAttribute(vertices, 3));\n\t\t\tthis.setAttribute('normal', new Float32BufferAttribute(normals, 3));\n\t\t\tthis.setAttribute('uv', new Float32BufferAttribute(uvs, 2));\n\n\t\t\tfunction generateTorso() {\n\t\t\t\tconst normal = new Vector3();\n\t\t\t\tconst vertex = new Vector3();\n\t\t\t\tlet groupCount = 0; // this will be used to calculate the normal\n\n\t\t\t\tconst slope = (radiusBottom - radiusTop) / height; // generate vertices, normals and uvs\n\n\t\t\t\tfor (let y = 0; y <= heightSegments; y++) {\n\t\t\t\t\tconst indexRow = [];\n\t\t\t\t\tconst v = y / heightSegments; // calculate the radius of the current row\n\n\t\t\t\t\tconst radius = v * (radiusBottom - radiusTop) + radiusTop;\n\n\t\t\t\t\tfor (let x = 0; x <= radialSegments; x++) {\n\t\t\t\t\t\tconst u = x / radialSegments;\n\t\t\t\t\t\tconst theta = u * thetaLength + thetaStart;\n\t\t\t\t\t\tconst sinTheta = Math.sin(theta);\n\t\t\t\t\t\tconst cosTheta = Math.cos(theta); // vertex\n\n\t\t\t\t\t\tvertex.x = radius * sinTheta;\n\t\t\t\t\t\tvertex.y = -v * height + halfHeight;\n\t\t\t\t\t\tvertex.z = radius * cosTheta;\n\t\t\t\t\t\tvertices.push(vertex.x, vertex.y, vertex.z); // normal\n\n\t\t\t\t\t\tnormal.set(sinTheta, slope, cosTheta).normalize();\n\t\t\t\t\t\tnormals.push(normal.x, normal.y, normal.z); // uv\n\n\t\t\t\t\t\tuvs.push(u, 1 - v); // save index of vertex in respective row\n\n\t\t\t\t\t\tindexRow.push(index++);\n\t\t\t\t\t} // now save vertices of the row in our index array\n\n\n\t\t\t\t\tindexArray.push(indexRow);\n\t\t\t\t} // generate indices\n\n\n\t\t\t\tfor (let x = 0; x < radialSegments; x++) {\n\t\t\t\t\tfor (let y = 0; y < heightSegments; y++) {\n\t\t\t\t\t\t// we use the index array to access the correct indices\n\t\t\t\t\t\tconst a = indexArray[y][x];\n\t\t\t\t\t\tconst b = indexArray[y + 1][x];\n\t\t\t\t\t\tconst c = indexArray[y + 1][x + 1];\n\t\t\t\t\t\tconst d = indexArray[y][x + 1]; // faces\n\n\t\t\t\t\t\tindices.push(a, b, d);\n\t\t\t\t\t\tindices.push(b, c, d); // update group counter\n\n\t\t\t\t\t\tgroupCount += 6;\n\t\t\t\t\t}\n\t\t\t\t} // add a group to the geometry. this will ensure multi material support\n\n\n\t\t\t\tscope.addGroup(groupStart, groupCount, 0); // calculate new start value for groups\n\n\t\t\t\tgroupStart += groupCount;\n\t\t\t}\n\n\t\t\tfunction generateCap(top) {\n\t\t\t\t// save the index of the first center vertex\n\t\t\t\tconst centerIndexStart = index;\n\t\t\t\tconst uv = new Vector2();\n\t\t\t\tconst vertex = new Vector3();\n\t\t\t\tlet groupCount = 0;\n\t\t\t\tconst radius = top === true ? radiusTop : radiusBottom;\n\t\t\t\tconst sign = top === true ? 1 : -1; // first we generate the center vertex data of the cap.\n\t\t\t\t// because the geometry needs one set of uvs per face,\n\t\t\t\t// we must generate a center vertex per face/segment\n\n\t\t\t\tfor (let x = 1; x <= radialSegments; x++) {\n\t\t\t\t\t// vertex\n\t\t\t\t\tvertices.push(0, halfHeight * sign, 0); // normal\n\n\t\t\t\t\tnormals.push(0, sign, 0); // uv\n\n\t\t\t\t\tuvs.push(0.5, 0.5); // increase index\n\n\t\t\t\t\tindex++;\n\t\t\t\t} // save the index of the last center vertex\n\n\n\t\t\t\tconst centerIndexEnd = index; // now we generate the surrounding vertices, normals and uvs\n\n\t\t\t\tfor (let x = 0; x <= radialSegments; x++) {\n\t\t\t\t\tconst u = x / radialSegments;\n\t\t\t\t\tconst theta = u * thetaLength + thetaStart;\n\t\t\t\t\tconst cosTheta = Math.cos(theta);\n\t\t\t\t\tconst sinTheta = Math.sin(theta); // vertex\n\n\t\t\t\t\tvertex.x = radius * sinTheta;\n\t\t\t\t\tvertex.y = halfHeight * sign;\n\t\t\t\t\tvertex.z = radius * cosTheta;\n\t\t\t\t\tvertices.push(vertex.x, vertex.y, vertex.z); // normal\n\n\t\t\t\t\tnormals.push(0, sign, 0); // uv\n\n\t\t\t\t\tuv.x = cosTheta * 0.5 + 0.5;\n\t\t\t\t\tuv.y = sinTheta * 0.5 * sign + 0.5;\n\t\t\t\t\tuvs.push(uv.x, uv.y); // increase index\n\n\t\t\t\t\tindex++;\n\t\t\t\t} // generate indices\n\n\n\t\t\t\tfor (let x = 0; x < radialSegments; x++) {\n\t\t\t\t\tconst c = centerIndexStart + x;\n\t\t\t\t\tconst i = centerIndexEnd + x;\n\n\t\t\t\t\tif (top === true) {\n\t\t\t\t\t\t// face top\n\t\t\t\t\t\tindices.push(i, i + 1, c);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// face bottom\n\t\t\t\t\t\tindices.push(i + 1, i, c);\n\t\t\t\t\t}\n\n\t\t\t\t\tgroupCount += 3;\n\t\t\t\t} // add a group to the geometry. this will ensure multi material support\n\n\n\t\t\t\tscope.addGroup(groupStart, groupCount, top === true ? 1 : 2); // calculate new start value for groups\n\n\t\t\t\tgroupStart += groupCount;\n\t\t\t}\n\t\t}\n\n\t\tstatic fromJSON(data) {\n\t\t\treturn new CylinderGeometry(data.radiusTop, data.radiusBottom, data.height, data.radialSegments, data.heightSegments, data.openEnded, data.thetaStart, data.thetaLength);\n\t\t}\n\n\t}\n\n\tclass ConeGeometry extends CylinderGeometry {\n\t\tconstructor(radius = 1, height = 1, radialSegments = 8, heightSegments = 1, openEnded = false, thetaStart = 0, thetaLength = Math.PI * 2) {\n\t\t\tsuper(0, radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength);\n\t\t\tthis.type = 'ConeGeometry';\n\t\t\tthis.parameters = {\n\t\t\t\tradius: radius,\n\t\t\t\theight: height,\n\t\t\t\tradialSegments: radialSegments,\n\t\t\t\theightSegments: heightSegments,\n\t\t\t\topenEnded: openEnded,\n\t\t\t\tthetaStart: thetaStart,\n\t\t\t\tthetaLength: thetaLength\n\t\t\t};\n\t\t}\n\n\t\tstatic fromJSON(data) {\n\t\t\treturn new ConeGeometry(data.radius, data.height, data.radialSegments, data.heightSegments, data.openEnded, data.thetaStart, data.thetaLength);\n\t\t}\n\n\t}\n\n\tclass PolyhedronGeometry extends BufferGeometry {\n\t\tconstructor(vertices = [], indices = [], radius = 1, detail = 0) {\n\t\t\tsuper();\n\t\t\tthis.type = 'PolyhedronGeometry';\n\t\t\tthis.parameters = {\n\t\t\t\tvertices: vertices,\n\t\t\t\tindices: indices,\n\t\t\t\tradius: radius,\n\t\t\t\tdetail: detail\n\t\t\t}; // default buffer data\n\n\t\t\tconst vertexBuffer = [];\n\t\t\tconst uvBuffer = []; // the subdivision creates the vertex buffer data\n\n\t\t\tsubdivide(detail); // all vertices should lie on a conceptual sphere with a given radius\n\n\t\t\tapplyRadius(radius); // finally, create the uv data\n\n\t\t\tgenerateUVs(); // build non-indexed geometry\n\n\t\t\tthis.setAttribute('position', new Float32BufferAttribute(vertexBuffer, 3));\n\t\t\tthis.setAttribute('normal', new Float32BufferAttribute(vertexBuffer.slice(), 3));\n\t\t\tthis.setAttribute('uv', new Float32BufferAttribute(uvBuffer, 2));\n\n\t\t\tif (detail === 0) {\n\t\t\t\tthis.computeVertexNormals(); // flat normals\n\t\t\t} else {\n\t\t\t\tthis.normalizeNormals(); // smooth normals\n\t\t\t} // helper functions\n\n\n\t\t\tfunction subdivide(detail) {\n\t\t\t\tconst a = new Vector3();\n\t\t\t\tconst b = new Vector3();\n\t\t\t\tconst c = new Vector3(); // iterate over all faces and apply a subdivison with the given detail value\n\n\t\t\t\tfor (let i = 0; i < indices.length; i += 3) {\n\t\t\t\t\t// get the vertices of the face\n\t\t\t\t\tgetVertexByIndex(indices[i + 0], a);\n\t\t\t\t\tgetVertexByIndex(indices[i + 1], b);\n\t\t\t\t\tgetVertexByIndex(indices[i + 2], c); // perform subdivision\n\n\t\t\t\t\tsubdivideFace(a, b, c, detail);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction subdivideFace(a, b, c, detail) {\n\t\t\t\tconst cols = detail + 1; // we use this multidimensional array as a data structure for creating the subdivision\n\n\t\t\t\tconst v = []; // construct all of the vertices for this subdivision\n\n\t\t\t\tfor (let i = 0; i <= cols; i++) {\n\t\t\t\t\tv[i] = [];\n\t\t\t\t\tconst aj = a.clone().lerp(c, i / cols);\n\t\t\t\t\tconst bj = b.clone().lerp(c, i / cols);\n\t\t\t\t\tconst rows = cols - i;\n\n\t\t\t\t\tfor (let j = 0; j <= rows; j++) {\n\t\t\t\t\t\tif (j === 0 && i === cols) {\n\t\t\t\t\t\t\tv[i][j] = aj;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tv[i][j] = aj.clone().lerp(bj, j / rows);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} // construct all of the faces\n\n\n\t\t\t\tfor (let i = 0; i < cols; i++) {\n\t\t\t\t\tfor (let j = 0; j < 2 * (cols - i) - 1; j++) {\n\t\t\t\t\t\tconst k = Math.floor(j / 2);\n\n\t\t\t\t\t\tif (j % 2 === 0) {\n\t\t\t\t\t\t\tpushVertex(v[i][k + 1]);\n\t\t\t\t\t\t\tpushVertex(v[i + 1][k]);\n\t\t\t\t\t\t\tpushVertex(v[i][k]);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tpushVertex(v[i][k + 1]);\n\t\t\t\t\t\t\tpushVertex(v[i + 1][k + 1]);\n\t\t\t\t\t\t\tpushVertex(v[i + 1][k]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction applyRadius(radius) {\n\t\t\t\tconst vertex = new Vector3(); // iterate over the entire buffer and apply the radius to each vertex\n\n\t\t\t\tfor (let i = 0; i < vertexBuffer.length; i += 3) {\n\t\t\t\t\tvertex.x = vertexBuffer[i + 0];\n\t\t\t\t\tvertex.y = vertexBuffer[i + 1];\n\t\t\t\t\tvertex.z = vertexBuffer[i + 2];\n\t\t\t\t\tvertex.normalize().multiplyScalar(radius);\n\t\t\t\t\tvertexBuffer[i + 0] = vertex.x;\n\t\t\t\t\tvertexBuffer[i + 1] = vertex.y;\n\t\t\t\t\tvertexBuffer[i + 2] = vertex.z;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction generateUVs() {\n\t\t\t\tconst vertex = new Vector3();\n\n\t\t\t\tfor (let i = 0; i < vertexBuffer.length; i += 3) {\n\t\t\t\t\tvertex.x = vertexBuffer[i + 0];\n\t\t\t\t\tvertex.y = vertexBuffer[i + 1];\n\t\t\t\t\tvertex.z = vertexBuffer[i + 2];\n\t\t\t\t\tconst u = azimuth(vertex) / 2 / Math.PI + 0.5;\n\t\t\t\t\tconst v = inclination(vertex) / Math.PI + 0.5;\n\t\t\t\t\tuvBuffer.push(u, 1 - v);\n\t\t\t\t}\n\n\t\t\t\tcorrectUVs();\n\t\t\t\tcorrectSeam();\n\t\t\t}\n\n\t\t\tfunction correctSeam() {\n\t\t\t\t// handle case when face straddles the seam, see #3269\n\t\t\t\tfor (let i = 0; i < uvBuffer.length; i += 6) {\n\t\t\t\t\t// uv data of a single face\n\t\t\t\t\tconst x0 = uvBuffer[i + 0];\n\t\t\t\t\tconst x1 = uvBuffer[i + 2];\n\t\t\t\t\tconst x2 = uvBuffer[i + 4];\n\t\t\t\t\tconst max = Math.max(x0, x1, x2);\n\t\t\t\t\tconst min = Math.min(x0, x1, x2); // 0.9 is somewhat arbitrary\n\n\t\t\t\t\tif (max > 0.9 && min < 0.1) {\n\t\t\t\t\t\tif (x0 < 0.2) uvBuffer[i + 0] += 1;\n\t\t\t\t\t\tif (x1 < 0.2) uvBuffer[i + 2] += 1;\n\t\t\t\t\t\tif (x2 < 0.2) uvBuffer[i + 4] += 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction pushVertex(vertex) {\n\t\t\t\tvertexBuffer.push(vertex.x, vertex.y, vertex.z);\n\t\t\t}\n\n\t\t\tfunction getVertexByIndex(index, vertex) {\n\t\t\t\tconst stride = index * 3;\n\t\t\t\tvertex.x = vertices[stride + 0];\n\t\t\t\tvertex.y = vertices[stride + 1];\n\t\t\t\tvertex.z = vertices[stride + 2];\n\t\t\t}\n\n\t\t\tfunction correctUVs() {\n\t\t\t\tconst a = new Vector3();\n\t\t\t\tconst b = new Vector3();\n\t\t\t\tconst c = new Vector3();\n\t\t\t\tconst centroid = new Vector3();\n\t\t\t\tconst uvA = new Vector2();\n\t\t\t\tconst uvB = new Vector2();\n\t\t\t\tconst uvC = new Vector2();\n\n\t\t\t\tfor (let i = 0, j = 0; i < vertexBuffer.length; i += 9, j += 6) {\n\t\t\t\t\ta.set(vertexBuffer[i + 0], vertexBuffer[i + 1], vertexBuffer[i + 2]);\n\t\t\t\t\tb.set(vertexBuffer[i + 3], vertexBuffer[i + 4], vertexBuffer[i + 5]);\n\t\t\t\t\tc.set(vertexBuffer[i + 6], vertexBuffer[i + 7], vertexBuffer[i + 8]);\n\t\t\t\t\tuvA.set(uvBuffer[j + 0], uvBuffer[j + 1]);\n\t\t\t\t\tuvB.set(uvBuffer[j + 2], uvBuffer[j + 3]);\n\t\t\t\t\tuvC.set(uvBuffer[j + 4], uvBuffer[j + 5]);\n\t\t\t\t\tcentroid.copy(a).add(b).add(c).divideScalar(3);\n\t\t\t\t\tconst azi = azimuth(centroid);\n\t\t\t\t\tcorrectUV(uvA, j + 0, a, azi);\n\t\t\t\t\tcorrectUV(uvB, j + 2, b, azi);\n\t\t\t\t\tcorrectUV(uvC, j + 4, c, azi);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction correctUV(uv, stride, vector, azimuth) {\n\t\t\t\tif (azimuth < 0 && uv.x === 1) {\n\t\t\t\t\tuvBuffer[stride] = uv.x - 1;\n\t\t\t\t}\n\n\t\t\t\tif (vector.x === 0 && vector.z === 0) {\n\t\t\t\t\tuvBuffer[stride] = azimuth / 2 / Math.PI + 0.5;\n\t\t\t\t}\n\t\t\t} // Angle around the Y axis, counter-clockwise when looking from above.\n\n\n\t\t\tfunction azimuth(vector) {\n\t\t\t\treturn Math.atan2(vector.z, -vector.x);\n\t\t\t} // Angle above the XZ plane.\n\n\n\t\t\tfunction inclination(vector) {\n\t\t\t\treturn Math.atan2(-vector.y, Math.sqrt(vector.x * vector.x + vector.z * vector.z));\n\t\t\t}\n\t\t}\n\n\t\tstatic fromJSON(data) {\n\t\t\treturn new PolyhedronGeometry(data.vertices, data.indices, data.radius, data.details);\n\t\t}\n\n\t}\n\n\tclass DodecahedronGeometry extends PolyhedronGeometry {\n\t\tconstructor(radius = 1, detail = 0) {\n\t\t\tconst t = (1 + Math.sqrt(5)) / 2;\n\t\t\tconst r = 1 / t;\n\t\t\tconst vertices = [// (±1, ±1, ±1)\n\t\t\t-1, -1, -1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, -1, -1, 1, -1, 1, 1, 1, -1, 1, 1, 1, // (0, ±1/φ, ±φ)\n\t\t\t0, -r, -t, 0, -r, t, 0, r, -t, 0, r, t, // (±1/φ, ±φ, 0)\n\t\t\t-r, -t, 0, -r, t, 0, r, -t, 0, r, t, 0, // (±φ, 0, ±1/φ)\n\t\t\t-t, 0, -r, t, 0, -r, -t, 0, r, t, 0, r];\n\t\t\tconst indices = [3, 11, 7, 3, 7, 15, 3, 15, 13, 7, 19, 17, 7, 17, 6, 7, 6, 15, 17, 4, 8, 17, 8, 10, 17, 10, 6, 8, 0, 16, 8, 16, 2, 8, 2, 10, 0, 12, 1, 0, 1, 18, 0, 18, 16, 6, 10, 2, 6, 2, 13, 6, 13, 15, 2, 16, 18, 2, 18, 3, 2, 3, 13, 18, 1, 9, 18, 9, 11, 18, 11, 3, 4, 14, 12, 4, 12, 0, 4, 0, 8, 11, 9, 5, 11, 5, 19, 11, 19, 7, 19, 5, 14, 19, 14, 4, 19, 4, 17, 1, 12, 14, 1, 14, 5, 1, 5, 9];\n\t\t\tsuper(vertices, indices, radius, detail);\n\t\t\tthis.type = 'DodecahedronGeometry';\n\t\t\tthis.parameters = {\n\t\t\t\tradius: radius,\n\t\t\t\tdetail: detail\n\t\t\t};\n\t\t}\n\n\t\tstatic fromJSON(data) {\n\t\t\treturn new DodecahedronGeometry(data.radius, data.detail);\n\t\t}\n\n\t}\n\n\tconst _v0 = new Vector3();\n\n\tconst _v1$1 = new Vector3();\n\n\tconst _normal = new Vector3();\n\n\tconst _triangle = new Triangle();\n\n\tclass EdgesGeometry extends BufferGeometry {\n\t\tconstructor(geometry = null, thresholdAngle = 1) {\n\t\t\tsuper();\n\t\t\tthis.type = 'EdgesGeometry';\n\t\t\tthis.parameters = {\n\t\t\t\tgeometry: geometry,\n\t\t\t\tthresholdAngle: thresholdAngle\n\t\t\t};\n\n\t\t\tif (geometry !== null) {\n\t\t\t\tconst precisionPoints = 4;\n\t\t\t\tconst precision = Math.pow(10, precisionPoints);\n\t\t\t\tconst thresholdDot = Math.cos(DEG2RAD * thresholdAngle);\n\t\t\t\tconst indexAttr = geometry.getIndex();\n\t\t\t\tconst positionAttr = geometry.getAttribute('position');\n\t\t\t\tconst indexCount = indexAttr ? indexAttr.count : positionAttr.count;\n\t\t\t\tconst indexArr = [0, 0, 0];\n\t\t\t\tconst vertKeys = ['a', 'b', 'c'];\n\t\t\t\tconst hashes = new Array(3);\n\t\t\t\tconst edgeData = {};\n\t\t\t\tconst vertices = [];\n\n\t\t\t\tfor (let i = 0; i < indexCount; i += 3) {\n\t\t\t\t\tif (indexAttr) {\n\t\t\t\t\t\tindexArr[0] = indexAttr.getX(i);\n\t\t\t\t\t\tindexArr[1] = indexAttr.getX(i + 1);\n\t\t\t\t\t\tindexArr[2] = indexAttr.getX(i + 2);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tindexArr[0] = i;\n\t\t\t\t\t\tindexArr[1] = i + 1;\n\t\t\t\t\t\tindexArr[2] = i + 2;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst {\n\t\t\t\t\t\ta,\n\t\t\t\t\t\tb,\n\t\t\t\t\t\tc\n\t\t\t\t\t} = _triangle;\n\t\t\t\t\ta.fromBufferAttribute(positionAttr, indexArr[0]);\n\t\t\t\t\tb.fromBufferAttribute(positionAttr, indexArr[1]);\n\t\t\t\t\tc.fromBufferAttribute(positionAttr, indexArr[2]);\n\n\t\t\t\t\t_triangle.getNormal(_normal); // create hashes for the edge from the vertices\n\n\n\t\t\t\t\thashes[0] = `${Math.round(a.x * precision)},${Math.round(a.y * precision)},${Math.round(a.z * precision)}`;\n\t\t\t\t\thashes[1] = `${Math.round(b.x * precision)},${Math.round(b.y * precision)},${Math.round(b.z * precision)}`;\n\t\t\t\t\thashes[2] = `${Math.round(c.x * precision)},${Math.round(c.y * precision)},${Math.round(c.z * precision)}`; // skip degenerate triangles\n\n\t\t\t\t\tif (hashes[0] === hashes[1] || hashes[1] === hashes[2] || hashes[2] === hashes[0]) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t} // iterate over every edge\n\n\n\t\t\t\t\tfor (let j = 0; j < 3; j++) {\n\t\t\t\t\t\t// get the first and next vertex making up the edge\n\t\t\t\t\t\tconst jNext = (j + 1) % 3;\n\t\t\t\t\t\tconst vecHash0 = hashes[j];\n\t\t\t\t\t\tconst vecHash1 = hashes[jNext];\n\t\t\t\t\t\tconst v0 = _triangle[vertKeys[j]];\n\t\t\t\t\t\tconst v1 = _triangle[vertKeys[jNext]];\n\t\t\t\t\t\tconst hash = `${vecHash0}_${vecHash1}`;\n\t\t\t\t\t\tconst reverseHash = `${vecHash1}_${vecHash0}`;\n\n\t\t\t\t\t\tif (reverseHash in edgeData && edgeData[reverseHash]) {\n\t\t\t\t\t\t\t// if we found a sibling edge add it into the vertex array if\n\t\t\t\t\t\t\t// it meets the angle threshold and delete the edge from the map.\n\t\t\t\t\t\t\tif (_normal.dot(edgeData[reverseHash].normal) <= thresholdDot) {\n\t\t\t\t\t\t\t\tvertices.push(v0.x, v0.y, v0.z);\n\t\t\t\t\t\t\t\tvertices.push(v1.x, v1.y, v1.z);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tedgeData[reverseHash] = null;\n\t\t\t\t\t\t} else if (!(hash in edgeData)) {\n\t\t\t\t\t\t\t// if we've already got an edge here then skip adding a new one\n\t\t\t\t\t\t\tedgeData[hash] = {\n\t\t\t\t\t\t\t\tindex0: indexArr[j],\n\t\t\t\t\t\t\t\tindex1: indexArr[jNext],\n\t\t\t\t\t\t\t\tnormal: _normal.clone()\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} // iterate over all remaining, unmatched edges and add them to the vertex array\n\n\n\t\t\t\tfor (const key in edgeData) {\n\t\t\t\t\tif (edgeData[key]) {\n\t\t\t\t\t\tconst {\n\t\t\t\t\t\t\tindex0,\n\t\t\t\t\t\t\tindex1\n\t\t\t\t\t\t} = edgeData[key];\n\n\t\t\t\t\t\t_v0.fromBufferAttribute(positionAttr, index0);\n\n\t\t\t\t\t\t_v1$1.fromBufferAttribute(positionAttr, index1);\n\n\t\t\t\t\t\tvertices.push(_v0.x, _v0.y, _v0.z);\n\t\t\t\t\t\tvertices.push(_v1$1.x, _v1$1.y, _v1$1.z);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis.setAttribute('position', new Float32BufferAttribute(vertices, 3));\n\t\t\t}\n\t\t}\n\n\t}\n\n\t/**\n\t * Extensible curve object.\n\t *\n\t * Some common of curve methods:\n\t * .getPoint( t, optionalTarget ), .getTangent( t, optionalTarget )\n\t * .getPointAt( u, optionalTarget ), .getTangentAt( u, optionalTarget )\n\t * .getPoints(), .getSpacedPoints()\n\t * .getLength()\n\t * .updateArcLengths()\n\t *\n\t * This following curves inherit from THREE.Curve:\n\t *\n\t * -- 2D curves --\n\t * THREE.ArcCurve\n\t * THREE.CubicBezierCurve\n\t * THREE.EllipseCurve\n\t * THREE.LineCurve\n\t * THREE.QuadraticBezierCurve\n\t * THREE.SplineCurve\n\t *\n\t * -- 3D curves --\n\t * THREE.CatmullRomCurve3\n\t * THREE.CubicBezierCurve3\n\t * THREE.LineCurve3\n\t * THREE.QuadraticBezierCurve3\n\t *\n\t * A series of curves can be represented as a THREE.CurvePath.\n\t *\n\t **/\n\n\tclass Curve {\n\t\tconstructor() {\n\t\t\tthis.type = 'Curve';\n\t\t\tthis.arcLengthDivisions = 200;\n\t\t} // Virtual base class method to overwrite and implement in subclasses\n\t\t//\t- t [0 .. 1]\n\n\n\t\tgetPoint() {\n\t\t\tconsole.warn('THREE.Curve: .getPoint() not implemented.');\n\t\t\treturn null;\n\t\t} // Get point at relative position in curve according to arc length\n\t\t// - u [0 .. 1]\n\n\n\t\tgetPointAt(u, optionalTarget) {\n\t\t\tconst t = this.getUtoTmapping(u);\n\t\t\treturn this.getPoint(t, optionalTarget);\n\t\t} // Get sequence of points using getPoint( t )\n\n\n\t\tgetPoints(divisions = 5) {\n\t\t\tconst points = [];\n\n\t\t\tfor (let d = 0; d <= divisions; d++) {\n\t\t\t\tpoints.push(this.getPoint(d / divisions));\n\t\t\t}\n\n\t\t\treturn points;\n\t\t} // Get sequence of points using getPointAt( u )\n\n\n\t\tgetSpacedPoints(divisions = 5) {\n\t\t\tconst points = [];\n\n\t\t\tfor (let d = 0; d <= divisions; d++) {\n\t\t\t\tpoints.push(this.getPointAt(d / divisions));\n\t\t\t}\n\n\t\t\treturn points;\n\t\t} // Get total curve arc length\n\n\n\t\tgetLength() {\n\t\t\tconst lengths = this.getLengths();\n\t\t\treturn lengths[lengths.length - 1];\n\t\t} // Get list of cumulative segment lengths\n\n\n\t\tgetLengths(divisions = this.arcLengthDivisions) {\n\t\t\tif (this.cacheArcLengths && this.cacheArcLengths.length === divisions + 1 && !this.needsUpdate) {\n\t\t\t\treturn this.cacheArcLengths;\n\t\t\t}\n\n\t\t\tthis.needsUpdate = false;\n\t\t\tconst cache = [];\n\t\t\tlet current,\n\t\t\t\t\tlast = this.getPoint(0);\n\t\t\tlet sum = 0;\n\t\t\tcache.push(0);\n\n\t\t\tfor (let p = 1; p <= divisions; p++) {\n\t\t\t\tcurrent = this.getPoint(p / divisions);\n\t\t\t\tsum += current.distanceTo(last);\n\t\t\t\tcache.push(sum);\n\t\t\t\tlast = current;\n\t\t\t}\n\n\t\t\tthis.cacheArcLengths = cache;\n\t\t\treturn cache; // { sums: cache, sum: sum }; Sum is in the last element.\n\t\t}\n\n\t\tupdateArcLengths() {\n\t\t\tthis.needsUpdate = true;\n\t\t\tthis.getLengths();\n\t\t} // Given u ( 0 .. 1 ), get a t to find p. This gives you points which are equidistant\n\n\n\t\tgetUtoTmapping(u, distance) {\n\t\t\tconst arcLengths = this.getLengths();\n\t\t\tlet i = 0;\n\t\t\tconst il = arcLengths.length;\n\t\t\tlet targetArcLength; // The targeted u distance value to get\n\n\t\t\tif (distance) {\n\t\t\t\ttargetArcLength = distance;\n\t\t\t} else {\n\t\t\t\ttargetArcLength = u * arcLengths[il - 1];\n\t\t\t} // binary search for the index with largest value smaller than target u distance\n\n\n\t\t\tlet low = 0,\n\t\t\t\t\thigh = il - 1,\n\t\t\t\t\tcomparison;\n\n\t\t\twhile (low <= high) {\n\t\t\t\ti = Math.floor(low + (high - low) / 2); // less likely to overflow, though probably not issue here, JS doesn't really have integers, all numbers are floats\n\n\t\t\t\tcomparison = arcLengths[i] - targetArcLength;\n\n\t\t\t\tif (comparison < 0) {\n\t\t\t\t\tlow = i + 1;\n\t\t\t\t} else if (comparison > 0) {\n\t\t\t\t\thigh = i - 1;\n\t\t\t\t} else {\n\t\t\t\t\thigh = i;\n\t\t\t\t\tbreak; // DONE\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ti = high;\n\n\t\t\tif (arcLengths[i] === targetArcLength) {\n\t\t\t\treturn i / (il - 1);\n\t\t\t} // we could get finer grain at lengths, or use simple interpolation between two points\n\n\n\t\t\tconst lengthBefore = arcLengths[i];\n\t\t\tconst lengthAfter = arcLengths[i + 1];\n\t\t\tconst segmentLength = lengthAfter - lengthBefore; // determine where we are between the 'before' and 'after' points\n\n\t\t\tconst segmentFraction = (targetArcLength - lengthBefore) / segmentLength; // add that fractional amount to t\n\n\t\t\tconst t = (i + segmentFraction) / (il - 1);\n\t\t\treturn t;\n\t\t} // Returns a unit vector tangent at t\n\t\t// In case any sub curve does not implement its tangent derivation,\n\t\t// 2 points a small delta apart will be used to find its gradient\n\t\t// which seems to give a reasonable approximation\n\n\n\t\tgetTangent(t, optionalTarget) {\n\t\t\tconst delta = 0.0001;\n\t\t\tlet t1 = t - delta;\n\t\t\tlet t2 = t + delta; // Capping in case of danger\n\n\t\t\tif (t1 < 0) t1 = 0;\n\t\t\tif (t2 > 1) t2 = 1;\n\t\t\tconst pt1 = this.getPoint(t1);\n\t\t\tconst pt2 = this.getPoint(t2);\n\t\t\tconst tangent = optionalTarget || (pt1.isVector2 ? new Vector2() : new Vector3());\n\t\t\ttangent.copy(pt2).sub(pt1).normalize();\n\t\t\treturn tangent;\n\t\t}\n\n\t\tgetTangentAt(u, optionalTarget) {\n\t\t\tconst t = this.getUtoTmapping(u);\n\t\t\treturn this.getTangent(t, optionalTarget);\n\t\t}\n\n\t\tcomputeFrenetFrames(segments, closed) {\n\t\t\t// see http://www.cs.indiana.edu/pub/techreports/TR425.pdf\n\t\t\tconst normal = new Vector3();\n\t\t\tconst tangents = [];\n\t\t\tconst normals = [];\n\t\t\tconst binormals = [];\n\t\t\tconst vec = new Vector3();\n\t\t\tconst mat = new Matrix4(); // compute the tangent vectors for each segment on the curve\n\n\t\t\tfor (let i = 0; i <= segments; i++) {\n\t\t\t\tconst u = i / segments;\n\t\t\t\ttangents[i] = this.getTangentAt(u, new Vector3());\n\t\t\t} // select an initial normal vector perpendicular to the first tangent vector,\n\t\t\t// and in the direction of the minimum tangent xyz component\n\n\n\t\t\tnormals[0] = new Vector3();\n\t\t\tbinormals[0] = new Vector3();\n\t\t\tlet min = Number.MAX_VALUE;\n\t\t\tconst tx = Math.abs(tangents[0].x);\n\t\t\tconst ty = Math.abs(tangents[0].y);\n\t\t\tconst tz = Math.abs(tangents[0].z);\n\n\t\t\tif (tx <= min) {\n\t\t\t\tmin = tx;\n\t\t\t\tnormal.set(1, 0, 0);\n\t\t\t}\n\n\t\t\tif (ty <= min) {\n\t\t\t\tmin = ty;\n\t\t\t\tnormal.set(0, 1, 0);\n\t\t\t}\n\n\t\t\tif (tz <= min) {\n\t\t\t\tnormal.set(0, 0, 1);\n\t\t\t}\n\n\t\t\tvec.crossVectors(tangents[0], normal).normalize();\n\t\t\tnormals[0].crossVectors(tangents[0], vec);\n\t\t\tbinormals[0].crossVectors(tangents[0], normals[0]); // compute the slowly-varying normal and binormal vectors for each segment on the curve\n\n\t\t\tfor (let i = 1; i <= segments; i++) {\n\t\t\t\tnormals[i] = normals[i - 1].clone();\n\t\t\t\tbinormals[i] = binormals[i - 1].clone();\n\t\t\t\tvec.crossVectors(tangents[i - 1], tangents[i]);\n\n\t\t\t\tif (vec.length() > Number.EPSILON) {\n\t\t\t\t\tvec.normalize();\n\t\t\t\t\tconst theta = Math.acos(clamp(tangents[i - 1].dot(tangents[i]), -1, 1)); // clamp for floating pt errors\n\n\t\t\t\t\tnormals[i].applyMatrix4(mat.makeRotationAxis(vec, theta));\n\t\t\t\t}\n\n\t\t\t\tbinormals[i].crossVectors(tangents[i], normals[i]);\n\t\t\t} // if the curve is closed, postprocess the vectors so the first and last normal vectors are the same\n\n\n\t\t\tif (closed === true) {\n\t\t\t\tlet theta = Math.acos(clamp(normals[0].dot(normals[segments]), -1, 1));\n\t\t\t\ttheta /= segments;\n\n\t\t\t\tif (tangents[0].dot(vec.crossVectors(normals[0], normals[segments])) > 0) {\n\t\t\t\t\ttheta = -theta;\n\t\t\t\t}\n\n\t\t\t\tfor (let i = 1; i <= segments; i++) {\n\t\t\t\t\t// twist a little...\n\t\t\t\t\tnormals[i].applyMatrix4(mat.makeRotationAxis(tangents[i], theta * i));\n\t\t\t\t\tbinormals[i].crossVectors(tangents[i], normals[i]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\ttangents: tangents,\n\t\t\t\tnormals: normals,\n\t\t\t\tbinormals: binormals\n\t\t\t};\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new this.constructor().copy(this);\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tthis.arcLengthDivisions = source.arcLengthDivisions;\n\t\t\treturn this;\n\t\t}\n\n\t\ttoJSON() {\n\t\t\tconst data = {\n\t\t\t\tmetadata: {\n\t\t\t\t\tversion: 4.5,\n\t\t\t\t\ttype: 'Curve',\n\t\t\t\t\tgenerator: 'Curve.toJSON'\n\t\t\t\t}\n\t\t\t};\n\t\t\tdata.arcLengthDivisions = this.arcLengthDivisions;\n\t\t\tdata.type = this.type;\n\t\t\treturn data;\n\t\t}\n\n\t\tfromJSON(json) {\n\t\t\tthis.arcLengthDivisions = json.arcLengthDivisions;\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tclass EllipseCurve extends Curve {\n\t\tconstructor(aX = 0, aY = 0, xRadius = 1, yRadius = 1, aStartAngle = 0, aEndAngle = Math.PI * 2, aClockwise = false, aRotation = 0) {\n\t\t\tsuper();\n\t\t\tthis.type = 'EllipseCurve';\n\t\t\tthis.aX = aX;\n\t\t\tthis.aY = aY;\n\t\t\tthis.xRadius = xRadius;\n\t\t\tthis.yRadius = yRadius;\n\t\t\tthis.aStartAngle = aStartAngle;\n\t\t\tthis.aEndAngle = aEndAngle;\n\t\t\tthis.aClockwise = aClockwise;\n\t\t\tthis.aRotation = aRotation;\n\t\t}\n\n\t\tgetPoint(t, optionalTarget) {\n\t\t\tconst point = optionalTarget || new Vector2();\n\t\t\tconst twoPi = Math.PI * 2;\n\t\t\tlet deltaAngle = this.aEndAngle - this.aStartAngle;\n\t\t\tconst samePoints = Math.abs(deltaAngle) < Number.EPSILON; // ensures that deltaAngle is 0 .. 2 PI\n\n\t\t\twhile (deltaAngle < 0) deltaAngle += twoPi;\n\n\t\t\twhile (deltaAngle > twoPi) deltaAngle -= twoPi;\n\n\t\t\tif (deltaAngle < Number.EPSILON) {\n\t\t\t\tif (samePoints) {\n\t\t\t\t\tdeltaAngle = 0;\n\t\t\t\t} else {\n\t\t\t\t\tdeltaAngle = twoPi;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.aClockwise === true && !samePoints) {\n\t\t\t\tif (deltaAngle === twoPi) {\n\t\t\t\t\tdeltaAngle = -twoPi;\n\t\t\t\t} else {\n\t\t\t\t\tdeltaAngle = deltaAngle - twoPi;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst angle = this.aStartAngle + t * deltaAngle;\n\t\t\tlet x = this.aX + this.xRadius * Math.cos(angle);\n\t\t\tlet y = this.aY + this.yRadius * Math.sin(angle);\n\n\t\t\tif (this.aRotation !== 0) {\n\t\t\t\tconst cos = Math.cos(this.aRotation);\n\t\t\t\tconst sin = Math.sin(this.aRotation);\n\t\t\t\tconst tx = x - this.aX;\n\t\t\t\tconst ty = y - this.aY; // Rotate the point about the center of the ellipse.\n\n\t\t\t\tx = tx * cos - ty * sin + this.aX;\n\t\t\t\ty = tx * sin + ty * cos + this.aY;\n\t\t\t}\n\n\t\t\treturn point.set(x, y);\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.aX = source.aX;\n\t\t\tthis.aY = source.aY;\n\t\t\tthis.xRadius = source.xRadius;\n\t\t\tthis.yRadius = source.yRadius;\n\t\t\tthis.aStartAngle = source.aStartAngle;\n\t\t\tthis.aEndAngle = source.aEndAngle;\n\t\t\tthis.aClockwise = source.aClockwise;\n\t\t\tthis.aRotation = source.aRotation;\n\t\t\treturn this;\n\t\t}\n\n\t\ttoJSON() {\n\t\t\tconst data = super.toJSON();\n\t\t\tdata.aX = this.aX;\n\t\t\tdata.aY = this.aY;\n\t\t\tdata.xRadius = this.xRadius;\n\t\t\tdata.yRadius = this.yRadius;\n\t\t\tdata.aStartAngle = this.aStartAngle;\n\t\t\tdata.aEndAngle = this.aEndAngle;\n\t\t\tdata.aClockwise = this.aClockwise;\n\t\t\tdata.aRotation = this.aRotation;\n\t\t\treturn data;\n\t\t}\n\n\t\tfromJSON(json) {\n\t\t\tsuper.fromJSON(json);\n\t\t\tthis.aX = json.aX;\n\t\t\tthis.aY = json.aY;\n\t\t\tthis.xRadius = json.xRadius;\n\t\t\tthis.yRadius = json.yRadius;\n\t\t\tthis.aStartAngle = json.aStartAngle;\n\t\t\tthis.aEndAngle = json.aEndAngle;\n\t\t\tthis.aClockwise = json.aClockwise;\n\t\t\tthis.aRotation = json.aRotation;\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tEllipseCurve.prototype.isEllipseCurve = true;\n\n\tclass ArcCurve extends EllipseCurve {\n\t\tconstructor(aX, aY, aRadius, aStartAngle, aEndAngle, aClockwise) {\n\t\t\tsuper(aX, aY, aRadius, aRadius, aStartAngle, aEndAngle, aClockwise);\n\t\t\tthis.type = 'ArcCurve';\n\t\t}\n\n\t}\n\n\tArcCurve.prototype.isArcCurve = true;\n\n\t/**\n\t * Centripetal CatmullRom Curve - which is useful for avoiding\n\t * cusps and self-intersections in non-uniform catmull rom curves.\n\t * http://www.cemyuksel.com/research/catmullrom_param/catmullrom.pdf\n\t *\n\t * curve.type accepts centripetal(default), chordal and catmullrom\n\t * curve.tension is used for catmullrom which defaults to 0.5\n\t */\n\n\t/*\n\tBased on an optimized c++ solution in\n\t - http://stackoverflow.com/questions/9489736/catmull-rom-curve-with-no-cusps-and-no-self-intersections/\n\t - http://ideone.com/NoEbVM\n\n\tThis CubicPoly class could be used for reusing some variables and calculations,\n\tbut for three.js curve use, it could be possible inlined and flatten into a single function call\n\twhich can be placed in CurveUtils.\n\t*/\n\n\tfunction CubicPoly() {\n\t\tlet c0 = 0,\n\t\t\t\tc1 = 0,\n\t\t\t\tc2 = 0,\n\t\t\t\tc3 = 0;\n\t\t/*\n\t\t * Compute coefficients for a cubic polynomial\n\t\t *\t p(s) = c0 + c1*s + c2*s^2 + c3*s^3\n\t\t * such that\n\t\t *\t p(0) = x0, p(1) = x1\n\t\t *\tand\n\t\t *\t p'(0) = t0, p'(1) = t1.\n\t\t */\n\n\t\tfunction init(x0, x1, t0, t1) {\n\t\t\tc0 = x0;\n\t\t\tc1 = t0;\n\t\t\tc2 = -3 * x0 + 3 * x1 - 2 * t0 - t1;\n\t\t\tc3 = 2 * x0 - 2 * x1 + t0 + t1;\n\t\t}\n\n\t\treturn {\n\t\t\tinitCatmullRom: function (x0, x1, x2, x3, tension) {\n\t\t\t\tinit(x1, x2, tension * (x2 - x0), tension * (x3 - x1));\n\t\t\t},\n\t\t\tinitNonuniformCatmullRom: function (x0, x1, x2, x3, dt0, dt1, dt2) {\n\t\t\t\t// compute tangents when parameterized in [t1,t2]\n\t\t\t\tlet t1 = (x1 - x0) / dt0 - (x2 - x0) / (dt0 + dt1) + (x2 - x1) / dt1;\n\t\t\t\tlet t2 = (x2 - x1) / dt1 - (x3 - x1) / (dt1 + dt2) + (x3 - x2) / dt2; // rescale tangents for parametrization in [0,1]\n\n\t\t\t\tt1 *= dt1;\n\t\t\t\tt2 *= dt1;\n\t\t\t\tinit(x1, x2, t1, t2);\n\t\t\t},\n\t\t\tcalc: function (t) {\n\t\t\t\tconst t2 = t * t;\n\t\t\t\tconst t3 = t2 * t;\n\t\t\t\treturn c0 + c1 * t + c2 * t2 + c3 * t3;\n\t\t\t}\n\t\t};\n\t} //\n\n\n\tconst tmp = new Vector3();\n\tconst px = new CubicPoly(),\n\t\t\t\tpy = new CubicPoly(),\n\t\t\t\tpz = new CubicPoly();\n\n\tclass CatmullRomCurve3 extends Curve {\n\t\tconstructor(points = [], closed = false, curveType = 'centripetal', tension = 0.5) {\n\t\t\tsuper();\n\t\t\tthis.type = 'CatmullRomCurve3';\n\t\t\tthis.points = points;\n\t\t\tthis.closed = closed;\n\t\t\tthis.curveType = curveType;\n\t\t\tthis.tension = tension;\n\t\t}\n\n\t\tgetPoint(t, optionalTarget = new Vector3()) {\n\t\t\tconst point = optionalTarget;\n\t\t\tconst points = this.points;\n\t\t\tconst l = points.length;\n\t\t\tconst p = (l - (this.closed ? 0 : 1)) * t;\n\t\t\tlet intPoint = Math.floor(p);\n\t\t\tlet weight = p - intPoint;\n\n\t\t\tif (this.closed) {\n\t\t\t\tintPoint += intPoint > 0 ? 0 : (Math.floor(Math.abs(intPoint) / l) + 1) * l;\n\t\t\t} else if (weight === 0 && intPoint === l - 1) {\n\t\t\t\tintPoint = l - 2;\n\t\t\t\tweight = 1;\n\t\t\t}\n\n\t\t\tlet p0, p3; // 4 points (p1 & p2 defined below)\n\n\t\t\tif (this.closed || intPoint > 0) {\n\t\t\t\tp0 = points[(intPoint - 1) % l];\n\t\t\t} else {\n\t\t\t\t// extrapolate first point\n\t\t\t\ttmp.subVectors(points[0], points[1]).add(points[0]);\n\t\t\t\tp0 = tmp;\n\t\t\t}\n\n\t\t\tconst p1 = points[intPoint % l];\n\t\t\tconst p2 = points[(intPoint + 1) % l];\n\n\t\t\tif (this.closed || intPoint + 2 < l) {\n\t\t\t\tp3 = points[(intPoint + 2) % l];\n\t\t\t} else {\n\t\t\t\t// extrapolate last point\n\t\t\t\ttmp.subVectors(points[l - 1], points[l - 2]).add(points[l - 1]);\n\t\t\t\tp3 = tmp;\n\t\t\t}\n\n\t\t\tif (this.curveType === 'centripetal' || this.curveType === 'chordal') {\n\t\t\t\t// init Centripetal / Chordal Catmull-Rom\n\t\t\t\tconst pow = this.curveType === 'chordal' ? 0.5 : 0.25;\n\t\t\t\tlet dt0 = Math.pow(p0.distanceToSquared(p1), pow);\n\t\t\t\tlet dt1 = Math.pow(p1.distanceToSquared(p2), pow);\n\t\t\t\tlet dt2 = Math.pow(p2.distanceToSquared(p3), pow); // safety check for repeated points\n\n\t\t\t\tif (dt1 < 1e-4) dt1 = 1.0;\n\t\t\t\tif (dt0 < 1e-4) dt0 = dt1;\n\t\t\t\tif (dt2 < 1e-4) dt2 = dt1;\n\t\t\t\tpx.initNonuniformCatmullRom(p0.x, p1.x, p2.x, p3.x, dt0, dt1, dt2);\n\t\t\t\tpy.initNonuniformCatmullRom(p0.y, p1.y, p2.y, p3.y, dt0, dt1, dt2);\n\t\t\t\tpz.initNonuniformCatmullRom(p0.z, p1.z, p2.z, p3.z, dt0, dt1, dt2);\n\t\t\t} else if (this.curveType === 'catmullrom') {\n\t\t\t\tpx.initCatmullRom(p0.x, p1.x, p2.x, p3.x, this.tension);\n\t\t\t\tpy.initCatmullRom(p0.y, p1.y, p2.y, p3.y, this.tension);\n\t\t\t\tpz.initCatmullRom(p0.z, p1.z, p2.z, p3.z, this.tension);\n\t\t\t}\n\n\t\t\tpoint.set(px.calc(weight), py.calc(weight), pz.calc(weight));\n\t\t\treturn point;\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.points = [];\n\n\t\t\tfor (let i = 0, l = source.points.length; i < l; i++) {\n\t\t\t\tconst point = source.points[i];\n\t\t\t\tthis.points.push(point.clone());\n\t\t\t}\n\n\t\t\tthis.closed = source.closed;\n\t\t\tthis.curveType = source.curveType;\n\t\t\tthis.tension = source.tension;\n\t\t\treturn this;\n\t\t}\n\n\t\ttoJSON() {\n\t\t\tconst data = super.toJSON();\n\t\t\tdata.points = [];\n\n\t\t\tfor (let i = 0, l = this.points.length; i < l; i++) {\n\t\t\t\tconst point = this.points[i];\n\t\t\t\tdata.points.push(point.toArray());\n\t\t\t}\n\n\t\t\tdata.closed = this.closed;\n\t\t\tdata.curveType = this.curveType;\n\t\t\tdata.tension = this.tension;\n\t\t\treturn data;\n\t\t}\n\n\t\tfromJSON(json) {\n\t\t\tsuper.fromJSON(json);\n\t\t\tthis.points = [];\n\n\t\t\tfor (let i = 0, l = json.points.length; i < l; i++) {\n\t\t\t\tconst point = json.points[i];\n\t\t\t\tthis.points.push(new Vector3().fromArray(point));\n\t\t\t}\n\n\t\t\tthis.closed = json.closed;\n\t\t\tthis.curveType = json.curveType;\n\t\t\tthis.tension = json.tension;\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tCatmullRomCurve3.prototype.isCatmullRomCurve3 = true;\n\n\t/**\n\t * Bezier Curves formulas obtained from\n\t * http://en.wikipedia.org/wiki/Bézier_curve\n\t */\n\tfunction CatmullRom(t, p0, p1, p2, p3) {\n\t\tconst v0 = (p2 - p0) * 0.5;\n\t\tconst v1 = (p3 - p1) * 0.5;\n\t\tconst t2 = t * t;\n\t\tconst t3 = t * t2;\n\t\treturn (2 * p1 - 2 * p2 + v0 + v1) * t3 + (-3 * p1 + 3 * p2 - 2 * v0 - v1) * t2 + v0 * t + p1;\n\t} //\n\n\n\tfunction QuadraticBezierP0(t, p) {\n\t\tconst k = 1 - t;\n\t\treturn k * k * p;\n\t}\n\n\tfunction QuadraticBezierP1(t, p) {\n\t\treturn 2 * (1 - t) * t * p;\n\t}\n\n\tfunction QuadraticBezierP2(t, p) {\n\t\treturn t * t * p;\n\t}\n\n\tfunction QuadraticBezier(t, p0, p1, p2) {\n\t\treturn QuadraticBezierP0(t, p0) + QuadraticBezierP1(t, p1) + QuadraticBezierP2(t, p2);\n\t} //\n\n\n\tfunction CubicBezierP0(t, p) {\n\t\tconst k = 1 - t;\n\t\treturn k * k * k * p;\n\t}\n\n\tfunction CubicBezierP1(t, p) {\n\t\tconst k = 1 - t;\n\t\treturn 3 * k * k * t * p;\n\t}\n\n\tfunction CubicBezierP2(t, p) {\n\t\treturn 3 * (1 - t) * t * t * p;\n\t}\n\n\tfunction CubicBezierP3(t, p) {\n\t\treturn t * t * t * p;\n\t}\n\n\tfunction CubicBezier(t, p0, p1, p2, p3) {\n\t\treturn CubicBezierP0(t, p0) + CubicBezierP1(t, p1) + CubicBezierP2(t, p2) + CubicBezierP3(t, p3);\n\t}\n\n\tclass CubicBezierCurve extends Curve {\n\t\tconstructor(v0 = new Vector2(), v1 = new Vector2(), v2 = new Vector2(), v3 = new Vector2()) {\n\t\t\tsuper();\n\t\t\tthis.type = 'CubicBezierCurve';\n\t\t\tthis.v0 = v0;\n\t\t\tthis.v1 = v1;\n\t\t\tthis.v2 = v2;\n\t\t\tthis.v3 = v3;\n\t\t}\n\n\t\tgetPoint(t, optionalTarget = new Vector2()) {\n\t\t\tconst point = optionalTarget;\n\t\t\tconst v0 = this.v0,\n\t\t\t\t\t\tv1 = this.v1,\n\t\t\t\t\t\tv2 = this.v2,\n\t\t\t\t\t\tv3 = this.v3;\n\t\t\tpoint.set(CubicBezier(t, v0.x, v1.x, v2.x, v3.x), CubicBezier(t, v0.y, v1.y, v2.y, v3.y));\n\t\t\treturn point;\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.v0.copy(source.v0);\n\t\t\tthis.v1.copy(source.v1);\n\t\t\tthis.v2.copy(source.v2);\n\t\t\tthis.v3.copy(source.v3);\n\t\t\treturn this;\n\t\t}\n\n\t\ttoJSON() {\n\t\t\tconst data = super.toJSON();\n\t\t\tdata.v0 = this.v0.toArray();\n\t\t\tdata.v1 = this.v1.toArray();\n\t\t\tdata.v2 = this.v2.toArray();\n\t\t\tdata.v3 = this.v3.toArray();\n\t\t\treturn data;\n\t\t}\n\n\t\tfromJSON(json) {\n\t\t\tsuper.fromJSON(json);\n\t\t\tthis.v0.fromArray(json.v0);\n\t\t\tthis.v1.fromArray(json.v1);\n\t\t\tthis.v2.fromArray(json.v2);\n\t\t\tthis.v3.fromArray(json.v3);\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tCubicBezierCurve.prototype.isCubicBezierCurve = true;\n\n\tclass CubicBezierCurve3 extends Curve {\n\t\tconstructor(v0 = new Vector3(), v1 = new Vector3(), v2 = new Vector3(), v3 = new Vector3()) {\n\t\t\tsuper();\n\t\t\tthis.type = 'CubicBezierCurve3';\n\t\t\tthis.v0 = v0;\n\t\t\tthis.v1 = v1;\n\t\t\tthis.v2 = v2;\n\t\t\tthis.v3 = v3;\n\t\t}\n\n\t\tgetPoint(t, optionalTarget = new Vector3()) {\n\t\t\tconst point = optionalTarget;\n\t\t\tconst v0 = this.v0,\n\t\t\t\t\t\tv1 = this.v1,\n\t\t\t\t\t\tv2 = this.v2,\n\t\t\t\t\t\tv3 = this.v3;\n\t\t\tpoint.set(CubicBezier(t, v0.x, v1.x, v2.x, v3.x), CubicBezier(t, v0.y, v1.y, v2.y, v3.y), CubicBezier(t, v0.z, v1.z, v2.z, v3.z));\n\t\t\treturn point;\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.v0.copy(source.v0);\n\t\t\tthis.v1.copy(source.v1);\n\t\t\tthis.v2.copy(source.v2);\n\t\t\tthis.v3.copy(source.v3);\n\t\t\treturn this;\n\t\t}\n\n\t\ttoJSON() {\n\t\t\tconst data = super.toJSON();\n\t\t\tdata.v0 = this.v0.toArray();\n\t\t\tdata.v1 = this.v1.toArray();\n\t\t\tdata.v2 = this.v2.toArray();\n\t\t\tdata.v3 = this.v3.toArray();\n\t\t\treturn data;\n\t\t}\n\n\t\tfromJSON(json) {\n\t\t\tsuper.fromJSON(json);\n\t\t\tthis.v0.fromArray(json.v0);\n\t\t\tthis.v1.fromArray(json.v1);\n\t\t\tthis.v2.fromArray(json.v2);\n\t\t\tthis.v3.fromArray(json.v3);\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tCubicBezierCurve3.prototype.isCubicBezierCurve3 = true;\n\n\tclass LineCurve extends Curve {\n\t\tconstructor(v1 = new Vector2(), v2 = new Vector2()) {\n\t\t\tsuper();\n\t\t\tthis.type = 'LineCurve';\n\t\t\tthis.v1 = v1;\n\t\t\tthis.v2 = v2;\n\t\t}\n\n\t\tgetPoint(t, optionalTarget = new Vector2()) {\n\t\t\tconst point = optionalTarget;\n\n\t\t\tif (t === 1) {\n\t\t\t\tpoint.copy(this.v2);\n\t\t\t} else {\n\t\t\t\tpoint.copy(this.v2).sub(this.v1);\n\t\t\t\tpoint.multiplyScalar(t).add(this.v1);\n\t\t\t}\n\n\t\t\treturn point;\n\t\t} // Line curve is linear, so we can overwrite default getPointAt\n\n\n\t\tgetPointAt(u, optionalTarget) {\n\t\t\treturn this.getPoint(u, optionalTarget);\n\t\t}\n\n\t\tgetTangent(t, optionalTarget) {\n\t\t\tconst tangent = optionalTarget || new Vector2();\n\t\t\ttangent.copy(this.v2).sub(this.v1).normalize();\n\t\t\treturn tangent;\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.v1.copy(source.v1);\n\t\t\tthis.v2.copy(source.v2);\n\t\t\treturn this;\n\t\t}\n\n\t\ttoJSON() {\n\t\t\tconst data = super.toJSON();\n\t\t\tdata.v1 = this.v1.toArray();\n\t\t\tdata.v2 = this.v2.toArray();\n\t\t\treturn data;\n\t\t}\n\n\t\tfromJSON(json) {\n\t\t\tsuper.fromJSON(json);\n\t\t\tthis.v1.fromArray(json.v1);\n\t\t\tthis.v2.fromArray(json.v2);\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tLineCurve.prototype.isLineCurve = true;\n\n\tclass LineCurve3 extends Curve {\n\t\tconstructor(v1 = new Vector3(), v2 = new Vector3()) {\n\t\t\tsuper();\n\t\t\tthis.type = 'LineCurve3';\n\t\t\tthis.isLineCurve3 = true;\n\t\t\tthis.v1 = v1;\n\t\t\tthis.v2 = v2;\n\t\t}\n\n\t\tgetPoint(t, optionalTarget = new Vector3()) {\n\t\t\tconst point = optionalTarget;\n\n\t\t\tif (t === 1) {\n\t\t\t\tpoint.copy(this.v2);\n\t\t\t} else {\n\t\t\t\tpoint.copy(this.v2).sub(this.v1);\n\t\t\t\tpoint.multiplyScalar(t).add(this.v1);\n\t\t\t}\n\n\t\t\treturn point;\n\t\t} // Line curve is linear, so we can overwrite default getPointAt\n\n\n\t\tgetPointAt(u, optionalTarget) {\n\t\t\treturn this.getPoint(u, optionalTarget);\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.v1.copy(source.v1);\n\t\t\tthis.v2.copy(source.v2);\n\t\t\treturn this;\n\t\t}\n\n\t\ttoJSON() {\n\t\t\tconst data = super.toJSON();\n\t\t\tdata.v1 = this.v1.toArray();\n\t\t\tdata.v2 = this.v2.toArray();\n\t\t\treturn data;\n\t\t}\n\n\t\tfromJSON(json) {\n\t\t\tsuper.fromJSON(json);\n\t\t\tthis.v1.fromArray(json.v1);\n\t\t\tthis.v2.fromArray(json.v2);\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tclass QuadraticBezierCurve extends Curve {\n\t\tconstructor(v0 = new Vector2(), v1 = new Vector2(), v2 = new Vector2()) {\n\t\t\tsuper();\n\t\t\tthis.type = 'QuadraticBezierCurve';\n\t\t\tthis.v0 = v0;\n\t\t\tthis.v1 = v1;\n\t\t\tthis.v2 = v2;\n\t\t}\n\n\t\tgetPoint(t, optionalTarget = new Vector2()) {\n\t\t\tconst point = optionalTarget;\n\t\t\tconst v0 = this.v0,\n\t\t\t\t\t\tv1 = this.v1,\n\t\t\t\t\t\tv2 = this.v2;\n\t\t\tpoint.set(QuadraticBezier(t, v0.x, v1.x, v2.x), QuadraticBezier(t, v0.y, v1.y, v2.y));\n\t\t\treturn point;\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.v0.copy(source.v0);\n\t\t\tthis.v1.copy(source.v1);\n\t\t\tthis.v2.copy(source.v2);\n\t\t\treturn this;\n\t\t}\n\n\t\ttoJSON() {\n\t\t\tconst data = super.toJSON();\n\t\t\tdata.v0 = this.v0.toArray();\n\t\t\tdata.v1 = this.v1.toArray();\n\t\t\tdata.v2 = this.v2.toArray();\n\t\t\treturn data;\n\t\t}\n\n\t\tfromJSON(json) {\n\t\t\tsuper.fromJSON(json);\n\t\t\tthis.v0.fromArray(json.v0);\n\t\t\tthis.v1.fromArray(json.v1);\n\t\t\tthis.v2.fromArray(json.v2);\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tQuadraticBezierCurve.prototype.isQuadraticBezierCurve = true;\n\n\tclass QuadraticBezierCurve3 extends Curve {\n\t\tconstructor(v0 = new Vector3(), v1 = new Vector3(), v2 = new Vector3()) {\n\t\t\tsuper();\n\t\t\tthis.type = 'QuadraticBezierCurve3';\n\t\t\tthis.v0 = v0;\n\t\t\tthis.v1 = v1;\n\t\t\tthis.v2 = v2;\n\t\t}\n\n\t\tgetPoint(t, optionalTarget = new Vector3()) {\n\t\t\tconst point = optionalTarget;\n\t\t\tconst v0 = this.v0,\n\t\t\t\t\t\tv1 = this.v1,\n\t\t\t\t\t\tv2 = this.v2;\n\t\t\tpoint.set(QuadraticBezier(t, v0.x, v1.x, v2.x), QuadraticBezier(t, v0.y, v1.y, v2.y), QuadraticBezier(t, v0.z, v1.z, v2.z));\n\t\t\treturn point;\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.v0.copy(source.v0);\n\t\t\tthis.v1.copy(source.v1);\n\t\t\tthis.v2.copy(source.v2);\n\t\t\treturn this;\n\t\t}\n\n\t\ttoJSON() {\n\t\t\tconst data = super.toJSON();\n\t\t\tdata.v0 = this.v0.toArray();\n\t\t\tdata.v1 = this.v1.toArray();\n\t\t\tdata.v2 = this.v2.toArray();\n\t\t\treturn data;\n\t\t}\n\n\t\tfromJSON(json) {\n\t\t\tsuper.fromJSON(json);\n\t\t\tthis.v0.fromArray(json.v0);\n\t\t\tthis.v1.fromArray(json.v1);\n\t\t\tthis.v2.fromArray(json.v2);\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tQuadraticBezierCurve3.prototype.isQuadraticBezierCurve3 = true;\n\n\tclass SplineCurve extends Curve {\n\t\tconstructor(points = []) {\n\t\t\tsuper();\n\t\t\tthis.type = 'SplineCurve';\n\t\t\tthis.points = points;\n\t\t}\n\n\t\tgetPoint(t, optionalTarget = new Vector2()) {\n\t\t\tconst point = optionalTarget;\n\t\t\tconst points = this.points;\n\t\t\tconst p = (points.length - 1) * t;\n\t\t\tconst intPoint = Math.floor(p);\n\t\t\tconst weight = p - intPoint;\n\t\t\tconst p0 = points[intPoint === 0 ? intPoint : intPoint - 1];\n\t\t\tconst p1 = points[intPoint];\n\t\t\tconst p2 = points[intPoint > points.length - 2 ? points.length - 1 : intPoint + 1];\n\t\t\tconst p3 = points[intPoint > points.length - 3 ? points.length - 1 : intPoint + 2];\n\t\t\tpoint.set(CatmullRom(weight, p0.x, p1.x, p2.x, p3.x), CatmullRom(weight, p0.y, p1.y, p2.y, p3.y));\n\t\t\treturn point;\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.points = [];\n\n\t\t\tfor (let i = 0, l = source.points.length; i < l; i++) {\n\t\t\t\tconst point = source.points[i];\n\t\t\t\tthis.points.push(point.clone());\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\ttoJSON() {\n\t\t\tconst data = super.toJSON();\n\t\t\tdata.points = [];\n\n\t\t\tfor (let i = 0, l = this.points.length; i < l; i++) {\n\t\t\t\tconst point = this.points[i];\n\t\t\t\tdata.points.push(point.toArray());\n\t\t\t}\n\n\t\t\treturn data;\n\t\t}\n\n\t\tfromJSON(json) {\n\t\t\tsuper.fromJSON(json);\n\t\t\tthis.points = [];\n\n\t\t\tfor (let i = 0, l = json.points.length; i < l; i++) {\n\t\t\t\tconst point = json.points[i];\n\t\t\t\tthis.points.push(new Vector2().fromArray(point));\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tSplineCurve.prototype.isSplineCurve = true;\n\n\tvar Curves = /*#__PURE__*/Object.freeze({\n\t\t__proto__: null,\n\t\tArcCurve: ArcCurve,\n\t\tCatmullRomCurve3: CatmullRomCurve3,\n\t\tCubicBezierCurve: CubicBezierCurve,\n\t\tCubicBezierCurve3: CubicBezierCurve3,\n\t\tEllipseCurve: EllipseCurve,\n\t\tLineCurve: LineCurve,\n\t\tLineCurve3: LineCurve3,\n\t\tQuadraticBezierCurve: QuadraticBezierCurve,\n\t\tQuadraticBezierCurve3: QuadraticBezierCurve3,\n\t\tSplineCurve: SplineCurve\n\t});\n\n\t/**************************************************************\n\t *\tCurved Path - a curve path is simply a array of connected\n\t *\tcurves, but retains the api of a curve\n\t **************************************************************/\n\n\tclass CurvePath extends Curve {\n\t\tconstructor() {\n\t\t\tsuper();\n\t\t\tthis.type = 'CurvePath';\n\t\t\tthis.curves = [];\n\t\t\tthis.autoClose = false; // Automatically closes the path\n\t\t}\n\n\t\tadd(curve) {\n\t\t\tthis.curves.push(curve);\n\t\t}\n\n\t\tclosePath() {\n\t\t\t// Add a line curve if start and end of lines are not connected\n\t\t\tconst startPoint = this.curves[0].getPoint(0);\n\t\t\tconst endPoint = this.curves[this.curves.length - 1].getPoint(1);\n\n\t\t\tif (!startPoint.equals(endPoint)) {\n\t\t\t\tthis.curves.push(new LineCurve(endPoint, startPoint));\n\t\t\t}\n\t\t} // To get accurate point with reference to\n\t\t// entire path distance at time t,\n\t\t// following has to be done:\n\t\t// 1. Length of each sub path have to be known\n\t\t// 2. Locate and identify type of curve\n\t\t// 3. Get t for the curve\n\t\t// 4. Return curve.getPointAt(t')\n\n\n\t\tgetPoint(t, optionalTarget) {\n\t\t\tconst d = t * this.getLength();\n\t\t\tconst curveLengths = this.getCurveLengths();\n\t\t\tlet i = 0; // To think about boundaries points.\n\n\t\t\twhile (i < curveLengths.length) {\n\t\t\t\tif (curveLengths[i] >= d) {\n\t\t\t\t\tconst diff = curveLengths[i] - d;\n\t\t\t\t\tconst curve = this.curves[i];\n\t\t\t\t\tconst segmentLength = curve.getLength();\n\t\t\t\t\tconst u = segmentLength === 0 ? 0 : 1 - diff / segmentLength;\n\t\t\t\t\treturn curve.getPointAt(u, optionalTarget);\n\t\t\t\t}\n\n\t\t\t\ti++;\n\t\t\t}\n\n\t\t\treturn null; // loop where sum != 0, sum > d , sum+1 <d\n\t\t} // We cannot use the default THREE.Curve getPoint() with getLength() because in\n\t\t// THREE.Curve, getLength() depends on getPoint() but in THREE.CurvePath\n\t\t// getPoint() depends on getLength\n\n\n\t\tgetLength() {\n\t\t\tconst lens = this.getCurveLengths();\n\t\t\treturn lens[lens.length - 1];\n\t\t} // cacheLengths must be recalculated.\n\n\n\t\tupdateArcLengths() {\n\t\t\tthis.needsUpdate = true;\n\t\t\tthis.cacheLengths = null;\n\t\t\tthis.getCurveLengths();\n\t\t} // Compute lengths and cache them\n\t\t// We cannot overwrite getLengths() because UtoT mapping uses it.\n\n\n\t\tgetCurveLengths() {\n\t\t\t// We use cache values if curves and cache array are same length\n\t\t\tif (this.cacheLengths && this.cacheLengths.length === this.curves.length) {\n\t\t\t\treturn this.cacheLengths;\n\t\t\t} // Get length of sub-curve\n\t\t\t// Push sums into cached array\n\n\n\t\t\tconst lengths = [];\n\t\t\tlet sums = 0;\n\n\t\t\tfor (let i = 0, l = this.curves.length; i < l; i++) {\n\t\t\t\tsums += this.curves[i].getLength();\n\t\t\t\tlengths.push(sums);\n\t\t\t}\n\n\t\t\tthis.cacheLengths = lengths;\n\t\t\treturn lengths;\n\t\t}\n\n\t\tgetSpacedPoints(divisions = 40) {\n\t\t\tconst points = [];\n\n\t\t\tfor (let i = 0; i <= divisions; i++) {\n\t\t\t\tpoints.push(this.getPoint(i / divisions));\n\t\t\t}\n\n\t\t\tif (this.autoClose) {\n\t\t\t\tpoints.push(points[0]);\n\t\t\t}\n\n\t\t\treturn points;\n\t\t}\n\n\t\tgetPoints(divisions = 12) {\n\t\t\tconst points = [];\n\t\t\tlet last;\n\n\t\t\tfor (let i = 0, curves = this.curves; i < curves.length; i++) {\n\t\t\t\tconst curve = curves[i];\n\t\t\t\tconst resolution = curve && curve.isEllipseCurve ? divisions * 2 : curve && (curve.isLineCurve || curve.isLineCurve3) ? 1 : curve && curve.isSplineCurve ? divisions * curve.points.length : divisions;\n\t\t\t\tconst pts = curve.getPoints(resolution);\n\n\t\t\t\tfor (let j = 0; j < pts.length; j++) {\n\t\t\t\t\tconst point = pts[j];\n\t\t\t\t\tif (last && last.equals(point)) continue; // ensures no consecutive points are duplicates\n\n\t\t\t\t\tpoints.push(point);\n\t\t\t\t\tlast = point;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.autoClose && points.length > 1 && !points[points.length - 1].equals(points[0])) {\n\t\t\t\tpoints.push(points[0]);\n\t\t\t}\n\n\t\t\treturn points;\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.curves = [];\n\n\t\t\tfor (let i = 0, l = source.curves.length; i < l; i++) {\n\t\t\t\tconst curve = source.curves[i];\n\t\t\t\tthis.curves.push(curve.clone());\n\t\t\t}\n\n\t\t\tthis.autoClose = source.autoClose;\n\t\t\treturn this;\n\t\t}\n\n\t\ttoJSON() {\n\t\t\tconst data = super.toJSON();\n\t\t\tdata.autoClose = this.autoClose;\n\t\t\tdata.curves = [];\n\n\t\t\tfor (let i = 0, l = this.curves.length; i < l; i++) {\n\t\t\t\tconst curve = this.curves[i];\n\t\t\t\tdata.curves.push(curve.toJSON());\n\t\t\t}\n\n\t\t\treturn data;\n\t\t}\n\n\t\tfromJSON(json) {\n\t\t\tsuper.fromJSON(json);\n\t\t\tthis.autoClose = json.autoClose;\n\t\t\tthis.curves = [];\n\n\t\t\tfor (let i = 0, l = json.curves.length; i < l; i++) {\n\t\t\t\tconst curve = json.curves[i];\n\t\t\t\tthis.curves.push(new Curves[curve.type]().fromJSON(curve));\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tclass Path extends CurvePath {\n\t\tconstructor(points) {\n\t\t\tsuper();\n\t\t\tthis.type = 'Path';\n\t\t\tthis.currentPoint = new Vector2();\n\n\t\t\tif (points) {\n\t\t\t\tthis.setFromPoints(points);\n\t\t\t}\n\t\t}\n\n\t\tsetFromPoints(points) {\n\t\t\tthis.moveTo(points[0].x, points[0].y);\n\n\t\t\tfor (let i = 1, l = points.length; i < l; i++) {\n\t\t\t\tthis.lineTo(points[i].x, points[i].y);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tmoveTo(x, y) {\n\t\t\tthis.currentPoint.set(x, y); // TODO consider referencing vectors instead of copying?\n\n\t\t\treturn this;\n\t\t}\n\n\t\tlineTo(x, y) {\n\t\t\tconst curve = new LineCurve(this.currentPoint.clone(), new Vector2(x, y));\n\t\t\tthis.curves.push(curve);\n\t\t\tthis.currentPoint.set(x, y);\n\t\t\treturn this;\n\t\t}\n\n\t\tquadraticCurveTo(aCPx, aCPy, aX, aY) {\n\t\t\tconst curve = new QuadraticBezierCurve(this.currentPoint.clone(), new Vector2(aCPx, aCPy), new Vector2(aX, aY));\n\t\t\tthis.curves.push(curve);\n\t\t\tthis.currentPoint.set(aX, aY);\n\t\t\treturn this;\n\t\t}\n\n\t\tbezierCurveTo(aCP1x, aCP1y, aCP2x, aCP2y, aX, aY) {\n\t\t\tconst curve = new CubicBezierCurve(this.currentPoint.clone(), new Vector2(aCP1x, aCP1y), new Vector2(aCP2x, aCP2y), new Vector2(aX, aY));\n\t\t\tthis.curves.push(curve);\n\t\t\tthis.currentPoint.set(aX, aY);\n\t\t\treturn this;\n\t\t}\n\n\t\tsplineThru(pts\n\t\t/*Array of Vector*/\n\t\t) {\n\t\t\tconst npts = [this.currentPoint.clone()].concat(pts);\n\t\t\tconst curve = new SplineCurve(npts);\n\t\t\tthis.curves.push(curve);\n\t\t\tthis.currentPoint.copy(pts[pts.length - 1]);\n\t\t\treturn this;\n\t\t}\n\n\t\tarc(aX, aY, aRadius, aStartAngle, aEndAngle, aClockwise) {\n\t\t\tconst x0 = this.currentPoint.x;\n\t\t\tconst y0 = this.currentPoint.y;\n\t\t\tthis.absarc(aX + x0, aY + y0, aRadius, aStartAngle, aEndAngle, aClockwise);\n\t\t\treturn this;\n\t\t}\n\n\t\tabsarc(aX, aY, aRadius, aStartAngle, aEndAngle, aClockwise) {\n\t\t\tthis.absellipse(aX, aY, aRadius, aRadius, aStartAngle, aEndAngle, aClockwise);\n\t\t\treturn this;\n\t\t}\n\n\t\tellipse(aX, aY, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation) {\n\t\t\tconst x0 = this.currentPoint.x;\n\t\t\tconst y0 = this.currentPoint.y;\n\t\t\tthis.absellipse(aX + x0, aY + y0, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation);\n\t\t\treturn this;\n\t\t}\n\n\t\tabsellipse(aX, aY, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation) {\n\t\t\tconst curve = new EllipseCurve(aX, aY, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation);\n\n\t\t\tif (this.curves.length > 0) {\n\t\t\t\t// if a previous curve is present, attempt to join\n\t\t\t\tconst firstPoint = curve.getPoint(0);\n\n\t\t\t\tif (!firstPoint.equals(this.currentPoint)) {\n\t\t\t\t\tthis.lineTo(firstPoint.x, firstPoint.y);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.curves.push(curve);\n\t\t\tconst lastPoint = curve.getPoint(1);\n\t\t\tthis.currentPoint.copy(lastPoint);\n\t\t\treturn this;\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.currentPoint.copy(source.currentPoint);\n\t\t\treturn this;\n\t\t}\n\n\t\ttoJSON() {\n\t\t\tconst data = super.toJSON();\n\t\t\tdata.currentPoint = this.currentPoint.toArray();\n\t\t\treturn data;\n\t\t}\n\n\t\tfromJSON(json) {\n\t\t\tsuper.fromJSON(json);\n\t\t\tthis.currentPoint.fromArray(json.currentPoint);\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tclass Shape extends Path {\n\t\tconstructor(points) {\n\t\t\tsuper(points);\n\t\t\tthis.uuid = generateUUID();\n\t\t\tthis.type = 'Shape';\n\t\t\tthis.holes = [];\n\t\t}\n\n\t\tgetPointsHoles(divisions) {\n\t\t\tconst holesPts = [];\n\n\t\t\tfor (let i = 0, l = this.holes.length; i < l; i++) {\n\t\t\t\tholesPts[i] = this.holes[i].getPoints(divisions);\n\t\t\t}\n\n\t\t\treturn holesPts;\n\t\t} // get points of shape and holes (keypoints based on segments parameter)\n\n\n\t\textractPoints(divisions) {\n\t\t\treturn {\n\t\t\t\tshape: this.getPoints(divisions),\n\t\t\t\tholes: this.getPointsHoles(divisions)\n\t\t\t};\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.holes = [];\n\n\t\t\tfor (let i = 0, l = source.holes.length; i < l; i++) {\n\t\t\t\tconst hole = source.holes[i];\n\t\t\t\tthis.holes.push(hole.clone());\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\ttoJSON() {\n\t\t\tconst data = super.toJSON();\n\t\t\tdata.uuid = this.uuid;\n\t\t\tdata.holes = [];\n\n\t\t\tfor (let i = 0, l = this.holes.length; i < l; i++) {\n\t\t\t\tconst hole = this.holes[i];\n\t\t\t\tdata.holes.push(hole.toJSON());\n\t\t\t}\n\n\t\t\treturn data;\n\t\t}\n\n\t\tfromJSON(json) {\n\t\t\tsuper.fromJSON(json);\n\t\t\tthis.uuid = json.uuid;\n\t\t\tthis.holes = [];\n\n\t\t\tfor (let i = 0, l = json.holes.length; i < l; i++) {\n\t\t\t\tconst hole = json.holes[i];\n\t\t\t\tthis.holes.push(new Path().fromJSON(hole));\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\t/**\n\t * Port from https://github.com/mapbox/earcut (v2.2.2)\n\t */\n\tconst Earcut = {\n\t\ttriangulate: function (data, holeIndices, dim = 2) {\n\t\t\tconst hasHoles = holeIndices && holeIndices.length;\n\t\t\tconst outerLen = hasHoles ? holeIndices[0] * dim : data.length;\n\t\t\tlet outerNode = linkedList(data, 0, outerLen, dim, true);\n\t\t\tconst triangles = [];\n\t\t\tif (!outerNode || outerNode.next === outerNode.prev) return triangles;\n\t\t\tlet minX, minY, maxX, maxY, x, y, invSize;\n\t\t\tif (hasHoles) outerNode = eliminateHoles(data, holeIndices, outerNode, dim); // if the shape is not too simple, we'll use z-order curve hash later; calculate polygon bbox\n\n\t\t\tif (data.length > 80 * dim) {\n\t\t\t\tminX = maxX = data[0];\n\t\t\t\tminY = maxY = data[1];\n\n\t\t\t\tfor (let i = dim; i < outerLen; i += dim) {\n\t\t\t\t\tx = data[i];\n\t\t\t\t\ty = data[i + 1];\n\t\t\t\t\tif (x < minX) minX = x;\n\t\t\t\t\tif (y < minY) minY = y;\n\t\t\t\t\tif (x > maxX) maxX = x;\n\t\t\t\t\tif (y > maxY) maxY = y;\n\t\t\t\t} // minX, minY and invSize are later used to transform coords into integers for z-order calculation\n\n\n\t\t\t\tinvSize = Math.max(maxX - minX, maxY - minY);\n\t\t\t\tinvSize = invSize !== 0 ? 1 / invSize : 0;\n\t\t\t}\n\n\t\t\tearcutLinked(outerNode, triangles, dim, minX, minY, invSize);\n\t\t\treturn triangles;\n\t\t}\n\t}; // create a circular doubly linked list from polygon points in the specified winding order\n\n\tfunction linkedList(data, start, end, dim, clockwise) {\n\t\tlet i, last;\n\n\t\tif (clockwise === signedArea(data, start, end, dim) > 0) {\n\t\t\tfor (i = start; i < end; i += dim) last = insertNode(i, data[i], data[i + 1], last);\n\t\t} else {\n\t\t\tfor (i = end - dim; i >= start; i -= dim) last = insertNode(i, data[i], data[i + 1], last);\n\t\t}\n\n\t\tif (last && equals(last, last.next)) {\n\t\t\tremoveNode(last);\n\t\t\tlast = last.next;\n\t\t}\n\n\t\treturn last;\n\t} // eliminate colinear or duplicate points\n\n\n\tfunction filterPoints(start, end) {\n\t\tif (!start) return start;\n\t\tif (!end) end = start;\n\t\tlet p = start,\n\t\t\t\tagain;\n\n\t\tdo {\n\t\t\tagain = false;\n\n\t\t\tif (!p.steiner && (equals(p, p.next) || area(p.prev, p, p.next) === 0)) {\n\t\t\t\tremoveNode(p);\n\t\t\t\tp = end = p.prev;\n\t\t\t\tif (p === p.next) break;\n\t\t\t\tagain = true;\n\t\t\t} else {\n\t\t\t\tp = p.next;\n\t\t\t}\n\t\t} while (again || p !== end);\n\n\t\treturn end;\n\t} // main ear slicing loop which triangulates a polygon (given as a linked list)\n\n\n\tfunction earcutLinked(ear, triangles, dim, minX, minY, invSize, pass) {\n\t\tif (!ear) return; // interlink polygon nodes in z-order\n\n\t\tif (!pass && invSize) indexCurve(ear, minX, minY, invSize);\n\t\tlet stop = ear,\n\t\t\t\tprev,\n\t\t\t\tnext; // iterate through ears, slicing them one by one\n\n\t\twhile (ear.prev !== ear.next) {\n\t\t\tprev = ear.prev;\n\t\t\tnext = ear.next;\n\n\t\t\tif (invSize ? isEarHashed(ear, minX, minY, invSize) : isEar(ear)) {\n\t\t\t\t// cut off the triangle\n\t\t\t\ttriangles.push(prev.i / dim);\n\t\t\t\ttriangles.push(ear.i / dim);\n\t\t\t\ttriangles.push(next.i / dim);\n\t\t\t\tremoveNode(ear); // skipping the next vertex leads to less sliver triangles\n\n\t\t\t\tear = next.next;\n\t\t\t\tstop = next.next;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tear = next; // if we looped through the whole remaining polygon and can't find any more ears\n\n\t\t\tif (ear === stop) {\n\t\t\t\t// try filtering points and slicing again\n\t\t\t\tif (!pass) {\n\t\t\t\t\tearcutLinked(filterPoints(ear), triangles, dim, minX, minY, invSize, 1); // if this didn't work, try curing all small self-intersections locally\n\t\t\t\t} else if (pass === 1) {\n\t\t\t\t\tear = cureLocalIntersections(filterPoints(ear), triangles, dim);\n\t\t\t\t\tearcutLinked(ear, triangles, dim, minX, minY, invSize, 2); // as a last resort, try splitting the remaining polygon into two\n\t\t\t\t} else if (pass === 2) {\n\t\t\t\t\tsplitEarcut(ear, triangles, dim, minX, minY, invSize);\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t} // check whether a polygon node forms a valid ear with adjacent nodes\n\n\n\tfunction isEar(ear) {\n\t\tconst a = ear.prev,\n\t\t\t\t\tb = ear,\n\t\t\t\t\tc = ear.next;\n\t\tif (area(a, b, c) >= 0) return false; // reflex, can't be an ear\n\t\t// now make sure we don't have other points inside the potential ear\n\n\t\tlet p = ear.next.next;\n\n\t\twhile (p !== ear.prev) {\n\t\t\tif (pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) && area(p.prev, p, p.next) >= 0) return false;\n\t\t\tp = p.next;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tfunction isEarHashed(ear, minX, minY, invSize) {\n\t\tconst a = ear.prev,\n\t\t\t\t\tb = ear,\n\t\t\t\t\tc = ear.next;\n\t\tif (area(a, b, c) >= 0) return false; // reflex, can't be an ear\n\t\t// triangle bbox; min & max are calculated like this for speed\n\n\t\tconst minTX = a.x < b.x ? a.x < c.x ? a.x : c.x : b.x < c.x ? b.x : c.x,\n\t\t\t\t\tminTY = a.y < b.y ? a.y < c.y ? a.y : c.y : b.y < c.y ? b.y : c.y,\n\t\t\t\t\tmaxTX = a.x > b.x ? a.x > c.x ? a.x : c.x : b.x > c.x ? b.x : c.x,\n\t\t\t\t\tmaxTY = a.y > b.y ? a.y > c.y ? a.y : c.y : b.y > c.y ? b.y : c.y; // z-order range for the current triangle bbox;\n\n\t\tconst minZ = zOrder(minTX, minTY, minX, minY, invSize),\n\t\t\t\t\tmaxZ = zOrder(maxTX, maxTY, minX, minY, invSize);\n\t\tlet p = ear.prevZ,\n\t\t\t\tn = ear.nextZ; // look for points inside the triangle in both directions\n\n\t\twhile (p && p.z >= minZ && n && n.z <= maxZ) {\n\t\t\tif (p !== ear.prev && p !== ear.next && pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) && area(p.prev, p, p.next) >= 0) return false;\n\t\t\tp = p.prevZ;\n\t\t\tif (n !== ear.prev && n !== ear.next && pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, n.x, n.y) && area(n.prev, n, n.next) >= 0) return false;\n\t\t\tn = n.nextZ;\n\t\t} // look for remaining points in decreasing z-order\n\n\n\t\twhile (p && p.z >= minZ) {\n\t\t\tif (p !== ear.prev && p !== ear.next && pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) && area(p.prev, p, p.next) >= 0) return false;\n\t\t\tp = p.prevZ;\n\t\t} // look for remaining points in increasing z-order\n\n\n\t\twhile (n && n.z <= maxZ) {\n\t\t\tif (n !== ear.prev && n !== ear.next && pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, n.x, n.y) && area(n.prev, n, n.next) >= 0) return false;\n\t\t\tn = n.nextZ;\n\t\t}\n\n\t\treturn true;\n\t} // go through all polygon nodes and cure small local self-intersections\n\n\n\tfunction cureLocalIntersections(start, triangles, dim) {\n\t\tlet p = start;\n\n\t\tdo {\n\t\t\tconst a = p.prev,\n\t\t\t\t\t\tb = p.next.next;\n\n\t\t\tif (!equals(a, b) && intersects(a, p, p.next, b) && locallyInside(a, b) && locallyInside(b, a)) {\n\t\t\t\ttriangles.push(a.i / dim);\n\t\t\t\ttriangles.push(p.i / dim);\n\t\t\t\ttriangles.push(b.i / dim); // remove two nodes involved\n\n\t\t\t\tremoveNode(p);\n\t\t\t\tremoveNode(p.next);\n\t\t\t\tp = start = b;\n\t\t\t}\n\n\t\t\tp = p.next;\n\t\t} while (p !== start);\n\n\t\treturn filterPoints(p);\n\t} // try splitting polygon into two and triangulate them independently\n\n\n\tfunction splitEarcut(start, triangles, dim, minX, minY, invSize) {\n\t\t// look for a valid diagonal that divides the polygon into two\n\t\tlet a = start;\n\n\t\tdo {\n\t\t\tlet b = a.next.next;\n\n\t\t\twhile (b !== a.prev) {\n\t\t\t\tif (a.i !== b.i && isValidDiagonal(a, b)) {\n\t\t\t\t\t// split the polygon in two by the diagonal\n\t\t\t\t\tlet c = splitPolygon(a, b); // filter colinear points around the cuts\n\n\t\t\t\t\ta = filterPoints(a, a.next);\n\t\t\t\t\tc = filterPoints(c, c.next); // run earcut on each half\n\n\t\t\t\t\tearcutLinked(a, triangles, dim, minX, minY, invSize);\n\t\t\t\t\tearcutLinked(c, triangles, dim, minX, minY, invSize);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tb = b.next;\n\t\t\t}\n\n\t\t\ta = a.next;\n\t\t} while (a !== start);\n\t} // link every hole into the outer loop, producing a single-ring polygon without holes\n\n\n\tfunction eliminateHoles(data, holeIndices, outerNode, dim) {\n\t\tconst queue = [];\n\t\tlet i, len, start, end, list;\n\n\t\tfor (i = 0, len = holeIndices.length; i < len; i++) {\n\t\t\tstart = holeIndices[i] * dim;\n\t\t\tend = i < len - 1 ? holeIndices[i + 1] * dim : data.length;\n\t\t\tlist = linkedList(data, start, end, dim, false);\n\t\t\tif (list === list.next) list.steiner = true;\n\t\t\tqueue.push(getLeftmost(list));\n\t\t}\n\n\t\tqueue.sort(compareX); // process holes from left to right\n\n\t\tfor (i = 0; i < queue.length; i++) {\n\t\t\teliminateHole(queue[i], outerNode);\n\t\t\touterNode = filterPoints(outerNode, outerNode.next);\n\t\t}\n\n\t\treturn outerNode;\n\t}\n\n\tfunction compareX(a, b) {\n\t\treturn a.x - b.x;\n\t} // find a bridge between vertices that connects hole with an outer ring and and link it\n\n\n\tfunction eliminateHole(hole, outerNode) {\n\t\touterNode = findHoleBridge(hole, outerNode);\n\n\t\tif (outerNode) {\n\t\t\tconst b = splitPolygon(outerNode, hole); // filter collinear points around the cuts\n\n\t\t\tfilterPoints(outerNode, outerNode.next);\n\t\t\tfilterPoints(b, b.next);\n\t\t}\n\t} // David Eberly's algorithm for finding a bridge between hole and outer polygon\n\n\n\tfunction findHoleBridge(hole, outerNode) {\n\t\tlet p = outerNode;\n\t\tconst hx = hole.x;\n\t\tconst hy = hole.y;\n\t\tlet qx = -Infinity,\n\t\t\t\tm; // find a segment intersected by a ray from the hole's leftmost point to the left;\n\t\t// segment's endpoint with lesser x will be potential connection point\n\n\t\tdo {\n\t\t\tif (hy <= p.y && hy >= p.next.y && p.next.y !== p.y) {\n\t\t\t\tconst x = p.x + (hy - p.y) * (p.next.x - p.x) / (p.next.y - p.y);\n\n\t\t\t\tif (x <= hx && x > qx) {\n\t\t\t\t\tqx = x;\n\n\t\t\t\t\tif (x === hx) {\n\t\t\t\t\t\tif (hy === p.y) return p;\n\t\t\t\t\t\tif (hy === p.next.y) return p.next;\n\t\t\t\t\t}\n\n\t\t\t\t\tm = p.x < p.next.x ? p : p.next;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tp = p.next;\n\t\t} while (p !== outerNode);\n\n\t\tif (!m) return null;\n\t\tif (hx === qx) return m; // hole touches outer segment; pick leftmost endpoint\n\t\t// look for points inside the triangle of hole point, segment intersection and endpoint;\n\t\t// if there are no points found, we have a valid connection;\n\t\t// otherwise choose the point of the minimum angle with the ray as connection point\n\n\t\tconst stop = m,\n\t\t\t\t\tmx = m.x,\n\t\t\t\t\tmy = m.y;\n\t\tlet tanMin = Infinity,\n\t\t\t\ttan;\n\t\tp = m;\n\n\t\tdo {\n\t\t\tif (hx >= p.x && p.x >= mx && hx !== p.x && pointInTriangle(hy < my ? hx : qx, hy, mx, my, hy < my ? qx : hx, hy, p.x, p.y)) {\n\t\t\t\ttan = Math.abs(hy - p.y) / (hx - p.x); // tangential\n\n\t\t\t\tif (locallyInside(p, hole) && (tan < tanMin || tan === tanMin && (p.x > m.x || p.x === m.x && sectorContainsSector(m, p)))) {\n\t\t\t\t\tm = p;\n\t\t\t\t\ttanMin = tan;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tp = p.next;\n\t\t} while (p !== stop);\n\n\t\treturn m;\n\t} // whether sector in vertex m contains sector in vertex p in the same coordinates\n\n\n\tfunction sectorContainsSector(m, p) {\n\t\treturn area(m.prev, m, p.prev) < 0 && area(p.next, m, m.next) < 0;\n\t} // interlink polygon nodes in z-order\n\n\n\tfunction indexCurve(start, minX, minY, invSize) {\n\t\tlet p = start;\n\n\t\tdo {\n\t\t\tif (p.z === null) p.z = zOrder(p.x, p.y, minX, minY, invSize);\n\t\t\tp.prevZ = p.prev;\n\t\t\tp.nextZ = p.next;\n\t\t\tp = p.next;\n\t\t} while (p !== start);\n\n\t\tp.prevZ.nextZ = null;\n\t\tp.prevZ = null;\n\t\tsortLinked(p);\n\t} // Simon Tatham's linked list merge sort algorithm\n\t// http://www.chiark.greenend.org.uk/~sgtatham/algorithms/listsort.html\n\n\n\tfunction sortLinked(list) {\n\t\tlet i,\n\t\t\t\tp,\n\t\t\t\tq,\n\t\t\t\te,\n\t\t\t\ttail,\n\t\t\t\tnumMerges,\n\t\t\t\tpSize,\n\t\t\t\tqSize,\n\t\t\t\tinSize = 1;\n\n\t\tdo {\n\t\t\tp = list;\n\t\t\tlist = null;\n\t\t\ttail = null;\n\t\t\tnumMerges = 0;\n\n\t\t\twhile (p) {\n\t\t\t\tnumMerges++;\n\t\t\t\tq = p;\n\t\t\t\tpSize = 0;\n\n\t\t\t\tfor (i = 0; i < inSize; i++) {\n\t\t\t\t\tpSize++;\n\t\t\t\t\tq = q.nextZ;\n\t\t\t\t\tif (!q) break;\n\t\t\t\t}\n\n\t\t\t\tqSize = inSize;\n\n\t\t\t\twhile (pSize > 0 || qSize > 0 && q) {\n\t\t\t\t\tif (pSize !== 0 && (qSize === 0 || !q || p.z <= q.z)) {\n\t\t\t\t\t\te = p;\n\t\t\t\t\t\tp = p.nextZ;\n\t\t\t\t\t\tpSize--;\n\t\t\t\t\t} else {\n\t\t\t\t\t\te = q;\n\t\t\t\t\t\tq = q.nextZ;\n\t\t\t\t\t\tqSize--;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (tail) tail.nextZ = e;else list = e;\n\t\t\t\t\te.prevZ = tail;\n\t\t\t\t\ttail = e;\n\t\t\t\t}\n\n\t\t\t\tp = q;\n\t\t\t}\n\n\t\t\ttail.nextZ = null;\n\t\t\tinSize *= 2;\n\t\t} while (numMerges > 1);\n\n\t\treturn list;\n\t} // z-order of a point given coords and inverse of the longer side of data bbox\n\n\n\tfunction zOrder(x, y, minX, minY, invSize) {\n\t\t// coords are transformed into non-negative 15-bit integer range\n\t\tx = 32767 * (x - minX) * invSize;\n\t\ty = 32767 * (y - minY) * invSize;\n\t\tx = (x | x << 8) & 0x00FF00FF;\n\t\tx = (x | x << 4) & 0x0F0F0F0F;\n\t\tx = (x | x << 2) & 0x33333333;\n\t\tx = (x | x << 1) & 0x55555555;\n\t\ty = (y | y << 8) & 0x00FF00FF;\n\t\ty = (y | y << 4) & 0x0F0F0F0F;\n\t\ty = (y | y << 2) & 0x33333333;\n\t\ty = (y | y << 1) & 0x55555555;\n\t\treturn x | y << 1;\n\t} // find the leftmost node of a polygon ring\n\n\n\tfunction getLeftmost(start) {\n\t\tlet p = start,\n\t\t\t\tleftmost = start;\n\n\t\tdo {\n\t\t\tif (p.x < leftmost.x || p.x === leftmost.x && p.y < leftmost.y) leftmost = p;\n\t\t\tp = p.next;\n\t\t} while (p !== start);\n\n\t\treturn leftmost;\n\t} // check if a point lies within a convex triangle\n\n\n\tfunction pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {\n\t\treturn (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 && (ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 && (bx - px) * (cy - py) - (cx - px) * (by - py) >= 0;\n\t} // check if a diagonal between two polygon nodes is valid (lies in polygon interior)\n\n\n\tfunction isValidDiagonal(a, b) {\n\t\treturn a.next.i !== b.i && a.prev.i !== b.i && !intersectsPolygon(a, b) && (locallyInside(a, b) && locallyInside(b, a) && middleInside(a, b) && (area(a.prev, a, b.prev) || area(a, b.prev, b)) || // does not create opposite-facing sectors\n\t\tequals(a, b) && area(a.prev, a, a.next) > 0 && area(b.prev, b, b.next) > 0); // special zero-length case\n\t} // signed area of a triangle\n\n\n\tfunction area(p, q, r) {\n\t\treturn (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);\n\t} // check if two points are equal\n\n\n\tfunction equals(p1, p2) {\n\t\treturn p1.x === p2.x && p1.y === p2.y;\n\t} // check if two segments intersect\n\n\n\tfunction intersects(p1, q1, p2, q2) {\n\t\tconst o1 = sign(area(p1, q1, p2));\n\t\tconst o2 = sign(area(p1, q1, q2));\n\t\tconst o3 = sign(area(p2, q2, p1));\n\t\tconst o4 = sign(area(p2, q2, q1));\n\t\tif (o1 !== o2 && o3 !== o4) return true; // general case\n\n\t\tif (o1 === 0 && onSegment(p1, p2, q1)) return true; // p1, q1 and p2 are collinear and p2 lies on p1q1\n\n\t\tif (o2 === 0 && onSegment(p1, q2, q1)) return true; // p1, q1 and q2 are collinear and q2 lies on p1q1\n\n\t\tif (o3 === 0 && onSegment(p2, p1, q2)) return true; // p2, q2 and p1 are collinear and p1 lies on p2q2\n\n\t\tif (o4 === 0 && onSegment(p2, q1, q2)) return true; // p2, q2 and q1 are collinear and q1 lies on p2q2\n\n\t\treturn false;\n\t} // for collinear points p, q, r, check if point q lies on segment pr\n\n\n\tfunction onSegment(p, q, r) {\n\t\treturn q.x <= Math.max(p.x, r.x) && q.x >= Math.min(p.x, r.x) && q.y <= Math.max(p.y, r.y) && q.y >= Math.min(p.y, r.y);\n\t}\n\n\tfunction sign(num) {\n\t\treturn num > 0 ? 1 : num < 0 ? -1 : 0;\n\t} // check if a polygon diagonal intersects any polygon segments\n\n\n\tfunction intersectsPolygon(a, b) {\n\t\tlet p = a;\n\n\t\tdo {\n\t\t\tif (p.i !== a.i && p.next.i !== a.i && p.i !== b.i && p.next.i !== b.i && intersects(p, p.next, a, b)) return true;\n\t\t\tp = p.next;\n\t\t} while (p !== a);\n\n\t\treturn false;\n\t} // check if a polygon diagonal is locally inside the polygon\n\n\n\tfunction locallyInside(a, b) {\n\t\treturn area(a.prev, a, a.next) < 0 ? area(a, b, a.next) >= 0 && area(a, a.prev, b) >= 0 : area(a, b, a.prev) < 0 || area(a, a.next, b) < 0;\n\t} // check if the middle point of a polygon diagonal is inside the polygon\n\n\n\tfunction middleInside(a, b) {\n\t\tlet p = a,\n\t\t\t\tinside = false;\n\t\tconst px = (a.x + b.x) / 2,\n\t\t\t\t\tpy = (a.y + b.y) / 2;\n\n\t\tdo {\n\t\t\tif (p.y > py !== p.next.y > py && p.next.y !== p.y && px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x) inside = !inside;\n\t\t\tp = p.next;\n\t\t} while (p !== a);\n\n\t\treturn inside;\n\t} // link two polygon vertices with a bridge; if the vertices belong to the same ring, it splits polygon into two;\n\t// if one belongs to the outer ring and another to a hole, it merges it into a single ring\n\n\n\tfunction splitPolygon(a, b) {\n\t\tconst a2 = new Node(a.i, a.x, a.y),\n\t\t\t\t\tb2 = new Node(b.i, b.x, b.y),\n\t\t\t\t\tan = a.next,\n\t\t\t\t\tbp = b.prev;\n\t\ta.next = b;\n\t\tb.prev = a;\n\t\ta2.next = an;\n\t\tan.prev = a2;\n\t\tb2.next = a2;\n\t\ta2.prev = b2;\n\t\tbp.next = b2;\n\t\tb2.prev = bp;\n\t\treturn b2;\n\t} // create a node and optionally link it with previous one (in a circular doubly linked list)\n\n\n\tfunction insertNode(i, x, y, last) {\n\t\tconst p = new Node(i, x, y);\n\n\t\tif (!last) {\n\t\t\tp.prev = p;\n\t\t\tp.next = p;\n\t\t} else {\n\t\t\tp.next = last.next;\n\t\t\tp.prev = last;\n\t\t\tlast.next.prev = p;\n\t\t\tlast.next = p;\n\t\t}\n\n\t\treturn p;\n\t}\n\n\tfunction removeNode(p) {\n\t\tp.next.prev = p.prev;\n\t\tp.prev.next = p.next;\n\t\tif (p.prevZ) p.prevZ.nextZ = p.nextZ;\n\t\tif (p.nextZ) p.nextZ.prevZ = p.prevZ;\n\t}\n\n\tfunction Node(i, x, y) {\n\t\t// vertex index in coordinates array\n\t\tthis.i = i; // vertex coordinates\n\n\t\tthis.x = x;\n\t\tthis.y = y; // previous and next vertex nodes in a polygon ring\n\n\t\tthis.prev = null;\n\t\tthis.next = null; // z-order curve value\n\n\t\tthis.z = null; // previous and next nodes in z-order\n\n\t\tthis.prevZ = null;\n\t\tthis.nextZ = null; // indicates whether this is a steiner point\n\n\t\tthis.steiner = false;\n\t}\n\n\tfunction signedArea(data, start, end, dim) {\n\t\tlet sum = 0;\n\n\t\tfor (let i = start, j = end - dim; i < end; i += dim) {\n\t\t\tsum += (data[j] - data[i]) * (data[i + 1] + data[j + 1]);\n\t\t\tj = i;\n\t\t}\n\n\t\treturn sum;\n\t}\n\n\tclass ShapeUtils {\n\t\t// calculate area of the contour polygon\n\t\tstatic area(contour) {\n\t\t\tconst n = contour.length;\n\t\t\tlet a = 0.0;\n\n\t\t\tfor (let p = n - 1, q = 0; q < n; p = q++) {\n\t\t\t\ta += contour[p].x * contour[q].y - contour[q].x * contour[p].y;\n\t\t\t}\n\n\t\t\treturn a * 0.5;\n\t\t}\n\n\t\tstatic isClockWise(pts) {\n\t\t\treturn ShapeUtils.area(pts) < 0;\n\t\t}\n\n\t\tstatic triangulateShape(contour, holes) {\n\t\t\tconst vertices = []; // flat array of vertices like [ x0,y0, x1,y1, x2,y2, ... ]\n\n\t\t\tconst holeIndices = []; // array of hole indices\n\n\t\t\tconst faces = []; // final array of vertex indices like [ [ a,b,d ], [ b,c,d ] ]\n\n\t\t\tremoveDupEndPts(contour);\n\t\t\taddContour(vertices, contour); //\n\n\t\t\tlet holeIndex = contour.length;\n\t\t\tholes.forEach(removeDupEndPts);\n\n\t\t\tfor (let i = 0; i < holes.length; i++) {\n\t\t\t\tholeIndices.push(holeIndex);\n\t\t\t\tholeIndex += holes[i].length;\n\t\t\t\taddContour(vertices, holes[i]);\n\t\t\t} //\n\n\n\t\t\tconst triangles = Earcut.triangulate(vertices, holeIndices); //\n\n\t\t\tfor (let i = 0; i < triangles.length; i += 3) {\n\t\t\t\tfaces.push(triangles.slice(i, i + 3));\n\t\t\t}\n\n\t\t\treturn faces;\n\t\t}\n\n\t}\n\n\tfunction removeDupEndPts(points) {\n\t\tconst l = points.length;\n\n\t\tif (l > 2 && points[l - 1].equals(points[0])) {\n\t\t\tpoints.pop();\n\t\t}\n\t}\n\n\tfunction addContour(vertices, contour) {\n\t\tfor (let i = 0; i < contour.length; i++) {\n\t\t\tvertices.push(contour[i].x);\n\t\t\tvertices.push(contour[i].y);\n\t\t}\n\t}\n\n\t/**\n\t * Creates extruded geometry from a path shape.\n\t *\n\t * parameters = {\n\t *\n\t *\tcurveSegments: <int>, // number of points on the curves\n\t *\tsteps: <int>, // number of points for z-side extrusions / used for subdividing segments of extrude spline too\n\t *\tdepth: <float>, // Depth to extrude the shape\n\t *\n\t *\tbevelEnabled: <bool>, // turn on bevel\n\t *\tbevelThickness: <float>, // how deep into the original shape bevel goes\n\t *\tbevelSize: <float>, // how far from shape outline (including bevelOffset) is bevel\n\t *\tbevelOffset: <float>, // how far from shape outline does bevel start\n\t *\tbevelSegments: <int>, // number of bevel layers\n\t *\n\t *\textrudePath: <THREE.Curve> // curve to extrude shape along\n\t *\n\t *\tUVGenerator: <Object> // object that provides UV generator functions\n\t *\n\t * }\n\t */\n\n\tclass ExtrudeGeometry extends BufferGeometry {\n\t\tconstructor(shapes = new Shape([new Vector2(0.5, 0.5), new Vector2(-0.5, 0.5), new Vector2(-0.5, -0.5), new Vector2(0.5, -0.5)]), options = {}) {\n\t\t\tsuper();\n\t\t\tthis.type = 'ExtrudeGeometry';\n\t\t\tthis.parameters = {\n\t\t\t\tshapes: shapes,\n\t\t\t\toptions: options\n\t\t\t};\n\t\t\tshapes = Array.isArray(shapes) ? shapes : [shapes];\n\t\t\tconst scope = this;\n\t\t\tconst verticesArray = [];\n\t\t\tconst uvArray = [];\n\n\t\t\tfor (let i = 0, l = shapes.length; i < l; i++) {\n\t\t\t\tconst shape = shapes[i];\n\t\t\t\taddShape(shape);\n\t\t\t} // build geometry\n\n\n\t\t\tthis.setAttribute('position', new Float32BufferAttribute(verticesArray, 3));\n\t\t\tthis.setAttribute('uv', new Float32BufferAttribute(uvArray, 2));\n\t\t\tthis.computeVertexNormals(); // functions\n\n\t\t\tfunction addShape(shape) {\n\t\t\t\tconst placeholder = []; // options\n\n\t\t\t\tconst curveSegments = options.curveSegments !== undefined ? options.curveSegments : 12;\n\t\t\t\tconst steps = options.steps !== undefined ? options.steps : 1;\n\t\t\t\tlet depth = options.depth !== undefined ? options.depth : 1;\n\t\t\t\tlet bevelEnabled = options.bevelEnabled !== undefined ? options.bevelEnabled : true;\n\t\t\t\tlet bevelThickness = options.bevelThickness !== undefined ? options.bevelThickness : 0.2;\n\t\t\t\tlet bevelSize = options.bevelSize !== undefined ? options.bevelSize : bevelThickness - 0.1;\n\t\t\t\tlet bevelOffset = options.bevelOffset !== undefined ? options.bevelOffset : 0;\n\t\t\t\tlet bevelSegments = options.bevelSegments !== undefined ? options.bevelSegments : 3;\n\t\t\t\tconst extrudePath = options.extrudePath;\n\t\t\t\tconst uvgen = options.UVGenerator !== undefined ? options.UVGenerator : WorldUVGenerator; // deprecated options\n\n\t\t\t\tif (options.amount !== undefined) {\n\t\t\t\t\tconsole.warn('THREE.ExtrudeBufferGeometry: amount has been renamed to depth.');\n\t\t\t\t\tdepth = options.amount;\n\t\t\t\t} //\n\n\n\t\t\t\tlet extrudePts,\n\t\t\t\t\t\textrudeByPath = false;\n\t\t\t\tlet splineTube, binormal, normal, position2;\n\n\t\t\t\tif (extrudePath) {\n\t\t\t\t\textrudePts = extrudePath.getSpacedPoints(steps);\n\t\t\t\t\textrudeByPath = true;\n\t\t\t\t\tbevelEnabled = false; // bevels not supported for path extrusion\n\t\t\t\t\t// SETUP TNB variables\n\t\t\t\t\t// TODO1 - have a .isClosed in spline?\n\n\t\t\t\t\tsplineTube = extrudePath.computeFrenetFrames(steps, false); // console.log(splineTube, 'splineTube', splineTube.normals.length, 'steps', steps, 'extrudePts', extrudePts.length);\n\n\t\t\t\t\tbinormal = new Vector3();\n\t\t\t\t\tnormal = new Vector3();\n\t\t\t\t\tposition2 = new Vector3();\n\t\t\t\t} // Safeguards if bevels are not enabled\n\n\n\t\t\t\tif (!bevelEnabled) {\n\t\t\t\t\tbevelSegments = 0;\n\t\t\t\t\tbevelThickness = 0;\n\t\t\t\t\tbevelSize = 0;\n\t\t\t\t\tbevelOffset = 0;\n\t\t\t\t} // Variables initialization\n\n\n\t\t\t\tconst shapePoints = shape.extractPoints(curveSegments);\n\t\t\t\tlet vertices = shapePoints.shape;\n\t\t\t\tconst holes = shapePoints.holes;\n\t\t\t\tconst reverse = !ShapeUtils.isClockWise(vertices);\n\n\t\t\t\tif (reverse) {\n\t\t\t\t\tvertices = vertices.reverse(); // Maybe we should also check if holes are in the opposite direction, just to be safe ...\n\n\t\t\t\t\tfor (let h = 0, hl = holes.length; h < hl; h++) {\n\t\t\t\t\t\tconst ahole = holes[h];\n\n\t\t\t\t\t\tif (ShapeUtils.isClockWise(ahole)) {\n\t\t\t\t\t\t\tholes[h] = ahole.reverse();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst faces = ShapeUtils.triangulateShape(vertices, holes);\n\t\t\t\t/* Vertices */\n\n\t\t\t\tconst contour = vertices; // vertices has all points but contour has only points of circumference\n\n\t\t\t\tfor (let h = 0, hl = holes.length; h < hl; h++) {\n\t\t\t\t\tconst ahole = holes[h];\n\t\t\t\t\tvertices = vertices.concat(ahole);\n\t\t\t\t}\n\n\t\t\t\tfunction scalePt2(pt, vec, size) {\n\t\t\t\t\tif (!vec) console.error('THREE.ExtrudeGeometry: vec does not exist');\n\t\t\t\t\treturn vec.clone().multiplyScalar(size).add(pt);\n\t\t\t\t}\n\n\t\t\t\tconst vlen = vertices.length,\n\t\t\t\t\t\t\tflen = faces.length; // Find directions for point movement\n\n\t\t\t\tfunction getBevelVec(inPt, inPrev, inNext) {\n\t\t\t\t\t// computes for inPt the corresponding point inPt' on a new contour\n\t\t\t\t\t//\t shifted by 1 unit (length of normalized vector) to the left\n\t\t\t\t\t// if we walk along contour clockwise, this new contour is outside the old one\n\t\t\t\t\t//\n\t\t\t\t\t// inPt' is the intersection of the two lines parallel to the two\n\t\t\t\t\t//\tadjacent edges of inPt at a distance of 1 unit on the left side.\n\t\t\t\t\tlet v_trans_x, v_trans_y, shrink_by; // resulting translation vector for inPt\n\t\t\t\t\t// good reading for geometry algorithms (here: line-line intersection)\n\t\t\t\t\t// http://geomalgorithms.com/a05-_intersect-1.html\n\n\t\t\t\t\tconst v_prev_x = inPt.x - inPrev.x,\n\t\t\t\t\t\t\t\tv_prev_y = inPt.y - inPrev.y;\n\t\t\t\t\tconst v_next_x = inNext.x - inPt.x,\n\t\t\t\t\t\t\t\tv_next_y = inNext.y - inPt.y;\n\t\t\t\t\tconst v_prev_lensq = v_prev_x * v_prev_x + v_prev_y * v_prev_y; // check for collinear edges\n\n\t\t\t\t\tconst collinear0 = v_prev_x * v_next_y - v_prev_y * v_next_x;\n\n\t\t\t\t\tif (Math.abs(collinear0) > Number.EPSILON) {\n\t\t\t\t\t\t// not collinear\n\t\t\t\t\t\t// length of vectors for normalizing\n\t\t\t\t\t\tconst v_prev_len = Math.sqrt(v_prev_lensq);\n\t\t\t\t\t\tconst v_next_len = Math.sqrt(v_next_x * v_next_x + v_next_y * v_next_y); // shift adjacent points by unit vectors to the left\n\n\t\t\t\t\t\tconst ptPrevShift_x = inPrev.x - v_prev_y / v_prev_len;\n\t\t\t\t\t\tconst ptPrevShift_y = inPrev.y + v_prev_x / v_prev_len;\n\t\t\t\t\t\tconst ptNextShift_x = inNext.x - v_next_y / v_next_len;\n\t\t\t\t\t\tconst ptNextShift_y = inNext.y + v_next_x / v_next_len; // scaling factor for v_prev to intersection point\n\n\t\t\t\t\t\tconst sf = ((ptNextShift_x - ptPrevShift_x) * v_next_y - (ptNextShift_y - ptPrevShift_y) * v_next_x) / (v_prev_x * v_next_y - v_prev_y * v_next_x); // vector from inPt to intersection point\n\n\t\t\t\t\t\tv_trans_x = ptPrevShift_x + v_prev_x * sf - inPt.x;\n\t\t\t\t\t\tv_trans_y = ptPrevShift_y + v_prev_y * sf - inPt.y; // Don't normalize!, otherwise sharp corners become ugly\n\t\t\t\t\t\t//\tbut prevent crazy spikes\n\n\t\t\t\t\t\tconst v_trans_lensq = v_trans_x * v_trans_x + v_trans_y * v_trans_y;\n\n\t\t\t\t\t\tif (v_trans_lensq <= 2) {\n\t\t\t\t\t\t\treturn new Vector2(v_trans_x, v_trans_y);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tshrink_by = Math.sqrt(v_trans_lensq / 2);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// handle special case of collinear edges\n\t\t\t\t\t\tlet direction_eq = false; // assumes: opposite\n\n\t\t\t\t\t\tif (v_prev_x > Number.EPSILON) {\n\t\t\t\t\t\t\tif (v_next_x > Number.EPSILON) {\n\t\t\t\t\t\t\t\tdirection_eq = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (v_prev_x < -Number.EPSILON) {\n\t\t\t\t\t\t\t\tif (v_next_x < -Number.EPSILON) {\n\t\t\t\t\t\t\t\t\tdirection_eq = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif (Math.sign(v_prev_y) === Math.sign(v_next_y)) {\n\t\t\t\t\t\t\t\t\tdirection_eq = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (direction_eq) {\n\t\t\t\t\t\t\t// console.log(\"Warning: lines are a straight sequence\");\n\t\t\t\t\t\t\tv_trans_x = -v_prev_y;\n\t\t\t\t\t\t\tv_trans_y = v_prev_x;\n\t\t\t\t\t\t\tshrink_by = Math.sqrt(v_prev_lensq);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// console.log(\"Warning: lines are a straight spike\");\n\t\t\t\t\t\t\tv_trans_x = v_prev_x;\n\t\t\t\t\t\t\tv_trans_y = v_prev_y;\n\t\t\t\t\t\t\tshrink_by = Math.sqrt(v_prev_lensq / 2);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn new Vector2(v_trans_x / shrink_by, v_trans_y / shrink_by);\n\t\t\t\t}\n\n\t\t\t\tconst contourMovements = [];\n\n\t\t\t\tfor (let i = 0, il = contour.length, j = il - 1, k = i + 1; i < il; i++, j++, k++) {\n\t\t\t\t\tif (j === il) j = 0;\n\t\t\t\t\tif (k === il) k = 0; //\t(j)---(i)---(k)\n\t\t\t\t\t// console.log('i,j,k', i, j , k)\n\n\t\t\t\t\tcontourMovements[i] = getBevelVec(contour[i], contour[j], contour[k]);\n\t\t\t\t}\n\n\t\t\t\tconst holesMovements = [];\n\t\t\t\tlet oneHoleMovements,\n\t\t\t\t\t\tverticesMovements = contourMovements.concat();\n\n\t\t\t\tfor (let h = 0, hl = holes.length; h < hl; h++) {\n\t\t\t\t\tconst ahole = holes[h];\n\t\t\t\t\toneHoleMovements = [];\n\n\t\t\t\t\tfor (let i = 0, il = ahole.length, j = il - 1, k = i + 1; i < il; i++, j++, k++) {\n\t\t\t\t\t\tif (j === il) j = 0;\n\t\t\t\t\t\tif (k === il) k = 0; //\t(j)---(i)---(k)\n\n\t\t\t\t\t\toneHoleMovements[i] = getBevelVec(ahole[i], ahole[j], ahole[k]);\n\t\t\t\t\t}\n\n\t\t\t\t\tholesMovements.push(oneHoleMovements);\n\t\t\t\t\tverticesMovements = verticesMovements.concat(oneHoleMovements);\n\t\t\t\t} // Loop bevelSegments, 1 for the front, 1 for the back\n\n\n\t\t\t\tfor (let b = 0; b < bevelSegments; b++) {\n\t\t\t\t\t//for ( b = bevelSegments; b > 0; b -- ) {\n\t\t\t\t\tconst t = b / bevelSegments;\n\t\t\t\t\tconst z = bevelThickness * Math.cos(t * Math.PI / 2);\n\t\t\t\t\tconst bs = bevelSize * Math.sin(t * Math.PI / 2) + bevelOffset; // contract shape\n\n\t\t\t\t\tfor (let i = 0, il = contour.length; i < il; i++) {\n\t\t\t\t\t\tconst vert = scalePt2(contour[i], contourMovements[i], bs);\n\t\t\t\t\t\tv(vert.x, vert.y, -z);\n\t\t\t\t\t} // expand holes\n\n\n\t\t\t\t\tfor (let h = 0, hl = holes.length; h < hl; h++) {\n\t\t\t\t\t\tconst ahole = holes[h];\n\t\t\t\t\t\toneHoleMovements = holesMovements[h];\n\n\t\t\t\t\t\tfor (let i = 0, il = ahole.length; i < il; i++) {\n\t\t\t\t\t\t\tconst vert = scalePt2(ahole[i], oneHoleMovements[i], bs);\n\t\t\t\t\t\t\tv(vert.x, vert.y, -z);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst bs = bevelSize + bevelOffset; // Back facing vertices\n\n\t\t\t\tfor (let i = 0; i < vlen; i++) {\n\t\t\t\t\tconst vert = bevelEnabled ? scalePt2(vertices[i], verticesMovements[i], bs) : vertices[i];\n\n\t\t\t\t\tif (!extrudeByPath) {\n\t\t\t\t\t\tv(vert.x, vert.y, 0);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// v( vert.x, vert.y + extrudePts[ 0 ].y, extrudePts[ 0 ].x );\n\t\t\t\t\t\tnormal.copy(splineTube.normals[0]).multiplyScalar(vert.x);\n\t\t\t\t\t\tbinormal.copy(splineTube.binormals[0]).multiplyScalar(vert.y);\n\t\t\t\t\t\tposition2.copy(extrudePts[0]).add(normal).add(binormal);\n\t\t\t\t\t\tv(position2.x, position2.y, position2.z);\n\t\t\t\t\t}\n\t\t\t\t} // Add stepped vertices...\n\t\t\t\t// Including front facing vertices\n\n\n\t\t\t\tfor (let s = 1; s <= steps; s++) {\n\t\t\t\t\tfor (let i = 0; i < vlen; i++) {\n\t\t\t\t\t\tconst vert = bevelEnabled ? scalePt2(vertices[i], verticesMovements[i], bs) : vertices[i];\n\n\t\t\t\t\t\tif (!extrudeByPath) {\n\t\t\t\t\t\t\tv(vert.x, vert.y, depth / steps * s);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// v( vert.x, vert.y + extrudePts[ s - 1 ].y, extrudePts[ s - 1 ].x );\n\t\t\t\t\t\t\tnormal.copy(splineTube.normals[s]).multiplyScalar(vert.x);\n\t\t\t\t\t\t\tbinormal.copy(splineTube.binormals[s]).multiplyScalar(vert.y);\n\t\t\t\t\t\t\tposition2.copy(extrudePts[s]).add(normal).add(binormal);\n\t\t\t\t\t\t\tv(position2.x, position2.y, position2.z);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} // Add bevel segments planes\n\t\t\t\t//for ( b = 1; b <= bevelSegments; b ++ ) {\n\n\n\t\t\t\tfor (let b = bevelSegments - 1; b >= 0; b--) {\n\t\t\t\t\tconst t = b / bevelSegments;\n\t\t\t\t\tconst z = bevelThickness * Math.cos(t * Math.PI / 2);\n\t\t\t\t\tconst bs = bevelSize * Math.sin(t * Math.PI / 2) + bevelOffset; // contract shape\n\n\t\t\t\t\tfor (let i = 0, il = contour.length; i < il; i++) {\n\t\t\t\t\t\tconst vert = scalePt2(contour[i], contourMovements[i], bs);\n\t\t\t\t\t\tv(vert.x, vert.y, depth + z);\n\t\t\t\t\t} // expand holes\n\n\n\t\t\t\t\tfor (let h = 0, hl = holes.length; h < hl; h++) {\n\t\t\t\t\t\tconst ahole = holes[h];\n\t\t\t\t\t\toneHoleMovements = holesMovements[h];\n\n\t\t\t\t\t\tfor (let i = 0, il = ahole.length; i < il; i++) {\n\t\t\t\t\t\t\tconst vert = scalePt2(ahole[i], oneHoleMovements[i], bs);\n\n\t\t\t\t\t\t\tif (!extrudeByPath) {\n\t\t\t\t\t\t\t\tv(vert.x, vert.y, depth + z);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tv(vert.x, vert.y + extrudePts[steps - 1].y, extrudePts[steps - 1].x + z);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t/* Faces */\n\t\t\t\t// Top and bottom faces\n\n\n\t\t\t\tbuildLidFaces(); // Sides faces\n\n\t\t\t\tbuildSideFaces(); /////\tInternal functions\n\n\t\t\t\tfunction buildLidFaces() {\n\t\t\t\t\tconst start = verticesArray.length / 3;\n\n\t\t\t\t\tif (bevelEnabled) {\n\t\t\t\t\t\tlet layer = 0; // steps + 1\n\n\t\t\t\t\t\tlet offset = vlen * layer; // Bottom faces\n\n\t\t\t\t\t\tfor (let i = 0; i < flen; i++) {\n\t\t\t\t\t\t\tconst face = faces[i];\n\t\t\t\t\t\t\tf3(face[2] + offset, face[1] + offset, face[0] + offset);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlayer = steps + bevelSegments * 2;\n\t\t\t\t\t\toffset = vlen * layer; // Top faces\n\n\t\t\t\t\t\tfor (let i = 0; i < flen; i++) {\n\t\t\t\t\t\t\tconst face = faces[i];\n\t\t\t\t\t\t\tf3(face[0] + offset, face[1] + offset, face[2] + offset);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Bottom faces\n\t\t\t\t\t\tfor (let i = 0; i < flen; i++) {\n\t\t\t\t\t\t\tconst face = faces[i];\n\t\t\t\t\t\t\tf3(face[2], face[1], face[0]);\n\t\t\t\t\t\t} // Top faces\n\n\n\t\t\t\t\t\tfor (let i = 0; i < flen; i++) {\n\t\t\t\t\t\t\tconst face = faces[i];\n\t\t\t\t\t\t\tf3(face[0] + vlen * steps, face[1] + vlen * steps, face[2] + vlen * steps);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tscope.addGroup(start, verticesArray.length / 3 - start, 0);\n\t\t\t\t} // Create faces for the z-sides of the shape\n\n\n\t\t\t\tfunction buildSideFaces() {\n\t\t\t\t\tconst start = verticesArray.length / 3;\n\t\t\t\t\tlet layeroffset = 0;\n\t\t\t\t\tsidewalls(contour, layeroffset);\n\t\t\t\t\tlayeroffset += contour.length;\n\n\t\t\t\t\tfor (let h = 0, hl = holes.length; h < hl; h++) {\n\t\t\t\t\t\tconst ahole = holes[h];\n\t\t\t\t\t\tsidewalls(ahole, layeroffset); //, true\n\n\t\t\t\t\t\tlayeroffset += ahole.length;\n\t\t\t\t\t}\n\n\t\t\t\t\tscope.addGroup(start, verticesArray.length / 3 - start, 1);\n\t\t\t\t}\n\n\t\t\t\tfunction sidewalls(contour, layeroffset) {\n\t\t\t\t\tlet i = contour.length;\n\n\t\t\t\t\twhile (--i >= 0) {\n\t\t\t\t\t\tconst j = i;\n\t\t\t\t\t\tlet k = i - 1;\n\t\t\t\t\t\tif (k < 0) k = contour.length - 1; //console.log('b', i,j, i-1, k,vertices.length);\n\n\t\t\t\t\t\tfor (let s = 0, sl = steps + bevelSegments * 2; s < sl; s++) {\n\t\t\t\t\t\t\tconst slen1 = vlen * s;\n\t\t\t\t\t\t\tconst slen2 = vlen * (s + 1);\n\t\t\t\t\t\t\tconst a = layeroffset + j + slen1,\n\t\t\t\t\t\t\t\t\t\tb = layeroffset + k + slen1,\n\t\t\t\t\t\t\t\t\t\tc = layeroffset + k + slen2,\n\t\t\t\t\t\t\t\t\t\td = layeroffset + j + slen2;\n\t\t\t\t\t\t\tf4(a, b, c, d);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfunction v(x, y, z) {\n\t\t\t\t\tplaceholder.push(x);\n\t\t\t\t\tplaceholder.push(y);\n\t\t\t\t\tplaceholder.push(z);\n\t\t\t\t}\n\n\t\t\t\tfunction f3(a, b, c) {\n\t\t\t\t\taddVertex(a);\n\t\t\t\t\taddVertex(b);\n\t\t\t\t\taddVertex(c);\n\t\t\t\t\tconst nextIndex = verticesArray.length / 3;\n\t\t\t\t\tconst uvs = uvgen.generateTopUV(scope, verticesArray, nextIndex - 3, nextIndex - 2, nextIndex - 1);\n\t\t\t\t\taddUV(uvs[0]);\n\t\t\t\t\taddUV(uvs[1]);\n\t\t\t\t\taddUV(uvs[2]);\n\t\t\t\t}\n\n\t\t\t\tfunction f4(a, b, c, d) {\n\t\t\t\t\taddVertex(a);\n\t\t\t\t\taddVertex(b);\n\t\t\t\t\taddVertex(d);\n\t\t\t\t\taddVertex(b);\n\t\t\t\t\taddVertex(c);\n\t\t\t\t\taddVertex(d);\n\t\t\t\t\tconst nextIndex = verticesArray.length / 3;\n\t\t\t\t\tconst uvs = uvgen.generateSideWallUV(scope, verticesArray, nextIndex - 6, nextIndex - 3, nextIndex - 2, nextIndex - 1);\n\t\t\t\t\taddUV(uvs[0]);\n\t\t\t\t\taddUV(uvs[1]);\n\t\t\t\t\taddUV(uvs[3]);\n\t\t\t\t\taddUV(uvs[1]);\n\t\t\t\t\taddUV(uvs[2]);\n\t\t\t\t\taddUV(uvs[3]);\n\t\t\t\t}\n\n\t\t\t\tfunction addVertex(index) {\n\t\t\t\t\tverticesArray.push(placeholder[index * 3 + 0]);\n\t\t\t\t\tverticesArray.push(placeholder[index * 3 + 1]);\n\t\t\t\t\tverticesArray.push(placeholder[index * 3 + 2]);\n\t\t\t\t}\n\n\t\t\t\tfunction addUV(vector2) {\n\t\t\t\t\tuvArray.push(vector2.x);\n\t\t\t\t\tuvArray.push(vector2.y);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\ttoJSON() {\n\t\t\tconst data = super.toJSON();\n\t\t\tconst shapes = this.parameters.shapes;\n\t\t\tconst options = this.parameters.options;\n\t\t\treturn toJSON$1(shapes, options, data);\n\t\t}\n\n\t\tstatic fromJSON(data, shapes) {\n\t\t\tconst geometryShapes = [];\n\n\t\t\tfor (let j = 0, jl = data.shapes.length; j < jl; j++) {\n\t\t\t\tconst shape = shapes[data.shapes[j]];\n\t\t\t\tgeometryShapes.push(shape);\n\t\t\t}\n\n\t\t\tconst extrudePath = data.options.extrudePath;\n\n\t\t\tif (extrudePath !== undefined) {\n\t\t\t\tdata.options.extrudePath = new Curves[extrudePath.type]().fromJSON(extrudePath);\n\t\t\t}\n\n\t\t\treturn new ExtrudeGeometry(geometryShapes, data.options);\n\t\t}\n\n\t}\n\n\tconst WorldUVGenerator = {\n\t\tgenerateTopUV: function (geometry, vertices, indexA, indexB, indexC) {\n\t\t\tconst a_x = vertices[indexA * 3];\n\t\t\tconst a_y = vertices[indexA * 3 + 1];\n\t\t\tconst b_x = vertices[indexB * 3];\n\t\t\tconst b_y = vertices[indexB * 3 + 1];\n\t\t\tconst c_x = vertices[indexC * 3];\n\t\t\tconst c_y = vertices[indexC * 3 + 1];\n\t\t\treturn [new Vector2(a_x, a_y), new Vector2(b_x, b_y), new Vector2(c_x, c_y)];\n\t\t},\n\t\tgenerateSideWallUV: function (geometry, vertices, indexA, indexB, indexC, indexD) {\n\t\t\tconst a_x = vertices[indexA * 3];\n\t\t\tconst a_y = vertices[indexA * 3 + 1];\n\t\t\tconst a_z = vertices[indexA * 3 + 2];\n\t\t\tconst b_x = vertices[indexB * 3];\n\t\t\tconst b_y = vertices[indexB * 3 + 1];\n\t\t\tconst b_z = vertices[indexB * 3 + 2];\n\t\t\tconst c_x = vertices[indexC * 3];\n\t\t\tconst c_y = vertices[indexC * 3 + 1];\n\t\t\tconst c_z = vertices[indexC * 3 + 2];\n\t\t\tconst d_x = vertices[indexD * 3];\n\t\t\tconst d_y = vertices[indexD * 3 + 1];\n\t\t\tconst d_z = vertices[indexD * 3 + 2];\n\n\t\t\tif (Math.abs(a_y - b_y) < Math.abs(a_x - b_x)) {\n\t\t\t\treturn [new Vector2(a_x, 1 - a_z), new Vector2(b_x, 1 - b_z), new Vector2(c_x, 1 - c_z), new Vector2(d_x, 1 - d_z)];\n\t\t\t} else {\n\t\t\t\treturn [new Vector2(a_y, 1 - a_z), new Vector2(b_y, 1 - b_z), new Vector2(c_y, 1 - c_z), new Vector2(d_y, 1 - d_z)];\n\t\t\t}\n\t\t}\n\t};\n\n\tfunction toJSON$1(shapes, options, data) {\n\t\tdata.shapes = [];\n\n\t\tif (Array.isArray(shapes)) {\n\t\t\tfor (let i = 0, l = shapes.length; i < l; i++) {\n\t\t\t\tconst shape = shapes[i];\n\t\t\t\tdata.shapes.push(shape.uuid);\n\t\t\t}\n\t\t} else {\n\t\t\tdata.shapes.push(shapes.uuid);\n\t\t}\n\n\t\tif (options.extrudePath !== undefined) data.options.extrudePath = options.extrudePath.toJSON();\n\t\treturn data;\n\t}\n\n\tclass IcosahedronGeometry extends PolyhedronGeometry {\n\t\tconstructor(radius = 1, detail = 0) {\n\t\t\tconst t = (1 + Math.sqrt(5)) / 2;\n\t\t\tconst vertices = [-1, t, 0, 1, t, 0, -1, -t, 0, 1, -t, 0, 0, -1, t, 0, 1, t, 0, -1, -t, 0, 1, -t, t, 0, -1, t, 0, 1, -t, 0, -1, -t, 0, 1];\n\t\t\tconst indices = [0, 11, 5, 0, 5, 1, 0, 1, 7, 0, 7, 10, 0, 10, 11, 1, 5, 9, 5, 11, 4, 11, 10, 2, 10, 7, 6, 7, 1, 8, 3, 9, 4, 3, 4, 2, 3, 2, 6, 3, 6, 8, 3, 8, 9, 4, 9, 5, 2, 4, 11, 6, 2, 10, 8, 6, 7, 9, 8, 1];\n\t\t\tsuper(vertices, indices, radius, detail);\n\t\t\tthis.type = 'IcosahedronGeometry';\n\t\t\tthis.parameters = {\n\t\t\t\tradius: radius,\n\t\t\t\tdetail: detail\n\t\t\t};\n\t\t}\n\n\t\tstatic fromJSON(data) {\n\t\t\treturn new IcosahedronGeometry(data.radius, data.detail);\n\t\t}\n\n\t}\n\n\tclass LatheGeometry extends BufferGeometry {\n\t\tconstructor(points = [new Vector2(0, 0.5), new Vector2(0.5, 0), new Vector2(0, -0.5)], segments = 12, phiStart = 0, phiLength = Math.PI * 2) {\n\t\t\tsuper();\n\t\t\tthis.type = 'LatheGeometry';\n\t\t\tthis.parameters = {\n\t\t\t\tpoints: points,\n\t\t\t\tsegments: segments,\n\t\t\t\tphiStart: phiStart,\n\t\t\t\tphiLength: phiLength\n\t\t\t};\n\t\t\tsegments = Math.floor(segments); // clamp phiLength so it's in range of [ 0, 2PI ]\n\n\t\t\tphiLength = clamp(phiLength, 0, Math.PI * 2); // buffers\n\n\t\t\tconst indices = [];\n\t\t\tconst vertices = [];\n\t\t\tconst uvs = []; // helper variables\n\n\t\t\tconst inverseSegments = 1.0 / segments;\n\t\t\tconst vertex = new Vector3();\n\t\t\tconst uv = new Vector2(); // generate vertices and uvs\n\n\t\t\tfor (let i = 0; i <= segments; i++) {\n\t\t\t\tconst phi = phiStart + i * inverseSegments * phiLength;\n\t\t\t\tconst sin = Math.sin(phi);\n\t\t\t\tconst cos = Math.cos(phi);\n\n\t\t\t\tfor (let j = 0; j <= points.length - 1; j++) {\n\t\t\t\t\t// vertex\n\t\t\t\t\tvertex.x = points[j].x * sin;\n\t\t\t\t\tvertex.y = points[j].y;\n\t\t\t\t\tvertex.z = points[j].x * cos;\n\t\t\t\t\tvertices.push(vertex.x, vertex.y, vertex.z); // uv\n\n\t\t\t\t\tuv.x = i / segments;\n\t\t\t\t\tuv.y = j / (points.length - 1);\n\t\t\t\t\tuvs.push(uv.x, uv.y);\n\t\t\t\t}\n\t\t\t} // indices\n\n\n\t\t\tfor (let i = 0; i < segments; i++) {\n\t\t\t\tfor (let j = 0; j < points.length - 1; j++) {\n\t\t\t\t\tconst base = j + i * points.length;\n\t\t\t\t\tconst a = base;\n\t\t\t\t\tconst b = base + points.length;\n\t\t\t\t\tconst c = base + points.length + 1;\n\t\t\t\t\tconst d = base + 1; // faces\n\n\t\t\t\t\tindices.push(a, b, d);\n\t\t\t\t\tindices.push(b, c, d);\n\t\t\t\t}\n\t\t\t} // build geometry\n\n\n\t\t\tthis.setIndex(indices);\n\t\t\tthis.setAttribute('position', new Float32BufferAttribute(vertices, 3));\n\t\t\tthis.setAttribute('uv', new Float32BufferAttribute(uvs, 2)); // generate normals\n\n\t\t\tthis.computeVertexNormals(); // if the geometry is closed, we need to average the normals along the seam.\n\t\t\t// because the corresponding vertices are identical (but still have different UVs).\n\n\t\t\tif (phiLength === Math.PI * 2) {\n\t\t\t\tconst normals = this.attributes.normal.array;\n\t\t\t\tconst n1 = new Vector3();\n\t\t\t\tconst n2 = new Vector3();\n\t\t\t\tconst n = new Vector3(); // this is the buffer offset for the last line of vertices\n\n\t\t\t\tconst base = segments * points.length * 3;\n\n\t\t\t\tfor (let i = 0, j = 0; i < points.length; i++, j += 3) {\n\t\t\t\t\t// select the normal of the vertex in the first line\n\t\t\t\t\tn1.x = normals[j + 0];\n\t\t\t\t\tn1.y = normals[j + 1];\n\t\t\t\t\tn1.z = normals[j + 2]; // select the normal of the vertex in the last line\n\n\t\t\t\t\tn2.x = normals[base + j + 0];\n\t\t\t\t\tn2.y = normals[base + j + 1];\n\t\t\t\t\tn2.z = normals[base + j + 2]; // average normals\n\n\t\t\t\t\tn.addVectors(n1, n2).normalize(); // assign the new values to both normals\n\n\t\t\t\t\tnormals[j + 0] = normals[base + j + 0] = n.x;\n\t\t\t\t\tnormals[j + 1] = normals[base + j + 1] = n.y;\n\t\t\t\t\tnormals[j + 2] = normals[base + j + 2] = n.z;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tstatic fromJSON(data) {\n\t\t\treturn new LatheGeometry(data.points, data.segments, data.phiStart, data.phiLength);\n\t\t}\n\n\t}\n\n\tclass OctahedronGeometry extends PolyhedronGeometry {\n\t\tconstructor(radius = 1, detail = 0) {\n\t\t\tconst vertices = [1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1];\n\t\t\tconst indices = [0, 2, 4, 0, 4, 3, 0, 3, 5, 0, 5, 2, 1, 2, 5, 1, 5, 3, 1, 3, 4, 1, 4, 2];\n\t\t\tsuper(vertices, indices, radius, detail);\n\t\t\tthis.type = 'OctahedronGeometry';\n\t\t\tthis.parameters = {\n\t\t\t\tradius: radius,\n\t\t\t\tdetail: detail\n\t\t\t};\n\t\t}\n\n\t\tstatic fromJSON(data) {\n\t\t\treturn new OctahedronGeometry(data.radius, data.detail);\n\t\t}\n\n\t}\n\n\tclass RingGeometry extends BufferGeometry {\n\t\tconstructor(innerRadius = 0.5, outerRadius = 1, thetaSegments = 8, phiSegments = 1, thetaStart = 0, thetaLength = Math.PI * 2) {\n\t\t\tsuper();\n\t\t\tthis.type = 'RingGeometry';\n\t\t\tthis.parameters = {\n\t\t\t\tinnerRadius: innerRadius,\n\t\t\t\touterRadius: outerRadius,\n\t\t\t\tthetaSegments: thetaSegments,\n\t\t\t\tphiSegments: phiSegments,\n\t\t\t\tthetaStart: thetaStart,\n\t\t\t\tthetaLength: thetaLength\n\t\t\t};\n\t\t\tthetaSegments = Math.max(3, thetaSegments);\n\t\t\tphiSegments = Math.max(1, phiSegments); // buffers\n\n\t\t\tconst indices = [];\n\t\t\tconst vertices = [];\n\t\t\tconst normals = [];\n\t\t\tconst uvs = []; // some helper variables\n\n\t\t\tlet radius = innerRadius;\n\t\t\tconst radiusStep = (outerRadius - innerRadius) / phiSegments;\n\t\t\tconst vertex = new Vector3();\n\t\t\tconst uv = new Vector2(); // generate vertices, normals and uvs\n\n\t\t\tfor (let j = 0; j <= phiSegments; j++) {\n\t\t\t\tfor (let i = 0; i <= thetaSegments; i++) {\n\t\t\t\t\t// values are generate from the inside of the ring to the outside\n\t\t\t\t\tconst segment = thetaStart + i / thetaSegments * thetaLength; // vertex\n\n\t\t\t\t\tvertex.x = radius * Math.cos(segment);\n\t\t\t\t\tvertex.y = radius * Math.sin(segment);\n\t\t\t\t\tvertices.push(vertex.x, vertex.y, vertex.z); // normal\n\n\t\t\t\t\tnormals.push(0, 0, 1); // uv\n\n\t\t\t\t\tuv.x = (vertex.x / outerRadius + 1) / 2;\n\t\t\t\t\tuv.y = (vertex.y / outerRadius + 1) / 2;\n\t\t\t\t\tuvs.push(uv.x, uv.y);\n\t\t\t\t} // increase the radius for next row of vertices\n\n\n\t\t\t\tradius += radiusStep;\n\t\t\t} // indices\n\n\n\t\t\tfor (let j = 0; j < phiSegments; j++) {\n\t\t\t\tconst thetaSegmentLevel = j * (thetaSegments + 1);\n\n\t\t\t\tfor (let i = 0; i < thetaSegments; i++) {\n\t\t\t\t\tconst segment = i + thetaSegmentLevel;\n\t\t\t\t\tconst a = segment;\n\t\t\t\t\tconst b = segment + thetaSegments + 1;\n\t\t\t\t\tconst c = segment + thetaSegments + 2;\n\t\t\t\t\tconst d = segment + 1; // faces\n\n\t\t\t\t\tindices.push(a, b, d);\n\t\t\t\t\tindices.push(b, c, d);\n\t\t\t\t}\n\t\t\t} // build geometry\n\n\n\t\t\tthis.setIndex(indices);\n\t\t\tthis.setAttribute('position', new Float32BufferAttribute(vertices, 3));\n\t\t\tthis.setAttribute('normal', new Float32BufferAttribute(normals, 3));\n\t\t\tthis.setAttribute('uv', new Float32BufferAttribute(uvs, 2));\n\t\t}\n\n\t\tstatic fromJSON(data) {\n\t\t\treturn new RingGeometry(data.innerRadius, data.outerRadius, data.thetaSegments, data.phiSegments, data.thetaStart, data.thetaLength);\n\t\t}\n\n\t}\n\n\tclass ShapeGeometry extends BufferGeometry {\n\t\tconstructor(shapes = new Shape([new Vector2(0, 0.5), new Vector2(-0.5, -0.5), new Vector2(0.5, -0.5)]), curveSegments = 12) {\n\t\t\tsuper();\n\t\t\tthis.type = 'ShapeGeometry';\n\t\t\tthis.parameters = {\n\t\t\t\tshapes: shapes,\n\t\t\t\tcurveSegments: curveSegments\n\t\t\t}; // buffers\n\n\t\t\tconst indices = [];\n\t\t\tconst vertices = [];\n\t\t\tconst normals = [];\n\t\t\tconst uvs = []; // helper variables\n\n\t\t\tlet groupStart = 0;\n\t\t\tlet groupCount = 0; // allow single and array values for \"shapes\" parameter\n\n\t\t\tif (Array.isArray(shapes) === false) {\n\t\t\t\taddShape(shapes);\n\t\t\t} else {\n\t\t\t\tfor (let i = 0; i < shapes.length; i++) {\n\t\t\t\t\taddShape(shapes[i]);\n\t\t\t\t\tthis.addGroup(groupStart, groupCount, i); // enables MultiMaterial support\n\n\t\t\t\t\tgroupStart += groupCount;\n\t\t\t\t\tgroupCount = 0;\n\t\t\t\t}\n\t\t\t} // build geometry\n\n\n\t\t\tthis.setIndex(indices);\n\t\t\tthis.setAttribute('position', new Float32BufferAttribute(vertices, 3));\n\t\t\tthis.setAttribute('normal', new Float32BufferAttribute(normals, 3));\n\t\t\tthis.setAttribute('uv', new Float32BufferAttribute(uvs, 2)); // helper functions\n\n\t\t\tfunction addShape(shape) {\n\t\t\t\tconst indexOffset = vertices.length / 3;\n\t\t\t\tconst points = shape.extractPoints(curveSegments);\n\t\t\t\tlet shapeVertices = points.shape;\n\t\t\t\tconst shapeHoles = points.holes; // check direction of vertices\n\n\t\t\t\tif (ShapeUtils.isClockWise(shapeVertices) === false) {\n\t\t\t\t\tshapeVertices = shapeVertices.reverse();\n\t\t\t\t}\n\n\t\t\t\tfor (let i = 0, l = shapeHoles.length; i < l; i++) {\n\t\t\t\t\tconst shapeHole = shapeHoles[i];\n\n\t\t\t\t\tif (ShapeUtils.isClockWise(shapeHole) === true) {\n\t\t\t\t\t\tshapeHoles[i] = shapeHole.reverse();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst faces = ShapeUtils.triangulateShape(shapeVertices, shapeHoles); // join vertices of inner and outer paths to a single array\n\n\t\t\t\tfor (let i = 0, l = shapeHoles.length; i < l; i++) {\n\t\t\t\t\tconst shapeHole = shapeHoles[i];\n\t\t\t\t\tshapeVertices = shapeVertices.concat(shapeHole);\n\t\t\t\t} // vertices, normals, uvs\n\n\n\t\t\t\tfor (let i = 0, l = shapeVertices.length; i < l; i++) {\n\t\t\t\t\tconst vertex = shapeVertices[i];\n\t\t\t\t\tvertices.push(vertex.x, vertex.y, 0);\n\t\t\t\t\tnormals.push(0, 0, 1);\n\t\t\t\t\tuvs.push(vertex.x, vertex.y); // world uvs\n\t\t\t\t} // incides\n\n\n\t\t\t\tfor (let i = 0, l = faces.length; i < l; i++) {\n\t\t\t\t\tconst face = faces[i];\n\t\t\t\t\tconst a = face[0] + indexOffset;\n\t\t\t\t\tconst b = face[1] + indexOffset;\n\t\t\t\t\tconst c = face[2] + indexOffset;\n\t\t\t\t\tindices.push(a, b, c);\n\t\t\t\t\tgroupCount += 3;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\ttoJSON() {\n\t\t\tconst data = super.toJSON();\n\t\t\tconst shapes = this.parameters.shapes;\n\t\t\treturn toJSON(shapes, data);\n\t\t}\n\n\t\tstatic fromJSON(data, shapes) {\n\t\t\tconst geometryShapes = [];\n\n\t\t\tfor (let j = 0, jl = data.shapes.length; j < jl; j++) {\n\t\t\t\tconst shape = shapes[data.shapes[j]];\n\t\t\t\tgeometryShapes.push(shape);\n\t\t\t}\n\n\t\t\treturn new ShapeGeometry(geometryShapes, data.curveSegments);\n\t\t}\n\n\t}\n\n\tfunction toJSON(shapes, data) {\n\t\tdata.shapes = [];\n\n\t\tif (Array.isArray(shapes)) {\n\t\t\tfor (let i = 0, l = shapes.length; i < l; i++) {\n\t\t\t\tconst shape = shapes[i];\n\t\t\t\tdata.shapes.push(shape.uuid);\n\t\t\t}\n\t\t} else {\n\t\t\tdata.shapes.push(shapes.uuid);\n\t\t}\n\n\t\treturn data;\n\t}\n\n\tclass SphereGeometry extends BufferGeometry {\n\t\tconstructor(radius = 1, widthSegments = 32, heightSegments = 16, phiStart = 0, phiLength = Math.PI * 2, thetaStart = 0, thetaLength = Math.PI) {\n\t\t\tsuper();\n\t\t\tthis.type = 'SphereGeometry';\n\t\t\tthis.parameters = {\n\t\t\t\tradius: radius,\n\t\t\t\twidthSegments: widthSegments,\n\t\t\t\theightSegments: heightSegments,\n\t\t\t\tphiStart: phiStart,\n\t\t\t\tphiLength: phiLength,\n\t\t\t\tthetaStart: thetaStart,\n\t\t\t\tthetaLength: thetaLength\n\t\t\t};\n\t\t\twidthSegments = Math.max(3, Math.floor(widthSegments));\n\t\t\theightSegments = Math.max(2, Math.floor(heightSegments));\n\t\t\tconst thetaEnd = Math.min(thetaStart + thetaLength, Math.PI);\n\t\t\tlet index = 0;\n\t\t\tconst grid = [];\n\t\t\tconst vertex = new Vector3();\n\t\t\tconst normal = new Vector3(); // buffers\n\n\t\t\tconst indices = [];\n\t\t\tconst vertices = [];\n\t\t\tconst normals = [];\n\t\t\tconst uvs = []; // generate vertices, normals and uvs\n\n\t\t\tfor (let iy = 0; iy <= heightSegments; iy++) {\n\t\t\t\tconst verticesRow = [];\n\t\t\t\tconst v = iy / heightSegments; // special case for the poles\n\n\t\t\t\tlet uOffset = 0;\n\n\t\t\t\tif (iy == 0 && thetaStart == 0) {\n\t\t\t\t\tuOffset = 0.5 / widthSegments;\n\t\t\t\t} else if (iy == heightSegments && thetaEnd == Math.PI) {\n\t\t\t\t\tuOffset = -0.5 / widthSegments;\n\t\t\t\t}\n\n\t\t\t\tfor (let ix = 0; ix <= widthSegments; ix++) {\n\t\t\t\t\tconst u = ix / widthSegments; // vertex\n\n\t\t\t\t\tvertex.x = -radius * Math.cos(phiStart + u * phiLength) * Math.sin(thetaStart + v * thetaLength);\n\t\t\t\t\tvertex.y = radius * Math.cos(thetaStart + v * thetaLength);\n\t\t\t\t\tvertex.z = radius * Math.sin(phiStart + u * phiLength) * Math.sin(thetaStart + v * thetaLength);\n\t\t\t\t\tvertices.push(vertex.x, vertex.y, vertex.z); // normal\n\n\t\t\t\t\tnormal.copy(vertex).normalize();\n\t\t\t\t\tnormals.push(normal.x, normal.y, normal.z); // uv\n\n\t\t\t\t\tuvs.push(u + uOffset, 1 - v);\n\t\t\t\t\tverticesRow.push(index++);\n\t\t\t\t}\n\n\t\t\t\tgrid.push(verticesRow);\n\t\t\t} // indices\n\n\n\t\t\tfor (let iy = 0; iy < heightSegments; iy++) {\n\t\t\t\tfor (let ix = 0; ix < widthSegments; ix++) {\n\t\t\t\t\tconst a = grid[iy][ix + 1];\n\t\t\t\t\tconst b = grid[iy][ix];\n\t\t\t\t\tconst c = grid[iy + 1][ix];\n\t\t\t\t\tconst d = grid[iy + 1][ix + 1];\n\t\t\t\t\tif (iy !== 0 || thetaStart > 0) indices.push(a, b, d);\n\t\t\t\t\tif (iy !== heightSegments - 1 || thetaEnd < Math.PI) indices.push(b, c, d);\n\t\t\t\t}\n\t\t\t} // build geometry\n\n\n\t\t\tthis.setIndex(indices);\n\t\t\tthis.setAttribute('position', new Float32BufferAttribute(vertices, 3));\n\t\t\tthis.setAttribute('normal', new Float32BufferAttribute(normals, 3));\n\t\t\tthis.setAttribute('uv', new Float32BufferAttribute(uvs, 2));\n\t\t}\n\n\t\tstatic fromJSON(data) {\n\t\t\treturn new SphereGeometry(data.radius, data.widthSegments, data.heightSegments, data.phiStart, data.phiLength, data.thetaStart, data.thetaLength);\n\t\t}\n\n\t}\n\n\tclass TetrahedronGeometry extends PolyhedronGeometry {\n\t\tconstructor(radius = 1, detail = 0) {\n\t\t\tconst vertices = [1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1];\n\t\t\tconst indices = [2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1];\n\t\t\tsuper(vertices, indices, radius, detail);\n\t\t\tthis.type = 'TetrahedronGeometry';\n\t\t\tthis.parameters = {\n\t\t\t\tradius: radius,\n\t\t\t\tdetail: detail\n\t\t\t};\n\t\t}\n\n\t\tstatic fromJSON(data) {\n\t\t\treturn new TetrahedronGeometry(data.radius, data.detail);\n\t\t}\n\n\t}\n\n\tclass TorusGeometry extends BufferGeometry {\n\t\tconstructor(radius = 1, tube = 0.4, radialSegments = 8, tubularSegments = 6, arc = Math.PI * 2) {\n\t\t\tsuper();\n\t\t\tthis.type = 'TorusGeometry';\n\t\t\tthis.parameters = {\n\t\t\t\tradius: radius,\n\t\t\t\ttube: tube,\n\t\t\t\tradialSegments: radialSegments,\n\t\t\t\ttubularSegments: tubularSegments,\n\t\t\t\tarc: arc\n\t\t\t};\n\t\t\tradialSegments = Math.floor(radialSegments);\n\t\t\ttubularSegments = Math.floor(tubularSegments); // buffers\n\n\t\t\tconst indices = [];\n\t\t\tconst vertices = [];\n\t\t\tconst normals = [];\n\t\t\tconst uvs = []; // helper variables\n\n\t\t\tconst center = new Vector3();\n\t\t\tconst vertex = new Vector3();\n\t\t\tconst normal = new Vector3(); // generate vertices, normals and uvs\n\n\t\t\tfor (let j = 0; j <= radialSegments; j++) {\n\t\t\t\tfor (let i = 0; i <= tubularSegments; i++) {\n\t\t\t\t\tconst u = i / tubularSegments * arc;\n\t\t\t\t\tconst v = j / radialSegments * Math.PI * 2; // vertex\n\n\t\t\t\t\tvertex.x = (radius + tube * Math.cos(v)) * Math.cos(u);\n\t\t\t\t\tvertex.y = (radius + tube * Math.cos(v)) * Math.sin(u);\n\t\t\t\t\tvertex.z = tube * Math.sin(v);\n\t\t\t\t\tvertices.push(vertex.x, vertex.y, vertex.z); // normal\n\n\t\t\t\t\tcenter.x = radius * Math.cos(u);\n\t\t\t\t\tcenter.y = radius * Math.sin(u);\n\t\t\t\t\tnormal.subVectors(vertex, center).normalize();\n\t\t\t\t\tnormals.push(normal.x, normal.y, normal.z); // uv\n\n\t\t\t\t\tuvs.push(i / tubularSegments);\n\t\t\t\t\tuvs.push(j / radialSegments);\n\t\t\t\t}\n\t\t\t} // generate indices\n\n\n\t\t\tfor (let j = 1; j <= radialSegments; j++) {\n\t\t\t\tfor (let i = 1; i <= tubularSegments; i++) {\n\t\t\t\t\t// indices\n\t\t\t\t\tconst a = (tubularSegments + 1) * j + i - 1;\n\t\t\t\t\tconst b = (tubularSegments + 1) * (j - 1) + i - 1;\n\t\t\t\t\tconst c = (tubularSegments + 1) * (j - 1) + i;\n\t\t\t\t\tconst d = (tubularSegments + 1) * j + i; // faces\n\n\t\t\t\t\tindices.push(a, b, d);\n\t\t\t\t\tindices.push(b, c, d);\n\t\t\t\t}\n\t\t\t} // build geometry\n\n\n\t\t\tthis.setIndex(indices);\n\t\t\tthis.setAttribute('position', new Float32BufferAttribute(vertices, 3));\n\t\t\tthis.setAttribute('normal', new Float32BufferAttribute(normals, 3));\n\t\t\tthis.setAttribute('uv', new Float32BufferAttribute(uvs, 2));\n\t\t}\n\n\t\tstatic fromJSON(data) {\n\t\t\treturn new TorusGeometry(data.radius, data.tube, data.radialSegments, data.tubularSegments, data.arc);\n\t\t}\n\n\t}\n\n\tclass TorusKnotGeometry extends BufferGeometry {\n\t\tconstructor(radius = 1, tube = 0.4, tubularSegments = 64, radialSegments = 8, p = 2, q = 3) {\n\t\t\tsuper();\n\t\t\tthis.type = 'TorusKnotGeometry';\n\t\t\tthis.parameters = {\n\t\t\t\tradius: radius,\n\t\t\t\ttube: tube,\n\t\t\t\ttubularSegments: tubularSegments,\n\t\t\t\tradialSegments: radialSegments,\n\t\t\t\tp: p,\n\t\t\t\tq: q\n\t\t\t};\n\t\t\ttubularSegments = Math.floor(tubularSegments);\n\t\t\tradialSegments = Math.floor(radialSegments); // buffers\n\n\t\t\tconst indices = [];\n\t\t\tconst vertices = [];\n\t\t\tconst normals = [];\n\t\t\tconst uvs = []; // helper variables\n\n\t\t\tconst vertex = new Vector3();\n\t\t\tconst normal = new Vector3();\n\t\t\tconst P1 = new Vector3();\n\t\t\tconst P2 = new Vector3();\n\t\t\tconst B = new Vector3();\n\t\t\tconst T = new Vector3();\n\t\t\tconst N = new Vector3(); // generate vertices, normals and uvs\n\n\t\t\tfor (let i = 0; i <= tubularSegments; ++i) {\n\t\t\t\t// the radian \"u\" is used to calculate the position on the torus curve of the current tubular segement\n\t\t\t\tconst u = i / tubularSegments * p * Math.PI * 2; // now we calculate two points. P1 is our current position on the curve, P2 is a little farther ahead.\n\t\t\t\t// these points are used to create a special \"coordinate space\", which is necessary to calculate the correct vertex positions\n\n\t\t\t\tcalculatePositionOnCurve(u, p, q, radius, P1);\n\t\t\t\tcalculatePositionOnCurve(u + 0.01, p, q, radius, P2); // calculate orthonormal basis\n\n\t\t\t\tT.subVectors(P2, P1);\n\t\t\t\tN.addVectors(P2, P1);\n\t\t\t\tB.crossVectors(T, N);\n\t\t\t\tN.crossVectors(B, T); // normalize B, N. T can be ignored, we don't use it\n\n\t\t\t\tB.normalize();\n\t\t\t\tN.normalize();\n\n\t\t\t\tfor (let j = 0; j <= radialSegments; ++j) {\n\t\t\t\t\t// now calculate the vertices. they are nothing more than an extrusion of the torus curve.\n\t\t\t\t\t// because we extrude a shape in the xy-plane, there is no need to calculate a z-value.\n\t\t\t\t\tconst v = j / radialSegments * Math.PI * 2;\n\t\t\t\t\tconst cx = -tube * Math.cos(v);\n\t\t\t\t\tconst cy = tube * Math.sin(v); // now calculate the final vertex position.\n\t\t\t\t\t// first we orient the extrusion with our basis vectos, then we add it to the current position on the curve\n\n\t\t\t\t\tvertex.x = P1.x + (cx * N.x + cy * B.x);\n\t\t\t\t\tvertex.y = P1.y + (cx * N.y + cy * B.y);\n\t\t\t\t\tvertex.z = P1.z + (cx * N.z + cy * B.z);\n\t\t\t\t\tvertices.push(vertex.x, vertex.y, vertex.z); // normal (P1 is always the center/origin of the extrusion, thus we can use it to calculate the normal)\n\n\t\t\t\t\tnormal.subVectors(vertex, P1).normalize();\n\t\t\t\t\tnormals.push(normal.x, normal.y, normal.z); // uv\n\n\t\t\t\t\tuvs.push(i / tubularSegments);\n\t\t\t\t\tuvs.push(j / radialSegments);\n\t\t\t\t}\n\t\t\t} // generate indices\n\n\n\t\t\tfor (let j = 1; j <= tubularSegments; j++) {\n\t\t\t\tfor (let i = 1; i <= radialSegments; i++) {\n\t\t\t\t\t// indices\n\t\t\t\t\tconst a = (radialSegments + 1) * (j - 1) + (i - 1);\n\t\t\t\t\tconst b = (radialSegments + 1) * j + (i - 1);\n\t\t\t\t\tconst c = (radialSegments + 1) * j + i;\n\t\t\t\t\tconst d = (radialSegments + 1) * (j - 1) + i; // faces\n\n\t\t\t\t\tindices.push(a, b, d);\n\t\t\t\t\tindices.push(b, c, d);\n\t\t\t\t}\n\t\t\t} // build geometry\n\n\n\t\t\tthis.setIndex(indices);\n\t\t\tthis.setAttribute('position', new Float32BufferAttribute(vertices, 3));\n\t\t\tthis.setAttribute('normal', new Float32BufferAttribute(normals, 3));\n\t\t\tthis.setAttribute('uv', new Float32BufferAttribute(uvs, 2)); // this function calculates the current position on the torus curve\n\n\t\t\tfunction calculatePositionOnCurve(u, p, q, radius, position) {\n\t\t\t\tconst cu = Math.cos(u);\n\t\t\t\tconst su = Math.sin(u);\n\t\t\t\tconst quOverP = q / p * u;\n\t\t\t\tconst cs = Math.cos(quOverP);\n\t\t\t\tposition.x = radius * (2 + cs) * 0.5 * cu;\n\t\t\t\tposition.y = radius * (2 + cs) * su * 0.5;\n\t\t\t\tposition.z = radius * Math.sin(quOverP) * 0.5;\n\t\t\t}\n\t\t}\n\n\t\tstatic fromJSON(data) {\n\t\t\treturn new TorusKnotGeometry(data.radius, data.tube, data.tubularSegments, data.radialSegments, data.p, data.q);\n\t\t}\n\n\t}\n\n\tclass TubeGeometry extends BufferGeometry {\n\t\tconstructor(path = new QuadraticBezierCurve3(new Vector3(-1, -1, 0), new Vector3(-1, 1, 0), new Vector3(1, 1, 0)), tubularSegments = 64, radius = 1, radialSegments = 8, closed = false) {\n\t\t\tsuper();\n\t\t\tthis.type = 'TubeGeometry';\n\t\t\tthis.parameters = {\n\t\t\t\tpath: path,\n\t\t\t\ttubularSegments: tubularSegments,\n\t\t\t\tradius: radius,\n\t\t\t\tradialSegments: radialSegments,\n\t\t\t\tclosed: closed\n\t\t\t};\n\t\t\tconst frames = path.computeFrenetFrames(tubularSegments, closed); // expose internals\n\n\t\t\tthis.tangents = frames.tangents;\n\t\t\tthis.normals = frames.normals;\n\t\t\tthis.binormals = frames.binormals; // helper variables\n\n\t\t\tconst vertex = new Vector3();\n\t\t\tconst normal = new Vector3();\n\t\t\tconst uv = new Vector2();\n\t\t\tlet P = new Vector3(); // buffer\n\n\t\t\tconst vertices = [];\n\t\t\tconst normals = [];\n\t\t\tconst uvs = [];\n\t\t\tconst indices = []; // create buffer data\n\n\t\t\tgenerateBufferData(); // build geometry\n\n\t\t\tthis.setIndex(indices);\n\t\t\tthis.setAttribute('position', new Float32BufferAttribute(vertices, 3));\n\t\t\tthis.setAttribute('normal', new Float32BufferAttribute(normals, 3));\n\t\t\tthis.setAttribute('uv', new Float32BufferAttribute(uvs, 2)); // functions\n\n\t\t\tfunction generateBufferData() {\n\t\t\t\tfor (let i = 0; i < tubularSegments; i++) {\n\t\t\t\t\tgenerateSegment(i);\n\t\t\t\t} // if the geometry is not closed, generate the last row of vertices and normals\n\t\t\t\t// at the regular position on the given path\n\t\t\t\t//\n\t\t\t\t// if the geometry is closed, duplicate the first row of vertices and normals (uvs will differ)\n\n\n\t\t\t\tgenerateSegment(closed === false ? tubularSegments : 0); // uvs are generated in a separate function.\n\t\t\t\t// this makes it easy compute correct values for closed geometries\n\n\t\t\t\tgenerateUVs(); // finally create faces\n\n\t\t\t\tgenerateIndices();\n\t\t\t}\n\n\t\t\tfunction generateSegment(i) {\n\t\t\t\t// we use getPointAt to sample evenly distributed points from the given path\n\t\t\t\tP = path.getPointAt(i / tubularSegments, P); // retrieve corresponding normal and binormal\n\n\t\t\t\tconst N = frames.normals[i];\n\t\t\t\tconst B = frames.binormals[i]; // generate normals and vertices for the current segment\n\n\t\t\t\tfor (let j = 0; j <= radialSegments; j++) {\n\t\t\t\t\tconst v = j / radialSegments * Math.PI * 2;\n\t\t\t\t\tconst sin = Math.sin(v);\n\t\t\t\t\tconst cos = -Math.cos(v); // normal\n\n\t\t\t\t\tnormal.x = cos * N.x + sin * B.x;\n\t\t\t\t\tnormal.y = cos * N.y + sin * B.y;\n\t\t\t\t\tnormal.z = cos * N.z + sin * B.z;\n\t\t\t\t\tnormal.normalize();\n\t\t\t\t\tnormals.push(normal.x, normal.y, normal.z); // vertex\n\n\t\t\t\t\tvertex.x = P.x + radius * normal.x;\n\t\t\t\t\tvertex.y = P.y + radius * normal.y;\n\t\t\t\t\tvertex.z = P.z + radius * normal.z;\n\t\t\t\t\tvertices.push(vertex.x, vertex.y, vertex.z);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction generateIndices() {\n\t\t\t\tfor (let j = 1; j <= tubularSegments; j++) {\n\t\t\t\t\tfor (let i = 1; i <= radialSegments; i++) {\n\t\t\t\t\t\tconst a = (radialSegments + 1) * (j - 1) + (i - 1);\n\t\t\t\t\t\tconst b = (radialSegments + 1) * j + (i - 1);\n\t\t\t\t\t\tconst c = (radialSegments + 1) * j + i;\n\t\t\t\t\t\tconst d = (radialSegments + 1) * (j - 1) + i; // faces\n\n\t\t\t\t\t\tindices.push(a, b, d);\n\t\t\t\t\t\tindices.push(b, c, d);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction generateUVs() {\n\t\t\t\tfor (let i = 0; i <= tubularSegments; i++) {\n\t\t\t\t\tfor (let j = 0; j <= radialSegments; j++) {\n\t\t\t\t\t\tuv.x = i / tubularSegments;\n\t\t\t\t\t\tuv.y = j / radialSegments;\n\t\t\t\t\t\tuvs.push(uv.x, uv.y);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\ttoJSON() {\n\t\t\tconst data = super.toJSON();\n\t\t\tdata.path = this.parameters.path.toJSON();\n\t\t\treturn data;\n\t\t}\n\n\t\tstatic fromJSON(data) {\n\t\t\t// This only works for built-in curves (e.g. CatmullRomCurve3).\n\t\t\t// User defined curves or instances of CurvePath will not be deserialized.\n\t\t\treturn new TubeGeometry(new Curves[data.path.type]().fromJSON(data.path), data.tubularSegments, data.radius, data.radialSegments, data.closed);\n\t\t}\n\n\t}\n\n\tclass WireframeGeometry extends BufferGeometry {\n\t\tconstructor(geometry = null) {\n\t\t\tsuper();\n\t\t\tthis.type = 'WireframeGeometry';\n\t\t\tthis.parameters = {\n\t\t\t\tgeometry: geometry\n\t\t\t};\n\n\t\t\tif (geometry !== null) {\n\t\t\t\t// buffer\n\t\t\t\tconst vertices = [];\n\t\t\t\tconst edges = new Set(); // helper variables\n\n\t\t\t\tconst start = new Vector3();\n\t\t\t\tconst end = new Vector3();\n\n\t\t\t\tif (geometry.index !== null) {\n\t\t\t\t\t// indexed BufferGeometry\n\t\t\t\t\tconst position = geometry.attributes.position;\n\t\t\t\t\tconst indices = geometry.index;\n\t\t\t\t\tlet groups = geometry.groups;\n\n\t\t\t\t\tif (groups.length === 0) {\n\t\t\t\t\t\tgroups = [{\n\t\t\t\t\t\t\tstart: 0,\n\t\t\t\t\t\t\tcount: indices.count,\n\t\t\t\t\t\t\tmaterialIndex: 0\n\t\t\t\t\t\t}];\n\t\t\t\t\t} // create a data structure that contains all eges without duplicates\n\n\n\t\t\t\t\tfor (let o = 0, ol = groups.length; o < ol; ++o) {\n\t\t\t\t\t\tconst group = groups[o];\n\t\t\t\t\t\tconst groupStart = group.start;\n\t\t\t\t\t\tconst groupCount = group.count;\n\n\t\t\t\t\t\tfor (let i = groupStart, l = groupStart + groupCount; i < l; i += 3) {\n\t\t\t\t\t\t\tfor (let j = 0; j < 3; j++) {\n\t\t\t\t\t\t\t\tconst index1 = indices.getX(i + j);\n\t\t\t\t\t\t\t\tconst index2 = indices.getX(i + (j + 1) % 3);\n\t\t\t\t\t\t\t\tstart.fromBufferAttribute(position, index1);\n\t\t\t\t\t\t\t\tend.fromBufferAttribute(position, index2);\n\n\t\t\t\t\t\t\t\tif (isUniqueEdge(start, end, edges) === true) {\n\t\t\t\t\t\t\t\t\tvertices.push(start.x, start.y, start.z);\n\t\t\t\t\t\t\t\t\tvertices.push(end.x, end.y, end.z);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// non-indexed BufferGeometry\n\t\t\t\t\tconst position = geometry.attributes.position;\n\n\t\t\t\t\tfor (let i = 0, l = position.count / 3; i < l; i++) {\n\t\t\t\t\t\tfor (let j = 0; j < 3; j++) {\n\t\t\t\t\t\t\t// three edges per triangle, an edge is represented as (index1, index2)\n\t\t\t\t\t\t\t// e.g. the first triangle has the following edges: (0,1),(1,2),(2,0)\n\t\t\t\t\t\t\tconst index1 = 3 * i + j;\n\t\t\t\t\t\t\tconst index2 = 3 * i + (j + 1) % 3;\n\t\t\t\t\t\t\tstart.fromBufferAttribute(position, index1);\n\t\t\t\t\t\t\tend.fromBufferAttribute(position, index2);\n\n\t\t\t\t\t\t\tif (isUniqueEdge(start, end, edges) === true) {\n\t\t\t\t\t\t\t\tvertices.push(start.x, start.y, start.z);\n\t\t\t\t\t\t\t\tvertices.push(end.x, end.y, end.z);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} // build geometry\n\n\n\t\t\t\tthis.setAttribute('position', new Float32BufferAttribute(vertices, 3));\n\t\t\t}\n\t\t}\n\n\t}\n\n\tfunction isUniqueEdge(start, end, edges) {\n\t\tconst hash1 = `${start.x},${start.y},${start.z}-${end.x},${end.y},${end.z}`;\n\t\tconst hash2 = `${end.x},${end.y},${end.z}-${start.x},${start.y},${start.z}`; // coincident edge\n\n\t\tif (edges.has(hash1) === true || edges.has(hash2) === true) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\tedges.add(hash1, hash2);\n\t\t\treturn true;\n\t\t}\n\t}\n\n\tvar Geometries = /*#__PURE__*/Object.freeze({\n\t\t__proto__: null,\n\t\tBoxGeometry: BoxGeometry,\n\t\tBoxBufferGeometry: BoxGeometry,\n\t\tCircleGeometry: CircleGeometry,\n\t\tCircleBufferGeometry: CircleGeometry,\n\t\tConeGeometry: ConeGeometry,\n\t\tConeBufferGeometry: ConeGeometry,\n\t\tCylinderGeometry: CylinderGeometry,\n\t\tCylinderBufferGeometry: CylinderGeometry,\n\t\tDodecahedronGeometry: DodecahedronGeometry,\n\t\tDodecahedronBufferGeometry: DodecahedronGeometry,\n\t\tEdgesGeometry: EdgesGeometry,\n\t\tExtrudeGeometry: ExtrudeGeometry,\n\t\tExtrudeBufferGeometry: ExtrudeGeometry,\n\t\tIcosahedronGeometry: IcosahedronGeometry,\n\t\tIcosahedronBufferGeometry: IcosahedronGeometry,\n\t\tLatheGeometry: LatheGeometry,\n\t\tLatheBufferGeometry: LatheGeometry,\n\t\tOctahedronGeometry: OctahedronGeometry,\n\t\tOctahedronBufferGeometry: OctahedronGeometry,\n\t\tPlaneGeometry: PlaneGeometry,\n\t\tPlaneBufferGeometry: PlaneGeometry,\n\t\tPolyhedronGeometry: PolyhedronGeometry,\n\t\tPolyhedronBufferGeometry: PolyhedronGeometry,\n\t\tRingGeometry: RingGeometry,\n\t\tRingBufferGeometry: RingGeometry,\n\t\tShapeGeometry: ShapeGeometry,\n\t\tShapeBufferGeometry: ShapeGeometry,\n\t\tSphereGeometry: SphereGeometry,\n\t\tSphereBufferGeometry: SphereGeometry,\n\t\tTetrahedronGeometry: TetrahedronGeometry,\n\t\tTetrahedronBufferGeometry: TetrahedronGeometry,\n\t\tTorusGeometry: TorusGeometry,\n\t\tTorusBufferGeometry: TorusGeometry,\n\t\tTorusKnotGeometry: TorusKnotGeometry,\n\t\tTorusKnotBufferGeometry: TorusKnotGeometry,\n\t\tTubeGeometry: TubeGeometry,\n\t\tTubeBufferGeometry: TubeGeometry,\n\t\tWireframeGeometry: WireframeGeometry\n\t});\n\n\t/**\n\t * parameters = {\n\t *\tcolor: <THREE.Color>\n\t * }\n\t */\n\n\tclass ShadowMaterial extends Material {\n\t\tconstructor(parameters) {\n\t\t\tsuper();\n\t\t\tthis.type = 'ShadowMaterial';\n\t\t\tthis.color = new Color(0x000000);\n\t\t\tthis.transparent = true;\n\t\t\tthis.setValues(parameters);\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.color.copy(source.color);\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tShadowMaterial.prototype.isShadowMaterial = true;\n\n\t/**\n\t * parameters = {\n\t *\tcolor: <hex>,\n\t *\troughness: <float>,\n\t *\tmetalness: <float>,\n\t *\topacity: <float>,\n\t *\n\t *\tmap: new THREE.Texture( <Image> ),\n\t *\n\t *\tlightMap: new THREE.Texture( <Image> ),\n\t *\tlightMapIntensity: <float>\n\t *\n\t *\taoMap: new THREE.Texture( <Image> ),\n\t *\taoMapIntensity: <float>\n\t *\n\t *\temissive: <hex>,\n\t *\temissiveIntensity: <float>\n\t *\temissiveMap: new THREE.Texture( <Image> ),\n\t *\n\t *\tbumpMap: new THREE.Texture( <Image> ),\n\t *\tbumpScale: <float>,\n\t *\n\t *\tnormalMap: new THREE.Texture( <Image> ),\n\t *\tnormalMapType: THREE.TangentSpaceNormalMap,\n\t *\tnormalScale: <Vector2>,\n\t *\n\t *\tdisplacementMap: new THREE.Texture( <Image> ),\n\t *\tdisplacementScale: <float>,\n\t *\tdisplacementBias: <float>,\n\t *\n\t *\troughnessMap: new THREE.Texture( <Image> ),\n\t *\n\t *\tmetalnessMap: new THREE.Texture( <Image> ),\n\t *\n\t *\talphaMap: new THREE.Texture( <Image> ),\n\t *\n\t *\tenvMap: new THREE.CubeTexture( [posx, negx, posy, negy, posz, negz] ),\n\t *\tenvMapIntensity: <float>\n\t *\n\t *\trefractionRatio: <float>,\n\t *\n\t *\twireframe: <boolean>,\n\t *\twireframeLinewidth: <float>,\n\t *\n\t *\tflatShading: <bool>\n\t * }\n\t */\n\n\tclass MeshStandardMaterial extends Material {\n\t\tconstructor(parameters) {\n\t\t\tsuper();\n\t\t\tthis.defines = {\n\t\t\t\t'STANDARD': ''\n\t\t\t};\n\t\t\tthis.type = 'MeshStandardMaterial';\n\t\t\tthis.color = new Color(0xffffff); // diffuse\n\n\t\t\tthis.roughness = 1.0;\n\t\t\tthis.metalness = 0.0;\n\t\t\tthis.map = null;\n\t\t\tthis.lightMap = null;\n\t\t\tthis.lightMapIntensity = 1.0;\n\t\t\tthis.aoMap = null;\n\t\t\tthis.aoMapIntensity = 1.0;\n\t\t\tthis.emissive = new Color(0x000000);\n\t\t\tthis.emissiveIntensity = 1.0;\n\t\t\tthis.emissiveMap = null;\n\t\t\tthis.bumpMap = null;\n\t\t\tthis.bumpScale = 1;\n\t\t\tthis.normalMap = null;\n\t\t\tthis.normalMapType = TangentSpaceNormalMap;\n\t\t\tthis.normalScale = new Vector2(1, 1);\n\t\t\tthis.displacementMap = null;\n\t\t\tthis.displacementScale = 1;\n\t\t\tthis.displacementBias = 0;\n\t\t\tthis.roughnessMap = null;\n\t\t\tthis.metalnessMap = null;\n\t\t\tthis.alphaMap = null;\n\t\t\tthis.envMap = null;\n\t\t\tthis.envMapIntensity = 1.0;\n\t\t\tthis.refractionRatio = 0.98;\n\t\t\tthis.wireframe = false;\n\t\t\tthis.wireframeLinewidth = 1;\n\t\t\tthis.wireframeLinecap = 'round';\n\t\t\tthis.wireframeLinejoin = 'round';\n\t\t\tthis.flatShading = false;\n\t\t\tthis.setValues(parameters);\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.defines = {\n\t\t\t\t'STANDARD': ''\n\t\t\t};\n\t\t\tthis.color.copy(source.color);\n\t\t\tthis.roughness = source.roughness;\n\t\t\tthis.metalness = source.metalness;\n\t\t\tthis.map = source.map;\n\t\t\tthis.lightMap = source.lightMap;\n\t\t\tthis.lightMapIntensity = source.lightMapIntensity;\n\t\t\tthis.aoMap = source.aoMap;\n\t\t\tthis.aoMapIntensity = source.aoMapIntensity;\n\t\t\tthis.emissive.copy(source.emissive);\n\t\t\tthis.emissiveMap = source.emissiveMap;\n\t\t\tthis.emissiveIntensity = source.emissiveIntensity;\n\t\t\tthis.bumpMap = source.bumpMap;\n\t\t\tthis.bumpScale = source.bumpScale;\n\t\t\tthis.normalMap = source.normalMap;\n\t\t\tthis.normalMapType = source.normalMapType;\n\t\t\tthis.normalScale.copy(source.normalScale);\n\t\t\tthis.displacementMap = source.displacementMap;\n\t\t\tthis.displacementScale = source.displacementScale;\n\t\t\tthis.displacementBias = source.displacementBias;\n\t\t\tthis.roughnessMap = source.roughnessMap;\n\t\t\tthis.metalnessMap = source.metalnessMap;\n\t\t\tthis.alphaMap = source.alphaMap;\n\t\t\tthis.envMap = source.envMap;\n\t\t\tthis.envMapIntensity = source.envMapIntensity;\n\t\t\tthis.refractionRatio = source.refractionRatio;\n\t\t\tthis.wireframe = source.wireframe;\n\t\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\t\t\tthis.wireframeLinecap = source.wireframeLinecap;\n\t\t\tthis.wireframeLinejoin = source.wireframeLinejoin;\n\t\t\tthis.flatShading = source.flatShading;\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tMeshStandardMaterial.prototype.isMeshStandardMaterial = true;\n\n\t/**\n\t * parameters = {\n\t *\tclearcoat: <float>,\n\t *\tclearcoatMap: new THREE.Texture( <Image> ),\n\t *\tclearcoatRoughness: <float>,\n\t *\tclearcoatRoughnessMap: new THREE.Texture( <Image> ),\n\t *\tclearcoatNormalScale: <Vector2>,\n\t *\tclearcoatNormalMap: new THREE.Texture( <Image> ),\n\t *\n\t *\tior: <float>,\n\t *\treflectivity: <float>,\n\t *\n\t *\tsheen: <float>,\n\t *\tsheenTint: <Color>,\n\t *\tsheenRoughness: <float>,\n\t *\n\t *\ttransmission: <float>,\n\t *\ttransmissionMap: new THREE.Texture( <Image> ),\n\t *\n\t *\tthickness: <float>,\n\t *\tthicknessMap: new THREE.Texture( <Image> ),\n\t *\tattenuationDistance: <float>,\n\t *\tattenuationTint: <Color>,\n\t *\n\t *\tspecularIntensity: <float>,\n\t *\tspecularIntensityhMap: new THREE.Texture( <Image> ),\n\t *\tspecularTint: <Color>,\n\t *\tspecularTintMap: new THREE.Texture( <Image> )\n\t * }\n\t */\n\n\tclass MeshPhysicalMaterial extends MeshStandardMaterial {\n\t\tconstructor(parameters) {\n\t\t\tsuper();\n\t\t\tthis.defines = {\n\t\t\t\t'STANDARD': '',\n\t\t\t\t'PHYSICAL': ''\n\t\t\t};\n\t\t\tthis.type = 'MeshPhysicalMaterial';\n\t\t\tthis.clearcoatMap = null;\n\t\t\tthis.clearcoatRoughness = 0.0;\n\t\t\tthis.clearcoatRoughnessMap = null;\n\t\t\tthis.clearcoatNormalScale = new Vector2(1, 1);\n\t\t\tthis.clearcoatNormalMap = null;\n\t\t\tthis.ior = 1.5;\n\t\t\tObject.defineProperty(this, 'reflectivity', {\n\t\t\t\tget: function () {\n\t\t\t\t\treturn clamp(2.5 * (this.ior - 1) / (this.ior + 1), 0, 1);\n\t\t\t\t},\n\t\t\t\tset: function (reflectivity) {\n\t\t\t\t\tthis.ior = (1 + 0.4 * reflectivity) / (1 - 0.4 * reflectivity);\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis.sheenTint = new Color(0x000000);\n\t\t\tthis.sheenRoughness = 1.0;\n\t\t\tthis.transmissionMap = null;\n\t\t\tthis.thickness = 0.01;\n\t\t\tthis.thicknessMap = null;\n\t\t\tthis.attenuationDistance = 0.0;\n\t\t\tthis.attenuationTint = new Color(1, 1, 1);\n\t\t\tthis.specularIntensity = 1.0;\n\t\t\tthis.specularIntensityMap = null;\n\t\t\tthis.specularTint = new Color(1, 1, 1);\n\t\t\tthis.specularTintMap = null;\n\t\t\tthis._sheen = 0.0;\n\t\t\tthis._clearcoat = 0;\n\t\t\tthis._transmission = 0;\n\t\t\tthis.setValues(parameters);\n\t\t}\n\n\t\tget sheen() {\n\t\t\treturn this._sheen;\n\t\t}\n\n\t\tset sheen(value) {\n\t\t\tif (this._sheen > 0 !== value > 0) {\n\t\t\t\tthis.version++;\n\t\t\t}\n\n\t\t\tthis._sheen = value;\n\t\t}\n\n\t\tget clearcoat() {\n\t\t\treturn this._clearcoat;\n\t\t}\n\n\t\tset clearcoat(value) {\n\t\t\tif (this._clearcoat > 0 !== value > 0) {\n\t\t\t\tthis.version++;\n\t\t\t}\n\n\t\t\tthis._clearcoat = value;\n\t\t}\n\n\t\tget transmission() {\n\t\t\treturn this._transmission;\n\t\t}\n\n\t\tset transmission(value) {\n\t\t\tif (this._transmission > 0 !== value > 0) {\n\t\t\t\tthis.version++;\n\t\t\t}\n\n\t\t\tthis._transmission = value;\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.defines = {\n\t\t\t\t'STANDARD': '',\n\t\t\t\t'PHYSICAL': ''\n\t\t\t};\n\t\t\tthis.clearcoat = source.clearcoat;\n\t\t\tthis.clearcoatMap = source.clearcoatMap;\n\t\t\tthis.clearcoatRoughness = source.clearcoatRoughness;\n\t\t\tthis.clearcoatRoughnessMap = source.clearcoatRoughnessMap;\n\t\t\tthis.clearcoatNormalMap = source.clearcoatNormalMap;\n\t\t\tthis.clearcoatNormalScale.copy(source.clearcoatNormalScale);\n\t\t\tthis.ior = source.ior;\n\t\t\tthis.sheen = source.sheen;\n\t\t\tthis.sheenTint.copy(source.sheenTint);\n\t\t\tthis.sheenRoughness = source.sheenRoughness;\n\t\t\tthis.transmission = source.transmission;\n\t\t\tthis.transmissionMap = source.transmissionMap;\n\t\t\tthis.thickness = source.thickness;\n\t\t\tthis.thicknessMap = source.thicknessMap;\n\t\t\tthis.attenuationDistance = source.attenuationDistance;\n\t\t\tthis.attenuationTint.copy(source.attenuationTint);\n\t\t\tthis.specularIntensity = source.specularIntensity;\n\t\t\tthis.specularIntensityMap = source.specularIntensityMap;\n\t\t\tthis.specularTint.copy(source.specularTint);\n\t\t\tthis.specularTintMap = source.specularTintMap;\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tMeshPhysicalMaterial.prototype.isMeshPhysicalMaterial = true;\n\n\t/**\n\t * parameters = {\n\t *\tcolor: <hex>,\n\t *\tspecular: <hex>,\n\t *\tshininess: <float>,\n\t *\topacity: <float>,\n\t *\n\t *\tmap: new THREE.Texture( <Image> ),\n\t *\n\t *\tlightMap: new THREE.Texture( <Image> ),\n\t *\tlightMapIntensity: <float>\n\t *\n\t *\taoMap: new THREE.Texture( <Image> ),\n\t *\taoMapIntensity: <float>\n\t *\n\t *\temissive: <hex>,\n\t *\temissiveIntensity: <float>\n\t *\temissiveMap: new THREE.Texture( <Image> ),\n\t *\n\t *\tbumpMap: new THREE.Texture( <Image> ),\n\t *\tbumpScale: <float>,\n\t *\n\t *\tnormalMap: new THREE.Texture( <Image> ),\n\t *\tnormalMapType: THREE.TangentSpaceNormalMap,\n\t *\tnormalScale: <Vector2>,\n\t *\n\t *\tdisplacementMap: new THREE.Texture( <Image> ),\n\t *\tdisplacementScale: <float>,\n\t *\tdisplacementBias: <float>,\n\t *\n\t *\tspecularMap: new THREE.Texture( <Image> ),\n\t *\n\t *\talphaMap: new THREE.Texture( <Image> ),\n\t *\n\t *\tenvMap: new THREE.CubeTexture( [posx, negx, posy, negy, posz, negz] ),\n\t *\tcombine: THREE.MultiplyOperation,\n\t *\treflectivity: <float>,\n\t *\trefractionRatio: <float>,\n\t *\n\t *\twireframe: <boolean>,\n\t *\twireframeLinewidth: <float>,\n\t *\n\t *\tflatShading: <bool>\n\t * }\n\t */\n\n\tclass MeshPhongMaterial extends Material {\n\t\tconstructor(parameters) {\n\t\t\tsuper();\n\t\t\tthis.type = 'MeshPhongMaterial';\n\t\t\tthis.color = new Color(0xffffff); // diffuse\n\n\t\t\tthis.specular = new Color(0x111111);\n\t\t\tthis.shininess = 30;\n\t\t\tthis.map = null;\n\t\t\tthis.lightMap = null;\n\t\t\tthis.lightMapIntensity = 1.0;\n\t\t\tthis.aoMap = null;\n\t\t\tthis.aoMapIntensity = 1.0;\n\t\t\tthis.emissive = new Color(0x000000);\n\t\t\tthis.emissiveIntensity = 1.0;\n\t\t\tthis.emissiveMap = null;\n\t\t\tthis.bumpMap = null;\n\t\t\tthis.bumpScale = 1;\n\t\t\tthis.normalMap = null;\n\t\t\tthis.normalMapType = TangentSpaceNormalMap;\n\t\t\tthis.normalScale = new Vector2(1, 1);\n\t\t\tthis.displacementMap = null;\n\t\t\tthis.displacementScale = 1;\n\t\t\tthis.displacementBias = 0;\n\t\t\tthis.specularMap = null;\n\t\t\tthis.alphaMap = null;\n\t\t\tthis.envMap = null;\n\t\t\tthis.combine = MultiplyOperation;\n\t\t\tthis.reflectivity = 1;\n\t\t\tthis.refractionRatio = 0.98;\n\t\t\tthis.wireframe = false;\n\t\t\tthis.wireframeLinewidth = 1;\n\t\t\tthis.wireframeLinecap = 'round';\n\t\t\tthis.wireframeLinejoin = 'round';\n\t\t\tthis.flatShading = false;\n\t\t\tthis.setValues(parameters);\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.color.copy(source.color);\n\t\t\tthis.specular.copy(source.specular);\n\t\t\tthis.shininess = source.shininess;\n\t\t\tthis.map = source.map;\n\t\t\tthis.lightMap = source.lightMap;\n\t\t\tthis.lightMapIntensity = source.lightMapIntensity;\n\t\t\tthis.aoMap = source.aoMap;\n\t\t\tthis.aoMapIntensity = source.aoMapIntensity;\n\t\t\tthis.emissive.copy(source.emissive);\n\t\t\tthis.emissiveMap = source.emissiveMap;\n\t\t\tthis.emissiveIntensity = source.emissiveIntensity;\n\t\t\tthis.bumpMap = source.bumpMap;\n\t\t\tthis.bumpScale = source.bumpScale;\n\t\t\tthis.normalMap = source.normalMap;\n\t\t\tthis.normalMapType = source.normalMapType;\n\t\t\tthis.normalScale.copy(source.normalScale);\n\t\t\tthis.displacementMap = source.displacementMap;\n\t\t\tthis.displacementScale = source.displacementScale;\n\t\t\tthis.displacementBias = source.displacementBias;\n\t\t\tthis.specularMap = source.specularMap;\n\t\t\tthis.alphaMap = source.alphaMap;\n\t\t\tthis.envMap = source.envMap;\n\t\t\tthis.combine = source.combine;\n\t\t\tthis.reflectivity = source.reflectivity;\n\t\t\tthis.refractionRatio = source.refractionRatio;\n\t\t\tthis.wireframe = source.wireframe;\n\t\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\t\t\tthis.wireframeLinecap = source.wireframeLinecap;\n\t\t\tthis.wireframeLinejoin = source.wireframeLinejoin;\n\t\t\tthis.flatShading = source.flatShading;\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tMeshPhongMaterial.prototype.isMeshPhongMaterial = true;\n\n\t/**\n\t * parameters = {\n\t *\tcolor: <hex>,\n\t *\n\t *\tmap: new THREE.Texture( <Image> ),\n\t *\tgradientMap: new THREE.Texture( <Image> ),\n\t *\n\t *\tlightMap: new THREE.Texture( <Image> ),\n\t *\tlightMapIntensity: <float>\n\t *\n\t *\taoMap: new THREE.Texture( <Image> ),\n\t *\taoMapIntensity: <float>\n\t *\n\t *\temissive: <hex>,\n\t *\temissiveIntensity: <float>\n\t *\temissiveMap: new THREE.Texture( <Image> ),\n\t *\n\t *\tbumpMap: new THREE.Texture( <Image> ),\n\t *\tbumpScale: <float>,\n\t *\n\t *\tnormalMap: new THREE.Texture( <Image> ),\n\t *\tnormalMapType: THREE.TangentSpaceNormalMap,\n\t *\tnormalScale: <Vector2>,\n\t *\n\t *\tdisplacementMap: new THREE.Texture( <Image> ),\n\t *\tdisplacementScale: <float>,\n\t *\tdisplacementBias: <float>,\n\t *\n\t *\talphaMap: new THREE.Texture( <Image> ),\n\t *\n\t *\twireframe: <boolean>,\n\t *\twireframeLinewidth: <float>,\n\t *\n\t * }\n\t */\n\n\tclass MeshToonMaterial extends Material {\n\t\tconstructor(parameters) {\n\t\t\tsuper();\n\t\t\tthis.defines = {\n\t\t\t\t'TOON': ''\n\t\t\t};\n\t\t\tthis.type = 'MeshToonMaterial';\n\t\t\tthis.color = new Color(0xffffff);\n\t\t\tthis.map = null;\n\t\t\tthis.gradientMap = null;\n\t\t\tthis.lightMap = null;\n\t\t\tthis.lightMapIntensity = 1.0;\n\t\t\tthis.aoMap = null;\n\t\t\tthis.aoMapIntensity = 1.0;\n\t\t\tthis.emissive = new Color(0x000000);\n\t\t\tthis.emissiveIntensity = 1.0;\n\t\t\tthis.emissiveMap = null;\n\t\t\tthis.bumpMap = null;\n\t\t\tthis.bumpScale = 1;\n\t\t\tthis.normalMap = null;\n\t\t\tthis.normalMapType = TangentSpaceNormalMap;\n\t\t\tthis.normalScale = new Vector2(1, 1);\n\t\t\tthis.displacementMap = null;\n\t\t\tthis.displacementScale = 1;\n\t\t\tthis.displacementBias = 0;\n\t\t\tthis.alphaMap = null;\n\t\t\tthis.wireframe = false;\n\t\t\tthis.wireframeLinewidth = 1;\n\t\t\tthis.wireframeLinecap = 'round';\n\t\t\tthis.wireframeLinejoin = 'round';\n\t\t\tthis.setValues(parameters);\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.color.copy(source.color);\n\t\t\tthis.map = source.map;\n\t\t\tthis.gradientMap = source.gradientMap;\n\t\t\tthis.lightMap = source.lightMap;\n\t\t\tthis.lightMapIntensity = source.lightMapIntensity;\n\t\t\tthis.aoMap = source.aoMap;\n\t\t\tthis.aoMapIntensity = source.aoMapIntensity;\n\t\t\tthis.emissive.copy(source.emissive);\n\t\t\tthis.emissiveMap = source.emissiveMap;\n\t\t\tthis.emissiveIntensity = source.emissiveIntensity;\n\t\t\tthis.bumpMap = source.bumpMap;\n\t\t\tthis.bumpScale = source.bumpScale;\n\t\t\tthis.normalMap = source.normalMap;\n\t\t\tthis.normalMapType = source.normalMapType;\n\t\t\tthis.normalScale.copy(source.normalScale);\n\t\t\tthis.displacementMap = source.displacementMap;\n\t\t\tthis.displacementScale = source.displacementScale;\n\t\t\tthis.displacementBias = source.displacementBias;\n\t\t\tthis.alphaMap = source.alphaMap;\n\t\t\tthis.wireframe = source.wireframe;\n\t\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\t\t\tthis.wireframeLinecap = source.wireframeLinecap;\n\t\t\tthis.wireframeLinejoin = source.wireframeLinejoin;\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tMeshToonMaterial.prototype.isMeshToonMaterial = true;\n\n\t/**\n\t * parameters = {\n\t *\topacity: <float>,\n\t *\n\t *\tbumpMap: new THREE.Texture( <Image> ),\n\t *\tbumpScale: <float>,\n\t *\n\t *\tnormalMap: new THREE.Texture( <Image> ),\n\t *\tnormalMapType: THREE.TangentSpaceNormalMap,\n\t *\tnormalScale: <Vector2>,\n\t *\n\t *\tdisplacementMap: new THREE.Texture( <Image> ),\n\t *\tdisplacementScale: <float>,\n\t *\tdisplacementBias: <float>,\n\t *\n\t *\twireframe: <boolean>,\n\t *\twireframeLinewidth: <float>\n\t *\n\t *\tflatShading: <bool>\n\t * }\n\t */\n\n\tclass MeshNormalMaterial extends Material {\n\t\tconstructor(parameters) {\n\t\t\tsuper();\n\t\t\tthis.type = 'MeshNormalMaterial';\n\t\t\tthis.bumpMap = null;\n\t\t\tthis.bumpScale = 1;\n\t\t\tthis.normalMap = null;\n\t\t\tthis.normalMapType = TangentSpaceNormalMap;\n\t\t\tthis.normalScale = new Vector2(1, 1);\n\t\t\tthis.displacementMap = null;\n\t\t\tthis.displacementScale = 1;\n\t\t\tthis.displacementBias = 0;\n\t\t\tthis.wireframe = false;\n\t\t\tthis.wireframeLinewidth = 1;\n\t\t\tthis.fog = false;\n\t\t\tthis.flatShading = false;\n\t\t\tthis.setValues(parameters);\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.bumpMap = source.bumpMap;\n\t\t\tthis.bumpScale = source.bumpScale;\n\t\t\tthis.normalMap = source.normalMap;\n\t\t\tthis.normalMapType = source.normalMapType;\n\t\t\tthis.normalScale.copy(source.normalScale);\n\t\t\tthis.displacementMap = source.displacementMap;\n\t\t\tthis.displacementScale = source.displacementScale;\n\t\t\tthis.displacementBias = source.displacementBias;\n\t\t\tthis.wireframe = source.wireframe;\n\t\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\t\t\tthis.flatShading = source.flatShading;\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tMeshNormalMaterial.prototype.isMeshNormalMaterial = true;\n\n\t/**\n\t * parameters = {\n\t *\tcolor: <hex>,\n\t *\topacity: <float>,\n\t *\n\t *\tmap: new THREE.Texture( <Image> ),\n\t *\n\t *\tlightMap: new THREE.Texture( <Image> ),\n\t *\tlightMapIntensity: <float>\n\t *\n\t *\taoMap: new THREE.Texture( <Image> ),\n\t *\taoMapIntensity: <float>\n\t *\n\t *\temissive: <hex>,\n\t *\temissiveIntensity: <float>\n\t *\temissiveMap: new THREE.Texture( <Image> ),\n\t *\n\t *\tspecularMap: new THREE.Texture( <Image> ),\n\t *\n\t *\talphaMap: new THREE.Texture( <Image> ),\n\t *\n\t *\tenvMap: new THREE.CubeTexture( [posx, negx, posy, negy, posz, negz] ),\n\t *\tcombine: THREE.Multiply,\n\t *\treflectivity: <float>,\n\t *\trefractionRatio: <float>,\n\t *\n\t *\twireframe: <boolean>,\n\t *\twireframeLinewidth: <float>,\n\t *\n\t * }\n\t */\n\n\tclass MeshLambertMaterial extends Material {\n\t\tconstructor(parameters) {\n\t\t\tsuper();\n\t\t\tthis.type = 'MeshLambertMaterial';\n\t\t\tthis.color = new Color(0xffffff); // diffuse\n\n\t\t\tthis.map = null;\n\t\t\tthis.lightMap = null;\n\t\t\tthis.lightMapIntensity = 1.0;\n\t\t\tthis.aoMap = null;\n\t\t\tthis.aoMapIntensity = 1.0;\n\t\t\tthis.emissive = new Color(0x000000);\n\t\t\tthis.emissiveIntensity = 1.0;\n\t\t\tthis.emissiveMap = null;\n\t\t\tthis.specularMap = null;\n\t\t\tthis.alphaMap = null;\n\t\t\tthis.envMap = null;\n\t\t\tthis.combine = MultiplyOperation;\n\t\t\tthis.reflectivity = 1;\n\t\t\tthis.refractionRatio = 0.98;\n\t\t\tthis.wireframe = false;\n\t\t\tthis.wireframeLinewidth = 1;\n\t\t\tthis.wireframeLinecap = 'round';\n\t\t\tthis.wireframeLinejoin = 'round';\n\t\t\tthis.setValues(parameters);\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.color.copy(source.color);\n\t\t\tthis.map = source.map;\n\t\t\tthis.lightMap = source.lightMap;\n\t\t\tthis.lightMapIntensity = source.lightMapIntensity;\n\t\t\tthis.aoMap = source.aoMap;\n\t\t\tthis.aoMapIntensity = source.aoMapIntensity;\n\t\t\tthis.emissive.copy(source.emissive);\n\t\t\tthis.emissiveMap = source.emissiveMap;\n\t\t\tthis.emissiveIntensity = source.emissiveIntensity;\n\t\t\tthis.specularMap = source.specularMap;\n\t\t\tthis.alphaMap = source.alphaMap;\n\t\t\tthis.envMap = source.envMap;\n\t\t\tthis.combine = source.combine;\n\t\t\tthis.reflectivity = source.reflectivity;\n\t\t\tthis.refractionRatio = source.refractionRatio;\n\t\t\tthis.wireframe = source.wireframe;\n\t\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\t\t\tthis.wireframeLinecap = source.wireframeLinecap;\n\t\t\tthis.wireframeLinejoin = source.wireframeLinejoin;\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tMeshLambertMaterial.prototype.isMeshLambertMaterial = true;\n\n\t/**\n\t * parameters = {\n\t *\tcolor: <hex>,\n\t *\topacity: <float>,\n\t *\n\t *\tmatcap: new THREE.Texture( <Image> ),\n\t *\n\t *\tmap: new THREE.Texture( <Image> ),\n\t *\n\t *\tbumpMap: new THREE.Texture( <Image> ),\n\t *\tbumpScale: <float>,\n\t *\n\t *\tnormalMap: new THREE.Texture( <Image> ),\n\t *\tnormalMapType: THREE.TangentSpaceNormalMap,\n\t *\tnormalScale: <Vector2>,\n\t *\n\t *\tdisplacementMap: new THREE.Texture( <Image> ),\n\t *\tdisplacementScale: <float>,\n\t *\tdisplacementBias: <float>,\n\t *\n\t *\talphaMap: new THREE.Texture( <Image> ),\n\t *\n\t *\tflatShading: <bool>\n\t * }\n\t */\n\n\tclass MeshMatcapMaterial extends Material {\n\t\tconstructor(parameters) {\n\t\t\tsuper();\n\t\t\tthis.defines = {\n\t\t\t\t'MATCAP': ''\n\t\t\t};\n\t\t\tthis.type = 'MeshMatcapMaterial';\n\t\t\tthis.color = new Color(0xffffff); // diffuse\n\n\t\t\tthis.matcap = null;\n\t\t\tthis.map = null;\n\t\t\tthis.bumpMap = null;\n\t\t\tthis.bumpScale = 1;\n\t\t\tthis.normalMap = null;\n\t\t\tthis.normalMapType = TangentSpaceNormalMap;\n\t\t\tthis.normalScale = new Vector2(1, 1);\n\t\t\tthis.displacementMap = null;\n\t\t\tthis.displacementScale = 1;\n\t\t\tthis.displacementBias = 0;\n\t\t\tthis.alphaMap = null;\n\t\t\tthis.flatShading = false;\n\t\t\tthis.setValues(parameters);\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.defines = {\n\t\t\t\t'MATCAP': ''\n\t\t\t};\n\t\t\tthis.color.copy(source.color);\n\t\t\tthis.matcap = source.matcap;\n\t\t\tthis.map = source.map;\n\t\t\tthis.bumpMap = source.bumpMap;\n\t\t\tthis.bumpScale = source.bumpScale;\n\t\t\tthis.normalMap = source.normalMap;\n\t\t\tthis.normalMapType = source.normalMapType;\n\t\t\tthis.normalScale.copy(source.normalScale);\n\t\t\tthis.displacementMap = source.displacementMap;\n\t\t\tthis.displacementScale = source.displacementScale;\n\t\t\tthis.displacementBias = source.displacementBias;\n\t\t\tthis.alphaMap = source.alphaMap;\n\t\t\tthis.flatShading = source.flatShading;\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tMeshMatcapMaterial.prototype.isMeshMatcapMaterial = true;\n\n\t/**\n\t * parameters = {\n\t *\tcolor: <hex>,\n\t *\topacity: <float>,\n\t *\n\t *\tlinewidth: <float>,\n\t *\n\t *\tscale: <float>,\n\t *\tdashSize: <float>,\n\t *\tgapSize: <float>\n\t * }\n\t */\n\n\tclass LineDashedMaterial extends LineBasicMaterial {\n\t\tconstructor(parameters) {\n\t\t\tsuper();\n\t\t\tthis.type = 'LineDashedMaterial';\n\t\t\tthis.scale = 1;\n\t\t\tthis.dashSize = 3;\n\t\t\tthis.gapSize = 1;\n\t\t\tthis.setValues(parameters);\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.scale = source.scale;\n\t\t\tthis.dashSize = source.dashSize;\n\t\t\tthis.gapSize = source.gapSize;\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tLineDashedMaterial.prototype.isLineDashedMaterial = true;\n\n\tvar Materials = /*#__PURE__*/Object.freeze({\n\t\t__proto__: null,\n\t\tShadowMaterial: ShadowMaterial,\n\t\tSpriteMaterial: SpriteMaterial,\n\t\tRawShaderMaterial: RawShaderMaterial,\n\t\tShaderMaterial: ShaderMaterial,\n\t\tPointsMaterial: PointsMaterial,\n\t\tMeshPhysicalMaterial: MeshPhysicalMaterial,\n\t\tMeshStandardMaterial: MeshStandardMaterial,\n\t\tMeshPhongMaterial: MeshPhongMaterial,\n\t\tMeshToonMaterial: MeshToonMaterial,\n\t\tMeshNormalMaterial: MeshNormalMaterial,\n\t\tMeshLambertMaterial: MeshLambertMaterial,\n\t\tMeshDepthMaterial: MeshDepthMaterial,\n\t\tMeshDistanceMaterial: MeshDistanceMaterial,\n\t\tMeshBasicMaterial: MeshBasicMaterial,\n\t\tMeshMatcapMaterial: MeshMatcapMaterial,\n\t\tLineDashedMaterial: LineDashedMaterial,\n\t\tLineBasicMaterial: LineBasicMaterial,\n\t\tMaterial: Material\n\t});\n\n\tconst AnimationUtils = {\n\t\t// same as Array.prototype.slice, but also works on typed arrays\n\t\tarraySlice: function (array, from, to) {\n\t\t\tif (AnimationUtils.isTypedArray(array)) {\n\t\t\t\t// in ios9 array.subarray(from, undefined) will return empty array\n\t\t\t\t// but array.subarray(from) or array.subarray(from, len) is correct\n\t\t\t\treturn new array.constructor(array.subarray(from, to !== undefined ? to : array.length));\n\t\t\t}\n\n\t\t\treturn array.slice(from, to);\n\t\t},\n\t\t// converts an array to a specific type\n\t\tconvertArray: function (array, type, forceClone) {\n\t\t\tif (!array || // let 'undefined' and 'null' pass\n\t\t\t!forceClone && array.constructor === type) return array;\n\n\t\t\tif (typeof type.BYTES_PER_ELEMENT === 'number') {\n\t\t\t\treturn new type(array); // create typed array\n\t\t\t}\n\n\t\t\treturn Array.prototype.slice.call(array); // create Array\n\t\t},\n\t\tisTypedArray: function (object) {\n\t\t\treturn ArrayBuffer.isView(object) && !(object instanceof DataView);\n\t\t},\n\t\t// returns an array by which times and values can be sorted\n\t\tgetKeyframeOrder: function (times) {\n\t\t\tfunction compareTime(i, j) {\n\t\t\t\treturn times[i] - times[j];\n\t\t\t}\n\n\t\t\tconst n = times.length;\n\t\t\tconst result = new Array(n);\n\n\t\t\tfor (let i = 0; i !== n; ++i) result[i] = i;\n\n\t\t\tresult.sort(compareTime);\n\t\t\treturn result;\n\t\t},\n\t\t// uses the array previously returned by 'getKeyframeOrder' to sort data\n\t\tsortedArray: function (values, stride, order) {\n\t\t\tconst nValues = values.length;\n\t\t\tconst result = new values.constructor(nValues);\n\n\t\t\tfor (let i = 0, dstOffset = 0; dstOffset !== nValues; ++i) {\n\t\t\t\tconst srcOffset = order[i] * stride;\n\n\t\t\t\tfor (let j = 0; j !== stride; ++j) {\n\t\t\t\t\tresult[dstOffset++] = values[srcOffset + j];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn result;\n\t\t},\n\t\t// function for parsing AOS keyframe formats\n\t\tflattenJSON: function (jsonKeys, times, values, valuePropertyName) {\n\t\t\tlet i = 1,\n\t\t\t\t\tkey = jsonKeys[0];\n\n\t\t\twhile (key !== undefined && key[valuePropertyName] === undefined) {\n\t\t\t\tkey = jsonKeys[i++];\n\t\t\t}\n\n\t\t\tif (key === undefined) return; // no data\n\n\t\t\tlet value = key[valuePropertyName];\n\t\t\tif (value === undefined) return; // no data\n\n\t\t\tif (Array.isArray(value)) {\n\t\t\t\tdo {\n\t\t\t\t\tvalue = key[valuePropertyName];\n\n\t\t\t\t\tif (value !== undefined) {\n\t\t\t\t\t\ttimes.push(key.time);\n\t\t\t\t\t\tvalues.push.apply(values, value); // push all elements\n\t\t\t\t\t}\n\n\t\t\t\t\tkey = jsonKeys[i++];\n\t\t\t\t} while (key !== undefined);\n\t\t\t} else if (value.toArray !== undefined) {\n\t\t\t\t// ...assume THREE.Math-ish\n\t\t\t\tdo {\n\t\t\t\t\tvalue = key[valuePropertyName];\n\n\t\t\t\t\tif (value !== undefined) {\n\t\t\t\t\t\ttimes.push(key.time);\n\t\t\t\t\t\tvalue.toArray(values, values.length);\n\t\t\t\t\t}\n\n\t\t\t\t\tkey = jsonKeys[i++];\n\t\t\t\t} while (key !== undefined);\n\t\t\t} else {\n\t\t\t\t// otherwise push as-is\n\t\t\t\tdo {\n\t\t\t\t\tvalue = key[valuePropertyName];\n\n\t\t\t\t\tif (value !== undefined) {\n\t\t\t\t\t\ttimes.push(key.time);\n\t\t\t\t\t\tvalues.push(value);\n\t\t\t\t\t}\n\n\t\t\t\t\tkey = jsonKeys[i++];\n\t\t\t\t} while (key !== undefined);\n\t\t\t}\n\t\t},\n\t\tsubclip: function (sourceClip, name, startFrame, endFrame, fps = 30) {\n\t\t\tconst clip = sourceClip.clone();\n\t\t\tclip.name = name;\n\t\t\tconst tracks = [];\n\n\t\t\tfor (let i = 0; i < clip.tracks.length; ++i) {\n\t\t\t\tconst track = clip.tracks[i];\n\t\t\t\tconst valueSize = track.getValueSize();\n\t\t\t\tconst times = [];\n\t\t\t\tconst values = [];\n\n\t\t\t\tfor (let j = 0; j < track.times.length; ++j) {\n\t\t\t\t\tconst frame = track.times[j] * fps;\n\t\t\t\t\tif (frame < startFrame || frame >= endFrame) continue;\n\t\t\t\t\ttimes.push(track.times[j]);\n\n\t\t\t\t\tfor (let k = 0; k < valueSize; ++k) {\n\t\t\t\t\t\tvalues.push(track.values[j * valueSize + k]);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (times.length === 0) continue;\n\t\t\t\ttrack.times = AnimationUtils.convertArray(times, track.times.constructor);\n\t\t\t\ttrack.values = AnimationUtils.convertArray(values, track.values.constructor);\n\t\t\t\ttracks.push(track);\n\t\t\t}\n\n\t\t\tclip.tracks = tracks; // find minimum .times value across all tracks in the trimmed clip\n\n\t\t\tlet minStartTime = Infinity;\n\n\t\t\tfor (let i = 0; i < clip.tracks.length; ++i) {\n\t\t\t\tif (minStartTime > clip.tracks[i].times[0]) {\n\t\t\t\t\tminStartTime = clip.tracks[i].times[0];\n\t\t\t\t}\n\t\t\t} // shift all tracks such that clip begins at t=0\n\n\n\t\t\tfor (let i = 0; i < clip.tracks.length; ++i) {\n\t\t\t\tclip.tracks[i].shift(-1 * minStartTime);\n\t\t\t}\n\n\t\t\tclip.resetDuration();\n\t\t\treturn clip;\n\t\t},\n\t\tmakeClipAdditive: function (targetClip, referenceFrame = 0, referenceClip = targetClip, fps = 30) {\n\t\t\tif (fps <= 0) fps = 30;\n\t\t\tconst numTracks = referenceClip.tracks.length;\n\t\t\tconst referenceTime = referenceFrame / fps; // Make each track's values relative to the values at the reference frame\n\n\t\t\tfor (let i = 0; i < numTracks; ++i) {\n\t\t\t\tconst referenceTrack = referenceClip.tracks[i];\n\t\t\t\tconst referenceTrackType = referenceTrack.ValueTypeName; // Skip this track if it's non-numeric\n\n\t\t\t\tif (referenceTrackType === 'bool' || referenceTrackType === 'string') continue; // Find the track in the target clip whose name and type matches the reference track\n\n\t\t\t\tconst targetTrack = targetClip.tracks.find(function (track) {\n\t\t\t\t\treturn track.name === referenceTrack.name && track.ValueTypeName === referenceTrackType;\n\t\t\t\t});\n\t\t\t\tif (targetTrack === undefined) continue;\n\t\t\t\tlet referenceOffset = 0;\n\t\t\t\tconst referenceValueSize = referenceTrack.getValueSize();\n\n\t\t\t\tif (referenceTrack.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline) {\n\t\t\t\t\treferenceOffset = referenceValueSize / 3;\n\t\t\t\t}\n\n\t\t\t\tlet targetOffset = 0;\n\t\t\t\tconst targetValueSize = targetTrack.getValueSize();\n\n\t\t\t\tif (targetTrack.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline) {\n\t\t\t\t\ttargetOffset = targetValueSize / 3;\n\t\t\t\t}\n\n\t\t\t\tconst lastIndex = referenceTrack.times.length - 1;\n\t\t\t\tlet referenceValue; // Find the value to subtract out of the track\n\n\t\t\t\tif (referenceTime <= referenceTrack.times[0]) {\n\t\t\t\t\t// Reference frame is earlier than the first keyframe, so just use the first keyframe\n\t\t\t\t\tconst startIndex = referenceOffset;\n\t\t\t\t\tconst endIndex = referenceValueSize - referenceOffset;\n\t\t\t\t\treferenceValue = AnimationUtils.arraySlice(referenceTrack.values, startIndex, endIndex);\n\t\t\t\t} else if (referenceTime >= referenceTrack.times[lastIndex]) {\n\t\t\t\t\t// Reference frame is after the last keyframe, so just use the last keyframe\n\t\t\t\t\tconst startIndex = lastIndex * referenceValueSize + referenceOffset;\n\t\t\t\t\tconst endIndex = startIndex + referenceValueSize - referenceOffset;\n\t\t\t\t\treferenceValue = AnimationUtils.arraySlice(referenceTrack.values, startIndex, endIndex);\n\t\t\t\t} else {\n\t\t\t\t\t// Interpolate to the reference value\n\t\t\t\t\tconst interpolant = referenceTrack.createInterpolant();\n\t\t\t\t\tconst startIndex = referenceOffset;\n\t\t\t\t\tconst endIndex = referenceValueSize - referenceOffset;\n\t\t\t\t\tinterpolant.evaluate(referenceTime);\n\t\t\t\t\treferenceValue = AnimationUtils.arraySlice(interpolant.resultBuffer, startIndex, endIndex);\n\t\t\t\t} // Conjugate the quaternion\n\n\n\t\t\t\tif (referenceTrackType === 'quaternion') {\n\t\t\t\t\tconst referenceQuat = new Quaternion().fromArray(referenceValue).normalize().conjugate();\n\t\t\t\t\treferenceQuat.toArray(referenceValue);\n\t\t\t\t} // Subtract the reference value from all of the track values\n\n\n\t\t\t\tconst numTimes = targetTrack.times.length;\n\n\t\t\t\tfor (let j = 0; j < numTimes; ++j) {\n\t\t\t\t\tconst valueStart = j * targetValueSize + targetOffset;\n\n\t\t\t\t\tif (referenceTrackType === 'quaternion') {\n\t\t\t\t\t\t// Multiply the conjugate for quaternion track types\n\t\t\t\t\t\tQuaternion.multiplyQuaternionsFlat(targetTrack.values, valueStart, referenceValue, 0, targetTrack.values, valueStart);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst valueEnd = targetValueSize - targetOffset * 2; // Subtract each value for all other numeric track types\n\n\t\t\t\t\t\tfor (let k = 0; k < valueEnd; ++k) {\n\t\t\t\t\t\t\ttargetTrack.values[valueStart + k] -= referenceValue[k];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ttargetClip.blendMode = AdditiveAnimationBlendMode;\n\t\t\treturn targetClip;\n\t\t}\n\t};\n\n\t/**\n\t * Abstract base class of interpolants over parametric samples.\n\t *\n\t * The parameter domain is one dimensional, typically the time or a path\n\t * along a curve defined by the data.\n\t *\n\t * The sample values can have any dimensionality and derived classes may\n\t * apply special interpretations to the data.\n\t *\n\t * This class provides the interval seek in a Template Method, deferring\n\t * the actual interpolation to derived classes.\n\t *\n\t * Time complexity is O(1) for linear access crossing at most two points\n\t * and O(log N) for random access, where N is the number of positions.\n\t *\n\t * References:\n\t *\n\t * \t\thttp://www.oodesign.com/template-method-pattern.html\n\t *\n\t */\n\tclass Interpolant {\n\t\tconstructor(parameterPositions, sampleValues, sampleSize, resultBuffer) {\n\t\t\tthis.parameterPositions = parameterPositions;\n\t\t\tthis._cachedIndex = 0;\n\t\t\tthis.resultBuffer = resultBuffer !== undefined ? resultBuffer : new sampleValues.constructor(sampleSize);\n\t\t\tthis.sampleValues = sampleValues;\n\t\t\tthis.valueSize = sampleSize;\n\t\t\tthis.settings = null;\n\t\t\tthis.DefaultSettings_ = {};\n\t\t}\n\n\t\tevaluate(t) {\n\t\t\tconst pp = this.parameterPositions;\n\t\t\tlet i1 = this._cachedIndex,\n\t\t\t\t\tt1 = pp[i1],\n\t\t\t\t\tt0 = pp[i1 - 1];\n\n\t\t\tvalidate_interval: {\n\t\t\t\tseek: {\n\t\t\t\t\tlet right;\n\n\t\t\t\t\tlinear_scan: {\n\t\t\t\t\t\t//- See http://jsperf.com/comparison-to-undefined/3\n\t\t\t\t\t\t//- slower code:\n\t\t\t\t\t\t//-\n\t\t\t\t\t\t//- \t\t\t\tif ( t >= t1 || t1 === undefined ) {\n\t\t\t\t\t\tforward_scan: if (!(t < t1)) {\n\t\t\t\t\t\t\tfor (let giveUpAt = i1 + 2;;) {\n\t\t\t\t\t\t\t\tif (t1 === undefined) {\n\t\t\t\t\t\t\t\t\tif (t < t0) break forward_scan; // after end\n\n\t\t\t\t\t\t\t\t\ti1 = pp.length;\n\t\t\t\t\t\t\t\t\tthis._cachedIndex = i1;\n\t\t\t\t\t\t\t\t\treturn this.afterEnd_(i1 - 1, t, t0);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (i1 === giveUpAt) break; // this loop\n\n\t\t\t\t\t\t\t\tt0 = t1;\n\t\t\t\t\t\t\t\tt1 = pp[++i1];\n\n\t\t\t\t\t\t\t\tif (t < t1) {\n\t\t\t\t\t\t\t\t\t// we have arrived at the sought interval\n\t\t\t\t\t\t\t\t\tbreak seek;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} // prepare binary search on the right side of the index\n\n\n\t\t\t\t\t\t\tright = pp.length;\n\t\t\t\t\t\t\tbreak linear_scan;\n\t\t\t\t\t\t} //- slower code:\n\t\t\t\t\t\t//-\t\t\t\t\tif ( t < t0 || t0 === undefined ) {\n\n\n\t\t\t\t\t\tif (!(t >= t0)) {\n\t\t\t\t\t\t\t// looping?\n\t\t\t\t\t\t\tconst t1global = pp[1];\n\n\t\t\t\t\t\t\tif (t < t1global) {\n\t\t\t\t\t\t\t\ti1 = 2; // + 1, using the scan for the details\n\n\t\t\t\t\t\t\t\tt0 = t1global;\n\t\t\t\t\t\t\t} // linear reverse scan\n\n\n\t\t\t\t\t\t\tfor (let giveUpAt = i1 - 2;;) {\n\t\t\t\t\t\t\t\tif (t0 === undefined) {\n\t\t\t\t\t\t\t\t\t// before start\n\t\t\t\t\t\t\t\t\tthis._cachedIndex = 0;\n\t\t\t\t\t\t\t\t\treturn this.beforeStart_(0, t, t1);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (i1 === giveUpAt) break; // this loop\n\n\t\t\t\t\t\t\t\tt1 = t0;\n\t\t\t\t\t\t\t\tt0 = pp[--i1 - 1];\n\n\t\t\t\t\t\t\t\tif (t >= t0) {\n\t\t\t\t\t\t\t\t\t// we have arrived at the sought interval\n\t\t\t\t\t\t\t\t\tbreak seek;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} // prepare binary search on the left side of the index\n\n\n\t\t\t\t\t\t\tright = i1;\n\t\t\t\t\t\t\ti1 = 0;\n\t\t\t\t\t\t\tbreak linear_scan;\n\t\t\t\t\t\t} // the interval is valid\n\n\n\t\t\t\t\t\tbreak validate_interval;\n\t\t\t\t\t} // linear scan\n\t\t\t\t\t// binary search\n\n\n\t\t\t\t\twhile (i1 < right) {\n\t\t\t\t\t\tconst mid = i1 + right >>> 1;\n\n\t\t\t\t\t\tif (t < pp[mid]) {\n\t\t\t\t\t\t\tright = mid;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ti1 = mid + 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tt1 = pp[i1];\n\t\t\t\t\tt0 = pp[i1 - 1]; // check boundary cases, again\n\n\t\t\t\t\tif (t0 === undefined) {\n\t\t\t\t\t\tthis._cachedIndex = 0;\n\t\t\t\t\t\treturn this.beforeStart_(0, t, t1);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (t1 === undefined) {\n\t\t\t\t\t\ti1 = pp.length;\n\t\t\t\t\t\tthis._cachedIndex = i1;\n\t\t\t\t\t\treturn this.afterEnd_(i1 - 1, t0, t);\n\t\t\t\t\t}\n\t\t\t\t} // seek\n\n\n\t\t\t\tthis._cachedIndex = i1;\n\t\t\t\tthis.intervalChanged_(i1, t0, t1);\n\t\t\t} // validate_interval\n\n\n\t\t\treturn this.interpolate_(i1, t0, t, t1);\n\t\t}\n\n\t\tgetSettings_() {\n\t\t\treturn this.settings || this.DefaultSettings_;\n\t\t}\n\n\t\tcopySampleValue_(index) {\n\t\t\t// copies a sample value to the result buffer\n\t\t\tconst result = this.resultBuffer,\n\t\t\t\t\t\tvalues = this.sampleValues,\n\t\t\t\t\t\tstride = this.valueSize,\n\t\t\t\t\t\toffset = index * stride;\n\n\t\t\tfor (let i = 0; i !== stride; ++i) {\n\t\t\t\tresult[i] = values[offset + i];\n\t\t\t}\n\n\t\t\treturn result;\n\t\t} // Template methods for derived classes:\n\n\n\t\tinterpolate_() {\n\t\t\tthrow new Error('call to abstract method'); // implementations shall return this.resultBuffer\n\t\t}\n\n\t\tintervalChanged_() {// empty\n\t\t}\n\n\t} // ALIAS DEFINITIONS\n\n\n\tInterpolant.prototype.beforeStart_ = Interpolant.prototype.copySampleValue_;\n\tInterpolant.prototype.afterEnd_ = Interpolant.prototype.copySampleValue_;\n\n\t/**\n\t * Fast and simple cubic spline interpolant.\n\t *\n\t * It was derived from a Hermitian construction setting the first derivative\n\t * at each sample position to the linear slope between neighboring positions\n\t * over their parameter interval.\n\t */\n\n\tclass CubicInterpolant extends Interpolant {\n\t\tconstructor(parameterPositions, sampleValues, sampleSize, resultBuffer) {\n\t\t\tsuper(parameterPositions, sampleValues, sampleSize, resultBuffer);\n\t\t\tthis._weightPrev = -0;\n\t\t\tthis._offsetPrev = -0;\n\t\t\tthis._weightNext = -0;\n\t\t\tthis._offsetNext = -0;\n\t\t\tthis.DefaultSettings_ = {\n\t\t\t\tendingStart: ZeroCurvatureEnding,\n\t\t\t\tendingEnd: ZeroCurvatureEnding\n\t\t\t};\n\t\t}\n\n\t\tintervalChanged_(i1, t0, t1) {\n\t\t\tconst pp = this.parameterPositions;\n\t\t\tlet iPrev = i1 - 2,\n\t\t\t\t\tiNext = i1 + 1,\n\t\t\t\t\ttPrev = pp[iPrev],\n\t\t\t\t\ttNext = pp[iNext];\n\n\t\t\tif (tPrev === undefined) {\n\t\t\t\tswitch (this.getSettings_().endingStart) {\n\t\t\t\t\tcase ZeroSlopeEnding:\n\t\t\t\t\t\t// f'(t0) = 0\n\t\t\t\t\t\tiPrev = i1;\n\t\t\t\t\t\ttPrev = 2 * t0 - t1;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase WrapAroundEnding:\n\t\t\t\t\t\t// use the other end of the curve\n\t\t\t\t\t\tiPrev = pp.length - 2;\n\t\t\t\t\t\ttPrev = t0 + pp[iPrev] - pp[iPrev + 1];\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t// ZeroCurvatureEnding\n\t\t\t\t\t\t// f''(t0) = 0 a.k.a. Natural Spline\n\t\t\t\t\t\tiPrev = i1;\n\t\t\t\t\t\ttPrev = t1;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (tNext === undefined) {\n\t\t\t\tswitch (this.getSettings_().endingEnd) {\n\t\t\t\t\tcase ZeroSlopeEnding:\n\t\t\t\t\t\t// f'(tN) = 0\n\t\t\t\t\t\tiNext = i1;\n\t\t\t\t\t\ttNext = 2 * t1 - t0;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase WrapAroundEnding:\n\t\t\t\t\t\t// use the other end of the curve\n\t\t\t\t\t\tiNext = 1;\n\t\t\t\t\t\ttNext = t1 + pp[1] - pp[0];\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t// ZeroCurvatureEnding\n\t\t\t\t\t\t// f''(tN) = 0, a.k.a. Natural Spline\n\t\t\t\t\t\tiNext = i1 - 1;\n\t\t\t\t\t\ttNext = t0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst halfDt = (t1 - t0) * 0.5,\n\t\t\t\t\t\tstride = this.valueSize;\n\t\t\tthis._weightPrev = halfDt / (t0 - tPrev);\n\t\t\tthis._weightNext = halfDt / (tNext - t1);\n\t\t\tthis._offsetPrev = iPrev * stride;\n\t\t\tthis._offsetNext = iNext * stride;\n\t\t}\n\n\t\tinterpolate_(i1, t0, t, t1) {\n\t\t\tconst result = this.resultBuffer,\n\t\t\t\t\t\tvalues = this.sampleValues,\n\t\t\t\t\t\tstride = this.valueSize,\n\t\t\t\t\t\to1 = i1 * stride,\n\t\t\t\t\t\to0 = o1 - stride,\n\t\t\t\t\t\toP = this._offsetPrev,\n\t\t\t\t\t\toN = this._offsetNext,\n\t\t\t\t\t\twP = this._weightPrev,\n\t\t\t\t\t\twN = this._weightNext,\n\t\t\t\t\t\tp = (t - t0) / (t1 - t0),\n\t\t\t\t\t\tpp = p * p,\n\t\t\t\t\t\tppp = pp * p; // evaluate polynomials\n\n\t\t\tconst sP = -wP * ppp + 2 * wP * pp - wP * p;\n\t\t\tconst s0 = (1 + wP) * ppp + (-1.5 - 2 * wP) * pp + (-0.5 + wP) * p + 1;\n\t\t\tconst s1 = (-1 - wN) * ppp + (1.5 + wN) * pp + 0.5 * p;\n\t\t\tconst sN = wN * ppp - wN * pp; // combine data linearly\n\n\t\t\tfor (let i = 0; i !== stride; ++i) {\n\t\t\t\tresult[i] = sP * values[oP + i] + s0 * values[o0 + i] + s1 * values[o1 + i] + sN * values[oN + i];\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}\n\n\t}\n\n\tclass LinearInterpolant extends Interpolant {\n\t\tconstructor(parameterPositions, sampleValues, sampleSize, resultBuffer) {\n\t\t\tsuper(parameterPositions, sampleValues, sampleSize, resultBuffer);\n\t\t}\n\n\t\tinterpolate_(i1, t0, t, t1) {\n\t\t\tconst result = this.resultBuffer,\n\t\t\t\t\t\tvalues = this.sampleValues,\n\t\t\t\t\t\tstride = this.valueSize,\n\t\t\t\t\t\toffset1 = i1 * stride,\n\t\t\t\t\t\toffset0 = offset1 - stride,\n\t\t\t\t\t\tweight1 = (t - t0) / (t1 - t0),\n\t\t\t\t\t\tweight0 = 1 - weight1;\n\n\t\t\tfor (let i = 0; i !== stride; ++i) {\n\t\t\t\tresult[i] = values[offset0 + i] * weight0 + values[offset1 + i] * weight1;\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}\n\n\t}\n\n\t/**\n\t *\n\t * Interpolant that evaluates to the sample value at the position preceeding\n\t * the parameter.\n\t */\n\n\tclass DiscreteInterpolant extends Interpolant {\n\t\tconstructor(parameterPositions, sampleValues, sampleSize, resultBuffer) {\n\t\t\tsuper(parameterPositions, sampleValues, sampleSize, resultBuffer);\n\t\t}\n\n\t\tinterpolate_(i1\n\t\t/*, t0, t, t1 */\n\t\t) {\n\t\t\treturn this.copySampleValue_(i1 - 1);\n\t\t}\n\n\t}\n\n\tclass KeyframeTrack {\n\t\tconstructor(name, times, values, interpolation) {\n\t\t\tif (name === undefined) throw new Error('THREE.KeyframeTrack: track name is undefined');\n\t\t\tif (times === undefined || times.length === 0) throw new Error('THREE.KeyframeTrack: no keyframes in track named ' + name);\n\t\t\tthis.name = name;\n\t\t\tthis.times = AnimationUtils.convertArray(times, this.TimeBufferType);\n\t\t\tthis.values = AnimationUtils.convertArray(values, this.ValueBufferType);\n\t\t\tthis.setInterpolation(interpolation || this.DefaultInterpolation);\n\t\t} // Serialization (in static context, because of constructor invocation\n\t\t// and automatic invocation of .toJSON):\n\n\n\t\tstatic toJSON(track) {\n\t\t\tconst trackType = track.constructor;\n\t\t\tlet json; // derived classes can define a static toJSON method\n\n\t\t\tif (trackType.toJSON !== this.toJSON) {\n\t\t\t\tjson = trackType.toJSON(track);\n\t\t\t} else {\n\t\t\t\t// by default, we assume the data can be serialized as-is\n\t\t\t\tjson = {\n\t\t\t\t\t'name': track.name,\n\t\t\t\t\t'times': AnimationUtils.convertArray(track.times, Array),\n\t\t\t\t\t'values': AnimationUtils.convertArray(track.values, Array)\n\t\t\t\t};\n\t\t\t\tconst interpolation = track.getInterpolation();\n\n\t\t\t\tif (interpolation !== track.DefaultInterpolation) {\n\t\t\t\t\tjson.interpolation = interpolation;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tjson.type = track.ValueTypeName; // mandatory\n\n\t\t\treturn json;\n\t\t}\n\n\t\tInterpolantFactoryMethodDiscrete(result) {\n\t\t\treturn new DiscreteInterpolant(this.times, this.values, this.getValueSize(), result);\n\t\t}\n\n\t\tInterpolantFactoryMethodLinear(result) {\n\t\t\treturn new LinearInterpolant(this.times, this.values, this.getValueSize(), result);\n\t\t}\n\n\t\tInterpolantFactoryMethodSmooth(result) {\n\t\t\treturn new CubicInterpolant(this.times, this.values, this.getValueSize(), result);\n\t\t}\n\n\t\tsetInterpolation(interpolation) {\n\t\t\tlet factoryMethod;\n\n\t\t\tswitch (interpolation) {\n\t\t\t\tcase InterpolateDiscrete:\n\t\t\t\t\tfactoryMethod = this.InterpolantFactoryMethodDiscrete;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase InterpolateLinear:\n\t\t\t\t\tfactoryMethod = this.InterpolantFactoryMethodLinear;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase InterpolateSmooth:\n\t\t\t\t\tfactoryMethod = this.InterpolantFactoryMethodSmooth;\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif (factoryMethod === undefined) {\n\t\t\t\tconst message = 'unsupported interpolation for ' + this.ValueTypeName + ' keyframe track named ' + this.name;\n\n\t\t\t\tif (this.createInterpolant === undefined) {\n\t\t\t\t\t// fall back to default, unless the default itself is messed up\n\t\t\t\t\tif (interpolation !== this.DefaultInterpolation) {\n\t\t\t\t\t\tthis.setInterpolation(this.DefaultInterpolation);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new Error(message); // fatal, in this case\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconsole.warn('THREE.KeyframeTrack:', message);\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\tthis.createInterpolant = factoryMethod;\n\t\t\treturn this;\n\t\t}\n\n\t\tgetInterpolation() {\n\t\t\tswitch (this.createInterpolant) {\n\t\t\t\tcase this.InterpolantFactoryMethodDiscrete:\n\t\t\t\t\treturn InterpolateDiscrete;\n\n\t\t\t\tcase this.InterpolantFactoryMethodLinear:\n\t\t\t\t\treturn InterpolateLinear;\n\n\t\t\t\tcase this.InterpolantFactoryMethodSmooth:\n\t\t\t\t\treturn InterpolateSmooth;\n\t\t\t}\n\t\t}\n\n\t\tgetValueSize() {\n\t\t\treturn this.values.length / this.times.length;\n\t\t} // move all keyframes either forwards or backwards in time\n\n\n\t\tshift(timeOffset) {\n\t\t\tif (timeOffset !== 0.0) {\n\t\t\t\tconst times = this.times;\n\n\t\t\t\tfor (let i = 0, n = times.length; i !== n; ++i) {\n\t\t\t\t\ttimes[i] += timeOffset;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn this;\n\t\t} // scale all keyframe times by a factor (useful for frame <-> seconds conversions)\n\n\n\t\tscale(timeScale) {\n\t\t\tif (timeScale !== 1.0) {\n\t\t\t\tconst times = this.times;\n\n\t\t\t\tfor (let i = 0, n = times.length; i !== n; ++i) {\n\t\t\t\t\ttimes[i] *= timeScale;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn this;\n\t\t} // removes keyframes before and after animation without changing any values within the range [startTime, endTime].\n\t\t// IMPORTANT: We do not shift around keys to the start of the track time, because for interpolated keys this will change their values\n\n\n\t\ttrim(startTime, endTime) {\n\t\t\tconst times = this.times,\n\t\t\t\t\t\tnKeys = times.length;\n\t\t\tlet from = 0,\n\t\t\t\t\tto = nKeys - 1;\n\n\t\t\twhile (from !== nKeys && times[from] < startTime) {\n\t\t\t\t++from;\n\t\t\t}\n\n\t\t\twhile (to !== -1 && times[to] > endTime) {\n\t\t\t\t--to;\n\t\t\t}\n\n\t\t\t++to; // inclusive -> exclusive bound\n\n\t\t\tif (from !== 0 || to !== nKeys) {\n\t\t\t\t// empty tracks are forbidden, so keep at least one keyframe\n\t\t\t\tif (from >= to) {\n\t\t\t\t\tto = Math.max(to, 1);\n\t\t\t\t\tfrom = to - 1;\n\t\t\t\t}\n\n\t\t\t\tconst stride = this.getValueSize();\n\t\t\t\tthis.times = AnimationUtils.arraySlice(times, from, to);\n\t\t\t\tthis.values = AnimationUtils.arraySlice(this.values, from * stride, to * stride);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t} // ensure we do not get a GarbageInGarbageOut situation, make sure tracks are at least minimally viable\n\n\n\t\tvalidate() {\n\t\t\tlet valid = true;\n\t\t\tconst valueSize = this.getValueSize();\n\n\t\t\tif (valueSize - Math.floor(valueSize) !== 0) {\n\t\t\t\tconsole.error('THREE.KeyframeTrack: Invalid value size in track.', this);\n\t\t\t\tvalid = false;\n\t\t\t}\n\n\t\t\tconst times = this.times,\n\t\t\t\t\t\tvalues = this.values,\n\t\t\t\t\t\tnKeys = times.length;\n\n\t\t\tif (nKeys === 0) {\n\t\t\t\tconsole.error('THREE.KeyframeTrack: Track is empty.', this);\n\t\t\t\tvalid = false;\n\t\t\t}\n\n\t\t\tlet prevTime = null;\n\n\t\t\tfor (let i = 0; i !== nKeys; i++) {\n\t\t\t\tconst currTime = times[i];\n\n\t\t\t\tif (typeof currTime === 'number' && isNaN(currTime)) {\n\t\t\t\t\tconsole.error('THREE.KeyframeTrack: Time is not a valid number.', this, i, currTime);\n\t\t\t\t\tvalid = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (prevTime !== null && prevTime > currTime) {\n\t\t\t\t\tconsole.error('THREE.KeyframeTrack: Out of order keys.', this, i, currTime, prevTime);\n\t\t\t\t\tvalid = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tprevTime = currTime;\n\t\t\t}\n\n\t\t\tif (values !== undefined) {\n\t\t\t\tif (AnimationUtils.isTypedArray(values)) {\n\t\t\t\t\tfor (let i = 0, n = values.length; i !== n; ++i) {\n\t\t\t\t\t\tconst value = values[i];\n\n\t\t\t\t\t\tif (isNaN(value)) {\n\t\t\t\t\t\t\tconsole.error('THREE.KeyframeTrack: Value is not a valid number.', this, i, value);\n\t\t\t\t\t\t\tvalid = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn valid;\n\t\t} // removes equivalent sequential keys as common in morph target sequences\n\t\t// (0,0,0,0,1,1,1,0,0,0,0,0,0,0) --> (0,0,1,1,0,0)\n\n\n\t\toptimize() {\n\t\t\t// times or values may be shared with other tracks, so overwriting is unsafe\n\t\t\tconst times = AnimationUtils.arraySlice(this.times),\n\t\t\t\t\t\tvalues = AnimationUtils.arraySlice(this.values),\n\t\t\t\t\t\tstride = this.getValueSize(),\n\t\t\t\t\t\tsmoothInterpolation = this.getInterpolation() === InterpolateSmooth,\n\t\t\t\t\t\tlastIndex = times.length - 1;\n\t\t\tlet writeIndex = 1;\n\n\t\t\tfor (let i = 1; i < lastIndex; ++i) {\n\t\t\t\tlet keep = false;\n\t\t\t\tconst time = times[i];\n\t\t\t\tconst timeNext = times[i + 1]; // remove adjacent keyframes scheduled at the same time\n\n\t\t\t\tif (time !== timeNext && (i !== 1 || time !== times[0])) {\n\t\t\t\t\tif (!smoothInterpolation) {\n\t\t\t\t\t\t// remove unnecessary keyframes same as their neighbors\n\t\t\t\t\t\tconst offset = i * stride,\n\t\t\t\t\t\t\t\t\toffsetP = offset - stride,\n\t\t\t\t\t\t\t\t\toffsetN = offset + stride;\n\n\t\t\t\t\t\tfor (let j = 0; j !== stride; ++j) {\n\t\t\t\t\t\t\tconst value = values[offset + j];\n\n\t\t\t\t\t\t\tif (value !== values[offsetP + j] || value !== values[offsetN + j]) {\n\t\t\t\t\t\t\t\tkeep = true;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tkeep = true;\n\t\t\t\t\t}\n\t\t\t\t} // in-place compaction\n\n\n\t\t\t\tif (keep) {\n\t\t\t\t\tif (i !== writeIndex) {\n\t\t\t\t\t\ttimes[writeIndex] = times[i];\n\t\t\t\t\t\tconst readOffset = i * stride,\n\t\t\t\t\t\t\t\t\twriteOffset = writeIndex * stride;\n\n\t\t\t\t\t\tfor (let j = 0; j !== stride; ++j) {\n\t\t\t\t\t\t\tvalues[writeOffset + j] = values[readOffset + j];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t++writeIndex;\n\t\t\t\t}\n\t\t\t} // flush last keyframe (compaction looks ahead)\n\n\n\t\t\tif (lastIndex > 0) {\n\t\t\t\ttimes[writeIndex] = times[lastIndex];\n\n\t\t\t\tfor (let readOffset = lastIndex * stride, writeOffset = writeIndex * stride, j = 0; j !== stride; ++j) {\n\t\t\t\t\tvalues[writeOffset + j] = values[readOffset + j];\n\t\t\t\t}\n\n\t\t\t\t++writeIndex;\n\t\t\t}\n\n\t\t\tif (writeIndex !== times.length) {\n\t\t\t\tthis.times = AnimationUtils.arraySlice(times, 0, writeIndex);\n\t\t\t\tthis.values = AnimationUtils.arraySlice(values, 0, writeIndex * stride);\n\t\t\t} else {\n\t\t\t\tthis.times = times;\n\t\t\t\tthis.values = values;\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tclone() {\n\t\t\tconst times = AnimationUtils.arraySlice(this.times, 0);\n\t\t\tconst values = AnimationUtils.arraySlice(this.values, 0);\n\t\t\tconst TypedKeyframeTrack = this.constructor;\n\t\t\tconst track = new TypedKeyframeTrack(this.name, times, values); // Interpolant argument to constructor is not saved, so copy the factory method directly.\n\n\t\t\ttrack.createInterpolant = this.createInterpolant;\n\t\t\treturn track;\n\t\t}\n\n\t}\n\n\tKeyframeTrack.prototype.TimeBufferType = Float32Array;\n\tKeyframeTrack.prototype.ValueBufferType = Float32Array;\n\tKeyframeTrack.prototype.DefaultInterpolation = InterpolateLinear;\n\n\t/**\n\t * A Track of Boolean keyframe values.\n\t */\n\n\tclass BooleanKeyframeTrack extends KeyframeTrack {}\n\n\tBooleanKeyframeTrack.prototype.ValueTypeName = 'bool';\n\tBooleanKeyframeTrack.prototype.ValueBufferType = Array;\n\tBooleanKeyframeTrack.prototype.DefaultInterpolation = InterpolateDiscrete;\n\tBooleanKeyframeTrack.prototype.InterpolantFactoryMethodLinear = undefined;\n\tBooleanKeyframeTrack.prototype.InterpolantFactoryMethodSmooth = undefined; // Note: Actually this track could have a optimized / compressed\n\n\t/**\n\t * A Track of keyframe values that represent color.\n\t */\n\n\tclass ColorKeyframeTrack extends KeyframeTrack {}\n\n\tColorKeyframeTrack.prototype.ValueTypeName = 'color'; // ValueBufferType is inherited\n\n\t/**\n\t * A Track of numeric keyframe values.\n\t */\n\n\tclass NumberKeyframeTrack extends KeyframeTrack {}\n\n\tNumberKeyframeTrack.prototype.ValueTypeName = 'number'; // ValueBufferType is inherited\n\n\t/**\n\t * Spherical linear unit quaternion interpolant.\n\t */\n\n\tclass QuaternionLinearInterpolant extends Interpolant {\n\t\tconstructor(parameterPositions, sampleValues, sampleSize, resultBuffer) {\n\t\t\tsuper(parameterPositions, sampleValues, sampleSize, resultBuffer);\n\t\t}\n\n\t\tinterpolate_(i1, t0, t, t1) {\n\t\t\tconst result = this.resultBuffer,\n\t\t\t\t\t\tvalues = this.sampleValues,\n\t\t\t\t\t\tstride = this.valueSize,\n\t\t\t\t\t\talpha = (t - t0) / (t1 - t0);\n\t\t\tlet offset = i1 * stride;\n\n\t\t\tfor (let end = offset + stride; offset !== end; offset += 4) {\n\t\t\t\tQuaternion.slerpFlat(result, 0, values, offset - stride, values, offset, alpha);\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}\n\n\t}\n\n\t/**\n\t * A Track of quaternion keyframe values.\n\t */\n\n\tclass QuaternionKeyframeTrack extends KeyframeTrack {\n\t\tInterpolantFactoryMethodLinear(result) {\n\t\t\treturn new QuaternionLinearInterpolant(this.times, this.values, this.getValueSize(), result);\n\t\t}\n\n\t}\n\n\tQuaternionKeyframeTrack.prototype.ValueTypeName = 'quaternion'; // ValueBufferType is inherited\n\n\tQuaternionKeyframeTrack.prototype.DefaultInterpolation = InterpolateLinear;\n\tQuaternionKeyframeTrack.prototype.InterpolantFactoryMethodSmooth = undefined;\n\n\t/**\n\t * A Track that interpolates Strings\n\t */\n\n\tclass StringKeyframeTrack extends KeyframeTrack {}\n\n\tStringKeyframeTrack.prototype.ValueTypeName = 'string';\n\tStringKeyframeTrack.prototype.ValueBufferType = Array;\n\tStringKeyframeTrack.prototype.DefaultInterpolation = InterpolateDiscrete;\n\tStringKeyframeTrack.prototype.InterpolantFactoryMethodLinear = undefined;\n\tStringKeyframeTrack.prototype.InterpolantFactoryMethodSmooth = undefined;\n\n\t/**\n\t * A Track of vectored keyframe values.\n\t */\n\n\tclass VectorKeyframeTrack extends KeyframeTrack {}\n\n\tVectorKeyframeTrack.prototype.ValueTypeName = 'vector'; // ValueBufferType is inherited\n\n\tclass AnimationClip {\n\t\tconstructor(name, duration = -1, tracks, blendMode = NormalAnimationBlendMode) {\n\t\t\tthis.name = name;\n\t\t\tthis.tracks = tracks;\n\t\t\tthis.duration = duration;\n\t\t\tthis.blendMode = blendMode;\n\t\t\tthis.uuid = generateUUID(); // this means it should figure out its duration by scanning the tracks\n\n\t\t\tif (this.duration < 0) {\n\t\t\t\tthis.resetDuration();\n\t\t\t}\n\t\t}\n\n\t\tstatic parse(json) {\n\t\t\tconst tracks = [],\n\t\t\t\t\t\tjsonTracks = json.tracks,\n\t\t\t\t\t\tframeTime = 1.0 / (json.fps || 1.0);\n\n\t\t\tfor (let i = 0, n = jsonTracks.length; i !== n; ++i) {\n\t\t\t\ttracks.push(parseKeyframeTrack(jsonTracks[i]).scale(frameTime));\n\t\t\t}\n\n\t\t\tconst clip = new this(json.name, json.duration, tracks, json.blendMode);\n\t\t\tclip.uuid = json.uuid;\n\t\t\treturn clip;\n\t\t}\n\n\t\tstatic toJSON(clip) {\n\t\t\tconst tracks = [],\n\t\t\t\t\t\tclipTracks = clip.tracks;\n\t\t\tconst json = {\n\t\t\t\t'name': clip.name,\n\t\t\t\t'duration': clip.duration,\n\t\t\t\t'tracks': tracks,\n\t\t\t\t'uuid': clip.uuid,\n\t\t\t\t'blendMode': clip.blendMode\n\t\t\t};\n\n\t\t\tfor (let i = 0, n = clipTracks.length; i !== n; ++i) {\n\t\t\t\ttracks.push(KeyframeTrack.toJSON(clipTracks[i]));\n\t\t\t}\n\n\t\t\treturn json;\n\t\t}\n\n\t\tstatic CreateFromMorphTargetSequence(name, morphTargetSequence, fps, noLoop) {\n\t\t\tconst numMorphTargets = morphTargetSequence.length;\n\t\t\tconst tracks = [];\n\n\t\t\tfor (let i = 0; i < numMorphTargets; i++) {\n\t\t\t\tlet times = [];\n\t\t\t\tlet values = [];\n\t\t\t\ttimes.push((i + numMorphTargets - 1) % numMorphTargets, i, (i + 1) % numMorphTargets);\n\t\t\t\tvalues.push(0, 1, 0);\n\t\t\t\tconst order = AnimationUtils.getKeyframeOrder(times);\n\t\t\t\ttimes = AnimationUtils.sortedArray(times, 1, order);\n\t\t\t\tvalues = AnimationUtils.sortedArray(values, 1, order); // if there is a key at the first frame, duplicate it as the\n\t\t\t\t// last frame as well for perfect loop.\n\n\t\t\t\tif (!noLoop && times[0] === 0) {\n\t\t\t\t\ttimes.push(numMorphTargets);\n\t\t\t\t\tvalues.push(values[0]);\n\t\t\t\t}\n\n\t\t\t\ttracks.push(new NumberKeyframeTrack('.morphTargetInfluences[' + morphTargetSequence[i].name + ']', times, values).scale(1.0 / fps));\n\t\t\t}\n\n\t\t\treturn new this(name, -1, tracks);\n\t\t}\n\n\t\tstatic findByName(objectOrClipArray, name) {\n\t\t\tlet clipArray = objectOrClipArray;\n\n\t\t\tif (!Array.isArray(objectOrClipArray)) {\n\t\t\t\tconst o = objectOrClipArray;\n\t\t\t\tclipArray = o.geometry && o.geometry.animations || o.animations;\n\t\t\t}\n\n\t\t\tfor (let i = 0; i < clipArray.length; i++) {\n\t\t\t\tif (clipArray[i].name === name) {\n\t\t\t\t\treturn clipArray[i];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\tstatic CreateClipsFromMorphTargetSequences(morphTargets, fps, noLoop) {\n\t\t\tconst animationToMorphTargets = {}; // tested with https://regex101.com/ on trick sequences\n\t\t\t// such flamingo_flyA_003, flamingo_run1_003, crdeath0059\n\n\t\t\tconst pattern = /^([\\w-]*?)([\\d]+)$/; // sort morph target names into animation groups based\n\t\t\t// patterns like Walk_001, Walk_002, Run_001, Run_002\n\n\t\t\tfor (let i = 0, il = morphTargets.length; i < il; i++) {\n\t\t\t\tconst morphTarget = morphTargets[i];\n\t\t\t\tconst parts = morphTarget.name.match(pattern);\n\n\t\t\t\tif (parts && parts.length > 1) {\n\t\t\t\t\tconst name = parts[1];\n\t\t\t\t\tlet animationMorphTargets = animationToMorphTargets[name];\n\n\t\t\t\t\tif (!animationMorphTargets) {\n\t\t\t\t\t\tanimationToMorphTargets[name] = animationMorphTargets = [];\n\t\t\t\t\t}\n\n\t\t\t\t\tanimationMorphTargets.push(morphTarget);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst clips = [];\n\n\t\t\tfor (const name in animationToMorphTargets) {\n\t\t\t\tclips.push(this.CreateFromMorphTargetSequence(name, animationToMorphTargets[name], fps, noLoop));\n\t\t\t}\n\n\t\t\treturn clips;\n\t\t} // parse the animation.hierarchy format\n\n\n\t\tstatic parseAnimation(animation, bones) {\n\t\t\tif (!animation) {\n\t\t\t\tconsole.error('THREE.AnimationClip: No animation in JSONLoader data.');\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst addNonemptyTrack = function (trackType, trackName, animationKeys, propertyName, destTracks) {\n\t\t\t\t// only return track if there are actually keys.\n\t\t\t\tif (animationKeys.length !== 0) {\n\t\t\t\t\tconst times = [];\n\t\t\t\t\tconst values = [];\n\t\t\t\t\tAnimationUtils.flattenJSON(animationKeys, times, values, propertyName); // empty keys are filtered out, so check again\n\n\t\t\t\t\tif (times.length !== 0) {\n\t\t\t\t\t\tdestTracks.push(new trackType(trackName, times, values));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tconst tracks = [];\n\t\t\tconst clipName = animation.name || 'default';\n\t\t\tconst fps = animation.fps || 30;\n\t\t\tconst blendMode = animation.blendMode; // automatic length determination in AnimationClip.\n\n\t\t\tlet duration = animation.length || -1;\n\t\t\tconst hierarchyTracks = animation.hierarchy || [];\n\n\t\t\tfor (let h = 0; h < hierarchyTracks.length; h++) {\n\t\t\t\tconst animationKeys = hierarchyTracks[h].keys; // skip empty tracks\n\n\t\t\t\tif (!animationKeys || animationKeys.length === 0) continue; // process morph targets\n\n\t\t\t\tif (animationKeys[0].morphTargets) {\n\t\t\t\t\t// figure out all morph targets used in this track\n\t\t\t\t\tconst morphTargetNames = {};\n\t\t\t\t\tlet k;\n\n\t\t\t\t\tfor (k = 0; k < animationKeys.length; k++) {\n\t\t\t\t\t\tif (animationKeys[k].morphTargets) {\n\t\t\t\t\t\t\tfor (let m = 0; m < animationKeys[k].morphTargets.length; m++) {\n\t\t\t\t\t\t\t\tmorphTargetNames[animationKeys[k].morphTargets[m]] = -1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} // create a track for each morph target with all zero\n\t\t\t\t\t// morphTargetInfluences except for the keys in which\n\t\t\t\t\t// the morphTarget is named.\n\n\n\t\t\t\t\tfor (const morphTargetName in morphTargetNames) {\n\t\t\t\t\t\tconst times = [];\n\t\t\t\t\t\tconst values = [];\n\n\t\t\t\t\t\tfor (let m = 0; m !== animationKeys[k].morphTargets.length; ++m) {\n\t\t\t\t\t\t\tconst animationKey = animationKeys[k];\n\t\t\t\t\t\t\ttimes.push(animationKey.time);\n\t\t\t\t\t\t\tvalues.push(animationKey.morphTarget === morphTargetName ? 1 : 0);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttracks.push(new NumberKeyframeTrack('.morphTargetInfluence[' + morphTargetName + ']', times, values));\n\t\t\t\t\t}\n\n\t\t\t\t\tduration = morphTargetNames.length * (fps || 1.0);\n\t\t\t\t} else {\n\t\t\t\t\t// ...assume skeletal animation\n\t\t\t\t\tconst boneName = '.bones[' + bones[h].name + ']';\n\t\t\t\t\taddNonemptyTrack(VectorKeyframeTrack, boneName + '.position', animationKeys, 'pos', tracks);\n\t\t\t\t\taddNonemptyTrack(QuaternionKeyframeTrack, boneName + '.quaternion', animationKeys, 'rot', tracks);\n\t\t\t\t\taddNonemptyTrack(VectorKeyframeTrack, boneName + '.scale', animationKeys, 'scl', tracks);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (tracks.length === 0) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst clip = new this(clipName, duration, tracks, blendMode);\n\t\t\treturn clip;\n\t\t}\n\n\t\tresetDuration() {\n\t\t\tconst tracks = this.tracks;\n\t\t\tlet duration = 0;\n\n\t\t\tfor (let i = 0, n = tracks.length; i !== n; ++i) {\n\t\t\t\tconst track = this.tracks[i];\n\t\t\t\tduration = Math.max(duration, track.times[track.times.length - 1]);\n\t\t\t}\n\n\t\t\tthis.duration = duration;\n\t\t\treturn this;\n\t\t}\n\n\t\ttrim() {\n\t\t\tfor (let i = 0; i < this.tracks.length; i++) {\n\t\t\t\tthis.tracks[i].trim(0, this.duration);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tvalidate() {\n\t\t\tlet valid = true;\n\n\t\t\tfor (let i = 0; i < this.tracks.length; i++) {\n\t\t\t\tvalid = valid && this.tracks[i].validate();\n\t\t\t}\n\n\t\t\treturn valid;\n\t\t}\n\n\t\toptimize() {\n\t\t\tfor (let i = 0; i < this.tracks.length; i++) {\n\t\t\t\tthis.tracks[i].optimize();\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tclone() {\n\t\t\tconst tracks = [];\n\n\t\t\tfor (let i = 0; i < this.tracks.length; i++) {\n\t\t\t\ttracks.push(this.tracks[i].clone());\n\t\t\t}\n\n\t\t\treturn new this.constructor(this.name, this.duration, tracks, this.blendMode);\n\t\t}\n\n\t\ttoJSON() {\n\t\t\treturn this.constructor.toJSON(this);\n\t\t}\n\n\t}\n\n\tfunction getTrackTypeForValueTypeName(typeName) {\n\t\tswitch (typeName.toLowerCase()) {\n\t\t\tcase 'scalar':\n\t\t\tcase 'double':\n\t\t\tcase 'float':\n\t\t\tcase 'number':\n\t\t\tcase 'integer':\n\t\t\t\treturn NumberKeyframeTrack;\n\n\t\t\tcase 'vector':\n\t\t\tcase 'vector2':\n\t\t\tcase 'vector3':\n\t\t\tcase 'vector4':\n\t\t\t\treturn VectorKeyframeTrack;\n\n\t\t\tcase 'color':\n\t\t\t\treturn ColorKeyframeTrack;\n\n\t\t\tcase 'quaternion':\n\t\t\t\treturn QuaternionKeyframeTrack;\n\n\t\t\tcase 'bool':\n\t\t\tcase 'boolean':\n\t\t\t\treturn BooleanKeyframeTrack;\n\n\t\t\tcase 'string':\n\t\t\t\treturn StringKeyframeTrack;\n\t\t}\n\n\t\tthrow new Error('THREE.KeyframeTrack: Unsupported typeName: ' + typeName);\n\t}\n\n\tfunction parseKeyframeTrack(json) {\n\t\tif (json.type === undefined) {\n\t\t\tthrow new Error('THREE.KeyframeTrack: track type undefined, can not parse');\n\t\t}\n\n\t\tconst trackType = getTrackTypeForValueTypeName(json.type);\n\n\t\tif (json.times === undefined) {\n\t\t\tconst times = [],\n\t\t\t\t\t\tvalues = [];\n\t\t\tAnimationUtils.flattenJSON(json.keys, times, values, 'value');\n\t\t\tjson.times = times;\n\t\t\tjson.values = values;\n\t\t} // derived classes can define a static parse method\n\n\n\t\tif (trackType.parse !== undefined) {\n\t\t\treturn trackType.parse(json);\n\t\t} else {\n\t\t\t// by default, we assume a constructor compatible with the base\n\t\t\treturn new trackType(json.name, json.times, json.values, json.interpolation);\n\t\t}\n\t}\n\n\tconst Cache = {\n\t\tenabled: false,\n\t\tfiles: {},\n\t\tadd: function (key, file) {\n\t\t\tif (this.enabled === false) return; // console.log( 'THREE.Cache', 'Adding key:', key );\n\n\t\t\tthis.files[key] = file;\n\t\t},\n\t\tget: function (key) {\n\t\t\tif (this.enabled === false) return; // console.log( 'THREE.Cache', 'Checking key:', key );\n\n\t\t\treturn this.files[key];\n\t\t},\n\t\tremove: function (key) {\n\t\t\tdelete this.files[key];\n\t\t},\n\t\tclear: function () {\n\t\t\tthis.files = {};\n\t\t}\n\t};\n\n\tclass LoadingManager {\n\t\tconstructor(onLoad, onProgress, onError) {\n\t\t\tconst scope = this;\n\t\t\tlet isLoading = false;\n\t\t\tlet itemsLoaded = 0;\n\t\t\tlet itemsTotal = 0;\n\t\t\tlet urlModifier = undefined;\n\t\t\tconst handlers = []; // Refer to #5689 for the reason why we don't set .onStart\n\t\t\t// in the constructor\n\n\t\t\tthis.onStart = undefined;\n\t\t\tthis.onLoad = onLoad;\n\t\t\tthis.onProgress = onProgress;\n\t\t\tthis.onError = onError;\n\n\t\t\tthis.itemStart = function (url) {\n\t\t\t\titemsTotal++;\n\n\t\t\t\tif (isLoading === false) {\n\t\t\t\t\tif (scope.onStart !== undefined) {\n\t\t\t\t\t\tscope.onStart(url, itemsLoaded, itemsTotal);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tisLoading = true;\n\t\t\t};\n\n\t\t\tthis.itemEnd = function (url) {\n\t\t\t\titemsLoaded++;\n\n\t\t\t\tif (scope.onProgress !== undefined) {\n\t\t\t\t\tscope.onProgress(url, itemsLoaded, itemsTotal);\n\t\t\t\t}\n\n\t\t\t\tif (itemsLoaded === itemsTotal) {\n\t\t\t\t\tisLoading = false;\n\n\t\t\t\t\tif (scope.onLoad !== undefined) {\n\t\t\t\t\t\tscope.onLoad();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.itemError = function (url) {\n\t\t\t\tif (scope.onError !== undefined) {\n\t\t\t\t\tscope.onError(url);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.resolveURL = function (url) {\n\t\t\t\tif (urlModifier) {\n\t\t\t\t\treturn urlModifier(url);\n\t\t\t\t}\n\n\t\t\t\treturn url;\n\t\t\t};\n\n\t\t\tthis.setURLModifier = function (transform) {\n\t\t\t\turlModifier = transform;\n\t\t\t\treturn this;\n\t\t\t};\n\n\t\t\tthis.addHandler = function (regex, loader) {\n\t\t\t\thandlers.push(regex, loader);\n\t\t\t\treturn this;\n\t\t\t};\n\n\t\t\tthis.removeHandler = function (regex) {\n\t\t\t\tconst index = handlers.indexOf(regex);\n\n\t\t\t\tif (index !== -1) {\n\t\t\t\t\thandlers.splice(index, 2);\n\t\t\t\t}\n\n\t\t\t\treturn this;\n\t\t\t};\n\n\t\t\tthis.getHandler = function (file) {\n\t\t\t\tfor (let i = 0, l = handlers.length; i < l; i += 2) {\n\t\t\t\t\tconst regex = handlers[i];\n\t\t\t\t\tconst loader = handlers[i + 1];\n\t\t\t\t\tif (regex.global) regex.lastIndex = 0; // see #17920\n\n\t\t\t\t\tif (regex.test(file)) {\n\t\t\t\t\t\treturn loader;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn null;\n\t\t\t};\n\t\t}\n\n\t}\n\n\tconst DefaultLoadingManager = new LoadingManager();\n\n\tclass Loader {\n\t\tconstructor(manager) {\n\t\t\tthis.manager = manager !== undefined ? manager : DefaultLoadingManager;\n\t\t\tthis.crossOrigin = 'anonymous';\n\t\t\tthis.withCredentials = false;\n\t\t\tthis.path = '';\n\t\t\tthis.resourcePath = '';\n\t\t\tthis.requestHeader = {};\n\t\t}\n\n\t\tload() {}\n\n\t\tloadAsync(url, onProgress) {\n\t\t\tconst scope = this;\n\t\t\treturn new Promise(function (resolve, reject) {\n\t\t\t\tscope.load(url, resolve, onProgress, reject);\n\t\t\t});\n\t\t}\n\n\t\tparse() {}\n\n\t\tsetCrossOrigin(crossOrigin) {\n\t\t\tthis.crossOrigin = crossOrigin;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetWithCredentials(value) {\n\t\t\tthis.withCredentials = value;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetPath(path) {\n\t\t\tthis.path = path;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetResourcePath(resourcePath) {\n\t\t\tthis.resourcePath = resourcePath;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetRequestHeader(requestHeader) {\n\t\t\tthis.requestHeader = requestHeader;\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tconst loading = {};\n\n\tclass FileLoader extends Loader {\n\t\tconstructor(manager) {\n\t\t\tsuper(manager);\n\t\t}\n\n\t\tload(url, onLoad, onProgress, onError) {\n\t\t\tif (url === undefined) url = '';\n\t\t\tif (this.path !== undefined) url = this.path + url;\n\t\t\turl = this.manager.resolveURL(url);\n\t\t\tconst scope = this;\n\t\t\tconst cached = Cache.get(url);\n\n\t\t\tif (cached !== undefined) {\n\t\t\t\tscope.manager.itemStart(url);\n\t\t\t\tsetTimeout(function () {\n\t\t\t\t\tif (onLoad) onLoad(cached);\n\t\t\t\t\tscope.manager.itemEnd(url);\n\t\t\t\t}, 0);\n\t\t\t\treturn cached;\n\t\t\t} // Check if request is duplicate\n\n\n\t\t\tif (loading[url] !== undefined) {\n\t\t\t\tloading[url].push({\n\t\t\t\t\tonLoad: onLoad,\n\t\t\t\t\tonProgress: onProgress,\n\t\t\t\t\tonError: onError\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t} // Check for data: URI\n\n\n\t\t\tconst dataUriRegex = /^data:(.*?)(;base64)?,(.*)$/;\n\t\t\tconst dataUriRegexResult = url.match(dataUriRegex);\n\t\t\tlet request; // Safari can not handle Data URIs through XMLHttpRequest so process manually\n\n\t\t\tif (dataUriRegexResult) {\n\t\t\t\tconst mimeType = dataUriRegexResult[1];\n\t\t\t\tconst isBase64 = !!dataUriRegexResult[2];\n\t\t\t\tlet data = dataUriRegexResult[3];\n\t\t\t\tdata = decodeURIComponent(data);\n\t\t\t\tif (isBase64) data = atob(data);\n\n\t\t\t\ttry {\n\t\t\t\t\tlet response;\n\t\t\t\t\tconst responseType = (this.responseType || '').toLowerCase();\n\n\t\t\t\t\tswitch (responseType) {\n\t\t\t\t\t\tcase 'arraybuffer':\n\t\t\t\t\t\tcase 'blob':\n\t\t\t\t\t\t\tconst view = new Uint8Array(data.length);\n\n\t\t\t\t\t\t\tfor (let i = 0; i < data.length; i++) {\n\t\t\t\t\t\t\t\tview[i] = data.charCodeAt(i);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (responseType === 'blob') {\n\t\t\t\t\t\t\t\tresponse = new Blob([view.buffer], {\n\t\t\t\t\t\t\t\t\ttype: mimeType\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tresponse = view.buffer;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'document':\n\t\t\t\t\t\t\tconst parser = new DOMParser();\n\t\t\t\t\t\t\tresponse = parser.parseFromString(data, mimeType);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'json':\n\t\t\t\t\t\t\tresponse = JSON.parse(data);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t// 'text' or other\n\t\t\t\t\t\t\tresponse = data;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t} // Wait for next browser tick like standard XMLHttpRequest event dispatching does\n\n\n\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\tif (onLoad) onLoad(response);\n\t\t\t\t\t\tscope.manager.itemEnd(url);\n\t\t\t\t\t}, 0);\n\t\t\t\t} catch (error) {\n\t\t\t\t\t// Wait for next browser tick like standard XMLHttpRequest event dispatching does\n\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\tif (onError) onError(error);\n\t\t\t\t\t\tscope.manager.itemError(url);\n\t\t\t\t\t\tscope.manager.itemEnd(url);\n\t\t\t\t\t}, 0);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Initialise array for duplicate requests\n\t\t\t\tloading[url] = [];\n\t\t\t\tloading[url].push({\n\t\t\t\t\tonLoad: onLoad,\n\t\t\t\t\tonProgress: onProgress,\n\t\t\t\t\tonError: onError\n\t\t\t\t});\n\t\t\t\trequest = new XMLHttpRequest();\n\t\t\t\trequest.open('GET', url, true);\n\t\t\t\trequest.addEventListener('load', function (event) {\n\t\t\t\t\tconst response = this.response;\n\t\t\t\t\tconst callbacks = loading[url];\n\t\t\t\t\tdelete loading[url];\n\n\t\t\t\t\tif (this.status === 200 || this.status === 0) {\n\t\t\t\t\t\t// Some browsers return HTTP Status 0 when using non-http protocol\n\t\t\t\t\t\t// e.g. 'file://' or 'data://'. Handle as success.\n\t\t\t\t\t\tif (this.status === 0) console.warn('THREE.FileLoader: HTTP Status 0 received.'); // Add to cache only on HTTP success, so that we do not cache\n\t\t\t\t\t\t// error response bodies as proper responses to requests.\n\n\t\t\t\t\t\tCache.add(url, response);\n\n\t\t\t\t\t\tfor (let i = 0, il = callbacks.length; i < il; i++) {\n\t\t\t\t\t\t\tconst callback = callbacks[i];\n\t\t\t\t\t\t\tif (callback.onLoad) callback.onLoad(response);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tscope.manager.itemEnd(url);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfor (let i = 0, il = callbacks.length; i < il; i++) {\n\t\t\t\t\t\t\tconst callback = callbacks[i];\n\t\t\t\t\t\t\tif (callback.onError) callback.onError(event);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tscope.manager.itemError(url);\n\t\t\t\t\t\tscope.manager.itemEnd(url);\n\t\t\t\t\t}\n\t\t\t\t}, false);\n\t\t\t\trequest.addEventListener('progress', function (event) {\n\t\t\t\t\tconst callbacks = loading[url];\n\n\t\t\t\t\tfor (let i = 0, il = callbacks.length; i < il; i++) {\n\t\t\t\t\t\tconst callback = callbacks[i];\n\t\t\t\t\t\tif (callback.onProgress) callback.onProgress(event);\n\t\t\t\t\t}\n\t\t\t\t}, false);\n\t\t\t\trequest.addEventListener('error', function (event) {\n\t\t\t\t\tconst callbacks = loading[url];\n\t\t\t\t\tdelete loading[url];\n\n\t\t\t\t\tfor (let i = 0, il = callbacks.length; i < il; i++) {\n\t\t\t\t\t\tconst callback = callbacks[i];\n\t\t\t\t\t\tif (callback.onError) callback.onError(event);\n\t\t\t\t\t}\n\n\t\t\t\t\tscope.manager.itemError(url);\n\t\t\t\t\tscope.manager.itemEnd(url);\n\t\t\t\t}, false);\n\t\t\t\trequest.addEventListener('abort', function (event) {\n\t\t\t\t\tconst callbacks = loading[url];\n\t\t\t\t\tdelete loading[url];\n\n\t\t\t\t\tfor (let i = 0, il = callbacks.length; i < il; i++) {\n\t\t\t\t\t\tconst callback = callbacks[i];\n\t\t\t\t\t\tif (callback.onError) callback.onError(event);\n\t\t\t\t\t}\n\n\t\t\t\t\tscope.manager.itemError(url);\n\t\t\t\t\tscope.manager.itemEnd(url);\n\t\t\t\t}, false);\n\t\t\t\tif (this.responseType !== undefined) request.responseType = this.responseType;\n\t\t\t\tif (this.withCredentials !== undefined) request.withCredentials = this.withCredentials;\n\t\t\t\tif (request.overrideMimeType) request.overrideMimeType(this.mimeType !== undefined ? this.mimeType : 'text/plain');\n\n\t\t\t\tfor (const header in this.requestHeader) {\n\t\t\t\t\trequest.setRequestHeader(header, this.requestHeader[header]);\n\t\t\t\t}\n\n\t\t\t\trequest.send(null);\n\t\t\t}\n\n\t\t\tscope.manager.itemStart(url);\n\t\t\treturn request;\n\t\t}\n\n\t\tsetResponseType(value) {\n\t\t\tthis.responseType = value;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetMimeType(value) {\n\t\t\tthis.mimeType = value;\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tclass AnimationLoader extends Loader {\n\t\tconstructor(manager) {\n\t\t\tsuper(manager);\n\t\t}\n\n\t\tload(url, onLoad, onProgress, onError) {\n\t\t\tconst scope = this;\n\t\t\tconst loader = new FileLoader(this.manager);\n\t\t\tloader.setPath(this.path);\n\t\t\tloader.setRequestHeader(this.requestHeader);\n\t\t\tloader.setWithCredentials(this.withCredentials);\n\t\t\tloader.load(url, function (text) {\n\t\t\t\ttry {\n\t\t\t\t\tonLoad(scope.parse(JSON.parse(text)));\n\t\t\t\t} catch (e) {\n\t\t\t\t\tif (onError) {\n\t\t\t\t\t\tonError(e);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconsole.error(e);\n\t\t\t\t\t}\n\n\t\t\t\t\tscope.manager.itemError(url);\n\t\t\t\t}\n\t\t\t}, onProgress, onError);\n\t\t}\n\n\t\tparse(json) {\n\t\t\tconst animations = [];\n\n\t\t\tfor (let i = 0; i < json.length; i++) {\n\t\t\t\tconst clip = AnimationClip.parse(json[i]);\n\t\t\t\tanimations.push(clip);\n\t\t\t}\n\n\t\t\treturn animations;\n\t\t}\n\n\t}\n\n\t/**\n\t * Abstract Base class to block based textures loader (dds, pvr, ...)\n\t *\n\t * Sub classes have to implement the parse() method which will be used in load().\n\t */\n\n\tclass CompressedTextureLoader extends Loader {\n\t\tconstructor(manager) {\n\t\t\tsuper(manager);\n\t\t}\n\n\t\tload(url, onLoad, onProgress, onError) {\n\t\t\tconst scope = this;\n\t\t\tconst images = [];\n\t\t\tconst texture = new CompressedTexture();\n\t\t\tconst loader = new FileLoader(this.manager);\n\t\t\tloader.setPath(this.path);\n\t\t\tloader.setResponseType('arraybuffer');\n\t\t\tloader.setRequestHeader(this.requestHeader);\n\t\t\tloader.setWithCredentials(scope.withCredentials);\n\t\t\tlet loaded = 0;\n\n\t\t\tfunction loadTexture(i) {\n\t\t\t\tloader.load(url[i], function (buffer) {\n\t\t\t\t\tconst texDatas = scope.parse(buffer, true);\n\t\t\t\t\timages[i] = {\n\t\t\t\t\t\twidth: texDatas.width,\n\t\t\t\t\t\theight: texDatas.height,\n\t\t\t\t\t\tformat: texDatas.format,\n\t\t\t\t\t\tmipmaps: texDatas.mipmaps\n\t\t\t\t\t};\n\t\t\t\t\tloaded += 1;\n\n\t\t\t\t\tif (loaded === 6) {\n\t\t\t\t\t\tif (texDatas.mipmapCount === 1) texture.minFilter = LinearFilter;\n\t\t\t\t\t\ttexture.image = images;\n\t\t\t\t\t\ttexture.format = texDatas.format;\n\t\t\t\t\t\ttexture.needsUpdate = true;\n\t\t\t\t\t\tif (onLoad) onLoad(texture);\n\t\t\t\t\t}\n\t\t\t\t}, onProgress, onError);\n\t\t\t}\n\n\t\t\tif (Array.isArray(url)) {\n\t\t\t\tfor (let i = 0, il = url.length; i < il; ++i) {\n\t\t\t\t\tloadTexture(i);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// compressed cubemap texture stored in a single DDS file\n\t\t\t\tloader.load(url, function (buffer) {\n\t\t\t\t\tconst texDatas = scope.parse(buffer, true);\n\n\t\t\t\t\tif (texDatas.isCubemap) {\n\t\t\t\t\t\tconst faces = texDatas.mipmaps.length / texDatas.mipmapCount;\n\n\t\t\t\t\t\tfor (let f = 0; f < faces; f++) {\n\t\t\t\t\t\t\timages[f] = {\n\t\t\t\t\t\t\t\tmipmaps: []\n\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\tfor (let i = 0; i < texDatas.mipmapCount; i++) {\n\t\t\t\t\t\t\t\timages[f].mipmaps.push(texDatas.mipmaps[f * texDatas.mipmapCount + i]);\n\t\t\t\t\t\t\t\timages[f].format = texDatas.format;\n\t\t\t\t\t\t\t\timages[f].width = texDatas.width;\n\t\t\t\t\t\t\t\timages[f].height = texDatas.height;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttexture.image = images;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttexture.image.width = texDatas.width;\n\t\t\t\t\t\ttexture.image.height = texDatas.height;\n\t\t\t\t\t\ttexture.mipmaps = texDatas.mipmaps;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (texDatas.mipmapCount === 1) {\n\t\t\t\t\t\ttexture.minFilter = LinearFilter;\n\t\t\t\t\t}\n\n\t\t\t\t\ttexture.format = texDatas.format;\n\t\t\t\t\ttexture.needsUpdate = true;\n\t\t\t\t\tif (onLoad) onLoad(texture);\n\t\t\t\t}, onProgress, onError);\n\t\t\t}\n\n\t\t\treturn texture;\n\t\t}\n\n\t}\n\n\tclass ImageLoader extends Loader {\n\t\tconstructor(manager) {\n\t\t\tsuper(manager);\n\t\t}\n\n\t\tload(url, onLoad, onProgress, onError) {\n\t\t\tif (this.path !== undefined) url = this.path + url;\n\t\t\turl = this.manager.resolveURL(url);\n\t\t\tconst scope = this;\n\t\t\tconst cached = Cache.get(url);\n\n\t\t\tif (cached !== undefined) {\n\t\t\t\tscope.manager.itemStart(url);\n\t\t\t\tsetTimeout(function () {\n\t\t\t\t\tif (onLoad) onLoad(cached);\n\t\t\t\t\tscope.manager.itemEnd(url);\n\t\t\t\t}, 0);\n\t\t\t\treturn cached;\n\t\t\t}\n\n\t\t\tconst image = createElementNS('img');\n\n\t\t\tfunction onImageLoad() {\n\t\t\t\timage.removeEventListener('load', onImageLoad, false);\n\t\t\t\timage.removeEventListener('error', onImageError, false);\n\t\t\t\tCache.add(url, this);\n\t\t\t\tif (onLoad) onLoad(this);\n\t\t\t\tscope.manager.itemEnd(url);\n\t\t\t}\n\n\t\t\tfunction onImageError(event) {\n\t\t\t\timage.removeEventListener('load', onImageLoad, false);\n\t\t\t\timage.removeEventListener('error', onImageError, false);\n\t\t\t\tif (onError) onError(event);\n\t\t\t\tscope.manager.itemError(url);\n\t\t\t\tscope.manager.itemEnd(url);\n\t\t\t}\n\n\t\t\timage.addEventListener('load', onImageLoad, false);\n\t\t\timage.addEventListener('error', onImageError, false);\n\n\t\t\tif (url.substr(0, 5) !== 'data:') {\n\t\t\t\tif (this.crossOrigin !== undefined) image.crossOrigin = this.crossOrigin;\n\t\t\t}\n\n\t\t\tscope.manager.itemStart(url);\n\t\t\timage.src = url;\n\t\t\treturn image;\n\t\t}\n\n\t}\n\n\tclass CubeTextureLoader extends Loader {\n\t\tconstructor(manager) {\n\t\t\tsuper(manager);\n\t\t}\n\n\t\tload(urls, onLoad, onProgress, onError) {\n\t\t\tconst texture = new CubeTexture();\n\t\t\tconst loader = new ImageLoader(this.manager);\n\t\t\tloader.setCrossOrigin(this.crossOrigin);\n\t\t\tloader.setPath(this.path);\n\t\t\tlet loaded = 0;\n\n\t\t\tfunction loadTexture(i) {\n\t\t\t\tloader.load(urls[i], function (image) {\n\t\t\t\t\ttexture.images[i] = image;\n\t\t\t\t\tloaded++;\n\n\t\t\t\t\tif (loaded === 6) {\n\t\t\t\t\t\ttexture.needsUpdate = true;\n\t\t\t\t\t\tif (onLoad) onLoad(texture);\n\t\t\t\t\t}\n\t\t\t\t}, undefined, onError);\n\t\t\t}\n\n\t\t\tfor (let i = 0; i < urls.length; ++i) {\n\t\t\t\tloadTexture(i);\n\t\t\t}\n\n\t\t\treturn texture;\n\t\t}\n\n\t}\n\n\t/**\n\t * Abstract Base class to load generic binary textures formats (rgbe, hdr, ...)\n\t *\n\t * Sub classes have to implement the parse() method which will be used in load().\n\t */\n\n\tclass DataTextureLoader extends Loader {\n\t\tconstructor(manager) {\n\t\t\tsuper(manager);\n\t\t}\n\n\t\tload(url, onLoad, onProgress, onError) {\n\t\t\tconst scope = this;\n\t\t\tconst texture = new DataTexture();\n\t\t\tconst loader = new FileLoader(this.manager);\n\t\t\tloader.setResponseType('arraybuffer');\n\t\t\tloader.setRequestHeader(this.requestHeader);\n\t\t\tloader.setPath(this.path);\n\t\t\tloader.setWithCredentials(scope.withCredentials);\n\t\t\tloader.load(url, function (buffer) {\n\t\t\t\tconst texData = scope.parse(buffer);\n\t\t\t\tif (!texData) return;\n\n\t\t\t\tif (texData.image !== undefined) {\n\t\t\t\t\ttexture.image = texData.image;\n\t\t\t\t} else if (texData.data !== undefined) {\n\t\t\t\t\ttexture.image.width = texData.width;\n\t\t\t\t\ttexture.image.height = texData.height;\n\t\t\t\t\ttexture.image.data = texData.data;\n\t\t\t\t}\n\n\t\t\t\ttexture.wrapS = texData.wrapS !== undefined ? texData.wrapS : ClampToEdgeWrapping;\n\t\t\t\ttexture.wrapT = texData.wrapT !== undefined ? texData.wrapT : ClampToEdgeWrapping;\n\t\t\t\ttexture.magFilter = texData.magFilter !== undefined ? texData.magFilter : LinearFilter;\n\t\t\t\ttexture.minFilter = texData.minFilter !== undefined ? texData.minFilter : LinearFilter;\n\t\t\t\ttexture.anisotropy = texData.anisotropy !== undefined ? texData.anisotropy : 1;\n\n\t\t\t\tif (texData.encoding !== undefined) {\n\t\t\t\t\ttexture.encoding = texData.encoding;\n\t\t\t\t}\n\n\t\t\t\tif (texData.flipY !== undefined) {\n\t\t\t\t\ttexture.flipY = texData.flipY;\n\t\t\t\t}\n\n\t\t\t\tif (texData.format !== undefined) {\n\t\t\t\t\ttexture.format = texData.format;\n\t\t\t\t}\n\n\t\t\t\tif (texData.type !== undefined) {\n\t\t\t\t\ttexture.type = texData.type;\n\t\t\t\t}\n\n\t\t\t\tif (texData.mipmaps !== undefined) {\n\t\t\t\t\ttexture.mipmaps = texData.mipmaps;\n\t\t\t\t\ttexture.minFilter = LinearMipmapLinearFilter; // presumably...\n\t\t\t\t}\n\n\t\t\t\tif (texData.mipmapCount === 1) {\n\t\t\t\t\ttexture.minFilter = LinearFilter;\n\t\t\t\t}\n\n\t\t\t\tif (texData.generateMipmaps !== undefined) {\n\t\t\t\t\ttexture.generateMipmaps = texData.generateMipmaps;\n\t\t\t\t}\n\n\t\t\t\ttexture.needsUpdate = true;\n\t\t\t\tif (onLoad) onLoad(texture, texData);\n\t\t\t}, onProgress, onError);\n\t\t\treturn texture;\n\t\t}\n\n\t}\n\n\tclass TextureLoader extends Loader {\n\t\tconstructor(manager) {\n\t\t\tsuper(manager);\n\t\t}\n\n\t\tload(url, onLoad, onProgress, onError) {\n\t\t\tconst texture = new Texture();\n\t\t\tconst loader = new ImageLoader(this.manager);\n\t\t\tloader.setCrossOrigin(this.crossOrigin);\n\t\t\tloader.setPath(this.path);\n\t\t\tloader.load(url, function (image) {\n\t\t\t\ttexture.image = image;\n\t\t\t\ttexture.needsUpdate = true;\n\n\t\t\t\tif (onLoad !== undefined) {\n\t\t\t\t\tonLoad(texture);\n\t\t\t\t}\n\t\t\t}, onProgress, onError);\n\t\t\treturn texture;\n\t\t}\n\n\t}\n\n\tclass Light extends Object3D {\n\t\tconstructor(color, intensity = 1) {\n\t\t\tsuper();\n\t\t\tthis.type = 'Light';\n\t\t\tthis.color = new Color(color);\n\t\t\tthis.intensity = intensity;\n\t\t}\n\n\t\tdispose() {// Empty here in base class; some subclasses override.\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.color.copy(source.color);\n\t\t\tthis.intensity = source.intensity;\n\t\t\treturn this;\n\t\t}\n\n\t\ttoJSON(meta) {\n\t\t\tconst data = super.toJSON(meta);\n\t\t\tdata.object.color = this.color.getHex();\n\t\t\tdata.object.intensity = this.intensity;\n\t\t\tif (this.groundColor !== undefined) data.object.groundColor = this.groundColor.getHex();\n\t\t\tif (this.distance !== undefined) data.object.distance = this.distance;\n\t\t\tif (this.angle !== undefined) data.object.angle = this.angle;\n\t\t\tif (this.decay !== undefined) data.object.decay = this.decay;\n\t\t\tif (this.penumbra !== undefined) data.object.penumbra = this.penumbra;\n\t\t\tif (this.shadow !== undefined) data.object.shadow = this.shadow.toJSON();\n\t\t\treturn data;\n\t\t}\n\n\t}\n\n\tLight.prototype.isLight = true;\n\n\tclass HemisphereLight extends Light {\n\t\tconstructor(skyColor, groundColor, intensity) {\n\t\t\tsuper(skyColor, intensity);\n\t\t\tthis.type = 'HemisphereLight';\n\t\t\tthis.position.copy(Object3D.DefaultUp);\n\t\t\tthis.updateMatrix();\n\t\t\tthis.groundColor = new Color(groundColor);\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tLight.prototype.copy.call(this, source);\n\t\t\tthis.groundColor.copy(source.groundColor);\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tHemisphereLight.prototype.isHemisphereLight = true;\n\n\tconst _projScreenMatrix$1 = /*@__PURE__*/new Matrix4();\n\n\tconst _lightPositionWorld$1 = /*@__PURE__*/new Vector3();\n\n\tconst _lookTarget$1 = /*@__PURE__*/new Vector3();\n\n\tclass LightShadow {\n\t\tconstructor(camera) {\n\t\t\tthis.camera = camera;\n\t\t\tthis.bias = 0;\n\t\t\tthis.normalBias = 0;\n\t\t\tthis.radius = 1;\n\t\t\tthis.blurSamples = 8;\n\t\t\tthis.mapSize = new Vector2(512, 512);\n\t\t\tthis.map = null;\n\t\t\tthis.mapPass = null;\n\t\t\tthis.matrix = new Matrix4();\n\t\t\tthis.autoUpdate = true;\n\t\t\tthis.needsUpdate = false;\n\t\t\tthis._frustum = new Frustum();\n\t\t\tthis._frameExtents = new Vector2(1, 1);\n\t\t\tthis._viewportCount = 1;\n\t\t\tthis._viewports = [new Vector4(0, 0, 1, 1)];\n\t\t}\n\n\t\tgetViewportCount() {\n\t\t\treturn this._viewportCount;\n\t\t}\n\n\t\tgetFrustum() {\n\t\t\treturn this._frustum;\n\t\t}\n\n\t\tupdateMatrices(light) {\n\t\t\tconst shadowCamera = this.camera;\n\t\t\tconst shadowMatrix = this.matrix;\n\n\t\t\t_lightPositionWorld$1.setFromMatrixPosition(light.matrixWorld);\n\n\t\t\tshadowCamera.position.copy(_lightPositionWorld$1);\n\n\t\t\t_lookTarget$1.setFromMatrixPosition(light.target.matrixWorld);\n\n\t\t\tshadowCamera.lookAt(_lookTarget$1);\n\t\t\tshadowCamera.updateMatrixWorld();\n\n\t\t\t_projScreenMatrix$1.multiplyMatrices(shadowCamera.projectionMatrix, shadowCamera.matrixWorldInverse);\n\n\t\t\tthis._frustum.setFromProjectionMatrix(_projScreenMatrix$1);\n\n\t\t\tshadowMatrix.set(0.5, 0.0, 0.0, 0.5, 0.0, 0.5, 0.0, 0.5, 0.0, 0.0, 0.5, 0.5, 0.0, 0.0, 0.0, 1.0);\n\t\t\tshadowMatrix.multiply(shadowCamera.projectionMatrix);\n\t\t\tshadowMatrix.multiply(shadowCamera.matrixWorldInverse);\n\t\t}\n\n\t\tgetViewport(viewportIndex) {\n\t\t\treturn this._viewports[viewportIndex];\n\t\t}\n\n\t\tgetFrameExtents() {\n\t\t\treturn this._frameExtents;\n\t\t}\n\n\t\tdispose() {\n\t\t\tif (this.map) {\n\t\t\t\tthis.map.dispose();\n\t\t\t}\n\n\t\t\tif (this.mapPass) {\n\t\t\t\tthis.mapPass.dispose();\n\t\t\t}\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tthis.camera = source.camera.clone();\n\t\t\tthis.bias = source.bias;\n\t\t\tthis.radius = source.radius;\n\t\t\tthis.mapSize.copy(source.mapSize);\n\t\t\treturn this;\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new this.constructor().copy(this);\n\t\t}\n\n\t\ttoJSON() {\n\t\t\tconst object = {};\n\t\t\tif (this.bias !== 0) object.bias = this.bias;\n\t\t\tif (this.normalBias !== 0) object.normalBias = this.normalBias;\n\t\t\tif (this.radius !== 1) object.radius = this.radius;\n\t\t\tif (this.mapSize.x !== 512 || this.mapSize.y !== 512) object.mapSize = this.mapSize.toArray();\n\t\t\tobject.camera = this.camera.toJSON(false).object;\n\t\t\tdelete object.camera.matrix;\n\t\t\treturn object;\n\t\t}\n\n\t}\n\n\tclass SpotLightShadow extends LightShadow {\n\t\tconstructor() {\n\t\t\tsuper(new PerspectiveCamera(50, 1, 0.5, 500));\n\t\t\tthis.focus = 1;\n\t\t}\n\n\t\tupdateMatrices(light) {\n\t\t\tconst camera = this.camera;\n\t\t\tconst fov = RAD2DEG * 2 * light.angle * this.focus;\n\t\t\tconst aspect = this.mapSize.width / this.mapSize.height;\n\t\t\tconst far = light.distance || camera.far;\n\n\t\t\tif (fov !== camera.fov || aspect !== camera.aspect || far !== camera.far) {\n\t\t\t\tcamera.fov = fov;\n\t\t\t\tcamera.aspect = aspect;\n\t\t\t\tcamera.far = far;\n\t\t\t\tcamera.updateProjectionMatrix();\n\t\t\t}\n\n\t\t\tsuper.updateMatrices(light);\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.focus = source.focus;\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tSpotLightShadow.prototype.isSpotLightShadow = true;\n\n\tclass SpotLight extends Light {\n\t\tconstructor(color, intensity, distance = 0, angle = Math.PI / 3, penumbra = 0, decay = 1) {\n\t\t\tsuper(color, intensity);\n\t\t\tthis.type = 'SpotLight';\n\t\t\tthis.position.copy(Object3D.DefaultUp);\n\t\t\tthis.updateMatrix();\n\t\t\tthis.target = new Object3D();\n\t\t\tthis.distance = distance;\n\t\t\tthis.angle = angle;\n\t\t\tthis.penumbra = penumbra;\n\t\t\tthis.decay = decay; // for physically correct lights, should be 2.\n\n\t\t\tthis.shadow = new SpotLightShadow();\n\t\t}\n\n\t\tget power() {\n\t\t\t// compute the light's luminous power (in lumens) from its intensity (in candela)\n\t\t\t// by convention for a spotlight, luminous power (lm) = π * luminous intensity (cd)\n\t\t\treturn this.intensity * Math.PI;\n\t\t}\n\n\t\tset power(power) {\n\t\t\t// set the light's intensity (in candela) from the desired luminous power (in lumens)\n\t\t\tthis.intensity = power / Math.PI;\n\t\t}\n\n\t\tdispose() {\n\t\t\tthis.shadow.dispose();\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.distance = source.distance;\n\t\t\tthis.angle = source.angle;\n\t\t\tthis.penumbra = source.penumbra;\n\t\t\tthis.decay = source.decay;\n\t\t\tthis.target = source.target.clone();\n\t\t\tthis.shadow = source.shadow.clone();\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tSpotLight.prototype.isSpotLight = true;\n\n\tconst _projScreenMatrix = /*@__PURE__*/new Matrix4();\n\n\tconst _lightPositionWorld = /*@__PURE__*/new Vector3();\n\n\tconst _lookTarget = /*@__PURE__*/new Vector3();\n\n\tclass PointLightShadow extends LightShadow {\n\t\tconstructor() {\n\t\t\tsuper(new PerspectiveCamera(90, 1, 0.5, 500));\n\t\t\tthis._frameExtents = new Vector2(4, 2);\n\t\t\tthis._viewportCount = 6;\n\t\t\tthis._viewports = [// These viewports map a cube-map onto a 2D texture with the\n\t\t\t// following orientation:\n\t\t\t//\n\t\t\t//\txzXZ\n\t\t\t//\t y Y\n\t\t\t//\n\t\t\t// X - Positive x direction\n\t\t\t// x - Negative x direction\n\t\t\t// Y - Positive y direction\n\t\t\t// y - Negative y direction\n\t\t\t// Z - Positive z direction\n\t\t\t// z - Negative z direction\n\t\t\t// positive X\n\t\t\tnew Vector4(2, 1, 1, 1), // negative X\n\t\t\tnew Vector4(0, 1, 1, 1), // positive Z\n\t\t\tnew Vector4(3, 1, 1, 1), // negative Z\n\t\t\tnew Vector4(1, 1, 1, 1), // positive Y\n\t\t\tnew Vector4(3, 0, 1, 1), // negative Y\n\t\t\tnew Vector4(1, 0, 1, 1)];\n\t\t\tthis._cubeDirections = [new Vector3(1, 0, 0), new Vector3(-1, 0, 0), new Vector3(0, 0, 1), new Vector3(0, 0, -1), new Vector3(0, 1, 0), new Vector3(0, -1, 0)];\n\t\t\tthis._cubeUps = [new Vector3(0, 1, 0), new Vector3(0, 1, 0), new Vector3(0, 1, 0), new Vector3(0, 1, 0), new Vector3(0, 0, 1), new Vector3(0, 0, -1)];\n\t\t}\n\n\t\tupdateMatrices(light, viewportIndex = 0) {\n\t\t\tconst camera = this.camera;\n\t\t\tconst shadowMatrix = this.matrix;\n\t\t\tconst far = light.distance || camera.far;\n\n\t\t\tif (far !== camera.far) {\n\t\t\t\tcamera.far = far;\n\t\t\t\tcamera.updateProjectionMatrix();\n\t\t\t}\n\n\t\t\t_lightPositionWorld.setFromMatrixPosition(light.matrixWorld);\n\n\t\t\tcamera.position.copy(_lightPositionWorld);\n\n\t\t\t_lookTarget.copy(camera.position);\n\n\t\t\t_lookTarget.add(this._cubeDirections[viewportIndex]);\n\n\t\t\tcamera.up.copy(this._cubeUps[viewportIndex]);\n\t\t\tcamera.lookAt(_lookTarget);\n\t\t\tcamera.updateMatrixWorld();\n\t\t\tshadowMatrix.makeTranslation(-_lightPositionWorld.x, -_lightPositionWorld.y, -_lightPositionWorld.z);\n\n\t\t\t_projScreenMatrix.multiplyMatrices(camera.projectionMatrix, camera.matrixWorldInverse);\n\n\t\t\tthis._frustum.setFromProjectionMatrix(_projScreenMatrix);\n\t\t}\n\n\t}\n\n\tPointLightShadow.prototype.isPointLightShadow = true;\n\n\tclass PointLight extends Light {\n\t\tconstructor(color, intensity, distance = 0, decay = 1) {\n\t\t\tsuper(color, intensity);\n\t\t\tthis.type = 'PointLight';\n\t\t\tthis.distance = distance;\n\t\t\tthis.decay = decay; // for physically correct lights, should be 2.\n\n\t\t\tthis.shadow = new PointLightShadow();\n\t\t}\n\n\t\tget power() {\n\t\t\t// compute the light's luminous power (in lumens) from its intensity (in candela)\n\t\t\t// for an isotropic light source, luminous power (lm) = 4 π luminous intensity (cd)\n\t\t\treturn this.intensity * 4 * Math.PI;\n\t\t}\n\n\t\tset power(power) {\n\t\t\t// set the light's intensity (in candela) from the desired luminous power (in lumens)\n\t\t\tthis.intensity = power / (4 * Math.PI);\n\t\t}\n\n\t\tdispose() {\n\t\t\tthis.shadow.dispose();\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.distance = source.distance;\n\t\t\tthis.decay = source.decay;\n\t\t\tthis.shadow = source.shadow.clone();\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tPointLight.prototype.isPointLight = true;\n\n\tclass DirectionalLightShadow extends LightShadow {\n\t\tconstructor() {\n\t\t\tsuper(new OrthographicCamera(-5, 5, 5, -5, 0.5, 500));\n\t\t}\n\n\t}\n\n\tDirectionalLightShadow.prototype.isDirectionalLightShadow = true;\n\n\tclass DirectionalLight extends Light {\n\t\tconstructor(color, intensity) {\n\t\t\tsuper(color, intensity);\n\t\t\tthis.type = 'DirectionalLight';\n\t\t\tthis.position.copy(Object3D.DefaultUp);\n\t\t\tthis.updateMatrix();\n\t\t\tthis.target = new Object3D();\n\t\t\tthis.shadow = new DirectionalLightShadow();\n\t\t}\n\n\t\tdispose() {\n\t\t\tthis.shadow.dispose();\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.target = source.target.clone();\n\t\t\tthis.shadow = source.shadow.clone();\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tDirectionalLight.prototype.isDirectionalLight = true;\n\n\tclass AmbientLight extends Light {\n\t\tconstructor(color, intensity) {\n\t\t\tsuper(color, intensity);\n\t\t\tthis.type = 'AmbientLight';\n\t\t}\n\n\t}\n\n\tAmbientLight.prototype.isAmbientLight = true;\n\n\tclass RectAreaLight extends Light {\n\t\tconstructor(color, intensity, width = 10, height = 10) {\n\t\t\tsuper(color, intensity);\n\t\t\tthis.type = 'RectAreaLight';\n\t\t\tthis.width = width;\n\t\t\tthis.height = height;\n\t\t}\n\n\t\tget power() {\n\t\t\t// compute the light's luminous power (in lumens) from its intensity (in nits)\n\t\t\treturn this.intensity * this.width * this.height * Math.PI;\n\t\t}\n\n\t\tset power(power) {\n\t\t\t// set the light's intensity (in nits) from the desired luminous power (in lumens)\n\t\t\tthis.intensity = power / (this.width * this.height * Math.PI);\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.width = source.width;\n\t\t\tthis.height = source.height;\n\t\t\treturn this;\n\t\t}\n\n\t\ttoJSON(meta) {\n\t\t\tconst data = super.toJSON(meta);\n\t\t\tdata.object.width = this.width;\n\t\t\tdata.object.height = this.height;\n\t\t\treturn data;\n\t\t}\n\n\t}\n\n\tRectAreaLight.prototype.isRectAreaLight = true;\n\n\t/**\n\t * Primary reference:\n\t *\t https://graphics.stanford.edu/papers/envmap/envmap.pdf\n\t *\n\t * Secondary reference:\n\t *\t https://www.ppsloan.org/publications/StupidSH36.pdf\n\t */\n\t// 3-band SH defined by 9 coefficients\n\n\tclass SphericalHarmonics3 {\n\t\tconstructor() {\n\t\t\tthis.coefficients = [];\n\n\t\t\tfor (let i = 0; i < 9; i++) {\n\t\t\t\tthis.coefficients.push(new Vector3());\n\t\t\t}\n\t\t}\n\n\t\tset(coefficients) {\n\t\t\tfor (let i = 0; i < 9; i++) {\n\t\t\t\tthis.coefficients[i].copy(coefficients[i]);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tzero() {\n\t\t\tfor (let i = 0; i < 9; i++) {\n\t\t\t\tthis.coefficients[i].set(0, 0, 0);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t} // get the radiance in the direction of the normal\n\t\t// target is a Vector3\n\n\n\t\tgetAt(normal, target) {\n\t\t\t// normal is assumed to be unit length\n\t\t\tconst x = normal.x,\n\t\t\t\t\t\ty = normal.y,\n\t\t\t\t\t\tz = normal.z;\n\t\t\tconst coeff = this.coefficients; // band 0\n\n\t\t\ttarget.copy(coeff[0]).multiplyScalar(0.282095); // band 1\n\n\t\t\ttarget.addScaledVector(coeff[1], 0.488603 * y);\n\t\t\ttarget.addScaledVector(coeff[2], 0.488603 * z);\n\t\t\ttarget.addScaledVector(coeff[3], 0.488603 * x); // band 2\n\n\t\t\ttarget.addScaledVector(coeff[4], 1.092548 * (x * y));\n\t\t\ttarget.addScaledVector(coeff[5], 1.092548 * (y * z));\n\t\t\ttarget.addScaledVector(coeff[6], 0.315392 * (3.0 * z * z - 1.0));\n\t\t\ttarget.addScaledVector(coeff[7], 1.092548 * (x * z));\n\t\t\ttarget.addScaledVector(coeff[8], 0.546274 * (x * x - y * y));\n\t\t\treturn target;\n\t\t} // get the irradiance (radiance convolved with cosine lobe) in the direction of the normal\n\t\t// target is a Vector3\n\t\t// https://graphics.stanford.edu/papers/envmap/envmap.pdf\n\n\n\t\tgetIrradianceAt(normal, target) {\n\t\t\t// normal is assumed to be unit length\n\t\t\tconst x = normal.x,\n\t\t\t\t\t\ty = normal.y,\n\t\t\t\t\t\tz = normal.z;\n\t\t\tconst coeff = this.coefficients; // band 0\n\n\t\t\ttarget.copy(coeff[0]).multiplyScalar(0.886227); // π * 0.282095\n\t\t\t// band 1\n\n\t\t\ttarget.addScaledVector(coeff[1], 2.0 * 0.511664 * y); // ( 2 * π / 3 ) * 0.488603\n\n\t\t\ttarget.addScaledVector(coeff[2], 2.0 * 0.511664 * z);\n\t\t\ttarget.addScaledVector(coeff[3], 2.0 * 0.511664 * x); // band 2\n\n\t\t\ttarget.addScaledVector(coeff[4], 2.0 * 0.429043 * x * y); // ( π / 4 ) * 1.092548\n\n\t\t\ttarget.addScaledVector(coeff[5], 2.0 * 0.429043 * y * z);\n\t\t\ttarget.addScaledVector(coeff[6], 0.743125 * z * z - 0.247708); // ( π / 4 ) * 0.315392 * 3\n\n\t\t\ttarget.addScaledVector(coeff[7], 2.0 * 0.429043 * x * z);\n\t\t\ttarget.addScaledVector(coeff[8], 0.429043 * (x * x - y * y)); // ( π / 4 ) * 0.546274\n\n\t\t\treturn target;\n\t\t}\n\n\t\tadd(sh) {\n\t\t\tfor (let i = 0; i < 9; i++) {\n\t\t\t\tthis.coefficients[i].add(sh.coefficients[i]);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\taddScaledSH(sh, s) {\n\t\t\tfor (let i = 0; i < 9; i++) {\n\t\t\t\tthis.coefficients[i].addScaledVector(sh.coefficients[i], s);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tscale(s) {\n\t\t\tfor (let i = 0; i < 9; i++) {\n\t\t\t\tthis.coefficients[i].multiplyScalar(s);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tlerp(sh, alpha) {\n\t\t\tfor (let i = 0; i < 9; i++) {\n\t\t\t\tthis.coefficients[i].lerp(sh.coefficients[i], alpha);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tequals(sh) {\n\t\t\tfor (let i = 0; i < 9; i++) {\n\t\t\t\tif (!this.coefficients[i].equals(sh.coefficients[i])) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tcopy(sh) {\n\t\t\treturn this.set(sh.coefficients);\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new this.constructor().copy(this);\n\t\t}\n\n\t\tfromArray(array, offset = 0) {\n\t\t\tconst coefficients = this.coefficients;\n\n\t\t\tfor (let i = 0; i < 9; i++) {\n\t\t\t\tcoefficients[i].fromArray(array, offset + i * 3);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\ttoArray(array = [], offset = 0) {\n\t\t\tconst coefficients = this.coefficients;\n\n\t\t\tfor (let i = 0; i < 9; i++) {\n\t\t\t\tcoefficients[i].toArray(array, offset + i * 3);\n\t\t\t}\n\n\t\t\treturn array;\n\t\t} // evaluate the basis functions\n\t\t// shBasis is an Array[ 9 ]\n\n\n\t\tstatic getBasisAt(normal, shBasis) {\n\t\t\t// normal is assumed to be unit length\n\t\t\tconst x = normal.x,\n\t\t\t\t\t\ty = normal.y,\n\t\t\t\t\t\tz = normal.z; // band 0\n\n\t\t\tshBasis[0] = 0.282095; // band 1\n\n\t\t\tshBasis[1] = 0.488603 * y;\n\t\t\tshBasis[2] = 0.488603 * z;\n\t\t\tshBasis[3] = 0.488603 * x; // band 2\n\n\t\t\tshBasis[4] = 1.092548 * x * y;\n\t\t\tshBasis[5] = 1.092548 * y * z;\n\t\t\tshBasis[6] = 0.315392 * (3 * z * z - 1);\n\t\t\tshBasis[7] = 1.092548 * x * z;\n\t\t\tshBasis[8] = 0.546274 * (x * x - y * y);\n\t\t}\n\n\t}\n\n\tSphericalHarmonics3.prototype.isSphericalHarmonics3 = true;\n\n\tclass LightProbe extends Light {\n\t\tconstructor(sh = new SphericalHarmonics3(), intensity = 1) {\n\t\t\tsuper(undefined, intensity);\n\t\t\tthis.sh = sh;\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.sh.copy(source.sh);\n\t\t\treturn this;\n\t\t}\n\n\t\tfromJSON(json) {\n\t\t\tthis.intensity = json.intensity; // TODO: Move this bit to Light.fromJSON();\n\n\t\t\tthis.sh.fromArray(json.sh);\n\t\t\treturn this;\n\t\t}\n\n\t\ttoJSON(meta) {\n\t\t\tconst data = super.toJSON(meta);\n\t\t\tdata.object.sh = this.sh.toArray();\n\t\t\treturn data;\n\t\t}\n\n\t}\n\n\tLightProbe.prototype.isLightProbe = true;\n\n\tclass MaterialLoader extends Loader {\n\t\tconstructor(manager) {\n\t\t\tsuper(manager);\n\t\t\tthis.textures = {};\n\t\t}\n\n\t\tload(url, onLoad, onProgress, onError) {\n\t\t\tconst scope = this;\n\t\t\tconst loader = new FileLoader(scope.manager);\n\t\t\tloader.setPath(scope.path);\n\t\t\tloader.setRequestHeader(scope.requestHeader);\n\t\t\tloader.setWithCredentials(scope.withCredentials);\n\t\t\tloader.load(url, function (text) {\n\t\t\t\ttry {\n\t\t\t\t\tonLoad(scope.parse(JSON.parse(text)));\n\t\t\t\t} catch (e) {\n\t\t\t\t\tif (onError) {\n\t\t\t\t\t\tonError(e);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconsole.error(e);\n\t\t\t\t\t}\n\n\t\t\t\t\tscope.manager.itemError(url);\n\t\t\t\t}\n\t\t\t}, onProgress, onError);\n\t\t}\n\n\t\tparse(json) {\n\t\t\tconst textures = this.textures;\n\n\t\t\tfunction getTexture(name) {\n\t\t\t\tif (textures[name] === undefined) {\n\t\t\t\t\tconsole.warn('THREE.MaterialLoader: Undefined texture', name);\n\t\t\t\t}\n\n\t\t\t\treturn textures[name];\n\t\t\t}\n\n\t\t\tconst material = new Materials[json.type]();\n\t\t\tif (json.uuid !== undefined) material.uuid = json.uuid;\n\t\t\tif (json.name !== undefined) material.name = json.name;\n\t\t\tif (json.color !== undefined && material.color !== undefined) material.color.setHex(json.color);\n\t\t\tif (json.roughness !== undefined) material.roughness = json.roughness;\n\t\t\tif (json.metalness !== undefined) material.metalness = json.metalness;\n\t\t\tif (json.sheen !== undefined) material.sheen = json.sheen;\n\t\t\tif (json.sheenTint !== undefined) material.sheenTint = new Color().setHex(json.sheenTint);\n\t\t\tif (json.sheenRoughness !== undefined) material.sheenRoughness = json.sheenRoughness;\n\t\t\tif (json.emissive !== undefined && material.emissive !== undefined) material.emissive.setHex(json.emissive);\n\t\t\tif (json.specular !== undefined && material.specular !== undefined) material.specular.setHex(json.specular);\n\t\t\tif (json.specularIntensity !== undefined) material.specularIntensity = json.specularIntensity;\n\t\t\tif (json.specularTint !== undefined && material.specularTint !== undefined) material.specularTint.setHex(json.specularTint);\n\t\t\tif (json.shininess !== undefined) material.shininess = json.shininess;\n\t\t\tif (json.clearcoat !== undefined) material.clearcoat = json.clearcoat;\n\t\t\tif (json.clearcoatRoughness !== undefined) material.clearcoatRoughness = json.clearcoatRoughness;\n\t\t\tif (json.transmission !== undefined) material.transmission = json.transmission;\n\t\t\tif (json.thickness !== undefined) material.thickness = json.thickness;\n\t\t\tif (json.attenuationDistance !== undefined) material.attenuationDistance = json.attenuationDistance;\n\t\t\tif (json.attenuationTint !== undefined && material.attenuationTint !== undefined) material.attenuationTint.setHex(json.attenuationTint);\n\t\t\tif (json.fog !== undefined) material.fog = json.fog;\n\t\t\tif (json.flatShading !== undefined) material.flatShading = json.flatShading;\n\t\t\tif (json.blending !== undefined) material.blending = json.blending;\n\t\t\tif (json.combine !== undefined) material.combine = json.combine;\n\t\t\tif (json.side !== undefined) material.side = json.side;\n\t\t\tif (json.shadowSide !== undefined) material.shadowSide = json.shadowSide;\n\t\t\tif (json.opacity !== undefined) material.opacity = json.opacity;\n\t\t\tif (json.format !== undefined) material.format = json.format;\n\t\t\tif (json.transparent !== undefined) material.transparent = json.transparent;\n\t\t\tif (json.alphaTest !== undefined) material.alphaTest = json.alphaTest;\n\t\t\tif (json.depthTest !== undefined) material.depthTest = json.depthTest;\n\t\t\tif (json.depthWrite !== undefined) material.depthWrite = json.depthWrite;\n\t\t\tif (json.colorWrite !== undefined) material.colorWrite = json.colorWrite;\n\t\t\tif (json.stencilWrite !== undefined) material.stencilWrite = json.stencilWrite;\n\t\t\tif (json.stencilWriteMask !== undefined) material.stencilWriteMask = json.stencilWriteMask;\n\t\t\tif (json.stencilFunc !== undefined) material.stencilFunc = json.stencilFunc;\n\t\t\tif (json.stencilRef !== undefined) material.stencilRef = json.stencilRef;\n\t\t\tif (json.stencilFuncMask !== undefined) material.stencilFuncMask = json.stencilFuncMask;\n\t\t\tif (json.stencilFail !== undefined) material.stencilFail = json.stencilFail;\n\t\t\tif (json.stencilZFail !== undefined) material.stencilZFail = json.stencilZFail;\n\t\t\tif (json.stencilZPass !== undefined) material.stencilZPass = json.stencilZPass;\n\t\t\tif (json.wireframe !== undefined) material.wireframe = json.wireframe;\n\t\t\tif (json.wireframeLinewidth !== undefined) material.wireframeLinewidth = json.wireframeLinewidth;\n\t\t\tif (json.wireframeLinecap !== undefined) material.wireframeLinecap = json.wireframeLinecap;\n\t\t\tif (json.wireframeLinejoin !== undefined) material.wireframeLinejoin = json.wireframeLinejoin;\n\t\t\tif (json.rotation !== undefined) material.rotation = json.rotation;\n\t\t\tif (json.linewidth !== 1) material.linewidth = json.linewidth;\n\t\t\tif (json.dashSize !== undefined) material.dashSize = json.dashSize;\n\t\t\tif (json.gapSize !== undefined) material.gapSize = json.gapSize;\n\t\t\tif (json.scale !== undefined) material.scale = json.scale;\n\t\t\tif (json.polygonOffset !== undefined) material.polygonOffset = json.polygonOffset;\n\t\t\tif (json.polygonOffsetFactor !== undefined) material.polygonOffsetFactor = json.polygonOffsetFactor;\n\t\t\tif (json.polygonOffsetUnits !== undefined) material.polygonOffsetUnits = json.polygonOffsetUnits;\n\t\t\tif (json.dithering !== undefined) material.dithering = json.dithering;\n\t\t\tif (json.alphaToCoverage !== undefined) material.alphaToCoverage = json.alphaToCoverage;\n\t\t\tif (json.premultipliedAlpha !== undefined) material.premultipliedAlpha = json.premultipliedAlpha;\n\t\t\tif (json.visible !== undefined) material.visible = json.visible;\n\t\t\tif (json.toneMapped !== undefined) material.toneMapped = json.toneMapped;\n\t\t\tif (json.userData !== undefined) material.userData = json.userData;\n\n\t\t\tif (json.vertexColors !== undefined) {\n\t\t\t\tif (typeof json.vertexColors === 'number') {\n\t\t\t\t\tmaterial.vertexColors = json.vertexColors > 0 ? true : false;\n\t\t\t\t} else {\n\t\t\t\t\tmaterial.vertexColors = json.vertexColors;\n\t\t\t\t}\n\t\t\t} // Shader Material\n\n\n\t\t\tif (json.uniforms !== undefined) {\n\t\t\t\tfor (const name in json.uniforms) {\n\t\t\t\t\tconst uniform = json.uniforms[name];\n\t\t\t\t\tmaterial.uniforms[name] = {};\n\n\t\t\t\t\tswitch (uniform.type) {\n\t\t\t\t\t\tcase 't':\n\t\t\t\t\t\t\tmaterial.uniforms[name].value = getTexture(uniform.value);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'c':\n\t\t\t\t\t\t\tmaterial.uniforms[name].value = new Color().setHex(uniform.value);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'v2':\n\t\t\t\t\t\t\tmaterial.uniforms[name].value = new Vector2().fromArray(uniform.value);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'v3':\n\t\t\t\t\t\t\tmaterial.uniforms[name].value = new Vector3().fromArray(uniform.value);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'v4':\n\t\t\t\t\t\t\tmaterial.uniforms[name].value = new Vector4().fromArray(uniform.value);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'm3':\n\t\t\t\t\t\t\tmaterial.uniforms[name].value = new Matrix3().fromArray(uniform.value);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'm4':\n\t\t\t\t\t\t\tmaterial.uniforms[name].value = new Matrix4().fromArray(uniform.value);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tmaterial.uniforms[name].value = uniform.value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (json.defines !== undefined) material.defines = json.defines;\n\t\t\tif (json.vertexShader !== undefined) material.vertexShader = json.vertexShader;\n\t\t\tif (json.fragmentShader !== undefined) material.fragmentShader = json.fragmentShader;\n\n\t\t\tif (json.extensions !== undefined) {\n\t\t\t\tfor (const key in json.extensions) {\n\t\t\t\t\tmaterial.extensions[key] = json.extensions[key];\n\t\t\t\t}\n\t\t\t} // Deprecated\n\n\n\t\t\tif (json.shading !== undefined) material.flatShading = json.shading === 1; // THREE.FlatShading\n\t\t\t// for PointsMaterial\n\n\t\t\tif (json.size !== undefined) material.size = json.size;\n\t\t\tif (json.sizeAttenuation !== undefined) material.sizeAttenuation = json.sizeAttenuation; // maps\n\n\t\t\tif (json.map !== undefined) material.map = getTexture(json.map);\n\t\t\tif (json.matcap !== undefined) material.matcap = getTexture(json.matcap);\n\t\t\tif (json.alphaMap !== undefined) material.alphaMap = getTexture(json.alphaMap);\n\t\t\tif (json.bumpMap !== undefined) material.bumpMap = getTexture(json.bumpMap);\n\t\t\tif (json.bumpScale !== undefined) material.bumpScale = json.bumpScale;\n\t\t\tif (json.normalMap !== undefined) material.normalMap = getTexture(json.normalMap);\n\t\t\tif (json.normalMapType !== undefined) material.normalMapType = json.normalMapType;\n\n\t\t\tif (json.normalScale !== undefined) {\n\t\t\t\tlet normalScale = json.normalScale;\n\n\t\t\t\tif (Array.isArray(normalScale) === false) {\n\t\t\t\t\t// Blender exporter used to export a scalar. See #7459\n\t\t\t\t\tnormalScale = [normalScale, normalScale];\n\t\t\t\t}\n\n\t\t\t\tmaterial.normalScale = new Vector2().fromArray(normalScale);\n\t\t\t}\n\n\t\t\tif (json.displacementMap !== undefined) material.displacementMap = getTexture(json.displacementMap);\n\t\t\tif (json.displacementScale !== undefined) material.displacementScale = json.displacementScale;\n\t\t\tif (json.displacementBias !== undefined) material.displacementBias = json.displacementBias;\n\t\t\tif (json.roughnessMap !== undefined) material.roughnessMap = getTexture(json.roughnessMap);\n\t\t\tif (json.metalnessMap !== undefined) material.metalnessMap = getTexture(json.metalnessMap);\n\t\t\tif (json.emissiveMap !== undefined) material.emissiveMap = getTexture(json.emissiveMap);\n\t\t\tif (json.emissiveIntensity !== undefined) material.emissiveIntensity = json.emissiveIntensity;\n\t\t\tif (json.specularMap !== undefined) material.specularMap = getTexture(json.specularMap);\n\t\t\tif (json.specularIntensityMap !== undefined) material.specularIntensityMap = getTexture(json.specularIntensityMap);\n\t\t\tif (json.specularTintMap !== undefined) material.specularTintMap = getTexture(json.specularTintMap);\n\t\t\tif (json.envMap !== undefined) material.envMap = getTexture(json.envMap);\n\t\t\tif (json.envMapIntensity !== undefined) material.envMapIntensity = json.envMapIntensity;\n\t\t\tif (json.reflectivity !== undefined) material.reflectivity = json.reflectivity;\n\t\t\tif (json.refractionRatio !== undefined) material.refractionRatio = json.refractionRatio;\n\t\t\tif (json.lightMap !== undefined) material.lightMap = getTexture(json.lightMap);\n\t\t\tif (json.lightMapIntensity !== undefined) material.lightMapIntensity = json.lightMapIntensity;\n\t\t\tif (json.aoMap !== undefined) material.aoMap = getTexture(json.aoMap);\n\t\t\tif (json.aoMapIntensity !== undefined) material.aoMapIntensity = json.aoMapIntensity;\n\t\t\tif (json.gradientMap !== undefined) material.gradientMap = getTexture(json.gradientMap);\n\t\t\tif (json.clearcoatMap !== undefined) material.clearcoatMap = getTexture(json.clearcoatMap);\n\t\t\tif (json.clearcoatRoughnessMap !== undefined) material.clearcoatRoughnessMap = getTexture(json.clearcoatRoughnessMap);\n\t\t\tif (json.clearcoatNormalMap !== undefined) material.clearcoatNormalMap = getTexture(json.clearcoatNormalMap);\n\t\t\tif (json.clearcoatNormalScale !== undefined) material.clearcoatNormalScale = new Vector2().fromArray(json.clearcoatNormalScale);\n\t\t\tif (json.transmissionMap !== undefined) material.transmissionMap = getTexture(json.transmissionMap);\n\t\t\tif (json.thicknessMap !== undefined) material.thicknessMap = getTexture(json.thicknessMap);\n\t\t\treturn material;\n\t\t}\n\n\t\tsetTextures(value) {\n\t\t\tthis.textures = value;\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tclass LoaderUtils {\n\t\tstatic decodeText(array) {\n\t\t\tif (typeof TextDecoder !== 'undefined') {\n\t\t\t\treturn new TextDecoder().decode(array);\n\t\t\t} // Avoid the String.fromCharCode.apply(null, array) shortcut, which\n\t\t\t// throws a \"maximum call stack size exceeded\" error for large arrays.\n\n\n\t\t\tlet s = '';\n\n\t\t\tfor (let i = 0, il = array.length; i < il; i++) {\n\t\t\t\t// Implicitly assumes little-endian.\n\t\t\t\ts += String.fromCharCode(array[i]);\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\t// merges multi-byte utf-8 characters.\n\t\t\t\treturn decodeURIComponent(escape(s));\n\t\t\t} catch (e) {\n\t\t\t\t// see #16358\n\t\t\t\treturn s;\n\t\t\t}\n\t\t}\n\n\t\tstatic extractUrlBase(url) {\n\t\t\tconst index = url.lastIndexOf('/');\n\t\t\tif (index === -1) return './';\n\t\t\treturn url.substr(0, index + 1);\n\t\t}\n\n\t}\n\n\tclass InstancedBufferGeometry extends BufferGeometry {\n\t\tconstructor() {\n\t\t\tsuper();\n\t\t\tthis.type = 'InstancedBufferGeometry';\n\t\t\tthis.instanceCount = Infinity;\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.instanceCount = source.instanceCount;\n\t\t\treturn this;\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new this.constructor().copy(this);\n\t\t}\n\n\t\ttoJSON() {\n\t\t\tconst data = super.toJSON(this);\n\t\t\tdata.instanceCount = this.instanceCount;\n\t\t\tdata.isInstancedBufferGeometry = true;\n\t\t\treturn data;\n\t\t}\n\n\t}\n\n\tInstancedBufferGeometry.prototype.isInstancedBufferGeometry = true;\n\n\tclass BufferGeometryLoader extends Loader {\n\t\tconstructor(manager) {\n\t\t\tsuper(manager);\n\t\t}\n\n\t\tload(url, onLoad, onProgress, onError) {\n\t\t\tconst scope = this;\n\t\t\tconst loader = new FileLoader(scope.manager);\n\t\t\tloader.setPath(scope.path);\n\t\t\tloader.setRequestHeader(scope.requestHeader);\n\t\t\tloader.setWithCredentials(scope.withCredentials);\n\t\t\tloader.load(url, function (text) {\n\t\t\t\ttry {\n\t\t\t\t\tonLoad(scope.parse(JSON.parse(text)));\n\t\t\t\t} catch (e) {\n\t\t\t\t\tif (onError) {\n\t\t\t\t\t\tonError(e);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconsole.error(e);\n\t\t\t\t\t}\n\n\t\t\t\t\tscope.manager.itemError(url);\n\t\t\t\t}\n\t\t\t}, onProgress, onError);\n\t\t}\n\n\t\tparse(json) {\n\t\t\tconst interleavedBufferMap = {};\n\t\t\tconst arrayBufferMap = {};\n\n\t\t\tfunction getInterleavedBuffer(json, uuid) {\n\t\t\t\tif (interleavedBufferMap[uuid] !== undefined) return interleavedBufferMap[uuid];\n\t\t\t\tconst interleavedBuffers = json.interleavedBuffers;\n\t\t\t\tconst interleavedBuffer = interleavedBuffers[uuid];\n\t\t\t\tconst buffer = getArrayBuffer(json, interleavedBuffer.buffer);\n\t\t\t\tconst array = getTypedArray(interleavedBuffer.type, buffer);\n\t\t\t\tconst ib = new InterleavedBuffer(array, interleavedBuffer.stride);\n\t\t\t\tib.uuid = interleavedBuffer.uuid;\n\t\t\t\tinterleavedBufferMap[uuid] = ib;\n\t\t\t\treturn ib;\n\t\t\t}\n\n\t\t\tfunction getArrayBuffer(json, uuid) {\n\t\t\t\tif (arrayBufferMap[uuid] !== undefined) return arrayBufferMap[uuid];\n\t\t\t\tconst arrayBuffers = json.arrayBuffers;\n\t\t\t\tconst arrayBuffer = arrayBuffers[uuid];\n\t\t\t\tconst ab = new Uint32Array(arrayBuffer).buffer;\n\t\t\t\tarrayBufferMap[uuid] = ab;\n\t\t\t\treturn ab;\n\t\t\t}\n\n\t\t\tconst geometry = json.isInstancedBufferGeometry ? new InstancedBufferGeometry() : new BufferGeometry();\n\t\t\tconst index = json.data.index;\n\n\t\t\tif (index !== undefined) {\n\t\t\t\tconst typedArray = getTypedArray(index.type, index.array);\n\t\t\t\tgeometry.setIndex(new BufferAttribute(typedArray, 1));\n\t\t\t}\n\n\t\t\tconst attributes = json.data.attributes;\n\n\t\t\tfor (const key in attributes) {\n\t\t\t\tconst attribute = attributes[key];\n\t\t\t\tlet bufferAttribute;\n\n\t\t\t\tif (attribute.isInterleavedBufferAttribute) {\n\t\t\t\t\tconst interleavedBuffer = getInterleavedBuffer(json.data, attribute.data);\n\t\t\t\t\tbufferAttribute = new InterleavedBufferAttribute(interleavedBuffer, attribute.itemSize, attribute.offset, attribute.normalized);\n\t\t\t\t} else {\n\t\t\t\t\tconst typedArray = getTypedArray(attribute.type, attribute.array);\n\t\t\t\t\tconst bufferAttributeConstr = attribute.isInstancedBufferAttribute ? InstancedBufferAttribute : BufferAttribute;\n\t\t\t\t\tbufferAttribute = new bufferAttributeConstr(typedArray, attribute.itemSize, attribute.normalized);\n\t\t\t\t}\n\n\t\t\t\tif (attribute.name !== undefined) bufferAttribute.name = attribute.name;\n\t\t\t\tif (attribute.usage !== undefined) bufferAttribute.setUsage(attribute.usage);\n\n\t\t\t\tif (attribute.updateRange !== undefined) {\n\t\t\t\t\tbufferAttribute.updateRange.offset = attribute.updateRange.offset;\n\t\t\t\t\tbufferAttribute.updateRange.count = attribute.updateRange.count;\n\t\t\t\t}\n\n\t\t\t\tgeometry.setAttribute(key, bufferAttribute);\n\t\t\t}\n\n\t\t\tconst morphAttributes = json.data.morphAttributes;\n\n\t\t\tif (morphAttributes) {\n\t\t\t\tfor (const key in morphAttributes) {\n\t\t\t\t\tconst attributeArray = morphAttributes[key];\n\t\t\t\t\tconst array = [];\n\n\t\t\t\t\tfor (let i = 0, il = attributeArray.length; i < il; i++) {\n\t\t\t\t\t\tconst attribute = attributeArray[i];\n\t\t\t\t\t\tlet bufferAttribute;\n\n\t\t\t\t\t\tif (attribute.isInterleavedBufferAttribute) {\n\t\t\t\t\t\t\tconst interleavedBuffer = getInterleavedBuffer(json.data, attribute.data);\n\t\t\t\t\t\t\tbufferAttribute = new InterleavedBufferAttribute(interleavedBuffer, attribute.itemSize, attribute.offset, attribute.normalized);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst typedArray = getTypedArray(attribute.type, attribute.array);\n\t\t\t\t\t\t\tbufferAttribute = new BufferAttribute(typedArray, attribute.itemSize, attribute.normalized);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (attribute.name !== undefined) bufferAttribute.name = attribute.name;\n\t\t\t\t\t\tarray.push(bufferAttribute);\n\t\t\t\t\t}\n\n\t\t\t\t\tgeometry.morphAttributes[key] = array;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst morphTargetsRelative = json.data.morphTargetsRelative;\n\n\t\t\tif (morphTargetsRelative) {\n\t\t\t\tgeometry.morphTargetsRelative = true;\n\t\t\t}\n\n\t\t\tconst groups = json.data.groups || json.data.drawcalls || json.data.offsets;\n\n\t\t\tif (groups !== undefined) {\n\t\t\t\tfor (let i = 0, n = groups.length; i !== n; ++i) {\n\t\t\t\t\tconst group = groups[i];\n\t\t\t\t\tgeometry.addGroup(group.start, group.count, group.materialIndex);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst boundingSphere = json.data.boundingSphere;\n\n\t\t\tif (boundingSphere !== undefined) {\n\t\t\t\tconst center = new Vector3();\n\n\t\t\t\tif (boundingSphere.center !== undefined) {\n\t\t\t\t\tcenter.fromArray(boundingSphere.center);\n\t\t\t\t}\n\n\t\t\t\tgeometry.boundingSphere = new Sphere(center, boundingSphere.radius);\n\t\t\t}\n\n\t\t\tif (json.name) geometry.name = json.name;\n\t\t\tif (json.userData) geometry.userData = json.userData;\n\t\t\treturn geometry;\n\t\t}\n\n\t}\n\n\tclass ObjectLoader extends Loader {\n\t\tconstructor(manager) {\n\t\t\tsuper(manager);\n\t\t}\n\n\t\tload(url, onLoad, onProgress, onError) {\n\t\t\tconst scope = this;\n\t\t\tconst path = this.path === '' ? LoaderUtils.extractUrlBase(url) : this.path;\n\t\t\tthis.resourcePath = this.resourcePath || path;\n\t\t\tconst loader = new FileLoader(this.manager);\n\t\t\tloader.setPath(this.path);\n\t\t\tloader.setRequestHeader(this.requestHeader);\n\t\t\tloader.setWithCredentials(this.withCredentials);\n\t\t\tloader.load(url, function (text) {\n\t\t\t\tlet json = null;\n\n\t\t\t\ttry {\n\t\t\t\t\tjson = JSON.parse(text);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (onError !== undefined) onError(error);\n\t\t\t\t\tconsole.error('THREE:ObjectLoader: Can\\'t parse ' + url + '.', error.message);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst metadata = json.metadata;\n\n\t\t\t\tif (metadata === undefined || metadata.type === undefined || metadata.type.toLowerCase() === 'geometry') {\n\t\t\t\t\tconsole.error('THREE.ObjectLoader: Can\\'t load ' + url);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tscope.parse(json, onLoad);\n\t\t\t}, onProgress, onError);\n\t\t}\n\n\t\tasync loadAsync(url, onProgress) {\n\t\t\tconst scope = this;\n\t\t\tconst path = this.path === '' ? LoaderUtils.extractUrlBase(url) : this.path;\n\t\t\tthis.resourcePath = this.resourcePath || path;\n\t\t\tconst loader = new FileLoader(this.manager);\n\t\t\tloader.setPath(this.path);\n\t\t\tloader.setRequestHeader(this.requestHeader);\n\t\t\tloader.setWithCredentials(this.withCredentials);\n\t\t\tconst text = await loader.loadAsync(url, onProgress);\n\t\t\tconst json = JSON.parse(text);\n\t\t\tconst metadata = json.metadata;\n\n\t\t\tif (metadata === undefined || metadata.type === undefined || metadata.type.toLowerCase() === 'geometry') {\n\t\t\t\tthrow new Error('THREE.ObjectLoader: Can\\'t load ' + url);\n\t\t\t}\n\n\t\t\treturn await scope.parseAsync(json);\n\t\t}\n\n\t\tparse(json, onLoad) {\n\t\t\tconst animations = this.parseAnimations(json.animations);\n\t\t\tconst shapes = this.parseShapes(json.shapes);\n\t\t\tconst geometries = this.parseGeometries(json.geometries, shapes);\n\t\t\tconst images = this.parseImages(json.images, function () {\n\t\t\t\tif (onLoad !== undefined) onLoad(object);\n\t\t\t});\n\t\t\tconst textures = this.parseTextures(json.textures, images);\n\t\t\tconst materials = this.parseMaterials(json.materials, textures);\n\t\t\tconst object = this.parseObject(json.object, geometries, materials, textures, animations);\n\t\t\tconst skeletons = this.parseSkeletons(json.skeletons, object);\n\t\t\tthis.bindSkeletons(object, skeletons); //\n\n\t\t\tif (onLoad !== undefined) {\n\t\t\t\tlet hasImages = false;\n\n\t\t\t\tfor (const uuid in images) {\n\t\t\t\t\tif (images[uuid] instanceof HTMLImageElement) {\n\t\t\t\t\t\thasImages = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (hasImages === false) onLoad(object);\n\t\t\t}\n\n\t\t\treturn object;\n\t\t}\n\n\t\tasync parseAsync(json) {\n\t\t\tconst animations = this.parseAnimations(json.animations);\n\t\t\tconst shapes = this.parseShapes(json.shapes);\n\t\t\tconst geometries = this.parseGeometries(json.geometries, shapes);\n\t\t\tconst images = await this.parseImagesAsync(json.images);\n\t\t\tconst textures = this.parseTextures(json.textures, images);\n\t\t\tconst materials = this.parseMaterials(json.materials, textures);\n\t\t\tconst object = this.parseObject(json.object, geometries, materials, textures, animations);\n\t\t\tconst skeletons = this.parseSkeletons(json.skeletons, object);\n\t\t\tthis.bindSkeletons(object, skeletons);\n\t\t\treturn object;\n\t\t}\n\n\t\tparseShapes(json) {\n\t\t\tconst shapes = {};\n\n\t\t\tif (json !== undefined) {\n\t\t\t\tfor (let i = 0, l = json.length; i < l; i++) {\n\t\t\t\t\tconst shape = new Shape().fromJSON(json[i]);\n\t\t\t\t\tshapes[shape.uuid] = shape;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn shapes;\n\t\t}\n\n\t\tparseSkeletons(json, object) {\n\t\t\tconst skeletons = {};\n\t\t\tconst bones = {}; // generate bone lookup table\n\n\t\t\tobject.traverse(function (child) {\n\t\t\t\tif (child.isBone) bones[child.uuid] = child;\n\t\t\t}); // create skeletons\n\n\t\t\tif (json !== undefined) {\n\t\t\t\tfor (let i = 0, l = json.length; i < l; i++) {\n\t\t\t\t\tconst skeleton = new Skeleton().fromJSON(json[i], bones);\n\t\t\t\t\tskeletons[skeleton.uuid] = skeleton;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn skeletons;\n\t\t}\n\n\t\tparseGeometries(json, shapes) {\n\t\t\tconst geometries = {};\n\n\t\t\tif (json !== undefined) {\n\t\t\t\tconst bufferGeometryLoader = new BufferGeometryLoader();\n\n\t\t\t\tfor (let i = 0, l = json.length; i < l; i++) {\n\t\t\t\t\tlet geometry;\n\t\t\t\t\tconst data = json[i];\n\n\t\t\t\t\tswitch (data.type) {\n\t\t\t\t\t\tcase 'BufferGeometry':\n\t\t\t\t\t\tcase 'InstancedBufferGeometry':\n\t\t\t\t\t\t\tgeometry = bufferGeometryLoader.parse(data);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'Geometry':\n\t\t\t\t\t\t\tif ('THREE' in window && 'LegacyJSONLoader' in THREE) {\n\t\t\t\t\t\t\t\tvar geometryLoader = new THREE.LegacyJSONLoader();\n\t\t\t\t\t\t\t\tgeometry = geometryLoader.parse(data, this.resourcePath).geometry;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tconsole.error('THREE.ObjectLoader: You have to import LegacyJSONLoader in order load geometry data of type \"Geometry\".');\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tif (data.type in Geometries) {\n\t\t\t\t\t\t\t\tgeometry = Geometries[data.type].fromJSON(data, shapes);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tconsole.warn(`THREE.ObjectLoader: Unsupported geometry type \"${data.type}\"`);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tgeometry.uuid = data.uuid;\n\t\t\t\t\tif (data.name !== undefined) geometry.name = data.name;\n\t\t\t\t\tif (geometry.isBufferGeometry === true && data.userData !== undefined) geometry.userData = data.userData;\n\t\t\t\t\tgeometries[data.uuid] = geometry;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn geometries;\n\t\t}\n\n\t\tparseMaterials(json, textures) {\n\t\t\tconst cache = {}; // MultiMaterial\n\n\t\t\tconst materials = {};\n\n\t\t\tif (json !== undefined) {\n\t\t\t\tconst loader = new MaterialLoader();\n\t\t\t\tloader.setTextures(textures);\n\n\t\t\t\tfor (let i = 0, l = json.length; i < l; i++) {\n\t\t\t\t\tconst data = json[i];\n\n\t\t\t\t\tif (data.type === 'MultiMaterial') {\n\t\t\t\t\t\t// Deprecated\n\t\t\t\t\t\tconst array = [];\n\n\t\t\t\t\t\tfor (let j = 0; j < data.materials.length; j++) {\n\t\t\t\t\t\t\tconst material = data.materials[j];\n\n\t\t\t\t\t\t\tif (cache[material.uuid] === undefined) {\n\t\t\t\t\t\t\t\tcache[material.uuid] = loader.parse(material);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tarray.push(cache[material.uuid]);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmaterials[data.uuid] = array;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (cache[data.uuid] === undefined) {\n\t\t\t\t\t\t\tcache[data.uuid] = loader.parse(data);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmaterials[data.uuid] = cache[data.uuid];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn materials;\n\t\t}\n\n\t\tparseAnimations(json) {\n\t\t\tconst animations = {};\n\n\t\t\tif (json !== undefined) {\n\t\t\t\tfor (let i = 0; i < json.length; i++) {\n\t\t\t\t\tconst data = json[i];\n\t\t\t\t\tconst clip = AnimationClip.parse(data);\n\t\t\t\t\tanimations[clip.uuid] = clip;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn animations;\n\t\t}\n\n\t\tparseImages(json, onLoad) {\n\t\t\tconst scope = this;\n\t\t\tconst images = {};\n\t\t\tlet loader;\n\n\t\t\tfunction loadImage(url) {\n\t\t\t\tscope.manager.itemStart(url);\n\t\t\t\treturn loader.load(url, function () {\n\t\t\t\t\tscope.manager.itemEnd(url);\n\t\t\t\t}, undefined, function () {\n\t\t\t\t\tscope.manager.itemError(url);\n\t\t\t\t\tscope.manager.itemEnd(url);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tfunction deserializeImage(image) {\n\t\t\t\tif (typeof image === 'string') {\n\t\t\t\t\tconst url = image;\n\t\t\t\t\tconst path = /^(\\/\\/)|([a-z]+:(\\/\\/)?)/i.test(url) ? url : scope.resourcePath + url;\n\t\t\t\t\treturn loadImage(path);\n\t\t\t\t} else {\n\t\t\t\t\tif (image.data) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tdata: getTypedArray(image.type, image.data),\n\t\t\t\t\t\t\twidth: image.width,\n\t\t\t\t\t\t\theight: image.height\n\t\t\t\t\t\t};\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (json !== undefined && json.length > 0) {\n\t\t\t\tconst manager = new LoadingManager(onLoad);\n\t\t\t\tloader = new ImageLoader(manager);\n\t\t\t\tloader.setCrossOrigin(this.crossOrigin);\n\n\t\t\t\tfor (let i = 0, il = json.length; i < il; i++) {\n\t\t\t\t\tconst image = json[i];\n\t\t\t\t\tconst url = image.url;\n\n\t\t\t\t\tif (Array.isArray(url)) {\n\t\t\t\t\t\t// load array of images e.g CubeTexture\n\t\t\t\t\t\timages[image.uuid] = [];\n\n\t\t\t\t\t\tfor (let j = 0, jl = url.length; j < jl; j++) {\n\t\t\t\t\t\t\tconst currentUrl = url[j];\n\t\t\t\t\t\t\tconst deserializedImage = deserializeImage(currentUrl);\n\n\t\t\t\t\t\t\tif (deserializedImage !== null) {\n\t\t\t\t\t\t\t\tif (deserializedImage instanceof HTMLImageElement) {\n\t\t\t\t\t\t\t\t\timages[image.uuid].push(deserializedImage);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t// special case: handle array of data textures for cube textures\n\t\t\t\t\t\t\t\t\timages[image.uuid].push(new DataTexture(deserializedImage.data, deserializedImage.width, deserializedImage.height));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// load single image\n\t\t\t\t\t\tconst deserializedImage = deserializeImage(image.url);\n\n\t\t\t\t\t\tif (deserializedImage !== null) {\n\t\t\t\t\t\t\timages[image.uuid] = deserializedImage;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn images;\n\t\t}\n\n\t\tasync parseImagesAsync(json) {\n\t\t\tconst scope = this;\n\t\t\tconst images = {};\n\t\t\tlet loader;\n\n\t\t\tasync function deserializeImage(image) {\n\t\t\t\tif (typeof image === 'string') {\n\t\t\t\t\tconst url = image;\n\t\t\t\t\tconst path = /^(\\/\\/)|([a-z]+:(\\/\\/)?)/i.test(url) ? url : scope.resourcePath + url;\n\t\t\t\t\treturn await loader.loadAsync(path);\n\t\t\t\t} else {\n\t\t\t\t\tif (image.data) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tdata: getTypedArray(image.type, image.data),\n\t\t\t\t\t\t\twidth: image.width,\n\t\t\t\t\t\t\theight: image.height\n\t\t\t\t\t\t};\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (json !== undefined && json.length > 0) {\n\t\t\t\tloader = new ImageLoader(this.manager);\n\t\t\t\tloader.setCrossOrigin(this.crossOrigin);\n\n\t\t\t\tfor (let i = 0, il = json.length; i < il; i++) {\n\t\t\t\t\tconst image = json[i];\n\t\t\t\t\tconst url = image.url;\n\n\t\t\t\t\tif (Array.isArray(url)) {\n\t\t\t\t\t\t// load array of images e.g CubeTexture\n\t\t\t\t\t\timages[image.uuid] = [];\n\n\t\t\t\t\t\tfor (let j = 0, jl = url.length; j < jl; j++) {\n\t\t\t\t\t\t\tconst currentUrl = url[j];\n\t\t\t\t\t\t\tconst deserializedImage = await deserializeImage(currentUrl);\n\n\t\t\t\t\t\t\tif (deserializedImage !== null) {\n\t\t\t\t\t\t\t\tif (deserializedImage instanceof HTMLImageElement) {\n\t\t\t\t\t\t\t\t\timages[image.uuid].push(deserializedImage);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t// special case: handle array of data textures for cube textures\n\t\t\t\t\t\t\t\t\timages[image.uuid].push(new DataTexture(deserializedImage.data, deserializedImage.width, deserializedImage.height));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// load single image\n\t\t\t\t\t\tconst deserializedImage = await deserializeImage(image.url);\n\n\t\t\t\t\t\tif (deserializedImage !== null) {\n\t\t\t\t\t\t\timages[image.uuid] = deserializedImage;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn images;\n\t\t}\n\n\t\tparseTextures(json, images) {\n\t\t\tfunction parseConstant(value, type) {\n\t\t\t\tif (typeof value === 'number') return value;\n\t\t\t\tconsole.warn('THREE.ObjectLoader.parseTexture: Constant should be in numeric form.', value);\n\t\t\t\treturn type[value];\n\t\t\t}\n\n\t\t\tconst textures = {};\n\n\t\t\tif (json !== undefined) {\n\t\t\t\tfor (let i = 0, l = json.length; i < l; i++) {\n\t\t\t\t\tconst data = json[i];\n\n\t\t\t\t\tif (data.image === undefined) {\n\t\t\t\t\t\tconsole.warn('THREE.ObjectLoader: No \"image\" specified for', data.uuid);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (images[data.image] === undefined) {\n\t\t\t\t\t\tconsole.warn('THREE.ObjectLoader: Undefined image', data.image);\n\t\t\t\t\t}\n\n\t\t\t\t\tlet texture;\n\t\t\t\t\tconst image = images[data.image];\n\n\t\t\t\t\tif (Array.isArray(image)) {\n\t\t\t\t\t\ttexture = new CubeTexture(image);\n\t\t\t\t\t\tif (image.length === 6) texture.needsUpdate = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (image && image.data) {\n\t\t\t\t\t\t\ttexture = new DataTexture(image.data, image.width, image.height);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttexture = new Texture(image);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (image) texture.needsUpdate = true; // textures can have undefined image data\n\t\t\t\t\t}\n\n\t\t\t\t\ttexture.uuid = data.uuid;\n\t\t\t\t\tif (data.name !== undefined) texture.name = data.name;\n\t\t\t\t\tif (data.mapping !== undefined) texture.mapping = parseConstant(data.mapping, TEXTURE_MAPPING);\n\t\t\t\t\tif (data.offset !== undefined) texture.offset.fromArray(data.offset);\n\t\t\t\t\tif (data.repeat !== undefined) texture.repeat.fromArray(data.repeat);\n\t\t\t\t\tif (data.center !== undefined) texture.center.fromArray(data.center);\n\t\t\t\t\tif (data.rotation !== undefined) texture.rotation = data.rotation;\n\n\t\t\t\t\tif (data.wrap !== undefined) {\n\t\t\t\t\t\ttexture.wrapS = parseConstant(data.wrap[0], TEXTURE_WRAPPING);\n\t\t\t\t\t\ttexture.wrapT = parseConstant(data.wrap[1], TEXTURE_WRAPPING);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (data.format !== undefined) texture.format = data.format;\n\t\t\t\t\tif (data.type !== undefined) texture.type = data.type;\n\t\t\t\t\tif (data.encoding !== undefined) texture.encoding = data.encoding;\n\t\t\t\t\tif (data.minFilter !== undefined) texture.minFilter = parseConstant(data.minFilter, TEXTURE_FILTER);\n\t\t\t\t\tif (data.magFilter !== undefined) texture.magFilter = parseConstant(data.magFilter, TEXTURE_FILTER);\n\t\t\t\t\tif (data.anisotropy !== undefined) texture.anisotropy = data.anisotropy;\n\t\t\t\t\tif (data.flipY !== undefined) texture.flipY = data.flipY;\n\t\t\t\t\tif (data.premultiplyAlpha !== undefined) texture.premultiplyAlpha = data.premultiplyAlpha;\n\t\t\t\t\tif (data.unpackAlignment !== undefined) texture.unpackAlignment = data.unpackAlignment;\n\t\t\t\t\ttextures[data.uuid] = texture;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn textures;\n\t\t}\n\n\t\tparseObject(data, geometries, materials, textures, animations) {\n\t\t\tlet object;\n\n\t\t\tfunction getGeometry(name) {\n\t\t\t\tif (geometries[name] === undefined) {\n\t\t\t\t\tconsole.warn('THREE.ObjectLoader: Undefined geometry', name);\n\t\t\t\t}\n\n\t\t\t\treturn geometries[name];\n\t\t\t}\n\n\t\t\tfunction getMaterial(name) {\n\t\t\t\tif (name === undefined) return undefined;\n\n\t\t\t\tif (Array.isArray(name)) {\n\t\t\t\t\tconst array = [];\n\n\t\t\t\t\tfor (let i = 0, l = name.length; i < l; i++) {\n\t\t\t\t\t\tconst uuid = name[i];\n\n\t\t\t\t\t\tif (materials[uuid] === undefined) {\n\t\t\t\t\t\t\tconsole.warn('THREE.ObjectLoader: Undefined material', uuid);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tarray.push(materials[uuid]);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn array;\n\t\t\t\t}\n\n\t\t\t\tif (materials[name] === undefined) {\n\t\t\t\t\tconsole.warn('THREE.ObjectLoader: Undefined material', name);\n\t\t\t\t}\n\n\t\t\t\treturn materials[name];\n\t\t\t}\n\n\t\t\tfunction getTexture(uuid) {\n\t\t\t\tif (textures[uuid] === undefined) {\n\t\t\t\t\tconsole.warn('THREE.ObjectLoader: Undefined texture', uuid);\n\t\t\t\t}\n\n\t\t\t\treturn textures[uuid];\n\t\t\t}\n\n\t\t\tlet geometry, material;\n\n\t\t\tswitch (data.type) {\n\t\t\t\tcase 'Scene':\n\t\t\t\t\tobject = new Scene();\n\n\t\t\t\t\tif (data.background !== undefined) {\n\t\t\t\t\t\tif (Number.isInteger(data.background)) {\n\t\t\t\t\t\t\tobject.background = new Color(data.background);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tobject.background = getTexture(data.background);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (data.environment !== undefined) {\n\t\t\t\t\t\tobject.environment = getTexture(data.environment);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (data.fog !== undefined) {\n\t\t\t\t\t\tif (data.fog.type === 'Fog') {\n\t\t\t\t\t\t\tobject.fog = new Fog(data.fog.color, data.fog.near, data.fog.far);\n\t\t\t\t\t\t} else if (data.fog.type === 'FogExp2') {\n\t\t\t\t\t\t\tobject.fog = new FogExp2(data.fog.color, data.fog.density);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'PerspectiveCamera':\n\t\t\t\t\tobject = new PerspectiveCamera(data.fov, data.aspect, data.near, data.far);\n\t\t\t\t\tif (data.focus !== undefined) object.focus = data.focus;\n\t\t\t\t\tif (data.zoom !== undefined) object.zoom = data.zoom;\n\t\t\t\t\tif (data.filmGauge !== undefined) object.filmGauge = data.filmGauge;\n\t\t\t\t\tif (data.filmOffset !== undefined) object.filmOffset = data.filmOffset;\n\t\t\t\t\tif (data.view !== undefined) object.view = Object.assign({}, data.view);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'OrthographicCamera':\n\t\t\t\t\tobject = new OrthographicCamera(data.left, data.right, data.top, data.bottom, data.near, data.far);\n\t\t\t\t\tif (data.zoom !== undefined) object.zoom = data.zoom;\n\t\t\t\t\tif (data.view !== undefined) object.view = Object.assign({}, data.view);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'AmbientLight':\n\t\t\t\t\tobject = new AmbientLight(data.color, data.intensity);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'DirectionalLight':\n\t\t\t\t\tobject = new DirectionalLight(data.color, data.intensity);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'PointLight':\n\t\t\t\t\tobject = new PointLight(data.color, data.intensity, data.distance, data.decay);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'RectAreaLight':\n\t\t\t\t\tobject = new RectAreaLight(data.color, data.intensity, data.width, data.height);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'SpotLight':\n\t\t\t\t\tobject = new SpotLight(data.color, data.intensity, data.distance, data.angle, data.penumbra, data.decay);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'HemisphereLight':\n\t\t\t\t\tobject = new HemisphereLight(data.color, data.groundColor, data.intensity);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'LightProbe':\n\t\t\t\t\tobject = new LightProbe().fromJSON(data);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'SkinnedMesh':\n\t\t\t\t\tgeometry = getGeometry(data.geometry);\n\t\t\t\t\tmaterial = getMaterial(data.material);\n\t\t\t\t\tobject = new SkinnedMesh(geometry, material);\n\t\t\t\t\tif (data.bindMode !== undefined) object.bindMode = data.bindMode;\n\t\t\t\t\tif (data.bindMatrix !== undefined) object.bindMatrix.fromArray(data.bindMatrix);\n\t\t\t\t\tif (data.skeleton !== undefined) object.skeleton = data.skeleton;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'Mesh':\n\t\t\t\t\tgeometry = getGeometry(data.geometry);\n\t\t\t\t\tmaterial = getMaterial(data.material);\n\t\t\t\t\tobject = new Mesh(geometry, material);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'InstancedMesh':\n\t\t\t\t\tgeometry = getGeometry(data.geometry);\n\t\t\t\t\tmaterial = getMaterial(data.material);\n\t\t\t\t\tconst count = data.count;\n\t\t\t\t\tconst instanceMatrix = data.instanceMatrix;\n\t\t\t\t\tconst instanceColor = data.instanceColor;\n\t\t\t\t\tobject = new InstancedMesh(geometry, material, count);\n\t\t\t\t\tobject.instanceMatrix = new InstancedBufferAttribute(new Float32Array(instanceMatrix.array), 16);\n\t\t\t\t\tif (instanceColor !== undefined) object.instanceColor = new InstancedBufferAttribute(new Float32Array(instanceColor.array), instanceColor.itemSize);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'LOD':\n\t\t\t\t\tobject = new LOD();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'Line':\n\t\t\t\t\tobject = new Line(getGeometry(data.geometry), getMaterial(data.material));\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'LineLoop':\n\t\t\t\t\tobject = new LineLoop(getGeometry(data.geometry), getMaterial(data.material));\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'LineSegments':\n\t\t\t\t\tobject = new LineSegments(getGeometry(data.geometry), getMaterial(data.material));\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'PointCloud':\n\t\t\t\tcase 'Points':\n\t\t\t\t\tobject = new Points(getGeometry(data.geometry), getMaterial(data.material));\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'Sprite':\n\t\t\t\t\tobject = new Sprite(getMaterial(data.material));\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'Group':\n\t\t\t\t\tobject = new Group();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'Bone':\n\t\t\t\t\tobject = new Bone();\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tobject = new Object3D();\n\t\t\t}\n\n\t\t\tobject.uuid = data.uuid;\n\t\t\tif (data.name !== undefined) object.name = data.name;\n\n\t\t\tif (data.matrix !== undefined) {\n\t\t\t\tobject.matrix.fromArray(data.matrix);\n\t\t\t\tif (data.matrixAutoUpdate !== undefined) object.matrixAutoUpdate = data.matrixAutoUpdate;\n\t\t\t\tif (object.matrixAutoUpdate) object.matrix.decompose(object.position, object.quaternion, object.scale);\n\t\t\t} else {\n\t\t\t\tif (data.position !== undefined) object.position.fromArray(data.position);\n\t\t\t\tif (data.rotation !== undefined) object.rotation.fromArray(data.rotation);\n\t\t\t\tif (data.quaternion !== undefined) object.quaternion.fromArray(data.quaternion);\n\t\t\t\tif (data.scale !== undefined) object.scale.fromArray(data.scale);\n\t\t\t}\n\n\t\t\tif (data.castShadow !== undefined) object.castShadow = data.castShadow;\n\t\t\tif (data.receiveShadow !== undefined) object.receiveShadow = data.receiveShadow;\n\n\t\t\tif (data.shadow) {\n\t\t\t\tif (data.shadow.bias !== undefined) object.shadow.bias = data.shadow.bias;\n\t\t\t\tif (data.shadow.normalBias !== undefined) object.shadow.normalBias = data.shadow.normalBias;\n\t\t\t\tif (data.shadow.radius !== undefined) object.shadow.radius = data.shadow.radius;\n\t\t\t\tif (data.shadow.mapSize !== undefined) object.shadow.mapSize.fromArray(data.shadow.mapSize);\n\t\t\t\tif (data.shadow.camera !== undefined) object.shadow.camera = this.parseObject(data.shadow.camera);\n\t\t\t}\n\n\t\t\tif (data.visible !== undefined) object.visible = data.visible;\n\t\t\tif (data.frustumCulled !== undefined) object.frustumCulled = data.frustumCulled;\n\t\t\tif (data.renderOrder !== undefined) object.renderOrder = data.renderOrder;\n\t\t\tif (data.userData !== undefined) object.userData = data.userData;\n\t\t\tif (data.layers !== undefined) object.layers.mask = data.layers;\n\n\t\t\tif (data.children !== undefined) {\n\t\t\t\tconst children = data.children;\n\n\t\t\t\tfor (let i = 0; i < children.length; i++) {\n\t\t\t\t\tobject.add(this.parseObject(children[i], geometries, materials, textures, animations));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (data.animations !== undefined) {\n\t\t\t\tconst objectAnimations = data.animations;\n\n\t\t\t\tfor (let i = 0; i < objectAnimations.length; i++) {\n\t\t\t\t\tconst uuid = objectAnimations[i];\n\t\t\t\t\tobject.animations.push(animations[uuid]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (data.type === 'LOD') {\n\t\t\t\tif (data.autoUpdate !== undefined) object.autoUpdate = data.autoUpdate;\n\t\t\t\tconst levels = data.levels;\n\n\t\t\t\tfor (let l = 0; l < levels.length; l++) {\n\t\t\t\t\tconst level = levels[l];\n\t\t\t\t\tconst child = object.getObjectByProperty('uuid', level.object);\n\n\t\t\t\t\tif (child !== undefined) {\n\t\t\t\t\t\tobject.addLevel(child, level.distance);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn object;\n\t\t}\n\n\t\tbindSkeletons(object, skeletons) {\n\t\t\tif (Object.keys(skeletons).length === 0) return;\n\t\t\tobject.traverse(function (child) {\n\t\t\t\tif (child.isSkinnedMesh === true && child.skeleton !== undefined) {\n\t\t\t\t\tconst skeleton = skeletons[child.skeleton];\n\n\t\t\t\t\tif (skeleton === undefined) {\n\t\t\t\t\t\tconsole.warn('THREE.ObjectLoader: No skeleton found with UUID:', child.skeleton);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tchild.bind(skeleton, child.bindMatrix);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\t/* DEPRECATED */\n\n\n\t\tsetTexturePath(value) {\n\t\t\tconsole.warn('THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath().');\n\t\t\treturn this.setResourcePath(value);\n\t\t}\n\n\t}\n\n\tconst TEXTURE_MAPPING = {\n\t\tUVMapping: UVMapping,\n\t\tCubeReflectionMapping: CubeReflectionMapping,\n\t\tCubeRefractionMapping: CubeRefractionMapping,\n\t\tEquirectangularReflectionMapping: EquirectangularReflectionMapping,\n\t\tEquirectangularRefractionMapping: EquirectangularRefractionMapping,\n\t\tCubeUVReflectionMapping: CubeUVReflectionMapping,\n\t\tCubeUVRefractionMapping: CubeUVRefractionMapping\n\t};\n\tconst TEXTURE_WRAPPING = {\n\t\tRepeatWrapping: RepeatWrapping,\n\t\tClampToEdgeWrapping: ClampToEdgeWrapping,\n\t\tMirroredRepeatWrapping: MirroredRepeatWrapping\n\t};\n\tconst TEXTURE_FILTER = {\n\t\tNearestFilter: NearestFilter,\n\t\tNearestMipmapNearestFilter: NearestMipmapNearestFilter,\n\t\tNearestMipmapLinearFilter: NearestMipmapLinearFilter,\n\t\tLinearFilter: LinearFilter,\n\t\tLinearMipmapNearestFilter: LinearMipmapNearestFilter,\n\t\tLinearMipmapLinearFilter: LinearMipmapLinearFilter\n\t};\n\n\tclass ImageBitmapLoader extends Loader {\n\t\tconstructor(manager) {\n\t\t\tsuper(manager);\n\n\t\t\tif (typeof createImageBitmap === 'undefined') {\n\t\t\t\tconsole.warn('THREE.ImageBitmapLoader: createImageBitmap() not supported.');\n\t\t\t}\n\n\t\t\tif (typeof fetch === 'undefined') {\n\t\t\t\tconsole.warn('THREE.ImageBitmapLoader: fetch() not supported.');\n\t\t\t}\n\n\t\t\tthis.options = {\n\t\t\t\tpremultiplyAlpha: 'none'\n\t\t\t};\n\t\t}\n\n\t\tsetOptions(options) {\n\t\t\tthis.options = options;\n\t\t\treturn this;\n\t\t}\n\n\t\tload(url, onLoad, onProgress, onError) {\n\t\t\tif (url === undefined) url = '';\n\t\t\tif (this.path !== undefined) url = this.path + url;\n\t\t\turl = this.manager.resolveURL(url);\n\t\t\tconst scope = this;\n\t\t\tconst cached = Cache.get(url);\n\n\t\t\tif (cached !== undefined) {\n\t\t\t\tscope.manager.itemStart(url);\n\t\t\t\tsetTimeout(function () {\n\t\t\t\t\tif (onLoad) onLoad(cached);\n\t\t\t\t\tscope.manager.itemEnd(url);\n\t\t\t\t}, 0);\n\t\t\t\treturn cached;\n\t\t\t}\n\n\t\t\tconst fetchOptions = {};\n\t\t\tfetchOptions.credentials = this.crossOrigin === 'anonymous' ? 'same-origin' : 'include';\n\t\t\tfetchOptions.headers = this.requestHeader;\n\t\t\tfetch(url, fetchOptions).then(function (res) {\n\t\t\t\treturn res.blob();\n\t\t\t}).then(function (blob) {\n\t\t\t\treturn createImageBitmap(blob, Object.assign(scope.options, {\n\t\t\t\t\tcolorSpaceConversion: 'none'\n\t\t\t\t}));\n\t\t\t}).then(function (imageBitmap) {\n\t\t\t\tCache.add(url, imageBitmap);\n\t\t\t\tif (onLoad) onLoad(imageBitmap);\n\t\t\t\tscope.manager.itemEnd(url);\n\t\t\t}).catch(function (e) {\n\t\t\t\tif (onError) onError(e);\n\t\t\t\tscope.manager.itemError(url);\n\t\t\t\tscope.manager.itemEnd(url);\n\t\t\t});\n\t\t\tscope.manager.itemStart(url);\n\t\t}\n\n\t}\n\n\tImageBitmapLoader.prototype.isImageBitmapLoader = true;\n\n\tlet _context;\n\n\tconst AudioContext = {\n\t\tgetContext: function () {\n\t\t\tif (_context === undefined) {\n\t\t\t\t_context = new (window.AudioContext || window.webkitAudioContext)();\n\t\t\t}\n\n\t\t\treturn _context;\n\t\t},\n\t\tsetContext: function (value) {\n\t\t\t_context = value;\n\t\t}\n\t};\n\n\tclass AudioLoader extends Loader {\n\t\tconstructor(manager) {\n\t\t\tsuper(manager);\n\t\t}\n\n\t\tload(url, onLoad, onProgress, onError) {\n\t\t\tconst scope = this;\n\t\t\tconst loader = new FileLoader(this.manager);\n\t\t\tloader.setResponseType('arraybuffer');\n\t\t\tloader.setPath(this.path);\n\t\t\tloader.setRequestHeader(this.requestHeader);\n\t\t\tloader.setWithCredentials(this.withCredentials);\n\t\t\tloader.load(url, function (buffer) {\n\t\t\t\ttry {\n\t\t\t\t\t// Create a copy of the buffer. The `decodeAudioData` method\n\t\t\t\t\t// detaches the buffer when complete, preventing reuse.\n\t\t\t\t\tconst bufferCopy = buffer.slice(0);\n\t\t\t\t\tconst context = AudioContext.getContext();\n\t\t\t\t\tcontext.decodeAudioData(bufferCopy, function (audioBuffer) {\n\t\t\t\t\t\tonLoad(audioBuffer);\n\t\t\t\t\t});\n\t\t\t\t} catch (e) {\n\t\t\t\t\tif (onError) {\n\t\t\t\t\t\tonError(e);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconsole.error(e);\n\t\t\t\t\t}\n\n\t\t\t\t\tscope.manager.itemError(url);\n\t\t\t\t}\n\t\t\t}, onProgress, onError);\n\t\t}\n\n\t}\n\n\tclass HemisphereLightProbe extends LightProbe {\n\t\tconstructor(skyColor, groundColor, intensity = 1) {\n\t\t\tsuper(undefined, intensity);\n\t\t\tconst color1 = new Color().set(skyColor);\n\t\t\tconst color2 = new Color().set(groundColor);\n\t\t\tconst sky = new Vector3(color1.r, color1.g, color1.b);\n\t\t\tconst ground = new Vector3(color2.r, color2.g, color2.b); // without extra factor of PI in the shader, should = 1 / Math.sqrt( Math.PI );\n\n\t\t\tconst c0 = Math.sqrt(Math.PI);\n\t\t\tconst c1 = c0 * Math.sqrt(0.75);\n\t\t\tthis.sh.coefficients[0].copy(sky).add(ground).multiplyScalar(c0);\n\t\t\tthis.sh.coefficients[1].copy(sky).sub(ground).multiplyScalar(c1);\n\t\t}\n\n\t}\n\n\tHemisphereLightProbe.prototype.isHemisphereLightProbe = true;\n\n\tclass AmbientLightProbe extends LightProbe {\n\t\tconstructor(color, intensity = 1) {\n\t\t\tsuper(undefined, intensity);\n\t\t\tconst color1 = new Color().set(color); // without extra factor of PI in the shader, would be 2 / Math.sqrt( Math.PI );\n\n\t\t\tthis.sh.coefficients[0].set(color1.r, color1.g, color1.b).multiplyScalar(2 * Math.sqrt(Math.PI));\n\t\t}\n\n\t}\n\n\tAmbientLightProbe.prototype.isAmbientLightProbe = true;\n\n\tconst _eyeRight = /*@__PURE__*/new Matrix4();\n\n\tconst _eyeLeft = /*@__PURE__*/new Matrix4();\n\n\tclass StereoCamera {\n\t\tconstructor() {\n\t\t\tthis.type = 'StereoCamera';\n\t\t\tthis.aspect = 1;\n\t\t\tthis.eyeSep = 0.064;\n\t\t\tthis.cameraL = new PerspectiveCamera();\n\t\t\tthis.cameraL.layers.enable(1);\n\t\t\tthis.cameraL.matrixAutoUpdate = false;\n\t\t\tthis.cameraR = new PerspectiveCamera();\n\t\t\tthis.cameraR.layers.enable(2);\n\t\t\tthis.cameraR.matrixAutoUpdate = false;\n\t\t\tthis._cache = {\n\t\t\t\tfocus: null,\n\t\t\t\tfov: null,\n\t\t\t\taspect: null,\n\t\t\t\tnear: null,\n\t\t\t\tfar: null,\n\t\t\t\tzoom: null,\n\t\t\t\teyeSep: null\n\t\t\t};\n\t\t}\n\n\t\tupdate(camera) {\n\t\t\tconst cache = this._cache;\n\t\t\tconst needsUpdate = cache.focus !== camera.focus || cache.fov !== camera.fov || cache.aspect !== camera.aspect * this.aspect || cache.near !== camera.near || cache.far !== camera.far || cache.zoom !== camera.zoom || cache.eyeSep !== this.eyeSep;\n\n\t\t\tif (needsUpdate) {\n\t\t\t\tcache.focus = camera.focus;\n\t\t\t\tcache.fov = camera.fov;\n\t\t\t\tcache.aspect = camera.aspect * this.aspect;\n\t\t\t\tcache.near = camera.near;\n\t\t\t\tcache.far = camera.far;\n\t\t\t\tcache.zoom = camera.zoom;\n\t\t\t\tcache.eyeSep = this.eyeSep; // Off-axis stereoscopic effect based on\n\t\t\t\t// http://paulbourke.net/stereographics/stereorender/\n\n\t\t\t\tconst projectionMatrix = camera.projectionMatrix.clone();\n\t\t\t\tconst eyeSepHalf = cache.eyeSep / 2;\n\t\t\t\tconst eyeSepOnProjection = eyeSepHalf * cache.near / cache.focus;\n\t\t\t\tconst ymax = cache.near * Math.tan(DEG2RAD * cache.fov * 0.5) / cache.zoom;\n\t\t\t\tlet xmin, xmax; // translate xOffset\n\n\t\t\t\t_eyeLeft.elements[12] = -eyeSepHalf;\n\t\t\t\t_eyeRight.elements[12] = eyeSepHalf; // for left eye\n\n\t\t\t\txmin = -ymax * cache.aspect + eyeSepOnProjection;\n\t\t\t\txmax = ymax * cache.aspect + eyeSepOnProjection;\n\t\t\t\tprojectionMatrix.elements[0] = 2 * cache.near / (xmax - xmin);\n\t\t\t\tprojectionMatrix.elements[8] = (xmax + xmin) / (xmax - xmin);\n\t\t\t\tthis.cameraL.projectionMatrix.copy(projectionMatrix); // for right eye\n\n\t\t\t\txmin = -ymax * cache.aspect - eyeSepOnProjection;\n\t\t\t\txmax = ymax * cache.aspect - eyeSepOnProjection;\n\t\t\t\tprojectionMatrix.elements[0] = 2 * cache.near / (xmax - xmin);\n\t\t\t\tprojectionMatrix.elements[8] = (xmax + xmin) / (xmax - xmin);\n\t\t\t\tthis.cameraR.projectionMatrix.copy(projectionMatrix);\n\t\t\t}\n\n\t\t\tthis.cameraL.matrixWorld.copy(camera.matrixWorld).multiply(_eyeLeft);\n\t\t\tthis.cameraR.matrixWorld.copy(camera.matrixWorld).multiply(_eyeRight);\n\t\t}\n\n\t}\n\n\tclass Clock {\n\t\tconstructor(autoStart = true) {\n\t\t\tthis.autoStart = autoStart;\n\t\t\tthis.startTime = 0;\n\t\t\tthis.oldTime = 0;\n\t\t\tthis.elapsedTime = 0;\n\t\t\tthis.running = false;\n\t\t}\n\n\t\tstart() {\n\t\t\tthis.startTime = now();\n\t\t\tthis.oldTime = this.startTime;\n\t\t\tthis.elapsedTime = 0;\n\t\t\tthis.running = true;\n\t\t}\n\n\t\tstop() {\n\t\t\tthis.getElapsedTime();\n\t\t\tthis.running = false;\n\t\t\tthis.autoStart = false;\n\t\t}\n\n\t\tgetElapsedTime() {\n\t\t\tthis.getDelta();\n\t\t\treturn this.elapsedTime;\n\t\t}\n\n\t\tgetDelta() {\n\t\t\tlet diff = 0;\n\n\t\t\tif (this.autoStart && !this.running) {\n\t\t\t\tthis.start();\n\t\t\t\treturn 0;\n\t\t\t}\n\n\t\t\tif (this.running) {\n\t\t\t\tconst newTime = now();\n\t\t\t\tdiff = (newTime - this.oldTime) / 1000;\n\t\t\t\tthis.oldTime = newTime;\n\t\t\t\tthis.elapsedTime += diff;\n\t\t\t}\n\n\t\t\treturn diff;\n\t\t}\n\n\t}\n\n\tfunction now() {\n\t\treturn (typeof performance === 'undefined' ? Date : performance).now(); // see #10732\n\t}\n\n\tconst _position$1 = /*@__PURE__*/new Vector3();\n\n\tconst _quaternion$1 = /*@__PURE__*/new Quaternion();\n\n\tconst _scale$1 = /*@__PURE__*/new Vector3();\n\n\tconst _orientation$1 = /*@__PURE__*/new Vector3();\n\n\tclass AudioListener extends Object3D {\n\t\tconstructor() {\n\t\t\tsuper();\n\t\t\tthis.type = 'AudioListener';\n\t\t\tthis.context = AudioContext.getContext();\n\t\t\tthis.gain = this.context.createGain();\n\t\t\tthis.gain.connect(this.context.destination);\n\t\t\tthis.filter = null;\n\t\t\tthis.timeDelta = 0; // private\n\n\t\t\tthis._clock = new Clock();\n\t\t}\n\n\t\tgetInput() {\n\t\t\treturn this.gain;\n\t\t}\n\n\t\tremoveFilter() {\n\t\t\tif (this.filter !== null) {\n\t\t\t\tthis.gain.disconnect(this.filter);\n\t\t\t\tthis.filter.disconnect(this.context.destination);\n\t\t\t\tthis.gain.connect(this.context.destination);\n\t\t\t\tthis.filter = null;\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tgetFilter() {\n\t\t\treturn this.filter;\n\t\t}\n\n\t\tsetFilter(value) {\n\t\t\tif (this.filter !== null) {\n\t\t\t\tthis.gain.disconnect(this.filter);\n\t\t\t\tthis.filter.disconnect(this.context.destination);\n\t\t\t} else {\n\t\t\t\tthis.gain.disconnect(this.context.destination);\n\t\t\t}\n\n\t\t\tthis.filter = value;\n\t\t\tthis.gain.connect(this.filter);\n\t\t\tthis.filter.connect(this.context.destination);\n\t\t\treturn this;\n\t\t}\n\n\t\tgetMasterVolume() {\n\t\t\treturn this.gain.gain.value;\n\t\t}\n\n\t\tsetMasterVolume(value) {\n\t\t\tthis.gain.gain.setTargetAtTime(value, this.context.currentTime, 0.01);\n\t\t\treturn this;\n\t\t}\n\n\t\tupdateMatrixWorld(force) {\n\t\t\tsuper.updateMatrixWorld(force);\n\t\t\tconst listener = this.context.listener;\n\t\t\tconst up = this.up;\n\t\t\tthis.timeDelta = this._clock.getDelta();\n\t\t\tthis.matrixWorld.decompose(_position$1, _quaternion$1, _scale$1);\n\n\t\t\t_orientation$1.set(0, 0, -1).applyQuaternion(_quaternion$1);\n\n\t\t\tif (listener.positionX) {\n\t\t\t\t// code path for Chrome (see #14393)\n\t\t\t\tconst endTime = this.context.currentTime + this.timeDelta;\n\t\t\t\tlistener.positionX.linearRampToValueAtTime(_position$1.x, endTime);\n\t\t\t\tlistener.positionY.linearRampToValueAtTime(_position$1.y, endTime);\n\t\t\t\tlistener.positionZ.linearRampToValueAtTime(_position$1.z, endTime);\n\t\t\t\tlistener.forwardX.linearRampToValueAtTime(_orientation$1.x, endTime);\n\t\t\t\tlistener.forwardY.linearRampToValueAtTime(_orientation$1.y, endTime);\n\t\t\t\tlistener.forwardZ.linearRampToValueAtTime(_orientation$1.z, endTime);\n\t\t\t\tlistener.upX.linearRampToValueAtTime(up.x, endTime);\n\t\t\t\tlistener.upY.linearRampToValueAtTime(up.y, endTime);\n\t\t\t\tlistener.upZ.linearRampToValueAtTime(up.z, endTime);\n\t\t\t} else {\n\t\t\t\tlistener.setPosition(_position$1.x, _position$1.y, _position$1.z);\n\t\t\t\tlistener.setOrientation(_orientation$1.x, _orientation$1.y, _orientation$1.z, up.x, up.y, up.z);\n\t\t\t}\n\t\t}\n\n\t}\n\n\tclass Audio extends Object3D {\n\t\tconstructor(listener) {\n\t\t\tsuper();\n\t\t\tthis.type = 'Audio';\n\t\t\tthis.listener = listener;\n\t\t\tthis.context = listener.context;\n\t\t\tthis.gain = this.context.createGain();\n\t\t\tthis.gain.connect(listener.getInput());\n\t\t\tthis.autoplay = false;\n\t\t\tthis.buffer = null;\n\t\t\tthis.detune = 0;\n\t\t\tthis.loop = false;\n\t\t\tthis.loopStart = 0;\n\t\t\tthis.loopEnd = 0;\n\t\t\tthis.offset = 0;\n\t\t\tthis.duration = undefined;\n\t\t\tthis.playbackRate = 1;\n\t\t\tthis.isPlaying = false;\n\t\t\tthis.hasPlaybackControl = true;\n\t\t\tthis.source = null;\n\t\t\tthis.sourceType = 'empty';\n\t\t\tthis._startedAt = 0;\n\t\t\tthis._progress = 0;\n\t\t\tthis._connected = false;\n\t\t\tthis.filters = [];\n\t\t}\n\n\t\tgetOutput() {\n\t\t\treturn this.gain;\n\t\t}\n\n\t\tsetNodeSource(audioNode) {\n\t\t\tthis.hasPlaybackControl = false;\n\t\t\tthis.sourceType = 'audioNode';\n\t\t\tthis.source = audioNode;\n\t\t\tthis.connect();\n\t\t\treturn this;\n\t\t}\n\n\t\tsetMediaElementSource(mediaElement) {\n\t\t\tthis.hasPlaybackControl = false;\n\t\t\tthis.sourceType = 'mediaNode';\n\t\t\tthis.source = this.context.createMediaElementSource(mediaElement);\n\t\t\tthis.connect();\n\t\t\treturn this;\n\t\t}\n\n\t\tsetMediaStreamSource(mediaStream) {\n\t\t\tthis.hasPlaybackControl = false;\n\t\t\tthis.sourceType = 'mediaStreamNode';\n\t\t\tthis.source = this.context.createMediaStreamSource(mediaStream);\n\t\t\tthis.connect();\n\t\t\treturn this;\n\t\t}\n\n\t\tsetBuffer(audioBuffer) {\n\t\t\tthis.buffer = audioBuffer;\n\t\t\tthis.sourceType = 'buffer';\n\t\t\tif (this.autoplay) this.play();\n\t\t\treturn this;\n\t\t}\n\n\t\tplay(delay = 0) {\n\t\t\tif (this.isPlaying === true) {\n\t\t\t\tconsole.warn('THREE.Audio: Audio is already playing.');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (this.hasPlaybackControl === false) {\n\t\t\t\tconsole.warn('THREE.Audio: this Audio has no playback control.');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._startedAt = this.context.currentTime + delay;\n\t\t\tconst source = this.context.createBufferSource();\n\t\t\tsource.buffer = this.buffer;\n\t\t\tsource.loop = this.loop;\n\t\t\tsource.loopStart = this.loopStart;\n\t\t\tsource.loopEnd = this.loopEnd;\n\t\t\tsource.onended = this.onEnded.bind(this);\n\t\t\tsource.start(this._startedAt, this._progress + this.offset, this.duration);\n\t\t\tthis.isPlaying = true;\n\t\t\tthis.source = source;\n\t\t\tthis.setDetune(this.detune);\n\t\t\tthis.setPlaybackRate(this.playbackRate);\n\t\t\treturn this.connect();\n\t\t}\n\n\t\tpause() {\n\t\t\tif (this.hasPlaybackControl === false) {\n\t\t\t\tconsole.warn('THREE.Audio: this Audio has no playback control.');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (this.isPlaying === true) {\n\t\t\t\t// update current progress\n\t\t\t\tthis._progress += Math.max(this.context.currentTime - this._startedAt, 0) * this.playbackRate;\n\n\t\t\t\tif (this.loop === true) {\n\t\t\t\t\t// ensure _progress does not exceed duration with looped audios\n\t\t\t\t\tthis._progress = this._progress % (this.duration || this.buffer.duration);\n\t\t\t\t}\n\n\t\t\t\tthis.source.stop();\n\t\t\t\tthis.source.onended = null;\n\t\t\t\tthis.isPlaying = false;\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tstop() {\n\t\t\tif (this.hasPlaybackControl === false) {\n\t\t\t\tconsole.warn('THREE.Audio: this Audio has no playback control.');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._progress = 0;\n\t\t\tthis.source.stop();\n\t\t\tthis.source.onended = null;\n\t\t\tthis.isPlaying = false;\n\t\t\treturn this;\n\t\t}\n\n\t\tconnect() {\n\t\t\tif (this.filters.length > 0) {\n\t\t\t\tthis.source.connect(this.filters[0]);\n\n\t\t\t\tfor (let i = 1, l = this.filters.length; i < l; i++) {\n\t\t\t\t\tthis.filters[i - 1].connect(this.filters[i]);\n\t\t\t\t}\n\n\t\t\t\tthis.filters[this.filters.length - 1].connect(this.getOutput());\n\t\t\t} else {\n\t\t\t\tthis.source.connect(this.getOutput());\n\t\t\t}\n\n\t\t\tthis._connected = true;\n\t\t\treturn this;\n\t\t}\n\n\t\tdisconnect() {\n\t\t\tif (this.filters.length > 0) {\n\t\t\t\tthis.source.disconnect(this.filters[0]);\n\n\t\t\t\tfor (let i = 1, l = this.filters.length; i < l; i++) {\n\t\t\t\t\tthis.filters[i - 1].disconnect(this.filters[i]);\n\t\t\t\t}\n\n\t\t\t\tthis.filters[this.filters.length - 1].disconnect(this.getOutput());\n\t\t\t} else {\n\t\t\t\tthis.source.disconnect(this.getOutput());\n\t\t\t}\n\n\t\t\tthis._connected = false;\n\t\t\treturn this;\n\t\t}\n\n\t\tgetFilters() {\n\t\t\treturn this.filters;\n\t\t}\n\n\t\tsetFilters(value) {\n\t\t\tif (!value) value = [];\n\n\t\t\tif (this._connected === true) {\n\t\t\t\tthis.disconnect();\n\t\t\t\tthis.filters = value.slice();\n\t\t\t\tthis.connect();\n\t\t\t} else {\n\t\t\t\tthis.filters = value.slice();\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tsetDetune(value) {\n\t\t\tthis.detune = value;\n\t\t\tif (this.source.detune === undefined) return; // only set detune when available\n\n\t\t\tif (this.isPlaying === true) {\n\t\t\t\tthis.source.detune.setTargetAtTime(this.detune, this.context.currentTime, 0.01);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tgetDetune() {\n\t\t\treturn this.detune;\n\t\t}\n\n\t\tgetFilter() {\n\t\t\treturn this.getFilters()[0];\n\t\t}\n\n\t\tsetFilter(filter) {\n\t\t\treturn this.setFilters(filter ? [filter] : []);\n\t\t}\n\n\t\tsetPlaybackRate(value) {\n\t\t\tif (this.hasPlaybackControl === false) {\n\t\t\t\tconsole.warn('THREE.Audio: this Audio has no playback control.');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.playbackRate = value;\n\n\t\t\tif (this.isPlaying === true) {\n\t\t\t\tthis.source.playbackRate.setTargetAtTime(this.playbackRate, this.context.currentTime, 0.01);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tgetPlaybackRate() {\n\t\t\treturn this.playbackRate;\n\t\t}\n\n\t\tonEnded() {\n\t\t\tthis.isPlaying = false;\n\t\t}\n\n\t\tgetLoop() {\n\t\t\tif (this.hasPlaybackControl === false) {\n\t\t\t\tconsole.warn('THREE.Audio: this Audio has no playback control.');\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn this.loop;\n\t\t}\n\n\t\tsetLoop(value) {\n\t\t\tif (this.hasPlaybackControl === false) {\n\t\t\t\tconsole.warn('THREE.Audio: this Audio has no playback control.');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.loop = value;\n\n\t\t\tif (this.isPlaying === true) {\n\t\t\t\tthis.source.loop = this.loop;\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tsetLoopStart(value) {\n\t\t\tthis.loopStart = value;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetLoopEnd(value) {\n\t\t\tthis.loopEnd = value;\n\t\t\treturn this;\n\t\t}\n\n\t\tgetVolume() {\n\t\t\treturn this.gain.gain.value;\n\t\t}\n\n\t\tsetVolume(value) {\n\t\t\tthis.gain.gain.setTargetAtTime(value, this.context.currentTime, 0.01);\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tconst _position = /*@__PURE__*/new Vector3();\n\n\tconst _quaternion = /*@__PURE__*/new Quaternion();\n\n\tconst _scale = /*@__PURE__*/new Vector3();\n\n\tconst _orientation = /*@__PURE__*/new Vector3();\n\n\tclass PositionalAudio extends Audio {\n\t\tconstructor(listener) {\n\t\t\tsuper(listener);\n\t\t\tthis.panner = this.context.createPanner();\n\t\t\tthis.panner.panningModel = 'HRTF';\n\t\t\tthis.panner.connect(this.gain);\n\t\t}\n\n\t\tgetOutput() {\n\t\t\treturn this.panner;\n\t\t}\n\n\t\tgetRefDistance() {\n\t\t\treturn this.panner.refDistance;\n\t\t}\n\n\t\tsetRefDistance(value) {\n\t\t\tthis.panner.refDistance = value;\n\t\t\treturn this;\n\t\t}\n\n\t\tgetRolloffFactor() {\n\t\t\treturn this.panner.rolloffFactor;\n\t\t}\n\n\t\tsetRolloffFactor(value) {\n\t\t\tthis.panner.rolloffFactor = value;\n\t\t\treturn this;\n\t\t}\n\n\t\tgetDistanceModel() {\n\t\t\treturn this.panner.distanceModel;\n\t\t}\n\n\t\tsetDistanceModel(value) {\n\t\t\tthis.panner.distanceModel = value;\n\t\t\treturn this;\n\t\t}\n\n\t\tgetMaxDistance() {\n\t\t\treturn this.panner.maxDistance;\n\t\t}\n\n\t\tsetMaxDistance(value) {\n\t\t\tthis.panner.maxDistance = value;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetDirectionalCone(coneInnerAngle, coneOuterAngle, coneOuterGain) {\n\t\t\tthis.panner.coneInnerAngle = coneInnerAngle;\n\t\t\tthis.panner.coneOuterAngle = coneOuterAngle;\n\t\t\tthis.panner.coneOuterGain = coneOuterGain;\n\t\t\treturn this;\n\t\t}\n\n\t\tupdateMatrixWorld(force) {\n\t\t\tsuper.updateMatrixWorld(force);\n\t\t\tif (this.hasPlaybackControl === true && this.isPlaying === false) return;\n\t\t\tthis.matrixWorld.decompose(_position, _quaternion, _scale);\n\n\t\t\t_orientation.set(0, 0, 1).applyQuaternion(_quaternion);\n\n\t\t\tconst panner = this.panner;\n\n\t\t\tif (panner.positionX) {\n\t\t\t\t// code path for Chrome and Firefox (see #14393)\n\t\t\t\tconst endTime = this.context.currentTime + this.listener.timeDelta;\n\t\t\t\tpanner.positionX.linearRampToValueAtTime(_position.x, endTime);\n\t\t\t\tpanner.positionY.linearRampToValueAtTime(_position.y, endTime);\n\t\t\t\tpanner.positionZ.linearRampToValueAtTime(_position.z, endTime);\n\t\t\t\tpanner.orientationX.linearRampToValueAtTime(_orientation.x, endTime);\n\t\t\t\tpanner.orientationY.linearRampToValueAtTime(_orientation.y, endTime);\n\t\t\t\tpanner.orientationZ.linearRampToValueAtTime(_orientation.z, endTime);\n\t\t\t} else {\n\t\t\t\tpanner.setPosition(_position.x, _position.y, _position.z);\n\t\t\t\tpanner.setOrientation(_orientation.x, _orientation.y, _orientation.z);\n\t\t\t}\n\t\t}\n\n\t}\n\n\tclass AudioAnalyser {\n\t\tconstructor(audio, fftSize = 2048) {\n\t\t\tthis.analyser = audio.context.createAnalyser();\n\t\t\tthis.analyser.fftSize = fftSize;\n\t\t\tthis.data = new Uint8Array(this.analyser.frequencyBinCount);\n\t\t\taudio.getOutput().connect(this.analyser);\n\t\t}\n\n\t\tgetFrequencyData() {\n\t\t\tthis.analyser.getByteFrequencyData(this.data);\n\t\t\treturn this.data;\n\t\t}\n\n\t\tgetAverageFrequency() {\n\t\t\tlet value = 0;\n\t\t\tconst data = this.getFrequencyData();\n\n\t\t\tfor (let i = 0; i < data.length; i++) {\n\t\t\t\tvalue += data[i];\n\t\t\t}\n\n\t\t\treturn value / data.length;\n\t\t}\n\n\t}\n\n\tclass PropertyMixer {\n\t\tconstructor(binding, typeName, valueSize) {\n\t\t\tthis.binding = binding;\n\t\t\tthis.valueSize = valueSize;\n\t\t\tlet mixFunction, mixFunctionAdditive, setIdentity; // buffer layout: [ incoming | accu0 | accu1 | orig | addAccu | (optional work) ]\n\t\t\t//\n\t\t\t// interpolators can use .buffer as their .result\n\t\t\t// the data then goes to 'incoming'\n\t\t\t//\n\t\t\t// 'accu0' and 'accu1' are used frame-interleaved for\n\t\t\t// the cumulative result and are compared to detect\n\t\t\t// changes\n\t\t\t//\n\t\t\t// 'orig' stores the original state of the property\n\t\t\t//\n\t\t\t// 'add' is used for additive cumulative results\n\t\t\t//\n\t\t\t// 'work' is optional and is only present for quaternion types. It is used\n\t\t\t// to store intermediate quaternion multiplication results\n\n\t\t\tswitch (typeName) {\n\t\t\t\tcase 'quaternion':\n\t\t\t\t\tmixFunction = this._slerp;\n\t\t\t\t\tmixFunctionAdditive = this._slerpAdditive;\n\t\t\t\t\tsetIdentity = this._setAdditiveIdentityQuaternion;\n\t\t\t\t\tthis.buffer = new Float64Array(valueSize * 6);\n\t\t\t\t\tthis._workIndex = 5;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'string':\n\t\t\t\tcase 'bool':\n\t\t\t\t\tmixFunction = this._select; // Use the regular mix function and for additive on these types,\n\t\t\t\t\t// additive is not relevant for non-numeric types\n\n\t\t\t\t\tmixFunctionAdditive = this._select;\n\t\t\t\t\tsetIdentity = this._setAdditiveIdentityOther;\n\t\t\t\t\tthis.buffer = new Array(valueSize * 5);\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tmixFunction = this._lerp;\n\t\t\t\t\tmixFunctionAdditive = this._lerpAdditive;\n\t\t\t\t\tsetIdentity = this._setAdditiveIdentityNumeric;\n\t\t\t\t\tthis.buffer = new Float64Array(valueSize * 5);\n\t\t\t}\n\n\t\t\tthis._mixBufferRegion = mixFunction;\n\t\t\tthis._mixBufferRegionAdditive = mixFunctionAdditive;\n\t\t\tthis._setIdentity = setIdentity;\n\t\t\tthis._origIndex = 3;\n\t\t\tthis._addIndex = 4;\n\t\t\tthis.cumulativeWeight = 0;\n\t\t\tthis.cumulativeWeightAdditive = 0;\n\t\t\tthis.useCount = 0;\n\t\t\tthis.referenceCount = 0;\n\t\t} // accumulate data in the 'incoming' region into 'accu<i>'\n\n\n\t\taccumulate(accuIndex, weight) {\n\t\t\t// note: happily accumulating nothing when weight = 0, the caller knows\n\t\t\t// the weight and shouldn't have made the call in the first place\n\t\t\tconst buffer = this.buffer,\n\t\t\t\t\t\tstride = this.valueSize,\n\t\t\t\t\t\toffset = accuIndex * stride + stride;\n\t\t\tlet currentWeight = this.cumulativeWeight;\n\n\t\t\tif (currentWeight === 0) {\n\t\t\t\t// accuN := incoming * weight\n\t\t\t\tfor (let i = 0; i !== stride; ++i) {\n\t\t\t\t\tbuffer[offset + i] = buffer[i];\n\t\t\t\t}\n\n\t\t\t\tcurrentWeight = weight;\n\t\t\t} else {\n\t\t\t\t// accuN := accuN + incoming * weight\n\t\t\t\tcurrentWeight += weight;\n\t\t\t\tconst mix = weight / currentWeight;\n\n\t\t\t\tthis._mixBufferRegion(buffer, offset, 0, mix, stride);\n\t\t\t}\n\n\t\t\tthis.cumulativeWeight = currentWeight;\n\t\t} // accumulate data in the 'incoming' region into 'add'\n\n\n\t\taccumulateAdditive(weight) {\n\t\t\tconst buffer = this.buffer,\n\t\t\t\t\t\tstride = this.valueSize,\n\t\t\t\t\t\toffset = stride * this._addIndex;\n\n\t\t\tif (this.cumulativeWeightAdditive === 0) {\n\t\t\t\t// add = identity\n\t\t\t\tthis._setIdentity();\n\t\t\t} // add := add + incoming * weight\n\n\n\t\t\tthis._mixBufferRegionAdditive(buffer, offset, 0, weight, stride);\n\n\t\t\tthis.cumulativeWeightAdditive += weight;\n\t\t} // apply the state of 'accu<i>' to the binding when accus differ\n\n\n\t\tapply(accuIndex) {\n\t\t\tconst stride = this.valueSize,\n\t\t\t\t\t\tbuffer = this.buffer,\n\t\t\t\t\t\toffset = accuIndex * stride + stride,\n\t\t\t\t\t\tweight = this.cumulativeWeight,\n\t\t\t\t\t\tweightAdditive = this.cumulativeWeightAdditive,\n\t\t\t\t\t\tbinding = this.binding;\n\t\t\tthis.cumulativeWeight = 0;\n\t\t\tthis.cumulativeWeightAdditive = 0;\n\n\t\t\tif (weight < 1) {\n\t\t\t\t// accuN := accuN + original * ( 1 - cumulativeWeight )\n\t\t\t\tconst originalValueOffset = stride * this._origIndex;\n\n\t\t\t\tthis._mixBufferRegion(buffer, offset, originalValueOffset, 1 - weight, stride);\n\t\t\t}\n\n\t\t\tif (weightAdditive > 0) {\n\t\t\t\t// accuN := accuN + additive accuN\n\t\t\t\tthis._mixBufferRegionAdditive(buffer, offset, this._addIndex * stride, 1, stride);\n\t\t\t}\n\n\t\t\tfor (let i = stride, e = stride + stride; i !== e; ++i) {\n\t\t\t\tif (buffer[i] !== buffer[i + stride]) {\n\t\t\t\t\t// value has changed -> update scene graph\n\t\t\t\t\tbinding.setValue(buffer, offset);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} // remember the state of the bound property and copy it to both accus\n\n\n\t\tsaveOriginalState() {\n\t\t\tconst binding = this.binding;\n\t\t\tconst buffer = this.buffer,\n\t\t\t\t\t\tstride = this.valueSize,\n\t\t\t\t\t\toriginalValueOffset = stride * this._origIndex;\n\t\t\tbinding.getValue(buffer, originalValueOffset); // accu[0..1] := orig -- initially detect changes against the original\n\n\t\t\tfor (let i = stride, e = originalValueOffset; i !== e; ++i) {\n\t\t\t\tbuffer[i] = buffer[originalValueOffset + i % stride];\n\t\t\t} // Add to identity for additive\n\n\n\t\t\tthis._setIdentity();\n\n\t\t\tthis.cumulativeWeight = 0;\n\t\t\tthis.cumulativeWeightAdditive = 0;\n\t\t} // apply the state previously taken via 'saveOriginalState' to the binding\n\n\n\t\trestoreOriginalState() {\n\t\t\tconst originalValueOffset = this.valueSize * 3;\n\t\t\tthis.binding.setValue(this.buffer, originalValueOffset);\n\t\t}\n\n\t\t_setAdditiveIdentityNumeric() {\n\t\t\tconst startIndex = this._addIndex * this.valueSize;\n\t\t\tconst endIndex = startIndex + this.valueSize;\n\n\t\t\tfor (let i = startIndex; i < endIndex; i++) {\n\t\t\t\tthis.buffer[i] = 0;\n\t\t\t}\n\t\t}\n\n\t\t_setAdditiveIdentityQuaternion() {\n\t\t\tthis._setAdditiveIdentityNumeric();\n\n\t\t\tthis.buffer[this._addIndex * this.valueSize + 3] = 1;\n\t\t}\n\n\t\t_setAdditiveIdentityOther() {\n\t\t\tconst startIndex = this._origIndex * this.valueSize;\n\t\t\tconst targetIndex = this._addIndex * this.valueSize;\n\n\t\t\tfor (let i = 0; i < this.valueSize; i++) {\n\t\t\t\tthis.buffer[targetIndex + i] = this.buffer[startIndex + i];\n\t\t\t}\n\t\t} // mix functions\n\n\n\t\t_select(buffer, dstOffset, srcOffset, t, stride) {\n\t\t\tif (t >= 0.5) {\n\t\t\t\tfor (let i = 0; i !== stride; ++i) {\n\t\t\t\t\tbuffer[dstOffset + i] = buffer[srcOffset + i];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t_slerp(buffer, dstOffset, srcOffset, t) {\n\t\t\tQuaternion.slerpFlat(buffer, dstOffset, buffer, dstOffset, buffer, srcOffset, t);\n\t\t}\n\n\t\t_slerpAdditive(buffer, dstOffset, srcOffset, t, stride) {\n\t\t\tconst workOffset = this._workIndex * stride; // Store result in intermediate buffer offset\n\n\t\t\tQuaternion.multiplyQuaternionsFlat(buffer, workOffset, buffer, dstOffset, buffer, srcOffset); // Slerp to the intermediate result\n\n\t\t\tQuaternion.slerpFlat(buffer, dstOffset, buffer, dstOffset, buffer, workOffset, t);\n\t\t}\n\n\t\t_lerp(buffer, dstOffset, srcOffset, t, stride) {\n\t\t\tconst s = 1 - t;\n\n\t\t\tfor (let i = 0; i !== stride; ++i) {\n\t\t\t\tconst j = dstOffset + i;\n\t\t\t\tbuffer[j] = buffer[j] * s + buffer[srcOffset + i] * t;\n\t\t\t}\n\t\t}\n\n\t\t_lerpAdditive(buffer, dstOffset, srcOffset, t, stride) {\n\t\t\tfor (let i = 0; i !== stride; ++i) {\n\t\t\t\tconst j = dstOffset + i;\n\t\t\t\tbuffer[j] = buffer[j] + buffer[srcOffset + i] * t;\n\t\t\t}\n\t\t}\n\n\t}\n\n\t// Characters [].:/ are reserved for track binding syntax.\n\tconst _RESERVED_CHARS_RE = '\\\\[\\\\]\\\\.:\\\\/';\n\n\tconst _reservedRe = new RegExp('[' + _RESERVED_CHARS_RE + ']', 'g'); // Attempts to allow node names from any language. ES5's `\\w` regexp matches\n\t// only latin characters, and the unicode \\p{L} is not yet supported. So\n\t// instead, we exclude reserved characters and match everything else.\n\n\n\tconst _wordChar = '[^' + _RESERVED_CHARS_RE + ']';\n\n\tconst _wordCharOrDot = '[^' + _RESERVED_CHARS_RE.replace('\\\\.', '') + ']'; // Parent directories, delimited by '/' or ':'. Currently unused, but must\n\t// be matched to parse the rest of the track name.\n\n\n\tconst _directoryRe = /((?:WC+[\\/:])*)/.source.replace('WC', _wordChar); // Target node. May contain word characters (a-zA-Z0-9_) and '.' or '-'.\n\n\n\tconst _nodeRe = /(WCOD+)?/.source.replace('WCOD', _wordCharOrDot); // Object on target node, and accessor. May not contain reserved\n\t// characters. Accessor may contain any character except closing bracket.\n\n\n\tconst _objectRe = /(?:\\.(WC+)(?:\\[(.+)\\])?)?/.source.replace('WC', _wordChar); // Property and accessor. May not contain reserved characters. Accessor may\n\t// contain any non-bracket characters.\n\n\n\tconst _propertyRe = /\\.(WC+)(?:\\[(.+)\\])?/.source.replace('WC', _wordChar);\n\n\tconst _trackRe = new RegExp('' + '^' + _directoryRe + _nodeRe + _objectRe + _propertyRe + '$');\n\n\tconst _supportedObjectNames = ['material', 'materials', 'bones'];\n\n\tclass Composite {\n\t\tconstructor(targetGroup, path, optionalParsedPath) {\n\t\t\tconst parsedPath = optionalParsedPath || PropertyBinding.parseTrackName(path);\n\t\t\tthis._targetGroup = targetGroup;\n\t\t\tthis._bindings = targetGroup.subscribe_(path, parsedPath);\n\t\t}\n\n\t\tgetValue(array, offset) {\n\t\t\tthis.bind(); // bind all binding\n\n\t\t\tconst firstValidIndex = this._targetGroup.nCachedObjects_,\n\t\t\t\t\t\tbinding = this._bindings[firstValidIndex]; // and only call .getValue on the first\n\n\t\t\tif (binding !== undefined) binding.getValue(array, offset);\n\t\t}\n\n\t\tsetValue(array, offset) {\n\t\t\tconst bindings = this._bindings;\n\n\t\t\tfor (let i = this._targetGroup.nCachedObjects_, n = bindings.length; i !== n; ++i) {\n\t\t\t\tbindings[i].setValue(array, offset);\n\t\t\t}\n\t\t}\n\n\t\tbind() {\n\t\t\tconst bindings = this._bindings;\n\n\t\t\tfor (let i = this._targetGroup.nCachedObjects_, n = bindings.length; i !== n; ++i) {\n\t\t\t\tbindings[i].bind();\n\t\t\t}\n\t\t}\n\n\t\tunbind() {\n\t\t\tconst bindings = this._bindings;\n\n\t\t\tfor (let i = this._targetGroup.nCachedObjects_, n = bindings.length; i !== n; ++i) {\n\t\t\t\tbindings[i].unbind();\n\t\t\t}\n\t\t}\n\n\t} // Note: This class uses a State pattern on a per-method basis:\n\t// 'bind' sets 'this.getValue' / 'setValue' and shadows the\n\t// prototype version of these methods with one that represents\n\t// the bound state. When the property is not found, the methods\n\t// become no-ops.\n\n\n\tclass PropertyBinding {\n\t\tconstructor(rootNode, path, parsedPath) {\n\t\t\tthis.path = path;\n\t\t\tthis.parsedPath = parsedPath || PropertyBinding.parseTrackName(path);\n\t\t\tthis.node = PropertyBinding.findNode(rootNode, this.parsedPath.nodeName) || rootNode;\n\t\t\tthis.rootNode = rootNode; // initial state of these methods that calls 'bind'\n\n\t\t\tthis.getValue = this._getValue_unbound;\n\t\t\tthis.setValue = this._setValue_unbound;\n\t\t}\n\n\t\tstatic create(root, path, parsedPath) {\n\t\t\tif (!(root && root.isAnimationObjectGroup)) {\n\t\t\t\treturn new PropertyBinding(root, path, parsedPath);\n\t\t\t} else {\n\t\t\t\treturn new PropertyBinding.Composite(root, path, parsedPath);\n\t\t\t}\n\t\t}\n\t\t/**\n\t\t * Replaces spaces with underscores and removes unsupported characters from\n\t\t * node names, to ensure compatibility with parseTrackName().\n\t\t *\n\t\t * @param {string} name Node name to be sanitized.\n\t\t * @return {string}\n\t\t */\n\n\n\t\tstatic sanitizeNodeName(name) {\n\t\t\treturn name.replace(/\\s/g, '_').replace(_reservedRe, '');\n\t\t}\n\n\t\tstatic parseTrackName(trackName) {\n\t\t\tconst matches = _trackRe.exec(trackName);\n\n\t\t\tif (!matches) {\n\t\t\t\tthrow new Error('PropertyBinding: Cannot parse trackName: ' + trackName);\n\t\t\t}\n\n\t\t\tconst results = {\n\t\t\t\t// directoryName: matches[ 1 ], // (tschw) currently unused\n\t\t\t\tnodeName: matches[2],\n\t\t\t\tobjectName: matches[3],\n\t\t\t\tobjectIndex: matches[4],\n\t\t\t\tpropertyName: matches[5],\n\t\t\t\t// required\n\t\t\t\tpropertyIndex: matches[6]\n\t\t\t};\n\t\t\tconst lastDot = results.nodeName && results.nodeName.lastIndexOf('.');\n\n\t\t\tif (lastDot !== undefined && lastDot !== -1) {\n\t\t\t\tconst objectName = results.nodeName.substring(lastDot + 1); // Object names must be checked against an allowlist. Otherwise, there\n\t\t\t\t// is no way to parse 'foo.bar.baz': 'baz' must be a property, but\n\t\t\t\t// 'bar' could be the objectName, or part of a nodeName (which can\n\t\t\t\t// include '.' characters).\n\n\t\t\t\tif (_supportedObjectNames.indexOf(objectName) !== -1) {\n\t\t\t\t\tresults.nodeName = results.nodeName.substring(0, lastDot);\n\t\t\t\t\tresults.objectName = objectName;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (results.propertyName === null || results.propertyName.length === 0) {\n\t\t\t\tthrow new Error('PropertyBinding: can not parse propertyName from trackName: ' + trackName);\n\t\t\t}\n\n\t\t\treturn results;\n\t\t}\n\n\t\tstatic findNode(root, nodeName) {\n\t\t\tif (!nodeName || nodeName === '' || nodeName === '.' || nodeName === -1 || nodeName === root.name || nodeName === root.uuid) {\n\t\t\t\treturn root;\n\t\t\t} // search into skeleton bones.\n\n\n\t\t\tif (root.skeleton) {\n\t\t\t\tconst bone = root.skeleton.getBoneByName(nodeName);\n\n\t\t\t\tif (bone !== undefined) {\n\t\t\t\t\treturn bone;\n\t\t\t\t}\n\t\t\t} // search into node subtree.\n\n\n\t\t\tif (root.children) {\n\t\t\t\tconst searchNodeSubtree = function (children) {\n\t\t\t\t\tfor (let i = 0; i < children.length; i++) {\n\t\t\t\t\t\tconst childNode = children[i];\n\n\t\t\t\t\t\tif (childNode.name === nodeName || childNode.uuid === nodeName) {\n\t\t\t\t\t\t\treturn childNode;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst result = searchNodeSubtree(childNode.children);\n\t\t\t\t\t\tif (result) return result;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn null;\n\t\t\t\t};\n\n\t\t\t\tconst subTreeNode = searchNodeSubtree(root.children);\n\n\t\t\t\tif (subTreeNode) {\n\t\t\t\t\treturn subTreeNode;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn null;\n\t\t} // these are used to \"bind\" a nonexistent property\n\n\n\t\t_getValue_unavailable() {}\n\n\t\t_setValue_unavailable() {} // Getters\n\n\n\t\t_getValue_direct(buffer, offset) {\n\t\t\tbuffer[offset] = this.targetObject[this.propertyName];\n\t\t}\n\n\t\t_getValue_array(buffer, offset) {\n\t\t\tconst source = this.resolvedProperty;\n\n\t\t\tfor (let i = 0, n = source.length; i !== n; ++i) {\n\t\t\t\tbuffer[offset++] = source[i];\n\t\t\t}\n\t\t}\n\n\t\t_getValue_arrayElement(buffer, offset) {\n\t\t\tbuffer[offset] = this.resolvedProperty[this.propertyIndex];\n\t\t}\n\n\t\t_getValue_toArray(buffer, offset) {\n\t\t\tthis.resolvedProperty.toArray(buffer, offset);\n\t\t} // Direct\n\n\n\t\t_setValue_direct(buffer, offset) {\n\t\t\tthis.targetObject[this.propertyName] = buffer[offset];\n\t\t}\n\n\t\t_setValue_direct_setNeedsUpdate(buffer, offset) {\n\t\t\tthis.targetObject[this.propertyName] = buffer[offset];\n\t\t\tthis.targetObject.needsUpdate = true;\n\t\t}\n\n\t\t_setValue_direct_setMatrixWorldNeedsUpdate(buffer, offset) {\n\t\t\tthis.targetObject[this.propertyName] = buffer[offset];\n\t\t\tthis.targetObject.matrixWorldNeedsUpdate = true;\n\t\t} // EntireArray\n\n\n\t\t_setValue_array(buffer, offset) {\n\t\t\tconst dest = this.resolvedProperty;\n\n\t\t\tfor (let i = 0, n = dest.length; i !== n; ++i) {\n\t\t\t\tdest[i] = buffer[offset++];\n\t\t\t}\n\t\t}\n\n\t\t_setValue_array_setNeedsUpdate(buffer, offset) {\n\t\t\tconst dest = this.resolvedProperty;\n\n\t\t\tfor (let i = 0, n = dest.length; i !== n; ++i) {\n\t\t\t\tdest[i] = buffer[offset++];\n\t\t\t}\n\n\t\t\tthis.targetObject.needsUpdate = true;\n\t\t}\n\n\t\t_setValue_array_setMatrixWorldNeedsUpdate(buffer, offset) {\n\t\t\tconst dest = this.resolvedProperty;\n\n\t\t\tfor (let i = 0, n = dest.length; i !== n; ++i) {\n\t\t\t\tdest[i] = buffer[offset++];\n\t\t\t}\n\n\t\t\tthis.targetObject.matrixWorldNeedsUpdate = true;\n\t\t} // ArrayElement\n\n\n\t\t_setValue_arrayElement(buffer, offset) {\n\t\t\tthis.resolvedProperty[this.propertyIndex] = buffer[offset];\n\t\t}\n\n\t\t_setValue_arrayElement_setNeedsUpdate(buffer, offset) {\n\t\t\tthis.resolvedProperty[this.propertyIndex] = buffer[offset];\n\t\t\tthis.targetObject.needsUpdate = true;\n\t\t}\n\n\t\t_setValue_arrayElement_setMatrixWorldNeedsUpdate(buffer, offset) {\n\t\t\tthis.resolvedProperty[this.propertyIndex] = buffer[offset];\n\t\t\tthis.targetObject.matrixWorldNeedsUpdate = true;\n\t\t} // HasToFromArray\n\n\n\t\t_setValue_fromArray(buffer, offset) {\n\t\t\tthis.resolvedProperty.fromArray(buffer, offset);\n\t\t}\n\n\t\t_setValue_fromArray_setNeedsUpdate(buffer, offset) {\n\t\t\tthis.resolvedProperty.fromArray(buffer, offset);\n\t\t\tthis.targetObject.needsUpdate = true;\n\t\t}\n\n\t\t_setValue_fromArray_setMatrixWorldNeedsUpdate(buffer, offset) {\n\t\t\tthis.resolvedProperty.fromArray(buffer, offset);\n\t\t\tthis.targetObject.matrixWorldNeedsUpdate = true;\n\t\t}\n\n\t\t_getValue_unbound(targetArray, offset) {\n\t\t\tthis.bind();\n\t\t\tthis.getValue(targetArray, offset);\n\t\t}\n\n\t\t_setValue_unbound(sourceArray, offset) {\n\t\t\tthis.bind();\n\t\t\tthis.setValue(sourceArray, offset);\n\t\t} // create getter / setter pair for a property in the scene graph\n\n\n\t\tbind() {\n\t\t\tlet targetObject = this.node;\n\t\t\tconst parsedPath = this.parsedPath;\n\t\t\tconst objectName = parsedPath.objectName;\n\t\t\tconst propertyName = parsedPath.propertyName;\n\t\t\tlet propertyIndex = parsedPath.propertyIndex;\n\n\t\t\tif (!targetObject) {\n\t\t\t\ttargetObject = PropertyBinding.findNode(this.rootNode, parsedPath.nodeName) || this.rootNode;\n\t\t\t\tthis.node = targetObject;\n\t\t\t} // set fail state so we can just 'return' on error\n\n\n\t\t\tthis.getValue = this._getValue_unavailable;\n\t\t\tthis.setValue = this._setValue_unavailable; // ensure there is a value node\n\n\t\t\tif (!targetObject) {\n\t\t\t\tconsole.error('THREE.PropertyBinding: Trying to update node for track: ' + this.path + ' but it wasn\\'t found.');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (objectName) {\n\t\t\t\tlet objectIndex = parsedPath.objectIndex; // special cases were we need to reach deeper into the hierarchy to get the face materials....\n\n\t\t\t\tswitch (objectName) {\n\t\t\t\t\tcase 'materials':\n\t\t\t\t\t\tif (!targetObject.material) {\n\t\t\t\t\t\t\tconsole.error('THREE.PropertyBinding: Can not bind to material as node does not have a material.', this);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (!targetObject.material.materials) {\n\t\t\t\t\t\t\tconsole.error('THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.', this);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttargetObject = targetObject.material.materials;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'bones':\n\t\t\t\t\t\tif (!targetObject.skeleton) {\n\t\t\t\t\t\t\tconsole.error('THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.', this);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t} // potential future optimization: skip this if propertyIndex is already an integer\n\t\t\t\t\t\t// and convert the integer string to a true integer.\n\n\n\t\t\t\t\t\ttargetObject = targetObject.skeleton.bones; // support resolving morphTarget names into indices.\n\n\t\t\t\t\t\tfor (let i = 0; i < targetObject.length; i++) {\n\t\t\t\t\t\t\tif (targetObject[i].name === objectIndex) {\n\t\t\t\t\t\t\t\tobjectIndex = i;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tif (targetObject[objectName] === undefined) {\n\t\t\t\t\t\t\tconsole.error('THREE.PropertyBinding: Can not bind to objectName of node undefined.', this);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttargetObject = targetObject[objectName];\n\t\t\t\t}\n\n\t\t\t\tif (objectIndex !== undefined) {\n\t\t\t\t\tif (targetObject[objectIndex] === undefined) {\n\t\t\t\t\t\tconsole.error('THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.', this, targetObject);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\ttargetObject = targetObject[objectIndex];\n\t\t\t\t}\n\t\t\t} // resolve property\n\n\n\t\t\tconst nodeProperty = targetObject[propertyName];\n\n\t\t\tif (nodeProperty === undefined) {\n\t\t\t\tconst nodeName = parsedPath.nodeName;\n\t\t\t\tconsole.error('THREE.PropertyBinding: Trying to update property for track: ' + nodeName + '.' + propertyName + ' but it wasn\\'t found.', targetObject);\n\t\t\t\treturn;\n\t\t\t} // determine versioning scheme\n\n\n\t\t\tlet versioning = this.Versioning.None;\n\t\t\tthis.targetObject = targetObject;\n\n\t\t\tif (targetObject.needsUpdate !== undefined) {\n\t\t\t\t// material\n\t\t\t\tversioning = this.Versioning.NeedsUpdate;\n\t\t\t} else if (targetObject.matrixWorldNeedsUpdate !== undefined) {\n\t\t\t\t// node transform\n\t\t\t\tversioning = this.Versioning.MatrixWorldNeedsUpdate;\n\t\t\t} // determine how the property gets bound\n\n\n\t\t\tlet bindingType = this.BindingType.Direct;\n\n\t\t\tif (propertyIndex !== undefined) {\n\t\t\t\t// access a sub element of the property array (only primitives are supported right now)\n\t\t\t\tif (propertyName === 'morphTargetInfluences') {\n\t\t\t\t\t// potential optimization, skip this if propertyIndex is already an integer, and convert the integer string to a true integer.\n\t\t\t\t\t// support resolving morphTarget names into indices.\n\t\t\t\t\tif (!targetObject.geometry) {\n\t\t\t\t\t\tconsole.error('THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.', this);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (targetObject.geometry.isBufferGeometry) {\n\t\t\t\t\t\tif (!targetObject.geometry.morphAttributes) {\n\t\t\t\t\t\t\tconsole.error('THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.', this);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (targetObject.morphTargetDictionary[propertyIndex] !== undefined) {\n\t\t\t\t\t\t\tpropertyIndex = targetObject.morphTargetDictionary[propertyIndex];\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconsole.error('THREE.PropertyBinding: Can not bind to morphTargetInfluences on THREE.Geometry. Use THREE.BufferGeometry instead.', this);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tbindingType = this.BindingType.ArrayElement;\n\t\t\t\tthis.resolvedProperty = nodeProperty;\n\t\t\t\tthis.propertyIndex = propertyIndex;\n\t\t\t} else if (nodeProperty.fromArray !== undefined && nodeProperty.toArray !== undefined) {\n\t\t\t\t// must use copy for Object3D.Euler/Quaternion\n\t\t\t\tbindingType = this.BindingType.HasFromToArray;\n\t\t\t\tthis.resolvedProperty = nodeProperty;\n\t\t\t} else if (Array.isArray(nodeProperty)) {\n\t\t\t\tbindingType = this.BindingType.EntireArray;\n\t\t\t\tthis.resolvedProperty = nodeProperty;\n\t\t\t} else {\n\t\t\t\tthis.propertyName = propertyName;\n\t\t\t} // select getter / setter\n\n\n\t\t\tthis.getValue = this.GetterByBindingType[bindingType];\n\t\t\tthis.setValue = this.SetterByBindingTypeAndVersioning[bindingType][versioning];\n\t\t}\n\n\t\tunbind() {\n\t\t\tthis.node = null; // back to the prototype version of getValue / setValue\n\t\t\t// note: avoiding to mutate the shape of 'this' via 'delete'\n\n\t\t\tthis.getValue = this._getValue_unbound;\n\t\t\tthis.setValue = this._setValue_unbound;\n\t\t}\n\n\t}\n\n\tPropertyBinding.Composite = Composite;\n\tPropertyBinding.prototype.BindingType = {\n\t\tDirect: 0,\n\t\tEntireArray: 1,\n\t\tArrayElement: 2,\n\t\tHasFromToArray: 3\n\t};\n\tPropertyBinding.prototype.Versioning = {\n\t\tNone: 0,\n\t\tNeedsUpdate: 1,\n\t\tMatrixWorldNeedsUpdate: 2\n\t};\n\tPropertyBinding.prototype.GetterByBindingType = [PropertyBinding.prototype._getValue_direct, PropertyBinding.prototype._getValue_array, PropertyBinding.prototype._getValue_arrayElement, PropertyBinding.prototype._getValue_toArray];\n\tPropertyBinding.prototype.SetterByBindingTypeAndVersioning = [[// Direct\n\tPropertyBinding.prototype._setValue_direct, PropertyBinding.prototype._setValue_direct_setNeedsUpdate, PropertyBinding.prototype._setValue_direct_setMatrixWorldNeedsUpdate], [// EntireArray\n\tPropertyBinding.prototype._setValue_array, PropertyBinding.prototype._setValue_array_setNeedsUpdate, PropertyBinding.prototype._setValue_array_setMatrixWorldNeedsUpdate], [// ArrayElement\n\tPropertyBinding.prototype._setValue_arrayElement, PropertyBinding.prototype._setValue_arrayElement_setNeedsUpdate, PropertyBinding.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate], [// HasToFromArray\n\tPropertyBinding.prototype._setValue_fromArray, PropertyBinding.prototype._setValue_fromArray_setNeedsUpdate, PropertyBinding.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];\n\n\t/**\n\t *\n\t * A group of objects that receives a shared animation state.\n\t *\n\t * Usage:\n\t *\n\t *\t- Add objects you would otherwise pass as 'root' to the\n\t *\t\tconstructor or the .clipAction method of AnimationMixer.\n\t *\n\t *\t- Instead pass this object as 'root'.\n\t *\n\t *\t- You can also add and remove objects later when the mixer\n\t *\t\tis running.\n\t *\n\t * Note:\n\t *\n\t *\t\tObjects of this class appear as one object to the mixer,\n\t *\t\tso cache control of the individual objects must be done\n\t *\t\ton the group.\n\t *\n\t * Limitation:\n\t *\n\t *\t- The animated properties must be compatible among the\n\t *\t\tall objects in the group.\n\t *\n\t *\t- A single property can either be controlled through a\n\t *\t\ttarget group or directly, but not both.\n\t */\n\n\tclass AnimationObjectGroup {\n\t\tconstructor() {\n\t\t\tthis.uuid = generateUUID(); // cached objects followed by the active ones\n\n\t\t\tthis._objects = Array.prototype.slice.call(arguments);\n\t\t\tthis.nCachedObjects_ = 0; // threshold\n\t\t\t// note: read by PropertyBinding.Composite\n\n\t\t\tconst indices = {};\n\t\t\tthis._indicesByUUID = indices; // for bookkeeping\n\n\t\t\tfor (let i = 0, n = arguments.length; i !== n; ++i) {\n\t\t\t\tindices[arguments[i].uuid] = i;\n\t\t\t}\n\n\t\t\tthis._paths = []; // inside: string\n\n\t\t\tthis._parsedPaths = []; // inside: { we don't care, here }\n\n\t\t\tthis._bindings = []; // inside: Array< PropertyBinding >\n\n\t\t\tthis._bindingsIndicesByPath = {}; // inside: indices in these arrays\n\n\t\t\tconst scope = this;\n\t\t\tthis.stats = {\n\t\t\t\tobjects: {\n\t\t\t\t\tget total() {\n\t\t\t\t\t\treturn scope._objects.length;\n\t\t\t\t\t},\n\n\t\t\t\t\tget inUse() {\n\t\t\t\t\t\treturn this.total - scope.nCachedObjects_;\n\t\t\t\t\t}\n\n\t\t\t\t},\n\n\t\t\t\tget bindingsPerObject() {\n\t\t\t\t\treturn scope._bindings.length;\n\t\t\t\t}\n\n\t\t\t};\n\t\t}\n\n\t\tadd() {\n\t\t\tconst objects = this._objects,\n\t\t\t\t\t\tindicesByUUID = this._indicesByUUID,\n\t\t\t\t\t\tpaths = this._paths,\n\t\t\t\t\t\tparsedPaths = this._parsedPaths,\n\t\t\t\t\t\tbindings = this._bindings,\n\t\t\t\t\t\tnBindings = bindings.length;\n\t\t\tlet knownObject = undefined,\n\t\t\t\t\tnObjects = objects.length,\n\t\t\t\t\tnCachedObjects = this.nCachedObjects_;\n\n\t\t\tfor (let i = 0, n = arguments.length; i !== n; ++i) {\n\t\t\t\tconst object = arguments[i],\n\t\t\t\t\t\t\tuuid = object.uuid;\n\t\t\t\tlet index = indicesByUUID[uuid];\n\n\t\t\t\tif (index === undefined) {\n\t\t\t\t\t// unknown object -> add it to the ACTIVE region\n\t\t\t\t\tindex = nObjects++;\n\t\t\t\t\tindicesByUUID[uuid] = index;\n\t\t\t\t\tobjects.push(object); // accounting is done, now do the same for all bindings\n\n\t\t\t\t\tfor (let j = 0, m = nBindings; j !== m; ++j) {\n\t\t\t\t\t\tbindings[j].push(new PropertyBinding(object, paths[j], parsedPaths[j]));\n\t\t\t\t\t}\n\t\t\t\t} else if (index < nCachedObjects) {\n\t\t\t\t\tknownObject = objects[index]; // move existing object to the ACTIVE region\n\n\t\t\t\t\tconst firstActiveIndex = --nCachedObjects,\n\t\t\t\t\t\t\t\tlastCachedObject = objects[firstActiveIndex];\n\t\t\t\t\tindicesByUUID[lastCachedObject.uuid] = index;\n\t\t\t\t\tobjects[index] = lastCachedObject;\n\t\t\t\t\tindicesByUUID[uuid] = firstActiveIndex;\n\t\t\t\t\tobjects[firstActiveIndex] = object; // accounting is done, now do the same for all bindings\n\n\t\t\t\t\tfor (let j = 0, m = nBindings; j !== m; ++j) {\n\t\t\t\t\t\tconst bindingsForPath = bindings[j],\n\t\t\t\t\t\t\t\t\tlastCached = bindingsForPath[firstActiveIndex];\n\t\t\t\t\t\tlet binding = bindingsForPath[index];\n\t\t\t\t\t\tbindingsForPath[index] = lastCached;\n\n\t\t\t\t\t\tif (binding === undefined) {\n\t\t\t\t\t\t\t// since we do not bother to create new bindings\n\t\t\t\t\t\t\t// for objects that are cached, the binding may\n\t\t\t\t\t\t\t// or may not exist\n\t\t\t\t\t\t\tbinding = new PropertyBinding(object, paths[j], parsedPaths[j]);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbindingsForPath[firstActiveIndex] = binding;\n\t\t\t\t\t}\n\t\t\t\t} else if (objects[index] !== knownObject) {\n\t\t\t\t\tconsole.error('THREE.AnimationObjectGroup: Different objects with the same UUID ' + 'detected. Clean the caches or recreate your infrastructure when reloading scenes.');\n\t\t\t\t} // else the object is already where we want it to be\n\n\t\t\t} // for arguments\n\n\n\t\t\tthis.nCachedObjects_ = nCachedObjects;\n\t\t}\n\n\t\tremove() {\n\t\t\tconst objects = this._objects,\n\t\t\t\t\t\tindicesByUUID = this._indicesByUUID,\n\t\t\t\t\t\tbindings = this._bindings,\n\t\t\t\t\t\tnBindings = bindings.length;\n\t\t\tlet nCachedObjects = this.nCachedObjects_;\n\n\t\t\tfor (let i = 0, n = arguments.length; i !== n; ++i) {\n\t\t\t\tconst object = arguments[i],\n\t\t\t\t\t\t\tuuid = object.uuid,\n\t\t\t\t\t\t\tindex = indicesByUUID[uuid];\n\n\t\t\t\tif (index !== undefined && index >= nCachedObjects) {\n\t\t\t\t\t// move existing object into the CACHED region\n\t\t\t\t\tconst lastCachedIndex = nCachedObjects++,\n\t\t\t\t\t\t\t\tfirstActiveObject = objects[lastCachedIndex];\n\t\t\t\t\tindicesByUUID[firstActiveObject.uuid] = index;\n\t\t\t\t\tobjects[index] = firstActiveObject;\n\t\t\t\t\tindicesByUUID[uuid] = lastCachedIndex;\n\t\t\t\t\tobjects[lastCachedIndex] = object; // accounting is done, now do the same for all bindings\n\n\t\t\t\t\tfor (let j = 0, m = nBindings; j !== m; ++j) {\n\t\t\t\t\t\tconst bindingsForPath = bindings[j],\n\t\t\t\t\t\t\t\t\tfirstActive = bindingsForPath[lastCachedIndex],\n\t\t\t\t\t\t\t\t\tbinding = bindingsForPath[index];\n\t\t\t\t\t\tbindingsForPath[index] = firstActive;\n\t\t\t\t\t\tbindingsForPath[lastCachedIndex] = binding;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} // for arguments\n\n\n\t\t\tthis.nCachedObjects_ = nCachedObjects;\n\t\t} // remove & forget\n\n\n\t\tuncache() {\n\t\t\tconst objects = this._objects,\n\t\t\t\t\t\tindicesByUUID = this._indicesByUUID,\n\t\t\t\t\t\tbindings = this._bindings,\n\t\t\t\t\t\tnBindings = bindings.length;\n\t\t\tlet nCachedObjects = this.nCachedObjects_,\n\t\t\t\t\tnObjects = objects.length;\n\n\t\t\tfor (let i = 0, n = arguments.length; i !== n; ++i) {\n\t\t\t\tconst object = arguments[i],\n\t\t\t\t\t\t\tuuid = object.uuid,\n\t\t\t\t\t\t\tindex = indicesByUUID[uuid];\n\n\t\t\t\tif (index !== undefined) {\n\t\t\t\t\tdelete indicesByUUID[uuid];\n\n\t\t\t\t\tif (index < nCachedObjects) {\n\t\t\t\t\t\t// object is cached, shrink the CACHED region\n\t\t\t\t\t\tconst firstActiveIndex = --nCachedObjects,\n\t\t\t\t\t\t\t\t\tlastCachedObject = objects[firstActiveIndex],\n\t\t\t\t\t\t\t\t\tlastIndex = --nObjects,\n\t\t\t\t\t\t\t\t\tlastObject = objects[lastIndex]; // last cached object takes this object's place\n\n\t\t\t\t\t\tindicesByUUID[lastCachedObject.uuid] = index;\n\t\t\t\t\t\tobjects[index] = lastCachedObject; // last object goes to the activated slot and pop\n\n\t\t\t\t\t\tindicesByUUID[lastObject.uuid] = firstActiveIndex;\n\t\t\t\t\t\tobjects[firstActiveIndex] = lastObject;\n\t\t\t\t\t\tobjects.pop(); // accounting is done, now do the same for all bindings\n\n\t\t\t\t\t\tfor (let j = 0, m = nBindings; j !== m; ++j) {\n\t\t\t\t\t\t\tconst bindingsForPath = bindings[j],\n\t\t\t\t\t\t\t\t\t\tlastCached = bindingsForPath[firstActiveIndex],\n\t\t\t\t\t\t\t\t\t\tlast = bindingsForPath[lastIndex];\n\t\t\t\t\t\t\tbindingsForPath[index] = lastCached;\n\t\t\t\t\t\t\tbindingsForPath[firstActiveIndex] = last;\n\t\t\t\t\t\t\tbindingsForPath.pop();\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// object is active, just swap with the last and pop\n\t\t\t\t\t\tconst lastIndex = --nObjects,\n\t\t\t\t\t\t\t\t\tlastObject = objects[lastIndex];\n\n\t\t\t\t\t\tif (lastIndex > 0) {\n\t\t\t\t\t\t\tindicesByUUID[lastObject.uuid] = index;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tobjects[index] = lastObject;\n\t\t\t\t\t\tobjects.pop(); // accounting is done, now do the same for all bindings\n\n\t\t\t\t\t\tfor (let j = 0, m = nBindings; j !== m; ++j) {\n\t\t\t\t\t\t\tconst bindingsForPath = bindings[j];\n\t\t\t\t\t\t\tbindingsForPath[index] = bindingsForPath[lastIndex];\n\t\t\t\t\t\t\tbindingsForPath.pop();\n\t\t\t\t\t\t}\n\t\t\t\t\t} // cached or active\n\n\t\t\t\t} // if object is known\n\n\t\t\t} // for arguments\n\n\n\t\t\tthis.nCachedObjects_ = nCachedObjects;\n\t\t} // Internal interface used by befriended PropertyBinding.Composite:\n\n\n\t\tsubscribe_(path, parsedPath) {\n\t\t\t// returns an array of bindings for the given path that is changed\n\t\t\t// according to the contained objects in the group\n\t\t\tconst indicesByPath = this._bindingsIndicesByPath;\n\t\t\tlet index = indicesByPath[path];\n\t\t\tconst bindings = this._bindings;\n\t\t\tif (index !== undefined) return bindings[index];\n\t\t\tconst paths = this._paths,\n\t\t\t\t\t\tparsedPaths = this._parsedPaths,\n\t\t\t\t\t\tobjects = this._objects,\n\t\t\t\t\t\tnObjects = objects.length,\n\t\t\t\t\t\tnCachedObjects = this.nCachedObjects_,\n\t\t\t\t\t\tbindingsForPath = new Array(nObjects);\n\t\t\tindex = bindings.length;\n\t\t\tindicesByPath[path] = index;\n\t\t\tpaths.push(path);\n\t\t\tparsedPaths.push(parsedPath);\n\t\t\tbindings.push(bindingsForPath);\n\n\t\t\tfor (let i = nCachedObjects, n = objects.length; i !== n; ++i) {\n\t\t\t\tconst object = objects[i];\n\t\t\t\tbindingsForPath[i] = new PropertyBinding(object, path, parsedPath);\n\t\t\t}\n\n\t\t\treturn bindingsForPath;\n\t\t}\n\n\t\tunsubscribe_(path) {\n\t\t\t// tells the group to forget about a property path and no longer\n\t\t\t// update the array previously obtained with 'subscribe_'\n\t\t\tconst indicesByPath = this._bindingsIndicesByPath,\n\t\t\t\t\t\tindex = indicesByPath[path];\n\n\t\t\tif (index !== undefined) {\n\t\t\t\tconst paths = this._paths,\n\t\t\t\t\t\t\tparsedPaths = this._parsedPaths,\n\t\t\t\t\t\t\tbindings = this._bindings,\n\t\t\t\t\t\t\tlastBindingsIndex = bindings.length - 1,\n\t\t\t\t\t\t\tlastBindings = bindings[lastBindingsIndex],\n\t\t\t\t\t\t\tlastBindingsPath = path[lastBindingsIndex];\n\t\t\t\tindicesByPath[lastBindingsPath] = index;\n\t\t\t\tbindings[index] = lastBindings;\n\t\t\t\tbindings.pop();\n\t\t\t\tparsedPaths[index] = parsedPaths[lastBindingsIndex];\n\t\t\t\tparsedPaths.pop();\n\t\t\t\tpaths[index] = paths[lastBindingsIndex];\n\t\t\t\tpaths.pop();\n\t\t\t}\n\t\t}\n\n\t}\n\n\tAnimationObjectGroup.prototype.isAnimationObjectGroup = true;\n\n\tclass AnimationAction {\n\t\tconstructor(mixer, clip, localRoot = null, blendMode = clip.blendMode) {\n\t\t\tthis._mixer = mixer;\n\t\t\tthis._clip = clip;\n\t\t\tthis._localRoot = localRoot;\n\t\t\tthis.blendMode = blendMode;\n\t\t\tconst tracks = clip.tracks,\n\t\t\t\t\t\tnTracks = tracks.length,\n\t\t\t\t\t\tinterpolants = new Array(nTracks);\n\t\t\tconst interpolantSettings = {\n\t\t\t\tendingStart: ZeroCurvatureEnding,\n\t\t\t\tendingEnd: ZeroCurvatureEnding\n\t\t\t};\n\n\t\t\tfor (let i = 0; i !== nTracks; ++i) {\n\t\t\t\tconst interpolant = tracks[i].createInterpolant(null);\n\t\t\t\tinterpolants[i] = interpolant;\n\t\t\t\tinterpolant.settings = interpolantSettings;\n\t\t\t}\n\n\t\t\tthis._interpolantSettings = interpolantSettings;\n\t\t\tthis._interpolants = interpolants; // bound by the mixer\n\t\t\t// inside: PropertyMixer (managed by the mixer)\n\n\t\t\tthis._propertyBindings = new Array(nTracks);\n\t\t\tthis._cacheIndex = null; // for the memory manager\n\n\t\t\tthis._byClipCacheIndex = null; // for the memory manager\n\n\t\t\tthis._timeScaleInterpolant = null;\n\t\t\tthis._weightInterpolant = null;\n\t\t\tthis.loop = LoopRepeat;\n\t\t\tthis._loopCount = -1; // global mixer time when the action is to be started\n\t\t\t// it's set back to 'null' upon start of the action\n\n\t\t\tthis._startTime = null; // scaled local time of the action\n\t\t\t// gets clamped or wrapped to 0..clip.duration according to loop\n\n\t\t\tthis.time = 0;\n\t\t\tthis.timeScale = 1;\n\t\t\tthis._effectiveTimeScale = 1;\n\t\t\tthis.weight = 1;\n\t\t\tthis._effectiveWeight = 1;\n\t\t\tthis.repetitions = Infinity; // no. of repetitions when looping\n\n\t\t\tthis.paused = false; // true -> zero effective time scale\n\n\t\t\tthis.enabled = true; // false -> zero effective weight\n\n\t\t\tthis.clampWhenFinished = false; // keep feeding the last frame?\n\n\t\t\tthis.zeroSlopeAtStart = true; // for smooth interpolation w/o separate\n\n\t\t\tthis.zeroSlopeAtEnd = true; // clips for start, loop and end\n\t\t} // State & Scheduling\n\n\n\t\tplay() {\n\t\t\tthis._mixer._activateAction(this);\n\n\t\t\treturn this;\n\t\t}\n\n\t\tstop() {\n\t\t\tthis._mixer._deactivateAction(this);\n\n\t\t\treturn this.reset();\n\t\t}\n\n\t\treset() {\n\t\t\tthis.paused = false;\n\t\t\tthis.enabled = true;\n\t\t\tthis.time = 0; // restart clip\n\n\t\t\tthis._loopCount = -1; // forget previous loops\n\n\t\t\tthis._startTime = null; // forget scheduling\n\n\t\t\treturn this.stopFading().stopWarping();\n\t\t}\n\n\t\tisRunning() {\n\t\t\treturn this.enabled && !this.paused && this.timeScale !== 0 && this._startTime === null && this._mixer._isActiveAction(this);\n\t\t} // return true when play has been called\n\n\n\t\tisScheduled() {\n\t\t\treturn this._mixer._isActiveAction(this);\n\t\t}\n\n\t\tstartAt(time) {\n\t\t\tthis._startTime = time;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetLoop(mode, repetitions) {\n\t\t\tthis.loop = mode;\n\t\t\tthis.repetitions = repetitions;\n\t\t\treturn this;\n\t\t} // Weight\n\t\t// set the weight stopping any scheduled fading\n\t\t// although .enabled = false yields an effective weight of zero, this\n\t\t// method does *not* change .enabled, because it would be confusing\n\n\n\t\tsetEffectiveWeight(weight) {\n\t\t\tthis.weight = weight; // note: same logic as when updated at runtime\n\n\t\t\tthis._effectiveWeight = this.enabled ? weight : 0;\n\t\t\treturn this.stopFading();\n\t\t} // return the weight considering fading and .enabled\n\n\n\t\tgetEffectiveWeight() {\n\t\t\treturn this._effectiveWeight;\n\t\t}\n\n\t\tfadeIn(duration) {\n\t\t\treturn this._scheduleFading(duration, 0, 1);\n\t\t}\n\n\t\tfadeOut(duration) {\n\t\t\treturn this._scheduleFading(duration, 1, 0);\n\t\t}\n\n\t\tcrossFadeFrom(fadeOutAction, duration, warp) {\n\t\t\tfadeOutAction.fadeOut(duration);\n\t\t\tthis.fadeIn(duration);\n\n\t\t\tif (warp) {\n\t\t\t\tconst fadeInDuration = this._clip.duration,\n\t\t\t\t\t\t\tfadeOutDuration = fadeOutAction._clip.duration,\n\t\t\t\t\t\t\tstartEndRatio = fadeOutDuration / fadeInDuration,\n\t\t\t\t\t\t\tendStartRatio = fadeInDuration / fadeOutDuration;\n\t\t\t\tfadeOutAction.warp(1.0, startEndRatio, duration);\n\t\t\t\tthis.warp(endStartRatio, 1.0, duration);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tcrossFadeTo(fadeInAction, duration, warp) {\n\t\t\treturn fadeInAction.crossFadeFrom(this, duration, warp);\n\t\t}\n\n\t\tstopFading() {\n\t\t\tconst weightInterpolant = this._weightInterpolant;\n\n\t\t\tif (weightInterpolant !== null) {\n\t\t\t\tthis._weightInterpolant = null;\n\n\t\t\t\tthis._mixer._takeBackControlInterpolant(weightInterpolant);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t} // Time Scale Control\n\t\t// set the time scale stopping any scheduled warping\n\t\t// although .paused = true yields an effective time scale of zero, this\n\t\t// method does *not* change .paused, because it would be confusing\n\n\n\t\tsetEffectiveTimeScale(timeScale) {\n\t\t\tthis.timeScale = timeScale;\n\t\t\tthis._effectiveTimeScale = this.paused ? 0 : timeScale;\n\t\t\treturn this.stopWarping();\n\t\t} // return the time scale considering warping and .paused\n\n\n\t\tgetEffectiveTimeScale() {\n\t\t\treturn this._effectiveTimeScale;\n\t\t}\n\n\t\tsetDuration(duration) {\n\t\t\tthis.timeScale = this._clip.duration / duration;\n\t\t\treturn this.stopWarping();\n\t\t}\n\n\t\tsyncWith(action) {\n\t\t\tthis.time = action.time;\n\t\t\tthis.timeScale = action.timeScale;\n\t\t\treturn this.stopWarping();\n\t\t}\n\n\t\thalt(duration) {\n\t\t\treturn this.warp(this._effectiveTimeScale, 0, duration);\n\t\t}\n\n\t\twarp(startTimeScale, endTimeScale, duration) {\n\t\t\tconst mixer = this._mixer,\n\t\t\t\t\t\tnow = mixer.time,\n\t\t\t\t\t\ttimeScale = this.timeScale;\n\t\t\tlet interpolant = this._timeScaleInterpolant;\n\n\t\t\tif (interpolant === null) {\n\t\t\t\tinterpolant = mixer._lendControlInterpolant();\n\t\t\t\tthis._timeScaleInterpolant = interpolant;\n\t\t\t}\n\n\t\t\tconst times = interpolant.parameterPositions,\n\t\t\t\t\t\tvalues = interpolant.sampleValues;\n\t\t\ttimes[0] = now;\n\t\t\ttimes[1] = now + duration;\n\t\t\tvalues[0] = startTimeScale / timeScale;\n\t\t\tvalues[1] = endTimeScale / timeScale;\n\t\t\treturn this;\n\t\t}\n\n\t\tstopWarping() {\n\t\t\tconst timeScaleInterpolant = this._timeScaleInterpolant;\n\n\t\t\tif (timeScaleInterpolant !== null) {\n\t\t\t\tthis._timeScaleInterpolant = null;\n\n\t\t\t\tthis._mixer._takeBackControlInterpolant(timeScaleInterpolant);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t} // Object Accessors\n\n\n\t\tgetMixer() {\n\t\t\treturn this._mixer;\n\t\t}\n\n\t\tgetClip() {\n\t\t\treturn this._clip;\n\t\t}\n\n\t\tgetRoot() {\n\t\t\treturn this._localRoot || this._mixer._root;\n\t\t} // Interna\n\n\n\t\t_update(time, deltaTime, timeDirection, accuIndex) {\n\t\t\t// called by the mixer\n\t\t\tif (!this.enabled) {\n\t\t\t\t// call ._updateWeight() to update ._effectiveWeight\n\t\t\t\tthis._updateWeight(time);\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst startTime = this._startTime;\n\n\t\t\tif (startTime !== null) {\n\t\t\t\t// check for scheduled start of action\n\t\t\t\tconst timeRunning = (time - startTime) * timeDirection;\n\n\t\t\t\tif (timeRunning < 0 || timeDirection === 0) {\n\t\t\t\t\treturn; // yet to come / don't decide when delta = 0\n\t\t\t\t} // start\n\n\n\t\t\t\tthis._startTime = null; // unschedule\n\n\t\t\t\tdeltaTime = timeDirection * timeRunning;\n\t\t\t} // apply time scale and advance time\n\n\n\t\t\tdeltaTime *= this._updateTimeScale(time);\n\n\t\t\tconst clipTime = this._updateTime(deltaTime); // note: _updateTime may disable the action resulting in\n\t\t\t// an effective weight of 0\n\n\n\t\t\tconst weight = this._updateWeight(time);\n\n\t\t\tif (weight > 0) {\n\t\t\t\tconst interpolants = this._interpolants;\n\t\t\t\tconst propertyMixers = this._propertyBindings;\n\n\t\t\t\tswitch (this.blendMode) {\n\t\t\t\t\tcase AdditiveAnimationBlendMode:\n\t\t\t\t\t\tfor (let j = 0, m = interpolants.length; j !== m; ++j) {\n\t\t\t\t\t\t\tinterpolants[j].evaluate(clipTime);\n\t\t\t\t\t\t\tpropertyMixers[j].accumulateAdditive(weight);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase NormalAnimationBlendMode:\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tfor (let j = 0, m = interpolants.length; j !== m; ++j) {\n\t\t\t\t\t\t\tinterpolants[j].evaluate(clipTime);\n\t\t\t\t\t\t\tpropertyMixers[j].accumulate(accuIndex, weight);\n\t\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t_updateWeight(time) {\n\t\t\tlet weight = 0;\n\n\t\t\tif (this.enabled) {\n\t\t\t\tweight = this.weight;\n\t\t\t\tconst interpolant = this._weightInterpolant;\n\n\t\t\t\tif (interpolant !== null) {\n\t\t\t\t\tconst interpolantValue = interpolant.evaluate(time)[0];\n\t\t\t\t\tweight *= interpolantValue;\n\n\t\t\t\t\tif (time > interpolant.parameterPositions[1]) {\n\t\t\t\t\t\tthis.stopFading();\n\n\t\t\t\t\t\tif (interpolantValue === 0) {\n\t\t\t\t\t\t\t// faded out, disable\n\t\t\t\t\t\t\tthis.enabled = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis._effectiveWeight = weight;\n\t\t\treturn weight;\n\t\t}\n\n\t\t_updateTimeScale(time) {\n\t\t\tlet timeScale = 0;\n\n\t\t\tif (!this.paused) {\n\t\t\t\ttimeScale = this.timeScale;\n\t\t\t\tconst interpolant = this._timeScaleInterpolant;\n\n\t\t\t\tif (interpolant !== null) {\n\t\t\t\t\tconst interpolantValue = interpolant.evaluate(time)[0];\n\t\t\t\t\ttimeScale *= interpolantValue;\n\n\t\t\t\t\tif (time > interpolant.parameterPositions[1]) {\n\t\t\t\t\t\tthis.stopWarping();\n\n\t\t\t\t\t\tif (timeScale === 0) {\n\t\t\t\t\t\t\t// motion has halted, pause\n\t\t\t\t\t\t\tthis.paused = true;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// warp done - apply final time scale\n\t\t\t\t\t\t\tthis.timeScale = timeScale;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis._effectiveTimeScale = timeScale;\n\t\t\treturn timeScale;\n\t\t}\n\n\t\t_updateTime(deltaTime) {\n\t\t\tconst duration = this._clip.duration;\n\t\t\tconst loop = this.loop;\n\t\t\tlet time = this.time + deltaTime;\n\t\t\tlet loopCount = this._loopCount;\n\t\t\tconst pingPong = loop === LoopPingPong;\n\n\t\t\tif (deltaTime === 0) {\n\t\t\t\tif (loopCount === -1) return time;\n\t\t\t\treturn pingPong && (loopCount & 1) === 1 ? duration - time : time;\n\t\t\t}\n\n\t\t\tif (loop === LoopOnce) {\n\t\t\t\tif (loopCount === -1) {\n\t\t\t\t\t// just started\n\t\t\t\t\tthis._loopCount = 0;\n\n\t\t\t\t\tthis._setEndings(true, true, false);\n\t\t\t\t}\n\n\t\t\t\thandle_stop: {\n\t\t\t\t\tif (time >= duration) {\n\t\t\t\t\t\ttime = duration;\n\t\t\t\t\t} else if (time < 0) {\n\t\t\t\t\t\ttime = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.time = time;\n\t\t\t\t\t\tbreak handle_stop;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (this.clampWhenFinished) this.paused = true;else this.enabled = false;\n\t\t\t\t\tthis.time = time;\n\n\t\t\t\t\tthis._mixer.dispatchEvent({\n\t\t\t\t\t\ttype: 'finished',\n\t\t\t\t\t\taction: this,\n\t\t\t\t\t\tdirection: deltaTime < 0 ? -1 : 1\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// repetitive Repeat or PingPong\n\t\t\t\tif (loopCount === -1) {\n\t\t\t\t\t// just started\n\t\t\t\t\tif (deltaTime >= 0) {\n\t\t\t\t\t\tloopCount = 0;\n\n\t\t\t\t\t\tthis._setEndings(true, this.repetitions === 0, pingPong);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// when looping in reverse direction, the initial\n\t\t\t\t\t\t// transition through zero counts as a repetition,\n\t\t\t\t\t\t// so leave loopCount at -1\n\t\t\t\t\t\tthis._setEndings(this.repetitions === 0, true, pingPong);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (time >= duration || time < 0) {\n\t\t\t\t\t// wrap around\n\t\t\t\t\tconst loopDelta = Math.floor(time / duration); // signed\n\n\t\t\t\t\ttime -= duration * loopDelta;\n\t\t\t\t\tloopCount += Math.abs(loopDelta);\n\t\t\t\t\tconst pending = this.repetitions - loopCount;\n\n\t\t\t\t\tif (pending <= 0) {\n\t\t\t\t\t\t// have to stop (switch state, clamp time, fire event)\n\t\t\t\t\t\tif (this.clampWhenFinished) this.paused = true;else this.enabled = false;\n\t\t\t\t\t\ttime = deltaTime > 0 ? duration : 0;\n\t\t\t\t\t\tthis.time = time;\n\n\t\t\t\t\t\tthis._mixer.dispatchEvent({\n\t\t\t\t\t\t\ttype: 'finished',\n\t\t\t\t\t\t\taction: this,\n\t\t\t\t\t\t\tdirection: deltaTime > 0 ? 1 : -1\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// keep running\n\t\t\t\t\t\tif (pending === 1) {\n\t\t\t\t\t\t\t// entering the last round\n\t\t\t\t\t\t\tconst atStart = deltaTime < 0;\n\n\t\t\t\t\t\t\tthis._setEndings(atStart, !atStart, pingPong);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthis._setEndings(false, false, pingPong);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tthis._loopCount = loopCount;\n\t\t\t\t\t\tthis.time = time;\n\n\t\t\t\t\t\tthis._mixer.dispatchEvent({\n\t\t\t\t\t\t\ttype: 'loop',\n\t\t\t\t\t\t\taction: this,\n\t\t\t\t\t\t\tloopDelta: loopDelta\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthis.time = time;\n\t\t\t\t}\n\n\t\t\t\tif (pingPong && (loopCount & 1) === 1) {\n\t\t\t\t\t// invert time for the \"pong round\"\n\t\t\t\t\treturn duration - time;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn time;\n\t\t}\n\n\t\t_setEndings(atStart, atEnd, pingPong) {\n\t\t\tconst settings = this._interpolantSettings;\n\n\t\t\tif (pingPong) {\n\t\t\t\tsettings.endingStart = ZeroSlopeEnding;\n\t\t\t\tsettings.endingEnd = ZeroSlopeEnding;\n\t\t\t} else {\n\t\t\t\t// assuming for LoopOnce atStart == atEnd == true\n\t\t\t\tif (atStart) {\n\t\t\t\t\tsettings.endingStart = this.zeroSlopeAtStart ? ZeroSlopeEnding : ZeroCurvatureEnding;\n\t\t\t\t} else {\n\t\t\t\t\tsettings.endingStart = WrapAroundEnding;\n\t\t\t\t}\n\n\t\t\t\tif (atEnd) {\n\t\t\t\t\tsettings.endingEnd = this.zeroSlopeAtEnd ? ZeroSlopeEnding : ZeroCurvatureEnding;\n\t\t\t\t} else {\n\t\t\t\t\tsettings.endingEnd = WrapAroundEnding;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t_scheduleFading(duration, weightNow, weightThen) {\n\t\t\tconst mixer = this._mixer,\n\t\t\t\t\t\tnow = mixer.time;\n\t\t\tlet interpolant = this._weightInterpolant;\n\n\t\t\tif (interpolant === null) {\n\t\t\t\tinterpolant = mixer._lendControlInterpolant();\n\t\t\t\tthis._weightInterpolant = interpolant;\n\t\t\t}\n\n\t\t\tconst times = interpolant.parameterPositions,\n\t\t\t\t\t\tvalues = interpolant.sampleValues;\n\t\t\ttimes[0] = now;\n\t\t\tvalues[0] = weightNow;\n\t\t\ttimes[1] = now + duration;\n\t\t\tvalues[1] = weightThen;\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tclass AnimationMixer extends EventDispatcher {\n\t\tconstructor(root) {\n\t\t\tsuper();\n\t\t\tthis._root = root;\n\n\t\t\tthis._initMemoryManager();\n\n\t\t\tthis._accuIndex = 0;\n\t\t\tthis.time = 0;\n\t\t\tthis.timeScale = 1.0;\n\t\t}\n\n\t\t_bindAction(action, prototypeAction) {\n\t\t\tconst root = action._localRoot || this._root,\n\t\t\t\t\t\ttracks = action._clip.tracks,\n\t\t\t\t\t\tnTracks = tracks.length,\n\t\t\t\t\t\tbindings = action._propertyBindings,\n\t\t\t\t\t\tinterpolants = action._interpolants,\n\t\t\t\t\t\trootUuid = root.uuid,\n\t\t\t\t\t\tbindingsByRoot = this._bindingsByRootAndName;\n\t\t\tlet bindingsByName = bindingsByRoot[rootUuid];\n\n\t\t\tif (bindingsByName === undefined) {\n\t\t\t\tbindingsByName = {};\n\t\t\t\tbindingsByRoot[rootUuid] = bindingsByName;\n\t\t\t}\n\n\t\t\tfor (let i = 0; i !== nTracks; ++i) {\n\t\t\t\tconst track = tracks[i],\n\t\t\t\t\t\t\ttrackName = track.name;\n\t\t\t\tlet binding = bindingsByName[trackName];\n\n\t\t\t\tif (binding !== undefined) {\n\t\t\t\t\tbindings[i] = binding;\n\t\t\t\t} else {\n\t\t\t\t\tbinding = bindings[i];\n\n\t\t\t\t\tif (binding !== undefined) {\n\t\t\t\t\t\t// existing binding, make sure the cache knows\n\t\t\t\t\t\tif (binding._cacheIndex === null) {\n\t\t\t\t\t\t\t++binding.referenceCount;\n\n\t\t\t\t\t\t\tthis._addInactiveBinding(binding, rootUuid, trackName);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst path = prototypeAction && prototypeAction._propertyBindings[i].binding.parsedPath;\n\t\t\t\t\tbinding = new PropertyMixer(PropertyBinding.create(root, trackName, path), track.ValueTypeName, track.getValueSize());\n\t\t\t\t\t++binding.referenceCount;\n\n\t\t\t\t\tthis._addInactiveBinding(binding, rootUuid, trackName);\n\n\t\t\t\t\tbindings[i] = binding;\n\t\t\t\t}\n\n\t\t\t\tinterpolants[i].resultBuffer = binding.buffer;\n\t\t\t}\n\t\t}\n\n\t\t_activateAction(action) {\n\t\t\tif (!this._isActiveAction(action)) {\n\t\t\t\tif (action._cacheIndex === null) {\n\t\t\t\t\t// this action has been forgotten by the cache, but the user\n\t\t\t\t\t// appears to be still using it -> rebind\n\t\t\t\t\tconst rootUuid = (action._localRoot || this._root).uuid,\n\t\t\t\t\t\t\t\tclipUuid = action._clip.uuid,\n\t\t\t\t\t\t\t\tactionsForClip = this._actionsByClip[clipUuid];\n\n\t\t\t\t\tthis._bindAction(action, actionsForClip && actionsForClip.knownActions[0]);\n\n\t\t\t\t\tthis._addInactiveAction(action, clipUuid, rootUuid);\n\t\t\t\t}\n\n\t\t\t\tconst bindings = action._propertyBindings; // increment reference counts / sort out state\n\n\t\t\t\tfor (let i = 0, n = bindings.length; i !== n; ++i) {\n\t\t\t\t\tconst binding = bindings[i];\n\n\t\t\t\t\tif (binding.useCount++ === 0) {\n\t\t\t\t\t\tthis._lendBinding(binding);\n\n\t\t\t\t\t\tbinding.saveOriginalState();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis._lendAction(action);\n\t\t\t}\n\t\t}\n\n\t\t_deactivateAction(action) {\n\t\t\tif (this._isActiveAction(action)) {\n\t\t\t\tconst bindings = action._propertyBindings; // decrement reference counts / sort out state\n\n\t\t\t\tfor (let i = 0, n = bindings.length; i !== n; ++i) {\n\t\t\t\t\tconst binding = bindings[i];\n\n\t\t\t\t\tif (--binding.useCount === 0) {\n\t\t\t\t\t\tbinding.restoreOriginalState();\n\n\t\t\t\t\t\tthis._takeBackBinding(binding);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis._takeBackAction(action);\n\t\t\t}\n\t\t} // Memory manager\n\n\n\t\t_initMemoryManager() {\n\t\t\tthis._actions = []; // 'nActiveActions' followed by inactive ones\n\n\t\t\tthis._nActiveActions = 0;\n\t\t\tthis._actionsByClip = {}; // inside:\n\t\t\t// {\n\t\t\t// \tknownActions: Array< AnimationAction > - used as prototypes\n\t\t\t// \tactionByRoot: AnimationAction - lookup\n\t\t\t// }\n\n\t\t\tthis._bindings = []; // 'nActiveBindings' followed by inactive ones\n\n\t\t\tthis._nActiveBindings = 0;\n\t\t\tthis._bindingsByRootAndName = {}; // inside: Map< name, PropertyMixer >\n\n\t\t\tthis._controlInterpolants = []; // same game as above\n\n\t\t\tthis._nActiveControlInterpolants = 0;\n\t\t\tconst scope = this;\n\t\t\tthis.stats = {\n\t\t\t\tactions: {\n\t\t\t\t\tget total() {\n\t\t\t\t\t\treturn scope._actions.length;\n\t\t\t\t\t},\n\n\t\t\t\t\tget inUse() {\n\t\t\t\t\t\treturn scope._nActiveActions;\n\t\t\t\t\t}\n\n\t\t\t\t},\n\t\t\t\tbindings: {\n\t\t\t\t\tget total() {\n\t\t\t\t\t\treturn scope._bindings.length;\n\t\t\t\t\t},\n\n\t\t\t\t\tget inUse() {\n\t\t\t\t\t\treturn scope._nActiveBindings;\n\t\t\t\t\t}\n\n\t\t\t\t},\n\t\t\t\tcontrolInterpolants: {\n\t\t\t\t\tget total() {\n\t\t\t\t\t\treturn scope._controlInterpolants.length;\n\t\t\t\t\t},\n\n\t\t\t\t\tget inUse() {\n\t\t\t\t\t\treturn scope._nActiveControlInterpolants;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t};\n\t\t} // Memory management for AnimationAction objects\n\n\n\t\t_isActiveAction(action) {\n\t\t\tconst index = action._cacheIndex;\n\t\t\treturn index !== null && index < this._nActiveActions;\n\t\t}\n\n\t\t_addInactiveAction(action, clipUuid, rootUuid) {\n\t\t\tconst actions = this._actions,\n\t\t\t\t\t\tactionsByClip = this._actionsByClip;\n\t\t\tlet actionsForClip = actionsByClip[clipUuid];\n\n\t\t\tif (actionsForClip === undefined) {\n\t\t\t\tactionsForClip = {\n\t\t\t\t\tknownActions: [action],\n\t\t\t\t\tactionByRoot: {}\n\t\t\t\t};\n\t\t\t\taction._byClipCacheIndex = 0;\n\t\t\t\tactionsByClip[clipUuid] = actionsForClip;\n\t\t\t} else {\n\t\t\t\tconst knownActions = actionsForClip.knownActions;\n\t\t\t\taction._byClipCacheIndex = knownActions.length;\n\t\t\t\tknownActions.push(action);\n\t\t\t}\n\n\t\t\taction._cacheIndex = actions.length;\n\t\t\tactions.push(action);\n\t\t\tactionsForClip.actionByRoot[rootUuid] = action;\n\t\t}\n\n\t\t_removeInactiveAction(action) {\n\t\t\tconst actions = this._actions,\n\t\t\t\t\t\tlastInactiveAction = actions[actions.length - 1],\n\t\t\t\t\t\tcacheIndex = action._cacheIndex;\n\t\t\tlastInactiveAction._cacheIndex = cacheIndex;\n\t\t\tactions[cacheIndex] = lastInactiveAction;\n\t\t\tactions.pop();\n\t\t\taction._cacheIndex = null;\n\t\t\tconst clipUuid = action._clip.uuid,\n\t\t\t\t\t\tactionsByClip = this._actionsByClip,\n\t\t\t\t\t\tactionsForClip = actionsByClip[clipUuid],\n\t\t\t\t\t\tknownActionsForClip = actionsForClip.knownActions,\n\t\t\t\t\t\tlastKnownAction = knownActionsForClip[knownActionsForClip.length - 1],\n\t\t\t\t\t\tbyClipCacheIndex = action._byClipCacheIndex;\n\t\t\tlastKnownAction._byClipCacheIndex = byClipCacheIndex;\n\t\t\tknownActionsForClip[byClipCacheIndex] = lastKnownAction;\n\t\t\tknownActionsForClip.pop();\n\t\t\taction._byClipCacheIndex = null;\n\t\t\tconst actionByRoot = actionsForClip.actionByRoot,\n\t\t\t\t\t\trootUuid = (action._localRoot || this._root).uuid;\n\t\t\tdelete actionByRoot[rootUuid];\n\n\t\t\tif (knownActionsForClip.length === 0) {\n\t\t\t\tdelete actionsByClip[clipUuid];\n\t\t\t}\n\n\t\t\tthis._removeInactiveBindingsForAction(action);\n\t\t}\n\n\t\t_removeInactiveBindingsForAction(action) {\n\t\t\tconst bindings = action._propertyBindings;\n\n\t\t\tfor (let i = 0, n = bindings.length; i !== n; ++i) {\n\t\t\t\tconst binding = bindings[i];\n\n\t\t\t\tif (--binding.referenceCount === 0) {\n\t\t\t\t\tthis._removeInactiveBinding(binding);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t_lendAction(action) {\n\t\t\t// [ active actions |\tinactive actions\t]\n\t\t\t// [\tactive actions >| inactive actions ]\n\t\t\t//\t\t\t\t\t\t\t\t s\t\t\t\ta\n\t\t\t//\t\t\t\t\t\t\t\t\t<-swap->\n\t\t\t//\t\t\t\t\t\t\t\t a\t\t\t\ts\n\t\t\tconst actions = this._actions,\n\t\t\t\t\t\tprevIndex = action._cacheIndex,\n\t\t\t\t\t\tlastActiveIndex = this._nActiveActions++,\n\t\t\t\t\t\tfirstInactiveAction = actions[lastActiveIndex];\n\t\t\taction._cacheIndex = lastActiveIndex;\n\t\t\tactions[lastActiveIndex] = action;\n\t\t\tfirstInactiveAction._cacheIndex = prevIndex;\n\t\t\tactions[prevIndex] = firstInactiveAction;\n\t\t}\n\n\t\t_takeBackAction(action) {\n\t\t\t// [\tactive actions\t| inactive actions ]\n\t\t\t// [ active actions |< inactive actions\t]\n\t\t\t//\t\t\t\ta\t\t\t\ts\n\t\t\t//\t\t\t\t <-swap->\n\t\t\t//\t\t\t\ts\t\t\t\ta\n\t\t\tconst actions = this._actions,\n\t\t\t\t\t\tprevIndex = action._cacheIndex,\n\t\t\t\t\t\tfirstInactiveIndex = --this._nActiveActions,\n\t\t\t\t\t\tlastActiveAction = actions[firstInactiveIndex];\n\t\t\taction._cacheIndex = firstInactiveIndex;\n\t\t\tactions[firstInactiveIndex] = action;\n\t\t\tlastActiveAction._cacheIndex = prevIndex;\n\t\t\tactions[prevIndex] = lastActiveAction;\n\t\t} // Memory management for PropertyMixer objects\n\n\n\t\t_addInactiveBinding(binding, rootUuid, trackName) {\n\t\t\tconst bindingsByRoot = this._bindingsByRootAndName,\n\t\t\t\t\t\tbindings = this._bindings;\n\t\t\tlet bindingByName = bindingsByRoot[rootUuid];\n\n\t\t\tif (bindingByName === undefined) {\n\t\t\t\tbindingByName = {};\n\t\t\t\tbindingsByRoot[rootUuid] = bindingByName;\n\t\t\t}\n\n\t\t\tbindingByName[trackName] = binding;\n\t\t\tbinding._cacheIndex = bindings.length;\n\t\t\tbindings.push(binding);\n\t\t}\n\n\t\t_removeInactiveBinding(binding) {\n\t\t\tconst bindings = this._bindings,\n\t\t\t\t\t\tpropBinding = binding.binding,\n\t\t\t\t\t\trootUuid = propBinding.rootNode.uuid,\n\t\t\t\t\t\ttrackName = propBinding.path,\n\t\t\t\t\t\tbindingsByRoot = this._bindingsByRootAndName,\n\t\t\t\t\t\tbindingByName = bindingsByRoot[rootUuid],\n\t\t\t\t\t\tlastInactiveBinding = bindings[bindings.length - 1],\n\t\t\t\t\t\tcacheIndex = binding._cacheIndex;\n\t\t\tlastInactiveBinding._cacheIndex = cacheIndex;\n\t\t\tbindings[cacheIndex] = lastInactiveBinding;\n\t\t\tbindings.pop();\n\t\t\tdelete bindingByName[trackName];\n\n\t\t\tif (Object.keys(bindingByName).length === 0) {\n\t\t\t\tdelete bindingsByRoot[rootUuid];\n\t\t\t}\n\t\t}\n\n\t\t_lendBinding(binding) {\n\t\t\tconst bindings = this._bindings,\n\t\t\t\t\t\tprevIndex = binding._cacheIndex,\n\t\t\t\t\t\tlastActiveIndex = this._nActiveBindings++,\n\t\t\t\t\t\tfirstInactiveBinding = bindings[lastActiveIndex];\n\t\t\tbinding._cacheIndex = lastActiveIndex;\n\t\t\tbindings[lastActiveIndex] = binding;\n\t\t\tfirstInactiveBinding._cacheIndex = prevIndex;\n\t\t\tbindings[prevIndex] = firstInactiveBinding;\n\t\t}\n\n\t\t_takeBackBinding(binding) {\n\t\t\tconst bindings = this._bindings,\n\t\t\t\t\t\tprevIndex = binding._cacheIndex,\n\t\t\t\t\t\tfirstInactiveIndex = --this._nActiveBindings,\n\t\t\t\t\t\tlastActiveBinding = bindings[firstInactiveIndex];\n\t\t\tbinding._cacheIndex = firstInactiveIndex;\n\t\t\tbindings[firstInactiveIndex] = binding;\n\t\t\tlastActiveBinding._cacheIndex = prevIndex;\n\t\t\tbindings[prevIndex] = lastActiveBinding;\n\t\t} // Memory management of Interpolants for weight and time scale\n\n\n\t\t_lendControlInterpolant() {\n\t\t\tconst interpolants = this._controlInterpolants,\n\t\t\t\t\t\tlastActiveIndex = this._nActiveControlInterpolants++;\n\t\t\tlet interpolant = interpolants[lastActiveIndex];\n\n\t\t\tif (interpolant === undefined) {\n\t\t\t\tinterpolant = new LinearInterpolant(new Float32Array(2), new Float32Array(2), 1, this._controlInterpolantsResultBuffer);\n\t\t\t\tinterpolant.__cacheIndex = lastActiveIndex;\n\t\t\t\tinterpolants[lastActiveIndex] = interpolant;\n\t\t\t}\n\n\t\t\treturn interpolant;\n\t\t}\n\n\t\t_takeBackControlInterpolant(interpolant) {\n\t\t\tconst interpolants = this._controlInterpolants,\n\t\t\t\t\t\tprevIndex = interpolant.__cacheIndex,\n\t\t\t\t\t\tfirstInactiveIndex = --this._nActiveControlInterpolants,\n\t\t\t\t\t\tlastActiveInterpolant = interpolants[firstInactiveIndex];\n\t\t\tinterpolant.__cacheIndex = firstInactiveIndex;\n\t\t\tinterpolants[firstInactiveIndex] = interpolant;\n\t\t\tlastActiveInterpolant.__cacheIndex = prevIndex;\n\t\t\tinterpolants[prevIndex] = lastActiveInterpolant;\n\t\t} // return an action for a clip optionally using a custom root target\n\t\t// object (this method allocates a lot of dynamic memory in case a\n\t\t// previously unknown clip/root combination is specified)\n\n\n\t\tclipAction(clip, optionalRoot, blendMode) {\n\t\t\tconst root = optionalRoot || this._root,\n\t\t\t\t\t\trootUuid = root.uuid;\n\t\t\tlet clipObject = typeof clip === 'string' ? AnimationClip.findByName(root, clip) : clip;\n\t\t\tconst clipUuid = clipObject !== null ? clipObject.uuid : clip;\n\t\t\tconst actionsForClip = this._actionsByClip[clipUuid];\n\t\t\tlet prototypeAction = null;\n\n\t\t\tif (blendMode === undefined) {\n\t\t\t\tif (clipObject !== null) {\n\t\t\t\t\tblendMode = clipObject.blendMode;\n\t\t\t\t} else {\n\t\t\t\t\tblendMode = NormalAnimationBlendMode;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (actionsForClip !== undefined) {\n\t\t\t\tconst existingAction = actionsForClip.actionByRoot[rootUuid];\n\n\t\t\t\tif (existingAction !== undefined && existingAction.blendMode === blendMode) {\n\t\t\t\t\treturn existingAction;\n\t\t\t\t} // we know the clip, so we don't have to parse all\n\t\t\t\t// the bindings again but can just copy\n\n\n\t\t\t\tprototypeAction = actionsForClip.knownActions[0]; // also, take the clip from the prototype action\n\n\t\t\t\tif (clipObject === null) clipObject = prototypeAction._clip;\n\t\t\t} // clip must be known when specified via string\n\n\n\t\t\tif (clipObject === null) return null; // allocate all resources required to run it\n\n\t\t\tconst newAction = new AnimationAction(this, clipObject, optionalRoot, blendMode);\n\n\t\t\tthis._bindAction(newAction, prototypeAction); // and make the action known to the memory manager\n\n\n\t\t\tthis._addInactiveAction(newAction, clipUuid, rootUuid);\n\n\t\t\treturn newAction;\n\t\t} // get an existing action\n\n\n\t\texistingAction(clip, optionalRoot) {\n\t\t\tconst root = optionalRoot || this._root,\n\t\t\t\t\t\trootUuid = root.uuid,\n\t\t\t\t\t\tclipObject = typeof clip === 'string' ? AnimationClip.findByName(root, clip) : clip,\n\t\t\t\t\t\tclipUuid = clipObject ? clipObject.uuid : clip,\n\t\t\t\t\t\tactionsForClip = this._actionsByClip[clipUuid];\n\n\t\t\tif (actionsForClip !== undefined) {\n\t\t\t\treturn actionsForClip.actionByRoot[rootUuid] || null;\n\t\t\t}\n\n\t\t\treturn null;\n\t\t} // deactivates all previously scheduled actions\n\n\n\t\tstopAllAction() {\n\t\t\tconst actions = this._actions,\n\t\t\t\t\t\tnActions = this._nActiveActions;\n\n\t\t\tfor (let i = nActions - 1; i >= 0; --i) {\n\t\t\t\tactions[i].stop();\n\t\t\t}\n\n\t\t\treturn this;\n\t\t} // advance the time and update apply the animation\n\n\n\t\tupdate(deltaTime) {\n\t\t\tdeltaTime *= this.timeScale;\n\t\t\tconst actions = this._actions,\n\t\t\t\t\t\tnActions = this._nActiveActions,\n\t\t\t\t\t\ttime = this.time += deltaTime,\n\t\t\t\t\t\ttimeDirection = Math.sign(deltaTime),\n\t\t\t\t\t\taccuIndex = this._accuIndex ^= 1; // run active actions\n\n\t\t\tfor (let i = 0; i !== nActions; ++i) {\n\t\t\t\tconst action = actions[i];\n\n\t\t\t\taction._update(time, deltaTime, timeDirection, accuIndex);\n\t\t\t} // update scene graph\n\n\n\t\t\tconst bindings = this._bindings,\n\t\t\t\t\t\tnBindings = this._nActiveBindings;\n\n\t\t\tfor (let i = 0; i !== nBindings; ++i) {\n\t\t\t\tbindings[i].apply(accuIndex);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t} // Allows you to seek to a specific time in an animation.\n\n\n\t\tsetTime(timeInSeconds) {\n\t\t\tthis.time = 0; // Zero out time attribute for AnimationMixer object;\n\n\t\t\tfor (let i = 0; i < this._actions.length; i++) {\n\t\t\t\tthis._actions[i].time = 0; // Zero out time attribute for all associated AnimationAction objects.\n\t\t\t}\n\n\t\t\treturn this.update(timeInSeconds); // Update used to set exact time. Returns \"this\" AnimationMixer object.\n\t\t} // return this mixer's root target object\n\n\n\t\tgetRoot() {\n\t\t\treturn this._root;\n\t\t} // free all resources specific to a particular clip\n\n\n\t\tuncacheClip(clip) {\n\t\t\tconst actions = this._actions,\n\t\t\t\t\t\tclipUuid = clip.uuid,\n\t\t\t\t\t\tactionsByClip = this._actionsByClip,\n\t\t\t\t\t\tactionsForClip = actionsByClip[clipUuid];\n\n\t\t\tif (actionsForClip !== undefined) {\n\t\t\t\t// note: just calling _removeInactiveAction would mess up the\n\t\t\t\t// iteration state and also require updating the state we can\n\t\t\t\t// just throw away\n\t\t\t\tconst actionsToRemove = actionsForClip.knownActions;\n\n\t\t\t\tfor (let i = 0, n = actionsToRemove.length; i !== n; ++i) {\n\t\t\t\t\tconst action = actionsToRemove[i];\n\n\t\t\t\t\tthis._deactivateAction(action);\n\n\t\t\t\t\tconst cacheIndex = action._cacheIndex,\n\t\t\t\t\t\t\t\tlastInactiveAction = actions[actions.length - 1];\n\t\t\t\t\taction._cacheIndex = null;\n\t\t\t\t\taction._byClipCacheIndex = null;\n\t\t\t\t\tlastInactiveAction._cacheIndex = cacheIndex;\n\t\t\t\t\tactions[cacheIndex] = lastInactiveAction;\n\t\t\t\t\tactions.pop();\n\n\t\t\t\t\tthis._removeInactiveBindingsForAction(action);\n\t\t\t\t}\n\n\t\t\t\tdelete actionsByClip[clipUuid];\n\t\t\t}\n\t\t} // free all resources specific to a particular root target object\n\n\n\t\tuncacheRoot(root) {\n\t\t\tconst rootUuid = root.uuid,\n\t\t\t\t\t\tactionsByClip = this._actionsByClip;\n\n\t\t\tfor (const clipUuid in actionsByClip) {\n\t\t\t\tconst actionByRoot = actionsByClip[clipUuid].actionByRoot,\n\t\t\t\t\t\t\taction = actionByRoot[rootUuid];\n\n\t\t\t\tif (action !== undefined) {\n\t\t\t\t\tthis._deactivateAction(action);\n\n\t\t\t\t\tthis._removeInactiveAction(action);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst bindingsByRoot = this._bindingsByRootAndName,\n\t\t\t\t\t\tbindingByName = bindingsByRoot[rootUuid];\n\n\t\t\tif (bindingByName !== undefined) {\n\t\t\t\tfor (const trackName in bindingByName) {\n\t\t\t\t\tconst binding = bindingByName[trackName];\n\t\t\t\t\tbinding.restoreOriginalState();\n\n\t\t\t\t\tthis._removeInactiveBinding(binding);\n\t\t\t\t}\n\t\t\t}\n\t\t} // remove a targeted clip from the cache\n\n\n\t\tuncacheAction(clip, optionalRoot) {\n\t\t\tconst action = this.existingAction(clip, optionalRoot);\n\n\t\t\tif (action !== null) {\n\t\t\t\tthis._deactivateAction(action);\n\n\t\t\t\tthis._removeInactiveAction(action);\n\t\t\t}\n\t\t}\n\n\t}\n\n\tAnimationMixer.prototype._controlInterpolantsResultBuffer = new Float32Array(1);\n\n\tclass Uniform {\n\t\tconstructor(value) {\n\t\t\tif (typeof value === 'string') {\n\t\t\t\tconsole.warn('THREE.Uniform: Type parameter is no longer needed.');\n\t\t\t\tvalue = arguments[1];\n\t\t\t}\n\n\t\t\tthis.value = value;\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new Uniform(this.value.clone === undefined ? this.value : this.value.clone());\n\t\t}\n\n\t}\n\n\tclass InstancedInterleavedBuffer extends InterleavedBuffer {\n\t\tconstructor(array, stride, meshPerAttribute = 1) {\n\t\t\tsuper(array, stride);\n\t\t\tthis.meshPerAttribute = meshPerAttribute;\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.meshPerAttribute = source.meshPerAttribute;\n\t\t\treturn this;\n\t\t}\n\n\t\tclone(data) {\n\t\t\tconst ib = super.clone(data);\n\t\t\tib.meshPerAttribute = this.meshPerAttribute;\n\t\t\treturn ib;\n\t\t}\n\n\t\ttoJSON(data) {\n\t\t\tconst json = super.toJSON(data);\n\t\t\tjson.isInstancedInterleavedBuffer = true;\n\t\t\tjson.meshPerAttribute = this.meshPerAttribute;\n\t\t\treturn json;\n\t\t}\n\n\t}\n\n\tInstancedInterleavedBuffer.prototype.isInstancedInterleavedBuffer = true;\n\n\tclass GLBufferAttribute {\n\t\tconstructor(buffer, type, itemSize, elementSize, count) {\n\t\t\tthis.buffer = buffer;\n\t\t\tthis.type = type;\n\t\t\tthis.itemSize = itemSize;\n\t\t\tthis.elementSize = elementSize;\n\t\t\tthis.count = count;\n\t\t\tthis.version = 0;\n\t\t}\n\n\t\tset needsUpdate(value) {\n\t\t\tif (value === true) this.version++;\n\t\t}\n\n\t\tsetBuffer(buffer) {\n\t\t\tthis.buffer = buffer;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetType(type, elementSize) {\n\t\t\tthis.type = type;\n\t\t\tthis.elementSize = elementSize;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetItemSize(itemSize) {\n\t\t\tthis.itemSize = itemSize;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetCount(count) {\n\t\t\tthis.count = count;\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tGLBufferAttribute.prototype.isGLBufferAttribute = true;\n\n\tclass Raycaster {\n\t\tconstructor(origin, direction, near = 0, far = Infinity) {\n\t\t\tthis.ray = new Ray(origin, direction); // direction is assumed to be normalized (for accurate distance calculations)\n\n\t\t\tthis.near = near;\n\t\t\tthis.far = far;\n\t\t\tthis.camera = null;\n\t\t\tthis.layers = new Layers();\n\t\t\tthis.params = {\n\t\t\t\tMesh: {},\n\t\t\t\tLine: {\n\t\t\t\t\tthreshold: 1\n\t\t\t\t},\n\t\t\t\tLOD: {},\n\t\t\t\tPoints: {\n\t\t\t\t\tthreshold: 1\n\t\t\t\t},\n\t\t\t\tSprite: {}\n\t\t\t};\n\t\t}\n\n\t\tset(origin, direction) {\n\t\t\t// direction is assumed to be normalized (for accurate distance calculations)\n\t\t\tthis.ray.set(origin, direction);\n\t\t}\n\n\t\tsetFromCamera(coords, camera) {\n\t\t\tif (camera && camera.isPerspectiveCamera) {\n\t\t\t\tthis.ray.origin.setFromMatrixPosition(camera.matrixWorld);\n\t\t\t\tthis.ray.direction.set(coords.x, coords.y, 0.5).unproject(camera).sub(this.ray.origin).normalize();\n\t\t\t\tthis.camera = camera;\n\t\t\t} else if (camera && camera.isOrthographicCamera) {\n\t\t\t\tthis.ray.origin.set(coords.x, coords.y, (camera.near + camera.far) / (camera.near - camera.far)).unproject(camera); // set origin in plane of camera\n\n\t\t\t\tthis.ray.direction.set(0, 0, -1).transformDirection(camera.matrixWorld);\n\t\t\t\tthis.camera = camera;\n\t\t\t} else {\n\t\t\t\tconsole.error('THREE.Raycaster: Unsupported camera type: ' + camera.type);\n\t\t\t}\n\t\t}\n\n\t\tintersectObject(object, recursive = true, intersects = []) {\n\t\t\tintersectObject(object, this, intersects, recursive);\n\t\t\tintersects.sort(ascSort);\n\t\t\treturn intersects;\n\t\t}\n\n\t\tintersectObjects(objects, recursive = true, intersects = []) {\n\t\t\tfor (let i = 0, l = objects.length; i < l; i++) {\n\t\t\t\tintersectObject(objects[i], this, intersects, recursive);\n\t\t\t}\n\n\t\t\tintersects.sort(ascSort);\n\t\t\treturn intersects;\n\t\t}\n\n\t}\n\n\tfunction ascSort(a, b) {\n\t\treturn a.distance - b.distance;\n\t}\n\n\tfunction intersectObject(object, raycaster, intersects, recursive) {\n\t\tif (object.layers.test(raycaster.layers)) {\n\t\t\tobject.raycast(raycaster, intersects);\n\t\t}\n\n\t\tif (recursive === true) {\n\t\t\tconst children = object.children;\n\n\t\t\tfor (let i = 0, l = children.length; i < l; i++) {\n\t\t\t\tintersectObject(children[i], raycaster, intersects, true);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Ref: https://en.wikipedia.org/wiki/Spherical_coordinate_system\n\t *\n\t * The polar angle (phi) is measured from the positive y-axis. The positive y-axis is up.\n\t * The azimuthal angle (theta) is measured from the positive z-axis.\n\t */\n\n\tclass Spherical {\n\t\tconstructor(radius = 1, phi = 0, theta = 0) {\n\t\t\tthis.radius = radius;\n\t\t\tthis.phi = phi; // polar angle\n\n\t\t\tthis.theta = theta; // azimuthal angle\n\n\t\t\treturn this;\n\t\t}\n\n\t\tset(radius, phi, theta) {\n\t\t\tthis.radius = radius;\n\t\t\tthis.phi = phi;\n\t\t\tthis.theta = theta;\n\t\t\treturn this;\n\t\t}\n\n\t\tcopy(other) {\n\t\t\tthis.radius = other.radius;\n\t\t\tthis.phi = other.phi;\n\t\t\tthis.theta = other.theta;\n\t\t\treturn this;\n\t\t} // restrict phi to be betwee EPS and PI-EPS\n\n\n\t\tmakeSafe() {\n\t\t\tconst EPS = 0.000001;\n\t\t\tthis.phi = Math.max(EPS, Math.min(Math.PI - EPS, this.phi));\n\t\t\treturn this;\n\t\t}\n\n\t\tsetFromVector3(v) {\n\t\t\treturn this.setFromCartesianCoords(v.x, v.y, v.z);\n\t\t}\n\n\t\tsetFromCartesianCoords(x, y, z) {\n\t\t\tthis.radius = Math.sqrt(x * x + y * y + z * z);\n\n\t\t\tif (this.radius === 0) {\n\t\t\t\tthis.theta = 0;\n\t\t\t\tthis.phi = 0;\n\t\t\t} else {\n\t\t\t\tthis.theta = Math.atan2(x, z);\n\t\t\t\tthis.phi = Math.acos(clamp(y / this.radius, -1, 1));\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new this.constructor().copy(this);\n\t\t}\n\n\t}\n\n\t/**\n\t * Ref: https://en.wikipedia.org/wiki/Cylindrical_coordinate_system\n\t */\n\tclass Cylindrical {\n\t\tconstructor(radius = 1, theta = 0, y = 0) {\n\t\t\tthis.radius = radius; // distance from the origin to a point in the x-z plane\n\n\t\t\tthis.theta = theta; // counterclockwise angle in the x-z plane measured in radians from the positive z-axis\n\n\t\t\tthis.y = y; // height above the x-z plane\n\n\t\t\treturn this;\n\t\t}\n\n\t\tset(radius, theta, y) {\n\t\t\tthis.radius = radius;\n\t\t\tthis.theta = theta;\n\t\t\tthis.y = y;\n\t\t\treturn this;\n\t\t}\n\n\t\tcopy(other) {\n\t\t\tthis.radius = other.radius;\n\t\t\tthis.theta = other.theta;\n\t\t\tthis.y = other.y;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetFromVector3(v) {\n\t\t\treturn this.setFromCartesianCoords(v.x, v.y, v.z);\n\t\t}\n\n\t\tsetFromCartesianCoords(x, y, z) {\n\t\t\tthis.radius = Math.sqrt(x * x + z * z);\n\t\t\tthis.theta = Math.atan2(x, z);\n\t\t\tthis.y = y;\n\t\t\treturn this;\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new this.constructor().copy(this);\n\t\t}\n\n\t}\n\n\tconst _vector$4 = /*@__PURE__*/new Vector2();\n\n\tclass Box2 {\n\t\tconstructor(min = new Vector2(+Infinity, +Infinity), max = new Vector2(-Infinity, -Infinity)) {\n\t\t\tthis.min = min;\n\t\t\tthis.max = max;\n\t\t}\n\n\t\tset(min, max) {\n\t\t\tthis.min.copy(min);\n\t\t\tthis.max.copy(max);\n\t\t\treturn this;\n\t\t}\n\n\t\tsetFromPoints(points) {\n\t\t\tthis.makeEmpty();\n\n\t\t\tfor (let i = 0, il = points.length; i < il; i++) {\n\t\t\t\tthis.expandByPoint(points[i]);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tsetFromCenterAndSize(center, size) {\n\t\t\tconst halfSize = _vector$4.copy(size).multiplyScalar(0.5);\n\n\t\t\tthis.min.copy(center).sub(halfSize);\n\t\t\tthis.max.copy(center).add(halfSize);\n\t\t\treturn this;\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new this.constructor().copy(this);\n\t\t}\n\n\t\tcopy(box) {\n\t\t\tthis.min.copy(box.min);\n\t\t\tthis.max.copy(box.max);\n\t\t\treturn this;\n\t\t}\n\n\t\tmakeEmpty() {\n\t\t\tthis.min.x = this.min.y = +Infinity;\n\t\t\tthis.max.x = this.max.y = -Infinity;\n\t\t\treturn this;\n\t\t}\n\n\t\tisEmpty() {\n\t\t\t// this is a more robust check for empty than ( volume <= 0 ) because volume can get positive with two negative axes\n\t\t\treturn this.max.x < this.min.x || this.max.y < this.min.y;\n\t\t}\n\n\t\tgetCenter(target) {\n\t\t\treturn this.isEmpty() ? target.set(0, 0) : target.addVectors(this.min, this.max).multiplyScalar(0.5);\n\t\t}\n\n\t\tgetSize(target) {\n\t\t\treturn this.isEmpty() ? target.set(0, 0) : target.subVectors(this.max, this.min);\n\t\t}\n\n\t\texpandByPoint(point) {\n\t\t\tthis.min.min(point);\n\t\t\tthis.max.max(point);\n\t\t\treturn this;\n\t\t}\n\n\t\texpandByVector(vector) {\n\t\t\tthis.min.sub(vector);\n\t\t\tthis.max.add(vector);\n\t\t\treturn this;\n\t\t}\n\n\t\texpandByScalar(scalar) {\n\t\t\tthis.min.addScalar(-scalar);\n\t\t\tthis.max.addScalar(scalar);\n\t\t\treturn this;\n\t\t}\n\n\t\tcontainsPoint(point) {\n\t\t\treturn point.x < this.min.x || point.x > this.max.x || point.y < this.min.y || point.y > this.max.y ? false : true;\n\t\t}\n\n\t\tcontainsBox(box) {\n\t\t\treturn this.min.x <= box.min.x && box.max.x <= this.max.x && this.min.y <= box.min.y && box.max.y <= this.max.y;\n\t\t}\n\n\t\tgetParameter(point, target) {\n\t\t\t// This can potentially have a divide by zero if the box\n\t\t\t// has a size dimension of 0.\n\t\t\treturn target.set((point.x - this.min.x) / (this.max.x - this.min.x), (point.y - this.min.y) / (this.max.y - this.min.y));\n\t\t}\n\n\t\tintersectsBox(box) {\n\t\t\t// using 4 splitting planes to rule out intersections\n\t\t\treturn box.max.x < this.min.x || box.min.x > this.max.x || box.max.y < this.min.y || box.min.y > this.max.y ? false : true;\n\t\t}\n\n\t\tclampPoint(point, target) {\n\t\t\treturn target.copy(point).clamp(this.min, this.max);\n\t\t}\n\n\t\tdistanceToPoint(point) {\n\t\t\tconst clampedPoint = _vector$4.copy(point).clamp(this.min, this.max);\n\n\t\t\treturn clampedPoint.sub(point).length();\n\t\t}\n\n\t\tintersect(box) {\n\t\t\tthis.min.max(box.min);\n\t\t\tthis.max.min(box.max);\n\t\t\treturn this;\n\t\t}\n\n\t\tunion(box) {\n\t\t\tthis.min.min(box.min);\n\t\t\tthis.max.max(box.max);\n\t\t\treturn this;\n\t\t}\n\n\t\ttranslate(offset) {\n\t\t\tthis.min.add(offset);\n\t\t\tthis.max.add(offset);\n\t\t\treturn this;\n\t\t}\n\n\t\tequals(box) {\n\t\t\treturn box.min.equals(this.min) && box.max.equals(this.max);\n\t\t}\n\n\t}\n\n\tBox2.prototype.isBox2 = true;\n\n\tconst _startP = /*@__PURE__*/new Vector3();\n\n\tconst _startEnd = /*@__PURE__*/new Vector3();\n\n\tclass Line3 {\n\t\tconstructor(start = new Vector3(), end = new Vector3()) {\n\t\t\tthis.start = start;\n\t\t\tthis.end = end;\n\t\t}\n\n\t\tset(start, end) {\n\t\t\tthis.start.copy(start);\n\t\t\tthis.end.copy(end);\n\t\t\treturn this;\n\t\t}\n\n\t\tcopy(line) {\n\t\t\tthis.start.copy(line.start);\n\t\t\tthis.end.copy(line.end);\n\t\t\treturn this;\n\t\t}\n\n\t\tgetCenter(target) {\n\t\t\treturn target.addVectors(this.start, this.end).multiplyScalar(0.5);\n\t\t}\n\n\t\tdelta(target) {\n\t\t\treturn target.subVectors(this.end, this.start);\n\t\t}\n\n\t\tdistanceSq() {\n\t\t\treturn this.start.distanceToSquared(this.end);\n\t\t}\n\n\t\tdistance() {\n\t\t\treturn this.start.distanceTo(this.end);\n\t\t}\n\n\t\tat(t, target) {\n\t\t\treturn this.delta(target).multiplyScalar(t).add(this.start);\n\t\t}\n\n\t\tclosestPointToPointParameter(point, clampToLine) {\n\t\t\t_startP.subVectors(point, this.start);\n\n\t\t\t_startEnd.subVectors(this.end, this.start);\n\n\t\t\tconst startEnd2 = _startEnd.dot(_startEnd);\n\n\t\t\tconst startEnd_startP = _startEnd.dot(_startP);\n\n\t\t\tlet t = startEnd_startP / startEnd2;\n\n\t\t\tif (clampToLine) {\n\t\t\t\tt = clamp(t, 0, 1);\n\t\t\t}\n\n\t\t\treturn t;\n\t\t}\n\n\t\tclosestPointToPoint(point, clampToLine, target) {\n\t\t\tconst t = this.closestPointToPointParameter(point, clampToLine);\n\t\t\treturn this.delta(target).multiplyScalar(t).add(this.start);\n\t\t}\n\n\t\tapplyMatrix4(matrix) {\n\t\t\tthis.start.applyMatrix4(matrix);\n\t\t\tthis.end.applyMatrix4(matrix);\n\t\t\treturn this;\n\t\t}\n\n\t\tequals(line) {\n\t\t\treturn line.start.equals(this.start) && line.end.equals(this.end);\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new this.constructor().copy(this);\n\t\t}\n\n\t}\n\n\tclass ImmediateRenderObject extends Object3D {\n\t\tconstructor(material) {\n\t\t\tsuper();\n\t\t\tthis.material = material;\n\n\t\t\tthis.render = function () {};\n\n\t\t\tthis.hasPositions = false;\n\t\t\tthis.hasNormals = false;\n\t\t\tthis.hasColors = false;\n\t\t\tthis.hasUvs = false;\n\t\t\tthis.positionArray = null;\n\t\t\tthis.normalArray = null;\n\t\t\tthis.colorArray = null;\n\t\t\tthis.uvArray = null;\n\t\t\tthis.count = 0;\n\t\t}\n\n\t}\n\n\tImmediateRenderObject.prototype.isImmediateRenderObject = true;\n\n\tconst _vector$3 = /*@__PURE__*/new Vector3();\n\n\tclass SpotLightHelper extends Object3D {\n\t\tconstructor(light, color) {\n\t\t\tsuper();\n\t\t\tthis.light = light;\n\t\t\tthis.light.updateMatrixWorld();\n\t\t\tthis.matrix = light.matrixWorld;\n\t\t\tthis.matrixAutoUpdate = false;\n\t\t\tthis.color = color;\n\t\t\tconst geometry = new BufferGeometry();\n\t\t\tconst positions = [0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, -1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, -1, 1];\n\n\t\t\tfor (let i = 0, j = 1, l = 32; i < l; i++, j++) {\n\t\t\t\tconst p1 = i / l * Math.PI * 2;\n\t\t\t\tconst p2 = j / l * Math.PI * 2;\n\t\t\t\tpositions.push(Math.cos(p1), Math.sin(p1), 1, Math.cos(p2), Math.sin(p2), 1);\n\t\t\t}\n\n\t\t\tgeometry.setAttribute('position', new Float32BufferAttribute(positions, 3));\n\t\t\tconst material = new LineBasicMaterial({\n\t\t\t\tfog: false,\n\t\t\t\ttoneMapped: false\n\t\t\t});\n\t\t\tthis.cone = new LineSegments(geometry, material);\n\t\t\tthis.add(this.cone);\n\t\t\tthis.update();\n\t\t}\n\n\t\tdispose() {\n\t\t\tthis.cone.geometry.dispose();\n\t\t\tthis.cone.material.dispose();\n\t\t}\n\n\t\tupdate() {\n\t\t\tthis.light.updateMatrixWorld();\n\t\t\tconst coneLength = this.light.distance ? this.light.distance : 1000;\n\t\t\tconst coneWidth = coneLength * Math.tan(this.light.angle);\n\t\t\tthis.cone.scale.set(coneWidth, coneWidth, coneLength);\n\n\t\t\t_vector$3.setFromMatrixPosition(this.light.target.matrixWorld);\n\n\t\t\tthis.cone.lookAt(_vector$3);\n\n\t\t\tif (this.color !== undefined) {\n\t\t\t\tthis.cone.material.color.set(this.color);\n\t\t\t} else {\n\t\t\t\tthis.cone.material.color.copy(this.light.color);\n\t\t\t}\n\t\t}\n\n\t}\n\n\tconst _vector$2 = /*@__PURE__*/new Vector3();\n\n\tconst _boneMatrix = /*@__PURE__*/new Matrix4();\n\n\tconst _matrixWorldInv = /*@__PURE__*/new Matrix4();\n\n\tclass SkeletonHelper extends LineSegments {\n\t\tconstructor(object) {\n\t\t\tconst bones = getBoneList(object);\n\t\t\tconst geometry = new BufferGeometry();\n\t\t\tconst vertices = [];\n\t\t\tconst colors = [];\n\t\t\tconst color1 = new Color(0, 0, 1);\n\t\t\tconst color2 = new Color(0, 1, 0);\n\n\t\t\tfor (let i = 0; i < bones.length; i++) {\n\t\t\t\tconst bone = bones[i];\n\n\t\t\t\tif (bone.parent && bone.parent.isBone) {\n\t\t\t\t\tvertices.push(0, 0, 0);\n\t\t\t\t\tvertices.push(0, 0, 0);\n\t\t\t\t\tcolors.push(color1.r, color1.g, color1.b);\n\t\t\t\t\tcolors.push(color2.r, color2.g, color2.b);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tgeometry.setAttribute('position', new Float32BufferAttribute(vertices, 3));\n\t\t\tgeometry.setAttribute('color', new Float32BufferAttribute(colors, 3));\n\t\t\tconst material = new LineBasicMaterial({\n\t\t\t\tvertexColors: true,\n\t\t\t\tdepthTest: false,\n\t\t\t\tdepthWrite: false,\n\t\t\t\ttoneMapped: false,\n\t\t\t\ttransparent: true\n\t\t\t});\n\t\t\tsuper(geometry, material);\n\t\t\tthis.type = 'SkeletonHelper';\n\t\t\tthis.isSkeletonHelper = true;\n\t\t\tthis.root = object;\n\t\t\tthis.bones = bones;\n\t\t\tthis.matrix = object.matrixWorld;\n\t\t\tthis.matrixAutoUpdate = false;\n\t\t}\n\n\t\tupdateMatrixWorld(force) {\n\t\t\tconst bones = this.bones;\n\t\t\tconst geometry = this.geometry;\n\t\t\tconst position = geometry.getAttribute('position');\n\n\t\t\t_matrixWorldInv.copy(this.root.matrixWorld).invert();\n\n\t\t\tfor (let i = 0, j = 0; i < bones.length; i++) {\n\t\t\t\tconst bone = bones[i];\n\n\t\t\t\tif (bone.parent && bone.parent.isBone) {\n\t\t\t\t\t_boneMatrix.multiplyMatrices(_matrixWorldInv, bone.matrixWorld);\n\n\t\t\t\t\t_vector$2.setFromMatrixPosition(_boneMatrix);\n\n\t\t\t\t\tposition.setXYZ(j, _vector$2.x, _vector$2.y, _vector$2.z);\n\n\t\t\t\t\t_boneMatrix.multiplyMatrices(_matrixWorldInv, bone.parent.matrixWorld);\n\n\t\t\t\t\t_vector$2.setFromMatrixPosition(_boneMatrix);\n\n\t\t\t\t\tposition.setXYZ(j + 1, _vector$2.x, _vector$2.y, _vector$2.z);\n\t\t\t\t\tj += 2;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tgeometry.getAttribute('position').needsUpdate = true;\n\t\t\tsuper.updateMatrixWorld(force);\n\t\t}\n\n\t}\n\n\tfunction getBoneList(object) {\n\t\tconst boneList = [];\n\n\t\tif (object && object.isBone) {\n\t\t\tboneList.push(object);\n\t\t}\n\n\t\tfor (let i = 0; i < object.children.length; i++) {\n\t\t\tboneList.push.apply(boneList, getBoneList(object.children[i]));\n\t\t}\n\n\t\treturn boneList;\n\t}\n\n\tclass PointLightHelper extends Mesh {\n\t\tconstructor(light, sphereSize, color) {\n\t\t\tconst geometry = new SphereGeometry(sphereSize, 4, 2);\n\t\t\tconst material = new MeshBasicMaterial({\n\t\t\t\twireframe: true,\n\t\t\t\tfog: false,\n\t\t\t\ttoneMapped: false\n\t\t\t});\n\t\t\tsuper(geometry, material);\n\t\t\tthis.light = light;\n\t\t\tthis.light.updateMatrixWorld();\n\t\t\tthis.color = color;\n\t\t\tthis.type = 'PointLightHelper';\n\t\t\tthis.matrix = this.light.matrixWorld;\n\t\t\tthis.matrixAutoUpdate = false;\n\t\t\tthis.update();\n\t\t\t/*\n\t\t\t// TODO: delete this comment?\n\t\t\tconst distanceGeometry = new THREE.IcosahedronBufferGeometry( 1, 2 );\n\t\t\tconst distanceMaterial = new THREE.MeshBasicMaterial( { color: hexColor, fog: false, wireframe: true, opacity: 0.1, transparent: true } );\n\t\t\tthis.lightSphere = new THREE.Mesh( bulbGeometry, bulbMaterial );\n\t\t\tthis.lightDistance = new THREE.Mesh( distanceGeometry, distanceMaterial );\n\t\t\tconst d = light.distance;\n\t\t\tif ( d === 0.0 ) {\n\t\t\t\tthis.lightDistance.visible = false;\n\t\t\t} else {\n\t\t\t\tthis.lightDistance.scale.set( d, d, d );\n\t\t\t}\n\t\t\tthis.add( this.lightDistance );\n\t\t\t*/\n\t\t}\n\n\t\tdispose() {\n\t\t\tthis.geometry.dispose();\n\t\t\tthis.material.dispose();\n\t\t}\n\n\t\tupdate() {\n\t\t\tif (this.color !== undefined) {\n\t\t\t\tthis.material.color.set(this.color);\n\t\t\t} else {\n\t\t\t\tthis.material.color.copy(this.light.color);\n\t\t\t}\n\t\t\t/*\n\t\t\tconst d = this.light.distance;\n\t\t\t\tif ( d === 0.0 ) {\n\t\t\t\t\tthis.lightDistance.visible = false;\n\t\t\t\t} else {\n\t\t\t\t\tthis.lightDistance.visible = true;\n\t\t\t\tthis.lightDistance.scale.set( d, d, d );\n\t\t\t\t}\n\t\t\t*/\n\n\t\t}\n\n\t}\n\n\tconst _vector$1 = /*@__PURE__*/new Vector3();\n\n\tconst _color1 = /*@__PURE__*/new Color();\n\n\tconst _color2 = /*@__PURE__*/new Color();\n\n\tclass HemisphereLightHelper extends Object3D {\n\t\tconstructor(light, size, color) {\n\t\t\tsuper();\n\t\t\tthis.light = light;\n\t\t\tthis.light.updateMatrixWorld();\n\t\t\tthis.matrix = light.matrixWorld;\n\t\t\tthis.matrixAutoUpdate = false;\n\t\t\tthis.color = color;\n\t\t\tconst geometry = new OctahedronGeometry(size);\n\t\t\tgeometry.rotateY(Math.PI * 0.5);\n\t\t\tthis.material = new MeshBasicMaterial({\n\t\t\t\twireframe: true,\n\t\t\t\tfog: false,\n\t\t\t\ttoneMapped: false\n\t\t\t});\n\t\t\tif (this.color === undefined) this.material.vertexColors = true;\n\t\t\tconst position = geometry.getAttribute('position');\n\t\t\tconst colors = new Float32Array(position.count * 3);\n\t\t\tgeometry.setAttribute('color', new BufferAttribute(colors, 3));\n\t\t\tthis.add(new Mesh(geometry, this.material));\n\t\t\tthis.update();\n\t\t}\n\n\t\tdispose() {\n\t\t\tthis.children[0].geometry.dispose();\n\t\t\tthis.children[0].material.dispose();\n\t\t}\n\n\t\tupdate() {\n\t\t\tconst mesh = this.children[0];\n\n\t\t\tif (this.color !== undefined) {\n\t\t\t\tthis.material.color.set(this.color);\n\t\t\t} else {\n\t\t\t\tconst colors = mesh.geometry.getAttribute('color');\n\n\t\t\t\t_color1.copy(this.light.color);\n\n\t\t\t\t_color2.copy(this.light.groundColor);\n\n\t\t\t\tfor (let i = 0, l = colors.count; i < l; i++) {\n\t\t\t\t\tconst color = i < l / 2 ? _color1 : _color2;\n\t\t\t\t\tcolors.setXYZ(i, color.r, color.g, color.b);\n\t\t\t\t}\n\n\t\t\t\tcolors.needsUpdate = true;\n\t\t\t}\n\n\t\t\tmesh.lookAt(_vector$1.setFromMatrixPosition(this.light.matrixWorld).negate());\n\t\t}\n\n\t}\n\n\tclass GridHelper extends LineSegments {\n\t\tconstructor(size = 10, divisions = 10, color1 = 0x444444, color2 = 0x888888) {\n\t\t\tcolor1 = new Color(color1);\n\t\t\tcolor2 = new Color(color2);\n\t\t\tconst center = divisions / 2;\n\t\t\tconst step = size / divisions;\n\t\t\tconst halfSize = size / 2;\n\t\t\tconst vertices = [],\n\t\t\t\t\t\tcolors = [];\n\n\t\t\tfor (let i = 0, j = 0, k = -halfSize; i <= divisions; i++, k += step) {\n\t\t\t\tvertices.push(-halfSize, 0, k, halfSize, 0, k);\n\t\t\t\tvertices.push(k, 0, -halfSize, k, 0, halfSize);\n\t\t\t\tconst color = i === center ? color1 : color2;\n\t\t\t\tcolor.toArray(colors, j);\n\t\t\t\tj += 3;\n\t\t\t\tcolor.toArray(colors, j);\n\t\t\t\tj += 3;\n\t\t\t\tcolor.toArray(colors, j);\n\t\t\t\tj += 3;\n\t\t\t\tcolor.toArray(colors, j);\n\t\t\t\tj += 3;\n\t\t\t}\n\n\t\t\tconst geometry = new BufferGeometry();\n\t\t\tgeometry.setAttribute('position', new Float32BufferAttribute(vertices, 3));\n\t\t\tgeometry.setAttribute('color', new Float32BufferAttribute(colors, 3));\n\t\t\tconst material = new LineBasicMaterial({\n\t\t\t\tvertexColors: true,\n\t\t\t\ttoneMapped: false\n\t\t\t});\n\t\t\tsuper(geometry, material);\n\t\t\tthis.type = 'GridHelper';\n\t\t}\n\n\t}\n\n\tclass PolarGridHelper extends LineSegments {\n\t\tconstructor(radius = 10, radials = 16, circles = 8, divisions = 64, color1 = 0x444444, color2 = 0x888888) {\n\t\t\tcolor1 = new Color(color1);\n\t\t\tcolor2 = new Color(color2);\n\t\t\tconst vertices = [];\n\t\t\tconst colors = []; // create the radials\n\n\t\t\tfor (let i = 0; i <= radials; i++) {\n\t\t\t\tconst v = i / radials * (Math.PI * 2);\n\t\t\t\tconst x = Math.sin(v) * radius;\n\t\t\t\tconst z = Math.cos(v) * radius;\n\t\t\t\tvertices.push(0, 0, 0);\n\t\t\t\tvertices.push(x, 0, z);\n\t\t\t\tconst color = i & 1 ? color1 : color2;\n\t\t\t\tcolors.push(color.r, color.g, color.b);\n\t\t\t\tcolors.push(color.r, color.g, color.b);\n\t\t\t} // create the circles\n\n\n\t\t\tfor (let i = 0; i <= circles; i++) {\n\t\t\t\tconst color = i & 1 ? color1 : color2;\n\t\t\t\tconst r = radius - radius / circles * i;\n\n\t\t\t\tfor (let j = 0; j < divisions; j++) {\n\t\t\t\t\t// first vertex\n\t\t\t\t\tlet v = j / divisions * (Math.PI * 2);\n\t\t\t\t\tlet x = Math.sin(v) * r;\n\t\t\t\t\tlet z = Math.cos(v) * r;\n\t\t\t\t\tvertices.push(x, 0, z);\n\t\t\t\t\tcolors.push(color.r, color.g, color.b); // second vertex\n\n\t\t\t\t\tv = (j + 1) / divisions * (Math.PI * 2);\n\t\t\t\t\tx = Math.sin(v) * r;\n\t\t\t\t\tz = Math.cos(v) * r;\n\t\t\t\t\tvertices.push(x, 0, z);\n\t\t\t\t\tcolors.push(color.r, color.g, color.b);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst geometry = new BufferGeometry();\n\t\t\tgeometry.setAttribute('position', new Float32BufferAttribute(vertices, 3));\n\t\t\tgeometry.setAttribute('color', new Float32BufferAttribute(colors, 3));\n\t\t\tconst material = new LineBasicMaterial({\n\t\t\t\tvertexColors: true,\n\t\t\t\ttoneMapped: false\n\t\t\t});\n\t\t\tsuper(geometry, material);\n\t\t\tthis.type = 'PolarGridHelper';\n\t\t}\n\n\t}\n\n\tconst _v1 = /*@__PURE__*/new Vector3();\n\n\tconst _v2 = /*@__PURE__*/new Vector3();\n\n\tconst _v3 = /*@__PURE__*/new Vector3();\n\n\tclass DirectionalLightHelper extends Object3D {\n\t\tconstructor(light, size, color) {\n\t\t\tsuper();\n\t\t\tthis.light = light;\n\t\t\tthis.light.updateMatrixWorld();\n\t\t\tthis.matrix = light.matrixWorld;\n\t\t\tthis.matrixAutoUpdate = false;\n\t\t\tthis.color = color;\n\t\t\tif (size === undefined) size = 1;\n\t\t\tlet geometry = new BufferGeometry();\n\t\t\tgeometry.setAttribute('position', new Float32BufferAttribute([-size, size, 0, size, size, 0, size, -size, 0, -size, -size, 0, -size, size, 0], 3));\n\t\t\tconst material = new LineBasicMaterial({\n\t\t\t\tfog: false,\n\t\t\t\ttoneMapped: false\n\t\t\t});\n\t\t\tthis.lightPlane = new Line(geometry, material);\n\t\t\tthis.add(this.lightPlane);\n\t\t\tgeometry = new BufferGeometry();\n\t\t\tgeometry.setAttribute('position', new Float32BufferAttribute([0, 0, 0, 0, 0, 1], 3));\n\t\t\tthis.targetLine = new Line(geometry, material);\n\t\t\tthis.add(this.targetLine);\n\t\t\tthis.update();\n\t\t}\n\n\t\tdispose() {\n\t\t\tthis.lightPlane.geometry.dispose();\n\t\t\tthis.lightPlane.material.dispose();\n\t\t\tthis.targetLine.geometry.dispose();\n\t\t\tthis.targetLine.material.dispose();\n\t\t}\n\n\t\tupdate() {\n\t\t\t_v1.setFromMatrixPosition(this.light.matrixWorld);\n\n\t\t\t_v2.setFromMatrixPosition(this.light.target.matrixWorld);\n\n\t\t\t_v3.subVectors(_v2, _v1);\n\n\t\t\tthis.lightPlane.lookAt(_v2);\n\n\t\t\tif (this.color !== undefined) {\n\t\t\t\tthis.lightPlane.material.color.set(this.color);\n\t\t\t\tthis.targetLine.material.color.set(this.color);\n\t\t\t} else {\n\t\t\t\tthis.lightPlane.material.color.copy(this.light.color);\n\t\t\t\tthis.targetLine.material.color.copy(this.light.color);\n\t\t\t}\n\n\t\t\tthis.targetLine.lookAt(_v2);\n\t\t\tthis.targetLine.scale.z = _v3.length();\n\t\t}\n\n\t}\n\n\tconst _vector = /*@__PURE__*/new Vector3();\n\n\tconst _camera = /*@__PURE__*/new Camera();\n\t/**\n\t *\t- shows frustum, line of sight and up of the camera\n\t *\t- suitable for fast updates\n\t * \t- based on frustum visualization in lightgl.js shadowmap example\n\t *\t\thttp://evanw.github.com/lightgl.js/tests/shadowmap.html\n\t */\n\n\n\tclass CameraHelper extends LineSegments {\n\t\tconstructor(camera) {\n\t\t\tconst geometry = new BufferGeometry();\n\t\t\tconst material = new LineBasicMaterial({\n\t\t\t\tcolor: 0xffffff,\n\t\t\t\tvertexColors: true,\n\t\t\t\ttoneMapped: false\n\t\t\t});\n\t\t\tconst vertices = [];\n\t\t\tconst colors = [];\n\t\t\tconst pointMap = {}; // colors\n\n\t\t\tconst colorFrustum = new Color(0xffaa00);\n\t\t\tconst colorCone = new Color(0xff0000);\n\t\t\tconst colorUp = new Color(0x00aaff);\n\t\t\tconst colorTarget = new Color(0xffffff);\n\t\t\tconst colorCross = new Color(0x333333); // near\n\n\t\t\taddLine('n1', 'n2', colorFrustum);\n\t\t\taddLine('n2', 'n4', colorFrustum);\n\t\t\taddLine('n4', 'n3', colorFrustum);\n\t\t\taddLine('n3', 'n1', colorFrustum); // far\n\n\t\t\taddLine('f1', 'f2', colorFrustum);\n\t\t\taddLine('f2', 'f4', colorFrustum);\n\t\t\taddLine('f4', 'f3', colorFrustum);\n\t\t\taddLine('f3', 'f1', colorFrustum); // sides\n\n\t\t\taddLine('n1', 'f1', colorFrustum);\n\t\t\taddLine('n2', 'f2', colorFrustum);\n\t\t\taddLine('n3', 'f3', colorFrustum);\n\t\t\taddLine('n4', 'f4', colorFrustum); // cone\n\n\t\t\taddLine('p', 'n1', colorCone);\n\t\t\taddLine('p', 'n2', colorCone);\n\t\t\taddLine('p', 'n3', colorCone);\n\t\t\taddLine('p', 'n4', colorCone); // up\n\n\t\t\taddLine('u1', 'u2', colorUp);\n\t\t\taddLine('u2', 'u3', colorUp);\n\t\t\taddLine('u3', 'u1', colorUp); // target\n\n\t\t\taddLine('c', 't', colorTarget);\n\t\t\taddLine('p', 'c', colorCross); // cross\n\n\t\t\taddLine('cn1', 'cn2', colorCross);\n\t\t\taddLine('cn3', 'cn4', colorCross);\n\t\t\taddLine('cf1', 'cf2', colorCross);\n\t\t\taddLine('cf3', 'cf4', colorCross);\n\n\t\t\tfunction addLine(a, b, color) {\n\t\t\t\taddPoint(a, color);\n\t\t\t\taddPoint(b, color);\n\t\t\t}\n\n\t\t\tfunction addPoint(id, color) {\n\t\t\t\tvertices.push(0, 0, 0);\n\t\t\t\tcolors.push(color.r, color.g, color.b);\n\n\t\t\t\tif (pointMap[id] === undefined) {\n\t\t\t\t\tpointMap[id] = [];\n\t\t\t\t}\n\n\t\t\t\tpointMap[id].push(vertices.length / 3 - 1);\n\t\t\t}\n\n\t\t\tgeometry.setAttribute('position', new Float32BufferAttribute(vertices, 3));\n\t\t\tgeometry.setAttribute('color', new Float32BufferAttribute(colors, 3));\n\t\t\tsuper(geometry, material);\n\t\t\tthis.type = 'CameraHelper';\n\t\t\tthis.camera = camera;\n\t\t\tif (this.camera.updateProjectionMatrix) this.camera.updateProjectionMatrix();\n\t\t\tthis.matrix = camera.matrixWorld;\n\t\t\tthis.matrixAutoUpdate = false;\n\t\t\tthis.pointMap = pointMap;\n\t\t\tthis.update();\n\t\t}\n\n\t\tupdate() {\n\t\t\tconst geometry = this.geometry;\n\t\t\tconst pointMap = this.pointMap;\n\t\t\tconst w = 1,\n\t\t\t\t\t\th = 1; // we need just camera projection matrix inverse\n\t\t\t// world matrix must be identity\n\n\t\t\t_camera.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse); // center / target\n\n\n\t\t\tsetPoint('c', pointMap, geometry, _camera, 0, 0, -1);\n\t\t\tsetPoint('t', pointMap, geometry, _camera, 0, 0, 1); // near\n\n\t\t\tsetPoint('n1', pointMap, geometry, _camera, -w, -h, -1);\n\t\t\tsetPoint('n2', pointMap, geometry, _camera, w, -h, -1);\n\t\t\tsetPoint('n3', pointMap, geometry, _camera, -w, h, -1);\n\t\t\tsetPoint('n4', pointMap, geometry, _camera, w, h, -1); // far\n\n\t\t\tsetPoint('f1', pointMap, geometry, _camera, -w, -h, 1);\n\t\t\tsetPoint('f2', pointMap, geometry, _camera, w, -h, 1);\n\t\t\tsetPoint('f3', pointMap, geometry, _camera, -w, h, 1);\n\t\t\tsetPoint('f4', pointMap, geometry, _camera, w, h, 1); // up\n\n\t\t\tsetPoint('u1', pointMap, geometry, _camera, w * 0.7, h * 1.1, -1);\n\t\t\tsetPoint('u2', pointMap, geometry, _camera, -w * 0.7, h * 1.1, -1);\n\t\t\tsetPoint('u3', pointMap, geometry, _camera, 0, h * 2, -1); // cross\n\n\t\t\tsetPoint('cf1', pointMap, geometry, _camera, -w, 0, 1);\n\t\t\tsetPoint('cf2', pointMap, geometry, _camera, w, 0, 1);\n\t\t\tsetPoint('cf3', pointMap, geometry, _camera, 0, -h, 1);\n\t\t\tsetPoint('cf4', pointMap, geometry, _camera, 0, h, 1);\n\t\t\tsetPoint('cn1', pointMap, geometry, _camera, -w, 0, -1);\n\t\t\tsetPoint('cn2', pointMap, geometry, _camera, w, 0, -1);\n\t\t\tsetPoint('cn3', pointMap, geometry, _camera, 0, -h, -1);\n\t\t\tsetPoint('cn4', pointMap, geometry, _camera, 0, h, -1);\n\t\t\tgeometry.getAttribute('position').needsUpdate = true;\n\t\t}\n\n\t\tdispose() {\n\t\t\tthis.geometry.dispose();\n\t\t\tthis.material.dispose();\n\t\t}\n\n\t}\n\n\tfunction setPoint(point, pointMap, geometry, camera, x, y, z) {\n\t\t_vector.set(x, y, z).unproject(camera);\n\n\t\tconst points = pointMap[point];\n\n\t\tif (points !== undefined) {\n\t\t\tconst position = geometry.getAttribute('position');\n\n\t\t\tfor (let i = 0, l = points.length; i < l; i++) {\n\t\t\t\tposition.setXYZ(points[i], _vector.x, _vector.y, _vector.z);\n\t\t\t}\n\t\t}\n\t}\n\n\tconst _box = /*@__PURE__*/new Box3();\n\n\tclass BoxHelper extends LineSegments {\n\t\tconstructor(object, color = 0xffff00) {\n\t\t\tconst indices = 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]);\n\t\t\tconst positions = new Float32Array(8 * 3);\n\t\t\tconst geometry = new BufferGeometry();\n\t\t\tgeometry.setIndex(new BufferAttribute(indices, 1));\n\t\t\tgeometry.setAttribute('position', new BufferAttribute(positions, 3));\n\t\t\tsuper(geometry, new LineBasicMaterial({\n\t\t\t\tcolor: color,\n\t\t\t\ttoneMapped: false\n\t\t\t}));\n\t\t\tthis.object = object;\n\t\t\tthis.type = 'BoxHelper';\n\t\t\tthis.matrixAutoUpdate = false;\n\t\t\tthis.update();\n\t\t}\n\n\t\tupdate(object) {\n\t\t\tif (object !== undefined) {\n\t\t\t\tconsole.warn('THREE.BoxHelper: .update() has no longer arguments.');\n\t\t\t}\n\n\t\t\tif (this.object !== undefined) {\n\t\t\t\t_box.setFromObject(this.object);\n\t\t\t}\n\n\t\t\tif (_box.isEmpty()) return;\n\t\t\tconst min = _box.min;\n\t\t\tconst max = _box.max;\n\t\t\t/*\n\t\t\t\t5____4\n\t\t\t1/___0/|\n\t\t\t| 6__|_7\n\t\t\t2/___3/\n\t\t\t\t0: max.x, max.y, max.z\n\t\t\t1: min.x, max.y, max.z\n\t\t\t2: min.x, min.y, max.z\n\t\t\t3: max.x, min.y, max.z\n\t\t\t4: max.x, max.y, min.z\n\t\t\t5: min.x, max.y, min.z\n\t\t\t6: min.x, min.y, min.z\n\t\t\t7: max.x, min.y, min.z\n\t\t\t*/\n\n\t\t\tconst position = this.geometry.attributes.position;\n\t\t\tconst array = position.array;\n\t\t\tarray[0] = max.x;\n\t\t\tarray[1] = max.y;\n\t\t\tarray[2] = max.z;\n\t\t\tarray[3] = min.x;\n\t\t\tarray[4] = max.y;\n\t\t\tarray[5] = max.z;\n\t\t\tarray[6] = min.x;\n\t\t\tarray[7] = min.y;\n\t\t\tarray[8] = max.z;\n\t\t\tarray[9] = max.x;\n\t\t\tarray[10] = min.y;\n\t\t\tarray[11] = max.z;\n\t\t\tarray[12] = max.x;\n\t\t\tarray[13] = max.y;\n\t\t\tarray[14] = min.z;\n\t\t\tarray[15] = min.x;\n\t\t\tarray[16] = max.y;\n\t\t\tarray[17] = min.z;\n\t\t\tarray[18] = min.x;\n\t\t\tarray[19] = min.y;\n\t\t\tarray[20] = min.z;\n\t\t\tarray[21] = max.x;\n\t\t\tarray[22] = min.y;\n\t\t\tarray[23] = min.z;\n\t\t\tposition.needsUpdate = true;\n\t\t\tthis.geometry.computeBoundingSphere();\n\t\t}\n\n\t\tsetFromObject(object) {\n\t\t\tthis.object = object;\n\t\t\tthis.update();\n\t\t\treturn this;\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tLineSegments.prototype.copy.call(this, source);\n\t\t\tthis.object = source.object;\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tclass Box3Helper extends LineSegments {\n\t\tconstructor(box, color = 0xffff00) {\n\t\t\tconst indices = 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]);\n\t\t\tconst positions = [1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1];\n\t\t\tconst geometry = new BufferGeometry();\n\t\t\tgeometry.setIndex(new BufferAttribute(indices, 1));\n\t\t\tgeometry.setAttribute('position', new Float32BufferAttribute(positions, 3));\n\t\t\tsuper(geometry, new LineBasicMaterial({\n\t\t\t\tcolor: color,\n\t\t\t\ttoneMapped: false\n\t\t\t}));\n\t\t\tthis.box = box;\n\t\t\tthis.type = 'Box3Helper';\n\t\t\tthis.geometry.computeBoundingSphere();\n\t\t}\n\n\t\tupdateMatrixWorld(force) {\n\t\t\tconst box = this.box;\n\t\t\tif (box.isEmpty()) return;\n\t\t\tbox.getCenter(this.position);\n\t\t\tbox.getSize(this.scale);\n\t\t\tthis.scale.multiplyScalar(0.5);\n\t\t\tsuper.updateMatrixWorld(force);\n\t\t}\n\n\t}\n\n\tclass PlaneHelper extends Line {\n\t\tconstructor(plane, size = 1, hex = 0xffff00) {\n\t\t\tconst color = hex;\n\t\t\tconst positions = [1, -1, 1, -1, 1, 1, -1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0];\n\t\t\tconst geometry = new BufferGeometry();\n\t\t\tgeometry.setAttribute('position', new Float32BufferAttribute(positions, 3));\n\t\t\tgeometry.computeBoundingSphere();\n\t\t\tsuper(geometry, new LineBasicMaterial({\n\t\t\t\tcolor: color,\n\t\t\t\ttoneMapped: false\n\t\t\t}));\n\t\t\tthis.type = 'PlaneHelper';\n\t\t\tthis.plane = plane;\n\t\t\tthis.size = size;\n\t\t\tconst positions2 = [1, 1, 1, -1, 1, 1, -1, -1, 1, 1, 1, 1, -1, -1, 1, 1, -1, 1];\n\t\t\tconst geometry2 = new BufferGeometry();\n\t\t\tgeometry2.setAttribute('position', new Float32BufferAttribute(positions2, 3));\n\t\t\tgeometry2.computeBoundingSphere();\n\t\t\tthis.add(new Mesh(geometry2, new MeshBasicMaterial({\n\t\t\t\tcolor: color,\n\t\t\t\topacity: 0.2,\n\t\t\t\ttransparent: true,\n\t\t\t\tdepthWrite: false,\n\t\t\t\ttoneMapped: false\n\t\t\t})));\n\t\t}\n\n\t\tupdateMatrixWorld(force) {\n\t\t\tlet scale = -this.plane.constant;\n\t\t\tif (Math.abs(scale) < 1e-8) scale = 1e-8; // sign does not matter\n\n\t\t\tthis.scale.set(0.5 * this.size, 0.5 * this.size, scale);\n\t\t\tthis.children[0].material.side = scale < 0 ? BackSide : FrontSide; // renderer flips side when determinant < 0; flipping not wanted here\n\n\t\t\tthis.lookAt(this.plane.normal);\n\t\t\tsuper.updateMatrixWorld(force);\n\t\t}\n\n\t}\n\n\tconst _axis = /*@__PURE__*/new Vector3();\n\n\tlet _lineGeometry, _coneGeometry;\n\n\tclass ArrowHelper extends Object3D {\n\t\t// dir is assumed to be normalized\n\t\tconstructor(dir = new Vector3(0, 0, 1), origin = new Vector3(0, 0, 0), length = 1, color = 0xffff00, headLength = length * 0.2, headWidth = headLength * 0.2) {\n\t\t\tsuper();\n\t\t\tthis.type = 'ArrowHelper';\n\n\t\t\tif (_lineGeometry === undefined) {\n\t\t\t\t_lineGeometry = new BufferGeometry();\n\n\t\t\t\t_lineGeometry.setAttribute('position', new Float32BufferAttribute([0, 0, 0, 0, 1, 0], 3));\n\n\t\t\t\t_coneGeometry = new CylinderGeometry(0, 0.5, 1, 5, 1);\n\n\t\t\t\t_coneGeometry.translate(0, -0.5, 0);\n\t\t\t}\n\n\t\t\tthis.position.copy(origin);\n\t\t\tthis.line = new Line(_lineGeometry, new LineBasicMaterial({\n\t\t\t\tcolor: color,\n\t\t\t\ttoneMapped: false\n\t\t\t}));\n\t\t\tthis.line.matrixAutoUpdate = false;\n\t\t\tthis.add(this.line);\n\t\t\tthis.cone = new Mesh(_coneGeometry, new MeshBasicMaterial({\n\t\t\t\tcolor: color,\n\t\t\t\ttoneMapped: false\n\t\t\t}));\n\t\t\tthis.cone.matrixAutoUpdate = false;\n\t\t\tthis.add(this.cone);\n\t\t\tthis.setDirection(dir);\n\t\t\tthis.setLength(length, headLength, headWidth);\n\t\t}\n\n\t\tsetDirection(dir) {\n\t\t\t// dir is assumed to be normalized\n\t\t\tif (dir.y > 0.99999) {\n\t\t\t\tthis.quaternion.set(0, 0, 0, 1);\n\t\t\t} else if (dir.y < -0.99999) {\n\t\t\t\tthis.quaternion.set(1, 0, 0, 0);\n\t\t\t} else {\n\t\t\t\t_axis.set(dir.z, 0, -dir.x).normalize();\n\n\t\t\t\tconst radians = Math.acos(dir.y);\n\t\t\t\tthis.quaternion.setFromAxisAngle(_axis, radians);\n\t\t\t}\n\t\t}\n\n\t\tsetLength(length, headLength = length * 0.2, headWidth = headLength * 0.2) {\n\t\t\tthis.line.scale.set(1, Math.max(0.0001, length - headLength), 1); // see #17458\n\n\t\t\tthis.line.updateMatrix();\n\t\t\tthis.cone.scale.set(headWidth, headLength, headWidth);\n\t\t\tthis.cone.position.y = length;\n\t\t\tthis.cone.updateMatrix();\n\t\t}\n\n\t\tsetColor(color) {\n\t\t\tthis.line.material.color.set(color);\n\t\t\tthis.cone.material.color.set(color);\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source, false);\n\t\t\tthis.line.copy(source.line);\n\t\t\tthis.cone.copy(source.cone);\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tclass AxesHelper extends LineSegments {\n\t\tconstructor(size = 1) {\n\t\t\tconst vertices = [0, 0, 0, size, 0, 0, 0, 0, 0, 0, size, 0, 0, 0, 0, 0, 0, size];\n\t\t\tconst colors = [1, 0, 0, 1, 0.6, 0, 0, 1, 0, 0.6, 1, 0, 0, 0, 1, 0, 0.6, 1];\n\t\t\tconst geometry = new BufferGeometry();\n\t\t\tgeometry.setAttribute('position', new Float32BufferAttribute(vertices, 3));\n\t\t\tgeometry.setAttribute('color', new Float32BufferAttribute(colors, 3));\n\t\t\tconst material = new LineBasicMaterial({\n\t\t\t\tvertexColors: true,\n\t\t\t\ttoneMapped: false\n\t\t\t});\n\t\t\tsuper(geometry, material);\n\t\t\tthis.type = 'AxesHelper';\n\t\t}\n\n\t\tsetColors(xAxisColor, yAxisColor, zAxisColor) {\n\t\t\tconst color = new Color();\n\t\t\tconst array = this.geometry.attributes.color.array;\n\t\t\tcolor.set(xAxisColor);\n\t\t\tcolor.toArray(array, 0);\n\t\t\tcolor.toArray(array, 3);\n\t\t\tcolor.set(yAxisColor);\n\t\t\tcolor.toArray(array, 6);\n\t\t\tcolor.toArray(array, 9);\n\t\t\tcolor.set(zAxisColor);\n\t\t\tcolor.toArray(array, 12);\n\t\t\tcolor.toArray(array, 15);\n\t\t\tthis.geometry.attributes.color.needsUpdate = true;\n\t\t\treturn this;\n\t\t}\n\n\t\tdispose() {\n\t\t\tthis.geometry.dispose();\n\t\t\tthis.material.dispose();\n\t\t}\n\n\t}\n\n\tclass ShapePath {\n\t\tconstructor() {\n\t\t\tthis.type = 'ShapePath';\n\t\t\tthis.color = new Color();\n\t\t\tthis.subPaths = [];\n\t\t\tthis.currentPath = null;\n\t\t}\n\n\t\tmoveTo(x, y) {\n\t\t\tthis.currentPath = new Path();\n\t\t\tthis.subPaths.push(this.currentPath);\n\t\t\tthis.currentPath.moveTo(x, y);\n\t\t\treturn this;\n\t\t}\n\n\t\tlineTo(x, y) {\n\t\t\tthis.currentPath.lineTo(x, y);\n\t\t\treturn this;\n\t\t}\n\n\t\tquadraticCurveTo(aCPx, aCPy, aX, aY) {\n\t\t\tthis.currentPath.quadraticCurveTo(aCPx, aCPy, aX, aY);\n\t\t\treturn this;\n\t\t}\n\n\t\tbezierCurveTo(aCP1x, aCP1y, aCP2x, aCP2y, aX, aY) {\n\t\t\tthis.currentPath.bezierCurveTo(aCP1x, aCP1y, aCP2x, aCP2y, aX, aY);\n\t\t\treturn this;\n\t\t}\n\n\t\tsplineThru(pts) {\n\t\t\tthis.currentPath.splineThru(pts);\n\t\t\treturn this;\n\t\t}\n\n\t\ttoShapes(isCCW, noHoles) {\n\t\t\tfunction toShapesNoHoles(inSubpaths) {\n\t\t\t\tconst shapes = [];\n\n\t\t\t\tfor (let i = 0, l = inSubpaths.length; i < l; i++) {\n\t\t\t\t\tconst tmpPath = inSubpaths[i];\n\t\t\t\t\tconst tmpShape = new Shape();\n\t\t\t\t\ttmpShape.curves = tmpPath.curves;\n\t\t\t\t\tshapes.push(tmpShape);\n\t\t\t\t}\n\n\t\t\t\treturn shapes;\n\t\t\t}\n\n\t\t\tfunction isPointInsidePolygon(inPt, inPolygon) {\n\t\t\t\tconst polyLen = inPolygon.length; // inPt on polygon contour => immediate success\t\tor\n\t\t\t\t// toggling of inside/outside at every single! intersection point of an edge\n\t\t\t\t//\twith the horizontal line through inPt, left of inPt\n\t\t\t\t//\tnot counting lowerY endpoints of edges and whole edges on that line\n\n\t\t\t\tlet inside = false;\n\n\t\t\t\tfor (let p = polyLen - 1, q = 0; q < polyLen; p = q++) {\n\t\t\t\t\tlet edgeLowPt = inPolygon[p];\n\t\t\t\t\tlet edgeHighPt = inPolygon[q];\n\t\t\t\t\tlet edgeDx = edgeHighPt.x - edgeLowPt.x;\n\t\t\t\t\tlet edgeDy = edgeHighPt.y - edgeLowPt.y;\n\n\t\t\t\t\tif (Math.abs(edgeDy) > Number.EPSILON) {\n\t\t\t\t\t\t// not parallel\n\t\t\t\t\t\tif (edgeDy < 0) {\n\t\t\t\t\t\t\tedgeLowPt = inPolygon[q];\n\t\t\t\t\t\t\tedgeDx = -edgeDx;\n\t\t\t\t\t\t\tedgeHighPt = inPolygon[p];\n\t\t\t\t\t\t\tedgeDy = -edgeDy;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (inPt.y < edgeLowPt.y || inPt.y > edgeHighPt.y) continue;\n\n\t\t\t\t\t\tif (inPt.y === edgeLowPt.y) {\n\t\t\t\t\t\t\tif (inPt.x === edgeLowPt.x) return true; // inPt is on contour ?\n\t\t\t\t\t\t\t// continue;\t\t\t\t// no intersection or edgeLowPt => doesn't count !!!\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst perpEdge = edgeDy * (inPt.x - edgeLowPt.x) - edgeDx * (inPt.y - edgeLowPt.y);\n\t\t\t\t\t\t\tif (perpEdge === 0) return true; // inPt is on contour ?\n\n\t\t\t\t\t\t\tif (perpEdge < 0) continue;\n\t\t\t\t\t\t\tinside = !inside; // true intersection left of inPt\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// parallel or collinear\n\t\t\t\t\t\tif (inPt.y !== edgeLowPt.y) continue; // parallel\n\t\t\t\t\t\t// edge lies on the same horizontal line as inPt\n\n\t\t\t\t\t\tif (edgeHighPt.x <= inPt.x && inPt.x <= edgeLowPt.x || edgeLowPt.x <= inPt.x && inPt.x <= edgeHighPt.x) return true; // inPt: Point on contour !\n\t\t\t\t\t\t// continue;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn inside;\n\t\t\t}\n\n\t\t\tconst isClockWise = ShapeUtils.isClockWise;\n\t\t\tconst subPaths = this.subPaths;\n\t\t\tif (subPaths.length === 0) return [];\n\t\t\tif (noHoles === true) return toShapesNoHoles(subPaths);\n\t\t\tlet solid, tmpPath, tmpShape;\n\t\t\tconst shapes = [];\n\n\t\t\tif (subPaths.length === 1) {\n\t\t\t\ttmpPath = subPaths[0];\n\t\t\t\ttmpShape = new Shape();\n\t\t\t\ttmpShape.curves = tmpPath.curves;\n\t\t\t\tshapes.push(tmpShape);\n\t\t\t\treturn shapes;\n\t\t\t}\n\n\t\t\tlet holesFirst = !isClockWise(subPaths[0].getPoints());\n\t\t\tholesFirst = isCCW ? !holesFirst : holesFirst; // console.log(\"Holes first\", holesFirst);\n\n\t\t\tconst betterShapeHoles = [];\n\t\t\tconst newShapes = [];\n\t\t\tlet newShapeHoles = [];\n\t\t\tlet mainIdx = 0;\n\t\t\tlet tmpPoints;\n\t\t\tnewShapes[mainIdx] = undefined;\n\t\t\tnewShapeHoles[mainIdx] = [];\n\n\t\t\tfor (let i = 0, l = subPaths.length; i < l; i++) {\n\t\t\t\ttmpPath = subPaths[i];\n\t\t\t\ttmpPoints = tmpPath.getPoints();\n\t\t\t\tsolid = isClockWise(tmpPoints);\n\t\t\t\tsolid = isCCW ? !solid : solid;\n\n\t\t\t\tif (solid) {\n\t\t\t\t\tif (!holesFirst && newShapes[mainIdx]) mainIdx++;\n\t\t\t\t\tnewShapes[mainIdx] = {\n\t\t\t\t\t\ts: new Shape(),\n\t\t\t\t\t\tp: tmpPoints\n\t\t\t\t\t};\n\t\t\t\t\tnewShapes[mainIdx].s.curves = tmpPath.curves;\n\t\t\t\t\tif (holesFirst) mainIdx++;\n\t\t\t\t\tnewShapeHoles[mainIdx] = []; //console.log('cw', i);\n\t\t\t\t} else {\n\t\t\t\t\tnewShapeHoles[mainIdx].push({\n\t\t\t\t\t\th: tmpPath,\n\t\t\t\t\t\tp: tmpPoints[0]\n\t\t\t\t\t}); //console.log('ccw', i);\n\t\t\t\t}\n\t\t\t} // only Holes? -> probably all Shapes with wrong orientation\n\n\n\t\t\tif (!newShapes[0]) return toShapesNoHoles(subPaths);\n\n\t\t\tif (newShapes.length > 1) {\n\t\t\t\tlet ambiguous = false;\n\t\t\t\tconst toChange = [];\n\n\t\t\t\tfor (let sIdx = 0, sLen = newShapes.length; sIdx < sLen; sIdx++) {\n\t\t\t\t\tbetterShapeHoles[sIdx] = [];\n\t\t\t\t}\n\n\t\t\t\tfor (let sIdx = 0, sLen = newShapes.length; sIdx < sLen; sIdx++) {\n\t\t\t\t\tconst sho = newShapeHoles[sIdx];\n\n\t\t\t\t\tfor (let hIdx = 0; hIdx < sho.length; hIdx++) {\n\t\t\t\t\t\tconst ho = sho[hIdx];\n\t\t\t\t\t\tlet hole_unassigned = true;\n\n\t\t\t\t\t\tfor (let s2Idx = 0; s2Idx < newShapes.length; s2Idx++) {\n\t\t\t\t\t\t\tif (isPointInsidePolygon(ho.p, newShapes[s2Idx].p)) {\n\t\t\t\t\t\t\t\tif (sIdx !== s2Idx) toChange.push({\n\t\t\t\t\t\t\t\t\tfroms: sIdx,\n\t\t\t\t\t\t\t\t\ttos: s2Idx,\n\t\t\t\t\t\t\t\t\thole: hIdx\n\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\tif (hole_unassigned) {\n\t\t\t\t\t\t\t\t\thole_unassigned = false;\n\t\t\t\t\t\t\t\t\tbetterShapeHoles[s2Idx].push(ho);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tambiguous = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (hole_unassigned) {\n\t\t\t\t\t\t\tbetterShapeHoles[sIdx].push(ho);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} // console.log(\"ambiguous: \", ambiguous);\n\n\n\t\t\t\tif (toChange.length > 0) {\n\t\t\t\t\t// console.log(\"to change: \", toChange);\n\t\t\t\t\tif (!ambiguous) newShapeHoles = betterShapeHoles;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet tmpHoles;\n\n\t\t\tfor (let i = 0, il = newShapes.length; i < il; i++) {\n\t\t\t\ttmpShape = newShapes[i].s;\n\t\t\t\tshapes.push(tmpShape);\n\t\t\t\ttmpHoles = newShapeHoles[i];\n\n\t\t\t\tfor (let j = 0, jl = tmpHoles.length; j < jl; j++) {\n\t\t\t\t\ttmpShape.holes.push(tmpHoles[j].h);\n\t\t\t\t}\n\t\t\t} //console.log(\"shape\", shapes);\n\n\n\t\t\treturn shapes;\n\t\t}\n\n\t}\n\n\tconst _floatView = new Float32Array(1);\n\n\tconst _int32View = new Int32Array(_floatView.buffer);\n\n\tclass DataUtils {\n\t\t// Converts float32 to float16 (stored as uint16 value).\n\t\tstatic toHalfFloat(val) {\n\t\t\tif (val > 65504) {\n\t\t\t\tconsole.warn('THREE.DataUtils.toHalfFloat(): value exceeds 65504.');\n\t\t\t\tval = 65504; // maximum representable value in float16\n\t\t\t} // Source: http://gamedev.stackexchange.com/questions/17326/conversion-of-a-number-from-single-precision-floating-point-representation-to-a/17410#17410\n\n\t\t\t/* This method is faster than the OpenEXR implementation (very often\n\t\t\t* used, eg. in Ogre), with the additional benefit of rounding, inspired\n\t\t\t* by James Tursa?s half-precision code. */\n\n\n\t\t\t_floatView[0] = val;\n\t\t\tconst x = _int32View[0];\n\t\t\tlet bits = x >> 16 & 0x8000;\n\t\t\t/* Get the sign */\n\n\t\t\tlet m = x >> 12 & 0x07ff;\n\t\t\t/* Keep one extra bit for rounding */\n\n\t\t\tconst e = x >> 23 & 0xff;\n\t\t\t/* Using int is faster here */\n\n\t\t\t/* If zero, or denormal, or exponent underflows too much for a denormal\n\t\t\t\t* half, return signed zero. */\n\n\t\t\tif (e < 103) return bits;\n\t\t\t/* If NaN, return NaN. If Inf or exponent overflow, return Inf. */\n\n\t\t\tif (e > 142) {\n\t\t\t\tbits |= 0x7c00;\n\t\t\t\t/* If exponent was 0xff and one mantissa bit was set, it means NaN,\n\t\t\t\t\t\t\t* not Inf, so make sure we set one mantissa bit too. */\n\n\t\t\t\tbits |= (e == 255 ? 0 : 1) && x & 0x007fffff;\n\t\t\t\treturn bits;\n\t\t\t}\n\t\t\t/* If exponent underflows but not too much, return a denormal */\n\n\n\t\t\tif (e < 113) {\n\t\t\t\tm |= 0x0800;\n\t\t\t\t/* Extra rounding may overflow and set mantissa to 0 and exponent\n\t\t\t\t\t* to 1, which is OK. */\n\n\t\t\t\tbits |= (m >> 114 - e) + (m >> 113 - e & 1);\n\t\t\t\treturn bits;\n\t\t\t}\n\n\t\t\tbits |= e - 112 << 10 | m >> 1;\n\t\t\t/* Extra rounding. An overflow will set mantissa to 0 and increment\n\t\t\t\t* the exponent, which is OK. */\n\n\t\t\tbits += m & 1;\n\t\t\treturn bits;\n\t\t}\n\n\t}\n\n\tconst LineStrip = 0;\n\tconst LinePieces = 1;\n\tconst NoColors = 0;\n\tconst FaceColors = 1;\n\tconst VertexColors = 2;\n\tfunction MeshFaceMaterial(materials) {\n\t\tconsole.warn('THREE.MeshFaceMaterial has been removed. Use an Array instead.');\n\t\treturn materials;\n\t}\n\tfunction MultiMaterial(materials = []) {\n\t\tconsole.warn('THREE.MultiMaterial has been removed. Use an Array instead.');\n\t\tmaterials.isMultiMaterial = true;\n\t\tmaterials.materials = materials;\n\n\t\tmaterials.clone = function () {\n\t\t\treturn materials.slice();\n\t\t};\n\n\t\treturn materials;\n\t}\n\tfunction PointCloud(geometry, material) {\n\t\tconsole.warn('THREE.PointCloud has been renamed to THREE.Points.');\n\t\treturn new Points(geometry, material);\n\t}\n\tfunction Particle(material) {\n\t\tconsole.warn('THREE.Particle has been renamed to THREE.Sprite.');\n\t\treturn new Sprite(material);\n\t}\n\tfunction ParticleSystem(geometry, material) {\n\t\tconsole.warn('THREE.ParticleSystem has been renamed to THREE.Points.');\n\t\treturn new Points(geometry, material);\n\t}\n\tfunction PointCloudMaterial(parameters) {\n\t\tconsole.warn('THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial.');\n\t\treturn new PointsMaterial(parameters);\n\t}\n\tfunction ParticleBasicMaterial(parameters) {\n\t\tconsole.warn('THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial.');\n\t\treturn new PointsMaterial(parameters);\n\t}\n\tfunction ParticleSystemMaterial(parameters) {\n\t\tconsole.warn('THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial.');\n\t\treturn new PointsMaterial(parameters);\n\t}\n\tfunction Vertex(x, y, z) {\n\t\tconsole.warn('THREE.Vertex has been removed. Use THREE.Vector3 instead.');\n\t\treturn new Vector3(x, y, z);\n\t} //\n\n\tfunction DynamicBufferAttribute(array, itemSize) {\n\t\tconsole.warn('THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setUsage( THREE.DynamicDrawUsage ) instead.');\n\t\treturn new BufferAttribute(array, itemSize).setUsage(DynamicDrawUsage);\n\t}\n\tfunction Int8Attribute(array, itemSize) {\n\t\tconsole.warn('THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead.');\n\t\treturn new Int8BufferAttribute(array, itemSize);\n\t}\n\tfunction Uint8Attribute(array, itemSize) {\n\t\tconsole.warn('THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead.');\n\t\treturn new Uint8BufferAttribute(array, itemSize);\n\t}\n\tfunction Uint8ClampedAttribute(array, itemSize) {\n\t\tconsole.warn('THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead.');\n\t\treturn new Uint8ClampedBufferAttribute(array, itemSize);\n\t}\n\tfunction Int16Attribute(array, itemSize) {\n\t\tconsole.warn('THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead.');\n\t\treturn new Int16BufferAttribute(array, itemSize);\n\t}\n\tfunction Uint16Attribute(array, itemSize) {\n\t\tconsole.warn('THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead.');\n\t\treturn new Uint16BufferAttribute(array, itemSize);\n\t}\n\tfunction Int32Attribute(array, itemSize) {\n\t\tconsole.warn('THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead.');\n\t\treturn new Int32BufferAttribute(array, itemSize);\n\t}\n\tfunction Uint32Attribute(array, itemSize) {\n\t\tconsole.warn('THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead.');\n\t\treturn new Uint32BufferAttribute(array, itemSize);\n\t}\n\tfunction Float32Attribute(array, itemSize) {\n\t\tconsole.warn('THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead.');\n\t\treturn new Float32BufferAttribute(array, itemSize);\n\t}\n\tfunction Float64Attribute(array, itemSize) {\n\t\tconsole.warn('THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead.');\n\t\treturn new Float64BufferAttribute(array, itemSize);\n\t} //\n\n\tCurve.create = function (construct, getPoint) {\n\t\tconsole.log('THREE.Curve.create() has been deprecated');\n\t\tconstruct.prototype = Object.create(Curve.prototype);\n\t\tconstruct.prototype.constructor = construct;\n\t\tconstruct.prototype.getPoint = getPoint;\n\t\treturn construct;\n\t}; //\n\n\n\tPath.prototype.fromPoints = function (points) {\n\t\tconsole.warn('THREE.Path: .fromPoints() has been renamed to .setFromPoints().');\n\t\treturn this.setFromPoints(points);\n\t}; //\n\n\n\tfunction AxisHelper(size) {\n\t\tconsole.warn('THREE.AxisHelper has been renamed to THREE.AxesHelper.');\n\t\treturn new AxesHelper(size);\n\t}\n\tfunction BoundingBoxHelper(object, color) {\n\t\tconsole.warn('THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead.');\n\t\treturn new BoxHelper(object, color);\n\t}\n\tfunction EdgesHelper(object, hex) {\n\t\tconsole.warn('THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead.');\n\t\treturn new LineSegments(new EdgesGeometry(object.geometry), new LineBasicMaterial({\n\t\t\tcolor: hex !== undefined ? hex : 0xffffff\n\t\t}));\n\t}\n\n\tGridHelper.prototype.setColors = function () {\n\t\tconsole.error('THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.');\n\t};\n\n\tSkeletonHelper.prototype.update = function () {\n\t\tconsole.error('THREE.SkeletonHelper: update() no longer needs to be called.');\n\t};\n\n\tfunction WireframeHelper(object, hex) {\n\t\tconsole.warn('THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead.');\n\t\treturn new LineSegments(new WireframeGeometry(object.geometry), new LineBasicMaterial({\n\t\t\tcolor: hex !== undefined ? hex : 0xffffff\n\t\t}));\n\t} //\n\n\tLoader.prototype.extractUrlBase = function (url) {\n\t\tconsole.warn('THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead.');\n\t\treturn LoaderUtils.extractUrlBase(url);\n\t};\n\n\tLoader.Handlers = {\n\t\tadd: function () {\n\t\t\tconsole.error('THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.');\n\t\t},\n\t\tget: function () {\n\t\t\tconsole.error('THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.');\n\t\t}\n\t};\n\tfunction XHRLoader(manager) {\n\t\tconsole.warn('THREE.XHRLoader has been renamed to THREE.FileLoader.');\n\t\treturn new FileLoader(manager);\n\t}\n\tfunction BinaryTextureLoader(manager) {\n\t\tconsole.warn('THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader.');\n\t\treturn new DataTextureLoader(manager);\n\t} //\n\n\tBox2.prototype.center = function (optionalTarget) {\n\t\tconsole.warn('THREE.Box2: .center() has been renamed to .getCenter().');\n\t\treturn this.getCenter(optionalTarget);\n\t};\n\n\tBox2.prototype.empty = function () {\n\t\tconsole.warn('THREE.Box2: .empty() has been renamed to .isEmpty().');\n\t\treturn this.isEmpty();\n\t};\n\n\tBox2.prototype.isIntersectionBox = function (box) {\n\t\tconsole.warn('THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox().');\n\t\treturn this.intersectsBox(box);\n\t};\n\n\tBox2.prototype.size = function (optionalTarget) {\n\t\tconsole.warn('THREE.Box2: .size() has been renamed to .getSize().');\n\t\treturn this.getSize(optionalTarget);\n\t}; //\n\n\n\tBox3.prototype.center = function (optionalTarget) {\n\t\tconsole.warn('THREE.Box3: .center() has been renamed to .getCenter().');\n\t\treturn this.getCenter(optionalTarget);\n\t};\n\n\tBox3.prototype.empty = function () {\n\t\tconsole.warn('THREE.Box3: .empty() has been renamed to .isEmpty().');\n\t\treturn this.isEmpty();\n\t};\n\n\tBox3.prototype.isIntersectionBox = function (box) {\n\t\tconsole.warn('THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox().');\n\t\treturn this.intersectsBox(box);\n\t};\n\n\tBox3.prototype.isIntersectionSphere = function (sphere) {\n\t\tconsole.warn('THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere().');\n\t\treturn this.intersectsSphere(sphere);\n\t};\n\n\tBox3.prototype.size = function (optionalTarget) {\n\t\tconsole.warn('THREE.Box3: .size() has been renamed to .getSize().');\n\t\treturn this.getSize(optionalTarget);\n\t}; //\n\n\n\tSphere.prototype.empty = function () {\n\t\tconsole.warn('THREE.Sphere: .empty() has been renamed to .isEmpty().');\n\t\treturn this.isEmpty();\n\t}; //\n\n\n\tFrustum.prototype.setFromMatrix = function (m) {\n\t\tconsole.warn('THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix().');\n\t\treturn this.setFromProjectionMatrix(m);\n\t}; //\n\n\n\tLine3.prototype.center = function (optionalTarget) {\n\t\tconsole.warn('THREE.Line3: .center() has been renamed to .getCenter().');\n\t\treturn this.getCenter(optionalTarget);\n\t}; //\n\n\n\tMatrix3.prototype.flattenToArrayOffset = function (array, offset) {\n\t\tconsole.warn('THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead.');\n\t\treturn this.toArray(array, offset);\n\t};\n\n\tMatrix3.prototype.multiplyVector3 = function (vector) {\n\t\tconsole.warn('THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead.');\n\t\treturn vector.applyMatrix3(this);\n\t};\n\n\tMatrix3.prototype.multiplyVector3Array = function () {\n\t\tconsole.error('THREE.Matrix3: .multiplyVector3Array() has been removed.');\n\t};\n\n\tMatrix3.prototype.applyToBufferAttribute = function (attribute) {\n\t\tconsole.warn('THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead.');\n\t\treturn attribute.applyMatrix3(this);\n\t};\n\n\tMatrix3.prototype.applyToVector3Array = function () {\n\t\tconsole.error('THREE.Matrix3: .applyToVector3Array() has been removed.');\n\t};\n\n\tMatrix3.prototype.getInverse = function (matrix) {\n\t\tconsole.warn('THREE.Matrix3: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead.');\n\t\treturn this.copy(matrix).invert();\n\t}; //\n\n\n\tMatrix4.prototype.extractPosition = function (m) {\n\t\tconsole.warn('THREE.Matrix4: .extractPosition() has been renamed to .copyPosition().');\n\t\treturn this.copyPosition(m);\n\t};\n\n\tMatrix4.prototype.flattenToArrayOffset = function (array, offset) {\n\t\tconsole.warn('THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead.');\n\t\treturn this.toArray(array, offset);\n\t};\n\n\tMatrix4.prototype.getPosition = function () {\n\t\tconsole.warn('THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead.');\n\t\treturn new Vector3().setFromMatrixColumn(this, 3);\n\t};\n\n\tMatrix4.prototype.setRotationFromQuaternion = function (q) {\n\t\tconsole.warn('THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion().');\n\t\treturn this.makeRotationFromQuaternion(q);\n\t};\n\n\tMatrix4.prototype.multiplyToArray = function () {\n\t\tconsole.warn('THREE.Matrix4: .multiplyToArray() has been removed.');\n\t};\n\n\tMatrix4.prototype.multiplyVector3 = function (vector) {\n\t\tconsole.warn('THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead.');\n\t\treturn vector.applyMatrix4(this);\n\t};\n\n\tMatrix4.prototype.multiplyVector4 = function (vector) {\n\t\tconsole.warn('THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.');\n\t\treturn vector.applyMatrix4(this);\n\t};\n\n\tMatrix4.prototype.multiplyVector3Array = function () {\n\t\tconsole.error('THREE.Matrix4: .multiplyVector3Array() has been removed.');\n\t};\n\n\tMatrix4.prototype.rotateAxis = function (v) {\n\t\tconsole.warn('THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.');\n\t\tv.transformDirection(this);\n\t};\n\n\tMatrix4.prototype.crossVector = function (vector) {\n\t\tconsole.warn('THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.');\n\t\treturn vector.applyMatrix4(this);\n\t};\n\n\tMatrix4.prototype.translate = function () {\n\t\tconsole.error('THREE.Matrix4: .translate() has been removed.');\n\t};\n\n\tMatrix4.prototype.rotateX = function () {\n\t\tconsole.error('THREE.Matrix4: .rotateX() has been removed.');\n\t};\n\n\tMatrix4.prototype.rotateY = function () {\n\t\tconsole.error('THREE.Matrix4: .rotateY() has been removed.');\n\t};\n\n\tMatrix4.prototype.rotateZ = function () {\n\t\tconsole.error('THREE.Matrix4: .rotateZ() has been removed.');\n\t};\n\n\tMatrix4.prototype.rotateByAxis = function () {\n\t\tconsole.error('THREE.Matrix4: .rotateByAxis() has been removed.');\n\t};\n\n\tMatrix4.prototype.applyToBufferAttribute = function (attribute) {\n\t\tconsole.warn('THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead.');\n\t\treturn attribute.applyMatrix4(this);\n\t};\n\n\tMatrix4.prototype.applyToVector3Array = function () {\n\t\tconsole.error('THREE.Matrix4: .applyToVector3Array() has been removed.');\n\t};\n\n\tMatrix4.prototype.makeFrustum = function (left, right, bottom, top, near, far) {\n\t\tconsole.warn('THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead.');\n\t\treturn this.makePerspective(left, right, top, bottom, near, far);\n\t};\n\n\tMatrix4.prototype.getInverse = function (matrix) {\n\t\tconsole.warn('THREE.Matrix4: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead.');\n\t\treturn this.copy(matrix).invert();\n\t}; //\n\n\n\tPlane.prototype.isIntersectionLine = function (line) {\n\t\tconsole.warn('THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine().');\n\t\treturn this.intersectsLine(line);\n\t}; //\n\n\n\tQuaternion.prototype.multiplyVector3 = function (vector) {\n\t\tconsole.warn('THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead.');\n\t\treturn vector.applyQuaternion(this);\n\t};\n\n\tQuaternion.prototype.inverse = function () {\n\t\tconsole.warn('THREE.Quaternion: .inverse() has been renamed to invert().');\n\t\treturn this.invert();\n\t}; //\n\n\n\tRay.prototype.isIntersectionBox = function (box) {\n\t\tconsole.warn('THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox().');\n\t\treturn this.intersectsBox(box);\n\t};\n\n\tRay.prototype.isIntersectionPlane = function (plane) {\n\t\tconsole.warn('THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane().');\n\t\treturn this.intersectsPlane(plane);\n\t};\n\n\tRay.prototype.isIntersectionSphere = function (sphere) {\n\t\tconsole.warn('THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere().');\n\t\treturn this.intersectsSphere(sphere);\n\t}; //\n\n\n\tTriangle.prototype.area = function () {\n\t\tconsole.warn('THREE.Triangle: .area() has been renamed to .getArea().');\n\t\treturn this.getArea();\n\t};\n\n\tTriangle.prototype.barycoordFromPoint = function (point, target) {\n\t\tconsole.warn('THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord().');\n\t\treturn this.getBarycoord(point, target);\n\t};\n\n\tTriangle.prototype.midpoint = function (target) {\n\t\tconsole.warn('THREE.Triangle: .midpoint() has been renamed to .getMidpoint().');\n\t\treturn this.getMidpoint(target);\n\t};\n\n\tTriangle.prototypenormal = function (target) {\n\t\tconsole.warn('THREE.Triangle: .normal() has been renamed to .getNormal().');\n\t\treturn this.getNormal(target);\n\t};\n\n\tTriangle.prototype.plane = function (target) {\n\t\tconsole.warn('THREE.Triangle: .plane() has been renamed to .getPlane().');\n\t\treturn this.getPlane(target);\n\t};\n\n\tTriangle.barycoordFromPoint = function (point, a, b, c, target) {\n\t\tconsole.warn('THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord().');\n\t\treturn Triangle.getBarycoord(point, a, b, c, target);\n\t};\n\n\tTriangle.normal = function (a, b, c, target) {\n\t\tconsole.warn('THREE.Triangle: .normal() has been renamed to .getNormal().');\n\t\treturn Triangle.getNormal(a, b, c, target);\n\t}; //\n\n\n\tShape.prototype.extractAllPoints = function (divisions) {\n\t\tconsole.warn('THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead.');\n\t\treturn this.extractPoints(divisions);\n\t};\n\n\tShape.prototype.extrude = function (options) {\n\t\tconsole.warn('THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead.');\n\t\treturn new ExtrudeGeometry(this, options);\n\t};\n\n\tShape.prototype.makeGeometry = function (options) {\n\t\tconsole.warn('THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead.');\n\t\treturn new ShapeGeometry(this, options);\n\t}; //\n\n\n\tVector2.prototype.fromAttribute = function (attribute, index, offset) {\n\t\tconsole.warn('THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute().');\n\t\treturn this.fromBufferAttribute(attribute, index, offset);\n\t};\n\n\tVector2.prototype.distanceToManhattan = function (v) {\n\t\tconsole.warn('THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo().');\n\t\treturn this.manhattanDistanceTo(v);\n\t};\n\n\tVector2.prototype.lengthManhattan = function () {\n\t\tconsole.warn('THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength().');\n\t\treturn this.manhattanLength();\n\t}; //\n\n\n\tVector3.prototype.setEulerFromRotationMatrix = function () {\n\t\tconsole.error('THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.');\n\t};\n\n\tVector3.prototype.setEulerFromQuaternion = function () {\n\t\tconsole.error('THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.');\n\t};\n\n\tVector3.prototype.getPositionFromMatrix = function (m) {\n\t\tconsole.warn('THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition().');\n\t\treturn this.setFromMatrixPosition(m);\n\t};\n\n\tVector3.prototype.getScaleFromMatrix = function (m) {\n\t\tconsole.warn('THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale().');\n\t\treturn this.setFromMatrixScale(m);\n\t};\n\n\tVector3.prototype.getColumnFromMatrix = function (index, matrix) {\n\t\tconsole.warn('THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn().');\n\t\treturn this.setFromMatrixColumn(matrix, index);\n\t};\n\n\tVector3.prototype.applyProjection = function (m) {\n\t\tconsole.warn('THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead.');\n\t\treturn this.applyMatrix4(m);\n\t};\n\n\tVector3.prototype.fromAttribute = function (attribute, index, offset) {\n\t\tconsole.warn('THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute().');\n\t\treturn this.fromBufferAttribute(attribute, index, offset);\n\t};\n\n\tVector3.prototype.distanceToManhattan = function (v) {\n\t\tconsole.warn('THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo().');\n\t\treturn this.manhattanDistanceTo(v);\n\t};\n\n\tVector3.prototype.lengthManhattan = function () {\n\t\tconsole.warn('THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength().');\n\t\treturn this.manhattanLength();\n\t}; //\n\n\n\tVector4.prototype.fromAttribute = function (attribute, index, offset) {\n\t\tconsole.warn('THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute().');\n\t\treturn this.fromBufferAttribute(attribute, index, offset);\n\t};\n\n\tVector4.prototype.lengthManhattan = function () {\n\t\tconsole.warn('THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength().');\n\t\treturn this.manhattanLength();\n\t}; //\n\n\n\tObject3D.prototype.getChildByName = function (name) {\n\t\tconsole.warn('THREE.Object3D: .getChildByName() has been renamed to .getObjectByName().');\n\t\treturn this.getObjectByName(name);\n\t};\n\n\tObject3D.prototype.renderDepth = function () {\n\t\tconsole.warn('THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.');\n\t};\n\n\tObject3D.prototype.translate = function (distance, axis) {\n\t\tconsole.warn('THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead.');\n\t\treturn this.translateOnAxis(axis, distance);\n\t};\n\n\tObject3D.prototype.getWorldRotation = function () {\n\t\tconsole.error('THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.');\n\t};\n\n\tObject3D.prototype.applyMatrix = function (matrix) {\n\t\tconsole.warn('THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4().');\n\t\treturn this.applyMatrix4(matrix);\n\t};\n\n\tObject.defineProperties(Object3D.prototype, {\n\t\teulerOrder: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn('THREE.Object3D: .eulerOrder is now .rotation.order.');\n\t\t\t\treturn this.rotation.order;\n\t\t\t},\n\t\t\tset: function (value) {\n\t\t\t\tconsole.warn('THREE.Object3D: .eulerOrder is now .rotation.order.');\n\t\t\t\tthis.rotation.order = value;\n\t\t\t}\n\t\t},\n\t\tuseQuaternion: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn('THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.');\n\t\t\t},\n\t\t\tset: function () {\n\t\t\t\tconsole.warn('THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.');\n\t\t\t}\n\t\t}\n\t});\n\n\tMesh.prototype.setDrawMode = function () {\n\t\tconsole.error('THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.');\n\t};\n\n\tObject.defineProperties(Mesh.prototype, {\n\t\tdrawMode: {\n\t\t\tget: function () {\n\t\t\t\tconsole.error('THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode.');\n\t\t\t\treturn TrianglesDrawMode;\n\t\t\t},\n\t\t\tset: function () {\n\t\t\t\tconsole.error('THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.');\n\t\t\t}\n\t\t}\n\t});\n\n\tSkinnedMesh.prototype.initBones = function () {\n\t\tconsole.error('THREE.SkinnedMesh: initBones() has been removed.');\n\t}; //\n\n\n\tPerspectiveCamera.prototype.setLens = function (focalLength, filmGauge) {\n\t\tconsole.warn('THREE.PerspectiveCamera.setLens is deprecated. ' + 'Use .setFocalLength and .filmGauge for a photographic setup.');\n\t\tif (filmGauge !== undefined) this.filmGauge = filmGauge;\n\t\tthis.setFocalLength(focalLength);\n\t}; //\n\n\n\tObject.defineProperties(Light.prototype, {\n\t\tonlyShadow: {\n\t\t\tset: function () {\n\t\t\t\tconsole.warn('THREE.Light: .onlyShadow has been removed.');\n\t\t\t}\n\t\t},\n\t\tshadowCameraFov: {\n\t\t\tset: function (value) {\n\t\t\t\tconsole.warn('THREE.Light: .shadowCameraFov is now .shadow.camera.fov.');\n\t\t\t\tthis.shadow.camera.fov = value;\n\t\t\t}\n\t\t},\n\t\tshadowCameraLeft: {\n\t\t\tset: function (value) {\n\t\t\t\tconsole.warn('THREE.Light: .shadowCameraLeft is now .shadow.camera.left.');\n\t\t\t\tthis.shadow.camera.left = value;\n\t\t\t}\n\t\t},\n\t\tshadowCameraRight: {\n\t\t\tset: function (value) {\n\t\t\t\tconsole.warn('THREE.Light: .shadowCameraRight is now .shadow.camera.right.');\n\t\t\t\tthis.shadow.camera.right = value;\n\t\t\t}\n\t\t},\n\t\tshadowCameraTop: {\n\t\t\tset: function (value) {\n\t\t\t\tconsole.warn('THREE.Light: .shadowCameraTop is now .shadow.camera.top.');\n\t\t\t\tthis.shadow.camera.top = value;\n\t\t\t}\n\t\t},\n\t\tshadowCameraBottom: {\n\t\t\tset: function (value) {\n\t\t\t\tconsole.warn('THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom.');\n\t\t\t\tthis.shadow.camera.bottom = value;\n\t\t\t}\n\t\t},\n\t\tshadowCameraNear: {\n\t\t\tset: function (value) {\n\t\t\t\tconsole.warn('THREE.Light: .shadowCameraNear is now .shadow.camera.near.');\n\t\t\t\tthis.shadow.camera.near = value;\n\t\t\t}\n\t\t},\n\t\tshadowCameraFar: {\n\t\t\tset: function (value) {\n\t\t\t\tconsole.warn('THREE.Light: .shadowCameraFar is now .shadow.camera.far.');\n\t\t\t\tthis.shadow.camera.far = value;\n\t\t\t}\n\t\t},\n\t\tshadowCameraVisible: {\n\t\t\tset: function () {\n\t\t\t\tconsole.warn('THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.');\n\t\t\t}\n\t\t},\n\t\tshadowBias: {\n\t\t\tset: function (value) {\n\t\t\t\tconsole.warn('THREE.Light: .shadowBias is now .shadow.bias.');\n\t\t\t\tthis.shadow.bias = value;\n\t\t\t}\n\t\t},\n\t\tshadowDarkness: {\n\t\t\tset: function () {\n\t\t\t\tconsole.warn('THREE.Light: .shadowDarkness has been removed.');\n\t\t\t}\n\t\t},\n\t\tshadowMapWidth: {\n\t\t\tset: function (value) {\n\t\t\t\tconsole.warn('THREE.Light: .shadowMapWidth is now .shadow.mapSize.width.');\n\t\t\t\tthis.shadow.mapSize.width = value;\n\t\t\t}\n\t\t},\n\t\tshadowMapHeight: {\n\t\t\tset: function (value) {\n\t\t\t\tconsole.warn('THREE.Light: .shadowMapHeight is now .shadow.mapSize.height.');\n\t\t\t\tthis.shadow.mapSize.height = value;\n\t\t\t}\n\t\t}\n\t}); //\n\n\tObject.defineProperties(BufferAttribute.prototype, {\n\t\tlength: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn('THREE.BufferAttribute: .length has been deprecated. Use .count instead.');\n\t\t\t\treturn this.array.length;\n\t\t\t}\n\t\t},\n\t\tdynamic: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn('THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead.');\n\t\t\t\treturn this.usage === DynamicDrawUsage;\n\t\t\t},\n\t\t\tset: function () {\n\t\t\t\tconsole.warn('THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead.');\n\t\t\t\tthis.setUsage(DynamicDrawUsage);\n\t\t\t}\n\t\t}\n\t});\n\n\tBufferAttribute.prototype.setDynamic = function (value) {\n\t\tconsole.warn('THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead.');\n\t\tthis.setUsage(value === true ? DynamicDrawUsage : StaticDrawUsage);\n\t\treturn this;\n\t};\n\n\tBufferAttribute.prototype.copyIndicesArray = function () {\n\t\tconsole.error('THREE.BufferAttribute: .copyIndicesArray() has been removed.');\n\t}, BufferAttribute.prototype.setArray = function () {\n\t\tconsole.error('THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers');\n\t}; //\n\n\tBufferGeometry.prototype.addIndex = function (index) {\n\t\tconsole.warn('THREE.BufferGeometry: .addIndex() has been renamed to .setIndex().');\n\t\tthis.setIndex(index);\n\t};\n\n\tBufferGeometry.prototype.addAttribute = function (name, attribute) {\n\t\tconsole.warn('THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute().');\n\n\t\tif (!(attribute && attribute.isBufferAttribute) && !(attribute && attribute.isInterleavedBufferAttribute)) {\n\t\t\tconsole.warn('THREE.BufferGeometry: .addAttribute() now expects ( name, attribute ).');\n\t\t\treturn this.setAttribute(name, new BufferAttribute(arguments[1], arguments[2]));\n\t\t}\n\n\t\tif (name === 'index') {\n\t\t\tconsole.warn('THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute.');\n\t\t\tthis.setIndex(attribute);\n\t\t\treturn this;\n\t\t}\n\n\t\treturn this.setAttribute(name, attribute);\n\t};\n\n\tBufferGeometry.prototype.addDrawCall = function (start, count, indexOffset) {\n\t\tif (indexOffset !== undefined) {\n\t\t\tconsole.warn('THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset.');\n\t\t}\n\n\t\tconsole.warn('THREE.BufferGeometry: .addDrawCall() is now .addGroup().');\n\t\tthis.addGroup(start, count);\n\t};\n\n\tBufferGeometry.prototype.clearDrawCalls = function () {\n\t\tconsole.warn('THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups().');\n\t\tthis.clearGroups();\n\t};\n\n\tBufferGeometry.prototype.computeOffsets = function () {\n\t\tconsole.warn('THREE.BufferGeometry: .computeOffsets() has been removed.');\n\t};\n\n\tBufferGeometry.prototype.removeAttribute = function (name) {\n\t\tconsole.warn('THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute().');\n\t\treturn this.deleteAttribute(name);\n\t};\n\n\tBufferGeometry.prototype.applyMatrix = function (matrix) {\n\t\tconsole.warn('THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4().');\n\t\treturn this.applyMatrix4(matrix);\n\t};\n\n\tObject.defineProperties(BufferGeometry.prototype, {\n\t\tdrawcalls: {\n\t\t\tget: function () {\n\t\t\t\tconsole.error('THREE.BufferGeometry: .drawcalls has been renamed to .groups.');\n\t\t\t\treturn this.groups;\n\t\t\t}\n\t\t},\n\t\toffsets: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn('THREE.BufferGeometry: .offsets has been renamed to .groups.');\n\t\t\t\treturn this.groups;\n\t\t\t}\n\t\t}\n\t});\n\n\tInterleavedBuffer.prototype.setDynamic = function (value) {\n\t\tconsole.warn('THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead.');\n\t\tthis.setUsage(value === true ? DynamicDrawUsage : StaticDrawUsage);\n\t\treturn this;\n\t};\n\n\tInterleavedBuffer.prototype.setArray = function () {\n\t\tconsole.error('THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers');\n\t}; //\n\n\n\tExtrudeGeometry.prototype.getArrays = function () {\n\t\tconsole.error('THREE.ExtrudeGeometry: .getArrays() has been removed.');\n\t};\n\n\tExtrudeGeometry.prototype.addShapeList = function () {\n\t\tconsole.error('THREE.ExtrudeGeometry: .addShapeList() has been removed.');\n\t};\n\n\tExtrudeGeometry.prototype.addShape = function () {\n\t\tconsole.error('THREE.ExtrudeGeometry: .addShape() has been removed.');\n\t}; //\n\n\n\tScene.prototype.dispose = function () {\n\t\tconsole.error('THREE.Scene: .dispose() has been removed.');\n\t}; //\n\n\n\tUniform.prototype.onUpdate = function () {\n\t\tconsole.warn('THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead.');\n\t\treturn this;\n\t}; //\n\n\n\tObject.defineProperties(Material.prototype, {\n\t\twrapAround: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn('THREE.Material: .wrapAround has been removed.');\n\t\t\t},\n\t\t\tset: function () {\n\t\t\t\tconsole.warn('THREE.Material: .wrapAround has been removed.');\n\t\t\t}\n\t\t},\n\t\toverdraw: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn('THREE.Material: .overdraw has been removed.');\n\t\t\t},\n\t\t\tset: function () {\n\t\t\t\tconsole.warn('THREE.Material: .overdraw has been removed.');\n\t\t\t}\n\t\t},\n\t\twrapRGB: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn('THREE.Material: .wrapRGB has been removed.');\n\t\t\t\treturn new Color();\n\t\t\t}\n\t\t},\n\t\tshading: {\n\t\t\tget: function () {\n\t\t\t\tconsole.error('THREE.' + this.type + ': .shading has been removed. Use the boolean .flatShading instead.');\n\t\t\t},\n\t\t\tset: function (value) {\n\t\t\t\tconsole.warn('THREE.' + this.type + ': .shading has been removed. Use the boolean .flatShading instead.');\n\t\t\t\tthis.flatShading = value === FlatShading;\n\t\t\t}\n\t\t},\n\t\tstencilMask: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn('THREE.' + this.type + ': .stencilMask has been removed. Use .stencilFuncMask instead.');\n\t\t\t\treturn this.stencilFuncMask;\n\t\t\t},\n\t\t\tset: function (value) {\n\t\t\t\tconsole.warn('THREE.' + this.type + ': .stencilMask has been removed. Use .stencilFuncMask instead.');\n\t\t\t\tthis.stencilFuncMask = value;\n\t\t\t}\n\t\t},\n\t\tvertexTangents: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn('THREE.' + this.type + ': .vertexTangents has been removed.');\n\t\t\t},\n\t\t\tset: function () {\n\t\t\t\tconsole.warn('THREE.' + this.type + ': .vertexTangents has been removed.');\n\t\t\t}\n\t\t}\n\t});\n\tObject.defineProperties(ShaderMaterial.prototype, {\n\t\tderivatives: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn('THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives.');\n\t\t\t\treturn this.extensions.derivatives;\n\t\t\t},\n\t\t\tset: function (value) {\n\t\t\t\tconsole.warn('THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives.');\n\t\t\t\tthis.extensions.derivatives = value;\n\t\t\t}\n\t\t}\n\t}); //\n\n\tWebGLRenderer.prototype.clearTarget = function (renderTarget, color, depth, stencil) {\n\t\tconsole.warn('THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead.');\n\t\tthis.setRenderTarget(renderTarget);\n\t\tthis.clear(color, depth, stencil);\n\t};\n\n\tWebGLRenderer.prototype.animate = function (callback) {\n\t\tconsole.warn('THREE.WebGLRenderer: .animate() is now .setAnimationLoop().');\n\t\tthis.setAnimationLoop(callback);\n\t};\n\n\tWebGLRenderer.prototype.getCurrentRenderTarget = function () {\n\t\tconsole.warn('THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget().');\n\t\treturn this.getRenderTarget();\n\t};\n\n\tWebGLRenderer.prototype.getMaxAnisotropy = function () {\n\t\tconsole.warn('THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy().');\n\t\treturn this.capabilities.getMaxAnisotropy();\n\t};\n\n\tWebGLRenderer.prototype.getPrecision = function () {\n\t\tconsole.warn('THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision.');\n\t\treturn this.capabilities.precision;\n\t};\n\n\tWebGLRenderer.prototype.resetGLState = function () {\n\t\tconsole.warn('THREE.WebGLRenderer: .resetGLState() is now .state.reset().');\n\t\treturn this.state.reset();\n\t};\n\n\tWebGLRenderer.prototype.supportsFloatTextures = function () {\n\t\tconsole.warn('THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( \\'OES_texture_float\\' ).');\n\t\treturn this.extensions.get('OES_texture_float');\n\t};\n\n\tWebGLRenderer.prototype.supportsHalfFloatTextures = function () {\n\t\tconsole.warn('THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( \\'OES_texture_half_float\\' ).');\n\t\treturn this.extensions.get('OES_texture_half_float');\n\t};\n\n\tWebGLRenderer.prototype.supportsStandardDerivatives = function () {\n\t\tconsole.warn('THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( \\'OES_standard_derivatives\\' ).');\n\t\treturn this.extensions.get('OES_standard_derivatives');\n\t};\n\n\tWebGLRenderer.prototype.supportsCompressedTextureS3TC = function () {\n\t\tconsole.warn('THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( \\'WEBGL_compressed_texture_s3tc\\' ).');\n\t\treturn this.extensions.get('WEBGL_compressed_texture_s3tc');\n\t};\n\n\tWebGLRenderer.prototype.supportsCompressedTexturePVRTC = function () {\n\t\tconsole.warn('THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( \\'WEBGL_compressed_texture_pvrtc\\' ).');\n\t\treturn this.extensions.get('WEBGL_compressed_texture_pvrtc');\n\t};\n\n\tWebGLRenderer.prototype.supportsBlendMinMax = function () {\n\t\tconsole.warn('THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( \\'EXT_blend_minmax\\' ).');\n\t\treturn this.extensions.get('EXT_blend_minmax');\n\t};\n\n\tWebGLRenderer.prototype.supportsVertexTextures = function () {\n\t\tconsole.warn('THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures.');\n\t\treturn this.capabilities.vertexTextures;\n\t};\n\n\tWebGLRenderer.prototype.supportsInstancedArrays = function () {\n\t\tconsole.warn('THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( \\'ANGLE_instanced_arrays\\' ).');\n\t\treturn this.extensions.get('ANGLE_instanced_arrays');\n\t};\n\n\tWebGLRenderer.prototype.enableScissorTest = function (boolean) {\n\t\tconsole.warn('THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest().');\n\t\tthis.setScissorTest(boolean);\n\t};\n\n\tWebGLRenderer.prototype.initMaterial = function () {\n\t\tconsole.warn('THREE.WebGLRenderer: .initMaterial() has been removed.');\n\t};\n\n\tWebGLRenderer.prototype.addPrePlugin = function () {\n\t\tconsole.warn('THREE.WebGLRenderer: .addPrePlugin() has been removed.');\n\t};\n\n\tWebGLRenderer.prototype.addPostPlugin = function () {\n\t\tconsole.warn('THREE.WebGLRenderer: .addPostPlugin() has been removed.');\n\t};\n\n\tWebGLRenderer.prototype.updateShadowMap = function () {\n\t\tconsole.warn('THREE.WebGLRenderer: .updateShadowMap() has been removed.');\n\t};\n\n\tWebGLRenderer.prototype.setFaceCulling = function () {\n\t\tconsole.warn('THREE.WebGLRenderer: .setFaceCulling() has been removed.');\n\t};\n\n\tWebGLRenderer.prototype.setTexture = function () {\n\t\tconsole.warn('THREE.WebGLRenderer: .setTexture() has been removed.');\n\t};\n\n\tWebGLRenderer.prototype.setTextureCube = function () {\n\t\tconsole.warn('THREE.WebGLRenderer: .setTextureCube() has been removed.');\n\t};\n\n\tWebGLRenderer.prototype.getActiveMipMapLevel = function () {\n\t\tconsole.warn('THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel().');\n\t\treturn this.getActiveMipmapLevel();\n\t};\n\n\tObject.defineProperties(WebGLRenderer.prototype, {\n\t\tshadowMapEnabled: {\n\t\t\tget: function () {\n\t\t\t\treturn this.shadowMap.enabled;\n\t\t\t},\n\t\t\tset: function (value) {\n\t\t\t\tconsole.warn('THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled.');\n\t\t\t\tthis.shadowMap.enabled = value;\n\t\t\t}\n\t\t},\n\t\tshadowMapType: {\n\t\t\tget: function () {\n\t\t\t\treturn this.shadowMap.type;\n\t\t\t},\n\t\t\tset: function (value) {\n\t\t\t\tconsole.warn('THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type.');\n\t\t\t\tthis.shadowMap.type = value;\n\t\t\t}\n\t\t},\n\t\tshadowMapCullFace: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn('THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.');\n\t\t\t\treturn undefined;\n\t\t\t},\n\t\t\tset: function () {\n\t\t\t\tconsole.warn('THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.');\n\t\t\t}\n\t\t},\n\t\tcontext: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn('THREE.WebGLRenderer: .context has been removed. Use .getContext() instead.');\n\t\t\t\treturn this.getContext();\n\t\t\t}\n\t\t},\n\t\tvr: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn('THREE.WebGLRenderer: .vr has been renamed to .xr');\n\t\t\t\treturn this.xr;\n\t\t\t}\n\t\t},\n\t\tgammaInput: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn('THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.');\n\t\t\t\treturn false;\n\t\t\t},\n\t\t\tset: function () {\n\t\t\t\tconsole.warn('THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.');\n\t\t\t}\n\t\t},\n\t\tgammaOutput: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn('THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead.');\n\t\t\t\treturn false;\n\t\t\t},\n\t\t\tset: function (value) {\n\t\t\t\tconsole.warn('THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead.');\n\t\t\t\tthis.outputEncoding = value === true ? sRGBEncoding : LinearEncoding;\n\t\t\t}\n\t\t},\n\t\ttoneMappingWhitePoint: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn('THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.');\n\t\t\t\treturn 1.0;\n\t\t\t},\n\t\t\tset: function () {\n\t\t\t\tconsole.warn('THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.');\n\t\t\t}\n\t\t}\n\t});\n\tObject.defineProperties(WebGLShadowMap.prototype, {\n\t\tcullFace: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn('THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.');\n\t\t\t\treturn undefined;\n\t\t\t},\n\t\t\tset: function () {\n\t\t\t\tconsole.warn('THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.');\n\t\t\t}\n\t\t},\n\t\trenderReverseSided: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn('THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.');\n\t\t\t\treturn undefined;\n\t\t\t},\n\t\t\tset: function () {\n\t\t\t\tconsole.warn('THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.');\n\t\t\t}\n\t\t},\n\t\trenderSingleSided: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn('THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.');\n\t\t\t\treturn undefined;\n\t\t\t},\n\t\t\tset: function () {\n\t\t\t\tconsole.warn('THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.');\n\t\t\t}\n\t\t}\n\t});\n\tfunction WebGLRenderTargetCube(width, height, options) {\n\t\tconsole.warn('THREE.WebGLRenderTargetCube( width, height, options ) is now WebGLCubeRenderTarget( size, options ).');\n\t\treturn new WebGLCubeRenderTarget(width, options);\n\t} //\n\n\tObject.defineProperties(WebGLRenderTarget.prototype, {\n\t\twrapS: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn('THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.');\n\t\t\t\treturn this.texture.wrapS;\n\t\t\t},\n\t\t\tset: function (value) {\n\t\t\t\tconsole.warn('THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.');\n\t\t\t\tthis.texture.wrapS = value;\n\t\t\t}\n\t\t},\n\t\twrapT: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn('THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.');\n\t\t\t\treturn this.texture.wrapT;\n\t\t\t},\n\t\t\tset: function (value) {\n\t\t\t\tconsole.warn('THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.');\n\t\t\t\tthis.texture.wrapT = value;\n\t\t\t}\n\t\t},\n\t\tmagFilter: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn('THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.');\n\t\t\t\treturn this.texture.magFilter;\n\t\t\t},\n\t\t\tset: function (value) {\n\t\t\t\tconsole.warn('THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.');\n\t\t\t\tthis.texture.magFilter = value;\n\t\t\t}\n\t\t},\n\t\tminFilter: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn('THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.');\n\t\t\t\treturn this.texture.minFilter;\n\t\t\t},\n\t\t\tset: function (value) {\n\t\t\t\tconsole.warn('THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.');\n\t\t\t\tthis.texture.minFilter = value;\n\t\t\t}\n\t\t},\n\t\tanisotropy: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn('THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.');\n\t\t\t\treturn this.texture.anisotropy;\n\t\t\t},\n\t\t\tset: function (value) {\n\t\t\t\tconsole.warn('THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.');\n\t\t\t\tthis.texture.anisotropy = value;\n\t\t\t}\n\t\t},\n\t\toffset: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn('THREE.WebGLRenderTarget: .offset is now .texture.offset.');\n\t\t\t\treturn this.texture.offset;\n\t\t\t},\n\t\t\tset: function (value) {\n\t\t\t\tconsole.warn('THREE.WebGLRenderTarget: .offset is now .texture.offset.');\n\t\t\t\tthis.texture.offset = value;\n\t\t\t}\n\t\t},\n\t\trepeat: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn('THREE.WebGLRenderTarget: .repeat is now .texture.repeat.');\n\t\t\t\treturn this.texture.repeat;\n\t\t\t},\n\t\t\tset: function (value) {\n\t\t\t\tconsole.warn('THREE.WebGLRenderTarget: .repeat is now .texture.repeat.');\n\t\t\t\tthis.texture.repeat = value;\n\t\t\t}\n\t\t},\n\t\tformat: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn('THREE.WebGLRenderTarget: .format is now .texture.format.');\n\t\t\t\treturn this.texture.format;\n\t\t\t},\n\t\t\tset: function (value) {\n\t\t\t\tconsole.warn('THREE.WebGLRenderTarget: .format is now .texture.format.');\n\t\t\t\tthis.texture.format = value;\n\t\t\t}\n\t\t},\n\t\ttype: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn('THREE.WebGLRenderTarget: .type is now .texture.type.');\n\t\t\t\treturn this.texture.type;\n\t\t\t},\n\t\t\tset: function (value) {\n\t\t\t\tconsole.warn('THREE.WebGLRenderTarget: .type is now .texture.type.');\n\t\t\t\tthis.texture.type = value;\n\t\t\t}\n\t\t},\n\t\tgenerateMipmaps: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn('THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.');\n\t\t\t\treturn this.texture.generateMipmaps;\n\t\t\t},\n\t\t\tset: function (value) {\n\t\t\t\tconsole.warn('THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.');\n\t\t\t\tthis.texture.generateMipmaps = value;\n\t\t\t}\n\t\t}\n\t}); //\n\n\tAudio.prototype.load = function (file) {\n\t\tconsole.warn('THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.');\n\t\tconst scope = this;\n\t\tconst audioLoader = new AudioLoader();\n\t\taudioLoader.load(file, function (buffer) {\n\t\t\tscope.setBuffer(buffer);\n\t\t});\n\t\treturn this;\n\t};\n\n\tAudioAnalyser.prototype.getData = function () {\n\t\tconsole.warn('THREE.AudioAnalyser: .getData() is now .getFrequencyData().');\n\t\treturn this.getFrequencyData();\n\t}; //\n\n\n\tCubeCamera.prototype.updateCubeMap = function (renderer, scene) {\n\t\tconsole.warn('THREE.CubeCamera: .updateCubeMap() is now .update().');\n\t\treturn this.update(renderer, scene);\n\t};\n\n\tCubeCamera.prototype.clear = function (renderer, color, depth, stencil) {\n\t\tconsole.warn('THREE.CubeCamera: .clear() is now .renderTarget.clear().');\n\t\treturn this.renderTarget.clear(renderer, color, depth, stencil);\n\t};\n\n\tImageUtils.crossOrigin = undefined;\n\n\tImageUtils.loadTexture = function (url, mapping, onLoad, onError) {\n\t\tconsole.warn('THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.');\n\t\tconst loader = new TextureLoader();\n\t\tloader.setCrossOrigin(this.crossOrigin);\n\t\tconst texture = loader.load(url, onLoad, undefined, onError);\n\t\tif (mapping) texture.mapping = mapping;\n\t\treturn texture;\n\t};\n\n\tImageUtils.loadTextureCube = function (urls, mapping, onLoad, onError) {\n\t\tconsole.warn('THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.');\n\t\tconst loader = new CubeTextureLoader();\n\t\tloader.setCrossOrigin(this.crossOrigin);\n\t\tconst texture = loader.load(urls, onLoad, undefined, onError);\n\t\tif (mapping) texture.mapping = mapping;\n\t\treturn texture;\n\t};\n\n\tImageUtils.loadCompressedTexture = function () {\n\t\tconsole.error('THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.');\n\t};\n\n\tImageUtils.loadCompressedTextureCube = function () {\n\t\tconsole.error('THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.');\n\t}; //\n\n\n\tfunction CanvasRenderer() {\n\t\tconsole.error('THREE.CanvasRenderer has been removed');\n\t} //\n\n\tfunction JSONLoader() {\n\t\tconsole.error('THREE.JSONLoader has been removed.');\n\t} //\n\n\tconst SceneUtils = {\n\t\tcreateMultiMaterialObject: function () {\n\t\t\tconsole.error('THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js');\n\t\t},\n\t\tdetach: function () {\n\t\t\tconsole.error('THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js');\n\t\t},\n\t\tattach: function () {\n\t\t\tconsole.error('THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js');\n\t\t}\n\t}; //\n\n\tfunction LensFlare() {\n\t\tconsole.error('THREE.LensFlare has been moved to /examples/jsm/objects/Lensflare.js');\n\t} //\n\n\tfunction ParametricGeometry() {\n\t\tconsole.error('THREE.ParametricGeometry has been moved to /examples/jsm/geometries/ParametricGeometry.js');\n\t\treturn new BufferGeometry();\n\t}\n\tfunction TextGeometry() {\n\t\tconsole.error('THREE.TextGeometry has been moved to /examples/jsm/geometries/TextGeometry.js');\n\t\treturn new BufferGeometry();\n\t}\n\tfunction FontLoader() {\n\t\tconsole.error('THREE.FontLoader has been moved to /examples/jsm/loaders/FontLoader.js');\n\t}\n\tfunction Font() {\n\t\tconsole.error('THREE.Font has been moved to /examples/jsm/loaders/FontLoader.js');\n\t}\n\n\tif (typeof __THREE_DEVTOOLS__ !== 'undefined') {\n\t\t/* eslint-disable no-undef */\n\t\t__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent('register', {\n\t\t\tdetail: {\n\t\t\t\trevision: REVISION\n\t\t\t}\n\t\t}));\n\t\t/* eslint-enable no-undef */\n\n\t}\n\n\tif (typeof window !== 'undefined') {\n\t\tif (window.__THREE__) {\n\t\t\tconsole.warn('WARNING: Multiple instances of Three.js being imported.');\n\t\t} else {\n\t\t\twindow.__THREE__ = REVISION;\n\t\t}\n\t}\n\n\texports.ACESFilmicToneMapping = ACESFilmicToneMapping;\n\texports.AddEquation = AddEquation;\n\texports.AddOperation = AddOperation;\n\texports.AdditiveAnimationBlendMode = AdditiveAnimationBlendMode;\n\texports.AdditiveBlending = AdditiveBlending;\n\texports.AlphaFormat = AlphaFormat;\n\texports.AlwaysDepth = AlwaysDepth;\n\texports.AlwaysStencilFunc = AlwaysStencilFunc;\n\texports.AmbientLight = AmbientLight;\n\texports.AmbientLightProbe = AmbientLightProbe;\n\texports.AnimationClip = AnimationClip;\n\texports.AnimationLoader = AnimationLoader;\n\texports.AnimationMixer = AnimationMixer;\n\texports.AnimationObjectGroup = AnimationObjectGroup;\n\texports.AnimationUtils = AnimationUtils;\n\texports.ArcCurve = ArcCurve;\n\texports.ArrayCamera = ArrayCamera;\n\texports.ArrowHelper = ArrowHelper;\n\texports.Audio = Audio;\n\texports.AudioAnalyser = AudioAnalyser;\n\texports.AudioContext = AudioContext;\n\texports.AudioListener = AudioListener;\n\texports.AudioLoader = AudioLoader;\n\texports.AxesHelper = AxesHelper;\n\texports.AxisHelper = AxisHelper;\n\texports.BackSide = BackSide;\n\texports.BasicDepthPacking = BasicDepthPacking;\n\texports.BasicShadowMap = BasicShadowMap;\n\texports.BinaryTextureLoader = BinaryTextureLoader;\n\texports.Bone = Bone;\n\texports.BooleanKeyframeTrack = BooleanKeyframeTrack;\n\texports.BoundingBoxHelper = BoundingBoxHelper;\n\texports.Box2 = Box2;\n\texports.Box3 = Box3;\n\texports.Box3Helper = Box3Helper;\n\texports.BoxBufferGeometry = BoxGeometry;\n\texports.BoxGeometry = BoxGeometry;\n\texports.BoxHelper = BoxHelper;\n\texports.BufferAttribute = BufferAttribute;\n\texports.BufferGeometry = BufferGeometry;\n\texports.BufferGeometryLoader = BufferGeometryLoader;\n\texports.ByteType = ByteType;\n\texports.Cache = Cache;\n\texports.Camera = Camera;\n\texports.CameraHelper = CameraHelper;\n\texports.CanvasRenderer = CanvasRenderer;\n\texports.CanvasTexture = CanvasTexture;\n\texports.CatmullRomCurve3 = CatmullRomCurve3;\n\texports.CineonToneMapping = CineonToneMapping;\n\texports.CircleBufferGeometry = CircleGeometry;\n\texports.CircleGeometry = CircleGeometry;\n\texports.ClampToEdgeWrapping = ClampToEdgeWrapping;\n\texports.Clock = Clock;\n\texports.Color = Color;\n\texports.ColorKeyframeTrack = ColorKeyframeTrack;\n\texports.CompressedTexture = CompressedTexture;\n\texports.CompressedTextureLoader = CompressedTextureLoader;\n\texports.ConeBufferGeometry = ConeGeometry;\n\texports.ConeGeometry = ConeGeometry;\n\texports.CubeCamera = CubeCamera;\n\texports.CubeReflectionMapping = CubeReflectionMapping;\n\texports.CubeRefractionMapping = CubeRefractionMapping;\n\texports.CubeTexture = CubeTexture;\n\texports.CubeTextureLoader = CubeTextureLoader;\n\texports.CubeUVReflectionMapping = CubeUVReflectionMapping;\n\texports.CubeUVRefractionMapping = CubeUVRefractionMapping;\n\texports.CubicBezierCurve = CubicBezierCurve;\n\texports.CubicBezierCurve3 = CubicBezierCurve3;\n\texports.CubicInterpolant = CubicInterpolant;\n\texports.CullFaceBack = CullFaceBack;\n\texports.CullFaceFront = CullFaceFront;\n\texports.CullFaceFrontBack = CullFaceFrontBack;\n\texports.CullFaceNone = CullFaceNone;\n\texports.Curve = Curve;\n\texports.CurvePath = CurvePath;\n\texports.CustomBlending = CustomBlending;\n\texports.CustomToneMapping = CustomToneMapping;\n\texports.CylinderBufferGeometry = CylinderGeometry;\n\texports.CylinderGeometry = CylinderGeometry;\n\texports.Cylindrical = Cylindrical;\n\texports.DataTexture = DataTexture;\n\texports.DataTexture2DArray = DataTexture2DArray;\n\texports.DataTexture3D = DataTexture3D;\n\texports.DataTextureLoader = DataTextureLoader;\n\texports.DataUtils = DataUtils;\n\texports.DecrementStencilOp = DecrementStencilOp;\n\texports.DecrementWrapStencilOp = DecrementWrapStencilOp;\n\texports.DefaultLoadingManager = DefaultLoadingManager;\n\texports.DepthFormat = DepthFormat;\n\texports.DepthStencilFormat = DepthStencilFormat;\n\texports.DepthTexture = DepthTexture;\n\texports.DirectionalLight = DirectionalLight;\n\texports.DirectionalLightHelper = DirectionalLightHelper;\n\texports.DiscreteInterpolant = DiscreteInterpolant;\n\texports.DodecahedronBufferGeometry = DodecahedronGeometry;\n\texports.DodecahedronGeometry = DodecahedronGeometry;\n\texports.DoubleSide = DoubleSide;\n\texports.DstAlphaFactor = DstAlphaFactor;\n\texports.DstColorFactor = DstColorFactor;\n\texports.DynamicBufferAttribute = DynamicBufferAttribute;\n\texports.DynamicCopyUsage = DynamicCopyUsage;\n\texports.DynamicDrawUsage = DynamicDrawUsage;\n\texports.DynamicReadUsage = DynamicReadUsage;\n\texports.EdgesGeometry = EdgesGeometry;\n\texports.EdgesHelper = EdgesHelper;\n\texports.EllipseCurve = EllipseCurve;\n\texports.EqualDepth = EqualDepth;\n\texports.EqualStencilFunc = EqualStencilFunc;\n\texports.EquirectangularReflectionMapping = EquirectangularReflectionMapping;\n\texports.EquirectangularRefractionMapping = EquirectangularRefractionMapping;\n\texports.Euler = Euler;\n\texports.EventDispatcher = EventDispatcher;\n\texports.ExtrudeBufferGeometry = ExtrudeGeometry;\n\texports.ExtrudeGeometry = ExtrudeGeometry;\n\texports.FaceColors = FaceColors;\n\texports.FileLoader = FileLoader;\n\texports.FlatShading = FlatShading;\n\texports.Float16BufferAttribute = Float16BufferAttribute;\n\texports.Float32Attribute = Float32Attribute;\n\texports.Float32BufferAttribute = Float32BufferAttribute;\n\texports.Float64Attribute = Float64Attribute;\n\texports.Float64BufferAttribute = Float64BufferAttribute;\n\texports.FloatType = FloatType;\n\texports.Fog = Fog;\n\texports.FogExp2 = FogExp2;\n\texports.Font = Font;\n\texports.FontLoader = FontLoader;\n\texports.FrontSide = FrontSide;\n\texports.Frustum = Frustum;\n\texports.GLBufferAttribute = GLBufferAttribute;\n\texports.GLSL1 = GLSL1;\n\texports.GLSL3 = GLSL3;\n\texports.GammaEncoding = GammaEncoding;\n\texports.GreaterDepth = GreaterDepth;\n\texports.GreaterEqualDepth = GreaterEqualDepth;\n\texports.GreaterEqualStencilFunc = GreaterEqualStencilFunc;\n\texports.GreaterStencilFunc = GreaterStencilFunc;\n\texports.GridHelper = GridHelper;\n\texports.Group = Group;\n\texports.HalfFloatType = HalfFloatType;\n\texports.HemisphereLight = HemisphereLight;\n\texports.HemisphereLightHelper = HemisphereLightHelper;\n\texports.HemisphereLightProbe = HemisphereLightProbe;\n\texports.IcosahedronBufferGeometry = IcosahedronGeometry;\n\texports.IcosahedronGeometry = IcosahedronGeometry;\n\texports.ImageBitmapLoader = ImageBitmapLoader;\n\texports.ImageLoader = ImageLoader;\n\texports.ImageUtils = ImageUtils;\n\texports.ImmediateRenderObject = ImmediateRenderObject;\n\texports.IncrementStencilOp = IncrementStencilOp;\n\texports.IncrementWrapStencilOp = IncrementWrapStencilOp;\n\texports.InstancedBufferAttribute = InstancedBufferAttribute;\n\texports.InstancedBufferGeometry = InstancedBufferGeometry;\n\texports.InstancedInterleavedBuffer = InstancedInterleavedBuffer;\n\texports.InstancedMesh = InstancedMesh;\n\texports.Int16Attribute = Int16Attribute;\n\texports.Int16BufferAttribute = Int16BufferAttribute;\n\texports.Int32Attribute = Int32Attribute;\n\texports.Int32BufferAttribute = Int32BufferAttribute;\n\texports.Int8Attribute = Int8Attribute;\n\texports.Int8BufferAttribute = Int8BufferAttribute;\n\texports.IntType = IntType;\n\texports.InterleavedBuffer = InterleavedBuffer;\n\texports.InterleavedBufferAttribute = InterleavedBufferAttribute;\n\texports.Interpolant = Interpolant;\n\texports.InterpolateDiscrete = InterpolateDiscrete;\n\texports.InterpolateLinear = InterpolateLinear;\n\texports.InterpolateSmooth = InterpolateSmooth;\n\texports.InvertStencilOp = InvertStencilOp;\n\texports.JSONLoader = JSONLoader;\n\texports.KeepStencilOp = KeepStencilOp;\n\texports.KeyframeTrack = KeyframeTrack;\n\texports.LOD = LOD;\n\texports.LatheBufferGeometry = LatheGeometry;\n\texports.LatheGeometry = LatheGeometry;\n\texports.Layers = Layers;\n\texports.LensFlare = LensFlare;\n\texports.LessDepth = LessDepth;\n\texports.LessEqualDepth = LessEqualDepth;\n\texports.LessEqualStencilFunc = LessEqualStencilFunc;\n\texports.LessStencilFunc = LessStencilFunc;\n\texports.Light = Light;\n\texports.LightProbe = LightProbe;\n\texports.Line = Line;\n\texports.Line3 = Line3;\n\texports.LineBasicMaterial = LineBasicMaterial;\n\texports.LineCurve = LineCurve;\n\texports.LineCurve3 = LineCurve3;\n\texports.LineDashedMaterial = LineDashedMaterial;\n\texports.LineLoop = LineLoop;\n\texports.LinePieces = LinePieces;\n\texports.LineSegments = LineSegments;\n\texports.LineStrip = LineStrip;\n\texports.LinearEncoding = LinearEncoding;\n\texports.LinearFilter = LinearFilter;\n\texports.LinearInterpolant = LinearInterpolant;\n\texports.LinearMipMapLinearFilter = LinearMipMapLinearFilter;\n\texports.LinearMipMapNearestFilter = LinearMipMapNearestFilter;\n\texports.LinearMipmapLinearFilter = LinearMipmapLinearFilter;\n\texports.LinearMipmapNearestFilter = LinearMipmapNearestFilter;\n\texports.LinearToneMapping = LinearToneMapping;\n\texports.Loader = Loader;\n\texports.LoaderUtils = LoaderUtils;\n\texports.LoadingManager = LoadingManager;\n\texports.LogLuvEncoding = LogLuvEncoding;\n\texports.LoopOnce = LoopOnce;\n\texports.LoopPingPong = LoopPingPong;\n\texports.LoopRepeat = LoopRepeat;\n\texports.LuminanceAlphaFormat = LuminanceAlphaFormat;\n\texports.LuminanceFormat = LuminanceFormat;\n\texports.MOUSE = MOUSE;\n\texports.Material = Material;\n\texports.MaterialLoader = MaterialLoader;\n\texports.Math = MathUtils;\n\texports.MathUtils = MathUtils;\n\texports.Matrix3 = Matrix3;\n\texports.Matrix4 = Matrix4;\n\texports.MaxEquation = MaxEquation;\n\texports.Mesh = Mesh;\n\texports.MeshBasicMaterial = MeshBasicMaterial;\n\texports.MeshDepthMaterial = MeshDepthMaterial;\n\texports.MeshDistanceMaterial = MeshDistanceMaterial;\n\texports.MeshFaceMaterial = MeshFaceMaterial;\n\texports.MeshLambertMaterial = MeshLambertMaterial;\n\texports.MeshMatcapMaterial = MeshMatcapMaterial;\n\texports.MeshNormalMaterial = MeshNormalMaterial;\n\texports.MeshPhongMaterial = MeshPhongMaterial;\n\texports.MeshPhysicalMaterial = MeshPhysicalMaterial;\n\texports.MeshStandardMaterial = MeshStandardMaterial;\n\texports.MeshToonMaterial = MeshToonMaterial;\n\texports.MinEquation = MinEquation;\n\texports.MirroredRepeatWrapping = MirroredRepeatWrapping;\n\texports.MixOperation = MixOperation;\n\texports.MultiMaterial = MultiMaterial;\n\texports.MultiplyBlending = MultiplyBlending;\n\texports.MultiplyOperation = MultiplyOperation;\n\texports.NearestFilter = NearestFilter;\n\texports.NearestMipMapLinearFilter = NearestMipMapLinearFilter;\n\texports.NearestMipMapNearestFilter = NearestMipMapNearestFilter;\n\texports.NearestMipmapLinearFilter = NearestMipmapLinearFilter;\n\texports.NearestMipmapNearestFilter = NearestMipmapNearestFilter;\n\texports.NeverDepth = NeverDepth;\n\texports.NeverStencilFunc = NeverStencilFunc;\n\texports.NoBlending = NoBlending;\n\texports.NoColors = NoColors;\n\texports.NoToneMapping = NoToneMapping;\n\texports.NormalAnimationBlendMode = NormalAnimationBlendMode;\n\texports.NormalBlending = NormalBlending;\n\texports.NotEqualDepth = NotEqualDepth;\n\texports.NotEqualStencilFunc = NotEqualStencilFunc;\n\texports.NumberKeyframeTrack = NumberKeyframeTrack;\n\texports.Object3D = Object3D;\n\texports.ObjectLoader = ObjectLoader;\n\texports.ObjectSpaceNormalMap = ObjectSpaceNormalMap;\n\texports.OctahedronBufferGeometry = OctahedronGeometry;\n\texports.OctahedronGeometry = OctahedronGeometry;\n\texports.OneFactor = OneFactor;\n\texports.OneMinusDstAlphaFactor = OneMinusDstAlphaFactor;\n\texports.OneMinusDstColorFactor = OneMinusDstColorFactor;\n\texports.OneMinusSrcAlphaFactor = OneMinusSrcAlphaFactor;\n\texports.OneMinusSrcColorFactor = OneMinusSrcColorFactor;\n\texports.OrthographicCamera = OrthographicCamera;\n\texports.PCFShadowMap = PCFShadowMap;\n\texports.PCFSoftShadowMap = PCFSoftShadowMap;\n\texports.PMREMGenerator = PMREMGenerator;\n\texports.ParametricGeometry = ParametricGeometry;\n\texports.Particle = Particle;\n\texports.ParticleBasicMaterial = ParticleBasicMaterial;\n\texports.ParticleSystem = ParticleSystem;\n\texports.ParticleSystemMaterial = ParticleSystemMaterial;\n\texports.Path = Path;\n\texports.PerspectiveCamera = PerspectiveCamera;\n\texports.Plane = Plane;\n\texports.PlaneBufferGeometry = PlaneGeometry;\n\texports.PlaneGeometry = PlaneGeometry;\n\texports.PlaneHelper = PlaneHelper;\n\texports.PointCloud = PointCloud;\n\texports.PointCloudMaterial = PointCloudMaterial;\n\texports.PointLight = PointLight;\n\texports.PointLightHelper = PointLightHelper;\n\texports.Points = Points;\n\texports.PointsMaterial = PointsMaterial;\n\texports.PolarGridHelper = PolarGridHelper;\n\texports.PolyhedronBufferGeometry = PolyhedronGeometry;\n\texports.PolyhedronGeometry = PolyhedronGeometry;\n\texports.PositionalAudio = PositionalAudio;\n\texports.PropertyBinding = PropertyBinding;\n\texports.PropertyMixer = PropertyMixer;\n\texports.QuadraticBezierCurve = QuadraticBezierCurve;\n\texports.QuadraticBezierCurve3 = QuadraticBezierCurve3;\n\texports.Quaternion = Quaternion;\n\texports.QuaternionKeyframeTrack = QuaternionKeyframeTrack;\n\texports.QuaternionLinearInterpolant = QuaternionLinearInterpolant;\n\texports.REVISION = REVISION;\n\texports.RGBADepthPacking = RGBADepthPacking;\n\texports.RGBAFormat = RGBAFormat;\n\texports.RGBAIntegerFormat = RGBAIntegerFormat;\n\texports.RGBA_ASTC_10x10_Format = RGBA_ASTC_10x10_Format;\n\texports.RGBA_ASTC_10x5_Format = RGBA_ASTC_10x5_Format;\n\texports.RGBA_ASTC_10x6_Format = RGBA_ASTC_10x6_Format;\n\texports.RGBA_ASTC_10x8_Format = RGBA_ASTC_10x8_Format;\n\texports.RGBA_ASTC_12x10_Format = RGBA_ASTC_12x10_Format;\n\texports.RGBA_ASTC_12x12_Format = RGBA_ASTC_12x12_Format;\n\texports.RGBA_ASTC_4x4_Format = RGBA_ASTC_4x4_Format;\n\texports.RGBA_ASTC_5x4_Format = RGBA_ASTC_5x4_Format;\n\texports.RGBA_ASTC_5x5_Format = RGBA_ASTC_5x5_Format;\n\texports.RGBA_ASTC_6x5_Format = RGBA_ASTC_6x5_Format;\n\texports.RGBA_ASTC_6x6_Format = RGBA_ASTC_6x6_Format;\n\texports.RGBA_ASTC_8x5_Format = RGBA_ASTC_8x5_Format;\n\texports.RGBA_ASTC_8x6_Format = RGBA_ASTC_8x6_Format;\n\texports.RGBA_ASTC_8x8_Format = RGBA_ASTC_8x8_Format;\n\texports.RGBA_BPTC_Format = RGBA_BPTC_Format;\n\texports.RGBA_ETC2_EAC_Format = RGBA_ETC2_EAC_Format;\n\texports.RGBA_PVRTC_2BPPV1_Format = RGBA_PVRTC_2BPPV1_Format;\n\texports.RGBA_PVRTC_4BPPV1_Format = RGBA_PVRTC_4BPPV1_Format;\n\texports.RGBA_S3TC_DXT1_Format = RGBA_S3TC_DXT1_Format;\n\texports.RGBA_S3TC_DXT3_Format = RGBA_S3TC_DXT3_Format;\n\texports.RGBA_S3TC_DXT5_Format = RGBA_S3TC_DXT5_Format;\n\texports.RGBDEncoding = RGBDEncoding;\n\texports.RGBEEncoding = RGBEEncoding;\n\texports.RGBEFormat = RGBEFormat;\n\texports.RGBFormat = RGBFormat;\n\texports.RGBIntegerFormat = RGBIntegerFormat;\n\texports.RGBM16Encoding = RGBM16Encoding;\n\texports.RGBM7Encoding = RGBM7Encoding;\n\texports.RGB_ETC1_Format = RGB_ETC1_Format;\n\texports.RGB_ETC2_Format = RGB_ETC2_Format;\n\texports.RGB_PVRTC_2BPPV1_Format = RGB_PVRTC_2BPPV1_Format;\n\texports.RGB_PVRTC_4BPPV1_Format = RGB_PVRTC_4BPPV1_Format;\n\texports.RGB_S3TC_DXT1_Format = RGB_S3TC_DXT1_Format;\n\texports.RGFormat = RGFormat;\n\texports.RGIntegerFormat = RGIntegerFormat;\n\texports.RawShaderMaterial = RawShaderMaterial;\n\texports.Ray = Ray;\n\texports.Raycaster = Raycaster;\n\texports.RectAreaLight = RectAreaLight;\n\texports.RedFormat = RedFormat;\n\texports.RedIntegerFormat = RedIntegerFormat;\n\texports.ReinhardToneMapping = ReinhardToneMapping;\n\texports.RepeatWrapping = RepeatWrapping;\n\texports.ReplaceStencilOp = ReplaceStencilOp;\n\texports.ReverseSubtractEquation = ReverseSubtractEquation;\n\texports.RingBufferGeometry = RingGeometry;\n\texports.RingGeometry = RingGeometry;\n\texports.SRGB8_ALPHA8_ASTC_10x10_Format = SRGB8_ALPHA8_ASTC_10x10_Format;\n\texports.SRGB8_ALPHA8_ASTC_10x5_Format = SRGB8_ALPHA8_ASTC_10x5_Format;\n\texports.SRGB8_ALPHA8_ASTC_10x6_Format = SRGB8_ALPHA8_ASTC_10x6_Format;\n\texports.SRGB8_ALPHA8_ASTC_10x8_Format = SRGB8_ALPHA8_ASTC_10x8_Format;\n\texports.SRGB8_ALPHA8_ASTC_12x10_Format = SRGB8_ALPHA8_ASTC_12x10_Format;\n\texports.SRGB8_ALPHA8_ASTC_12x12_Format = SRGB8_ALPHA8_ASTC_12x12_Format;\n\texports.SRGB8_ALPHA8_ASTC_4x4_Format = SRGB8_ALPHA8_ASTC_4x4_Format;\n\texports.SRGB8_ALPHA8_ASTC_5x4_Format = SRGB8_ALPHA8_ASTC_5x4_Format;\n\texports.SRGB8_ALPHA8_ASTC_5x5_Format = SRGB8_ALPHA8_ASTC_5x5_Format;\n\texports.SRGB8_ALPHA8_ASTC_6x5_Format = SRGB8_ALPHA8_ASTC_6x5_Format;\n\texports.SRGB8_ALPHA8_ASTC_6x6_Format = SRGB8_ALPHA8_ASTC_6x6_Format;\n\texports.SRGB8_ALPHA8_ASTC_8x5_Format = SRGB8_ALPHA8_ASTC_8x5_Format;\n\texports.SRGB8_ALPHA8_ASTC_8x6_Format = SRGB8_ALPHA8_ASTC_8x6_Format;\n\texports.SRGB8_ALPHA8_ASTC_8x8_Format = SRGB8_ALPHA8_ASTC_8x8_Format;\n\texports.Scene = Scene;\n\texports.SceneUtils = SceneUtils;\n\texports.ShaderChunk = ShaderChunk;\n\texports.ShaderLib = ShaderLib;\n\texports.ShaderMaterial = ShaderMaterial;\n\texports.ShadowMaterial = ShadowMaterial;\n\texports.Shape = Shape;\n\texports.ShapeBufferGeometry = ShapeGeometry;\n\texports.ShapeGeometry = ShapeGeometry;\n\texports.ShapePath = ShapePath;\n\texports.ShapeUtils = ShapeUtils;\n\texports.ShortType = ShortType;\n\texports.Skeleton = Skeleton;\n\texports.SkeletonHelper = SkeletonHelper;\n\texports.SkinnedMesh = SkinnedMesh;\n\texports.SmoothShading = SmoothShading;\n\texports.Sphere = Sphere;\n\texports.SphereBufferGeometry = SphereGeometry;\n\texports.SphereGeometry = SphereGeometry;\n\texports.Spherical = Spherical;\n\texports.SphericalHarmonics3 = SphericalHarmonics3;\n\texports.SplineCurve = SplineCurve;\n\texports.SpotLight = SpotLight;\n\texports.SpotLightHelper = SpotLightHelper;\n\texports.Sprite = Sprite;\n\texports.SpriteMaterial = SpriteMaterial;\n\texports.SrcAlphaFactor = SrcAlphaFactor;\n\texports.SrcAlphaSaturateFactor = SrcAlphaSaturateFactor;\n\texports.SrcColorFactor = SrcColorFactor;\n\texports.StaticCopyUsage = StaticCopyUsage;\n\texports.StaticDrawUsage = StaticDrawUsage;\n\texports.StaticReadUsage = StaticReadUsage;\n\texports.StereoCamera = StereoCamera;\n\texports.StreamCopyUsage = StreamCopyUsage;\n\texports.StreamDrawUsage = StreamDrawUsage;\n\texports.StreamReadUsage = StreamReadUsage;\n\texports.StringKeyframeTrack = StringKeyframeTrack;\n\texports.SubtractEquation = SubtractEquation;\n\texports.SubtractiveBlending = SubtractiveBlending;\n\texports.TOUCH = TOUCH;\n\texports.TangentSpaceNormalMap = TangentSpaceNormalMap;\n\texports.TetrahedronBufferGeometry = TetrahedronGeometry;\n\texports.TetrahedronGeometry = TetrahedronGeometry;\n\texports.TextGeometry = TextGeometry;\n\texports.Texture = Texture;\n\texports.TextureLoader = TextureLoader;\n\texports.TorusBufferGeometry = TorusGeometry;\n\texports.TorusGeometry = TorusGeometry;\n\texports.TorusKnotBufferGeometry = TorusKnotGeometry;\n\texports.TorusKnotGeometry = TorusKnotGeometry;\n\texports.Triangle = Triangle;\n\texports.TriangleFanDrawMode = TriangleFanDrawMode;\n\texports.TriangleStripDrawMode = TriangleStripDrawMode;\n\texports.TrianglesDrawMode = TrianglesDrawMode;\n\texports.TubeBufferGeometry = TubeGeometry;\n\texports.TubeGeometry = TubeGeometry;\n\texports.UVMapping = UVMapping;\n\texports.Uint16Attribute = Uint16Attribute;\n\texports.Uint16BufferAttribute = Uint16BufferAttribute;\n\texports.Uint32Attribute = Uint32Attribute;\n\texports.Uint32BufferAttribute = Uint32BufferAttribute;\n\texports.Uint8Attribute = Uint8Attribute;\n\texports.Uint8BufferAttribute = Uint8BufferAttribute;\n\texports.Uint8ClampedAttribute = Uint8ClampedAttribute;\n\texports.Uint8ClampedBufferAttribute = Uint8ClampedBufferAttribute;\n\texports.Uniform = Uniform;\n\texports.UniformsLib = UniformsLib;\n\texports.UniformsUtils = UniformsUtils;\n\texports.UnsignedByteType = UnsignedByteType;\n\texports.UnsignedInt248Type = UnsignedInt248Type;\n\texports.UnsignedIntType = UnsignedIntType;\n\texports.UnsignedShort4444Type = UnsignedShort4444Type;\n\texports.UnsignedShort5551Type = UnsignedShort5551Type;\n\texports.UnsignedShort565Type = UnsignedShort565Type;\n\texports.UnsignedShortType = UnsignedShortType;\n\texports.VSMShadowMap = VSMShadowMap;\n\texports.Vector2 = Vector2;\n\texports.Vector3 = Vector3;\n\texports.Vector4 = Vector4;\n\texports.VectorKeyframeTrack = VectorKeyframeTrack;\n\texports.Vertex = Vertex;\n\texports.VertexColors = VertexColors;\n\texports.VideoTexture = VideoTexture;\n\texports.WebGL1Renderer = WebGL1Renderer;\n\texports.WebGLCubeRenderTarget = WebGLCubeRenderTarget;\n\texports.WebGLMultipleRenderTargets = WebGLMultipleRenderTargets;\n\texports.WebGLMultisampleRenderTarget = WebGLMultisampleRenderTarget;\n\texports.WebGLRenderTarget = WebGLRenderTarget;\n\texports.WebGLRenderTargetCube = WebGLRenderTargetCube;\n\texports.WebGLRenderer = WebGLRenderer;\n\texports.WebGLUtils = WebGLUtils;\n\texports.WireframeGeometry = WireframeGeometry;\n\texports.WireframeHelper = WireframeHelper;\n\texports.WrapAroundEnding = WrapAroundEnding;\n\texports.XHRLoader = XHRLoader;\n\texports.ZeroCurvatureEnding = ZeroCurvatureEnding;\n\texports.ZeroFactor = ZeroFactor;\n\texports.ZeroSlopeEnding = ZeroSlopeEnding;\n\texports.ZeroStencilOp = ZeroStencilOp;\n\texports.sRGBEncoding = sRGBEncoding;\n\n\tObject.defineProperty(exports, '__esModule', { value: true });\n\n})));\n","( function () {\n\n\tclass LightProbeGenerator {\n\n\t\t// https://www.ppsloan.org/publications/StupidSH36.pdf\n\t\tstatic fromCubeTexture( cubeTexture ) {\n\n\t\t\tlet totalWeight = 0;\n\t\t\tconst coord = new THREE.Vector3();\n\t\t\tconst dir = new THREE.Vector3();\n\t\t\tconst color = new THREE.Color();\n\t\t\tconst shBasis = [ 0, 0, 0, 0, 0, 0, 0, 0, 0 ];\n\t\t\tconst sh = new THREE.SphericalHarmonics3();\n\t\t\tconst shCoefficients = sh.coefficients;\n\n\t\t\tfor ( let faceIndex = 0; faceIndex < 6; faceIndex ++ ) {\n\n\t\t\t\tconst image = cubeTexture.image[ faceIndex ];\n\t\t\t\tconst width = image.width;\n\t\t\t\tconst height = image.height;\n\t\t\t\tconst canvas = document.createElement( 'canvas' );\n\t\t\t\tcanvas.width = width;\n\t\t\t\tcanvas.height = height;\n\t\t\t\tconst context = canvas.getContext( '2d' );\n\t\t\t\tcontext.drawImage( image, 0, 0, width, height );\n\t\t\t\tconst imageData = context.getImageData( 0, 0, width, height );\n\t\t\t\tconst data = imageData.data;\n\t\t\t\tconst imageWidth = imageData.width; // assumed to be square\n\n\t\t\t\tconst pixelSize = 2 / imageWidth;\n\n\t\t\t\tfor ( let i = 0, il = data.length; i < il; i += 4 ) {\n\n\t\t\t\t\t// RGBA assumed\n\t\t\t\t\t// pixel color\n\t\t\t\t\tcolor.setRGB( data[ i ] / 255, data[ i + 1 ] / 255, data[ i + 2 ] / 255 ); // convert to linear color space\n\n\t\t\t\t\tconvertColorToLinear( color, cubeTexture.encoding ); // pixel coordinate on unit cube\n\n\t\t\t\t\tconst pixelIndex = i / 4;\n\t\t\t\t\tconst col = - 1 + ( pixelIndex % imageWidth + 0.5 ) * pixelSize;\n\t\t\t\t\tconst row = 1 - ( Math.floor( pixelIndex / imageWidth ) + 0.5 ) * pixelSize;\n\n\t\t\t\t\tswitch ( faceIndex ) {\n\n\t\t\t\t\t\tcase 0:\n\t\t\t\t\t\t\tcoord.set( - 1, row, - col );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\tcoord.set( 1, row, col );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\tcoord.set( - col, 1, - row );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\tcoord.set( - col, - 1, row );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 4:\n\t\t\t\t\t\t\tcoord.set( - col, row, 1 );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 5:\n\t\t\t\t\t\t\tcoord.set( col, row, - 1 );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t} // weight assigned to this pixel\n\n\n\t\t\t\t\tconst lengthSq = coord.lengthSq();\n\t\t\t\t\tconst weight = 4 / ( Math.sqrt( lengthSq ) * lengthSq );\n\t\t\t\t\ttotalWeight += weight; // direction vector to this pixel\n\n\t\t\t\t\tdir.copy( coord ).normalize(); // evaluate SH basis functions in direction dir\n\n\t\t\t\t\tTHREE.SphericalHarmonics3.getBasisAt( dir, shBasis ); // accummuulate\n\n\t\t\t\t\tfor ( let j = 0; j < 9; j ++ ) {\n\n\t\t\t\t\t\tshCoefficients[ j ].x += shBasis[ j ] * color.r * weight;\n\t\t\t\t\t\tshCoefficients[ j ].y += shBasis[ j ] * color.g * weight;\n\t\t\t\t\t\tshCoefficients[ j ].z += shBasis[ j ] * color.b * weight;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} // normalize\n\n\n\t\t\tconst norm = 4 * Math.PI / totalWeight;\n\n\t\t\tfor ( let j = 0; j < 9; j ++ ) {\n\n\t\t\t\tshCoefficients[ j ].x *= norm;\n\t\t\t\tshCoefficients[ j ].y *= norm;\n\t\t\t\tshCoefficients[ j ].z *= norm;\n\n\t\t\t}\n\n\t\t\treturn new THREE.LightProbe( sh );\n\n\t\t}\n\n\t\tstatic fromCubeRenderTarget( renderer, cubeRenderTarget ) {\n\n\t\t\t// The renderTarget must be set to RGBA in order to make readRenderTargetPixels works\n\t\t\tlet totalWeight = 0;\n\t\t\tconst coord = new THREE.Vector3();\n\t\t\tconst dir = new THREE.Vector3();\n\t\t\tconst color = new THREE.Color();\n\t\t\tconst shBasis = [ 0, 0, 0, 0, 0, 0, 0, 0, 0 ];\n\t\t\tconst sh = new THREE.SphericalHarmonics3();\n\t\t\tconst shCoefficients = sh.coefficients;\n\n\t\t\tfor ( let faceIndex = 0; faceIndex < 6; faceIndex ++ ) {\n\n\t\t\t\tconst imageWidth = cubeRenderTarget.width; // assumed to be square\n\n\t\t\t\tconst data = new Uint8Array( imageWidth * imageWidth * 4 );\n\t\t\t\trenderer.readRenderTargetPixels( cubeRenderTarget, 0, 0, imageWidth, imageWidth, data, faceIndex );\n\t\t\t\tconst pixelSize = 2 / imageWidth;\n\n\t\t\t\tfor ( let i = 0, il = data.length; i < il; i += 4 ) {\n\n\t\t\t\t\t// RGBA assumed\n\t\t\t\t\t// pixel color\n\t\t\t\t\tcolor.setRGB( data[ i ] / 255, data[ i + 1 ] / 255, data[ i + 2 ] / 255 ); // convert to linear color space\n\n\t\t\t\t\tconvertColorToLinear( color, cubeRenderTarget.texture.encoding ); // pixel coordinate on unit cube\n\n\t\t\t\t\tconst pixelIndex = i / 4;\n\t\t\t\t\tconst col = - 1 + ( pixelIndex % imageWidth + 0.5 ) * pixelSize;\n\t\t\t\t\tconst row = 1 - ( Math.floor( pixelIndex / imageWidth ) + 0.5 ) * pixelSize;\n\n\t\t\t\t\tswitch ( faceIndex ) {\n\n\t\t\t\t\t\tcase 0:\n\t\t\t\t\t\t\tcoord.set( 1, row, - col );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\tcoord.set( - 1, row, col );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\tcoord.set( col, 1, - row );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\tcoord.set( col, - 1, row );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 4:\n\t\t\t\t\t\t\tcoord.set( col, row, 1 );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 5:\n\t\t\t\t\t\t\tcoord.set( - col, row, - 1 );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t} // weight assigned to this pixel\n\n\n\t\t\t\t\tconst lengthSq = coord.lengthSq();\n\t\t\t\t\tconst weight = 4 / ( Math.sqrt( lengthSq ) * lengthSq );\n\t\t\t\t\ttotalWeight += weight; // direction vector to this pixel\n\n\t\t\t\t\tdir.copy( coord ).normalize(); // evaluate SH basis functions in direction dir\n\n\t\t\t\t\tTHREE.SphericalHarmonics3.getBasisAt( dir, shBasis ); // accummuulate\n\n\t\t\t\t\tfor ( let j = 0; j < 9; j ++ ) {\n\n\t\t\t\t\t\tshCoefficients[ j ].x += shBasis[ j ] * color.r * weight;\n\t\t\t\t\t\tshCoefficients[ j ].y += shBasis[ j ] * color.g * weight;\n\t\t\t\t\t\tshCoefficients[ j ].z += shBasis[ j ] * color.b * weight;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} // normalize\n\n\n\t\t\tconst norm = 4 * Math.PI / totalWeight;\n\n\t\t\tfor ( let j = 0; j < 9; j ++ ) {\n\n\t\t\t\tshCoefficients[ j ].x *= norm;\n\t\t\t\tshCoefficients[ j ].y *= norm;\n\t\t\t\tshCoefficients[ j ].z *= norm;\n\n\t\t\t}\n\n\t\t\treturn new THREE.LightProbe( sh );\n\n\t\t}\n\n\t}\n\n\tfunction convertColorToLinear( color, encoding ) {\n\n\t\tswitch ( encoding ) {\n\n\t\t\tcase THREE.sRGBEncoding:\n\t\t\t\tcolor.convertSRGBToLinear();\n\t\t\t\tbreak;\n\n\t\t\tcase THREE.LinearEncoding:\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tconsole.warn( 'WARNING: LightProbeGenerator convertColorToLinear() encountered an unsupported encoding.' );\n\t\t\t\tbreak;\n\n\t\t}\n\n\t\treturn color;\n\n\t}\n\n\tTHREE.LightProbeGenerator = LightProbeGenerator;\n\n} )();\n","( function () {\n\n\tconst _taskCache = new WeakMap();\n\n\tclass DRACOLoader extends THREE.Loader {\n\n\t\tconstructor( manager ) {\n\n\t\t\tsuper( manager );\n\t\t\tthis.decoderPath = '';\n\t\t\tthis.decoderConfig = {};\n\t\t\tthis.decoderBinary = null;\n\t\t\tthis.decoderPending = null;\n\t\t\tthis.workerLimit = 4;\n\t\t\tthis.workerPool = [];\n\t\t\tthis.workerNextTaskID = 1;\n\t\t\tthis.workerSourceURL = '';\n\t\t\tthis.defaultAttributeIDs = {\n\t\t\t\tposition: 'POSITION',\n\t\t\t\tnormal: 'NORMAL',\n\t\t\t\tcolor: 'COLOR',\n\t\t\t\tuv: 'TEX_COORD'\n\t\t\t};\n\t\t\tthis.defaultAttributeTypes = {\n\t\t\t\tposition: 'Float32Array',\n\t\t\t\tnormal: 'Float32Array',\n\t\t\t\tcolor: 'Float32Array',\n\t\t\t\tuv: 'Float32Array'\n\t\t\t};\n\n\t\t}\n\n\t\tsetDecoderPath( path ) {\n\n\t\t\tthis.decoderPath = path;\n\t\t\treturn this;\n\n\t\t}\n\n\t\tsetDecoderConfig( config ) {\n\n\t\t\tthis.decoderConfig = config;\n\t\t\treturn this;\n\n\t\t}\n\n\t\tsetWorkerLimit( workerLimit ) {\n\n\t\t\tthis.workerLimit = workerLimit;\n\t\t\treturn this;\n\n\t\t}\n\n\t\tload( url, onLoad, onProgress, onError ) {\n\n\t\t\tconst loader = new THREE.FileLoader( this.manager );\n\t\t\tloader.setPath( this.path );\n\t\t\tloader.setResponseType( 'arraybuffer' );\n\t\t\tloader.setRequestHeader( this.requestHeader );\n\t\t\tloader.setWithCredentials( this.withCredentials );\n\t\t\tloader.load( url, buffer => {\n\n\t\t\t\tconst taskConfig = {\n\t\t\t\t\tattributeIDs: this.defaultAttributeIDs,\n\t\t\t\t\tattributeTypes: this.defaultAttributeTypes,\n\t\t\t\t\tuseUniqueIDs: false\n\t\t\t\t};\n\t\t\t\tthis.decodeGeometry( buffer, taskConfig ).then( onLoad ).catch( onError );\n\n\t\t\t}, onProgress, onError );\n\n\t\t}\n\t\t/** @deprecated Kept for backward-compatibility with previous DRACOLoader versions. */\n\n\n\t\tdecodeDracoFile( buffer, callback, attributeIDs, attributeTypes ) {\n\n\t\t\tconst taskConfig = {\n\t\t\t\tattributeIDs: attributeIDs || this.defaultAttributeIDs,\n\t\t\t\tattributeTypes: attributeTypes || this.defaultAttributeTypes,\n\t\t\t\tuseUniqueIDs: !! attributeIDs\n\t\t\t};\n\t\t\tthis.decodeGeometry( buffer, taskConfig ).then( callback );\n\n\t\t}\n\n\t\tdecodeGeometry( buffer, taskConfig ) {\n\n\t\t\t// TODO: For backward-compatibility, support 'attributeTypes' objects containing\n\t\t\t// references (rather than names) to typed array constructors. These must be\n\t\t\t// serialized before sending them to the worker.\n\t\t\tfor ( const attribute in taskConfig.attributeTypes ) {\n\n\t\t\t\tconst type = taskConfig.attributeTypes[ attribute ];\n\n\t\t\t\tif ( type.BYTES_PER_ELEMENT !== undefined ) {\n\n\t\t\t\t\ttaskConfig.attributeTypes[ attribute ] = type.name;\n\n\t\t\t\t}\n\n\t\t\t} //\n\n\n\t\t\tconst taskKey = JSON.stringify( taskConfig ); // Check for an existing task using this buffer. A transferred buffer cannot be transferred\n\t\t\t// again from this thread.\n\n\t\t\tif ( _taskCache.has( buffer ) ) {\n\n\t\t\t\tconst cachedTask = _taskCache.get( buffer );\n\n\t\t\t\tif ( cachedTask.key === taskKey ) {\n\n\t\t\t\t\treturn cachedTask.promise;\n\n\t\t\t\t} else if ( buffer.byteLength === 0 ) {\n\n\t\t\t\t\t// Technically, it would be possible to wait for the previous task to complete,\n\t\t\t\t\t// transfer the buffer back, and decode again with the second configuration. That\n\t\t\t\t\t// is complex, and I don't know of any reason to decode a Draco buffer twice in\n\t\t\t\t\t// different ways, so this is left unimplemented.\n\t\t\t\t\tthrow new Error( 'THREE.DRACOLoader: Unable to re-decode a buffer with different ' + 'settings. Buffer has already been transferred.' );\n\n\t\t\t\t}\n\n\t\t\t} //\n\n\n\t\t\tlet worker;\n\t\t\tconst taskID = this.workerNextTaskID ++;\n\t\t\tconst taskCost = buffer.byteLength; // Obtain a worker and assign a task, and construct a geometry instance\n\t\t\t// when the task completes.\n\n\t\t\tconst geometryPending = this._getWorker( taskID, taskCost ).then( _worker => {\n\n\t\t\t\tworker = _worker;\n\t\t\t\treturn new Promise( ( resolve, reject ) => {\n\n\t\t\t\t\tworker._callbacks[ taskID ] = {\n\t\t\t\t\t\tresolve,\n\t\t\t\t\t\treject\n\t\t\t\t\t};\n\t\t\t\t\tworker.postMessage( {\n\t\t\t\t\t\ttype: 'decode',\n\t\t\t\t\t\tid: taskID,\n\t\t\t\t\t\ttaskConfig,\n\t\t\t\t\t\tbuffer\n\t\t\t\t\t}, [ buffer ] ); // this.debug();\n\n\t\t\t\t} );\n\n\t\t\t} ).then( message => this._createGeometry( message.geometry ) ); // Remove task from the task list.\n\t\t\t// Note: replaced '.finally()' with '.catch().then()' block - iOS 11 support (#19416)\n\n\n\t\t\tgeometryPending.catch( () => true ).then( () => {\n\n\t\t\t\tif ( worker && taskID ) {\n\n\t\t\t\t\tthis._releaseTask( worker, taskID ); // this.debug();\n\n\t\t\t\t}\n\n\t\t\t} ); // Cache the task result.\n\n\t\t\t_taskCache.set( buffer, {\n\t\t\t\tkey: taskKey,\n\t\t\t\tpromise: geometryPending\n\t\t\t} );\n\n\t\t\treturn geometryPending;\n\n\t\t}\n\n\t\t_createGeometry( geometryData ) {\n\n\t\t\tconst geometry = new THREE.BufferGeometry();\n\n\t\t\tif ( geometryData.index ) {\n\n\t\t\t\tgeometry.setIndex( new THREE.BufferAttribute( geometryData.index.array, 1 ) );\n\n\t\t\t}\n\n\t\t\tfor ( let i = 0; i < geometryData.attributes.length; i ++ ) {\n\n\t\t\t\tconst attribute = geometryData.attributes[ i ];\n\t\t\t\tconst name = attribute.name;\n\t\t\t\tconst array = attribute.array;\n\t\t\t\tconst itemSize = attribute.itemSize;\n\t\t\t\tgeometry.setAttribute( name, new THREE.BufferAttribute( array, itemSize ) );\n\n\t\t\t}\n\n\t\t\treturn geometry;\n\n\t\t}\n\n\t\t_loadLibrary( url, responseType ) {\n\n\t\t\tconst loader = new THREE.FileLoader( this.manager );\n\t\t\tloader.setPath( this.decoderPath );\n\t\t\tloader.setResponseType( responseType );\n\t\t\tloader.setWithCredentials( this.withCredentials );\n\t\t\treturn new Promise( ( resolve, reject ) => {\n\n\t\t\t\tloader.load( url, resolve, undefined, reject );\n\n\t\t\t} );\n\n\t\t}\n\n\t\tpreload() {\n\n\t\t\tthis._initDecoder();\n\n\t\t\treturn this;\n\n\t\t}\n\n\t\t_initDecoder() {\n\n\t\t\tif ( this.decoderPending ) return this.decoderPending;\n\t\t\tconst useJS = typeof WebAssembly !== 'object' || this.decoderConfig.type === 'js';\n\t\t\tconst librariesPending = [];\n\n\t\t\tif ( useJS ) {\n\n\t\t\t\tlibrariesPending.push( this._loadLibrary( 'draco_decoder.js', 'text' ) );\n\n\t\t\t} else {\n\n\t\t\t\tlibrariesPending.push( this._loadLibrary( 'draco_wasm_wrapper.js', 'text' ) );\n\t\t\t\tlibrariesPending.push( this._loadLibrary( 'draco_decoder.wasm', 'arraybuffer' ) );\n\n\t\t\t}\n\n\t\t\tthis.decoderPending = Promise.all( librariesPending ).then( libraries => {\n\n\t\t\t\tconst jsContent = libraries[ 0 ];\n\n\t\t\t\tif ( ! useJS ) {\n\n\t\t\t\t\tthis.decoderConfig.wasmBinary = libraries[ 1 ];\n\n\t\t\t\t}\n\n\t\t\t\tconst fn = DRACOWorker.toString();\n\t\t\t\tconst body = [ '/* draco decoder */', jsContent, '', '/* worker */', fn.substring( fn.indexOf( '{' ) + 1, fn.lastIndexOf( '}' ) ) ].join( '\\n' );\n\t\t\t\tthis.workerSourceURL = URL.createObjectURL( new Blob( [ body ] ) );\n\n\t\t\t} );\n\t\t\treturn this.decoderPending;\n\n\t\t}\n\n\t\t_getWorker( taskID, taskCost ) {\n\n\t\t\treturn this._initDecoder().then( () => {\n\n\t\t\t\tif ( this.workerPool.length < this.workerLimit ) {\n\n\t\t\t\t\tconst worker = new Worker( this.workerSourceURL );\n\t\t\t\t\tworker._callbacks = {};\n\t\t\t\t\tworker._taskCosts = {};\n\t\t\t\t\tworker._taskLoad = 0;\n\t\t\t\t\tworker.postMessage( {\n\t\t\t\t\t\ttype: 'init',\n\t\t\t\t\t\tdecoderConfig: this.decoderConfig\n\t\t\t\t\t} );\n\n\t\t\t\t\tworker.onmessage = function ( e ) {\n\n\t\t\t\t\t\tconst message = e.data;\n\n\t\t\t\t\t\tswitch ( message.type ) {\n\n\t\t\t\t\t\t\tcase 'decode':\n\t\t\t\t\t\t\t\tworker._callbacks[ message.id ].resolve( message );\n\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'error':\n\t\t\t\t\t\t\t\tworker._callbacks[ message.id ].reject( message );\n\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tconsole.error( 'THREE.DRACOLoader: Unexpected message, \"' + message.type + '\"' );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t};\n\n\t\t\t\t\tthis.workerPool.push( worker );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthis.workerPool.sort( function ( a, b ) {\n\n\t\t\t\t\t\treturn a._taskLoad > b._taskLoad ? - 1 : 1;\n\n\t\t\t\t\t} );\n\n\t\t\t\t}\n\n\t\t\t\tconst worker = this.workerPool[ this.workerPool.length - 1 ];\n\t\t\t\tworker._taskCosts[ taskID ] = taskCost;\n\t\t\t\tworker._taskLoad += taskCost;\n\t\t\t\treturn worker;\n\n\t\t\t} );\n\n\t\t}\n\n\t\t_releaseTask( worker, taskID ) {\n\n\t\t\tworker._taskLoad -= worker._taskCosts[ taskID ];\n\t\t\tdelete worker._callbacks[ taskID ];\n\t\t\tdelete worker._taskCosts[ taskID ];\n\n\t\t}\n\n\t\tdebug() {\n\n\t\t\tconsole.log( 'Task load: ', this.workerPool.map( worker => worker._taskLoad ) );\n\n\t\t}\n\n\t\tdispose() {\n\n\t\t\tfor ( let i = 0; i < this.workerPool.length; ++ i ) {\n\n\t\t\t\tthis.workerPool[ i ].terminate();\n\n\t\t\t}\n\n\t\t\tthis.workerPool.length = 0;\n\t\t\treturn this;\n\n\t\t}\n\n\t}\n\t/* WEB WORKER */\n\n\n\tfunction DRACOWorker() {\n\n\t\tlet decoderConfig;\n\t\tlet decoderPending;\n\n\t\tonmessage = function ( e ) {\n\n\t\t\tconst message = e.data;\n\n\t\t\tswitch ( message.type ) {\n\n\t\t\t\tcase 'init':\n\t\t\t\t\tdecoderConfig = message.decoderConfig;\n\t\t\t\t\tdecoderPending = new Promise( function ( resolve\n\t\t\t\t\t\t/*, reject*/\n\t\t\t\t\t) {\n\n\t\t\t\t\t\tdecoderConfig.onModuleLoaded = function ( draco ) {\n\n\t\t\t\t\t\t\t// Module is Promise-like. Wrap before resolving to avoid loop.\n\t\t\t\t\t\t\tresolve( {\n\t\t\t\t\t\t\t\tdraco: draco\n\t\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tDracoDecoderModule( decoderConfig ); // eslint-disable-line no-undef\n\n\t\t\t\t\t} );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'decode':\n\t\t\t\t\tconst buffer = message.buffer;\n\t\t\t\t\tconst taskConfig = message.taskConfig;\n\t\t\t\t\tdecoderPending.then( module => {\n\n\t\t\t\t\t\tconst draco = module.draco;\n\t\t\t\t\t\tconst decoder = new draco.Decoder();\n\t\t\t\t\t\tconst decoderBuffer = new draco.DecoderBuffer();\n\t\t\t\t\t\tdecoderBuffer.Init( new Int8Array( buffer ), buffer.byteLength );\n\n\t\t\t\t\t\ttry {\n\n\t\t\t\t\t\t\tconst geometry = decodeGeometry( draco, decoder, decoderBuffer, taskConfig );\n\t\t\t\t\t\t\tconst buffers = geometry.attributes.map( attr => attr.array.buffer );\n\t\t\t\t\t\t\tif ( geometry.index ) buffers.push( geometry.index.array.buffer );\n\t\t\t\t\t\t\tself.postMessage( {\n\t\t\t\t\t\t\t\ttype: 'decode',\n\t\t\t\t\t\t\t\tid: message.id,\n\t\t\t\t\t\t\t\tgeometry\n\t\t\t\t\t\t\t}, buffers );\n\n\t\t\t\t\t\t} catch ( error ) {\n\n\t\t\t\t\t\t\tconsole.error( error );\n\t\t\t\t\t\t\tself.postMessage( {\n\t\t\t\t\t\t\t\ttype: 'error',\n\t\t\t\t\t\t\t\tid: message.id,\n\t\t\t\t\t\t\t\terror: error.message\n\t\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t} finally {\n\n\t\t\t\t\t\t\tdraco.destroy( decoderBuffer );\n\t\t\t\t\t\t\tdraco.destroy( decoder );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} );\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t};\n\n\t\tfunction decodeGeometry( draco, decoder, decoderBuffer, taskConfig ) {\n\n\t\t\tconst attributeIDs = taskConfig.attributeIDs;\n\t\t\tconst attributeTypes = taskConfig.attributeTypes;\n\t\t\tlet dracoGeometry;\n\t\t\tlet decodingStatus;\n\t\t\tconst geometryType = decoder.GetEncodedGeometryType( decoderBuffer );\n\n\t\t\tif ( geometryType === draco.TRIANGULAR_MESH ) {\n\n\t\t\t\tdracoGeometry = new draco.Mesh();\n\t\t\t\tdecodingStatus = decoder.DecodeBufferToMesh( decoderBuffer, dracoGeometry );\n\n\t\t\t} else if ( geometryType === draco.POINT_CLOUD ) {\n\n\t\t\t\tdracoGeometry = new draco.PointCloud();\n\t\t\t\tdecodingStatus = decoder.DecodeBufferToPointCloud( decoderBuffer, dracoGeometry );\n\n\t\t\t} else {\n\n\t\t\t\tthrow new Error( 'THREE.DRACOLoader: Unexpected geometry type.' );\n\n\t\t\t}\n\n\t\t\tif ( ! decodingStatus.ok() || dracoGeometry.ptr === 0 ) {\n\n\t\t\t\tthrow new Error( 'THREE.DRACOLoader: Decoding failed: ' + decodingStatus.error_msg() );\n\n\t\t\t}\n\n\t\t\tconst geometry = {\n\t\t\t\tindex: null,\n\t\t\t\tattributes: []\n\t\t\t}; // Gather all vertex attributes.\n\n\t\t\tfor ( const attributeName in attributeIDs ) {\n\n\t\t\t\tconst attributeType = self[ attributeTypes[ attributeName ] ];\n\t\t\t\tlet attribute;\n\t\t\t\tlet attributeID; // A Draco file may be created with default vertex attributes, whose attribute IDs\n\t\t\t\t// are mapped 1:1 from their semantic name (POSITION, NORMAL, ...). Alternatively,\n\t\t\t\t// a Draco file may contain a custom set of attributes, identified by known unique\n\t\t\t\t// IDs. glTF files always do the latter, and `.drc` files typically do the former.\n\n\t\t\t\tif ( taskConfig.useUniqueIDs ) {\n\n\t\t\t\t\tattributeID = attributeIDs[ attributeName ];\n\t\t\t\t\tattribute = decoder.GetAttributeByUniqueId( dracoGeometry, attributeID );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tattributeID = decoder.GetAttributeId( dracoGeometry, draco[ attributeIDs[ attributeName ] ] );\n\t\t\t\t\tif ( attributeID === - 1 ) continue;\n\t\t\t\t\tattribute = decoder.GetAttribute( dracoGeometry, attributeID );\n\n\t\t\t\t}\n\n\t\t\t\tgeometry.attributes.push( decodeAttribute( draco, decoder, dracoGeometry, attributeName, attributeType, attribute ) );\n\n\t\t\t} // Add index.\n\n\n\t\t\tif ( geometryType === draco.TRIANGULAR_MESH ) {\n\n\t\t\t\tgeometry.index = decodeIndex( draco, decoder, dracoGeometry );\n\n\t\t\t}\n\n\t\t\tdraco.destroy( dracoGeometry );\n\t\t\treturn geometry;\n\n\t\t}\n\n\t\tfunction decodeIndex( draco, decoder, dracoGeometry ) {\n\n\t\t\tconst numFaces = dracoGeometry.num_faces();\n\t\t\tconst numIndices = numFaces * 3;\n\t\t\tconst byteLength = numIndices * 4;\n\n\t\t\tconst ptr = draco._malloc( byteLength );\n\n\t\t\tdecoder.GetTrianglesUInt32Array( dracoGeometry, byteLength, ptr );\n\t\t\tconst index = new Uint32Array( draco.HEAPF32.buffer, ptr, numIndices ).slice();\n\n\t\t\tdraco._free( ptr );\n\n\t\t\treturn {\n\t\t\t\tarray: index,\n\t\t\t\titemSize: 1\n\t\t\t};\n\n\t\t}\n\n\t\tfunction decodeAttribute( draco, decoder, dracoGeometry, attributeName, attributeType, attribute ) {\n\n\t\t\tconst numComponents = attribute.num_components();\n\t\t\tconst numPoints = dracoGeometry.num_points();\n\t\t\tconst numValues = numPoints * numComponents;\n\t\t\tconst byteLength = numValues * attributeType.BYTES_PER_ELEMENT;\n\t\t\tconst dataType = getDracoDataType( draco, attributeType );\n\n\t\t\tconst ptr = draco._malloc( byteLength );\n\n\t\t\tdecoder.GetAttributeDataArrayForAllPoints( dracoGeometry, attribute, dataType, byteLength, ptr );\n\t\t\tconst array = new attributeType( draco.HEAPF32.buffer, ptr, numValues ).slice();\n\n\t\t\tdraco._free( ptr );\n\n\t\t\treturn {\n\t\t\t\tname: attributeName,\n\t\t\t\tarray: array,\n\t\t\t\titemSize: numComponents\n\t\t\t};\n\n\t\t}\n\n\t\tfunction getDracoDataType( draco, attributeType ) {\n\n\t\t\tswitch ( attributeType ) {\n\n\t\t\t\tcase Float32Array:\n\t\t\t\t\treturn draco.DT_FLOAT32;\n\n\t\t\t\tcase Int8Array:\n\t\t\t\t\treturn draco.DT_INT8;\n\n\t\t\t\tcase Int16Array:\n\t\t\t\t\treturn draco.DT_INT16;\n\n\t\t\t\tcase Int32Array:\n\t\t\t\t\treturn draco.DT_INT32;\n\n\t\t\t\tcase Uint8Array:\n\t\t\t\t\treturn draco.DT_UINT8;\n\n\t\t\t\tcase Uint16Array:\n\t\t\t\t\treturn draco.DT_UINT16;\n\n\t\t\t\tcase Uint32Array:\n\t\t\t\t\treturn draco.DT_UINT32;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tTHREE.DRACOLoader = DRACOLoader;\n\n} )();\n","( function () {\n\n\tclass GLTFLoader extends THREE.Loader {\n\n\t\tconstructor( manager ) {\n\n\t\t\tsuper( manager );\n\t\t\tthis.dracoLoader = null;\n\t\t\tthis.ktx2Loader = null;\n\t\t\tthis.meshoptDecoder = null;\n\t\t\tthis.pluginCallbacks = [];\n\t\t\tthis.register( function ( parser ) {\n\n\t\t\t\treturn new GLTFMaterialsClearcoatExtension( parser );\n\n\t\t\t} );\n\t\t\tthis.register( function ( parser ) {\n\n\t\t\t\treturn new GLTFTextureBasisUExtension( parser );\n\n\t\t\t} );\n\t\t\tthis.register( function ( parser ) {\n\n\t\t\t\treturn new GLTFTextureWebPExtension( parser );\n\n\t\t\t} );\n\t\t\tthis.register( function ( parser ) {\n\n\t\t\t\treturn new GLTFMaterialsTransmissionExtension( parser );\n\n\t\t\t} );\n\t\t\tthis.register( function ( parser ) {\n\n\t\t\t\treturn new GLTFMaterialsVolumeExtension( parser );\n\n\t\t\t} );\n\t\t\tthis.register( function ( parser ) {\n\n\t\t\t\treturn new GLTFMaterialsIorExtension( parser );\n\n\t\t\t} );\n\t\t\tthis.register( function ( parser ) {\n\n\t\t\t\treturn new GLTFMaterialsSpecularExtension( parser );\n\n\t\t\t} );\n\t\t\tthis.register( function ( parser ) {\n\n\t\t\t\treturn new GLTFLightsExtension( parser );\n\n\t\t\t} );\n\t\t\tthis.register( function ( parser ) {\n\n\t\t\t\treturn new GLTFMeshoptCompression( parser );\n\n\t\t\t} );\n\n\t\t}\n\n\t\tload( url, onLoad, onProgress, onError ) {\n\n\t\t\tconst scope = this;\n\t\t\tlet resourcePath;\n\n\t\t\tif ( this.resourcePath !== '' ) {\n\n\t\t\t\tresourcePath = this.resourcePath;\n\n\t\t\t} else if ( this.path !== '' ) {\n\n\t\t\t\tresourcePath = this.path;\n\n\t\t\t} else {\n\n\t\t\t\tresourcePath = THREE.LoaderUtils.extractUrlBase( url );\n\n\t\t\t} // Tells the LoadingManager to track an extra item, which resolves after\n\t\t\t// the model is fully loaded. This means the count of items loaded will\n\t\t\t// be incorrect, but ensures manager.onLoad() does not fire early.\n\n\n\t\t\tthis.manager.itemStart( url );\n\n\t\t\tconst _onError = function ( e ) {\n\n\t\t\t\tif ( onError ) {\n\n\t\t\t\t\tonError( e );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tconsole.error( e );\n\n\t\t\t\t}\n\n\t\t\t\tscope.manager.itemError( url );\n\t\t\t\tscope.manager.itemEnd( url );\n\n\t\t\t};\n\n\t\t\tconst loader = new THREE.FileLoader( this.manager );\n\t\t\tloader.setPath( this.path );\n\t\t\tloader.setResponseType( 'arraybuffer' );\n\t\t\tloader.setRequestHeader( this.requestHeader );\n\t\t\tloader.setWithCredentials( this.withCredentials );\n\t\t\tloader.load( url, function ( data ) {\n\n\t\t\t\ttry {\n\n\t\t\t\t\tscope.parse( data, resourcePath, function ( gltf ) {\n\n\t\t\t\t\t\tonLoad( gltf );\n\t\t\t\t\t\tscope.manager.itemEnd( url );\n\n\t\t\t\t\t}, _onError );\n\n\t\t\t\t} catch ( e ) {\n\n\t\t\t\t\t_onError( e );\n\n\t\t\t\t}\n\n\t\t\t}, onProgress, _onError );\n\n\t\t}\n\n\t\tsetDRACOLoader( dracoLoader ) {\n\n\t\t\tthis.dracoLoader = dracoLoader;\n\t\t\treturn this;\n\n\t\t}\n\n\t\tsetDDSLoader() {\n\n\t\t\tthrow new Error( 'THREE.GLTFLoader: \"MSFT_texture_dds\" no longer supported. Please update to \"KHR_texture_basisu\".' );\n\n\t\t}\n\n\t\tsetKTX2Loader( ktx2Loader ) {\n\n\t\t\tthis.ktx2Loader = ktx2Loader;\n\t\t\treturn this;\n\n\t\t}\n\n\t\tsetMeshoptDecoder( meshoptDecoder ) {\n\n\t\t\tthis.meshoptDecoder = meshoptDecoder;\n\t\t\treturn this;\n\n\t\t}\n\n\t\tregister( callback ) {\n\n\t\t\tif ( this.pluginCallbacks.indexOf( callback ) === - 1 ) {\n\n\t\t\t\tthis.pluginCallbacks.push( callback );\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t}\n\n\t\tunregister( callback ) {\n\n\t\t\tif ( this.pluginCallbacks.indexOf( callback ) !== - 1 ) {\n\n\t\t\t\tthis.pluginCallbacks.splice( this.pluginCallbacks.indexOf( callback ), 1 );\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t}\n\n\t\tparse( data, path, onLoad, onError ) {\n\n\t\t\tlet content;\n\t\t\tconst extensions = {};\n\t\t\tconst plugins = {};\n\n\t\t\tif ( typeof data === 'string' ) {\n\n\t\t\t\tcontent = data;\n\n\t\t\t} else {\n\n\t\t\t\tconst magic = THREE.LoaderUtils.decodeText( new Uint8Array( data, 0, 4 ) );\n\n\t\t\t\tif ( magic === BINARY_EXTENSION_HEADER_MAGIC ) {\n\n\t\t\t\t\ttry {\n\n\t\t\t\t\t\textensions[ EXTENSIONS.KHR_BINARY_GLTF ] = new GLTFBinaryExtension( data );\n\n\t\t\t\t\t} catch ( error ) {\n\n\t\t\t\t\t\tif ( onError ) onError( error );\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tcontent = extensions[ EXTENSIONS.KHR_BINARY_GLTF ].content;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tcontent = THREE.LoaderUtils.decodeText( new Uint8Array( data ) );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tconst json = JSON.parse( content );\n\n\t\t\tif ( json.asset === undefined || json.asset.version[ 0 ] < 2 ) {\n\n\t\t\t\tif ( onError ) onError( new Error( 'THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported.' ) );\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\tconst parser = new GLTFParser( json, {\n\t\t\t\tpath: path || this.resourcePath || '',\n\t\t\t\tcrossOrigin: this.crossOrigin,\n\t\t\t\trequestHeader: this.requestHeader,\n\t\t\t\tmanager: this.manager,\n\t\t\t\tktx2Loader: this.ktx2Loader,\n\t\t\t\tmeshoptDecoder: this.meshoptDecoder\n\t\t\t} );\n\t\t\tparser.fileLoader.setRequestHeader( this.requestHeader );\n\n\t\t\tfor ( let i = 0; i < this.pluginCallbacks.length; i ++ ) {\n\n\t\t\t\tconst plugin = this.pluginCallbacks[ i ]( parser );\n\t\t\t\tplugins[ plugin.name ] = plugin; // Workaround to avoid determining as unknown extension\n\t\t\t\t// in addUnknownExtensionsToUserData().\n\t\t\t\t// Remove this workaround if we move all the existing\n\t\t\t\t// extension handlers to plugin system\n\n\t\t\t\textensions[ plugin.name ] = true;\n\n\t\t\t}\n\n\t\t\tif ( json.extensionsUsed ) {\n\n\t\t\t\tfor ( let i = 0; i < json.extensionsUsed.length; ++ i ) {\n\n\t\t\t\t\tconst extensionName = json.extensionsUsed[ i ];\n\t\t\t\t\tconst extensionsRequired = json.extensionsRequired || [];\n\n\t\t\t\t\tswitch ( extensionName ) {\n\n\t\t\t\t\t\tcase EXTENSIONS.KHR_MATERIALS_UNLIT:\n\t\t\t\t\t\t\textensions[ extensionName ] = new GLTFMaterialsUnlitExtension();\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase EXTENSIONS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:\n\t\t\t\t\t\t\textensions[ extensionName ] = new GLTFMaterialsPbrSpecularGlossinessExtension();\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase EXTENSIONS.KHR_DRACO_MESH_COMPRESSION:\n\t\t\t\t\t\t\textensions[ extensionName ] = new GLTFDracoMeshCompressionExtension( json, this.dracoLoader );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase EXTENSIONS.KHR_TEXTURE_TRANSFORM:\n\t\t\t\t\t\t\textensions[ extensionName ] = new GLTFTextureTransformExtension();\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase EXTENSIONS.KHR_MESH_QUANTIZATION:\n\t\t\t\t\t\t\textensions[ extensionName ] = new GLTFMeshQuantizationExtension();\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tif ( extensionsRequired.indexOf( extensionName ) >= 0 && plugins[ extensionName ] === undefined ) {\n\n\t\t\t\t\t\t\t\tconsole.warn( 'THREE.GLTFLoader: Unknown extension \"' + extensionName + '\".' );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tparser.setExtensions( extensions );\n\t\t\tparser.setPlugins( plugins );\n\t\t\tparser.parse( onLoad, onError );\n\n\t\t}\n\n\t}\n\t/* GLTFREGISTRY */\n\n\n\tfunction GLTFRegistry() {\n\n\t\tlet objects = {};\n\t\treturn {\n\t\t\tget: function ( key ) {\n\n\t\t\t\treturn objects[ key ];\n\n\t\t\t},\n\t\t\tadd: function ( key, object ) {\n\n\t\t\t\tobjects[ key ] = object;\n\n\t\t\t},\n\t\t\tremove: function ( key ) {\n\n\t\t\t\tdelete objects[ key ];\n\n\t\t\t},\n\t\t\tremoveAll: function () {\n\n\t\t\t\tobjects = {};\n\n\t\t\t}\n\t\t};\n\n\t}\n\t/*********************************/\n\n\t/********** EXTENSIONS ***********/\n\n\t/*********************************/\n\n\n\tconst EXTENSIONS = {\n\t\tKHR_BINARY_GLTF: 'KHR_binary_glTF',\n\t\tKHR_DRACO_MESH_COMPRESSION: 'KHR_draco_mesh_compression',\n\t\tKHR_LIGHTS_PUNCTUAL: 'KHR_lights_punctual',\n\t\tKHR_MATERIALS_CLEARCOAT: 'KHR_materials_clearcoat',\n\t\tKHR_MATERIALS_IOR: 'KHR_materials_ior',\n\t\tKHR_MATERIALS_PBR_SPECULAR_GLOSSINESS: 'KHR_materials_pbrSpecularGlossiness',\n\t\tKHR_MATERIALS_SPECULAR: 'KHR_materials_specular',\n\t\tKHR_MATERIALS_TRANSMISSION: 'KHR_materials_transmission',\n\t\tKHR_MATERIALS_UNLIT: 'KHR_materials_unlit',\n\t\tKHR_MATERIALS_VOLUME: 'KHR_materials_volume',\n\t\tKHR_TEXTURE_BASISU: 'KHR_texture_basisu',\n\t\tKHR_TEXTURE_TRANSFORM: 'KHR_texture_transform',\n\t\tKHR_MESH_QUANTIZATION: 'KHR_mesh_quantization',\n\t\tEXT_TEXTURE_WEBP: 'EXT_texture_webp',\n\t\tEXT_MESHOPT_COMPRESSION: 'EXT_meshopt_compression'\n\t};\n\t/**\n * Punctual Lights Extension\n *\n * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_lights_punctual\n */\n\n\tclass GLTFLightsExtension {\n\n\t\tconstructor( parser ) {\n\n\t\t\tthis.parser = parser;\n\t\t\tthis.name = EXTENSIONS.KHR_LIGHTS_PUNCTUAL; // THREE.Object3D instance caches\n\n\t\t\tthis.cache = {\n\t\t\t\trefs: {},\n\t\t\t\tuses: {}\n\t\t\t};\n\n\t\t}\n\n\t\t_markDefs() {\n\n\t\t\tconst parser = this.parser;\n\t\t\tconst nodeDefs = this.parser.json.nodes || [];\n\n\t\t\tfor ( let nodeIndex = 0, nodeLength = nodeDefs.length; nodeIndex < nodeLength; nodeIndex ++ ) {\n\n\t\t\t\tconst nodeDef = nodeDefs[ nodeIndex ];\n\n\t\t\t\tif ( nodeDef.extensions && nodeDef.extensions[ this.name ] && nodeDef.extensions[ this.name ].light !== undefined ) {\n\n\t\t\t\t\tparser._addNodeRef( this.cache, nodeDef.extensions[ this.name ].light );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\t_loadLight( lightIndex ) {\n\n\t\t\tconst parser = this.parser;\n\t\t\tconst cacheKey = 'light:' + lightIndex;\n\t\t\tlet dependency = parser.cache.get( cacheKey );\n\t\t\tif ( dependency ) return dependency;\n\t\t\tconst json = parser.json;\n\t\t\tconst extensions = json.extensions && json.extensions[ this.name ] || {};\n\t\t\tconst lightDefs = extensions.lights || [];\n\t\t\tconst lightDef = lightDefs[ lightIndex ];\n\t\t\tlet lightNode;\n\t\t\tconst color = new THREE.Color( 0xffffff );\n\t\t\tif ( lightDef.color !== undefined ) color.fromArray( lightDef.color );\n\t\t\tconst range = lightDef.range !== undefined ? lightDef.range : 0;\n\n\t\t\tswitch ( lightDef.type ) {\n\n\t\t\t\tcase 'directional':\n\t\t\t\t\tlightNode = new THREE.DirectionalLight( color );\n\t\t\t\t\tlightNode.target.position.set( 0, 0, - 1 );\n\t\t\t\t\tlightNode.add( lightNode.target );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'point':\n\t\t\t\t\tlightNode = new THREE.PointLight( color );\n\t\t\t\t\tlightNode.distance = range;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'spot':\n\t\t\t\t\tlightNode = new THREE.SpotLight( color );\n\t\t\t\t\tlightNode.distance = range; // Handle spotlight properties.\n\n\t\t\t\t\tlightDef.spot = lightDef.spot || {};\n\t\t\t\t\tlightDef.spot.innerConeAngle = lightDef.spot.innerConeAngle !== undefined ? lightDef.spot.innerConeAngle : 0;\n\t\t\t\t\tlightDef.spot.outerConeAngle = lightDef.spot.outerConeAngle !== undefined ? lightDef.spot.outerConeAngle : Math.PI / 4.0;\n\t\t\t\t\tlightNode.angle = lightDef.spot.outerConeAngle;\n\t\t\t\t\tlightNode.penumbra = 1.0 - lightDef.spot.innerConeAngle / lightDef.spot.outerConeAngle;\n\t\t\t\t\tlightNode.target.position.set( 0, 0, - 1 );\n\t\t\t\t\tlightNode.add( lightNode.target );\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Error( 'THREE.GLTFLoader: Unexpected light type: ' + lightDef.type );\n\n\t\t\t} // Some lights (e.g. spot) default to a position other than the origin. Reset the position\n\t\t\t// here, because node-level parsing will only override position if explicitly specified.\n\n\n\t\t\tlightNode.position.set( 0, 0, 0 );\n\t\t\tlightNode.decay = 2;\n\t\t\tif ( lightDef.intensity !== undefined ) lightNode.intensity = lightDef.intensity;\n\t\t\tlightNode.name = parser.createUniqueName( lightDef.name || 'light_' + lightIndex );\n\t\t\tdependency = Promise.resolve( lightNode );\n\t\t\tparser.cache.add( cacheKey, dependency );\n\t\t\treturn dependency;\n\n\t\t}\n\n\t\tcreateNodeAttachment( nodeIndex ) {\n\n\t\t\tconst self = this;\n\t\t\tconst parser = this.parser;\n\t\t\tconst json = parser.json;\n\t\t\tconst nodeDef = json.nodes[ nodeIndex ];\n\t\t\tconst lightDef = nodeDef.extensions && nodeDef.extensions[ this.name ] || {};\n\t\t\tconst lightIndex = lightDef.light;\n\t\t\tif ( lightIndex === undefined ) return null;\n\t\t\treturn this._loadLight( lightIndex ).then( function ( light ) {\n\n\t\t\t\treturn parser._getNodeRef( self.cache, lightIndex, light );\n\n\t\t\t} );\n\n\t\t}\n\n\t}\n\t/**\n * Unlit Materials Extension\n *\n * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_unlit\n */\n\n\n\tclass GLTFMaterialsUnlitExtension {\n\n\t\tconstructor() {\n\n\t\t\tthis.name = EXTENSIONS.KHR_MATERIALS_UNLIT;\n\n\t\t}\n\n\t\tgetMaterialType() {\n\n\t\t\treturn THREE.MeshBasicMaterial;\n\n\t\t}\n\n\t\textendParams( materialParams, materialDef, parser ) {\n\n\t\t\tconst pending = [];\n\t\t\tmaterialParams.color = new THREE.Color( 1.0, 1.0, 1.0 );\n\t\t\tmaterialParams.opacity = 1.0;\n\t\t\tconst metallicRoughness = materialDef.pbrMetallicRoughness;\n\n\t\t\tif ( metallicRoughness ) {\n\n\t\t\t\tif ( Array.isArray( metallicRoughness.baseColorFactor ) ) {\n\n\t\t\t\t\tconst array = metallicRoughness.baseColorFactor;\n\t\t\t\t\tmaterialParams.color.fromArray( array );\n\t\t\t\t\tmaterialParams.opacity = array[ 3 ];\n\n\t\t\t\t}\n\n\t\t\t\tif ( metallicRoughness.baseColorTexture !== undefined ) {\n\n\t\t\t\t\tpending.push( parser.assignTexture( materialParams, 'map', metallicRoughness.baseColorTexture ) );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn Promise.all( pending );\n\n\t\t}\n\n\t}\n\t/**\n * Clearcoat Materials Extension\n *\n * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_clearcoat\n */\n\n\n\tclass GLTFMaterialsClearcoatExtension {\n\n\t\tconstructor( parser ) {\n\n\t\t\tthis.parser = parser;\n\t\t\tthis.name = EXTENSIONS.KHR_MATERIALS_CLEARCOAT;\n\n\t\t}\n\n\t\tgetMaterialType( materialIndex ) {\n\n\t\t\tconst parser = this.parser;\n\t\t\tconst materialDef = parser.json.materials[ materialIndex ];\n\t\t\tif ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) return null;\n\t\t\treturn THREE.MeshPhysicalMaterial;\n\n\t\t}\n\n\t\textendMaterialParams( materialIndex, materialParams ) {\n\n\t\t\tconst parser = this.parser;\n\t\t\tconst materialDef = parser.json.materials[ materialIndex ];\n\n\t\t\tif ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) {\n\n\t\t\t\treturn Promise.resolve();\n\n\t\t\t}\n\n\t\t\tconst pending = [];\n\t\t\tconst extension = materialDef.extensions[ this.name ];\n\n\t\t\tif ( extension.clearcoatFactor !== undefined ) {\n\n\t\t\t\tmaterialParams.clearcoat = extension.clearcoatFactor;\n\n\t\t\t}\n\n\t\t\tif ( extension.clearcoatTexture !== undefined ) {\n\n\t\t\t\tpending.push( parser.assignTexture( materialParams, 'clearcoatMap', extension.clearcoatTexture ) );\n\n\t\t\t}\n\n\t\t\tif ( extension.clearcoatRoughnessFactor !== undefined ) {\n\n\t\t\t\tmaterialParams.clearcoatRoughness = extension.clearcoatRoughnessFactor;\n\n\t\t\t}\n\n\t\t\tif ( extension.clearcoatRoughnessTexture !== undefined ) {\n\n\t\t\t\tpending.push( parser.assignTexture( materialParams, 'clearcoatRoughnessMap', extension.clearcoatRoughnessTexture ) );\n\n\t\t\t}\n\n\t\t\tif ( extension.clearcoatNormalTexture !== undefined ) {\n\n\t\t\t\tpending.push( parser.assignTexture( materialParams, 'clearcoatNormalMap', extension.clearcoatNormalTexture ) );\n\n\t\t\t\tif ( extension.clearcoatNormalTexture.scale !== undefined ) {\n\n\t\t\t\t\tconst scale = extension.clearcoatNormalTexture.scale;\n\t\t\t\t\tmaterialParams.clearcoatNormalScale = new THREE.Vector2( scale, scale );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn Promise.all( pending );\n\n\t\t}\n\n\t}\n\t/**\n * Transmission Materials Extension\n *\n * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_transmission\n * Draft: https://github.com/KhronosGroup/glTF/pull/1698\n */\n\n\n\tclass GLTFMaterialsTransmissionExtension {\n\n\t\tconstructor( parser ) {\n\n\t\t\tthis.parser = parser;\n\t\t\tthis.name = EXTENSIONS.KHR_MATERIALS_TRANSMISSION;\n\n\t\t}\n\n\t\tgetMaterialType( materialIndex ) {\n\n\t\t\tconst parser = this.parser;\n\t\t\tconst materialDef = parser.json.materials[ materialIndex ];\n\t\t\tif ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) return null;\n\t\t\treturn THREE.MeshPhysicalMaterial;\n\n\t\t}\n\n\t\textendMaterialParams( materialIndex, materialParams ) {\n\n\t\t\tconst parser = this.parser;\n\t\t\tconst materialDef = parser.json.materials[ materialIndex ];\n\n\t\t\tif ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) {\n\n\t\t\t\treturn Promise.resolve();\n\n\t\t\t}\n\n\t\t\tconst pending = [];\n\t\t\tconst extension = materialDef.extensions[ this.name ];\n\n\t\t\tif ( extension.transmissionFactor !== undefined ) {\n\n\t\t\t\tmaterialParams.transmission = extension.transmissionFactor;\n\n\t\t\t}\n\n\t\t\tif ( extension.transmissionTexture !== undefined ) {\n\n\t\t\t\tpending.push( parser.assignTexture( materialParams, 'transmissionMap', extension.transmissionTexture ) );\n\n\t\t\t}\n\n\t\t\treturn Promise.all( pending );\n\n\t\t}\n\n\t}\n\t/**\n * Materials Volume Extension\n *\n * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_volume\n */\n\n\n\tclass GLTFMaterialsVolumeExtension {\n\n\t\tconstructor( parser ) {\n\n\t\t\tthis.parser = parser;\n\t\t\tthis.name = EXTENSIONS.KHR_MATERIALS_VOLUME;\n\n\t\t}\n\n\t\tgetMaterialType( materialIndex ) {\n\n\t\t\tconst parser = this.parser;\n\t\t\tconst materialDef = parser.json.materials[ materialIndex ];\n\t\t\tif ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) return null;\n\t\t\treturn THREE.MeshPhysicalMaterial;\n\n\t\t}\n\n\t\textendMaterialParams( materialIndex, materialParams ) {\n\n\t\t\tconst parser = this.parser;\n\t\t\tconst materialDef = parser.json.materials[ materialIndex ];\n\n\t\t\tif ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) {\n\n\t\t\t\treturn Promise.resolve();\n\n\t\t\t}\n\n\t\t\tconst pending = [];\n\t\t\tconst extension = materialDef.extensions[ this.name ];\n\t\t\tmaterialParams.thickness = extension.thicknessFactor !== undefined ? extension.thicknessFactor : 0;\n\n\t\t\tif ( extension.thicknessTexture !== undefined ) {\n\n\t\t\t\tpending.push( parser.assignTexture( materialParams, 'thicknessMap', extension.thicknessTexture ) );\n\n\t\t\t}\n\n\t\t\tmaterialParams.attenuationDistance = extension.attenuationDistance || 0;\n\t\t\tconst colorArray = extension.attenuationColor || [ 1, 1, 1 ];\n\t\t\tmaterialParams.attenuationTint = new THREE.Color( colorArray[ 0 ], colorArray[ 1 ], colorArray[ 2 ] );\n\t\t\treturn Promise.all( pending );\n\n\t\t}\n\n\t}\n\t/**\n * Materials ior Extension\n *\n * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_ior\n */\n\n\n\tclass GLTFMaterialsIorExtension {\n\n\t\tconstructor( parser ) {\n\n\t\t\tthis.parser = parser;\n\t\t\tthis.name = EXTENSIONS.KHR_MATERIALS_IOR;\n\n\t\t}\n\n\t\tgetMaterialType( materialIndex ) {\n\n\t\t\tconst parser = this.parser;\n\t\t\tconst materialDef = parser.json.materials[ materialIndex ];\n\t\t\tif ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) return null;\n\t\t\treturn THREE.MeshPhysicalMaterial;\n\n\t\t}\n\n\t\textendMaterialParams( materialIndex, materialParams ) {\n\n\t\t\tconst parser = this.parser;\n\t\t\tconst materialDef = parser.json.materials[ materialIndex ];\n\n\t\t\tif ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) {\n\n\t\t\t\treturn Promise.resolve();\n\n\t\t\t}\n\n\t\t\tconst extension = materialDef.extensions[ this.name ];\n\t\t\tmaterialParams.ior = extension.ior !== undefined ? extension.ior : 1.5;\n\t\t\treturn Promise.resolve();\n\n\t\t}\n\n\t}\n\t/**\n * Materials specular Extension\n *\n * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_specular\n */\n\n\n\tclass GLTFMaterialsSpecularExtension {\n\n\t\tconstructor( parser ) {\n\n\t\t\tthis.parser = parser;\n\t\t\tthis.name = EXTENSIONS.KHR_MATERIALS_SPECULAR;\n\n\t\t}\n\n\t\tgetMaterialType( materialIndex ) {\n\n\t\t\tconst parser = this.parser;\n\t\t\tconst materialDef = parser.json.materials[ materialIndex ];\n\t\t\tif ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) return null;\n\t\t\treturn THREE.MeshPhysicalMaterial;\n\n\t\t}\n\n\t\textendMaterialParams( materialIndex, materialParams ) {\n\n\t\t\tconst parser = this.parser;\n\t\t\tconst materialDef = parser.json.materials[ materialIndex ];\n\n\t\t\tif ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) {\n\n\t\t\t\treturn Promise.resolve();\n\n\t\t\t}\n\n\t\t\tconst pending = [];\n\t\t\tconst extension = materialDef.extensions[ this.name ];\n\t\t\tmaterialParams.specularIntensity = extension.specularFactor !== undefined ? extension.specularFactor : 1.0;\n\n\t\t\tif ( extension.specularTexture !== undefined ) {\n\n\t\t\t\tpending.push( parser.assignTexture( materialParams, 'specularIntensityMap', extension.specularTexture ) );\n\n\t\t\t}\n\n\t\t\tconst colorArray = extension.specularColorFactor || [ 1, 1, 1 ];\n\t\t\tmaterialParams.specularTint = new THREE.Color( colorArray[ 0 ], colorArray[ 1 ], colorArray[ 2 ] );\n\n\t\t\tif ( extension.specularColorTexture !== undefined ) {\n\n\t\t\t\tpending.push( parser.assignTexture( materialParams, 'specularTintMap', extension.specularColorTexture ).then( function ( texture ) {\n\n\t\t\t\t\ttexture.encoding = THREE.sRGBEncoding;\n\n\t\t\t\t} ) );\n\n\t\t\t}\n\n\t\t\treturn Promise.all( pending );\n\n\t\t}\n\n\t}\n\t/**\n * BasisU THREE.Texture Extension\n *\n * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_texture_basisu\n */\n\n\n\tclass GLTFTextureBasisUExtension {\n\n\t\tconstructor( parser ) {\n\n\t\t\tthis.parser = parser;\n\t\t\tthis.name = EXTENSIONS.KHR_TEXTURE_BASISU;\n\n\t\t}\n\n\t\tloadTexture( textureIndex ) {\n\n\t\t\tconst parser = this.parser;\n\t\t\tconst json = parser.json;\n\t\t\tconst textureDef = json.textures[ textureIndex ];\n\n\t\t\tif ( ! textureDef.extensions || ! textureDef.extensions[ this.name ] ) {\n\n\t\t\t\treturn null;\n\n\t\t\t}\n\n\t\t\tconst extension = textureDef.extensions[ this.name ];\n\t\t\tconst source = json.images[ extension.source ];\n\t\t\tconst loader = parser.options.ktx2Loader;\n\n\t\t\tif ( ! loader ) {\n\n\t\t\t\tif ( json.extensionsRequired && json.extensionsRequired.indexOf( this.name ) >= 0 ) {\n\n\t\t\t\t\tthrow new Error( 'THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures' );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// Assumes that the extension is optional and that a fallback texture is present\n\t\t\t\t\treturn null;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn parser.loadTextureImage( textureIndex, source, loader );\n\n\t\t}\n\n\t}\n\t/**\n * WebP THREE.Texture Extension\n *\n * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/EXT_texture_webp\n */\n\n\n\tclass GLTFTextureWebPExtension {\n\n\t\tconstructor( parser ) {\n\n\t\t\tthis.parser = parser;\n\t\t\tthis.name = EXTENSIONS.EXT_TEXTURE_WEBP;\n\t\t\tthis.isSupported = null;\n\n\t\t}\n\n\t\tloadTexture( textureIndex ) {\n\n\t\t\tconst name = this.name;\n\t\t\tconst parser = this.parser;\n\t\t\tconst json = parser.json;\n\t\t\tconst textureDef = json.textures[ textureIndex ];\n\n\t\t\tif ( ! textureDef.extensions || ! textureDef.extensions[ name ] ) {\n\n\t\t\t\treturn null;\n\n\t\t\t}\n\n\t\t\tconst extension = textureDef.extensions[ name ];\n\t\t\tconst source = json.images[ extension.source ];\n\t\t\tlet loader = parser.textureLoader;\n\n\t\t\tif ( source.uri ) {\n\n\t\t\t\tconst handler = parser.options.manager.getHandler( source.uri );\n\t\t\t\tif ( handler !== null ) loader = handler;\n\n\t\t\t}\n\n\t\t\treturn this.detectSupport().then( function ( isSupported ) {\n\n\t\t\t\tif ( isSupported ) return parser.loadTextureImage( textureIndex, source, loader );\n\n\t\t\t\tif ( json.extensionsRequired && json.extensionsRequired.indexOf( name ) >= 0 ) {\n\n\t\t\t\t\tthrow new Error( 'THREE.GLTFLoader: WebP required by asset but unsupported.' );\n\n\t\t\t\t} // Fall back to PNG or JPEG.\n\n\n\t\t\t\treturn parser.loadTexture( textureIndex );\n\n\t\t\t} );\n\n\t\t}\n\n\t\tdetectSupport() {\n\n\t\t\tif ( ! this.isSupported ) {\n\n\t\t\t\tthis.isSupported = new Promise( function ( resolve ) {\n\n\t\t\t\t\tconst image = new Image(); // Lossy test image. Support for lossy images doesn't guarantee support for all\n\t\t\t\t\t// WebP images, unfortunately.\n\n\t\t\t\t\timage.src = 'data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA';\n\n\t\t\t\t\timage.onload = image.onerror = function () {\n\n\t\t\t\t\t\tresolve( image.height === 1 );\n\n\t\t\t\t\t};\n\n\t\t\t\t} );\n\n\t\t\t}\n\n\t\t\treturn this.isSupported;\n\n\t\t}\n\n\t}\n\t/**\n * meshopt BufferView Compression Extension\n *\n * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/EXT_meshopt_compression\n */\n\n\n\tclass GLTFMeshoptCompression {\n\n\t\tconstructor( parser ) {\n\n\t\t\tthis.name = EXTENSIONS.EXT_MESHOPT_COMPRESSION;\n\t\t\tthis.parser = parser;\n\n\t\t}\n\n\t\tloadBufferView( index ) {\n\n\t\t\tconst json = this.parser.json;\n\t\t\tconst bufferView = json.bufferViews[ index ];\n\n\t\t\tif ( bufferView.extensions && bufferView.extensions[ this.name ] ) {\n\n\t\t\t\tconst extensionDef = bufferView.extensions[ this.name ];\n\t\t\t\tconst buffer = this.parser.getDependency( 'buffer', extensionDef.buffer );\n\t\t\t\tconst decoder = this.parser.options.meshoptDecoder;\n\n\t\t\t\tif ( ! decoder || ! decoder.supported ) {\n\n\t\t\t\t\tif ( json.extensionsRequired && json.extensionsRequired.indexOf( this.name ) >= 0 ) {\n\n\t\t\t\t\t\tthrow new Error( 'THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files' );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// Assumes that the extension is optional and that fallback buffer data is present\n\t\t\t\t\t\treturn null;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\treturn Promise.all( [ buffer, decoder.ready ] ).then( function ( res ) {\n\n\t\t\t\t\tconst byteOffset = extensionDef.byteOffset || 0;\n\t\t\t\t\tconst byteLength = extensionDef.byteLength || 0;\n\t\t\t\t\tconst count = extensionDef.count;\n\t\t\t\t\tconst stride = extensionDef.byteStride;\n\t\t\t\t\tconst result = new ArrayBuffer( count * stride );\n\t\t\t\t\tconst source = new Uint8Array( res[ 0 ], byteOffset, byteLength );\n\t\t\t\t\tdecoder.decodeGltfBuffer( new Uint8Array( result ), count, stride, source, extensionDef.mode, extensionDef.filter );\n\t\t\t\t\treturn result;\n\n\t\t\t\t} );\n\n\t\t\t} else {\n\n\t\t\t\treturn null;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\t/* BINARY EXTENSION */\n\n\n\tconst BINARY_EXTENSION_HEADER_MAGIC = 'glTF';\n\tconst BINARY_EXTENSION_HEADER_LENGTH = 12;\n\tconst BINARY_EXTENSION_CHUNK_TYPES = {\n\t\tJSON: 0x4E4F534A,\n\t\tBIN: 0x004E4942\n\t};\n\n\tclass GLTFBinaryExtension {\n\n\t\tconstructor( data ) {\n\n\t\t\tthis.name = EXTENSIONS.KHR_BINARY_GLTF;\n\t\t\tthis.content = null;\n\t\t\tthis.body = null;\n\t\t\tconst headerView = new DataView( data, 0, BINARY_EXTENSION_HEADER_LENGTH );\n\t\t\tthis.header = {\n\t\t\t\tmagic: THREE.LoaderUtils.decodeText( new Uint8Array( data.slice( 0, 4 ) ) ),\n\t\t\t\tversion: headerView.getUint32( 4, true ),\n\t\t\t\tlength: headerView.getUint32( 8, true )\n\t\t\t};\n\n\t\t\tif ( this.header.magic !== BINARY_EXTENSION_HEADER_MAGIC ) {\n\n\t\t\t\tthrow new Error( 'THREE.GLTFLoader: Unsupported glTF-Binary header.' );\n\n\t\t\t} else if ( this.header.version < 2.0 ) {\n\n\t\t\t\tthrow new Error( 'THREE.GLTFLoader: Legacy binary file detected.' );\n\n\t\t\t}\n\n\t\t\tconst chunkContentsLength = this.header.length - BINARY_EXTENSION_HEADER_LENGTH;\n\t\t\tconst chunkView = new DataView( data, BINARY_EXTENSION_HEADER_LENGTH );\n\t\t\tlet chunkIndex = 0;\n\n\t\t\twhile ( chunkIndex < chunkContentsLength ) {\n\n\t\t\t\tconst chunkLength = chunkView.getUint32( chunkIndex, true );\n\t\t\t\tchunkIndex += 4;\n\t\t\t\tconst chunkType = chunkView.getUint32( chunkIndex, true );\n\t\t\t\tchunkIndex += 4;\n\n\t\t\t\tif ( chunkType === BINARY_EXTENSION_CHUNK_TYPES.JSON ) {\n\n\t\t\t\t\tconst contentArray = new Uint8Array( data, BINARY_EXTENSION_HEADER_LENGTH + chunkIndex, chunkLength );\n\t\t\t\t\tthis.content = THREE.LoaderUtils.decodeText( contentArray );\n\n\t\t\t\t} else if ( chunkType === BINARY_EXTENSION_CHUNK_TYPES.BIN ) {\n\n\t\t\t\t\tconst byteOffset = BINARY_EXTENSION_HEADER_LENGTH + chunkIndex;\n\t\t\t\t\tthis.body = data.slice( byteOffset, byteOffset + chunkLength );\n\n\t\t\t\t} // Clients must ignore chunks with unknown types.\n\n\n\t\t\t\tchunkIndex += chunkLength;\n\n\t\t\t}\n\n\t\t\tif ( this.content === null ) {\n\n\t\t\t\tthrow new Error( 'THREE.GLTFLoader: JSON content not found.' );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\t/**\n * DRACO THREE.Mesh Compression Extension\n *\n * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_draco_mesh_compression\n */\n\n\n\tclass GLTFDracoMeshCompressionExtension {\n\n\t\tconstructor( json, dracoLoader ) {\n\n\t\t\tif ( ! dracoLoader ) {\n\n\t\t\t\tthrow new Error( 'THREE.GLTFLoader: No DRACOLoader instance provided.' );\n\n\t\t\t}\n\n\t\t\tthis.name = EXTENSIONS.KHR_DRACO_MESH_COMPRESSION;\n\t\t\tthis.json = json;\n\t\t\tthis.dracoLoader = dracoLoader;\n\t\t\tthis.dracoLoader.preload();\n\n\t\t}\n\n\t\tdecodePrimitive( primitive, parser ) {\n\n\t\t\tconst json = this.json;\n\t\t\tconst dracoLoader = this.dracoLoader;\n\t\t\tconst bufferViewIndex = primitive.extensions[ this.name ].bufferView;\n\t\t\tconst gltfAttributeMap = primitive.extensions[ this.name ].attributes;\n\t\t\tconst threeAttributeMap = {};\n\t\t\tconst attributeNormalizedMap = {};\n\t\t\tconst attributeTypeMap = {};\n\n\t\t\tfor ( const attributeName in gltfAttributeMap ) {\n\n\t\t\t\tconst threeAttributeName = ATTRIBUTES[ attributeName ] || attributeName.toLowerCase();\n\t\t\t\tthreeAttributeMap[ threeAttributeName ] = gltfAttributeMap[ attributeName ];\n\n\t\t\t}\n\n\t\t\tfor ( const attributeName in primitive.attributes ) {\n\n\t\t\t\tconst threeAttributeName = ATTRIBUTES[ attributeName ] || attributeName.toLowerCase();\n\n\t\t\t\tif ( gltfAttributeMap[ attributeName ] !== undefined ) {\n\n\t\t\t\t\tconst accessorDef = json.accessors[ primitive.attributes[ attributeName ] ];\n\t\t\t\t\tconst componentType = WEBGL_COMPONENT_TYPES[ accessorDef.componentType ];\n\t\t\t\t\tattributeTypeMap[ threeAttributeName ] = componentType;\n\t\t\t\t\tattributeNormalizedMap[ threeAttributeName ] = accessorDef.normalized === true;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn parser.getDependency( 'bufferView', bufferViewIndex ).then( function ( bufferView ) {\n\n\t\t\t\treturn new Promise( function ( resolve ) {\n\n\t\t\t\t\tdracoLoader.decodeDracoFile( bufferView, function ( geometry ) {\n\n\t\t\t\t\t\tfor ( const attributeName in geometry.attributes ) {\n\n\t\t\t\t\t\t\tconst attribute = geometry.attributes[ attributeName ];\n\t\t\t\t\t\t\tconst normalized = attributeNormalizedMap[ attributeName ];\n\t\t\t\t\t\t\tif ( normalized !== undefined ) attribute.normalized = normalized;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tresolve( geometry );\n\n\t\t\t\t\t}, threeAttributeMap, attributeTypeMap );\n\n\t\t\t\t} );\n\n\t\t\t} );\n\n\t\t}\n\n\t}\n\t/**\n * THREE.Texture Transform Extension\n *\n * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_texture_transform\n */\n\n\n\tclass GLTFTextureTransformExtension {\n\n\t\tconstructor() {\n\n\t\t\tthis.name = EXTENSIONS.KHR_TEXTURE_TRANSFORM;\n\n\t\t}\n\n\t\textendTexture( texture, transform ) {\n\n\t\t\tif ( transform.texCoord !== undefined ) {\n\n\t\t\t\tconsole.warn( 'THREE.GLTFLoader: Custom UV sets in \"' + this.name + '\" extension not yet supported.' );\n\n\t\t\t}\n\n\t\t\tif ( transform.offset === undefined && transform.rotation === undefined && transform.scale === undefined ) {\n\n\t\t\t\t// See https://github.com/mrdoob/three.js/issues/21819.\n\t\t\t\treturn texture;\n\n\t\t\t}\n\n\t\t\ttexture = texture.clone();\n\n\t\t\tif ( transform.offset !== undefined ) {\n\n\t\t\t\ttexture.offset.fromArray( transform.offset );\n\n\t\t\t}\n\n\t\t\tif ( transform.rotation !== undefined ) {\n\n\t\t\t\ttexture.rotation = transform.rotation;\n\n\t\t\t}\n\n\t\t\tif ( transform.scale !== undefined ) {\n\n\t\t\t\ttexture.repeat.fromArray( transform.scale );\n\n\t\t\t}\n\n\t\t\ttexture.needsUpdate = true;\n\t\t\treturn texture;\n\n\t\t}\n\n\t}\n\t/**\n * Specular-Glossiness Extension\n *\n * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_pbrSpecularGlossiness\n */\n\n\t/**\n * A sub class of StandardMaterial with some of the functionality\n * changed via the `onBeforeCompile` callback\n * @pailhead\n */\n\n\n\tclass GLTFMeshStandardSGMaterial extends THREE.MeshStandardMaterial {\n\n\t\tconstructor( params ) {\n\n\t\t\tsuper();\n\t\t\tthis.isGLTFSpecularGlossinessMaterial = true; //various chunks that need replacing\n\n\t\t\tconst specularMapParsFragmentChunk = [ '#ifdef USE_SPECULARMAP', '\tuniform sampler2D specularMap;', '#endif' ].join( '\\n' );\n\t\t\tconst glossinessMapParsFragmentChunk = [ '#ifdef USE_GLOSSINESSMAP', '\tuniform sampler2D glossinessMap;', '#endif' ].join( '\\n' );\n\t\t\tconst specularMapFragmentChunk = [ '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' );\n\t\t\tconst glossinessMapFragmentChunk = [ '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' );\n\t\t\tconst lightPhysicalFragmentChunk = [ 'PhysicalMaterial material;', 'material.diffuseColor = diffuseColor.rgb * ( 1. - max( specularFactor.r, max( specularFactor.g, specularFactor.b ) ) );', 'vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );', 'float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );', 'material.roughness = max( 1.0 - glossinessFactor, 0.0525 ); // 0.0525 corresponds to the base mip of a 256 cubemap.', 'material.roughness += geometryRoughness;', 'material.roughness = min( material.roughness, 1.0 );', 'material.specularColor = specularFactor;' ].join( '\\n' );\n\t\t\tconst uniforms = {\n\t\t\t\tspecular: {\n\t\t\t\t\tvalue: new THREE.Color().setHex( 0xffffff )\n\t\t\t\t},\n\t\t\t\tglossiness: {\n\t\t\t\t\tvalue: 1\n\t\t\t\t},\n\t\t\t\tspecularMap: {\n\t\t\t\t\tvalue: null\n\t\t\t\t},\n\t\t\t\tglossinessMap: {\n\t\t\t\t\tvalue: null\n\t\t\t\t}\n\t\t\t};\n\t\t\tthis._extraUniforms = uniforms;\n\n\t\t\tthis.onBeforeCompile = function ( shader ) {\n\n\t\t\t\tfor ( const uniformName in uniforms ) {\n\n\t\t\t\t\tshader.uniforms[ uniformName ] = uniforms[ uniformName ];\n\n\t\t\t\t}\n\n\t\t\t\tshader.fragmentShader = shader.fragmentShader.replace( 'uniform float roughness;', 'uniform vec3 specular;' ).replace( 'uniform float metalness;', 'uniform float glossiness;' ).replace( '#include <roughnessmap_pars_fragment>', specularMapParsFragmentChunk ).replace( '#include <metalnessmap_pars_fragment>', glossinessMapParsFragmentChunk ).replace( '#include <roughnessmap_fragment>', specularMapFragmentChunk ).replace( '#include <metalnessmap_fragment>', glossinessMapFragmentChunk ).replace( '#include <lights_physical_fragment>', lightPhysicalFragmentChunk );\n\n\t\t\t};\n\n\t\t\tObject.defineProperties( this, {\n\t\t\t\tspecular: {\n\t\t\t\t\tget: function () {\n\n\t\t\t\t\t\treturn uniforms.specular.value;\n\n\t\t\t\t\t},\n\t\t\t\t\tset: function ( v ) {\n\n\t\t\t\t\t\tuniforms.specular.value = v;\n\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tspecularMap: {\n\t\t\t\t\tget: function () {\n\n\t\t\t\t\t\treturn uniforms.specularMap.value;\n\n\t\t\t\t\t},\n\t\t\t\t\tset: function ( v ) {\n\n\t\t\t\t\t\tuniforms.specularMap.value = v;\n\n\t\t\t\t\t\tif ( v ) {\n\n\t\t\t\t\t\t\tthis.defines.USE_SPECULARMAP = ''; // USE_UV is set by the renderer for specular maps\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tdelete this.defines.USE_SPECULARMAP;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tglossiness: {\n\t\t\t\t\tget: function () {\n\n\t\t\t\t\t\treturn uniforms.glossiness.value;\n\n\t\t\t\t\t},\n\t\t\t\t\tset: function ( v ) {\n\n\t\t\t\t\t\tuniforms.glossiness.value = v;\n\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tglossinessMap: {\n\t\t\t\t\tget: function () {\n\n\t\t\t\t\t\treturn uniforms.glossinessMap.value;\n\n\t\t\t\t\t},\n\t\t\t\t\tset: function ( v ) {\n\n\t\t\t\t\t\tuniforms.glossinessMap.value = v;\n\n\t\t\t\t\t\tif ( v ) {\n\n\t\t\t\t\t\t\tthis.defines.USE_GLOSSINESSMAP = '';\n\t\t\t\t\t\t\tthis.defines.USE_UV = '';\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tdelete this.defines.USE_GLOSSINESSMAP;\n\t\t\t\t\t\t\tdelete this.defines.USE_UV;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} );\n\t\t\tdelete this.metalness;\n\t\t\tdelete this.roughness;\n\t\t\tdelete this.metalnessMap;\n\t\t\tdelete this.roughnessMap;\n\t\t\tthis.setValues( params );\n\n\t\t}\n\n\t\tcopy( source ) {\n\n\t\t\tsuper.copy( source );\n\t\t\tthis.specularMap = source.specularMap;\n\t\t\tthis.specular.copy( source.specular );\n\t\t\tthis.glossinessMap = source.glossinessMap;\n\t\t\tthis.glossiness = source.glossiness;\n\t\t\tdelete this.metalness;\n\t\t\tdelete this.roughness;\n\t\t\tdelete this.metalnessMap;\n\t\t\tdelete this.roughnessMap;\n\t\t\treturn this;\n\n\t\t}\n\n\t}\n\n\tclass GLTFMaterialsPbrSpecularGlossinessExtension {\n\n\t\tconstructor() {\n\n\t\t\tthis.name = EXTENSIONS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS;\n\t\t\tthis.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' ];\n\n\t\t}\n\n\t\tgetMaterialType() {\n\n\t\t\treturn GLTFMeshStandardSGMaterial;\n\n\t\t}\n\n\t\textendParams( materialParams, materialDef, parser ) {\n\n\t\t\tconst pbrSpecularGlossiness = materialDef.extensions[ this.name ];\n\t\t\tmaterialParams.color = new THREE.Color( 1.0, 1.0, 1.0 );\n\t\t\tmaterialParams.opacity = 1.0;\n\t\t\tconst pending = [];\n\n\t\t\tif ( Array.isArray( pbrSpecularGlossiness.diffuseFactor ) ) {\n\n\t\t\t\tconst array = pbrSpecularGlossiness.diffuseFactor;\n\t\t\t\tmaterialParams.color.fromArray( array );\n\t\t\t\tmaterialParams.opacity = array[ 3 ];\n\n\t\t\t}\n\n\t\t\tif ( pbrSpecularGlossiness.diffuseTexture !== undefined ) {\n\n\t\t\t\tpending.push( parser.assignTexture( materialParams, 'map', pbrSpecularGlossiness.diffuseTexture ) );\n\n\t\t\t}\n\n\t\t\tmaterialParams.emissive = new THREE.Color( 0.0, 0.0, 0.0 );\n\t\t\tmaterialParams.glossiness = pbrSpecularGlossiness.glossinessFactor !== undefined ? pbrSpecularGlossiness.glossinessFactor : 1.0;\n\t\t\tmaterialParams.specular = new THREE.Color( 1.0, 1.0, 1.0 );\n\n\t\t\tif ( Array.isArray( pbrSpecularGlossiness.specularFactor ) ) {\n\n\t\t\t\tmaterialParams.specular.fromArray( pbrSpecularGlossiness.specularFactor );\n\n\t\t\t}\n\n\t\t\tif ( pbrSpecularGlossiness.specularGlossinessTexture !== undefined ) {\n\n\t\t\t\tconst specGlossMapDef = pbrSpecularGlossiness.specularGlossinessTexture;\n\t\t\t\tpending.push( parser.assignTexture( materialParams, 'glossinessMap', specGlossMapDef ) );\n\t\t\t\tpending.push( parser.assignTexture( materialParams, 'specularMap', specGlossMapDef ) );\n\n\t\t\t}\n\n\t\t\treturn Promise.all( pending );\n\n\t\t}\n\n\t\tcreateMaterial( materialParams ) {\n\n\t\t\tconst material = new GLTFMeshStandardSGMaterial( materialParams );\n\t\t\tmaterial.fog = true;\n\t\t\tmaterial.color = materialParams.color;\n\t\t\tmaterial.map = materialParams.map === undefined ? null : materialParams.map;\n\t\t\tmaterial.lightMap = null;\n\t\t\tmaterial.lightMapIntensity = 1.0;\n\t\t\tmaterial.aoMap = materialParams.aoMap === undefined ? null : materialParams.aoMap;\n\t\t\tmaterial.aoMapIntensity = 1.0;\n\t\t\tmaterial.emissive = materialParams.emissive;\n\t\t\tmaterial.emissiveIntensity = 1.0;\n\t\t\tmaterial.emissiveMap = materialParams.emissiveMap === undefined ? null : materialParams.emissiveMap;\n\t\t\tmaterial.bumpMap = materialParams.bumpMap === undefined ? null : materialParams.bumpMap;\n\t\t\tmaterial.bumpScale = 1;\n\t\t\tmaterial.normalMap = materialParams.normalMap === undefined ? null : materialParams.normalMap;\n\t\t\tmaterial.normalMapType = THREE.TangentSpaceNormalMap;\n\t\t\tif ( materialParams.normalScale ) material.normalScale = materialParams.normalScale;\n\t\t\tmaterial.displacementMap = null;\n\t\t\tmaterial.displacementScale = 1;\n\t\t\tmaterial.displacementBias = 0;\n\t\t\tmaterial.specularMap = materialParams.specularMap === undefined ? null : materialParams.specularMap;\n\t\t\tmaterial.specular = materialParams.specular;\n\t\t\tmaterial.glossinessMap = materialParams.glossinessMap === undefined ? null : materialParams.glossinessMap;\n\t\t\tmaterial.glossiness = materialParams.glossiness;\n\t\t\tmaterial.alphaMap = null;\n\t\t\tmaterial.envMap = materialParams.envMap === undefined ? null : materialParams.envMap;\n\t\t\tmaterial.envMapIntensity = 1.0;\n\t\t\tmaterial.refractionRatio = 0.98;\n\t\t\treturn material;\n\n\t\t}\n\n\t}\n\t/**\n * THREE.Mesh Quantization Extension\n *\n * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_mesh_quantization\n */\n\n\n\tclass GLTFMeshQuantizationExtension {\n\n\t\tconstructor() {\n\n\t\t\tthis.name = EXTENSIONS.KHR_MESH_QUANTIZATION;\n\n\t\t}\n\n\t}\n\t/*********************************/\n\n\t/********** INTERPOLATION ********/\n\n\t/*********************************/\n\t// Spline Interpolation\n\t// Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#appendix-c-spline-interpolation\n\n\n\tclass GLTFCubicSplineInterpolant extends THREE.Interpolant {\n\n\t\tconstructor( parameterPositions, sampleValues, sampleSize, resultBuffer ) {\n\n\t\t\tsuper( parameterPositions, sampleValues, sampleSize, resultBuffer );\n\n\t\t}\n\n\t\tcopySampleValue_( index ) {\n\n\t\t\t// Copies a sample value to the result buffer. See description of glTF\n\t\t\t// CUBICSPLINE values layout in interpolate_() function below.\n\t\t\tconst result = this.resultBuffer,\n\t\t\t\tvalues = this.sampleValues,\n\t\t\t\tvalueSize = this.valueSize,\n\t\t\t\toffset = index * valueSize * 3 + valueSize;\n\n\t\t\tfor ( let i = 0; i !== valueSize; i ++ ) {\n\n\t\t\t\tresult[ i ] = values[ offset + i ];\n\n\t\t\t}\n\n\t\t\treturn result;\n\n\t\t}\n\n\t}\n\n\tGLTFCubicSplineInterpolant.prototype.beforeStart_ = GLTFCubicSplineInterpolant.prototype.copySampleValue_;\n\tGLTFCubicSplineInterpolant.prototype.afterEnd_ = GLTFCubicSplineInterpolant.prototype.copySampleValue_;\n\n\tGLTFCubicSplineInterpolant.prototype.interpolate_ = function ( i1, t0, t, t1 ) {\n\n\t\tconst result = this.resultBuffer;\n\t\tconst values = this.sampleValues;\n\t\tconst stride = this.valueSize;\n\t\tconst stride2 = stride * 2;\n\t\tconst stride3 = stride * 3;\n\t\tconst td = t1 - t0;\n\t\tconst p = ( t - t0 ) / td;\n\t\tconst pp = p * p;\n\t\tconst ppp = pp * p;\n\t\tconst offset1 = i1 * stride3;\n\t\tconst offset0 = offset1 - stride3;\n\t\tconst s2 = - 2 * ppp + 3 * pp;\n\t\tconst s3 = ppp - pp;\n\t\tconst s0 = 1 - s2;\n\t\tconst s1 = s3 - pp + p; // Layout of keyframe output values for CUBICSPLINE animations:\n\t\t// [ inTangent_1, splineVertex_1, outTangent_1, inTangent_2, splineVertex_2, ... ]\n\n\t\tfor ( let i = 0; i !== stride; i ++ ) {\n\n\t\t\tconst p0 = values[ offset0 + i + stride ]; // splineVertex_k\n\n\t\t\tconst m0 = values[ offset0 + i + stride2 ] * td; // outTangent_k * (t_k+1 - t_k)\n\n\t\t\tconst p1 = values[ offset1 + i + stride ]; // splineVertex_k+1\n\n\t\t\tconst m1 = values[ offset1 + i ] * td; // inTangent_k+1 * (t_k+1 - t_k)\n\n\t\t\tresult[ i ] = s0 * p0 + s1 * m0 + s2 * p1 + s3 * m1;\n\n\t\t}\n\n\t\treturn result;\n\n\t};\n\n\tconst _q = new THREE.Quaternion();\n\n\tclass GLTFCubicSplineQuaternionInterpolant extends GLTFCubicSplineInterpolant {\n\n\t\tinterpolate_( i1, t0, t, t1 ) {\n\n\t\t\tconst result = super.interpolate_( i1, t0, t, t1 );\n\n\t\t\t_q.fromArray( result ).normalize().toArray( result );\n\n\t\t\treturn result;\n\n\t\t}\n\n\t}\n\t/*********************************/\n\n\t/********** INTERNALS ************/\n\n\t/*********************************/\n\n\t/* CONSTANTS */\n\n\n\tconst WEBGL_CONSTANTS = {\n\t\tFLOAT: 5126,\n\t\t//FLOAT_MAT2: 35674,\n\t\tFLOAT_MAT3: 35675,\n\t\tFLOAT_MAT4: 35676,\n\t\tFLOAT_VEC2: 35664,\n\t\tFLOAT_VEC3: 35665,\n\t\tFLOAT_VEC4: 35666,\n\t\tLINEAR: 9729,\n\t\tREPEAT: 10497,\n\t\tSAMPLER_2D: 35678,\n\t\tPOINTS: 0,\n\t\tLINES: 1,\n\t\tLINE_LOOP: 2,\n\t\tLINE_STRIP: 3,\n\t\tTRIANGLES: 4,\n\t\tTRIANGLE_STRIP: 5,\n\t\tTRIANGLE_FAN: 6,\n\t\tUNSIGNED_BYTE: 5121,\n\t\tUNSIGNED_SHORT: 5123\n\t};\n\tconst WEBGL_COMPONENT_TYPES = {\n\t\t5120: Int8Array,\n\t\t5121: Uint8Array,\n\t\t5122: Int16Array,\n\t\t5123: Uint16Array,\n\t\t5125: Uint32Array,\n\t\t5126: Float32Array\n\t};\n\tconst WEBGL_FILTERS = {\n\t\t9728: THREE.NearestFilter,\n\t\t9729: THREE.LinearFilter,\n\t\t9984: THREE.NearestMipmapNearestFilter,\n\t\t9985: THREE.LinearMipmapNearestFilter,\n\t\t9986: THREE.NearestMipmapLinearFilter,\n\t\t9987: THREE.LinearMipmapLinearFilter\n\t};\n\tconst WEBGL_WRAPPINGS = {\n\t\t33071: THREE.ClampToEdgeWrapping,\n\t\t33648: THREE.MirroredRepeatWrapping,\n\t\t10497: THREE.RepeatWrapping\n\t};\n\tconst WEBGL_TYPE_SIZES = {\n\t\t'SCALAR': 1,\n\t\t'VEC2': 2,\n\t\t'VEC3': 3,\n\t\t'VEC4': 4,\n\t\t'MAT2': 4,\n\t\t'MAT3': 9,\n\t\t'MAT4': 16\n\t};\n\tconst ATTRIBUTES = {\n\t\tPOSITION: 'position',\n\t\tNORMAL: 'normal',\n\t\tTANGENT: 'tangent',\n\t\tTEXCOORD_0: 'uv',\n\t\tTEXCOORD_1: 'uv2',\n\t\tCOLOR_0: 'color',\n\t\tWEIGHTS_0: 'skinWeight',\n\t\tJOINTS_0: 'skinIndex'\n\t};\n\tconst PATH_PROPERTIES = {\n\t\tscale: 'scale',\n\t\ttranslation: 'position',\n\t\trotation: 'quaternion',\n\t\tweights: 'morphTargetInfluences'\n\t};\n\tconst INTERPOLATION = {\n\t\tCUBICSPLINE: undefined,\n\t\t// We use a custom interpolant (GLTFCubicSplineInterpolation) for CUBICSPLINE tracks. Each\n\t\t// keyframe track will be initialized with a default interpolation type, then modified.\n\t\tLINEAR: THREE.InterpolateLinear,\n\t\tSTEP: THREE.InterpolateDiscrete\n\t};\n\tconst ALPHA_MODES = {\n\t\tOPAQUE: 'OPAQUE',\n\t\tMASK: 'MASK',\n\t\tBLEND: 'BLEND'\n\t};\n\t/* UTILITY FUNCTIONS */\n\n\tfunction resolveURL( url, path ) {\n\n\t\t// Invalid URL\n\t\tif ( typeof url !== 'string' || url === '' ) return ''; // Host Relative URL\n\n\t\tif ( /^https?:\\/\\//i.test( path ) && /^\\//.test( url ) ) {\n\n\t\t\tpath = path.replace( /(^https?:\\/\\/[^\\/]+).*/i, '$1' );\n\n\t\t} // Absolute URL http://,https://,//\n\n\n\t\tif ( /^(https?:)?\\/\\//i.test( url ) ) return url; // Data URI\n\n\t\tif ( /^data:.*,.*$/i.test( url ) ) return url; // Blob URL\n\n\t\tif ( /^blob:.*$/i.test( url ) ) return url; // Relative URL\n\n\t\treturn path + url;\n\n\t}\n\t/**\n * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#default-material\n */\n\n\n\tfunction createDefaultMaterial( cache ) {\n\n\t\tif ( cache[ 'DefaultMaterial' ] === undefined ) {\n\n\t\t\tcache[ 'DefaultMaterial' ] = new THREE.MeshStandardMaterial( {\n\t\t\t\tcolor: 0xFFFFFF,\n\t\t\t\temissive: 0x000000,\n\t\t\t\tmetalness: 1,\n\t\t\t\troughness: 1,\n\t\t\t\ttransparent: false,\n\t\t\t\tdepthTest: true,\n\t\t\t\tside: THREE.FrontSide\n\t\t\t} );\n\n\t\t}\n\n\t\treturn cache[ 'DefaultMaterial' ];\n\n\t}\n\n\tfunction addUnknownExtensionsToUserData( knownExtensions, object, objectDef ) {\n\n\t\t// Add unknown glTF extensions to an object's userData.\n\t\tfor ( const name in objectDef.extensions ) {\n\n\t\t\tif ( knownExtensions[ name ] === undefined ) {\n\n\t\t\t\tobject.userData.gltfExtensions = object.userData.gltfExtensions || {};\n\t\t\t\tobject.userData.gltfExtensions[ name ] = objectDef.extensions[ name ];\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\t/**\n * @param {Object3D|Material|BufferGeometry} object\n * @param {GLTF.definition} gltfDef\n */\n\n\n\tfunction assignExtrasToUserData( object, gltfDef ) {\n\n\t\tif ( gltfDef.extras !== undefined ) {\n\n\t\t\tif ( typeof gltfDef.extras === 'object' ) {\n\n\t\t\t\tObject.assign( object.userData, gltfDef.extras );\n\n\t\t\t} else {\n\n\t\t\t\tconsole.warn( 'THREE.GLTFLoader: Ignoring primitive type .extras, ' + gltfDef.extras );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\t/**\n * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#morph-targets\n *\n * @param {BufferGeometry} geometry\n * @param {Array<GLTF.Target>} targets\n * @param {GLTFParser} parser\n * @return {Promise<BufferGeometry>}\n */\n\n\n\tfunction addMorphTargets( geometry, targets, parser ) {\n\n\t\tlet hasMorphPosition = false;\n\t\tlet hasMorphNormal = false;\n\n\t\tfor ( let i = 0, il = targets.length; i < il; i ++ ) {\n\n\t\t\tconst target = targets[ i ];\n\t\t\tif ( target.POSITION !== undefined ) hasMorphPosition = true;\n\t\t\tif ( target.NORMAL !== undefined ) hasMorphNormal = true;\n\t\t\tif ( hasMorphPosition && hasMorphNormal ) break;\n\n\t\t}\n\n\t\tif ( ! hasMorphPosition && ! hasMorphNormal ) return Promise.resolve( geometry );\n\t\tconst pendingPositionAccessors = [];\n\t\tconst pendingNormalAccessors = [];\n\n\t\tfor ( let i = 0, il = targets.length; i < il; i ++ ) {\n\n\t\t\tconst target = targets[ i ];\n\n\t\t\tif ( hasMorphPosition ) {\n\n\t\t\t\tconst pendingAccessor = target.POSITION !== undefined ? parser.getDependency( 'accessor', target.POSITION ) : geometry.attributes.position;\n\t\t\t\tpendingPositionAccessors.push( pendingAccessor );\n\n\t\t\t}\n\n\t\t\tif ( hasMorphNormal ) {\n\n\t\t\t\tconst pendingAccessor = target.NORMAL !== undefined ? parser.getDependency( 'accessor', target.NORMAL ) : geometry.attributes.normal;\n\t\t\t\tpendingNormalAccessors.push( pendingAccessor );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn Promise.all( [ Promise.all( pendingPositionAccessors ), Promise.all( pendingNormalAccessors ) ] ).then( function ( accessors ) {\n\n\t\t\tconst morphPositions = accessors[ 0 ];\n\t\t\tconst morphNormals = accessors[ 1 ];\n\t\t\tif ( hasMorphPosition ) geometry.morphAttributes.position = morphPositions;\n\t\t\tif ( hasMorphNormal ) geometry.morphAttributes.normal = morphNormals;\n\t\t\tgeometry.morphTargetsRelative = true;\n\t\t\treturn geometry;\n\n\t\t} );\n\n\t}\n\t/**\n * @param {Mesh} mesh\n * @param {GLTF.Mesh} meshDef\n */\n\n\n\tfunction updateMorphTargets( mesh, meshDef ) {\n\n\t\tmesh.updateMorphTargets();\n\n\t\tif ( meshDef.weights !== undefined ) {\n\n\t\t\tfor ( let i = 0, il = meshDef.weights.length; i < il; i ++ ) {\n\n\t\t\t\tmesh.morphTargetInfluences[ i ] = meshDef.weights[ i ];\n\n\t\t\t}\n\n\t\t} // .extras has user-defined data, so check that .extras.targetNames is an array.\n\n\n\t\tif ( meshDef.extras && Array.isArray( meshDef.extras.targetNames ) ) {\n\n\t\t\tconst targetNames = meshDef.extras.targetNames;\n\n\t\t\tif ( mesh.morphTargetInfluences.length === targetNames.length ) {\n\n\t\t\t\tmesh.morphTargetDictionary = {};\n\n\t\t\t\tfor ( let i = 0, il = targetNames.length; i < il; i ++ ) {\n\n\t\t\t\t\tmesh.morphTargetDictionary[ targetNames[ i ] ] = i;\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tconsole.warn( 'THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.' );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tfunction createPrimitiveKey( primitiveDef ) {\n\n\t\tconst dracoExtension = primitiveDef.extensions && primitiveDef.extensions[ EXTENSIONS.KHR_DRACO_MESH_COMPRESSION ];\n\t\tlet geometryKey;\n\n\t\tif ( dracoExtension ) {\n\n\t\t\tgeometryKey = 'draco:' + dracoExtension.bufferView + ':' + dracoExtension.indices + ':' + createAttributesKey( dracoExtension.attributes );\n\n\t\t} else {\n\n\t\t\tgeometryKey = primitiveDef.indices + ':' + createAttributesKey( primitiveDef.attributes ) + ':' + primitiveDef.mode;\n\n\t\t}\n\n\t\treturn geometryKey;\n\n\t}\n\n\tfunction createAttributesKey( attributes ) {\n\n\t\tlet attributesKey = '';\n\t\tconst keys = Object.keys( attributes ).sort();\n\n\t\tfor ( let i = 0, il = keys.length; i < il; i ++ ) {\n\n\t\t\tattributesKey += keys[ i ] + ':' + attributes[ keys[ i ] ] + ';';\n\n\t\t}\n\n\t\treturn attributesKey;\n\n\t}\n\n\tfunction getNormalizedComponentScale( constructor ) {\n\n\t\t// Reference:\n\t\t// https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_mesh_quantization#encoding-quantized-data\n\t\tswitch ( constructor ) {\n\n\t\t\tcase Int8Array:\n\t\t\t\treturn 1 / 127;\n\n\t\t\tcase Uint8Array:\n\t\t\t\treturn 1 / 255;\n\n\t\t\tcase Int16Array:\n\t\t\t\treturn 1 / 32767;\n\n\t\t\tcase Uint16Array:\n\t\t\t\treturn 1 / 65535;\n\n\t\t\tdefault:\n\t\t\t\tthrow new Error( 'THREE.GLTFLoader: Unsupported normalized accessor component type.' );\n\n\t\t}\n\n\t}\n\t/* GLTF PARSER */\n\n\n\tclass GLTFParser {\n\n\t\tconstructor( json = {}, options = {} ) {\n\n\t\t\tthis.json = json;\n\t\t\tthis.extensions = {};\n\t\t\tthis.plugins = {};\n\t\t\tthis.options = options; // loader object cache\n\n\t\t\tthis.cache = new GLTFRegistry(); // associations between Three.js objects and glTF elements\n\n\t\t\tthis.associations = new Map(); // THREE.BufferGeometry caching\n\n\t\t\tthis.primitiveCache = {}; // THREE.Object3D instance caches\n\n\t\t\tthis.meshCache = {\n\t\t\t\trefs: {},\n\t\t\t\tuses: {}\n\t\t\t};\n\t\t\tthis.cameraCache = {\n\t\t\t\trefs: {},\n\t\t\t\tuses: {}\n\t\t\t};\n\t\t\tthis.lightCache = {\n\t\t\t\trefs: {},\n\t\t\t\tuses: {}\n\t\t\t};\n\t\t\tthis.textureCache = {}; // Track node names, to ensure no duplicates\n\n\t\t\tthis.nodeNamesUsed = {}; // Use an THREE.ImageBitmapLoader if imageBitmaps are supported. Moves much of the\n\t\t\t// expensive work of uploading a texture to the GPU off the main thread.\n\n\t\t\tif ( typeof createImageBitmap !== 'undefined' && /Firefox/.test( navigator.userAgent ) === false ) {\n\n\t\t\t\tthis.textureLoader = new THREE.ImageBitmapLoader( this.options.manager );\n\n\t\t\t} else {\n\n\t\t\t\tthis.textureLoader = new THREE.TextureLoader( this.options.manager );\n\n\t\t\t}\n\n\t\t\tthis.textureLoader.setCrossOrigin( this.options.crossOrigin );\n\t\t\tthis.textureLoader.setRequestHeader( this.options.requestHeader );\n\t\t\tthis.fileLoader = new THREE.FileLoader( this.options.manager );\n\t\t\tthis.fileLoader.setResponseType( 'arraybuffer' );\n\n\t\t\tif ( this.options.crossOrigin === 'use-credentials' ) {\n\n\t\t\t\tthis.fileLoader.setWithCredentials( true );\n\n\t\t\t}\n\n\t\t}\n\n\t\tsetExtensions( extensions ) {\n\n\t\t\tthis.extensions = extensions;\n\n\t\t}\n\n\t\tsetPlugins( plugins ) {\n\n\t\t\tthis.plugins = plugins;\n\n\t\t}\n\n\t\tparse( onLoad, onError ) {\n\n\t\t\tconst parser = this;\n\t\t\tconst json = this.json;\n\t\t\tconst extensions = this.extensions; // Clear the loader cache\n\n\t\t\tthis.cache.removeAll(); // Mark the special nodes/meshes in json for efficient parse\n\n\t\t\tthis._invokeAll( function ( ext ) {\n\n\t\t\t\treturn ext._markDefs && ext._markDefs();\n\n\t\t\t} );\n\n\t\t\tPromise.all( this._invokeAll( function ( ext ) {\n\n\t\t\t\treturn ext.beforeRoot && ext.beforeRoot();\n\n\t\t\t} ) ).then( function () {\n\n\t\t\t\treturn Promise.all( [ parser.getDependencies( 'scene' ), parser.getDependencies( 'animation' ), parser.getDependencies( 'camera' ) ] );\n\n\t\t\t} ).then( function ( dependencies ) {\n\n\t\t\t\tconst result = {\n\t\t\t\t\tscene: dependencies[ 0 ][ json.scene || 0 ],\n\t\t\t\t\tscenes: dependencies[ 0 ],\n\t\t\t\t\tanimations: dependencies[ 1 ],\n\t\t\t\t\tcameras: dependencies[ 2 ],\n\t\t\t\t\tasset: json.asset,\n\t\t\t\t\tparser: parser,\n\t\t\t\t\tuserData: {}\n\t\t\t\t};\n\t\t\t\taddUnknownExtensionsToUserData( extensions, result, json );\n\t\t\t\tassignExtrasToUserData( result, json );\n\t\t\t\tPromise.all( parser._invokeAll( function ( ext ) {\n\n\t\t\t\t\treturn ext.afterRoot && ext.afterRoot( result );\n\n\t\t\t\t} ) ).then( function () {\n\n\t\t\t\t\tonLoad( result );\n\n\t\t\t\t} );\n\n\t\t\t} ).catch( onError );\n\n\t\t}\n\t\t/**\n * Marks the special nodes/meshes in json for efficient parse.\n */\n\n\n\t\t_markDefs() {\n\n\t\t\tconst nodeDefs = this.json.nodes || [];\n\t\t\tconst skinDefs = this.json.skins || [];\n\t\t\tconst meshDefs = this.json.meshes || []; // Nothing in the node definition indicates whether it is a THREE.Bone or an\n\t\t\t// THREE.Object3D. Use the skins' joint references to mark bones.\n\n\t\t\tfor ( let skinIndex = 0, skinLength = skinDefs.length; skinIndex < skinLength; skinIndex ++ ) {\n\n\t\t\t\tconst joints = skinDefs[ skinIndex ].joints;\n\n\t\t\t\tfor ( let i = 0, il = joints.length; i < il; i ++ ) {\n\n\t\t\t\t\tnodeDefs[ joints[ i ] ].isBone = true;\n\n\t\t\t\t}\n\n\t\t\t} // Iterate over all nodes, marking references to shared resources,\n\t\t\t// as well as skeleton joints.\n\n\n\t\t\tfor ( let nodeIndex = 0, nodeLength = nodeDefs.length; nodeIndex < nodeLength; nodeIndex ++ ) {\n\n\t\t\t\tconst nodeDef = nodeDefs[ nodeIndex ];\n\n\t\t\t\tif ( nodeDef.mesh !== undefined ) {\n\n\t\t\t\t\tthis._addNodeRef( this.meshCache, nodeDef.mesh ); // Nothing in the mesh definition indicates whether it is\n\t\t\t\t\t// a THREE.SkinnedMesh or THREE.Mesh. Use the node's mesh reference\n\t\t\t\t\t// to mark THREE.SkinnedMesh if node has skin.\n\n\n\t\t\t\t\tif ( nodeDef.skin !== undefined ) {\n\n\t\t\t\t\t\tmeshDefs[ nodeDef.mesh ].isSkinnedMesh = true;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ( nodeDef.camera !== undefined ) {\n\n\t\t\t\t\tthis._addNodeRef( this.cameraCache, nodeDef.camera );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\t\t/**\n * Counts references to shared node / THREE.Object3D resources. These resources\n * can be reused, or \"instantiated\", at multiple nodes in the scene\n * hierarchy. THREE.Mesh, Camera, and Light instances are instantiated and must\n * be marked. Non-scenegraph resources (like Materials, Geometries, and\n * Textures) can be reused directly and are not marked here.\n *\n * Example: CesiumMilkTruck sample model reuses \"Wheel\" meshes.\n */\n\n\n\t\t_addNodeRef( cache, index ) {\n\n\t\t\tif ( index === undefined ) return;\n\n\t\t\tif ( cache.refs[ index ] === undefined ) {\n\n\t\t\t\tcache.refs[ index ] = cache.uses[ index ] = 0;\n\n\t\t\t}\n\n\t\t\tcache.refs[ index ] ++;\n\n\t\t}\n\t\t/** Returns a reference to a shared resource, cloning it if necessary. */\n\n\n\t\t_getNodeRef( cache, index, object ) {\n\n\t\t\tif ( cache.refs[ index ] <= 1 ) return object;\n\t\t\tconst ref = object.clone(); // Propagates mappings to the cloned object, prevents mappings on the\n\t\t\t// original object from being lost.\n\n\t\t\tconst updateMappings = ( original, clone ) => {\n\n\t\t\t\tconst mappings = this.associations.get( original );\n\n\t\t\t\tif ( mappings != null ) {\n\n\t\t\t\t\tthis.associations.set( clone, mappings );\n\n\t\t\t\t}\n\n\t\t\t\tfor ( const [ i, child ] of original.children.entries() ) {\n\n\t\t\t\t\tupdateMappings( child, clone.children[ i ] );\n\n\t\t\t\t}\n\n\t\t\t};\n\n\t\t\tupdateMappings( object, ref );\n\t\t\tref.name += '_instance_' + cache.uses[ index ] ++;\n\t\t\treturn ref;\n\n\t\t}\n\n\t\t_invokeOne( func ) {\n\n\t\t\tconst extensions = Object.values( this.plugins );\n\t\t\textensions.push( this );\n\n\t\t\tfor ( let i = 0; i < extensions.length; i ++ ) {\n\n\t\t\t\tconst result = func( extensions[ i ] );\n\t\t\t\tif ( result ) return result;\n\n\t\t\t}\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\t_invokeAll( func ) {\n\n\t\t\tconst extensions = Object.values( this.plugins );\n\t\t\textensions.unshift( this );\n\t\t\tconst pending = [];\n\n\t\t\tfor ( let i = 0; i < extensions.length; i ++ ) {\n\n\t\t\t\tconst result = func( extensions[ i ] );\n\t\t\t\tif ( result ) pending.push( result );\n\n\t\t\t}\n\n\t\t\treturn pending;\n\n\t\t}\n\t\t/**\n * Requests the specified dependency asynchronously, with caching.\n * @param {string} type\n * @param {number} index\n * @return {Promise<Object3D|Material|THREE.Texture|AnimationClip|ArrayBuffer|Object>}\n */\n\n\n\t\tgetDependency( type, index ) {\n\n\t\t\tconst cacheKey = type + ':' + index;\n\t\t\tlet dependency = this.cache.get( cacheKey );\n\n\t\t\tif ( ! dependency ) {\n\n\t\t\t\tswitch ( type ) {\n\n\t\t\t\t\tcase 'scene':\n\t\t\t\t\t\tdependency = this.loadScene( index );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'node':\n\t\t\t\t\t\tdependency = this.loadNode( index );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'mesh':\n\t\t\t\t\t\tdependency = this._invokeOne( function ( ext ) {\n\n\t\t\t\t\t\t\treturn ext.loadMesh && ext.loadMesh( index );\n\n\t\t\t\t\t\t} );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'accessor':\n\t\t\t\t\t\tdependency = this.loadAccessor( index );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'bufferView':\n\t\t\t\t\t\tdependency = this._invokeOne( function ( ext ) {\n\n\t\t\t\t\t\t\treturn ext.loadBufferView && ext.loadBufferView( index );\n\n\t\t\t\t\t\t} );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'buffer':\n\t\t\t\t\t\tdependency = this.loadBuffer( index );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'material':\n\t\t\t\t\t\tdependency = this._invokeOne( function ( ext ) {\n\n\t\t\t\t\t\t\treturn ext.loadMaterial && ext.loadMaterial( index );\n\n\t\t\t\t\t\t} );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'texture':\n\t\t\t\t\t\tdependency = this._invokeOne( function ( ext ) {\n\n\t\t\t\t\t\t\treturn ext.loadTexture && ext.loadTexture( index );\n\n\t\t\t\t\t\t} );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'skin':\n\t\t\t\t\t\tdependency = this.loadSkin( index );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'animation':\n\t\t\t\t\t\tdependency = this.loadAnimation( index );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'camera':\n\t\t\t\t\t\tdependency = this.loadCamera( index );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tthrow new Error( 'Unknown type: ' + type );\n\n\t\t\t\t}\n\n\t\t\t\tthis.cache.add( cacheKey, dependency );\n\n\t\t\t}\n\n\t\t\treturn dependency;\n\n\t\t}\n\t\t/**\n * Requests all dependencies of the specified type asynchronously, with caching.\n * @param {string} type\n * @return {Promise<Array<Object>>}\n */\n\n\n\t\tgetDependencies( type ) {\n\n\t\t\tlet dependencies = this.cache.get( type );\n\n\t\t\tif ( ! dependencies ) {\n\n\t\t\t\tconst parser = this;\n\t\t\t\tconst defs = this.json[ type + ( type === 'mesh' ? 'es' : 's' ) ] || [];\n\t\t\t\tdependencies = Promise.all( defs.map( function ( def, index ) {\n\n\t\t\t\t\treturn parser.getDependency( type, index );\n\n\t\t\t\t} ) );\n\t\t\t\tthis.cache.add( type, dependencies );\n\n\t\t\t}\n\n\t\t\treturn dependencies;\n\n\t\t}\n\t\t/**\n * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#buffers-and-buffer-views\n * @param {number} bufferIndex\n * @return {Promise<ArrayBuffer>}\n */\n\n\n\t\tloadBuffer( bufferIndex ) {\n\n\t\t\tconst bufferDef = this.json.buffers[ bufferIndex ];\n\t\t\tconst loader = this.fileLoader;\n\n\t\t\tif ( bufferDef.type && bufferDef.type !== 'arraybuffer' ) {\n\n\t\t\t\tthrow new Error( 'THREE.GLTFLoader: ' + bufferDef.type + ' buffer type is not supported.' );\n\n\t\t\t} // If present, GLB container is required to be the first buffer.\n\n\n\t\t\tif ( bufferDef.uri === undefined && bufferIndex === 0 ) {\n\n\t\t\t\treturn Promise.resolve( this.extensions[ EXTENSIONS.KHR_BINARY_GLTF ].body );\n\n\t\t\t}\n\n\t\t\tconst options = this.options;\n\t\t\treturn new Promise( function ( resolve, reject ) {\n\n\t\t\t\tloader.load( resolveURL( bufferDef.uri, options.path ), resolve, undefined, function () {\n\n\t\t\t\t\treject( new Error( 'THREE.GLTFLoader: Failed to load buffer \"' + bufferDef.uri + '\".' ) );\n\n\t\t\t\t} );\n\n\t\t\t} );\n\n\t\t}\n\t\t/**\n * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#buffers-and-buffer-views\n * @param {number} bufferViewIndex\n * @return {Promise<ArrayBuffer>}\n */\n\n\n\t\tloadBufferView( bufferViewIndex ) {\n\n\t\t\tconst bufferViewDef = this.json.bufferViews[ bufferViewIndex ];\n\t\t\treturn this.getDependency( 'buffer', bufferViewDef.buffer ).then( function ( buffer ) {\n\n\t\t\t\tconst byteLength = bufferViewDef.byteLength || 0;\n\t\t\t\tconst byteOffset = bufferViewDef.byteOffset || 0;\n\t\t\t\treturn buffer.slice( byteOffset, byteOffset + byteLength );\n\n\t\t\t} );\n\n\t\t}\n\t\t/**\n * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#accessors\n * @param {number} accessorIndex\n * @return {Promise<BufferAttribute|InterleavedBufferAttribute>}\n */\n\n\n\t\tloadAccessor( accessorIndex ) {\n\n\t\t\tconst parser = this;\n\t\t\tconst json = this.json;\n\t\t\tconst accessorDef = this.json.accessors[ accessorIndex ];\n\n\t\t\tif ( accessorDef.bufferView === undefined && accessorDef.sparse === undefined ) {\n\n\t\t\t\t// Ignore empty accessors, which may be used to declare runtime\n\t\t\t\t// information about attributes coming from another source (e.g. Draco\n\t\t\t\t// compression extension).\n\t\t\t\treturn Promise.resolve( null );\n\n\t\t\t}\n\n\t\t\tconst pendingBufferViews = [];\n\n\t\t\tif ( accessorDef.bufferView !== undefined ) {\n\n\t\t\t\tpendingBufferViews.push( this.getDependency( 'bufferView', accessorDef.bufferView ) );\n\n\t\t\t} else {\n\n\t\t\t\tpendingBufferViews.push( null );\n\n\t\t\t}\n\n\t\t\tif ( accessorDef.sparse !== undefined ) {\n\n\t\t\t\tpendingBufferViews.push( this.getDependency( 'bufferView', accessorDef.sparse.indices.bufferView ) );\n\t\t\t\tpendingBufferViews.push( this.getDependency( 'bufferView', accessorDef.sparse.values.bufferView ) );\n\n\t\t\t}\n\n\t\t\treturn Promise.all( pendingBufferViews ).then( function ( bufferViews ) {\n\n\t\t\t\tconst bufferView = bufferViews[ 0 ];\n\t\t\t\tconst itemSize = WEBGL_TYPE_SIZES[ accessorDef.type ];\n\t\t\t\tconst TypedArray = WEBGL_COMPONENT_TYPES[ accessorDef.componentType ]; // For VEC3: itemSize is 3, elementBytes is 4, itemBytes is 12.\n\n\t\t\t\tconst elementBytes = TypedArray.BYTES_PER_ELEMENT;\n\t\t\t\tconst itemBytes = elementBytes * itemSize;\n\t\t\t\tconst byteOffset = accessorDef.byteOffset || 0;\n\t\t\t\tconst byteStride = accessorDef.bufferView !== undefined ? json.bufferViews[ accessorDef.bufferView ].byteStride : undefined;\n\t\t\t\tconst normalized = accessorDef.normalized === true;\n\t\t\t\tlet array, bufferAttribute; // The buffer is not interleaved if the stride is the item size in bytes.\n\n\t\t\t\tif ( byteStride && byteStride !== itemBytes ) {\n\n\t\t\t\t\t// Each \"slice\" of the buffer, as defined by 'count' elements of 'byteStride' bytes, gets its own THREE.InterleavedBuffer\n\t\t\t\t\t// This makes sure that IBA.count reflects accessor.count properly\n\t\t\t\t\tconst ibSlice = Math.floor( byteOffset / byteStride );\n\t\t\t\t\tconst ibCacheKey = 'InterleavedBuffer:' + accessorDef.bufferView + ':' + accessorDef.componentType + ':' + ibSlice + ':' + accessorDef.count;\n\t\t\t\t\tlet ib = parser.cache.get( ibCacheKey );\n\n\t\t\t\t\tif ( ! ib ) {\n\n\t\t\t\t\t\tarray = new TypedArray( bufferView, ibSlice * byteStride, accessorDef.count * byteStride / elementBytes ); // Integer parameters to IB/IBA are in array elements, not bytes.\n\n\t\t\t\t\t\tib = new THREE.InterleavedBuffer( array, byteStride / elementBytes );\n\t\t\t\t\t\tparser.cache.add( ibCacheKey, ib );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbufferAttribute = new THREE.InterleavedBufferAttribute( ib, itemSize, byteOffset % byteStride / elementBytes, normalized );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tif ( bufferView === null ) {\n\n\t\t\t\t\t\tarray = new TypedArray( accessorDef.count * itemSize );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tarray = new TypedArray( bufferView, byteOffset, accessorDef.count * itemSize );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbufferAttribute = new THREE.BufferAttribute( array, itemSize, normalized );\n\n\t\t\t\t} // https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#sparse-accessors\n\n\n\t\t\t\tif ( accessorDef.sparse !== undefined ) {\n\n\t\t\t\t\tconst itemSizeIndices = WEBGL_TYPE_SIZES.SCALAR;\n\t\t\t\t\tconst TypedArrayIndices = WEBGL_COMPONENT_TYPES[ accessorDef.sparse.indices.componentType ];\n\t\t\t\t\tconst byteOffsetIndices = accessorDef.sparse.indices.byteOffset || 0;\n\t\t\t\t\tconst byteOffsetValues = accessorDef.sparse.values.byteOffset || 0;\n\t\t\t\t\tconst sparseIndices = new TypedArrayIndices( bufferViews[ 1 ], byteOffsetIndices, accessorDef.sparse.count * itemSizeIndices );\n\t\t\t\t\tconst sparseValues = new TypedArray( bufferViews[ 2 ], byteOffsetValues, accessorDef.sparse.count * itemSize );\n\n\t\t\t\t\tif ( bufferView !== null ) {\n\n\t\t\t\t\t\t// Avoid modifying the original ArrayBuffer, if the bufferView wasn't initialized with zeroes.\n\t\t\t\t\t\tbufferAttribute = new THREE.BufferAttribute( bufferAttribute.array.slice(), bufferAttribute.itemSize, bufferAttribute.normalized );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfor ( let i = 0, il = sparseIndices.length; i < il; i ++ ) {\n\n\t\t\t\t\t\tconst index = sparseIndices[ i ];\n\t\t\t\t\t\tbufferAttribute.setX( index, sparseValues[ i * itemSize ] );\n\t\t\t\t\t\tif ( itemSize >= 2 ) bufferAttribute.setY( index, sparseValues[ i * itemSize + 1 ] );\n\t\t\t\t\t\tif ( itemSize >= 3 ) bufferAttribute.setZ( index, sparseValues[ i * itemSize + 2 ] );\n\t\t\t\t\t\tif ( itemSize >= 4 ) bufferAttribute.setW( index, sparseValues[ i * itemSize + 3 ] );\n\t\t\t\t\t\tif ( itemSize >= 5 ) throw new Error( 'THREE.GLTFLoader: Unsupported itemSize in sparse THREE.BufferAttribute.' );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\treturn bufferAttribute;\n\n\t\t\t} );\n\n\t\t}\n\t\t/**\n * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#textures\n * @param {number} textureIndex\n * @return {Promise<THREE.Texture>}\n */\n\n\n\t\tloadTexture( textureIndex ) {\n\n\t\t\tconst json = this.json;\n\t\t\tconst options = this.options;\n\t\t\tconst textureDef = json.textures[ textureIndex ];\n\t\t\tconst source = json.images[ textureDef.source ];\n\t\t\tlet loader = this.textureLoader;\n\n\t\t\tif ( source.uri ) {\n\n\t\t\t\tconst handler = options.manager.getHandler( source.uri );\n\t\t\t\tif ( handler !== null ) loader = handler;\n\n\t\t\t}\n\n\t\t\treturn this.loadTextureImage( textureIndex, source, loader );\n\n\t\t}\n\n\t\tloadTextureImage( textureIndex, source, loader ) {\n\n\t\t\tconst parser = this;\n\t\t\tconst json = this.json;\n\t\t\tconst options = this.options;\n\t\t\tconst textureDef = json.textures[ textureIndex ];\n\t\t\tconst cacheKey = ( source.uri || source.bufferView ) + ':' + textureDef.sampler;\n\n\t\t\tif ( this.textureCache[ cacheKey ] ) {\n\n\t\t\t\t// See https://github.com/mrdoob/three.js/issues/21559.\n\t\t\t\treturn this.textureCache[ cacheKey ];\n\n\t\t\t}\n\n\t\t\tconst URL = self.URL || self.webkitURL;\n\t\t\tlet sourceURI = source.uri || '';\n\t\t\tlet isObjectURL = false;\n\n\t\t\tif ( source.bufferView !== undefined ) {\n\n\t\t\t\t// Load binary image data from bufferView, if provided.\n\t\t\t\tsourceURI = parser.getDependency( 'bufferView', source.bufferView ).then( function ( bufferView ) {\n\n\t\t\t\t\tisObjectURL = true;\n\t\t\t\t\tconst blob = new Blob( [ bufferView ], {\n\t\t\t\t\t\ttype: source.mimeType\n\t\t\t\t\t} );\n\t\t\t\t\tsourceURI = URL.createObjectURL( blob );\n\t\t\t\t\treturn sourceURI;\n\n\t\t\t\t} );\n\n\t\t\t} else if ( source.uri === undefined ) {\n\n\t\t\t\tthrow new Error( 'THREE.GLTFLoader: Image ' + textureIndex + ' is missing URI and bufferView' );\n\n\t\t\t}\n\n\t\t\tconst promise = Promise.resolve( sourceURI ).then( function ( sourceURI ) {\n\n\t\t\t\treturn new Promise( function ( resolve, reject ) {\n\n\t\t\t\t\tlet onLoad = resolve;\n\n\t\t\t\t\tif ( loader.isImageBitmapLoader === true ) {\n\n\t\t\t\t\t\tonLoad = function ( imageBitmap ) {\n\n\t\t\t\t\t\t\tconst texture = new THREE.Texture( imageBitmap );\n\t\t\t\t\t\t\ttexture.needsUpdate = true;\n\t\t\t\t\t\t\tresolve( texture );\n\n\t\t\t\t\t\t};\n\n\t\t\t\t\t}\n\n\t\t\t\t\tloader.load( resolveURL( sourceURI, options.path ), onLoad, undefined, reject );\n\n\t\t\t\t} );\n\n\t\t\t} ).then( function ( texture ) {\n\n\t\t\t\t// Clean up resources and configure THREE.Texture.\n\t\t\t\tif ( isObjectURL === true ) {\n\n\t\t\t\t\tURL.revokeObjectURL( sourceURI );\n\n\t\t\t\t}\n\n\t\t\t\ttexture.flipY = false;\n\t\t\t\tif ( textureDef.name ) texture.name = textureDef.name;\n\t\t\t\tconst samplers = json.samplers || {};\n\t\t\t\tconst sampler = samplers[ textureDef.sampler ] || {};\n\t\t\t\ttexture.magFilter = WEBGL_FILTERS[ sampler.magFilter ] || THREE.LinearFilter;\n\t\t\t\ttexture.minFilter = WEBGL_FILTERS[ sampler.minFilter ] || THREE.LinearMipmapLinearFilter;\n\t\t\t\ttexture.wrapS = WEBGL_WRAPPINGS[ sampler.wrapS ] || THREE.RepeatWrapping;\n\t\t\t\ttexture.wrapT = WEBGL_WRAPPINGS[ sampler.wrapT ] || THREE.RepeatWrapping;\n\t\t\t\tparser.associations.set( texture, {\n\t\t\t\t\ttextures: textureIndex\n\t\t\t\t} );\n\t\t\t\treturn texture;\n\n\t\t\t} ).catch( function () {\n\n\t\t\t\tconsole.error( 'THREE.GLTFLoader: Couldn\\'t load texture', sourceURI );\n\t\t\t\treturn null;\n\n\t\t\t} );\n\t\t\tthis.textureCache[ cacheKey ] = promise;\n\t\t\treturn promise;\n\n\t\t}\n\t\t/**\n * Asynchronously assigns a texture to the given material parameters.\n * @param {Object} materialParams\n * @param {string} mapName\n * @param {Object} mapDef\n * @return {Promise<Texture>}\n */\n\n\n\t\tassignTexture( materialParams, mapName, mapDef ) {\n\n\t\t\tconst parser = this;\n\t\t\treturn this.getDependency( 'texture', mapDef.index ).then( function ( texture ) {\n\n\t\t\t\t// Materials sample aoMap from UV set 1 and other maps from UV set 0 - this can't be configured\n\t\t\t\t// However, we will copy UV set 0 to UV set 1 on demand for aoMap\n\t\t\t\tif ( mapDef.texCoord !== undefined && mapDef.texCoord != 0 && ! ( mapName === 'aoMap' && mapDef.texCoord == 1 ) ) {\n\n\t\t\t\t\tconsole.warn( 'THREE.GLTFLoader: Custom UV set ' + mapDef.texCoord + ' for texture ' + mapName + ' not yet supported.' );\n\n\t\t\t\t}\n\n\t\t\t\tif ( parser.extensions[ EXTENSIONS.KHR_TEXTURE_TRANSFORM ] ) {\n\n\t\t\t\t\tconst transform = mapDef.extensions !== undefined ? mapDef.extensions[ EXTENSIONS.KHR_TEXTURE_TRANSFORM ] : undefined;\n\n\t\t\t\t\tif ( transform ) {\n\n\t\t\t\t\t\tconst gltfReference = parser.associations.get( texture );\n\t\t\t\t\t\ttexture = parser.extensions[ EXTENSIONS.KHR_TEXTURE_TRANSFORM ].extendTexture( texture, transform );\n\t\t\t\t\t\tparser.associations.set( texture, gltfReference );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tmaterialParams[ mapName ] = texture;\n\t\t\t\treturn texture;\n\n\t\t\t} );\n\n\t\t}\n\t\t/**\n * Assigns final material to a THREE.Mesh, THREE.Line, or THREE.Points instance. The instance\n * already has a material (generated from the glTF material options alone)\n * but reuse of the same glTF material may require multiple threejs materials\n * to accommodate different primitive types, defines, etc. New materials will\n * be created if necessary, and reused from a cache.\n * @param {Object3D} mesh THREE.Mesh, THREE.Line, or THREE.Points instance.\n */\n\n\n\t\tassignFinalMaterial( mesh ) {\n\n\t\t\tconst geometry = mesh.geometry;\n\t\t\tlet material = mesh.material;\n\t\t\tconst useDerivativeTangents = geometry.attributes.tangent === undefined;\n\t\t\tconst useVertexColors = geometry.attributes.color !== undefined;\n\t\t\tconst useFlatShading = geometry.attributes.normal === undefined;\n\n\t\t\tif ( mesh.isPoints ) {\n\n\t\t\t\tconst cacheKey = 'PointsMaterial:' + material.uuid;\n\t\t\t\tlet pointsMaterial = this.cache.get( cacheKey );\n\n\t\t\t\tif ( ! pointsMaterial ) {\n\n\t\t\t\t\tpointsMaterial = new THREE.PointsMaterial();\n\t\t\t\t\tTHREE.Material.prototype.copy.call( pointsMaterial, material );\n\t\t\t\t\tpointsMaterial.color.copy( material.color );\n\t\t\t\t\tpointsMaterial.map = material.map;\n\t\t\t\t\tpointsMaterial.sizeAttenuation = false; // glTF spec says points should be 1px\n\n\t\t\t\t\tthis.cache.add( cacheKey, pointsMaterial );\n\n\t\t\t\t}\n\n\t\t\t\tmaterial = pointsMaterial;\n\n\t\t\t} else if ( mesh.isLine ) {\n\n\t\t\t\tconst cacheKey = 'LineBasicMaterial:' + material.uuid;\n\t\t\t\tlet lineMaterial = this.cache.get( cacheKey );\n\n\t\t\t\tif ( ! lineMaterial ) {\n\n\t\t\t\t\tlineMaterial = new THREE.LineBasicMaterial();\n\t\t\t\t\tTHREE.Material.prototype.copy.call( lineMaterial, material );\n\t\t\t\t\tlineMaterial.color.copy( material.color );\n\t\t\t\t\tthis.cache.add( cacheKey, lineMaterial );\n\n\t\t\t\t}\n\n\t\t\t\tmaterial = lineMaterial;\n\n\t\t\t} // Clone the material if it will be modified\n\n\n\t\t\tif ( useDerivativeTangents || useVertexColors || useFlatShading ) {\n\n\t\t\t\tlet cacheKey = 'ClonedMaterial:' + material.uuid + ':';\n\t\t\t\tif ( material.isGLTFSpecularGlossinessMaterial ) cacheKey += 'specular-glossiness:';\n\t\t\t\tif ( useDerivativeTangents ) cacheKey += 'derivative-tangents:';\n\t\t\t\tif ( useVertexColors ) cacheKey += 'vertex-colors:';\n\t\t\t\tif ( useFlatShading ) cacheKey += 'flat-shading:';\n\t\t\t\tlet cachedMaterial = this.cache.get( cacheKey );\n\n\t\t\t\tif ( ! cachedMaterial ) {\n\n\t\t\t\t\tcachedMaterial = material.clone();\n\t\t\t\t\tif ( useVertexColors ) cachedMaterial.vertexColors = true;\n\t\t\t\t\tif ( useFlatShading ) cachedMaterial.flatShading = true;\n\n\t\t\t\t\tif ( useDerivativeTangents ) {\n\n\t\t\t\t\t\t// https://github.com/mrdoob/three.js/issues/11438#issuecomment-507003995\n\t\t\t\t\t\tif ( cachedMaterial.normalScale ) cachedMaterial.normalScale.y *= - 1;\n\t\t\t\t\t\tif ( cachedMaterial.clearcoatNormalScale ) cachedMaterial.clearcoatNormalScale.y *= - 1;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.cache.add( cacheKey, cachedMaterial );\n\t\t\t\t\tthis.associations.set( cachedMaterial, this.associations.get( material ) );\n\n\t\t\t\t}\n\n\t\t\t\tmaterial = cachedMaterial;\n\n\t\t\t} // workarounds for mesh and geometry\n\n\n\t\t\tif ( material.aoMap && geometry.attributes.uv2 === undefined && geometry.attributes.uv !== undefined ) {\n\n\t\t\t\tgeometry.setAttribute( 'uv2', geometry.attributes.uv );\n\n\t\t\t}\n\n\t\t\tmesh.material = material;\n\n\t\t}\n\n\t\tgetMaterialType() {\n\n\t\t\treturn THREE.MeshStandardMaterial;\n\n\t\t}\n\t\t/**\n * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#materials\n * @param {number} materialIndex\n * @return {Promise<Material>}\n */\n\n\n\t\tloadMaterial( materialIndex ) {\n\n\t\t\tconst parser = this;\n\t\t\tconst json = this.json;\n\t\t\tconst extensions = this.extensions;\n\t\t\tconst materialDef = json.materials[ materialIndex ];\n\t\t\tlet materialType;\n\t\t\tconst materialParams = {};\n\t\t\tconst materialExtensions = materialDef.extensions || {};\n\t\t\tconst pending = [];\n\n\t\t\tif ( materialExtensions[ EXTENSIONS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS ] ) {\n\n\t\t\t\tconst sgExtension = extensions[ EXTENSIONS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS ];\n\t\t\t\tmaterialType = sgExtension.getMaterialType();\n\t\t\t\tpending.push( sgExtension.extendParams( materialParams, materialDef, parser ) );\n\n\t\t\t} else if ( materialExtensions[ EXTENSIONS.KHR_MATERIALS_UNLIT ] ) {\n\n\t\t\t\tconst kmuExtension = extensions[ EXTENSIONS.KHR_MATERIALS_UNLIT ];\n\t\t\t\tmaterialType = kmuExtension.getMaterialType();\n\t\t\t\tpending.push( kmuExtension.extendParams( materialParams, materialDef, parser ) );\n\n\t\t\t} else {\n\n\t\t\t\t// Specification:\n\t\t\t\t// https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#metallic-roughness-material\n\t\t\t\tconst metallicRoughness = materialDef.pbrMetallicRoughness || {};\n\t\t\t\tmaterialParams.color = new THREE.Color( 1.0, 1.0, 1.0 );\n\t\t\t\tmaterialParams.opacity = 1.0;\n\n\t\t\t\tif ( Array.isArray( metallicRoughness.baseColorFactor ) ) {\n\n\t\t\t\t\tconst array = metallicRoughness.baseColorFactor;\n\t\t\t\t\tmaterialParams.color.fromArray( array );\n\t\t\t\t\tmaterialParams.opacity = array[ 3 ];\n\n\t\t\t\t}\n\n\t\t\t\tif ( metallicRoughness.baseColorTexture !== undefined ) {\n\n\t\t\t\t\tpending.push( parser.assignTexture( materialParams, 'map', metallicRoughness.baseColorTexture ) );\n\n\t\t\t\t}\n\n\t\t\t\tmaterialParams.metalness = metallicRoughness.metallicFactor !== undefined ? metallicRoughness.metallicFactor : 1.0;\n\t\t\t\tmaterialParams.roughness = metallicRoughness.roughnessFactor !== undefined ? metallicRoughness.roughnessFactor : 1.0;\n\n\t\t\t\tif ( metallicRoughness.metallicRoughnessTexture !== undefined ) {\n\n\t\t\t\t\tpending.push( parser.assignTexture( materialParams, 'metalnessMap', metallicRoughness.metallicRoughnessTexture ) );\n\t\t\t\t\tpending.push( parser.assignTexture( materialParams, 'roughnessMap', metallicRoughness.metallicRoughnessTexture ) );\n\n\t\t\t\t}\n\n\t\t\t\tmaterialType = this._invokeOne( function ( ext ) {\n\n\t\t\t\t\treturn ext.getMaterialType && ext.getMaterialType( materialIndex );\n\n\t\t\t\t} );\n\t\t\t\tpending.push( Promise.all( this._invokeAll( function ( ext ) {\n\n\t\t\t\t\treturn ext.extendMaterialParams && ext.extendMaterialParams( materialIndex, materialParams );\n\n\t\t\t\t} ) ) );\n\n\t\t\t}\n\n\t\t\tif ( materialDef.doubleSided === true ) {\n\n\t\t\t\tmaterialParams.side = THREE.DoubleSide;\n\n\t\t\t}\n\n\t\t\tconst alphaMode = materialDef.alphaMode || ALPHA_MODES.OPAQUE;\n\n\t\t\tif ( alphaMode === ALPHA_MODES.BLEND ) {\n\n\t\t\t\tmaterialParams.transparent = true; // See: https://github.com/mrdoob/three.js/issues/17706\n\n\t\t\t\tmaterialParams.depthWrite = false;\n\n\t\t\t} else {\n\n\t\t\t\tmaterialParams.format = THREE.RGBFormat;\n\t\t\t\tmaterialParams.transparent = false;\n\n\t\t\t\tif ( alphaMode === ALPHA_MODES.MASK ) {\n\n\t\t\t\t\tmaterialParams.alphaTest = materialDef.alphaCutoff !== undefined ? materialDef.alphaCutoff : 0.5;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( materialDef.normalTexture !== undefined && materialType !== THREE.MeshBasicMaterial ) {\n\n\t\t\t\tpending.push( parser.assignTexture( materialParams, 'normalMap', materialDef.normalTexture ) );\n\t\t\t\tmaterialParams.normalScale = new THREE.Vector2( 1, 1 );\n\n\t\t\t\tif ( materialDef.normalTexture.scale !== undefined ) {\n\n\t\t\t\t\tconst scale = materialDef.normalTexture.scale;\n\t\t\t\t\tmaterialParams.normalScale.set( scale, scale );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( materialDef.occlusionTexture !== undefined && materialType !== THREE.MeshBasicMaterial ) {\n\n\t\t\t\tpending.push( parser.assignTexture( materialParams, 'aoMap', materialDef.occlusionTexture ) );\n\n\t\t\t\tif ( materialDef.occlusionTexture.strength !== undefined ) {\n\n\t\t\t\t\tmaterialParams.aoMapIntensity = materialDef.occlusionTexture.strength;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( materialDef.emissiveFactor !== undefined && materialType !== THREE.MeshBasicMaterial ) {\n\n\t\t\t\tmaterialParams.emissive = new THREE.Color().fromArray( materialDef.emissiveFactor );\n\n\t\t\t}\n\n\t\t\tif ( materialDef.emissiveTexture !== undefined && materialType !== THREE.MeshBasicMaterial ) {\n\n\t\t\t\tpending.push( parser.assignTexture( materialParams, 'emissiveMap', materialDef.emissiveTexture ) );\n\n\t\t\t}\n\n\t\t\treturn Promise.all( pending ).then( function () {\n\n\t\t\t\tlet material;\n\n\t\t\t\tif ( materialType === GLTFMeshStandardSGMaterial ) {\n\n\t\t\t\t\tmaterial = extensions[ EXTENSIONS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS ].createMaterial( materialParams );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tmaterial = new materialType( materialParams );\n\n\t\t\t\t}\n\n\t\t\t\tif ( materialDef.name ) material.name = materialDef.name; // baseColorTexture, emissiveTexture, and specularGlossinessTexture use sRGB encoding.\n\n\t\t\t\tif ( material.map ) material.map.encoding = THREE.sRGBEncoding;\n\t\t\t\tif ( material.emissiveMap ) material.emissiveMap.encoding = THREE.sRGBEncoding;\n\t\t\t\tassignExtrasToUserData( material, materialDef );\n\t\t\t\tparser.associations.set( material, {\n\t\t\t\t\tmaterials: materialIndex\n\t\t\t\t} );\n\t\t\t\tif ( materialDef.extensions ) addUnknownExtensionsToUserData( extensions, material, materialDef );\n\t\t\t\treturn material;\n\n\t\t\t} );\n\n\t\t}\n\t\t/** When THREE.Object3D instances are targeted by animation, they need unique names. */\n\n\n\t\tcreateUniqueName( originalName ) {\n\n\t\t\tconst sanitizedName = THREE.PropertyBinding.sanitizeNodeName( originalName || '' );\n\t\t\tlet name = sanitizedName;\n\n\t\t\tfor ( let i = 1; this.nodeNamesUsed[ name ]; ++ i ) {\n\n\t\t\t\tname = sanitizedName + '_' + i;\n\n\t\t\t}\n\n\t\t\tthis.nodeNamesUsed[ name ] = true;\n\t\t\treturn name;\n\n\t\t}\n\t\t/**\n * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#geometry\n *\n * Creates BufferGeometries from primitives.\n *\n * @param {Array<GLTF.Primitive>} primitives\n * @return {Promise<Array<BufferGeometry>>}\n */\n\n\n\t\tloadGeometries( primitives ) {\n\n\t\t\tconst parser = this;\n\t\t\tconst extensions = this.extensions;\n\t\t\tconst cache = this.primitiveCache;\n\n\t\t\tfunction createDracoPrimitive( primitive ) {\n\n\t\t\t\treturn extensions[ EXTENSIONS.KHR_DRACO_MESH_COMPRESSION ].decodePrimitive( primitive, parser ).then( function ( geometry ) {\n\n\t\t\t\t\treturn addPrimitiveAttributes( geometry, primitive, parser );\n\n\t\t\t\t} );\n\n\t\t\t}\n\n\t\t\tconst pending = [];\n\n\t\t\tfor ( let i = 0, il = primitives.length; i < il; i ++ ) {\n\n\t\t\t\tconst primitive = primitives[ i ];\n\t\t\t\tconst cacheKey = createPrimitiveKey( primitive ); // See if we've already created this geometry\n\n\t\t\t\tconst cached = cache[ cacheKey ];\n\n\t\t\t\tif ( cached ) {\n\n\t\t\t\t\t// Use the cached geometry if it exists\n\t\t\t\t\tpending.push( cached.promise );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tlet geometryPromise;\n\n\t\t\t\t\tif ( primitive.extensions && primitive.extensions[ EXTENSIONS.KHR_DRACO_MESH_COMPRESSION ] ) {\n\n\t\t\t\t\t\t// Use DRACO geometry if available\n\t\t\t\t\t\tgeometryPromise = createDracoPrimitive( primitive );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// Otherwise create a new geometry\n\t\t\t\t\t\tgeometryPromise = addPrimitiveAttributes( new THREE.BufferGeometry(), primitive, parser );\n\n\t\t\t\t\t} // Cache this geometry\n\n\n\t\t\t\t\tcache[ cacheKey ] = {\n\t\t\t\t\t\tprimitive: primitive,\n\t\t\t\t\t\tpromise: geometryPromise\n\t\t\t\t\t};\n\t\t\t\t\tpending.push( geometryPromise );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn Promise.all( pending );\n\n\t\t}\n\t\t/**\n * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#meshes\n * @param {number} meshIndex\n * @return {Promise<Group|Mesh|SkinnedMesh>}\n */\n\n\n\t\tloadMesh( meshIndex ) {\n\n\t\t\tconst parser = this;\n\t\t\tconst json = this.json;\n\t\t\tconst extensions = this.extensions;\n\t\t\tconst meshDef = json.meshes[ meshIndex ];\n\t\t\tconst primitives = meshDef.primitives;\n\t\t\tconst pending = [];\n\n\t\t\tfor ( let i = 0, il = primitives.length; i < il; i ++ ) {\n\n\t\t\t\tconst material = primitives[ i ].material === undefined ? createDefaultMaterial( this.cache ) : this.getDependency( 'material', primitives[ i ].material );\n\t\t\t\tpending.push( material );\n\n\t\t\t}\n\n\t\t\tpending.push( parser.loadGeometries( primitives ) );\n\t\t\treturn Promise.all( pending ).then( function ( results ) {\n\n\t\t\t\tconst materials = results.slice( 0, results.length - 1 );\n\t\t\t\tconst geometries = results[ results.length - 1 ];\n\t\t\t\tconst meshes = [];\n\n\t\t\t\tfor ( let i = 0, il = geometries.length; i < il; i ++ ) {\n\n\t\t\t\t\tconst geometry = geometries[ i ];\n\t\t\t\t\tconst primitive = primitives[ i ]; // 1. create THREE.Mesh\n\n\t\t\t\t\tlet mesh;\n\t\t\t\t\tconst material = materials[ i ];\n\n\t\t\t\t\tif ( primitive.mode === WEBGL_CONSTANTS.TRIANGLES || primitive.mode === WEBGL_CONSTANTS.TRIANGLE_STRIP || primitive.mode === WEBGL_CONSTANTS.TRIANGLE_FAN || primitive.mode === undefined ) {\n\n\t\t\t\t\t\t// .isSkinnedMesh isn't in glTF spec. See ._markDefs()\n\t\t\t\t\t\tmesh = meshDef.isSkinnedMesh === true ? new THREE.SkinnedMesh( geometry, material ) : new THREE.Mesh( geometry, material );\n\n\t\t\t\t\t\tif ( mesh.isSkinnedMesh === true && ! mesh.geometry.attributes.skinWeight.normalized ) {\n\n\t\t\t\t\t\t\t// we normalize floating point skin weight array to fix malformed assets (see #15319)\n\t\t\t\t\t\t\t// it's important to skip this for non-float32 data since normalizeSkinWeights assumes non-normalized inputs\n\t\t\t\t\t\t\tmesh.normalizeSkinWeights();\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( primitive.mode === WEBGL_CONSTANTS.TRIANGLE_STRIP ) {\n\n\t\t\t\t\t\t\tmesh.geometry = toTrianglesDrawMode( mesh.geometry, THREE.TriangleStripDrawMode );\n\n\t\t\t\t\t\t} else if ( primitive.mode === WEBGL_CONSTANTS.TRIANGLE_FAN ) {\n\n\t\t\t\t\t\t\tmesh.geometry = toTrianglesDrawMode( mesh.geometry, THREE.TriangleFanDrawMode );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else if ( primitive.mode === WEBGL_CONSTANTS.LINES ) {\n\n\t\t\t\t\t\tmesh = new THREE.LineSegments( geometry, material );\n\n\t\t\t\t\t} else if ( primitive.mode === WEBGL_CONSTANTS.LINE_STRIP ) {\n\n\t\t\t\t\t\tmesh = new THREE.Line( geometry, material );\n\n\t\t\t\t\t} else if ( primitive.mode === WEBGL_CONSTANTS.LINE_LOOP ) {\n\n\t\t\t\t\t\tmesh = new THREE.LineLoop( geometry, material );\n\n\t\t\t\t\t} else if ( primitive.mode === WEBGL_CONSTANTS.POINTS ) {\n\n\t\t\t\t\t\tmesh = new THREE.Points( geometry, material );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tthrow new Error( 'THREE.GLTFLoader: Primitive mode unsupported: ' + primitive.mode );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( Object.keys( mesh.geometry.morphAttributes ).length > 0 ) {\n\n\t\t\t\t\t\tupdateMorphTargets( mesh, meshDef );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tmesh.name = parser.createUniqueName( meshDef.name || 'mesh_' + meshIndex );\n\t\t\t\t\tassignExtrasToUserData( mesh, meshDef );\n\t\t\t\t\tif ( primitive.extensions ) addUnknownExtensionsToUserData( extensions, mesh, primitive );\n\t\t\t\t\tparser.assignFinalMaterial( mesh );\n\t\t\t\t\tmeshes.push( mesh );\n\n\t\t\t\t}\n\n\t\t\t\tfor ( let i = 0, il = meshes.length; i < il; i ++ ) {\n\n\t\t\t\t\tparser.associations.set( meshes[ i ], {\n\t\t\t\t\t\tmeshes: meshIndex,\n\t\t\t\t\t\tprimitives: i\n\t\t\t\t\t} );\n\n\t\t\t\t}\n\n\t\t\t\tif ( meshes.length === 1 ) {\n\n\t\t\t\t\treturn meshes[ 0 ];\n\n\t\t\t\t}\n\n\t\t\t\tconst group = new THREE.Group();\n\t\t\t\tparser.associations.set( group, {\n\t\t\t\t\tmeshes: meshIndex\n\t\t\t\t} );\n\n\t\t\t\tfor ( let i = 0, il = meshes.length; i < il; i ++ ) {\n\n\t\t\t\t\tgroup.add( meshes[ i ] );\n\n\t\t\t\t}\n\n\t\t\t\treturn group;\n\n\t\t\t} );\n\n\t\t}\n\t\t/**\n * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#cameras\n * @param {number} cameraIndex\n * @return {Promise<THREE.Camera>}\n */\n\n\n\t\tloadCamera( cameraIndex ) {\n\n\t\t\tlet camera;\n\t\t\tconst cameraDef = this.json.cameras[ cameraIndex ];\n\t\t\tconst params = cameraDef[ cameraDef.type ];\n\n\t\t\tif ( ! params ) {\n\n\t\t\t\tconsole.warn( 'THREE.GLTFLoader: Missing camera parameters.' );\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\tif ( cameraDef.type === 'perspective' ) {\n\n\t\t\t\tcamera = new THREE.PerspectiveCamera( THREE.MathUtils.radToDeg( params.yfov ), params.aspectRatio || 1, params.znear || 1, params.zfar || 2e6 );\n\n\t\t\t} else if ( cameraDef.type === 'orthographic' ) {\n\n\t\t\t\tcamera = new THREE.OrthographicCamera( - params.xmag, params.xmag, params.ymag, - params.ymag, params.znear, params.zfar );\n\n\t\t\t}\n\n\t\t\tif ( cameraDef.name ) camera.name = this.createUniqueName( cameraDef.name );\n\t\t\tassignExtrasToUserData( camera, cameraDef );\n\t\t\treturn Promise.resolve( camera );\n\n\t\t}\n\t\t/**\n * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins\n * @param {number} skinIndex\n * @return {Promise<Object>}\n */\n\n\n\t\tloadSkin( skinIndex ) {\n\n\t\t\tconst skinDef = this.json.skins[ skinIndex ];\n\t\t\tconst skinEntry = {\n\t\t\t\tjoints: skinDef.joints\n\t\t\t};\n\n\t\t\tif ( skinDef.inverseBindMatrices === undefined ) {\n\n\t\t\t\treturn Promise.resolve( skinEntry );\n\n\t\t\t}\n\n\t\t\treturn this.getDependency( 'accessor', skinDef.inverseBindMatrices ).then( function ( accessor ) {\n\n\t\t\t\tskinEntry.inverseBindMatrices = accessor;\n\t\t\t\treturn skinEntry;\n\n\t\t\t} );\n\n\t\t}\n\t\t/**\n * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#animations\n * @param {number} animationIndex\n * @return {Promise<AnimationClip>}\n */\n\n\n\t\tloadAnimation( animationIndex ) {\n\n\t\t\tconst json = this.json;\n\t\t\tconst animationDef = json.animations[ animationIndex ];\n\t\t\tconst pendingNodes = [];\n\t\t\tconst pendingInputAccessors = [];\n\t\t\tconst pendingOutputAccessors = [];\n\t\t\tconst pendingSamplers = [];\n\t\t\tconst pendingTargets = [];\n\n\t\t\tfor ( let i = 0, il = animationDef.channels.length; i < il; i ++ ) {\n\n\t\t\t\tconst channel = animationDef.channels[ i ];\n\t\t\t\tconst sampler = animationDef.samplers[ channel.sampler ];\n\t\t\t\tconst target = channel.target;\n\t\t\t\tconst name = target.node !== undefined ? target.node : target.id; // NOTE: target.id is deprecated.\n\n\t\t\t\tconst input = animationDef.parameters !== undefined ? animationDef.parameters[ sampler.input ] : sampler.input;\n\t\t\t\tconst output = animationDef.parameters !== undefined ? animationDef.parameters[ sampler.output ] : sampler.output;\n\t\t\t\tpendingNodes.push( this.getDependency( 'node', name ) );\n\t\t\t\tpendingInputAccessors.push( this.getDependency( 'accessor', input ) );\n\t\t\t\tpendingOutputAccessors.push( this.getDependency( 'accessor', output ) );\n\t\t\t\tpendingSamplers.push( sampler );\n\t\t\t\tpendingTargets.push( target );\n\n\t\t\t}\n\n\t\t\treturn Promise.all( [ Promise.all( pendingNodes ), Promise.all( pendingInputAccessors ), Promise.all( pendingOutputAccessors ), Promise.all( pendingSamplers ), Promise.all( pendingTargets ) ] ).then( function ( dependencies ) {\n\n\t\t\t\tconst nodes = dependencies[ 0 ];\n\t\t\t\tconst inputAccessors = dependencies[ 1 ];\n\t\t\t\tconst outputAccessors = dependencies[ 2 ];\n\t\t\t\tconst samplers = dependencies[ 3 ];\n\t\t\t\tconst targets = dependencies[ 4 ];\n\t\t\t\tconst tracks = [];\n\n\t\t\t\tfor ( let i = 0, il = nodes.length; i < il; i ++ ) {\n\n\t\t\t\t\tconst node = nodes[ i ];\n\t\t\t\t\tconst inputAccessor = inputAccessors[ i ];\n\t\t\t\t\tconst outputAccessor = outputAccessors[ i ];\n\t\t\t\t\tconst sampler = samplers[ i ];\n\t\t\t\t\tconst target = targets[ i ];\n\t\t\t\t\tif ( node === undefined ) continue;\n\t\t\t\t\tnode.updateMatrix();\n\t\t\t\t\tnode.matrixAutoUpdate = true;\n\t\t\t\t\tlet TypedKeyframeTrack;\n\n\t\t\t\t\tswitch ( PATH_PROPERTIES[ target.path ] ) {\n\n\t\t\t\t\t\tcase PATH_PROPERTIES.weights:\n\t\t\t\t\t\t\tTypedKeyframeTrack = THREE.NumberKeyframeTrack;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase PATH_PROPERTIES.rotation:\n\t\t\t\t\t\t\tTypedKeyframeTrack = THREE.QuaternionKeyframeTrack;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase PATH_PROPERTIES.position:\n\t\t\t\t\t\tcase PATH_PROPERTIES.scale:\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tTypedKeyframeTrack = THREE.VectorKeyframeTrack;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tconst targetName = node.name ? node.name : node.uuid;\n\t\t\t\t\tconst interpolation = sampler.interpolation !== undefined ? INTERPOLATION[ sampler.interpolation ] : THREE.InterpolateLinear;\n\t\t\t\t\tconst targetNames = [];\n\n\t\t\t\t\tif ( PATH_PROPERTIES[ target.path ] === PATH_PROPERTIES.weights ) {\n\n\t\t\t\t\t\t// Node may be a THREE.Group (glTF mesh with several primitives) or a THREE.Mesh.\n\t\t\t\t\t\tnode.traverse( function ( object ) {\n\n\t\t\t\t\t\t\tif ( object.isMesh === true && object.morphTargetInfluences ) {\n\n\t\t\t\t\t\t\t\ttargetNames.push( object.name ? object.name : object.uuid );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\ttargetNames.push( targetName );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tlet outputArray = outputAccessor.array;\n\n\t\t\t\t\tif ( outputAccessor.normalized ) {\n\n\t\t\t\t\t\tconst scale = getNormalizedComponentScale( outputArray.constructor );\n\t\t\t\t\t\tconst scaled = new Float32Array( outputArray.length );\n\n\t\t\t\t\t\tfor ( let j = 0, jl = outputArray.length; j < jl; j ++ ) {\n\n\t\t\t\t\t\t\tscaled[ j ] = outputArray[ j ] * scale;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\toutputArray = scaled;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfor ( let j = 0, jl = targetNames.length; j < jl; j ++ ) {\n\n\t\t\t\t\t\tconst track = new TypedKeyframeTrack( targetNames[ j ] + '.' + PATH_PROPERTIES[ target.path ], inputAccessor.array, outputArray, interpolation ); // Override interpolation with custom factory method.\n\n\t\t\t\t\t\tif ( sampler.interpolation === 'CUBICSPLINE' ) {\n\n\t\t\t\t\t\t\ttrack.createInterpolant = function InterpolantFactoryMethodGLTFCubicSpline( result ) {\n\n\t\t\t\t\t\t\t\t// A CUBICSPLINE keyframe in glTF has three output values for each input value,\n\t\t\t\t\t\t\t\t// representing inTangent, splineVertex, and outTangent. As a result, track.getValueSize()\n\t\t\t\t\t\t\t\t// must be divided by three to get the interpolant's sampleSize argument.\n\t\t\t\t\t\t\t\tconst interpolantType = this instanceof THREE.QuaternionKeyframeTrack ? GLTFCubicSplineQuaternionInterpolant : GLTFCubicSplineInterpolant;\n\t\t\t\t\t\t\t\treturn new interpolantType( this.times, this.values, this.getValueSize() / 3, result );\n\n\t\t\t\t\t\t\t}; // Mark as CUBICSPLINE. `track.getInterpolation()` doesn't support custom interpolants.\n\n\n\t\t\t\t\t\t\ttrack.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline = true;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttracks.push( track );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tconst name = animationDef.name ? animationDef.name : 'animation_' + animationIndex;\n\t\t\t\treturn new THREE.AnimationClip( name, undefined, tracks );\n\n\t\t\t} );\n\n\t\t}\n\n\t\tcreateNodeMesh( nodeIndex ) {\n\n\t\t\tconst json = this.json;\n\t\t\tconst parser = this;\n\t\t\tconst nodeDef = json.nodes[ nodeIndex ];\n\t\t\tif ( nodeDef.mesh === undefined ) return null;\n\t\t\treturn parser.getDependency( 'mesh', nodeDef.mesh ).then( function ( mesh ) {\n\n\t\t\t\tconst node = parser._getNodeRef( parser.meshCache, nodeDef.mesh, mesh ); // if weights are provided on the node, override weights on the mesh.\n\n\n\t\t\t\tif ( nodeDef.weights !== undefined ) {\n\n\t\t\t\t\tnode.traverse( function ( o ) {\n\n\t\t\t\t\t\tif ( ! o.isMesh ) return;\n\n\t\t\t\t\t\tfor ( let i = 0, il = nodeDef.weights.length; i < il; i ++ ) {\n\n\t\t\t\t\t\t\to.morphTargetInfluences[ i ] = nodeDef.weights[ i ];\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} );\n\n\t\t\t\t}\n\n\t\t\t\treturn node;\n\n\t\t\t} );\n\n\t\t}\n\t\t/**\n * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#nodes-and-hierarchy\n * @param {number} nodeIndex\n * @return {Promise<Object3D>}\n */\n\n\n\t\tloadNode( nodeIndex ) {\n\n\t\t\tconst json = this.json;\n\t\t\tconst extensions = this.extensions;\n\t\t\tconst parser = this;\n\t\t\tconst nodeDef = json.nodes[ nodeIndex ]; // reserve node's name before its dependencies, so the root has the intended name.\n\n\t\t\tconst nodeName = nodeDef.name ? parser.createUniqueName( nodeDef.name ) : '';\n\t\t\treturn function () {\n\n\t\t\t\tconst pending = [];\n\n\t\t\t\tconst meshPromise = parser._invokeOne( function ( ext ) {\n\n\t\t\t\t\treturn ext.createNodeMesh && ext.createNodeMesh( nodeIndex );\n\n\t\t\t\t} );\n\n\t\t\t\tif ( meshPromise ) {\n\n\t\t\t\t\tpending.push( meshPromise );\n\n\t\t\t\t}\n\n\t\t\t\tif ( nodeDef.camera !== undefined ) {\n\n\t\t\t\t\tpending.push( parser.getDependency( 'camera', nodeDef.camera ).then( function ( camera ) {\n\n\t\t\t\t\t\treturn parser._getNodeRef( parser.cameraCache, nodeDef.camera, camera );\n\n\t\t\t\t\t} ) );\n\n\t\t\t\t}\n\n\t\t\t\tparser._invokeAll( function ( ext ) {\n\n\t\t\t\t\treturn ext.createNodeAttachment && ext.createNodeAttachment( nodeIndex );\n\n\t\t\t\t} ).forEach( function ( promise ) {\n\n\t\t\t\t\tpending.push( promise );\n\n\t\t\t\t} );\n\n\t\t\t\treturn Promise.all( pending );\n\n\t\t\t}().then( function ( objects ) {\n\n\t\t\t\tlet node; // .isBone isn't in glTF spec. See ._markDefs\n\n\t\t\t\tif ( nodeDef.isBone === true ) {\n\n\t\t\t\t\tnode = new THREE.Bone();\n\n\t\t\t\t} else if ( objects.length > 1 ) {\n\n\t\t\t\t\tnode = new THREE.Group();\n\n\t\t\t\t} else if ( objects.length === 1 ) {\n\n\t\t\t\t\tnode = objects[ 0 ];\n\n\t\t\t\t} else {\n\n\t\t\t\t\tnode = new THREE.Object3D();\n\n\t\t\t\t}\n\n\t\t\t\tif ( node !== objects[ 0 ] ) {\n\n\t\t\t\t\tfor ( let i = 0, il = objects.length; i < il; i ++ ) {\n\n\t\t\t\t\t\tnode.add( objects[ i ] );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ( nodeDef.name ) {\n\n\t\t\t\t\tnode.userData.name = nodeDef.name;\n\t\t\t\t\tnode.name = nodeName;\n\n\t\t\t\t}\n\n\t\t\t\tassignExtrasToUserData( node, nodeDef );\n\t\t\t\tif ( nodeDef.extensions ) addUnknownExtensionsToUserData( extensions, node, nodeDef );\n\n\t\t\t\tif ( nodeDef.matrix !== undefined ) {\n\n\t\t\t\t\tconst matrix = new THREE.Matrix4();\n\t\t\t\t\tmatrix.fromArray( nodeDef.matrix );\n\t\t\t\t\tnode.applyMatrix4( matrix );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tif ( nodeDef.translation !== undefined ) {\n\n\t\t\t\t\t\tnode.position.fromArray( nodeDef.translation );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( nodeDef.rotation !== undefined ) {\n\n\t\t\t\t\t\tnode.quaternion.fromArray( nodeDef.rotation );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( nodeDef.scale !== undefined ) {\n\n\t\t\t\t\t\tnode.scale.fromArray( nodeDef.scale );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ( ! parser.associations.has( node ) ) {\n\n\t\t\t\t\tparser.associations.set( node, {} );\n\n\t\t\t\t}\n\n\t\t\t\tparser.associations.get( node ).nodes = nodeIndex;\n\t\t\t\treturn node;\n\n\t\t\t} );\n\n\t\t}\n\t\t/**\n * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#scenes\n * @param {number} sceneIndex\n * @return {Promise<Group>}\n */\n\n\n\t\tloadScene( sceneIndex ) {\n\n\t\t\tconst json = this.json;\n\t\t\tconst extensions = this.extensions;\n\t\t\tconst sceneDef = this.json.scenes[ sceneIndex ];\n\t\t\tconst parser = this; // THREE.Loader returns THREE.Group, not Scene.\n\t\t\t// See: https://github.com/mrdoob/three.js/issues/18342#issuecomment-578981172\n\n\t\t\tconst scene = new THREE.Group();\n\t\t\tif ( sceneDef.name ) scene.name = parser.createUniqueName( sceneDef.name );\n\t\t\tassignExtrasToUserData( scene, sceneDef );\n\t\t\tif ( sceneDef.extensions ) addUnknownExtensionsToUserData( extensions, scene, sceneDef );\n\t\t\tconst nodeIds = sceneDef.nodes || [];\n\t\t\tconst pending = [];\n\n\t\t\tfor ( let i = 0, il = nodeIds.length; i < il; i ++ ) {\n\n\t\t\t\tpending.push( buildNodeHierarchy( nodeIds[ i ], scene, json, parser ) );\n\n\t\t\t}\n\n\t\t\treturn Promise.all( pending ).then( function () {\n\n\t\t\t\t// Removes dangling associations, associations that reference a node that\n\t\t\t\t// didn't make it into the scene.\n\t\t\t\tconst reduceAssociations = node => {\n\n\t\t\t\t\tconst reducedAssociations = new Map();\n\n\t\t\t\t\tfor ( const [ key, value ] of parser.associations ) {\n\n\t\t\t\t\t\tif ( key instanceof THREE.Material || key instanceof THREE.Texture ) {\n\n\t\t\t\t\t\t\treducedAssociations.set( key, value );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tnode.traverse( node => {\n\n\t\t\t\t\t\tconst mappings = parser.associations.get( node );\n\n\t\t\t\t\t\tif ( mappings != null ) {\n\n\t\t\t\t\t\t\treducedAssociations.set( node, mappings );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} );\n\t\t\t\t\treturn reducedAssociations;\n\n\t\t\t\t};\n\n\t\t\t\tparser.associations = reduceAssociations( scene );\n\t\t\t\treturn scene;\n\n\t\t\t} );\n\n\t\t}\n\n\t}\n\n\tfunction buildNodeHierarchy( nodeId, parentObject, json, parser ) {\n\n\t\tconst nodeDef = json.nodes[ nodeId ];\n\t\treturn parser.getDependency( 'node', nodeId ).then( function ( node ) {\n\n\t\t\tif ( nodeDef.skin === undefined ) return node; // build skeleton here as well\n\n\t\t\tlet skinEntry;\n\t\t\treturn parser.getDependency( 'skin', nodeDef.skin ).then( function ( skin ) {\n\n\t\t\t\tskinEntry = skin;\n\t\t\t\tconst pendingJoints = [];\n\n\t\t\t\tfor ( let i = 0, il = skinEntry.joints.length; i < il; i ++ ) {\n\n\t\t\t\t\tpendingJoints.push( parser.getDependency( 'node', skinEntry.joints[ i ] ) );\n\n\t\t\t\t}\n\n\t\t\t\treturn Promise.all( pendingJoints );\n\n\t\t\t} ).then( function ( jointNodes ) {\n\n\t\t\t\tnode.traverse( function ( mesh ) {\n\n\t\t\t\t\tif ( ! mesh.isMesh ) return;\n\t\t\t\t\tconst bones = [];\n\t\t\t\t\tconst boneInverses = [];\n\n\t\t\t\t\tfor ( let j = 0, jl = jointNodes.length; j < jl; j ++ ) {\n\n\t\t\t\t\t\tconst jointNode = jointNodes[ j ];\n\n\t\t\t\t\t\tif ( jointNode ) {\n\n\t\t\t\t\t\t\tbones.push( jointNode );\n\t\t\t\t\t\t\tconst mat = new THREE.Matrix4();\n\n\t\t\t\t\t\t\tif ( skinEntry.inverseBindMatrices !== undefined ) {\n\n\t\t\t\t\t\t\t\tmat.fromArray( skinEntry.inverseBindMatrices.array, j * 16 );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tboneInverses.push( mat );\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tconsole.warn( 'THREE.GLTFLoader: Joint \"%s\" could not be found.', skinEntry.joints[ j ] );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tmesh.bind( new THREE.Skeleton( bones, boneInverses ), mesh.matrixWorld );\n\n\t\t\t\t} );\n\t\t\t\treturn node;\n\n\t\t\t} );\n\n\t\t} ).then( function ( node ) {\n\n\t\t\t// build node hierachy\n\t\t\tparentObject.add( node );\n\t\t\tconst pending = [];\n\n\t\t\tif ( nodeDef.children ) {\n\n\t\t\t\tconst children = nodeDef.children;\n\n\t\t\t\tfor ( let i = 0, il = children.length; i < il; i ++ ) {\n\n\t\t\t\t\tconst child = children[ i ];\n\t\t\t\t\tpending.push( buildNodeHierarchy( child, node, json, parser ) );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn Promise.all( pending );\n\n\t\t} );\n\n\t}\n\t/**\n * @param {BufferGeometry} geometry\n * @param {GLTF.Primitive} primitiveDef\n * @param {GLTFParser} parser\n */\n\n\n\tfunction computeBounds( geometry, primitiveDef, parser ) {\n\n\t\tconst attributes = primitiveDef.attributes;\n\t\tconst box = new THREE.Box3();\n\n\t\tif ( attributes.POSITION !== undefined ) {\n\n\t\t\tconst accessor = parser.json.accessors[ attributes.POSITION ];\n\t\t\tconst min = accessor.min;\n\t\t\tconst max = accessor.max; // glTF requires 'min' and 'max', but VRM (which extends glTF) currently ignores that requirement.\n\n\t\t\tif ( min !== undefined && max !== undefined ) {\n\n\t\t\t\tbox.set( new THREE.Vector3( min[ 0 ], min[ 1 ], min[ 2 ] ), new THREE.Vector3( max[ 0 ], max[ 1 ], max[ 2 ] ) );\n\n\t\t\t\tif ( accessor.normalized ) {\n\n\t\t\t\t\tconst boxScale = getNormalizedComponentScale( WEBGL_COMPONENT_TYPES[ accessor.componentType ] );\n\t\t\t\t\tbox.min.multiplyScalar( boxScale );\n\t\t\t\t\tbox.max.multiplyScalar( boxScale );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tconsole.warn( 'THREE.GLTFLoader: Missing min/max properties for accessor POSITION.' );\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\treturn;\n\n\t\t}\n\n\t\tconst targets = primitiveDef.targets;\n\n\t\tif ( targets !== undefined ) {\n\n\t\t\tconst maxDisplacement = new THREE.Vector3();\n\t\t\tconst vector = new THREE.Vector3();\n\n\t\t\tfor ( let i = 0, il = targets.length; i < il; i ++ ) {\n\n\t\t\t\tconst target = targets[ i ];\n\n\t\t\t\tif ( target.POSITION !== undefined ) {\n\n\t\t\t\t\tconst accessor = parser.json.accessors[ target.POSITION ];\n\t\t\t\t\tconst min = accessor.min;\n\t\t\t\t\tconst max = accessor.max; // glTF requires 'min' and 'max', but VRM (which extends glTF) currently ignores that requirement.\n\n\t\t\t\t\tif ( min !== undefined && max !== undefined ) {\n\n\t\t\t\t\t\t// we need to get max of absolute components because target weight is [-1,1]\n\t\t\t\t\t\tvector.setX( Math.max( Math.abs( min[ 0 ] ), Math.abs( max[ 0 ] ) ) );\n\t\t\t\t\t\tvector.setY( Math.max( Math.abs( min[ 1 ] ), Math.abs( max[ 1 ] ) ) );\n\t\t\t\t\t\tvector.setZ( Math.max( Math.abs( min[ 2 ] ), Math.abs( max[ 2 ] ) ) );\n\n\t\t\t\t\t\tif ( accessor.normalized ) {\n\n\t\t\t\t\t\t\tconst boxScale = getNormalizedComponentScale( WEBGL_COMPONENT_TYPES[ accessor.componentType ] );\n\t\t\t\t\t\t\tvector.multiplyScalar( boxScale );\n\n\t\t\t\t\t\t} // Note: this assumes that the sum of all weights is at most 1. This isn't quite correct - it's more conservative\n\t\t\t\t\t\t// to assume that each target can have a max weight of 1. However, for some use cases - notably, when morph targets\n\t\t\t\t\t\t// are used to implement key-frame animations and as such only two are active at a time - this results in very large\n\t\t\t\t\t\t// boxes. So for now we make a box that's sometimes a touch too small but is hopefully mostly of reasonable size.\n\n\n\t\t\t\t\t\tmaxDisplacement.max( vector );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tconsole.warn( 'THREE.GLTFLoader: Missing min/max properties for accessor POSITION.' );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} // As per comment above this box isn't conservative, but has a reasonable size for a very large number of morph targets.\n\n\n\t\t\tbox.expandByVector( maxDisplacement );\n\n\t\t}\n\n\t\tgeometry.boundingBox = box;\n\t\tconst sphere = new THREE.Sphere();\n\t\tbox.getCenter( sphere.center );\n\t\tsphere.radius = box.min.distanceTo( box.max ) / 2;\n\t\tgeometry.boundingSphere = sphere;\n\n\t}\n\t/**\n * @param {BufferGeometry} geometry\n * @param {GLTF.Primitive} primitiveDef\n * @param {GLTFParser} parser\n * @return {Promise<BufferGeometry>}\n */\n\n\n\tfunction addPrimitiveAttributes( geometry, primitiveDef, parser ) {\n\n\t\tconst attributes = primitiveDef.attributes;\n\t\tconst pending = [];\n\n\t\tfunction assignAttributeAccessor( accessorIndex, attributeName ) {\n\n\t\t\treturn parser.getDependency( 'accessor', accessorIndex ).then( function ( accessor ) {\n\n\t\t\t\tgeometry.setAttribute( attributeName, accessor );\n\n\t\t\t} );\n\n\t\t}\n\n\t\tfor ( const gltfAttributeName in attributes ) {\n\n\t\t\tconst threeAttributeName = ATTRIBUTES[ gltfAttributeName ] || gltfAttributeName.toLowerCase(); // Skip attributes already provided by e.g. Draco extension.\n\n\t\t\tif ( threeAttributeName in geometry.attributes ) continue;\n\t\t\tpending.push( assignAttributeAccessor( attributes[ gltfAttributeName ], threeAttributeName ) );\n\n\t\t}\n\n\t\tif ( primitiveDef.indices !== undefined && ! geometry.index ) {\n\n\t\t\tconst accessor = parser.getDependency( 'accessor', primitiveDef.indices ).then( function ( accessor ) {\n\n\t\t\t\tgeometry.setIndex( accessor );\n\n\t\t\t} );\n\t\t\tpending.push( accessor );\n\n\t\t}\n\n\t\tassignExtrasToUserData( geometry, primitiveDef );\n\t\tcomputeBounds( geometry, primitiveDef, parser );\n\t\treturn Promise.all( pending ).then( function () {\n\n\t\t\treturn primitiveDef.targets !== undefined ? addMorphTargets( geometry, primitiveDef.targets, parser ) : geometry;\n\n\t\t} );\n\n\t}\n\t/**\n * @param {BufferGeometry} geometry\n * @param {Number} drawMode\n * @return {BufferGeometry}\n */\n\n\n\tfunction toTrianglesDrawMode( geometry, drawMode ) {\n\n\t\tlet index = geometry.getIndex(); // generate index if not present\n\n\t\tif ( index === null ) {\n\n\t\t\tconst indices = [];\n\t\t\tconst position = geometry.getAttribute( 'position' );\n\n\t\t\tif ( position !== undefined ) {\n\n\t\t\t\tfor ( let i = 0; i < position.count; i ++ ) {\n\n\t\t\t\t\tindices.push( i );\n\n\t\t\t\t}\n\n\t\t\t\tgeometry.setIndex( indices );\n\t\t\t\tindex = geometry.getIndex();\n\n\t\t\t} else {\n\n\t\t\t\tconsole.error( 'THREE.GLTFLoader.toTrianglesDrawMode(): Undefined position attribute. Processing not possible.' );\n\t\t\t\treturn geometry;\n\n\t\t\t}\n\n\t\t} //\n\n\n\t\tconst numberOfTriangles = index.count - 2;\n\t\tconst newIndices = [];\n\n\t\tif ( drawMode === THREE.TriangleFanDrawMode ) {\n\n\t\t\t// gl.TRIANGLE_FAN\n\t\t\tfor ( let i = 1; i <= numberOfTriangles; i ++ ) {\n\n\t\t\t\tnewIndices.push( index.getX( 0 ) );\n\t\t\t\tnewIndices.push( index.getX( i ) );\n\t\t\t\tnewIndices.push( index.getX( i + 1 ) );\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\t// gl.TRIANGLE_STRIP\n\t\t\tfor ( let i = 0; i < numberOfTriangles; i ++ ) {\n\n\t\t\t\tif ( i % 2 === 0 ) {\n\n\t\t\t\t\tnewIndices.push( index.getX( i ) );\n\t\t\t\t\tnewIndices.push( index.getX( i + 1 ) );\n\t\t\t\t\tnewIndices.push( index.getX( i + 2 ) );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tnewIndices.push( index.getX( i + 2 ) );\n\t\t\t\t\tnewIndices.push( index.getX( i + 1 ) );\n\t\t\t\t\tnewIndices.push( index.getX( i ) );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( newIndices.length / 3 !== numberOfTriangles ) {\n\n\t\t\tconsole.error( 'THREE.GLTFLoader.toTrianglesDrawMode(): Unable to generate correct amount of triangles.' );\n\n\t\t} // build final geometry\n\n\n\t\tconst newGeometry = geometry.clone();\n\t\tnewGeometry.setIndex( newIndices );\n\t\treturn newGeometry;\n\n\t}\n\n\tTHREE.GLTFLoader = GLTFLoader;\n\n} )();\n","( function () {\n\n\t/**\n * Loads a Wavefront .mtl file specifying materials\n */\n\n\tclass MTLLoader extends THREE.Loader {\n\n\t\tconstructor( manager ) {\n\n\t\t\tsuper( manager );\n\n\t\t}\n\t\t/**\n * Loads and parses a MTL asset from a URL.\n *\n * @param {String} url - URL to the MTL file.\n * @param {Function} [onLoad] - Callback invoked with the loaded object.\n * @param {Function} [onProgress] - Callback for download progress.\n * @param {Function} [onError] - Callback for download errors.\n *\n * @see setPath setResourcePath\n *\n * @note In order for relative texture references to resolve correctly\n * you must call setResourcePath() explicitly prior to load.\n */\n\n\n\t\tload( url, onLoad, onProgress, onError ) {\n\n\t\t\tconst scope = this;\n\t\t\tconst path = this.path === '' ? THREE.LoaderUtils.extractUrlBase( url ) : this.path;\n\t\t\tconst loader = new THREE.FileLoader( this.manager );\n\t\t\tloader.setPath( this.path );\n\t\t\tloader.setRequestHeader( this.requestHeader );\n\t\t\tloader.setWithCredentials( this.withCredentials );\n\t\t\tloader.load( url, function ( text ) {\n\n\t\t\t\ttry {\n\n\t\t\t\t\tonLoad( scope.parse( text, path ) );\n\n\t\t\t\t} catch ( e ) {\n\n\t\t\t\t\tif ( onError ) {\n\n\t\t\t\t\t\tonError( e );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tconsole.error( e );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tscope.manager.itemError( url );\n\n\t\t\t\t}\n\n\t\t\t}, onProgress, onError );\n\n\t\t}\n\n\t\tsetMaterialOptions( value ) {\n\n\t\t\tthis.materialOptions = value;\n\t\t\treturn this;\n\n\t\t}\n\t\t/**\n * Parses a MTL file.\n *\n * @param {String} text - Content of MTL file\n * @return {MaterialCreator}\n *\n * @see setPath setResourcePath\n *\n * @note In order for relative texture references to resolve correctly\n * you must call setResourcePath() explicitly prior to parse.\n */\n\n\n\t\tparse( text, path ) {\n\n\t\t\tconst lines = text.split( '\\n' );\n\t\t\tlet info = {};\n\t\t\tconst delimiter_pattern = /\\s+/;\n\t\t\tconst materialsInfo = {};\n\n\t\t\tfor ( let i = 0; i < lines.length; i ++ ) {\n\n\t\t\t\tlet line = lines[ i ];\n\t\t\t\tline = line.trim();\n\n\t\t\t\tif ( line.length === 0 || line.charAt( 0 ) === '#' ) {\n\n\t\t\t\t\t// Blank line or comment ignore\n\t\t\t\t\tcontinue;\n\n\t\t\t\t}\n\n\t\t\t\tconst pos = line.indexOf( ' ' );\n\t\t\t\tlet key = pos >= 0 ? line.substring( 0, pos ) : line;\n\t\t\t\tkey = key.toLowerCase();\n\t\t\t\tlet value = pos >= 0 ? line.substring( pos + 1 ) : '';\n\t\t\t\tvalue = value.trim();\n\n\t\t\t\tif ( key === 'newmtl' ) {\n\n\t\t\t\t\t// New material\n\t\t\t\t\tinfo = {\n\t\t\t\t\t\tname: value\n\t\t\t\t\t};\n\t\t\t\t\tmaterialsInfo[ value ] = info;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tif ( key === 'ka' || key === 'kd' || key === 'ks' || key === 'ke' ) {\n\n\t\t\t\t\t\tconst ss = value.split( delimiter_pattern, 3 );\n\t\t\t\t\t\tinfo[ key ] = [ parseFloat( ss[ 0 ] ), parseFloat( ss[ 1 ] ), parseFloat( ss[ 2 ] ) ];\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tinfo[ key ] = value;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tconst materialCreator = new MaterialCreator( this.resourcePath || path, this.materialOptions );\n\t\t\tmaterialCreator.setCrossOrigin( this.crossOrigin );\n\t\t\tmaterialCreator.setManager( this.manager );\n\t\t\tmaterialCreator.setMaterials( materialsInfo );\n\t\t\treturn materialCreator;\n\n\t\t}\n\n\t}\n\t/**\n * Create a new MTLLoader.MaterialCreator\n * @param baseUrl - Url relative to which textures are loaded\n * @param options - Set of options on how to construct the materials\n * side: Which side to apply the material\n * THREE.FrontSide (default), THREE.BackSide, THREE.DoubleSide\n * wrap: What type of wrapping to apply for textures\n * THREE.RepeatWrapping (default), THREE.ClampToEdgeWrapping, THREE.MirroredRepeatWrapping\n * normalizeRGB: RGBs need to be normalized to 0-1 from 0-255\n * Default: false, assumed to be already normalized\n * ignoreZeroRGBs: Ignore values of RGBs (Ka,Kd,Ks) that are all 0's\n * Default: false\n * @constructor\n */\n\n\n\tclass MaterialCreator {\n\n\t\tconstructor( baseUrl = '', options = {} ) {\n\n\t\t\tthis.baseUrl = baseUrl;\n\t\t\tthis.options = options;\n\t\t\tthis.materialsInfo = {};\n\t\t\tthis.materials = {};\n\t\t\tthis.materialsArray = [];\n\t\t\tthis.nameLookup = {};\n\t\t\tthis.crossOrigin = 'anonymous';\n\t\t\tthis.side = this.options.side !== undefined ? this.options.side : THREE.FrontSide;\n\t\t\tthis.wrap = this.options.wrap !== undefined ? this.options.wrap : THREE.RepeatWrapping;\n\n\t\t}\n\n\t\tsetCrossOrigin( value ) {\n\n\t\t\tthis.crossOrigin = value;\n\t\t\treturn this;\n\n\t\t}\n\n\t\tsetManager( value ) {\n\n\t\t\tthis.manager = value;\n\n\t\t}\n\n\t\tsetMaterials( materialsInfo ) {\n\n\t\t\tthis.materialsInfo = this.convert( materialsInfo );\n\t\t\tthis.materials = {};\n\t\t\tthis.materialsArray = [];\n\t\t\tthis.nameLookup = {};\n\n\t\t}\n\n\t\tconvert( materialsInfo ) {\n\n\t\t\tif ( ! this.options ) return materialsInfo;\n\t\t\tconst converted = {};\n\n\t\t\tfor ( const mn in materialsInfo ) {\n\n\t\t\t\t// Convert materials info into normalized form based on options\n\t\t\t\tconst mat = materialsInfo[ mn ];\n\t\t\t\tconst covmat = {};\n\t\t\t\tconverted[ mn ] = covmat;\n\n\t\t\t\tfor ( const prop in mat ) {\n\n\t\t\t\t\tlet save = true;\n\t\t\t\t\tlet value = mat[ prop ];\n\t\t\t\t\tconst lprop = prop.toLowerCase();\n\n\t\t\t\t\tswitch ( lprop ) {\n\n\t\t\t\t\t\tcase 'kd':\n\t\t\t\t\t\tcase 'ka':\n\t\t\t\t\t\tcase 'ks':\n\t\t\t\t\t\t\t// Diffuse color (color under white light) using RGB values\n\t\t\t\t\t\t\tif ( this.options && this.options.normalizeRGB ) {\n\n\t\t\t\t\t\t\t\tvalue = [ value[ 0 ] / 255, value[ 1 ] / 255, value[ 2 ] / 255 ];\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( this.options && this.options.ignoreZeroRGBs ) {\n\n\t\t\t\t\t\t\t\tif ( value[ 0 ] === 0 && value[ 1 ] === 0 && value[ 2 ] === 0 ) {\n\n\t\t\t\t\t\t\t\t\t// ignore\n\t\t\t\t\t\t\t\t\tsave = false;\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( save ) {\n\n\t\t\t\t\t\tcovmat[ lprop ] = value;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn converted;\n\n\t\t}\n\n\t\tpreload() {\n\n\t\t\tfor ( const mn in this.materialsInfo ) {\n\n\t\t\t\tthis.create( mn );\n\n\t\t\t}\n\n\t\t}\n\n\t\tgetIndex( materialName ) {\n\n\t\t\treturn this.nameLookup[ materialName ];\n\n\t\t}\n\n\t\tgetAsArray() {\n\n\t\t\tlet index = 0;\n\n\t\t\tfor ( const mn in this.materialsInfo ) {\n\n\t\t\t\tthis.materialsArray[ index ] = this.create( mn );\n\t\t\t\tthis.nameLookup[ mn ] = index;\n\t\t\t\tindex ++;\n\n\t\t\t}\n\n\t\t\treturn this.materialsArray;\n\n\t\t}\n\n\t\tcreate( materialName ) {\n\n\t\t\tif ( this.materials[ materialName ] === undefined ) {\n\n\t\t\t\tthis.createMaterial_( materialName );\n\n\t\t\t}\n\n\t\t\treturn this.materials[ materialName ];\n\n\t\t}\n\n\t\tcreateMaterial_( materialName ) {\n\n\t\t\t// Create material\n\t\t\tconst scope = this;\n\t\t\tconst mat = this.materialsInfo[ materialName ];\n\t\t\tconst params = {\n\t\t\t\tname: materialName,\n\t\t\t\tside: this.side\n\t\t\t};\n\n\t\t\tfunction resolveURL( baseUrl, url ) {\n\n\t\t\t\tif ( typeof url !== 'string' || url === '' ) return ''; // Absolute URL\n\n\t\t\t\tif ( /^https?:\\/\\//i.test( url ) ) return url;\n\t\t\t\treturn baseUrl + url;\n\n\t\t\t}\n\n\t\t\tfunction setMapForType( mapType, value ) {\n\n\t\t\t\tif ( params[ mapType ] ) return; // Keep the first encountered texture\n\n\t\t\t\tconst texParams = scope.getTextureParams( value, params );\n\t\t\t\tconst map = scope.loadTexture( resolveURL( scope.baseUrl, texParams.url ) );\n\t\t\t\tmap.repeat.copy( texParams.scale );\n\t\t\t\tmap.offset.copy( texParams.offset );\n\t\t\t\tmap.wrapS = scope.wrap;\n\t\t\t\tmap.wrapT = scope.wrap;\n\t\t\t\tparams[ mapType ] = map;\n\n\t\t\t}\n\n\t\t\tfor ( const prop in mat ) {\n\n\t\t\t\tconst value = mat[ prop ];\n\t\t\t\tlet n;\n\t\t\t\tif ( value === '' ) continue;\n\n\t\t\t\tswitch ( prop.toLowerCase() ) {\n\n\t\t\t\t\t// Ns is material specular exponent\n\t\t\t\t\tcase 'kd':\n\t\t\t\t\t\t// Diffuse color (color under white light) using RGB values\n\t\t\t\t\t\tparams.color = new THREE.Color().fromArray( value );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'ks':\n\t\t\t\t\t\t// Specular color (color when light is reflected from shiny surface) using RGB values\n\t\t\t\t\t\tparams.specular = new THREE.Color().fromArray( value );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'ke':\n\t\t\t\t\t\t// Emissive using RGB values\n\t\t\t\t\t\tparams.emissive = new THREE.Color().fromArray( value );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'map_kd':\n\t\t\t\t\t\t// Diffuse texture map\n\t\t\t\t\t\tsetMapForType( 'map', value );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'map_ks':\n\t\t\t\t\t\t// Specular map\n\t\t\t\t\t\tsetMapForType( 'specularMap', value );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'map_ke':\n\t\t\t\t\t\t// Emissive map\n\t\t\t\t\t\tsetMapForType( 'emissiveMap', value );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'norm':\n\t\t\t\t\t\tsetMapForType( 'normalMap', value );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'map_bump':\n\t\t\t\t\tcase 'bump':\n\t\t\t\t\t\t// Bump texture map\n\t\t\t\t\t\tsetMapForType( 'bumpMap', value );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'map_d':\n\t\t\t\t\t\t// Alpha map\n\t\t\t\t\t\tsetMapForType( 'alphaMap', value );\n\t\t\t\t\t\tparams.transparent = true;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'ns':\n\t\t\t\t\t\t// The specular exponent (defines the focus of the specular highlight)\n\t\t\t\t\t\t// A high exponent results in a tight, concentrated highlight. Ns values normally range from 0 to 1000.\n\t\t\t\t\t\tparams.shininess = parseFloat( value );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'd':\n\t\t\t\t\t\tn = parseFloat( value );\n\n\t\t\t\t\t\tif ( n < 1 ) {\n\n\t\t\t\t\t\t\tparams.opacity = n;\n\t\t\t\t\t\t\tparams.transparent = true;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'tr':\n\t\t\t\t\t\tn = parseFloat( value );\n\t\t\t\t\t\tif ( this.options && this.options.invertTrProperty ) n = 1 - n;\n\n\t\t\t\t\t\tif ( n > 0 ) {\n\n\t\t\t\t\t\t\tparams.opacity = 1 - n;\n\t\t\t\t\t\t\tparams.transparent = true;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tthis.materials[ materialName ] = new THREE.MeshPhongMaterial( params );\n\t\t\treturn this.materials[ materialName ];\n\n\t\t}\n\n\t\tgetTextureParams( value, matParams ) {\n\n\t\t\tconst texParams = {\n\t\t\t\tscale: new THREE.Vector2( 1, 1 ),\n\t\t\t\toffset: new THREE.Vector2( 0, 0 )\n\t\t\t};\n\t\t\tconst items = value.split( /\\s+/ );\n\t\t\tlet pos;\n\t\t\tpos = items.indexOf( '-bm' );\n\n\t\t\tif ( pos >= 0 ) {\n\n\t\t\t\tmatParams.bumpScale = parseFloat( items[ pos + 1 ] );\n\t\t\t\titems.splice( pos, 2 );\n\n\t\t\t}\n\n\t\t\tpos = items.indexOf( '-s' );\n\n\t\t\tif ( pos >= 0 ) {\n\n\t\t\t\ttexParams.scale.set( parseFloat( items[ pos + 1 ] ), parseFloat( items[ pos + 2 ] ) );\n\t\t\t\titems.splice( pos, 4 ); // we expect 3 parameters here!\n\n\t\t\t}\n\n\t\t\tpos = items.indexOf( '-o' );\n\n\t\t\tif ( pos >= 0 ) {\n\n\t\t\t\ttexParams.offset.set( parseFloat( items[ pos + 1 ] ), parseFloat( items[ pos + 2 ] ) );\n\t\t\t\titems.splice( pos, 4 ); // we expect 3 parameters here!\n\n\t\t\t}\n\n\t\t\ttexParams.url = items.join( ' ' ).trim();\n\t\t\treturn texParams;\n\n\t\t}\n\n\t\tloadTexture( url, mapping, onLoad, onProgress, onError ) {\n\n\t\t\tconst manager = this.manager !== undefined ? this.manager : THREE.DefaultLoadingManager;\n\t\t\tlet loader = manager.getHandler( url );\n\n\t\t\tif ( loader === null ) {\n\n\t\t\t\tloader = new THREE.TextureLoader( manager );\n\n\t\t\t}\n\n\t\t\tif ( loader.setCrossOrigin ) loader.setCrossOrigin( this.crossOrigin );\n\t\t\tconst texture = loader.load( url, onLoad, onProgress, onError );\n\t\t\tif ( mapping !== undefined ) texture.mapping = mapping;\n\t\t\treturn texture;\n\n\t\t}\n\n\t}\n\n\tTHREE.MTLLoader = MTLLoader;\n\n} )();\n","( function () {\n\n\tconst _object_pattern = /^[og]\\s*(.+)?/; // mtllib file_reference\n\n\tconst _material_library_pattern = /^mtllib /; // usemtl material_name\n\n\tconst _material_use_pattern = /^usemtl /; // usemap map_name\n\n\tconst _map_use_pattern = /^usemap /;\n\n\tconst _vA = new THREE.Vector3();\n\n\tconst _vB = new THREE.Vector3();\n\n\tconst _vC = new THREE.Vector3();\n\n\tconst _ab = new THREE.Vector3();\n\n\tconst _cb = new THREE.Vector3();\n\n\tfunction ParserState() {\n\n\t\tconst state = {\n\t\t\tobjects: [],\n\t\t\tobject: {},\n\t\t\tvertices: [],\n\t\t\tnormals: [],\n\t\t\tcolors: [],\n\t\t\tuvs: [],\n\t\t\tmaterials: {},\n\t\t\tmaterialLibraries: [],\n\t\t\tstartObject: function ( name, fromDeclaration ) {\n\n\t\t\t\t// If the current object (initial from reset) is not from a g/o declaration in the parsed\n\t\t\t\t// file. We need to use it for the first parsed g/o to keep things in sync.\n\t\t\t\tif ( this.object && this.object.fromDeclaration === false ) {\n\n\t\t\t\t\tthis.object.name = name;\n\t\t\t\t\tthis.object.fromDeclaration = fromDeclaration !== false;\n\t\t\t\t\treturn;\n\n\t\t\t\t}\n\n\t\t\t\tconst previousMaterial = this.object && typeof this.object.currentMaterial === 'function' ? this.object.currentMaterial() : undefined;\n\n\t\t\t\tif ( this.object && typeof this.object._finalize === 'function' ) {\n\n\t\t\t\t\tthis.object._finalize( true );\n\n\t\t\t\t}\n\n\t\t\t\tthis.object = {\n\t\t\t\t\tname: name || '',\n\t\t\t\t\tfromDeclaration: fromDeclaration !== false,\n\t\t\t\t\tgeometry: {\n\t\t\t\t\t\tvertices: [],\n\t\t\t\t\t\tnormals: [],\n\t\t\t\t\t\tcolors: [],\n\t\t\t\t\t\tuvs: [],\n\t\t\t\t\t\thasUVIndices: false\n\t\t\t\t\t},\n\t\t\t\t\tmaterials: [],\n\t\t\t\t\tsmooth: true,\n\t\t\t\t\tstartMaterial: function ( name, libraries ) {\n\n\t\t\t\t\t\tconst previous = this._finalize( false ); // New usemtl declaration overwrites an inherited material, except if faces were declared\n\t\t\t\t\t\t// after the material, then it must be preserved for proper MultiMaterial continuation.\n\n\n\t\t\t\t\t\tif ( previous && ( previous.inherited || previous.groupCount <= 0 ) ) {\n\n\t\t\t\t\t\t\tthis.materials.splice( previous.index, 1 );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst material = {\n\t\t\t\t\t\t\tindex: this.materials.length,\n\t\t\t\t\t\t\tname: name || '',\n\t\t\t\t\t\t\tmtllib: Array.isArray( libraries ) && libraries.length > 0 ? libraries[ libraries.length - 1 ] : '',\n\t\t\t\t\t\t\tsmooth: previous !== undefined ? previous.smooth : this.smooth,\n\t\t\t\t\t\t\tgroupStart: previous !== undefined ? previous.groupEnd : 0,\n\t\t\t\t\t\t\tgroupEnd: - 1,\n\t\t\t\t\t\t\tgroupCount: - 1,\n\t\t\t\t\t\t\tinherited: false,\n\t\t\t\t\t\t\tclone: function ( index ) {\n\n\t\t\t\t\t\t\t\tconst cloned = {\n\t\t\t\t\t\t\t\t\tindex: typeof index === 'number' ? index : this.index,\n\t\t\t\t\t\t\t\t\tname: this.name,\n\t\t\t\t\t\t\t\t\tmtllib: this.mtllib,\n\t\t\t\t\t\t\t\t\tsmooth: this.smooth,\n\t\t\t\t\t\t\t\t\tgroupStart: 0,\n\t\t\t\t\t\t\t\t\tgroupEnd: - 1,\n\t\t\t\t\t\t\t\t\tgroupCount: - 1,\n\t\t\t\t\t\t\t\t\tinherited: false\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\tcloned.clone = this.clone.bind( cloned );\n\t\t\t\t\t\t\t\treturn cloned;\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\t\t\t\t\t\tthis.materials.push( material );\n\t\t\t\t\t\treturn material;\n\n\t\t\t\t\t},\n\t\t\t\t\tcurrentMaterial: function () {\n\n\t\t\t\t\t\tif ( this.materials.length > 0 ) {\n\n\t\t\t\t\t\t\treturn this.materials[ this.materials.length - 1 ];\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn undefined;\n\n\t\t\t\t\t},\n\t\t\t\t\t_finalize: function ( end ) {\n\n\t\t\t\t\t\tconst lastMultiMaterial = this.currentMaterial();\n\n\t\t\t\t\t\tif ( lastMultiMaterial && lastMultiMaterial.groupEnd === - 1 ) {\n\n\t\t\t\t\t\t\tlastMultiMaterial.groupEnd = this.geometry.vertices.length / 3;\n\t\t\t\t\t\t\tlastMultiMaterial.groupCount = lastMultiMaterial.groupEnd - lastMultiMaterial.groupStart;\n\t\t\t\t\t\t\tlastMultiMaterial.inherited = false;\n\n\t\t\t\t\t\t} // Ignore objects tail materials if no face declarations followed them before a new o/g started.\n\n\n\t\t\t\t\t\tif ( end && this.materials.length > 1 ) {\n\n\t\t\t\t\t\t\tfor ( let mi = this.materials.length - 1; mi >= 0; mi -- ) {\n\n\t\t\t\t\t\t\t\tif ( this.materials[ mi ].groupCount <= 0 ) {\n\n\t\t\t\t\t\t\t\t\tthis.materials.splice( mi, 1 );\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} // Guarantee at least one empty material, this makes the creation later more straight forward.\n\n\n\t\t\t\t\t\tif ( end && this.materials.length === 0 ) {\n\n\t\t\t\t\t\t\tthis.materials.push( {\n\t\t\t\t\t\t\t\tname: '',\n\t\t\t\t\t\t\t\tsmooth: this.smooth\n\t\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn lastMultiMaterial;\n\n\t\t\t\t\t}\n\t\t\t\t}; // Inherit previous objects material.\n\t\t\t\t// Spec tells us that a declared material must be set to all objects until a new material is declared.\n\t\t\t\t// If a usemtl declaration is encountered while this new object is being parsed, it will\n\t\t\t\t// overwrite the inherited material. Exception being that there was already face declarations\n\t\t\t\t// to the inherited material, then it will be preserved for proper MultiMaterial continuation.\n\n\t\t\t\tif ( previousMaterial && previousMaterial.name && typeof previousMaterial.clone === 'function' ) {\n\n\t\t\t\t\tconst declared = previousMaterial.clone( 0 );\n\t\t\t\t\tdeclared.inherited = true;\n\t\t\t\t\tthis.object.materials.push( declared );\n\n\t\t\t\t}\n\n\t\t\t\tthis.objects.push( this.object );\n\n\t\t\t},\n\t\t\tfinalize: function () {\n\n\t\t\t\tif ( this.object && typeof this.object._finalize === 'function' ) {\n\n\t\t\t\t\tthis.object._finalize( true );\n\n\t\t\t\t}\n\n\t\t\t},\n\t\t\tparseVertexIndex: function ( value, len ) {\n\n\t\t\t\tconst index = parseInt( value, 10 );\n\t\t\t\treturn ( index >= 0 ? index - 1 : index + len / 3 ) * 3;\n\n\t\t\t},\n\t\t\tparseNormalIndex: function ( value, len ) {\n\n\t\t\t\tconst index = parseInt( value, 10 );\n\t\t\t\treturn ( index >= 0 ? index - 1 : index + len / 3 ) * 3;\n\n\t\t\t},\n\t\t\tparseUVIndex: function ( value, len ) {\n\n\t\t\t\tconst index = parseInt( value, 10 );\n\t\t\t\treturn ( index >= 0 ? index - 1 : index + len / 2 ) * 2;\n\n\t\t\t},\n\t\t\taddVertex: function ( a, b, c ) {\n\n\t\t\t\tconst src = this.vertices;\n\t\t\t\tconst dst = this.object.geometry.vertices;\n\t\t\t\tdst.push( src[ a + 0 ], src[ a + 1 ], src[ a + 2 ] );\n\t\t\t\tdst.push( src[ b + 0 ], src[ b + 1 ], src[ b + 2 ] );\n\t\t\t\tdst.push( src[ c + 0 ], src[ c + 1 ], src[ c + 2 ] );\n\n\t\t\t},\n\t\t\taddVertexPoint: function ( a ) {\n\n\t\t\t\tconst src = this.vertices;\n\t\t\t\tconst dst = this.object.geometry.vertices;\n\t\t\t\tdst.push( src[ a + 0 ], src[ a + 1 ], src[ a + 2 ] );\n\n\t\t\t},\n\t\t\taddVertexLine: function ( a ) {\n\n\t\t\t\tconst src = this.vertices;\n\t\t\t\tconst dst = this.object.geometry.vertices;\n\t\t\t\tdst.push( src[ a + 0 ], src[ a + 1 ], src[ a + 2 ] );\n\n\t\t\t},\n\t\t\taddNormal: function ( a, b, c ) {\n\n\t\t\t\tconst src = this.normals;\n\t\t\t\tconst dst = this.object.geometry.normals;\n\t\t\t\tdst.push( src[ a + 0 ], src[ a + 1 ], src[ a + 2 ] );\n\t\t\t\tdst.push( src[ b + 0 ], src[ b + 1 ], src[ b + 2 ] );\n\t\t\t\tdst.push( src[ c + 0 ], src[ c + 1 ], src[ c + 2 ] );\n\n\t\t\t},\n\t\t\taddFaceNormal: function ( a, b, c ) {\n\n\t\t\t\tconst src = this.vertices;\n\t\t\t\tconst dst = this.object.geometry.normals;\n\n\t\t\t\t_vA.fromArray( src, a );\n\n\t\t\t\t_vB.fromArray( src, b );\n\n\t\t\t\t_vC.fromArray( src, c );\n\n\t\t\t\t_cb.subVectors( _vC, _vB );\n\n\t\t\t\t_ab.subVectors( _vA, _vB );\n\n\t\t\t\t_cb.cross( _ab );\n\n\t\t\t\t_cb.normalize();\n\n\t\t\t\tdst.push( _cb.x, _cb.y, _cb.z );\n\t\t\t\tdst.push( _cb.x, _cb.y, _cb.z );\n\t\t\t\tdst.push( _cb.x, _cb.y, _cb.z );\n\n\t\t\t},\n\t\t\taddColor: function ( a, b, c ) {\n\n\t\t\t\tconst src = this.colors;\n\t\t\t\tconst dst = this.object.geometry.colors;\n\t\t\t\tif ( src[ a ] !== undefined ) dst.push( src[ a + 0 ], src[ a + 1 ], src[ a + 2 ] );\n\t\t\t\tif ( src[ b ] !== undefined ) dst.push( src[ b + 0 ], src[ b + 1 ], src[ b + 2 ] );\n\t\t\t\tif ( src[ c ] !== undefined ) dst.push( src[ c + 0 ], src[ c + 1 ], src[ c + 2 ] );\n\n\t\t\t},\n\t\t\taddUV: function ( a, b, c ) {\n\n\t\t\t\tconst src = this.uvs;\n\t\t\t\tconst dst = this.object.geometry.uvs;\n\t\t\t\tdst.push( src[ a + 0 ], src[ a + 1 ] );\n\t\t\t\tdst.push( src[ b + 0 ], src[ b + 1 ] );\n\t\t\t\tdst.push( src[ c + 0 ], src[ c + 1 ] );\n\n\t\t\t},\n\t\t\taddDefaultUV: function () {\n\n\t\t\t\tconst dst = this.object.geometry.uvs;\n\t\t\t\tdst.push( 0, 0 );\n\t\t\t\tdst.push( 0, 0 );\n\t\t\t\tdst.push( 0, 0 );\n\n\t\t\t},\n\t\t\taddUVLine: function ( a ) {\n\n\t\t\t\tconst src = this.uvs;\n\t\t\t\tconst dst = this.object.geometry.uvs;\n\t\t\t\tdst.push( src[ a + 0 ], src[ a + 1 ] );\n\n\t\t\t},\n\t\t\taddFace: function ( a, b, c, ua, ub, uc, na, nb, nc ) {\n\n\t\t\t\tconst vLen = this.vertices.length;\n\t\t\t\tlet ia = this.parseVertexIndex( a, vLen );\n\t\t\t\tlet ib = this.parseVertexIndex( b, vLen );\n\t\t\t\tlet ic = this.parseVertexIndex( c, vLen );\n\t\t\t\tthis.addVertex( ia, ib, ic );\n\t\t\t\tthis.addColor( ia, ib, ic ); // normals\n\n\t\t\t\tif ( na !== undefined && na !== '' ) {\n\n\t\t\t\t\tconst nLen = this.normals.length;\n\t\t\t\t\tia = this.parseNormalIndex( na, nLen );\n\t\t\t\t\tib = this.parseNormalIndex( nb, nLen );\n\t\t\t\t\tic = this.parseNormalIndex( nc, nLen );\n\t\t\t\t\tthis.addNormal( ia, ib, ic );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthis.addFaceNormal( ia, ib, ic );\n\n\t\t\t\t} // uvs\n\n\n\t\t\t\tif ( ua !== undefined && ua !== '' ) {\n\n\t\t\t\t\tconst uvLen = this.uvs.length;\n\t\t\t\t\tia = this.parseUVIndex( ua, uvLen );\n\t\t\t\t\tib = this.parseUVIndex( ub, uvLen );\n\t\t\t\t\tic = this.parseUVIndex( uc, uvLen );\n\t\t\t\t\tthis.addUV( ia, ib, ic );\n\t\t\t\t\tthis.object.geometry.hasUVIndices = true;\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// add placeholder values (for inconsistent face definitions)\n\t\t\t\t\tthis.addDefaultUV();\n\n\t\t\t\t}\n\n\t\t\t},\n\t\t\taddPointGeometry: function ( vertices ) {\n\n\t\t\t\tthis.object.geometry.type = 'Points';\n\t\t\t\tconst vLen = this.vertices.length;\n\n\t\t\t\tfor ( let vi = 0, l = vertices.length; vi < l; vi ++ ) {\n\n\t\t\t\t\tconst index = this.parseVertexIndex( vertices[ vi ], vLen );\n\t\t\t\t\tthis.addVertexPoint( index );\n\t\t\t\t\tthis.addColor( index );\n\n\t\t\t\t}\n\n\t\t\t},\n\t\t\taddLineGeometry: function ( vertices, uvs ) {\n\n\t\t\t\tthis.object.geometry.type = 'Line';\n\t\t\t\tconst vLen = this.vertices.length;\n\t\t\t\tconst uvLen = this.uvs.length;\n\n\t\t\t\tfor ( let vi = 0, l = vertices.length; vi < l; vi ++ ) {\n\n\t\t\t\t\tthis.addVertexLine( this.parseVertexIndex( vertices[ vi ], vLen ) );\n\n\t\t\t\t}\n\n\t\t\t\tfor ( let uvi = 0, l = uvs.length; uvi < l; uvi ++ ) {\n\n\t\t\t\t\tthis.addUVLine( this.parseUVIndex( uvs[ uvi ], uvLen ) );\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t};\n\t\tstate.startObject( '', false );\n\t\treturn state;\n\n\t} //\n\n\n\tclass OBJLoader extends THREE.Loader {\n\n\t\tconstructor( manager ) {\n\n\t\t\tsuper( manager );\n\t\t\tthis.materials = null;\n\n\t\t}\n\n\t\tload( url, onLoad, onProgress, onError ) {\n\n\t\t\tconst scope = this;\n\t\t\tconst loader = new THREE.FileLoader( this.manager );\n\t\t\tloader.setPath( this.path );\n\t\t\tloader.setRequestHeader( this.requestHeader );\n\t\t\tloader.setWithCredentials( this.withCredentials );\n\t\t\tloader.load( url, function ( text ) {\n\n\t\t\t\ttry {\n\n\t\t\t\t\tonLoad( scope.parse( text ) );\n\n\t\t\t\t} catch ( e ) {\n\n\t\t\t\t\tif ( onError ) {\n\n\t\t\t\t\t\tonError( e );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tconsole.error( e );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tscope.manager.itemError( url );\n\n\t\t\t\t}\n\n\t\t\t}, onProgress, onError );\n\n\t\t}\n\n\t\tsetMaterials( materials ) {\n\n\t\t\tthis.materials = materials;\n\t\t\treturn this;\n\n\t\t}\n\n\t\tparse( text ) {\n\n\t\t\tconst state = new ParserState();\n\n\t\t\tif ( text.indexOf( '\\r\\n' ) !== - 1 ) {\n\n\t\t\t\t// This is faster than String.split with regex that splits on both\n\t\t\t\ttext = text.replace( /\\r\\n/g, '\\n' );\n\n\t\t\t}\n\n\t\t\tif ( text.indexOf( '\\\\\\n' ) !== - 1 ) {\n\n\t\t\t\t// join lines separated by a line continuation character (\\)\n\t\t\t\ttext = text.replace( /\\\\\\n/g, '' );\n\n\t\t\t}\n\n\t\t\tconst lines = text.split( '\\n' );\n\t\t\tlet line = '',\n\t\t\t\tlineFirstChar = '';\n\t\t\tlet lineLength = 0;\n\t\t\tlet result = []; // Faster to just trim left side of the line. Use if available.\n\n\t\t\tconst trimLeft = typeof ''.trimLeft === 'function';\n\n\t\t\tfor ( let i = 0, l = lines.length; i < l; i ++ ) {\n\n\t\t\t\tline = lines[ i ];\n\t\t\t\tline = trimLeft ? line.trimLeft() : line.trim();\n\t\t\t\tlineLength = line.length;\n\t\t\t\tif ( lineLength === 0 ) continue;\n\t\t\t\tlineFirstChar = line.charAt( 0 ); // @todo invoke passed in handler if any\n\n\t\t\t\tif ( lineFirstChar === '#' ) continue;\n\n\t\t\t\tif ( lineFirstChar === 'v' ) {\n\n\t\t\t\t\tconst data = line.split( /\\s+/ );\n\n\t\t\t\t\tswitch ( data[ 0 ] ) {\n\n\t\t\t\t\t\tcase 'v':\n\t\t\t\t\t\t\tstate.vertices.push( parseFloat( data[ 1 ] ), parseFloat( data[ 2 ] ), parseFloat( data[ 3 ] ) );\n\n\t\t\t\t\t\t\tif ( data.length >= 7 ) {\n\n\t\t\t\t\t\t\t\tstate.colors.push( parseFloat( data[ 4 ] ), parseFloat( data[ 5 ] ), parseFloat( data[ 6 ] ) );\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t// if no colors are defined, add placeholders so color and vertex indices match\n\t\t\t\t\t\t\t\tstate.colors.push( undefined, undefined, undefined );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'vn':\n\t\t\t\t\t\t\tstate.normals.push( parseFloat( data[ 1 ] ), parseFloat( data[ 2 ] ), parseFloat( data[ 3 ] ) );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'vt':\n\t\t\t\t\t\t\tstate.uvs.push( parseFloat( data[ 1 ] ), parseFloat( data[ 2 ] ) );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t} else if ( lineFirstChar === 'f' ) {\n\n\t\t\t\t\tconst lineData = line.substr( 1 ).trim();\n\t\t\t\t\tconst vertexData = lineData.split( /\\s+/ );\n\t\t\t\t\tconst faceVertices = []; // Parse the face vertex data into an easy to work with format\n\n\t\t\t\t\tfor ( let j = 0, jl = vertexData.length; j < jl; j ++ ) {\n\n\t\t\t\t\t\tconst vertex = vertexData[ j ];\n\n\t\t\t\t\t\tif ( vertex.length > 0 ) {\n\n\t\t\t\t\t\t\tconst vertexParts = vertex.split( '/' );\n\t\t\t\t\t\t\tfaceVertices.push( vertexParts );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} // Draw an edge between the first vertex and all subsequent vertices to form an n-gon\n\n\n\t\t\t\t\tconst v1 = faceVertices[ 0 ];\n\n\t\t\t\t\tfor ( let j = 1, jl = faceVertices.length - 1; j < jl; j ++ ) {\n\n\t\t\t\t\t\tconst v2 = faceVertices[ j ];\n\t\t\t\t\t\tconst v3 = faceVertices[ j + 1 ];\n\t\t\t\t\t\tstate.addFace( v1[ 0 ], v2[ 0 ], v3[ 0 ], v1[ 1 ], v2[ 1 ], v3[ 1 ], v1[ 2 ], v2[ 2 ], v3[ 2 ] );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else if ( lineFirstChar === 'l' ) {\n\n\t\t\t\t\tconst lineParts = line.substring( 1 ).trim().split( ' ' );\n\t\t\t\t\tlet lineVertices = [];\n\t\t\t\t\tconst lineUVs = [];\n\n\t\t\t\t\tif ( line.indexOf( '/' ) === - 1 ) {\n\n\t\t\t\t\t\tlineVertices = lineParts;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tfor ( let li = 0, llen = lineParts.length; li < llen; li ++ ) {\n\n\t\t\t\t\t\t\tconst parts = lineParts[ li ].split( '/' );\n\t\t\t\t\t\t\tif ( parts[ 0 ] !== '' ) lineVertices.push( parts[ 0 ] );\n\t\t\t\t\t\t\tif ( parts[ 1 ] !== '' ) lineUVs.push( parts[ 1 ] );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tstate.addLineGeometry( lineVertices, lineUVs );\n\n\t\t\t\t} else if ( lineFirstChar === 'p' ) {\n\n\t\t\t\t\tconst lineData = line.substr( 1 ).trim();\n\t\t\t\t\tconst pointData = lineData.split( ' ' );\n\t\t\t\t\tstate.addPointGeometry( pointData );\n\n\t\t\t\t} else if ( ( result = _object_pattern.exec( line ) ) !== null ) {\n\n\t\t\t\t\t// o object_name\n\t\t\t\t\t// or\n\t\t\t\t\t// g group_name\n\t\t\t\t\t// WORKAROUND: https://bugs.chromium.org/p/v8/issues/detail?id=2869\n\t\t\t\t\t// let name = result[ 0 ].substr( 1 ).trim();\n\t\t\t\t\tconst name = ( ' ' + result[ 0 ].substr( 1 ).trim() ).substr( 1 );\n\t\t\t\t\tstate.startObject( name );\n\n\t\t\t\t} else if ( _material_use_pattern.test( line ) ) {\n\n\t\t\t\t\t// material\n\t\t\t\t\tstate.object.startMaterial( line.substring( 7 ).trim(), state.materialLibraries );\n\n\t\t\t\t} else if ( _material_library_pattern.test( line ) ) {\n\n\t\t\t\t\t// mtl file\n\t\t\t\t\tstate.materialLibraries.push( line.substring( 7 ).trim() );\n\n\t\t\t\t} else if ( _map_use_pattern.test( line ) ) {\n\n\t\t\t\t\t// the line is parsed but ignored since the loader assumes textures are defined MTL files\n\t\t\t\t\t// (according to https://www.okino.com/conv/imp_wave.htm, 'usemap' is the old-style Wavefront texture reference method)\n\t\t\t\t\tconsole.warn( 'THREE.OBJLoader: Rendering identifier \"usemap\" not supported. Textures must be defined in MTL files.' );\n\n\t\t\t\t} else if ( lineFirstChar === 's' ) {\n\n\t\t\t\t\tresult = line.split( ' ' ); // smooth shading\n\t\t\t\t\t// @todo Handle files that have varying smooth values for a set of faces inside one geometry,\n\t\t\t\t\t// but does not define a usemtl for each face set.\n\t\t\t\t\t// This should be detected and a dummy material created (later MultiMaterial and geometry groups).\n\t\t\t\t\t// This requires some care to not create extra material on each smooth value for \"normal\" obj files.\n\t\t\t\t\t// where explicit usemtl defines geometry groups.\n\t\t\t\t\t// Example asset: examples/models/obj/cerberus/Cerberus.obj\n\n\t\t\t\t\t/*\n \t * http://paulbourke.net/dataformats/obj/\n \t * or\n \t * http://www.cs.utah.edu/~boulos/cs3505/obj_spec.pdf\n \t *\n \t * From chapter \"Grouping\" Syntax explanation \"s group_number\":\n \t * \"group_number is the smoothing group number. To turn off smoothing groups, use a value of 0 or off.\n \t * Polygonal elements use group numbers to put elements in different smoothing groups. For free-form\n \t * surfaces, smoothing groups are either turned on or off; there is no difference between values greater\n \t * than 0.\"\n \t */\n\n\t\t\t\t\tif ( result.length > 1 ) {\n\n\t\t\t\t\t\tconst value = result[ 1 ].trim().toLowerCase();\n\t\t\t\t\t\tstate.object.smooth = value !== '0' && value !== 'off';\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// ZBrush can produce \"s\" lines #11707\n\t\t\t\t\t\tstate.object.smooth = true;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tconst material = state.object.currentMaterial();\n\t\t\t\t\tif ( material ) material.smooth = state.object.smooth;\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// Handle null terminated files without exception\n\t\t\t\t\tif ( line === '\\0' ) continue;\n\t\t\t\t\tconsole.warn( 'THREE.OBJLoader: Unexpected line: \"' + line + '\"' );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tstate.finalize();\n\t\t\tconst container = new THREE.Group();\n\t\t\tcontainer.materialLibraries = [].concat( state.materialLibraries );\n\t\t\tconst hasPrimitives = ! ( state.objects.length === 1 && state.objects[ 0 ].geometry.vertices.length === 0 );\n\n\t\t\tif ( hasPrimitives === true ) {\n\n\t\t\t\tfor ( let i = 0, l = state.objects.length; i < l; i ++ ) {\n\n\t\t\t\t\tconst object = state.objects[ i ];\n\t\t\t\t\tconst geometry = object.geometry;\n\t\t\t\t\tconst materials = object.materials;\n\t\t\t\t\tconst isLine = geometry.type === 'Line';\n\t\t\t\t\tconst isPoints = geometry.type === 'Points';\n\t\t\t\t\tlet hasVertexColors = false; // Skip o/g line declarations that did not follow with any faces\n\n\t\t\t\t\tif ( geometry.vertices.length === 0 ) continue;\n\t\t\t\t\tconst buffergeometry = new THREE.BufferGeometry();\n\t\t\t\t\tbuffergeometry.setAttribute( 'position', new THREE.Float32BufferAttribute( geometry.vertices, 3 ) );\n\n\t\t\t\t\tif ( geometry.normals.length > 0 ) {\n\n\t\t\t\t\t\tbuffergeometry.setAttribute( 'normal', new THREE.Float32BufferAttribute( geometry.normals, 3 ) );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( geometry.colors.length > 0 ) {\n\n\t\t\t\t\t\thasVertexColors = true;\n\t\t\t\t\t\tbuffergeometry.setAttribute( 'color', new THREE.Float32BufferAttribute( geometry.colors, 3 ) );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( geometry.hasUVIndices === true ) {\n\n\t\t\t\t\t\tbuffergeometry.setAttribute( 'uv', new THREE.Float32BufferAttribute( geometry.uvs, 2 ) );\n\n\t\t\t\t\t} // Create materials\n\n\n\t\t\t\t\tconst createdMaterials = [];\n\n\t\t\t\t\tfor ( let mi = 0, miLen = materials.length; mi < miLen; mi ++ ) {\n\n\t\t\t\t\t\tconst sourceMaterial = materials[ mi ];\n\t\t\t\t\t\tconst materialHash = sourceMaterial.name + '_' + sourceMaterial.smooth + '_' + hasVertexColors;\n\t\t\t\t\t\tlet material = state.materials[ materialHash ];\n\n\t\t\t\t\t\tif ( this.materials !== null ) {\n\n\t\t\t\t\t\t\tmaterial = this.materials.create( sourceMaterial.name ); // mtl etc. loaders probably can't create line materials correctly, copy properties to a line material.\n\n\t\t\t\t\t\t\tif ( isLine && material && ! ( material instanceof THREE.LineBasicMaterial ) ) {\n\n\t\t\t\t\t\t\t\tconst materialLine = new THREE.LineBasicMaterial();\n\t\t\t\t\t\t\t\tTHREE.Material.prototype.copy.call( materialLine, material );\n\t\t\t\t\t\t\t\tmaterialLine.color.copy( material.color );\n\t\t\t\t\t\t\t\tmaterial = materialLine;\n\n\t\t\t\t\t\t\t} else if ( isPoints && material && ! ( material instanceof THREE.PointsMaterial ) ) {\n\n\t\t\t\t\t\t\t\tconst materialPoints = new THREE.PointsMaterial( {\n\t\t\t\t\t\t\t\t\tsize: 10,\n\t\t\t\t\t\t\t\t\tsizeAttenuation: false\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\tTHREE.Material.prototype.copy.call( materialPoints, material );\n\t\t\t\t\t\t\t\tmaterialPoints.color.copy( material.color );\n\t\t\t\t\t\t\t\tmaterialPoints.map = material.map;\n\t\t\t\t\t\t\t\tmaterial = materialPoints;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( material === undefined ) {\n\n\t\t\t\t\t\t\tif ( isLine ) {\n\n\t\t\t\t\t\t\t\tmaterial = new THREE.LineBasicMaterial();\n\n\t\t\t\t\t\t\t} else if ( isPoints ) {\n\n\t\t\t\t\t\t\t\tmaterial = new THREE.PointsMaterial( {\n\t\t\t\t\t\t\t\t\tsize: 1,\n\t\t\t\t\t\t\t\t\tsizeAttenuation: false\n\t\t\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\tmaterial = new THREE.MeshPhongMaterial();\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tmaterial.name = sourceMaterial.name;\n\t\t\t\t\t\t\tmaterial.flatShading = sourceMaterial.smooth ? false : true;\n\t\t\t\t\t\t\tmaterial.vertexColors = hasVertexColors;\n\t\t\t\t\t\t\tstate.materials[ materialHash ] = material;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcreatedMaterials.push( material );\n\n\t\t\t\t\t} // Create mesh\n\n\n\t\t\t\t\tlet mesh;\n\n\t\t\t\t\tif ( createdMaterials.length > 1 ) {\n\n\t\t\t\t\t\tfor ( let mi = 0, miLen = materials.length; mi < miLen; mi ++ ) {\n\n\t\t\t\t\t\t\tconst sourceMaterial = materials[ mi ];\n\t\t\t\t\t\t\tbuffergeometry.addGroup( sourceMaterial.groupStart, sourceMaterial.groupCount, mi );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( isLine ) {\n\n\t\t\t\t\t\t\tmesh = new THREE.LineSegments( buffergeometry, createdMaterials );\n\n\t\t\t\t\t\t} else if ( isPoints ) {\n\n\t\t\t\t\t\t\tmesh = new THREE.Points( buffergeometry, createdMaterials );\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tmesh = new THREE.Mesh( buffergeometry, createdMaterials );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tif ( isLine ) {\n\n\t\t\t\t\t\t\tmesh = new THREE.LineSegments( buffergeometry, createdMaterials[ 0 ] );\n\n\t\t\t\t\t\t} else if ( isPoints ) {\n\n\t\t\t\t\t\t\tmesh = new THREE.Points( buffergeometry, createdMaterials[ 0 ] );\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tmesh = new THREE.Mesh( buffergeometry, createdMaterials[ 0 ] );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tmesh.name = object.name;\n\t\t\t\t\tcontainer.add( mesh );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t// if there is only the default parser state object with no geometry data, interpret data as point cloud\n\t\t\t\tif ( state.vertices.length > 0 ) {\n\n\t\t\t\t\tconst material = new THREE.PointsMaterial( {\n\t\t\t\t\t\tsize: 1,\n\t\t\t\t\t\tsizeAttenuation: false\n\t\t\t\t\t} );\n\t\t\t\t\tconst buffergeometry = new THREE.BufferGeometry();\n\t\t\t\t\tbuffergeometry.setAttribute( 'position', new THREE.Float32BufferAttribute( state.vertices, 3 ) );\n\n\t\t\t\t\tif ( state.colors.length > 0 && state.colors[ 0 ] !== undefined ) {\n\n\t\t\t\t\t\tbuffergeometry.setAttribute( 'color', new THREE.Float32BufferAttribute( state.colors, 3 ) );\n\t\t\t\t\t\tmaterial.vertexColors = true;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tconst points = new THREE.Points( buffergeometry, material );\n\t\t\t\t\tcontainer.add( points );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn container;\n\n\t\t}\n\n\t}\n\n\tTHREE.OBJLoader = OBJLoader;\n\n} )();\n","( function () {\n\n\tfunction computeTangents( geometry ) {\n\n\t\tgeometry.computeTangents();\n\t\tconsole.warn( 'THREE.BufferGeometryUtils: .computeTangents() has been removed. Use THREE.BufferGeometry.computeTangents() instead.' );\n\n\t}\n\t/**\n\t * @param {Array<BufferGeometry>} geometries\n\t * @param {Boolean} useGroups\n\t * @return {BufferGeometry}\n\t */\n\n\n\tfunction mergeBufferGeometries( geometries, useGroups = false ) {\n\n\t\tconst isIndexed = geometries[ 0 ].index !== null;\n\t\tconst attributesUsed = new Set( Object.keys( geometries[ 0 ].attributes ) );\n\t\tconst morphAttributesUsed = new Set( Object.keys( geometries[ 0 ].morphAttributes ) );\n\t\tconst attributes = {};\n\t\tconst morphAttributes = {};\n\t\tconst morphTargetsRelative = geometries[ 0 ].morphTargetsRelative;\n\t\tconst mergedGeometry = new THREE.BufferGeometry();\n\t\tlet offset = 0;\n\n\t\tfor ( let i = 0; i < geometries.length; ++ i ) {\n\n\t\t\tconst geometry = geometries[ i ];\n\t\t\tlet attributesCount = 0; // ensure that all geometries are indexed, or none\n\n\t\t\tif ( isIndexed !== ( geometry.index !== null ) ) {\n\n\t\t\t\tconsole.error( 'THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index ' + i + '. All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them.' );\n\t\t\t\treturn null;\n\n\t\t\t} // gather attributes, exit early if they're different\n\n\n\t\t\tfor ( const name in geometry.attributes ) {\n\n\t\t\t\tif ( ! attributesUsed.has( name ) ) {\n\n\t\t\t\t\tconsole.error( 'THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index ' + i + '. All geometries must have compatible attributes; make sure \"' + name + '\" attribute exists among all geometries, or in none of them.' );\n\t\t\t\t\treturn null;\n\n\t\t\t\t}\n\n\t\t\t\tif ( attributes[ name ] === undefined ) attributes[ name ] = [];\n\t\t\t\tattributes[ name ].push( geometry.attributes[ name ] );\n\t\t\t\tattributesCount ++;\n\n\t\t\t} // ensure geometries have the same number of attributes\n\n\n\t\t\tif ( attributesCount !== attributesUsed.size ) {\n\n\t\t\t\tconsole.error( 'THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index ' + i + '. Make sure all geometries have the same number of attributes.' );\n\t\t\t\treturn null;\n\n\t\t\t} // gather morph attributes, exit early if they're different\n\n\n\t\t\tif ( morphTargetsRelative !== geometry.morphTargetsRelative ) {\n\n\t\t\t\tconsole.error( 'THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index ' + i + '. .morphTargetsRelative must be consistent throughout all geometries.' );\n\t\t\t\treturn null;\n\n\t\t\t}\n\n\t\t\tfor ( const name in geometry.morphAttributes ) {\n\n\t\t\t\tif ( ! morphAttributesUsed.has( name ) ) {\n\n\t\t\t\t\tconsole.error( 'THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index ' + i + '. .morphAttributes must be consistent throughout all geometries.' );\n\t\t\t\t\treturn null;\n\n\t\t\t\t}\n\n\t\t\t\tif ( morphAttributes[ name ] === undefined ) morphAttributes[ name ] = [];\n\t\t\t\tmorphAttributes[ name ].push( geometry.morphAttributes[ name ] );\n\n\t\t\t} // gather .userData\n\n\n\t\t\tmergedGeometry.userData.mergedUserData = mergedGeometry.userData.mergedUserData || [];\n\t\t\tmergedGeometry.userData.mergedUserData.push( geometry.userData );\n\n\t\t\tif ( useGroups ) {\n\n\t\t\t\tlet count;\n\n\t\t\t\tif ( isIndexed ) {\n\n\t\t\t\t\tcount = geometry.index.count;\n\n\t\t\t\t} else if ( geometry.attributes.position !== undefined ) {\n\n\t\t\t\t\tcount = geometry.attributes.position.count;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tconsole.error( 'THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index ' + i + '. The geometry must have either an index or a position attribute' );\n\t\t\t\t\treturn null;\n\n\t\t\t\t}\n\n\t\t\t\tmergedGeometry.addGroup( offset, count, i );\n\t\t\t\toffset += count;\n\n\t\t\t}\n\n\t\t} // merge indices\n\n\n\t\tif ( isIndexed ) {\n\n\t\t\tlet indexOffset = 0;\n\t\t\tconst mergedIndex = [];\n\n\t\t\tfor ( let i = 0; i < geometries.length; ++ i ) {\n\n\t\t\t\tconst index = geometries[ i ].index;\n\n\t\t\t\tfor ( let j = 0; j < index.count; ++ j ) {\n\n\t\t\t\t\tmergedIndex.push( index.getX( j ) + indexOffset );\n\n\t\t\t\t}\n\n\t\t\t\tindexOffset += geometries[ i ].attributes.position.count;\n\n\t\t\t}\n\n\t\t\tmergedGeometry.setIndex( mergedIndex );\n\n\t\t} // merge attributes\n\n\n\t\tfor ( const name in attributes ) {\n\n\t\t\tconst mergedAttribute = mergeBufferAttributes( attributes[ name ] );\n\n\t\t\tif ( ! mergedAttribute ) {\n\n\t\t\t\tconsole.error( 'THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the ' + name + ' attribute.' );\n\t\t\t\treturn null;\n\n\t\t\t}\n\n\t\t\tmergedGeometry.setAttribute( name, mergedAttribute );\n\n\t\t} // merge morph attributes\n\n\n\t\tfor ( const name in morphAttributes ) {\n\n\t\t\tconst numMorphTargets = morphAttributes[ name ][ 0 ].length;\n\t\t\tif ( numMorphTargets === 0 ) break;\n\t\t\tmergedGeometry.morphAttributes = mergedGeometry.morphAttributes || {};\n\t\t\tmergedGeometry.morphAttributes[ name ] = [];\n\n\t\t\tfor ( let i = 0; i < numMorphTargets; ++ i ) {\n\n\t\t\t\tconst morphAttributesToMerge = [];\n\n\t\t\t\tfor ( let j = 0; j < morphAttributes[ name ].length; ++ j ) {\n\n\t\t\t\t\tmorphAttributesToMerge.push( morphAttributes[ name ][ j ][ i ] );\n\n\t\t\t\t}\n\n\t\t\t\tconst mergedMorphAttribute = mergeBufferAttributes( morphAttributesToMerge );\n\n\t\t\t\tif ( ! mergedMorphAttribute ) {\n\n\t\t\t\t\tconsole.error( 'THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the ' + name + ' morphAttribute.' );\n\t\t\t\t\treturn null;\n\n\t\t\t\t}\n\n\t\t\t\tmergedGeometry.morphAttributes[ name ].push( mergedMorphAttribute );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn mergedGeometry;\n\n\t}\n\t/**\n * @param {Array<BufferAttribute>} attributes\n * @return {BufferAttribute}\n */\n\n\n\tfunction mergeBufferAttributes( attributes ) {\n\n\t\tlet TypedArray;\n\t\tlet itemSize;\n\t\tlet normalized;\n\t\tlet arrayLength = 0;\n\n\t\tfor ( let i = 0; i < attributes.length; ++ i ) {\n\n\t\t\tconst attribute = attributes[ i ];\n\n\t\t\tif ( attribute.isInterleavedBufferAttribute ) {\n\n\t\t\t\tconsole.error( 'THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. InterleavedBufferAttributes are not supported.' );\n\t\t\t\treturn null;\n\n\t\t\t}\n\n\t\t\tif ( TypedArray === undefined ) TypedArray = attribute.array.constructor;\n\n\t\t\tif ( TypedArray !== attribute.array.constructor ) {\n\n\t\t\t\tconsole.error( 'THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. THREE.BufferAttribute.array must be of consistent array types across matching attributes.' );\n\t\t\t\treturn null;\n\n\t\t\t}\n\n\t\t\tif ( itemSize === undefined ) itemSize = attribute.itemSize;\n\n\t\t\tif ( itemSize !== attribute.itemSize ) {\n\n\t\t\t\tconsole.error( 'THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. THREE.BufferAttribute.itemSize must be consistent across matching attributes.' );\n\t\t\t\treturn null;\n\n\t\t\t}\n\n\t\t\tif ( normalized === undefined ) normalized = attribute.normalized;\n\n\t\t\tif ( normalized !== attribute.normalized ) {\n\n\t\t\t\tconsole.error( 'THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. THREE.BufferAttribute.normalized must be consistent across matching attributes.' );\n\t\t\t\treturn null;\n\n\t\t\t}\n\n\t\t\tarrayLength += attribute.array.length;\n\n\t\t}\n\n\t\tconst array = new TypedArray( arrayLength );\n\t\tlet offset = 0;\n\n\t\tfor ( let i = 0; i < attributes.length; ++ i ) {\n\n\t\t\tarray.set( attributes[ i ].array, offset );\n\t\t\toffset += attributes[ i ].array.length;\n\n\t\t}\n\n\t\treturn new THREE.BufferAttribute( array, itemSize, normalized );\n\n\t}\n\t/**\n * @param {Array<BufferAttribute>} attributes\n * @return {Array<InterleavedBufferAttribute>}\n */\n\n\n\tfunction interleaveAttributes( attributes ) {\n\n\t\t// Interleaves the provided attributes into an THREE.InterleavedBuffer and returns\n\t\t// a set of InterleavedBufferAttributes for each attribute\n\t\tlet TypedArray;\n\t\tlet arrayLength = 0;\n\t\tlet stride = 0; // calculate the the length and type of the interleavedBuffer\n\n\t\tfor ( let i = 0, l = attributes.length; i < l; ++ i ) {\n\n\t\t\tconst attribute = attributes[ i ];\n\t\t\tif ( TypedArray === undefined ) TypedArray = attribute.array.constructor;\n\n\t\t\tif ( TypedArray !== attribute.array.constructor ) {\n\n\t\t\t\tconsole.error( 'AttributeBuffers of different types cannot be interleaved' );\n\t\t\t\treturn null;\n\n\t\t\t}\n\n\t\t\tarrayLength += attribute.array.length;\n\t\t\tstride += attribute.itemSize;\n\n\t\t} // Create the set of buffer attributes\n\n\n\t\tconst interleavedBuffer = new THREE.InterleavedBuffer( new TypedArray( arrayLength ), stride );\n\t\tlet offset = 0;\n\t\tconst res = [];\n\t\tconst getters = [ 'getX', 'getY', 'getZ', 'getW' ];\n\t\tconst setters = [ 'setX', 'setY', 'setZ', 'setW' ];\n\n\t\tfor ( let j = 0, l = attributes.length; j < l; j ++ ) {\n\n\t\t\tconst attribute = attributes[ j ];\n\t\t\tconst itemSize = attribute.itemSize;\n\t\t\tconst count = attribute.count;\n\t\t\tconst iba = new THREE.InterleavedBufferAttribute( interleavedBuffer, itemSize, offset, attribute.normalized );\n\t\t\tres.push( iba );\n\t\t\toffset += itemSize; // Move the data for each attribute into the new interleavedBuffer\n\t\t\t// at the appropriate offset\n\n\t\t\tfor ( let c = 0; c < count; c ++ ) {\n\n\t\t\t\tfor ( let k = 0; k < itemSize; k ++ ) {\n\n\t\t\t\t\tiba[ setters[ k ] ]( c, attribute[ getters[ k ] ]( c ) );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn res;\n\n\t}\n\t/**\n * @param {Array<BufferGeometry>} geometry\n * @return {number}\n */\n\n\n\tfunction estimateBytesUsed( geometry ) {\n\n\t\t// Return the estimated memory used by this geometry in bytes\n\t\t// Calculate using itemSize, count, and BYTES_PER_ELEMENT to account\n\t\t// for InterleavedBufferAttributes.\n\t\tlet mem = 0;\n\n\t\tfor ( const name in geometry.attributes ) {\n\n\t\t\tconst attr = geometry.getAttribute( name );\n\t\t\tmem += attr.count * attr.itemSize * attr.array.BYTES_PER_ELEMENT;\n\n\t\t}\n\n\t\tconst indices = geometry.getIndex();\n\t\tmem += indices ? indices.count * indices.itemSize * indices.array.BYTES_PER_ELEMENT : 0;\n\t\treturn mem;\n\n\t}\n\t/**\n * @param {BufferGeometry} geometry\n * @param {number} tolerance\n * @return {BufferGeometry>}\n */\n\n\n\tfunction mergeVertices( geometry, tolerance = 1e-4 ) {\n\n\t\ttolerance = Math.max( tolerance, Number.EPSILON ); // Generate an index buffer if the geometry doesn't have one, or optimize it\n\t\t// if it's already available.\n\n\t\tconst hashToIndex = {};\n\t\tconst indices = geometry.getIndex();\n\t\tconst positions = geometry.getAttribute( 'position' );\n\t\tconst vertexCount = indices ? indices.count : positions.count; // next value for triangle indices\n\n\t\tlet nextIndex = 0; // attributes and new attribute arrays\n\n\t\tconst attributeNames = Object.keys( geometry.attributes );\n\t\tconst attrArrays = {};\n\t\tconst morphAttrsArrays = {};\n\t\tconst newIndices = [];\n\t\tconst getters = [ 'getX', 'getY', 'getZ', 'getW' ]; // initialize the arrays\n\n\t\tfor ( let i = 0, l = attributeNames.length; i < l; i ++ ) {\n\n\t\t\tconst name = attributeNames[ i ];\n\t\t\tattrArrays[ name ] = [];\n\t\t\tconst morphAttr = geometry.morphAttributes[ name ];\n\n\t\t\tif ( morphAttr ) {\n\n\t\t\t\tmorphAttrsArrays[ name ] = new Array( morphAttr.length ).fill().map( () => [] );\n\n\t\t\t}\n\n\t\t} // convert the error tolerance to an amount of decimal places to truncate to\n\n\n\t\tconst decimalShift = Math.log10( 1 / tolerance );\n\t\tconst shiftMultiplier = Math.pow( 10, decimalShift );\n\n\t\tfor ( let i = 0; i < vertexCount; i ++ ) {\n\n\t\t\tconst index = indices ? indices.getX( i ) : i; // Generate a hash for the vertex attributes at the current index 'i'\n\n\t\t\tlet hash = '';\n\n\t\t\tfor ( let j = 0, l = attributeNames.length; j < l; j ++ ) {\n\n\t\t\t\tconst name = attributeNames[ j ];\n\t\t\t\tconst attribute = geometry.getAttribute( name );\n\t\t\t\tconst itemSize = attribute.itemSize;\n\n\t\t\t\tfor ( let k = 0; k < itemSize; k ++ ) {\n\n\t\t\t\t\t// double tilde truncates the decimal value\n\t\t\t\t\thash += `${~ ~ ( attribute[ getters[ k ] ]( index ) * shiftMultiplier )},`;\n\n\t\t\t\t}\n\n\t\t\t} // Add another reference to the vertex if it's already\n\t\t\t// used by another index\n\n\n\t\t\tif ( hash in hashToIndex ) {\n\n\t\t\t\tnewIndices.push( hashToIndex[ hash ] );\n\n\t\t\t} else {\n\n\t\t\t\t// copy data to the new index in the attribute arrays\n\t\t\t\tfor ( let j = 0, l = attributeNames.length; j < l; j ++ ) {\n\n\t\t\t\t\tconst name = attributeNames[ j ];\n\t\t\t\t\tconst attribute = geometry.getAttribute( name );\n\t\t\t\t\tconst morphAttr = geometry.morphAttributes[ name ];\n\t\t\t\t\tconst itemSize = attribute.itemSize;\n\t\t\t\t\tconst newarray = attrArrays[ name ];\n\t\t\t\t\tconst newMorphArrays = morphAttrsArrays[ name ];\n\n\t\t\t\t\tfor ( let k = 0; k < itemSize; k ++ ) {\n\n\t\t\t\t\t\tconst getterFunc = getters[ k ];\n\t\t\t\t\t\tnewarray.push( attribute[ getterFunc ]( index ) );\n\n\t\t\t\t\t\tif ( morphAttr ) {\n\n\t\t\t\t\t\t\tfor ( let m = 0, ml = morphAttr.length; m < ml; m ++ ) {\n\n\t\t\t\t\t\t\t\tnewMorphArrays[ m ].push( morphAttr[ m ][ getterFunc ]( index ) );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\thashToIndex[ hash ] = nextIndex;\n\t\t\t\tnewIndices.push( nextIndex );\n\t\t\t\tnextIndex ++;\n\n\t\t\t}\n\n\t\t} // Generate typed arrays from new attribute arrays and update\n\t\t// the attributeBuffers\n\n\n\t\tconst result = geometry.clone();\n\n\t\tfor ( let i = 0, l = attributeNames.length; i < l; i ++ ) {\n\n\t\t\tconst name = attributeNames[ i ];\n\t\t\tconst oldAttribute = geometry.getAttribute( name );\n\t\t\tconst buffer = new oldAttribute.array.constructor( attrArrays[ name ] );\n\t\t\tconst attribute = new THREE.BufferAttribute( buffer, oldAttribute.itemSize, oldAttribute.normalized );\n\t\t\tresult.setAttribute( name, attribute ); // Update the attribute arrays\n\n\t\t\tif ( name in morphAttrsArrays ) {\n\n\t\t\t\tfor ( let j = 0; j < morphAttrsArrays[ name ].length; j ++ ) {\n\n\t\t\t\t\tconst oldMorphAttribute = geometry.morphAttributes[ name ][ j ];\n\t\t\t\t\tconst buffer = new oldMorphAttribute.array.constructor( morphAttrsArrays[ name ][ j ] );\n\t\t\t\t\tconst morphAttribute = new THREE.BufferAttribute( buffer, oldMorphAttribute.itemSize, oldMorphAttribute.normalized );\n\t\t\t\t\tresult.morphAttributes[ name ][ j ] = morphAttribute;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} // indices\n\n\n\t\tresult.setIndex( newIndices );\n\t\treturn result;\n\n\t}\n\t/**\n * @param {BufferGeometry} geometry\n * @param {number} drawMode\n * @return {BufferGeometry>}\n */\n\n\n\tfunction toTrianglesDrawMode( geometry, drawMode ) {\n\n\t\tif ( drawMode === THREE.TrianglesDrawMode ) {\n\n\t\t\tconsole.warn( 'THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles.' );\n\t\t\treturn geometry;\n\n\t\t}\n\n\t\tif ( drawMode === THREE.TriangleFanDrawMode || drawMode === THREE.TriangleStripDrawMode ) {\n\n\t\t\tlet index = geometry.getIndex(); // generate index if not present\n\n\t\t\tif ( index === null ) {\n\n\t\t\t\tconst indices = [];\n\t\t\t\tconst position = geometry.getAttribute( 'position' );\n\n\t\t\t\tif ( position !== undefined ) {\n\n\t\t\t\t\tfor ( let i = 0; i < position.count; i ++ ) {\n\n\t\t\t\t\t\tindices.push( i );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tgeometry.setIndex( indices );\n\t\t\t\t\tindex = geometry.getIndex();\n\n\t\t\t\t} else {\n\n\t\t\t\t\tconsole.error( 'THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible.' );\n\t\t\t\t\treturn geometry;\n\n\t\t\t\t}\n\n\t\t\t} //\n\n\n\t\t\tconst numberOfTriangles = index.count - 2;\n\t\t\tconst newIndices = [];\n\n\t\t\tif ( drawMode === THREE.TriangleFanDrawMode ) {\n\n\t\t\t\t// gl.TRIANGLE_FAN\n\t\t\t\tfor ( let i = 1; i <= numberOfTriangles; i ++ ) {\n\n\t\t\t\t\tnewIndices.push( index.getX( 0 ) );\n\t\t\t\t\tnewIndices.push( index.getX( i ) );\n\t\t\t\t\tnewIndices.push( index.getX( i + 1 ) );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t// gl.TRIANGLE_STRIP\n\t\t\t\tfor ( let i = 0; i < numberOfTriangles; i ++ ) {\n\n\t\t\t\t\tif ( i % 2 === 0 ) {\n\n\t\t\t\t\t\tnewIndices.push( index.getX( i ) );\n\t\t\t\t\t\tnewIndices.push( index.getX( i + 1 ) );\n\t\t\t\t\t\tnewIndices.push( index.getX( i + 2 ) );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tnewIndices.push( index.getX( i + 2 ) );\n\t\t\t\t\t\tnewIndices.push( index.getX( i + 1 ) );\n\t\t\t\t\t\tnewIndices.push( index.getX( i ) );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( newIndices.length / 3 !== numberOfTriangles ) {\n\n\t\t\t\tconsole.error( 'THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.' );\n\n\t\t\t} // build final geometry\n\n\n\t\t\tconst newGeometry = geometry.clone();\n\t\t\tnewGeometry.setIndex( newIndices );\n\t\t\tnewGeometry.clearGroups();\n\t\t\treturn newGeometry;\n\n\t\t} else {\n\n\t\t\tconsole.error( 'THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:', drawMode );\n\t\t\treturn geometry;\n\n\t\t}\n\n\t}\n\t/**\n * Calculates the morphed attributes of a morphed/skinned THREE.BufferGeometry.\n * Helpful for Raytracing or Decals.\n * @param {Mesh | Line | Points} object An instance of Mesh, Line or Points.\n * @return {Object} An Object with original position/normal attributes and morphed ones.\n */\n\n\n\tfunction computeMorphedAttributes( object ) {\n\n\t\tif ( object.geometry.isBufferGeometry !== true ) {\n\n\t\t\tconsole.error( 'THREE.BufferGeometryUtils: Geometry is not of type THREE.BufferGeometry.' );\n\t\t\treturn null;\n\n\t\t}\n\n\t\tconst _vA = new THREE.Vector3();\n\n\t\tconst _vB = new THREE.Vector3();\n\n\t\tconst _vC = new THREE.Vector3();\n\n\t\tconst _tempA = new THREE.Vector3();\n\n\t\tconst _tempB = new THREE.Vector3();\n\n\t\tconst _tempC = new THREE.Vector3();\n\n\t\tconst _morphA = new THREE.Vector3();\n\n\t\tconst _morphB = new THREE.Vector3();\n\n\t\tconst _morphC = new THREE.Vector3();\n\n\t\tfunction _calculateMorphedAttributeData( object, material, attribute, morphAttribute, morphTargetsRelative, a, b, c, modifiedAttributeArray ) {\n\n\t\t\t_vA.fromBufferAttribute( attribute, a );\n\n\t\t\t_vB.fromBufferAttribute( attribute, b );\n\n\t\t\t_vC.fromBufferAttribute( attribute, c );\n\n\t\t\tconst morphInfluences = object.morphTargetInfluences;\n\n\t\t\tif ( material.morphTargets && morphAttribute && morphInfluences ) {\n\n\t\t\t\t_morphA.set( 0, 0, 0 );\n\n\t\t\t\t_morphB.set( 0, 0, 0 );\n\n\t\t\t\t_morphC.set( 0, 0, 0 );\n\n\t\t\t\tfor ( let i = 0, il = morphAttribute.length; i < il; i ++ ) {\n\n\t\t\t\t\tconst influence = morphInfluences[ i ];\n\t\t\t\t\tconst morph = morphAttribute[ i ];\n\t\t\t\t\tif ( influence === 0 ) continue;\n\n\t\t\t\t\t_tempA.fromBufferAttribute( morph, a );\n\n\t\t\t\t\t_tempB.fromBufferAttribute( morph, b );\n\n\t\t\t\t\t_tempC.fromBufferAttribute( morph, c );\n\n\t\t\t\t\tif ( morphTargetsRelative ) {\n\n\t\t\t\t\t\t_morphA.addScaledVector( _tempA, influence );\n\n\t\t\t\t\t\t_morphB.addScaledVector( _tempB, influence );\n\n\t\t\t\t\t\t_morphC.addScaledVector( _tempC, influence );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t_morphA.addScaledVector( _tempA.sub( _vA ), influence );\n\n\t\t\t\t\t\t_morphB.addScaledVector( _tempB.sub( _vB ), influence );\n\n\t\t\t\t\t\t_morphC.addScaledVector( _tempC.sub( _vC ), influence );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t_vA.add( _morphA );\n\n\t\t\t\t_vB.add( _morphB );\n\n\t\t\t\t_vC.add( _morphC );\n\n\t\t\t}\n\n\t\t\tif ( object.isSkinnedMesh ) {\n\n\t\t\t\tobject.boneTransform( a, _vA );\n\t\t\t\tobject.boneTransform( b, _vB );\n\t\t\t\tobject.boneTransform( c, _vC );\n\n\t\t\t}\n\n\t\t\tmodifiedAttributeArray[ a * 3 + 0 ] = _vA.x;\n\t\t\tmodifiedAttributeArray[ a * 3 + 1 ] = _vA.y;\n\t\t\tmodifiedAttributeArray[ a * 3 + 2 ] = _vA.z;\n\t\t\tmodifiedAttributeArray[ b * 3 + 0 ] = _vB.x;\n\t\t\tmodifiedAttributeArray[ b * 3 + 1 ] = _vB.y;\n\t\t\tmodifiedAttributeArray[ b * 3 + 2 ] = _vB.z;\n\t\t\tmodifiedAttributeArray[ c * 3 + 0 ] = _vC.x;\n\t\t\tmodifiedAttributeArray[ c * 3 + 1 ] = _vC.y;\n\t\t\tmodifiedAttributeArray[ c * 3 + 2 ] = _vC.z;\n\n\t\t}\n\n\t\tconst geometry = object.geometry;\n\t\tconst material = object.material;\n\t\tlet a, b, c;\n\t\tconst index = geometry.index;\n\t\tconst positionAttribute = geometry.attributes.position;\n\t\tconst morphPosition = geometry.morphAttributes.position;\n\t\tconst morphTargetsRelative = geometry.morphTargetsRelative;\n\t\tconst normalAttribute = geometry.attributes.normal;\n\t\tconst morphNormal = geometry.morphAttributes.position;\n\t\tconst groups = geometry.groups;\n\t\tconst drawRange = geometry.drawRange;\n\t\tlet i, j, il, jl;\n\t\tlet group, groupMaterial;\n\t\tlet start, end;\n\t\tconst modifiedPosition = new Float32Array( positionAttribute.count * positionAttribute.itemSize );\n\t\tconst modifiedNormal = new Float32Array( normalAttribute.count * normalAttribute.itemSize );\n\n\t\tif ( index !== null ) {\n\n\t\t\t// indexed buffer geometry\n\t\t\tif ( Array.isArray( material ) ) {\n\n\t\t\t\tfor ( i = 0, il = groups.length; i < il; i ++ ) {\n\n\t\t\t\t\tgroup = groups[ i ];\n\t\t\t\t\tgroupMaterial = material[ group.materialIndex ];\n\t\t\t\t\tstart = Math.max( group.start, drawRange.start );\n\t\t\t\t\tend = Math.min( group.start + group.count, drawRange.start + drawRange.count );\n\n\t\t\t\t\tfor ( j = start, jl = end; j < jl; j += 3 ) {\n\n\t\t\t\t\t\ta = index.getX( j );\n\t\t\t\t\t\tb = index.getX( j + 1 );\n\t\t\t\t\t\tc = index.getX( j + 2 );\n\n\t\t\t\t\t\t_calculateMorphedAttributeData( object, groupMaterial, positionAttribute, morphPosition, morphTargetsRelative, a, b, c, modifiedPosition );\n\n\t\t\t\t\t\t_calculateMorphedAttributeData( object, groupMaterial, normalAttribute, morphNormal, morphTargetsRelative, a, b, c, modifiedNormal );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tstart = Math.max( 0, drawRange.start );\n\t\t\t\tend = Math.min( index.count, drawRange.start + drawRange.count );\n\n\t\t\t\tfor ( i = start, il = end; i < il; i += 3 ) {\n\n\t\t\t\t\ta = index.getX( i );\n\t\t\t\t\tb = index.getX( i + 1 );\n\t\t\t\t\tc = index.getX( i + 2 );\n\n\t\t\t\t\t_calculateMorphedAttributeData( object, material, positionAttribute, morphPosition, morphTargetsRelative, a, b, c, modifiedPosition );\n\n\t\t\t\t\t_calculateMorphedAttributeData( object, material, normalAttribute, morphNormal, morphTargetsRelative, a, b, c, modifiedNormal );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else if ( positionAttribute !== undefined ) {\n\n\t\t\t// non-indexed buffer geometry\n\t\t\tif ( Array.isArray( material ) ) {\n\n\t\t\t\tfor ( i = 0, il = groups.length; i < il; i ++ ) {\n\n\t\t\t\t\tgroup = groups[ i ];\n\t\t\t\t\tgroupMaterial = material[ group.materialIndex ];\n\t\t\t\t\tstart = Math.max( group.start, drawRange.start );\n\t\t\t\t\tend = Math.min( group.start + group.count, drawRange.start + drawRange.count );\n\n\t\t\t\t\tfor ( j = start, jl = end; j < jl; j += 3 ) {\n\n\t\t\t\t\t\ta = j;\n\t\t\t\t\t\tb = j + 1;\n\t\t\t\t\t\tc = j + 2;\n\n\t\t\t\t\t\t_calculateMorphedAttributeData( object, groupMaterial, positionAttribute, morphPosition, morphTargetsRelative, a, b, c, modifiedPosition );\n\n\t\t\t\t\t\t_calculateMorphedAttributeData( object, groupMaterial, normalAttribute, morphNormal, morphTargetsRelative, a, b, c, modifiedNormal );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tstart = Math.max( 0, drawRange.start );\n\t\t\t\tend = Math.min( positionAttribute.count, drawRange.start + drawRange.count );\n\n\t\t\t\tfor ( i = start, il = end; i < il; i += 3 ) {\n\n\t\t\t\t\ta = i;\n\t\t\t\t\tb = i + 1;\n\t\t\t\t\tc = i + 2;\n\n\t\t\t\t\t_calculateMorphedAttributeData( object, material, positionAttribute, morphPosition, morphTargetsRelative, a, b, c, modifiedPosition );\n\n\t\t\t\t\t_calculateMorphedAttributeData( object, material, normalAttribute, morphNormal, morphTargetsRelative, a, b, c, modifiedNormal );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst morphedPositionAttribute = new THREE.Float32BufferAttribute( modifiedPosition, 3 );\n\t\tconst morphedNormalAttribute = new THREE.Float32BufferAttribute( modifiedNormal, 3 );\n\t\treturn {\n\t\t\tpositionAttribute: positionAttribute,\n\t\t\tnormalAttribute: normalAttribute,\n\t\t\tmorphedPositionAttribute: morphedPositionAttribute,\n\t\t\tmorphedNormalAttribute: morphedNormalAttribute\n\t\t};\n\n\t}\n\n\tTHREE.BufferGeometryUtils = {};\n\tTHREE.BufferGeometryUtils.computeMorphedAttributes = computeMorphedAttributes;\n\tTHREE.BufferGeometryUtils.computeTangents = computeTangents;\n\tTHREE.BufferGeometryUtils.estimateBytesUsed = estimateBytesUsed;\n\tTHREE.BufferGeometryUtils.interleaveAttributes = interleaveAttributes;\n\tTHREE.BufferGeometryUtils.mergeBufferAttributes = mergeBufferAttributes;\n\tTHREE.BufferGeometryUtils.mergeBufferGeometries = mergeBufferGeometries;\n\tTHREE.BufferGeometryUtils.mergeVertices = mergeVertices;\n\tTHREE.BufferGeometryUtils.toTrianglesDrawMode = toTrianglesDrawMode;\n\n} )();\n","var createLayout = require('layout-bmfont-text')\nvar inherits = require('inherits')\nvar createIndices = require('quad-indices')\nvar buffer = require('three-buffer-vertex-data')\nvar assign = require('object-assign')\n\nvar vertices = require('./lib/vertices')\nvar utils = require('./lib/utils')\n\n\nmodule.exports = function createTextGeometry (opt) {\n return new TextGeometry(opt)\n}\n\nclass TextGeometry extends THREE.BufferGeometry {\n constructor (opt) {\n super()\n \n if (typeof opt === 'string') {\n opt = { text: opt }\n }\n\n // use these as default values for any subsequent\n // calls to update()\n this._opt = assign({}, opt)\n\n // also do an initial setup...\n if (opt) this.update(opt)\n }\n\n update(opt) {\n if (typeof opt === 'string') {\n opt = { text: opt }\n }\n\n // use constructor defaults\n opt = assign({}, this._opt, opt)\n\n if (!opt.font) {\n throw new TypeError('must specify a { font } in options')\n }\n\n this.layout = createLayout(opt)\n\n // get vec2 texcoords\n var flipY = opt.flipY !== false\n\n // the desired BMFont data\n var font = opt.font\n\n // determine texture size from font file\n var texWidth = font.common.scaleW\n var texHeight = font.common.scaleH\n\n // get visible glyphs\n var glyphs = this.layout.glyphs.filter(function (glyph) {\n var bitmap = glyph.data\n return bitmap.width * bitmap.height > 0\n })\n\n // provide visible glyphs for convenience\n this.visibleGlyphs = glyphs\n\n // get common vertex data\n var positions = vertices.positions(glyphs)\n var uvs = vertices.uvs(glyphs, texWidth, texHeight, flipY)\n var indices = createIndices({\n clockwise: true,\n type: 'uint16',\n count: glyphs.length\n })\n\n // update vertex data\n buffer.index(this, indices, 1, 'uint16')\n buffer.attr(this, 'position', positions, 2)\n buffer.attr(this, 'uv', uvs, 2)\n\n // update multipage data\n if (!opt.multipage && 'page' in this.attributes) {\n // disable multipage rendering\n this.removeAttribute('page')\n } else if (opt.multipage) {\n var pages = vertices.pages(glyphs)\n // enable multipage rendering\n buffer.attr(this, 'page', pages, 1)\n }\n }\n\n computeBoundingSphere() {\n if (this.boundingSphere === null) {\n this.boundingSphere = new THREE.Sphere()\n }\n\n var positions = this.attributes.position.array\n var itemSize = this.attributes.position.itemSize\n if (!positions || !itemSize || positions.length < 2) {\n this.boundingSphere.radius = 0\n this.boundingSphere.center.set(0, 0, 0)\n return\n }\n utils.computeSphere(positions, this.boundingSphere)\n if (isNaN(this.boundingSphere.radius)) {\n console.error('THREE.BufferGeometry.computeBoundingSphere(): ' +\n 'Computed radius is NaN. The ' +\n '\"position\" attribute is likely to have NaN values.')\n }\n }\n\n computeBoundingBox() {\n if (this.boundingBox === null) {\n this.boundingBox = new THREE.Box3()\n }\n\n var bbox = this.boundingBox\n var positions = this.attributes.position.array\n var itemSize = this.attributes.position.itemSize\n if (!positions || !itemSize || positions.length < 2) {\n bbox.makeEmpty()\n return\n }\n utils.computeBox(positions, bbox)\n }\n\n}\n","module.exports={\"name\":\"aframe\",\"version\":\"1.2.0\",\"description\":\"A web framework for building virtual reality experiences.\",\"homepage\":\"https://aframe.io/\",\"main\":\"dist/aframe-master.js\",\"scripts\":{\"browserify\":\"browserify src/index.js -s 'AFRAME' -p browserify-derequire\",\"build\":\"shx mkdir -p build/ && npm run browserify -- --debug -t [ envify --INSPECTOR_VERSION dev ] -o build/aframe.js\",\"codecov\":\"codecov\",\"dev\":\"npm run build && cross-env INSPECTOR_VERSION=dev node ./scripts/budo -t envify\",\"dist\":\"node scripts/updateVersionLog.js && npm run dist:min && npm run dist:max\",\"dist:max\":\"npm run browserify -s -- --debug | exorcist dist/aframe-master.js.map > dist/aframe-master.js\",\"dist:min\":\"npm run browserify -s -- --debug -p [ minifyify --map aframe-master.min.js.map --output dist/aframe-master.min.js.map ] -o dist/aframe-master.min.js\",\"docs\":\"markserv --dir docs --port 9001\",\"preghpages\":\"node ./scripts/preghpages.js\",\"ghpages\":\"ghpages -p gh-pages/\",\"lint\":\"semistandard -v | snazzy\",\"lint:fix\":\"semistandard --fix\",\"precommit\":\"npm run lint\",\"prepush\":\"node scripts/testOnlyCheck.js\",\"prerelease\":\"node scripts/release.js 1.1.0 1.2.0\",\"start\":\"npm run dev\",\"start:https\":\"cross-env SSL=true npm run dev\",\"test\":\"karma start ./tests/karma.conf.js\",\"test:docs\":\"node scripts/docsLint.js\",\"test:firefox\":\"npm test -- --browsers Firefox\",\"test:chrome\":\"npm test -- --browsers Chrome\",\"test:nobrowser\":\"NO_BROWSER=true npm test\",\"test:node\":\"mocha --ui tdd tests/node\"},\"repository\":\"aframevr/aframe\",\"license\":\"MIT\",\"files\":[\"dist/*\",\"docs/**/*\",\"src/**/*\",\"vendor/**/*\"],\"dependencies\":{\"custom-event-polyfill\":\"^1.0.6\",\"debug\":\"ngokevin/debug#noTimestamp\",\"deep-assign\":\"^2.0.0\",\"document-register-element\":\"dmarcos/document-register-element#8ccc532b7f3744be954574caf3072a5fd260ca90\",\"load-bmfont\":\"^1.2.3\",\"object-assign\":\"^4.0.1\",\"present\":\"0.0.6\",\"promise-polyfill\":\"^3.1.0\",\"super-animejs\":\"^3.1.0\",\"super-three\":\"^0.133.5\",\"three-bmfont-text\":\"dmarcos/three-bmfont-text#21d017046216e318362c48abd1a48bddfb6e0733\",\"webvr-polyfill\":\"^0.10.12\"},\"devDependencies\":{\"browserify\":\"^13.1.0\",\"browserify-css\":\"^0.8.4\",\"browserify-derequire\":\"^0.9.4\",\"browserify-istanbul\":\"^2.0.0\",\"budo\":\"^9.2.0\",\"chai\":\"^3.5.0\",\"chai-shallow-deep-equal\":\"^1.4.0\",\"chalk\":\"^1.1.3\",\"codecov\":\"^1.0.1\",\"cross-env\":\"^5.0.1\",\"envify\":\"^3.4.1\",\"exorcist\":\"^0.4.0\",\"ghpages\":\"0.0.8\",\"git-rev\":\"^0.2.1\",\"glob\":\"^7.1.1\",\"husky\":\"^0.11.7\",\"istanbul\":\"^0.4.5\",\"jsdom\":\"^9.11.0\",\"karma\":\"1.4.1\",\"karma-browserify\":\"^5.1.0\",\"karma-chai-shallow-deep-equal\":\"0.0.4\",\"karma-chrome-launcher\":\"^2.0.0\",\"karma-coverage\":\"^1.1.1\",\"karma-env-preprocessor\":\"^0.1.1\",\"karma-firefox-launcher\":\"^1.2.0\",\"karma-mocha\":\"^1.1.1\",\"karma-mocha-reporter\":\"^2.1.0\",\"karma-sinon-chai\":\"1.2.4\",\"lolex\":\"^1.5.1\",\"markserv\":\"github:sukima/markserv#feature/fix-broken-websoketio-link\",\"minifyify\":\"^7.3.3\",\"mocha\":\"^3.0.2\",\"mozilla-download\":\"^1.1.1\",\"replace-in-file\":\"^2.5.3\",\"semistandard\":\"^9.0.0\",\"shelljs\":\"^0.7.7\",\"shx\":\"^0.2.2\",\"sinon\":\"^1.17.5\",\"sinon-chai\":\"2.8.0\",\"snazzy\":\"^5.0.0\",\"too-wordy\":\"ngokevin/too-wordy\",\"uglifyjs\":\"^2.4.10\",\"write-good\":\"^0.9.1\"},\"link\":true,\"browserify\":{\"transform\":[\"browserify-css\",\"envify\"]},\"semistandard\":{\"ignore\":[\"build/**\",\"dist/**\",\"examples/**/shaders/*.js\",\"**/vendor/**\"]},\"keywords\":[\"3d\",\"aframe\",\"cardboard\",\"components\",\"oculus\",\"three\",\"three.js\",\"rift\",\"vive\",\"vr\",\"web-components\",\"webvr\"],\"browserify-css\":{\"minify\":true},\"engines\":{\"node\":\">= 4.6.0\",\"npm\":\"^2.15.9\"}}","/* global THREE, XRRigidTransform */\nvar registerComponent = require('../core/component').registerComponent;\nvar bind = require('../utils/bind');\n\nvar trackedControlsUtils = require('../utils/tracked-controls');\nvar checkControllerPresentAndSetup = trackedControlsUtils.checkControllerPresentAndSetup;\n\nvar LEFT_HAND_MODEL_URL = 'https://cdn.aframe.io/controllers/oculus-hands/v3/left.glb';\nvar RIGHT_HAND_MODEL_URL = 'https://cdn.aframe.io/controllers/oculus-hands/v3/right.glb';\n\nvar BONE_PREFIX = {\n left: 'b_l_',\n right: 'b_r_'\n};\n\nvar JOINTS = [\n 'wrist',\n 'thumb-metacarpal',\n 'thumb-phalanx-proximal',\n 'thumb-phalanx-distal',\n 'thumb-tip',\n 'index-finger-metacarpal',\n 'index-finger-phalanx-proximal',\n 'index-finger-phalanx-intermediate',\n 'index-finger-phalanx-distal',\n 'index-finger-tip',\n 'middle-finger-metacarpal',\n 'middle-finger-phalanx-proximal',\n 'middle-finger-phalanx-intermediate',\n 'middle-finger-phalanx-distal',\n 'middle-finger-tip',\n 'ring-finger-metacarpal',\n 'ring-finger-phalanx-proximal',\n 'ring-finger-phalanx-intermediate',\n 'ring-finger-phalanx-distal',\n 'ring-finger-tip',\n 'pinky-finger-metacarpal',\n 'pinky-finger-phalanx-proximal',\n 'pinky-finger-phalanx-intermediate',\n 'pinky-finger-phalanx-distal',\n 'pinky-finger-tip'\n];\n\nvar BONE_MAPPING = {\n 'wrist': 'wrist',\n 'thumb-metacarpal': 'thumb1',\n 'thumb-phalanx-proximal': 'thumb2',\n 'thumb-phalanx-distal': 'thumb3',\n 'thumb-tip': 'thumb_null',\n 'index-finger-metacarpal': 'index0',\n 'index-finger-phalanx-proximal': 'index1',\n 'index-finger-phalanx-intermediate': 'index2',\n 'index-finger-phalanx-distal': 'index3',\n 'index-finger-tip': 'index_null',\n 'middle-finger-metacarpal': 'middle0',\n 'middle-finger-phalanx-proximal': 'middle1',\n 'middle-finger-phalanx-intermediate': 'middle2',\n 'middle-finger-phalanx-distal': 'middle3',\n 'middle-finger-tip': 'middle_null',\n 'ring-finger-metacarpal': 'ring0',\n 'ring-finger-phalanx-proximal': 'ring1',\n 'ring-finger-phalanx-intermediate': 'ring2',\n 'ring-finger-phalanx-distal': 'ring3',\n 'ring-finger-tip': 'ring_null',\n 'pinky-finger-metacarpal': 'pinky0',\n 'pinky-finger-phalanx-proximal': 'pinky1',\n 'pinky-finger-phalanx-intermediate': 'pinky2',\n 'pinky-finger-phalanx-distal': 'pinky3',\n 'pinky-finger-tip': 'pinky_null'\n};\n\nvar PINCH_START_DISTANCE = 0.015;\nvar PINCH_END_DISTANCE = 0.03;\nvar PINCH_POSITION_INTERPOLATION = 0.5;\n\n/**\n * Controls for hand tracking\n */\nmodule.exports.Component = registerComponent('hand-tracking-controls', {\n schema: {\n hand: {default: 'right', oneOf: ['left', 'right']},\n modelStyle: {default: 'mesh', oneOf: ['dots', 'mesh']},\n modelColor: {default: 'white'}\n },\n\n bindMethods: function () {\n this.onControllersUpdate = bind(this.onControllersUpdate, this);\n this.checkIfControllerPresent = bind(this.checkIfControllerPresent, this);\n this.removeControllersUpdateListener = bind(this.removeControllersUpdateListener, this);\n },\n\n addEventListeners: function () {\n this.el.addEventListener('model-loaded', this.onModelLoaded);\n for (var i = 0; i < this.jointEls.length; ++i) {\n this.jointEls[i].object3D.visible = true;\n }\n },\n\n removeEventListeners: function () {\n this.el.removeEventListener('model-loaded', this.onModelLoaded);\n for (var i = 0; i < this.jointEls.length; ++i) {\n this.jointEls[i].object3D.visible = false;\n }\n },\n\n init: function () {\n var sceneEl = this.el.sceneEl;\n var webXROptionalAttributes = sceneEl.getAttribute('webxr').optionalFeatures;\n webXROptionalAttributes.push('hand-tracking');\n sceneEl.setAttribute('webxr', {optionalFeatures: webXROptionalAttributes});\n this.onModelLoaded = this.onModelLoaded.bind(this);\n this.jointEls = [];\n this.controllerPresent = false;\n this.isPinched = false;\n this.pinchEventDetail = {position: new THREE.Vector3()};\n this.indexTipPosition = new THREE.Vector3();\n\n this.bindMethods();\n\n this.updateReferenceSpace = this.updateReferenceSpace.bind(this);\n this.el.sceneEl.addEventListener('enter-vr', this.updateReferenceSpace);\n this.el.sceneEl.addEventListener('exit-vr', this.updateReferenceSpace);\n },\n\n updateReferenceSpace: function () {\n var self = this;\n var xrSession = this.el.sceneEl.xrSession;\n this.referenceSpace = undefined;\n if (!xrSession) { return; }\n var referenceSpaceType = self.el.sceneEl.systems.webxr.sessionReferenceSpaceType;\n xrSession.requestReferenceSpace(referenceSpaceType).then(function (referenceSpace) {\n self.referenceSpace = referenceSpace.getOffsetReferenceSpace(new XRRigidTransform({x: 0, y: 1.5, z: 0}));\n }).catch(function (error) {\n self.el.sceneEl.systems.webxr.warnIfFeatureNotRequested(referenceSpaceType, 'tracked-controls-webxr uses reference space ' + referenceSpaceType);\n throw error;\n });\n },\n\n checkIfControllerPresent: function () {\n var data = this.data;\n var hand = data.hand ? data.hand : undefined;\n checkControllerPresentAndSetup(\n this, '',\n {hand: hand, iterateControllerProfiles: true, handTracking: true});\n },\n\n play: function () {\n this.checkIfControllerPresent();\n this.addControllersUpdateListener();\n },\n\n tick: function () {\n var sceneEl = this.el.sceneEl;\n var controller = this.el.components['tracked-controls'] && this.el.components['tracked-controls'].controller;\n var frame = sceneEl.frame;\n var trackedControlsWebXR = this.el.components['tracked-controls-webxr'];\n if (!controller || !frame || !trackedControlsWebXR) { return; }\n if (controller.hand) {\n this.el.object3D.position.set(0, 0, 0);\n this.el.object3D.rotation.set(0, 0, 0);\n if (frame.getJointPose) { this.updateHandModel(); }\n this.detectGesture();\n }\n },\n\n updateHandModel: function () {\n if (this.data.modelStyle === 'dots') {\n this.updateHandDotsModel();\n }\n\n if (this.data.modelStyle === 'mesh') {\n this.updateHandMeshModel();\n }\n },\n\n getBone: function (name) {\n var bones = this.bones;\n for (var i = 0; i < bones.length; i++) {\n if (bones[i].name === name) { return bones[i]; }\n }\n return null;\n },\n\n updateHandMeshModel: function () {\n var frame = this.el.sceneEl.frame;\n var controller = this.el.components['tracked-controls'] && this.el.components['tracked-controls'].controller;\n var referenceSpace = this.referenceSpace;\n\n if (!controller || !this.mesh || !referenceSpace) { return; }\n this.mesh.visible = false;\n for (var inputjoint of controller.hand.values()) {\n var bone;\n var jointPose;\n var jointTransform;\n jointPose = frame.getJointPose(inputjoint, referenceSpace);\n if (!BONE_MAPPING[inputjoint.jointName]) { continue; }\n bone = this.getBone(BONE_PREFIX[this.data.hand] + BONE_MAPPING[inputjoint.jointName]);\n if (bone != null && jointPose) {\n jointTransform = jointPose.transform;\n this.mesh.visible = true;\n bone.position.copy(jointTransform.position).multiplyScalar(100);\n bone.quaternion.set(jointTransform.orientation.x, jointTransform.orientation.y, jointTransform.orientation.z, jointTransform.orientation.w);\n }\n }\n },\n\n updateHandDotsModel: function () {\n var frame = this.el.sceneEl.frame;\n var controller = this.el.components['tracked-controls'] && this.el.components['tracked-controls'].controller;\n var trackedControlsWebXR = this.el.components['tracked-controls-webxr'];\n var referenceSpace = trackedControlsWebXR.system.referenceSpace;\n var jointEl;\n var object3D;\n var jointPose;\n var i = 0;\n\n for (var inputjoint of controller.hand.values()) {\n jointEl = this.jointEls[i++];\n object3D = jointEl.object3D;\n jointPose = frame.getJointPose(inputjoint, referenceSpace);\n jointEl.object3D.visible = !!jointPose;\n if (!jointPose) { continue; }\n object3D.matrix.elements = jointPose.transform.matrix;\n object3D.matrix.decompose(object3D.position, object3D.rotation, object3D.scale);\n jointEl.setAttribute('scale', {x: jointPose.radius, y: jointPose.radius, z: jointPose.radius});\n }\n },\n\n detectGesture: function () {\n this.detectPinch();\n },\n\n detectPinch: (function () {\n var thumbTipPosition = new THREE.Vector3();\n return function () {\n var frame = this.el.sceneEl.frame;\n var indexTipPosition = this.indexTipPosition;\n var controller = this.el.components['tracked-controls'] && this.el.components['tracked-controls'].controller;\n var trackedControlsWebXR = this.el.components['tracked-controls-webxr'];\n var referenceSpace = this.referenceSpace || trackedControlsWebXR.system.referenceSpace;\n var indexTip = controller.hand.get('index-finger-tip');\n var thumbTip = controller.hand.get('thumb-tip');\n if (!indexTip ||\n !thumbTip) { return; }\n var indexTipPose = frame.getJointPose(indexTip, referenceSpace);\n var thumbTipPose = frame.getJointPose(thumbTip, referenceSpace);\n\n if (!indexTipPose || !thumbTipPose) { return; }\n\n thumbTipPosition.copy(thumbTipPose.transform.position);\n indexTipPosition.copy(indexTipPose.transform.position);\n\n var distance = indexTipPosition.distanceTo(thumbTipPosition);\n\n if (distance < PINCH_START_DISTANCE && this.isPinched === false) {\n this.isPinched = true;\n this.pinchEventDetail.position.copy(indexTipPosition).lerp(thumbTipPosition, PINCH_POSITION_INTERPOLATION);\n this.pinchEventDetail.position.y += 1.5;\n this.el.emit('pinchstarted', this.pinchEventDetail);\n }\n\n if (distance > PINCH_END_DISTANCE && this.isPinched === true) {\n this.isPinched = false;\n this.pinchEventDetail.position.copy(indexTipPosition).lerp(thumbTipPosition, PINCH_POSITION_INTERPOLATION);\n this.pinchEventDetail.position.y += 1.5;\n this.el.emit('pinchended', this.pinchEventDetail);\n }\n\n if (this.isPinched) {\n this.pinchEventDetail.position.copy(indexTipPosition).lerp(thumbTipPosition, PINCH_POSITION_INTERPOLATION);\n this.pinchEventDetail.position.y += 1.5;\n this.el.emit('pinchmoved', this.pinchEventDetail);\n }\n\n indexTipPosition.y += 1.5;\n };\n })(),\n\n pause: function () {\n this.removeEventListeners();\n this.removeControllersUpdateListener();\n },\n\n injectTrackedControls: function () {\n var el = this.el;\n var data = this.data;\n el.setAttribute('tracked-controls', {\n hand: data.hand,\n iterateControllerProfiles: true,\n handTrackingEnabled: true\n });\n this.initDefaultModel();\n },\n\n addControllersUpdateListener: function () {\n this.el.sceneEl.addEventListener('controllersupdated', this.onControllersUpdate, false);\n },\n\n removeControllersUpdateListener: function () {\n this.el.sceneEl.removeEventListener('controllersupdated', this.onControllersUpdate, false);\n },\n\n onControllersUpdate: function () {\n var controller;\n this.checkIfControllerPresent();\n controller = this.el.components['tracked-controls'] && this.el.components['tracked-controls'].controller;\n if (!this.el.getObject3D('mesh')) { return; }\n if (!controller || !controller.hand || !controller.hand[0]) {\n this.el.getObject3D('mesh').visible = false;\n }\n },\n\n initDefaultModel: function () {\n if (this.el.getObject3D('mesh')) { return; }\n if (this.data.modelStyle === 'dots') {\n this.initDotsModel();\n }\n\n if (this.data.modelStyle === 'mesh') {\n this.initMeshHandModel();\n }\n },\n\n initDotsModel: function () {\n // Add models just once.\n if (this.jointEls.length !== 0) { return; }\n for (var i = 0; i < JOINTS.length; ++i) {\n var jointEl = this.jointEl = document.createElement('a-entity');\n jointEl.setAttribute('geometry', {\n primitive: 'sphere',\n radius: 1.0\n });\n jointEl.setAttribute('material', {color: this.data.modelColor});\n jointEl.object3D.visible = false;\n this.el.appendChild(jointEl);\n this.jointEls.push(jointEl);\n }\n },\n\n initMeshHandModel: function () {\n var modelURL = this.data.hand === 'left' ? LEFT_HAND_MODEL_URL : RIGHT_HAND_MODEL_URL;\n this.el.setAttribute('gltf-model', modelURL);\n },\n\n onModelLoaded: function () {\n var mesh = this.mesh = this.el.getObject3D('mesh').children[0];\n var skinnedMesh = this.skinnedMesh = mesh.children[30];\n if (!this.skinnedMesh) { return; }\n this.bones = skinnedMesh.skeleton.bones;\n this.el.removeObject3D('mesh');\n mesh.position.set(0, 1.5, 0);\n mesh.rotation.set(0, 0, 0);\n skinnedMesh.frustumCulled = false;\n skinnedMesh.material = new THREE.MeshStandardMaterial({skinning: true, color: this.data.modelColor});\n this.el.setObject3D('mesh', mesh);\n }\n});\n\n","/* global THREE, XRRigidTransform, XRWebGLBinding */\nvar registerComponent = require('../core/component').registerComponent;\nvar utils = require('../utils/');\nvar warn = utils.debug('components:layer:warn');\n\nmodule.exports.Component = registerComponent('layer', {\n schema: {\n type: {default: 'quad', oneOf: ['quad', 'monocubemap', 'stereocubemap']},\n src: {type: 'map'},\n rotateCubemap: {default: false},\n width: {default: 0},\n height: {default: 0}\n },\n\n init: function () {\n var gl = this.el.sceneEl.renderer.getContext();\n\n this.quaternion = new THREE.Quaternion();\n this.position = new THREE.Vector3();\n\n this.bindMethods();\n this.needsRedraw = false;\n this.frameBuffer = gl.createFramebuffer();\n var requiredFeatures = this.el.sceneEl.getAttribute('webxr').requiredFeatures;\n requiredFeatures.push('layers');\n this.el.sceneEl.getAttribute('webxr', 'requiredFeatures', requiredFeatures);\n this.el.sceneEl.addEventListener('enter-vr', this.onEnterVR);\n this.el.sceneEl.addEventListener('exit-vr', this.onExitVR);\n },\n\n bindMethods: function () {\n this.onRequestedReferenceSpace = this.onRequestedReferenceSpace.bind(this);\n this.onEnterVR = this.onEnterVR.bind(this);\n this.onExitVR = this.onExitVR.bind(this);\n },\n\n update: function (oldData) {\n if (this.data.src !== oldData.src) { this.updateSrc(); }\n },\n\n updateSrc: function () {\n var type = this.data.type;\n this.texture = undefined;\n if (type === 'quad') {\n this.loadQuadImage();\n return;\n }\n\n if (type === 'monocubemap' || type === 'stereocubemap') {\n this.loadCubeMapImages();\n return;\n }\n },\n\n loadCubeMapImages: function () {\n var type = this.data.type;\n var glayer;\n var xrGLFactory = this.xrGLFactory;\n var frame = this.el.sceneEl.frame;\n var src = this.data.src;\n\n this.visibilityChanged = false;\n if (!this.layer) { return; }\n if (!src.complete) {\n this.pendingCubeMapUpdate = true;\n } else {\n this.pendingCubeMapUpdate = false;\n }\n\n if (!this.loadingScreen) {\n this.loadingScreen = true;\n } else {\n this.loadingScreen = false;\n }\n\n if (type === 'monocubemap') {\n glayer = xrGLFactory.getSubImage(this.layer, frame);\n this.loadCubeMapImage(glayer.colorTexture, src, 0);\n } else {\n glayer = xrGLFactory.getSubImage(this.layer, frame, 'left');\n this.loadCubeMapImage(glayer.colorTexture, src, 0);\n glayer = xrGLFactory.getSubImage(this.layer, frame, 'right');\n this.loadCubeMapImage(glayer.colorTexture, src, 6);\n }\n },\n\n loadQuadImage: function () {\n var src = this.data.src;\n var self = this;\n this.el.sceneEl.systems.material.loadTexture(src, {src: src}, function textureLoaded (texture) {\n self.el.sceneEl.renderer.initTexture(texture);\n self.texture = texture;\n if (src.tagName === 'VIDEO') { setTimeout(function () { self.textureIsVideo = true; }, 1000); }\n if (self.layer) {\n self.layer.height = self.data.height / 2 || self.texture.image.height / 1000;\n self.layer.width = self.data.width / 2 || self.texture.image.width / 1000;\n self.needsRedraw = true;\n }\n self.updateQuadPanel();\n });\n },\n\n preGenerateCubeMapTextures: function (src, callback) {\n if (this.data.type === 'monocubemap') {\n this.generateCubeMapTextures(src, 0, callback);\n } else {\n this.generateCubeMapTextures(src, 0, callback);\n this.generateCubeMapTextures(src, 6, callback);\n }\n },\n\n generateCubeMapTextures: function (src, faceOffset, callback) {\n var data = this.data;\n var cubeFaceSize = this.cubeFaceSize;\n var textureSourceCubeFaceSize = Math.min(src.width, src.height);\n var cubefaceTextures = [];\n var imgTmp0;\n var imgTmp2;\n\n for (var i = 0; i < 6; i++) {\n var tempCanvas = document.createElement('CANVAS');\n tempCanvas.width = tempCanvas.height = cubeFaceSize;\n var tempCanvasContext = tempCanvas.getContext('2d');\n\n if (data.rotateCubemap) {\n if (i === 2 || i === 3) {\n tempCanvasContext.save();\n tempCanvasContext.translate(cubeFaceSize, cubeFaceSize);\n tempCanvasContext.rotate(Math.PI);\n }\n }\n\n // Note that this call to drawImage will not only copy the bytes to the\n // canvas but also could resized the image if our cube face size is\n // smaller than the source image due to GL max texture size.\n tempCanvasContext.drawImage(\n src,\n (i + faceOffset) * textureSourceCubeFaceSize, // top left x coord in source\n 0, // top left y coord in source\n textureSourceCubeFaceSize, // x pixel count from source\n textureSourceCubeFaceSize, // y pixel count from source\n 0, // dest x offset in the canvas\n 0, // dest y offset in the canvas\n cubeFaceSize, // x pixel count in dest\n cubeFaceSize // y pixel count in dest\n );\n\n tempCanvasContext.restore();\n\n if (callback) { callback(); }\n cubefaceTextures.push(tempCanvas);\n }\n\n if (data.rotateCubemap) {\n imgTmp0 = cubefaceTextures[0];\n imgTmp2 = cubefaceTextures[1];\n\n cubefaceTextures[0] = imgTmp2;\n cubefaceTextures[1] = imgTmp0;\n\n imgTmp0 = cubefaceTextures[4];\n imgTmp2 = cubefaceTextures[5];\n\n cubefaceTextures[4] = imgTmp2;\n cubefaceTextures[5] = imgTmp0;\n }\n\n if (callback) { callback(); }\n return cubefaceTextures;\n },\n\n loadCubeMapImage: function (layerColorTexture, src, faceOffset) {\n var gl = this.el.sceneEl.renderer.getContext();\n var cubefaceTextures;\n\n // dont flip the pixels as we load them into the texture buffer.\n // TEXTURE_CUBE_MAP expects the Y to be flipped for the faces and it already\n // is flipped in our texture image.\n gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);\n gl.bindTexture(gl.TEXTURE_CUBE_MAP, layerColorTexture);\n\n if (!src.complete || this.loadingScreen) {\n cubefaceTextures = this.loadingScreenImages;\n } else {\n cubefaceTextures = this.generateCubeMapTextures(src, faceOffset);\n }\n\n var errorCode = 0;\n cubefaceTextures.forEach(function (canvas, i) {\n gl.texSubImage2D(\n gl.TEXTURE_CUBE_MAP_POSITIVE_X + i,\n 0,\n 0, 0,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n canvas\n );\n errorCode = gl.getError();\n });\n\n if (errorCode !== 0) {\n console.log('renderingError, WebGL Error Code: ' + errorCode);\n }\n gl.bindTexture(gl.TEXTURE_CUBE_MAP, null);\n },\n\n tick: function () {\n if (!this.el.sceneEl.xrSession) { return; }\n if (!this.layer && this.el.sceneEl.is('vr-mode')) { this.initLayer(); }\n this.updateTransform();\n if (this.data.src.complete && (this.pendingCubeMapUpdate || this.loadingScreen || this.visibilityChanged)) { this.loadCubeMapImages(); }\n if (!this.needsRedraw && !this.layer.needsRedraw && !this.textureIsVideo) { return; }\n if (this.data.type === 'quad') { this.draw(); }\n this.needsRedraw = false;\n },\n\n initLayer: function () {\n var self = this;\n var type = this.data.type;\n\n this.el.sceneEl.xrSession.onvisibilitychange = function (evt) {\n self.visibilityChanged = evt.session.visibilityState !== 'hidden';\n };\n\n if (type === 'quad') {\n this.initQuadLayer();\n return;\n }\n\n if (type === 'monocubemap' || type === 'stereocubemap') {\n this.initCubeMapLayer();\n return;\n }\n },\n\n initQuadLayer: function () {\n var sceneEl = this.el.sceneEl;\n var gl = sceneEl.renderer.getContext();\n var xrGLFactory = this.xrGLFactory = new XRWebGLBinding(sceneEl.xrSession, gl);\n if (!this.texture) { return; }\n this.layer = xrGLFactory.createQuadLayer({\n space: this.referenceSpace,\n viewPixelHeight: 2048,\n viewPixelWidth: 2048,\n height: this.data.height / 2 || this.texture.image.height / 1000,\n width: this.data.width / 2 || this.texture.image.width / 1000\n });\n sceneEl.renderer.xr.addLayer(this.layer);\n },\n\n initCubeMapLayer: function () {\n var src = this.data.src;\n var sceneEl = this.el.sceneEl;\n var gl = sceneEl.renderer.getContext();\n var glSizeLimit = gl.getParameter(gl.MAX_CUBE_MAP_TEXTURE_SIZE);\n var cubeFaceSize = this.cubeFaceSize = Math.min(glSizeLimit, Math.min(src.width, src.height));\n var xrGLFactory = this.xrGLFactory = new XRWebGLBinding(sceneEl.xrSession, gl);\n this.layer = xrGLFactory.createCubeLayer({\n space: this.referenceSpace,\n viewPixelWidth: cubeFaceSize,\n viewPixelHeight: cubeFaceSize,\n layout: this.data.type === 'monocubemap' ? 'mono' : 'stereo',\n isStatic: false\n });\n\n this.initLoadingScreenImages();\n this.loadCubeMapImages();\n sceneEl.renderer.xr.addLayer(this.layer);\n },\n\n initLoadingScreenImages: function () {\n var cubeFaceSize = this.cubeFaceSize;\n var loadingScreenImages = this.loadingScreenImages = [];\n for (var i = 0; i < 6; i++) {\n var tempCanvas = document.createElement('CANVAS');\n tempCanvas.width = tempCanvas.height = cubeFaceSize;\n var tempCanvasContext = tempCanvas.getContext('2d');\n tempCanvas.width = tempCanvas.height = cubeFaceSize;\n tempCanvasContext.fillStyle = 'black';\n tempCanvasContext.fillRect(0, 0, cubeFaceSize, cubeFaceSize);\n if (i !== 2 && i !== 3) {\n tempCanvasContext.translate(cubeFaceSize, 0);\n tempCanvasContext.scale(-1, 1);\n tempCanvasContext.fillStyle = 'white';\n tempCanvasContext.font = '30px Arial';\n tempCanvasContext.fillText('Loading', cubeFaceSize / 2, cubeFaceSize / 2);\n }\n loadingScreenImages.push(tempCanvas);\n }\n },\n\n destroyLayer: function () {\n if (!this.layer) { return; }\n this.el.sceneEl.renderer.xr.removeLayer(this.layer);\n this.layer.destroy();\n this.layer = undefined;\n },\n\n toggleCompositorLayer: function () {\n this.enableCompositorLayer(!this.layerEnabled);\n },\n\n enableCompositorLayer: function (enable) {\n this.layerEnabled = enable;\n this.quadPanelEl.object3D.visible = !this.layerEnabled;\n },\n\n updateQuadPanel: function () {\n var quadPanelEl = this.quadPanelEl;\n if (!this.quadPanelEl) {\n quadPanelEl = this.quadPanelEl = document.createElement('a-entity');\n this.el.appendChild(quadPanelEl);\n }\n\n quadPanelEl.setAttribute('material', {\n shader: 'flat',\n src: this.data.src,\n transparent: true\n });\n\n quadPanelEl.setAttribute('geometry', {\n primitive: 'plane',\n height: this.data.height || this.texture.image.height / 1000,\n width: this.data.width || this.texture.image.height / 1000\n });\n },\n\n draw: function () {\n var sceneEl = this.el.sceneEl;\n var gl = this.el.sceneEl.renderer.getContext();\n var glayer = this.xrGLFactory.getSubImage(this.layer, sceneEl.frame);\n var texture = sceneEl.renderer.properties.get(this.texture).__webglTexture;\n var previousFrameBuffer = gl.getParameter(gl.FRAMEBUFFER_BINDING);\n\n gl.viewport(glayer.viewport.x, glayer.viewport.y, glayer.viewport.width, glayer.viewport.height);\n gl.bindFramebuffer(gl.FRAMEBUFFER, this.frameBuffer);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, glayer.colorTexture, 0);\n\n blitTexture(gl, texture, glayer, this.data.src);\n\n gl.bindFramebuffer(gl.FRAMEBUFFER, previousFrameBuffer);\n },\n\n updateTransform: function () {\n var el = this.el;\n var position = this.position;\n var quaternion = this.quaternion;\n el.object3D.updateMatrixWorld();\n position.setFromMatrixPosition(el.object3D.matrixWorld);\n quaternion.setFromRotationMatrix(el.object3D.matrixWorld);\n if (!this.layerEnabled) { position.set(0, 0, 100000000); }\n this.layer.transform = new XRRigidTransform(position, quaternion);\n },\n\n onEnterVR: function () {\n var sceneEl = this.el.sceneEl;\n var xrSession = sceneEl.xrSession;\n if (!sceneEl.hasWebXR || !XRWebGLBinding || !xrSession) {\n warn('The layer component requires WebXR and the layers API enabled');\n return;\n }\n xrSession.requestReferenceSpace('local').then(this.onRequestedReferenceSpace);\n this.needsRedraw = true;\n this.layerEnabled = true;\n if (this.quadPanelEl) {\n this.quadPanelEl.object3D.visible = false;\n }\n if (this.data.src.play) { this.data.src.play(); }\n },\n\n onExitVR: function () {\n if (this.quadPanelEl) {\n this.quadPanelEl.object3D.visible = true;\n }\n this.destroyLayer();\n },\n\n onRequestedReferenceSpace: function (referenceSpace) {\n this.referenceSpace = referenceSpace;\n }\n});\n\nfunction blitTexture (gl, texture, subImage, textureEl) {\n var xrReadFramebuffer = gl.createFramebuffer();\n let x1offset = subImage.viewport.x;\n let y1offset = subImage.viewport.y;\n let x2offset = subImage.viewport.x + subImage.viewport.width;\n let y2offset = subImage.viewport.y + subImage.viewport.height;\n\n // Update video texture.\n if (textureEl.tagName === 'VIDEO') {\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, textureEl.width, textureEl.height, gl.RGB, gl.UNSIGNED_BYTE, textureEl);\n }\n\n // Bind texture to read framebuffer.\n gl.bindFramebuffer(gl.READ_FRAMEBUFFER, xrReadFramebuffer);\n gl.framebufferTexture2D(gl.READ_FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);\n\n // Blit into layer buffer.\n gl.readBuffer(gl.COLOR_ATTACHMENT0);\n gl.blitFramebuffer(0, 0, textureEl.width, textureEl.height, x1offset, y1offset, x2offset, y2offset, gl.COLOR_BUFFER_BIT, gl.NEAREST);\n\n gl.bindFramebuffer(gl.READ_FRAMEBUFFER, null);\n gl.deleteFramebuffer(xrReadFramebuffer);\n}\n","var css = \"html.a-fullscreen{bottom:0;left:0;position:fixed;right:0;top:0}html.a-fullscreen body{height:100%;margin:0;overflow:hidden;padding:0;width:100%}html.a-fullscreen .a-canvas{width:100%!important;height:100%!important;top:0!important;left:0!important;right:0!important;bottom:0!important;position:fixed!important}html:not(.a-fullscreen) .a-enter-ar,html:not(.a-fullscreen) .a-enter-vr{right:5px;bottom:5px}:-webkit-full-screen{background-color:transparent}.a-hidden{display:none!important}.a-canvas{height:100%;left:0;position:absolute;top:0;width:100%}.a-canvas.a-grab-cursor:hover{cursor:grab;cursor:-moz-grab;cursor:-webkit-grab}canvas.a-canvas.a-mouse-cursor-hover:hover{cursor:pointer}.a-inspector-loader{background-color:#ed3160;position:fixed;left:3px;top:3px;padding:6px 10px;color:#fff;text-decoration:none;font-size:12px;font-family:Roboto,sans-serif;text-align:center;z-index:99999;width:204px}@keyframes dots-1{from{opacity:0}25%{opacity:1}}@keyframes dots-2{from{opacity:0}50%{opacity:1}}@keyframes dots-3{from{opacity:0}75%{opacity:1}}@-webkit-keyframes dots-1{from{opacity:0}25%{opacity:1}}@-webkit-keyframes dots-2{from{opacity:0}50%{opacity:1}}@-webkit-keyframes dots-3{from{opacity:0}75%{opacity:1}}.a-inspector-loader .dots span{animation:dots-1 2s infinite steps(1);-webkit-animation:dots-1 2s infinite steps(1)}.a-inspector-loader .dots span:first-child+span{animation-name:dots-2;-webkit-animation-name:dots-2}.a-inspector-loader .dots span:first-child+span+span{animation-name:dots-3;-webkit-animation-name:dots-3}a-scene{display:block;position:relative;height:100%;width:100%}a-assets,a-scene audio,a-scene img,a-scene video{display:none}.a-enter-vr-modal,.a-orientation-modal{font-family:Consolas,Andale Mono,Courier New,monospace}.a-enter-vr-modal a{border-bottom:1px solid #fff;padding:2px 0;text-decoration:none;transition:.1s color ease-in}.a-enter-vr-modal a:hover{background-color:#fff;color:#111;padding:2px 4px;position:relative;left:-4px}.a-enter-ar,.a-enter-vr{font-family:sans-serif,monospace;font-size:13px;width:100%;font-weight:200;line-height:16px;position:absolute;right:20px;bottom:20px}.a-enter-ar{right:80px}.a-enter-vr-button,.a-enter-vr-modal,.a-enter-vr-modal a{color:#fff;user-select:none;outline:0}.a-enter-vr-button{background:url(\\\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='108' height='62' viewBox='0 0 108 62'%3E%3Ctitle%3Eaframe-vrmode-noborder-reduced-tracking%3C/title%3E%3Cpath d='M68.81,21.56H64.23v8.27h4.58a4.13,4.13,0,0,0,3.1-1.09,4.2,4.2,0,0,0,1-3,4.24,4.24,0,0,0-1-3A4.05,4.05,0,0,0,68.81,21.56Z' fill='%23fff'/%3E%3Cpath d='M96,0H12A12,12,0,0,0,0,12V50A12,12,0,0,0,12,62H96a12,12,0,0,0,12-12V12A12,12,0,0,0,96,0ZM41.9,46H34L24,16h8l6,21.84,6-21.84H52Zm39.29,0H73.44L68.15,35.39H64.23V46H57V16H68.81q5.32,0,8.34,2.37a8,8,0,0,1,3,6.69,9.68,9.68,0,0,1-1.27,5.18,8.9,8.9,0,0,1-4,3.34l6.26,12.11Z' fill='%23fff'/%3E%3C/svg%3E\\\") 50% 50% no-repeat rgba(0,0,0,.35)}.a-enter-ar-button{background:url(\\\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='108' height='62' viewBox='0 0 108 62'%3E%3Ctitle%3Eaframe-armode-noborder-reduced-tracking%3C/title%3E%3Cpath d='M96,0H12A12,12,0,0,0,0,12V50A12,12,0,0,0,12,62H96a12,12,0,0,0,12-12V12A12,12,0,0,0,96,0Zm8,50a8,8,0,0,1-8,8H12a8,8,0,0,1-8-8V12a8,8,0,0,1,8-8H96a8,8,0,0,1,8,8Z' fill='%23fff'/%3E%3Cpath d='M43.35,39.82H32.51L30.45,46H23.88L35,16h5.73L52,46H45.43Zm-9.17-5h7.5L37.91,23.58Z' fill='%23fff'/%3E%3Cpath d='M68.11,35H63.18V46H57V16H68.15q5.31,0,8.2,2.37a8.18,8.18,0,0,1,2.88,6.7,9.22,9.22,0,0,1-1.33,5.12,9.09,9.09,0,0,1-4,3.26l6.49,12.26V46H73.73Zm-4.93-5h5a5.09,5.09,0,0,0,3.6-1.18,4.21,4.21,0,0,0,1.28-3.27,4.56,4.56,0,0,0-1.2-3.34A5,5,0,0,0,68.15,21h-5Z' fill='%23fff'/%3E%3C/svg%3E\\\") 50% 50% no-repeat rgba(0,0,0,.2)}.a-enter-ar-button,.a-enter-vr-button{background-size:90% 90%;border:0;bottom:0;cursor:pointer;min-width:58px;min-height:34px;padding-right:0;padding-top:0;position:absolute;right:0;transition:background-color .05s ease;-webkit-transition:background-color .05s ease;z-index:9999;border-radius:8px;touch-action:manipulation}.a-enter-ar-button{background-size:100% 90%;margin-right:10px;border-radius:7px}.a-enter-ar-button:active,.a-enter-ar-button:hover,.a-enter-vr-button:active,.a-enter-vr-button:hover{background-color:#ef2d5e}.a-enter-vr-button.resethover{background-color:rgba(0,0,0,.35)}[data-a-enter-vr-no-webvr] .a-enter-vr-button{border-color:#666;opacity:.65}[data-a-enter-vr-no-webvr] .a-enter-vr-button:active,[data-a-enter-vr-no-webvr] .a-enter-vr-button:hover{background-color:rgba(0,0,0,.35);cursor:not-allowed}.a-enter-vr-modal{background-color:#666;border-radius:0;display:none;min-height:32px;margin-right:70px;padding:9px;width:280px;right:2%;position:absolute}.a-enter-vr-modal:after{border-bottom:10px solid transparent;border-left:10px solid #666;border-top:10px solid transparent;display:inline-block;content:'';position:absolute;right:-5px;top:5px;width:0;height:0}.a-enter-vr-modal a,.a-enter-vr-modal p{display:inline}.a-enter-vr-modal p{margin:0}.a-enter-vr-modal p:after{content:' '}[data-a-enter-vr-no-headset].a-enter-vr:hover .a-enter-vr-modal,[data-a-enter-vr-no-webvr].a-enter-vr:hover .a-enter-vr-modal{display:block}.a-orientation-modal{background:url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20xmlns%3Axlink%3D%22http%3A//www.w3.org/1999/xlink%22%20version%3D%221.1%22%20x%3D%220px%22%20y%3D%220px%22%20viewBox%3D%220%200%2090%2090%22%20enable-background%3D%22new%200%200%2090%2090%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpolygon%20points%3D%220%2C0%200%2C0%200%2C0%20%22%3E%3C/polygon%3E%3Cg%3E%3Cpath%20d%3D%22M71.545%2C48.145h-31.98V20.743c0-2.627-2.138-4.765-4.765-4.765H18.456c-2.628%2C0-4.767%2C2.138-4.767%2C4.765v42.789%20%20%20c0%2C2.628%2C2.138%2C4.766%2C4.767%2C4.766h5.535v0.959c0%2C2.628%2C2.138%2C4.765%2C4.766%2C4.765h42.788c2.628%2C0%2C4.766-2.137%2C4.766-4.765V52.914%20%20%20C76.311%2C50.284%2C74.173%2C48.145%2C71.545%2C48.145z%20M18.455%2C16.935h16.344c2.1%2C0%2C3.808%2C1.708%2C3.808%2C3.808v27.401H37.25V22.636%20%20%20c0-0.264-0.215-0.478-0.479-0.478H16.482c-0.264%2C0-0.479%2C0.214-0.479%2C0.478v36.585c0%2C0.264%2C0.215%2C0.478%2C0.479%2C0.478h7.507v7.644%20%20%20h-5.534c-2.101%2C0-3.81-1.709-3.81-3.81V20.743C14.645%2C18.643%2C16.354%2C16.935%2C18.455%2C16.935z%20M16.96%2C23.116h19.331v25.031h-7.535%20%20%20c-2.628%2C0-4.766%2C2.139-4.766%2C4.768v5.828h-7.03V23.116z%20M71.545%2C73.064H28.757c-2.101%2C0-3.81-1.708-3.81-3.808V52.914%20%20%20c0-2.102%2C1.709-3.812%2C3.81-3.812h42.788c2.1%2C0%2C3.809%2C1.71%2C3.809%2C3.812v16.343C75.354%2C71.356%2C73.645%2C73.064%2C71.545%2C73.064z%22%3E%3C/path%3E%3Cpath%20d%3D%22M28.919%2C58.424c-1.466%2C0-2.659%2C1.193-2.659%2C2.66c0%2C1.466%2C1.193%2C2.658%2C2.659%2C2.658c1.468%2C0%2C2.662-1.192%2C2.662-2.658%20%20%20C31.581%2C59.617%2C30.387%2C58.424%2C28.919%2C58.424z%20M28.919%2C62.786c-0.939%2C0-1.703-0.764-1.703-1.702c0-0.939%2C0.764-1.704%2C1.703-1.704%20%20%20c0.94%2C0%2C1.705%2C0.765%2C1.705%2C1.704C30.623%2C62.022%2C29.858%2C62.786%2C28.919%2C62.786z%22%3E%3C/path%3E%3Cpath%20d%3D%22M69.654%2C50.461H33.069c-0.264%2C0-0.479%2C0.215-0.479%2C0.479v20.288c0%2C0.264%2C0.215%2C0.478%2C0.479%2C0.478h36.585%20%20%20c0.263%2C0%2C0.477-0.214%2C0.477-0.478V50.939C70.131%2C50.676%2C69.917%2C50.461%2C69.654%2C50.461z%20M69.174%2C51.417V70.75H33.548V51.417H69.174z%22%3E%3C/path%3E%3Cpath%20d%3D%22M45.201%2C30.296c6.651%2C0%2C12.233%2C5.351%2C12.551%2C11.977l-3.033-2.638c-0.193-0.165-0.507-0.142-0.675%2C0.048%20%20%20c-0.174%2C0.198-0.153%2C0.501%2C0.045%2C0.676l3.883%2C3.375c0.09%2C0.075%2C0.198%2C0.115%2C0.312%2C0.115c0.141%2C0%2C0.273-0.061%2C0.362-0.166%20%20%20l3.371-3.877c0.173-0.2%2C0.151-0.502-0.047-0.675c-0.194-0.166-0.508-0.144-0.676%2C0.048l-2.592%2C2.979%20%20%20c-0.18-3.417-1.629-6.605-4.099-9.001c-2.538-2.461-5.877-3.817-9.404-3.817c-0.264%2C0-0.479%2C0.215-0.479%2C0.479%20%20%20C44.72%2C30.083%2C44.936%2C30.296%2C45.201%2C30.296z%22%3E%3C/path%3E%3C/g%3E%3C/svg%3E) center/50% 50% no-repeat rgba(244,244,244,1);bottom:0;font-size:14px;font-weight:600;left:0;line-height:20px;right:0;position:fixed;top:0;z-index:9999999}.a-orientation-modal:after{color:#666;content:\\\"Insert phone into Cardboard holder.\\\";display:block;position:absolute;text-align:center;top:70%;transform:translateY(-70%);width:100%}.a-orientation-modal button{background:url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20xmlns%3Axlink%3D%22http%3A//www.w3.org/1999/xlink%22%20version%3D%221.1%22%20x%3D%220px%22%20y%3D%220px%22%20viewBox%3D%220%200%20100%20100%22%20enable-background%3D%22new%200%200%20100%20100%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20fill%3D%22%23000000%22%20d%3D%22M55.209%2C50l17.803-17.803c1.416-1.416%2C1.416-3.713%2C0-5.129c-1.416-1.417-3.713-1.417-5.129%2C0L50.08%2C44.872%20%20L32.278%2C27.069c-1.416-1.417-3.714-1.417-5.129%2C0c-1.417%2C1.416-1.417%2C3.713%2C0%2C5.129L44.951%2C50L27.149%2C67.803%20%20c-1.417%2C1.416-1.417%2C3.713%2C0%2C5.129c0.708%2C0.708%2C1.636%2C1.062%2C2.564%2C1.062c0.928%2C0%2C1.856-0.354%2C2.564-1.062L50.08%2C55.13l17.803%2C17.802%20%20c0.708%2C0.708%2C1.637%2C1.062%2C2.564%2C1.062s1.856-0.354%2C2.564-1.062c1.416-1.416%2C1.416-3.713%2C0-5.129L55.209%2C50z%22%3E%3C/path%3E%3C/svg%3E) no-repeat;border:none;height:50px;text-indent:-9999px;width:50px}.a-loader-title{background-color:rgba(0,0,0,.6);font-family:sans-serif,monospace;text-align:center;font-size:20px;height:50px;font-weight:300;line-height:50px;position:absolute;right:0;left:0;top:0;color:#fff}.a-modal{background:0 0/50% 50% rgba(0,0,0,.6);bottom:0;font-size:14px;font-weight:600;left:0;line-height:20px;right:0;position:fixed;top:0;z-index:9999999}.a-dialog{position:relative;left:50%;top:50%;transform:translate(-50%,-50%);z-index:199995;width:300px;height:200px;background-size:contain;background-color:#fff;font-family:sans-serif,monospace;font-size:20px;border-radius:3px;padding:6px}.a-dialog-text-container{width:100%;height:70%;align-self:flex-start;display:flex;justify-content:center;align-content:center;flex-direction:column}.a-dialog-text{display:inline-block;font-weight:400;font-size:14pt;margin:8px}.a-dialog-buttons-container{display:inline-flex;align-self:flex-end;width:100%;height:30%}.a-dialog-button{cursor:pointer;align-self:center;opacity:.9;height:80%;width:50%;font-size:12pt;margin:4px;border-radius:2px;text-align:center;border:none;display:inline-block;-webkit-transition:all .25s ease-in-out;transition:all .25s ease-in-out;box-shadow:0 1px 3px rgba(0,0,0,.1),0 1px 2px rgba(0,0,0,.2);user-select:none}.a-dialog-permission-button:hover{box-shadow:0 7px 14px rgba(0,0,0,.2),0 2px 2px rgba(0,0,0,.2)}.a-dialog-allow-button{background-color:#00ceff}.a-dialog-deny-button{background-color:#ff005b}.a-dialog-ok-button{background-color:#00ceff;width:100%}.a-dom-overlay:not(.a-no-style){overflow:hidden;position:absolute;pointer-events:none;box-sizing:border-box;bottom:0;left:0;right:0;top:0;padding:1em}.a-dom-overlay:not(.a-no-style)>*{pointer-events:auto}\"; (require(\"browserify-css\").createStyle(css, { \"href\": \"src/style/aframe.css\"})); module.exports = css;","var css = \".rs-base{background-color:#333;color:#fafafa;border-radius:0;font:10px monospace;left:5px;line-height:1em;opacity:.85;overflow:hidden;padding:10px;position:fixed;top:5px;width:300px;z-index:10000}.rs-base div.hidden{display:none}.rs-base h1{color:#fff;cursor:pointer;font-size:1.4em;font-weight:300;margin:0 0 5px;padding:0}.rs-group{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-flex-direction:column-reverse;flex-direction:column-reverse;margin-bottom:5px}.rs-group:last-child{margin-bottom:0}.rs-counter-base{align-items:center;display:-webkit-box;display:-webkit-flex;display:flex;height:10px;-webkit-justify-content:space-between;justify-content:space-between;margin:2px 0}.rs-counter-base.alarm{color:#b70000;text-shadow:0 0 0 #b70000,0 0 1px #fff,0 0 1px #fff,0 0 2px #fff,0 0 2px #fff,0 0 3px #fff,0 0 3px #fff,0 0 4px #fff,0 0 4px #fff}.rs-counter-id{font-weight:300;-webkit-box-ordinal-group:0;-webkit-order:0;order:0;width:54px}.rs-counter-value{font-weight:300;-webkit-box-ordinal-group:1;-webkit-order:1;order:1;text-align:right;width:35px}.rs-canvas{-webkit-box-ordinal-group:2;-webkit-order:2;order:2}@media (min-width:480px){.rs-base{left:20px;top:20px}}\"; (require(\"browserify-css\").createStyle(css, { \"href\": \"src/style/rStats.css\"})); module.exports = css;","// Safari regression introduced in iOS 12 and remains in iOS 13.\n// https://stackoverflow.com/questions/62717621/white-space-at-page-bottom-after-device-rotation-in-ios-safari\nwindow.addEventListener('orientationchange', function () {\n document.documentElement.style.height = `initial`;\n setTimeout(function () {\n document.documentElement.style.height = `100%`;\n setTimeout(function () {\n // this line prevents the content\n // from hiding behind the address bar\n window.scrollTo(0, 1);\n }, 500);\n }, 500);\n});\n","var str = Object.prototype.toString\n\nmodule.exports = anArray\n\nfunction anArray(arr) {\n return (\n arr.BYTES_PER_ELEMENT\n && str.call(arr.buffer) === '[object ArrayBuffer]'\n || Array.isArray(arr)\n )\n}\n","module.exports = function numtype(num, def) {\n\treturn typeof num === 'number'\n\t\t? num \n\t\t: (typeof def === 'number' ? def : 0)\n}","'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n for (var i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(\n uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)\n ))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n","'use strict';\n// For more information about browser field, check out the browser field at https://github.com/substack/browserify-handbook#browser-field.\n\nmodule.exports = {\n // Create a <link> tag with optional data attributes\n createLink: function(href, attributes) {\n var head = document.head || document.getElementsByTagName('head')[0];\n var link = document.createElement('link');\n\n link.href = href;\n link.rel = 'stylesheet';\n\n for (var key in attributes) {\n if ( ! attributes.hasOwnProperty(key)) {\n continue;\n }\n var value = attributes[key];\n link.setAttribute('data-' + key, value);\n }\n\n head.appendChild(link);\n },\n // Create a <style> tag with optional data attributes\n createStyle: function(cssText, attributes) {\n var head = document.head || document.getElementsByTagName('head')[0],\n style = document.createElement('style');\n\n style.type = 'text/css';\n\n for (var key in attributes) {\n if ( ! attributes.hasOwnProperty(key)) {\n continue;\n }\n var value = attributes[key];\n style.setAttribute('data-' + key, value);\n }\n \n if (style.sheet) { // for jsdom and IE9+\n style.innerHTML = cssText;\n style.sheet.cssText = cssText;\n head.appendChild(style);\n } else if (style.styleSheet) { // for IE8 and below\n head.appendChild(style);\n style.styleSheet.cssText = cssText;\n } else { // for Chrome, Firefox, and Safari\n style.appendChild(document.createTextNode(cssText));\n head.appendChild(style);\n }\n }\n};\n","var Buffer = require('buffer').Buffer; // for use with browserify\n\nmodule.exports = function (a, b) {\n if (!Buffer.isBuffer(a)) return undefined;\n if (!Buffer.isBuffer(b)) return undefined;\n if (typeof a.equals === 'function') return a.equals(b);\n if (a.length !== b.length) return false;\n \n for (var i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) return false;\n }\n \n return true;\n};\n","/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>\n * @license MIT\n */\n/* eslint-disable no-proto */\n\n'use strict'\n\nvar base64 = require('base64-js')\nvar ieee754 = require('ieee754')\nvar isArray = require('isarray')\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Use Object implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * Due to various browser bugs, sometimes the Object implementation will be used even\n * when the browser supports typed arrays.\n *\n * Note:\n *\n * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,\n * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.\n *\n * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.\n *\n * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of\n * incorrect length in some situations.\n\n * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they\n * get the Object implementation, which is slower but behaves correctly.\n */\nBuffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined\n ? global.TYPED_ARRAY_SUPPORT\n : typedArraySupport()\n\n/*\n * Export kMaxLength after typed array support is determined.\n */\nexports.kMaxLength = kMaxLength()\n\nfunction typedArraySupport () {\n try {\n var arr = new Uint8Array(1)\n arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}\n return arr.foo() === 42 && // typed array instances can be augmented\n typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`\n arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`\n } catch (e) {\n return false\n }\n}\n\nfunction kMaxLength () {\n return Buffer.TYPED_ARRAY_SUPPORT\n ? 0x7fffffff\n : 0x3fffffff\n}\n\nfunction createBuffer (that, length) {\n if (kMaxLength() < length) {\n throw new RangeError('Invalid typed array length')\n }\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = new Uint8Array(length)\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n if (that === null) {\n that = new Buffer(length)\n }\n that.length = length\n }\n\n return that\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length)\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(this, arg)\n }\n return from(this, arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\n// TODO: Legacy, not needed anymore. Remove in next major version.\nBuffer._augment = function (arr) {\n arr.__proto__ = Buffer.prototype\n return arr\n}\n\nfunction from (that, value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('\"value\" argument must not be a number')\n }\n\n if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {\n return fromArrayBuffer(that, value, encodingOrOffset, length)\n }\n\n if (typeof value === 'string') {\n return fromString(that, value, encodingOrOffset)\n }\n\n return fromObject(that, value)\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(null, value, encodingOrOffset, length)\n}\n\nif (Buffer.TYPED_ARRAY_SUPPORT) {\n Buffer.prototype.__proto__ = Uint8Array.prototype\n Buffer.__proto__ = Uint8Array\n if (typeof Symbol !== 'undefined' && Symbol.species &&\n Buffer[Symbol.species] === Buffer) {\n // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97\n Object.defineProperty(Buffer, Symbol.species, {\n value: null,\n configurable: true\n })\n }\n}\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be a number')\n } else if (size < 0) {\n throw new RangeError('\"size\" argument must not be negative')\n }\n}\n\nfunction alloc (that, size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(that, size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpretted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(that, size).fill(fill, encoding)\n : createBuffer(that, size).fill(fill)\n }\n return createBuffer(that, size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(null, size, fill, encoding)\n}\n\nfunction allocUnsafe (that, size) {\n assertSize(size)\n that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n for (var i = 0; i < size; ++i) {\n that[i] = 0\n }\n }\n return that\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(null, size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(null, size)\n}\n\nfunction fromString (that, string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('\"encoding\" must be a valid string encoding')\n }\n\n var length = byteLength(string, encoding) | 0\n that = createBuffer(that, length)\n\n var actual = that.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n that = that.slice(0, actual)\n }\n\n return that\n}\n\nfunction fromArrayLike (that, array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0\n that = createBuffer(that, length)\n for (var i = 0; i < length; i += 1) {\n that[i] = array[i] & 255\n }\n return that\n}\n\nfunction fromArrayBuffer (that, array, byteOffset, length) {\n array.byteLength // this throws if `array` is not a valid ArrayBuffer\n\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\\'offset\\' is out of bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\\'length\\' is out of bounds')\n }\n\n if (byteOffset === undefined && length === undefined) {\n array = new Uint8Array(array)\n } else if (length === undefined) {\n array = new Uint8Array(array, byteOffset)\n } else {\n array = new Uint8Array(array, byteOffset, length)\n }\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = array\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n that = fromArrayLike(that, array)\n }\n return that\n}\n\nfunction fromObject (that, obj) {\n if (Buffer.isBuffer(obj)) {\n var len = checked(obj.length) | 0\n that = createBuffer(that, len)\n\n if (that.length === 0) {\n return that\n }\n\n obj.copy(that, 0, 0, len)\n return that\n }\n\n if (obj) {\n if ((typeof ArrayBuffer !== 'undefined' &&\n obj.buffer instanceof ArrayBuffer) || 'length' in obj) {\n if (typeof obj.length !== 'number' || isnan(obj.length)) {\n return createBuffer(that, 0)\n }\n return fromArrayLike(that, obj)\n }\n\n if (obj.type === 'Buffer' && isArray(obj.data)) {\n return fromArrayLike(that, obj.data)\n }\n }\n\n throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')\n}\n\nfunction checked (length) {\n // Note: cannot use `length < kMaxLength()` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= kMaxLength()) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + kMaxLength().toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return !!(b != null && b._isBuffer)\n}\n\nBuffer.compare = function compare (a, b) {\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError('Arguments must be Buffers')\n }\n\n if (a === b) return 0\n\n var x = a.length\n var y = b.length\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n var i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n var buffer = Buffer.allocUnsafe(length)\n var pos = 0\n for (i = 0; i < list.length; ++i) {\n var buf = list[i]\n if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n buf.copy(buffer, pos)\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&\n (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n string = '' + string\n }\n\n var len = string.length\n if (len === 0) return 0\n\n // Use a for loop to avoid recursion\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n case undefined:\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) return utf8ToBytes(string).length // assume utf8\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n var loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coersion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect\n// Buffer instances.\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n var i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n var len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n var len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n var len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n var length = this.length | 0\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n var str = ''\n var max = exports.INSPECT_MAX_BYTES\n if (this.length > 0) {\n str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')\n if (this.length > max) str += ' ... '\n }\n return '<Buffer ' + str + '>'\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (!Buffer.isBuffer(target)) {\n throw new TypeError('Argument must be a Buffer')\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n var x = thisEnd - thisStart\n var y = end - start\n var len = Math.min(x, y)\n\n var thisCopy = this.slice(thisStart, thisEnd)\n var targetCopy = target.slice(start, end)\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n var indexSize = 1\n var arrLength = arr.length\n var valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n var i\n if (dir) {\n var foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n var found = true\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n var remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n // must be an even number of digits\n var strLen = string.length\n if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16)\n if (isNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction latin1Write (buf, string, offset, length) {\n return asciiWrite(buf, string, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset | 0\n if (isFinite(length)) {\n length = length | 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n // legacy write(string, encoding, offset, length) - remove in v0.13\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n var remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n return asciiWrite(this, string, offset, length)\n\n case 'latin1':\n case 'binary':\n return latin1Write(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n var res = []\n\n var i = start\n while (i < end) {\n var firstByte = buf[i]\n var codePoint = null\n var bytesPerSequence = (firstByte > 0xEF) ? 4\n : (firstByte > 0xDF) ? 3\n : (firstByte > 0xBF) ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n var len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n var res = ''\n var i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n var len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n var out = ''\n for (var i = start; i < end; ++i) {\n out += toHex(buf[i])\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n var bytes = buf.slice(start, end)\n var res = ''\n for (var i = 0; i < bytes.length; i += 2) {\n res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n var len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n var newBuf\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n newBuf = this.subarray(start, end)\n newBuf.__proto__ = Buffer.prototype\n } else {\n var sliceLen = end - start\n newBuf = new Buffer(sliceLen, undefined)\n for (var i = 0; i < sliceLen; ++i) {\n newBuf[i] = this[i + start]\n }\n }\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n var val = this[offset + --byteLength]\n var mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var i = byteLength\n var mul = 1\n var val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var mul = 1\n var i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var i = byteLength - 1\n var mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nfunction objectWriteUInt16 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {\n buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>\n (littleEndian ? i : 1 - i) * 8\n }\n}\n\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nfunction objectWriteUInt32 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffffffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {\n buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff\n }\n}\n\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = 0\n var mul = 1\n var sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = byteLength - 1\n var mul = 1\n var sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n var len = end - start\n var i\n\n if (this === target && start < targetStart && targetStart < end) {\n // descending copy from end\n for (i = len - 1; i >= 0; --i) {\n target[i + targetStart] = this[i + start]\n }\n } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {\n // ascending copy from start\n for (i = 0; i < len; ++i) {\n target[i + targetStart] = this[i + start]\n }\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, start + len),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (val.length === 1) {\n var code = val.charCodeAt(0)\n if (code < 256) {\n val = code\n }\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n } else if (typeof val === 'number') {\n val = val & 255\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n var i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n var bytes = Buffer.isBuffer(val)\n ? val\n : utf8ToBytes(new Buffer(val, encoding).toString())\n var len = bytes.length\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+\\/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = stringtrim(str).replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction stringtrim (str) {\n if (str.trim) return str.trim()\n return str.replace(/^\\s+|\\s+$/g, '')\n}\n\nfunction toHex (n) {\n if (n < 16) return '0' + n.toString(16)\n return n.toString(16)\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n var codePoint\n var length = string.length\n var leadSurrogate = null\n var bytes = []\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n var c, hi, lo\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\nfunction isnan (val) {\n return val !== val // eslint-disable-line no-self-compare\n}\n","// Polyfill for creating CustomEvents on IE9/10/11\n\n// code pulled from:\n// https://github.com/d4tocchini/customevent-polyfill\n// https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent#Polyfill\n\n(function() {\n if (typeof window === 'undefined') {\n return;\n }\n\n try {\n var ce = new window.CustomEvent('test', { cancelable: true });\n ce.preventDefault();\n if (ce.defaultPrevented !== true) {\n // IE has problems with .preventDefault() on custom events\n // http://stackoverflow.com/questions/23349191\n throw new Error('Could not prevent default');\n }\n } catch (e) {\n var CustomEvent = function(event, params) {\n var evt, origPrevent;\n params = params || {};\n params.bubbles = !!params.bubbles;\n params.cancelable = !!params.cancelable;\n\n evt = document.createEvent('CustomEvent');\n evt.initCustomEvent(\n event,\n params.bubbles,\n params.cancelable,\n params.detail\n );\n origPrevent = evt.preventDefault;\n evt.preventDefault = function() {\n origPrevent.call(this);\n try {\n Object.defineProperty(this, 'defaultPrevented', {\n get: function() {\n return true;\n }\n });\n } catch (e) {\n this.defaultPrevented = true;\n }\n };\n return evt;\n };\n\n CustomEvent.prototype = window.Event.prototype;\n window.CustomEvent = CustomEvent; // expose definition to window\n }\n})();\n","\n/**\n * This is the web browser implementation of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = require('./debug');\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = 'undefined' != typeof chrome\n && 'undefined' != typeof chrome.storage\n ? chrome.storage.local\n : localstorage();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n 'lightseagreen',\n 'forestgreen',\n 'goldenrod',\n 'dodgerblue',\n 'darkorchid',\n 'crimson'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\nfunction useColors() {\n // is webkit? http://stackoverflow.com/a/16459606/376773\n return ('WebkitAppearance' in document.documentElement.style) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (window.console && (console.firebug || (console.exception && console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\n}\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nexports.formatters.j = function(v) {\n return JSON.stringify(v);\n};\n\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ');\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}\n\n/**\n * Invokes `console.log()` when available.\n * No-op when `console.log` is not a \"function\".\n *\n * @api public\n */\n\nfunction log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\nfunction save(namespaces) {\n try {\n if (null == namespaces) {\n exports.storage.removeItem('debug');\n } else {\n exports.storage.debug = namespaces;\n }\n } catch(e) {}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n var r;\n try {\n r = exports.storage.debug;\n } catch(e) {}\n return r;\n}\n\n/**\n * Enable namespaces listed in `localStorage.debug` initially.\n */\n\nexports.enable(load());\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage(){\n try {\n return window.localStorage;\n } catch (e) {}\n}\n","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = debug;\nexports.coerce = coerce;\nexports.disable = disable;\nexports.enable = enable;\nexports.enabled = enabled;\n\n/**\n * The currently active debug mode names, and names to skip.\n */\n\nexports.names = [];\nexports.skips = [];\n\n/**\n * Map of special \"%n\" handling functions, for the debug \"format\" argument.\n *\n * Valid key names are a single, lowercased letter, i.e. \"n\".\n */\n\nexports.formatters = {};\n\n/**\n * Previously assigned color.\n */\n\nvar prevColor = 0;\n\n/**\n * Select a color.\n *\n * @return {Number}\n * @api private\n */\n\nfunction selectColor() {\n return exports.colors[prevColor++ % exports.colors.length];\n}\n\n/**\n * Create a debugger with the given `namespace`.\n *\n * @param {String} namespace\n * @return {Function}\n * @api public\n */\n\nfunction debug(namespace) {\n\n // define the `disabled` version\n function disabled() {\n }\n disabled.enabled = false;\n\n // define the `enabled` version\n function enabled() {\n\n var self = enabled;\n\n // add the `color` if not set\n if (null == self.useColors) self.useColors = exports.useColors();\n if (null == self.color && self.useColors) self.color = selectColor();\n\n var args = Array.prototype.slice.call(arguments);\n\n args[0] = exports.coerce(args[0]);\n\n if ('string' !== typeof args[0]) {\n // anything else let's inspect with %o\n args = ['%o'].concat(args);\n }\n\n // apply any `formatters` transformations\n var index = 0;\n args[0] = args[0].replace(/%([a-z%])/g, function(match, format) {\n // if we encounter an escaped % then don't increase the array index\n if (match === '%%') return match;\n index++;\n var formatter = exports.formatters[format];\n if ('function' === typeof formatter) {\n var val = args[index];\n match = formatter.call(self, val);\n\n // now we need to remove `args[index]` since it's inlined in the `format`\n args.splice(index, 1);\n index--;\n }\n return match;\n });\n\n if ('function' === typeof exports.formatArgs) {\n args = exports.formatArgs.apply(self, args);\n }\n var logFn = enabled.log || exports.log || console.log.bind(console);\n logFn.apply(self, args);\n }\n enabled.enabled = true;\n\n var fn = exports.enabled(namespace) ? enabled : disabled;\n\n fn.namespace = namespace;\n\n return fn;\n}\n\n/**\n * Enables a debug mode by namespaces. This can include modes\n * separated by a colon and wildcards.\n *\n * @param {String} namespaces\n * @api public\n */\n\nfunction enable(namespaces) {\n exports.save(namespaces);\n\n var split = (namespaces || '').split(/[\\s,]+/);\n var len = split.length;\n\n for (var i = 0; i < len; i++) {\n if (!split[i]) continue; // ignore empty strings\n namespaces = split[i].replace(/\\*/g, '.*?');\n if (namespaces[0] === '-') {\n exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n } else {\n exports.names.push(new RegExp('^' + namespaces + '$'));\n }\n }\n}\n\n/**\n * Disable debug output.\n *\n * @api public\n */\n\nfunction disable() {\n exports.enable('');\n}\n\n/**\n * Returns true if the given mode name is enabled, false otherwise.\n *\n * @param {String} name\n * @return {Boolean}\n * @api public\n */\n\nfunction enabled(name) {\n var i, len;\n for (i = 0, len = exports.skips.length; i < len; i++) {\n if (exports.skips[i].test(name)) {\n return false;\n }\n }\n for (i = 0, len = exports.names.length; i < len; i++) {\n if (exports.names[i].test(name)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Coerce `val`.\n *\n * @param {Mixed} val\n * @return {Mixed}\n * @api private\n */\n\nfunction coerce(val) {\n if (val instanceof Error) return val.stack || val.message;\n return val;\n}\n","'use strict';\nvar isObj = require('is-obj');\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n\tif (val === null || val === undefined) {\n\t\tthrow new TypeError('Sources cannot be null or undefined');\n\t}\n\n\treturn Object(val);\n}\n\nfunction assignKey(to, from, key) {\n\tvar val = from[key];\n\n\tif (val === undefined || val === null) {\n\t\treturn;\n\t}\n\n\tif (hasOwnProperty.call(to, key)) {\n\t\tif (to[key] === undefined || to[key] === null) {\n\t\t\tthrow new TypeError('Cannot convert undefined or null to object (' + key + ')');\n\t\t}\n\t}\n\n\tif (!hasOwnProperty.call(to, key) || !isObj(val)) {\n\t\tto[key] = val;\n\t} else {\n\t\tto[key] = assign(Object(to[key]), from[key]);\n\t}\n}\n\nfunction assign(to, from) {\n\tif (to === from) {\n\t\treturn to;\n\t}\n\n\tfrom = Object(from);\n\n\tfor (var key in from) {\n\t\tif (hasOwnProperty.call(from, key)) {\n\t\t\tassignKey(to, from, key);\n\t\t}\n\t}\n\n\tif (Object.getOwnPropertySymbols) {\n\t\tvar symbols = Object.getOwnPropertySymbols(from);\n\n\t\tfor (var i = 0; i < symbols.length; i++) {\n\t\t\tif (propIsEnumerable.call(from, symbols[i])) {\n\t\t\t\tassignKey(to, from, symbols[i]);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to;\n}\n\nmodule.exports = function deepAssign(target) {\n\ttarget = toObject(target);\n\n\tfor (var s = 1; s < arguments.length; s++) {\n\t\tassign(target, arguments[s]);\n\t}\n\n\treturn target;\n};\n","'use strict';\n\nvar keys = require('object-keys');\nvar hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';\n\nvar toStr = Object.prototype.toString;\nvar concat = Array.prototype.concat;\nvar origDefineProperty = Object.defineProperty;\n\nvar isFunction = function (fn) {\n\treturn typeof fn === 'function' && toStr.call(fn) === '[object Function]';\n};\n\nvar arePropertyDescriptorsSupported = function () {\n\tvar obj = {};\n\ttry {\n\t\torigDefineProperty(obj, 'x', { enumerable: false, value: obj });\n\t\t// eslint-disable-next-line no-unused-vars, no-restricted-syntax\n\t\tfor (var _ in obj) { // jscs:ignore disallowUnusedVariables\n\t\t\treturn false;\n\t\t}\n\t\treturn obj.x === obj;\n\t} catch (e) { /* this is IE 8. */\n\t\treturn false;\n\t}\n};\nvar supportsDescriptors = origDefineProperty && arePropertyDescriptorsSupported();\n\nvar defineProperty = function (object, name, value, predicate) {\n\tif (name in object && (!isFunction(predicate) || !predicate())) {\n\t\treturn;\n\t}\n\tif (supportsDescriptors) {\n\t\torigDefineProperty(object, name, {\n\t\t\tconfigurable: true,\n\t\t\tenumerable: false,\n\t\t\tvalue: value,\n\t\t\twritable: true\n\t\t});\n\t} else {\n\t\tobject[name] = value;\n\t}\n};\n\nvar defineProperties = function (object, map) {\n\tvar predicates = arguments.length > 2 ? arguments[2] : {};\n\tvar props = keys(map);\n\tif (hasSymbols) {\n\t\tprops = concat.call(props, Object.getOwnPropertySymbols(map));\n\t}\n\tfor (var i = 0; i < props.length; i += 1) {\n\t\tdefineProperty(object, props[i], map[props[i]], predicates[props[i]]);\n\t}\n};\n\ndefineProperties.supportsDescriptors = !!supportsDescriptors;\n\nmodule.exports = defineProperties;\n","/*! (C) WebReflection Mit Style License */\n(function(t,n,r,i){\"use strict\";function st(e,t){for(var n=0,r=e.length;n<r;n++)gt(e[n],t)}function ot(e){for(var t=0,n=e.length,r;t<n;t++)r=e[t],it(r,w[at(r)])}function ut(e){return function(t){F(t)&&(gt(t,e),st(t.querySelectorAll(E),e))}}function at(e){var t=R.call(e,\"is\"),n=e.nodeName.toUpperCase(),r=x.call(b,t?m+t.toUpperCase():v+n);return t&&-1<r&&!ft(n,t)?-1:r}function ft(e,t){return-1<E.indexOf(e+'[is=\"'+t+'\"]')}function lt(e){var t=e.currentTarget,n=e.attrChange,r=e.attrName,i=e.target;Y&&(!i||i===t)&&t.attributeChangedCallback&&r!==\"style\"&&e.prevValue!==e.newValue&&t.attributeChangedCallback(r,n===e[f]?null:e.prevValue,n===e[c]?null:e.newValue)}function ct(e){var t=ut(e);return function(e){$.push(t,e.target)}}function ht(e){G&&(G=!1,e.currentTarget.removeEventListener(p,ht)),st((e.target||n).querySelectorAll(E),e.detail===u?u:o),j&&vt()}function pt(e,t){var n=this;U.call(n,e,t),Z.call(n,{target:n})}function dt(e,t){P(e,t),nt?nt.observe(e,X):(Q&&(e.setAttribute=pt,e[s]=tt(e),e.addEventListener(d,Z)),e.addEventListener(h,lt)),e.createdCallback&&Y&&(e.created=!0,e.createdCallback(),e.created=!1)}function vt(){for(var e,t=0,n=I.length;t<n;t++)e=I[t],S.contains(e)||(n--,I.splice(t--,1),gt(e,u))}function mt(e){throw new Error(\"A \"+e+\" type is already registered\")}function gt(e,t){var n,r=at(e);-1<r&&(rt(e,w[r]),r=0,t===o&&!e[o]?(e[u]=!1,e[o]=!0,r=1,j&&x.call(I,e)<0&&I.push(e)):t===u&&!e[u]&&(e[o]=!1,e[u]=!0,r=1),r&&(n=e[t+\"Callback\"])&&n.call(e))}if(i in n)return;var s=\"__\"+i+(Math.random()*1e5>>0),o=\"attached\",u=\"detached\",a=\"extends\",f=\"ADDITION\",l=\"MODIFICATION\",c=\"REMOVAL\",h=\"DOMAttrModified\",p=\"DOMContentLoaded\",d=\"DOMSubtreeModified\",v=\"<\",m=\"=\",g=/^[A-Z][A-Z0-9]*(?:-[A-Z0-9]+)+$/,y=[\"ANNOTATION-XML\",\"COLOR-PROFILE\",\"FONT-FACE\",\"FONT-FACE-SRC\",\"FONT-FACE-URI\",\"FONT-FACE-FORMAT\",\"FONT-FACE-NAME\",\"MISSING-GLYPH\"],b=[],w=[],E=\"\",S=n.documentElement,x=b.indexOf||function(e){for(var t=this.length;t--&&this[t]!==e;);return t},T=r.prototype,N=T.hasOwnProperty,C=T.isPrototypeOf,k=r.defineProperty,L=r.getOwnPropertyDescriptor,A=r.getOwnPropertyNames,O=r.getPrototypeOf,M=r.setPrototypeOf,_=!!r.__proto__,D=r.create||function yt(e){return e?(yt.prototype=e,new yt):this},P=M||(_?function(e,t){return e.__proto__=t,e}:A&&L?function(){function e(e,t){for(var n,r=A(t),i=0,s=r.length;i<s;i++)n=r[i],N.call(e,n)||k(e,n,L(t,n))}return function(t,n){do e(t,n);while((n=O(n))&&!C.call(n,t));return t}}():function(e,t){for(var n in t)e[n]=t[n];return e}),H=t.MutationObserver||t.WebKitMutationObserver,B=(t.HTMLElement||t.Element||t.Node).prototype,j=!C.call(B,S),F=j?function(e){return e.nodeType===1}:function(e){return C.call(B,e)},I=j&&[],q=B.cloneNode,R=B.getAttribute,U=B.setAttribute,z=B.removeAttribute,W=n.createElement,X=H&&{attributes:!0,characterData:!0,attributeOldValue:!0},V=H||function(e){Q=!1,S.removeEventListener(h,V)},$,J=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,10)},K=!1,Q=!0,G=!0,Y=!0,Z,et,tt,nt,rt,it;M||_?(rt=function(e,t){C.call(t,e)||dt(e,t)},it=dt):(rt=function(e,t){e[s]||(e[s]=r(!0),dt(e,t))},it=rt),j?(Q=!1,function(){var t=L(B,\"addEventListener\"),n=t.value,r=function(e){var t=new CustomEvent(h,{bubbles:!0});t.attrName=e,t.prevValue=R.call(this,e),t.newValue=null,t[c]=t.attrChange=2,z.call(this,e),this.dispatchEvent(t)},i=function(t,n){var r=this.hasAttribute(t),i=r&&R.call(this,t);e=new CustomEvent(h,{bubbles:!0}),U.call(this,t,n),e.attrName=t,e.prevValue=r?i:null,e.newValue=n,r?e[l]=e.attrChange=1:e[f]=e.attrChange=0,this.dispatchEvent(e)},o=function(e){var t=e.currentTarget,n=t[s],r=e.propertyName,i;n.hasOwnProperty(r)&&(n=n[r],i=new CustomEvent(h,{bubbles:!0}),i.attrName=n.name,i.prevValue=n.value||null,i.newValue=n.value=t[r]||null,i.prevValue==null?i[f]=i.attrChange=0:i[l]=i.attrChange=1,t.dispatchEvent(i))};t.value=function(e,t,u){e===h&&this.attributeChangedCallback&&this.setAttribute!==i&&(this[s]={className:{name:\"class\",value:this.className}},this.setAttribute=i,this.removeAttribute=r,n.call(this,\"propertychange\",o)),n.call(this,e,t,u)},k(B,\"addEventListener\",t)}()):H||(S.addEventListener(h,V),S.setAttribute(s,1),S.removeAttribute(s),Q&&(Z=function(e){var t=this,n,r,i;if(t===e.target){n=t[s],t[s]=r=tt(t);for(i in r){if(!(i in n))return et(0,t,i,n[i],r[i],f);if(r[i]!==n[i])return et(1,t,i,n[i],r[i],l)}for(i in n)if(!(i in r))return et(2,t,i,n[i],r[i],c)}},et=function(e,t,n,r,i,s){var o={attrChange:e,currentTarget:t,attrName:n,prevValue:r,newValue:i};o[s]=e,lt(o)},tt=function(e){for(var t,n,r={},i=e.attributes,s=0,o=i.length;s<o;s++)t=i[s],n=t.name,n!==\"setAttribute\"&&(r[n]=t.value);return r})),n[i]=function(t,r){c=t.toUpperCase(),K||(K=!0,H?(nt=function(e,t){function n(e,t){for(var n=0,r=e.length;n<r;t(e[n++]));}return new H(function(r){for(var i,s,o,u=0,a=r.length;u<a;u++)i=r[u],i.type===\"childList\"?(n(i.addedNodes,e),n(i.removedNodes,t)):(s=i.target,Y&&s.attributeChangedCallback&&i.attributeName!==\"style\"&&(o=R.call(s,i.attributeName),o!==i.oldValue&&s.attributeChangedCallback(i.attributeName,i.oldValue,o)))})}(ut(o),ut(u)),nt.observe(n,{childList:!0,subtree:!0})):($=[],J(function d(){while($.length)$.shift().call(null,$.shift());J(d)}),n.addEventListener(\"DOMNodeInserted\",ct(o)),n.addEventListener(\"DOMNodeRemoved\",ct(u))),n.addEventListener(p,ht),n.addEventListener(\"readystatechange\",ht),n.createElement=function(e,t){var r=W.apply(n,arguments),i=\"\"+e,s=x.call(b,(t?m:v)+(t||i).toUpperCase()),o=-1<s;return t&&(r.setAttribute(\"is\",t=t.toLowerCase()),o&&(o=ft(i.toUpperCase(),t))),Y=!n.createElement.innerHTMLHelper,o&&it(r,w[s]),r},B.cloneNode=function(e){var t=q.call(this,!!e),n=at(t);return-1<n&&it(t,w[n]),e&&ot(t.querySelectorAll(E)),t}),-2<x.call(b,m+c)+x.call(b,v+c)&&mt(t);if(!g.test(c)||-1<x.call(y,c))throw new Error(\"The type \"+t+\" is invalid\");var i=function(){return f?n.createElement(l,c):n.createElement(l)},s=r||T,f=N.call(s,a),l=f?r[a].toUpperCase():c,c,h;return f&&-1<x.call(b,v+l)&&mt(l),h=b.push((f?m:v)+c)-1,E=E.concat(E.length?\",\":\"\",f?l+'[is=\"'+t.toLowerCase()+'\"]':l),i.prototype=w[h]=N.call(s,\"prototype\")?s.prototype:D(B),st(n.querySelectorAll(E),o),i}})(window,document,Object,\"registerElement\");","module.exports = function(dtype) {\n switch (dtype) {\n case 'int8':\n return Int8Array\n case 'int16':\n return Int16Array\n case 'int32':\n return Int32Array\n case 'uint8':\n return Uint8Array\n case 'uint16':\n return Uint16Array\n case 'uint32':\n return Uint32Array\n case 'float32':\n return Float32Array\n case 'float64':\n return Float64Array\n case 'array':\n return Array\n case 'uint8_clamped':\n return Uint8ClampedArray\n }\n}\n","'use strict';\n\n/* globals\n\tSet,\n\tMap,\n\tWeakSet,\n\tWeakMap,\n\n\tPromise,\n\n\tSymbol,\n\tProxy,\n\n\tAtomics,\n\tSharedArrayBuffer,\n\n\tArrayBuffer,\n\tDataView,\n\tUint8Array,\n\tFloat32Array,\n\tFloat64Array,\n\tInt8Array,\n\tInt16Array,\n\tInt32Array,\n\tUint8ClampedArray,\n\tUint16Array,\n\tUint32Array,\n*/\n\nvar undefined; // eslint-disable-line no-shadow-restricted-names\n\nvar ThrowTypeError = Object.getOwnPropertyDescriptor\n\t? (function () { return Object.getOwnPropertyDescriptor(arguments, 'callee').get; }())\n\t: function () { throw new TypeError(); };\n\nvar hasSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol';\n\nvar getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto\n\nvar generator; // = function * () {};\nvar generatorFunction = generator ? getProto(generator) : undefined;\nvar asyncFn; // async function() {};\nvar asyncFunction = asyncFn ? asyncFn.constructor : undefined;\nvar asyncGen; // async function * () {};\nvar asyncGenFunction = asyncGen ? getProto(asyncGen) : undefined;\nvar asyncGenIterator = asyncGen ? asyncGen() : undefined;\n\nvar TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array);\n\nvar INTRINSICS = {\n\t'$ %Array%': Array,\n\t'$ %ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,\n\t'$ %ArrayBufferPrototype%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer.prototype,\n\t'$ %ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined,\n\t'$ %ArrayPrototype%': Array.prototype,\n\t'$ %ArrayProto_entries%': Array.prototype.entries,\n\t'$ %ArrayProto_forEach%': Array.prototype.forEach,\n\t'$ %ArrayProto_keys%': Array.prototype.keys,\n\t'$ %ArrayProto_values%': Array.prototype.values,\n\t'$ %AsyncFromSyncIteratorPrototype%': undefined,\n\t'$ %AsyncFunction%': asyncFunction,\n\t'$ %AsyncFunctionPrototype%': asyncFunction ? asyncFunction.prototype : undefined,\n\t'$ %AsyncGenerator%': asyncGen ? getProto(asyncGenIterator) : undefined,\n\t'$ %AsyncGeneratorFunction%': asyncGenFunction,\n\t'$ %AsyncGeneratorPrototype%': asyncGenFunction ? asyncGenFunction.prototype : undefined,\n\t'$ %AsyncIteratorPrototype%': asyncGenIterator && hasSymbols && Symbol.asyncIterator ? asyncGenIterator[Symbol.asyncIterator]() : undefined,\n\t'$ %Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,\n\t'$ %Boolean%': Boolean,\n\t'$ %BooleanPrototype%': Boolean.prototype,\n\t'$ %DataView%': typeof DataView === 'undefined' ? undefined : DataView,\n\t'$ %DataViewPrototype%': typeof DataView === 'undefined' ? undefined : DataView.prototype,\n\t'$ %Date%': Date,\n\t'$ %DatePrototype%': Date.prototype,\n\t'$ %decodeURI%': decodeURI,\n\t'$ %decodeURIComponent%': decodeURIComponent,\n\t'$ %encodeURI%': encodeURI,\n\t'$ %encodeURIComponent%': encodeURIComponent,\n\t'$ %Error%': Error,\n\t'$ %ErrorPrototype%': Error.prototype,\n\t'$ %eval%': eval, // eslint-disable-line no-eval\n\t'$ %EvalError%': EvalError,\n\t'$ %EvalErrorPrototype%': EvalError.prototype,\n\t'$ %Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,\n\t'$ %Float32ArrayPrototype%': typeof Float32Array === 'undefined' ? undefined : Float32Array.prototype,\n\t'$ %Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,\n\t'$ %Float64ArrayPrototype%': typeof Float64Array === 'undefined' ? undefined : Float64Array.prototype,\n\t'$ %Function%': Function,\n\t'$ %FunctionPrototype%': Function.prototype,\n\t'$ %Generator%': generator ? getProto(generator()) : undefined,\n\t'$ %GeneratorFunction%': generatorFunction,\n\t'$ %GeneratorPrototype%': generatorFunction ? generatorFunction.prototype : undefined,\n\t'$ %Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,\n\t'$ %Int8ArrayPrototype%': typeof Int8Array === 'undefined' ? undefined : Int8Array.prototype,\n\t'$ %Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,\n\t'$ %Int16ArrayPrototype%': typeof Int16Array === 'undefined' ? undefined : Int8Array.prototype,\n\t'$ %Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,\n\t'$ %Int32ArrayPrototype%': typeof Int32Array === 'undefined' ? undefined : Int32Array.prototype,\n\t'$ %isFinite%': isFinite,\n\t'$ %isNaN%': isNaN,\n\t'$ %IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined,\n\t'$ %JSON%': JSON,\n\t'$ %JSONParse%': JSON.parse,\n\t'$ %Map%': typeof Map === 'undefined' ? undefined : Map,\n\t'$ %MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()),\n\t'$ %MapPrototype%': typeof Map === 'undefined' ? undefined : Map.prototype,\n\t'$ %Math%': Math,\n\t'$ %Number%': Number,\n\t'$ %NumberPrototype%': Number.prototype,\n\t'$ %Object%': Object,\n\t'$ %ObjectPrototype%': Object.prototype,\n\t'$ %ObjProto_toString%': Object.prototype.toString,\n\t'$ %ObjProto_valueOf%': Object.prototype.valueOf,\n\t'$ %parseFloat%': parseFloat,\n\t'$ %parseInt%': parseInt,\n\t'$ %Promise%': typeof Promise === 'undefined' ? undefined : Promise,\n\t'$ %PromisePrototype%': typeof Promise === 'undefined' ? undefined : Promise.prototype,\n\t'$ %PromiseProto_then%': typeof Promise === 'undefined' ? undefined : Promise.prototype.then,\n\t'$ %Promise_all%': typeof Promise === 'undefined' ? undefined : Promise.all,\n\t'$ %Promise_reject%': typeof Promise === 'undefined' ? undefined : Promise.reject,\n\t'$ %Promise_resolve%': typeof Promise === 'undefined' ? undefined : Promise.resolve,\n\t'$ %Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,\n\t'$ %RangeError%': RangeError,\n\t'$ %RangeErrorPrototype%': RangeError.prototype,\n\t'$ %ReferenceError%': ReferenceError,\n\t'$ %ReferenceErrorPrototype%': ReferenceError.prototype,\n\t'$ %Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,\n\t'$ %RegExp%': RegExp,\n\t'$ %RegExpPrototype%': RegExp.prototype,\n\t'$ %Set%': typeof Set === 'undefined' ? undefined : Set,\n\t'$ %SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()),\n\t'$ %SetPrototype%': typeof Set === 'undefined' ? undefined : Set.prototype,\n\t'$ %SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,\n\t'$ %SharedArrayBufferPrototype%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer.prototype,\n\t'$ %String%': String,\n\t'$ %StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined,\n\t'$ %StringPrototype%': String.prototype,\n\t'$ %Symbol%': hasSymbols ? Symbol : undefined,\n\t'$ %SymbolPrototype%': hasSymbols ? Symbol.prototype : undefined,\n\t'$ %SyntaxError%': SyntaxError,\n\t'$ %SyntaxErrorPrototype%': SyntaxError.prototype,\n\t'$ %ThrowTypeError%': ThrowTypeError,\n\t'$ %TypedArray%': TypedArray,\n\t'$ %TypedArrayPrototype%': TypedArray ? TypedArray.prototype : undefined,\n\t'$ %TypeError%': TypeError,\n\t'$ %TypeErrorPrototype%': TypeError.prototype,\n\t'$ %Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,\n\t'$ %Uint8ArrayPrototype%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array.prototype,\n\t'$ %Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,\n\t'$ %Uint8ClampedArrayPrototype%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray.prototype,\n\t'$ %Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,\n\t'$ %Uint16ArrayPrototype%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array.prototype,\n\t'$ %Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,\n\t'$ %Uint32ArrayPrototype%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array.prototype,\n\t'$ %URIError%': URIError,\n\t'$ %URIErrorPrototype%': URIError.prototype,\n\t'$ %WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,\n\t'$ %WeakMapPrototype%': typeof WeakMap === 'undefined' ? undefined : WeakMap.prototype,\n\t'$ %WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet,\n\t'$ %WeakSetPrototype%': typeof WeakSet === 'undefined' ? undefined : WeakSet.prototype\n};\n\nmodule.exports = function GetIntrinsic(name, allowMissing) {\n\tif (arguments.length > 1 && typeof allowMissing !== 'boolean') {\n\t\tthrow new TypeError('\"allowMissing\" argument must be a boolean');\n\t}\n\n\tvar key = '$ ' + name;\n\tif (!(key in INTRINSICS)) {\n\t\tthrow new SyntaxError('intrinsic ' + name + ' does not exist!');\n\t}\n\n\t// istanbul ignore if // hopefully this is impossible to test :-)\n\tif (typeof INTRINSICS[key] === 'undefined' && !allowMissing) {\n\t\tthrow new TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');\n\t}\n\treturn INTRINSICS[key];\n};\n","'use strict';\n\nvar GetIntrinsic = require('./GetIntrinsic');\n\nvar $Object = GetIntrinsic('%Object%');\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $String = GetIntrinsic('%String%');\n\nvar assertRecord = require('./helpers/assertRecord');\nvar $isNaN = require('./helpers/isNaN');\nvar $isFinite = require('./helpers/isFinite');\n\nvar sign = require('./helpers/sign');\nvar mod = require('./helpers/mod');\n\nvar IsCallable = require('is-callable');\nvar toPrimitive = require('es-to-primitive/es5');\n\nvar has = require('has');\n\n// https://es5.github.io/#x9\nvar ES5 = {\n\tToPrimitive: toPrimitive,\n\n\tToBoolean: function ToBoolean(value) {\n\t\treturn !!value;\n\t},\n\tToNumber: function ToNumber(value) {\n\t\treturn +value; // eslint-disable-line no-implicit-coercion\n\t},\n\tToInteger: function ToInteger(value) {\n\t\tvar number = this.ToNumber(value);\n\t\tif ($isNaN(number)) { return 0; }\n\t\tif (number === 0 || !$isFinite(number)) { return number; }\n\t\treturn sign(number) * Math.floor(Math.abs(number));\n\t},\n\tToInt32: function ToInt32(x) {\n\t\treturn this.ToNumber(x) >> 0;\n\t},\n\tToUint32: function ToUint32(x) {\n\t\treturn this.ToNumber(x) >>> 0;\n\t},\n\tToUint16: function ToUint16(value) {\n\t\tvar number = this.ToNumber(value);\n\t\tif ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; }\n\t\tvar posInt = sign(number) * Math.floor(Math.abs(number));\n\t\treturn mod(posInt, 0x10000);\n\t},\n\tToString: function ToString(value) {\n\t\treturn $String(value);\n\t},\n\tToObject: function ToObject(value) {\n\t\tthis.CheckObjectCoercible(value);\n\t\treturn $Object(value);\n\t},\n\tCheckObjectCoercible: function CheckObjectCoercible(value, optMessage) {\n\t\t/* jshint eqnull:true */\n\t\tif (value == null) {\n\t\t\tthrow new $TypeError(optMessage || 'Cannot call method on ' + value);\n\t\t}\n\t\treturn value;\n\t},\n\tIsCallable: IsCallable,\n\tSameValue: function SameValue(x, y) {\n\t\tif (x === y) { // 0 === -0, but they are not identical.\n\t\t\tif (x === 0) { return 1 / x === 1 / y; }\n\t\t\treturn true;\n\t\t}\n\t\treturn $isNaN(x) && $isNaN(y);\n\t},\n\n\t// https://www.ecma-international.org/ecma-262/5.1/#sec-8\n\tType: function Type(x) {\n\t\tif (x === null) {\n\t\t\treturn 'Null';\n\t\t}\n\t\tif (typeof x === 'undefined') {\n\t\t\treturn 'Undefined';\n\t\t}\n\t\tif (typeof x === 'function' || typeof x === 'object') {\n\t\t\treturn 'Object';\n\t\t}\n\t\tif (typeof x === 'number') {\n\t\t\treturn 'Number';\n\t\t}\n\t\tif (typeof x === 'boolean') {\n\t\t\treturn 'Boolean';\n\t\t}\n\t\tif (typeof x === 'string') {\n\t\t\treturn 'String';\n\t\t}\n\t},\n\n\t// https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type\n\tIsPropertyDescriptor: function IsPropertyDescriptor(Desc) {\n\t\tif (this.Type(Desc) !== 'Object') {\n\t\t\treturn false;\n\t\t}\n\t\tvar allowed = {\n\t\t\t'[[Configurable]]': true,\n\t\t\t'[[Enumerable]]': true,\n\t\t\t'[[Get]]': true,\n\t\t\t'[[Set]]': true,\n\t\t\t'[[Value]]': true,\n\t\t\t'[[Writable]]': true\n\t\t};\n\n\t\tfor (var key in Desc) { // eslint-disable-line\n\t\t\tif (has(Desc, key) && !allowed[key]) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tvar isData = has(Desc, '[[Value]]');\n\t\tvar IsAccessor = has(Desc, '[[Get]]') || has(Desc, '[[Set]]');\n\t\tif (isData && IsAccessor) {\n\t\t\tthrow new $TypeError('Property Descriptors may not be both accessor and data descriptors');\n\t\t}\n\t\treturn true;\n\t},\n\n\t// https://ecma-international.org/ecma-262/5.1/#sec-8.10.1\n\tIsAccessorDescriptor: function IsAccessorDescriptor(Desc) {\n\t\tif (typeof Desc === 'undefined') {\n\t\t\treturn false;\n\t\t}\n\n\t\tassertRecord(this, 'Property Descriptor', 'Desc', Desc);\n\n\t\tif (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t},\n\n\t// https://ecma-international.org/ecma-262/5.1/#sec-8.10.2\n\tIsDataDescriptor: function IsDataDescriptor(Desc) {\n\t\tif (typeof Desc === 'undefined') {\n\t\t\treturn false;\n\t\t}\n\n\t\tassertRecord(this, 'Property Descriptor', 'Desc', Desc);\n\n\t\tif (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t},\n\n\t// https://ecma-international.org/ecma-262/5.1/#sec-8.10.3\n\tIsGenericDescriptor: function IsGenericDescriptor(Desc) {\n\t\tif (typeof Desc === 'undefined') {\n\t\t\treturn false;\n\t\t}\n\n\t\tassertRecord(this, 'Property Descriptor', 'Desc', Desc);\n\n\t\tif (!this.IsAccessorDescriptor(Desc) && !this.IsDataDescriptor(Desc)) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t},\n\n\t// https://ecma-international.org/ecma-262/5.1/#sec-8.10.4\n\tFromPropertyDescriptor: function FromPropertyDescriptor(Desc) {\n\t\tif (typeof Desc === 'undefined') {\n\t\t\treturn Desc;\n\t\t}\n\n\t\tassertRecord(this, 'Property Descriptor', 'Desc', Desc);\n\n\t\tif (this.IsDataDescriptor(Desc)) {\n\t\t\treturn {\n\t\t\t\tvalue: Desc['[[Value]]'],\n\t\t\t\twritable: !!Desc['[[Writable]]'],\n\t\t\t\tenumerable: !!Desc['[[Enumerable]]'],\n\t\t\t\tconfigurable: !!Desc['[[Configurable]]']\n\t\t\t};\n\t\t} else if (this.IsAccessorDescriptor(Desc)) {\n\t\t\treturn {\n\t\t\t\tget: Desc['[[Get]]'],\n\t\t\t\tset: Desc['[[Set]]'],\n\t\t\t\tenumerable: !!Desc['[[Enumerable]]'],\n\t\t\t\tconfigurable: !!Desc['[[Configurable]]']\n\t\t\t};\n\t\t} else {\n\t\t\tthrow new $TypeError('FromPropertyDescriptor must be called with a fully populated Property Descriptor');\n\t\t}\n\t},\n\n\t// https://ecma-international.org/ecma-262/5.1/#sec-8.10.5\n\tToPropertyDescriptor: function ToPropertyDescriptor(Obj) {\n\t\tif (this.Type(Obj) !== 'Object') {\n\t\t\tthrow new $TypeError('ToPropertyDescriptor requires an object');\n\t\t}\n\n\t\tvar desc = {};\n\t\tif (has(Obj, 'enumerable')) {\n\t\t\tdesc['[[Enumerable]]'] = this.ToBoolean(Obj.enumerable);\n\t\t}\n\t\tif (has(Obj, 'configurable')) {\n\t\t\tdesc['[[Configurable]]'] = this.ToBoolean(Obj.configurable);\n\t\t}\n\t\tif (has(Obj, 'value')) {\n\t\t\tdesc['[[Value]]'] = Obj.value;\n\t\t}\n\t\tif (has(Obj, 'writable')) {\n\t\t\tdesc['[[Writable]]'] = this.ToBoolean(Obj.writable);\n\t\t}\n\t\tif (has(Obj, 'get')) {\n\t\t\tvar getter = Obj.get;\n\t\t\tif (typeof getter !== 'undefined' && !this.IsCallable(getter)) {\n\t\t\t\tthrow new TypeError('getter must be a function');\n\t\t\t}\n\t\t\tdesc['[[Get]]'] = getter;\n\t\t}\n\t\tif (has(Obj, 'set')) {\n\t\t\tvar setter = Obj.set;\n\t\t\tif (typeof setter !== 'undefined' && !this.IsCallable(setter)) {\n\t\t\t\tthrow new $TypeError('setter must be a function');\n\t\t\t}\n\t\t\tdesc['[[Set]]'] = setter;\n\t\t}\n\n\t\tif ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) {\n\t\t\tthrow new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute');\n\t\t}\n\t\treturn desc;\n\t}\n};\n\nmodule.exports = ES5;\n","'use strict';\n\nvar GetIntrinsic = require('../GetIntrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $SyntaxError = GetIntrinsic('%SyntaxError%');\n\nvar has = require('has');\n\nvar predicates = {\n // https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type\n 'Property Descriptor': function isPropertyDescriptor(ES, Desc) {\n if (ES.Type(Desc) !== 'Object') {\n return false;\n }\n var allowed = {\n '[[Configurable]]': true,\n '[[Enumerable]]': true,\n '[[Get]]': true,\n '[[Set]]': true,\n '[[Value]]': true,\n '[[Writable]]': true\n };\n\n for (var key in Desc) { // eslint-disable-line\n if (has(Desc, key) && !allowed[key]) {\n return false;\n }\n }\n\n var isData = has(Desc, '[[Value]]');\n var IsAccessor = has(Desc, '[[Get]]') || has(Desc, '[[Set]]');\n if (isData && IsAccessor) {\n throw new $TypeError('Property Descriptors may not be both accessor and data descriptors');\n }\n return true;\n }\n};\n\nmodule.exports = function assertRecord(ES, recordType, argumentName, value) {\n var predicate = predicates[recordType];\n if (typeof predicate !== 'function') {\n throw new $SyntaxError('unknown record type: ' + recordType);\n }\n if (!predicate(ES, value)) {\n throw new $TypeError(argumentName + ' must be a ' + recordType);\n }\n console.log(predicate(ES, value), value);\n};\n","var $isNaN = Number.isNaN || function (a) { return a !== a; };\n\nmodule.exports = Number.isFinite || function (x) { return typeof x === 'number' && !$isNaN(x) && x !== Infinity && x !== -Infinity; };\n","module.exports = Number.isNaN || function isNaN(a) {\n\treturn a !== a;\n};\n","module.exports = function mod(number, modulo) {\n\tvar remain = number % modulo;\n\treturn Math.floor(remain >= 0 ? remain : remain + modulo);\n};\n","module.exports = function sign(number) {\n\treturn number >= 0 ? 1 : -1;\n};\n","'use strict';\n\nvar toStr = Object.prototype.toString;\n\nvar isPrimitive = require('./helpers/isPrimitive');\n\nvar isCallable = require('is-callable');\n\n// http://ecma-international.org/ecma-262/5.1/#sec-8.12.8\nvar ES5internalSlots = {\n\t'[[DefaultValue]]': function (O) {\n\t\tvar actualHint;\n\t\tif (arguments.length > 1) {\n\t\t\tactualHint = arguments[1];\n\t\t} else {\n\t\t\tactualHint = toStr.call(O) === '[object Date]' ? String : Number;\n\t\t}\n\n\t\tif (actualHint === String || actualHint === Number) {\n\t\t\tvar methods = actualHint === String ? ['toString', 'valueOf'] : ['valueOf', 'toString'];\n\t\t\tvar value, i;\n\t\t\tfor (i = 0; i < methods.length; ++i) {\n\t\t\t\tif (isCallable(O[methods[i]])) {\n\t\t\t\t\tvalue = O[methods[i]]();\n\t\t\t\t\tif (isPrimitive(value)) {\n\t\t\t\t\t\treturn value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tthrow new TypeError('No default value');\n\t\t}\n\t\tthrow new TypeError('invalid [[DefaultValue]] hint supplied');\n\t}\n};\n\n// http://ecma-international.org/ecma-262/5.1/#sec-9.1\nmodule.exports = function ToPrimitive(input) {\n\tif (isPrimitive(input)) {\n\t\treturn input;\n\t}\n\tif (arguments.length > 1) {\n\t\treturn ES5internalSlots['[[DefaultValue]]'](input, arguments[1]);\n\t}\n\treturn ES5internalSlots['[[DefaultValue]]'](input);\n};\n","module.exports = function isPrimitive(value) {\n\treturn value === null || (typeof value !== 'function' && typeof value !== 'object');\n};\n","/*eslint new-cap:0*/\nvar dtype = require('dtype')\n\nmodule.exports = flattenVertexData\n\nfunction flattenVertexData (data, output, offset) {\n if (!data) throw new TypeError('must specify data as first parameter')\n offset = +(offset || 0) | 0\n\n if (Array.isArray(data) && (data[0] && typeof data[0][0] === 'number')) {\n var dim = data[0].length\n var length = data.length * dim\n var i, j, k, l\n\n // no output specified, create a new typed array\n if (!output || typeof output === 'string') {\n output = new (dtype(output || 'float32'))(length + offset)\n }\n\n var dstLength = output.length - offset\n if (length !== dstLength) {\n throw new Error('source length ' + length + ' (' + dim + 'x' + data.length + ')' +\n ' does not match destination length ' + dstLength)\n }\n\n for (i = 0, k = offset; i < data.length; i++) {\n for (j = 0; j < dim; j++) {\n output[k++] = data[i][j] === null ? NaN : data[i][j]\n }\n }\n } else {\n if (!output || typeof output === 'string') {\n // no output, create a new one\n var Ctor = dtype(output || 'float32')\n\n // handle arrays separately due to possible nulls\n if (Array.isArray(data) || output === 'array') {\n output = new Ctor(data.length + offset)\n for (i = 0, k = offset, l = output.length; k < l; k++, i++) {\n output[k] = data[i] === null ? NaN : data[i]\n }\n } else {\n if (offset === 0) {\n output = new Ctor(data)\n } else {\n output = new Ctor(data.length + offset)\n\n output.set(data, offset)\n }\n }\n } else {\n // store output in existing array\n output.set(data, offset)\n }\n }\n\n return output\n}\n","'use strict';\n\nvar isCallable = require('is-callable');\n\nvar toStr = Object.prototype.toString;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar forEachArray = function forEachArray(array, iterator, receiver) {\n for (var i = 0, len = array.length; i < len; i++) {\n if (hasOwnProperty.call(array, i)) {\n if (receiver == null) {\n iterator(array[i], i, array);\n } else {\n iterator.call(receiver, array[i], i, array);\n }\n }\n }\n};\n\nvar forEachString = function forEachString(string, iterator, receiver) {\n for (var i = 0, len = string.length; i < len; i++) {\n // no such thing as a sparse string.\n if (receiver == null) {\n iterator(string.charAt(i), i, string);\n } else {\n iterator.call(receiver, string.charAt(i), i, string);\n }\n }\n};\n\nvar forEachObject = function forEachObject(object, iterator, receiver) {\n for (var k in object) {\n if (hasOwnProperty.call(object, k)) {\n if (receiver == null) {\n iterator(object[k], k, object);\n } else {\n iterator.call(receiver, object[k], k, object);\n }\n }\n }\n};\n\nvar forEach = function forEach(list, iterator, thisArg) {\n if (!isCallable(iterator)) {\n throw new TypeError('iterator must be a function');\n }\n\n var receiver;\n if (arguments.length >= 3) {\n receiver = thisArg;\n }\n\n if (toStr.call(list) === '[object Array]') {\n forEachArray(list, iterator, receiver);\n } else if (typeof list === 'string') {\n forEachString(list, iterator, receiver);\n } else {\n forEachObject(list, iterator, receiver);\n }\n};\n\nmodule.exports = forEach;\n","'use strict';\n\n/* eslint no-invalid-this: 1 */\n\nvar ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';\nvar slice = Array.prototype.slice;\nvar toStr = Object.prototype.toString;\nvar funcType = '[object Function]';\n\nmodule.exports = function bind(that) {\n var target = this;\n if (typeof target !== 'function' || toStr.call(target) !== funcType) {\n throw new TypeError(ERROR_MESSAGE + target);\n }\n var args = slice.call(arguments, 1);\n\n var bound;\n var binder = function () {\n if (this instanceof bound) {\n var result = target.apply(\n this,\n args.concat(slice.call(arguments))\n );\n if (Object(result) === result) {\n return result;\n }\n return this;\n } else {\n return target.apply(\n that,\n args.concat(slice.call(arguments))\n );\n }\n };\n\n var boundLength = Math.max(0, target.length - args.length);\n var boundArgs = [];\n for (var i = 0; i < boundLength; i++) {\n boundArgs.push('$' + i);\n }\n\n bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);\n\n if (target.prototype) {\n var Empty = function Empty() {};\n Empty.prototype = target.prototype;\n bound.prototype = new Empty();\n Empty.prototype = null;\n }\n\n return bound;\n};\n","'use strict';\n\nvar implementation = require('./implementation');\n\nmodule.exports = Function.prototype.bind || implementation;\n","var win;\n\nif (typeof window !== \"undefined\") {\n win = window;\n} else if (typeof global !== \"undefined\") {\n win = global;\n} else if (typeof self !== \"undefined\"){\n win = self;\n} else {\n win = {};\n}\n\nmodule.exports = win;\n","'use strict';\n\nvar bind = require('function-bind');\n\nmodule.exports = bind.call(Function.call, Object.prototype.hasOwnProperty);\n","exports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = ((value * c) - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n","if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n })\n }\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n }\n}\n","/*!\n * Determine if an object is a Buffer\n *\n * @author Feross Aboukhadijeh <https://feross.org>\n * @license MIT\n */\n\n// The _isBuffer check is for Safari 5-7 support, because it's missing\n// Object.prototype.constructor. Remove this eventually\nmodule.exports = function (obj) {\n return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)\n}\n\nfunction isBuffer (obj) {\n return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)\n}\n\n// For Node v0.10 support. Remove this eventually.\nfunction isSlowBuffer (obj) {\n return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))\n}\n","'use strict';\n\nvar fnToStr = Function.prototype.toString;\n\nvar constructorRegex = /^\\s*class\\b/;\nvar isES6ClassFn = function isES6ClassFunction(value) {\n\ttry {\n\t\tvar fnStr = fnToStr.call(value);\n\t\treturn constructorRegex.test(fnStr);\n\t} catch (e) {\n\t\treturn false; // not a function\n\t}\n};\n\nvar tryFunctionObject = function tryFunctionToStr(value) {\n\ttry {\n\t\tif (isES6ClassFn(value)) { return false; }\n\t\tfnToStr.call(value);\n\t\treturn true;\n\t} catch (e) {\n\t\treturn false;\n\t}\n};\nvar toStr = Object.prototype.toString;\nvar fnClass = '[object Function]';\nvar genClass = '[object GeneratorFunction]';\nvar hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';\n\nmodule.exports = function isCallable(value) {\n\tif (!value) { return false; }\n\tif (typeof value !== 'function' && typeof value !== 'object') { return false; }\n\tif (typeof value === 'function' && !value.prototype) { return true; }\n\tif (hasToStringTag) { return tryFunctionObject(value); }\n\tif (isES6ClassFn(value)) { return false; }\n\tvar strClass = toStr.call(value);\n\treturn strClass === fnClass || strClass === genClass;\n};\n","module.exports = isFunction\n\nvar toString = Object.prototype.toString\n\nfunction isFunction (fn) {\n var string = toString.call(fn)\n return string === '[object Function]' ||\n (typeof fn === 'function' && string !== '[object RegExp]') ||\n (typeof window !== 'undefined' &&\n // IE8 and below\n (fn === window.setTimeout ||\n fn === window.alert ||\n fn === window.confirm ||\n fn === window.prompt))\n};\n","'use strict';\nmodule.exports = function (x) {\n\tvar type = typeof x;\n\treturn x !== null && (type === 'object' || type === 'function');\n};\n","var toString = {}.toString;\n\nmodule.exports = Array.isArray || function (arr) {\n return toString.call(arr) == '[object Array]';\n};\n","var wordWrap = require('word-wrapper')\nvar xtend = require('xtend')\nvar number = require('as-number')\n\nvar X_HEIGHTS = ['x', 'e', 'a', 'o', 'n', 's', 'r', 'c', 'u', 'm', 'v', 'w', 'z']\nvar M_WIDTHS = ['m', 'w']\nvar CAP_HEIGHTS = ['H', 'I', 'N', 'E', 'F', 'K', 'L', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']\n\n\nvar TAB_ID = '\\t'.charCodeAt(0)\nvar SPACE_ID = ' '.charCodeAt(0)\nvar ALIGN_LEFT = 0, \n ALIGN_CENTER = 1, \n ALIGN_RIGHT = 2\n\nmodule.exports = function createLayout(opt) {\n return new TextLayout(opt)\n}\n\nfunction TextLayout(opt) {\n this.glyphs = []\n this._measure = this.computeMetrics.bind(this)\n this.update(opt)\n}\n\nTextLayout.prototype.update = function(opt) {\n opt = xtend({\n measure: this._measure\n }, opt)\n this._opt = opt\n this._opt.tabSize = number(this._opt.tabSize, 4)\n\n if (!opt.font)\n throw new Error('must provide a valid bitmap font')\n\n var glyphs = this.glyphs\n var text = opt.text||'' \n var font = opt.font\n this._setupSpaceGlyphs(font)\n \n var lines = wordWrap.lines(text, opt)\n var minWidth = opt.width || 0\n\n //clear glyphs\n glyphs.length = 0\n\n //get max line width\n var maxLineWidth = lines.reduce(function(prev, line) {\n return Math.max(prev, line.width, minWidth)\n }, 0)\n\n //the pen position\n var x = 0\n var y = 0\n var lineHeight = number(opt.lineHeight, font.common.lineHeight)\n var baseline = font.common.base\n var descender = lineHeight-baseline\n var letterSpacing = opt.letterSpacing || 0\n var height = lineHeight * lines.length - descender\n var align = getAlignType(this._opt.align)\n\n //draw text along baseline\n y -= height\n \n //the metrics for this text layout\n this._width = maxLineWidth\n this._height = height\n this._descender = lineHeight - baseline\n this._baseline = baseline\n this._xHeight = getXHeight(font)\n this._capHeight = getCapHeight(font)\n this._lineHeight = lineHeight\n this._ascender = lineHeight - descender - this._xHeight\n \n //layout each glyph\n var self = this\n lines.forEach(function(line, lineIndex) {\n var start = line.start\n var end = line.end\n var lineWidth = line.width\n var lastGlyph\n \n //for each glyph in that line...\n for (var i=start; i<end; i++) {\n var id = text.charCodeAt(i)\n var glyph = self.getGlyph(font, id)\n if (glyph) {\n if (lastGlyph) \n x += getKerning(font, lastGlyph.id, glyph.id)\n\n var tx = x\n if (align === ALIGN_CENTER) \n tx += (maxLineWidth-lineWidth)/2\n else if (align === ALIGN_RIGHT)\n tx += (maxLineWidth-lineWidth)\n\n glyphs.push({\n position: [tx, y],\n data: glyph,\n index: i,\n line: lineIndex\n }) \n\n //move pen forward\n x += glyph.xadvance + letterSpacing\n lastGlyph = glyph\n }\n }\n\n //next line down\n y += lineHeight\n x = 0\n })\n this._linesTotal = lines.length;\n}\n\nTextLayout.prototype._setupSpaceGlyphs = function(font) {\n //These are fallbacks, when the font doesn't include\n //' ' or '\\t' glyphs\n this._fallbackSpaceGlyph = null\n this._fallbackTabGlyph = null\n\n if (!font.chars || font.chars.length === 0)\n return\n\n //try to get space glyph\n //then fall back to the 'm' or 'w' glyphs\n //then fall back to the first glyph available\n var space = getGlyphById(font, SPACE_ID) \n || getMGlyph(font) \n || font.chars[0]\n\n //and create a fallback for tab\n var tabWidth = this._opt.tabSize * space.xadvance\n this._fallbackSpaceGlyph = space\n this._fallbackTabGlyph = xtend(space, {\n x: 0, y: 0, xadvance: tabWidth, id: TAB_ID, \n xoffset: 0, yoffset: 0, width: 0, height: 0\n })\n}\n\nTextLayout.prototype.getGlyph = function(font, id) {\n var glyph = getGlyphById(font, id)\n if (glyph)\n return glyph\n else if (id === TAB_ID) \n return this._fallbackTabGlyph\n else if (id === SPACE_ID) \n return this._fallbackSpaceGlyph\n return null\n}\n\nTextLayout.prototype.computeMetrics = function(text, start, end, width) {\n var letterSpacing = this._opt.letterSpacing || 0\n var font = this._opt.font\n var curPen = 0\n var curWidth = 0\n var count = 0\n var glyph\n var lastGlyph\n\n if (!font.chars || font.chars.length === 0) {\n return {\n start: start,\n end: start,\n width: 0\n }\n }\n\n end = Math.min(text.length, end)\n for (var i=start; i < end; i++) {\n var id = text.charCodeAt(i)\n var glyph = this.getGlyph(font, id)\n\n if (glyph) {\n //move pen forward\n var xoff = glyph.xoffset\n var kern = lastGlyph ? getKerning(font, lastGlyph.id, glyph.id) : 0\n curPen += kern\n\n var nextPen = curPen + glyph.xadvance + letterSpacing\n var nextWidth = curPen + glyph.width\n\n //we've hit our limit; we can't move onto the next glyph\n if (nextWidth >= width || nextPen >= width)\n break\n\n //otherwise continue along our line\n curPen = nextPen\n curWidth = nextWidth\n lastGlyph = glyph\n }\n count++\n }\n \n //make sure rightmost edge lines up with rendered glyphs\n if (lastGlyph)\n curWidth += lastGlyph.xoffset\n\n return {\n start: start,\n end: start + count,\n width: curWidth\n }\n}\n\n//getters for the private vars\n;['width', 'height', \n 'descender', 'ascender',\n 'xHeight', 'baseline',\n 'capHeight',\n 'lineHeight' ].forEach(addGetter)\n\nfunction addGetter(name) {\n Object.defineProperty(TextLayout.prototype, name, {\n get: wrapper(name),\n configurable: true\n })\n}\n\n//create lookups for private vars\nfunction wrapper(name) {\n return (new Function([\n 'return function '+name+'() {',\n ' return this._'+name,\n '}'\n ].join('\\n')))()\n}\n\nfunction getGlyphById(font, id) {\n if (!font.chars || font.chars.length === 0)\n return null\n\n var glyphIdx = findChar(font.chars, id)\n if (glyphIdx >= 0)\n return font.chars[glyphIdx]\n return null\n}\n\nfunction getXHeight(font) {\n for (var i=0; i<X_HEIGHTS.length; i++) {\n var id = X_HEIGHTS[i].charCodeAt(0)\n var idx = findChar(font.chars, id)\n if (idx >= 0) \n return font.chars[idx].height\n }\n return 0\n}\n\nfunction getMGlyph(font) {\n for (var i=0; i<M_WIDTHS.length; i++) {\n var id = M_WIDTHS[i].charCodeAt(0)\n var idx = findChar(font.chars, id)\n if (idx >= 0) \n return font.chars[idx]\n }\n return 0\n}\n\nfunction getCapHeight(font) {\n for (var i=0; i<CAP_HEIGHTS.length; i++) {\n var id = CAP_HEIGHTS[i].charCodeAt(0)\n var idx = findChar(font.chars, id)\n if (idx >= 0) \n return font.chars[idx].height\n }\n return 0\n}\n\nfunction getKerning(font, left, right) {\n if (!font.kernings || font.kernings.length === 0)\n return 0\n\n var table = font.kernings\n for (var i=0; i<table.length; i++) {\n var kern = table[i]\n if (kern.first === left && kern.second === right)\n return kern.amount\n }\n return 0\n}\n\nfunction getAlignType(align) {\n if (align === 'center')\n return ALIGN_CENTER\n else if (align === 'right')\n return ALIGN_RIGHT\n return ALIGN_LEFT\n}\n\nfunction findChar (array, value, start) {\n start = start || 0\n for (var i = start; i < array.length; i++) {\n if (array[i].id === value) {\n return i\n }\n }\n return -1\n}","var xhr = require('xhr')\nvar noop = function(){}\nvar parseASCII = require('parse-bmfont-ascii')\nvar parseXML = require('parse-bmfont-xml')\nvar readBinary = require('parse-bmfont-binary')\nvar isBinaryFormat = require('./lib/is-binary')\nvar xtend = require('xtend')\n\nvar xml2 = (function hasXML2() {\n return self.XMLHttpRequest && \"withCredentials\" in new XMLHttpRequest\n})()\n\nmodule.exports = function(opt, cb) {\n cb = typeof cb === 'function' ? cb : noop\n\n if (typeof opt === 'string')\n opt = { uri: opt }\n else if (!opt)\n opt = {}\n\n var expectBinary = opt.binary\n if (expectBinary)\n opt = getBinaryOpts(opt)\n\n xhr(opt, function(err, res, body) {\n if (err)\n return cb(err)\n if (!/^2/.test(res.statusCode))\n return cb(new Error('http status code: '+res.statusCode))\n if (!body)\n return cb(new Error('no body result'))\n\n var binary = false \n\n //if the response type is an array buffer,\n //we need to convert it into a regular Buffer object\n if (isArrayBuffer(body)) {\n var array = new Uint8Array(body)\n body = new Buffer(array, 'binary')\n }\n\n //now check the string/Buffer response\n //and see if it has a binary BMF header\n if (isBinaryFormat(body)) {\n binary = true\n //if we have a string, turn it into a Buffer\n if (typeof body === 'string') \n body = new Buffer(body, 'binary')\n } \n\n //we are not parsing a binary format, just ASCII/XML/etc\n if (!binary) {\n //might still be a buffer if responseType is 'arraybuffer'\n if (Buffer.isBuffer(body))\n body = body.toString(opt.encoding)\n body = body.trim()\n }\n\n var result\n try {\n var type = res.headers['content-type']\n if (binary)\n result = readBinary(body)\n else if (/json/.test(type) || body.charAt(0) === '{')\n result = JSON.parse(body)\n else if (/xml/.test(type) || body.charAt(0) === '<')\n result = parseXML(body)\n else\n result = parseASCII(body)\n } catch (e) {\n cb(new Error('error parsing font '+e.message))\n cb = noop\n }\n cb(null, result)\n })\n}\n\nfunction isArrayBuffer(arr) {\n var str = Object.prototype.toString\n return str.call(arr) === '[object ArrayBuffer]'\n}\n\nfunction getBinaryOpts(opt) {\n //IE10+ and other modern browsers support array buffers\n if (xml2)\n return xtend(opt, { responseType: 'arraybuffer' })\n \n if (typeof self.XMLHttpRequest === 'undefined')\n throw new Error('your browser does not support XHR loading')\n\n //IE9 and XML1 browsers could still use an override\n var req = new self.XMLHttpRequest()\n req.overrideMimeType('text/plain; charset=x-user-defined')\n return xtend({\n xhr: req\n }, opt)\n}\n","var equal = require('buffer-equal')\nvar HEADER = new Buffer([66, 77, 70, 3])\n\nmodule.exports = function(buf) {\n if (typeof buf === 'string')\n return buf.substring(0, 3) === 'BMF'\n return buf.length > 4 && equal(buf.slice(0, 4), HEADER)\n}","/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/\n\n'use strict';\n/* eslint-disable no-unused-vars */\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n\tif (val === null || val === undefined) {\n\t\tthrow new TypeError('Object.assign cannot be called with null or undefined');\n\t}\n\n\treturn Object(val);\n}\n\nfunction shouldUseNative() {\n\ttry {\n\t\tif (!Object.assign) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Detect buggy property enumeration order in older V8 versions.\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=4118\n\t\tvar test1 = new String('abc'); // eslint-disable-line no-new-wrappers\n\t\ttest1[5] = 'de';\n\t\tif (Object.getOwnPropertyNames(test1)[0] === '5') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test2 = {};\n\t\tfor (var i = 0; i < 10; i++) {\n\t\t\ttest2['_' + String.fromCharCode(i)] = i;\n\t\t}\n\t\tvar order2 = Object.getOwnPropertyNames(test2).map(function (n) {\n\t\t\treturn test2[n];\n\t\t});\n\t\tif (order2.join('') !== '0123456789') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test3 = {};\n\t\t'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\n\t\t\ttest3[letter] = letter;\n\t\t});\n\t\tif (Object.keys(Object.assign({}, test3)).join('') !==\n\t\t\t\t'abcdefghijklmnopqrst') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t} catch (err) {\n\t\t// We don't expect any of the above to throw, but better to be safe.\n\t\treturn false;\n\t}\n}\n\nmodule.exports = shouldUseNative() ? Object.assign : function (target, source) {\n\tvar from;\n\tvar to = toObject(target);\n\tvar symbols;\n\n\tfor (var s = 1; s < arguments.length; s++) {\n\t\tfrom = Object(arguments[s]);\n\n\t\tfor (var key in from) {\n\t\t\tif (hasOwnProperty.call(from, key)) {\n\t\t\t\tto[key] = from[key];\n\t\t\t}\n\t\t}\n\n\t\tif (getOwnPropertySymbols) {\n\t\t\tsymbols = getOwnPropertySymbols(from);\n\t\t\tfor (var i = 0; i < symbols.length; i++) {\n\t\t\t\tif (propIsEnumerable.call(from, symbols[i])) {\n\t\t\t\t\tto[symbols[i]] = from[symbols[i]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to;\n};\n","'use strict';\n\nvar keysShim;\nif (!Object.keys) {\n\t// modified from https://github.com/es-shims/es5-shim\n\tvar has = Object.prototype.hasOwnProperty;\n\tvar toStr = Object.prototype.toString;\n\tvar isArgs = require('./isArguments'); // eslint-disable-line global-require\n\tvar isEnumerable = Object.prototype.propertyIsEnumerable;\n\tvar hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString');\n\tvar hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype');\n\tvar dontEnums = [\n\t\t'toString',\n\t\t'toLocaleString',\n\t\t'valueOf',\n\t\t'hasOwnProperty',\n\t\t'isPrototypeOf',\n\t\t'propertyIsEnumerable',\n\t\t'constructor'\n\t];\n\tvar equalsConstructorPrototype = function (o) {\n\t\tvar ctor = o.constructor;\n\t\treturn ctor && ctor.prototype === o;\n\t};\n\tvar excludedKeys = {\n\t\t$applicationCache: true,\n\t\t$console: true,\n\t\t$external: true,\n\t\t$frame: true,\n\t\t$frameElement: true,\n\t\t$frames: true,\n\t\t$innerHeight: true,\n\t\t$innerWidth: true,\n\t\t$onmozfullscreenchange: true,\n\t\t$onmozfullscreenerror: true,\n\t\t$outerHeight: true,\n\t\t$outerWidth: true,\n\t\t$pageXOffset: true,\n\t\t$pageYOffset: true,\n\t\t$parent: true,\n\t\t$scrollLeft: true,\n\t\t$scrollTop: true,\n\t\t$scrollX: true,\n\t\t$scrollY: true,\n\t\t$self: true,\n\t\t$webkitIndexedDB: true,\n\t\t$webkitStorageInfo: true,\n\t\t$window: true\n\t};\n\tvar hasAutomationEqualityBug = (function () {\n\t\t/* global window */\n\t\tif (typeof window === 'undefined') { return false; }\n\t\tfor (var k in window) {\n\t\t\ttry {\n\t\t\t\tif (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tequalsConstructorPrototype(window[k]);\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}());\n\tvar equalsConstructorPrototypeIfNotBuggy = function (o) {\n\t\t/* global window */\n\t\tif (typeof window === 'undefined' || !hasAutomationEqualityBug) {\n\t\t\treturn equalsConstructorPrototype(o);\n\t\t}\n\t\ttry {\n\t\t\treturn equalsConstructorPrototype(o);\n\t\t} catch (e) {\n\t\t\treturn false;\n\t\t}\n\t};\n\n\tkeysShim = function keys(object) {\n\t\tvar isObject = object !== null && typeof object === 'object';\n\t\tvar isFunction = toStr.call(object) === '[object Function]';\n\t\tvar isArguments = isArgs(object);\n\t\tvar isString = isObject && toStr.call(object) === '[object String]';\n\t\tvar theKeys = [];\n\n\t\tif (!isObject && !isFunction && !isArguments) {\n\t\t\tthrow new TypeError('Object.keys called on a non-object');\n\t\t}\n\n\t\tvar skipProto = hasProtoEnumBug && isFunction;\n\t\tif (isString && object.length > 0 && !has.call(object, 0)) {\n\t\t\tfor (var i = 0; i < object.length; ++i) {\n\t\t\t\ttheKeys.push(String(i));\n\t\t\t}\n\t\t}\n\n\t\tif (isArguments && object.length > 0) {\n\t\t\tfor (var j = 0; j < object.length; ++j) {\n\t\t\t\ttheKeys.push(String(j));\n\t\t\t}\n\t\t} else {\n\t\t\tfor (var name in object) {\n\t\t\t\tif (!(skipProto && name === 'prototype') && has.call(object, name)) {\n\t\t\t\t\ttheKeys.push(String(name));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (hasDontEnumBug) {\n\t\t\tvar skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);\n\n\t\t\tfor (var k = 0; k < dontEnums.length; ++k) {\n\t\t\t\tif (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) {\n\t\t\t\t\ttheKeys.push(dontEnums[k]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn theKeys;\n\t};\n}\nmodule.exports = keysShim;\n","'use strict';\n\nvar slice = Array.prototype.slice;\nvar isArgs = require('./isArguments');\n\nvar origKeys = Object.keys;\nvar keysShim = origKeys ? function keys(o) { return origKeys(o); } : require('./implementation');\n\nvar originalKeys = Object.keys;\n\nkeysShim.shim = function shimObjectKeys() {\n\tif (Object.keys) {\n\t\tvar keysWorksWithArguments = (function () {\n\t\t\t// Safari 5.0 bug\n\t\t\tvar args = Object.keys(arguments);\n\t\t\treturn args && args.length === arguments.length;\n\t\t}(1, 2));\n\t\tif (!keysWorksWithArguments) {\n\t\t\tObject.keys = function keys(object) { // eslint-disable-line func-name-matching\n\t\t\t\tif (isArgs(object)) {\n\t\t\t\t\treturn originalKeys(slice.call(object));\n\t\t\t\t}\n\t\t\t\treturn originalKeys(object);\n\t\t\t};\n\t\t}\n\t} else {\n\t\tObject.keys = keysShim;\n\t}\n\treturn Object.keys || keysShim;\n};\n\nmodule.exports = keysShim;\n","'use strict';\n\nvar toStr = Object.prototype.toString;\n\nmodule.exports = function isArguments(value) {\n\tvar str = toStr.call(value);\n\tvar isArgs = str === '[object Arguments]';\n\tif (!isArgs) {\n\t\tisArgs = str !== '[object Array]' &&\n\t\t\tvalue !== null &&\n\t\t\ttypeof value === 'object' &&\n\t\t\ttypeof value.length === 'number' &&\n\t\t\tvalue.length >= 0 &&\n\t\t\ttoStr.call(value.callee) === '[object Function]';\n\t}\n\treturn isArgs;\n};\n","module.exports = function parseBMFontAscii(data) {\n if (!data)\n throw new Error('no data provided')\n data = data.toString().trim()\n\n var output = {\n pages: [],\n chars: [],\n kernings: []\n }\n\n var lines = data.split(/\\r\\n?|\\n/g)\n\n if (lines.length === 0)\n throw new Error('no data in BMFont file')\n\n for (var i = 0; i < lines.length; i++) {\n var lineData = splitLine(lines[i], i)\n if (!lineData) //skip empty lines\n continue\n\n if (lineData.key === 'page') {\n if (typeof lineData.data.id !== 'number')\n throw new Error('malformed file at line ' + i + ' -- needs page id=N')\n if (typeof lineData.data.file !== 'string')\n throw new Error('malformed file at line ' + i + ' -- needs page file=\"path\"')\n output.pages[lineData.data.id] = lineData.data.file\n } else if (lineData.key === 'chars' || lineData.key === 'kernings') {\n //... do nothing for these two ...\n } else if (lineData.key === 'char') {\n output.chars.push(lineData.data)\n } else if (lineData.key === 'kerning') {\n output.kernings.push(lineData.data)\n } else {\n output[lineData.key] = lineData.data\n }\n }\n\n return output\n}\n\nfunction splitLine(line, idx) {\n line = line.replace(/\\t+/g, ' ').trim()\n if (!line)\n return null\n\n var space = line.indexOf(' ')\n if (space === -1) \n throw new Error(\"no named row at line \" + idx)\n\n var key = line.substring(0, space)\n\n line = line.substring(space + 1)\n //clear \"letter\" field as it is non-standard and\n //requires additional complexity to parse \" / = symbols\n line = line.replace(/letter=[\\'\\\"]\\S+[\\'\\\"]/gi, '') \n line = line.split(\"=\")\n line = line.map(function(str) {\n return str.trim().match((/(\".*?\"|[^\"\\s]+)+(?=\\s*|\\s*$)/g))\n })\n\n var data = []\n for (var i = 0; i < line.length; i++) {\n var dt = line[i]\n if (i === 0) {\n data.push({\n key: dt[0],\n data: \"\"\n })\n } else if (i === line.length - 1) {\n data[data.length - 1].data = parseData(dt[0])\n } else {\n data[data.length - 1].data = parseData(dt[0])\n data.push({\n key: dt[1],\n data: \"\"\n })\n }\n }\n\n var out = {\n key: key,\n data: {}\n }\n\n data.forEach(function(v) {\n out.data[v.key] = v.data;\n })\n\n return out\n}\n\nfunction parseData(data) {\n if (!data || data.length === 0)\n return \"\"\n\n if (data.indexOf('\"') === 0 || data.indexOf(\"'\") === 0)\n return data.substring(1, data.length - 1)\n if (data.indexOf(',') !== -1)\n return parseIntList(data)\n return parseInt(data, 10)\n}\n\nfunction parseIntList(data) {\n return data.split(',').map(function(val) {\n return parseInt(val, 10)\n })\n}","var HEADER = [66, 77, 70]\n\nmodule.exports = function readBMFontBinary(buf) {\n if (buf.length < 6)\n throw new Error('invalid buffer length for BMFont')\n\n var header = HEADER.every(function(byte, i) {\n return buf.readUInt8(i) === byte\n })\n\n if (!header)\n throw new Error('BMFont missing BMF byte header')\n\n var i = 3\n var vers = buf.readUInt8(i++)\n if (vers > 3)\n throw new Error('Only supports BMFont Binary v3 (BMFont App v1.10)')\n \n var target = { kernings: [], chars: [] }\n for (var b=0; b<5; b++)\n i += readBlock(target, buf, i)\n return target\n}\n\nfunction readBlock(target, buf, i) {\n if (i > buf.length-1)\n return 0\n\n var blockID = buf.readUInt8(i++)\n var blockSize = buf.readInt32LE(i)\n i += 4\n\n switch(blockID) {\n case 1: \n target.info = readInfo(buf, i)\n break\n case 2:\n target.common = readCommon(buf, i)\n break\n case 3:\n target.pages = readPages(buf, i, blockSize)\n break\n case 4:\n target.chars = readChars(buf, i, blockSize)\n break\n case 5:\n target.kernings = readKernings(buf, i, blockSize)\n break\n }\n return 5 + blockSize\n}\n\nfunction readInfo(buf, i) {\n var info = {}\n info.size = buf.readInt16LE(i)\n\n var bitField = buf.readUInt8(i+2)\n info.smooth = (bitField >> 7) & 1\n info.unicode = (bitField >> 6) & 1\n info.italic = (bitField >> 5) & 1\n info.bold = (bitField >> 4) & 1\n \n //fixedHeight is only mentioned in binary spec \n if ((bitField >> 3) & 1)\n info.fixedHeight = 1\n \n info.charset = buf.readUInt8(i+3) || ''\n info.stretchH = buf.readUInt16LE(i+4)\n info.aa = buf.readUInt8(i+6)\n info.padding = [\n buf.readInt8(i+7),\n buf.readInt8(i+8),\n buf.readInt8(i+9),\n buf.readInt8(i+10)\n ]\n info.spacing = [\n buf.readInt8(i+11),\n buf.readInt8(i+12)\n ]\n info.outline = buf.readUInt8(i+13)\n info.face = readStringNT(buf, i+14)\n return info\n}\n\nfunction readCommon(buf, i) {\n var common = {}\n common.lineHeight = buf.readUInt16LE(i)\n common.base = buf.readUInt16LE(i+2)\n common.scaleW = buf.readUInt16LE(i+4)\n common.scaleH = buf.readUInt16LE(i+6)\n common.pages = buf.readUInt16LE(i+8)\n var bitField = buf.readUInt8(i+10)\n common.packed = 0\n common.alphaChnl = buf.readUInt8(i+11)\n common.redChnl = buf.readUInt8(i+12)\n common.greenChnl = buf.readUInt8(i+13)\n common.blueChnl = buf.readUInt8(i+14)\n return common\n}\n\nfunction readPages(buf, i, size) {\n var pages = []\n var text = readNameNT(buf, i)\n var len = text.length+1\n var count = size / len\n for (var c=0; c<count; c++) {\n pages[c] = buf.slice(i, i+text.length).toString('utf8')\n i += len\n }\n return pages\n}\n\nfunction readChars(buf, i, blockSize) {\n var chars = []\n\n var count = blockSize / 20\n for (var c=0; c<count; c++) {\n var char = {}\n var off = c*20\n char.id = buf.readUInt32LE(i + 0 + off)\n char.x = buf.readUInt16LE(i + 4 + off)\n char.y = buf.readUInt16LE(i + 6 + off)\n char.width = buf.readUInt16LE(i + 8 + off)\n char.height = buf.readUInt16LE(i + 10 + off)\n char.xoffset = buf.readInt16LE(i + 12 + off)\n char.yoffset = buf.readInt16LE(i + 14 + off)\n char.xadvance = buf.readInt16LE(i + 16 + off)\n char.page = buf.readUInt8(i + 18 + off)\n char.chnl = buf.readUInt8(i + 19 + off)\n chars[c] = char\n }\n return chars\n}\n\nfunction readKernings(buf, i, blockSize) {\n var kernings = []\n var count = blockSize / 10\n for (var c=0; c<count; c++) {\n var kern = {}\n var off = c*10\n kern.first = buf.readUInt32LE(i + 0 + off)\n kern.second = buf.readUInt32LE(i + 4 + off)\n kern.amount = buf.readInt16LE(i + 8 + off)\n kernings[c] = kern\n }\n return kernings\n}\n\nfunction readNameNT(buf, offset) {\n var pos=offset\n for (; pos<buf.length; pos++) {\n if (buf[pos] === 0x00) \n break\n }\n return buf.slice(offset, pos)\n}\n\nfunction readStringNT(buf, offset) {\n return readNameNT(buf, offset).toString('utf8')\n}","var parseAttributes = require('./parse-attribs')\nvar parseFromString = require('xml-parse-from-string')\n\n//In some cases element.attribute.nodeName can return\n//all lowercase values.. so we need to map them to the correct \n//case\nvar NAME_MAP = {\n scaleh: 'scaleH',\n scalew: 'scaleW',\n stretchh: 'stretchH',\n lineheight: 'lineHeight',\n alphachnl: 'alphaChnl',\n redchnl: 'redChnl',\n greenchnl: 'greenChnl',\n bluechnl: 'blueChnl'\n}\n\nmodule.exports = function parse(data) {\n data = data.toString()\n \n var xmlRoot = parseFromString(data)\n var output = {\n pages: [],\n chars: [],\n kernings: []\n }\n\n //get config settings\n ;['info', 'common'].forEach(function(key) {\n var element = xmlRoot.getElementsByTagName(key)[0]\n if (element)\n output[key] = parseAttributes(getAttribs(element))\n })\n\n //get page info\n var pageRoot = xmlRoot.getElementsByTagName('pages')[0]\n if (!pageRoot)\n throw new Error('malformed file -- no <pages> element')\n var pages = pageRoot.getElementsByTagName('page')\n for (var i=0; i<pages.length; i++) {\n var p = pages[i]\n var id = parseInt(p.getAttribute('id'), 10)\n var file = p.getAttribute('file')\n if (isNaN(id))\n throw new Error('malformed file -- page \"id\" attribute is NaN')\n if (!file)\n throw new Error('malformed file -- needs page \"file\" attribute')\n output.pages[parseInt(id, 10)] = file\n }\n\n //get kernings / chars\n ;['chars', 'kernings'].forEach(function(key) {\n var element = xmlRoot.getElementsByTagName(key)[0]\n if (!element)\n return\n var childTag = key.substring(0, key.length-1)\n var children = element.getElementsByTagName(childTag)\n for (var i=0; i<children.length; i++) { \n var child = children[i]\n output[key].push(parseAttributes(getAttribs(child)))\n }\n })\n return output\n}\n\nfunction getAttribs(element) {\n var attribs = getAttribList(element)\n return attribs.reduce(function(dict, attrib) {\n var key = mapName(attrib.nodeName)\n dict[key] = attrib.nodeValue\n return dict\n }, {})\n}\n\nfunction getAttribList(element) {\n //IE8+ and modern browsers\n var attribs = []\n for (var i=0; i<element.attributes.length; i++)\n attribs.push(element.attributes[i])\n return attribs\n}\n\nfunction mapName(nodeName) {\n return NAME_MAP[nodeName.toLowerCase()] || nodeName\n}","//Some versions of GlyphDesigner have a typo\n//that causes some bugs with parsing. \n//Need to confirm with recent version of the software\n//to see whether this is still an issue or not.\nvar GLYPH_DESIGNER_ERROR = 'chasrset'\n\nmodule.exports = function parseAttributes(obj) {\n if (GLYPH_DESIGNER_ERROR in obj) {\n obj['charset'] = obj[GLYPH_DESIGNER_ERROR]\n delete obj[GLYPH_DESIGNER_ERROR]\n }\n\n for (var k in obj) {\n if (k === 'face' || k === 'charset') \n continue\n else if (k === 'padding' || k === 'spacing')\n obj[k] = parseIntList(obj[k])\n else\n obj[k] = parseInt(obj[k], 10) \n }\n return obj\n}\n\nfunction parseIntList(data) {\n return data.split(',').map(function(val) {\n return parseInt(val, 10)\n })\n}","var trim = require('string.prototype.trim')\n , forEach = require('for-each')\n , isArray = function(arg) {\n return Object.prototype.toString.call(arg) === '[object Array]';\n }\n\nmodule.exports = function (headers) {\n if (!headers)\n return {}\n\n var result = {}\n\n forEach(\n trim(headers).split('\\n')\n , function (row) {\n var index = row.indexOf(':')\n , key = trim(row.slice(0, index)).toLowerCase()\n , value = trim(row.slice(index + 1))\n\n if (typeof(result[key]) === 'undefined') {\n result[key] = value\n } else if (isArray(result[key])) {\n result[key].push(value)\n } else {\n result[key] = [ result[key], value ]\n }\n }\n )\n\n return result\n}\n","var performance = global.performance || {};\n\nvar present = (function () {\n var names = ['now', 'webkitNow', 'msNow', 'mozNow', 'oNow'];\n while (names.length) {\n var name = names.shift();\n if (name in performance) {\n return performance[name].bind(performance);\n }\n }\n\n var dateNow = Date.now || function () { return new Date().getTime(); };\n var navigationStart = (performance.timing || {}).navigationStart || dateNow();\n return function () {\n return dateNow() - navigationStart;\n };\n}());\n\npresent.performanceNow = performance.now;\npresent.noConflict = function () {\n performance.now = present.performanceNow;\n};\npresent.conflict = function () {\n performance.now = present;\n};\npresent.conflict();\n\nmodule.exports = present;\n","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","(function(root) {\n\n\t// Store setTimeout reference so promise-polyfill will be unaffected by\n\t// other code modifying setTimeout (like sinon.useFakeTimers())\n\tvar setTimeoutFunc = setTimeout;\n\n\t// Use polyfill for setImmediate for performance gains\n\tvar asap = (typeof setImmediate === 'function' && setImmediate) ||\n\t\tfunction(fn) { setTimeoutFunc(fn, 1); };\n\n\t// Polyfill for Function.prototype.bind\n\tfunction bind(fn, thisArg) {\n\t\treturn function() {\n\t\t\tfn.apply(thisArg, arguments);\n\t\t}\n\t}\n\n\tvar isArray = Array.isArray || function(value) { return Object.prototype.toString.call(value) === \"[object Array]\" };\n\n\tfunction Promise(fn) {\n\t\tif (typeof this !== 'object') throw new TypeError('Promises must be constructed via new');\n\t\tif (typeof fn !== 'function') throw new TypeError('not a function');\n\t\tthis._state = null;\n\t\tthis._value = null;\n\t\tthis._deferreds = []\n\n\t\tdoResolve(fn, bind(resolve, this), bind(reject, this))\n\t}\n\n\tfunction handle(deferred) {\n\t\tvar me = this;\n\t\tif (this._state === null) {\n\t\t\tthis._deferreds.push(deferred);\n\t\t\treturn\n\t\t}\n\t\tasap(function() {\n\t\t\tvar cb = me._state ? deferred.onFulfilled : deferred.onRejected\n\t\t\tif (cb === null) {\n\t\t\t\t(me._state ? deferred.resolve : deferred.reject)(me._value);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar ret;\n\t\t\ttry {\n\t\t\t\tret = cb(me._value);\n\t\t\t}\n\t\t\tcatch (e) {\n\t\t\t\tdeferred.reject(e);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tdeferred.resolve(ret);\n\t\t})\n\t}\n\n\tfunction resolve(newValue) {\n\t\ttry { //Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure\n\t\t\tif (newValue === this) throw new TypeError('A promise cannot be resolved with itself.');\n\t\t\tif (newValue && (typeof newValue === 'object' || typeof newValue === 'function')) {\n\t\t\t\tvar then = newValue.then;\n\t\t\t\tif (typeof then === 'function') {\n\t\t\t\t\tdoResolve(bind(then, newValue), bind(resolve, this), bind(reject, this));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._state = true;\n\t\t\tthis._value = newValue;\n\t\t\tfinale.call(this);\n\t\t} catch (e) { reject.call(this, e); }\n\t}\n\n\tfunction reject(newValue) {\n\t\tthis._state = false;\n\t\tthis._value = newValue;\n\t\tfinale.call(this);\n\t}\n\n\tfunction finale() {\n\t\tfor (var i = 0, len = this._deferreds.length; i < len; i++) {\n\t\t\thandle.call(this, this._deferreds[i]);\n\t\t}\n\t\tthis._deferreds = null;\n\t}\n\n\tfunction Handler(onFulfilled, onRejected, resolve, reject){\n\t\tthis.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;\n\t\tthis.onRejected = typeof onRejected === 'function' ? onRejected : null;\n\t\tthis.resolve = resolve;\n\t\tthis.reject = reject;\n\t}\n\n\t/**\n\t * Take a potentially misbehaving resolver function and make sure\n\t * onFulfilled and onRejected are only called once.\n\t *\n\t * Makes no guarantees about asynchrony.\n\t */\n\tfunction doResolve(fn, onFulfilled, onRejected) {\n\t\tvar done = false;\n\t\ttry {\n\t\t\tfn(function (value) {\n\t\t\t\tif (done) return;\n\t\t\t\tdone = true;\n\t\t\t\tonFulfilled(value);\n\t\t\t}, function (reason) {\n\t\t\t\tif (done) return;\n\t\t\t\tdone = true;\n\t\t\t\tonRejected(reason);\n\t\t\t})\n\t\t} catch (ex) {\n\t\t\tif (done) return;\n\t\t\tdone = true;\n\t\t\tonRejected(ex);\n\t\t}\n\t}\n\n\tPromise.prototype['catch'] = function (onRejected) {\n\t\treturn this.then(null, onRejected);\n\t};\n\n\tPromise.prototype.then = function(onFulfilled, onRejected) {\n\t\tvar me = this;\n\t\treturn new Promise(function(resolve, reject) {\n\t\t\thandle.call(me, new Handler(onFulfilled, onRejected, resolve, reject));\n\t\t})\n\t};\n\n\tPromise.all = function () {\n\t\tvar args = Array.prototype.slice.call(arguments.length === 1 && isArray(arguments[0]) ? arguments[0] : arguments);\n\n\t\treturn new Promise(function (resolve, reject) {\n\t\t\tif (args.length === 0) return resolve([]);\n\t\t\tvar remaining = args.length;\n\t\t\tfunction res(i, val) {\n\t\t\t\ttry {\n\t\t\t\t\tif (val && (typeof val === 'object' || typeof val === 'function')) {\n\t\t\t\t\t\tvar then = val.then;\n\t\t\t\t\t\tif (typeof then === 'function') {\n\t\t\t\t\t\t\tthen.call(val, function (val) { res(i, val) }, reject);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\targs[i] = val;\n\t\t\t\t\tif (--remaining === 0) {\n\t\t\t\t\t\tresolve(args);\n\t\t\t\t\t}\n\t\t\t\t} catch (ex) {\n\t\t\t\t\treject(ex);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (var i = 0; i < args.length; i++) {\n\t\t\t\tres(i, args[i]);\n\t\t\t}\n\t\t});\n\t};\n\n\tPromise.resolve = function (value) {\n\t\tif (value && typeof value === 'object' && value.constructor === Promise) {\n\t\t\treturn value;\n\t\t}\n\n\t\treturn new Promise(function (resolve) {\n\t\t\tresolve(value);\n\t\t});\n\t};\n\n\tPromise.reject = function (value) {\n\t\treturn new Promise(function (resolve, reject) {\n\t\t\treject(value);\n\t\t});\n\t};\n\n\tPromise.race = function (values) {\n\t\treturn new Promise(function (resolve, reject) {\n\t\t\tfor(var i = 0, len = values.length; i < len; i++) {\n\t\t\t\tvalues[i].then(resolve, reject);\n\t\t\t}\n\t\t});\n\t};\n\n\t/**\n\t * Set the immediate function to execute callbacks\n\t * @param fn {function} Function to execute\n\t * @private\n\t */\n\tPromise._setImmediateFn = function _setImmediateFn(fn) {\n\t\tasap = fn;\n\t};\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tmodule.exports = Promise;\n\t} else if (!root.Promise) {\n\t\troot.Promise = Promise;\n\t}\n\n})(this);\n","var dtype = require('dtype')\nvar anArray = require('an-array')\nvar isBuffer = require('is-buffer')\n\nvar CW = [0, 2, 3]\nvar CCW = [2, 1, 3]\n\nmodule.exports = function createQuadElements(array, opt) {\n //if user didn't specify an output array\n if (!array || !(anArray(array) || isBuffer(array))) {\n opt = array || {}\n array = null\n }\n\n if (typeof opt === 'number') //backwards-compatible\n opt = { count: opt }\n else\n opt = opt || {}\n\n var type = typeof opt.type === 'string' ? opt.type : 'uint16'\n var count = typeof opt.count === 'number' ? opt.count : 1\n var start = (opt.start || 0) \n\n var dir = opt.clockwise !== false ? CW : CCW,\n a = dir[0], \n b = dir[1],\n c = dir[2]\n\n var numIndices = count * 6\n\n var indices = array || new (dtype(type))(numIndices)\n for (var i = 0, j = 0; i < numIndices; i += 6, j += 4) {\n var x = i + start\n indices[x + 0] = j + 0\n indices[x + 1] = j + 1\n indices[x + 2] = j + 2\n indices[x + 3] = j + a\n indices[x + 4] = j + b\n indices[x + 5] = j + c\n }\n return indices\n}","'use strict';\n\nvar bind = require('function-bind');\nvar ES = require('es-abstract/es5');\nvar replace = bind.call(Function.call, String.prototype.replace);\n\n/* eslint-disable no-control-regex */\nvar leftWhitespace = /^[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]+/;\nvar rightWhitespace = /[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]+$/;\n/* eslint-enable no-control-regex */\n\nmodule.exports = function trim() {\n\tvar S = ES.ToString(ES.CheckObjectCoercible(this));\n\treturn replace(replace(S, leftWhitespace, ''), rightWhitespace, '');\n};\n","'use strict';\n\nvar bind = require('function-bind');\nvar define = require('define-properties');\n\nvar implementation = require('./implementation');\nvar getPolyfill = require('./polyfill');\nvar shim = require('./shim');\n\nvar boundTrim = bind.call(Function.call, getPolyfill());\n\ndefine(boundTrim, {\n\tgetPolyfill: getPolyfill,\n\timplementation: implementation,\n\tshim: shim\n});\n\nmodule.exports = boundTrim;\n","'use strict';\n\nvar implementation = require('./implementation');\n\nvar zeroWidthSpace = '\\u200b';\n\nmodule.exports = function getPolyfill() {\n\tif (String.prototype.trim && zeroWidthSpace.trim() === zeroWidthSpace) {\n\t\treturn String.prototype.trim;\n\t}\n\treturn implementation;\n};\n","'use strict';\n\nvar define = require('define-properties');\nvar getPolyfill = require('./polyfill');\n\nmodule.exports = function shimStringTrim() {\n\tvar polyfill = getPolyfill();\n\tdefine(String.prototype, { trim: polyfill }, {\n\t\ttrim: function testTrim() {\n\t\t\treturn String.prototype.trim !== polyfill;\n\t\t}\n\t});\n\treturn polyfill;\n};\n","/*\n * anime.js v3.0.0\n * (c) 2019 Julian Garnier\n * Released under the MIT license\n * animejs.com\n */\n\n'use strict';\n\n// Defaults\n\nvar defaultInstanceSettings = {\n update: null,\n begin: null,\n loopBegin: null,\n changeBegin: null,\n change: null,\n changeComplete: null,\n loopComplete: null,\n complete: null,\n loop: 1,\n direction: 'normal',\n autoplay: true,\n timelineOffset: 0\n};\n\nvar defaultTweenSettings = {\n duration: 1000,\n delay: 0,\n endDelay: 0,\n easing: 'easeOutElastic(1, .5)',\n round: 0\n};\n\nvar validTransforms = ['translateX', 'translateY', 'translateZ', 'rotate', 'rotateX', 'rotateY', 'rotateZ', 'scale', 'scaleX', 'scaleY', 'scaleZ', 'skew', 'skewX', 'skewY', 'perspective'];\n\n// Caching\n\nvar cache = {\n CSS: {},\n springs: {}\n};\n\n// Utils\n\nfunction minMax(val, min, max) {\n return Math.min(Math.max(val, min), max);\n}\n\nfunction stringContains(str, text) {\n return str.indexOf(text) > -1;\n}\n\nfunction applyArguments(func, args) {\n return func.apply(null, args);\n}\n\nvar hexRegex = /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i;\nvar rgbPrefixRegex = /^rgb/;\nvar hslRegex = /^hsl/;\n\nvar is = {\n arr: function (a) { return Array.isArray(a); },\n obj: function (a) { return stringContains(Object.prototype.toString.call(a), 'Object'); },\n pth: function (a) { return is.obj(a) && a.hasOwnProperty('totalLength'); },\n svg: function (a) { return a instanceof SVGElement; },\n inp: function (a) { return a instanceof HTMLInputElement; },\n dom: function (a) { return a.nodeType || is.svg(a); },\n str: function (a) { return typeof a === 'string'; },\n fnc: function (a) { return typeof a === 'function'; },\n und: function (a) { return typeof a === 'undefined'; },\n hex: function (a) { return hexRegex.test(a); },\n rgb: function (a) { return rgbPrefixRegex.test(a); },\n hsl: function (a) { return hslRegex.test(a); },\n col: function (a) { return (is.hex(a) || is.rgb(a) || is.hsl(a)); },\n key: function (a) { return !defaultInstanceSettings.hasOwnProperty(a) && !defaultTweenSettings.hasOwnProperty(a) && a !== 'targets' && a !== 'keyframes'; }\n};\n\n// Easings\n\nvar easingFunctionRegex = /\\(([^)]+)\\)/;\n\nfunction parseEasingParameters(string) {\n var match = easingFunctionRegex.exec(string);\n return match ? match[1].split(',').map(function (p) { return parseFloat(p); }) : [];\n}\n\n// Spring solver inspired by Webkit Copyright © 2016 Apple Inc. All rights reserved. https://webkit.org/demos/spring/spring.js\n\nfunction spring(string, duration) {\n\n var params = parseEasingParameters(string);\n var mass = minMax(is.und(params[0]) ? 1 : params[0], .1, 100);\n var stiffness = minMax(is.und(params[1]) ? 100 : params[1], .1, 100);\n var damping = minMax(is.und(params[2]) ? 10 : params[2], .1, 100);\n var velocity = minMax(is.und(params[3]) ? 0 : params[3], .1, 100);\n var w0 = Math.sqrt(stiffness / mass);\n var zeta = damping / (2 * Math.sqrt(stiffness * mass));\n var wd = zeta < 1 ? w0 * Math.sqrt(1 - zeta * zeta) : 0;\n var a = 1;\n var b = zeta < 1 ? (zeta * w0 + -velocity) / wd : -velocity + w0;\n\n function solver(t) {\n var progress = duration ? (duration * t) / 1000 : t;\n if (zeta < 1) {\n progress = Math.exp(-progress * zeta * w0) * (a * Math.cos(wd * progress) + b * Math.sin(wd * progress));\n } else {\n progress = (a + b * progress) * Math.exp(-progress * w0);\n }\n if (t === 0 || t === 1) { return t; }\n return 1 - progress;\n }\n\n function getDuration() {\n var cached = cache.springs[string];\n if (cached) { return cached; }\n var frame = 1/6;\n var elapsed = 0;\n var rest = 0;\n while(true) {\n elapsed += frame;\n if (solver(elapsed) === 1) {\n rest++;\n if (rest >= 16) { break; }\n } else {\n rest = 0;\n }\n }\n var duration = elapsed * frame * 1000;\n cache.springs[string] = duration;\n return duration;\n }\n\n return duration ? solver : getDuration;\n\n}\n\n// Elastic easing adapted from jQueryUI http://api.jqueryui.com/easings/\n\nfunction elastic(amplitude, period) {\n if ( amplitude === void 0 ) amplitude = 1;\n if ( period === void 0 ) period = .5;\n\n var a = minMax(amplitude, 1, 10);\n var p = minMax(period, .1, 2);\n return function (t) {\n return (t === 0 || t === 1) ? t :\n -a * Math.pow(2, 10 * (t - 1)) * Math.sin((((t - 1) - (p / (Math.PI * 2) * Math.asin(1 / a))) * (Math.PI * 2)) / p);\n }\n}\n\n// Basic steps easing implementation https://developer.mozilla.org/fr/docs/Web/CSS/transition-timing-function\n\nfunction steps(steps) {\n if ( steps === void 0 ) steps = 10;\n\n return function (t) { return Math.round(t * steps) * (1 / steps); };\n}\n\n// BezierEasing https://github.com/gre/bezier-easing\n\nvar bezier = (function () {\n\n var kSplineTableSize = 11;\n var kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);\n\n function A(aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1 }\n function B(aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1 }\n function C(aA1) { return 3.0 * aA1 }\n\n function calcBezier(aT, aA1, aA2) { return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT }\n function getSlope(aT, aA1, aA2) { return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1) }\n\n function binarySubdivide(aX, aA, aB, mX1, mX2) {\n var currentX, currentT, i = 0;\n do {\n currentT = aA + (aB - aA) / 2.0;\n currentX = calcBezier(currentT, mX1, mX2) - aX;\n if (currentX > 0.0) { aB = currentT; } else { aA = currentT; }\n } while (Math.abs(currentX) > 0.0000001 && ++i < 10);\n return currentT;\n }\n\n function newtonRaphsonIterate(aX, aGuessT, mX1, mX2) {\n for (var i = 0; i < 4; ++i) {\n var currentSlope = getSlope(aGuessT, mX1, mX2);\n if (currentSlope === 0.0) { return aGuessT; }\n var currentX = calcBezier(aGuessT, mX1, mX2) - aX;\n aGuessT -= currentX / currentSlope;\n }\n return aGuessT;\n }\n\n function bezier(mX1, mY1, mX2, mY2) {\n\n if (!(0 <= mX1 && mX1 <= 1 && 0 <= mX2 && mX2 <= 1)) { return; }\n var sampleValues = new Float32Array(kSplineTableSize);\n\n if (mX1 !== mY1 || mX2 !== mY2) {\n for (var i = 0; i < kSplineTableSize; ++i) {\n sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);\n }\n }\n\n function getTForX(aX) {\n\n var intervalStart = 0;\n var currentSample = 1;\n var lastSample = kSplineTableSize - 1;\n\n for (; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) {\n intervalStart += kSampleStepSize;\n }\n\n --currentSample;\n\n var dist = (aX - sampleValues[currentSample]) / (sampleValues[currentSample + 1] - sampleValues[currentSample]);\n var guessForT = intervalStart + dist * kSampleStepSize;\n var initialSlope = getSlope(guessForT, mX1, mX2);\n\n if (initialSlope >= 0.001) {\n return newtonRaphsonIterate(aX, guessForT, mX1, mX2);\n } else if (initialSlope === 0.0) {\n return guessForT;\n } else {\n return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);\n }\n\n }\n\n return function (x) {\n if (mX1 === mY1 && mX2 === mY2) { return x; }\n if (x === 0 || x === 1) { return x; }\n return calcBezier(getTForX(x), mY1, mY2);\n }\n\n }\n\n return bezier;\n\n})();\n\nvar penner = (function () {\n\n var names = ['Quad', 'Cubic', 'Quart', 'Quint', 'Sine', 'Expo', 'Circ', 'Back', 'Elastic'];\n\n // Approximated Penner equations http://matthewlein.com/ceaser/\n\n var curves = {\n In: [\n [0.550, 0.085, 0.680, 0.530], /* inQuad */\n [0.550, 0.055, 0.675, 0.190], /* inCubic */\n [0.895, 0.030, 0.685, 0.220], /* inQuart */\n [0.755, 0.050, 0.855, 0.060], /* inQuint */\n [0.470, 0.000, 0.745, 0.715], /* inSine */\n [0.950, 0.050, 0.795, 0.035], /* inExpo */\n [0.600, 0.040, 0.980, 0.335], /* inCirc */\n [0.600,-0.280, 0.735, 0.045], /* inBack */\n elastic /* inElastic */\n ],\n Out: [\n [0.250, 0.460, 0.450, 0.940], /* outQuad */\n [0.215, 0.610, 0.355, 1.000], /* outCubic */\n [0.165, 0.840, 0.440, 1.000], /* outQuart */\n [0.230, 1.000, 0.320, 1.000], /* outQuint */\n [0.390, 0.575, 0.565, 1.000], /* outSine */\n [0.190, 1.000, 0.220, 1.000], /* outExpo */\n [0.075, 0.820, 0.165, 1.000], /* outCirc */\n [0.175, 0.885, 0.320, 1.275], /* outBack */\n function (a, p) { return function (t) { return 1 - elastic(a, p)(1 - t); }; } /* outElastic */\n ],\n InOut: [\n [0.455, 0.030, 0.515, 0.955], /* inOutQuad */\n [0.645, 0.045, 0.355, 1.000], /* inOutCubic */\n [0.770, 0.000, 0.175, 1.000], /* inOutQuart */\n [0.860, 0.000, 0.070, 1.000], /* inOutQuint */\n [0.445, 0.050, 0.550, 0.950], /* inOutSine */\n [1.000, 0.000, 0.000, 1.000], /* inOutExpo */\n [0.785, 0.135, 0.150, 0.860], /* inOutCirc */\n [0.680,-0.550, 0.265, 1.550], /* inOutBack */\n function (a, p) { return function (t) { return t < .5 ? elastic(a, p)(t * 2) / 2 : 1 - elastic(a, p)(t * -2 + 2) / 2; }; } /* inOutElastic */\n ]\n };\n\n var eases = {\n linear: [0.250, 0.250, 0.750, 0.750]\n };\n\n for (var coords in curves) {\n for (var i = 0, len = curves[coords].length; i < len; i++) {\n eases['ease'+coords+names[i]] = curves[coords][i];\n }\n }\n\n return eases;\n\n})();\n\nfunction parseEasings(easing, duration) {\n if (is.fnc(easing)) { return easing; }\n var name = easing.split('(')[0];\n var ease = penner[name];\n var args = parseEasingParameters(easing);\n switch (name) {\n case 'spring' : return spring(easing, duration);\n case 'cubicBezier' : return applyArguments(bezier, args);\n case 'steps' : return applyArguments(steps, args);\n default : return is.fnc(ease) ? applyArguments(ease, args) : applyArguments(bezier, ease);\n }\n}\n\n// Strings\n\nfunction selectString(str) {\n try {\n var nodes = document.querySelectorAll(str);\n return nodes;\n } catch(e) {\n return;\n }\n}\n\n// Arrays\n\nvar auxArrayFilter = [];\n\nfunction filterArray(arr, callback) {\n var result = auxArrayFilter;\n\n var len = arr.length;\n var thisArg = arguments.length >= 2 ? arguments[1] : void 0;\n for (var i = 0; i < len; i++) {\n if (i in arr) {\n var val = arr[i];\n if (callback.call(thisArg, val, i, arr)) {\n result.push(val);\n }\n }\n }\n\n // arr turns into the auxArray and we return the previously aux array.\n auxArrayFilter = arr;\n auxArrayFilter.length = 0;\n return result;\n}\n\nfunction flattenArray (arr, result) {\n if (!result) { result = []; }\n for (var i = 0, length = arr.length; i < length; i++) {\n var value = arr[i];\n if (Array.isArray(value)) {\n flattenArray(value, result);\n } else {\n result.push(value);\n }\n }\n return result;\n}\n\nfunction toArray(o) {\n if (is.arr(o)) { return o; }\n if (is.str(o)) { o = selectString(o) || o; }\n if (o instanceof NodeList || o instanceof HTMLCollection) { return [].slice.call(o); }\n return [o];\n}\n\nfunction arrayContains(arr, val) {\n return arr.some(function (a) { return a === val; });\n}\n\n// Objects\n\nfunction cloneObject(o) {\n var clone = {};\n for (var p in o) { clone[p] = o[p]; }\n return clone;\n}\n\nfunction replaceObjectProps(o1, o2) {\n var o = cloneObject(o1);\n for (var p in o1) { o[p] = o2.hasOwnProperty(p) ? o2[p] : o1[p]; }\n return o;\n}\n\nfunction mergeObjects(o1, o2) {\n var o = cloneObject(o1);\n for (var p in o2) { o[p] = is.und(o1[p]) ? o2[p] : o1[p]; }\n return o;\n}\n\n// Colors\n\nvar rgbRegex = /rgb\\((\\d+,\\s*[\\d]+,\\s*[\\d]+)\\)/g;\n\nfunction rgbToRgba(rgbValue) {\n var rgb = rgbRegex.exec(rgbValue);\n return rgb ? (\"rgba(\" + (rgb[1]) + \",1)\") : rgbValue;\n}\n\nvar hexToRgbaHexRegex = /^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;\nvar hexToRgbaRgbRegex = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i;\n\nfunction hexToRgba(hexValue) {\n var hex = hexValue.replace(hexToRgbaHexRegex, function (m, r, g, b) { return r + r + g + g + b + b; } );\n var rgb = hexToRgbaRgbRegex.exec(hex);\n var r = parseInt(rgb[1], 16);\n var g = parseInt(rgb[2], 16);\n var b = parseInt(rgb[3], 16);\n return (\"rgba(\" + r + \",\" + g + \",\" + b + \",1)\");\n}\n\nvar hslToRgbaHsl1Regex = /hsl\\((\\d+),\\s*([\\d.]+)%,\\s*([\\d.]+)%\\)/g;\nvar hslToRgbaHsl2Regex = /hsla\\((\\d+),\\s*([\\d.]+)%,\\s*([\\d.]+)%,\\s*([\\d.]+)\\)/g;\n\nfunction hslToRgba(hslValue) {\n var hsl = hslToRgbaHsl1Regex.exec(hslValue) || hslToRgbaHsl2Regex.exec(hslValue);\n var h = parseInt(hsl[1], 10) / 360;\n var s = parseInt(hsl[2], 10) / 100;\n var l = parseInt(hsl[3], 10) / 100;\n var a = hsl[4] || 1;\n function hue2rgb(p, q, t) {\n if (t < 0) { t += 1; }\n if (t > 1) { t -= 1; }\n if (t < 1/6) { return p + (q - p) * 6 * t; }\n if (t < 1/2) { return q; }\n if (t < 2/3) { return p + (q - p) * (2/3 - t) * 6; }\n return p;\n }\n var r, g, b;\n if (s == 0) {\n r = g = b = l;\n } else {\n var q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n var p = 2 * l - q;\n r = hue2rgb(p, q, h + 1/3);\n g = hue2rgb(p, q, h);\n b = hue2rgb(p, q, h - 1/3);\n }\n return (\"rgba(\" + (r * 255) + \",\" + (g * 255) + \",\" + (b * 255) + \",\" + a + \")\");\n}\n\nfunction colorToRgb(val) {\n if (is.rgb(val)) { return rgbToRgba(val); }\n if (is.hex(val)) { return hexToRgba(val); }\n if (is.hsl(val)) { return hslToRgba(val); }\n}\n\n// Units\n\nvar unitRegex = /([\\+\\-]?[0-9#\\.]+)(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/;\n\nfunction getUnit(val) {\n var split = unitRegex.exec(val);\n if (split) { return split[2]; }\n}\n\nfunction getTransformUnit(propName) {\n if (stringContains(propName, 'translate') || propName === 'perspective') { return 'px'; }\n if (stringContains(propName, 'rotate') || stringContains(propName, 'skew')) { return 'deg'; }\n}\n\n// Values\n\nfunction getFunctionValue(val, animatable) {\n if (!is.fnc(val)) { return val; }\n return val(animatable.target, animatable.id, animatable.total);\n}\n\nfunction getAttribute(el, prop) {\n return el.getAttribute(prop);\n}\n\nfunction convertPxToUnit(el, value, unit) {\n var valueUnit = getUnit(value);\n if (arrayContains([unit, 'deg', 'rad', 'turn'], valueUnit)) { return value; }\n var cached = cache.CSS[value + unit];\n if (!is.und(cached)) { return cached; }\n var baseline = 100;\n var tempEl = document.createElement(el.tagName);\n var parentEl = (el.parentNode && (el.parentNode !== document)) ? el.parentNode : document.body;\n parentEl.appendChild(tempEl);\n tempEl.style.position = 'absolute';\n tempEl.style.width = baseline + unit;\n var factor = baseline / tempEl.offsetWidth;\n parentEl.removeChild(tempEl);\n var convertedUnit = factor * parseFloat(value);\n cache.CSS[value + unit] = convertedUnit;\n return convertedUnit;\n}\n\nfunction getCSSValue(el, prop, unit) {\n if (prop in el.style) {\n var uppercasePropName = prop.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n var value = el.style[prop] || getComputedStyle(el).getPropertyValue(uppercasePropName) || '0';\n return unit ? convertPxToUnit(el, value, unit) : value;\n }\n}\n\nfunction getAnimationType(el, prop) {\n if (is.dom(el) && !is.inp(el) && (getAttribute(el, prop) || (is.svg(el) && el[prop]))) { return 'attribute'; }\n if (is.dom(el) && arrayContains(validTransforms, prop)) { return 'transform'; }\n if (is.dom(el) && (prop !== 'transform' && getCSSValue(el, prop))) { return 'css'; }\n if (el[prop] != null) { return 'object'; }\n}\n\nvar transformRegex = /(\\w+)\\(([^)]*)\\)/g;\n\nfunction getElementTransforms(el) {\n if (!is.dom(el)) { return; }\n var str = el.style.transform || '';\n var transforms = new Map();\n var m; while (m = transformRegex.exec(str)) { transforms.set(m[1], m[2]); }\n return transforms;\n}\n\nfunction getTransformValue(el, propName, animatable, unit) {\n var defaultVal = stringContains(propName, 'scale') ? 1 : 0 + getTransformUnit(propName);\n var value = getElementTransforms(el).get(propName) || defaultVal;\n if (animatable) {\n animatable.transforms.list.set(propName, value);\n animatable.transforms['last'] = propName;\n }\n return unit ? convertPxToUnit(el, value, unit) : value;\n}\n\nfunction getOriginalTargetValue(target, propName, unit, animatable) {\n switch (getAnimationType(target, propName)) {\n case 'transform': return getTransformValue(target, propName, animatable, unit);\n case 'css': return getCSSValue(target, propName, unit);\n case 'attribute': return getAttribute(target, propName);\n default: return target[propName] || 0;\n }\n}\n\nvar operatorRegex = /^(\\*=|\\+=|-=)/;\n\nfunction getRelativeValue(to, from) {\n var operator = operatorRegex.exec(to);\n if (!operator) { return to; }\n var u = getUnit(to) || 0;\n var x = parseFloat(from);\n var y = parseFloat(to.replace(operator[0], ''));\n switch (operator[0][0]) {\n case '+': return x + y + u;\n case '-': return x - y + u;\n case '*': return x * y + u;\n }\n}\n\nvar whitespaceRegex = /\\s/g;\n\nfunction validateValue(val, unit) {\n if (is.col(val)) { return colorToRgb(val); }\n var originalUnit = getUnit(val);\n var unitLess = originalUnit ? val.substr(0, val.length - originalUnit.length) : val;\n return unit && !whitespaceRegex.test(val) ? unitLess + unit : unitLess;\n}\n\n// getTotalLength() equivalent for circle, rect, polyline, polygon and line shapes\n// adapted from https://gist.github.com/SebLambla/3e0550c496c236709744\n\nfunction getDistance(p1, p2) {\n return Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2));\n}\n\nfunction getCircleLength(el) {\n return Math.PI * 2 * getAttribute(el, 'r');\n}\n\nfunction getRectLength(el) {\n return (getAttribute(el, 'width') * 2) + (getAttribute(el, 'height') * 2);\n}\n\nfunction getLineLength(el) {\n return getDistance(\n {x: getAttribute(el, 'x1'), y: getAttribute(el, 'y1')},\n {x: getAttribute(el, 'x2'), y: getAttribute(el, 'y2')}\n );\n}\n\nfunction getPolylineLength(el) {\n var points = el.points;\n var totalLength = 0;\n var previousPos;\n for (var i = 0 ; i < points.numberOfItems; i++) {\n var currentPos = points.getItem(i);\n if (i > 0) { totalLength += getDistance(previousPos, currentPos); }\n previousPos = currentPos;\n }\n return totalLength;\n}\n\nfunction getPolygonLength(el) {\n var points = el.points;\n return getPolylineLength(el) + getDistance(points.getItem(points.numberOfItems - 1), points.getItem(0));\n}\n\n// Path animation\n\nfunction getTotalLength(el) {\n if (el.getTotalLength) { return el.getTotalLength(); }\n switch(el.tagName.toLowerCase()) {\n case 'circle': return getCircleLength(el);\n case 'rect': return getRectLength(el);\n case 'line': return getLineLength(el);\n case 'polyline': return getPolylineLength(el);\n case 'polygon': return getPolygonLength(el);\n }\n}\n\nfunction setDashoffset(el) {\n var pathLength = getTotalLength(el);\n el.setAttribute('stroke-dasharray', pathLength);\n return pathLength;\n}\n\n// Motion path\n\nfunction getParentSvgEl(el) {\n var parentEl = el.parentNode;\n while (is.svg(parentEl)) {\n parentEl = parentEl.parentNode;\n if (!is.svg(parentEl.parentNode)) { break; }\n }\n return parentEl;\n}\n\nfunction getParentSvg(pathEl, svgData) {\n var svg = svgData || {};\n var parentSvgEl = svg.el || getParentSvgEl(pathEl);\n var rect = parentSvgEl.getBoundingClientRect();\n var viewBoxAttr = getAttribute(parentSvgEl, 'viewBox');\n var width = rect.width;\n var height = rect.height;\n var viewBox = svg.viewBox || (viewBoxAttr ? viewBoxAttr.split(' ') : [0, 0, width, height]);\n return {\n el: parentSvgEl,\n viewBox: viewBox,\n x: viewBox[0] / 1,\n y: viewBox[1] / 1,\n w: width / viewBox[2],\n h: height / viewBox[3]\n }\n}\n\nfunction getPath(path, percent) {\n var pathEl = is.str(path) ? selectString(path)[0] : path;\n var p = percent || 100;\n return function(property) {\n return {\n property: property,\n el: pathEl,\n svg: getParentSvg(pathEl),\n totalLength: getTotalLength(pathEl) * (p / 100)\n }\n }\n}\n\nfunction getPathProgress(path, progress) {\n function point(offset) {\n if ( offset === void 0 ) offset = 0;\n\n var l = progress + offset >= 1 ? progress + offset : 0;\n return path.el.getPointAtLength(l);\n }\n var svg = getParentSvg(path.el, path.svg);\n var p = point();\n var p0 = point(-1);\n var p1 = point(+1);\n switch (path.property) {\n case 'x': return (p.x - svg.x) * svg.w;\n case 'y': return (p.y - svg.y) * svg.h;\n case 'angle': return Math.atan2(p1.y - p0.y, p1.x - p0.x) * 180 / Math.PI;\n }\n}\n\n// Decompose value\n\nvar valueRegex = /-?\\d*\\.?\\d+/g;\n\nfunction decomposeValue(val, unit) {\n var value = validateValue((is.pth(val) ? val.totalLength : val), unit) + '';\n return {\n original: value,\n numbers: value.match(valueRegex) ? value.match(valueRegex).map(Number) : [0],\n strings: (is.str(val) || unit) ? value.split(valueRegex) : []\n }\n}\n\n// Animatables\n\nfunction parseTargets(targets) {\n var targetsArray = targets ? (flattenArray(is.arr(targets) ? targets.map(toArray) : toArray(targets))) : [];\n return filterArray(targetsArray, function (item, pos, self) { return self.indexOf(item) === pos; });\n}\n\nfunction getAnimatables(targets) {\n var parsed = parseTargets(targets);\n return parsed.map(function (t, i) {\n return {target: t, id: i, total: parsed.length, transforms: { list: getElementTransforms(t) } };\n });\n}\n\n// Properties\n\nvar springRegex = /^spring/;\n\nfunction normalizePropertyTweens(prop, tweenSettings) {\n var settings = cloneObject(tweenSettings);\n // Override duration if easing is a spring\n if (springRegex.test(settings.easing)) { settings.duration = spring(settings.easing); }\n if (is.arr(prop)) {\n var l = prop.length;\n var isFromTo = (l === 2 && !is.obj(prop[0]));\n if (!isFromTo) {\n // Duration divided by the number of tweens\n if (!is.fnc(tweenSettings.duration)) { settings.duration = tweenSettings.duration / l; }\n } else {\n // Transform [from, to] values shorthand to a valid tween value\n prop = {value: prop};\n }\n }\n var propArray = is.arr(prop) ? prop : [prop];\n return propArray.map(function (v, i) {\n var obj = (is.obj(v) && !is.pth(v)) ? v : {value: v};\n // Default delay value should only be applied to the first tween\n if (is.und(obj.delay)) { obj.delay = !i ? tweenSettings.delay : 0; }\n // Default endDelay value should only be applied to the last tween\n if (is.und(obj.endDelay)) { obj.endDelay = i === propArray.length - 1 ? tweenSettings.endDelay : 0; }\n return obj;\n }).map(function (k) { return mergeObjects(k, settings); });\n}\n\n\nfunction flattenKeyframes(keyframes) {\n var propertyNames = filterArray(flattenArray(keyframes.map(function (key) { return Object.keys(key); })), function (p) { return is.key(p); })\n .reduce(function (a,b) { if (a.indexOf(b) < 0) { a.push(b); } return a; }, []);\n var properties = {};\n var loop = function ( i ) {\n var propName = propertyNames[i];\n properties[propName] = keyframes.map(function (key) {\n var newKey = {};\n for (var p in key) {\n if (is.key(p)) {\n if (p == propName) { newKey.value = key[p]; }\n } else {\n newKey[p] = key[p];\n }\n }\n return newKey;\n });\n };\n\n for (var i = 0; i < propertyNames.length; i++) loop( i );\n return properties;\n}\n\nfunction getProperties(tweenSettings, params) {\n var properties = [];\n var keyframes = params.keyframes;\n if (keyframes) { params = mergeObjects(flattenKeyframes(keyframes), params); }\n for (var p in params) {\n if (is.key(p)) {\n properties.push({\n name: p,\n tweens: normalizePropertyTweens(params[p], tweenSettings)\n });\n }\n }\n return properties;\n}\n\n// Tweens\n\nfunction normalizeTweenValues(tween, animatable) {\n var t = {};\n for (var p in tween) {\n var value = getFunctionValue(tween[p], animatable);\n if (is.arr(value)) {\n value = value.map(function (v) { return getFunctionValue(v, animatable); });\n if (value.length === 1) { value = value[0]; }\n }\n t[p] = value;\n }\n t.duration = parseFloat(t.duration);\n t.delay = parseFloat(t.delay);\n return t;\n}\n\nfunction normalizeTweens(prop, animatable) {\n var previousTween;\n return prop.tweens.map(function (t) {\n var tween = normalizeTweenValues(t, animatable);\n var tweenValue = tween.value;\n var to = is.arr(tweenValue) ? tweenValue[1] : tweenValue;\n var toUnit = getUnit(to);\n var originalValue = getOriginalTargetValue(animatable.target, prop.name, toUnit, animatable);\n var previousValue = previousTween ? previousTween.to.original : originalValue;\n var from = is.arr(tweenValue) ? tweenValue[0] : previousValue;\n var fromUnit = getUnit(from) || getUnit(originalValue);\n var unit = toUnit || fromUnit;\n if (is.und(to)) { to = previousValue; }\n tween.from = decomposeValue(from, unit);\n tween.to = decomposeValue(getRelativeValue(to, from), unit);\n tween.start = previousTween ? previousTween.end : 0;\n tween.end = tween.start + tween.delay + tween.duration + tween.endDelay;\n tween.easing = parseEasings(tween.easing, tween.duration);\n tween.isPath = is.pth(tweenValue);\n tween.isColor = is.col(tween.from.original);\n if (tween.isColor) { tween.round = 1; }\n previousTween = tween;\n return tween;\n });\n}\n\n// Tween progress\n\nvar setProgressValue = {\n css: function (t, p, v) { return t.style[p] = v; },\n attribute: function (t, p, v) { return t.setAttribute(p, v); },\n object: function (t, p, v) { return t[p] = v; },\n transform: function (t, p, v, transforms, manual) {\n transforms.list.set(p, v);\n if (p === transforms.last || manual) {\n var str = '';\n transforms.list.forEach(function (value, prop) { str += prop + \"(\" + value + \") \"; });\n t.style.transform = str;\n }\n }\n};\n\n// Set Value helper\n\nfunction setTargetsValue(targets, properties) {\n var animatables = getAnimatables(targets);\n\n for (var i = 0, len = animatables.length; i < len; i++) {\n var animatable = animatables[i];\n\n for (var property in properties) {\n var value = getFunctionValue(properties[property], animatable);\n var target = animatable.target;\n var valueUnit = getUnit(value);\n var originalValue = getOriginalTargetValue(target, property, valueUnit, animatable);\n var unit = valueUnit || getUnit(originalValue);\n var to = getRelativeValue(validateValue(value, unit), originalValue);\n var animType = getAnimationType(target, property);\n setProgressValue[animType](target, property, to, animatable.transforms, true);\n }\n }\n}\n\n// Animations\n\nfunction createAnimation(animatable, prop) {\n var animType = getAnimationType(animatable.target, prop.name);\n if (animType) {\n var tweens = normalizeTweens(prop, animatable);\n var lastTween = tweens[tweens.length - 1];\n return {\n type: animType,\n property: prop.name,\n animatable: animatable,\n tweens: tweens,\n duration: lastTween.end,\n delay: tweens[0].delay,\n endDelay: lastTween.endDelay\n }\n }\n}\n\nfunction getAnimations(animatables, properties) {\n return filterArray(flattenArray(animatables.map(function (animatable) {\n return properties.map(function (prop) {\n return createAnimation(animatable, prop);\n });\n })), function (a) { return !is.und(a); });\n}\n\n// Create Instance\n\nfunction getInstanceTimings(animations, tweenSettings) {\n var animLength = animations.length;\n var getTlOffset = function (anim) { return anim.timelineOffset ? anim.timelineOffset : 0; };\n var timings = {};\n timings.duration = animLength ? Math.max.apply(Math, animations.map(function (anim) { return getTlOffset(anim) + anim.duration; })) : tweenSettings.duration;\n timings.delay = animLength ? Math.min.apply(Math, animations.map(function (anim) { return getTlOffset(anim) + anim.delay; })) : tweenSettings.delay;\n timings.endDelay = animLength ? timings.duration - Math.max.apply(Math, animations.map(function (anim) { return getTlOffset(anim) + anim.duration - anim.endDelay; })) : tweenSettings.endDelay;\n return timings;\n}\n\nvar instanceID = 0;\n\nfunction createNewInstance(params) {\n var instanceSettings = replaceObjectProps(defaultInstanceSettings, params);\n var tweenSettings = replaceObjectProps(defaultTweenSettings, params);\n var properties = getProperties(tweenSettings, params);\n var animatables = getAnimatables(params.targets);\n var animations = getAnimations(animatables, properties);\n var timings = getInstanceTimings(animations, tweenSettings);\n var id = instanceID;\n instanceID++;\n return mergeObjects(instanceSettings, {\n id: id,\n children: [],\n animatables: animatables,\n animations: animations,\n duration: timings.duration,\n delay: timings.delay,\n endDelay: timings.endDelay\n });\n}\n\n// Core\n\nvar activeInstances = [];\nvar pausedInstances = [];\nvar raf;\n\nvar engine = (function () {\n function play() {\n raf = requestAnimationFrame(step);\n }\n function step(t) {\n var activeInstancesLength = activeInstances.length;\n if (activeInstancesLength) {\n var i = 0;\n while (i < activeInstancesLength) {\n var activeInstance = activeInstances[i];\n if (!activeInstance.paused) {\n activeInstance.tick(t);\n } else {\n var instanceIndex = activeInstances.indexOf(activeInstance);\n if (instanceIndex > -1) {\n activeInstances.splice(instanceIndex, 1);\n activeInstancesLength = activeInstances.length;\n }\n }\n i++;\n }\n play();\n } else {\n raf = cancelAnimationFrame(raf);\n }\n }\n return play;\n})();\n\nfunction handleVisibilityChange() {\n if (document.hidden) {\n for (var i = 0, len = activeInstances.length; i < len; i++) {\n activeInstance[i].pause();\n }\n pausedInstances = activeInstances.slice(0);\n activeInstances = [];\n } else {\n for (var i$1 = 0, len$1 = pausedInstances.length; i$1 < len$1; i$1++) {\n pausedInstances[i$1].play();\n }\n }\n}\n\ndocument.addEventListener('visibilitychange', handleVisibilityChange);\n\n// Public Instance\n\nfunction anime(params) {\n if ( params === void 0 ) params = {};\n\n\n var startTime = 0, lastTime = 0, now = 0;\n var children, childrenLength = 0;\n var resolve = null;\n\n function makePromise() {\n return window.Promise && new Promise(function (_resolve) { return resolve = _resolve; });\n }\n\n var promise = makePromise();\n\n var instance = createNewInstance(params);\n\n function toggleInstanceDirection() {\n instance.reversed = !instance.reversed;\n for (var i = 0, len = children.length; i < len; i++) {\n children[i].reversed = instance.reversed;\n }\n }\n\n function adjustTime(time) {\n return instance.reversed ? instance.duration - time : time;\n }\n\n function resetTime() {\n startTime = 0;\n lastTime = adjustTime(instance.currentTime) * (1 / anime.speed);\n }\n\n function seekCild(time, child) {\n if (child) { child.seek(time - child.timelineOffset); }\n }\n\n function syncInstanceChildren(time) {\n if (!instance.reversePlayback) {\n for (var i = 0; i < childrenLength; i++) { seekCild(time, children[i]); }\n } else {\n for (var i$1 = childrenLength; i$1--;) { seekCild(time, children[i$1]); }\n }\n }\n\n function setAnimationsProgress(insTime) {\n var i = 0;\n var animations = instance.animations;\n var animationsLength = animations.length;\n while (i < animationsLength) {\n var anim = animations[i];\n var animatable = anim.animatable;\n var tweens = anim.tweens;\n var tweenLength = tweens.length - 1;\n var tween = tweens[tweenLength];\n // Only check for keyframes if there is more than one tween\n if (tweenLength) { tween = filterArray(tweens, function (t) { return (insTime < t.end); })[0] || tween; }\n var elapsed = minMax(insTime - tween.start - tween.delay, 0, tween.duration) / tween.duration;\n var eased = isNaN(elapsed) ? 1 : tween.easing(elapsed);\n var strings = tween.to.strings;\n var round = tween.round;\n var numbers = [];\n var toNumbersLength = tween.to.numbers.length;\n var progress = (void 0);\n for (var n = 0; n < toNumbersLength; n++) {\n var value = (void 0);\n var toNumber = tween.to.numbers[n];\n var fromNumber = tween.from.numbers[n] || 0;\n if (!tween.isPath) {\n value = fromNumber + (eased * (toNumber - fromNumber));\n } else {\n value = getPathProgress(tween.value, eased * toNumber);\n }\n if (round) {\n if (!(tween.isColor && n > 2)) {\n value = Math.round(value * round) / round;\n }\n }\n numbers.push(value);\n }\n // Manual Array.reduce for better performances\n var stringsLength = strings.length;\n if (!stringsLength) {\n progress = numbers[0];\n } else {\n progress = strings[0];\n for (var s = 0; s < stringsLength; s++) {\n var a = strings[s];\n var b = strings[s + 1];\n var n$1 = numbers[s];\n if (!isNaN(n$1)) {\n if (!b) {\n progress += n$1 + ' ';\n } else {\n progress += n$1 + b;\n }\n }\n }\n }\n setProgressValue[anim.type](animatable.target, anim.property, progress, animatable.transforms);\n anim.currentValue = progress;\n i++;\n }\n }\n\n function setCallback(cb) {\n if (instance[cb] && !instance.passThrough) { instance[cb](instance); }\n }\n\n function countIteration() {\n if (instance.remaining && instance.remaining !== true) {\n instance.remaining--;\n }\n }\n\n function setInstanceProgress(engineTime) {\n var insDuration = instance.duration;\n var insDelay = instance.delay;\n var insEndDelay = insDuration - instance.endDelay;\n var insTime = adjustTime(engineTime);\n instance.progress = minMax((insTime / insDuration) * 100, 0, 100);\n instance.reversePlayback = insTime < instance.currentTime;\n if (children) { syncInstanceChildren(insTime); }\n if (!instance.began && instance.currentTime > 0) {\n instance.began = true;\n setCallback('begin');\n setCallback('loopBegin');\n }\n if (insTime <= insDelay && instance.currentTime !== 0) {\n setAnimationsProgress(0);\n }\n if ((insTime >= insEndDelay && instance.currentTime !== insDuration) || !insDuration) {\n setAnimationsProgress(insDuration);\n }\n if (insTime > insDelay && insTime < insEndDelay) {\n if (!instance.changeBegan) {\n instance.changeBegan = true;\n instance.changeCompleted = false;\n setCallback('changeBegin');\n }\n setCallback('change');\n setAnimationsProgress(insTime);\n } else {\n if (instance.changeBegan) {\n instance.changeCompleted = true;\n instance.changeBegan = false;\n setCallback('changeComplete');\n }\n }\n instance.currentTime = minMax(insTime, 0, insDuration);\n if (instance.began) { setCallback('update'); }\n if (engineTime >= insDuration) {\n lastTime = 0;\n countIteration();\n if (instance.remaining) {\n startTime = now;\n setCallback('loopComplete');\n setCallback('loopBegin');\n if (instance.direction === 'alternate') { toggleInstanceDirection(); }\n } else {\n instance.paused = true;\n if (!instance.completed) {\n instance.completed = true;\n setCallback('loopComplete');\n setCallback('complete');\n if ('Promise' in window) {\n resolve();\n promise = makePromise();\n }\n }\n }\n }\n }\n\n instance.reset = function() {\n var direction = instance.direction;\n instance.passThrough = false;\n instance.currentTime = 0;\n instance.progress = 0;\n instance.paused = true;\n instance.began = false;\n instance.changeBegan = false;\n instance.completed = false;\n instance.changeCompleted = false;\n instance.reversePlayback = false;\n instance.reversed = direction === 'reverse';\n instance.remaining = instance.loop;\n children = instance.children;\n childrenLength = children.length;\n for (var i = childrenLength; i--;) { instance.children[i].reset(); }\n if (instance.reversed && instance.loop !== true || (direction === 'alternate' && instance.loop === 1)) { instance.remaining++; }\n setAnimationsProgress(0);\n };\n\n // Set Value helper\n\n instance.set = function(targets, properties) {\n setTargetsValue(targets, properties);\n return instance;\n };\n\n instance.tick = function(t) {\n now = t;\n if (!startTime) { startTime = now; }\n setInstanceProgress((now + (lastTime - startTime)) * anime.speed);\n };\n\n instance.seek = function(time) {\n setInstanceProgress(adjustTime(time));\n };\n\n instance.pause = function() {\n instance.paused = true;\n resetTime();\n };\n\n instance.play = function() {\n if (!instance.paused) { return; }\n instance.paused = false;\n activeInstances.push(instance);\n resetTime();\n if (!raf) { engine(); }\n };\n\n instance.reverse = function() {\n toggleInstanceDirection();\n resetTime();\n };\n\n instance.restart = function() {\n instance.reset();\n instance.play();\n };\n\n instance.finished = promise;\n instance.reset();\n\n if (instance.autoplay) { instance.play(); }\n\n return instance;\n\n}\n\n// Remove targets from animation\n\nfunction removeTargetsFromAnimations(targetsArray, animations) {\n for (var a = animations.length; a--;) {\n if (arrayContains(targetsArray, animations[a].animatable.target)) {\n animations.splice(a, 1);\n }\n }\n}\n\nfunction removeTargets(targets) {\n var targetsArray = parseTargets(targets);\n for (var i = activeInstances.length; i--;) {\n var instance = activeInstances[i];\n var animations = instance.animations;\n var children = instance.children;\n removeTargetsFromAnimations(targetsArray, animations);\n for (var c = children.length; c--;) {\n var child = children[c];\n var childAnimations = child.animations;\n removeTargetsFromAnimations(targetsArray, childAnimations);\n if (!childAnimations.length && !child.children.length) { children.splice(c, 1); }\n }\n if (!animations.length && !children.length) { instance.pause(); }\n }\n}\n\n// Stagger helpers\n\nfunction stagger(val, params) {\n if ( params === void 0 ) params = {};\n\n var direction = params.direction || 'normal';\n var easing = params.easing ? parseEasings(params.easing) : null;\n var grid = params.grid;\n var axis = params.axis;\n var fromIndex = params.from || 0;\n var fromFirst = fromIndex === 'first';\n var fromCenter = fromIndex === 'center';\n var fromLast = fromIndex === 'last';\n var isRange = is.arr(val);\n var val1 = isRange ? parseFloat(val[0]) : parseFloat(val);\n var val2 = isRange ? parseFloat(val[1]) : 0;\n var unit = getUnit(isRange ? val[1] : val) || 0;\n var start = params.start || 0 + (isRange ? val1 : 0);\n var values = [];\n var maxValue = 0;\n return function (el, i, t) {\n if (fromFirst) { fromIndex = 0; }\n if (fromCenter) { fromIndex = (t - 1) / 2; }\n if (fromLast) { fromIndex = t - 1; }\n if (!values.length) {\n for (var index = 0; index < t; index++) {\n if (!grid) {\n values.push(Math.abs(fromIndex - index));\n } else {\n var fromX = !fromCenter ? fromIndex%grid[0] : (grid[0]-1)/2;\n var fromY = !fromCenter ? Math.floor(fromIndex/grid[0]) : (grid[1]-1)/2;\n var toX = index%grid[0];\n var toY = Math.floor(index/grid[0]);\n var distanceX = fromX - toX;\n var distanceY = fromY - toY;\n var value = Math.sqrt(distanceX * distanceX + distanceY * distanceY);\n if (axis === 'x') { value = -distanceX; }\n if (axis === 'y') { value = -distanceY; }\n values.push(value);\n }\n maxValue = Math.max.apply(Math, values);\n }\n if (easing) { values = values.map(function (val) { return easing(val / maxValue) * maxValue; }); }\n if (direction === 'reverse') { values = values.map(function (val) { return axis ? (val < 0) ? val * -1 : -val : Math.abs(maxValue - val); }); }\n }\n var spacing = isRange ? (val2 - val1) / maxValue : val1;\n return start + (spacing * (Math.round(values[i] * 100) / 100)) + unit;\n }\n}\n\n// Timeline\n\nfunction timeline(params) {\n if ( params === void 0 ) params = {};\n\n var tl = anime(params);\n tl.duration = 0;\n tl.add = function(instanceParams, timelineOffset) {\n var tlIndex = activeInstances.indexOf(tl);\n var children = tl.children;\n if (tlIndex > -1) { activeInstances.splice(tlIndex, 1); }\n function passThrough(ins) { ins.passThrough = true; }\n for (var i = 0; i < children.length; i++) { passThrough(children[i]); }\n var insParams = mergeObjects(instanceParams, replaceObjectProps(defaultTweenSettings, params));\n insParams.targets = insParams.targets || params.targets;\n var tlDuration = tl.duration;\n insParams.autoplay = false;\n insParams.direction = tl.direction;\n insParams.timelineOffset = is.und(timelineOffset) ? tlDuration : getRelativeValue(timelineOffset, tlDuration);\n passThrough(tl);\n tl.seek(insParams.timelineOffset);\n var ins = anime(insParams);\n passThrough(ins);\n children.push(ins);\n var timings = getInstanceTimings(children, params);\n tl.delay = timings.delay;\n tl.endDelay = timings.endDelay;\n tl.duration = timings.duration;\n tl.seek(0);\n tl.reset();\n if (tl.autoplay) { tl.play(); }\n return tl;\n };\n return tl;\n}\n\nanime.version = '3.0.0';\nanime.speed = 1;\nanime.running = activeInstances;\nanime.remove = removeTargets;\nanime.get = getOriginalTargetValue;\nanime.set = setTargetsValue;\nanime.convertPx = convertPxToUnit;\nanime.path = getPath;\nanime.setDashoffset = setDashoffset;\nanime.stagger = stagger;\nanime.timeline = timeline;\nanime.easing = parseEasings;\nanime.penner = penner;\nanime.random = function (min, max) { return Math.floor(Math.random() * (max - min + 1)) + min; };\n\nmodule.exports = anime;\n","var itemSize = 2\nvar box = { min: [0, 0], max: [0, 0] }\n\nfunction bounds (positions) {\n var count = positions.length / itemSize\n box.min[0] = positions[0]\n box.min[1] = positions[1]\n box.max[0] = positions[0]\n box.max[1] = positions[1]\n\n for (var i = 0; i < count; i++) {\n var x = positions[i * itemSize + 0]\n var y = positions[i * itemSize + 1]\n box.min[0] = Math.min(x, box.min[0])\n box.min[1] = Math.min(y, box.min[1])\n box.max[0] = Math.max(x, box.max[0])\n box.max[1] = Math.max(y, box.max[1])\n }\n}\n\nmodule.exports.computeBox = function (positions, output) {\n bounds(positions)\n output.min.set(box.min[0], box.min[1], 0)\n output.max.set(box.max[0], box.max[1], 0)\n}\n\nmodule.exports.computeSphere = function (positions, output) {\n bounds(positions)\n var minX = box.min[0]\n var minY = box.min[1]\n var maxX = box.max[0]\n var maxY = box.max[1]\n var width = maxX - minX\n var height = maxY - minY\n var length = Math.sqrt(width * width + height * height)\n output.center.set(minX + width / 2, minY + height / 2, 0)\n output.radius = length / 2\n}\n","module.exports.pages = function pages (glyphs) {\n var pages = new Float32Array(glyphs.length * 4 * 1)\n var i = 0\n glyphs.forEach(function (glyph) {\n var id = glyph.data.page || 0\n pages[i++] = id\n pages[i++] = id\n pages[i++] = id\n pages[i++] = id\n })\n return pages\n}\n\nmodule.exports.uvs = function uvs (glyphs, texWidth, texHeight, flipY) {\n var uvs = new Float32Array(glyphs.length * 4 * 2)\n var i = 0\n glyphs.forEach(function (glyph) {\n var bitmap = glyph.data\n var bw = (bitmap.x + bitmap.width)\n var bh = (bitmap.y + bitmap.height)\n\n // top left position\n var u0 = bitmap.x / texWidth\n var v1 = bitmap.y / texHeight\n var u1 = bw / texWidth\n var v0 = bh / texHeight\n\n if (flipY) {\n v1 = (texHeight - bitmap.y) / texHeight\n v0 = (texHeight - bh) / texHeight\n }\n\n // BL\n uvs[i++] = u0\n uvs[i++] = v1\n // TL\n uvs[i++] = u0\n uvs[i++] = v0\n // TR\n uvs[i++] = u1\n uvs[i++] = v0\n // BR\n uvs[i++] = u1\n uvs[i++] = v1\n })\n return uvs\n}\n\nmodule.exports.positions = function positions (glyphs) {\n var positions = new Float32Array(glyphs.length * 4 * 2)\n var i = 0\n glyphs.forEach(function (glyph) {\n var bitmap = glyph.data\n\n // bottom left position\n var x = glyph.position[0] + bitmap.xoffset\n var y = glyph.position[1] + bitmap.yoffset\n\n // quad size\n var w = bitmap.width\n var h = bitmap.height\n\n // BL\n positions[i++] = x\n positions[i++] = y\n // TL\n positions[i++] = x\n positions[i++] = y + h\n // TR\n positions[i++] = x + w\n positions[i++] = y + h\n // BR\n positions[i++] = x + w\n positions[i++] = y\n })\n return positions\n}\n","var flatten = require('flatten-vertex-data')\nvar warned = false;\n\nmodule.exports.attr = setAttribute\nmodule.exports.index = setIndex\n\nfunction setIndex (geometry, data, itemSize, dtype) {\n if (typeof itemSize !== 'number') itemSize = 1\n if (typeof dtype !== 'string') dtype = 'uint16'\n\n var isR69 = !geometry.index && typeof geometry.setIndex !== 'function'\n var attrib = isR69 ? geometry.getAttribute('index') : geometry.index\n var newAttrib = updateAttribute(attrib, data, itemSize, dtype)\n if (newAttrib) {\n if (isR69) geometry.addAttribute('index', newAttrib)\n else geometry.index = newAttrib\n }\n}\n\nfunction setAttribute (geometry, key, data, itemSize, dtype) {\n if (typeof itemSize !== 'number') itemSize = 3\n if (typeof dtype !== 'string') dtype = 'float32'\n if (Array.isArray(data) &&\n Array.isArray(data[0]) &&\n data[0].length !== itemSize) {\n throw new Error('Nested vertex array has unexpected size; expected ' +\n itemSize + ' but found ' + data[0].length)\n }\n\n var attrib = geometry.getAttribute(key)\n var newAttrib = updateAttribute(attrib, data, itemSize, dtype)\n geometry.setAttribute(key, newAttrib)\n}\n\nfunction updateAttribute (attrib, data, itemSize, dtype) {\n data = data || []\n\n // create a new array with desired type\n data = flatten(data, dtype)\n\n attrib = new THREE.BufferAttribute(data, itemSize);\n attrib.itemSize = itemSize;\n attrib.needsUpdate = true;\n\n return attrib\n}\n\n// Test whether the attribute needs to be re-created,\n// returns false if we can re-use it as-is.\nfunction rebuildAttribute (attrib, data, itemSize) {\n if (attrib.itemSize !== itemSize) return true\n if (!attrib.array) return true\n var attribLength = attrib.array.length\n if (Array.isArray(data) && Array.isArray(data[0])) {\n // [ [ x, y, z ] ]\n return attribLength !== data.length * itemSize\n } else {\n // [ x, y, z ]\n return attribLength !== data.length\n }\n return false\n}\n","var nextTick = require('process/browser.js').nextTick;\nvar apply = Function.prototype.apply;\nvar slice = Array.prototype.slice;\nvar immediateIds = {};\nvar nextImmediateId = 0;\n\n// DOM APIs, for completeness\n\nexports.setTimeout = function() {\n return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout);\n};\nexports.setInterval = function() {\n return new Timeout(apply.call(setInterval, window, arguments), clearInterval);\n};\nexports.clearTimeout =\nexports.clearInterval = function(timeout) { timeout.close(); };\n\nfunction Timeout(id, clearFn) {\n this._id = id;\n this._clearFn = clearFn;\n}\nTimeout.prototype.unref = Timeout.prototype.ref = function() {};\nTimeout.prototype.close = function() {\n this._clearFn.call(window, this._id);\n};\n\n// Does not start the time, just sets up the members needed.\nexports.enroll = function(item, msecs) {\n clearTimeout(item._idleTimeoutId);\n item._idleTimeout = msecs;\n};\n\nexports.unenroll = function(item) {\n clearTimeout(item._idleTimeoutId);\n item._idleTimeout = -1;\n};\n\nexports._unrefActive = exports.active = function(item) {\n clearTimeout(item._idleTimeoutId);\n\n var msecs = item._idleTimeout;\n if (msecs >= 0) {\n item._idleTimeoutId = setTimeout(function onTimeout() {\n if (item._onTimeout)\n item._onTimeout();\n }, msecs);\n }\n};\n\n// That's not how node.js implements it but the exposed api is the same.\nexports.setImmediate = typeof setImmediate === \"function\" ? setImmediate : function(fn) {\n var id = nextImmediateId++;\n var args = arguments.length < 2 ? false : slice.call(arguments, 1);\n\n immediateIds[id] = true;\n\n nextTick(function onNextTick() {\n if (immediateIds[id]) {\n // fn.call() is faster so we optimize for the common use-case\n // @see http://jsperf.com/call-apply-segu\n if (args) {\n fn.apply(null, args);\n } else {\n fn.call(null);\n }\n // Prevent ids from leaking\n exports.clearImmediate(id);\n }\n });\n\n return id;\n};\n\nexports.clearImmediate = typeof clearImmediate === \"function\" ? clearImmediate : function(id) {\n delete immediateIds[id];\n};","/**\n * @license\n * webvr-polyfill\n * Copyright (c) 2015-2017 Google\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * @license\n * cardboard-vr-display\n * Copyright (c) 2015-2017 Google\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * @license\n * webvr-polyfill-dpdb \n * Copyright (c) 2017 Google\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * @license\n * wglu-preserve-state\n * Copyright (c) 2016, Brandon Jones.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * @license\n * nosleep.js\n * Copyright (c) 2017, Rich Tibbett\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n\ttypeof define === 'function' && define.amd ? define(factory) :\n\t(global.WebVRPolyfill = factory());\n}(this, (function () { 'use strict';\n\nvar commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\n\n\n\nfunction unwrapExports (x) {\n\treturn x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;\n}\n\nfunction createCommonjsModule(fn, module) {\n\treturn module = { exports: {} }, fn(module, module.exports), module.exports;\n}\n\nvar isMobile = function isMobile() {\n return (/Android/i.test(navigator.userAgent) || /iPhone|iPad|iPod/i.test(navigator.userAgent)\n );\n};\nvar copyArray = function copyArray(source, dest) {\n for (var i = 0, n = source.length; i < n; i++) {\n dest[i] = source[i];\n }\n};\nvar extend = function extend(dest, src) {\n for (var key in src) {\n if (src.hasOwnProperty(key)) {\n dest[key] = src[key];\n }\n }\n return dest;\n};\n\nvar cardboardVrDisplay = createCommonjsModule(function (module, exports) {\n/**\n * @license\n * cardboard-vr-display\n * Copyright (c) 2015-2017 Google\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * @license\n * gl-preserve-state\n * Copyright (c) 2016, Brandon Jones.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n/**\n * @license\n * webvr-polyfill-dpdb\n * Copyright (c) 2015-2017 Google\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * @license\n * nosleep.js\n * Copyright (c) 2017, Rich Tibbett\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n(function (global, factory) {\n\tmodule.exports = factory();\n}(commonjsGlobal, (function () { var classCallCheck = function (instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n};\nvar createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();\nvar slicedToArray = function () {\n function sliceIterator(arr, i) {\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"]) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n return _arr;\n }\n return function (arr, i) {\n if (Array.isArray(arr)) {\n return arr;\n } else if (Symbol.iterator in Object(arr)) {\n return sliceIterator(arr, i);\n } else {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance\");\n }\n };\n}();\nvar MIN_TIMESTEP = 0.001;\nvar MAX_TIMESTEP = 1;\nvar dataUri = function dataUri(mimeType, svg) {\n return 'data:' + mimeType + ',' + encodeURIComponent(svg);\n};\nvar lerp = function lerp(a, b, t) {\n return a + (b - a) * t;\n};\nvar isIOS = function () {\n var isIOS = /iPad|iPhone|iPod/.test(navigator.platform);\n return function () {\n return isIOS;\n };\n}();\nvar isWebViewAndroid = function () {\n var isWebViewAndroid = navigator.userAgent.indexOf('Version') !== -1 && navigator.userAgent.indexOf('Android') !== -1 && navigator.userAgent.indexOf('Chrome') !== -1;\n return function () {\n return isWebViewAndroid;\n };\n}();\nvar isSafari = function () {\n var isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);\n return function () {\n return isSafari;\n };\n}();\nvar isFirefoxAndroid = function () {\n var isFirefoxAndroid = navigator.userAgent.indexOf('Firefox') !== -1 && navigator.userAgent.indexOf('Android') !== -1;\n return function () {\n return isFirefoxAndroid;\n };\n}();\nvar getChromeVersion = function () {\n var match = navigator.userAgent.match(/.*Chrome\\/([0-9]+)/);\n var value = match ? parseInt(match[1], 10) : null;\n return function () {\n return value;\n };\n}();\nvar isSafariWithoutDeviceMotion = function () {\n var value = false;\n value = isIOS() && isSafari() && navigator.userAgent.indexOf('13_4') !== -1;\n return function () {\n return value;\n };\n}();\nvar isChromeWithoutDeviceMotion = function () {\n var value = false;\n if (getChromeVersion() === 65) {\n var match = navigator.userAgent.match(/.*Chrome\\/([0-9\\.]*)/);\n if (match) {\n var _match$1$split = match[1].split('.'),\n _match$1$split2 = slicedToArray(_match$1$split, 4),\n major = _match$1$split2[0],\n minor = _match$1$split2[1],\n branch = _match$1$split2[2],\n build = _match$1$split2[3];\n value = parseInt(branch, 10) === 3325 && parseInt(build, 10) < 148;\n }\n }\n return function () {\n return value;\n };\n}();\nvar isR7 = function () {\n var isR7 = navigator.userAgent.indexOf('R7 Build') !== -1;\n return function () {\n return isR7;\n };\n}();\nvar isLandscapeMode = function isLandscapeMode() {\n var rtn = window.orientation == 90 || window.orientation == -90;\n return isR7() ? !rtn : rtn;\n};\nvar isTimestampDeltaValid = function isTimestampDeltaValid(timestampDeltaS) {\n if (isNaN(timestampDeltaS)) {\n return false;\n }\n if (timestampDeltaS <= MIN_TIMESTEP) {\n return false;\n }\n if (timestampDeltaS > MAX_TIMESTEP) {\n return false;\n }\n return true;\n};\nvar getScreenWidth = function getScreenWidth() {\n return Math.max(window.screen.width, window.screen.height) * window.devicePixelRatio;\n};\nvar getScreenHeight = function getScreenHeight() {\n return Math.min(window.screen.width, window.screen.height) * window.devicePixelRatio;\n};\nvar requestFullscreen = function requestFullscreen(element) {\n if (isWebViewAndroid()) {\n return false;\n }\n if (element.requestFullscreen) {\n element.requestFullscreen();\n } else if (element.webkitRequestFullscreen) {\n element.webkitRequestFullscreen();\n } else if (element.mozRequestFullScreen) {\n element.mozRequestFullScreen();\n } else if (element.msRequestFullscreen) {\n element.msRequestFullscreen();\n } else {\n return false;\n }\n return true;\n};\nvar exitFullscreen = function exitFullscreen() {\n if (document.exitFullscreen) {\n document.exitFullscreen();\n } else if (document.webkitExitFullscreen) {\n document.webkitExitFullscreen();\n } else if (document.mozCancelFullScreen) {\n document.mozCancelFullScreen();\n } else if (document.msExitFullscreen) {\n document.msExitFullscreen();\n } else {\n return false;\n }\n return true;\n};\nvar getFullscreenElement = function getFullscreenElement() {\n return document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement;\n};\nvar linkProgram = function linkProgram(gl, vertexSource, fragmentSource, attribLocationMap) {\n var vertexShader = gl.createShader(gl.VERTEX_SHADER);\n gl.shaderSource(vertexShader, vertexSource);\n gl.compileShader(vertexShader);\n var fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);\n gl.shaderSource(fragmentShader, fragmentSource);\n gl.compileShader(fragmentShader);\n var program = gl.createProgram();\n gl.attachShader(program, vertexShader);\n gl.attachShader(program, fragmentShader);\n for (var attribName in attribLocationMap) {\n gl.bindAttribLocation(program, attribLocationMap[attribName], attribName);\n }gl.linkProgram(program);\n gl.deleteShader(vertexShader);\n gl.deleteShader(fragmentShader);\n return program;\n};\nvar getProgramUniforms = function getProgramUniforms(gl, program) {\n var uniforms = {};\n var uniformCount = gl.getProgramParameter(program, gl.ACTIVE_UNIFORMS);\n var uniformName = '';\n for (var i = 0; i < uniformCount; i++) {\n var uniformInfo = gl.getActiveUniform(program, i);\n uniformName = uniformInfo.name.replace('[0]', '');\n uniforms[uniformName] = gl.getUniformLocation(program, uniformName);\n }\n return uniforms;\n};\nvar orthoMatrix = function orthoMatrix(out, left, right, bottom, top, near, far) {\n var lr = 1 / (left - right),\n bt = 1 / (bottom - top),\n nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 2 * nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = (far + near) * nf;\n out[15] = 1;\n return out;\n};\nvar isMobile = function isMobile() {\n var check = false;\n (function (a) {\n if (/(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i.test(a.substr(0, 4))) check = true;\n })(navigator.userAgent || navigator.vendor || window.opera);\n return check;\n};\nvar extend = function extend(dest, src) {\n for (var key in src) {\n if (src.hasOwnProperty(key)) {\n dest[key] = src[key];\n }\n }\n return dest;\n};\nvar safariCssSizeWorkaround = function safariCssSizeWorkaround(canvas) {\n if (isIOS()) {\n var width = canvas.style.width;\n var height = canvas.style.height;\n canvas.style.width = parseInt(width) + 1 + 'px';\n canvas.style.height = parseInt(height) + 'px';\n setTimeout(function () {\n canvas.style.width = width;\n canvas.style.height = height;\n }, 100);\n }\n window.canvas = canvas;\n};\nvar frameDataFromPose = function () {\n var piOver180 = Math.PI / 180.0;\n var rad45 = Math.PI * 0.25;\n function mat4_perspectiveFromFieldOfView(out, fov, near, far) {\n var upTan = Math.tan(fov ? fov.upDegrees * piOver180 : rad45),\n downTan = Math.tan(fov ? fov.downDegrees * piOver180 : rad45),\n leftTan = Math.tan(fov ? fov.leftDegrees * piOver180 : rad45),\n rightTan = Math.tan(fov ? fov.rightDegrees * piOver180 : rad45),\n xScale = 2.0 / (leftTan + rightTan),\n yScale = 2.0 / (upTan + downTan);\n out[0] = xScale;\n out[1] = 0.0;\n out[2] = 0.0;\n out[3] = 0.0;\n out[4] = 0.0;\n out[5] = yScale;\n out[6] = 0.0;\n out[7] = 0.0;\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\n out[9] = (upTan - downTan) * yScale * 0.5;\n out[10] = far / (near - far);\n out[11] = -1.0;\n out[12] = 0.0;\n out[13] = 0.0;\n out[14] = far * near / (near - far);\n out[15] = 0.0;\n return out;\n }\n function mat4_fromRotationTranslation(out, q, v) {\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3],\n x2 = x + x,\n y2 = y + y,\n z2 = z + z,\n xx = x * x2,\n xy = x * y2,\n xz = x * z2,\n yy = y * y2,\n yz = y * z2,\n zz = z * z2,\n wx = w * x2,\n wy = w * y2,\n wz = w * z2;\n out[0] = 1 - (yy + zz);\n out[1] = xy + wz;\n out[2] = xz - wy;\n out[3] = 0;\n out[4] = xy - wz;\n out[5] = 1 - (xx + zz);\n out[6] = yz + wx;\n out[7] = 0;\n out[8] = xz + wy;\n out[9] = yz - wx;\n out[10] = 1 - (xx + yy);\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n }\n function mat4_translate(out, a, v) {\n var x = v[0],\n y = v[1],\n z = v[2],\n a00,\n a01,\n a02,\n a03,\n a10,\n a11,\n a12,\n a13,\n a20,\n a21,\n a22,\n a23;\n if (a === out) {\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\n } else {\n a00 = a[0];a01 = a[1];a02 = a[2];a03 = a[3];\n a10 = a[4];a11 = a[5];a12 = a[6];a13 = a[7];\n a20 = a[8];a21 = a[9];a22 = a[10];a23 = a[11];\n out[0] = a00;out[1] = a01;out[2] = a02;out[3] = a03;\n out[4] = a10;out[5] = a11;out[6] = a12;out[7] = a13;\n out[8] = a20;out[9] = a21;out[10] = a22;out[11] = a23;\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\n }\n return out;\n }\n function mat4_invert(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3],\n a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7],\n a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11],\n a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15],\n b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32,\n det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n if (!det) {\n return null;\n }\n det = 1.0 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\n return out;\n }\n var defaultOrientation = new Float32Array([0, 0, 0, 1]);\n var defaultPosition = new Float32Array([0, 0, 0]);\n function updateEyeMatrices(projection, view, pose, fov, offset, vrDisplay) {\n mat4_perspectiveFromFieldOfView(projection, fov || null, vrDisplay.depthNear, vrDisplay.depthFar);\n var orientation = pose.orientation || defaultOrientation;\n var position = pose.position || defaultPosition;\n mat4_fromRotationTranslation(view, orientation, position);\n if (offset) mat4_translate(view, view, offset);\n mat4_invert(view, view);\n }\n return function (frameData, pose, vrDisplay) {\n if (!frameData || !pose) return false;\n frameData.pose = pose;\n frameData.timestamp = pose.timestamp;\n updateEyeMatrices(frameData.leftProjectionMatrix, frameData.leftViewMatrix, pose, vrDisplay._getFieldOfView(\"left\"), vrDisplay._getEyeOffset(\"left\"), vrDisplay);\n updateEyeMatrices(frameData.rightProjectionMatrix, frameData.rightViewMatrix, pose, vrDisplay._getFieldOfView(\"right\"), vrDisplay._getEyeOffset(\"right\"), vrDisplay);\n return true;\n };\n}();\nvar isInsideCrossOriginIFrame = function isInsideCrossOriginIFrame() {\n var isFramed = window.self !== window.top;\n var refOrigin = getOriginFromUrl(document.referrer);\n var thisOrigin = getOriginFromUrl(window.location.href);\n return isFramed && refOrigin !== thisOrigin;\n};\nvar getOriginFromUrl = function getOriginFromUrl(url) {\n var domainIdx;\n var protoSepIdx = url.indexOf(\"://\");\n if (protoSepIdx !== -1) {\n domainIdx = protoSepIdx + 3;\n } else {\n domainIdx = 0;\n }\n var domainEndIdx = url.indexOf('/', domainIdx);\n if (domainEndIdx === -1) {\n domainEndIdx = url.length;\n }\n return url.substring(0, domainEndIdx);\n};\nvar getQuaternionAngle = function getQuaternionAngle(quat) {\n if (quat.w > 1) {\n console.warn('getQuaternionAngle: w > 1');\n return 0;\n }\n var angle = 2 * Math.acos(quat.w);\n return angle;\n};\nvar warnOnce = function () {\n var observedWarnings = {};\n return function (key, message) {\n if (observedWarnings[key] === undefined) {\n console.warn('webvr-polyfill: ' + message);\n observedWarnings[key] = true;\n }\n };\n}();\nvar deprecateWarning = function deprecateWarning(deprecated, suggested) {\n var alternative = suggested ? 'Please use ' + suggested + ' instead.' : '';\n warnOnce(deprecated, deprecated + ' has been deprecated. ' + 'This may not work on native WebVR displays. ' + alternative);\n};\nfunction WGLUPreserveGLState(gl, bindings, callback) {\n if (!bindings) {\n callback(gl);\n return;\n }\n var boundValues = [];\n var activeTexture = null;\n for (var i = 0; i < bindings.length; ++i) {\n var binding = bindings[i];\n switch (binding) {\n case gl.TEXTURE_BINDING_2D:\n case gl.TEXTURE_BINDING_CUBE_MAP:\n var textureUnit = bindings[++i];\n if (textureUnit < gl.TEXTURE0 || textureUnit > gl.TEXTURE31) {\n console.error(\"TEXTURE_BINDING_2D or TEXTURE_BINDING_CUBE_MAP must be followed by a valid texture unit\");\n boundValues.push(null, null);\n break;\n }\n if (!activeTexture) {\n activeTexture = gl.getParameter(gl.ACTIVE_TEXTURE);\n }\n gl.activeTexture(textureUnit);\n boundValues.push(gl.getParameter(binding), null);\n break;\n case gl.ACTIVE_TEXTURE:\n activeTexture = gl.getParameter(gl.ACTIVE_TEXTURE);\n boundValues.push(null);\n break;\n default:\n boundValues.push(gl.getParameter(binding));\n break;\n }\n }\n callback(gl);\n for (var i = 0; i < bindings.length; ++i) {\n var binding = bindings[i];\n var boundValue = boundValues[i];\n switch (binding) {\n case gl.ACTIVE_TEXTURE:\n break;\n case gl.ARRAY_BUFFER_BINDING:\n gl.bindBuffer(gl.ARRAY_BUFFER, boundValue);\n break;\n case gl.COLOR_CLEAR_VALUE:\n gl.clearColor(boundValue[0], boundValue[1], boundValue[2], boundValue[3]);\n break;\n case gl.COLOR_WRITEMASK:\n gl.colorMask(boundValue[0], boundValue[1], boundValue[2], boundValue[3]);\n break;\n case gl.CURRENT_PROGRAM:\n gl.useProgram(boundValue);\n break;\n case gl.ELEMENT_ARRAY_BUFFER_BINDING:\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, boundValue);\n break;\n case gl.FRAMEBUFFER_BINDING:\n gl.bindFramebuffer(gl.FRAMEBUFFER, boundValue);\n break;\n case gl.RENDERBUFFER_BINDING:\n gl.bindRenderbuffer(gl.RENDERBUFFER, boundValue);\n break;\n case gl.TEXTURE_BINDING_2D:\n var textureUnit = bindings[++i];\n if (textureUnit < gl.TEXTURE0 || textureUnit > gl.TEXTURE31)\n break;\n gl.activeTexture(textureUnit);\n gl.bindTexture(gl.TEXTURE_2D, boundValue);\n break;\n case gl.TEXTURE_BINDING_CUBE_MAP:\n var textureUnit = bindings[++i];\n if (textureUnit < gl.TEXTURE0 || textureUnit > gl.TEXTURE31)\n break;\n gl.activeTexture(textureUnit);\n gl.bindTexture(gl.TEXTURE_CUBE_MAP, boundValue);\n break;\n case gl.VIEWPORT:\n gl.viewport(boundValue[0], boundValue[1], boundValue[2], boundValue[3]);\n break;\n case gl.BLEND:\n case gl.CULL_FACE:\n case gl.DEPTH_TEST:\n case gl.SCISSOR_TEST:\n case gl.STENCIL_TEST:\n if (boundValue) {\n gl.enable(binding);\n } else {\n gl.disable(binding);\n }\n break;\n default:\n console.log(\"No GL restore behavior for 0x\" + binding.toString(16));\n break;\n }\n if (activeTexture) {\n gl.activeTexture(activeTexture);\n }\n }\n}\nvar glPreserveState = WGLUPreserveGLState;\nvar distortionVS = ['attribute vec2 position;', 'attribute vec3 texCoord;', 'varying vec2 vTexCoord;', 'uniform vec4 viewportOffsetScale[2];', 'void main() {', ' vec4 viewport = viewportOffsetScale[int(texCoord.z)];', ' vTexCoord = (texCoord.xy * viewport.zw) + viewport.xy;', ' gl_Position = vec4( position, 1.0, 1.0 );', '}'].join('\\n');\nvar distortionFS = ['precision mediump float;', 'uniform sampler2D diffuse;', 'varying vec2 vTexCoord;', 'void main() {', ' gl_FragColor = texture2D(diffuse, vTexCoord);', '}'].join('\\n');\nfunction CardboardDistorter(gl, cardboardUI, bufferScale, dirtySubmitFrameBindings) {\n this.gl = gl;\n this.cardboardUI = cardboardUI;\n this.bufferScale = bufferScale;\n this.dirtySubmitFrameBindings = dirtySubmitFrameBindings;\n this.ctxAttribs = gl.getContextAttributes();\n this.instanceExt = gl.getExtension('ANGLE_instanced_arrays');\n this.meshWidth = 20;\n this.meshHeight = 20;\n this.bufferWidth = gl.drawingBufferWidth;\n this.bufferHeight = gl.drawingBufferHeight;\n this.realBindFramebuffer = gl.bindFramebuffer;\n this.realEnable = gl.enable;\n this.realDisable = gl.disable;\n this.realColorMask = gl.colorMask;\n this.realClearColor = gl.clearColor;\n this.realViewport = gl.viewport;\n if (!isIOS()) {\n this.realCanvasWidth = Object.getOwnPropertyDescriptor(gl.canvas.__proto__, 'width');\n this.realCanvasHeight = Object.getOwnPropertyDescriptor(gl.canvas.__proto__, 'height');\n }\n this.isPatched = false;\n this.lastBoundFramebuffer = null;\n this.cullFace = false;\n this.depthTest = false;\n this.blend = false;\n this.scissorTest = false;\n this.stencilTest = false;\n this.viewport = [0, 0, 0, 0];\n this.colorMask = [true, true, true, true];\n this.clearColor = [0, 0, 0, 0];\n this.attribs = {\n position: 0,\n texCoord: 1\n };\n this.program = linkProgram(gl, distortionVS, distortionFS, this.attribs);\n this.uniforms = getProgramUniforms(gl, this.program);\n this.viewportOffsetScale = new Float32Array(8);\n this.setTextureBounds();\n this.vertexBuffer = gl.createBuffer();\n this.indexBuffer = gl.createBuffer();\n this.indexCount = 0;\n this.renderTarget = gl.createTexture();\n this.framebuffer = gl.createFramebuffer();\n this.depthStencilBuffer = null;\n this.depthBuffer = null;\n this.stencilBuffer = null;\n if (this.ctxAttribs.depth && this.ctxAttribs.stencil) {\n this.depthStencilBuffer = gl.createRenderbuffer();\n } else if (this.ctxAttribs.depth) {\n this.depthBuffer = gl.createRenderbuffer();\n } else if (this.ctxAttribs.stencil) {\n this.stencilBuffer = gl.createRenderbuffer();\n }\n this.patch();\n this.onResize();\n}\nCardboardDistorter.prototype.destroy = function () {\n var gl = this.gl;\n this.unpatch();\n gl.deleteProgram(this.program);\n gl.deleteBuffer(this.vertexBuffer);\n gl.deleteBuffer(this.indexBuffer);\n gl.deleteTexture(this.renderTarget);\n gl.deleteFramebuffer(this.framebuffer);\n if (this.depthStencilBuffer) {\n gl.deleteRenderbuffer(this.depthStencilBuffer);\n }\n if (this.depthBuffer) {\n gl.deleteRenderbuffer(this.depthBuffer);\n }\n if (this.stencilBuffer) {\n gl.deleteRenderbuffer(this.stencilBuffer);\n }\n if (this.cardboardUI) {\n this.cardboardUI.destroy();\n }\n};\nCardboardDistorter.prototype.onResize = function () {\n var gl = this.gl;\n var self = this;\n var glState = [gl.RENDERBUFFER_BINDING, gl.TEXTURE_BINDING_2D, gl.TEXTURE0];\n glPreserveState(gl, glState, function (gl) {\n self.realBindFramebuffer.call(gl, gl.FRAMEBUFFER, null);\n if (self.scissorTest) {\n self.realDisable.call(gl, gl.SCISSOR_TEST);\n }\n self.realColorMask.call(gl, true, true, true, true);\n self.realViewport.call(gl, 0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight);\n self.realClearColor.call(gl, 0, 0, 0, 1);\n gl.clear(gl.COLOR_BUFFER_BIT);\n self.realBindFramebuffer.call(gl, gl.FRAMEBUFFER, self.framebuffer);\n gl.bindTexture(gl.TEXTURE_2D, self.renderTarget);\n gl.texImage2D(gl.TEXTURE_2D, 0, self.ctxAttribs.alpha ? gl.RGBA : gl.RGB, self.bufferWidth, self.bufferHeight, 0, self.ctxAttribs.alpha ? gl.RGBA : gl.RGB, gl.UNSIGNED_BYTE, null);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, self.renderTarget, 0);\n if (self.ctxAttribs.depth && self.ctxAttribs.stencil) {\n gl.bindRenderbuffer(gl.RENDERBUFFER, self.depthStencilBuffer);\n gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, self.bufferWidth, self.bufferHeight);\n gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, self.depthStencilBuffer);\n } else if (self.ctxAttribs.depth) {\n gl.bindRenderbuffer(gl.RENDERBUFFER, self.depthBuffer);\n gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_COMPONENT16, self.bufferWidth, self.bufferHeight);\n gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, self.depthBuffer);\n } else if (self.ctxAttribs.stencil) {\n gl.bindRenderbuffer(gl.RENDERBUFFER, self.stencilBuffer);\n gl.renderbufferStorage(gl.RENDERBUFFER, gl.STENCIL_INDEX8, self.bufferWidth, self.bufferHeight);\n gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.RENDERBUFFER, self.stencilBuffer);\n }\n if (!gl.checkFramebufferStatus(gl.FRAMEBUFFER) === gl.FRAMEBUFFER_COMPLETE) {\n console.error('Framebuffer incomplete!');\n }\n self.realBindFramebuffer.call(gl, gl.FRAMEBUFFER, self.lastBoundFramebuffer);\n if (self.scissorTest) {\n self.realEnable.call(gl, gl.SCISSOR_TEST);\n }\n self.realColorMask.apply(gl, self.colorMask);\n self.realViewport.apply(gl, self.viewport);\n self.realClearColor.apply(gl, self.clearColor);\n });\n if (this.cardboardUI) {\n this.cardboardUI.onResize();\n }\n};\nCardboardDistorter.prototype.patch = function () {\n if (this.isPatched) {\n return;\n }\n var self = this;\n var canvas = this.gl.canvas;\n var gl = this.gl;\n if (!isIOS()) {\n canvas.width = getScreenWidth() * this.bufferScale;\n canvas.height = getScreenHeight() * this.bufferScale;\n Object.defineProperty(canvas, 'width', {\n configurable: true,\n enumerable: true,\n get: function get() {\n return self.bufferWidth;\n },\n set: function set(value) {\n self.bufferWidth = value;\n self.realCanvasWidth.set.call(canvas, value);\n self.onResize();\n }\n });\n Object.defineProperty(canvas, 'height', {\n configurable: true,\n enumerable: true,\n get: function get() {\n return self.bufferHeight;\n },\n set: function set(value) {\n self.bufferHeight = value;\n self.realCanvasHeight.set.call(canvas, value);\n self.onResize();\n }\n });\n }\n this.lastBoundFramebuffer = gl.getParameter(gl.FRAMEBUFFER_BINDING);\n if (this.lastBoundFramebuffer == null) {\n this.lastBoundFramebuffer = this.framebuffer;\n this.gl.bindFramebuffer(gl.FRAMEBUFFER, this.framebuffer);\n }\n this.gl.bindFramebuffer = function (target, framebuffer) {\n self.lastBoundFramebuffer = framebuffer ? framebuffer : self.framebuffer;\n self.realBindFramebuffer.call(gl, target, self.lastBoundFramebuffer);\n };\n this.cullFace = gl.getParameter(gl.CULL_FACE);\n this.depthTest = gl.getParameter(gl.DEPTH_TEST);\n this.blend = gl.getParameter(gl.BLEND);\n this.scissorTest = gl.getParameter(gl.SCISSOR_TEST);\n this.stencilTest = gl.getParameter(gl.STENCIL_TEST);\n gl.enable = function (pname) {\n switch (pname) {\n case gl.CULL_FACE:\n self.cullFace = true;break;\n case gl.DEPTH_TEST:\n self.depthTest = true;break;\n case gl.BLEND:\n self.blend = true;break;\n case gl.SCISSOR_TEST:\n self.scissorTest = true;break;\n case gl.STENCIL_TEST:\n self.stencilTest = true;break;\n }\n self.realEnable.call(gl, pname);\n };\n gl.disable = function (pname) {\n switch (pname) {\n case gl.CULL_FACE:\n self.cullFace = false;break;\n case gl.DEPTH_TEST:\n self.depthTest = false;break;\n case gl.BLEND:\n self.blend = false;break;\n case gl.SCISSOR_TEST:\n self.scissorTest = false;break;\n case gl.STENCIL_TEST:\n self.stencilTest = false;break;\n }\n self.realDisable.call(gl, pname);\n };\n this.colorMask = gl.getParameter(gl.COLOR_WRITEMASK);\n gl.colorMask = function (r, g, b, a) {\n self.colorMask[0] = r;\n self.colorMask[1] = g;\n self.colorMask[2] = b;\n self.colorMask[3] = a;\n self.realColorMask.call(gl, r, g, b, a);\n };\n this.clearColor = gl.getParameter(gl.COLOR_CLEAR_VALUE);\n gl.clearColor = function (r, g, b, a) {\n self.clearColor[0] = r;\n self.clearColor[1] = g;\n self.clearColor[2] = b;\n self.clearColor[3] = a;\n self.realClearColor.call(gl, r, g, b, a);\n };\n this.viewport = gl.getParameter(gl.VIEWPORT);\n gl.viewport = function (x, y, w, h) {\n self.viewport[0] = x;\n self.viewport[1] = y;\n self.viewport[2] = w;\n self.viewport[3] = h;\n self.realViewport.call(gl, x, y, w, h);\n };\n this.isPatched = true;\n safariCssSizeWorkaround(canvas);\n};\nCardboardDistorter.prototype.unpatch = function () {\n if (!this.isPatched) {\n return;\n }\n var gl = this.gl;\n var canvas = this.gl.canvas;\n if (!isIOS()) {\n Object.defineProperty(canvas, 'width', this.realCanvasWidth);\n Object.defineProperty(canvas, 'height', this.realCanvasHeight);\n }\n canvas.width = this.bufferWidth;\n canvas.height = this.bufferHeight;\n gl.bindFramebuffer = this.realBindFramebuffer;\n gl.enable = this.realEnable;\n gl.disable = this.realDisable;\n gl.colorMask = this.realColorMask;\n gl.clearColor = this.realClearColor;\n gl.viewport = this.realViewport;\n if (this.lastBoundFramebuffer == this.framebuffer) {\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n }\n this.isPatched = false;\n setTimeout(function () {\n safariCssSizeWorkaround(canvas);\n }, 1);\n};\nCardboardDistorter.prototype.setTextureBounds = function (leftBounds, rightBounds) {\n if (!leftBounds) {\n leftBounds = [0, 0, 0.5, 1];\n }\n if (!rightBounds) {\n rightBounds = [0.5, 0, 0.5, 1];\n }\n this.viewportOffsetScale[0] = leftBounds[0];\n this.viewportOffsetScale[1] = leftBounds[1];\n this.viewportOffsetScale[2] = leftBounds[2];\n this.viewportOffsetScale[3] = leftBounds[3];\n this.viewportOffsetScale[4] = rightBounds[0];\n this.viewportOffsetScale[5] = rightBounds[1];\n this.viewportOffsetScale[6] = rightBounds[2];\n this.viewportOffsetScale[7] = rightBounds[3];\n};\nCardboardDistorter.prototype.submitFrame = function () {\n var gl = this.gl;\n var self = this;\n var glState = [];\n if (!this.dirtySubmitFrameBindings) {\n glState.push(gl.CURRENT_PROGRAM, gl.ARRAY_BUFFER_BINDING, gl.ELEMENT_ARRAY_BUFFER_BINDING, gl.TEXTURE_BINDING_2D, gl.TEXTURE0);\n }\n glPreserveState(gl, glState, function (gl) {\n self.realBindFramebuffer.call(gl, gl.FRAMEBUFFER, null);\n var positionDivisor = 0;\n var texCoordDivisor = 0;\n if (self.instanceExt) {\n positionDivisor = gl.getVertexAttrib(self.attribs.position, self.instanceExt.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE);\n texCoordDivisor = gl.getVertexAttrib(self.attribs.texCoord, self.instanceExt.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE);\n }\n if (self.cullFace) {\n self.realDisable.call(gl, gl.CULL_FACE);\n }\n if (self.depthTest) {\n self.realDisable.call(gl, gl.DEPTH_TEST);\n }\n if (self.blend) {\n self.realDisable.call(gl, gl.BLEND);\n }\n if (self.scissorTest) {\n self.realDisable.call(gl, gl.SCISSOR_TEST);\n }\n if (self.stencilTest) {\n self.realDisable.call(gl, gl.STENCIL_TEST);\n }\n self.realColorMask.call(gl, true, true, true, true);\n self.realViewport.call(gl, 0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight);\n if (self.ctxAttribs.alpha || isIOS()) {\n self.realClearColor.call(gl, 0, 0, 0, 1);\n gl.clear(gl.COLOR_BUFFER_BIT);\n }\n gl.useProgram(self.program);\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, self.indexBuffer);\n gl.bindBuffer(gl.ARRAY_BUFFER, self.vertexBuffer);\n gl.enableVertexAttribArray(self.attribs.position);\n gl.enableVertexAttribArray(self.attribs.texCoord);\n gl.vertexAttribPointer(self.attribs.position, 2, gl.FLOAT, false, 20, 0);\n gl.vertexAttribPointer(self.attribs.texCoord, 3, gl.FLOAT, false, 20, 8);\n if (self.instanceExt) {\n if (positionDivisor != 0) {\n self.instanceExt.vertexAttribDivisorANGLE(self.attribs.position, 0);\n }\n if (texCoordDivisor != 0) {\n self.instanceExt.vertexAttribDivisorANGLE(self.attribs.texCoord, 0);\n }\n }\n gl.activeTexture(gl.TEXTURE0);\n gl.uniform1i(self.uniforms.diffuse, 0);\n gl.bindTexture(gl.TEXTURE_2D, self.renderTarget);\n gl.uniform4fv(self.uniforms.viewportOffsetScale, self.viewportOffsetScale);\n gl.drawElements(gl.TRIANGLES, self.indexCount, gl.UNSIGNED_SHORT, 0);\n if (self.cardboardUI) {\n self.cardboardUI.renderNoState();\n }\n self.realBindFramebuffer.call(self.gl, gl.FRAMEBUFFER, self.framebuffer);\n if (!self.ctxAttribs.preserveDrawingBuffer) {\n self.realClearColor.call(gl, 0, 0, 0, 0);\n gl.clear(gl.COLOR_BUFFER_BIT);\n }\n if (!self.dirtySubmitFrameBindings) {\n self.realBindFramebuffer.call(gl, gl.FRAMEBUFFER, self.lastBoundFramebuffer);\n }\n if (self.cullFace) {\n self.realEnable.call(gl, gl.CULL_FACE);\n }\n if (self.depthTest) {\n self.realEnable.call(gl, gl.DEPTH_TEST);\n }\n if (self.blend) {\n self.realEnable.call(gl, gl.BLEND);\n }\n if (self.scissorTest) {\n self.realEnable.call(gl, gl.SCISSOR_TEST);\n }\n if (self.stencilTest) {\n self.realEnable.call(gl, gl.STENCIL_TEST);\n }\n self.realColorMask.apply(gl, self.colorMask);\n self.realViewport.apply(gl, self.viewport);\n if (self.ctxAttribs.alpha || !self.ctxAttribs.preserveDrawingBuffer) {\n self.realClearColor.apply(gl, self.clearColor);\n }\n if (self.instanceExt) {\n if (positionDivisor != 0) {\n self.instanceExt.vertexAttribDivisorANGLE(self.attribs.position, positionDivisor);\n }\n if (texCoordDivisor != 0) {\n self.instanceExt.vertexAttribDivisorANGLE(self.attribs.texCoord, texCoordDivisor);\n }\n }\n });\n if (isIOS()) {\n var canvas = gl.canvas;\n if (canvas.width != self.bufferWidth || canvas.height != self.bufferHeight) {\n self.bufferWidth = canvas.width;\n self.bufferHeight = canvas.height;\n self.onResize();\n }\n }\n};\nCardboardDistorter.prototype.updateDeviceInfo = function (deviceInfo) {\n var gl = this.gl;\n var self = this;\n var glState = [gl.ARRAY_BUFFER_BINDING, gl.ELEMENT_ARRAY_BUFFER_BINDING];\n glPreserveState(gl, glState, function (gl) {\n var vertices = self.computeMeshVertices_(self.meshWidth, self.meshHeight, deviceInfo);\n gl.bindBuffer(gl.ARRAY_BUFFER, self.vertexBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW);\n if (!self.indexCount) {\n var indices = self.computeMeshIndices_(self.meshWidth, self.meshHeight);\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, self.indexBuffer);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, indices, gl.STATIC_DRAW);\n self.indexCount = indices.length;\n }\n });\n};\nCardboardDistorter.prototype.computeMeshVertices_ = function (width, height, deviceInfo) {\n var vertices = new Float32Array(2 * width * height * 5);\n var lensFrustum = deviceInfo.getLeftEyeVisibleTanAngles();\n var noLensFrustum = deviceInfo.getLeftEyeNoLensTanAngles();\n var viewport = deviceInfo.getLeftEyeVisibleScreenRect(noLensFrustum);\n var vidx = 0;\n for (var e = 0; e < 2; e++) {\n for (var j = 0; j < height; j++) {\n for (var i = 0; i < width; i++, vidx++) {\n var u = i / (width - 1);\n var v = j / (height - 1);\n var s = u;\n var t = v;\n var x = lerp(lensFrustum[0], lensFrustum[2], u);\n var y = lerp(lensFrustum[3], lensFrustum[1], v);\n var d = Math.sqrt(x * x + y * y);\n var r = deviceInfo.distortion.distortInverse(d);\n var p = x * r / d;\n var q = y * r / d;\n u = (p - noLensFrustum[0]) / (noLensFrustum[2] - noLensFrustum[0]);\n v = (q - noLensFrustum[3]) / (noLensFrustum[1] - noLensFrustum[3]);\n u = (viewport.x + u * viewport.width - 0.5) * 2.0;\n v = (viewport.y + v * viewport.height - 0.5) * 2.0;\n vertices[vidx * 5 + 0] = u;\n vertices[vidx * 5 + 1] = v;\n vertices[vidx * 5 + 2] = s;\n vertices[vidx * 5 + 3] = t;\n vertices[vidx * 5 + 4] = e;\n }\n }\n var w = lensFrustum[2] - lensFrustum[0];\n lensFrustum[0] = -(w + lensFrustum[0]);\n lensFrustum[2] = w - lensFrustum[2];\n w = noLensFrustum[2] - noLensFrustum[0];\n noLensFrustum[0] = -(w + noLensFrustum[0]);\n noLensFrustum[2] = w - noLensFrustum[2];\n viewport.x = 1 - (viewport.x + viewport.width);\n }\n return vertices;\n};\nCardboardDistorter.prototype.computeMeshIndices_ = function (width, height) {\n var indices = new Uint16Array(2 * (width - 1) * (height - 1) * 6);\n var halfwidth = width / 2;\n var halfheight = height / 2;\n var vidx = 0;\n var iidx = 0;\n for (var e = 0; e < 2; e++) {\n for (var j = 0; j < height; j++) {\n for (var i = 0; i < width; i++, vidx++) {\n if (i == 0 || j == 0) continue;\n if (i <= halfwidth == j <= halfheight) {\n indices[iidx++] = vidx;\n indices[iidx++] = vidx - width - 1;\n indices[iidx++] = vidx - width;\n indices[iidx++] = vidx - width - 1;\n indices[iidx++] = vidx;\n indices[iidx++] = vidx - 1;\n } else {\n indices[iidx++] = vidx - 1;\n indices[iidx++] = vidx - width;\n indices[iidx++] = vidx;\n indices[iidx++] = vidx - width;\n indices[iidx++] = vidx - 1;\n indices[iidx++] = vidx - width - 1;\n }\n }\n }\n }\n return indices;\n};\nCardboardDistorter.prototype.getOwnPropertyDescriptor_ = function (proto, attrName) {\n var descriptor = Object.getOwnPropertyDescriptor(proto, attrName);\n if (descriptor.get === undefined || descriptor.set === undefined) {\n descriptor.configurable = true;\n descriptor.enumerable = true;\n descriptor.get = function () {\n return this.getAttribute(attrName);\n };\n descriptor.set = function (val) {\n this.setAttribute(attrName, val);\n };\n }\n return descriptor;\n};\nvar uiVS = ['attribute vec2 position;', 'uniform mat4 projectionMat;', 'void main() {', ' gl_Position = projectionMat * vec4( position, -1.0, 1.0 );', '}'].join('\\n');\nvar uiFS = ['precision mediump float;', 'uniform vec4 color;', 'void main() {', ' gl_FragColor = color;', '}'].join('\\n');\nvar DEG2RAD = Math.PI / 180.0;\nvar kAnglePerGearSection = 60;\nvar kOuterRimEndAngle = 12;\nvar kInnerRimBeginAngle = 20;\nvar kOuterRadius = 1;\nvar kMiddleRadius = 0.75;\nvar kInnerRadius = 0.3125;\nvar kCenterLineThicknessDp = 4;\nvar kButtonWidthDp = 28;\nvar kTouchSlopFactor = 1.5;\nfunction CardboardUI(gl) {\n this.gl = gl;\n this.attribs = {\n position: 0\n };\n this.program = linkProgram(gl, uiVS, uiFS, this.attribs);\n this.uniforms = getProgramUniforms(gl, this.program);\n this.vertexBuffer = gl.createBuffer();\n this.gearOffset = 0;\n this.gearVertexCount = 0;\n this.arrowOffset = 0;\n this.arrowVertexCount = 0;\n this.projMat = new Float32Array(16);\n this.listener = null;\n this.onResize();\n}\nCardboardUI.prototype.destroy = function () {\n var gl = this.gl;\n if (this.listener) {\n gl.canvas.removeEventListener('click', this.listener, false);\n }\n gl.deleteProgram(this.program);\n gl.deleteBuffer(this.vertexBuffer);\n};\nCardboardUI.prototype.listen = function (optionsCallback, backCallback) {\n var canvas = this.gl.canvas;\n this.listener = function (event) {\n var midline = canvas.clientWidth / 2;\n var buttonSize = kButtonWidthDp * kTouchSlopFactor;\n if (event.clientX > midline - buttonSize && event.clientX < midline + buttonSize && event.clientY > canvas.clientHeight - buttonSize) {\n optionsCallback(event);\n }\n else if (event.clientX < buttonSize && event.clientY < buttonSize) {\n backCallback(event);\n }\n };\n canvas.addEventListener('click', this.listener, false);\n};\nCardboardUI.prototype.onResize = function () {\n var gl = this.gl;\n var self = this;\n var glState = [gl.ARRAY_BUFFER_BINDING];\n glPreserveState(gl, glState, function (gl) {\n var vertices = [];\n var midline = gl.drawingBufferWidth / 2;\n var physicalPixels = Math.max(screen.width, screen.height) * window.devicePixelRatio;\n var scalingRatio = gl.drawingBufferWidth / physicalPixels;\n var dps = scalingRatio * window.devicePixelRatio;\n var lineWidth = kCenterLineThicknessDp * dps / 2;\n var buttonSize = kButtonWidthDp * kTouchSlopFactor * dps;\n var buttonScale = kButtonWidthDp * dps / 2;\n var buttonBorder = (kButtonWidthDp * kTouchSlopFactor - kButtonWidthDp) * dps;\n vertices.push(midline - lineWidth, buttonSize);\n vertices.push(midline - lineWidth, gl.drawingBufferHeight);\n vertices.push(midline + lineWidth, buttonSize);\n vertices.push(midline + lineWidth, gl.drawingBufferHeight);\n self.gearOffset = vertices.length / 2;\n function addGearSegment(theta, r) {\n var angle = (90 - theta) * DEG2RAD;\n var x = Math.cos(angle);\n var y = Math.sin(angle);\n vertices.push(kInnerRadius * x * buttonScale + midline, kInnerRadius * y * buttonScale + buttonScale);\n vertices.push(r * x * buttonScale + midline, r * y * buttonScale + buttonScale);\n }\n for (var i = 0; i <= 6; i++) {\n var segmentTheta = i * kAnglePerGearSection;\n addGearSegment(segmentTheta, kOuterRadius);\n addGearSegment(segmentTheta + kOuterRimEndAngle, kOuterRadius);\n addGearSegment(segmentTheta + kInnerRimBeginAngle, kMiddleRadius);\n addGearSegment(segmentTheta + (kAnglePerGearSection - kInnerRimBeginAngle), kMiddleRadius);\n addGearSegment(segmentTheta + (kAnglePerGearSection - kOuterRimEndAngle), kOuterRadius);\n }\n self.gearVertexCount = vertices.length / 2 - self.gearOffset;\n self.arrowOffset = vertices.length / 2;\n function addArrowVertex(x, y) {\n vertices.push(buttonBorder + x, gl.drawingBufferHeight - buttonBorder - y);\n }\n var angledLineWidth = lineWidth / Math.sin(45 * DEG2RAD);\n addArrowVertex(0, buttonScale);\n addArrowVertex(buttonScale, 0);\n addArrowVertex(buttonScale + angledLineWidth, angledLineWidth);\n addArrowVertex(angledLineWidth, buttonScale + angledLineWidth);\n addArrowVertex(angledLineWidth, buttonScale - angledLineWidth);\n addArrowVertex(0, buttonScale);\n addArrowVertex(buttonScale, buttonScale * 2);\n addArrowVertex(buttonScale + angledLineWidth, buttonScale * 2 - angledLineWidth);\n addArrowVertex(angledLineWidth, buttonScale - angledLineWidth);\n addArrowVertex(0, buttonScale);\n addArrowVertex(angledLineWidth, buttonScale - lineWidth);\n addArrowVertex(kButtonWidthDp * dps, buttonScale - lineWidth);\n addArrowVertex(angledLineWidth, buttonScale + lineWidth);\n addArrowVertex(kButtonWidthDp * dps, buttonScale + lineWidth);\n self.arrowVertexCount = vertices.length / 2 - self.arrowOffset;\n gl.bindBuffer(gl.ARRAY_BUFFER, self.vertexBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertices), gl.STATIC_DRAW);\n });\n};\nCardboardUI.prototype.render = function () {\n var gl = this.gl;\n var self = this;\n var glState = [gl.CULL_FACE, gl.DEPTH_TEST, gl.BLEND, gl.SCISSOR_TEST, gl.STENCIL_TEST, gl.COLOR_WRITEMASK, gl.VIEWPORT, gl.CURRENT_PROGRAM, gl.ARRAY_BUFFER_BINDING];\n glPreserveState(gl, glState, function (gl) {\n gl.disable(gl.CULL_FACE);\n gl.disable(gl.DEPTH_TEST);\n gl.disable(gl.BLEND);\n gl.disable(gl.SCISSOR_TEST);\n gl.disable(gl.STENCIL_TEST);\n gl.colorMask(true, true, true, true);\n gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight);\n self.renderNoState();\n });\n};\nCardboardUI.prototype.renderNoState = function () {\n var gl = this.gl;\n gl.useProgram(this.program);\n gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);\n gl.enableVertexAttribArray(this.attribs.position);\n gl.vertexAttribPointer(this.attribs.position, 2, gl.FLOAT, false, 8, 0);\n gl.uniform4f(this.uniforms.color, 1.0, 1.0, 1.0, 1.0);\n orthoMatrix(this.projMat, 0, gl.drawingBufferWidth, 0, gl.drawingBufferHeight, 0.1, 1024.0);\n gl.uniformMatrix4fv(this.uniforms.projectionMat, false, this.projMat);\n gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);\n gl.drawArrays(gl.TRIANGLE_STRIP, this.gearOffset, this.gearVertexCount);\n gl.drawArrays(gl.TRIANGLE_STRIP, this.arrowOffset, this.arrowVertexCount);\n};\nfunction Distortion(coefficients) {\n this.coefficients = coefficients;\n}\nDistortion.prototype.distortInverse = function (radius) {\n var r0 = 0;\n var r1 = 1;\n var dr0 = radius - this.distort(r0);\n while (Math.abs(r1 - r0) > 0.0001 ) {\n var dr1 = radius - this.distort(r1);\n var r2 = r1 - dr1 * ((r1 - r0) / (dr1 - dr0));\n r0 = r1;\n r1 = r2;\n dr0 = dr1;\n }\n return r1;\n};\nDistortion.prototype.distort = function (radius) {\n var r2 = radius * radius;\n var ret = 0;\n for (var i = 0; i < this.coefficients.length; i++) {\n ret = r2 * (ret + this.coefficients[i]);\n }\n return (ret + 1) * radius;\n};\nvar degToRad = Math.PI / 180;\nvar radToDeg = 180 / Math.PI;\nvar Vector3 = function Vector3(x, y, z) {\n this.x = x || 0;\n this.y = y || 0;\n this.z = z || 0;\n};\nVector3.prototype = {\n constructor: Vector3,\n set: function set(x, y, z) {\n this.x = x;\n this.y = y;\n this.z = z;\n return this;\n },\n copy: function copy(v) {\n this.x = v.x;\n this.y = v.y;\n this.z = v.z;\n return this;\n },\n length: function length() {\n return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);\n },\n normalize: function normalize() {\n var scalar = this.length();\n if (scalar !== 0) {\n var invScalar = 1 / scalar;\n this.multiplyScalar(invScalar);\n } else {\n this.x = 0;\n this.y = 0;\n this.z = 0;\n }\n return this;\n },\n multiplyScalar: function multiplyScalar(scalar) {\n this.x *= scalar;\n this.y *= scalar;\n this.z *= scalar;\n },\n applyQuaternion: function applyQuaternion(q) {\n var x = this.x;\n var y = this.y;\n var z = this.z;\n var qx = q.x;\n var qy = q.y;\n var qz = q.z;\n var qw = q.w;\n var ix = qw * x + qy * z - qz * y;\n var iy = qw * y + qz * x - qx * z;\n var iz = qw * z + qx * y - qy * x;\n var iw = -qx * x - qy * y - qz * z;\n this.x = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n this.y = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n this.z = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n return this;\n },\n dot: function dot(v) {\n return this.x * v.x + this.y * v.y + this.z * v.z;\n },\n crossVectors: function crossVectors(a, b) {\n var ax = a.x,\n ay = a.y,\n az = a.z;\n var bx = b.x,\n by = b.y,\n bz = b.z;\n this.x = ay * bz - az * by;\n this.y = az * bx - ax * bz;\n this.z = ax * by - ay * bx;\n return this;\n }\n};\nvar Quaternion = function Quaternion(x, y, z, w) {\n this.x = x || 0;\n this.y = y || 0;\n this.z = z || 0;\n this.w = w !== undefined ? w : 1;\n};\nQuaternion.prototype = {\n constructor: Quaternion,\n set: function set(x, y, z, w) {\n this.x = x;\n this.y = y;\n this.z = z;\n this.w = w;\n return this;\n },\n copy: function copy(quaternion) {\n this.x = quaternion.x;\n this.y = quaternion.y;\n this.z = quaternion.z;\n this.w = quaternion.w;\n return this;\n },\n setFromEulerXYZ: function setFromEulerXYZ(x, y, z) {\n var c1 = Math.cos(x / 2);\n var c2 = Math.cos(y / 2);\n var c3 = Math.cos(z / 2);\n var s1 = Math.sin(x / 2);\n var s2 = Math.sin(y / 2);\n var s3 = Math.sin(z / 2);\n this.x = s1 * c2 * c3 + c1 * s2 * s3;\n this.y = c1 * s2 * c3 - s1 * c2 * s3;\n this.z = c1 * c2 * s3 + s1 * s2 * c3;\n this.w = c1 * c2 * c3 - s1 * s2 * s3;\n return this;\n },\n setFromEulerYXZ: function setFromEulerYXZ(x, y, z) {\n var c1 = Math.cos(x / 2);\n var c2 = Math.cos(y / 2);\n var c3 = Math.cos(z / 2);\n var s1 = Math.sin(x / 2);\n var s2 = Math.sin(y / 2);\n var s3 = Math.sin(z / 2);\n this.x = s1 * c2 * c3 + c1 * s2 * s3;\n this.y = c1 * s2 * c3 - s1 * c2 * s3;\n this.z = c1 * c2 * s3 - s1 * s2 * c3;\n this.w = c1 * c2 * c3 + s1 * s2 * s3;\n return this;\n },\n setFromAxisAngle: function setFromAxisAngle(axis, angle) {\n var halfAngle = angle / 2,\n s = Math.sin(halfAngle);\n this.x = axis.x * s;\n this.y = axis.y * s;\n this.z = axis.z * s;\n this.w = Math.cos(halfAngle);\n return this;\n },\n multiply: function multiply(q) {\n return this.multiplyQuaternions(this, q);\n },\n multiplyQuaternions: function multiplyQuaternions(a, b) {\n var qax = a.x,\n qay = a.y,\n qaz = a.z,\n qaw = a.w;\n var qbx = b.x,\n qby = b.y,\n qbz = b.z,\n qbw = b.w;\n this.x = qax * qbw + qaw * qbx + qay * qbz - qaz * qby;\n this.y = qay * qbw + qaw * qby + qaz * qbx - qax * qbz;\n this.z = qaz * qbw + qaw * qbz + qax * qby - qay * qbx;\n this.w = qaw * qbw - qax * qbx - qay * qby - qaz * qbz;\n return this;\n },\n inverse: function inverse() {\n this.x *= -1;\n this.y *= -1;\n this.z *= -1;\n this.normalize();\n return this;\n },\n normalize: function normalize() {\n var l = Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w);\n if (l === 0) {\n this.x = 0;\n this.y = 0;\n this.z = 0;\n this.w = 1;\n } else {\n l = 1 / l;\n this.x = this.x * l;\n this.y = this.y * l;\n this.z = this.z * l;\n this.w = this.w * l;\n }\n return this;\n },\n slerp: function slerp(qb, t) {\n if (t === 0) return this;\n if (t === 1) return this.copy(qb);\n var x = this.x,\n y = this.y,\n z = this.z,\n w = this.w;\n var cosHalfTheta = w * qb.w + x * qb.x + y * qb.y + z * qb.z;\n if (cosHalfTheta < 0) {\n this.w = -qb.w;\n this.x = -qb.x;\n this.y = -qb.y;\n this.z = -qb.z;\n cosHalfTheta = -cosHalfTheta;\n } else {\n this.copy(qb);\n }\n if (cosHalfTheta >= 1.0) {\n this.w = w;\n this.x = x;\n this.y = y;\n this.z = z;\n return this;\n }\n var halfTheta = Math.acos(cosHalfTheta);\n var sinHalfTheta = Math.sqrt(1.0 - cosHalfTheta * cosHalfTheta);\n if (Math.abs(sinHalfTheta) < 0.001) {\n this.w = 0.5 * (w + this.w);\n this.x = 0.5 * (x + this.x);\n this.y = 0.5 * (y + this.y);\n this.z = 0.5 * (z + this.z);\n return this;\n }\n var ratioA = Math.sin((1 - t) * halfTheta) / sinHalfTheta,\n ratioB = Math.sin(t * halfTheta) / sinHalfTheta;\n this.w = w * ratioA + this.w * ratioB;\n this.x = x * ratioA + this.x * ratioB;\n this.y = y * ratioA + this.y * ratioB;\n this.z = z * ratioA + this.z * ratioB;\n return this;\n },\n setFromUnitVectors: function () {\n var v1, r;\n var EPS = 0.000001;\n return function (vFrom, vTo) {\n if (v1 === undefined) v1 = new Vector3();\n r = vFrom.dot(vTo) + 1;\n if (r < EPS) {\n r = 0;\n if (Math.abs(vFrom.x) > Math.abs(vFrom.z)) {\n v1.set(-vFrom.y, vFrom.x, 0);\n } else {\n v1.set(0, -vFrom.z, vFrom.y);\n }\n } else {\n v1.crossVectors(vFrom, vTo);\n }\n this.x = v1.x;\n this.y = v1.y;\n this.z = v1.z;\n this.w = r;\n this.normalize();\n return this;\n };\n }()\n};\nfunction Device(params) {\n this.width = params.width || getScreenWidth();\n this.height = params.height || getScreenHeight();\n this.widthMeters = params.widthMeters;\n this.heightMeters = params.heightMeters;\n this.bevelMeters = params.bevelMeters;\n}\nvar DEFAULT_ANDROID = new Device({\n widthMeters: 0.110,\n heightMeters: 0.062,\n bevelMeters: 0.004\n});\nvar DEFAULT_IOS = new Device({\n widthMeters: 0.1038,\n heightMeters: 0.0584,\n bevelMeters: 0.004\n});\nvar Viewers = {\n CardboardV1: new CardboardViewer({\n id: 'CardboardV1',\n label: 'Cardboard I/O 2014',\n fov: 40,\n interLensDistance: 0.060,\n baselineLensDistance: 0.035,\n screenLensDistance: 0.042,\n distortionCoefficients: [0.441, 0.156],\n inverseCoefficients: [-0.4410035, 0.42756155, -0.4804439, 0.5460139, -0.58821183, 0.5733938, -0.48303202, 0.33299083, -0.17573841, 0.0651772, -0.01488963, 0.001559834]\n }),\n CardboardV2: new CardboardViewer({\n id: 'CardboardV2',\n label: 'Cardboard I/O 2015',\n fov: 60,\n interLensDistance: 0.064,\n baselineLensDistance: 0.035,\n screenLensDistance: 0.039,\n distortionCoefficients: [0.34, 0.55],\n inverseCoefficients: [-0.33836704, -0.18162185, 0.862655, -1.2462051, 1.0560602, -0.58208317, 0.21609078, -0.05444823, 0.009177956, -9.904169E-4, 6.183535E-5, -1.6981803E-6]\n })\n};\nfunction DeviceInfo(deviceParams, additionalViewers) {\n this.viewer = Viewers.CardboardV2;\n this.updateDeviceParams(deviceParams);\n this.distortion = new Distortion(this.viewer.distortionCoefficients);\n for (var i = 0; i < additionalViewers.length; i++) {\n var viewer = additionalViewers[i];\n Viewers[viewer.id] = new CardboardViewer(viewer);\n }\n}\nDeviceInfo.prototype.updateDeviceParams = function (deviceParams) {\n this.device = this.determineDevice_(deviceParams) || this.device;\n};\nDeviceInfo.prototype.getDevice = function () {\n return this.device;\n};\nDeviceInfo.prototype.setViewer = function (viewer) {\n this.viewer = viewer;\n this.distortion = new Distortion(this.viewer.distortionCoefficients);\n};\nDeviceInfo.prototype.determineDevice_ = function (deviceParams) {\n if (!deviceParams) {\n if (isIOS()) {\n console.warn('Using fallback iOS device measurements.');\n return DEFAULT_IOS;\n } else {\n console.warn('Using fallback Android device measurements.');\n return DEFAULT_ANDROID;\n }\n }\n var METERS_PER_INCH = 0.0254;\n var metersPerPixelX = METERS_PER_INCH / deviceParams.xdpi;\n var metersPerPixelY = METERS_PER_INCH / deviceParams.ydpi;\n var width = getScreenWidth();\n var height = getScreenHeight();\n return new Device({\n widthMeters: metersPerPixelX * width,\n heightMeters: metersPerPixelY * height,\n bevelMeters: deviceParams.bevelMm * 0.001\n });\n};\nDeviceInfo.prototype.getDistortedFieldOfViewLeftEye = function () {\n var viewer = this.viewer;\n var device = this.device;\n var distortion = this.distortion;\n var eyeToScreenDistance = viewer.screenLensDistance;\n var outerDist = (device.widthMeters - viewer.interLensDistance) / 2;\n var innerDist = viewer.interLensDistance / 2;\n var bottomDist = viewer.baselineLensDistance - device.bevelMeters;\n var topDist = device.heightMeters - bottomDist;\n var outerAngle = radToDeg * Math.atan(distortion.distort(outerDist / eyeToScreenDistance));\n var innerAngle = radToDeg * Math.atan(distortion.distort(innerDist / eyeToScreenDistance));\n var bottomAngle = radToDeg * Math.atan(distortion.distort(bottomDist / eyeToScreenDistance));\n var topAngle = radToDeg * Math.atan(distortion.distort(topDist / eyeToScreenDistance));\n return {\n leftDegrees: Math.min(outerAngle, viewer.fov),\n rightDegrees: Math.min(innerAngle, viewer.fov),\n downDegrees: Math.min(bottomAngle, viewer.fov),\n upDegrees: Math.min(topAngle, viewer.fov)\n };\n};\nDeviceInfo.prototype.getLeftEyeVisibleTanAngles = function () {\n var viewer = this.viewer;\n var device = this.device;\n var distortion = this.distortion;\n var fovLeft = Math.tan(-degToRad * viewer.fov);\n var fovTop = Math.tan(degToRad * viewer.fov);\n var fovRight = Math.tan(degToRad * viewer.fov);\n var fovBottom = Math.tan(-degToRad * viewer.fov);\n var halfWidth = device.widthMeters / 4;\n var halfHeight = device.heightMeters / 2;\n var verticalLensOffset = viewer.baselineLensDistance - device.bevelMeters - halfHeight;\n var centerX = viewer.interLensDistance / 2 - halfWidth;\n var centerY = -verticalLensOffset;\n var centerZ = viewer.screenLensDistance;\n var screenLeft = distortion.distort((centerX - halfWidth) / centerZ);\n var screenTop = distortion.distort((centerY + halfHeight) / centerZ);\n var screenRight = distortion.distort((centerX + halfWidth) / centerZ);\n var screenBottom = distortion.distort((centerY - halfHeight) / centerZ);\n var result = new Float32Array(4);\n result[0] = Math.max(fovLeft, screenLeft);\n result[1] = Math.min(fovTop, screenTop);\n result[2] = Math.min(fovRight, screenRight);\n result[3] = Math.max(fovBottom, screenBottom);\n return result;\n};\nDeviceInfo.prototype.getLeftEyeNoLensTanAngles = function () {\n var viewer = this.viewer;\n var device = this.device;\n var distortion = this.distortion;\n var result = new Float32Array(4);\n var fovLeft = distortion.distortInverse(Math.tan(-degToRad * viewer.fov));\n var fovTop = distortion.distortInverse(Math.tan(degToRad * viewer.fov));\n var fovRight = distortion.distortInverse(Math.tan(degToRad * viewer.fov));\n var fovBottom = distortion.distortInverse(Math.tan(-degToRad * viewer.fov));\n var halfWidth = device.widthMeters / 4;\n var halfHeight = device.heightMeters / 2;\n var verticalLensOffset = viewer.baselineLensDistance - device.bevelMeters - halfHeight;\n var centerX = viewer.interLensDistance / 2 - halfWidth;\n var centerY = -verticalLensOffset;\n var centerZ = viewer.screenLensDistance;\n var screenLeft = (centerX - halfWidth) / centerZ;\n var screenTop = (centerY + halfHeight) / centerZ;\n var screenRight = (centerX + halfWidth) / centerZ;\n var screenBottom = (centerY - halfHeight) / centerZ;\n result[0] = Math.max(fovLeft, screenLeft);\n result[1] = Math.min(fovTop, screenTop);\n result[2] = Math.min(fovRight, screenRight);\n result[3] = Math.max(fovBottom, screenBottom);\n return result;\n};\nDeviceInfo.prototype.getLeftEyeVisibleScreenRect = function (undistortedFrustum) {\n var viewer = this.viewer;\n var device = this.device;\n var dist = viewer.screenLensDistance;\n var eyeX = (device.widthMeters - viewer.interLensDistance) / 2;\n var eyeY = viewer.baselineLensDistance - device.bevelMeters;\n var left = (undistortedFrustum[0] * dist + eyeX) / device.widthMeters;\n var top = (undistortedFrustum[1] * dist + eyeY) / device.heightMeters;\n var right = (undistortedFrustum[2] * dist + eyeX) / device.widthMeters;\n var bottom = (undistortedFrustum[3] * dist + eyeY) / device.heightMeters;\n return {\n x: left,\n y: bottom,\n width: right - left,\n height: top - bottom\n };\n};\nDeviceInfo.prototype.getFieldOfViewLeftEye = function (opt_isUndistorted) {\n return opt_isUndistorted ? this.getUndistortedFieldOfViewLeftEye() : this.getDistortedFieldOfViewLeftEye();\n};\nDeviceInfo.prototype.getFieldOfViewRightEye = function (opt_isUndistorted) {\n var fov = this.getFieldOfViewLeftEye(opt_isUndistorted);\n return {\n leftDegrees: fov.rightDegrees,\n rightDegrees: fov.leftDegrees,\n upDegrees: fov.upDegrees,\n downDegrees: fov.downDegrees\n };\n};\nDeviceInfo.prototype.getUndistortedFieldOfViewLeftEye = function () {\n var p = this.getUndistortedParams_();\n return {\n leftDegrees: radToDeg * Math.atan(p.outerDist),\n rightDegrees: radToDeg * Math.atan(p.innerDist),\n downDegrees: radToDeg * Math.atan(p.bottomDist),\n upDegrees: radToDeg * Math.atan(p.topDist)\n };\n};\nDeviceInfo.prototype.getUndistortedViewportLeftEye = function () {\n var p = this.getUndistortedParams_();\n var viewer = this.viewer;\n var device = this.device;\n var eyeToScreenDistance = viewer.screenLensDistance;\n var screenWidth = device.widthMeters / eyeToScreenDistance;\n var screenHeight = device.heightMeters / eyeToScreenDistance;\n var xPxPerTanAngle = device.width / screenWidth;\n var yPxPerTanAngle = device.height / screenHeight;\n var x = Math.round((p.eyePosX - p.outerDist) * xPxPerTanAngle);\n var y = Math.round((p.eyePosY - p.bottomDist) * yPxPerTanAngle);\n return {\n x: x,\n y: y,\n width: Math.round((p.eyePosX + p.innerDist) * xPxPerTanAngle) - x,\n height: Math.round((p.eyePosY + p.topDist) * yPxPerTanAngle) - y\n };\n};\nDeviceInfo.prototype.getUndistortedParams_ = function () {\n var viewer = this.viewer;\n var device = this.device;\n var distortion = this.distortion;\n var eyeToScreenDistance = viewer.screenLensDistance;\n var halfLensDistance = viewer.interLensDistance / 2 / eyeToScreenDistance;\n var screenWidth = device.widthMeters / eyeToScreenDistance;\n var screenHeight = device.heightMeters / eyeToScreenDistance;\n var eyePosX = screenWidth / 2 - halfLensDistance;\n var eyePosY = (viewer.baselineLensDistance - device.bevelMeters) / eyeToScreenDistance;\n var maxFov = viewer.fov;\n var viewerMax = distortion.distortInverse(Math.tan(degToRad * maxFov));\n var outerDist = Math.min(eyePosX, viewerMax);\n var innerDist = Math.min(halfLensDistance, viewerMax);\n var bottomDist = Math.min(eyePosY, viewerMax);\n var topDist = Math.min(screenHeight - eyePosY, viewerMax);\n return {\n outerDist: outerDist,\n innerDist: innerDist,\n topDist: topDist,\n bottomDist: bottomDist,\n eyePosX: eyePosX,\n eyePosY: eyePosY\n };\n};\nfunction CardboardViewer(params) {\n this.id = params.id;\n this.label = params.label;\n this.fov = params.fov;\n this.interLensDistance = params.interLensDistance;\n this.baselineLensDistance = params.baselineLensDistance;\n this.screenLensDistance = params.screenLensDistance;\n this.distortionCoefficients = params.distortionCoefficients;\n this.inverseCoefficients = params.inverseCoefficients;\n}\nDeviceInfo.Viewers = Viewers;\nvar format = 1;\nvar last_updated = \"2019-11-09T17:36:14Z\";\nvar devices = [{\"type\":\"android\",\"rules\":[{\"mdmh\":\"asus/*/Nexus 7/*\"},{\"ua\":\"Nexus 7\"}],\"dpi\":[320.8,323],\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"asus/*/ASUS_X00PD/*\"},{\"ua\":\"ASUS_X00PD\"}],\"dpi\":245,\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"asus/*/ASUS_X008D/*\"},{\"ua\":\"ASUS_X008D\"}],\"dpi\":282,\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"asus/*/ASUS_Z00AD/*\"},{\"ua\":\"ASUS_Z00AD\"}],\"dpi\":[403,404.6],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"Google/*/Pixel 2 XL/*\"},{\"ua\":\"Pixel 2 XL\"}],\"dpi\":537.9,\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"Google/*/Pixel 3 XL/*\"},{\"ua\":\"Pixel 3 XL\"}],\"dpi\":[558.5,553.8],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"Google/*/Pixel XL/*\"},{\"ua\":\"Pixel XL\"}],\"dpi\":[537.9,533],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"Google/*/Pixel 3/*\"},{\"ua\":\"Pixel 3\"}],\"dpi\":442.4,\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"Google/*/Pixel 2/*\"},{\"ua\":\"Pixel 2\"}],\"dpi\":441,\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"Google/*/Pixel/*\"},{\"ua\":\"Pixel\"}],\"dpi\":[432.6,436.7],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"HTC/*/HTC6435LVW/*\"},{\"ua\":\"HTC6435LVW\"}],\"dpi\":[449.7,443.3],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"HTC/*/HTC One XL/*\"},{\"ua\":\"HTC One XL\"}],\"dpi\":[315.3,314.6],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"htc/*/Nexus 9/*\"},{\"ua\":\"Nexus 9\"}],\"dpi\":289,\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"HTC/*/HTC One M9/*\"},{\"ua\":\"HTC One M9\"}],\"dpi\":[442.5,443.3],\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"HTC/*/HTC One_M8/*\"},{\"ua\":\"HTC One_M8\"}],\"dpi\":[449.7,447.4],\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"HTC/*/HTC One/*\"},{\"ua\":\"HTC One\"}],\"dpi\":472.8,\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"Huawei/*/Nexus 6P/*\"},{\"ua\":\"Nexus 6P\"}],\"dpi\":[515.1,518],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"Huawei/*/BLN-L24/*\"},{\"ua\":\"HONORBLN-L24\"}],\"dpi\":480,\"bw\":4,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"Huawei/*/BKL-L09/*\"},{\"ua\":\"BKL-L09\"}],\"dpi\":403,\"bw\":3.47,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"LENOVO/*/Lenovo PB2-690Y/*\"},{\"ua\":\"Lenovo PB2-690Y\"}],\"dpi\":[457.2,454.713],\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"LGE/*/Nexus 5X/*\"},{\"ua\":\"Nexus 5X\"}],\"dpi\":[422,419.9],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"LGE/*/LGMS345/*\"},{\"ua\":\"LGMS345\"}],\"dpi\":[221.7,219.1],\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"LGE/*/LG-D800/*\"},{\"ua\":\"LG-D800\"}],\"dpi\":[422,424.1],\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"LGE/*/LG-D850/*\"},{\"ua\":\"LG-D850\"}],\"dpi\":[537.9,541.9],\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"LGE/*/VS985 4G/*\"},{\"ua\":\"VS985 4G\"}],\"dpi\":[537.9,535.6],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"LGE/*/Nexus 5/*\"},{\"ua\":\"Nexus 5 B\"}],\"dpi\":[442.4,444.8],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"LGE/*/Nexus 4/*\"},{\"ua\":\"Nexus 4\"}],\"dpi\":[319.8,318.4],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"LGE/*/LG-P769/*\"},{\"ua\":\"LG-P769\"}],\"dpi\":[240.6,247.5],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"LGE/*/LGMS323/*\"},{\"ua\":\"LGMS323\"}],\"dpi\":[206.6,204.6],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"LGE/*/LGLS996/*\"},{\"ua\":\"LGLS996\"}],\"dpi\":[403.4,401.5],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"Micromax/*/4560MMX/*\"},{\"ua\":\"4560MMX\"}],\"dpi\":[240,219.4],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"Micromax/*/A250/*\"},{\"ua\":\"Micromax A250\"}],\"dpi\":[480,446.4],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"Micromax/*/Micromax AQ4501/*\"},{\"ua\":\"Micromax AQ4501\"}],\"dpi\":240,\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"motorola/*/G5/*\"},{\"ua\":\"Moto G (5) Plus\"}],\"dpi\":[403.4,403],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"motorola/*/DROID RAZR/*\"},{\"ua\":\"DROID RAZR\"}],\"dpi\":[368.1,256.7],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"motorola/*/XT830C/*\"},{\"ua\":\"XT830C\"}],\"dpi\":[254,255.9],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"motorola/*/XT1021/*\"},{\"ua\":\"XT1021\"}],\"dpi\":[254,256.7],\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"motorola/*/XT1023/*\"},{\"ua\":\"XT1023\"}],\"dpi\":[254,256.7],\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"motorola/*/XT1028/*\"},{\"ua\":\"XT1028\"}],\"dpi\":[326.6,327.6],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"motorola/*/XT1034/*\"},{\"ua\":\"XT1034\"}],\"dpi\":[326.6,328.4],\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"motorola/*/XT1053/*\"},{\"ua\":\"XT1053\"}],\"dpi\":[315.3,316.1],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"motorola/*/XT1562/*\"},{\"ua\":\"XT1562\"}],\"dpi\":[403.4,402.7],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"motorola/*/Nexus 6/*\"},{\"ua\":\"Nexus 6 B\"}],\"dpi\":[494.3,489.7],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"motorola/*/XT1063/*\"},{\"ua\":\"XT1063\"}],\"dpi\":[295,296.6],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"motorola/*/XT1064/*\"},{\"ua\":\"XT1064\"}],\"dpi\":[295,295.6],\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"motorola/*/XT1092/*\"},{\"ua\":\"XT1092\"}],\"dpi\":[422,424.1],\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"motorola/*/XT1095/*\"},{\"ua\":\"XT1095\"}],\"dpi\":[422,423.4],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"motorola/*/G4/*\"},{\"ua\":\"Moto G (4)\"}],\"dpi\":401,\"bw\":4,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"OnePlus/*/A0001/*\"},{\"ua\":\"A0001\"}],\"dpi\":[403.4,401],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"OnePlus/*/ONE E1001/*\"},{\"ua\":\"ONE E1001\"}],\"dpi\":[442.4,441.4],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"OnePlus/*/ONE E1003/*\"},{\"ua\":\"ONE E1003\"}],\"dpi\":[442.4,441.4],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"OnePlus/*/ONE E1005/*\"},{\"ua\":\"ONE E1005\"}],\"dpi\":[442.4,441.4],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"OnePlus/*/ONE A2001/*\"},{\"ua\":\"ONE A2001\"}],\"dpi\":[391.9,405.4],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"OnePlus/*/ONE A2003/*\"},{\"ua\":\"ONE A2003\"}],\"dpi\":[391.9,405.4],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"OnePlus/*/ONE A2005/*\"},{\"ua\":\"ONE A2005\"}],\"dpi\":[391.9,405.4],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"OnePlus/*/ONEPLUS A3000/*\"},{\"ua\":\"ONEPLUS A3000\"}],\"dpi\":401,\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"OnePlus/*/ONEPLUS A3003/*\"},{\"ua\":\"ONEPLUS A3003\"}],\"dpi\":401,\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"OnePlus/*/ONEPLUS A3010/*\"},{\"ua\":\"ONEPLUS A3010\"}],\"dpi\":401,\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"OnePlus/*/ONEPLUS A5000/*\"},{\"ua\":\"ONEPLUS A5000 \"}],\"dpi\":[403.411,399.737],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"OnePlus/*/ONE A5010/*\"},{\"ua\":\"ONEPLUS A5010\"}],\"dpi\":[403,400],\"bw\":2,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"OnePlus/*/ONEPLUS A6000/*\"},{\"ua\":\"ONEPLUS A6000\"}],\"dpi\":401,\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"OnePlus/*/ONEPLUS A6003/*\"},{\"ua\":\"ONEPLUS A6003\"}],\"dpi\":401,\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"OnePlus/*/ONEPLUS A6010/*\"},{\"ua\":\"ONEPLUS A6010\"}],\"dpi\":401,\"bw\":2,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"OnePlus/*/ONEPLUS A6013/*\"},{\"ua\":\"ONEPLUS A6013\"}],\"dpi\":401,\"bw\":2,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"OPPO/*/X909/*\"},{\"ua\":\"X909\"}],\"dpi\":[442.4,444.1],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/GT-I9082/*\"},{\"ua\":\"GT-I9082\"}],\"dpi\":[184.7,185.4],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-G360P/*\"},{\"ua\":\"SM-G360P\"}],\"dpi\":[196.7,205.4],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/Nexus S/*\"},{\"ua\":\"Nexus S\"}],\"dpi\":[234.5,229.8],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/GT-I9300/*\"},{\"ua\":\"GT-I9300\"}],\"dpi\":[304.8,303.9],\"bw\":5,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-T230NU/*\"},{\"ua\":\"SM-T230NU\"}],\"dpi\":216,\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SGH-T399/*\"},{\"ua\":\"SGH-T399\"}],\"dpi\":[217.7,231.4],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SGH-M919/*\"},{\"ua\":\"SGH-M919\"}],\"dpi\":[440.8,437.7],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-N9005/*\"},{\"ua\":\"SM-N9005\"}],\"dpi\":[386.4,387],\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SAMSUNG-SM-N900A/*\"},{\"ua\":\"SAMSUNG-SM-N900A\"}],\"dpi\":[386.4,387.7],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/GT-I9500/*\"},{\"ua\":\"GT-I9500\"}],\"dpi\":[442.5,443.3],\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/GT-I9505/*\"},{\"ua\":\"GT-I9505\"}],\"dpi\":439.4,\"bw\":4,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-G900F/*\"},{\"ua\":\"SM-G900F\"}],\"dpi\":[415.6,431.6],\"bw\":5,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-G900M/*\"},{\"ua\":\"SM-G900M\"}],\"dpi\":[415.6,431.6],\"bw\":5,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-G800F/*\"},{\"ua\":\"SM-G800F\"}],\"dpi\":326.8,\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-G906S/*\"},{\"ua\":\"SM-G906S\"}],\"dpi\":[562.7,572.4],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/GT-I9300/*\"},{\"ua\":\"GT-I9300\"}],\"dpi\":[306.7,304.8],\"bw\":5,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-T535/*\"},{\"ua\":\"SM-T535\"}],\"dpi\":[142.6,136.4],\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-N920C/*\"},{\"ua\":\"SM-N920C\"}],\"dpi\":[515.1,518.4],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-N920P/*\"},{\"ua\":\"SM-N920P\"}],\"dpi\":[386.3655,390.144],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-N920W8/*\"},{\"ua\":\"SM-N920W8\"}],\"dpi\":[515.1,518.4],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/GT-I9300I/*\"},{\"ua\":\"GT-I9300I\"}],\"dpi\":[304.8,305.8],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/GT-I9195/*\"},{\"ua\":\"GT-I9195\"}],\"dpi\":[249.4,256.7],\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SPH-L520/*\"},{\"ua\":\"SPH-L520\"}],\"dpi\":[249.4,255.9],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SAMSUNG-SGH-I717/*\"},{\"ua\":\"SAMSUNG-SGH-I717\"}],\"dpi\":285.8,\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SPH-D710/*\"},{\"ua\":\"SPH-D710\"}],\"dpi\":[217.7,204.2],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/GT-N7100/*\"},{\"ua\":\"GT-N7100\"}],\"dpi\":265.1,\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SCH-I605/*\"},{\"ua\":\"SCH-I605\"}],\"dpi\":265.1,\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/Galaxy Nexus/*\"},{\"ua\":\"Galaxy Nexus\"}],\"dpi\":[315.3,314.2],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-N910H/*\"},{\"ua\":\"SM-N910H\"}],\"dpi\":[515.1,518],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-N910C/*\"},{\"ua\":\"SM-N910C\"}],\"dpi\":[515.2,520.2],\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-G130M/*\"},{\"ua\":\"SM-G130M\"}],\"dpi\":[165.9,164.8],\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-G928I/*\"},{\"ua\":\"SM-G928I\"}],\"dpi\":[515.1,518.4],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-G920F/*\"},{\"ua\":\"SM-G920F\"}],\"dpi\":580.6,\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-G920P/*\"},{\"ua\":\"SM-G920P\"}],\"dpi\":[522.5,577],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-G925F/*\"},{\"ua\":\"SM-G925F\"}],\"dpi\":580.6,\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-G925V/*\"},{\"ua\":\"SM-G925V\"}],\"dpi\":[522.5,576.6],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-G930F/*\"},{\"ua\":\"SM-G930F\"}],\"dpi\":576.6,\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-G935F/*\"},{\"ua\":\"SM-G935F\"}],\"dpi\":533,\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-G950F/*\"},{\"ua\":\"SM-G950F\"}],\"dpi\":[562.707,565.293],\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-G955U/*\"},{\"ua\":\"SM-G955U\"}],\"dpi\":[522.514,525.762],\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-G955F/*\"},{\"ua\":\"SM-G955F\"}],\"dpi\":[522.514,525.762],\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-G960F/*\"},{\"ua\":\"SM-G960F\"}],\"dpi\":[569.575,571.5],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-G9600/*\"},{\"ua\":\"SM-G9600\"}],\"dpi\":[569.575,571.5],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-G960T/*\"},{\"ua\":\"SM-G960T\"}],\"dpi\":[569.575,571.5],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-G960N/*\"},{\"ua\":\"SM-G960N\"}],\"dpi\":[569.575,571.5],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-G960U/*\"},{\"ua\":\"SM-G960U\"}],\"dpi\":[569.575,571.5],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-G9608/*\"},{\"ua\":\"SM-G9608\"}],\"dpi\":[569.575,571.5],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-G960FD/*\"},{\"ua\":\"SM-G960FD\"}],\"dpi\":[569.575,571.5],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-G960W/*\"},{\"ua\":\"SM-G960W\"}],\"dpi\":[569.575,571.5],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-G965F/*\"},{\"ua\":\"SM-G965F\"}],\"dpi\":529,\"bw\":2,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"Sony/*/C6903/*\"},{\"ua\":\"C6903\"}],\"dpi\":[442.5,443.3],\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"Sony/*/D6653/*\"},{\"ua\":\"D6653\"}],\"dpi\":[428.6,427.6],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"Sony/*/E6653/*\"},{\"ua\":\"E6653\"}],\"dpi\":[428.6,425.7],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"Sony/*/E6853/*\"},{\"ua\":\"E6853\"}],\"dpi\":[403.4,401.9],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"Sony/*/SGP321/*\"},{\"ua\":\"SGP321\"}],\"dpi\":[224.7,224.1],\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"TCT/*/ALCATEL ONE TOUCH Fierce/*\"},{\"ua\":\"ALCATEL ONE TOUCH Fierce\"}],\"dpi\":[240,247.5],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"THL/*/thl 5000/*\"},{\"ua\":\"thl 5000\"}],\"dpi\":[480,443.3],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"Fly/*/IQ4412/*\"},{\"ua\":\"IQ4412\"}],\"dpi\":307.9,\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"ZTE/*/ZTE Blade L2/*\"},{\"ua\":\"ZTE Blade L2\"}],\"dpi\":240,\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"BENEVE/*/VR518/*\"},{\"ua\":\"VR518\"}],\"dpi\":480,\"bw\":3,\"ac\":500},{\"type\":\"ios\",\"rules\":[{\"res\":[640,960]}],\"dpi\":[325.1,328.4],\"bw\":4,\"ac\":1000},{\"type\":\"ios\",\"rules\":[{\"res\":[640,1136]}],\"dpi\":[317.1,320.2],\"bw\":3,\"ac\":1000},{\"type\":\"ios\",\"rules\":[{\"res\":[750,1334]}],\"dpi\":326.4,\"bw\":4,\"ac\":1000},{\"type\":\"ios\",\"rules\":[{\"res\":[1242,2208]}],\"dpi\":[453.6,458.4],\"bw\":4,\"ac\":1000},{\"type\":\"ios\",\"rules\":[{\"res\":[1125,2001]}],\"dpi\":[410.9,415.4],\"bw\":4,\"ac\":1000},{\"type\":\"ios\",\"rules\":[{\"res\":[1125,2436]}],\"dpi\":458,\"bw\":4,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"Huawei/*/EML-L29/*\"},{\"ua\":\"EML-L29\"}],\"dpi\":428,\"bw\":3.45,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"Nokia/*/Nokia 7.1/*\"},{\"ua\":\"Nokia 7.1\"}],\"dpi\":[432,431.9],\"bw\":3,\"ac\":500},{\"type\":\"ios\",\"rules\":[{\"res\":[1242,2688]}],\"dpi\":458,\"bw\":4,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-G570M/*\"},{\"ua\":\"SM-G570M\"}],\"dpi\":320,\"bw\":3.684,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-G970F/*\"},{\"ua\":\"SM-G970F\"}],\"dpi\":438,\"bw\":2.281,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-G973F/*\"},{\"ua\":\"SM-G973F\"}],\"dpi\":550,\"bw\":2.002,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-G975F/*\"},{\"ua\":\"SM-G975F\"}],\"dpi\":522,\"bw\":2.054,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-G977F/*\"},{\"ua\":\"SM-G977F\"}],\"dpi\":505,\"bw\":2.334,\"ac\":500},{\"type\":\"ios\",\"rules\":[{\"res\":[828,1792]}],\"dpi\":326,\"bw\":5,\"ac\":500}];\nvar DPDB_CACHE = {\n\tformat: format,\n\tlast_updated: last_updated,\n\tdevices: devices\n};\nfunction Dpdb(url, onDeviceParamsUpdated) {\n this.dpdb = DPDB_CACHE;\n this.recalculateDeviceParams_();\n if (url) {\n this.onDeviceParamsUpdated = onDeviceParamsUpdated;\n var xhr = new XMLHttpRequest();\n var obj = this;\n xhr.open('GET', url, true);\n xhr.addEventListener('load', function () {\n obj.loading = false;\n if (xhr.status >= 200 && xhr.status <= 299) {\n obj.dpdb = JSON.parse(xhr.response);\n obj.recalculateDeviceParams_();\n } else {\n console.error('Error loading online DPDB!');\n }\n });\n xhr.send();\n }\n}\nDpdb.prototype.getDeviceParams = function () {\n return this.deviceParams;\n};\nDpdb.prototype.recalculateDeviceParams_ = function () {\n var newDeviceParams = this.calcDeviceParams_();\n if (newDeviceParams) {\n this.deviceParams = newDeviceParams;\n if (this.onDeviceParamsUpdated) {\n this.onDeviceParamsUpdated(this.deviceParams);\n }\n } else {\n console.error('Failed to recalculate device parameters.');\n }\n};\nDpdb.prototype.calcDeviceParams_ = function () {\n var db = this.dpdb;\n if (!db) {\n console.error('DPDB not available.');\n return null;\n }\n if (db.format != 1) {\n console.error('DPDB has unexpected format version.');\n return null;\n }\n if (!db.devices || !db.devices.length) {\n console.error('DPDB does not have a devices section.');\n return null;\n }\n var userAgent = navigator.userAgent || navigator.vendor || window.opera;\n var width = getScreenWidth();\n var height = getScreenHeight();\n if (!db.devices) {\n console.error('DPDB has no devices section.');\n return null;\n }\n for (var i = 0; i < db.devices.length; i++) {\n var device = db.devices[i];\n if (!device.rules) {\n console.warn('Device[' + i + '] has no rules section.');\n continue;\n }\n if (device.type != 'ios' && device.type != 'android') {\n console.warn('Device[' + i + '] has invalid type.');\n continue;\n }\n if (isIOS() != (device.type == 'ios')) continue;\n var matched = false;\n for (var j = 0; j < device.rules.length; j++) {\n var rule = device.rules[j];\n if (this.ruleMatches_(rule, userAgent, width, height)) {\n matched = true;\n break;\n }\n }\n if (!matched) continue;\n var xdpi = device.dpi[0] || device.dpi;\n var ydpi = device.dpi[1] || device.dpi;\n return new DeviceParams({ xdpi: xdpi, ydpi: ydpi, bevelMm: device.bw });\n }\n console.warn('No DPDB device match.');\n return null;\n};\nDpdb.prototype.ruleMatches_ = function (rule, ua, screenWidth, screenHeight) {\n if (!rule.ua && !rule.res) return false;\n if (rule.ua && rule.ua.substring(0, 2) === 'SM') rule.ua = rule.ua.substring(0, 7);\n if (rule.ua && ua.indexOf(rule.ua) < 0) return false;\n if (rule.res) {\n if (!rule.res[0] || !rule.res[1]) return false;\n var resX = rule.res[0];\n var resY = rule.res[1];\n if (Math.min(screenWidth, screenHeight) != Math.min(resX, resY) || Math.max(screenWidth, screenHeight) != Math.max(resX, resY)) {\n return false;\n }\n }\n return true;\n};\nfunction DeviceParams(params) {\n this.xdpi = params.xdpi;\n this.ydpi = params.ydpi;\n this.bevelMm = params.bevelMm;\n}\nfunction SensorSample(sample, timestampS) {\n this.set(sample, timestampS);\n}\nSensorSample.prototype.set = function (sample, timestampS) {\n this.sample = sample;\n this.timestampS = timestampS;\n};\nSensorSample.prototype.copy = function (sensorSample) {\n this.set(sensorSample.sample, sensorSample.timestampS);\n};\nfunction ComplementaryFilter(kFilter, isDebug) {\n this.kFilter = kFilter;\n this.isDebug = isDebug;\n this.currentAccelMeasurement = new SensorSample();\n this.currentGyroMeasurement = new SensorSample();\n this.previousGyroMeasurement = new SensorSample();\n if (isIOS()) {\n this.filterQ = new Quaternion(-1, 0, 0, 1);\n } else {\n this.filterQ = new Quaternion(1, 0, 0, 1);\n }\n this.previousFilterQ = new Quaternion();\n this.previousFilterQ.copy(this.filterQ);\n this.accelQ = new Quaternion();\n this.isOrientationInitialized = false;\n this.estimatedGravity = new Vector3();\n this.measuredGravity = new Vector3();\n this.gyroIntegralQ = new Quaternion();\n}\nComplementaryFilter.prototype.addAccelMeasurement = function (vector, timestampS) {\n this.currentAccelMeasurement.set(vector, timestampS);\n};\nComplementaryFilter.prototype.addGyroMeasurement = function (vector, timestampS) {\n this.currentGyroMeasurement.set(vector, timestampS);\n var deltaT = timestampS - this.previousGyroMeasurement.timestampS;\n if (isTimestampDeltaValid(deltaT)) {\n this.run_();\n }\n this.previousGyroMeasurement.copy(this.currentGyroMeasurement);\n};\nComplementaryFilter.prototype.run_ = function () {\n if (!this.isOrientationInitialized) {\n this.accelQ = this.accelToQuaternion_(this.currentAccelMeasurement.sample);\n this.previousFilterQ.copy(this.accelQ);\n this.isOrientationInitialized = true;\n return;\n }\n var deltaT = this.currentGyroMeasurement.timestampS - this.previousGyroMeasurement.timestampS;\n var gyroDeltaQ = this.gyroToQuaternionDelta_(this.currentGyroMeasurement.sample, deltaT);\n this.gyroIntegralQ.multiply(gyroDeltaQ);\n this.filterQ.copy(this.previousFilterQ);\n this.filterQ.multiply(gyroDeltaQ);\n var invFilterQ = new Quaternion();\n invFilterQ.copy(this.filterQ);\n invFilterQ.inverse();\n this.estimatedGravity.set(0, 0, -1);\n this.estimatedGravity.applyQuaternion(invFilterQ);\n this.estimatedGravity.normalize();\n this.measuredGravity.copy(this.currentAccelMeasurement.sample);\n this.measuredGravity.normalize();\n var deltaQ = new Quaternion();\n deltaQ.setFromUnitVectors(this.estimatedGravity, this.measuredGravity);\n deltaQ.inverse();\n if (this.isDebug) {\n console.log('Delta: %d deg, G_est: (%s, %s, %s), G_meas: (%s, %s, %s)', radToDeg * getQuaternionAngle(deltaQ), this.estimatedGravity.x.toFixed(1), this.estimatedGravity.y.toFixed(1), this.estimatedGravity.z.toFixed(1), this.measuredGravity.x.toFixed(1), this.measuredGravity.y.toFixed(1), this.measuredGravity.z.toFixed(1));\n }\n var targetQ = new Quaternion();\n targetQ.copy(this.filterQ);\n targetQ.multiply(deltaQ);\n this.filterQ.slerp(targetQ, 1 - this.kFilter);\n this.previousFilterQ.copy(this.filterQ);\n};\nComplementaryFilter.prototype.getOrientation = function () {\n return this.filterQ;\n};\nComplementaryFilter.prototype.accelToQuaternion_ = function (accel) {\n var normAccel = new Vector3();\n normAccel.copy(accel);\n normAccel.normalize();\n var quat = new Quaternion();\n quat.setFromUnitVectors(new Vector3(0, 0, -1), normAccel);\n quat.inverse();\n return quat;\n};\nComplementaryFilter.prototype.gyroToQuaternionDelta_ = function (gyro, dt) {\n var quat = new Quaternion();\n var axis = new Vector3();\n axis.copy(gyro);\n axis.normalize();\n quat.setFromAxisAngle(axis, gyro.length() * dt);\n return quat;\n};\nfunction PosePredictor(predictionTimeS, isDebug) {\n this.predictionTimeS = predictionTimeS;\n this.isDebug = isDebug;\n this.previousQ = new Quaternion();\n this.previousTimestampS = null;\n this.deltaQ = new Quaternion();\n this.outQ = new Quaternion();\n}\nPosePredictor.prototype.getPrediction = function (currentQ, gyro, timestampS) {\n if (!this.previousTimestampS) {\n this.previousQ.copy(currentQ);\n this.previousTimestampS = timestampS;\n return currentQ;\n }\n var axis = new Vector3();\n axis.copy(gyro);\n axis.normalize();\n var angularSpeed = gyro.length();\n if (angularSpeed < degToRad * 20) {\n if (this.isDebug) {\n console.log('Moving slowly, at %s deg/s: no prediction', (radToDeg * angularSpeed).toFixed(1));\n }\n this.outQ.copy(currentQ);\n this.previousQ.copy(currentQ);\n return this.outQ;\n }\n var predictAngle = angularSpeed * this.predictionTimeS;\n this.deltaQ.setFromAxisAngle(axis, predictAngle);\n this.outQ.copy(this.previousQ);\n this.outQ.multiply(this.deltaQ);\n this.previousQ.copy(currentQ);\n this.previousTimestampS = timestampS;\n return this.outQ;\n};\nfunction FusionPoseSensor(kFilter, predictionTime, yawOnly, isDebug) {\n this.yawOnly = yawOnly;\n this.accelerometer = new Vector3();\n this.gyroscope = new Vector3();\n this.filter = new ComplementaryFilter(kFilter, isDebug);\n this.posePredictor = new PosePredictor(predictionTime, isDebug);\n this.isFirefoxAndroid = isFirefoxAndroid();\n this.isIOS = isIOS();\n var chromeVersion = getChromeVersion();\n this.isDeviceMotionInRadians = !this.isIOS && chromeVersion && chromeVersion < 66;\n this.isWithoutDeviceMotion = isChromeWithoutDeviceMotion() || isSafariWithoutDeviceMotion();\n this.filterToWorldQ = new Quaternion();\n if (isIOS()) {\n this.filterToWorldQ.setFromAxisAngle(new Vector3(1, 0, 0), Math.PI / 2);\n } else {\n this.filterToWorldQ.setFromAxisAngle(new Vector3(1, 0, 0), -Math.PI / 2);\n }\n this.inverseWorldToScreenQ = new Quaternion();\n this.worldToScreenQ = new Quaternion();\n this.originalPoseAdjustQ = new Quaternion();\n this.originalPoseAdjustQ.setFromAxisAngle(new Vector3(0, 0, 1), -window.orientation * Math.PI / 180);\n this.setScreenTransform_();\n if (isLandscapeMode()) {\n this.filterToWorldQ.multiply(this.inverseWorldToScreenQ);\n }\n this.resetQ = new Quaternion();\n this.orientationOut_ = new Float32Array(4);\n this.start();\n}\nFusionPoseSensor.prototype.getPosition = function () {\n return null;\n};\nFusionPoseSensor.prototype.getOrientation = function () {\n var orientation = void 0;\n if (this.isWithoutDeviceMotion && this._deviceOrientationQ) {\n this.deviceOrientationFixQ = this.deviceOrientationFixQ || function () {\n var z = new Quaternion().setFromAxisAngle(new Vector3(0, 0, -1), 0);\n var y = new Quaternion();\n if (window.orientation === -90) {\n y.setFromAxisAngle(new Vector3(0, 1, 0), Math.PI / -2);\n } else {\n y.setFromAxisAngle(new Vector3(0, 1, 0), Math.PI / 2);\n }\n return z.multiply(y);\n }();\n this.deviceOrientationFilterToWorldQ = this.deviceOrientationFilterToWorldQ || function () {\n var q = new Quaternion();\n q.setFromAxisAngle(new Vector3(1, 0, 0), -Math.PI / 2);\n return q;\n }();\n orientation = this._deviceOrientationQ;\n var out = new Quaternion();\n out.copy(orientation);\n out.multiply(this.deviceOrientationFilterToWorldQ);\n out.multiply(this.resetQ);\n out.multiply(this.worldToScreenQ);\n out.multiplyQuaternions(this.deviceOrientationFixQ, out);\n if (this.yawOnly) {\n out.x = 0;\n out.z = 0;\n out.normalize();\n }\n this.orientationOut_[0] = out.x;\n this.orientationOut_[1] = out.y;\n this.orientationOut_[2] = out.z;\n this.orientationOut_[3] = out.w;\n return this.orientationOut_;\n } else {\n var filterOrientation = this.filter.getOrientation();\n orientation = this.posePredictor.getPrediction(filterOrientation, this.gyroscope, this.previousTimestampS);\n }\n var out = new Quaternion();\n out.copy(this.filterToWorldQ);\n out.multiply(this.resetQ);\n out.multiply(orientation);\n out.multiply(this.worldToScreenQ);\n if (this.yawOnly) {\n out.x = 0;\n out.z = 0;\n out.normalize();\n }\n this.orientationOut_[0] = out.x;\n this.orientationOut_[1] = out.y;\n this.orientationOut_[2] = out.z;\n this.orientationOut_[3] = out.w;\n return this.orientationOut_;\n};\nFusionPoseSensor.prototype.resetPose = function () {\n this.resetQ.copy(this.filter.getOrientation());\n this.resetQ.x = 0;\n this.resetQ.y = 0;\n this.resetQ.z *= -1;\n this.resetQ.normalize();\n if (isLandscapeMode()) {\n this.resetQ.multiply(this.inverseWorldToScreenQ);\n }\n this.resetQ.multiply(this.originalPoseAdjustQ);\n};\nFusionPoseSensor.prototype.onDeviceOrientation_ = function (e) {\n this._deviceOrientationQ = this._deviceOrientationQ || new Quaternion();\n var alpha = e.alpha,\n beta = e.beta,\n gamma = e.gamma;\n alpha = (alpha || 0) * Math.PI / 180;\n beta = (beta || 0) * Math.PI / 180;\n gamma = (gamma || 0) * Math.PI / 180;\n this._deviceOrientationQ.setFromEulerYXZ(beta, alpha, -gamma);\n};\nFusionPoseSensor.prototype.onDeviceMotion_ = function (deviceMotion) {\n this.updateDeviceMotion_(deviceMotion);\n};\nFusionPoseSensor.prototype.updateDeviceMotion_ = function (deviceMotion) {\n var accGravity = deviceMotion.accelerationIncludingGravity;\n var rotRate = deviceMotion.rotationRate;\n var timestampS = deviceMotion.timeStamp / 1000;\n var deltaS = timestampS - this.previousTimestampS;\n if (deltaS < 0) {\n warnOnce('fusion-pose-sensor:invalid:non-monotonic', 'Invalid timestamps detected: non-monotonic timestamp from devicemotion');\n this.previousTimestampS = timestampS;\n return;\n } else if (deltaS <= MIN_TIMESTEP || deltaS > MAX_TIMESTEP) {\n warnOnce('fusion-pose-sensor:invalid:outside-threshold', 'Invalid timestamps detected: Timestamp from devicemotion outside expected range.');\n this.previousTimestampS = timestampS;\n return;\n }\n this.accelerometer.set(-accGravity.x, -accGravity.y, -accGravity.z);\n if (rotRate) {\n if (isR7()) {\n this.gyroscope.set(-rotRate.beta, rotRate.alpha, rotRate.gamma);\n } else {\n this.gyroscope.set(rotRate.alpha, rotRate.beta, rotRate.gamma);\n }\n if (!this.isDeviceMotionInRadians) {\n this.gyroscope.multiplyScalar(Math.PI / 180);\n }\n this.filter.addGyroMeasurement(this.gyroscope, timestampS);\n }\n this.filter.addAccelMeasurement(this.accelerometer, timestampS);\n this.previousTimestampS = timestampS;\n};\nFusionPoseSensor.prototype.onOrientationChange_ = function (screenOrientation) {\n this.setScreenTransform_();\n};\nFusionPoseSensor.prototype.onMessage_ = function (event) {\n var message = event.data;\n if (!message || !message.type) {\n return;\n }\n var type = message.type.toLowerCase();\n if (type !== 'devicemotion') {\n return;\n }\n this.updateDeviceMotion_(message.deviceMotionEvent);\n};\nFusionPoseSensor.prototype.setScreenTransform_ = function () {\n this.worldToScreenQ.set(0, 0, 0, 1);\n switch (window.orientation) {\n case 0:\n break;\n case 90:\n this.worldToScreenQ.setFromAxisAngle(new Vector3(0, 0, 1), -Math.PI / 2);\n break;\n case -90:\n this.worldToScreenQ.setFromAxisAngle(new Vector3(0, 0, 1), Math.PI / 2);\n break;\n case 180:\n break;\n }\n this.inverseWorldToScreenQ.copy(this.worldToScreenQ);\n this.inverseWorldToScreenQ.inverse();\n};\nFusionPoseSensor.prototype.start = function () {\n this.onDeviceMotionCallback_ = this.onDeviceMotion_.bind(this);\n this.onOrientationChangeCallback_ = this.onOrientationChange_.bind(this);\n this.onMessageCallback_ = this.onMessage_.bind(this);\n this.onDeviceOrientationCallback_ = this.onDeviceOrientation_.bind(this);\n if (isIOS() && isInsideCrossOriginIFrame()) {\n window.addEventListener('message', this.onMessageCallback_);\n }\n window.addEventListener('orientationchange', this.onOrientationChangeCallback_);\n if (this.isWithoutDeviceMotion) {\n window.addEventListener('deviceorientation', this.onDeviceOrientationCallback_);\n } else {\n window.addEventListener('devicemotion', this.onDeviceMotionCallback_);\n }\n};\nFusionPoseSensor.prototype.stop = function () {\n window.removeEventListener('devicemotion', this.onDeviceMotionCallback_);\n window.removeEventListener('deviceorientation', this.onDeviceOrientationCallback_);\n window.removeEventListener('orientationchange', this.onOrientationChangeCallback_);\n window.removeEventListener('message', this.onMessageCallback_);\n};\nvar SENSOR_FREQUENCY = 60;\nvar X_AXIS = new Vector3(1, 0, 0);\nvar Z_AXIS = new Vector3(0, 0, 1);\nvar SENSOR_TO_VR = new Quaternion();\nSENSOR_TO_VR.setFromAxisAngle(X_AXIS, -Math.PI / 2);\nSENSOR_TO_VR.multiply(new Quaternion().setFromAxisAngle(Z_AXIS, Math.PI / 2));\nvar PoseSensor = function () {\n function PoseSensor(config) {\n classCallCheck(this, PoseSensor);\n this.config = config;\n this.sensor = null;\n this.fusionSensor = null;\n this._out = new Float32Array(4);\n this.api = null;\n this.errors = [];\n this._sensorQ = new Quaternion();\n this._outQ = new Quaternion();\n this._onSensorRead = this._onSensorRead.bind(this);\n this._onSensorError = this._onSensorError.bind(this);\n this.init();\n }\n createClass(PoseSensor, [{\n key: 'init',\n value: function init() {\n var sensor = null;\n try {\n sensor = new RelativeOrientationSensor({\n frequency: SENSOR_FREQUENCY,\n referenceFrame: 'screen'\n });\n sensor.addEventListener('error', this._onSensorError);\n } catch (error) {\n this.errors.push(error);\n if (error.name === 'SecurityError') {\n console.error('Cannot construct sensors due to the Feature Policy');\n console.warn('Attempting to fall back using \"devicemotion\"; however this will ' + 'fail in the future without correct permissions.');\n this.useDeviceMotion();\n } else if (error.name === 'ReferenceError') {\n this.useDeviceMotion();\n } else {\n console.error(error);\n }\n }\n if (sensor) {\n this.api = 'sensor';\n this.sensor = sensor;\n this.sensor.addEventListener('reading', this._onSensorRead);\n this.sensor.start();\n }\n }\n }, {\n key: 'useDeviceMotion',\n value: function useDeviceMotion() {\n this.api = 'devicemotion';\n this.fusionSensor = new FusionPoseSensor(this.config.K_FILTER, this.config.PREDICTION_TIME_S, this.config.YAW_ONLY, this.config.DEBUG);\n if (this.sensor) {\n this.sensor.removeEventListener('reading', this._onSensorRead);\n this.sensor.removeEventListener('error', this._onSensorError);\n this.sensor = null;\n }\n }\n }, {\n key: 'getOrientation',\n value: function getOrientation() {\n if (this.fusionSensor) {\n return this.fusionSensor.getOrientation();\n }\n if (!this.sensor || !this.sensor.quaternion) {\n this._out[0] = this._out[1] = this._out[2] = 0;\n this._out[3] = 1;\n return this._out;\n }\n var q = this.sensor.quaternion;\n this._sensorQ.set(q[0], q[1], q[2], q[3]);\n var out = this._outQ;\n out.copy(SENSOR_TO_VR);\n out.multiply(this._sensorQ);\n if (this.config.YAW_ONLY) {\n out.x = out.z = 0;\n out.normalize();\n }\n this._out[0] = out.x;\n this._out[1] = out.y;\n this._out[2] = out.z;\n this._out[3] = out.w;\n return this._out;\n }\n }, {\n key: '_onSensorError',\n value: function _onSensorError(event) {\n this.errors.push(event.error);\n if (event.error.name === 'NotAllowedError') {\n console.error('Permission to access sensor was denied');\n } else if (event.error.name === 'NotReadableError') {\n console.error('Sensor could not be read');\n } else {\n console.error(event.error);\n }\n this.useDeviceMotion();\n }\n }, {\n key: '_onSensorRead',\n value: function _onSensorRead() {}\n }]);\n return PoseSensor;\n}();\nvar rotateInstructionsAsset = \"<svg width='198' height='240' viewBox='0 0 198 240' xmlns='http://www.w3.org/2000/svg'><g fill='none' fill-rule='evenodd'><path d='M149.625 109.527l6.737 3.891v.886c0 .177.013.36.038.549.01.081.02.162.027.242.14 1.415.974 2.998 2.105 3.999l5.72 5.062.081-.09s4.382-2.53 5.235-3.024l25.97 14.993v54.001c0 .771-.386 1.217-.948 1.217-.233 0-.495-.076-.772-.236l-23.967-13.838-.014.024-27.322 15.775-.85-1.323c-4.731-1.529-9.748-2.74-14.951-3.61a.27.27 0 0 0-.007.024l-5.067 16.961-7.891 4.556-.037-.063v27.59c0 .772-.386 1.217-.948 1.217-.232 0-.495-.076-.772-.236l-42.473-24.522c-.95-.549-1.72-1.877-1.72-2.967v-1.035l-.021.047a5.111 5.111 0 0 0-1.816-.399 5.682 5.682 0 0 0-.546.001 13.724 13.724 0 0 1-1.918-.041c-1.655-.153-3.2-.6-4.404-1.296l-46.576-26.89.005.012-10.278-18.75c-1.001-1.827-.241-4.216 1.698-5.336l56.011-32.345a4.194 4.194 0 0 1 2.099-.572c1.326 0 2.572.659 3.227 1.853l.005-.003.227.413-.006.004a9.63 9.63 0 0 0 1.477 2.018l.277.27c1.914 1.85 4.468 2.801 7.113 2.801 1.949 0 3.948-.517 5.775-1.572.013 0 7.319-4.219 7.319-4.219a4.194 4.194 0 0 1 2.099-.572c1.326 0 2.572.658 3.226 1.853l3.25 5.928.022-.018 6.785 3.917-.105-.182 46.881-26.965m0-1.635c-.282 0-.563.073-.815.218l-46.169 26.556-5.41-3.124-3.005-5.481c-.913-1.667-2.699-2.702-4.66-2.703-1.011 0-2.02.274-2.917.792a3825 3825 0 0 1-7.275 4.195l-.044.024a9.937 9.937 0 0 1-4.957 1.353c-2.292 0-4.414-.832-5.976-2.342l-.252-.245a7.992 7.992 0 0 1-1.139-1.534 1.379 1.379 0 0 0-.06-.122l-.227-.414a1.718 1.718 0 0 0-.095-.154c-.938-1.574-2.673-2.545-4.571-2.545-1.011 0-2.02.274-2.917.792L3.125 155.502c-2.699 1.559-3.738 4.94-2.314 7.538l10.278 18.75c.177.323.448.563.761.704l46.426 26.804c1.403.81 3.157 1.332 5.072 1.508a15.661 15.661 0 0 0 2.146.046 4.766 4.766 0 0 1 .396 0c.096.004.19.011.283.022.109 1.593 1.159 3.323 2.529 4.114l42.472 24.522c.524.302 1.058.455 1.59.455 1.497 0 2.583-1.2 2.583-2.852v-26.562l7.111-4.105a1.64 1.64 0 0 0 .749-.948l4.658-15.593c4.414.797 8.692 1.848 12.742 3.128l.533.829a1.634 1.634 0 0 0 2.193.531l26.532-15.317L193 192.433c.523.302 1.058.455 1.59.455 1.497 0 2.583-1.199 2.583-2.852v-54.001c0-.584-.312-1.124-.818-1.416l-25.97-14.993a1.633 1.633 0 0 0-1.636.001c-.606.351-2.993 1.73-4.325 2.498l-4.809-4.255c-.819-.725-1.461-1.933-1.561-2.936a7.776 7.776 0 0 0-.033-.294 2.487 2.487 0 0 1-.023-.336v-.886c0-.584-.312-1.123-.817-1.416l-6.739-3.891a1.633 1.633 0 0 0-.817-.219' fill='#455A64'/><path d='M96.027 132.636l46.576 26.891c1.204.695 1.979 1.587 2.242 2.541l-.01.007-81.374 46.982h-.001c-1.654-.152-3.199-.6-4.403-1.295l-46.576-26.891 83.546-48.235' fill='#FAFAFA'/><path d='M63.461 209.174c-.008 0-.015 0-.022-.002-1.693-.156-3.228-.609-4.441-1.309l-46.576-26.89a.118.118 0 0 1 0-.203l83.546-48.235a.117.117 0 0 1 .117 0l46.576 26.891c1.227.708 2.021 1.612 2.296 2.611a.116.116 0 0 1-.042.124l-.021.016-81.375 46.981a.11.11 0 0 1-.058.016zm-50.747-28.303l46.401 26.79c1.178.68 2.671 1.121 4.32 1.276l81.272-46.922c-.279-.907-1.025-1.73-2.163-2.387l-46.517-26.857-83.313 48.1z' fill='#607D8B'/><path d='M148.327 165.471a5.85 5.85 0 0 1-.546.001c-1.894-.083-3.302-1.038-3.145-2.132a2.693 2.693 0 0 0-.072-1.105l-81.103 46.822c.628.058 1.272.073 1.918.042.182-.009.364-.009.546-.001 1.894.083 3.302 1.038 3.145 2.132l79.257-45.759' fill='#FFF'/><path d='M69.07 211.347a.118.118 0 0 1-.115-.134c.045-.317-.057-.637-.297-.925-.505-.61-1.555-1.022-2.738-1.074a5.966 5.966 0 0 0-.535.001 14.03 14.03 0 0 1-1.935-.041.117.117 0 0 1-.103-.092.116.116 0 0 1 .055-.126l81.104-46.822a.117.117 0 0 1 .171.07c.104.381.129.768.074 1.153-.045.316.057.637.296.925.506.61 1.555 1.021 2.739 1.073.178.008.357.008.535-.001a.117.117 0 0 1 .064.218l-79.256 45.759a.114.114 0 0 1-.059.016zm-3.405-2.372c.089 0 .177.002.265.006 1.266.056 2.353.488 2.908 1.158.227.274.35.575.36.882l78.685-45.429c-.036 0-.072-.001-.107-.003-1.267-.056-2.354-.489-2.909-1.158-.282-.34-.402-.724-.347-1.107a2.604 2.604 0 0 0-.032-.91L63.846 208.97a13.91 13.91 0 0 0 1.528.012c.097-.005.194-.007.291-.007z' fill='#607D8B'/><path d='M2.208 162.134c-1.001-1.827-.241-4.217 1.698-5.337l56.011-32.344c1.939-1.12 4.324-.546 5.326 1.281l.232.41a9.344 9.344 0 0 0 1.47 2.021l.278.27c3.325 3.214 8.583 3.716 12.888 1.23l7.319-4.22c1.94-1.119 4.324-.546 5.325 1.282l3.25 5.928-83.519 48.229-10.278-18.75z' fill='#FAFAFA'/><path d='M12.486 181.001a.112.112 0 0 1-.031-.005.114.114 0 0 1-.071-.056L2.106 162.19c-1.031-1.88-.249-4.345 1.742-5.494l56.01-32.344a4.328 4.328 0 0 1 2.158-.588c1.415 0 2.65.702 3.311 1.882.01.008.018.017.024.028l.227.414a.122.122 0 0 1 .013.038 9.508 9.508 0 0 0 1.439 1.959l.275.266c1.846 1.786 4.344 2.769 7.031 2.769 1.977 0 3.954-.538 5.717-1.557a.148.148 0 0 1 .035-.013l7.284-4.206a4.321 4.321 0 0 1 2.157-.588c1.427 0 2.672.716 3.329 1.914l3.249 5.929a.116.116 0 0 1-.044.157l-83.518 48.229a.116.116 0 0 1-.059.016zm49.53-57.004c-.704 0-1.41.193-2.041.557l-56.01 32.345c-1.882 1.086-2.624 3.409-1.655 5.179l10.221 18.645 83.317-48.112-3.195-5.829c-.615-1.122-1.783-1.792-3.124-1.792a4.08 4.08 0 0 0-2.04.557l-7.317 4.225a.148.148 0 0 1-.035.013 11.7 11.7 0 0 1-5.801 1.569c-2.748 0-5.303-1.007-7.194-2.835l-.278-.27a9.716 9.716 0 0 1-1.497-2.046.096.096 0 0 1-.013-.037l-.191-.347a.11.11 0 0 1-.023-.029c-.615-1.123-1.783-1.793-3.124-1.793z' fill='#607D8B'/><path d='M42.434 155.808c-2.51-.001-4.697-1.258-5.852-3.365-1.811-3.304-.438-7.634 3.059-9.654l12.291-7.098a7.599 7.599 0 0 1 3.789-1.033c2.51 0 4.697 1.258 5.852 3.365 1.811 3.304.439 7.634-3.059 9.654l-12.291 7.098a7.606 7.606 0 0 1-3.789 1.033zm13.287-20.683a7.128 7.128 0 0 0-3.555.971l-12.291 7.098c-3.279 1.893-4.573 5.942-2.883 9.024 1.071 1.955 3.106 3.122 5.442 3.122a7.13 7.13 0 0 0 3.556-.97l12.291-7.098c3.279-1.893 4.572-5.942 2.883-9.024-1.072-1.955-3.106-3.123-5.443-3.123z' fill='#607D8B'/><path d='M149.588 109.407l6.737 3.89v.887c0 .176.013.36.037.549.011.081.02.161.028.242.14 1.415.973 2.998 2.105 3.999l7.396 6.545c.177.156.358.295.541.415 1.579 1.04 2.95.466 3.062-1.282.049-.784.057-1.595.023-2.429l-.003-.16v-1.151l25.987 15.003v54c0 1.09-.77 1.53-1.72.982l-42.473-24.523c-.95-.548-1.72-1.877-1.72-2.966v-34.033' fill='#FAFAFA'/><path d='M194.553 191.25c-.257 0-.54-.085-.831-.253l-42.472-24.521c-.981-.567-1.779-1.943-1.779-3.068v-34.033h.234v34.033c0 1.051.745 2.336 1.661 2.866l42.473 24.521c.424.245.816.288 1.103.122.285-.164.442-.52.442-1.002v-53.933l-25.753-14.868.003 1.106c.034.832.026 1.654-.024 2.439-.054.844-.396 1.464-.963 1.746-.619.309-1.45.173-2.28-.373a5.023 5.023 0 0 1-.553-.426l-7.397-6.544c-1.158-1.026-1.999-2.625-2.143-4.076a9.624 9.624 0 0 0-.027-.238 4.241 4.241 0 0 1-.038-.564v-.82l-6.68-3.856.117-.202 6.738 3.89.058.034v.954c0 .171.012.351.036.533.011.083.021.165.029.246.138 1.395.948 2.935 2.065 3.923l7.397 6.545c.173.153.35.289.527.406.758.499 1.504.63 2.047.359.49-.243.786-.795.834-1.551.05-.778.057-1.591.024-2.417l-.004-.163v-1.355l.175.1 25.987 15.004.059.033v54.068c0 .569-.198.996-.559 1.204a1.002 1.002 0 0 1-.506.131' fill='#607D8B'/><path d='M145.685 163.161l24.115 13.922-25.978 14.998-1.462-.307c-6.534-2.17-13.628-3.728-21.019-4.616-4.365-.524-8.663 1.096-9.598 3.62a2.746 2.746 0 0 0-.011 1.928c1.538 4.267 4.236 8.363 7.995 12.135l.532.845-25.977 14.997-24.115-13.922 75.518-43.6' fill='#FFF'/><path d='M94.282 220.818l-.059-.033-24.29-14.024.175-.101 75.577-43.634.058.033 24.29 14.024-26.191 15.122-.045-.01-1.461-.307c-6.549-2.174-13.613-3.725-21.009-4.614a13.744 13.744 0 0 0-1.638-.097c-3.758 0-7.054 1.531-7.837 3.642a2.62 2.62 0 0 0-.01 1.848c1.535 4.258 4.216 8.326 7.968 12.091l.016.021.526.835.006.01.064.102-.105.061-25.977 14.998-.058.033zm-23.881-14.057l23.881 13.788 24.802-14.32c.546-.315.846-.489 1.017-.575l-.466-.74c-3.771-3.787-6.467-7.881-8.013-12.168a2.851 2.851 0 0 1 .011-2.008c.815-2.199 4.203-3.795 8.056-3.795.557 0 1.117.033 1.666.099 7.412.891 14.491 2.445 21.041 4.621.836.175 1.215.254 1.39.304l25.78-14.884-23.881-13.788-75.284 43.466z' fill='#607D8B'/><path d='M167.23 125.979v50.871l-27.321 15.773-6.461-14.167c-.91-1.996-3.428-1.738-5.624.574a10.238 10.238 0 0 0-2.33 4.018l-6.46 21.628-27.322 15.774v-50.871l75.518-43.6' fill='#FFF'/><path d='M91.712 220.567a.127.127 0 0 1-.059-.016.118.118 0 0 1-.058-.101v-50.871c0-.042.023-.08.058-.101l75.519-43.6a.117.117 0 0 1 .175.101v50.871c0 .041-.023.08-.059.1l-27.321 15.775a.118.118 0 0 1-.094.01.12.12 0 0 1-.071-.063l-6.46-14.168c-.375-.822-1.062-1.275-1.934-1.275-1.089 0-2.364.686-3.5 1.881a10.206 10.206 0 0 0-2.302 3.972l-6.46 21.627a.118.118 0 0 1-.054.068L91.77 220.551a.12.12 0 0 1-.058.016zm.117-50.92v50.601l27.106-15.65 6.447-21.583a10.286 10.286 0 0 1 2.357-4.065c1.18-1.242 2.517-1.954 3.669-1.954.969 0 1.731.501 2.146 1.411l6.407 14.051 27.152-15.676v-50.601l-75.284 43.466z' fill='#607D8B'/><path d='M168.543 126.213v50.87l-27.322 15.774-6.46-14.168c-.91-1.995-3.428-1.738-5.624.574a10.248 10.248 0 0 0-2.33 4.019l-6.461 21.627-27.321 15.774v-50.87l75.518-43.6' fill='#FFF'/><path d='M93.025 220.8a.123.123 0 0 1-.059-.015.12.12 0 0 1-.058-.101v-50.871c0-.042.023-.08.058-.101l75.518-43.6a.112.112 0 0 1 .117 0c.036.02.059.059.059.1v50.871a.116.116 0 0 1-.059.101l-27.321 15.774a.111.111 0 0 1-.094.01.115.115 0 0 1-.071-.062l-6.46-14.168c-.375-.823-1.062-1.275-1.935-1.275-1.088 0-2.363.685-3.499 1.881a10.19 10.19 0 0 0-2.302 3.971l-6.461 21.628a.108.108 0 0 1-.053.067l-27.322 15.775a.12.12 0 0 1-.058.015zm.117-50.919v50.6l27.106-15.649 6.447-21.584a10.293 10.293 0 0 1 2.357-4.065c1.179-1.241 2.516-1.954 3.668-1.954.969 0 1.732.502 2.147 1.412l6.407 14.051 27.152-15.676v-50.601l-75.284 43.466z' fill='#607D8B'/><path d='M169.8 177.083l-27.322 15.774-6.46-14.168c-.91-1.995-3.428-1.738-5.625.574a10.246 10.246 0 0 0-2.329 4.019l-6.461 21.627-27.321 15.774v-50.87l75.518-43.6v50.87z' fill='#FAFAFA'/><path d='M94.282 220.917a.234.234 0 0 1-.234-.233v-50.871c0-.083.045-.161.117-.202l75.518-43.601a.234.234 0 1 1 .35.202v50.871a.233.233 0 0 1-.116.202l-27.322 15.775a.232.232 0 0 1-.329-.106l-6.461-14.168c-.36-.789-.992-1.206-1.828-1.206-1.056 0-2.301.672-3.415 1.844a10.099 10.099 0 0 0-2.275 3.924l-6.46 21.628a.235.235 0 0 1-.107.136l-27.322 15.774a.23.23 0 0 1-.116.031zm.233-50.969v50.331l26.891-15.525 6.434-21.539a10.41 10.41 0 0 1 2.384-4.112c1.201-1.265 2.569-1.991 3.753-1.991 1.018 0 1.818.526 2.253 1.48l6.354 13.934 26.982-15.578v-50.331l-75.051 43.331z' fill='#607D8B'/><path d='M109.894 199.943c-1.774 0-3.241-.725-4.244-2.12a.224.224 0 0 1 .023-.294.233.233 0 0 1 .301-.023c.78.547 1.705.827 2.75.827 1.323 0 2.754-.439 4.256-1.306 5.311-3.067 9.631-10.518 9.631-16.611 0-1.927-.442-3.56-1.278-4.724a.232.232 0 0 1 .323-.327c1.671 1.172 2.591 3.381 2.591 6.219 0 6.242-4.426 13.863-9.865 17.003-1.574.908-3.084 1.356-4.488 1.356zm-2.969-1.542c.813.651 1.82.877 2.968.877h.001c1.321 0 2.753-.327 4.254-1.194 5.311-3.067 9.632-10.463 9.632-16.556 0-1.979-.463-3.599-1.326-4.761.411 1.035.625 2.275.625 3.635 0 6.243-4.426 13.883-9.865 17.023-1.574.909-3.084 1.317-4.49 1.317-.641 0-1.243-.149-1.799-.341z' fill='#607D8B'/><path d='M113.097 197.23c5.384-3.108 9.748-10.636 9.748-16.814 0-2.051-.483-3.692-1.323-4.86-1.784-1.252-4.374-1.194-7.257.47-5.384 3.108-9.748 10.636-9.748 16.814 0 2.051.483 3.692 1.323 4.86 1.784 1.252 4.374 1.194 7.257-.47' fill='#FAFAFA'/><path d='M108.724 198.614c-1.142 0-2.158-.213-3.019-.817-.021-.014-.04.014-.055-.007-.894-1.244-1.367-2.948-1.367-4.973 0-6.242 4.426-13.864 9.865-17.005 1.574-.908 3.084-1.363 4.49-1.363 1.142 0 2.158.309 3.018.913a.23.23 0 0 1 .056.056c.894 1.244 1.367 2.972 1.367 4.997 0 6.243-4.426 13.783-9.865 16.923-1.574.909-3.084 1.276-4.49 1.276zm-2.718-1.109c.774.532 1.688.776 2.718.776 1.323 0 2.754-.413 4.256-1.28 5.311-3.066 9.631-10.505 9.631-16.598 0-1.909-.434-3.523-1.255-4.685-.774-.533-1.688-.799-2.718-.799-1.323 0-2.755.441-4.256 1.308-5.311 3.066-9.631 10.506-9.631 16.599 0 1.909.434 3.517 1.255 4.679z' fill='#607D8B'/><path d='M149.318 114.262l-9.984 8.878 15.893 11.031 5.589-6.112-11.498-13.797' fill='#FAFAFA'/><path d='M169.676 120.84l-9.748 5.627c-3.642 2.103-9.528 2.113-13.147.024-3.62-2.089-3.601-5.488.041-7.591l9.495-5.608-6.729-3.885-81.836 47.071 45.923 26.514 3.081-1.779c.631-.365.869-.898.618-1.39-2.357-4.632-2.593-9.546-.683-14.262 5.638-13.92 24.509-24.815 48.618-28.07 8.169-1.103 16.68-.967 24.704.394.852.145 1.776.008 2.407-.357l3.081-1.778-25.825-14.91' fill='#FAFAFA'/><path d='M113.675 183.459a.47.47 0 0 1-.233-.062l-45.924-26.515a.468.468 0 0 1 .001-.809l81.836-47.071a.467.467 0 0 1 .466 0l6.729 3.885a.467.467 0 0 1-.467.809l-6.496-3.75-80.9 46.533 44.988 25.973 2.848-1.644c.192-.111.62-.409.435-.773-2.416-4.748-2.658-9.814-.7-14.65 2.806-6.927 8.885-13.242 17.582-18.263 8.657-4.998 19.518-8.489 31.407-10.094 8.198-1.107 16.79-.97 24.844.397.739.125 1.561.007 2.095-.301l2.381-1.374-25.125-14.506a.467.467 0 0 1 .467-.809l25.825 14.91a.467.467 0 0 1 0 .809l-3.081 1.779c-.721.417-1.763.575-2.718.413-7.963-1.351-16.457-1.486-24.563-.392-11.77 1.589-22.512 5.039-31.065 9.977-8.514 4.916-14.456 11.073-17.183 17.805-1.854 4.578-1.623 9.376.666 13.875.37.725.055 1.513-.8 2.006l-3.081 1.78a.476.476 0 0 1-.234.062' fill='#455A64'/><path d='M153.316 128.279c-2.413 0-4.821-.528-6.652-1.586-1.818-1.049-2.82-2.461-2.82-3.975 0-1.527 1.016-2.955 2.861-4.02l9.493-5.607a.233.233 0 1 1 .238.402l-9.496 5.609c-1.696.979-2.628 2.263-2.628 3.616 0 1.34.918 2.608 2.585 3.571 3.549 2.049 9.343 2.038 12.914-.024l9.748-5.628a.234.234 0 0 1 .234.405l-9.748 5.628c-1.858 1.072-4.296 1.609-6.729 1.609' fill='#607D8B'/><path d='M113.675 182.992l-45.913-26.508M113.675 183.342a.346.346 0 0 1-.175-.047l-45.913-26.508a.35.35 0 1 1 .35-.607l45.913 26.508a.35.35 0 0 1-.175.654' fill='#455A64'/><path d='M67.762 156.484v54.001c0 1.09.77 2.418 1.72 2.967l42.473 24.521c.95.549 1.72.11 1.72-.98v-54.001' fill='#FAFAFA'/><path d='M112.727 238.561c-.297 0-.62-.095-.947-.285l-42.473-24.521c-1.063-.613-1.895-2.05-1.895-3.27v-54.001a.35.35 0 1 1 .701 0v54.001c0 .96.707 2.18 1.544 2.663l42.473 24.522c.344.198.661.243.87.122.206-.119.325-.411.325-.799v-54.001a.35.35 0 1 1 .7 0v54.001c0 .655-.239 1.154-.675 1.406a1.235 1.235 0 0 1-.623.162' fill='#455A64'/><path d='M112.86 147.512h-.001c-2.318 0-4.499-.522-6.142-1.471-1.705-.984-2.643-2.315-2.643-3.749 0-1.445.952-2.791 2.68-3.788l12.041-6.953c1.668-.962 3.874-1.493 6.212-1.493 2.318 0 4.499.523 6.143 1.472 1.704.984 2.643 2.315 2.643 3.748 0 1.446-.952 2.791-2.68 3.789l-12.042 6.952c-1.668.963-3.874 1.493-6.211 1.493zm12.147-16.753c-2.217 0-4.298.497-5.861 1.399l-12.042 6.952c-1.502.868-2.33 1.998-2.33 3.182 0 1.173.815 2.289 2.293 3.142 1.538.889 3.596 1.378 5.792 1.378h.001c2.216 0 4.298-.497 5.861-1.399l12.041-6.953c1.502-.867 2.33-1.997 2.33-3.182 0-1.172-.814-2.288-2.292-3.142-1.539-.888-3.596-1.377-5.793-1.377z' fill='#607D8B'/><path d='M165.63 123.219l-5.734 3.311c-3.167 1.828-8.286 1.837-11.433.02-3.147-1.817-3.131-4.772.036-6.601l5.734-3.31 11.397 6.58' fill='#FAFAFA'/><path d='M154.233 117.448l9.995 5.771-4.682 2.704c-1.434.827-3.352 1.283-5.399 1.283-2.029 0-3.923-.449-5.333-1.263-1.29-.744-2-1.694-2-2.674 0-.991.723-1.955 2.036-2.713l5.383-3.108m0-.809l-5.734 3.31c-3.167 1.829-3.183 4.784-.036 6.601 1.568.905 3.623 1.357 5.684 1.357 2.077 0 4.159-.46 5.749-1.377l5.734-3.311-11.397-6.58M145.445 179.667c-1.773 0-3.241-.85-4.243-2.245-.067-.092-.057-.275.023-.356.08-.081.207-.12.3-.055.781.548 1.706.812 2.751.811 1.322 0 2.754-.446 4.256-1.313 5.31-3.066 9.631-10.522 9.631-16.615 0-1.927-.442-3.562-1.279-4.726a.235.235 0 0 1 .024-.301.232.232 0 0 1 .3-.027c1.67 1.172 2.59 3.38 2.59 6.219 0 6.242-4.425 13.987-9.865 17.127-1.573.908-3.083 1.481-4.488 1.481zM142.476 178c.814.651 1.82 1.002 2.969 1.002 1.322 0 2.753-.452 4.255-1.32 5.31-3.065 9.631-10.523 9.631-16.617 0-1.98-.463-3.63-1.325-4.793.411 1.035.624 2.26.624 3.62 0 6.242-4.425 13.875-9.865 17.015-1.573.909-3.084 1.376-4.489 1.376a5.49 5.49 0 0 1-1.8-.283z' fill='#607D8B'/><path d='M148.648 176.704c5.384-3.108 9.748-10.636 9.748-16.813 0-2.052-.483-3.693-1.322-4.861-1.785-1.252-4.375-1.194-7.258.471-5.383 3.108-9.748 10.636-9.748 16.813 0 2.051.484 3.692 1.323 4.86 1.785 1.253 4.374 1.195 7.257-.47' fill='#FAFAFA'/><path d='M144.276 178.276c-1.143 0-2.158-.307-3.019-.911a.217.217 0 0 1-.055-.054c-.895-1.244-1.367-2.972-1.367-4.997 0-6.241 4.425-13.875 9.865-17.016 1.573-.908 3.084-1.369 4.489-1.369 1.143 0 2.158.307 3.019.91a.24.24 0 0 1 .055.055c.894 1.244 1.367 2.971 1.367 4.997 0 6.241-4.425 13.875-9.865 17.016-1.573.908-3.084 1.369-4.489 1.369zm-2.718-1.172c.773.533 1.687.901 2.718.901 1.322 0 2.754-.538 4.256-1.405 5.31-3.066 9.631-10.567 9.631-16.661 0-1.908-.434-3.554-1.256-4.716-.774-.532-1.688-.814-2.718-.814-1.322 0-2.754.433-4.256 1.3-5.31 3.066-9.631 10.564-9.631 16.657 0 1.91.434 3.576 1.256 4.738z' fill='#607D8B'/><path d='M150.72 172.361l-.363-.295a24.105 24.105 0 0 0 2.148-3.128 24.05 24.05 0 0 0 1.977-4.375l.443.149a24.54 24.54 0 0 1-2.015 4.46 24.61 24.61 0 0 1-2.19 3.189M115.917 191.514l-.363-.294a24.174 24.174 0 0 0 2.148-3.128 24.038 24.038 0 0 0 1.976-4.375l.443.148a24.48 24.48 0 0 1-2.015 4.461 24.662 24.662 0 0 1-2.189 3.188M114 237.476V182.584 237.476' fill='#607D8B'/><g><path d='M81.822 37.474c.017-.135-.075-.28-.267-.392-.327-.188-.826-.21-1.109-.045l-6.012 3.471c-.131.076-.194.178-.191.285.002.132.002.461.002.578v.043l-.007.128-6.591 3.779c-.001 0-2.077 1.046-2.787 5.192 0 0-.912 6.961-.898 19.745.015 12.57.606 17.07 1.167 21.351.22 1.684 3.001 2.125 3.001 2.125.331.04.698-.027 1.08-.248l75.273-43.551c1.808-1.069 2.667-3.719 3.056-6.284 1.213-7.99 1.675-32.978-.275-39.878-.196-.693-.51-1.083-.868-1.282l-2.086-.79c-.727.028-1.416.467-1.534.535L82.032 37.072l-.21.402' fill='#FFF'/><path d='M144.311 1.701l2.085.79c.358.199.672.589.868 1.282 1.949 6.9 1.487 31.887.275 39.878-.39 2.565-1.249 5.215-3.056 6.284L69.21 93.486a1.78 1.78 0 0 1-.896.258l-.183-.011c0 .001-2.782-.44-3.003-2.124-.56-4.282-1.151-8.781-1.165-21.351-.015-12.784.897-19.745.897-19.745.71-4.146 2.787-5.192 2.787-5.192l6.591-3.779.007-.128v-.043c0-.117 0-.446-.002-.578-.003-.107.059-.21.191-.285l6.012-3.472a.98.98 0 0 1 .481-.11c.218 0 .449.053.627.156.193.112.285.258.268.392l.211-.402 60.744-34.836c.117-.068.806-.507 1.534-.535m0-.997l-.039.001c-.618.023-1.283.244-1.974.656l-.021.012-60.519 34.706a2.358 2.358 0 0 0-.831-.15c-.365 0-.704.084-.98.244l-6.012 3.471c-.442.255-.699.69-.689 1.166l.001.15-6.08 3.487c-.373.199-2.542 1.531-3.29 5.898l-.006.039c-.009.07-.92 7.173-.906 19.875.014 12.62.603 17.116 1.172 21.465l.002.015c.308 2.355 3.475 2.923 3.836 2.98l.034.004c.101.013.204.019.305.019a2.77 2.77 0 0 0 1.396-.392l75.273-43.552c1.811-1.071 2.999-3.423 3.542-6.997 1.186-7.814 1.734-33.096-.301-40.299-.253-.893-.704-1.527-1.343-1.882l-.132-.062-2.085-.789a.973.973 0 0 0-.353-.065' fill='#455A64'/><path d='M128.267 11.565l1.495.434-56.339 32.326' fill='#FFF'/><path d='M74.202 90.545a.5.5 0 0 1-.25-.931l18.437-10.645a.499.499 0 1 1 .499.864L74.451 90.478l-.249.067M75.764 42.654l-.108-.062.046-.171 5.135-2.964.17.045-.045.171-5.135 2.964-.063.017M70.52 90.375V46.421l.063-.036L137.84 7.554v43.954l-.062.036L70.52 90.375zm.25-43.811v43.38l66.821-38.579V7.985L70.77 46.564z' fill='#607D8B'/><path d='M86.986 83.182c-.23.149-.612.384-.849.523l-11.505 6.701c-.237.139-.206.252.068.252h.565c.275 0 .693-.113.93-.252L87.7 83.705c.237-.139.428-.253.425-.256a11.29 11.29 0 0 1-.006-.503c0-.274-.188-.377-.418-.227l-.715.463' fill='#607D8B'/><path d='M75.266 90.782H74.7c-.2 0-.316-.056-.346-.166-.03-.11.043-.217.215-.317l11.505-6.702c.236-.138.615-.371.844-.519l.715-.464a.488.488 0 0 1 .266-.089c.172 0 .345.13.345.421 0 .214.001.363.003.437l.006.004-.004.069c-.003.075-.003.075-.486.356l-11.505 6.702a2.282 2.282 0 0 1-.992.268zm-.6-.25l.034.001h.566c.252 0 .649-.108.866-.234l11.505-6.702c.168-.098.294-.173.361-.214-.004-.084-.004-.218-.004-.437l-.095-.171-.131.049-.714.463c-.232.15-.616.386-.854.525l-11.505 6.702-.029.018z' fill='#607D8B'/><path d='M75.266 89.871H74.7c-.2 0-.316-.056-.346-.166-.03-.11.043-.217.215-.317l11.505-6.702c.258-.151.694-.268.993-.268h.565c.2 0 .316.056.346.166.03.11-.043.217-.215.317l-11.505 6.702a2.282 2.282 0 0 1-.992.268zm-.6-.25l.034.001h.566c.252 0 .649-.107.866-.234l11.505-6.702.03-.018-.035-.001h-.565c-.252 0-.649.108-.867.234l-11.505 6.702-.029.018zM74.37 90.801v-1.247 1.247' fill='#607D8B'/><path d='M68.13 93.901c-.751-.093-1.314-.737-1.439-1.376-.831-4.238-1.151-8.782-1.165-21.352-.015-12.784.897-19.745.897-19.745.711-4.146 2.787-5.192 2.787-5.192l74.859-43.219c.223-.129 2.487-1.584 3.195.923 1.95 6.9 1.488 31.887.275 39.878-.389 2.565-1.248 5.215-3.056 6.283L69.21 93.653c-.382.221-.749.288-1.08.248 0 0-2.781-.441-3.001-2.125-.561-4.281-1.152-8.781-1.167-21.351-.014-12.784.898-19.745.898-19.745.71-4.146 2.787-5.191 2.787-5.191l6.598-3.81.871-.119 6.599-3.83.046-.461L68.13 93.901' fill='#FAFAFA'/><path d='M68.317 94.161l-.215-.013h-.001l-.244-.047c-.719-.156-2.772-.736-2.976-2.292-.568-4.34-1.154-8.813-1.168-21.384-.014-12.654.891-19.707.9-19.777.725-4.231 2.832-5.338 2.922-5.382l6.628-3.827.87-.119 6.446-3.742.034-.334a.248.248 0 0 1 .273-.223.248.248 0 0 1 .223.272l-.059.589-6.752 3.919-.87.118-6.556 3.785c-.031.016-1.99 1.068-2.666 5.018-.007.06-.908 7.086-.894 19.702.014 12.539.597 16.996 1.161 21.305.091.691.689 1.154 1.309 1.452a1.95 1.95 0 0 1-.236-.609c-.781-3.984-1.155-8.202-1.17-21.399-.014-12.653.891-19.707.9-19.777.725-4.231 2.832-5.337 2.922-5.382-.004.001 74.444-42.98 74.846-43.212l.028-.017c.904-.538 1.72-.688 2.36-.433.555.221.949.733 1.172 1.52 2.014 7.128 1.46 32.219.281 39.983-.507 3.341-1.575 5.515-3.175 6.462L69.335 93.869a2.023 2.023 0 0 1-1.018.292zm-.147-.507c.293.036.604-.037.915-.217l75.273-43.551c1.823-1.078 2.602-3.915 2.934-6.106 1.174-7.731 1.731-32.695-.268-39.772-.178-.631-.473-1.032-.876-1.192-.484-.193-1.166-.052-1.921.397l-.034.021-74.858 43.218c-.031.017-1.989 1.069-2.666 5.019-.007.059-.908 7.085-.894 19.702.015 13.155.386 17.351 1.161 21.303.09.461.476.983 1.037 1.139.114.025.185.037.196.039h.001z' fill='#455A64'/><path d='M69.317 68.982c.489-.281.885-.056.885.505 0 .56-.396 1.243-.885 1.525-.488.282-.884.057-.884-.504 0-.56.396-1.243.884-1.526' fill='#FFF'/><path d='M68.92 71.133c-.289 0-.487-.228-.487-.625 0-.56.396-1.243.884-1.526a.812.812 0 0 1 .397-.121c.289 0 .488.229.488.626 0 .56-.396 1.243-.885 1.525a.812.812 0 0 1-.397.121m.794-2.459a.976.976 0 0 0-.49.147c-.548.317-.978 1.058-.978 1.687 0 .486.271.812.674.812a.985.985 0 0 0 .491-.146c.548-.317.978-1.057.978-1.687 0-.486-.272-.813-.675-.813' fill='#8097A2'/><path d='M68.92 70.947c-.271 0-.299-.307-.299-.439 0-.491.361-1.116.79-1.363a.632.632 0 0 1 .303-.096c.272 0 .301.306.301.438 0 .491-.363 1.116-.791 1.364a.629.629 0 0 1-.304.096m.794-2.086a.812.812 0 0 0-.397.121c-.488.283-.884.966-.884 1.526 0 .397.198.625.487.625a.812.812 0 0 0 .397-.121c.489-.282.885-.965.885-1.525 0-.397-.199-.626-.488-.626' fill='#8097A2'/><path d='M69.444 85.35c.264-.152.477-.031.477.272 0 .303-.213.67-.477.822-.263.153-.477.031-.477-.271 0-.302.214-.671.477-.823' fill='#FFF'/><path d='M69.23 86.51c-.156 0-.263-.123-.263-.337 0-.302.214-.671.477-.823a.431.431 0 0 1 .214-.066c.156 0 .263.124.263.338 0 .303-.213.67-.477.822a.431.431 0 0 1-.214.066m.428-1.412c-.1 0-.203.029-.307.09-.32.185-.57.618-.57.985 0 .309.185.524.449.524a.63.63 0 0 0 .308-.09c.32-.185.57-.618.57-.985 0-.309-.185-.524-.45-.524' fill='#8097A2'/><path d='M69.23 86.322l-.076-.149c0-.235.179-.544.384-.661l.12-.041.076.151c0 .234-.179.542-.383.66l-.121.04m.428-1.038a.431.431 0 0 0-.214.066c-.263.152-.477.521-.477.823 0 .214.107.337.263.337a.431.431 0 0 0 .214-.066c.264-.152.477-.519.477-.822 0-.214-.107-.338-.263-.338' fill='#8097A2'/><path d='M139.278 7.769v43.667L72.208 90.16V46.493l67.07-38.724' fill='#455A64'/><path d='M72.083 90.375V46.421l.063-.036 67.257-38.831v43.954l-.062.036-67.258 38.831zm.25-43.811v43.38l66.821-38.579V7.985L72.333 46.564z' fill='#607D8B'/></g><path d='M125.737 88.647l-7.639 3.334V84l-11.459 4.713v8.269L99 100.315l13.369 3.646 13.368-15.314' fill='#455A64'/></g></svg>\";\nfunction RotateInstructions() {\n this.loadIcon_();\n var overlay = document.createElement('div');\n var s = overlay.style;\n s.position = 'fixed';\n s.top = 0;\n s.right = 0;\n s.bottom = 0;\n s.left = 0;\n s.backgroundColor = 'gray';\n s.fontFamily = 'sans-serif';\n s.zIndex = 1000000;\n var img = document.createElement('img');\n img.src = this.icon;\n var s = img.style;\n s.marginLeft = '25%';\n s.marginTop = '25%';\n s.width = '50%';\n overlay.appendChild(img);\n var text = document.createElement('div');\n var s = text.style;\n s.textAlign = 'center';\n s.fontSize = '16px';\n s.lineHeight = '24px';\n s.margin = '24px 25%';\n s.width = '50%';\n text.innerHTML = 'Place your phone into your Cardboard viewer.';\n overlay.appendChild(text);\n var snackbar = document.createElement('div');\n var s = snackbar.style;\n s.backgroundColor = '#CFD8DC';\n s.position = 'fixed';\n s.bottom = 0;\n s.width = '100%';\n s.height = '48px';\n s.padding = '14px 24px';\n s.boxSizing = 'border-box';\n s.color = '#656A6B';\n overlay.appendChild(snackbar);\n var snackbarText = document.createElement('div');\n snackbarText.style.float = 'left';\n snackbarText.innerHTML = 'No Cardboard viewer?';\n var snackbarButton = document.createElement('a');\n snackbarButton.href = 'https://www.google.com/get/cardboard/get-cardboard/';\n snackbarButton.innerHTML = 'get one';\n snackbarButton.target = '_blank';\n var s = snackbarButton.style;\n s.float = 'right';\n s.fontWeight = 600;\n s.textTransform = 'uppercase';\n s.borderLeft = '1px solid gray';\n s.paddingLeft = '24px';\n s.textDecoration = 'none';\n s.color = '#656A6B';\n snackbar.appendChild(snackbarText);\n snackbar.appendChild(snackbarButton);\n this.overlay = overlay;\n this.text = text;\n this.hide();\n}\nRotateInstructions.prototype.show = function (parent) {\n if (!parent && !this.overlay.parentElement) {\n document.body.appendChild(this.overlay);\n } else if (parent) {\n if (this.overlay.parentElement && this.overlay.parentElement != parent) this.overlay.parentElement.removeChild(this.overlay);\n parent.appendChild(this.overlay);\n }\n this.overlay.style.display = 'block';\n var img = this.overlay.querySelector('img');\n var s = img.style;\n if (isLandscapeMode()) {\n s.width = '20%';\n s.marginLeft = '40%';\n s.marginTop = '3%';\n } else {\n s.width = '50%';\n s.marginLeft = '25%';\n s.marginTop = '25%';\n }\n};\nRotateInstructions.prototype.hide = function () {\n this.overlay.style.display = 'none';\n};\nRotateInstructions.prototype.showTemporarily = function (ms, parent) {\n this.show(parent);\n this.timer = setTimeout(this.hide.bind(this), ms);\n};\nRotateInstructions.prototype.disableShowTemporarily = function () {\n clearTimeout(this.timer);\n};\nRotateInstructions.prototype.update = function () {\n this.disableShowTemporarily();\n if (!isLandscapeMode() && isMobile()) {\n this.show();\n } else {\n this.hide();\n }\n};\nRotateInstructions.prototype.loadIcon_ = function () {\n this.icon = dataUri('image/svg+xml', rotateInstructionsAsset);\n};\nvar DEFAULT_VIEWER = 'CardboardV1';\nvar VIEWER_KEY = 'WEBVR_CARDBOARD_VIEWER';\nvar CLASS_NAME = 'webvr-polyfill-viewer-selector';\nfunction ViewerSelector(defaultViewer) {\n try {\n this.selectedKey = localStorage.getItem(VIEWER_KEY);\n } catch (error) {\n console.error('Failed to load viewer profile: %s', error);\n }\n if (!this.selectedKey) {\n this.selectedKey = defaultViewer || DEFAULT_VIEWER;\n }\n this.dialog = this.createDialog_(DeviceInfo.Viewers);\n this.root = null;\n this.onChangeCallbacks_ = [];\n}\nViewerSelector.prototype.show = function (root) {\n this.root = root;\n root.appendChild(this.dialog);\n var selected = this.dialog.querySelector('#' + this.selectedKey);\n selected.checked = true;\n this.dialog.style.display = 'block';\n};\nViewerSelector.prototype.hide = function () {\n if (this.root && this.root.contains(this.dialog)) {\n this.root.removeChild(this.dialog);\n }\n this.dialog.style.display = 'none';\n};\nViewerSelector.prototype.getCurrentViewer = function () {\n return DeviceInfo.Viewers[this.selectedKey];\n};\nViewerSelector.prototype.getSelectedKey_ = function () {\n var input = this.dialog.querySelector('input[name=field]:checked');\n if (input) {\n return input.id;\n }\n return null;\n};\nViewerSelector.prototype.onChange = function (cb) {\n this.onChangeCallbacks_.push(cb);\n};\nViewerSelector.prototype.fireOnChange_ = function (viewer) {\n for (var i = 0; i < this.onChangeCallbacks_.length; i++) {\n this.onChangeCallbacks_[i](viewer);\n }\n};\nViewerSelector.prototype.onSave_ = function () {\n this.selectedKey = this.getSelectedKey_();\n if (!this.selectedKey || !DeviceInfo.Viewers[this.selectedKey]) {\n console.error('ViewerSelector.onSave_: this should never happen!');\n return;\n }\n this.fireOnChange_(DeviceInfo.Viewers[this.selectedKey]);\n try {\n localStorage.setItem(VIEWER_KEY, this.selectedKey);\n } catch (error) {\n console.error('Failed to save viewer profile: %s', error);\n }\n this.hide();\n};\nViewerSelector.prototype.createDialog_ = function (options) {\n var container = document.createElement('div');\n container.classList.add(CLASS_NAME);\n container.style.display = 'none';\n var overlay = document.createElement('div');\n var s = overlay.style;\n s.position = 'fixed';\n s.left = 0;\n s.top = 0;\n s.width = '100%';\n s.height = '100%';\n s.background = 'rgba(0, 0, 0, 0.3)';\n overlay.addEventListener('click', this.hide.bind(this));\n var width = 280;\n var dialog = document.createElement('div');\n var s = dialog.style;\n s.boxSizing = 'border-box';\n s.position = 'fixed';\n s.top = '24px';\n s.left = '50%';\n s.marginLeft = -width / 2 + 'px';\n s.width = width + 'px';\n s.padding = '24px';\n s.overflow = 'hidden';\n s.background = '#fafafa';\n s.fontFamily = \"'Roboto', sans-serif\";\n s.boxShadow = '0px 5px 20px #666';\n dialog.appendChild(this.createH1_('Select your viewer'));\n for (var id in options) {\n dialog.appendChild(this.createChoice_(id, options[id].label));\n }\n dialog.appendChild(this.createButton_('Save', this.onSave_.bind(this)));\n container.appendChild(overlay);\n container.appendChild(dialog);\n return container;\n};\nViewerSelector.prototype.createH1_ = function (name) {\n var h1 = document.createElement('h1');\n var s = h1.style;\n s.color = 'black';\n s.fontSize = '20px';\n s.fontWeight = 'bold';\n s.marginTop = 0;\n s.marginBottom = '24px';\n h1.innerHTML = name;\n return h1;\n};\nViewerSelector.prototype.createChoice_ = function (id, name) {\n var div = document.createElement('div');\n div.style.marginTop = '8px';\n div.style.color = 'black';\n var input = document.createElement('input');\n input.style.fontSize = '30px';\n input.setAttribute('id', id);\n input.setAttribute('type', 'radio');\n input.setAttribute('value', id);\n input.setAttribute('name', 'field');\n var label = document.createElement('label');\n label.style.marginLeft = '4px';\n label.setAttribute('for', id);\n label.innerHTML = name;\n div.appendChild(input);\n div.appendChild(label);\n return div;\n};\nViewerSelector.prototype.createButton_ = function (label, onclick) {\n var button = document.createElement('button');\n button.innerHTML = label;\n var s = button.style;\n s.float = 'right';\n s.textTransform = 'uppercase';\n s.color = '#1094f7';\n s.fontSize = '14px';\n s.letterSpacing = 0;\n s.border = 0;\n s.background = 'none';\n s.marginTop = '16px';\n button.addEventListener('click', onclick);\n return button;\n};\nvar commonjsGlobal$$1 = typeof window !== 'undefined' ? window : typeof commonjsGlobal !== 'undefined' ? commonjsGlobal : typeof self !== 'undefined' ? self : {};\nfunction unwrapExports$$1 (x) {\n\treturn x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;\n}\nfunction createCommonjsModule$$1(fn, module) {\n\treturn module = { exports: {} }, fn(module, module.exports), module.exports;\n}\nvar NoSleep = createCommonjsModule$$1(function (module, exports) {\n(function webpackUniversalModuleDefinition(root, factory) {\n\tmodule.exports = factory();\n})(commonjsGlobal$$1, function() {\nreturn (function(modules) {\n \tvar installedModules = {};\n \tfunction __webpack_require__(moduleId) {\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n \t\tmodule.l = true;\n \t\treturn module.exports;\n \t}\n \t__webpack_require__.m = modules;\n \t__webpack_require__.c = installedModules;\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n \t__webpack_require__.p = \"\";\n \treturn __webpack_require__(__webpack_require__.s = 0);\n })\n ([\n (function(module, exports, __webpack_require__) {\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nvar mediaFile = __webpack_require__(1);\nvar oldIOS = typeof navigator !== 'undefined' && parseFloat(('' + (/CPU.*OS ([0-9_]{3,4})[0-9_]{0,1}|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent) || [0, ''])[1]).replace('undefined', '3_2').replace('_', '.').replace('_', '')) < 10 && !window.MSStream;\nvar NoSleep = function () {\n function NoSleep() {\n _classCallCheck(this, NoSleep);\n if (oldIOS) {\n this.noSleepTimer = null;\n } else {\n this.noSleepVideo = document.createElement('video');\n this.noSleepVideo.setAttribute('playsinline', '');\n this.noSleepVideo.setAttribute('src', mediaFile);\n this.noSleepVideo.addEventListener('timeupdate', function (e) {\n if (this.noSleepVideo.currentTime > 0.5) {\n this.noSleepVideo.currentTime = Math.random();\n }\n }.bind(this));\n }\n }\n _createClass(NoSleep, [{\n key: 'enable',\n value: function enable() {\n if (oldIOS) {\n this.disable();\n this.noSleepTimer = window.setInterval(function () {\n window.location.href = '/';\n window.setTimeout(window.stop, 0);\n }, 15000);\n } else {\n this.noSleepVideo.play();\n }\n }\n }, {\n key: 'disable',\n value: function disable() {\n if (oldIOS) {\n if (this.noSleepTimer) {\n window.clearInterval(this.noSleepTimer);\n this.noSleepTimer = null;\n }\n } else {\n this.noSleepVideo.pause();\n }\n }\n }]);\n return NoSleep;\n}();\nmodule.exports = NoSleep;\n }),\n (function(module, exports, __webpack_require__) {\nmodule.exports = 'data:video/mp4;base64,AAAAIGZ0eXBtcDQyAAACAGlzb21pc28yYXZjMW1wNDEAAAAIZnJlZQAACKBtZGF0AAAC8wYF///v3EXpvebZSLeWLNgg2SPu73gyNjQgLSBjb3JlIDE0MiByMjQ3OSBkZDc5YTYxIC0gSC4yNjQvTVBFRy00IEFWQyBjb2RlYyAtIENvcHlsZWZ0IDIwMDMtMjAxNCAtIGh0dHA6Ly93d3cudmlkZW9sYW4ub3JnL3gyNjQuaHRtbCAtIG9wdGlvbnM6IGNhYmFjPTEgcmVmPTEgZGVibG9jaz0xOjA6MCBhbmFseXNlPTB4MToweDExMSBtZT1oZXggc3VibWU9MiBwc3k9MSBwc3lfcmQ9MS4wMDowLjAwIG1peGVkX3JlZj0wIG1lX3JhbmdlPTE2IGNocm9tYV9tZT0xIHRyZWxsaXM9MCA4eDhkY3Q9MCBjcW09MCBkZWFkem9uZT0yMSwxMSBmYXN0X3Bza2lwPTEgY2hyb21hX3FwX29mZnNldD0wIHRocmVhZHM9NiBsb29rYWhlYWRfdGhyZWFkcz0xIHNsaWNlZF90aHJlYWRzPTAgbnI9MCBkZWNpbWF0ZT0xIGludGVybGFjZWQ9MCBibHVyYXlfY29tcGF0PTAgY29uc3RyYWluZWRfaW50cmE9MCBiZnJhbWVzPTMgYl9weXJ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AAAG7wAABwYAAAcMAAAHIQAABzQAAAc6AAAHTQAAB2QAAAdqAAAHfwAAB5IAAAeYAAAHqwAAB8IAAAfXAAAH3QAAB/AAAAgDAAAICQAACCAAAAg1AAAIOwAACE4AAAhhAAAIeAAACH4AAAiRAAAIpAAACKoAAAiwAAAItgAACLwAAAjCAAAAFnVkdGEAAAAObmFtZVN0ZXJlbwAAAHB1ZHRhAAAAaG1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAAO2lsc3QAAAAzqXRvbwAAACtkYXRhAAAAAQAAAABIYW5kQnJha2UgMC4xMC4yIDIwMTUwNjExMDA=';\n })\n ]);\n});\n});\nvar NoSleep$1 = unwrapExports$$1(NoSleep);\nvar nextDisplayId = 1000;\nvar defaultLeftBounds = [0, 0, 0.5, 1];\nvar defaultRightBounds = [0.5, 0, 0.5, 1];\nvar raf = window.requestAnimationFrame;\nvar caf = window.cancelAnimationFrame;\nfunction VRFrameData() {\n this.leftProjectionMatrix = new Float32Array(16);\n this.leftViewMatrix = new Float32Array(16);\n this.rightProjectionMatrix = new Float32Array(16);\n this.rightViewMatrix = new Float32Array(16);\n this.pose = null;\n}\nfunction VRDisplayCapabilities(config) {\n Object.defineProperties(this, {\n hasPosition: {\n writable: false, enumerable: true, value: config.hasPosition\n },\n hasExternalDisplay: {\n writable: false, enumerable: true, value: config.hasExternalDisplay\n },\n canPresent: {\n writable: false, enumerable: true, value: config.canPresent\n },\n maxLayers: {\n writable: false, enumerable: true, value: config.maxLayers\n },\n hasOrientation: {\n enumerable: true, get: function get() {\n deprecateWarning('VRDisplayCapabilities.prototype.hasOrientation', 'VRDisplay.prototype.getFrameData');\n return config.hasOrientation;\n }\n }\n });\n}\nfunction VRDisplay(config) {\n config = config || {};\n var USE_WAKELOCK = 'wakelock' in config ? config.wakelock : true;\n this.isPolyfilled = true;\n this.displayId = nextDisplayId++;\n this.displayName = '';\n this.depthNear = 0.01;\n this.depthFar = 10000.0;\n this.isPresenting = false;\n Object.defineProperty(this, 'isConnected', {\n get: function get() {\n deprecateWarning('VRDisplay.prototype.isConnected', 'VRDisplayCapabilities.prototype.hasExternalDisplay');\n return false;\n }\n });\n this.capabilities = new VRDisplayCapabilities({\n hasPosition: false,\n hasOrientation: false,\n hasExternalDisplay: false,\n canPresent: false,\n maxLayers: 1\n });\n this.stageParameters = null;\n this.waitingForPresent_ = false;\n this.layer_ = null;\n this.originalParent_ = null;\n this.fullscreenElement_ = null;\n this.fullscreenWrapper_ = null;\n this.fullscreenElementCachedStyle_ = null;\n this.fullscreenEventTarget_ = null;\n this.fullscreenChangeHandler_ = null;\n this.fullscreenErrorHandler_ = null;\n if (USE_WAKELOCK && isMobile()) {\n this.wakelock_ = new NoSleep$1();\n }\n}\nVRDisplay.prototype.getFrameData = function (frameData) {\n return frameDataFromPose(frameData, this._getPose(), this);\n};\nVRDisplay.prototype.getPose = function () {\n deprecateWarning('VRDisplay.prototype.getPose', 'VRDisplay.prototype.getFrameData');\n return this._getPose();\n};\nVRDisplay.prototype.resetPose = function () {\n deprecateWarning('VRDisplay.prototype.resetPose');\n return this._resetPose();\n};\nVRDisplay.prototype.getImmediatePose = function () {\n deprecateWarning('VRDisplay.prototype.getImmediatePose', 'VRDisplay.prototype.getFrameData');\n return this._getPose();\n};\nVRDisplay.prototype.requestAnimationFrame = function (callback) {\n return raf(callback);\n};\nVRDisplay.prototype.cancelAnimationFrame = function (id) {\n return caf(id);\n};\nVRDisplay.prototype.wrapForFullscreen = function (element) {\n if (isIOS()) {\n return element;\n }\n if (!this.fullscreenWrapper_) {\n this.fullscreenWrapper_ = document.createElement('div');\n var cssProperties = ['height: ' + Math.min(screen.height, screen.width) + 'px !important', 'top: 0 !important', 'left: 0 !important', 'right: 0 !important', 'border: 0', 'margin: 0', 'padding: 0', 'z-index: 999999 !important', 'position: fixed'];\n this.fullscreenWrapper_.setAttribute('style', cssProperties.join('; ') + ';');\n this.fullscreenWrapper_.classList.add('webvr-polyfill-fullscreen-wrapper');\n }\n if (this.fullscreenElement_ == element) {\n return this.fullscreenWrapper_;\n }\n if (this.fullscreenElement_) {\n if (this.originalParent_) {\n this.originalParent_.appendChild(this.fullscreenElement_);\n } else {\n this.fullscreenElement_.parentElement.removeChild(this.fullscreenElement_);\n }\n }\n this.fullscreenElement_ = element;\n this.originalParent_ = element.parentElement;\n if (!this.originalParent_) {\n document.body.appendChild(element);\n }\n if (!this.fullscreenWrapper_.parentElement) {\n var parent = this.fullscreenElement_.parentElement;\n parent.insertBefore(this.fullscreenWrapper_, this.fullscreenElement_);\n parent.removeChild(this.fullscreenElement_);\n }\n this.fullscreenWrapper_.insertBefore(this.fullscreenElement_, this.fullscreenWrapper_.firstChild);\n this.fullscreenElementCachedStyle_ = this.fullscreenElement_.getAttribute('style');\n var self = this;\n function applyFullscreenElementStyle() {\n if (!self.fullscreenElement_) {\n return;\n }\n var cssProperties = ['position: absolute', 'top: 0', 'left: 0', 'width: ' + Math.max(screen.width, screen.height) + 'px', 'height: ' + Math.min(screen.height, screen.width) + 'px', 'border: 0', 'margin: 0', 'padding: 0'];\n self.fullscreenElement_.setAttribute('style', cssProperties.join('; ') + ';');\n }\n applyFullscreenElementStyle();\n return this.fullscreenWrapper_;\n};\nVRDisplay.prototype.removeFullscreenWrapper = function () {\n if (!this.fullscreenElement_) {\n return;\n }\n var element = this.fullscreenElement_;\n if (this.fullscreenElementCachedStyle_) {\n element.setAttribute('style', this.fullscreenElementCachedStyle_);\n } else {\n element.removeAttribute('style');\n }\n this.fullscreenElement_ = null;\n this.fullscreenElementCachedStyle_ = null;\n var parent = this.fullscreenWrapper_.parentElement;\n this.fullscreenWrapper_.removeChild(element);\n if (this.originalParent_ === parent) {\n parent.insertBefore(element, this.fullscreenWrapper_);\n }\n else if (this.originalParent_) {\n this.originalParent_.appendChild(element);\n }\n parent.removeChild(this.fullscreenWrapper_);\n return element;\n};\nVRDisplay.prototype.requestPresent = function (layers) {\n var wasPresenting = this.isPresenting;\n var self = this;\n if (!(layers instanceof Array)) {\n deprecateWarning('VRDisplay.prototype.requestPresent with non-array argument', 'an array of VRLayers as the first argument');\n layers = [layers];\n }\n return new Promise(function (resolve, reject) {\n if (!self.capabilities.canPresent) {\n reject(new Error('VRDisplay is not capable of presenting.'));\n return;\n }\n if (layers.length == 0 || layers.length > self.capabilities.maxLayers) {\n reject(new Error('Invalid number of layers.'));\n return;\n }\n var incomingLayer = layers[0];\n if (!incomingLayer.source) {\n resolve();\n return;\n }\n var leftBounds = incomingLayer.leftBounds || defaultLeftBounds;\n var rightBounds = incomingLayer.rightBounds || defaultRightBounds;\n if (wasPresenting) {\n var layer = self.layer_;\n if (layer.source !== incomingLayer.source) {\n layer.source = incomingLayer.source;\n }\n for (var i = 0; i < 4; i++) {\n layer.leftBounds[i] = leftBounds[i];\n layer.rightBounds[i] = rightBounds[i];\n }\n self.wrapForFullscreen(self.layer_.source);\n self.updatePresent_();\n resolve();\n return;\n }\n self.layer_ = {\n predistorted: incomingLayer.predistorted,\n source: incomingLayer.source,\n leftBounds: leftBounds.slice(0),\n rightBounds: rightBounds.slice(0)\n };\n self.waitingForPresent_ = false;\n if (self.layer_ && self.layer_.source) {\n var fullscreenElement = self.wrapForFullscreen(self.layer_.source);\n var onFullscreenChange = function onFullscreenChange() {\n var actualFullscreenElement = getFullscreenElement();\n self.isPresenting = fullscreenElement === actualFullscreenElement;\n if (self.isPresenting) {\n if (screen.orientation && screen.orientation.lock) {\n screen.orientation.lock('landscape-primary').catch(function (error) {\n console.error('screen.orientation.lock() failed due to', error.message);\n });\n }\n self.waitingForPresent_ = false;\n self.beginPresent_();\n resolve();\n } else {\n if (screen.orientation && screen.orientation.unlock) {\n screen.orientation.unlock();\n }\n self.removeFullscreenWrapper();\n self.disableWakeLock();\n self.endPresent_();\n self.removeFullscreenListeners_();\n }\n self.fireVRDisplayPresentChange_();\n };\n var onFullscreenError = function onFullscreenError() {\n if (!self.waitingForPresent_) {\n return;\n }\n self.removeFullscreenWrapper();\n self.removeFullscreenListeners_();\n self.disableWakeLock();\n self.waitingForPresent_ = false;\n self.isPresenting = false;\n reject(new Error('Unable to present.'));\n };\n self.addFullscreenListeners_(fullscreenElement, onFullscreenChange, onFullscreenError);\n if (requestFullscreen(fullscreenElement)) {\n self.enableWakeLock();\n self.waitingForPresent_ = true;\n } else if (isIOS() || isWebViewAndroid()) {\n self.enableWakeLock();\n self.isPresenting = true;\n self.beginPresent_();\n self.fireVRDisplayPresentChange_();\n resolve();\n }\n }\n if (!self.waitingForPresent_ && !isIOS()) {\n exitFullscreen();\n reject(new Error('Unable to present.'));\n }\n });\n};\nVRDisplay.prototype.exitPresent = function () {\n var wasPresenting = this.isPresenting;\n var self = this;\n this.isPresenting = false;\n this.layer_ = null;\n this.disableWakeLock();\n return new Promise(function (resolve, reject) {\n if (wasPresenting) {\n if (!exitFullscreen() && isIOS()) {\n self.endPresent_();\n self.fireVRDisplayPresentChange_();\n }\n if (isWebViewAndroid()) {\n self.removeFullscreenWrapper();\n self.removeFullscreenListeners_();\n self.endPresent_();\n self.fireVRDisplayPresentChange_();\n }\n resolve();\n } else {\n reject(new Error('Was not presenting to VRDisplay.'));\n }\n });\n};\nVRDisplay.prototype.getLayers = function () {\n if (this.layer_) {\n return [this.layer_];\n }\n return [];\n};\nVRDisplay.prototype.fireVRDisplayPresentChange_ = function () {\n var event = new CustomEvent('vrdisplaypresentchange', { detail: { display: this } });\n window.dispatchEvent(event);\n};\nVRDisplay.prototype.fireVRDisplayConnect_ = function () {\n var event = new CustomEvent('vrdisplayconnect', { detail: { display: this } });\n window.dispatchEvent(event);\n};\nVRDisplay.prototype.addFullscreenListeners_ = function (element, changeHandler, errorHandler) {\n this.removeFullscreenListeners_();\n this.fullscreenEventTarget_ = element;\n this.fullscreenChangeHandler_ = changeHandler;\n this.fullscreenErrorHandler_ = errorHandler;\n if (changeHandler) {\n if (document.fullscreenEnabled) {\n element.addEventListener('fullscreenchange', changeHandler, false);\n } else if (document.webkitFullscreenEnabled) {\n element.addEventListener('webkitfullscreenchange', changeHandler, false);\n } else if (document.mozFullScreenEnabled) {\n document.addEventListener('mozfullscreenchange', changeHandler, false);\n } else if (document.msFullscreenEnabled) {\n element.addEventListener('msfullscreenchange', changeHandler, false);\n }\n }\n if (errorHandler) {\n if (document.fullscreenEnabled) {\n element.addEventListener('fullscreenerror', errorHandler, false);\n } else if (document.webkitFullscreenEnabled) {\n element.addEventListener('webkitfullscreenerror', errorHandler, false);\n } else if (document.mozFullScreenEnabled) {\n document.addEventListener('mozfullscreenerror', errorHandler, false);\n } else if (document.msFullscreenEnabled) {\n element.addEventListener('msfullscreenerror', errorHandler, false);\n }\n }\n};\nVRDisplay.prototype.removeFullscreenListeners_ = function () {\n if (!this.fullscreenEventTarget_) return;\n var element = this.fullscreenEventTarget_;\n if (this.fullscreenChangeHandler_) {\n var changeHandler = this.fullscreenChangeHandler_;\n element.removeEventListener('fullscreenchange', changeHandler, false);\n element.removeEventListener('webkitfullscreenchange', changeHandler, false);\n document.removeEventListener('mozfullscreenchange', changeHandler, false);\n element.removeEventListener('msfullscreenchange', changeHandler, false);\n }\n if (this.fullscreenErrorHandler_) {\n var errorHandler = this.fullscreenErrorHandler_;\n element.removeEventListener('fullscreenerror', errorHandler, false);\n element.removeEventListener('webkitfullscreenerror', errorHandler, false);\n document.removeEventListener('mozfullscreenerror', errorHandler, false);\n element.removeEventListener('msfullscreenerror', errorHandler, false);\n }\n this.fullscreenEventTarget_ = null;\n this.fullscreenChangeHandler_ = null;\n this.fullscreenErrorHandler_ = null;\n};\nVRDisplay.prototype.enableWakeLock = function () {\n if (this.wakelock_) {\n this.wakelock_.enable();\n }\n};\nVRDisplay.prototype.disableWakeLock = function () {\n if (this.wakelock_) {\n this.wakelock_.disable();\n }\n};\nVRDisplay.prototype.beginPresent_ = function () {\n};\nVRDisplay.prototype.endPresent_ = function () {\n};\nVRDisplay.prototype.submitFrame = function (pose) {\n};\nVRDisplay.prototype.getEyeParameters = function (whichEye) {\n return null;\n};\nvar config = {\n ADDITIONAL_VIEWERS: [],\n DEFAULT_VIEWER: '',\n MOBILE_WAKE_LOCK: true,\n DEBUG: false,\n DPDB_URL: 'https://dpdb.webvr.rocks/dpdb.json',\n K_FILTER: 0.98,\n PREDICTION_TIME_S: 0.040,\n CARDBOARD_UI_DISABLED: false,\n ROTATE_INSTRUCTIONS_DISABLED: false,\n YAW_ONLY: false,\n BUFFER_SCALE: 0.5,\n DIRTY_SUBMIT_FRAME_BINDINGS: false\n};\nvar Eye = {\n LEFT: 'left',\n RIGHT: 'right'\n};\nfunction CardboardVRDisplay(config$$1) {\n var defaults = extend({}, config);\n config$$1 = extend(defaults, config$$1 || {});\n VRDisplay.call(this, {\n wakelock: config$$1.MOBILE_WAKE_LOCK\n });\n this.config = config$$1;\n this.displayName = 'Cardboard VRDisplay';\n this.capabilities = new VRDisplayCapabilities({\n hasPosition: false,\n hasOrientation: true,\n hasExternalDisplay: false,\n canPresent: true,\n maxLayers: 1\n });\n this.stageParameters = null;\n this.bufferScale_ = this.config.BUFFER_SCALE;\n this.poseSensor_ = new PoseSensor(this.config);\n this.distorter_ = null;\n this.cardboardUI_ = null;\n this.dpdb_ = new Dpdb(this.config.DPDB_URL, this.onDeviceParamsUpdated_.bind(this));\n this.deviceInfo_ = new DeviceInfo(this.dpdb_.getDeviceParams(), config$$1.ADDITIONAL_VIEWERS);\n this.viewerSelector_ = new ViewerSelector(config$$1.DEFAULT_VIEWER);\n this.viewerSelector_.onChange(this.onViewerChanged_.bind(this));\n this.deviceInfo_.setViewer(this.viewerSelector_.getCurrentViewer());\n if (!this.config.ROTATE_INSTRUCTIONS_DISABLED) {\n this.rotateInstructions_ = new RotateInstructions();\n }\n if (isIOS()) {\n window.addEventListener('resize', this.onResize_.bind(this));\n }\n}\nCardboardVRDisplay.prototype = Object.create(VRDisplay.prototype);\nCardboardVRDisplay.prototype._getPose = function () {\n return {\n position: null,\n orientation: this.poseSensor_.getOrientation(),\n linearVelocity: null,\n linearAcceleration: null,\n angularVelocity: null,\n angularAcceleration: null\n };\n};\nCardboardVRDisplay.prototype._resetPose = function () {\n if (this.poseSensor_.resetPose) {\n this.poseSensor_.resetPose();\n }\n};\nCardboardVRDisplay.prototype._getFieldOfView = function (whichEye) {\n var fieldOfView;\n if (whichEye == Eye.LEFT) {\n fieldOfView = this.deviceInfo_.getFieldOfViewLeftEye();\n } else if (whichEye == Eye.RIGHT) {\n fieldOfView = this.deviceInfo_.getFieldOfViewRightEye();\n } else {\n console.error('Invalid eye provided: %s', whichEye);\n return null;\n }\n return fieldOfView;\n};\nCardboardVRDisplay.prototype._getEyeOffset = function (whichEye) {\n var offset;\n if (whichEye == Eye.LEFT) {\n offset = [-this.deviceInfo_.viewer.interLensDistance * 0.5, 0.0, 0.0];\n } else if (whichEye == Eye.RIGHT) {\n offset = [this.deviceInfo_.viewer.interLensDistance * 0.5, 0.0, 0.0];\n } else {\n console.error('Invalid eye provided: %s', whichEye);\n return null;\n }\n return offset;\n};\nCardboardVRDisplay.prototype.getEyeParameters = function (whichEye) {\n var offset = this._getEyeOffset(whichEye);\n var fieldOfView = this._getFieldOfView(whichEye);\n var eyeParams = {\n offset: offset,\n renderWidth: this.deviceInfo_.device.width * 0.5 * this.bufferScale_,\n renderHeight: this.deviceInfo_.device.height * this.bufferScale_\n };\n Object.defineProperty(eyeParams, 'fieldOfView', {\n enumerable: true,\n get: function get() {\n deprecateWarning('VRFieldOfView', 'VRFrameData\\'s projection matrices');\n return fieldOfView;\n }\n });\n return eyeParams;\n};\nCardboardVRDisplay.prototype.onDeviceParamsUpdated_ = function (newParams) {\n if (this.config.DEBUG) {\n console.log('DPDB reported that device params were updated.');\n }\n this.deviceInfo_.updateDeviceParams(newParams);\n if (this.distorter_) {\n this.distorter_.updateDeviceInfo(this.deviceInfo_);\n }\n};\nCardboardVRDisplay.prototype.updateBounds_ = function () {\n if (this.layer_ && this.distorter_ && (this.layer_.leftBounds || this.layer_.rightBounds)) {\n this.distorter_.setTextureBounds(this.layer_.leftBounds, this.layer_.rightBounds);\n }\n};\nCardboardVRDisplay.prototype.beginPresent_ = function () {\n var gl = this.layer_.source.getContext('webgl');\n if (!gl) gl = this.layer_.source.getContext('experimental-webgl');\n if (!gl) gl = this.layer_.source.getContext('webgl2');\n if (!gl) return;\n if (this.layer_.predistorted) {\n if (!this.config.CARDBOARD_UI_DISABLED) {\n gl.canvas.width = getScreenWidth() * this.bufferScale_;\n gl.canvas.height = getScreenHeight() * this.bufferScale_;\n this.cardboardUI_ = new CardboardUI(gl);\n }\n } else {\n if (!this.config.CARDBOARD_UI_DISABLED) {\n this.cardboardUI_ = new CardboardUI(gl);\n }\n this.distorter_ = new CardboardDistorter(gl, this.cardboardUI_, this.config.BUFFER_SCALE, this.config.DIRTY_SUBMIT_FRAME_BINDINGS);\n this.distorter_.updateDeviceInfo(this.deviceInfo_);\n }\n if (this.cardboardUI_) {\n this.cardboardUI_.listen(function (e) {\n this.viewerSelector_.show(this.layer_.source.parentElement);\n e.stopPropagation();\n e.preventDefault();\n }.bind(this), function (e) {\n this.exitPresent();\n e.stopPropagation();\n e.preventDefault();\n }.bind(this));\n }\n if (this.rotateInstructions_) {\n if (isLandscapeMode() && isMobile()) {\n this.rotateInstructions_.showTemporarily(3000, this.layer_.source.parentElement);\n } else {\n this.rotateInstructions_.update();\n }\n }\n this.orientationHandler = this.onOrientationChange_.bind(this);\n window.addEventListener('orientationchange', this.orientationHandler);\n this.vrdisplaypresentchangeHandler = this.updateBounds_.bind(this);\n window.addEventListener('vrdisplaypresentchange', this.vrdisplaypresentchangeHandler);\n this.fireVRDisplayDeviceParamsChange_();\n};\nCardboardVRDisplay.prototype.endPresent_ = function () {\n if (this.distorter_) {\n this.distorter_.destroy();\n this.distorter_ = null;\n }\n if (this.cardboardUI_) {\n this.cardboardUI_.destroy();\n this.cardboardUI_ = null;\n }\n if (this.rotateInstructions_) {\n this.rotateInstructions_.hide();\n }\n this.viewerSelector_.hide();\n window.removeEventListener('orientationchange', this.orientationHandler);\n window.removeEventListener('vrdisplaypresentchange', this.vrdisplaypresentchangeHandler);\n};\nCardboardVRDisplay.prototype.updatePresent_ = function () {\n this.endPresent_();\n this.beginPresent_();\n};\nCardboardVRDisplay.prototype.submitFrame = function (pose) {\n if (this.distorter_) {\n this.updateBounds_();\n this.distorter_.submitFrame();\n } else if (this.cardboardUI_ && this.layer_) {\n var gl = this.layer_.source.getContext('webgl');\n if (!gl) gl = this.layer_.source.getContext('experimental-webgl');\n if (!gl) gl = this.layer_.source.getContext('webgl2');\n var canvas = gl.canvas;\n if (canvas.width != this.lastWidth || canvas.height != this.lastHeight) {\n this.cardboardUI_.onResize();\n }\n this.lastWidth = canvas.width;\n this.lastHeight = canvas.height;\n this.cardboardUI_.render();\n }\n};\nCardboardVRDisplay.prototype.onOrientationChange_ = function (e) {\n this.viewerSelector_.hide();\n if (this.rotateInstructions_) {\n this.rotateInstructions_.update();\n }\n this.onResize_();\n};\nCardboardVRDisplay.prototype.onResize_ = function (e) {\n if (this.layer_) {\n var gl = this.layer_.source.getContext('webgl');\n if (!gl) gl = this.layer_.source.getContext('experimental-webgl');\n if (!gl) gl = this.layer_.source.getContext('webgl2');\n var cssProperties = ['position: absolute', 'top: 0', 'left: 0',\n 'width: 100vw', 'height: 100vh', 'border: 0', 'margin: 0',\n 'padding: 0px', 'box-sizing: content-box'];\n gl.canvas.setAttribute('style', cssProperties.join('; ') + ';');\n safariCssSizeWorkaround(gl.canvas);\n }\n};\nCardboardVRDisplay.prototype.onViewerChanged_ = function (viewer) {\n this.deviceInfo_.setViewer(viewer);\n if (this.distorter_) {\n this.distorter_.updateDeviceInfo(this.deviceInfo_);\n }\n this.fireVRDisplayDeviceParamsChange_();\n};\nCardboardVRDisplay.prototype.fireVRDisplayDeviceParamsChange_ = function () {\n var event = new CustomEvent('vrdisplaydeviceparamschange', {\n detail: {\n vrdisplay: this,\n deviceInfo: this.deviceInfo_\n }\n });\n window.dispatchEvent(event);\n};\nCardboardVRDisplay.VRFrameData = VRFrameData;\nCardboardVRDisplay.VRDisplay = VRDisplay;\nreturn CardboardVRDisplay;\n})));\n});\nvar CardboardVRDisplay = unwrapExports(cardboardVrDisplay);\n\nvar version = \"0.10.12\";\n\nvar DefaultConfig = {\n ADDITIONAL_VIEWERS: [],\n DEFAULT_VIEWER: '',\n PROVIDE_MOBILE_VRDISPLAY: true,\n MOBILE_WAKE_LOCK: true,\n DEBUG: false,\n DPDB_URL: 'https://dpdb.webvr.rocks/dpdb.json',\n K_FILTER: 0.98,\n PREDICTION_TIME_S: 0.040,\n CARDBOARD_UI_DISABLED: false,\n ROTATE_INSTRUCTIONS_DISABLED: false,\n YAW_ONLY: false,\n BUFFER_SCALE: 0.5,\n DIRTY_SUBMIT_FRAME_BINDINGS: false\n};\n\nfunction WebVRPolyfill(config) {\n this.config = extend(extend({}, DefaultConfig), config);\n this.polyfillDisplays = [];\n this.enabled = false;\n this.hasNative = 'getVRDisplays' in navigator;\n this.native = {};\n this.native.getVRDisplays = navigator.getVRDisplays;\n this.native.VRFrameData = window.VRFrameData;\n this.native.VRDisplay = window.VRDisplay;\n if (!this.hasNative || this.config.PROVIDE_MOBILE_VRDISPLAY && isMobile()) {\n this.enable();\n this.getVRDisplays().then(function (displays) {\n if (displays && displays[0] && displays[0].fireVRDisplayConnect_) {\n displays[0].fireVRDisplayConnect_();\n }\n });\n }\n}\nWebVRPolyfill.prototype.getPolyfillDisplays = function () {\n if (this._polyfillDisplaysPopulated) {\n return this.polyfillDisplays;\n }\n if (isMobile()) {\n var vrDisplay = new CardboardVRDisplay({\n ADDITIONAL_VIEWERS: this.config.ADDITIONAL_VIEWERS,\n DEFAULT_VIEWER: this.config.DEFAULT_VIEWER,\n MOBILE_WAKE_LOCK: this.config.MOBILE_WAKE_LOCK,\n DEBUG: this.config.DEBUG,\n DPDB_URL: this.config.DPDB_URL,\n CARDBOARD_UI_DISABLED: this.config.CARDBOARD_UI_DISABLED,\n K_FILTER: this.config.K_FILTER,\n PREDICTION_TIME_S: this.config.PREDICTION_TIME_S,\n ROTATE_INSTRUCTIONS_DISABLED: this.config.ROTATE_INSTRUCTIONS_DISABLED,\n YAW_ONLY: this.config.YAW_ONLY,\n BUFFER_SCALE: this.config.BUFFER_SCALE,\n DIRTY_SUBMIT_FRAME_BINDINGS: this.config.DIRTY_SUBMIT_FRAME_BINDINGS\n });\n this.polyfillDisplays.push(vrDisplay);\n }\n this._polyfillDisplaysPopulated = true;\n return this.polyfillDisplays;\n};\nWebVRPolyfill.prototype.enable = function () {\n this.enabled = true;\n if (this.hasNative && this.native.VRFrameData) {\n var NativeVRFrameData = this.native.VRFrameData;\n var nativeFrameData = new this.native.VRFrameData();\n var nativeGetFrameData = this.native.VRDisplay.prototype.getFrameData;\n window.VRDisplay.prototype.getFrameData = function (frameData) {\n if (frameData instanceof NativeVRFrameData) {\n nativeGetFrameData.call(this, frameData);\n return;\n }\n nativeGetFrameData.call(this, nativeFrameData);\n frameData.pose = nativeFrameData.pose;\n copyArray(nativeFrameData.leftProjectionMatrix, frameData.leftProjectionMatrix);\n copyArray(nativeFrameData.rightProjectionMatrix, frameData.rightProjectionMatrix);\n copyArray(nativeFrameData.leftViewMatrix, frameData.leftViewMatrix);\n copyArray(nativeFrameData.rightViewMatrix, frameData.rightViewMatrix);\n };\n }\n navigator.getVRDisplays = this.getVRDisplays.bind(this);\n window.VRDisplay = CardboardVRDisplay.VRDisplay;\n window.VRFrameData = CardboardVRDisplay.VRFrameData;\n};\nWebVRPolyfill.prototype.getVRDisplays = function () {\n var _this = this;\n var config = this.config;\n if (!this.hasNative) {\n return Promise.resolve(this.getPolyfillDisplays());\n }\n return this.native.getVRDisplays.call(navigator).then(function (nativeDisplays) {\n return nativeDisplays.length > 0 ? nativeDisplays : _this.getPolyfillDisplays();\n });\n};\nWebVRPolyfill.version = version;\nWebVRPolyfill.VRFrameData = CardboardVRDisplay.VRFrameData;\nWebVRPolyfill.VRDisplay = CardboardVRDisplay.VRDisplay;\n\n\nvar webvrPolyfill = Object.freeze({\n\tdefault: WebVRPolyfill\n});\n\nvar require$$0 = ( webvrPolyfill && WebVRPolyfill ) || webvrPolyfill;\n\nif (typeof commonjsGlobal !== 'undefined' && commonjsGlobal.window) {\n if (!commonjsGlobal.document) {\n commonjsGlobal.document = commonjsGlobal.window.document;\n }\n if (!commonjsGlobal.navigator) {\n commonjsGlobal.navigator = commonjsGlobal.window.navigator;\n }\n}\nvar src = require$$0;\n\nreturn src;\n\n})));\n","var newline = /\\n/\nvar newlineChar = '\\n'\nvar whitespace = /\\s/\n\nmodule.exports = function(text, opt) {\n var lines = module.exports.lines(text, opt)\n return lines.map(function(line) {\n return text.substring(line.start, line.end)\n }).join('\\n')\n}\n\nmodule.exports.lines = function wordwrap(text, opt) {\n opt = opt||{}\n\n //zero width results in nothing visible\n if (opt.width === 0 && opt.mode !== 'nowrap') \n return []\n\n text = text||''\n var width = typeof opt.width === 'number' ? opt.width : Number.MAX_VALUE\n var start = Math.max(0, opt.start||0)\n var end = typeof opt.end === 'number' ? opt.end : text.length\n var mode = opt.mode\n\n var measure = opt.measure || monospace\n if (mode === 'pre')\n return pre(measure, text, start, end, width)\n else\n return greedy(measure, text, start, end, width, mode)\n}\n\nfunction idxOf(text, chr, start, end) {\n var idx = text.indexOf(chr, start)\n if (idx === -1 || idx > end)\n return end\n return idx\n}\n\nfunction isWhitespace(chr) {\n return whitespace.test(chr)\n}\n\nfunction pre(measure, text, start, end, width) {\n var lines = []\n var lineStart = start\n for (var i=start; i<end && i<text.length; i++) {\n var chr = text.charAt(i)\n var isNewline = newline.test(chr)\n\n //If we've reached a newline, then step down a line\n //Or if we've reached the EOF\n if (isNewline || i===end-1) {\n var lineEnd = isNewline ? i : i+1\n var measured = measure(text, lineStart, lineEnd, width)\n lines.push(measured)\n \n lineStart = i+1\n }\n }\n return lines\n}\n\nfunction greedy(measure, text, start, end, width, mode) {\n //A greedy word wrapper based on LibGDX algorithm\n //https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/BitmapFontCache.java\n var lines = []\n\n var testWidth = width\n //if 'nowrap' is specified, we only wrap on newline chars\n if (mode === 'nowrap')\n testWidth = Number.MAX_VALUE\n\n while (start < end && start < text.length) {\n //get next newline position\n var newLine = idxOf(text, newlineChar, start, end)\n\n //eat whitespace at start of line\n while (start < newLine) {\n if (!isWhitespace( text.charAt(start) ))\n break\n start++\n }\n\n //determine visible # of glyphs for the available width\n var measured = measure(text, start, newLine, testWidth)\n\n var lineEnd = start + (measured.end-measured.start)\n var nextStart = lineEnd + newlineChar.length\n\n //if we had to cut the line before the next newline...\n if (lineEnd < newLine) {\n //find char to break on\n while (lineEnd > start) {\n if (isWhitespace(text.charAt(lineEnd)))\n break\n lineEnd--\n }\n if (lineEnd === start) {\n if (nextStart > start + newlineChar.length) nextStart--\n lineEnd = nextStart // If no characters to break, show all.\n } else {\n nextStart = lineEnd\n //eat whitespace at end of line\n while (lineEnd > start) {\n if (!isWhitespace(text.charAt(lineEnd - newlineChar.length)))\n break\n lineEnd--\n }\n }\n }\n if (lineEnd >= start) {\n var result = measure(text, start, lineEnd, testWidth)\n lines.push(result)\n }\n start = nextStart\n }\n return lines\n}\n\n//determines the visible number of glyphs within a given width\nfunction monospace(text, start, end, width) {\n var glyphs = Math.min(width, end-start)\n return {\n start: start,\n end: start+glyphs\n }\n}","\"use strict\";\nvar window = require(\"global/window\")\nvar isFunction = require(\"is-function\")\nvar parseHeaders = require(\"parse-headers\")\nvar xtend = require(\"xtend\")\n\nmodule.exports = createXHR\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = createXHR;\ncreateXHR.XMLHttpRequest = window.XMLHttpRequest || noop\ncreateXHR.XDomainRequest = \"withCredentials\" in (new createXHR.XMLHttpRequest()) ? createXHR.XMLHttpRequest : window.XDomainRequest\n\nforEachArray([\"get\", \"put\", \"post\", \"patch\", \"head\", \"delete\"], function(method) {\n createXHR[method === \"delete\" ? \"del\" : method] = function(uri, options, callback) {\n options = initParams(uri, options, callback)\n options.method = method.toUpperCase()\n return _createXHR(options)\n }\n})\n\nfunction forEachArray(array, iterator) {\n for (var i = 0; i < array.length; i++) {\n iterator(array[i])\n }\n}\n\nfunction isEmpty(obj){\n for(var i in obj){\n if(obj.hasOwnProperty(i)) return false\n }\n return true\n}\n\nfunction initParams(uri, options, callback) {\n var params = uri\n\n if (isFunction(options)) {\n callback = options\n if (typeof uri === \"string\") {\n params = {uri:uri}\n }\n } else {\n params = xtend(options, {uri: uri})\n }\n\n params.callback = callback\n return params\n}\n\nfunction createXHR(uri, options, callback) {\n options = initParams(uri, options, callback)\n return _createXHR(options)\n}\n\nfunction _createXHR(options) {\n if(typeof options.callback === \"undefined\"){\n throw new Error(\"callback argument missing\")\n }\n\n var called = false\n var callback = function cbOnce(err, response, body){\n if(!called){\n called = true\n options.callback(err, response, body)\n }\n }\n\n function readystatechange() {\n if (xhr.readyState === 4) {\n setTimeout(loadFunc, 0)\n }\n }\n\n function getBody() {\n // Chrome with requestType=blob throws errors arround when even testing access to responseText\n var body = undefined\n\n if (xhr.response) {\n body = xhr.response\n } else {\n body = xhr.responseText || getXml(xhr)\n }\n\n if (isJson) {\n try {\n body = JSON.parse(body)\n } catch (e) {}\n }\n\n return body\n }\n\n function errorFunc(evt) {\n clearTimeout(timeoutTimer)\n if(!(evt instanceof Error)){\n evt = new Error(\"\" + (evt || \"Unknown XMLHttpRequest Error\") )\n }\n evt.statusCode = 0\n return callback(evt, failureResponse)\n }\n\n // will load the data & process the response in a special response object\n function loadFunc() {\n if (aborted) return\n var status\n clearTimeout(timeoutTimer)\n if(options.useXDR && xhr.status===undefined) {\n //IE8 CORS GET successful response doesn't have a status field, but body is fine\n status = 200\n } else {\n status = (xhr.status === 1223 ? 204 : xhr.status)\n }\n var response = failureResponse\n var err = null\n\n if (status !== 0){\n response = {\n body: getBody(),\n statusCode: status,\n method: method,\n headers: {},\n url: uri,\n rawRequest: xhr\n }\n if(xhr.getAllResponseHeaders){ //remember xhr can in fact be XDR for CORS in IE\n response.headers = parseHeaders(xhr.getAllResponseHeaders())\n }\n } else {\n err = new Error(\"Internal XMLHttpRequest Error\")\n }\n return callback(err, response, response.body)\n }\n\n var xhr = options.xhr || null\n\n if (!xhr) {\n if (options.cors || options.useXDR) {\n xhr = new createXHR.XDomainRequest()\n }else{\n xhr = new createXHR.XMLHttpRequest()\n }\n }\n\n var key\n var aborted\n var uri = xhr.url = options.uri || options.url\n var method = xhr.method = options.method || \"GET\"\n var body = options.body || options.data\n var headers = xhr.headers = options.headers || {}\n var sync = !!options.sync\n var isJson = false\n var timeoutTimer\n var failureResponse = {\n body: undefined,\n headers: {},\n statusCode: 0,\n method: method,\n url: uri,\n rawRequest: xhr\n }\n\n if (\"json\" in options && options.json !== false) {\n isJson = true\n headers[\"accept\"] || headers[\"Accept\"] || (headers[\"Accept\"] = \"application/json\") //Don't override existing accept header declared by user\n if (method !== \"GET\" && method !== \"HEAD\") {\n headers[\"content-type\"] || headers[\"Content-Type\"] || (headers[\"Content-Type\"] = \"application/json\") //Don't override existing accept header declared by user\n body = JSON.stringify(options.json === true ? body : options.json)\n }\n }\n\n xhr.onreadystatechange = readystatechange\n xhr.onload = loadFunc\n xhr.onerror = errorFunc\n // IE9 must have onprogress be set to a unique function.\n xhr.onprogress = function () {\n // IE must die\n }\n xhr.onabort = function(){\n aborted = true;\n }\n xhr.ontimeout = errorFunc\n xhr.open(method, uri, !sync, options.username, options.password)\n //has to be after open\n if(!sync) {\n xhr.withCredentials = !!options.withCredentials\n }\n // Cannot set timeout with sync request\n // not setting timeout on the xhr object, because of old webkits etc. not handling that correctly\n // both npm's request and jquery 1.x use this kind of timeout, so this is being consistent\n if (!sync && options.timeout > 0 ) {\n timeoutTimer = setTimeout(function(){\n if (aborted) return\n aborted = true//IE9 may still call readystatechange\n xhr.abort(\"timeout\")\n var e = new Error(\"XMLHttpRequest timeout\")\n e.code = \"ETIMEDOUT\"\n errorFunc(e)\n }, options.timeout )\n }\n\n if (xhr.setRequestHeader) {\n for(key in headers){\n if(headers.hasOwnProperty(key)){\n xhr.setRequestHeader(key, headers[key])\n }\n }\n } else if (options.headers && !isEmpty(options.headers)) {\n throw new Error(\"Headers cannot be set on an XDomainRequest object\")\n }\n\n if (\"responseType\" in options) {\n xhr.responseType = options.responseType\n }\n\n if (\"beforeSend\" in options &&\n typeof options.beforeSend === \"function\"\n ) {\n options.beforeSend(xhr)\n }\n\n // Microsoft Edge browser sends \"undefined\" when send is called with undefined value.\n // XMLHttpRequest spec says to pass null as body to indicate no body\n // See https://github.com/naugtur/xhr/issues/100.\n xhr.send(body || null)\n\n return xhr\n\n\n}\n\nfunction getXml(xhr) {\n // xhr.responseXML will throw Exception \"InvalidStateError\" or \"DOMException\"\n // See https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/responseXML.\n try {\n if (xhr.responseType === \"document\") {\n return xhr.responseXML\n }\n var firefoxBugTakenEffect = xhr.responseXML && xhr.responseXML.documentElement.nodeName === \"parsererror\"\n if (xhr.responseType === \"\" && !firefoxBugTakenEffect) {\n return xhr.responseXML\n }\n } catch (e) {}\n\n return null\n}\n\nfunction noop() {}\n","module.exports = (function xmlparser() {\n //common browsers\n if (typeof self.DOMParser !== 'undefined') {\n return function(str) {\n var parser = new self.DOMParser()\n return parser.parseFromString(str, 'application/xml')\n }\n } \n\n //IE8 fallback\n if (typeof self.ActiveXObject !== 'undefined'\n && new self.ActiveXObject('Microsoft.XMLDOM')) {\n return function(str) {\n var xmlDoc = new self.ActiveXObject(\"Microsoft.XMLDOM\")\n xmlDoc.async = \"false\"\n xmlDoc.loadXML(str)\n return xmlDoc\n }\n }\n\n //last resort fallback\n return function(str) {\n var div = document.createElement('div')\n div.innerHTML = str\n return div\n }\n})()\n","module.exports = extend\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nfunction extend() {\n var target = {}\n\n for (var i = 0; i < arguments.length; i++) {\n var source = arguments[i]\n\n for (var key in source) {\n if (hasOwnProperty.call(source, key)) {\n target[key] = source[key]\n }\n }\n }\n\n return target\n}\n","var anime = require('super-animejs');\nvar components = require('../core/component').components;\nvar registerComponent = require('../core/component').registerComponent;\nvar THREE = require('../lib/three');\nvar utils = require('../utils');\n\nvar colorHelperFrom = new THREE.Color();\nvar colorHelperTo = new THREE.Color();\n\nvar getComponentProperty = utils.entity.getComponentProperty;\nvar setComponentProperty = utils.entity.setComponentProperty;\nvar splitCache = {};\n\nvar TYPE_COLOR = 'color';\nvar PROP_POSITION = 'position';\nvar PROP_ROTATION = 'rotation';\nvar PROP_SCALE = 'scale';\nvar STRING_COMPONENTS = 'components';\nvar STRING_OBJECT3D = 'object3D';\n\n/**\n * Animation component for A-Frame using anime.js.\n *\n * The component manually controls the tick by setting `autoplay: false` on anime.js and\n * manually * calling `animation.tick()` in the tick handler. To pause or resume, we toggle a\n * boolean * flag * `isAnimationPlaying`.\n *\n * anime.js animation config for tweenining Javascript objects and values works as:\n *\n * config = {\n * targets: {foo: 0.0, bar: '#000'},\n * foo: 1.0,\n * bar: '#FFF'\n * }\n *\n * The above will tween each property in `targets`. The `to` values are set in the root of\n * the config.\n *\n * @member {object} animation - anime.js instance.\n * @member {boolean} animationIsPlaying - Control if animation is playing.\n */\nmodule.exports.Component = registerComponent('animation', {\n schema: {\n autoplay: {default: true},\n delay: {default: 0},\n dir: {default: ''},\n dur: {default: 1000},\n easing: {default: 'easeInQuad'},\n elasticity: {default: 400},\n enabled: {default: true},\n from: {default: ''},\n loop: {\n default: 0,\n parse: function (value) {\n // Boolean or integer.\n if (value === true || value === 'true') { return true; }\n if (value === false || value === 'false') { return false; }\n return parseInt(value, 10);\n }\n },\n property: {default: ''},\n startEvents: {type: 'array'},\n pauseEvents: {type: 'array'},\n resumeEvents: {type: 'array'},\n round: {default: false},\n to: {default: ''},\n type: {default: ''},\n isRawProperty: {default: false}\n },\n\n multiple: true,\n\n init: function () {\n var self = this;\n\n this.eventDetail = {name: this.attrName};\n this.time = 0;\n\n this.animation = null;\n this.animationIsPlaying = false;\n this.onStartEvent = this.onStartEvent.bind(this);\n this.beginAnimation = this.beginAnimation.bind(this);\n this.pauseAnimation = this.pauseAnimation.bind(this);\n this.resumeAnimation = this.resumeAnimation.bind(this);\n\n this.fromColor = {};\n this.toColor = {};\n this.targets = {};\n this.targetsArray = [];\n\n this.updateConfigForDefault = this.updateConfigForDefault.bind(this);\n this.updateConfigForRawColor = this.updateConfigForRawColor.bind(this);\n\n this.config = {\n complete: function () {\n self.animationIsPlaying = false;\n self.el.emit('animationcomplete', self.eventDetail, false);\n if (self.id) {\n self.el.emit('animationcomplete__' + self.id, self.eventDetail, false);\n }\n }\n };\n },\n\n update: function (oldData) {\n var config = this.config;\n var data = this.data;\n\n this.animationIsPlaying = false;\n\n if (!this.data.enabled) { return; }\n\n if (!data.property) { return; }\n\n // Base config.\n config.autoplay = false;\n config.direction = data.dir;\n config.duration = data.dur;\n config.easing = data.easing;\n config.elasticity = data.elasticity;\n config.loop = data.loop;\n config.round = data.round;\n\n // Start new animation.\n this.createAndStartAnimation();\n },\n\n tick: function (t, dt) {\n if (!this.animationIsPlaying) { return; }\n this.time += dt;\n this.animation.tick(this.time);\n },\n\n remove: function () {\n this.pauseAnimation();\n this.removeEventListeners();\n },\n\n pause: function () {\n this.paused = true;\n this.pausedWasPlaying = this.animationIsPlaying;\n this.pauseAnimation();\n this.removeEventListeners();\n },\n\n /**\n * `play` handler only for resuming scene.\n */\n play: function () {\n if (!this.paused) { return; }\n this.paused = false;\n this.addEventListeners();\n if (this.pausedWasPlaying) {\n this.resumeAnimation();\n this.pausedWasPlaying = false;\n }\n },\n\n /**\n * Start animation from scratch.\n */\n createAndStartAnimation: function () {\n var data = this.data;\n\n this.updateConfig();\n this.animationIsPlaying = false;\n this.animation = anime(this.config);\n this.animation.began = true;\n\n this.removeEventListeners();\n this.addEventListeners();\n\n // Wait for start events for animation.\n if (!data.autoplay || data.startEvents && data.startEvents.length) { return; }\n\n // Delay animation.\n if (data.delay) {\n setTimeout(this.beginAnimation, data.delay);\n return;\n }\n\n // Play animation.\n this.beginAnimation();\n },\n\n /**\n * This is before animation start (including from startEvents).\n * Set to initial state (config.from, time = 0, seekTime = 0).\n */\n beginAnimation: function () {\n this.updateConfig();\n this.animation.began = true;\n this.time = 0;\n this.animationIsPlaying = true;\n this.stopRelatedAnimations();\n this.el.emit('animationbegin', this.eventDetail, false);\n },\n\n pauseAnimation: function () {\n this.animationIsPlaying = false;\n },\n\n resumeAnimation: function () {\n this.animationIsPlaying = true;\n },\n\n /**\n * startEvents callback.\n */\n onStartEvent: function () {\n if (!this.data.enabled) { return; }\n\n this.updateConfig();\n if (this.animation) {\n this.animation.pause();\n }\n this.animation = anime(this.config);\n\n // Include the delay before each start event.\n if (this.data.delay) {\n setTimeout(this.beginAnimation, this.data.delay);\n return;\n }\n this.beginAnimation();\n },\n\n /**\n * rawProperty: true and type: color;\n */\n updateConfigForRawColor: function () {\n var config = this.config;\n var data = this.data;\n var el = this.el;\n var from;\n var key;\n var to;\n\n if (this.waitComponentInitRawProperty(this.updateConfigForRawColor)) {\n return;\n }\n\n from = data.from === '' ? getRawProperty(el, data.property) : data.from;\n to = data.to;\n\n // Use r/g/b vector for color type.\n this.setColorConfig(from, to);\n from = this.fromColor;\n to = this.toColor;\n\n this.targetsArray.length = 0;\n this.targetsArray.push(from);\n config.targets = this.targetsArray;\n for (key in to) { config[key] = to[key]; }\n\n config.update = (function () {\n var lastValue = {};\n return function (anim) {\n var value;\n value = anim.animatables[0].target;\n // For animation timeline.\n if (value.r === lastValue.r &&\n value.g === lastValue.g &&\n value.b === lastValue.b) { return; }\n\n setRawProperty(el, data.property, value, data.type);\n };\n })();\n },\n\n /**\n * Stuff property into generic `property` key.\n */\n updateConfigForDefault: function () {\n var config = this.config;\n var data = this.data;\n var el = this.el;\n var from;\n var isBoolean;\n var isNumber;\n var to;\n\n if (this.waitComponentInitRawProperty(this.updateConfigForDefault)) {\n return;\n }\n\n if (data.from === '') {\n // Infer from.\n from = isRawProperty(data)\n ? getRawProperty(el, data.property)\n : getComponentProperty(el, data.property);\n } else {\n // Explicit from.\n from = data.from;\n }\n\n to = data.to;\n\n isNumber = !isNaN(from || to);\n if (isNumber) {\n from = parseFloat(from);\n to = parseFloat(to);\n } else {\n from = from ? from.toString() : from;\n to = to ? to.toString() : to;\n }\n\n // Convert booleans to integer to allow boolean flipping.\n isBoolean = data.to === 'true' || data.to === 'false' ||\n data.to === true || data.to === false;\n if (isBoolean) {\n from = data.from === 'true' || data.from === true ? 1 : 0;\n to = data.to === 'true' || data.to === true ? 1 : 0;\n }\n\n this.targets.aframeProperty = from;\n config.targets = this.targets;\n config.aframeProperty = to;\n config.update = (function () {\n var lastValue;\n\n return function (anim) {\n var value;\n value = anim.animatables[0].target.aframeProperty;\n\n // Need to do a last value check for animation timeline since all the tweening\n // begins simultaenously even if the value has not changed. Also better for perf\n // anyways.\n if (value === lastValue) { return; }\n lastValue = value;\n\n if (isBoolean) { value = value >= 1; }\n\n if (isRawProperty(data)) {\n setRawProperty(el, data.property, value, data.type);\n } else {\n setComponentProperty(el, data.property, value);\n }\n };\n })();\n },\n\n /**\n * Extend x/y/z/w onto the config.\n * Update vector by modifying object3D.\n */\n updateConfigForVector: function () {\n var config = this.config;\n var data = this.data;\n var el = this.el;\n var key;\n var from;\n var to;\n\n // Parse coordinates.\n from = data.from !== ''\n ? utils.coordinates.parse(data.from) // If data.from defined, use that.\n : getComponentProperty(el, data.property); // If data.from not defined, get on the fly.\n to = utils.coordinates.parse(data.to);\n\n if (data.property === PROP_ROTATION) {\n toRadians(from);\n toRadians(to);\n }\n\n // Set to and from.\n this.targetsArray.length = 0;\n this.targetsArray.push(from);\n config.targets = this.targetsArray;\n for (key in to) { config[key] = to[key]; }\n\n // If animating object3D transformation, run more optimized updater.\n if (data.property === PROP_POSITION || data.property === PROP_ROTATION ||\n data.property === PROP_SCALE) {\n config.update = (function () {\n var lastValue = {};\n return function (anim) {\n var value = anim.animatables[0].target;\n\n if (data.property === PROP_SCALE) {\n value.x = Math.max(0.0001, value.x);\n value.y = Math.max(0.0001, value.y);\n value.z = Math.max(0.0001, value.z);\n }\n\n // For animation timeline.\n if (value.x === lastValue.x &&\n value.y === lastValue.y &&\n value.z === lastValue.z) { return; }\n\n lastValue.x = value.x;\n lastValue.y = value.y;\n lastValue.z = value.z;\n\n el.object3D[data.property].set(value.x, value.y, value.z);\n };\n })();\n return;\n }\n\n // Animating some vector.\n config.update = (function () {\n var lastValue = {};\n return function (anim) {\n var value = anim.animatables[0].target;\n\n // Animate rotation through radians.\n // For animation timeline.\n if (value.x === lastValue.x &&\n value.y === lastValue.y &&\n value.z === lastValue.z) { return; }\n lastValue.x = value.x;\n lastValue.y = value.y;\n lastValue.z = value.z;\n setComponentProperty(el, data.property, value);\n };\n })();\n },\n\n /**\n * Update the config before each run.\n */\n updateConfig: function () {\n var propType;\n\n // Route config type.\n propType = getPropertyType(this.el, this.data.property);\n if (isRawProperty(this.data) && this.data.type === TYPE_COLOR) {\n this.updateConfigForRawColor();\n } else if (propType === 'vec2' || propType === 'vec3' || propType === 'vec4') {\n this.updateConfigForVector();\n } else {\n this.updateConfigForDefault();\n }\n },\n\n /**\n * Wait for component to initialize.\n */\n waitComponentInitRawProperty: function (cb) {\n var componentName;\n var data = this.data;\n var el = this.el;\n var self = this;\n\n if (data.from !== '') { return false; }\n\n if (!data.property.startsWith(STRING_COMPONENTS)) { return false; }\n\n componentName = splitDot(data.property)[1];\n if (el.components[componentName]) { return false; }\n\n el.addEventListener('componentinitialized', function wait (evt) {\n if (evt.detail.name !== componentName) { return; }\n cb();\n // Since the config was created async, create the animation now since we missed it\n // earlier.\n self.animation = anime(self.config);\n el.removeEventListener('componentinitialized', wait);\n });\n return true;\n },\n\n /**\n * Make sure two animations on the same property don't fight each other.\n * e.g., animation__mouseenter=\"property: material.opacity\"\n * animation__mouseleave=\"property: material.opacity\"\n */\n stopRelatedAnimations: function () {\n var component;\n var componentName;\n for (componentName in this.el.components) {\n component = this.el.components[componentName];\n if (componentName === this.attrName) { continue; }\n if (component.name !== 'animation') { continue; }\n if (!component.animationIsPlaying) { continue; }\n if (component.data.property !== this.data.property) { continue; }\n component.animationIsPlaying = false;\n }\n },\n\n addEventListeners: function () {\n var data = this.data;\n var el = this.el;\n addEventListeners(el, data.startEvents, this.onStartEvent);\n addEventListeners(el, data.pauseEvents, this.pauseAnimation);\n addEventListeners(el, data.resumeEvents, this.resumeAnimation);\n },\n\n removeEventListeners: function () {\n var data = this.data;\n var el = this.el;\n removeEventListeners(el, data.startEvents, this.onStartEvent);\n removeEventListeners(el, data.pauseEvents, this.pauseAnimation);\n removeEventListeners(el, data.resumeEvents, this.resumeAnimation);\n },\n\n setColorConfig: function (from, to) {\n colorHelperFrom.set(from);\n colorHelperTo.set(to);\n from = this.fromColor;\n to = this.toColor;\n from.r = colorHelperFrom.r;\n from.g = colorHelperFrom.g;\n from.b = colorHelperFrom.b;\n to.r = colorHelperTo.r;\n to.g = colorHelperTo.g;\n to.b = colorHelperTo.b;\n }\n});\n\n/**\n * Given property name, check schema to see what type we are animating.\n * We just care whether the property is a vector.\n */\nfunction getPropertyType (el, property) {\n var component;\n var componentName;\n var split;\n var propertyName;\n\n split = property.split('.');\n componentName = split[0];\n propertyName = split[1];\n component = el.components[componentName] || components[componentName];\n\n // Primitives.\n if (!component) { return null; }\n\n // Dynamic schema. We only care about vectors anyways.\n if (propertyName && !component.schema[propertyName]) { return null; }\n\n // Multi-prop.\n if (propertyName) { return component.schema[propertyName].type; }\n\n // Single-prop.\n return component.schema.type;\n}\n\n/**\n * Convert object to radians.\n */\nfunction toRadians (obj) {\n obj.x = THREE.Math.degToRad(obj.x);\n obj.y = THREE.Math.degToRad(obj.y);\n obj.z = THREE.Math.degToRad(obj.z);\n}\n\nfunction addEventListeners (el, eventNames, handler) {\n var i;\n for (i = 0; i < eventNames.length; i++) {\n el.addEventListener(eventNames[i], handler);\n }\n}\n\nfunction removeEventListeners (el, eventNames, handler) {\n var i;\n for (i = 0; i < eventNames.length; i++) {\n el.removeEventListener(eventNames[i], handler);\n }\n}\n\nfunction getRawProperty (el, path) {\n var i;\n var split;\n var value;\n split = splitDot(path);\n value = el;\n for (i = 0; i < split.length; i++) {\n value = value[split[i]];\n }\n if (value === undefined) {\n console.log(el);\n throw new Error('[animation] property (' + path + ') could not be found');\n }\n return value;\n}\n\nfunction setRawProperty (el, path, value, type) {\n var i;\n var split;\n var propertyName;\n var targetValue;\n\n if (path.startsWith('object3D.rotation')) {\n value = THREE.Math.degToRad(value);\n }\n\n // Walk.\n split = splitDot(path);\n targetValue = el;\n for (i = 0; i < split.length - 1; i++) { targetValue = targetValue[split[i]]; }\n propertyName = split[split.length - 1];\n\n // Raw color.\n if (type === TYPE_COLOR) {\n if ('r' in targetValue[propertyName]) {\n targetValue[propertyName].r = value.r;\n targetValue[propertyName].g = value.g;\n targetValue[propertyName].b = value.b;\n } else {\n targetValue[propertyName].x = value.r;\n targetValue[propertyName].y = value.g;\n targetValue[propertyName].z = value.b;\n }\n return;\n }\n\n targetValue[propertyName] = value;\n}\n\nfunction splitDot (path) {\n if (path in splitCache) { return splitCache[path]; }\n splitCache[path] = path.split('.');\n return splitCache[path];\n}\n\nfunction isRawProperty (data) {\n return data.isRawProperty || data.property.startsWith(STRING_COMPONENTS) ||\n data.property.startsWith(STRING_OBJECT3D);\n}\n","var registerComponent = require('../core/component').registerComponent;\nvar THREE = require('../lib/three');\n\n/**\n * Camera component.\n * Pairs along with camera system to handle tracking the active camera.\n */\nmodule.exports.Component = registerComponent('camera', {\n schema: {\n active: {default: true},\n far: {default: 10000},\n fov: {default: 80, min: 0},\n near: {default: 0.005, min: 0},\n spectator: {default: false},\n zoom: {default: 1, min: 0}\n },\n\n /**\n * Initialize three.js camera and add it to the entity.\n * Add reference from scene to this entity as the camera.\n */\n init: function () {\n var camera;\n var el = this.el;\n\n // Create camera.\n camera = this.camera = new THREE.PerspectiveCamera();\n el.setObject3D('camera', camera);\n },\n\n /**\n * Update three.js camera.\n */\n update: function (oldData) {\n var data = this.data;\n var camera = this.camera;\n\n // Update properties.\n camera.aspect = data.aspect || (window.innerWidth / window.innerHeight);\n camera.far = data.far;\n camera.fov = data.fov;\n camera.near = data.near;\n camera.zoom = data.zoom;\n camera.updateProjectionMatrix();\n\n this.updateActiveCamera(oldData);\n this.updateSpectatorCamera(oldData);\n },\n\n updateActiveCamera: function (oldData) {\n var data = this.data;\n var el = this.el;\n var system = this.system;\n // Active property did not change.\n if (oldData && oldData.active === data.active || data.spectator) { return; }\n\n // If `active` property changes, or first update, handle active camera with system.\n if (data.active && system.activeCameraEl !== el) {\n // Camera enabled. Set camera to this camera.\n system.setActiveCamera(el);\n } else if (!data.active && system.activeCameraEl === el) {\n // Camera disabled. Set camera to another camera.\n system.disableActiveCamera();\n }\n },\n\n updateSpectatorCamera: function (oldData) {\n var data = this.data;\n var el = this.el;\n var system = this.system;\n // spectator property did not change.\n if (oldData && oldData.spectator === data.spectator) { return; }\n\n // If `spectator` property changes, or first update, handle spectator camera with system.\n if (data.spectator && system.spectatorCameraEl !== el) {\n // Camera enabled. Set camera to this camera.\n system.setSpectatorCamera(el);\n } else if (!data.spectator && system.spectatorCameraEl === el) {\n // Camera disabled. Set camera to another camera.\n system.disableSpectatorCamera();\n }\n },\n\n /**\n * Remove camera on remove (callback).\n */\n remove: function () {\n this.el.removeObject3D('camera');\n }\n});\n","/* global THREE */\nvar registerComponent = require('../core/component').registerComponent;\nvar utils = require('../utils/');\n\nvar bind = utils.bind;\n\nvar EVENTS = {\n CLICK: 'click',\n FUSING: 'fusing',\n MOUSEENTER: 'mouseenter',\n MOUSEDOWN: 'mousedown',\n MOUSELEAVE: 'mouseleave',\n MOUSEUP: 'mouseup'\n};\n\nvar STATES = {\n FUSING: 'cursor-fusing',\n HOVERING: 'cursor-hovering',\n HOVERED: 'cursor-hovered'\n};\n\nvar CANVAS_EVENTS = {\n DOWN: ['mousedown', 'touchstart'],\n UP: ['mouseup', 'touchend']\n};\n\nvar WEBXR_EVENTS = {\n DOWN: ['selectstart'],\n UP: ['selectend']\n};\n\nvar CANVAS_HOVER_CLASS = 'a-mouse-cursor-hover';\n\n/**\n * Cursor component. Applies the raycaster component specifically for starting the raycaster\n * from the camera and pointing from camera's facing direction, and then only returning the\n * closest intersection. Cursor can be fine-tuned by setting raycaster properties.\n *\n * @member {object} fuseTimeout - Timeout to trigger fuse-click.\n * @member {Element} cursorDownEl - Entity that was last mousedowned during current click.\n * @member {object} intersection - Attributes of the current intersection event, including\n * 3D- and 2D-space coordinates. See: http://threejs.org/docs/api/core/Raycaster.html\n * @member {Element} intersectedEl - Currently-intersected entity. Used to keep track to\n * emit events when unintersecting.\n */\nmodule.exports.Component = registerComponent('cursor', {\n dependencies: ['raycaster'],\n\n schema: {\n downEvents: {default: []},\n fuse: {default: utils.device.isMobile()},\n fuseTimeout: {default: 1500, min: 0},\n mouseCursorStylesEnabled: {default: true},\n upEvents: {default: []},\n rayOrigin: {default: 'entity', oneOf: ['mouse', 'entity']}\n },\n\n init: function () {\n var self = this;\n\n this.fuseTimeout = undefined;\n this.cursorDownEl = null;\n this.intersectedEl = null;\n this.canvasBounds = document.body.getBoundingClientRect();\n this.isCursorDown = false;\n\n // Debounce.\n this.updateCanvasBounds = utils.debounce(function updateCanvasBounds () {\n self.canvasBounds = self.el.sceneEl.canvas.getBoundingClientRect();\n }, 500);\n\n this.eventDetail = {};\n this.intersectedEventDetail = {cursorEl: this.el};\n\n // Bind methods.\n this.onCursorDown = bind(this.onCursorDown, this);\n this.onCursorUp = bind(this.onCursorUp, this);\n this.onIntersection = bind(this.onIntersection, this);\n this.onIntersectionCleared = bind(this.onIntersectionCleared, this);\n this.onMouseMove = bind(this.onMouseMove, this);\n this.onEnterVR = bind(this.onEnterVR, this);\n },\n\n update: function (oldData) {\n if (this.data.rayOrigin === oldData.rayOrigin) { return; }\n this.updateMouseEventListeners();\n },\n\n play: function () {\n this.addEventListeners();\n },\n\n pause: function () {\n this.removeEventListeners();\n },\n\n remove: function () {\n var el = this.el;\n el.removeState(STATES.HOVERING);\n el.removeState(STATES.FUSING);\n clearTimeout(this.fuseTimeout);\n if (this.intersectedEl) { this.intersectedEl.removeState(STATES.HOVERED); }\n this.removeEventListeners();\n },\n\n addEventListeners: function () {\n var canvas;\n var data = this.data;\n var el = this.el;\n var self = this;\n\n function addCanvasListeners () {\n canvas = el.sceneEl.canvas;\n if (data.downEvents.length || data.upEvents.length) { return; }\n CANVAS_EVENTS.DOWN.forEach(function (downEvent) {\n canvas.addEventListener(downEvent, self.onCursorDown);\n });\n CANVAS_EVENTS.UP.forEach(function (upEvent) {\n canvas.addEventListener(upEvent, self.onCursorUp);\n });\n }\n\n canvas = el.sceneEl.canvas;\n if (canvas) {\n addCanvasListeners();\n } else {\n el.sceneEl.addEventListener('render-target-loaded', addCanvasListeners);\n }\n\n data.downEvents.forEach(function (downEvent) {\n el.addEventListener(downEvent, self.onCursorDown);\n });\n data.upEvents.forEach(function (upEvent) {\n el.addEventListener(upEvent, self.onCursorUp);\n });\n el.addEventListener('raycaster-intersection', this.onIntersection);\n el.addEventListener('raycaster-intersection-cleared', this.onIntersectionCleared);\n\n el.sceneEl.addEventListener('rendererresize', this.updateCanvasBounds);\n el.sceneEl.addEventListener('enter-vr', this.onEnterVR);\n window.addEventListener('resize', this.updateCanvasBounds);\n window.addEventListener('scroll', this.updateCanvasBounds);\n\n this.updateMouseEventListeners();\n },\n\n removeEventListeners: function () {\n var canvas;\n var data = this.data;\n var el = this.el;\n var self = this;\n\n canvas = el.sceneEl.canvas;\n if (canvas && !data.downEvents.length && !data.upEvents.length) {\n CANVAS_EVENTS.DOWN.forEach(function (downEvent) {\n canvas.removeEventListener(downEvent, self.onCursorDown);\n });\n CANVAS_EVENTS.UP.forEach(function (upEvent) {\n canvas.removeEventListener(upEvent, self.onCursorUp);\n });\n }\n\n data.downEvents.forEach(function (downEvent) {\n el.removeEventListener(downEvent, self.onCursorDown);\n });\n data.upEvents.forEach(function (upEvent) {\n el.removeEventListener(upEvent, self.onCursorUp);\n });\n el.removeEventListener('raycaster-intersection', this.onIntersection);\n el.removeEventListener('raycaster-intersection-cleared', this.onIntersectionCleared);\n canvas.removeEventListener('mousemove', this.onMouseMove);\n canvas.removeEventListener('touchstart', this.onMouseMove);\n canvas.removeEventListener('touchmove', this.onMouseMove);\n\n el.sceneEl.removeEventListener('rendererresize', this.updateCanvasBounds);\n el.sceneEl.removeEventListener('enter-vr', this.onEnterVR);\n window.removeEventListener('resize', this.updateCanvasBounds);\n window.removeEventListener('scroll', this.updateCanvasBounds);\n },\n\n updateMouseEventListeners: function () {\n var canvas;\n var el = this.el;\n\n canvas = el.sceneEl.canvas;\n canvas.removeEventListener('mousemove', this.onMouseMove);\n canvas.removeEventListener('touchmove', this.onMouseMove);\n el.setAttribute('raycaster', 'useWorldCoordinates', false);\n if (this.data.rayOrigin !== 'mouse') { return; }\n canvas.addEventListener('mousemove', this.onMouseMove, false);\n canvas.addEventListener('touchmove', this.onMouseMove, false);\n el.setAttribute('raycaster', 'useWorldCoordinates', true);\n this.updateCanvasBounds();\n },\n\n onMouseMove: (function () {\n var direction = new THREE.Vector3();\n var mouse = new THREE.Vector2();\n var origin = new THREE.Vector3();\n var rayCasterConfig = {origin: origin, direction: direction};\n\n return function (evt) {\n var bounds = this.canvasBounds;\n var camera = this.el.sceneEl.camera;\n var left;\n var point;\n var top;\n\n camera.parent.updateMatrixWorld();\n\n // Calculate mouse position based on the canvas element\n if (evt.type === 'touchmove' || evt.type === 'touchstart') {\n // Track the first touch for simplicity.\n point = evt.touches.item(0);\n } else {\n point = evt;\n }\n\n left = point.clientX - bounds.left;\n top = point.clientY - bounds.top;\n mouse.x = (left / bounds.width) * 2 - 1;\n mouse.y = -(top / bounds.height) * 2 + 1;\n\n if (camera && camera.isPerspectiveCamera) {\n origin.setFromMatrixPosition(camera.matrixWorld);\n direction.set(mouse.x, mouse.y, 0.5).unproject(camera).sub(origin).normalize();\n } else if (camera && camera.isOrthographicCamera) {\n origin.set(mouse.x, mouse.y, (camera.near + camera.far) / (camera.near - camera.far)).unproject(camera); // set origin in plane of camera\n direction.set(0, 0, -1).transformDirection(camera.matrixWorld);\n } else {\n console.error('AFRAME.Raycaster: Unsupported camera type: ' + camera.type);\n }\n\n this.el.setAttribute('raycaster', rayCasterConfig);\n if (evt.type === 'touchmove') { evt.preventDefault(); }\n };\n })(),\n\n /**\n * Trigger mousedown and keep track of the mousedowned entity.\n */\n onCursorDown: function (evt) {\n this.isCursorDown = true;\n // Raycast again for touch.\n if (this.data.rayOrigin === 'mouse' && evt.type === 'touchstart') {\n this.onMouseMove(evt);\n this.el.components.raycaster.checkIntersections();\n evt.preventDefault();\n }\n\n this.twoWayEmit(EVENTS.MOUSEDOWN);\n this.cursorDownEl = this.intersectedEl;\n },\n\n /**\n * Trigger mouseup if:\n * - Not fusing (mobile has no mouse).\n * - Currently intersecting an entity.\n * - Currently-intersected entity is the same as the one when mousedown was triggered,\n * in case user mousedowned one entity, dragged to another, and mouseupped.\n */\n onCursorUp: function (evt) {\n if (!this.isCursorDown) { return; }\n\n this.isCursorDown = false;\n\n var data = this.data;\n this.twoWayEmit(EVENTS.MOUSEUP);\n\n // If intersected entity has changed since the cursorDown, still emit mouseUp on the\n // previously cursorUp entity.\n if (this.cursorDownEl && this.cursorDownEl !== this.intersectedEl) {\n this.intersectedEventDetail.intersection = null;\n this.cursorDownEl.emit(EVENTS.MOUSEUP, this.intersectedEventDetail);\n }\n\n if ((!data.fuse || data.rayOrigin === 'mouse') &&\n this.intersectedEl && this.cursorDownEl === this.intersectedEl) {\n this.twoWayEmit(EVENTS.CLICK);\n }\n\n this.cursorDownEl = null;\n if (evt.type === 'touchend') { evt.preventDefault(); }\n },\n\n /**\n * Handle intersection.\n */\n onIntersection: function (evt) {\n var currentIntersection;\n var cursorEl = this.el;\n var index;\n var intersectedEl;\n var intersection;\n\n // Select closest object, excluding the cursor.\n index = evt.detail.els[0] === cursorEl ? 1 : 0;\n intersection = evt.detail.intersections[index];\n intersectedEl = evt.detail.els[index];\n\n // If cursor is the only intersected object, ignore the event.\n if (!intersectedEl) { return; }\n\n // Already intersecting this entity.\n if (this.intersectedEl === intersectedEl) { return; }\n\n // Ignore events further away than active intersection.\n if (this.intersectedEl) {\n currentIntersection = this.el.components.raycaster.getIntersection(this.intersectedEl);\n if (currentIntersection && currentIntersection.distance <= intersection.distance) { return; }\n }\n\n // Unset current intersection.\n this.clearCurrentIntersection(true);\n\n this.setIntersection(intersectedEl, intersection);\n },\n\n /**\n * Handle intersection cleared.\n */\n onIntersectionCleared: function (evt) {\n var clearedEls = evt.detail.clearedEls;\n // Check if the current intersection has ended\n if (clearedEls.indexOf(this.intersectedEl) === -1) { return; }\n this.clearCurrentIntersection();\n },\n\n onEnterVR: function () {\n this.clearCurrentIntersection(true);\n var xrSession = this.el.sceneEl.xrSession;\n var self = this;\n if (!xrSession) { return; }\n if (this.data.rayOrigin === 'mouse') { return; }\n WEBXR_EVENTS.DOWN.forEach(function (downEvent) {\n xrSession.addEventListener(downEvent, self.onCursorDown);\n });\n WEBXR_EVENTS.UP.forEach(function (upEvent) {\n xrSession.addEventListener(upEvent, self.onCursorUp);\n });\n },\n\n setIntersection: function (intersectedEl, intersection) {\n var cursorEl = this.el;\n var data = this.data;\n var self = this;\n\n // Already intersecting.\n if (this.intersectedEl === intersectedEl) { return; }\n\n // Set new intersection.\n this.intersectedEl = intersectedEl;\n\n // Hovering.\n cursorEl.addState(STATES.HOVERING);\n intersectedEl.addState(STATES.HOVERED);\n this.twoWayEmit(EVENTS.MOUSEENTER);\n\n if (this.data.mouseCursorStylesEnabled && this.data.rayOrigin === 'mouse') {\n this.el.sceneEl.canvas.classList.add(CANVAS_HOVER_CLASS);\n }\n\n // Begin fuse if necessary.\n if (data.fuseTimeout === 0 || !data.fuse) { return; }\n cursorEl.addState(STATES.FUSING);\n this.twoWayEmit(EVENTS.FUSING);\n this.fuseTimeout = setTimeout(function fuse () {\n cursorEl.removeState(STATES.FUSING);\n self.twoWayEmit(EVENTS.CLICK);\n }, data.fuseTimeout);\n },\n\n clearCurrentIntersection: function (ignoreRemaining) {\n var index;\n var intersection;\n var intersections;\n var cursorEl = this.el;\n\n // Nothing to be cleared.\n if (!this.intersectedEl) { return; }\n\n // No longer hovering (or fusing).\n this.intersectedEl.removeState(STATES.HOVERED);\n cursorEl.removeState(STATES.HOVERING);\n cursorEl.removeState(STATES.FUSING);\n this.twoWayEmit(EVENTS.MOUSELEAVE);\n\n if (this.data.mouseCursorStylesEnabled && this.data.rayOrigin === 'mouse') {\n this.el.sceneEl.canvas.classList.remove(CANVAS_HOVER_CLASS);\n }\n\n // Unset intersected entity (after emitting the event).\n this.intersectedEl = null;\n\n // Clear fuseTimeout.\n clearTimeout(this.fuseTimeout);\n\n // Set intersection to another raycasted element if any.\n if (ignoreRemaining === true) { return; }\n intersections = this.el.components.raycaster.intersections;\n if (intersections.length === 0) { return; }\n // Exclude the cursor.\n index = intersections[0].object.el === cursorEl ? 1 : 0;\n intersection = intersections[index];\n if (!intersection) { return; }\n this.setIntersection(intersection.object.el, intersection);\n },\n\n /**\n * Helper to emit on both the cursor and the intersected entity (if exists).\n */\n twoWayEmit: function (evtName) {\n var el = this.el;\n var intersectedEl = this.intersectedEl;\n var intersection;\n\n intersection = this.el.components.raycaster.getIntersection(intersectedEl);\n this.eventDetail.intersectedEl = intersectedEl;\n this.eventDetail.intersection = intersection;\n el.emit(evtName, this.eventDetail);\n\n if (!intersectedEl) { return; }\n\n this.intersectedEventDetail.intersection = intersection;\n intersectedEl.emit(evtName, this.intersectedEventDetail);\n }\n});\n","var registerComponent = require('../core/component').registerComponent;\nvar bind = require('../utils/bind');\n\nvar trackedControlsUtils = require('../utils/tracked-controls');\nvar checkControllerPresentAndSetup = trackedControlsUtils.checkControllerPresentAndSetup;\nvar emitIfAxesChanged = trackedControlsUtils.emitIfAxesChanged;\nvar onButtonEvent = trackedControlsUtils.onButtonEvent;\n\nvar DAYDREAM_CONTROLLER_MODEL_BASE_URL = 'https://cdn.aframe.io/controllers/google/';\nvar DAYDREAM_CONTROLLER_MODEL_OBJ_URL = DAYDREAM_CONTROLLER_MODEL_BASE_URL + 'vr_controller_daydream.obj';\nvar DAYDREAM_CONTROLLER_MODEL_OBJ_MTL = DAYDREAM_CONTROLLER_MODEL_BASE_URL + 'vr_controller_daydream.mtl';\n\nvar isWebXRAvailable = require('../utils/').device.isWebXRAvailable;\n\nvar GAMEPAD_ID_WEBXR = 'google-daydream';\nvar GAMEPAD_ID_WEBVR = 'Daydream Controller';\n\nvar GAMEPAD_ID_PREFIX = isWebXRAvailable ? GAMEPAD_ID_WEBXR : GAMEPAD_ID_WEBVR;\n\n/**\n * Button indices:\n * 0 - trackpad\n * 1 - menu (never dispatched on this layer)\n * 2 - system (never dispatched on this layer)\n *\n * Axis:\n * 0 - trackpad x\n * 1 - trackpad y\n */\nvar INPUT_MAPPING_WEBVR = {\n axes: {trackpad: [0, 1]},\n buttons: ['trackpad', 'menu', 'system']\n};\n\n/**\n * Button indices:\n * 0 - none\n * 1 - none\n * 2 - touchpad\n *\n * Axis:\n * 0 - touchpad x\n * 1 - touchpad y\n * Reference: https://github.com/immersive-web/webxr-input-profiles/blob/master/packages/registry/profiles/google/google-daydream.json\n */\nvar INPUT_MAPPING_WEBXR = {\n axes: {touchpad: [0, 1]},\n buttons: ['none', 'none', 'touchpad', 'menu', 'system']\n};\n\nvar INPUT_MAPPING = isWebXRAvailable ? INPUT_MAPPING_WEBXR : INPUT_MAPPING_WEBVR;\n\n/**\n * Daydream controls.\n * Interface with Daydream controller and map Gamepad events to\n * controller buttons: trackpad, menu, system\n * Load a controller model and highlight the pressed buttons.\n */\nmodule.exports.Component = registerComponent('daydream-controls', {\n schema: {\n hand: {default: ''}, // This informs the degenerate arm model.\n buttonColor: {type: 'color', default: '#000000'},\n buttonTouchedColor: {type: 'color', default: '#777777'},\n buttonHighlightColor: {type: 'color', default: '#FFFFFF'},\n model: {default: true},\n orientationOffset: {type: 'vec3'},\n armModel: {default: true}\n },\n\n mapping: INPUT_MAPPING,\n\n bindMethods: function () {\n this.onModelLoaded = bind(this.onModelLoaded, this);\n this.onControllersUpdate = bind(this.onControllersUpdate, this);\n this.checkIfControllerPresent = bind(this.checkIfControllerPresent, this);\n this.removeControllersUpdateListener = bind(this.removeControllersUpdateListener, this);\n this.onAxisMoved = bind(this.onAxisMoved, this);\n },\n\n init: function () {\n var self = this;\n this.onButtonChanged = bind(this.onButtonChanged, this);\n this.onButtonDown = function (evt) { onButtonEvent(evt.detail.id, 'down', self); };\n this.onButtonUp = function (evt) { onButtonEvent(evt.detail.id, 'up', self); };\n this.onButtonTouchStart = function (evt) { onButtonEvent(evt.detail.id, 'touchstart', self); };\n this.onButtonTouchEnd = function (evt) { onButtonEvent(evt.detail.id, 'touchend', self); };\n this.controllerPresent = false;\n this.lastControllerCheck = 0;\n this.bindMethods();\n },\n\n addEventListeners: function () {\n var el = this.el;\n el.addEventListener('buttonchanged', this.onButtonChanged);\n el.addEventListener('buttondown', this.onButtonDown);\n el.addEventListener('buttonup', this.onButtonUp);\n el.addEventListener('touchstart', this.onButtonTouchStart);\n el.addEventListener('touchend', this.onButtonTouchEnd);\n el.addEventListener('model-loaded', this.onModelLoaded);\n el.addEventListener('axismove', this.onAxisMoved);\n this.controllerEventsActive = true;\n },\n\n removeEventListeners: function () {\n var el = this.el;\n el.removeEventListener('buttonchanged', this.onButtonChanged);\n el.removeEventListener('buttondown', this.onButtonDown);\n el.removeEventListener('buttonup', this.onButtonUp);\n el.removeEventListener('touchstart', this.onButtonTouchStart);\n el.removeEventListener('touchend', this.onButtonTouchEnd);\n el.removeEventListener('model-loaded', this.onModelLoaded);\n el.removeEventListener('axismove', this.onAxisMoved);\n this.controllerEventsActive = false;\n },\n\n checkIfControllerPresent: function () {\n checkControllerPresentAndSetup(this, GAMEPAD_ID_PREFIX,\n this.data.hand ? {hand: this.data.hand} : {});\n },\n\n play: function () {\n this.checkIfControllerPresent();\n this.addControllersUpdateListener();\n },\n\n pause: function () {\n this.removeEventListeners();\n this.removeControllersUpdateListener();\n },\n\n injectTrackedControls: function () {\n var el = this.el;\n var data = this.data;\n el.setAttribute('tracked-controls', {\n armModel: data.armModel,\n hand: data.hand,\n idPrefix: GAMEPAD_ID_PREFIX,\n id: GAMEPAD_ID_PREFIX,\n orientationOffset: data.orientationOffset\n });\n if (!this.data.model) { return; }\n this.el.setAttribute('obj-model', {\n obj: DAYDREAM_CONTROLLER_MODEL_OBJ_URL,\n mtl: DAYDREAM_CONTROLLER_MODEL_OBJ_MTL\n });\n },\n\n addControllersUpdateListener: function () {\n this.el.sceneEl.addEventListener('controllersupdated', this.onControllersUpdate, false);\n },\n\n removeControllersUpdateListener: function () {\n this.el.sceneEl.removeEventListener('controllersupdated', this.onControllersUpdate, false);\n },\n\n onControllersUpdate: function () {\n this.checkIfControllerPresent();\n },\n\n onModelLoaded: function (evt) {\n var controllerObject3D = evt.detail.model;\n var buttonMeshes;\n if (!this.data.model) { return; }\n buttonMeshes = this.buttonMeshes = {};\n buttonMeshes.menu = controllerObject3D.getObjectByName('AppButton_AppButton_Cylinder.004');\n buttonMeshes.system = controllerObject3D.getObjectByName('HomeButton_HomeButton_Cylinder.005');\n buttonMeshes.trackpad = controllerObject3D.getObjectByName('TouchPad_TouchPad_Cylinder.003');\n buttonMeshes.touchpad = controllerObject3D.getObjectByName('TouchPad_TouchPad_Cylinder.003');\n // Offset pivot point.\n controllerObject3D.position.set(0, 0, -0.04);\n },\n\n onAxisMoved: function (evt) {\n emitIfAxesChanged(this, this.mapping.axes, evt);\n },\n\n onButtonChanged: function (evt) {\n var button = this.mapping.buttons[evt.detail.id];\n if (!button) return;\n // Pass along changed event with button state, using button mapping for convenience.\n this.el.emit(button + 'changed', evt.detail.state);\n },\n\n updateModel: function (buttonName, evtName) {\n if (!this.data.model) { return; }\n this.updateButtonModel(buttonName, evtName);\n },\n\n updateButtonModel: function (buttonName, state) {\n var buttonMeshes = this.buttonMeshes;\n if (!buttonMeshes || !buttonMeshes[buttonName]) { return; }\n var color;\n switch (state) {\n case 'down':\n color = this.data.buttonHighlightColor;\n break;\n case 'touchstart':\n color = this.data.buttonTouchedColor;\n break;\n default:\n color = this.data.buttonColor;\n }\n buttonMeshes[buttonName].material.color.set(color);\n }\n});\n","var registerComponent = require('../core/component').registerComponent;\nvar bind = require('../utils/bind');\n\nvar trackedControlsUtils = require('../utils/tracked-controls');\nvar checkControllerPresentAndSetup = trackedControlsUtils.checkControllerPresentAndSetup;\nvar emitIfAxesChanged = trackedControlsUtils.emitIfAxesChanged;\nvar onButtonEvent = trackedControlsUtils.onButtonEvent;\nvar isWebXRAvailable = require('../utils/').device.isWebXRAvailable;\n\nvar GEARVR_CONTROLLER_MODEL_BASE_URL = 'https://cdn.aframe.io/controllers/samsung/';\nvar GEARVR_CONTROLLER_MODEL_OBJ_URL = GEARVR_CONTROLLER_MODEL_BASE_URL + 'gear_vr_controller.obj';\nvar GEARVR_CONTROLLER_MODEL_OBJ_MTL = GEARVR_CONTROLLER_MODEL_BASE_URL + 'gear_vr_controller.mtl';\n\nvar GAMEPAD_ID_WEBXR = 'samsung-gearvr';\nvar GAMEPAD_ID_WEBVR = 'Gear VR';\n\n// Prefix for Gen1 and Gen2 Oculus Touch Controllers.\nvar GAMEPAD_ID_PREFIX = isWebXRAvailable ? GAMEPAD_ID_WEBXR : GAMEPAD_ID_WEBVR;\n\n/**\n * Button indices:\n * 0 - trackpad\n * 1 - trigger\n *\n * Axis:\n * 0 - trackpad x\n * 1 - trackpad y\n */\nvar INPUT_MAPPING_WEBVR = {\n axes: {trackpad: [0, 1]},\n buttons: ['trackpad', 'trigger']\n};\n\n/**\n * Button indices:\n * 0 - trigger\n * 1 - none\n * 2 - touchpad\n * 3 - menu\n *\n * Axis:\n * 0 - touchpad x\n * 1 - touchpad y\n * Reference: https://github.com/immersive-web/webxr-input-profiles/blob/master/packages/registry/profiles/samsung/samsung-gearvr.json\n */\nvar INPUT_MAPPING_WEBXR = {\n axes: {touchpad: [0, 1]},\n buttons: ['trigger', 'none', 'touchpad', 'none', 'menu']\n};\n\nvar INPUT_MAPPING = isWebXRAvailable ? INPUT_MAPPING_WEBXR : INPUT_MAPPING_WEBVR;\n\n/**\n * Gear VR controls.\n * Interface with Gear VR controller and map Gamepad events to\n * controller buttons: trackpad, trigger\n * Load a controller model and highlight the pressed buttons.\n */\nmodule.exports.Component = registerComponent('gearvr-controls', {\n schema: {\n hand: {default: ''}, // This informs the degenerate arm model.\n buttonColor: {type: 'color', default: '#000000'},\n buttonTouchedColor: {type: 'color', default: '#777777'},\n buttonHighlightColor: {type: 'color', default: '#FFFFFF'},\n model: {default: true},\n orientationOffset: {type: 'vec3'},\n armModel: {default: true}\n },\n\n mapping: INPUT_MAPPING,\n\n bindMethods: function () {\n this.onModelLoaded = bind(this.onModelLoaded, this);\n this.onControllersUpdate = bind(this.onControllersUpdate, this);\n this.checkIfControllerPresent = bind(this.checkIfControllerPresent, this);\n this.removeControllersUpdateListener = bind(this.removeControllersUpdateListener, this);\n this.onAxisMoved = bind(this.onAxisMoved, this);\n },\n\n init: function () {\n var self = this;\n this.onButtonChanged = bind(this.onButtonChanged, this);\n this.onButtonDown = function (evt) { onButtonEvent(evt.detail.id, 'down', self); };\n this.onButtonUp = function (evt) { onButtonEvent(evt.detail.id, 'up', self); };\n this.onButtonTouchStart = function (evt) { onButtonEvent(evt.detail.id, 'touchstart', self); };\n this.onButtonTouchEnd = function (evt) { onButtonEvent(evt.detail.id, 'touchend', self); };\n this.controllerPresent = false;\n this.lastControllerCheck = 0;\n this.bindMethods();\n },\n\n addEventListeners: function () {\n var el = this.el;\n el.addEventListener('buttonchanged', this.onButtonChanged);\n el.addEventListener('buttondown', this.onButtonDown);\n el.addEventListener('buttonup', this.onButtonUp);\n el.addEventListener('touchstart', this.onButtonTouchStart);\n el.addEventListener('touchend', this.onButtonTouchEnd);\n el.addEventListener('model-loaded', this.onModelLoaded);\n el.addEventListener('axismove', this.onAxisMoved);\n this.controllerEventsActive = true;\n },\n\n removeEventListeners: function () {\n var el = this.el;\n el.removeEventListener('buttonchanged', this.onButtonChanged);\n el.removeEventListener('buttondown', this.onButtonDown);\n el.removeEventListener('buttonup', this.onButtonUp);\n el.removeEventListener('touchstart', this.onButtonTouchStart);\n el.removeEventListener('touchend', this.onButtonTouchEnd);\n el.removeEventListener('model-loaded', this.onModelLoaded);\n el.removeEventListener('axismove', this.onAxisMoved);\n this.controllerEventsActive = false;\n },\n\n checkIfControllerPresent: function () {\n checkControllerPresentAndSetup(this, GAMEPAD_ID_PREFIX,\n this.data.hand ? {hand: this.data.hand} : {});\n },\n\n play: function () {\n this.checkIfControllerPresent();\n this.addControllersUpdateListener();\n },\n\n pause: function () {\n this.removeEventListeners();\n this.removeControllersUpdateListener();\n },\n\n injectTrackedControls: function () {\n var el = this.el;\n var data = this.data;\n el.setAttribute('tracked-controls', {\n armModel: data.armModel,\n hand: data.hand,\n idPrefix: GAMEPAD_ID_PREFIX,\n id: GAMEPAD_ID_PREFIX,\n orientationOffset: data.orientationOffset\n });\n if (!this.data.model) { return; }\n this.el.setAttribute('obj-model', {\n obj: GEARVR_CONTROLLER_MODEL_OBJ_URL,\n mtl: GEARVR_CONTROLLER_MODEL_OBJ_MTL\n });\n },\n\n addControllersUpdateListener: function () {\n this.el.sceneEl.addEventListener('controllersupdated', this.onControllersUpdate, false);\n },\n\n removeControllersUpdateListener: function () {\n this.el.sceneEl.removeEventListener('controllersupdated', this.onControllersUpdate, false);\n },\n\n onControllersUpdate: function () {\n this.checkIfControllerPresent();\n },\n\n // No need for onButtonChanged, since Gear VR controller has no analog buttons.\n\n onModelLoaded: function (evt) {\n var controllerObject3D = evt.detail.model;\n var buttonMeshes;\n if (!this.data.model) { return; }\n buttonMeshes = this.buttonMeshes = {};\n buttonMeshes.trigger = controllerObject3D.children[2];\n buttonMeshes.trackpad = controllerObject3D.children[1];\n buttonMeshes.touchpad = controllerObject3D.children[1];\n },\n\n onButtonChanged: function (evt) {\n var button = this.mapping.buttons[evt.detail.id];\n if (!button) return;\n // Pass along changed event with button state, using button mapping for convenience.\n this.el.emit(button + 'changed', evt.detail.state);\n },\n\n onAxisMoved: function (evt) {\n emitIfAxesChanged(this, this.mapping.axes, evt);\n },\n\n updateModel: function (buttonName, evtName) {\n if (!this.data.model) { return; }\n this.updateButtonModel(buttonName, evtName);\n },\n\n updateButtonModel: function (buttonName, state) {\n var buttonMeshes = this.buttonMeshes;\n if (!buttonMeshes || !buttonMeshes[buttonName]) { return; }\n var color;\n switch (state) {\n case 'down':\n color = this.data.buttonHighlightColor;\n break;\n case 'touchstart':\n color = this.data.buttonTouchedColor;\n break;\n default:\n color = this.data.buttonColor;\n }\n buttonMeshes[buttonName].material.color.set(color);\n }\n});\n","var registerComponent = require('../core/component').registerComponent;\nvar bind = require('../utils/bind');\n\nvar trackedControlsUtils = require('../utils/tracked-controls');\nvar checkControllerPresentAndSetup = trackedControlsUtils.checkControllerPresentAndSetup;\nvar emitIfAxesChanged = trackedControlsUtils.emitIfAxesChanged;\nvar onButtonEvent = trackedControlsUtils.onButtonEvent;\n\nvar GAMEPAD_ID_PREFIX = 'generic';\n\n/**\n * Button indices:\n * 0 - trigger\n * 1 - squeeze\n * 2 - touchpad\n * 3 - thumbstick\n *\n * Axis:\n * 0 - touchpad\n * 1 - thumbstick\n *\n */\nvar INPUT_MAPPING = {\n axes: {\n touchpad: [0, 1],\n thumbstick: [2, 3]\n },\n buttons: ['trigger', 'squeeze', 'touchpad', 'thumbstick']\n};\n\n/**\n * Oculus Go controls.\n * Interface with Oculus Go controller and map Gamepad events to\n * controller buttons: trackpad, trigger\n * Load a controller model and highlight the pressed buttons.\n */\nmodule.exports.Component = registerComponent('generic-tracked-controller-controls', {\n schema: {\n hand: {default: ''}, // This informs the degenerate arm model.\n defaultModel: {default: true},\n defaultModelColor: {default: 'gray'},\n orientationOffset: {type: 'vec3'},\n disabled: {default: false}\n },\n\n /**\n * Button IDs:\n * 0 - trackpad\n * 1 - trigger\n */\n mapping: INPUT_MAPPING,\n\n bindMethods: function () {\n this.onControllersUpdate = bind(this.onControllersUpdate, this);\n this.checkIfControllerPresent = bind(this.checkIfControllerPresent, this);\n this.removeControllersUpdateListener = bind(this.removeControllersUpdateListener, this);\n this.onAxisMoved = bind(this.onAxisMoved, this);\n },\n\n init: function () {\n var self = this;\n this.onButtonChanged = bind(this.onButtonChanged, this);\n this.onButtonDown = function (evt) { onButtonEvent(evt.detail.id, 'down', self); };\n this.onButtonUp = function (evt) { onButtonEvent(evt.detail.id, 'up', self); };\n this.onButtonTouchStart = function (evt) { onButtonEvent(evt.detail.id, 'touchstart', self); };\n this.onButtonTouchEnd = function (evt) { onButtonEvent(evt.detail.id, 'touchend', self); };\n this.controllerPresent = false;\n this.wasControllerConnected = false;\n this.lastControllerCheck = 0;\n this.rendererSystem = this.el.sceneEl.systems.renderer;\n this.bindMethods();\n\n // generic-tracked-controller-controls has the lowest precedence.\n // We must diable this component if there are more specialized controls components.\n this.el.addEventListener('controllerconnected', function (evt) {\n if (evt.detail.name === self.name) { return; }\n self.wasControllerConnected = true;\n self.removeEventListeners();\n self.removeControllersUpdateListener();\n });\n },\n\n addEventListeners: function () {\n var el = this.el;\n el.addEventListener('buttonchanged', this.onButtonChanged);\n el.addEventListener('buttondown', this.onButtonDown);\n el.addEventListener('buttonup', this.onButtonUp);\n el.addEventListener('touchstart', this.onButtonTouchStart);\n el.addEventListener('touchend', this.onButtonTouchEnd);\n el.addEventListener('axismove', this.onAxisMoved);\n this.controllerEventsActive = true;\n },\n\n removeEventListeners: function () {\n var el = this.el;\n el.removeEventListener('buttonchanged', this.onButtonChanged);\n el.removeEventListener('buttondown', this.onButtonDown);\n el.removeEventListener('buttonup', this.onButtonUp);\n el.removeEventListener('touchstart', this.onButtonTouchStart);\n el.removeEventListener('touchend', this.onButtonTouchEnd);\n el.removeEventListener('axismove', this.onAxisMoved);\n this.controllerEventsActive = false;\n },\n\n checkIfControllerPresent: function () {\n var data = this.data;\n var hand = data.hand ? data.hand : undefined;\n checkControllerPresentAndSetup(\n this, GAMEPAD_ID_PREFIX,\n {hand: hand, iterateControllerProfiles: true});\n },\n\n play: function () {\n if (this.wasControllerConnected) { return; }\n this.checkIfControllerPresent();\n this.addControllersUpdateListener();\n },\n\n pause: function () {\n this.removeEventListeners();\n this.removeControllersUpdateListener();\n },\n\n injectTrackedControls: function () {\n var el = this.el;\n var data = this.data;\n\n // Do nothing if tracked-controls already set.\n // Generic controls have the lowest precedence.\n if (this.el.components['tracked-controls']) {\n this.removeEventListeners();\n return;\n }\n el.setAttribute('tracked-controls', {\n hand: data.hand,\n idPrefix: GAMEPAD_ID_PREFIX,\n orientationOffset: data.orientationOffset,\n iterateControllerProfiles: true\n });\n if (!this.data.defaultModel) { return; }\n this.initDefaultModel();\n },\n\n addControllersUpdateListener: function () {\n this.el.sceneEl.addEventListener('controllersupdated', this.onControllersUpdate, false);\n },\n\n removeControllersUpdateListener: function () {\n this.el.sceneEl.removeEventListener('controllersupdated', this.onControllersUpdate, false);\n },\n\n onControllersUpdate: function () {\n this.checkIfControllerPresent();\n },\n\n onButtonChanged: function (evt) {\n var button = this.mapping.buttons[evt.detail.id];\n if (!button) return;\n // Pass along changed event with button state, using button mapping for convenience.\n this.el.emit(button + 'changed', evt.detail.state);\n },\n\n onAxisMoved: function (evt) {\n emitIfAxesChanged(this, this.mapping.axes, evt);\n },\n\n initDefaultModel: function () {\n var modelEl = this.modelEl = document.createElement('a-entity');\n modelEl.setAttribute('geometry', {\n primitive: 'sphere',\n radius: 0.03\n });\n modelEl.setAttribute('material', {color: this.data.color});\n this.el.appendChild(modelEl);\n }\n});\n","var geometries = require('../core/geometry').geometries;\nvar geometryNames = require('../core/geometry').geometryNames;\nvar registerComponent = require('../core/component').registerComponent;\nvar THREE = require('../lib/three');\n\nvar dummyGeometry = new THREE.BufferGeometry();\n\n/**\n * Geometry component. Combined with material component to make a mesh in 3D object.\n * Extended with registered geometries.\n */\nmodule.exports.Component = registerComponent('geometry', {\n schema: {\n buffer: {default: true},\n primitive: {default: 'box', oneOf: geometryNames, schemaChange: true},\n skipCache: {default: false}\n },\n\n init: function () {\n this.geometry = null;\n },\n\n /**\n * Talk to geometry system to get or create geometry.\n */\n update: function (previousData) {\n var data = this.data;\n var el = this.el;\n var mesh;\n var system = this.system;\n\n // Dispose old geometry if we created one.\n if (this.geometry) {\n system.unuseGeometry(previousData);\n this.geometry = null;\n }\n\n // Create new geometry.\n this.geometry = system.getOrCreateGeometry(data);\n\n // Set on mesh. If mesh does not exist, create it.\n mesh = el.getObject3D('mesh');\n if (mesh) {\n mesh.geometry = this.geometry;\n } else {\n mesh = new THREE.Mesh();\n mesh.geometry = this.geometry;\n // Default material if not defined on the entity.\n if (!this.el.getAttribute('material')) {\n mesh.material = new THREE.MeshStandardMaterial({\n color: Math.random() * 0xFFFFFF,\n metalness: 0,\n roughness: 0.5\n });\n }\n el.setObject3D('mesh', mesh);\n }\n },\n\n /**\n * Tell geometry system that entity is no longer using the geometry.\n * Unset the geometry on the mesh\n */\n remove: function () {\n this.system.unuseGeometry(this.data);\n this.el.getObject3D('mesh').geometry = dummyGeometry;\n this.geometry = null;\n },\n\n /**\n * Update geometry component schema based on geometry type.\n */\n updateSchema: function (data) {\n var currentGeometryType = this.oldData && this.oldData.primitive;\n var newGeometryType = data.primitive;\n var schema = geometries[newGeometryType] && geometries[newGeometryType].schema;\n\n // Geometry has no schema.\n if (!schema) { throw new Error('Unknown geometry schema `' + newGeometryType + '`'); }\n // Nothing has changed.\n if (currentGeometryType && currentGeometryType === newGeometryType) { return; }\n\n this.extendSchema(schema);\n }\n});\n","var registerComponent = require('../core/component').registerComponent;\nvar THREE = require('../lib/three');\nvar utils = require('../utils/');\nvar warn = utils.debug('components:gltf-model:warn');\n\n/**\n * glTF model loader.\n */\nmodule.exports.Component = registerComponent('gltf-model', {\n schema: {type: 'model'},\n\n init: function () {\n var self = this;\n var dracoLoader = this.system.getDRACOLoader();\n var meshoptDecoder = this.system.getMeshoptDecoder();\n this.model = null;\n this.loader = new THREE.GLTFLoader();\n if (dracoLoader) {\n this.loader.setDRACOLoader(dracoLoader);\n }\n if (meshoptDecoder) {\n this.ready = meshoptDecoder.then(function (meshoptDecoder) {\n self.loader.setMeshoptDecoder(meshoptDecoder);\n });\n } else {\n this.ready = Promise.resolve();\n }\n },\n\n update: function () {\n var self = this;\n var el = this.el;\n var src = this.data;\n\n if (!src) { return; }\n\n this.remove();\n\n this.ready.then(function () {\n self.loader.load(src, function gltfLoaded (gltfModel) {\n self.model = gltfModel.scene || gltfModel.scenes[0];\n self.model.animations = gltfModel.animations;\n el.setObject3D('mesh', self.model);\n el.emit('model-loaded', {format: 'gltf', model: self.model});\n }, undefined /* onProgress */, function gltfFailed (error) {\n var message = (error && error.message) ? error.message : 'Failed to load glTF model';\n warn(message);\n el.emit('model-error', {format: 'gltf', src: src});\n });\n });\n },\n\n remove: function () {\n if (!this.model) { return; }\n this.el.removeObject3D('mesh');\n }\n});\n","/* global THREE */\nvar registerComponent = require('../core/component').registerComponent;\n\n// Found at https://github.com/aframevr/assets.\nvar MODEL_URLS = {\n toonLeft: 'https://cdn.aframe.io/controllers/hands/leftHand.glb',\n toonRight: 'https://cdn.aframe.io/controllers/hands/rightHand.glb',\n lowPolyLeft: 'https://cdn.aframe.io/controllers/hands/leftHandLow.glb',\n lowPolyRight: 'https://cdn.aframe.io/controllers/hands/rightHandLow.glb',\n highPolyLeft: 'https://cdn.aframe.io/controllers/hands/leftHandHigh.glb',\n highPolyRight: 'https://cdn.aframe.io/controllers/hands/rightHandHigh.glb'\n};\n\n// Poses.\nvar ANIMATIONS = {\n open: 'Open',\n // point: grip active, trackpad surface active, trigger inactive.\n point: 'Point',\n // pointThumb: grip active, trigger inactive, trackpad surface inactive.\n pointThumb: 'Point + Thumb',\n // fist: grip active, trigger active, trackpad surface active.\n fist: 'Fist',\n // hold: trigger active, grip inactive.\n hold: 'Hold',\n // thumbUp: grip active, trigger active, trackpad surface inactive.\n thumbUp: 'Thumb Up'\n};\n\n// Map animation to public events for the API.\nvar EVENTS = {};\nEVENTS[ANIMATIONS.fist] = 'grip';\nEVENTS[ANIMATIONS.thumbUp] = 'pistol';\nEVENTS[ANIMATIONS.point] = 'pointing';\n\n/**\n * Hand controls component that abstracts 6DoF controls:\n * oculus-touch-controls, vive-controls, windows-motion-controls.\n *\n * Originally meant to be a sample implementation of applications-specific controls that\n * abstracts multiple types of controllers.\n *\n * Auto-detect appropriate controller.\n * Handle common events coming from the detected vendor-specific controls.\n * Translate button events to semantic hand-related event names:\n * (gripclose, gripopen, thumbup, thumbdown, pointup, pointdown)\n * Load hand model with gestures that are applied based on the button pressed.\n *\n * @property {string} Hand mapping (`left`, `right`).\n */\nmodule.exports.Component = registerComponent('hand-controls', {\n schema: {\n color: {default: 'white', type: 'color'},\n hand: { default: 'left' },\n handModelStyle: {default: 'lowPoly', oneOf: ['lowPoly', 'highPoly', 'toon']}\n },\n\n init: function () {\n var self = this;\n var el = this.el;\n // Current pose.\n this.gesture = ANIMATIONS.open;\n // Active buttons populated by events provided by the attached controls.\n this.pressedButtons = {};\n this.touchedButtons = {};\n this.loader = new THREE.GLTFLoader();\n this.loader.setCrossOrigin('anonymous');\n\n this.onGripDown = function () { self.handleButton('grip', 'down'); };\n this.onGripUp = function () { self.handleButton('grip', 'up'); };\n this.onTrackpadDown = function () { self.handleButton('trackpad', 'down'); };\n this.onTrackpadUp = function () { self.handleButton('trackpad', 'up'); };\n this.onTrackpadTouchStart = function () { self.handleButton('trackpad', 'touchstart'); };\n this.onTrackpadTouchEnd = function () { self.handleButton('trackpad', 'touchend'); };\n this.onTriggerDown = function () { self.handleButton('trigger', 'down'); };\n this.onTriggerUp = function () { self.handleButton('trigger', 'up'); };\n this.onTriggerTouchStart = function () { self.handleButton('trigger', 'touchstart'); };\n this.onTriggerTouchEnd = function () { self.handleButton('trigger', 'touchend'); };\n this.onGripTouchStart = function () { self.handleButton('grip', 'touchstart'); };\n this.onGripTouchEnd = function () { self.handleButton('grip', 'touchend'); };\n this.onThumbstickDown = function () { self.handleButton('thumbstick', 'down'); };\n this.onThumbstickUp = function () { self.handleButton('thumbstick', 'up'); };\n this.onAorXTouchStart = function () { self.handleButton('AorX', 'touchstart'); };\n this.onAorXTouchEnd = function () { self.handleButton('AorX', 'touchend'); };\n this.onBorYTouchStart = function () { self.handleButton('BorY', 'touchstart'); };\n this.onBorYTouchEnd = function () { self.handleButton('BorY', 'touchend'); };\n this.onSurfaceTouchStart = function () { self.handleButton('surface', 'touchstart'); };\n this.onSurfaceTouchEnd = function () { self.handleButton('surface', 'touchend'); };\n this.onControllerConnected = this.onControllerConnected.bind(this);\n this.onControllerDisconnected = this.onControllerDisconnected.bind(this);\n\n el.addEventListener('controllerconnected', this.onControllerConnected);\n el.addEventListener('controllerdisconnected', this.onControllerDisconnected);\n\n // Hidden by default.\n el.object3D.visible = false;\n },\n\n play: function () {\n this.addEventListeners();\n },\n\n pause: function () {\n this.removeEventListeners();\n },\n\n tick: function (time, delta) {\n var mesh = this.el.getObject3D('mesh');\n\n if (!mesh || !mesh.mixer) { return; }\n\n mesh.mixer.update(delta / 1000);\n },\n\n onControllerConnected: function () {\n this.el.object3D.visible = true;\n },\n\n onControllerDisconnected: function () {\n this.el.object3D.visible = false;\n },\n\n addEventListeners: function () {\n var el = this.el;\n el.addEventListener('gripdown', this.onGripDown);\n el.addEventListener('gripup', this.onGripUp);\n el.addEventListener('trackpaddown', this.onTrackpadDown);\n el.addEventListener('trackpadup', this.onTrackpadUp);\n el.addEventListener('trackpadtouchstart', this.onTrackpadTouchStart);\n el.addEventListener('trackpadtouchend', this.onTrackpadTouchEnd);\n el.addEventListener('triggerdown', this.onTriggerDown);\n el.addEventListener('triggerup', this.onTriggerUp);\n el.addEventListener('triggertouchstart', this.onTriggerTouchStart);\n el.addEventListener('triggertouchend', this.onTriggerTouchEnd);\n el.addEventListener('griptouchstart', this.onGripTouchStart);\n el.addEventListener('griptouchend', this.onGripTouchEnd);\n el.addEventListener('thumbstickdown', this.onThumbstickDown);\n el.addEventListener('thumbstickup', this.onThumbstickUp);\n el.addEventListener('abuttontouchstart', this.onAorXTouchStart);\n el.addEventListener('abuttontouchend', this.onAorXTouchEnd);\n el.addEventListener('bbuttontouchstart', this.onBorYTouchStart);\n el.addEventListener('bbuttontouchend', this.onBorYTouchEnd);\n el.addEventListener('xbuttontouchstart', this.onAorXTouchStart);\n el.addEventListener('xbuttontouchend', this.onAorXTouchEnd);\n el.addEventListener('ybuttontouchstart', this.onBorYTouchStart);\n el.addEventListener('ybuttontouchend', this.onBorYTouchEnd);\n el.addEventListener('surfacetouchstart', this.onSurfaceTouchStart);\n el.addEventListener('surfacetouchend', this.onSurfaceTouchEnd);\n },\n\n removeEventListeners: function () {\n var el = this.el;\n el.removeEventListener('gripdown', this.onGripDown);\n el.removeEventListener('gripup', this.onGripUp);\n el.removeEventListener('trackpaddown', this.onTrackpadDown);\n el.removeEventListener('trackpadup', this.onTrackpadUp);\n el.removeEventListener('trackpadtouchstart', this.onTrackpadTouchStart);\n el.removeEventListener('trackpadtouchend', this.onTrackpadTouchEnd);\n el.removeEventListener('triggerdown', this.onTriggerDown);\n el.removeEventListener('triggerup', this.onTriggerUp);\n el.removeEventListener('triggertouchstart', this.onTriggerTouchStart);\n el.removeEventListener('triggertouchend', this.onTriggerTouchEnd);\n el.removeEventListener('griptouchstart', this.onGripTouchStart);\n el.removeEventListener('griptouchend', this.onGripTouchEnd);\n el.removeEventListener('thumbstickdown', this.onThumbstickDown);\n el.removeEventListener('thumbstickup', this.onThumbstickUp);\n el.removeEventListener('abuttontouchstart', this.onAorXTouchStart);\n el.removeEventListener('abuttontouchend', this.onAorXTouchEnd);\n el.removeEventListener('bbuttontouchstart', this.onBorYTouchStart);\n el.removeEventListener('bbuttontouchend', this.onBorYTouchEnd);\n el.removeEventListener('xbuttontouchstart', this.onAorXTouchStart);\n el.removeEventListener('xbuttontouchend', this.onAorXTouchEnd);\n el.removeEventListener('ybuttontouchstart', this.onBorYTouchStart);\n el.removeEventListener('ybuttontouchend', this.onBorYTouchEnd);\n el.removeEventListener('surfacetouchstart', this.onSurfaceTouchStart);\n el.removeEventListener('surfacetouchend', this.onSurfaceTouchEnd);\n },\n\n /**\n * Update handler. More like the `init` handler since the only property is the hand, and\n * that won't be changing much.\n */\n update: function (previousHand) {\n var controlConfiguration;\n var el = this.el;\n var hand = this.data.hand;\n var handModelStyle = this.data.handModelStyle;\n var handColor = this.data.color;\n var self = this;\n\n // Get common configuration to abstract different vendor controls.\n controlConfiguration = {\n hand: hand,\n model: false\n };\n\n // Set model.\n if (hand !== previousHand) {\n var handmodelUrl = MODEL_URLS[handModelStyle + hand.charAt(0).toUpperCase() + hand.slice(1)];\n this.loader.load(handmodelUrl, function (gltf) {\n var mesh = gltf.scene.children[0];\n var handModelOrientation = hand === 'left' ? Math.PI / 2 : -Math.PI / 2;\n mesh.mixer = new THREE.AnimationMixer(mesh);\n self.clips = gltf.animations;\n el.setObject3D('mesh', mesh);\n\n var handMaterial = mesh.children[1].material;\n handMaterial.color = new THREE.Color(handColor);\n mesh.position.set(0, 0, 0);\n mesh.rotation.set(0, 0, handModelOrientation);\n el.setAttribute('magicleap-controls', controlConfiguration);\n el.setAttribute('vive-controls', controlConfiguration);\n el.setAttribute('oculus-touch-controls', controlConfiguration);\n el.setAttribute('windows-motion-controls', controlConfiguration);\n el.setAttribute('hp-mixed-reality-controls', controlConfiguration);\n });\n }\n },\n\n remove: function () {\n this.el.removeObject3D('mesh');\n },\n\n /**\n * Play model animation, based on which button was pressed and which kind of event.\n *\n * 1. Process buttons.\n * 2. Determine gesture (this.determineGesture()).\n * 3. Animation gesture (this.animationGesture()).\n * 4. Emit gesture events (this.emitGestureEvents()).\n *\n * @param {string} button - Name of the button.\n * @param {string} evt - Type of event for the button (i.e., down/up/touchstart/touchend).\n */\n handleButton: function (button, evt) {\n var lastGesture;\n var isPressed = evt === 'down';\n var isTouched = evt === 'touchstart';\n\n // Update objects.\n if (evt.indexOf('touch') === 0) {\n // Update touch object.\n if (isTouched === this.touchedButtons[button]) { return; }\n this.touchedButtons[button] = isTouched;\n } else {\n // Update button object.\n if (isPressed === this.pressedButtons[button]) { return; }\n this.pressedButtons[button] = isPressed;\n }\n\n // Determine the gesture.\n lastGesture = this.gesture;\n this.gesture = this.determineGesture();\n\n // Same gesture.\n if (this.gesture === lastGesture) { return; }\n // Animate gesture.\n this.animateGesture(this.gesture, lastGesture);\n\n // Emit events.\n this.emitGestureEvents(this.gesture, lastGesture);\n },\n\n /**\n * Determine which pose hand should be in considering active and touched buttons.\n */\n determineGesture: function () {\n var gesture;\n var isGripActive = this.pressedButtons.grip;\n var isSurfaceActive = this.pressedButtons.surface || this.touchedButtons.surface;\n var isTrackpadActive = this.pressedButtons.trackpad || this.touchedButtons.trackpad;\n var isTriggerActive = this.pressedButtons.trigger || this.touchedButtons.trigger;\n var isABXYActive = this.touchedButtons.AorX || this.touchedButtons.BorY;\n var isVive = isViveController(this.el.components['tracked-controls']);\n\n // Works well with Oculus Touch and Windows Motion Controls, but Vive needs tweaks.\n if (isVive) {\n if (isGripActive || isTriggerActive) {\n gesture = ANIMATIONS.fist;\n } else if (isTrackpadActive) {\n gesture = ANIMATIONS.point;\n }\n } else {\n if (isGripActive) {\n if (isSurfaceActive || isABXYActive || isTrackpadActive) {\n gesture = isTriggerActive ? ANIMATIONS.fist : ANIMATIONS.point;\n } else {\n gesture = isTriggerActive ? ANIMATIONS.thumbUp : ANIMATIONS.pointThumb;\n }\n } else if (isTriggerActive) {\n gesture = ANIMATIONS.hold;\n }\n }\n\n return gesture;\n },\n\n /**\n * Play corresponding clip to a gesture\n */\n getClip: function (gesture) {\n var clip;\n var i;\n for (i = 0; i < this.clips.length; i++) {\n clip = this.clips[i];\n if (clip.name !== gesture) { continue; }\n return clip;\n }\n },\n\n /**\n * Play gesture animation.\n *\n * @param {string} gesture - Which pose to animate to. If absent, then animate to open.\n * @param {string} lastGesture - Previous gesture, to reverse back to open if needed.\n */\n animateGesture: function (gesture, lastGesture) {\n if (gesture) {\n this.playAnimation(gesture || ANIMATIONS.open, lastGesture, false);\n return;\n }\n\n // If no gesture, then reverse the current gesture back to open pose.\n this.playAnimation(lastGesture, lastGesture, true);\n },\n\n /**\n * Emit `hand-controls`-specific events.\n */\n emitGestureEvents: function (gesture, lastGesture) {\n var el = this.el;\n var eventName;\n\n if (lastGesture === gesture) { return; }\n\n // Emit event for lastGesture not inactive.\n eventName = getGestureEventName(lastGesture, false);\n if (eventName) { el.emit(eventName); }\n\n // Emit event for current gesture now active.\n eventName = getGestureEventName(gesture, true);\n if (eventName) { el.emit(eventName); }\n },\n\n /**\n * Play hand animation based on button state.\n *\n * @param {string} gesture - Name of the animation as specified by the model.\n * @param {string} lastGesture - Previous pose.\n * @param {boolean} reverse - Whether animation should play in reverse.\n */\n playAnimation: function (gesture, lastGesture, reverse) {\n var clip;\n var fromAction;\n var mesh = this.el.getObject3D('mesh');\n var toAction;\n\n if (!mesh) { return; }\n\n // Stop all current animations.\n mesh.mixer.stopAllAction();\n\n // Grab clip action.\n clip = this.getClip(gesture);\n toAction = mesh.mixer.clipAction(clip);\n toAction.clampWhenFinished = true;\n toAction.loop = THREE.LoopRepeat;\n toAction.repetitions = 0;\n toAction.timeScale = reverse ? -1 : 1;\n toAction.time = reverse ? clip.duration : 0;\n toAction.weight = 1;\n\n // No gesture to gesture or gesture to no gesture.\n if (!lastGesture || gesture === lastGesture) {\n // Stop all current animations.\n mesh.mixer.stopAllAction();\n // Play animation.\n toAction.play();\n return;\n }\n\n // Animate or crossfade from gesture to gesture.\n clip = this.getClip(lastGesture);\n fromAction = mesh.mixer.clipAction(clip);\n fromAction.weight = 0.15;\n fromAction.play();\n toAction.play();\n fromAction.crossFadeTo(toAction, 0.15, true);\n }\n});\n\n/**\n * Suffix gestures based on toggle state (e.g., open/close, up/down, start/end).\n *\n * @param {string} gesture\n * @param {boolean} active\n */\nfunction getGestureEventName (gesture, active) {\n var eventName;\n\n if (!gesture) { return; }\n\n eventName = EVENTS[gesture];\n if (eventName === 'grip') {\n return eventName + (active ? 'close' : 'open');\n }\n if (eventName === 'point') {\n return eventName + (active ? 'up' : 'down');\n }\n if (eventName === 'pointing' || eventName === 'pistol') {\n return eventName + (active ? 'start' : 'end');\n }\n}\n\nfunction isViveController (trackedControls) {\n var controller = trackedControls && trackedControls.controller;\n var isVive = controller && (controller.id && controller.id.indexOf('OpenVR ') === 0 ||\n (controller.profiles &&\n controller.profiles[0] &&\n controller.profiles[0] === 'htc-vive'));\n return isVive;\n}\n","var register = require('../core/component').registerComponent;\n\nmodule.exports.Component = register('hide-on-enter-ar', {\n init: function () {\n var self = this;\n this.el.sceneEl.addEventListener('enter-vr', function () {\n if (self.el.sceneEl.is('ar-mode')) {\n self.el.object3D.visible = false;\n }\n });\n this.el.sceneEl.addEventListener('exit-vr', function () {\n self.el.object3D.visible = true;\n });\n }\n});\n","var bind = require('../utils/bind');\nvar registerComponent = require('../core/component').registerComponent;\nvar THREE = require('../lib/three');\n\nvar trackedControlsUtils = require('../utils/tracked-controls');\nvar checkControllerPresentAndSetup = trackedControlsUtils.checkControllerPresentAndSetup;\nvar emitIfAxesChanged = trackedControlsUtils.emitIfAxesChanged;\nvar onButtonEvent = trackedControlsUtils.onButtonEvent;\n\n// See Profiles Registry:\n// https://github.com/immersive-web/webxr-input-profiles/tree/master/packages/registry\n// TODO: Add a more robust system for deriving gamepad name.\nvar GAMEPAD_ID = 'hp-mixed-reality';\n\nvar HP_MIXEDL_REALITY_MODEL_GLB_BASE_URL = 'https://cdn.aframe.io/controllers/hp/mixed-reality/';\n\nvar HP_MIXED_REALITY_POSITION_OFFSET = {x: 0, y: 0, z: 0.06};\nvar HP_MIXED_REALITY_ROTATION_OFFSET = {_x: Math.PI / 4, _y: 0, _z: 0, _order: 'XYZ'};\n\n/**\n * Button IDs:\n * 0 - trigger\n * 1 - grip\n * 3 - X / A\n * 4 - Y / B\n *\n * Axis:\n * 2 - joystick x axis\n * 3 - joystick y axis\n */\nvar INPUT_MAPPING_WEBXR = {\n left: {\n axes: {touchpad: [2, 3]},\n buttons: ['trigger', 'grip', 'none', 'thumbstick', 'xbutton', 'ybutton']\n },\n right: {\n axes: {touchpad: [2, 3]},\n buttons: ['trigger', 'grip', 'none', 'thumbstick', 'abutton', 'bbutton']\n }\n};\n\n/**\n * HP Mixed Reality Controls\n */\nmodule.exports.Component = registerComponent('hp-mixed-reality-controls', {\n schema: {\n hand: {default: 'none'},\n model: {default: true},\n orientationOffset: {type: 'vec3'}\n },\n\n mapping: INPUT_MAPPING_WEBXR,\n\n init: function () {\n var self = this;\n this.controllerPresent = false;\n this.lastControllerCheck = 0;\n this.onButtonChanged = bind(this.onButtonChanged, this);\n this.onButtonDown = function (evt) { onButtonEvent(evt.detail.id, 'down', self, self.data.hand); };\n this.onButtonUp = function (evt) { onButtonEvent(evt.detail.id, 'up', self, self.data.hand); };\n this.onButtonTouchEnd = function (evt) { onButtonEvent(evt.detail.id, 'touchend', self, self.data.hand); };\n this.onButtonTouchStart = function (evt) { onButtonEvent(evt.detail.id, 'touchstart', self, self.data.hand); };\n this.previousButtonValues = {};\n this.rendererSystem = this.el.sceneEl.systems.renderer;\n\n this.bindMethods();\n },\n\n update: function () {\n var data = this.data;\n this.controllerIndex = data.hand === 'right' ? 0 : data.hand === 'left' ? 1 : 2;\n },\n\n play: function () {\n this.checkIfControllerPresent();\n this.addControllersUpdateListener();\n },\n\n pause: function () {\n this.removeEventListeners();\n this.removeControllersUpdateListener();\n },\n\n bindMethods: function () {\n this.onModelLoaded = bind(this.onModelLoaded, this);\n this.onControllersUpdate = bind(this.onControllersUpdate, this);\n this.checkIfControllerPresent = bind(this.checkIfControllerPresent, this);\n this.removeControllersUpdateListener = bind(this.removeControllersUpdateListener, this);\n this.onAxisMoved = bind(this.onAxisMoved, this);\n },\n\n addEventListeners: function () {\n var el = this.el;\n el.addEventListener('buttonchanged', this.onButtonChanged);\n el.addEventListener('buttondown', this.onButtonDown);\n el.addEventListener('buttonup', this.onButtonUp);\n el.addEventListener('touchstart', this.onButtonTouchStart);\n el.addEventListener('touchend', this.onButtonTouchEnd);\n el.addEventListener('axismove', this.onAxisMoved);\n el.addEventListener('model-loaded', this.onModelLoaded);\n this.controllerEventsActive = true;\n },\n\n removeEventListeners: function () {\n var el = this.el;\n el.removeEventListener('buttonchanged', this.onButtonChanged);\n el.removeEventListener('buttondown', this.onButtonDown);\n el.removeEventListener('buttonup', this.onButtonUp);\n el.removeEventListener('touchstart', this.onButtonTouchStart);\n el.removeEventListener('touchend', this.onButtonTouchEnd);\n el.removeEventListener('axismove', this.onAxisMoved);\n el.removeEventListener('model-loaded', this.onModelLoaded);\n this.controllerEventsActive = false;\n },\n\n checkIfControllerPresent: function () {\n var data = this.data;\n checkControllerPresentAndSetup(this, GAMEPAD_ID,\n {index: this.controllerIndex, hand: data.hand});\n },\n\n injectTrackedControls: function () {\n var el = this.el;\n var data = this.data;\n\n el.setAttribute('tracked-controls', {\n // TODO: verify expected behavior between reserved prefixes.\n idPrefix: GAMEPAD_ID,\n hand: data.hand,\n controller: this.controllerIndex,\n orientationOffset: data.orientationOffset\n });\n\n // Load model.\n if (!this.data.model) { return; }\n this.el.setAttribute('gltf-model', HP_MIXEDL_REALITY_MODEL_GLB_BASE_URL + this.data.hand + '.glb');\n },\n\n addControllersUpdateListener: function () {\n this.el.sceneEl.addEventListener('controllersupdated', this.onControllersUpdate, false);\n },\n\n removeControllersUpdateListener: function () {\n this.el.sceneEl.removeEventListener('controllersupdated', this.onControllersUpdate, false);\n },\n\n onControllersUpdate: function () {\n // Note that due to gamepadconnected event propagation issues, we don't rely on events.\n this.checkIfControllerPresent();\n },\n\n onButtonChanged: function (evt) {\n var button = this.mapping[this.data.hand].buttons[evt.detail.id];\n var analogValue;\n\n if (!button) { return; }\n if (button === 'trigger') {\n analogValue = evt.detail.state.value;\n console.log('analog value of trigger press: ' + analogValue);\n }\n\n // Pass along changed event with button state, using button mapping for convenience.\n this.el.emit(button + 'changed', evt.detail.state);\n },\n\n onModelLoaded: function (evt) {\n var controllerObject3D = evt.detail.model;\n\n if (!this.data.model) { return; }\n\n controllerObject3D.position.copy(HP_MIXED_REALITY_POSITION_OFFSET);\n controllerObject3D.rotation.copy(HP_MIXED_REALITY_ROTATION_OFFSET);\n\n this.el.emit('controllermodelready', {\n name: 'hp-mixed-reality-controls',\n model: this.data.model,\n rayOrigin: new THREE.Vector3(0, 0, 0)\n });\n },\n\n onAxisMoved: function (evt) {\n emitIfAxesChanged(this, this.mapping.axes, evt);\n }\n});\n","require('./animation');\nrequire('./camera');\nrequire('./cursor');\nrequire('./daydream-controls');\nrequire('./gearvr-controls');\nrequire('./geometry');\nrequire('./generic-tracked-controller-controls');\nrequire('./gltf-model');\nrequire('./hand-tracking-controls');\nrequire('./hand-controls');\nrequire('./hide-on-enter-ar');\nrequire('./hp-mixed-reality-controls');\nrequire('./layer');\nrequire('./laser-controls');\nrequire('./light');\nrequire('./line');\nrequire('./link');\nrequire('./look-controls');\nrequire('./magicleap-controls');\nrequire('./material');\nrequire('./obj-model');\nrequire('./oculus-go-controls');\nrequire('./oculus-touch-controls');\nrequire('./position');\nrequire('./raycaster');\nrequire('./rotation');\nrequire('./scale');\nrequire('./shadow');\nrequire('./sound');\nrequire('./text');\nrequire('./tracked-controls');\nrequire('./tracked-controls-webvr');\nrequire('./tracked-controls-webxr');\nrequire('./visible');\nrequire('./valve-index-controls');\nrequire('./vive-controls');\nrequire('./vive-focus-controls');\nrequire('./wasd-controls');\nrequire('./windows-motion-controls');\n\nrequire('./scene/ar-hit-test');\nrequire('./scene/background');\nrequire('./scene/debug');\nrequire('./scene/device-orientation-permission-ui');\nrequire('./scene/embedded');\nrequire('./scene/inspector');\nrequire('./scene/fog');\nrequire('./scene/keyboard-shortcuts');\nrequire('./scene/pool');\nrequire('./scene/screenshot');\nrequire('./scene/stats');\nrequire('./scene/vr-mode-ui');\n","var registerComponent = require('../core/component').registerComponent;\nvar utils = require('../utils/');\n\nregisterComponent('laser-controls', {\n schema: {\n hand: {default: 'right'},\n model: {default: true},\n defaultModelColor: {type: 'color', default: 'grey'}\n },\n\n init: function () {\n var config = this.config;\n var data = this.data;\n var el = this.el;\n var self = this;\n var controlsConfiguration = {hand: data.hand, model: data.model};\n\n // Set all controller models.\n el.setAttribute('daydream-controls', controlsConfiguration);\n el.setAttribute('gearvr-controls', controlsConfiguration);\n el.setAttribute('hp-mixed-reality-controls', controlsConfiguration);\n el.setAttribute('magicleap-controls', controlsConfiguration);\n el.setAttribute('oculus-go-controls', controlsConfiguration);\n el.setAttribute('oculus-touch-controls', controlsConfiguration);\n el.setAttribute('valve-index-controls', controlsConfiguration);\n el.setAttribute('vive-controls', controlsConfiguration);\n el.setAttribute('vive-focus-controls', controlsConfiguration);\n el.setAttribute('windows-motion-controls', controlsConfiguration);\n el.setAttribute('generic-tracked-controller-controls', controlsConfiguration);\n\n // Wait for controller to connect, or have a valid pointing pose, before creating ray\n el.addEventListener('controllerconnected', createRay);\n el.addEventListener('controllerdisconnected', hideRay);\n el.addEventListener('controllermodelready', function (evt) {\n createRay(evt);\n self.modelReady = true;\n });\n\n function createRay (evt) {\n var controllerConfig = config[evt.detail.name];\n\n if (!controllerConfig) { return; }\n\n // Show the line unless a particular config opts to hide it, until a controllermodelready\n // event comes through.\n var raycasterConfig = utils.extend({\n showLine: true\n }, controllerConfig.raycaster || {});\n\n // The controllermodelready event contains a rayOrigin that takes into account\n // offsets specific to the loaded model.\n if (evt.detail.rayOrigin) {\n raycasterConfig.origin = evt.detail.rayOrigin.origin;\n raycasterConfig.direction = evt.detail.rayOrigin.direction;\n raycasterConfig.showLine = true;\n }\n\n // Only apply a default raycaster if it does not yet exist. This prevents it overwriting\n // config applied from a controllermodelready event.\n if (evt.detail.rayOrigin || !self.modelReady) {\n el.setAttribute('raycaster', raycasterConfig);\n } else {\n el.setAttribute('raycaster', 'showLine', true);\n }\n\n el.setAttribute('cursor', utils.extend({\n fuse: false\n }, controllerConfig.cursor));\n }\n\n function hideRay () {\n el.setAttribute('raycaster', 'showLine', false);\n }\n },\n\n config: {\n 'daydream-controls': {\n cursor: {downEvents: ['trackpaddown', 'triggerdown'], upEvents: ['trackpadup', 'triggerup']}\n },\n\n 'gearvr-controls': {\n cursor: {downEvents: ['triggerdown'], upEvents: ['triggerup']},\n raycaster: {origin: {x: 0, y: 0.0010, z: 0}}\n },\n\n 'generic-tracked-controller-controls': {\n cursor: {downEvents: ['triggerdown'], upEvents: ['triggerup']}\n },\n\n 'hp-mixed-reality-controls': {\n cursor: {downEvents: ['triggerdown'], upEvents: ['triggerup']},\n raycaster: {origin: {x: 0, y: 0, z: 0}}\n },\n\n 'magicleap-controls': {\n cursor: {downEvents: ['trackpaddown', 'triggerdown'], upEvents: ['trackpadup', 'triggerup']}\n },\n\n 'oculus-go-controls': {\n cursor: {downEvents: ['triggerdown'], upEvents: ['triggerup']},\n raycaster: {origin: {x: 0, y: 0.0005, z: 0}}\n },\n\n 'oculus-touch-controls': {\n cursor: {downEvents: ['triggerdown'], upEvents: ['triggerup']},\n raycaster: {origin: {x: 0, y: 0, z: 0}}\n },\n\n 'valve-index-controls': {\n cursor: {downEvents: ['triggerdown'], upEvents: ['triggerup']}\n },\n\n 'vive-controls': {\n cursor: {downEvents: ['triggerdown'], upEvents: ['triggerup']}\n },\n\n 'vive-focus-controls': {\n cursor: {downEvents: ['trackpaddown', 'triggerdown'], upEvents: ['trackpadup', 'triggerup']}\n },\n\n 'windows-motion-controls': {\n cursor: {downEvents: ['triggerdown'], upEvents: ['triggerup']},\n raycaster: {showLine: false}\n }\n }\n});\n","var bind = require('../utils/bind');\nvar utils = require('../utils');\nvar diff = utils.diff;\nvar debug = require('../utils/debug');\nvar registerComponent = require('../core/component').registerComponent;\nvar THREE = require('../lib/three');\n\nvar degToRad = THREE.Math.degToRad;\nvar warn = debug('components:light:warn');\nvar CubeLoader = new THREE.CubeTextureLoader();\n\nvar probeCache = {};\n\n/**\n * Light component.\n */\nmodule.exports.Component = registerComponent('light', {\n schema: {\n angle: {default: 60, if: {type: ['spot']}},\n color: {type: 'color', if: {type: ['ambient', 'directional', 'hemisphere', 'point', 'spot']}},\n envMap: {default: '', if: {type: ['probe']}},\n groundColor: {type: 'color', if: {type: ['hemisphere']}},\n decay: {default: 1, if: {type: ['point', 'spot']}},\n distance: {default: 0.0, min: 0, if: {type: ['point', 'spot']}},\n intensity: {default: 1.0, min: 0, if: {type: ['ambient', 'directional', 'hemisphere', 'point', 'spot', 'probe']}},\n penumbra: {default: 0, min: 0, max: 1, if: {type: ['spot']}},\n type: {\n default: 'directional',\n oneOf: ['ambient', 'directional', 'hemisphere', 'point', 'spot', 'probe'],\n schemaChange: true\n },\n target: {type: 'selector', if: {type: ['spot', 'directional']}},\n\n // Shadows.\n castShadow: {default: false, if: {type: ['point', 'spot', 'directional']}},\n shadowBias: {default: 0, if: {castShadow: true}},\n shadowCameraFar: {default: 500, if: {castShadow: true}},\n shadowCameraFov: {default: 90, if: {castShadow: true}},\n shadowCameraNear: {default: 0.5, if: {castShadow: true}},\n shadowCameraTop: {default: 5, if: {castShadow: true}},\n shadowCameraRight: {default: 5, if: {castShadow: true}},\n shadowCameraBottom: {default: -5, if: {castShadow: true}},\n shadowCameraLeft: {default: -5, if: {castShadow: true}},\n shadowCameraVisible: {default: false, if: {castShadow: true}},\n shadowMapHeight: {default: 512, if: {castShadow: true}},\n shadowMapWidth: {default: 512, if: {castShadow: true}},\n shadowRadius: {default: 1, if: {castShadow: true}}\n },\n\n /**\n * Notifies scene a light has been added to remove default lighting.\n */\n init: function () {\n var el = this.el;\n this.light = null;\n this.defaultTarget = null;\n this.rendererSystem = this.el.sceneEl.systems.renderer;\n this.system.registerLight(el);\n },\n\n /**\n * (Re)create or update light.\n */\n update: function (oldData) {\n var data = this.data;\n var diffData = diff(data, oldData);\n var light = this.light;\n var rendererSystem = this.rendererSystem;\n var self = this;\n\n // Existing light.\n if (light && !('type' in diffData)) {\n var shadowsLoaded = false;\n // Light type has not changed. Update light.\n Object.keys(diffData).forEach(function (key) {\n var value = data[key];\n\n switch (key) {\n case 'color': {\n light.color.set(value);\n rendererSystem.applyColorCorrection(light.color);\n break;\n }\n\n case 'groundColor': {\n light.groundColor.set(value);\n rendererSystem.applyColorCorrection(light.groundColor);\n break;\n }\n\n case 'angle': {\n light.angle = degToRad(value);\n break;\n }\n\n case 'target': {\n // Reset target if selector is null.\n if (value === null) {\n if (data.type === 'spot' || data.type === 'directional') {\n light.target = self.defaultTarget;\n }\n } else {\n // Target specified, set target to entity's `object3D` when it is loaded.\n if (value.hasLoaded) {\n self.onSetTarget(value, light);\n } else {\n value.addEventListener('loaded', bind(self.onSetTarget, self, value, light));\n }\n }\n break;\n }\n\n case 'envMap':\n this.updateProbeMap(data, light);\n break;\n\n case 'castShadow':\n case 'shadowBias':\n case 'shadowCameraFar':\n case 'shadowCameraFov':\n case 'shadowCameraNear':\n case 'shadowCameraTop':\n case 'shadowCameraRight':\n case 'shadowCameraBottom':\n case 'shadowCameraLeft':\n case 'shadowCameraVisible':\n case 'shadowMapHeight':\n case 'shadowMapWidth':\n case 'shadowRadius':\n if (!shadowsLoaded) {\n self.updateShadow();\n shadowsLoaded = true;\n }\n break;\n\n default: {\n light[key] = value;\n }\n }\n });\n return;\n }\n\n // No light yet or light type has changed. Create and add light.\n this.setLight(this.data);\n this.updateShadow();\n },\n\n setLight: function (data) {\n var el = this.el;\n var newLight = this.getLight(data);\n if (newLight) {\n if (this.light) {\n el.removeObject3D('light');\n }\n\n this.light = newLight;\n this.light.el = el;\n el.setObject3D('light', this.light);\n\n // HACK solution for issue #1624\n if (data.type === 'spot' || data.type === 'directional' || data.type === 'hemisphere') {\n el.getObject3D('light').translateY(-1);\n }\n\n // set and position default lighttarget as a child to enable spotlight orientation\n if (data.type === 'spot') {\n el.setObject3D('light-target', this.defaultTarget);\n el.getObject3D('light-target').position.set(0, 0, -1);\n }\n }\n },\n\n /**\n * Updates shadow-related properties on the current light.\n */\n updateShadow: function () {\n var el = this.el;\n var data = this.data;\n var light = this.light;\n\n light.castShadow = data.castShadow;\n\n // Shadow camera helper.\n var cameraHelper = el.getObject3D('cameraHelper');\n if (data.shadowCameraVisible && !cameraHelper) {\n el.setObject3D('cameraHelper', new THREE.CameraHelper(light.shadow.camera));\n } else if (!data.shadowCameraVisible && cameraHelper) {\n el.removeObject3D('cameraHelper');\n }\n\n if (!data.castShadow) { return light; }\n\n // Shadow appearance.\n light.shadow.bias = data.shadowBias;\n light.shadow.radius = data.shadowRadius;\n light.shadow.mapSize.height = data.shadowMapHeight;\n light.shadow.mapSize.width = data.shadowMapWidth;\n\n // Shadow camera.\n light.shadow.camera.near = data.shadowCameraNear;\n light.shadow.camera.far = data.shadowCameraFar;\n if (light.shadow.camera instanceof THREE.OrthographicCamera) {\n light.shadow.camera.top = data.shadowCameraTop;\n light.shadow.camera.right = data.shadowCameraRight;\n light.shadow.camera.bottom = data.shadowCameraBottom;\n light.shadow.camera.left = data.shadowCameraLeft;\n } else {\n light.shadow.camera.fov = data.shadowCameraFov;\n }\n light.shadow.camera.updateProjectionMatrix();\n\n if (cameraHelper) { cameraHelper.update(); }\n },\n\n /**\n * Creates a new three.js light object given data object defining the light.\n *\n * @param {object} data\n */\n getLight: function (data) {\n var angle = data.angle;\n var color = new THREE.Color(data.color);\n this.rendererSystem.applyColorCorrection(color);\n color = color.getHex();\n var decay = data.decay;\n var distance = data.distance;\n var groundColor = new THREE.Color(data.groundColor);\n this.rendererSystem.applyColorCorrection(groundColor);\n groundColor = groundColor.getHex();\n var intensity = data.intensity;\n var type = data.type;\n var target = data.target;\n var light = null;\n\n switch (type.toLowerCase()) {\n case 'ambient': {\n return new THREE.AmbientLight(color, intensity);\n }\n\n case 'directional': {\n light = new THREE.DirectionalLight(color, intensity);\n this.defaultTarget = light.target;\n if (target) {\n if (target.hasLoaded) {\n this.onSetTarget(target, light);\n } else {\n target.addEventListener('loaded', bind(this.onSetTarget, this, target, light));\n }\n }\n return light;\n }\n\n case 'hemisphere': {\n return new THREE.HemisphereLight(color, groundColor, intensity);\n }\n\n case 'point': {\n return new THREE.PointLight(color, intensity, distance, decay);\n }\n\n case 'spot': {\n light = new THREE.SpotLight(color, intensity, distance, degToRad(angle), data.penumbra, decay);\n this.defaultTarget = light.target;\n if (target) {\n if (target.hasLoaded) {\n this.onSetTarget(target, light);\n } else {\n target.addEventListener('loaded', bind(this.onSetTarget, this, target, light));\n }\n }\n return light;\n }\n\n case 'probe': {\n light = new THREE.LightProbe();\n this.updateProbeMap(data, light);\n return light;\n }\n\n default: {\n warn('%s is not a valid light type. ' +\n 'Choose from ambient, directional, hemisphere, point, spot.', type);\n }\n }\n },\n\n /**\n * Generate the spherical harmonics for the LightProbe from a cube map\n */\n updateProbeMap: function (data, light) {\n if (!data.envMap) {\n // reset parameters if no map\n light.copy(new THREE.LightProbe());\n }\n\n if (probeCache[data.envMap] instanceof window.Promise) {\n probeCache[data.envMap].then(function (tempLightProbe) {\n light.copy(tempLightProbe);\n });\n }\n if (probeCache[data.envMap] instanceof THREE.LightProbe) {\n light.copy(probeCache[data.envMap]);\n }\n probeCache[data.envMap] = new window.Promise(function (resolve) {\n utils.srcLoader.validateCubemapSrc(data.envMap, function loadEnvMap (urls) {\n CubeLoader.load(urls, function (cube) {\n var tempLightProbe = THREE.LightProbeGenerator.fromCubeTexture(cube);\n probeCache[data.envMap] = tempLightProbe;\n light.copy(tempLightProbe);\n });\n });\n });\n },\n\n onSetTarget: function (targetEl, light) {\n light.target = targetEl.object3D;\n },\n\n /**\n * Remove light on remove (callback).\n */\n remove: function () {\n var el = this.el;\n el.removeObject3D('light');\n if (el.getObject3D('cameraHelper')) {\n el.removeObject3D('cameraHelper');\n }\n }\n});\n","/* global THREE */\nvar registerComponent = require('../core/component').registerComponent;\n\nmodule.exports.Component = registerComponent('line', {\n schema: {\n start: {type: 'vec3', default: {x: 0, y: 0, z: 0}},\n end: {type: 'vec3', default: {x: 0, y: 0, z: 0}},\n color: {type: 'color', default: '#74BEC1'},\n opacity: {type: 'number', default: 1},\n visible: {default: true}\n },\n\n multiple: true,\n\n init: function () {\n var data = this.data;\n var geometry;\n var material;\n this.rendererSystem = this.el.sceneEl.systems.renderer;\n material = this.material = new THREE.LineBasicMaterial({\n color: data.color,\n opacity: data.opacity,\n transparent: data.opacity < 1,\n visible: data.visible\n });\n geometry = this.geometry = new THREE.BufferGeometry();\n geometry.setAttribute('position', new THREE.BufferAttribute(new Float32Array(2 * 3), 3));\n\n this.rendererSystem.applyColorCorrection(material.color);\n this.line = new THREE.Line(geometry, material);\n this.el.setObject3D(this.attrName, this.line);\n },\n\n update: function (oldData) {\n var data = this.data;\n var geometry = this.geometry;\n var geoNeedsUpdate = false;\n var material = this.material;\n var positionArray = geometry.attributes.position.array;\n\n // Update geometry.\n if (!isEqualVec3(data.start, oldData.start)) {\n positionArray[0] = data.start.x;\n positionArray[1] = data.start.y;\n positionArray[2] = data.start.z;\n geoNeedsUpdate = true;\n }\n\n if (!isEqualVec3(data.end, oldData.end)) {\n positionArray[3] = data.end.x;\n positionArray[4] = data.end.y;\n positionArray[5] = data.end.z;\n geoNeedsUpdate = true;\n }\n\n if (geoNeedsUpdate) {\n geometry.attributes.position.needsUpdate = true;\n geometry.computeBoundingSphere();\n }\n\n material.color.setStyle(data.color);\n this.rendererSystem.applyColorCorrection(material.color);\n material.opacity = data.opacity;\n material.transparent = data.opacity < 1;\n material.visible = data.visible;\n },\n\n remove: function () {\n this.el.removeObject3D('line', this.line);\n }\n});\n\nfunction isEqualVec3 (a, b) {\n if (!a || !b) { return false; }\n return (a.x === b.x && a.y === b.y && a.z === b.z);\n}\n","var registerComponent = require('../core/component').registerComponent;\nvar registerShader = require('../core/shader').registerShader;\nvar THREE = require('../lib/three');\n\n/**\n * Link component. Connect experiences and traverse between them in VR\n *\n * @member {object} hiddenEls - Store the hidden elements during peek mode.\n */\nmodule.exports.Component = registerComponent('link', {\n schema: {\n backgroundColor: {default: 'red', type: 'color'},\n borderColor: {default: 'white', type: 'color'},\n highlighted: {default: false},\n highlightedColor: {default: '#24CAFF', type: 'color'},\n href: {default: ''},\n image: {type: 'asset'},\n on: {default: 'click'},\n peekMode: {default: false},\n title: {default: ''},\n titleColor: {default: 'white', type: 'color'},\n visualAspectEnabled: {default: false}\n },\n\n init: function () {\n this.navigate = this.navigate.bind(this);\n this.previousQuaternion = undefined;\n this.quaternionClone = new THREE.Quaternion();\n // Store hidden elements during peek mode so we can show them again later.\n this.hiddenEls = [];\n },\n\n update: function (oldData) {\n var data = this.data;\n var el = this.el;\n var backgroundColor;\n var strokeColor;\n\n if (!data.visualAspectEnabled) { return; }\n\n this.initVisualAspect();\n\n backgroundColor = data.highlighted ? data.highlightedColor : data.backgroundColor;\n strokeColor = data.highlighted ? data.highlightedColor : data.borderColor;\n el.setAttribute('material', 'backgroundColor', backgroundColor);\n el.setAttribute('material', 'strokeColor', strokeColor);\n\n if (data.on !== oldData.on) { this.updateEventListener(); }\n\n if (oldData.peekMode !== undefined &&\n data.peekMode !== oldData.peekMode) { this.updatePeekMode(); }\n\n if (!data.image || oldData.image === data.image) { return; }\n\n el.setAttribute('material', 'pano',\n typeof data.image === 'string' ? data.image : data.image.src);\n },\n\n /*\n * Toggle all elements and full 360 preview of the linked page.\n */\n updatePeekMode: function () {\n var el = this.el;\n var sphereEl = this.sphereEl;\n if (this.data.peekMode) {\n this.hideAll();\n el.getObject3D('mesh').visible = false;\n sphereEl.setAttribute('visible', true);\n } else {\n this.showAll();\n el.getObject3D('mesh').visible = true;\n sphereEl.setAttribute('visible', false);\n }\n },\n\n play: function () {\n this.updateEventListener();\n },\n\n pause: function () {\n this.removeEventListener();\n },\n\n updateEventListener: function () {\n var el = this.el;\n if (!el.isPlaying) { return; }\n this.removeEventListener();\n el.addEventListener(this.data.on, this.navigate);\n },\n\n removeEventListener: function () {\n var on = this.data.on;\n if (!on) { return; }\n this.el.removeEventListener(on, this.navigate);\n },\n\n initVisualAspect: function () {\n var el = this.el;\n var semiSphereEl;\n var sphereEl;\n var textEl;\n\n if (!this.data.visualAspectEnabled || this.visualAspectInitialized) { return; }\n\n textEl = this.textEl = this.textEl || document.createElement('a-entity');\n sphereEl = this.sphereEl = this.sphereEl || document.createElement('a-entity');\n semiSphereEl = this.semiSphereEl = this.semiSphereEl || document.createElement('a-entity');\n\n // Set portal.\n el.setAttribute('geometry', {primitive: 'circle', radius: 1.0, segments: 64});\n el.setAttribute('material', {shader: 'portal', pano: this.data.image, side: 'double'});\n\n // Set text that displays the link title and URL.\n textEl.setAttribute('text', {\n color: this.data.titleColor,\n align: 'center',\n font: 'kelsonsans',\n value: this.data.title || this.data.href,\n width: 4\n });\n textEl.setAttribute('position', '0 1.5 0');\n el.appendChild(textEl);\n\n // Set sphere rendered when camera is close to portal to allow user to peek inside.\n semiSphereEl.setAttribute('geometry', {\n primitive: 'sphere',\n radius: 1.0,\n phiStart: 0,\n segmentsWidth: 64,\n segmentsHeight: 64,\n phiLength: 180,\n thetaStart: 0,\n thetaLength: 360\n });\n semiSphereEl.setAttribute('material', {\n shader: 'portal',\n borderEnabled: 0.0,\n pano: this.data.image,\n side: 'back'\n });\n semiSphereEl.setAttribute('rotation', '0 180 0');\n semiSphereEl.setAttribute('position', '0 0 0');\n semiSphereEl.setAttribute('visible', false);\n el.appendChild(semiSphereEl);\n\n // Set sphere rendered when camera is close to portal to allow user to peek inside.\n sphereEl.setAttribute('geometry', {\n primitive: 'sphere',\n radius: 10,\n segmentsWidth: 64,\n segmentsHeight: 64\n });\n sphereEl.setAttribute('material', {\n shader: 'portal',\n borderEnabled: 0.0,\n pano: this.data.image,\n side: 'back'\n });\n sphereEl.setAttribute('visible', false);\n el.appendChild(sphereEl);\n\n this.visualAspectInitialized = true;\n },\n\n navigate: function () {\n window.location = this.data.href;\n },\n\n /**\n * 1. Swap plane that represents portal with sphere with a hole when the camera is close\n * so user can peek inside portal. Sphere is rendered on oposite side of portal\n * from where user enters.\n * 2. Place the url/title above or inside portal depending on distance to camera.\n * 3. Face portal to camera when far away from user.\n */\n tick: (function () {\n var cameraWorldPosition = new THREE.Vector3();\n var elWorldPosition = new THREE.Vector3();\n var quaternion = new THREE.Quaternion();\n var scale = new THREE.Vector3();\n\n return function () {\n var el = this.el;\n var object3D = el.object3D;\n var camera = el.sceneEl.camera;\n var cameraPortalOrientation;\n var distance;\n var textEl = this.textEl;\n\n if (!this.data.visualAspectEnabled) { return; }\n\n // Update matrices\n object3D.updateMatrixWorld();\n camera.parent.updateMatrixWorld();\n camera.updateMatrixWorld();\n\n object3D.matrix.decompose(elWorldPosition, quaternion, scale);\n elWorldPosition.setFromMatrixPosition(object3D.matrixWorld);\n cameraWorldPosition.setFromMatrixPosition(camera.matrixWorld);\n distance = elWorldPosition.distanceTo(cameraWorldPosition);\n\n if (distance > 20) {\n // Store original orientation to be restored when the portal stops facing the camera.\n if (!this.previousQuaternion) {\n this.quaternionClone.copy(quaternion);\n this.previousQuaternion = this.quaternionClone;\n }\n // If the portal is far away from the user, face portal to camera.\n object3D.lookAt(cameraWorldPosition);\n } else {\n // When portal is close to the user/camera.\n cameraPortalOrientation = this.calculateCameraPortalOrientation();\n // If user gets very close to portal, replace with holed sphere they can peek in.\n if (distance < 0.5) {\n // Configure text size and sphere orientation depending side user approaches portal.\n if (this.semiSphereEl.getAttribute('visible') === true) { return; }\n textEl.setAttribute('text', 'width', 1.5);\n if (cameraPortalOrientation <= 0.0) {\n textEl.setAttribute('position', '0 0 0.75');\n textEl.setAttribute('rotation', '0 180 0');\n this.semiSphereEl.setAttribute('rotation', '0 0 0');\n } else {\n textEl.setAttribute('position', '0 0 -0.75');\n textEl.setAttribute('rotation', '0 0 0');\n this.semiSphereEl.setAttribute('rotation', '0 180 0');\n }\n el.getObject3D('mesh').visible = false;\n this.semiSphereEl.setAttribute('visible', true);\n this.peekCameraPortalOrientation = cameraPortalOrientation;\n } else {\n // Calculate wich side the camera is approaching the camera (back / front).\n // Adjust text orientation based on camera position.\n if (cameraPortalOrientation <= 0.0) {\n textEl.setAttribute('rotation', '0 180 0');\n } else {\n textEl.setAttribute('rotation', '0 0 0');\n }\n textEl.setAttribute('text', 'width', 5);\n textEl.setAttribute('position', '0 1.5 0');\n el.getObject3D('mesh').visible = true;\n this.semiSphereEl.setAttribute('visible', false);\n this.peekCameraPortalOrientation = undefined;\n }\n if (this.previousQuaternion) {\n object3D.quaternion.copy(this.previousQuaternion);\n this.previousQuaternion = undefined;\n }\n }\n };\n })(),\n\n hideAll: function () {\n var el = this.el;\n var hiddenEls = this.hiddenEls;\n var self = this;\n if (hiddenEls.length > 0) { return; }\n el.sceneEl.object3D.traverse(function (object) {\n if (object && object.el && object.el.hasAttribute('link-controls')) { return; }\n if (!object.el || object === el.sceneEl.object3D || object.el === el ||\n object.el === self.sphereEl || object.el === el.sceneEl.cameraEl ||\n object.el.getAttribute('visible') === false || object.el === self.textEl ||\n object.el === self.semiSphereEl) {\n return;\n }\n object.el.setAttribute('visible', false);\n hiddenEls.push(object.el);\n });\n },\n\n showAll: function () {\n this.hiddenEls.forEach(function (el) { el.setAttribute('visible', true); });\n this.hiddenEls = [];\n },\n\n /**\n * Calculate whether the camera faces the front or back face of the portal.\n * @returns {number} > 0 if camera faces front of portal, < 0 if it faces back of portal.\n */\n calculateCameraPortalOrientation: (function () {\n var mat4 = new THREE.Matrix4();\n var cameraPosition = new THREE.Vector3();\n var portalNormal = new THREE.Vector3(0, 0, 1);\n var portalPosition = new THREE.Vector3(0, 0, 0);\n\n return function () {\n var el = this.el;\n var camera = el.sceneEl.camera;\n\n // Reset tmp variables.\n cameraPosition.set(0, 0, 0);\n portalNormal.set(0, 0, 1);\n portalPosition.set(0, 0, 0);\n\n // Apply portal orientation to the normal.\n el.object3D.matrixWorld.extractRotation(mat4);\n portalNormal.applyMatrix4(mat4);\n\n // Calculate portal world position.\n el.object3D.updateMatrixWorld();\n el.object3D.localToWorld(portalPosition);\n\n // Calculate camera world position.\n camera.parent.parent.updateMatrixWorld();\n camera.parent.updateMatrixWorld();\n camera.updateMatrixWorld();\n camera.localToWorld(cameraPosition);\n\n // Calculate vector from portal to camera.\n // (portal) -------> (camera)\n cameraPosition.sub(portalPosition).normalize();\n portalNormal.normalize();\n\n // Side where camera approaches portal is given by sign of dot product of portal normal\n // and portal to camera vectors.\n return Math.sign(portalNormal.dot(cameraPosition));\n };\n })(),\n\n remove: function () {\n this.removeEventListener();\n }\n});\n\n/* eslint-disable */\nregisterShader('portal', {\n schema: {\n borderEnabled: {default: 1.0, type: 'int', is: 'uniform'},\n backgroundColor: {default: 'red', type: 'color', is: 'uniform'},\n pano: {type: 'map', is: 'uniform'},\n strokeColor: {default: 'white', type: 'color', is: 'uniform'}\n },\n\n vertexShader: [\n 'vec3 portalPosition;',\n 'varying vec3 vWorldPosition;',\n 'varying float vDistanceToCenter;',\n 'varying float vDistance;',\n 'void main() {',\n 'vDistanceToCenter = clamp(length(position - vec3(0.0, 0.0, 0.0)), 0.0, 1.0);',\n 'portalPosition = (modelMatrix * vec4(0.0, 0.0, 0.0, 1.0)).xyz;',\n 'vDistance = length(portalPosition - cameraPosition);',\n 'vWorldPosition = (modelMatrix * vec4(position, 1.0)).xyz;',\n 'gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);',\n '}'\n ].join('\\n'),\n\n fragmentShader: [\n '#define RECIPROCAL_PI2 0.15915494',\n 'uniform sampler2D pano;',\n 'uniform vec3 strokeColor;',\n 'uniform vec3 backgroundColor;',\n 'uniform float borderEnabled;',\n 'varying float vDistanceToCenter;',\n 'varying float vDistance;',\n 'varying vec3 vWorldPosition;',\n 'void main() {',\n 'vec3 direction = normalize(vWorldPosition - cameraPosition);',\n 'vec2 sampleUV;',\n 'float borderThickness = clamp(exp(-vDistance / 50.0), 0.6, 0.95);',\n 'sampleUV.y = clamp(direction.y * 0.5 + 0.5, 0.0, 1.0);',\n 'sampleUV.x = atan(direction.z, -direction.x) * -RECIPROCAL_PI2 + 0.5;',\n 'if (vDistanceToCenter > borderThickness && borderEnabled == 1.0) {',\n 'gl_FragColor = vec4(strokeColor, 1.0);',\n '} else {',\n 'gl_FragColor = mix(texture2D(pano, sampleUV), vec4(backgroundColor, 1.0), clamp(pow((vDistance / 15.0), 2.0), 0.0, 1.0));',\n '}',\n '}'\n ].join('\\n')\n});\n/* eslint-enable */\n","/* global DeviceOrientationEvent */\nvar registerComponent = require('../core/component').registerComponent;\nvar THREE = require('../lib/three');\nvar utils = require('../utils/');\nvar bind = utils.bind;\n\n// To avoid recalculation at every mouse movement tick\nvar PI_2 = Math.PI / 2;\n\n/**\n * look-controls. Update entity pose, factoring mouse, touch, and WebVR API data.\n */\nmodule.exports.Component = registerComponent('look-controls', {\n dependencies: ['position', 'rotation'],\n\n schema: {\n enabled: {default: true},\n magicWindowTrackingEnabled: {default: true},\n pointerLockEnabled: {default: false},\n reverseMouseDrag: {default: false},\n reverseTouchDrag: {default: false},\n touchEnabled: {default: true},\n mouseEnabled: {default: true}\n },\n\n init: function () {\n this.deltaYaw = 0;\n this.previousHMDPosition = new THREE.Vector3();\n this.hmdQuaternion = new THREE.Quaternion();\n this.magicWindowAbsoluteEuler = new THREE.Euler();\n this.magicWindowDeltaEuler = new THREE.Euler();\n this.position = new THREE.Vector3();\n this.magicWindowObject = new THREE.Object3D();\n this.rotation = {};\n this.deltaRotation = {};\n this.savedPose = null;\n this.pointerLocked = false;\n this.setupMouseControls();\n this.bindMethods();\n this.previousMouseEvent = {};\n\n this.setupMagicWindowControls();\n\n // To save / restore camera pose\n this.savedPose = {\n position: new THREE.Vector3(),\n rotation: new THREE.Euler()\n };\n\n // Call enter VR handler if the scene has entered VR before the event listeners attached.\n if (this.el.sceneEl.is('vr-mode') || this.el.sceneEl.is('ar-mode')) { this.onEnterVR(); }\n },\n\n setupMagicWindowControls: function () {\n var magicWindowControls;\n var data = this.data;\n\n // Only on mobile devices and only enabled if DeviceOrientation permission has been granted.\n if (utils.device.isMobile() || utils.device.isMobileDeviceRequestingDesktopSite()) {\n magicWindowControls = this.magicWindowControls = new THREE.DeviceOrientationControls(this.magicWindowObject);\n if (typeof DeviceOrientationEvent !== 'undefined' && DeviceOrientationEvent.requestPermission) {\n magicWindowControls.enabled = false;\n if (this.el.sceneEl.components['device-orientation-permission-ui'].permissionGranted) {\n magicWindowControls.enabled = data.magicWindowTrackingEnabled;\n } else {\n this.el.sceneEl.addEventListener('deviceorientationpermissiongranted', function () {\n magicWindowControls.enabled = data.magicWindowTrackingEnabled;\n });\n }\n }\n }\n },\n\n update: function (oldData) {\n var data = this.data;\n\n // Disable grab cursor classes if no longer enabled.\n if (data.enabled !== oldData.enabled) {\n this.updateGrabCursor(data.enabled);\n }\n\n // Reset magic window eulers if tracking is disabled.\n if (oldData && !data.magicWindowTrackingEnabled && oldData.magicWindowTrackingEnabled) {\n this.magicWindowAbsoluteEuler.set(0, 0, 0);\n this.magicWindowDeltaEuler.set(0, 0, 0);\n }\n\n // Pass on magic window tracking setting to magicWindowControls.\n if (this.magicWindowControls) {\n this.magicWindowControls.enabled = data.magicWindowTrackingEnabled;\n }\n\n if (oldData && !data.pointerLockEnabled !== oldData.pointerLockEnabled) {\n this.removeEventListeners();\n this.addEventListeners();\n if (this.pointerLocked) { this.exitPointerLock(); }\n }\n },\n\n tick: function (t) {\n var data = this.data;\n if (!data.enabled) { return; }\n this.updateOrientation();\n },\n\n play: function () {\n this.addEventListeners();\n },\n\n pause: function () {\n this.removeEventListeners();\n if (this.pointerLocked) { this.exitPointerLock(); }\n },\n\n remove: function () {\n this.removeEventListeners();\n if (this.pointerLocked) { this.exitPointerLock(); }\n },\n\n bindMethods: function () {\n this.onMouseDown = bind(this.onMouseDown, this);\n this.onMouseMove = bind(this.onMouseMove, this);\n this.onMouseUp = bind(this.onMouseUp, this);\n this.onTouchStart = bind(this.onTouchStart, this);\n this.onTouchMove = bind(this.onTouchMove, this);\n this.onTouchEnd = bind(this.onTouchEnd, this);\n this.onEnterVR = bind(this.onEnterVR, this);\n this.onExitVR = bind(this.onExitVR, this);\n this.onPointerLockChange = bind(this.onPointerLockChange, this);\n this.onPointerLockError = bind(this.onPointerLockError, this);\n },\n\n /**\n * Set up states and Object3Ds needed to store rotation data.\n */\n setupMouseControls: function () {\n this.mouseDown = false;\n this.pitchObject = new THREE.Object3D();\n this.yawObject = new THREE.Object3D();\n this.yawObject.position.y = 10;\n this.yawObject.add(this.pitchObject);\n },\n\n /**\n * Add mouse and touch event listeners to canvas.\n */\n addEventListeners: function () {\n var sceneEl = this.el.sceneEl;\n var canvasEl = sceneEl.canvas;\n\n // Wait for canvas to load.\n if (!canvasEl) {\n sceneEl.addEventListener('render-target-loaded', bind(this.addEventListeners, this));\n return;\n }\n\n // Mouse events.\n canvasEl.addEventListener('mousedown', this.onMouseDown, false);\n window.addEventListener('mousemove', this.onMouseMove, false);\n window.addEventListener('mouseup', this.onMouseUp, false);\n\n // Touch events.\n canvasEl.addEventListener('touchstart', this.onTouchStart);\n window.addEventListener('touchmove', this.onTouchMove);\n window.addEventListener('touchend', this.onTouchEnd);\n\n // sceneEl events.\n sceneEl.addEventListener('enter-vr', this.onEnterVR);\n sceneEl.addEventListener('exit-vr', this.onExitVR);\n\n // Pointer Lock events.\n if (this.data.pointerLockEnabled) {\n document.addEventListener('pointerlockchange', this.onPointerLockChange, false);\n document.addEventListener('mozpointerlockchange', this.onPointerLockChange, false);\n document.addEventListener('pointerlockerror', this.onPointerLockError, false);\n }\n },\n\n /**\n * Remove mouse and touch event listeners from canvas.\n */\n removeEventListeners: function () {\n var sceneEl = this.el.sceneEl;\n var canvasEl = sceneEl && sceneEl.canvas;\n\n if (!canvasEl) { return; }\n\n // Mouse events.\n canvasEl.removeEventListener('mousedown', this.onMouseDown);\n window.removeEventListener('mousemove', this.onMouseMove);\n window.removeEventListener('mouseup', this.onMouseUp);\n\n // Touch events.\n canvasEl.removeEventListener('touchstart', this.onTouchStart);\n window.removeEventListener('touchmove', this.onTouchMove);\n window.removeEventListener('touchend', this.onTouchEnd);\n\n // sceneEl events.\n sceneEl.removeEventListener('enter-vr', this.onEnterVR);\n sceneEl.removeEventListener('exit-vr', this.onExitVR);\n\n // Pointer Lock events.\n document.removeEventListener('pointerlockchange', this.onPointerLockChange, false);\n document.removeEventListener('mozpointerlockchange', this.onPointerLockChange, false);\n document.removeEventListener('pointerlockerror', this.onPointerLockError, false);\n },\n\n /**\n * Update orientation for mobile, mouse drag, and headset.\n * Mouse-drag only enabled if HMD is not active.\n */\n updateOrientation: function () {\n var object3D = this.el.object3D;\n var pitchObject = this.pitchObject;\n var yawObject = this.yawObject;\n var sceneEl = this.el.sceneEl;\n\n // In VR or AR mode, THREE is in charge of updating the camera pose.\n if ((sceneEl.is('vr-mode') || sceneEl.is('ar-mode')) && sceneEl.checkHeadsetConnected()) {\n // With WebXR THREE applies headset pose to the object3D internally.\n return;\n }\n\n this.updateMagicWindowOrientation();\n\n // On mobile, do camera rotation with touch events and sensors.\n object3D.rotation.x = this.magicWindowDeltaEuler.x + pitchObject.rotation.x;\n object3D.rotation.y = this.magicWindowDeltaEuler.y + yawObject.rotation.y;\n object3D.rotation.z = this.magicWindowDeltaEuler.z;\n },\n\n updateMagicWindowOrientation: function () {\n var magicWindowAbsoluteEuler = this.magicWindowAbsoluteEuler;\n var magicWindowDeltaEuler = this.magicWindowDeltaEuler;\n // Calculate magic window HMD quaternion.\n if (this.magicWindowControls && this.magicWindowControls.enabled) {\n this.magicWindowControls.update();\n magicWindowAbsoluteEuler.setFromQuaternion(this.magicWindowObject.quaternion, 'YXZ');\n if (!this.previousMagicWindowYaw && magicWindowAbsoluteEuler.y !== 0) {\n this.previousMagicWindowYaw = magicWindowAbsoluteEuler.y;\n }\n if (this.previousMagicWindowYaw) {\n magicWindowDeltaEuler.x = magicWindowAbsoluteEuler.x;\n magicWindowDeltaEuler.y += magicWindowAbsoluteEuler.y - this.previousMagicWindowYaw;\n magicWindowDeltaEuler.z = magicWindowAbsoluteEuler.z;\n this.previousMagicWindowYaw = magicWindowAbsoluteEuler.y;\n }\n }\n },\n\n /**\n * Translate mouse drag into rotation.\n *\n * Dragging up and down rotates the camera around the X-axis (yaw).\n * Dragging left and right rotates the camera around the Y-axis (pitch).\n */\n onMouseMove: function (evt) {\n var direction;\n var movementX;\n var movementY;\n var pitchObject = this.pitchObject;\n var previousMouseEvent = this.previousMouseEvent;\n var yawObject = this.yawObject;\n\n // Not dragging or not enabled.\n if (!this.data.enabled || (!this.mouseDown && !this.pointerLocked)) { return; }\n\n // Calculate delta.\n if (this.pointerLocked) {\n movementX = evt.movementX || evt.mozMovementX || 0;\n movementY = evt.movementY || evt.mozMovementY || 0;\n } else {\n movementX = evt.screenX - previousMouseEvent.screenX;\n movementY = evt.screenY - previousMouseEvent.screenY;\n }\n this.previousMouseEvent.screenX = evt.screenX;\n this.previousMouseEvent.screenY = evt.screenY;\n\n // Calculate rotation.\n direction = this.data.reverseMouseDrag ? 1 : -1;\n yawObject.rotation.y += movementX * 0.002 * direction;\n pitchObject.rotation.x += movementY * 0.002 * direction;\n pitchObject.rotation.x = Math.max(-PI_2, Math.min(PI_2, pitchObject.rotation.x));\n },\n\n /**\n * Register mouse down to detect mouse drag.\n */\n onMouseDown: function (evt) {\n var sceneEl = this.el.sceneEl;\n if (!this.data.enabled || !this.data.mouseEnabled || ((sceneEl.is('vr-mode') || sceneEl.is('ar-mode')) && sceneEl.checkHeadsetConnected())) { return; }\n // Handle only primary button.\n if (evt.button !== 0) { return; }\n\n var canvasEl = sceneEl && sceneEl.canvas;\n\n this.mouseDown = true;\n this.previousMouseEvent.screenX = evt.screenX;\n this.previousMouseEvent.screenY = evt.screenY;\n this.showGrabbingCursor();\n\n if (this.data.pointerLockEnabled && !this.pointerLocked) {\n if (canvasEl.requestPointerLock) {\n canvasEl.requestPointerLock();\n } else if (canvasEl.mozRequestPointerLock) {\n canvasEl.mozRequestPointerLock();\n }\n }\n },\n\n /**\n * Shows grabbing cursor on scene\n */\n showGrabbingCursor: function () {\n this.el.sceneEl.canvas.style.cursor = 'grabbing';\n },\n\n /**\n * Hides grabbing cursor on scene\n */\n hideGrabbingCursor: function () {\n this.el.sceneEl.canvas.style.cursor = '';\n },\n\n /**\n * Register mouse up to detect release of mouse drag.\n */\n onMouseUp: function () {\n this.mouseDown = false;\n this.hideGrabbingCursor();\n },\n\n /**\n * Register touch down to detect touch drag.\n */\n onTouchStart: function (evt) {\n if (evt.touches.length !== 1 ||\n !this.data.touchEnabled ||\n this.el.sceneEl.is('vr-mode') ||\n this.el.sceneEl.is('ar-mode')) { return; }\n this.touchStart = {\n x: evt.touches[0].pageX,\n y: evt.touches[0].pageY\n };\n this.touchStarted = true;\n },\n\n /**\n * Translate touch move to Y-axis rotation.\n */\n onTouchMove: function (evt) {\n var direction;\n var canvas = this.el.sceneEl.canvas;\n var deltaY;\n var yawObject = this.yawObject;\n\n if (!this.touchStarted || !this.data.touchEnabled) { return; }\n\n deltaY = 2 * Math.PI * (evt.touches[0].pageX - this.touchStart.x) / canvas.clientWidth;\n\n direction = this.data.reverseTouchDrag ? 1 : -1;\n // Limit touch orientaion to to yaw (y axis).\n yawObject.rotation.y -= deltaY * 0.5 * direction;\n this.touchStart = {\n x: evt.touches[0].pageX,\n y: evt.touches[0].pageY\n };\n },\n\n /**\n * Register touch end to detect release of touch drag.\n */\n onTouchEnd: function () {\n this.touchStarted = false;\n },\n\n /**\n * Save pose.\n */\n onEnterVR: function () {\n var sceneEl = this.el.sceneEl;\n if (!sceneEl.checkHeadsetConnected()) { return; }\n this.saveCameraPose();\n this.el.object3D.position.set(0, 0, 0);\n this.el.object3D.rotation.set(0, 0, 0);\n if (sceneEl.hasWebXR) {\n this.el.object3D.matrixAutoUpdate = false;\n this.el.object3D.updateMatrix();\n }\n },\n\n /**\n * Restore the pose.\n */\n onExitVR: function () {\n if (!this.el.sceneEl.checkHeadsetConnected()) { return; }\n this.restoreCameraPose();\n this.previousHMDPosition.set(0, 0, 0);\n this.el.object3D.matrixAutoUpdate = true;\n },\n\n /**\n * Update Pointer Lock state.\n */\n onPointerLockChange: function () {\n this.pointerLocked = !!(document.pointerLockElement || document.mozPointerLockElement);\n },\n\n /**\n * Recover from Pointer Lock error.\n */\n onPointerLockError: function () {\n this.pointerLocked = false;\n },\n\n // Exits pointer-locked mode.\n exitPointerLock: function () {\n document.exitPointerLock();\n this.pointerLocked = false;\n },\n\n /**\n * Toggle the feature of showing/hiding the grab cursor.\n */\n updateGrabCursor: function (enabled) {\n var sceneEl = this.el.sceneEl;\n\n function enableGrabCursor () { sceneEl.canvas.classList.add('a-grab-cursor'); }\n function disableGrabCursor () { sceneEl.canvas.classList.remove('a-grab-cursor'); }\n\n if (!sceneEl.canvas) {\n if (enabled) {\n sceneEl.addEventListener('render-target-loaded', enableGrabCursor);\n } else {\n sceneEl.addEventListener('render-target-loaded', disableGrabCursor);\n }\n return;\n }\n\n if (enabled) {\n enableGrabCursor();\n return;\n }\n disableGrabCursor();\n },\n\n /**\n * Save camera pose before entering VR to restore later if exiting.\n */\n saveCameraPose: function () {\n var el = this.el;\n\n this.savedPose.position.copy(el.object3D.position);\n this.savedPose.rotation.copy(el.object3D.rotation);\n this.hasSavedPose = true;\n },\n\n /**\n * Reset camera pose to before entering VR.\n */\n restoreCameraPose: function () {\n var el = this.el;\n var savedPose = this.savedPose;\n\n if (!this.hasSavedPose) { return; }\n\n // Reset camera orientation.\n el.object3D.position.copy(savedPose.position);\n el.object3D.rotation.copy(savedPose.rotation);\n this.hasSavedPose = false;\n }\n});\n","var bind = require('../utils/bind');\nvar registerComponent = require('../core/component').registerComponent;\n\nvar trackedControlsUtils = require('../utils/tracked-controls');\nvar checkControllerPresentAndSetup = trackedControlsUtils.checkControllerPresentAndSetup;\nvar emitIfAxesChanged = trackedControlsUtils.emitIfAxesChanged;\nvar onButtonEvent = trackedControlsUtils.onButtonEvent;\n\n// See Profiles Registry:\n// https://github.com/immersive-web/webxr-input-profiles/tree/master/packages/registry\n// TODO: Add a more robust system for deriving gamepad name.\nvar GAMEPAD_ID_PREFIX = 'magicleap';\nvar GAMEPAD_ID_SUFFIX = '-one';\nvar GAMEPAD_ID_COMPOSITE = GAMEPAD_ID_PREFIX + GAMEPAD_ID_SUFFIX;\n\nvar MAGICLEAP_CONTROLLER_MODEL_GLB_URL = 'https://cdn.aframe.io/controllers/magicleap/magicleap-one-controller.glb';\n\n/**\n * Button IDs:\n * 0 - trigger\n * 1 - grip\n * 2 - touchpad\n * 3 - menu (never dispatched on this layer)\n *\n * Axis:\n * 0 - touchpad x axis\n * 1 - touchpad y axis\n */\nvar INPUT_MAPPING_WEBXR = {\n axes: {touchpad: [0, 1]},\n buttons: ['trigger', 'grip', 'touchpad', 'menu']\n};\n\n/**\n * Magic Leap Controls\n * Interface with Magic Leap control and map Gamepad events to controller\n * buttons: trigger, grip, touchpad, and menu.\n * Load a controller model.\n */\nmodule.exports.Component = registerComponent('magicleap-controls', {\n schema: {\n hand: {default: 'none'},\n model: {default: true},\n orientationOffset: {type: 'vec3'}\n },\n\n mapping: INPUT_MAPPING_WEBXR,\n\n init: function () {\n var self = this;\n this.controllerPresent = false;\n this.lastControllerCheck = 0;\n this.onButtonChanged = bind(this.onButtonChanged, this);\n this.onButtonDown = function (evt) { onButtonEvent(evt.detail.id, 'down', self); };\n this.onButtonUp = function (evt) { onButtonEvent(evt.detail.id, 'up', self); };\n this.onButtonTouchEnd = function (evt) { onButtonEvent(evt.detail.id, 'touchend', self); };\n this.onButtonTouchStart = function (evt) { onButtonEvent(evt.detail.id, 'touchstart', self); };\n this.previousButtonValues = {};\n this.rendererSystem = this.el.sceneEl.systems.renderer;\n\n this.bindMethods();\n },\n\n update: function () {\n var data = this.data;\n this.controllerIndex = data.hand === 'right' ? 0 : data.hand === 'left' ? 1 : 2;\n },\n\n play: function () {\n this.checkIfControllerPresent();\n this.addControllersUpdateListener();\n },\n\n pause: function () {\n this.removeEventListeners();\n this.removeControllersUpdateListener();\n },\n\n bindMethods: function () {\n this.onModelLoaded = bind(this.onModelLoaded, this);\n this.onControllersUpdate = bind(this.onControllersUpdate, this);\n this.checkIfControllerPresent = bind(this.checkIfControllerPresent, this);\n this.removeControllersUpdateListener = bind(this.removeControllersUpdateListener, this);\n this.onAxisMoved = bind(this.onAxisMoved, this);\n },\n\n addEventListeners: function () {\n var el = this.el;\n el.addEventListener('buttonchanged', this.onButtonChanged);\n el.addEventListener('buttondown', this.onButtonDown);\n el.addEventListener('buttonup', this.onButtonUp);\n el.addEventListener('touchstart', this.onButtonTouchStart);\n el.addEventListener('touchend', this.onButtonTouchEnd);\n el.addEventListener('axismove', this.onAxisMoved);\n el.addEventListener('model-loaded', this.onModelLoaded);\n this.controllerEventsActive = true;\n },\n\n removeEventListeners: function () {\n var el = this.el;\n el.removeEventListener('buttonchanged', this.onButtonChanged);\n el.removeEventListener('buttondown', this.onButtonDown);\n el.removeEventListener('buttonup', this.onButtonUp);\n el.removeEventListener('touchstart', this.onButtonTouchStart);\n el.removeEventListener('touchend', this.onButtonTouchEnd);\n el.removeEventListener('axismove', this.onAxisMoved);\n el.removeEventListener('model-loaded', this.onModelLoaded);\n this.controllerEventsActive = false;\n },\n\n checkIfControllerPresent: function () {\n var data = this.data;\n checkControllerPresentAndSetup(this, GAMEPAD_ID_COMPOSITE,\n {index: this.controllerIndex, hand: data.hand});\n },\n\n injectTrackedControls: function () {\n var el = this.el;\n var data = this.data;\n\n el.setAttribute('tracked-controls', {\n // TODO: verify expected behavior between reserved prefixes.\n idPrefix: GAMEPAD_ID_COMPOSITE,\n hand: data.hand,\n controller: this.controllerIndex,\n orientationOffset: data.orientationOffset\n });\n\n // Load model.\n if (!this.data.model) { return; }\n this.el.setAttribute('gltf-model', MAGICLEAP_CONTROLLER_MODEL_GLB_URL);\n },\n\n addControllersUpdateListener: function () {\n this.el.sceneEl.addEventListener('controllersupdated', this.onControllersUpdate, false);\n },\n\n removeControllersUpdateListener: function () {\n this.el.sceneEl.removeEventListener('controllersupdated', this.onControllersUpdate, false);\n },\n\n onControllersUpdate: function () {\n // Note that due to gamepadconnected event propagation issues, we don't rely on events.\n this.checkIfControllerPresent();\n },\n\n /**\n * Rotate the trigger button based on how hard the trigger is pressed.\n */\n onButtonChanged: function (evt) {\n var button = this.mapping.buttons[evt.detail.id];\n var analogValue;\n\n if (!button) { return; }\n if (button === 'trigger') {\n analogValue = evt.detail.state.value;\n console.log('analog value of trigger press: ' + analogValue);\n }\n\n // Pass along changed event with button state, using button mapping for convenience.\n this.el.emit(button + 'changed', evt.detail.state);\n },\n\n onModelLoaded: function (evt) {\n var controllerObject3D = evt.detail.model;\n // our glb scale is too large.\n controllerObject3D.scale.set(0.01, 0.01, 0.01);\n },\n\n onAxisMoved: function (evt) {\n emitIfAxesChanged(this, this.mapping.axes, evt);\n },\n\n updateModel: function (buttonName, evtName) {},\n\n setButtonColor: function (buttonName, color) {}\n\n});\n","/* global Promise */\nvar utils = require('../utils/');\nvar component = require('../core/component');\nvar THREE = require('../lib/three');\nvar shader = require('../core/shader');\n\nvar error = utils.debug('components:material:error');\nvar registerComponent = component.registerComponent;\nvar shaders = shader.shaders;\nvar shaderNames = shader.shaderNames;\n\n/**\n * Material component.\n *\n * @member {object} shader - Determines how material is shaded. Defaults to `standard`,\n * three.js's implementation of PBR. Another standard shading model is `flat` which\n * uses MeshBasicMaterial.\n */\nmodule.exports.Component = registerComponent('material', {\n schema: {\n alphaTest: {default: 0.0, min: 0.0, max: 1.0},\n depthTest: {default: true},\n depthWrite: {default: true},\n flatShading: {default: false},\n npot: {default: false},\n offset: {type: 'vec2', default: {x: 0, y: 0}},\n opacity: {default: 1.0, min: 0.0, max: 1.0},\n repeat: {type: 'vec2', default: {x: 1, y: 1}},\n shader: {default: 'standard', oneOf: shaderNames, schemaChange: true},\n side: {default: 'front', oneOf: ['front', 'back', 'double']},\n transparent: {default: false},\n vertexColors: {type: 'string', default: 'none', oneOf: ['face', 'vertex']},\n visible: {default: true},\n blending: {default: 'normal', oneOf: ['none', 'normal', 'additive', 'subtractive', 'multiply']},\n dithering: {default: true}\n },\n\n init: function () {\n this.material = null;\n },\n\n /**\n * Update or create material.\n *\n * @param {object|null} oldData\n */\n update: function (oldData) {\n var data = this.data;\n if (!this.shader || data.shader !== oldData.shader) {\n this.updateShader(data.shader);\n }\n this.shader.update(this.data);\n this.updateMaterial(oldData);\n },\n\n updateSchema: function (data) {\n var currentShader;\n var newShader;\n var schema;\n var shader;\n\n newShader = data && data.shader;\n currentShader = this.oldData && this.oldData.shader;\n shader = newShader || currentShader;\n schema = shaders[shader] && shaders[shader].schema;\n\n if (!schema) { error('Unknown shader schema ' + shader); }\n if (currentShader && newShader === currentShader) { return; }\n this.extendSchema(schema);\n this.updateBehavior();\n },\n\n updateBehavior: function () {\n var key;\n var sceneEl = this.el.sceneEl;\n var schema = this.schema;\n var self = this;\n var tickProperties;\n\n function tickTime (time, delta) {\n var key;\n for (key in tickProperties) {\n tickProperties[key] = time;\n }\n self.shader.update(tickProperties);\n }\n\n this.tick = undefined;\n\n tickProperties = {};\n for (key in schema) {\n if (schema[key].type === 'time') {\n this.tick = tickTime;\n tickProperties[key] = true;\n }\n }\n\n if (!sceneEl) { return; }\n if (this.tick) {\n sceneEl.addBehavior(this);\n } else {\n sceneEl.removeBehavior(this);\n }\n },\n\n updateShader: function (shaderName) {\n var data = this.data;\n var Shader = shaders[shaderName] && shaders[shaderName].Shader;\n var shaderInstance;\n\n if (!Shader) { throw new Error('Unknown shader ' + shaderName); }\n\n // Get material from A-Frame shader.\n shaderInstance = this.shader = new Shader();\n shaderInstance.el = this.el;\n shaderInstance.init(data);\n this.setMaterial(shaderInstance.material);\n this.updateSchema(data);\n },\n\n /**\n * Set and update base material properties.\n * Set `needsUpdate` when needed.\n */\n updateMaterial: function (oldData) {\n var data = this.data;\n var material = this.material;\n var oldDataHasKeys;\n\n // Base material properties.\n material.alphaTest = data.alphaTest;\n material.depthTest = data.depthTest !== false;\n material.depthWrite = data.depthWrite !== false;\n material.opacity = data.opacity;\n material.flatShading = data.flatShading;\n material.side = parseSide(data.side);\n material.transparent = data.transparent !== false || data.opacity < 1.0;\n material.vertexColors = parseVertexColors(data.vertexColors);\n material.visible = data.visible;\n material.blending = parseBlending(data.blending);\n material.dithering = data.dithering;\n\n // Check if material needs update.\n for (oldDataHasKeys in oldData) { break; }\n if (oldDataHasKeys &&\n (oldData.alphaTest !== data.alphaTest ||\n oldData.side !== data.side ||\n oldData.vertexColors !== data.vertexColors)) {\n material.needsUpdate = true;\n }\n },\n\n /**\n * Remove material on remove (callback).\n * Dispose of it from memory and unsubscribe from scene updates.\n */\n remove: function () {\n var defaultMaterial = new THREE.MeshBasicMaterial();\n var material = this.material;\n var object3D = this.el.getObject3D('mesh');\n if (object3D) { object3D.material = defaultMaterial; }\n disposeMaterial(material, this.system);\n },\n\n /**\n * (Re)create new material. Has side-effects of setting `this.material` and updating\n * material registration in scene.\n *\n * @param {object} data - Material component data.\n * @param {object} type - Material type to create.\n * @returns {object} Material.\n */\n setMaterial: function (material) {\n var el = this.el;\n var mesh;\n var system = this.system;\n\n if (this.material) { disposeMaterial(this.material, system); }\n\n this.material = material;\n system.registerMaterial(material);\n\n // Set on mesh. If mesh does not exist, wait for it.\n mesh = el.getObject3D('mesh');\n if (mesh) {\n mesh.material = material;\n } else {\n el.addEventListener('object3dset', function waitForMesh (evt) {\n if (evt.detail.type !== 'mesh' || evt.target !== el) { return; }\n el.getObject3D('mesh').material = material;\n el.removeEventListener('object3dset', waitForMesh);\n });\n }\n }\n});\n\n/**\n * Return a three.js constant determining which material face sides to render\n * based on the side parameter (passed as a component property).\n *\n * @param {string} [side=front] - `front`, `back`, or `double`.\n * @returns {number} THREE.FrontSide, THREE.BackSide, or THREE.DoubleSide.\n */\nfunction parseSide (side) {\n switch (side) {\n case 'back': {\n return THREE.BackSide;\n }\n case 'double': {\n return THREE.DoubleSide;\n }\n default: {\n // Including case `front`.\n return THREE.FrontSide;\n }\n }\n}\n\n/**\n * Return a three.js constant determining vertex coloring.\n */\nfunction parseVertexColors (coloring) {\n switch (coloring) {\n case 'face': {\n return THREE.FaceColors;\n }\n case 'vertex': {\n return THREE.VertexColors;\n }\n default: {\n return THREE.NoColors;\n }\n }\n}\n\n/**\n * Return a three.js constant determining blending\n *\n * @param {string} [blending=normal]\n * - `none`, additive`, `subtractive`,`multiply` or `normal`.\n * @returns {number}\n */\nfunction parseBlending (blending) {\n switch (blending) {\n case 'none': {\n return THREE.NoBlending;\n }\n case 'additive': {\n return THREE.AdditiveBlending;\n }\n case 'subtractive': {\n return THREE.SubtractiveBlending;\n }\n case 'multiply': {\n return THREE.MultiplyBlending;\n }\n default: {\n return THREE.NormalBlending;\n }\n }\n}\n\n/**\n * Dispose of material from memory and unsubscribe material from scene updates like fog.\n */\nfunction disposeMaterial (material, system) {\n material.dispose();\n system.unregisterMaterial(material);\n}\n","var debug = require('../utils/debug');\nvar registerComponent = require('../core/component').registerComponent;\nvar THREE = require('../lib/three');\n\nvar warn = debug('components:obj-model:warn');\n\nmodule.exports.Component = registerComponent('obj-model', {\n schema: {\n mtl: {type: 'model'},\n obj: {type: 'model'}\n },\n\n init: function () {\n var self = this;\n\n this.model = null;\n this.objLoader = new THREE.OBJLoader();\n this.mtlLoader = new THREE.MTLLoader(this.objLoader.manager);\n // Allow cross-origin images to be loaded.\n this.mtlLoader.crossOrigin = '';\n\n this.el.addEventListener('componentinitialized', function (evt) {\n if (!self.model) { return; }\n if (evt.detail.name !== 'material') { return; }\n self.applyMaterial();\n });\n },\n\n update: function () {\n var data = this.data;\n if (!data.obj) { return; }\n this.resetMesh();\n this.loadObj(data.obj, data.mtl);\n },\n\n remove: function () {\n if (!this.model) { return; }\n this.resetMesh();\n },\n\n resetMesh: function () {\n this.el.removeObject3D('mesh');\n },\n\n loadObj: function (objUrl, mtlUrl) {\n var self = this;\n var el = this.el;\n var mtlLoader = this.mtlLoader;\n var objLoader = this.objLoader;\n var rendererSystem = this.el.sceneEl.systems.renderer;\n var BASE_PATH = mtlUrl.substr(0, mtlUrl.lastIndexOf('/') + 1);\n\n if (mtlUrl) {\n // .OBJ with an .MTL.\n if (el.hasAttribute('material')) {\n warn('Material component properties are ignored when a .MTL is provided');\n }\n mtlLoader.setResourcePath(BASE_PATH);\n mtlLoader.load(mtlUrl, function (materials) {\n materials.preload();\n objLoader.setMaterials(materials);\n objLoader.load(objUrl, function (objModel) {\n self.model = objModel;\n self.model.traverse(function (object) {\n if (object.isMesh) {\n var material = object.material;\n if (material.color) rendererSystem.applyColorCorrection(material.color);\n if (material.map) rendererSystem.applyColorCorrection(material.map);\n if (material.emissive) rendererSystem.applyColorCorrection(material.emissive);\n if (material.emissiveMap) rendererSystem.applyColorCorrection(material.emissiveMap);\n }\n });\n el.setObject3D('mesh', objModel);\n el.emit('model-loaded', {format: 'obj', model: objModel});\n });\n });\n return;\n }\n\n // .OBJ only.\n objLoader.load(objUrl, function loadObjOnly (objModel) {\n self.model = objModel;\n self.applyMaterial();\n el.setObject3D('mesh', objModel);\n el.emit('model-loaded', {format: 'obj', model: objModel});\n });\n },\n\n /**\n * Apply material from material component recursively.\n */\n applyMaterial: function () {\n var material = this.el.components.material;\n if (!material) { return; }\n this.model.traverse(function (child) {\n if (child instanceof THREE.Mesh) {\n child.material = material.material;\n }\n });\n }\n});\n","var registerComponent = require('../core/component').registerComponent;\nvar bind = require('../utils/bind');\n\nvar trackedControlsUtils = require('../utils/tracked-controls');\nvar checkControllerPresentAndSetup = trackedControlsUtils.checkControllerPresentAndSetup;\nvar emitIfAxesChanged = trackedControlsUtils.emitIfAxesChanged;\nvar onButtonEvent = trackedControlsUtils.onButtonEvent;\nvar isWebXRAvailable = require('../utils/').device.isWebXRAvailable;\n\nvar GAMEPAD_ID_WEBXR = 'oculus-go';\nvar GAMEPAD_ID_WEBVR = 'Oculus Go';\n\nvar OCULUS_GO_CONTROLLER_MODEL_URL = 'https://cdn.aframe.io/controllers/oculus/go/oculus-go-controller.gltf';\n\n// Prefix for Gen1 and Gen2 Oculus Touch Controllers.\nvar GAMEPAD_ID_PREFIX = isWebXRAvailable ? GAMEPAD_ID_WEBXR : GAMEPAD_ID_WEBVR;\n\n/**\n * Button indices:\n * 0 - trackpad\n * 1 - trigger\n *\n * Axis:\n * 0 - trackpad x\n * 1 - trackpad y\n */\nvar INPUT_MAPPING_WEBVR = {\n axes: {trackpad: [0, 1]},\n buttons: ['trackpad', 'trigger']\n};\n\n/**\n * Button indices:\n * 0 - trigger\n * 1 - none\n * 2 - touchpad\n *\n * Axis:\n * 0 - touchpad x\n * 1 - touchpad y\n * Reference: https://github.com/immersive-web/webxr-input-profiles/blob/master/packages/registry/profiles/oculus/oculus-go.json\n */\nvar INPUT_MAPPING_WEBXR = {\n axes: {touchpad: [0, 1]},\n buttons: ['trigger', 'none', 'touchpad']\n};\n\nvar INPUT_MAPPING = isWebXRAvailable ? INPUT_MAPPING_WEBXR : INPUT_MAPPING_WEBVR;\n\n/**\n * Oculus Go controls.\n * Interface with Oculus Go controller and map Gamepad events to\n * controller buttons: trackpad, trigger\n * Load a controller model and highlight the pressed buttons.\n */\nmodule.exports.Component = registerComponent('oculus-go-controls', {\n schema: {\n hand: {default: ''}, // This informs the degenerate arm model.\n buttonColor: {type: 'color', default: '#FFFFFF'},\n buttonTouchedColor: {type: 'color', default: '#BBBBBB'},\n buttonHighlightColor: {type: 'color', default: '#7A7A7A'},\n model: {default: true},\n orientationOffset: {type: 'vec3'},\n armModel: {default: true}\n },\n\n mapping: INPUT_MAPPING,\n\n bindMethods: function () {\n this.onModelLoaded = bind(this.onModelLoaded, this);\n this.onControllersUpdate = bind(this.onControllersUpdate, this);\n this.checkIfControllerPresent = bind(this.checkIfControllerPresent, this);\n this.removeControllersUpdateListener = bind(this.removeControllersUpdateListener, this);\n this.onAxisMoved = bind(this.onAxisMoved, this);\n },\n\n init: function () {\n var self = this;\n this.onButtonChanged = bind(this.onButtonChanged, this);\n this.onButtonDown = function (evt) { onButtonEvent(evt.detail.id, 'down', self); };\n this.onButtonUp = function (evt) { onButtonEvent(evt.detail.id, 'up', self); };\n this.onButtonTouchStart = function (evt) { onButtonEvent(evt.detail.id, 'touchstart', self); };\n this.onButtonTouchEnd = function (evt) { onButtonEvent(evt.detail.id, 'touchend', self); };\n this.controllerPresent = false;\n this.lastControllerCheck = 0;\n this.rendererSystem = this.el.sceneEl.systems.renderer;\n this.bindMethods();\n },\n\n addEventListeners: function () {\n var el = this.el;\n el.addEventListener('buttonchanged', this.onButtonChanged);\n el.addEventListener('buttondown', this.onButtonDown);\n el.addEventListener('buttonup', this.onButtonUp);\n el.addEventListener('touchstart', this.onButtonTouchStart);\n el.addEventListener('touchend', this.onButtonTouchEnd);\n el.addEventListener('model-loaded', this.onModelLoaded);\n el.addEventListener('axismove', this.onAxisMoved);\n this.controllerEventsActive = true;\n },\n\n removeEventListeners: function () {\n var el = this.el;\n el.removeEventListener('buttonchanged', this.onButtonChanged);\n el.removeEventListener('buttondown', this.onButtonDown);\n el.removeEventListener('buttonup', this.onButtonUp);\n el.removeEventListener('touchstart', this.onButtonTouchStart);\n el.removeEventListener('touchend', this.onButtonTouchEnd);\n el.removeEventListener('model-loaded', this.onModelLoaded);\n el.removeEventListener('axismove', this.onAxisMoved);\n this.controllerEventsActive = false;\n },\n\n checkIfControllerPresent: function () {\n checkControllerPresentAndSetup(this, GAMEPAD_ID_PREFIX,\n this.data.hand ? {hand: this.data.hand} : {});\n },\n\n play: function () {\n this.checkIfControllerPresent();\n this.addControllersUpdateListener();\n },\n\n pause: function () {\n this.removeEventListeners();\n this.removeControllersUpdateListener();\n },\n\n injectTrackedControls: function () {\n var el = this.el;\n var data = this.data;\n el.setAttribute('tracked-controls', {\n armModel: data.armModel,\n hand: data.hand,\n idPrefix: GAMEPAD_ID_PREFIX,\n orientationOffset: data.orientationOffset\n });\n if (!this.data.model) { return; }\n this.el.setAttribute('gltf-model', OCULUS_GO_CONTROLLER_MODEL_URL);\n },\n\n addControllersUpdateListener: function () {\n this.el.sceneEl.addEventListener('controllersupdated', this.onControllersUpdate, false);\n },\n\n removeControllersUpdateListener: function () {\n this.el.sceneEl.removeEventListener('controllersupdated', this.onControllersUpdate, false);\n },\n\n onControllersUpdate: function () {\n this.checkIfControllerPresent();\n },\n\n // No need for onButtonChanged, since Oculus Go controller has no analog buttons.\n\n onModelLoaded: function (evt) {\n var controllerObject3D = evt.detail.model;\n var buttonMeshes;\n\n if (!this.data.model) { return; }\n buttonMeshes = this.buttonMeshes = {};\n buttonMeshes.trigger = controllerObject3D.getObjectByName('oculus_go_button_trigger');\n buttonMeshes.trackpad = controllerObject3D.getObjectByName('oculus_go_touchpad');\n buttonMeshes.touchpad = controllerObject3D.getObjectByName('oculus_go_touchpad');\n },\n\n onButtonChanged: function (evt) {\n var button = this.mapping.buttons[evt.detail.id];\n if (!button) return;\n // Pass along changed event with button state, using button mapping for convenience.\n this.el.emit(button + 'changed', evt.detail.state);\n },\n\n onAxisMoved: function (evt) {\n emitIfAxesChanged(this, this.mapping.axes, evt);\n },\n\n updateModel: function (buttonName, evtName) {\n if (!this.data.model) { return; }\n this.updateButtonModel(buttonName, evtName);\n },\n\n updateButtonModel: function (buttonName, state) {\n var buttonMeshes = this.buttonMeshes;\n if (!buttonMeshes || !buttonMeshes[buttonName]) { return; }\n var color;\n var button;\n switch (state) {\n case 'down':\n color = this.data.buttonHighlightColor;\n break;\n case 'touchstart':\n color = this.data.buttonTouchedColor;\n break;\n default:\n color = this.data.buttonColor;\n }\n button = buttonMeshes[buttonName];\n button.material.color.set(color);\n this.rendererSystem.applyColorCorrection(button.material.color);\n }\n});\n","var bind = require('../utils/bind');\nvar registerComponent = require('../core/component').registerComponent;\nvar THREE = require('../lib/three');\n\nvar trackedControlsUtils = require('../utils/tracked-controls');\nvar checkControllerPresentAndSetup = trackedControlsUtils.checkControllerPresentAndSetup;\nvar emitIfAxesChanged = trackedControlsUtils.emitIfAxesChanged;\nvar onButtonEvent = trackedControlsUtils.onButtonEvent;\n\nvar isWebXRAvailable = require('../utils/').device.isWebXRAvailable;\n\nvar GAMEPAD_ID_WEBXR = 'oculus-touch';\nvar GAMEPAD_ID_WEBVR = 'Oculus Touch';\n\n// Prefix for Gen1 and Gen2 Oculus Touch Controllers.\nvar GAMEPAD_ID_PREFIX = isWebXRAvailable ? GAMEPAD_ID_WEBXR : GAMEPAD_ID_WEBVR;\n\n// First generation model URL.\nvar TOUCH_CONTROLLER_MODEL_BASE_URL = 'https://cdn.aframe.io/controllers/oculus/oculus-touch-controller-';\n\nvar OCULUS_TOUCH_WEBVR = {\n left: {\n modelUrl: TOUCH_CONTROLLER_MODEL_BASE_URL + 'left.gltf',\n rayOrigin: {origin: {x: 0.008, y: -0.01, z: 0}, direction: {x: 0, y: -0.8, z: -1}},\n modelPivotOffset: new THREE.Vector3(-0.005, 0.003, -0.055),\n modelPivotRotation: new THREE.Euler(0, 0, 0)\n },\n right: {\n modelUrl: TOUCH_CONTROLLER_MODEL_BASE_URL + 'right.gltf',\n rayOrigin: {origin: {x: -0.008, y: -0.01, z: 0}, direction: {x: 0, y: -0.8, z: -1}},\n modelPivotOffset: new THREE.Vector3(0.005, 0.003, -0.055),\n modelPivotRotation: new THREE.Euler(0, 0, 0)\n }\n};\n\nvar OCULUS_TOUCH_WEBXR = {\n left: {\n modelUrl: TOUCH_CONTROLLER_MODEL_BASE_URL + 'left.gltf',\n rayOrigin: {origin: {x: 0.002, y: -0.005, z: -0.03}, direction: {x: 0, y: -0.8, z: -1}},\n modelPivotOffset: new THREE.Vector3(-0.005, 0.036, -0.037),\n modelPivotRotation: new THREE.Euler(Math.PI / 4.5, 0, 0)\n },\n right: {\n modelUrl: TOUCH_CONTROLLER_MODEL_BASE_URL + 'right.gltf',\n rayOrigin: {origin: {x: -0.002, y: -0.005, z: -0.03}, direction: {x: 0, y: -0.8, z: -1}},\n modelPivotOffset: new THREE.Vector3(0.005, 0.036, -0.037),\n modelPivotRotation: new THREE.Euler(Math.PI / 4.5, 0, 0)\n }\n};\n\nvar OCULUS_TOUCH_CONFIG = isWebXRAvailable ? OCULUS_TOUCH_WEBXR : OCULUS_TOUCH_WEBVR;\n\nvar CONTROLLER_DEFAULT = 'oculus-touch';\nvar CONTROLLER_PROPERTIES = {\n 'oculus-touch': OCULUS_TOUCH_CONFIG,\n 'oculus-touch-v2': {\n left: {\n modelUrl: TOUCH_CONTROLLER_MODEL_BASE_URL + 'gen2-left.gltf',\n rayOrigin: {origin: {x: -0.01, y: 0, z: -0.02}, direction: {x: 0, y: -0.5, z: -1}},\n modelPivotOffset: new THREE.Vector3(0, 0, 0),\n modelPivotRotation: new THREE.Euler(0, 0, 0)\n },\n right: {\n modelUrl: TOUCH_CONTROLLER_MODEL_BASE_URL + 'gen2-right.gltf',\n rayOrigin: {origin: {x: 0.01, y: 0, z: -0.02}, direction: {x: 0, y: -0.5, z: -1}},\n modelPivotOffset: new THREE.Vector3(0, 0, 0),\n modelPivotRotation: new THREE.Euler(0, 0, 0)\n }\n },\n 'oculus-touch-v3': {\n left: {\n modelUrl: TOUCH_CONTROLLER_MODEL_BASE_URL + 'v3-left.glb',\n rayOrigin: {origin: {x: 0.015, y: 0.005, z: 0}, direction: {x: 0, y: 0, z: -1}},\n modelPivotOffset: new THREE.Vector3(0.01, -0.01, 0.05),\n modelPivotRotation: new THREE.Euler(Math.PI / 4, 0, 0)\n },\n right: {\n modelUrl: TOUCH_CONTROLLER_MODEL_BASE_URL + 'v3-right.glb',\n rayOrigin: {origin: {x: -0.015, y: 0.005, z: 0}, direction: {x: 0, y: 0, z: -1}},\n modelPivotOffset: new THREE.Vector3(-0.01, -0.01, 0.05),\n modelPivotRotation: new THREE.Euler(Math.PI / 4, 0, 0)\n }\n }\n};\n\n/**\n * Button indices:\n * 0 - thumbstick (which has separate axismove / thumbstickmoved events)\n * 1 - trigger (with analog value, which goes up to 1)\n * 2 - grip (with analog value, which goes up to 1)\n * 3 - X (left) or A (right)\n * 4 - Y (left) or B (right)\n * 5 - surface (touch only)\n */\nvar INPUT_MAPPING_WEBVR = {\n left: {\n axes: {thumbstick: [0, 1]},\n buttons: ['thumbstick', 'trigger', 'grip', 'xbutton', 'ybutton', 'surface']\n },\n right: {\n axes: {thumbstick: [0, 1]},\n buttons: ['thumbstick', 'trigger', 'grip', 'abutton', 'bbutton', 'surface']\n }\n};\n\n/**\n * Button indices:\n * 0 - trigger\n * 1 - grip\n * 2 - none\n * 3 - thumbstick\n * 4 - X or A button\n * 5 - Y or B button\n * 6 - surface\n *\n * Axis:\n * 0 - none\n * 1 - none\n * 2 - thumbstick\n * 3 - thumbstick\n * Reference: https://github.com/immersive-web/webxr-input-profiles/blob/master/packages/registry/profiles/oculus/oculus-touch.json\n */\nvar INPUT_MAPPING_WEBXR = {\n left: {\n axes: {thumbstick: [2, 3]},\n buttons: ['trigger', 'grip', 'none', 'thumbstick', 'xbutton', 'ybutton', 'surface']\n },\n right: {\n axes: {thumbstick: [2, 3]},\n buttons: ['trigger', 'grip', 'none', 'thumbstick', 'abutton', 'bbutton', 'surface']\n }\n};\n\nvar INPUT_MAPPING = isWebXRAvailable ? INPUT_MAPPING_WEBXR : INPUT_MAPPING_WEBVR;\n\n/**\n * Oculus Touch controls.\n * Interface with Oculus Touch controllers and map Gamepad events to\n * controller buttons: thumbstick, trigger, grip, xbutton, ybutton, surface\n * Load a controller model and highlight the pressed buttons.\n */\nmodule.exports.Component = registerComponent('oculus-touch-controls', {\n schema: {\n hand: {default: 'left'},\n buttonColor: {type: 'color', default: '#999'}, // Off-white.\n buttonTouchColor: {type: 'color', default: '#8AB'},\n buttonHighlightColor: {type: 'color', default: '#2DF'}, // Light blue.\n model: {default: true},\n controllerType: {default: 'auto', oneOf: ['auto', 'oculus-touch', 'oculus-touch-v2', 'oculus-touch-v3']},\n orientationOffset: {type: 'vec3', default: {x: 43, y: 0, z: 0}}\n },\n\n mapping: INPUT_MAPPING,\n\n bindMethods: function () {\n this.onModelLoaded = bind(this.onModelLoaded, this);\n this.onControllersUpdate = bind(this.onControllersUpdate, this);\n this.checkIfControllerPresent = bind(this.checkIfControllerPresent, this);\n this.onAxisMoved = bind(this.onAxisMoved, this);\n },\n\n init: function () {\n var self = this;\n this.onButtonChanged = bind(this.onButtonChanged, this);\n this.onButtonDown = function (evt) { onButtonEvent(evt.detail.id, 'down', self, self.data.hand); };\n this.onButtonUp = function (evt) { onButtonEvent(evt.detail.id, 'up', self, self.data.hand); };\n this.onButtonTouchStart = function (evt) { onButtonEvent(evt.detail.id, 'touchstart', self, self.data.hand); };\n this.onButtonTouchEnd = function (evt) { onButtonEvent(evt.detail.id, 'touchend', self, self.data.hand); };\n this.controllerPresent = false;\n this.lastControllerCheck = 0;\n this.previousButtonValues = {};\n this.rendererSystem = this.el.sceneEl.systems.renderer;\n this.bindMethods();\n },\n\n addEventListeners: function () {\n var el = this.el;\n el.addEventListener('buttonchanged', this.onButtonChanged);\n el.addEventListener('buttondown', this.onButtonDown);\n el.addEventListener('buttonup', this.onButtonUp);\n el.addEventListener('touchstart', this.onButtonTouchStart);\n el.addEventListener('touchend', this.onButtonTouchEnd);\n el.addEventListener('axismove', this.onAxisMoved);\n el.addEventListener('model-loaded', this.onModelLoaded);\n this.controllerEventsActive = true;\n },\n\n removeEventListeners: function () {\n var el = this.el;\n el.removeEventListener('buttonchanged', this.onButtonChanged);\n el.removeEventListener('buttondown', this.onButtonDown);\n el.removeEventListener('buttonup', this.onButtonUp);\n el.removeEventListener('touchstart', this.onButtonTouchStart);\n el.removeEventListener('touchend', this.onButtonTouchEnd);\n el.removeEventListener('axismove', this.onAxisMoved);\n el.removeEventListener('model-loaded', this.onModelLoaded);\n this.controllerEventsActive = false;\n },\n\n checkIfControllerPresent: function () {\n checkControllerPresentAndSetup(this, GAMEPAD_ID_PREFIX, {\n hand: this.data.hand\n });\n },\n\n play: function () {\n this.checkIfControllerPresent();\n this.addControllersUpdateListener();\n },\n\n pause: function () {\n this.removeEventListeners();\n this.removeControllersUpdateListener();\n },\n\n loadModel: function (controller) {\n var data = this.data;\n var controllerId;\n\n if (!data.model) { return; }\n // Set the controller display model based on the data passed in.\n this.displayModel = CONTROLLER_PROPERTIES[data.controllerType] || CONTROLLER_PROPERTIES[CONTROLLER_DEFAULT];\n // If the developer is asking for auto-detection, see if the displayName can be retrieved to identify the specific unit.\n // This only works for WebVR currently.\n if (data.controllerType === 'auto') {\n var trackedControlsSystem = this.el.sceneEl.systems['tracked-controls-webvr'];\n // WebVR\n if (trackedControlsSystem && trackedControlsSystem.vrDisplay) {\n var displayName = trackedControlsSystem.vrDisplay.displayName;\n // The Oculus Quest uses the updated generation 2 inside-out tracked controllers so update the displayModel.\n if (/^Oculus Quest$/.test(displayName)) {\n this.displayModel = CONTROLLER_PROPERTIES['oculus-touch-v2'];\n }\n } else { // WebXR\n controllerId = CONTROLLER_DEFAULT;\n controllerId = controller.profiles.indexOf('oculus-touch-v2') !== -1 ? 'oculus-touch-v2' : controllerId;\n controllerId = controller.profiles.indexOf('oculus-touch-v3') !== -1 ? 'oculus-touch-v3' : controllerId;\n this.displayModel = CONTROLLER_PROPERTIES[controllerId];\n }\n }\n var modelUrl = this.displayModel[data.hand].modelUrl;\n this.el.setAttribute('gltf-model', modelUrl);\n },\n\n injectTrackedControls: function (controller) {\n var data = this.data;\n var webXRId = GAMEPAD_ID_WEBXR;\n var webVRId = data.hand === 'right' ? 'Oculus Touch (Right)' : 'Oculus Touch (Left)';\n var id = isWebXRAvailable ? webXRId : webVRId;\n this.el.setAttribute('tracked-controls', {\n id: id,\n hand: data.hand,\n orientationOffset: data.orientationOffset,\n handTrackingEnabled: false\n });\n this.loadModel(controller);\n },\n\n addControllersUpdateListener: function () {\n this.el.sceneEl.addEventListener('controllersupdated', this.onControllersUpdate, false);\n },\n\n removeControllersUpdateListener: function () {\n this.el.sceneEl.removeEventListener('controllersupdated', this.onControllersUpdate, false);\n },\n\n onControllersUpdate: function () {\n // Note that due to gamepadconnected event propagation issues, we don't rely on events.\n this.checkIfControllerPresent();\n },\n\n onButtonChanged: function (evt) {\n var button = this.mapping[this.data.hand].buttons[evt.detail.id];\n var buttonMeshes = this.buttonMeshes;\n var analogValue;\n if (!button) { return; }\n\n if (button === 'trigger' || button === 'grip') { analogValue = evt.detail.state.value; }\n\n // Update trigger and/or grip meshes, if any.\n if (buttonMeshes) {\n if (button === 'trigger' && buttonMeshes.trigger) {\n buttonMeshes.trigger.rotation.x = this.originalXRotationTrigger - analogValue * (Math.PI / 26);\n }\n if (button === 'grip' && buttonMeshes.grip) {\n buttonMeshes.grip.position.x = this.originalXPositionGrip + (this.data.hand === 'left' ? -1 : 1) * analogValue * 0.004;\n }\n }\n\n // Pass along changed event with button state, using the buttom mapping for convenience.\n this.el.emit(button + 'changed', evt.detail.state);\n },\n\n onModelLoaded: function (evt) {\n var controllerObject3D = this.controllerObject3D = evt.detail.model;\n var buttonMeshes;\n\n if (!this.data.model) { return; }\n\n buttonMeshes = this.buttonMeshes = {};\n\n buttonMeshes.grip = controllerObject3D.getObjectByName('buttonHand');\n this.originalXPositionGrip = buttonMeshes.grip && buttonMeshes.grip.position.x;\n buttonMeshes.thumbstick = controllerObject3D.getObjectByName('stick');\n buttonMeshes.trigger = controllerObject3D.getObjectByName('buttonTrigger');\n this.originalXRotationTrigger = buttonMeshes.trigger && buttonMeshes.trigger.rotation.x;\n buttonMeshes.xbutton = controllerObject3D.getObjectByName('buttonX');\n buttonMeshes.abutton = controllerObject3D.getObjectByName('buttonA');\n buttonMeshes.ybutton = controllerObject3D.getObjectByName('buttonY');\n buttonMeshes.bbutton = controllerObject3D.getObjectByName('buttonB');\n\n // Offset pivot point\n controllerObject3D.position.copy(this.displayModel[this.data.hand].modelPivotOffset);\n controllerObject3D.rotation.copy(this.displayModel[this.data.hand].modelPivotRotation);\n\n this.el.emit('controllermodelready', {\n name: 'oculus-touch-controls',\n model: this.data.model,\n rayOrigin: this.displayModel[this.data.hand].rayOrigin\n });\n },\n\n onAxisMoved: function (evt) {\n emitIfAxesChanged(this, this.mapping[this.data.hand].axes, evt);\n },\n\n updateModel: function (buttonName, evtName) {\n if (!this.data.model) { return; }\n this.updateButtonModel(buttonName, evtName);\n },\n\n updateButtonModel: function (buttonName, state) {\n var button;\n var color = (state === 'up' || state === 'touchend') ? this.data.buttonColor : state === 'touchstart' ? this.data.buttonTouchColor : this.data.buttonHighlightColor;\n var buttonMeshes = this.buttonMeshes;\n if (!this.data.model) { return; }\n if (buttonMeshes && buttonMeshes[buttonName]) {\n button = buttonMeshes[buttonName];\n button.material.color.set(color);\n this.rendererSystem.applyColorCorrection(button.material.color);\n }\n }\n});\n","var registerComponent = require('../core/component').registerComponent;\n\nmodule.exports.Component = registerComponent('position', {\n schema: {type: 'vec3'},\n\n update: function () {\n var object3D = this.el.object3D;\n var data = this.data;\n object3D.position.set(data.x, data.y, data.z);\n },\n\n remove: function () {\n // Pretty much for mixins.\n this.el.object3D.position.set(0, 0, 0);\n }\n});\n","/* global MutationObserver */\n\nvar registerComponent = require('../core/component').registerComponent;\nvar THREE = require('../lib/three');\nvar utils = require('../utils/');\n\nvar warn = utils.debug('components:raycaster:warn');\n\n// Defines selectors that should be 'safe' for the MutationObserver used to\n// refresh the whitelist. Matches classnames, IDs, and presence of attributes.\n// Selectors for the value of an attribute, like [position=0 2 0], cannot be\n// reliably detected and are therefore disallowed.\nvar OBSERVER_SELECTOR_RE = /^[\\w\\s-.,[\\]#]*$/;\n\n// Configuration for the MutationObserver used to refresh the whitelist.\n// Listens for addition/removal of elements and attributes within the scene.\nvar OBSERVER_CONFIG = {\n childList: true,\n attributes: true,\n subtree: true\n};\n\nvar EVENTS = {\n INTERSECT: 'raycaster-intersected',\n INTERSECTION: 'raycaster-intersection',\n INTERSECT_CLEAR: 'raycaster-intersected-cleared',\n INTERSECTION_CLEAR: 'raycaster-intersection-cleared'\n};\n\n/**\n * Raycaster component.\n *\n * Pass options to three.js Raycaster including which objects to test.\n * Poll for intersections.\n * Emit event on origin entity and on target entity on intersect.\n *\n * @member {array} intersectedEls - List of currently intersected entities.\n * @member {array} objects - Cached list of meshes to intersect.\n * @member {number} prevCheckTime - Previous time intersection was checked. To help interval.\n * @member {object} raycaster - three.js Raycaster.\n */\nmodule.exports.Component = registerComponent('raycaster', {\n schema: {\n autoRefresh: {default: true},\n direction: {type: 'vec3', default: {x: 0, y: 0, z: -1}},\n enabled: {default: true},\n far: {default: 1000},\n interval: {default: 0},\n near: {default: 0},\n objects: {default: ''},\n origin: {type: 'vec3'},\n showLine: {default: false},\n lineColor: {default: 'white'},\n lineOpacity: {default: 1},\n useWorldCoordinates: {default: false}\n },\n\n multiple: true,\n\n init: function () {\n this.clearedIntersectedEls = [];\n this.unitLineEndVec3 = new THREE.Vector3();\n this.intersectedEls = [];\n this.intersections = [];\n this.newIntersectedEls = [];\n this.newIntersections = [];\n this.objects = [];\n this.prevCheckTime = undefined;\n this.prevIntersectedEls = [];\n this.rawIntersections = [];\n this.raycaster = new THREE.Raycaster();\n this.updateOriginDirection();\n this.setDirty = this.setDirty.bind(this);\n this.updateLine = this.updateLine.bind(this);\n this.observer = new MutationObserver(this.setDirty);\n this.dirty = true;\n this.lineEndVec3 = new THREE.Vector3();\n this.otherLineEndVec3 = new THREE.Vector3();\n this.lineData = {end: this.lineEndVec3};\n\n this.getIntersection = this.getIntersection.bind(this);\n this.intersectedDetail = {el: this.el, getIntersection: this.getIntersection};\n this.intersectedClearedDetail = {el: this.el};\n this.intersectionClearedDetail = {clearedEls: this.clearedIntersectedEls};\n this.intersectionDetail = {};\n },\n\n /**\n * Create or update raycaster object.\n */\n update: function (oldData) {\n var data = this.data;\n var el = this.el;\n var raycaster = this.raycaster;\n\n // Set raycaster properties.\n raycaster.far = data.far;\n raycaster.near = data.near;\n\n // Draw line.\n if (data.showLine &&\n (data.far !== oldData.far || data.origin !== oldData.origin ||\n data.direction !== oldData.direction || !oldData.showLine)) {\n // Calculate unit vector for line direction. Can be multiplied via scalar to performantly\n // adjust line length.\n this.unitLineEndVec3.copy(data.origin).add(data.direction).normalize();\n this.drawLine();\n }\n\n if (!data.showLine && oldData.showLine) {\n el.removeAttribute('line');\n }\n\n if (data.objects !== oldData.objects && !OBSERVER_SELECTOR_RE.test(data.objects)) {\n warn('[raycaster] Selector \"' + data.objects +\n '\" may not update automatically with DOM changes.');\n }\n\n if (!data.objects) {\n warn('[raycaster] For performance, please define raycaster.objects when using ' +\n 'raycaster or cursor components to whitelist which entities to intersect with. ' +\n 'e.g., raycaster=\"objects: [data-raycastable]\".');\n }\n\n if (data.autoRefresh !== oldData.autoRefresh && el.isPlaying) {\n data.autoRefresh\n ? this.addEventListeners()\n : this.removeEventListeners();\n }\n\n if (oldData.enabled && !data.enabled) { this.clearAllIntersections(); }\n\n this.setDirty();\n },\n\n play: function () {\n this.addEventListeners();\n },\n\n pause: function () {\n this.removeEventListeners();\n },\n\n remove: function () {\n if (this.data.showLine) {\n this.el.removeAttribute('line');\n }\n this.clearAllIntersections();\n },\n\n addEventListeners: function () {\n if (!this.data.autoRefresh) { return; }\n this.observer.observe(this.el.sceneEl, OBSERVER_CONFIG);\n this.el.sceneEl.addEventListener('object3dset', this.setDirty);\n this.el.sceneEl.addEventListener('object3dremove', this.setDirty);\n },\n\n removeEventListeners: function () {\n this.observer.disconnect();\n this.el.sceneEl.removeEventListener('object3dset', this.setDirty);\n this.el.sceneEl.removeEventListener('object3dremove', this.setDirty);\n },\n\n /**\n * Mark the object list as dirty, to be refreshed before next raycast.\n */\n setDirty: function () {\n this.dirty = true;\n },\n\n /**\n * Update list of objects to test for intersection.\n */\n refreshObjects: function () {\n var data = this.data;\n var els;\n\n // If objects not defined, intersect with everything.\n els = data.objects\n ? this.el.sceneEl.querySelectorAll(data.objects)\n : this.el.sceneEl.querySelectorAll('*');\n this.objects = this.flattenObject3DMaps(els);\n this.dirty = false;\n },\n\n /**\n * Check for intersections and cleared intersections on an interval.\n */\n tock: function (time) {\n var data = this.data;\n var prevCheckTime = this.prevCheckTime;\n\n if (!data.enabled) { return; }\n\n // Only check for intersection if interval time has passed.\n if (prevCheckTime && (time - prevCheckTime < data.interval)) { return; }\n\n // Update check time.\n this.prevCheckTime = time;\n this.checkIntersections();\n },\n\n /**\n * Raycast for intersections and emit events for current and cleared intersections.\n */\n checkIntersections: function () {\n var clearedIntersectedEls = this.clearedIntersectedEls;\n var el = this.el;\n var data = this.data;\n var i;\n var intersectedEls = this.intersectedEls;\n var intersection;\n var intersections = this.intersections;\n var newIntersectedEls = this.newIntersectedEls;\n var newIntersections = this.newIntersections;\n var prevIntersectedEls = this.prevIntersectedEls;\n var rawIntersections = this.rawIntersections;\n\n // Refresh the object whitelist if needed.\n if (this.dirty) { this.refreshObjects(); }\n\n // Store old previously intersected entities.\n copyArray(this.prevIntersectedEls, this.intersectedEls);\n\n // Raycast.\n this.updateOriginDirection();\n rawIntersections.length = 0;\n this.raycaster.intersectObjects(this.objects, true, rawIntersections);\n\n // Only keep intersections against objects that have a reference to an entity.\n intersections.length = 0;\n intersectedEls.length = 0;\n for (i = 0; i < rawIntersections.length; i++) {\n intersection = rawIntersections[i];\n // Don't intersect with own line.\n if (data.showLine && intersection.object === el.getObject3D('line')) {\n continue;\n }\n if (intersection.object.el) {\n intersections.push(intersection);\n intersectedEls.push(intersection.object.el);\n }\n }\n\n // Get newly intersected entities.\n newIntersections.length = 0;\n newIntersectedEls.length = 0;\n for (i = 0; i < intersections.length; i++) {\n if (prevIntersectedEls.indexOf(intersections[i].object.el) === -1) {\n newIntersections.push(intersections[i]);\n newIntersectedEls.push(intersections[i].object.el);\n }\n }\n\n // Emit intersection cleared on both entities per formerly intersected entity.\n clearedIntersectedEls.length = 0;\n for (i = 0; i < prevIntersectedEls.length; i++) {\n if (intersectedEls.indexOf(prevIntersectedEls[i]) !== -1) { continue; }\n prevIntersectedEls[i].emit(EVENTS.INTERSECT_CLEAR,\n this.intersectedClearedDetail);\n clearedIntersectedEls.push(prevIntersectedEls[i]);\n }\n if (clearedIntersectedEls.length) {\n el.emit(EVENTS.INTERSECTION_CLEAR, this.intersectionClearedDetail);\n }\n\n // Emit intersected on intersected entity per intersected entity.\n for (i = 0; i < newIntersectedEls.length; i++) {\n newIntersectedEls[i].emit(EVENTS.INTERSECT, this.intersectedDetail);\n }\n\n // Emit all intersections at once on raycasting entity.\n if (newIntersections.length) {\n this.intersectionDetail.els = newIntersectedEls;\n this.intersectionDetail.intersections = newIntersections;\n el.emit(EVENTS.INTERSECTION, this.intersectionDetail);\n }\n\n // Update line length.\n if (data.showLine) { setTimeout(this.updateLine); }\n },\n\n updateLine: function () {\n var el = this.el;\n var intersections = this.intersections;\n var lineLength;\n\n if (intersections.length) {\n if (intersections[0].object.el === el && intersections[1]) {\n lineLength = intersections[1].distance;\n } else {\n lineLength = intersections[0].distance;\n }\n }\n this.drawLine(lineLength);\n },\n\n /**\n * Return the most recent intersection details for a given entity, if any.\n * @param {AEntity} el\n * @return {Object}\n */\n getIntersection: function (el) {\n var i;\n var intersection;\n for (i = 0; i < this.intersections.length; i++) {\n intersection = this.intersections[i];\n if (intersection.object.el === el) { return intersection; }\n }\n return null;\n },\n\n /**\n * Update origin and direction of raycaster using entity transforms and supplied origin or\n * direction offsets.\n */\n updateOriginDirection: (function () {\n var direction = new THREE.Vector3();\n var originVec3 = new THREE.Vector3();\n\n // Closure to make quaternion/vector3 objects private.\n return function updateOriginDirection () {\n var el = this.el;\n var data = this.data;\n\n if (data.useWorldCoordinates) {\n this.raycaster.set(data.origin, data.direction);\n return;\n }\n\n el.object3D.updateMatrixWorld();\n originVec3.setFromMatrixPosition(el.object3D.matrixWorld);\n\n // If non-zero origin, translate the origin into world space.\n if (data.origin.x !== 0 || data.origin.y !== 0 || data.origin.z !== 0) {\n originVec3 = el.object3D.localToWorld(originVec3.copy(data.origin));\n }\n\n // three.js raycaster direction is relative to 0, 0, 0 NOT the origin / offset we\n // provide. Apply the offset to the direction, then rotation from the object,\n // and normalize.\n direction.copy(data.direction).transformDirection(el.object3D.matrixWorld).normalize();\n\n // Apply offset and direction, in world coordinates.\n this.raycaster.set(originVec3, direction);\n };\n })(),\n\n /**\n * Create or update line to give raycaster visual representation.\n * Customize the line through through line component.\n * We draw the line in the raycaster component to customize the line to the\n * raycaster's origin, direction, and far.\n *\n * Unlike the raycaster, we create the line as a child of the object. The line will\n * be affected by the transforms of the objects, so we don't have to calculate transforms\n * like we do with the raycaster.\n *\n * @param {number} length - Length of line. Pass in to shorten the line to the intersection\n * point. If not provided, length will default to the max length, `raycaster.far`.\n */\n drawLine: function (length) {\n var data = this.data;\n var el = this.el;\n var endVec3;\n\n // Switch each time vector so line update triggered and to avoid unnecessary vector clone.\n endVec3 = this.lineData.end === this.lineEndVec3\n ? this.otherLineEndVec3\n : this.lineEndVec3;\n\n // Treat Infinity as 1000m for the line.\n if (length === undefined) {\n length = data.far === Infinity ? 1000 : data.far;\n }\n\n // Update the length of the line if given. `unitLineEndVec3` is the direction\n // given by data.direction, then we apply a scalar to give it a length.\n this.lineData.start = data.origin;\n this.lineData.end = endVec3.copy(this.unitLineEndVec3).multiplyScalar(length);\n this.lineData.color = data.lineColor;\n this.lineData.opacity = data.lineOpacity;\n el.setAttribute('line', this.lineData);\n },\n\n /**\n * Return A-Frame attachments of each element's object3D group (e.g., mesh).\n * Children are flattened by one level, removing the THREE.Group wrapper,\n * so that non-recursive raycasting remains useful.\n *\n * Only push children defined as component attachements (e.g., setObject3D),\n * NOT actual children in the scene graph hierarchy.\n *\n * @param {Array<Element>} els\n * @return {Array<THREE.Object3D>}\n */\n flattenObject3DMaps: function (els) {\n var key;\n var i;\n var objects = this.objects;\n\n // Push meshes and other attachments onto list of objects to intersect.\n objects.length = 0;\n for (i = 0; i < els.length; i++) {\n if (els[i].isEntity && els[i].object3D) {\n for (key in els[i].object3DMap) {\n objects.push(els[i].getObject3D(key));\n }\n }\n }\n\n return objects;\n },\n\n clearAllIntersections: function () {\n var i;\n for (i = 0; i < this.intersectedEls.length; i++) {\n this.intersectedEls[i].emit(EVENTS.INTERSECT_CLEAR,\n this.intersectedClearedDetail);\n }\n copyArray(this.clearedIntersectedEls, this.intersectedEls);\n this.intersectedEls.length = 0;\n this.intersections.length = 0;\n this.el.emit(EVENTS.INTERSECTION_CLEAR, this.intersectionClearedDetail);\n }\n});\n\n/**\n * Copy contents of one array to another without allocating new array.\n */\nfunction copyArray (a, b) {\n var i;\n a.length = b.length;\n for (i = 0; i < b.length; i++) {\n a[i] = b[i];\n }\n}\n","var degToRad = require('../lib/three').Math.degToRad;\nvar registerComponent = require('../core/component').registerComponent;\n\nmodule.exports.Component = registerComponent('rotation', {\n schema: {type: 'vec3'},\n\n /**\n * Updates object3D rotation.\n */\n update: function () {\n var data = this.data;\n var object3D = this.el.object3D;\n object3D.rotation.set(degToRad(data.x), degToRad(data.y), degToRad(data.z));\n object3D.rotation.order = 'YXZ';\n },\n\n remove: function () {\n // Pretty much for mixins.\n this.el.object3D.rotation.set(0, 0, 0);\n }\n});\n","var registerComponent = require('../core/component').registerComponent;\n\n// Avoids triggering a zero-determinant which makes object3D matrix non-invertible.\nvar zeroScale = 0.00001;\n\nmodule.exports.Component = registerComponent('scale', {\n schema: {\n type: 'vec3',\n default: {x: 1, y: 1, z: 1}\n },\n\n update: function () {\n var data = this.data;\n var object3D = this.el.object3D;\n var x = data.x === 0 ? zeroScale : data.x;\n var y = data.y === 0 ? zeroScale : data.y;\n var z = data.z === 0 ? zeroScale : data.z;\n object3D.scale.set(x, y, z);\n },\n\n remove: function () {\n // Pretty much for mixins.\n this.el.object3D.scale.set(1, 1, 1);\n }\n});\n","/* global ImageData, Map, Set */\nvar arrowURL = 'data:image/webp;base64,UklGRkQHAABXRUJQVlA4WAoAAAAQAAAA/wEA/wEAQUxQSL0DAAARDzD/ERGCjrY9sYYFfgo6aa1kJ7K0w9Lo3AadLSVeFxevQwj5kuM8RfR/Atw/C0+ozB/oUBrloFZs6ElSW88j1KA4yExNWQaqRZquIDF0JYmlq0hAuUDTFu66tng3teW7pa3cQf1V1edvur54M/Slm6Wv3Gx9zw0MXlQLntcsBN6wkHjTQuYtC4W3LTw8mGRVG57TbAROtxHfZNhInGkjc5aNwtk2Hg6Mvki14k+NkZzCwQgCxalcAv3kddRTPI1DcUrXId1FLf1uHpzaQz4tquhZVLlKesbVpqKeTj0n0F5PpXDlFN9UqmhalL/ImuZFo6KmToWLoKlddMprqlS8cKovBvHo2kTiFV2LN4msaxKZl3QNiair8xYRdDWivIvXVXmbcMqJ51UebZu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nMhs/rDF1hi6wxdYYusMXWGI5QRcCFDZog5OgqNlse1NDuz/UoFa/cOzPiUwAEsAOK4/nu5eZHK2tlXxJfNYlMABWv3Dsz4bvNJ5YA/LtxJ38SmAArX7h2Z8Sk5vdZUYv7mZPiUwAFa/cOzPh21s5OgZxf1mfEpemRyFr/rM+JS9noA/LtxJ38SmAAlUJIotzAASn6TjdhK+D3Dsz4dyvB7h2Z8O2tnJ0DOL+sz4lL2nKLT4lL/+iSLOocxq639w7M34MNZdm55uJ8v8ra2cpVZnxKTq2F3PN/cNksAfl24k7+JTAASqrD37h2Z7b1W+VtbOUqsz4lJ1bC7nm/uGyWAPy7cSd/EpgAJVVh79w7M9t6rfK2tnKVWZ8Sk6thdzzf3DZLAH5duJO/iUwAEqqw9+4dme29VvlbWzlKrM+JSdWwu55v7hslgD8u3EnfxKYACVVYe/cOzPbeq3ytrZylVme0kYJ8557FLerqFrzIbPrrf3DZLAH5duJO/iUvaVMS9BoaF4p7pSDFTP1XMyfElelrM0DOL+sz4eBJ13nV1OppBGPuKb4YzXQgq9uH19uS/0+JS9t9fr6ZUlQBelDG6GMgq97otb5QMPJwtKyBTbFp8Sl7b6/X0ykkawEOsgdiE6Fi0vb/Eve6xkwsmug0Z4nGNHQO8839bpTsjpz7SWIJxKagvd1QWMa6FYT1KEw3j4XDT6vJ9Xk+nyfT5Pq8n1eEmk5dinMM/9Fcfz4Z3Dsz3KD2dw7LxBRxKrqUUGQPH/7zxr1KIfNpLEJ0MZB2ITM/0Z2EFoh12NlXnEcpYcbvON3nG7zjd5xu84vfcNIAAP7+y8ceyzbVxkakPYY4lcr72fqOnDwipv+yxC71wAADBrjKnAAAAAAAAAAAAAAw7oNGHttqWONcoFN/2WIDc2pa6WVFtFYROlsaMaTXdcOjXHz93+YxAglKa4AAAAA=';\nvar register = require('../../core/component').registerComponent;\nvar THREE = require('../../lib/three');\nvar CAM_LAYER = 21;\n\nvar applyPose = (function () {\n var tempQuaternion = new THREE.Quaternion();\n var tempVec3 = new THREE.Vector3();\n function applyPose (pose, object3D, offset) {\n object3D.position.copy(pose.transform.position);\n object3D.quaternion.copy(pose.transform.orientation);\n\n tempVec3.copy(offset);\n tempQuaternion.copy(pose.transform.orientation);\n tempVec3.applyQuaternion(tempQuaternion);\n object3D.position.sub(tempVec3);\n }\n return applyPose;\n}());\n\napplyPose.tempFakePose = {\n transform: {\n orientation: new THREE.Quaternion(),\n position: new THREE.Vector3()\n }\n};\n\n/**\n * Class to handle hit-test from a single source\n *\n * For a normal space provide it as a space option\n * new HitTest(renderer, {\n * space: viewerSpace\n * });\n *\n * this is also useful for the targetRaySpace of an XRInputSource\n *\n * It can also describe a transient input source like so:\n *\n * var profileToSupport = 'generic-touchscreen';\n * var transientHitTest = new HitTest(renderer, {\n * profile: profileToSupport\n * });\n *\n * Where the profile matches an item in a type of controller, profiles matching 'generic-touchscreen'\n * will always be a transient input and as of 08/2021 all transient inputs are 'generic-touchscreen'\n *\n * @param {WebGLRenderer} renderer THREE.JS Renderer\n * @param {} hitTestSourceDetails The source information either as the information for a transient hit-test or a regular hit-test\n */\nfunction HitTest (renderer, hitTestSourceDetails) {\n this.renderer = renderer;\n this.xrHitTestSource = null;\n\n renderer.xr.addEventListener('sessionend', function () {\n this.xrHitTestSource = null;\n }.bind(this));\n renderer.xr.addEventListener('sessionstart', function () {\n this.sessionStart(hitTestSourceDetails);\n }.bind(this));\n\n if (this.renderer.xr.isPresenting) {\n this.sessionStart(hitTestSourceDetails);\n }\n}\n\nHitTest.prototype.previousFrameAnchors = new Set();\nHitTest.prototype.anchorToObject3D = new Map();\n\nfunction warnAboutHitTest (e) {\n console.warn(e.message);\n console.warn('Cannot requestHitTestSource Are you missing: webxr=\"optionalFeatures: hit-test;\" from <a-scene>?');\n}\n\nHitTest.prototype.sessionStart = function sessionStart (hitTestSourceDetails) {\n this.session = this.renderer.xr.getSession();\n if (!('requestHitTestSource' in this.session)) {\n warnAboutHitTest({message: 'No requestHitTestSource on the session.'});\n return;\n }\n if (hitTestSourceDetails.space) {\n this.session.requestHitTestSource(hitTestSourceDetails)\n .then(function (xrHitTestSource) {\n this.xrHitTestSource = xrHitTestSource;\n }.bind(this))\n .catch(warnAboutHitTest);\n } else if (hitTestSourceDetails.profile) {\n this.session.requestHitTestSourceForTransientInput(hitTestSourceDetails)\n .then(function (xrHitTestSource) {\n this.xrHitTestSource = xrHitTestSource;\n this.transient = true;\n }.bind(this))\n .catch(warnAboutHitTest);\n }\n};\n\n/**\n * Turns the last hit test into an anchor, the provided Object3D will have it's\n * position update to track the anchor.\n *\n * @param {Object3D} object3D object to track\n * @param {Vector3} offset offset of the object from the origin that gets subtracted\n * @returns\n */\nHitTest.prototype.anchorFromLastHitTestResult = function (object3D, offset) {\n var hitTest = this.lastHitTest;\n\n if (!hitTest) { return; }\n\n var object3DOptions = {\n object3D: object3D,\n offset: offset\n };\n\n Array.from(this.anchorToObject3D.entries())\n .forEach(function (entry) {\n var entryObject = entry[1].object3D;\n var anchor = entry[0];\n if (entryObject === object3D) {\n this.anchorToObject3D.delete(anchor);\n anchor.delete();\n }\n }.bind(this));\n\n if (hitTest.createAnchor) {\n hitTest.createAnchor()\n .then(function (anchor) {\n this.anchorToObject3D.set(anchor, object3DOptions);\n }.bind(this))\n .catch(function (e) {\n console.warn(e.message);\n console.warn('Cannot create anchor, are you missing: webxr=\"optionalFeatures: anchors;\" from <a-scene>?');\n });\n }\n};\n\nHitTest.prototype.doHit = function doHit (frame) {\n if (!this.renderer.xr.isPresenting) { return; }\n var refSpace = this.renderer.xr.getReferenceSpace();\n var xrViewerPose = frame.getViewerPose(refSpace);\n var hitTestResults;\n var results;\n\n if (this.xrHitTestSource && xrViewerPose) {\n if (this.transient) {\n hitTestResults = frame.getHitTestResultsForTransientInput(this.xrHitTestSource);\n if (hitTestResults.length > 0) {\n results = hitTestResults[0].results;\n if (results.length > 0) {\n this.lastHitTest = results[0];\n return results[0].getPose(refSpace);\n } else {\n return false;\n }\n } else {\n return false;\n }\n } else {\n hitTestResults = frame.getHitTestResults(this.xrHitTestSource);\n if (hitTestResults.length > 0) {\n this.lastHitTest = hitTestResults[0];\n return hitTestResults[0].getPose(refSpace);\n } else {\n return false;\n }\n }\n }\n};\n\n// static function\nHitTest.updateAnchorPoses = function (frame, refSpace) {\n // If tracked anchors isn't defined because it's not supported then just use the empty set\n var trackedAnchors = frame.trackedAnchors || HitTest.prototype.previousFrameAnchors;\n\n HitTest.prototype.previousFrameAnchors.forEach(function (anchor) {\n // Handle anchor tracking loss - `anchor` was present\n // in the present frame but is no longer tracked.\n if (!trackedAnchors.has(anchor)) {\n HitTest.prototype.anchorToObject3D.delete(anchor);\n }\n });\n\n trackedAnchors.forEach(function (anchor) {\n var anchorPose;\n var object3DOptions;\n var offset;\n var object3D;\n\n try {\n // Query most recent pose of the anchor relative to some reference space:\n anchorPose = frame.getPose(anchor.anchorSpace, refSpace);\n } catch (e) {\n // This will fail if the anchor has been deleted that frame\n }\n\n if (anchorPose) {\n object3DOptions = HitTest.prototype.anchorToObject3D.get(anchor);\n offset = object3DOptions.offset;\n object3D = object3DOptions.object3D;\n\n applyPose(anchorPose, object3D, offset);\n }\n });\n};\n\nvar hitTestCache;\nmodule.exports.Component = register('ar-hit-test', {\n schema: {\n target: { type: 'selector' },\n enabled: { default: true },\n src: {\n default: arrowURL,\n type: 'map'\n },\n type: {\n default: 'footprint',\n oneOf: ['footprint', 'map']\n },\n footprintDepth: {\n default: 0.1\n },\n mapSize: {\n type: 'vec2',\n default: {\n x: 0.5,\n y: 0.5\n }\n }\n },\n\n init: function () {\n this.hitTest = null;\n this.imageDataArray = new Uint8ClampedArray(512 * 512 * 4);\n this.imageData = new ImageData(this.imageDataArray, 512, 512);\n\n this.textureCache = new Map();\n\n this.orthoCam = new THREE.OrthographicCamera();\n this.orthoCam.layers.set(CAM_LAYER);\n this.textureTarget = new THREE.WebGLRenderTarget(512, 512, {});\n this.basicMaterial = new THREE.MeshBasicMaterial({\n color: 0x000000,\n side: THREE.DoubleSide\n });\n this.canvas = document.createElement('canvas');\n this.context = this.canvas.getContext('2d');\n this.context.imageSmoothingEnabled = false;\n this.canvas.width = 512;\n this.canvas.height = 512;\n this.canvasTexture = new THREE.CanvasTexture(this.canvas, {\n alpha: true\n });\n this.canvasTexture.flipY = false;\n\n // Update WebXR to support hit-test and anchors\n var webxrData = this.el.getAttribute('webxr');\n var optionalFeaturesArray = webxrData.optionalFeatures;\n if (\n !optionalFeaturesArray.includes('hit-test') ||\n !optionalFeaturesArray.includes('anchors')\n ) {\n optionalFeaturesArray.push('hit-test');\n optionalFeaturesArray.push('anchors');\n this.el.setAttribute('webxr', webxrData);\n }\n\n this.el.sceneEl.renderer.xr.addEventListener('sessionend', function () {\n this.hitTest = null;\n }.bind(this));\n\n this.el.sceneEl.renderer.xr.addEventListener('sessionstart', function () {\n var renderer = this.el.sceneEl.renderer;\n var session = this.session = renderer.xr.getSession();\n this.hasPosedOnce = false;\n this.bboxMesh.visible = false;\n\n if (!hitTestCache) { hitTestCache = new Map(); }\n\n // Default to selecting through the face\n session.requestReferenceSpace('viewer')\n .then(function (viewerSpace) {\n this.hitTest = new HitTest(renderer, {\n space: viewerSpace\n });\n\n hitTestCache.set(viewerSpace, this.hitTest);\n\n this.el.emit('ar-hit-test-start');\n }.bind(this));\n\n // These are transient inputs so need to be handled seperately\n var profileToSupport = 'generic-touchscreen';\n var transientHitTest = new HitTest(renderer, {\n profile: profileToSupport\n });\n\n session.addEventListener('selectstart', function (e) {\n if (this.data.enabled !== true) { return; }\n\n var inputSource = e.inputSource;\n\n this.bboxMesh.visible = true;\n\n if (this.hasPosedOnce === true) {\n this.el.emit('ar-hit-test-select-start', {\n inputSource: inputSource,\n position: this.bboxMesh.position,\n orientation: this.bboxMesh.quaternion\n });\n\n if (inputSource.profiles[0] === profileToSupport) {\n this.hitTest = transientHitTest;\n } else {\n this.hitTest = hitTestCache.get(inputSource) || new HitTest(renderer, {\n space: inputSource.targetRaySpace\n });\n hitTestCache.set(inputSource, this.hitTest);\n }\n }\n }.bind(this));\n\n session.addEventListener('selectend', function (e) {\n if (!this.hitTest || this.data.enabled !== true) {\n this.hitTest = null;\n return;\n }\n\n var inputSource = e.inputSource;\n var object;\n\n if (this.hasPosedOnce === true) {\n this.bboxMesh.visible = false;\n\n // if we have a target with a 3D object then automatically generate an anchor for it.\n if (this.data.target) {\n object = this.data.target.object3D;\n\n if (object) {\n applyPose.tempFakePose.transform.position.copy(this.bboxMesh.position);\n applyPose.tempFakePose.transform.orientation.copy(this.bboxMesh.quaternion);\n applyPose(applyPose.tempFakePose, object, this.bboxOffset);\n object.visible = true;\n\n // create an anchor attatched to the object\n this.hitTest.anchorFromLastHitTestResult(object, this.bboxOffset);\n }\n }\n\n this.el.emit('ar-hit-test-select', {\n inputSource: inputSource,\n position: this.bboxMesh.position,\n orientation: this.bboxMesh.quaternion\n });\n }\n\n this.hitTest = null;\n }.bind(this));\n }.bind(this));\n\n this.bboxOffset = new THREE.Vector3();\n this.update = this.update.bind(this);\n this.makeBBox();\n },\n update: function () {\n if (this.data.target) {\n if (this.data.target.object3D) {\n this.data.target.addEventListener('model-loaded', this.update);\n this.data.target.object3D.layers.enable(CAM_LAYER);\n this.data.target.object3D.traverse(function (child) {\n child.layers.enable(CAM_LAYER);\n });\n } else {\n this.data.target.addEventListener('loaded', this.update, {once: true});\n }\n }\n this.bboxNeedsUpdate = true;\n },\n makeBBox: function () {\n var geometry = new THREE.PlaneGeometry(1, 1);\n var material = new THREE.MeshBasicMaterial({\n transparent: true,\n color: 0xffffff\n });\n geometry.rotateX(-Math.PI / 2);\n geometry.rotateY(-Math.PI / 2);\n this.bbox = new THREE.Box3();\n this.bboxMesh = new THREE.Mesh(geometry, material);\n this.el.setObject3D('ar-hit-test', this.bboxMesh);\n this.bboxMesh.visible = false;\n },\n updateFootprint: function () {\n var tempImageData;\n var renderer = this.el.sceneEl.renderer;\n var oldRenderTarget, oldBackground;\n var isXREnabled = renderer.xr.enabled;\n this.bboxMesh.material.map = this.canvasTexture;\n this.bboxMesh.material.needsUpdate = true;\n this.orthoCam.rotation.set(-Math.PI / 2, 0, -Math.PI / 2);\n this.orthoCam.position.copy(this.bboxMesh.position);\n this.orthoCam.position.y -= this.bboxMesh.scale.y / 2;\n this.orthoCam.near = 0.1;\n this.orthoCam.far = this.orthoCam.near + (this.data.footprintDepth * this.bboxMesh.scale.y);\n this.orthoCam.position.y += this.orthoCam.far;\n this.orthoCam.right = this.bboxMesh.scale.z / 2;\n this.orthoCam.left = -this.bboxMesh.scale.z / 2;\n this.orthoCam.top = this.bboxMesh.scale.x / 2;\n this.orthoCam.bottom = -this.bboxMesh.scale.x / 2;\n this.orthoCam.updateProjectionMatrix();\n\n oldRenderTarget = renderer.getRenderTarget();\n renderer.setRenderTarget(this.textureTarget);\n renderer.xr.enabled = false;\n oldBackground = this.el.object3D.background;\n this.el.object3D.overrideMaterial = this.basicMaterial;\n this.el.object3D.background = null;\n renderer.render(this.el.object3D, this.orthoCam);\n this.el.object3D.background = oldBackground;\n this.el.object3D.overrideMaterial = null;\n renderer.xr.enabled = isXREnabled;\n renderer.setRenderTarget(oldRenderTarget);\n renderer.readRenderTargetPixels(this.textureTarget, 0, 0, 512, 512, this.imageDataArray);\n\n this.context.putImageData(this.imageData, 0, 0);\n this.context.shadowColor = 'white';\n this.context.shadowBlur = 10;\n this.context.drawImage(this.canvas, 0, 0);\n tempImageData = this.context.getImageData(0, 0, 512, 512);\n for (var i = 0; i < 512 * 512; i++) {\n // if it's a little bit transparent but not opaque make it middle transparent\n if (tempImageData.data[ i * 4 + 3 ] !== 0 && tempImageData.data[ i * 4 + 3 ] !== 255) {\n tempImageData.data[ i * 4 + 3 ] = 128;\n }\n }\n this.context.putImageData(tempImageData, 0, 0);\n this.canvasTexture.needsUpdate = true;\n },\n tick: function () {\n var pose;\n var frame = this.el.sceneEl.frame;\n var renderer = this.el.sceneEl.renderer;\n\n if (frame) {\n // if we are in XR then update the positions of the objects attatched to anchors\n HitTest.updateAnchorPoses(frame, renderer.xr.getReferenceSpace());\n }\n if (this.bboxNeedsUpdate) {\n this.bboxNeedsUpdate = false;\n\n if (!this.data.target || this.data.type === 'map') {\n var texture;\n if (this.textureCache.has(this.data.src)) {\n texture = this.textureCache.get(this.data.src);\n } else {\n texture = new THREE.TextureLoader().load(this.data.src);\n this.textureCache.set(this.data.src, texture);\n }\n this.bboxMesh.material.map = texture;\n this.bboxMesh.material.needsUpdate = true;\n }\n\n if (this.data.target && this.data.target.object3D) {\n this.bbox.setFromObject(this.data.target.object3D);\n this.bbox.getCenter(this.bboxMesh.position);\n this.bbox.getSize(this.bboxMesh.scale);\n\n if (this.data.type === 'footprint') {\n // Add a little buffer for the footprint border\n this.bboxMesh.scale.x *= 1.04;\n this.bboxMesh.scale.z *= 1.04;\n this.updateFootprint();\n }\n\n this.bboxMesh.position.y -= this.bboxMesh.scale.y / 2;\n this.bboxOffset.copy(this.bboxMesh.position);\n this.bboxOffset.sub(this.data.target.object3D.position);\n } else {\n this.bboxMesh.scale.set(this.data.mapSize.x, 1, this.data.mapSize.y);\n }\n }\n\n if (this.hitTest) {\n pose = this.hitTest.doHit(frame);\n if (pose) {\n if (this.hasPosedOnce !== true) {\n this.hasPosedOnce = true;\n this.el.emit('ar-hit-test-achieved');\n }\n this.bboxMesh.visible = true;\n this.bboxMesh.position.copy(pose.transform.position);\n this.bboxMesh.quaternion.copy(pose.transform.orientation);\n }\n }\n }\n});\n","/* global THREE, XRWebGLBinding */\nvar register = require('../../core/component').registerComponent;\nvar COMPONENTS = require('../../core/component').components;\n\n// source: view-source:https://storage.googleapis.com/chromium-webxr-test/r886480/proposals/lighting-estimation.html\nfunction updateLights (estimate, probeLight, directionalLight, directionalLightPosition) {\n var intensityScalar =\n Math.max(1.0,\n Math.max(estimate.primaryLightIntensity.x,\n Math.max(estimate.primaryLightIntensity.y,\n estimate.primaryLightIntensity.z)));\n\n probeLight.sh.fromArray(estimate.sphericalHarmonicsCoefficients);\n probeLight.intensity = 1;\n\n directionalLight.color.setRGB(\n estimate.primaryLightIntensity.x / intensityScalar,\n estimate.primaryLightIntensity.y / intensityScalar,\n estimate.primaryLightIntensity.z / intensityScalar);\n\n directionalLight.intensity = intensityScalar;\n directionalLightPosition.copy(estimate.primaryLightDirection);\n}\n\nmodule.exports.Component = register('background', {\n schema: {\n color: { type: 'color', default: 'black' },\n transparent: { default: false },\n generateEnvironment: { default: true },\n directionalLight: { type: 'selector' }\n },\n init: function () {\n var self = this;\n\n this.pmremGenerator = new THREE.PMREMGenerator(this.el.renderer);\n this.pmremGenerator.compileCubemapShader();\n this.cubeRenderTarget = new THREE.WebGLCubeRenderTarget(256, { format: THREE.RGBFormat, generateMipmaps: true, minFilter: THREE.LinearMipmapLinearFilter });\n this.lightProbeTarget = new THREE.WebGLCubeRenderTarget(16, { format: THREE.RGBFormat, generateMipmaps: false });\n this.cubeCamera = new THREE.CubeCamera(0.1, 1000, this.cubeRenderTarget);\n this.needsEnvironmentUpdate = true;\n this.timeSinceUpdate = 0;\n\n // Update WebXR to support light-estimation\n var webxrData = this.el.getAttribute('webxr');\n var optionalFeaturesArray = webxrData.optionalFeatures;\n if (!optionalFeaturesArray.includes('light-estimation')) {\n optionalFeaturesArray.push('light-estimation');\n this.el.setAttribute('webxr', webxrData);\n }\n\n this.el.sceneEl.addEventListener('enter-vr', function () {\n var renderer = self.el.renderer;\n var session = renderer.xr.getSession();\n if (\n session.requestLightProbe && self.el.sceneEl.is('ar-mode')\n ) {\n self.startLightProbe();\n }\n });\n\n this.el.sceneEl.addEventListener('exit-vr', function () {\n self.stopLightProbe();\n });\n },\n stopLightProbe: function () {\n var data = this.data;\n var scene = this.el.sceneEl.object3D;\n this.xrLightProbe = null;\n\n this.probeLight.components.light.light.intensity = 0;\n if (this.ownDirectionalLight) {\n this.ownDirectionalLight.components.light.light.intensity = 0;\n }\n\n if (data.generateEnvironment) {\n this.needsEnvironmentUpdate = true;\n } else {\n scene.environment = null;\n }\n },\n setupLightsForLightingEstimation: function () {\n // Make a directionalLight if required\n if (this.data.directionalLight) {\n this.directionalLight = this.data.directionalLight;\n } else {\n var directionalLight = this.ownDirectionalLight || document.createElement('a-light');\n directionalLight.setAttribute('type', 'directional');\n directionalLight.setAttribute('intensity', 0);\n this.el.appendChild(directionalLight);\n this.directionalLight = directionalLight;\n this.ownDirectionalLight = directionalLight;\n }\n\n if (!this.probeLight) {\n var probeLight = document.createElement('a-light');\n probeLight.setAttribute('type', 'probe');\n probeLight.setAttribute('intensity', 0);\n this.el.appendChild(probeLight);\n this.probeLight = probeLight;\n }\n },\n startLightProbe: function () {\n var data = this.data;\n var scene = this.el.sceneEl.object3D;\n\n if (data.generateEnvironment) {\n this.needsLightProbeUpdate = true;\n this.needsEnvironmentUpdate = true;\n } else {\n scene.environment = null;\n }\n },\n setupLightProbe: function () {\n var scene = this.el.object3D;\n var renderer = this.el.renderer;\n var xrSession = renderer.xr.getSession();\n var self = this;\n var gl = renderer.getContext();\n\n this.setupLightsForLightingEstimation();\n\n this.glBinding = new XRWebGLBinding(xrSession, gl);\n gl.getExtension('EXT_sRGB');\n gl.getExtension('OES_texture_half_float');\n\n xrSession.requestLightProbe()\n .then(function (lightProbe) {\n scene.environment = self.lightProbeTarget.texture;\n\n self.xrLightProbe = lightProbe;\n lightProbe.addEventListener('reflectionchange', function onReflectionChanged () {\n self.needsEnvironmentUpdate = true;\n });\n })\n .catch(function (err) {\n console.warn('Lighting estimation not supported: ' + err.message);\n console.warn('Are you missing: webxr=\"optionalFeatures: light-estimation;\" from <a-scene>?');\n });\n },\n update: function () {\n var scene = this.el.sceneEl.object3D;\n var data = this.data;\n var object3D = this.el.object3D;\n\n if (data.transparent) {\n object3D.background = null;\n } else {\n object3D.background = new THREE.Color(data.color);\n }\n\n if (data.generateEnvironment) {\n this.needsEnvironmentUpdate = true;\n } else {\n scene.environment = null;\n }\n },\n\n updateXRCubeMap: function () {\n // Update Cube Map, cubeMap maybe some unavailable on some hardware\n var renderer = this.el.renderer;\n var cubeMap = this.glBinding.getReflectionCubeMap(this.xrLightProbe);\n if (cubeMap) {\n var rendererProps = renderer.properties.get(this.lightProbeTarget.texture);\n rendererProps.__webglTexture = cubeMap;\n }\n },\n\n tick: function () {\n var scene = this.el.object3D;\n var renderer = this.el.renderer;\n var frame = this.el.sceneEl.frame;\n\n if (frame && this.xrLightProbe) {\n // light estimate may not yet be available, it takes a few frames to start working\n var estimate = frame.getLightEstimate(this.xrLightProbe);\n\n if (estimate) {\n updateLights(\n estimate,\n this.probeLight.components.light.light,\n this.directionalLight.components.light.light,\n this.directionalLight.object3D.position\n );\n }\n }\n\n if (!this.needsEnvironmentUpdate) {\n return;\n }\n\n if (this.needsLightProbeUpdate) {\n // wait until the XR Session has started before trying to make\n // the light probe\n if (!frame) {\n return;\n }\n this.needsLightProbeUpdate = false;\n this.setupLightProbe();\n }\n\n if (this.xrLightProbe) {\n this.updateXRCubeMap();\n } else {\n this.cubeCamera.position.set(0, 1.6, 0);\n scene.environment = null;\n this.cubeCamera.update(renderer, scene);\n scene.environment = this.pmremGenerator.fromCubemap(\n this.cubeRenderTarget.texture\n ).texture;\n }\n\n this.needsEnvironmentUpdate = false;\n },\n\n remove: function () {\n var data = this.data;\n var object3D = this.el.object3D;\n if (data.transparent) {\n object3D.background = null;\n return;\n }\n this.pmremGenerator.dispose();\n object3D.background = COMPONENTS[this.name].schema.color.default;\n }\n});\n","var register = require('../../core/component').registerComponent;\n\nmodule.exports.Component = register('debug', {\n schema: {default: true}\n});\n","/* global DeviceOrientationEvent, location */\nvar registerComponent = require('../../core/component').registerComponent;\nvar utils = require('../../utils/');\nvar bind = utils.bind;\n\nvar constants = require('../../constants/');\n\nvar MODAL_CLASS = 'a-modal';\nvar DIALOG_CLASS = 'a-dialog';\nvar DIALOG_TEXT_CLASS = 'a-dialog-text';\nvar DIALOG_TEXT_CONTAINER_CLASS = 'a-dialog-text-container';\nvar DIALOG_BUTTONS_CONTAINER_CLASS = 'a-dialog-buttons-container';\nvar DIALOG_BUTTON_CLASS = 'a-dialog-button';\nvar DIALOG_ALLOW_BUTTON_CLASS = 'a-dialog-allow-button';\nvar DIALOG_DENY_BUTTON_CLASS = 'a-dialog-deny-button';\nvar DIALOG_OK_BUTTON_CLASS = 'a-dialog-ok-button';\n\n/**\n * UI for enabling device motion permission\n */\nmodule.exports.Component = registerComponent('device-orientation-permission-ui', {\n schema: {\n enabled: {default: true},\n deviceMotionMessage: {\n default: 'This immersive website requires access to your device motion sensors.'\n },\n httpsMessage: {\n default: 'Access this site over HTTPS to enter VR mode and grant access to the device sensors.'\n },\n denyButtonText: {default: 'Deny'},\n allowButtonText: {default: 'Allow'},\n cancelButtonText: {default: 'Cancel'}\n },\n\n init: function () {\n var self = this;\n\n if (!this.data.enabled) { return; }\n\n if (location.hostname !== 'localhost' &&\n location.hostname !== '127.0.0.1' &&\n location.protocol === 'http:') {\n this.showHTTPAlert();\n }\n\n // Browser doesn't support or doesn't require permission to DeviceOrientationEvent API.\n if (typeof DeviceOrientationEvent === 'undefined' || !DeviceOrientationEvent.requestPermission) {\n this.permissionGranted = true;\n return;\n }\n\n this.onDeviceMotionDialogAllowClicked = bind(this.onDeviceMotionDialogAllowClicked, this);\n this.onDeviceMotionDialogDenyClicked = bind(this.onDeviceMotionDialogDenyClicked, this);\n // Show dialog only if permission has not yet been granted.\n DeviceOrientationEvent.requestPermission().catch(function () {\n self.devicePermissionDialogEl = createPermissionDialog(\n self.data.denyButtonText,\n self.data.allowButtonText,\n self.data.deviceMotionMessage,\n self.onDeviceMotionDialogAllowClicked,\n self.onDeviceMotionDialogDenyClicked);\n self.el.appendChild(self.devicePermissionDialogEl);\n }).then(function () {\n self.el.emit('deviceorientationpermissiongranted');\n self.permissionGranted = true;\n });\n },\n\n remove: function () {\n // This removes the modal screen\n if (this.devicePermissionDialogEl) { this.el.removeChild(this.devicePermissionDialogEl); }\n },\n\n onDeviceMotionDialogDenyClicked: function () {\n this.remove();\n },\n\n showHTTPAlert: function () {\n var self = this;\n var httpAlertEl = createAlertDialog(\n self.data.cancelButtonText,\n self.data.httpsMessage,\n function () { self.el.removeChild(httpAlertEl); });\n this.el.appendChild(httpAlertEl);\n },\n\n /**\n * Enable device motion permission when clicked.\n */\n onDeviceMotionDialogAllowClicked: function () {\n var self = this;\n this.el.emit('deviceorientationpermissionrequested');\n DeviceOrientationEvent.requestPermission().then(function (response) {\n if (response === 'granted') {\n self.el.emit('deviceorientationpermissiongranted');\n self.permissionGranted = true;\n } else {\n self.el.emit('deviceorientationpermissionrejected');\n }\n self.remove();\n }).catch(console.error);\n }\n});\n\n/**\n * Create a modal dialog that request users permission to access the Device Motion API.\n *\n * @param {function} onAllowClicked - click event handler\n * @param {function} onDenyClicked - click event handler\n *\n * @returns {Element} Wrapper <div>.\n */\nfunction createPermissionDialog (\n denyText, allowText, dialogText, onAllowClicked, onDenyClicked) {\n var buttonsContainer;\n var denyButton;\n var acceptButton;\n\n buttonsContainer = document.createElement('div');\n buttonsContainer.classList.add(DIALOG_BUTTONS_CONTAINER_CLASS);\n\n // Buttons\n denyButton = document.createElement('button');\n denyButton.classList.add(DIALOG_BUTTON_CLASS, DIALOG_DENY_BUTTON_CLASS);\n denyButton.setAttribute(constants.AFRAME_INJECTED, '');\n denyButton.innerHTML = denyText;\n buttonsContainer.appendChild(denyButton);\n\n acceptButton = document.createElement('button');\n acceptButton.classList.add(DIALOG_BUTTON_CLASS, DIALOG_ALLOW_BUTTON_CLASS);\n acceptButton.setAttribute(constants.AFRAME_INJECTED, '');\n acceptButton.innerHTML = allowText;\n buttonsContainer.appendChild(acceptButton);\n\n // Ask for sensor events to be used\n acceptButton.addEventListener('click', function (evt) {\n evt.stopPropagation();\n onAllowClicked();\n });\n\n denyButton.addEventListener('click', function (evt) {\n evt.stopPropagation();\n onDenyClicked();\n });\n\n return createDialog(dialogText, buttonsContainer);\n}\n\nfunction createAlertDialog (closeText, dialogText, onOkClicked) {\n var buttonsContainer;\n var okButton;\n\n buttonsContainer = document.createElement('div');\n buttonsContainer.classList.add(DIALOG_BUTTONS_CONTAINER_CLASS);\n\n // Buttons\n okButton = document.createElement('button');\n okButton.classList.add(DIALOG_BUTTON_CLASS, DIALOG_OK_BUTTON_CLASS);\n okButton.setAttribute(constants.AFRAME_INJECTED, '');\n okButton.innerHTML = closeText;\n buttonsContainer.appendChild(okButton);\n\n // Ask for sensor events to be used\n okButton.addEventListener('click', function (evt) {\n evt.stopPropagation();\n onOkClicked();\n });\n\n return createDialog(dialogText, buttonsContainer);\n}\n\nfunction createDialog (text, buttonsContainerEl) {\n var modalContainer;\n var dialog;\n var dialogTextContainer;\n var dialogText;\n\n modalContainer = document.createElement('div');\n modalContainer.classList.add(MODAL_CLASS);\n modalContainer.setAttribute(constants.AFRAME_INJECTED, '');\n\n dialog = document.createElement('div');\n dialog.className = DIALOG_CLASS;\n dialog.setAttribute(constants.AFRAME_INJECTED, '');\n modalContainer.appendChild(dialog);\n\n dialogTextContainer = document.createElement('div');\n dialogTextContainer.classList.add(DIALOG_TEXT_CONTAINER_CLASS);\n dialog.appendChild(dialogTextContainer);\n\n dialogText = document.createElement('div');\n dialogText.classList.add(DIALOG_TEXT_CLASS);\n dialogText.innerHTML = text;\n dialogTextContainer.appendChild(dialogText);\n\n dialog.appendChild(buttonsContainerEl);\n\n return modalContainer;\n}\n","var registerComponent = require('../../core/component').registerComponent;\n\n/**\n * Component to embed an a-frame scene within the layout of a 2D page.\n */\nmodule.exports.Component = registerComponent('embedded', {\n dependencies: ['vr-mode-ui'],\n\n schema: {default: true},\n\n update: function () {\n var sceneEl = this.el;\n var enterVREl = sceneEl.querySelector('.a-enter-vr');\n if (this.data === true) {\n if (enterVREl) { enterVREl.classList.add('embedded'); }\n sceneEl.removeFullScreenStyles();\n } else {\n if (enterVREl) { enterVREl.classList.remove('embedded'); }\n sceneEl.addFullScreenStyles();\n }\n }\n\n});\n","var register = require('../../core/component').registerComponent;\nvar THREE = require('../../lib/three');\nvar debug = require('../../utils/debug');\n\nvar warn = debug('components:fog:warn');\n\n/**\n * Fog component.\n * Applies only to the scene entity.\n */\nmodule.exports.Component = register('fog', {\n schema: {\n color: {type: 'color', default: '#000'},\n density: {default: 0.00025},\n far: {default: 1000, min: 0},\n near: {default: 1, min: 0},\n type: {default: 'linear', oneOf: ['linear', 'exponential']}\n },\n\n update: function () {\n var data = this.data;\n var el = this.el;\n var fog = this.el.object3D.fog;\n\n if (!el.isScene) {\n warn('Fog component can only be applied to <a-scene>');\n return;\n }\n\n // (Re)create fog if fog doesn't exist or fog type changed.\n if (!fog || data.type !== fog.name) {\n el.object3D.fog = getFog(data);\n el.systems.material.updateMaterials();\n return;\n }\n\n // Fog data changed. Update fog.\n Object.keys(this.schema).forEach(function (key) {\n var value = data[key];\n if (key === 'color') { value = new THREE.Color(value); }\n fog[key] = value;\n });\n },\n\n /**\n * Remove fog on remove (callback).\n */\n remove: function () {\n var fog = this.el.object3D.fog;\n if (!fog) { return; }\n fog.far = 0;\n fog.near = 0.1;\n }\n});\n\n/**\n * Creates a fog object. Sets fog.name to be able to detect fog type changes.\n *\n * @param {object} data - Fog data.\n * @returns {object} fog\n */\nfunction getFog (data) {\n var fog;\n if (data.type === 'exponential') {\n fog = new THREE.FogExp2(data.color, data.density);\n } else {\n fog = new THREE.Fog(data.color, data.near, data.far);\n }\n fog.name = data.type;\n return fog;\n}\n","/* global AFRAME */\nvar AFRAME_INJECTED = require('../../constants').AFRAME_INJECTED;\nvar pkg = require('../../../package');\nvar registerComponent = require('../../core/component').registerComponent;\nvar utils = require('../../utils/');\n\n/**\n * 0.4.2 to 0.4.x\n * Will need to update this when A-Frame goes to 1.x.x.\n */\nfunction getFuzzyPatchVersion (version) {\n var split = version.split('.');\n split[2] = 'x';\n return split.join('.');\n}\n\nvar INSPECTOR_DEV_URL = 'https://aframe.io/aframe-inspector/dist/aframe-inspector.js';\nvar INSPECTOR_RELEASE_URL = 'https://unpkg.com/aframe-inspector@' + getFuzzyPatchVersion(pkg.version) + '/dist/aframe-inspector.min.js';\nvar INSPECTOR_URL = process.env.INSPECTOR_VERSION === 'dev' ? INSPECTOR_DEV_URL : INSPECTOR_RELEASE_URL;\nvar LOADING_MESSAGE = 'Loading Inspector';\nvar LOADING_ERROR_MESSAGE = 'Error loading Inspector';\n\nmodule.exports.Component = registerComponent('inspector', {\n schema: {\n url: {default: INSPECTOR_URL}\n },\n\n init: function () {\n this.firstPlay = true;\n this.onKeydown = this.onKeydown.bind(this);\n this.onMessage = this.onMessage.bind(this);\n this.initOverlay();\n window.addEventListener('keydown', this.onKeydown);\n window.addEventListener('message', this.onMessage);\n },\n\n play: function () {\n var urlParam;\n if (!this.firstPlay) { return; }\n urlParam = utils.getUrlParameter('inspector');\n if (urlParam !== 'false' && !!urlParam) {\n this.openInspector();\n this.firstPlay = false;\n }\n },\n\n initOverlay: function () {\n var dotsHTML = '<span class=\"dots\"><span>.</span><span>.</span><span>.</span></span>';\n this.loadingMessageEl = document.createElement('div');\n this.loadingMessageEl.classList.add('a-inspector-loader');\n this.loadingMessageEl.innerHTML = LOADING_MESSAGE + dotsHTML;\n },\n\n remove: function () {\n this.removeEventListeners();\n },\n\n /**\n * <ctrl> + <alt> + i keyboard shortcut.\n */\n onKeydown: function (evt) {\n var shortcutPressed = evt.keyCode === 73 && (evt.ctrlKey && evt.altKey || evt.getModifierState('AltGraph'));\n if (!shortcutPressed) { return; }\n this.openInspector();\n },\n\n showLoader: function () {\n document.body.appendChild(this.loadingMessageEl);\n },\n\n hideLoader: function () {\n document.body.removeChild(this.loadingMessageEl);\n },\n\n /**\n * postMessage. aframe.io uses this to create a button on examples to open Inspector.\n */\n onMessage: function (evt) {\n if (evt.data === 'INJECT_AFRAME_INSPECTOR') { this.openInspector(); }\n },\n\n openInspector: function (focusEl) {\n var self = this;\n var script;\n\n // Already injected. Open.\n if (AFRAME.INSPECTOR || AFRAME.inspectorInjected) {\n AFRAME.INSPECTOR.open(focusEl);\n return;\n }\n\n this.showLoader();\n\n // Inject.\n script = document.createElement('script');\n script.src = this.data.url;\n script.setAttribute('data-name', 'aframe-inspector');\n script.setAttribute(AFRAME_INJECTED, '');\n script.onload = function () {\n AFRAME.INSPECTOR.open(focusEl);\n self.hideLoader();\n self.removeEventListeners();\n };\n script.onerror = function () {\n self.loadingMessageEl.innerHTML = LOADING_ERROR_MESSAGE;\n };\n document.head.appendChild(script);\n AFRAME.inspectorInjected = true;\n },\n\n removeEventListeners: function () {\n window.removeEventListener('keydown', this.onKeydown);\n window.removeEventListener('message', this.onMessage);\n }\n});\n","var registerComponent = require('../../core/component').registerComponent;\nvar shouldCaptureKeyEvent = require('../../utils/').shouldCaptureKeyEvent;\n\nmodule.exports.Component = registerComponent('keyboard-shortcuts', {\n schema: {\n enterVR: {default: true},\n exitVR: {default: true}\n },\n\n init: function () {\n this.onKeyup = this.onKeyup.bind(this);\n },\n\n update: function (oldData) {\n var data = this.data;\n this.enterVREnabled = data.enterVR;\n },\n\n play: function () {\n window.addEventListener('keyup', this.onKeyup, false);\n },\n\n pause: function () {\n window.removeEventListener('keyup', this.onKeyup);\n },\n\n onKeyup: function (evt) {\n var scene = this.el;\n if (!shouldCaptureKeyEvent(evt)) { return; }\n if (this.enterVREnabled && evt.keyCode === 70) { // f.\n scene.enterVR();\n }\n if (this.enterVREnabled && evt.keyCode === 27) { // escape.\n scene.exitVR();\n }\n }\n});\n","var debug = require('../../utils/debug');\nvar registerComponent = require('../../core/component').registerComponent;\n\nvar warn = debug('components:pool:warn');\n\n/**\n * Pool component to reuse entities.\n * Avoids creating and destroying the same kind of entities.\n * Helps reduce GC pauses. For example in a game to reuse enemies entities.\n *\n * @member {array} availableEls - Available entities in the pool.\n * @member {array} usedEls - Entities of the pool in use.\n */\nmodule.exports.Component = registerComponent('pool', {\n schema: {\n container: {default: ''},\n mixin: {default: ''},\n size: {default: 0},\n dynamic: {default: false}\n },\n\n multiple: true,\n\n initPool: function () {\n var i;\n\n this.availableEls = [];\n this.usedEls = [];\n\n if (!this.data.mixin) {\n warn('No mixin provided for pool component.');\n }\n\n if (this.data.container) {\n this.container = document.querySelector(this.data.container);\n if (!this.container) {\n warn('Container ' + this.data.container + ' not found.');\n }\n }\n this.container = this.container || this.el;\n\n for (i = 0; i < this.data.size; ++i) {\n this.createEntity();\n }\n },\n\n update: function (oldData) {\n var data = this.data;\n if (oldData.mixin !== data.mixin || oldData.size !== data.size) {\n this.initPool();\n }\n },\n\n /**\n * Add a new entity to the list of available entities.\n */\n createEntity: function () {\n var el;\n el = document.createElement('a-entity');\n el.play = this.wrapPlay(el.play);\n el.setAttribute('mixin', this.data.mixin);\n el.object3D.visible = false;\n el.pause();\n this.container.appendChild(el);\n this.availableEls.push(el);\n },\n\n /**\n * Play wrapper for pooled entities. When pausing and playing a scene, don't want to play\n * entities that are not in use.\n */\n wrapPlay: function (playMethod) {\n var usedEls = this.usedEls;\n return function () {\n if (usedEls.indexOf(this) === -1) { return; }\n playMethod.call(this);\n };\n },\n\n /**\n * Used to request one of the available entities of the pool.\n */\n requestEntity: function () {\n var el;\n if (this.availableEls.length === 0) {\n if (this.data.dynamic === false) {\n warn('Requested entity from empty pool: ' + this.attrName);\n return;\n } else {\n warn('Requested entity from empty pool. This pool is dynamic and will resize ' +\n 'automatically. You might want to increase its initial size: ' + this.attrName);\n }\n this.createEntity();\n }\n el = this.availableEls.shift();\n this.usedEls.push(el);\n el.object3D.visible = true;\n return el;\n },\n\n /**\n * Used to return a used entity to the pool.\n */\n returnEntity: function (el) {\n var index = this.usedEls.indexOf(el);\n if (index === -1) {\n warn('The returned entity was not previously pooled from ' + this.attrName);\n return;\n }\n this.usedEls.splice(index, 1);\n this.availableEls.push(el);\n el.object3D.visible = false;\n el.pause();\n return el;\n }\n});\n","/* global ImageData, URL */\nvar registerComponent = require('../../core/component').registerComponent;\nvar THREE = require('../../lib/three');\n\nvar VERTEX_SHADER = [\n 'attribute vec3 position;',\n 'attribute vec2 uv;',\n 'uniform mat4 projectionMatrix;',\n 'uniform mat4 modelViewMatrix;',\n 'varying vec2 vUv;',\n 'void main() {',\n ' vUv = vec2( 1.- uv.x, uv.y );',\n ' gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',\n '}'\n].join('\\n');\n\nvar FRAGMENT_SHADER = [\n 'precision mediump float;',\n 'uniform samplerCube map;',\n 'varying vec2 vUv;',\n '#define M_PI 3.141592653589793238462643383279',\n 'void main() {',\n ' vec2 uv = vUv;',\n ' float longitude = uv.x * 2. * M_PI - M_PI + M_PI / 2.;',\n ' float latitude = uv.y * M_PI;',\n ' vec3 dir = vec3(',\n ' - sin( longitude ) * sin( latitude ),',\n ' cos( latitude ),',\n ' - cos( longitude ) * sin( latitude )',\n ' );',\n ' normalize( dir );',\n ' gl_FragColor = vec4( textureCube( map, dir ).rgb, 1.0 );',\n '}'\n].join('\\n');\n\n/**\n * Component to take screenshots of the scene using a keboard shortcut (alt+s).\n * It can be configured to either take 360&deg; captures (`equirectangular`)\n * or regular screenshots (`projection`)\n *\n * This is based on https://github.com/spite/THREE.CubemapToEquirectangular\n * To capture an equirectangular projection of the scene a THREE.CubeCamera is used\n * The cube map produced by the CubeCamera is projected on a quad and then rendered to\n * WebGLRenderTarget with an ortographic camera.\n */\nmodule.exports.Component = registerComponent('screenshot', {\n schema: {\n width: {default: 4096},\n height: {default: 2048},\n camera: {type: 'selector'}\n },\n\n init: function () {\n var el = this.el;\n var self = this;\n\n if (el.renderer) {\n setup();\n } else {\n el.addEventListener('render-target-loaded', setup);\n }\n\n function setup () {\n var gl = el.renderer.getContext();\n if (!gl) { return; }\n self.cubeMapSize = gl.getParameter(gl.MAX_CUBE_MAP_TEXTURE_SIZE);\n self.material = new THREE.RawShaderMaterial({\n uniforms: {map: {type: 't', value: null}},\n vertexShader: VERTEX_SHADER,\n fragmentShader: FRAGMENT_SHADER,\n side: THREE.DoubleSide\n });\n self.quad = new THREE.Mesh(\n new THREE.PlaneBufferGeometry(1, 1),\n self.material\n );\n self.quad.visible = false;\n self.camera = new THREE.OrthographicCamera(-1 / 2, 1 / 2, 1 / 2, -1 / 2, -10000, 10000);\n self.canvas = document.createElement('canvas');\n self.ctx = self.canvas.getContext('2d');\n el.object3D.add(self.quad);\n self.onKeyDown = self.onKeyDown.bind(self);\n }\n },\n\n getRenderTarget: function (width, height) {\n return new THREE.WebGLRenderTarget(width, height, {\n encoding: THREE.sRGBEncoding,\n minFilter: THREE.LinearFilter,\n magFilter: THREE.LinearFilter,\n wrapS: THREE.ClampToEdgeWrapping,\n wrapT: THREE.ClampToEdgeWrapping,\n format: THREE.RGBAFormat,\n type: THREE.UnsignedByteType\n });\n },\n\n resize: function (width, height) {\n // Resize quad.\n this.quad.scale.set(width, height, 1);\n\n // Resize camera.\n this.camera.left = -1 * width / 2;\n this.camera.right = width / 2;\n this.camera.top = height / 2;\n this.camera.bottom = -1 * height / 2;\n this.camera.updateProjectionMatrix();\n\n // Resize canvas.\n this.canvas.width = width;\n this.canvas.height = height;\n },\n\n play: function () {\n window.addEventListener('keydown', this.onKeyDown);\n },\n\n /**\n * <ctrl> + <alt> + s = Regular screenshot.\n * <ctrl> + <alt> + <shift> + s = Equirectangular screenshot.\n */\n onKeyDown: function (evt) {\n var shortcutPressed = evt.keyCode === 83 && evt.ctrlKey && evt.altKey;\n if (!this.data || !shortcutPressed) { return; }\n var projection = evt.shiftKey ? 'equirectangular' : 'perspective';\n this.capture(projection);\n },\n\n /**\n * Capture a screenshot of the scene.\n *\n * @param {string} projection - Screenshot projection (equirectangular or perspective).\n */\n setCapture: function (projection) {\n var el = this.el;\n var size;\n var camera;\n var cubeCamera;\n var cubeRenderTarget;\n // Configure camera.\n if (projection === 'perspective') {\n // Quad is only used in equirectangular mode. Hide it in this case.\n this.quad.visible = false;\n // Use scene camera.\n camera = (this.data.camera && this.data.camera.components.camera.camera) || el.camera;\n size = {width: this.data.width, height: this.data.height};\n } else {\n // Use ortho camera.\n camera = this.camera;\n cubeRenderTarget = new THREE.WebGLCubeRenderTarget(\n Math.min(this.cubeMapSize, 2048),\n {\n format: THREE.RGBFormat,\n generateMipmaps: true,\n minFilter: THREE.LinearMipmapLinearFilter,\n encoding: THREE.sRGBEncoding\n });\n // Create cube camera and copy position from scene camera.\n cubeCamera = new THREE.CubeCamera(el.camera.near, el.camera.far, cubeRenderTarget);\n // Copy camera position into cube camera;\n el.camera.getWorldPosition(cubeCamera.position);\n el.camera.getWorldQuaternion(cubeCamera.quaternion);\n // Render scene with cube camera.\n cubeCamera.update(el.renderer, el.object3D);\n this.quad.material.uniforms.map.value = cubeCamera.renderTarget.texture;\n size = {width: this.data.width, height: this.data.height};\n // Use quad to project image taken by the cube camera.\n this.quad.visible = true;\n }\n return {\n camera: camera,\n size: size,\n projection: projection\n };\n },\n\n /**\n * Maintained for backwards compatibility.\n */\n capture: function (projection) {\n var isVREnabled = this.el.renderer.xr.enabled;\n var renderer = this.el.renderer;\n var params;\n // Disable VR.\n renderer.xr.enabled = false;\n params = this.setCapture(projection);\n this.renderCapture(params.camera, params.size, params.projection);\n // Trigger file download.\n this.saveCapture();\n // Restore VR.\n renderer.xr.enabled = isVREnabled;\n },\n\n /**\n * Return canvas instead of triggering download (e.g., for uploading blob to server).\n */\n getCanvas: function (projection) {\n var isVREnabled = this.el.renderer.xr.enabled;\n var renderer = this.el.renderer;\n // Disable VR.\n var params = this.setCapture(projection);\n renderer.xr.enabled = false;\n this.renderCapture(params.camera, params.size, params.projection);\n // Restore VR.\n renderer.xr.enabled = isVREnabled;\n return this.canvas;\n },\n\n renderCapture: function (camera, size, projection) {\n var autoClear = this.el.renderer.autoClear;\n var el = this.el;\n var imageData;\n var output;\n var pixels;\n var renderer = el.renderer;\n // Create rendering target and buffer to store the read pixels.\n output = this.getRenderTarget(size.width, size.height);\n pixels = new Uint8Array(4 * size.width * size.height);\n // Resize quad, camera, and canvas.\n this.resize(size.width, size.height);\n // Render scene to render target.\n renderer.autoClear = true;\n renderer.clear();\n renderer.setRenderTarget(output);\n renderer.render(el.object3D, camera);\n renderer.autoClear = autoClear;\n // Read image pizels back.\n renderer.readRenderTargetPixels(output, 0, 0, size.width, size.height, pixels);\n renderer.setRenderTarget(null);\n if (projection === 'perspective') {\n pixels = this.flipPixelsVertically(pixels, size.width, size.height);\n }\n imageData = new ImageData(new Uint8ClampedArray(pixels), size.width, size.height);\n // Hide quad after projecting the image.\n this.quad.visible = false;\n // Copy pixels into canvas.\n this.ctx.putImageData(imageData, 0, 0);\n },\n\n flipPixelsVertically: function (pixels, width, height) {\n var flippedPixels = pixels.slice(0);\n for (var x = 0; x < width; ++x) {\n for (var y = 0; y < height; ++y) {\n flippedPixels[x * 4 + y * width * 4] = pixels[x * 4 + (height - y) * width * 4];\n flippedPixels[x * 4 + 1 + y * width * 4] = pixels[x * 4 + 1 + (height - y) * width * 4];\n flippedPixels[x * 4 + 2 + y * width * 4] = pixels[x * 4 + 2 + (height - y) * width * 4];\n flippedPixels[x * 4 + 3 + y * width * 4] = pixels[x * 4 + 3 + (height - y) * width * 4];\n }\n }\n return flippedPixels;\n },\n\n /**\n * Download capture to file.\n */\n saveCapture: function () {\n this.canvas.toBlob(function (blob) {\n var fileName = 'screenshot-' + document.title.toLowerCase() + '-' + Date.now() + '.png';\n var linkEl = document.createElement('a');\n var url = URL.createObjectURL(blob);\n linkEl.href = url;\n linkEl.setAttribute('download', fileName);\n linkEl.innerHTML = 'downloading...';\n linkEl.style.display = 'none';\n document.body.appendChild(linkEl);\n setTimeout(function () {\n linkEl.click();\n document.body.removeChild(linkEl);\n }, 1);\n }, 'image/png');\n }\n});\n","var registerComponent = require('../../core/component').registerComponent;\nvar RStats = require('../../../vendor/rStats');\nvar utils = require('../../utils');\nrequire('../../../vendor/rStats.extras');\nrequire('../../lib/rStatsAframe');\n\nvar AFrameStats = window.aframeStats;\nvar bind = utils.bind;\nvar HIDDEN_CLASS = 'a-hidden';\nvar ThreeStats = window.threeStats;\n\n/**\n * Stats appended to document.body by RStats.\n */\nmodule.exports.Component = registerComponent('stats', {\n schema: {default: true},\n\n init: function () {\n var scene = this.el;\n\n if (utils.getUrlParameter('stats') === 'false') { return; }\n\n this.stats = createStats(scene);\n this.statsEl = document.querySelector('.rs-base');\n\n this.hideBound = bind(this.hide, this);\n this.showBound = bind(this.show, this);\n\n scene.addEventListener('enter-vr', this.hideBound);\n scene.addEventListener('exit-vr', this.showBound);\n },\n\n update: function () {\n if (!this.stats) { return; }\n return (!this.data) ? this.hide() : this.show();\n },\n\n remove: function () {\n this.el.removeEventListener('enter-vr', this.hideBound);\n this.el.removeEventListener('exit-vr', this.showBound);\n if (!this.statsEl) { return; } // Scene detached.\n this.statsEl.parentNode.removeChild(this.statsEl);\n },\n\n tick: function () {\n var stats = this.stats;\n\n if (!stats) { return; }\n\n stats('rAF').tick();\n stats('FPS').frame();\n stats().update();\n },\n\n hide: function () {\n this.statsEl.classList.add(HIDDEN_CLASS);\n },\n\n show: function () {\n this.statsEl.classList.remove(HIDDEN_CLASS);\n }\n});\n\nfunction createStats (scene) {\n var threeStats = new ThreeStats(scene.renderer);\n var aframeStats = new AFrameStats(scene);\n var plugins = scene.isMobile ? [] : [threeStats, aframeStats];\n return new RStats({\n css: [], // Our stylesheet is injected from `src/index.js`.\n values: {\n fps: {caption: 'fps', below: 30}\n },\n groups: [\n {caption: 'Framerate', values: ['fps', 'raf']}\n ],\n plugins: plugins\n });\n}\n","var registerComponent = require('../../core/component').registerComponent;\nvar constants = require('../../constants/');\nvar utils = require('../../utils/');\nvar bind = utils.bind;\n\nvar ENTER_VR_CLASS = 'a-enter-vr';\nvar ENTER_AR_CLASS = 'a-enter-ar';\nvar ENTER_VR_BTN_CLASS = 'a-enter-vr-button';\nvar ENTER_AR_BTN_CLASS = 'a-enter-ar-button';\nvar HIDDEN_CLASS = 'a-hidden';\nvar ORIENTATION_MODAL_CLASS = 'a-orientation-modal';\n\n/**\n * UI for entering VR mode.\n */\nmodule.exports.Component = registerComponent('vr-mode-ui', {\n dependencies: ['canvas'],\n\n schema: {\n enabled: {default: true},\n enterVRButton: {default: ''},\n enterARButton: {default: ''}\n },\n\n init: function () {\n var self = this;\n var sceneEl = this.el;\n\n if (utils.getUrlParameter('ui') === 'false') { return; }\n\n this.insideLoader = false;\n this.enterVREl = null;\n this.enterAREl = null;\n this.orientationModalEl = null;\n this.bindMethods();\n\n // Hide/show VR UI when entering/exiting VR mode.\n sceneEl.addEventListener('enter-vr', this.updateEnterInterfaces);\n sceneEl.addEventListener('exit-vr', this.updateEnterInterfaces);\n sceneEl.addEventListener('update-vr-devices', this.updateEnterInterfaces);\n\n window.addEventListener('message', function (event) {\n if (event.data.type === 'loaderReady') {\n self.insideLoader = true;\n self.remove();\n }\n });\n\n // Modal that tells the user to change orientation if in portrait.\n window.addEventListener('orientationchange', this.toggleOrientationModalIfNeeded);\n },\n\n bindMethods: function () {\n this.onEnterVRButtonClick = bind(this.onEnterVRButtonClick, this);\n this.onEnterARButtonClick = bind(this.onEnterARButtonClick, this);\n this.onModalClick = bind(this.onModalClick, this);\n this.toggleOrientationModalIfNeeded = bind(this.toggleOrientationModalIfNeeded, this);\n this.updateEnterInterfaces = bind(this.updateEnterInterfaces, this);\n },\n\n /**\n * Exit VR when modal clicked.\n */\n onModalClick: function () {\n this.el.exitVR();\n },\n\n /**\n * Enter VR when clicked.\n */\n onEnterVRButtonClick: function () {\n this.el.enterVR();\n },\n\n /**\n * Enter AR when clicked.\n */\n onEnterARButtonClick: function () {\n this.el.enterAR();\n },\n\n update: function () {\n var data = this.data;\n var sceneEl = this.el;\n\n if (!data.enabled || this.insideLoader || utils.getUrlParameter('ui') === 'false') {\n return this.remove();\n }\n\n if (this.enterVREl || this.enterAREl || this.orientationModalEl) { return; }\n\n // Add UI if enabled and not already present.\n if (data.enterVRButton) {\n // Custom button.\n this.enterVREl = document.querySelector(data.enterVRButton);\n this.enterVREl.addEventListener('click', this.onEnterVRButtonClick);\n } else {\n this.enterVREl = createEnterVRButton(this.onEnterVRButtonClick);\n sceneEl.appendChild(this.enterVREl);\n }\n if (data.enterARButton) {\n // Custom button.\n this.enterAREl = document.querySelector(data.enterARButton);\n this.enterAREl.addEventListener('click', this.onEnterARButtonClick);\n } else {\n this.enterAREl = createEnterARButton(this.onEnterARButtonClick);\n sceneEl.appendChild(this.enterAREl);\n }\n\n this.orientationModalEl = createOrientationModal(this.onModalClick);\n sceneEl.appendChild(this.orientationModalEl);\n\n this.updateEnterInterfaces();\n },\n\n remove: function () {\n [this.enterVREl, this.enterAREl, this.orientationModalEl].forEach(function (uiElement) {\n if (uiElement && uiElement.parentNode) {\n uiElement.parentNode.removeChild(uiElement);\n }\n });\n this.enterVREl = undefined;\n this.enterAREl = undefined;\n this.orientationModalEl = undefined;\n },\n\n updateEnterInterfaces: function () {\n this.toggleEnterVRButtonIfNeeded();\n this.toggleEnterARButtonIfNeeded();\n this.toggleOrientationModalIfNeeded();\n },\n\n toggleEnterVRButtonIfNeeded: function () {\n var sceneEl = this.el;\n if (!this.enterVREl) { return; }\n if (sceneEl.is('vr-mode')) {\n this.enterVREl.classList.add(HIDDEN_CLASS);\n } else {\n this.enterVREl.classList.remove(HIDDEN_CLASS);\n }\n },\n\n toggleEnterARButtonIfNeeded: function () {\n var sceneEl = this.el;\n if (!this.enterAREl) { return; }\n // Hide the button while in a session, or if AR is not supported.\n if (sceneEl.is('vr-mode') || !utils.device.checkARSupport()) {\n this.enterAREl.classList.add(HIDDEN_CLASS);\n } else {\n this.enterAREl.classList.remove(HIDDEN_CLASS);\n }\n },\n\n toggleOrientationModalIfNeeded: function () {\n var sceneEl = this.el;\n var orientationModalEl = this.orientationModalEl;\n if (!orientationModalEl || !sceneEl.isMobile) { return; }\n if (!utils.device.isLandscape() && sceneEl.is('vr-mode')) {\n // Show if in VR mode on portrait.\n orientationModalEl.classList.remove(HIDDEN_CLASS);\n } else {\n orientationModalEl.classList.add(HIDDEN_CLASS);\n }\n }\n});\n\n/**\n * Create a button that when clicked will enter into stereo-rendering mode for VR.\n *\n * Structure: <div><button></div>\n *\n * @param {function} onClick - click event handler\n * @returns {Element} Wrapper <div>.\n */\nfunction createEnterVRButton (onClick) {\n var vrButton;\n var wrapper;\n\n // Create elements.\n wrapper = document.createElement('div');\n wrapper.classList.add(ENTER_VR_CLASS);\n wrapper.setAttribute(constants.AFRAME_INJECTED, '');\n vrButton = document.createElement('button');\n vrButton.className = ENTER_VR_BTN_CLASS;\n vrButton.setAttribute('title',\n 'Enter VR mode with a headset or fullscreen mode on a desktop. ' +\n 'Visit https://webvr.rocks or https://webvr.info for more information.');\n vrButton.setAttribute(constants.AFRAME_INJECTED, '');\n if (utils.device.isMobile()) { applyStickyHoverFix(vrButton); }\n // Insert elements.\n wrapper.appendChild(vrButton);\n vrButton.addEventListener('click', function (evt) {\n onClick();\n evt.stopPropagation();\n });\n return wrapper;\n}\n\n/**\n * Create a button that when clicked will enter into AR mode\n *\n * Structure: <div><button></div>\n *\n * @param {function} onClick - click event handler\n * @returns {Element} Wrapper <div>.\n */\nfunction createEnterARButton (onClick) {\n var arButton;\n var wrapper;\n\n // Create elements.\n wrapper = document.createElement('div');\n wrapper.classList.add(ENTER_AR_CLASS);\n wrapper.setAttribute(constants.AFRAME_INJECTED, '');\n arButton = document.createElement('button');\n arButton.className = ENTER_AR_BTN_CLASS;\n arButton.setAttribute('title',\n 'Enter AR mode with a headset or handheld device. ' +\n 'Visit https://webvr.rocks or https://webvr.info for more information.');\n arButton.setAttribute(constants.AFRAME_INJECTED, '');\n if (utils.device.isMobile()) { applyStickyHoverFix(arButton); }\n // Insert elements.\n wrapper.appendChild(arButton);\n arButton.addEventListener('click', function (evt) {\n onClick();\n evt.stopPropagation();\n });\n return wrapper;\n}\n\n/**\n * Creates a modal dialog to request the user to switch to landscape orientation.\n *\n * @param {function} onClick - click event handler\n * @returns {Element} Wrapper <div>.\n */\nfunction createOrientationModal (onClick) {\n var modal = document.createElement('div');\n modal.className = ORIENTATION_MODAL_CLASS;\n modal.classList.add(HIDDEN_CLASS);\n modal.setAttribute(constants.AFRAME_INJECTED, '');\n\n var exit = document.createElement('button');\n exit.setAttribute(constants.AFRAME_INJECTED, '');\n exit.innerHTML = 'Exit VR';\n\n // Exit VR on close.\n exit.addEventListener('click', onClick);\n\n modal.appendChild(exit);\n\n return modal;\n}\n\n/**\n * CSS hover state is sticky in iOS (as in 12/18/2019)\n * They are not removed on mouseleave and this function applies a class\n * to resets the style.\n *\n * @param {function} buttonEl - Button element\n */\nfunction applyStickyHoverFix (buttonEl) {\n buttonEl.addEventListener('touchstart', function () {\n buttonEl.classList.remove('resethover');\n });\n buttonEl.addEventListener('touchend', function () {\n buttonEl.classList.add('resethover');\n });\n}\n","var component = require('../core/component');\nvar THREE = require('../lib/three');\nvar bind = require('../utils/bind');\nvar registerComponent = component.registerComponent;\n\n/**\n * Shadow component.\n *\n * When applied to an entity, that entity's geometry and any descendants will cast or receive\n * shadows as specified by the `cast` and `receive` properties.\n */\nmodule.exports.Component = registerComponent('shadow', {\n schema: {\n cast: {default: true},\n receive: {default: true}\n },\n\n init: function () {\n this.onMeshChanged = bind(this.update, this);\n this.el.addEventListener('object3dset', this.onMeshChanged);\n this.system.setShadowMapEnabled(true);\n },\n\n update: function () {\n var data = this.data;\n this.updateDescendants(data.cast, data.receive);\n },\n\n remove: function () {\n var el = this.el;\n el.removeEventListener('object3dset', this.onMeshChanged);\n this.updateDescendants(false, false);\n },\n\n updateDescendants: function (cast, receive) {\n var sceneEl = this.el.sceneEl;\n this.el.object3D.traverse(function (node) {\n if (!(node instanceof THREE.Mesh)) { return; }\n\n node.castShadow = cast;\n node.receiveShadow = receive;\n\n // If scene has already rendered, materials must be updated.\n if (sceneEl.hasLoaded && node.material) {\n var materials = Array.isArray(node.material) ? node.material : [node.material];\n for (var i = 0; i < materials.length; i++) {\n materials[i].needsUpdate = true;\n }\n }\n });\n }\n});\n","var registerComponent = require('../core/component').registerComponent;\nvar debug = require('../utils/debug');\nvar THREE = require('../lib/three');\n\nvar warn = debug('components:sound:warn');\n\n/**\n * Sound component.\n */\nmodule.exports.Component = registerComponent('sound', {\n schema: {\n autoplay: {default: false},\n distanceModel: {default: 'inverse', oneOf: ['linear', 'inverse', 'exponential']},\n loop: {default: false},\n maxDistance: {default: 10000},\n on: {default: ''},\n poolSize: {default: 1},\n positional: {default: true},\n refDistance: {default: 1},\n rolloffFactor: {default: 1},\n src: {type: 'audio'},\n volume: {default: 1}\n },\n\n multiple: true,\n\n init: function () {\n var self = this;\n\n this.listener = null;\n this.audioLoader = new THREE.AudioLoader();\n this.pool = new THREE.Group();\n this.loaded = false;\n this.mustPlay = false;\n\n // Don't pass evt because playSound takes a function as parameter.\n this.playSoundBound = function () { self.playSound(); };\n },\n\n update: function (oldData) {\n var data = this.data;\n var i;\n var sound;\n var srcChanged = data.src !== oldData.src;\n\n // Create new sound if not yet created or changing `src`.\n if (srcChanged) {\n if (!data.src) { return; }\n this.setupSound();\n }\n\n for (i = 0; i < this.pool.children.length; i++) {\n sound = this.pool.children[i];\n if (data.positional) {\n sound.setDistanceModel(data.distanceModel);\n sound.setMaxDistance(data.maxDistance);\n sound.setRefDistance(data.refDistance);\n sound.setRolloffFactor(data.rolloffFactor);\n }\n sound.setLoop(data.loop);\n sound.setVolume(data.volume);\n sound.isPaused = false;\n }\n\n if (data.on !== oldData.on) {\n this.updateEventListener(oldData.on);\n }\n\n // All sound values set. Load in `src`.\n if (srcChanged) {\n var self = this;\n\n this.loaded = false;\n this.audioLoader.load(data.src, function (buffer) {\n for (i = 0; i < self.pool.children.length; i++) {\n sound = self.pool.children[i];\n sound.setBuffer(buffer);\n }\n self.loaded = true;\n\n // Remove this key from cache, otherwise we can't play it again\n THREE.Cache.remove(data.src);\n if (self.data.autoplay || self.mustPlay) { self.playSound(); }\n self.el.emit('sound-loaded', self.evtDetail, false);\n });\n }\n },\n\n pause: function () {\n this.stopSound();\n this.removeEventListener();\n },\n\n play: function () {\n if (this.data.autoplay) { this.playSound(); }\n this.updateEventListener();\n },\n\n remove: function () {\n var i;\n var sound;\n\n this.removeEventListener();\n\n if (this.el.getObject3D(this.attrName)) {\n this.el.removeObject3D(this.attrName);\n }\n\n try {\n for (i = 0; i < this.pool.children.length; i++) {\n sound = this.pool.children[i];\n sound.disconnect();\n }\n } catch (e) {\n // disconnect() will throw if it was never connected initially.\n warn('Audio source not properly disconnected');\n }\n },\n\n /**\n * Update listener attached to the user defined on event.\n */\n updateEventListener: function (oldEvt) {\n var el = this.el;\n if (oldEvt) { el.removeEventListener(oldEvt, this.playSoundBound); }\n el.addEventListener(this.data.on, this.playSoundBound);\n },\n\n removeEventListener: function () {\n this.el.removeEventListener(this.data.on, this.playSoundBound);\n },\n\n /**\n * Removes current sound object, creates new sound object, adds to entity.\n *\n * @returns {object} sound\n */\n setupSound: function () {\n var el = this.el;\n var i;\n var sceneEl = el.sceneEl;\n var self = this;\n var sound;\n\n if (this.pool.children.length > 0) {\n this.stopSound();\n el.removeObject3D('sound');\n }\n\n // Only want one AudioListener. Cache it on the scene.\n var listener = this.listener = sceneEl.audioListener || new THREE.AudioListener();\n sceneEl.audioListener = listener;\n\n if (sceneEl.camera) {\n sceneEl.camera.add(listener);\n }\n\n // Wait for camera if necessary.\n sceneEl.addEventListener('camera-set-active', function (evt) {\n evt.detail.cameraEl.getObject3D('camera').add(listener);\n });\n\n // Create [poolSize] audio instances and attach them to pool\n this.pool = new THREE.Group();\n for (i = 0; i < this.data.poolSize; i++) {\n sound = this.data.positional\n ? new THREE.PositionalAudio(listener)\n : new THREE.Audio(listener);\n this.pool.add(sound);\n }\n el.setObject3D(this.attrName, this.pool);\n\n for (i = 0; i < this.pool.children.length; i++) {\n sound = this.pool.children[i];\n sound.onEnded = function () {\n this.isPlaying = false;\n self.el.emit('sound-ended', self.evtDetail, false);\n };\n }\n },\n\n /**\n * Pause all the sounds in the pool.\n */\n pauseSound: function () {\n var i;\n var sound;\n\n this.isPlaying = false;\n for (i = 0; i < this.pool.children.length; i++) {\n sound = this.pool.children[i];\n if (!sound.source || !sound.source.buffer || !sound.isPlaying || sound.isPaused) {\n continue;\n }\n sound.isPaused = true;\n sound.pause();\n }\n },\n\n /**\n * Look for an unused sound in the pool and play it if found.\n */\n playSound: function (processSound) {\n var found;\n var i;\n var sound;\n\n if (!this.loaded) {\n warn('Sound not loaded yet. It will be played once it finished loading');\n this.mustPlay = true;\n return;\n }\n\n found = false;\n this.isPlaying = true;\n for (i = 0; i < this.pool.children.length; i++) {\n sound = this.pool.children[i];\n if (!sound.isPlaying && sound.buffer && !found) {\n if (processSound) { processSound(sound); }\n sound.play();\n sound.isPaused = false;\n found = true;\n continue;\n }\n }\n\n if (!found) {\n warn('All the sounds are playing. If you need to play more sounds simultaneously ' +\n 'consider increasing the size of pool with the `poolSize` attribute.', this.el);\n return;\n }\n\n this.mustPlay = false;\n },\n\n /**\n * Stop all the sounds in the pool.\n */\n stopSound: function () {\n var i;\n var sound;\n this.isPlaying = false;\n for (i = 0; i < this.pool.children.length; i++) {\n sound = this.pool.children[i];\n if (!sound.source || !sound.source.buffer) { return; }\n sound.stop();\n }\n }\n});\n","var createTextGeometry = require('three-bmfont-text');\nvar loadBMFont = require('load-bmfont');\n\nvar registerComponent = require('../core/component').registerComponent;\nvar coreShader = require('../core/shader');\nvar THREE = require('../lib/three');\nvar utils = require('../utils/');\n\nvar error = utils.debug('components:text:error');\nvar shaders = coreShader.shaders;\nvar warn = utils.debug('components:text:warn');\n\n// 1 to match other A-Frame default widths.\nvar DEFAULT_WIDTH = 1;\n\n// @bryik set anisotropy to 16. Improves look of large amounts of text when viewed from angle.\nvar MAX_ANISOTROPY = 16;\n\nvar FONT_BASE_URL = 'https://cdn.aframe.io/fonts/';\nvar FONTS = {\n aileronsemibold: FONT_BASE_URL + 'Aileron-Semibold.fnt',\n dejavu: FONT_BASE_URL + 'DejaVu-sdf.fnt',\n exo2bold: FONT_BASE_URL + 'Exo2Bold.fnt',\n exo2semibold: FONT_BASE_URL + 'Exo2SemiBold.fnt',\n kelsonsans: FONT_BASE_URL + 'KelsonSans.fnt',\n monoid: FONT_BASE_URL + 'Monoid.fnt',\n mozillavr: FONT_BASE_URL + 'mozillavr.fnt',\n roboto: FONT_BASE_URL + 'Roboto-msdf.json',\n sourcecodepro: FONT_BASE_URL + 'SourceCodePro.fnt'\n};\nvar MSDF_FONTS = ['roboto'];\nvar DEFAULT_FONT = 'roboto';\nmodule.exports.FONTS = FONTS;\n\nvar cache = new PromiseCache();\nvar fontWidthFactors = {};\nvar textures = {};\n\n// Regular expression for detecting a URLs with a protocol prefix.\nvar protocolRe = /^\\w+:/;\n\n/**\n * SDF-based text component.\n * Based on https://github.com/Jam3/three-bmfont-text.\n *\n * All the stock fonts are for the `sdf` registered shader, an improved version of jam3's\n * original `sdf` shader.\n */\nmodule.exports.Component = registerComponent('text', {\n multiple: true,\n\n schema: {\n align: {type: 'string', default: 'left', oneOf: ['left', 'right', 'center']},\n alphaTest: {default: 0.5},\n // `anchor` defaults to center to match geometries.\n anchor: {default: 'center', oneOf: ['left', 'right', 'center', 'align']},\n baseline: {default: 'center', oneOf: ['top', 'center', 'bottom']},\n color: {type: 'color', default: '#FFF'},\n font: {type: 'string', default: DEFAULT_FONT},\n // `fontImage` defaults to the font name as a .png (e.g., mozillavr.fnt -> mozillavr.png).\n fontImage: {type: 'string'},\n // `height` has no default, will be populated at layout.\n height: {type: 'number'},\n letterSpacing: {type: 'number', default: 0},\n // `lineHeight` defaults to font's `lineHeight` value.\n lineHeight: {type: 'number'},\n // `negate` must be true for fonts generated with older versions of msdfgen (white background).\n negate: {type: 'boolean', default: true},\n opacity: {type: 'number', default: 1.0},\n shader: {default: 'sdf', oneOf: shaders},\n side: {default: 'front', oneOf: ['front', 'back', 'double']},\n tabSize: {default: 4},\n transparent: {default: true},\n value: {type: 'string'},\n whiteSpace: {default: 'normal', oneOf: ['normal', 'pre', 'nowrap']},\n // `width` defaults to geometry width if present, else `DEFAULT_WIDTH`.\n width: {type: 'number'},\n // `wrapCount` units are about one default font character. Wrap roughly at this number.\n wrapCount: {type: 'number', default: 40},\n // `wrapPixels` will wrap using bmfont pixel units (e.g., dejavu's is 32 pixels).\n wrapPixels: {type: 'number'},\n // `xOffset` to add padding.\n xOffset: {type: 'number', default: 0},\n // `yOffset` to adjust generated fonts from tools that may have incorrect metrics.\n yOffset: {type: 'number', default: 0},\n // `zOffset` will provide a small z offset to avoid z-fighting.\n zOffset: {type: 'number', default: 0.001}\n },\n\n init: function () {\n this.shaderData = {};\n this.geometry = createTextGeometry();\n this.createOrUpdateMaterial();\n },\n\n update: function (oldData) {\n var data = this.data;\n var font = this.currentFont;\n if (textures[data.font]) {\n this.texture = textures[data.font];\n } else {\n // Create texture per font.\n this.texture = textures[data.font] = new THREE.Texture();\n this.texture.anisotropy = MAX_ANISOTROPY;\n }\n\n // Update material.\n this.createOrUpdateMaterial();\n\n // New font. `updateFont` will later change data and layout.\n if (oldData.font !== data.font) {\n this.updateFont();\n return;\n }\n\n // Update geometry and layout.\n if (font) {\n this.updateGeometry(this.geometry, font);\n this.updateLayout();\n }\n },\n\n /**\n * Clean up geometry, material, texture, mesh, objects.\n */\n remove: function () {\n this.geometry.dispose();\n this.geometry = null;\n this.el.removeObject3D(this.attrName);\n this.material.dispose();\n this.material = null;\n this.texture.dispose();\n this.texture = null;\n if (this.shaderObject) { delete this.shaderObject; }\n },\n\n /**\n * Update the shader of the material.\n */\n createOrUpdateMaterial: function () {\n var data = this.data;\n var hasChangedShader;\n var material = this.material;\n var NewShader;\n var shaderData = this.shaderData;\n var shaderName;\n\n // Infer shader if using a stock font (or from `-msdf` filename convention).\n shaderName = data.shader;\n if (MSDF_FONTS.indexOf(data.font) !== -1 || data.font.indexOf('-msdf.') >= 0) {\n shaderName = 'msdf';\n } else if (data.font in FONTS && MSDF_FONTS.indexOf(data.font) === -1) {\n shaderName = 'sdf';\n }\n\n hasChangedShader = (this.shaderObject && this.shaderObject.name) !== shaderName;\n\n shaderData.alphaTest = data.alphaTest;\n shaderData.color = data.color;\n shaderData.map = this.texture;\n shaderData.opacity = data.opacity;\n shaderData.side = parseSide(data.side);\n shaderData.transparent = data.transparent;\n shaderData.negate = data.negate;\n\n // Shader has not changed, do an update.\n if (!hasChangedShader) {\n // Update shader material.\n this.shaderObject.update(shaderData);\n // Apparently, was not set on `init` nor `update`.\n material.transparent = shaderData.transparent;\n material.side = shaderData.side;\n return;\n }\n\n // Shader has changed. Create a shader material.\n NewShader = createShader(this.el, shaderName, shaderData);\n this.material = NewShader.material;\n this.shaderObject = NewShader.shader;\n\n // Set new shader material.\n this.material.side = shaderData.side;\n if (this.mesh) { this.mesh.material = this.material; }\n },\n\n /**\n * Load font for geometry, load font image for material, and apply.\n */\n updateFont: function () {\n var data = this.data;\n var el = this.el;\n var fontSrc;\n var geometry = this.geometry;\n var self = this;\n\n if (!data.font) { warn('No font specified. Using the default font.'); }\n\n // Make invisible during font swap.\n if (this.mesh) { this.mesh.visible = false; }\n\n // Look up font URL to use, and perform cached load.\n fontSrc = this.lookupFont(data.font || DEFAULT_FONT) || data.font;\n cache.get(fontSrc, function doLoadFont () {\n return loadFont(fontSrc, data.yOffset);\n }).then(function setFont (font) {\n var fontImgSrc;\n\n if (font.pages.length !== 1) {\n throw new Error('Currently only single-page bitmap fonts are supported.');\n }\n\n if (!fontWidthFactors[fontSrc]) {\n font.widthFactor = fontWidthFactors[font] = computeFontWidthFactor(font);\n }\n self.currentFont = font;\n // Look up font image URL to use, and perform cached load.\n fontImgSrc = self.getFontImageSrc();\n cache.get(fontImgSrc, function () {\n return loadTexture(fontImgSrc);\n }).then(function (image) {\n // Make mesh visible and apply font image as texture.\n var texture = self.texture;\n texture.image = image;\n texture.needsUpdate = true;\n textures[data.font] = texture;\n self.texture = texture;\n self.initMesh();\n self.currentFont = font;\n // Update geometry given font metrics.\n self.updateGeometry(geometry, font);\n self.updateLayout();\n self.mesh.visible = true;\n el.emit('textfontset', {font: data.font, fontObj: font});\n }).catch(function (err) {\n error(err.message);\n error(err.stack);\n });\n }).catch(function (err) {\n error(err.message);\n error(err.stack);\n });\n },\n\n initMesh: function () {\n if (this.mesh) { return; }\n this.mesh = new THREE.Mesh(this.geometry, this.material);\n this.el.setObject3D(this.attrName, this.mesh);\n },\n\n getFontImageSrc: function () {\n if (this.data.fontImage) { return this.data.fontImage; }\n var fontSrc = this.lookupFont(this.data.font || DEFAULT_FONT) || this.data.font;\n var imageSrc = this.currentFont.pages[0];\n // If the image URL contains a non-HTTP(S) protocol, assume it's an absolute\n // path on disk and try to infer the path from the font source instead.\n if (imageSrc.match(protocolRe) && imageSrc.indexOf('http') !== 0) {\n return fontSrc.replace(/(\\.fnt)|(\\.json)/, '.png');\n }\n return THREE.LoaderUtils.extractUrlBase(fontSrc) + imageSrc;\n },\n\n /**\n * Update layout with anchor, alignment, baseline, and considering any meshes.\n */\n updateLayout: function () {\n var anchor;\n var baseline;\n var el = this.el;\n var data = this.data;\n var geometry = this.geometry;\n var geometryComponent;\n var height;\n var layout;\n var mesh = this.mesh;\n var textRenderWidth;\n var textScale;\n var width;\n var x;\n var y;\n\n if (!mesh || !geometry.layout) { return; }\n\n // Determine width to use (defined width, geometry's width, or default width).\n geometryComponent = el.getAttribute('geometry');\n width = data.width || (geometryComponent && geometryComponent.width) || DEFAULT_WIDTH;\n\n // Determine wrap pixel count. Either specified or by experimental fudge factor.\n // Note that experimental factor will never be correct for variable width fonts.\n textRenderWidth = computeWidth(data.wrapPixels, data.wrapCount,\n this.currentFont.widthFactor);\n textScale = width / textRenderWidth;\n\n // Determine height to use.\n layout = geometry.layout;\n height = textScale * (layout.height + layout.descender);\n\n // Update geometry dimensions to match text layout if width and height are set to 0.\n // For example, scales a plane to fit text.\n if (geometryComponent && geometryComponent.primitive === 'plane') {\n if (!geometryComponent.width) { el.setAttribute('geometry', 'width', width); }\n if (!geometryComponent.height) { el.setAttribute('geometry', 'height', height); }\n }\n\n // Calculate X position to anchor text left, center, or right.\n anchor = data.anchor === 'align' ? data.align : data.anchor;\n if (anchor === 'left') {\n x = 0;\n } else if (anchor === 'right') {\n x = -1 * layout.width;\n } else if (anchor === 'center') {\n x = -1 * layout.width / 2;\n } else {\n throw new TypeError('Invalid text.anchor property value', anchor);\n }\n\n // Calculate Y position to anchor text top, center, or bottom.\n baseline = data.baseline;\n if (baseline === 'bottom') {\n y = 0;\n } else if (baseline === 'top') {\n y = -1 * layout.height + layout.ascender;\n } else if (baseline === 'center') {\n y = -1 * layout.height / 2;\n } else {\n throw new TypeError('Invalid text.baseline property value', baseline);\n }\n\n // Position and scale mesh to apply layout.\n mesh.position.x = x * textScale + data.xOffset;\n mesh.position.y = y * textScale;\n // Place text slightly in front to avoid Z-fighting.\n mesh.position.z = data.zOffset;\n mesh.scale.set(textScale, -1 * textScale, textScale);\n },\n\n /**\n * Grab font from the constant.\n * Set as a method for test stubbing purposes.\n */\n lookupFont: function (key) {\n return FONTS[key];\n },\n\n /**\n * Update the text geometry using `three-bmfont-text.update`.\n */\n updateGeometry: (function () {\n var geometryUpdateBase = {};\n var geometryUpdateData = {};\n var newLineRegex = /\\\\n/g;\n var tabRegex = /\\\\t/g;\n\n return function (geometry, font) {\n var data = this.data;\n\n geometryUpdateData.font = font;\n geometryUpdateData.lineHeight = data.lineHeight && isFinite(data.lineHeight)\n ? data.lineHeight\n : font.common.lineHeight;\n geometryUpdateData.text = data.value.toString().replace(newLineRegex, '\\n')\n .replace(tabRegex, '\\t');\n geometryUpdateData.width = computeWidth(data.wrapPixels, data.wrapCount,\n font.widthFactor);\n geometry.update(utils.extend(geometryUpdateBase, data, geometryUpdateData));\n };\n })()\n});\n\n/**\n * Due to using negative scale, we return the opposite side specified.\n * https://github.com/mrdoob/three.js/pull/12787/\n */\nfunction parseSide (side) {\n switch (side) {\n case 'back': {\n return THREE.FrontSide;\n }\n case 'double': {\n return THREE.DoubleSide;\n }\n default: {\n return THREE.BackSide;\n }\n }\n}\n\n/**\n * @returns {Promise}\n */\nfunction loadFont (src, yOffset) {\n return new Promise(function (resolve, reject) {\n loadBMFont(src, function (err, font) {\n if (err) {\n error('Error loading font', src);\n reject(err);\n return;\n }\n\n // Fix negative Y offsets for Roboto MSDF font from tool. Experimentally determined.\n if (src.indexOf('/Roboto-msdf.json') >= 0) { yOffset = 30; }\n if (yOffset) { font.chars.map(function doOffset (ch) { ch.yoffset += yOffset; }); }\n\n resolve(font);\n });\n });\n}\n\n/**\n * @returns {Promise}\n */\nfunction loadTexture (src) {\n return new Promise(function (resolve, reject) {\n new THREE.ImageLoader().load(src, function (image) {\n resolve(image);\n }, undefined, function () {\n error('Error loading font image', src);\n reject(null);\n });\n });\n}\n\nfunction createShader (el, shaderName, data) {\n var shader;\n var shaderObject;\n\n // Set up Shader.\n shaderObject = new shaders[shaderName].Shader();\n shaderObject.el = el;\n shaderObject.init(data);\n shaderObject.update(data);\n\n // Get material.\n shader = shaderObject.material;\n // Apparently, was not set on `init` nor `update`.\n shader.transparent = data.transparent;\n\n return {\n material: shader,\n shader: shaderObject\n };\n}\n\n/**\n * Determine wrap pixel count. Either specified or by experimental fudge factor.\n * Note that experimental factor will never be correct for variable width fonts.\n */\nfunction computeWidth (wrapPixels, wrapCount, widthFactor) {\n return wrapPixels || ((0.5 + wrapCount) * widthFactor);\n}\n\n/**\n * Compute default font width factor to use.\n */\nfunction computeFontWidthFactor (font) {\n var sum = 0;\n var digitsum = 0;\n var digits = 0;\n font.chars.map(function (ch) {\n sum += ch.xadvance;\n if (ch.id >= 48 && ch.id <= 57) {\n digits++;\n digitsum += ch.xadvance;\n }\n });\n return digits ? digitsum / digits : sum / font.chars.length;\n}\n\n/**\n * Get or create a promise given a key and promise generator.\n * @todo Move to a utility and use in other parts of A-Frame.\n */\nfunction PromiseCache () {\n var cache = this.cache = {};\n\n this.get = function (key, promiseGenerator) {\n if (key in cache) {\n return cache[key];\n }\n cache[key] = promiseGenerator();\n return cache[key];\n };\n}\n","var registerComponent = require('../core/component').registerComponent;\nvar controllerUtils = require('../utils/tracked-controls');\nvar DEFAULT_CAMERA_HEIGHT = require('../constants').DEFAULT_CAMERA_HEIGHT;\nvar THREE = require('../lib/three');\n\nvar DEFAULT_HANDEDNESS = require('../constants').DEFAULT_HANDEDNESS;\n// Vector from eyes to elbow (divided by user height).\nvar EYES_TO_ELBOW = {x: 0.175, y: -0.3, z: -0.03};\n// Vector from eyes to elbow (divided by user height).\nvar FOREARM = {x: 0, y: 0, z: -0.175};\n\n// Due to unfortunate name collision, add empty touches array to avoid Daydream error.\nvar EMPTY_DAYDREAM_TOUCHES = {touches: []};\n\nvar EVENTS = {\n AXISMOVE: 'axismove',\n BUTTONCHANGED: 'buttonchanged',\n BUTTONDOWN: 'buttondown',\n BUTTONUP: 'buttonup',\n TOUCHSTART: 'touchstart',\n TOUCHEND: 'touchend'\n};\n\n/**\n * Tracked controls component.\n * Wrap the gamepad API for pose and button states.\n * Select the appropriate controller and apply pose to the entity.\n * Observe button states and emit appropriate events.\n *\n * @property {number} controller - Index of controller in array returned by Gamepad API.\n * Only used if hand property is not set.\n * @property {string} id - Selected controller among those returned by Gamepad API.\n * @property {number} hand - If multiple controllers found with id, choose the one with the\n * given value for hand. If set, we ignore 'controller' property\n */\nmodule.exports.Component = registerComponent('tracked-controls-webvr', {\n schema: {\n autoHide: {default: true},\n controller: {default: 0},\n id: {type: 'string', default: ''},\n hand: {type: 'string', default: ''},\n idPrefix: {type: 'string', default: ''},\n orientationOffset: {type: 'vec3'},\n // Arm model parameters when not 6DoF.\n armModel: {default: false},\n headElement: {type: 'selector'}\n },\n\n init: function () {\n // Copy variables back to tracked-controls for backwards compatibility.\n // Some 3rd components rely on them.\n this.axis = this.el.components['tracked-controls'].axis = [0, 0, 0];\n this.buttonStates = this.el.components['tracked-controls'].buttonStates = {};\n this.changedAxes = [];\n this.targetControllerNumber = this.data.controller;\n\n this.axisMoveEventDetail = {axis: this.axis, changed: this.changedAxes};\n this.deltaControllerPosition = new THREE.Vector3();\n this.controllerQuaternion = new THREE.Quaternion();\n this.controllerEuler = new THREE.Euler();\n\n this.updateGamepad();\n\n this.buttonEventDetails = {};\n },\n\n tick: function (time, delta) {\n var mesh = this.el.getObject3D('mesh');\n // Update mesh animations.\n if (mesh && mesh.update) { mesh.update(delta / 1000); }\n this.updateGamepad();\n this.updatePose();\n this.updateButtons();\n },\n\n /**\n * Return default user height to use for non-6DOF arm model.\n */\n defaultUserHeight: function () {\n return DEFAULT_CAMERA_HEIGHT;\n },\n\n /**\n * Return head element to use for non-6DOF arm model.\n */\n getHeadElement: function () {\n return this.data.headElement || this.el.sceneEl.camera.el;\n },\n\n /**\n * Handle update controller match criteria (such as `id`, `idPrefix`, `hand`, `controller`)\n */\n updateGamepad: function () {\n var data = this.data;\n var controller = controllerUtils.findMatchingControllerWebVR(\n this.system.controllers,\n data.id,\n data.idPrefix,\n data.hand,\n data.controller\n );\n\n this.controller = controller;\n // Legacy handle to the controller for old components.\n this.el.components['tracked-controls'].controller = controller;\n\n if (this.data.autoHide) { this.el.object3D.visible = !!this.controller; }\n },\n\n /**\n * Applies an artificial arm model to simulate elbow to wrist positioning\n * based on the orientation of the controller.\n *\n * @param {object} controllerPosition - Existing vector to update with controller position.\n */\n applyArmModel: function (controllerPosition) {\n // Use controllerPosition and deltaControllerPosition to avoid creating variables.\n var controller = this.controller;\n var controllerEuler = this.controllerEuler;\n var controllerQuaternion = this.controllerQuaternion;\n var deltaControllerPosition = this.deltaControllerPosition;\n var hand;\n var headEl;\n var headObject3D;\n var pose;\n var userHeight;\n\n headEl = this.getHeadElement();\n headObject3D = headEl.object3D;\n userHeight = this.defaultUserHeight();\n\n pose = controller.pose;\n hand = (controller ? controller.hand : undefined) || DEFAULT_HANDEDNESS;\n\n // Use camera position as head position.\n controllerPosition.copy(headObject3D.position);\n // Set offset for degenerate \"arm model\" to elbow.\n deltaControllerPosition.set(\n EYES_TO_ELBOW.x * (hand === 'left' ? -1 : hand === 'right' ? 1 : 0),\n EYES_TO_ELBOW.y, // Lower than our eyes.\n EYES_TO_ELBOW.z); // Slightly out in front.\n // Scale offset by user height.\n deltaControllerPosition.multiplyScalar(userHeight);\n // Apply camera Y rotation (not X or Z, so you can look down at your hand).\n deltaControllerPosition.applyAxisAngle(headObject3D.up, headObject3D.rotation.y);\n // Apply rotated offset to position.\n controllerPosition.add(deltaControllerPosition);\n\n // Set offset for degenerate \"arm model\" forearm. Forearm sticking out from elbow.\n deltaControllerPosition.set(FOREARM.x, FOREARM.y, FOREARM.z);\n // Scale offset by user height.\n deltaControllerPosition.multiplyScalar(userHeight);\n // Apply controller X/Y rotation (tilting up/down/left/right is usually moving the arm).\n if (pose.orientation) {\n controllerQuaternion.fromArray(pose.orientation);\n } else {\n controllerQuaternion.copy(headObject3D.quaternion);\n }\n controllerEuler.setFromQuaternion(controllerQuaternion);\n controllerEuler.set(controllerEuler.x, controllerEuler.y, 0);\n deltaControllerPosition.applyEuler(controllerEuler);\n // Apply rotated offset to position.\n controllerPosition.add(deltaControllerPosition);\n },\n\n /**\n * Read pose from controller (from Gamepad API), apply transforms, apply to entity.\n */\n updatePose: function () {\n var controller = this.controller;\n var data = this.data;\n var object3D = this.el.object3D;\n var pose;\n var vrDisplay = this.system.vrDisplay;\n var standingMatrix;\n\n if (!controller) { return; }\n\n // Compose pose from Gamepad.\n pose = controller.pose;\n\n if (pose.position) {\n object3D.position.fromArray(pose.position);\n } else {\n // Controller not 6DOF, apply arm model.\n if (data.armModel) { this.applyArmModel(object3D.position); }\n }\n\n if (pose.orientation) {\n object3D.quaternion.fromArray(pose.orientation);\n }\n\n // Apply transforms, if 6DOF and in VR.\n if (vrDisplay && pose.position) {\n standingMatrix = this.el.sceneEl.renderer.xr.getStandingMatrix();\n object3D.matrix.compose(object3D.position, object3D.quaternion, object3D.scale);\n object3D.matrix.multiplyMatrices(standingMatrix, object3D.matrix);\n object3D.matrix.decompose(object3D.position, object3D.quaternion, object3D.scale);\n }\n\n object3D.rotateX(this.data.orientationOffset.x * THREE.Math.DEG2RAD);\n object3D.rotateY(this.data.orientationOffset.y * THREE.Math.DEG2RAD);\n object3D.rotateZ(this.data.orientationOffset.z * THREE.Math.DEG2RAD);\n },\n\n /**\n * Handle button changes including axes, presses, touches, values.\n */\n updateButtons: function () {\n var buttonState;\n var controller = this.controller;\n var id;\n\n if (!controller) { return; }\n\n // Check every button.\n for (id = 0; id < controller.buttons.length; ++id) {\n // Initialize button state.\n if (!this.buttonStates[id]) {\n this.buttonStates[id] = {pressed: false, touched: false, value: 0};\n }\n if (!this.buttonEventDetails[id]) {\n this.buttonEventDetails[id] = {id: id, state: this.buttonStates[id]};\n }\n\n buttonState = controller.buttons[id];\n this.handleButton(id, buttonState);\n }\n // Check axes.\n this.handleAxes();\n },\n\n /**\n * Handle presses and touches for a single button.\n *\n * @param {number} id - Index of button in Gamepad button array.\n * @param {number} buttonState - Value of button state from 0 to 1.\n * @returns {boolean} Whether button has changed in any way.\n */\n handleButton: function (id, buttonState) {\n var changed;\n changed = this.handlePress(id, buttonState) |\n this.handleTouch(id, buttonState) |\n this.handleValue(id, buttonState);\n if (!changed) { return false; }\n this.el.emit(EVENTS.BUTTONCHANGED, this.buttonEventDetails[id], false);\n return true;\n },\n\n /**\n * An axis is an array of values from -1 (up, left) to 1 (down, right).\n * Compare each component of the axis to the previous value to determine change.\n *\n * @returns {boolean} Whether axes changed.\n */\n handleAxes: function () {\n var changed = false;\n var controllerAxes = this.controller.axes;\n var i;\n var previousAxis = this.axis;\n var changedAxes = this.changedAxes;\n\n // Check if axis changed.\n this.changedAxes.splice(0, this.changedAxes.length);\n for (i = 0; i < controllerAxes.length; ++i) {\n changedAxes.push(previousAxis[i] !== controllerAxes[i]);\n if (changedAxes[i]) { changed = true; }\n }\n if (!changed) { return false; }\n\n this.axis.splice(0, this.axis.length);\n for (i = 0; i < controllerAxes.length; i++) {\n this.axis.push(controllerAxes[i]);\n }\n this.el.emit(EVENTS.AXISMOVE, this.axisMoveEventDetail, false);\n return true;\n },\n\n /**\n * Determine whether a button press has occured and emit events as appropriate.\n *\n * @param {string} id - ID of the button to check.\n * @param {object} buttonState - State of the button to check.\n * @returns {boolean} Whether button press state changed.\n */\n handlePress: function (id, buttonState) {\n var evtName;\n var previousButtonState = this.buttonStates[id];\n\n // Not changed.\n if (buttonState.pressed === previousButtonState.pressed) { return false; }\n\n evtName = buttonState.pressed ? EVENTS.BUTTONDOWN : EVENTS.BUTTONUP;\n this.el.emit(evtName, this.buttonEventDetails[id], false);\n previousButtonState.pressed = buttonState.pressed;\n return true;\n },\n\n /**\n * Determine whether a button touch has occured and emit events as appropriate.\n *\n * @param {string} id - ID of the button to check.\n * @param {object} buttonState - State of the button to check.\n * @returns {boolean} Whether button touch state changed.\n */\n handleTouch: function (id, buttonState) {\n var evtName;\n var previousButtonState = this.buttonStates[id];\n\n // Not changed.\n if (buttonState.touched === previousButtonState.touched) { return false; }\n\n evtName = buttonState.touched ? EVENTS.TOUCHSTART : EVENTS.TOUCHEND;\n this.el.emit(evtName, this.buttonEventDetails[id], false, EMPTY_DAYDREAM_TOUCHES);\n previousButtonState.touched = buttonState.touched;\n return true;\n },\n\n /**\n * Determine whether a button value has changed.\n *\n * @param {string} id - Id of the button to check.\n * @param {object} buttonState - State of the button to check.\n * @returns {boolean} Whether button value changed.\n */\n handleValue: function (id, buttonState) {\n var previousButtonState = this.buttonStates[id];\n\n // Not changed.\n if (buttonState.value === previousButtonState.value) { return false; }\n\n previousButtonState.value = buttonState.value;\n return true;\n }\n});\n","var controllerUtils = require('../utils/tracked-controls');\nvar registerComponent = require('../core/component').registerComponent;\n\nvar EVENTS = {\n AXISMOVE: 'axismove',\n BUTTONCHANGED: 'buttonchanged',\n BUTTONDOWN: 'buttondown',\n BUTTONUP: 'buttonup',\n TOUCHSTART: 'touchstart',\n TOUCHEND: 'touchend'\n};\n\nmodule.exports.Component = registerComponent('tracked-controls-webxr', {\n schema: {\n id: {type: 'string', default: ''},\n hand: {type: 'string', default: ''},\n handTrackingEnabled: {default: false},\n index: {type: 'int', default: -1},\n iterateControllerProfiles: {default: false}\n },\n\n init: function () {\n this.updateController = this.updateController.bind(this);\n this.buttonEventDetails = {};\n this.buttonStates = this.el.components['tracked-controls'].buttonStates = {};\n this.axis = this.el.components['tracked-controls'].axis = [0, 0, 0];\n this.changedAxes = [];\n this.axisMoveEventDetail = {axis: this.axis, changed: this.changedAxes};\n },\n\n update: function () {\n this.updateController();\n },\n\n play: function () {\n var sceneEl = this.el.sceneEl;\n this.updateController();\n sceneEl.addEventListener('controllersupdated', this.updateController);\n },\n\n pause: function () {\n var sceneEl = this.el.sceneEl;\n sceneEl.removeEventListener('controllersupdated', this.updateController);\n },\n\n isControllerPresent: function (evt) {\n if (!this.controller || this.controller.gamepad) { return false; }\n if (evt.inputSource.handedness !== 'none' &&\n evt.inputSource.handedness !== this.data.hand) {\n return false;\n }\n return true;\n },\n\n /**\n * Handle update controller match criteria (such as `id`, `idPrefix`, `hand`, `controller`)\n */\n updateController: function () {\n this.controller = controllerUtils.findMatchingControllerWebXR(\n this.system.controllers,\n this.data.id,\n this.data.hand,\n this.data.index,\n this.data.iterateControllerProfiles,\n this.data.handTrackingEnabled\n );\n // Legacy handle to the controller for old components.\n this.el.components['tracked-controls'].controller = this.controller;\n if (this.data.autoHide) { this.el.object3D.visible = !!this.controller; }\n },\n\n tick: function () {\n var sceneEl = this.el.sceneEl;\n var controller = this.controller;\n var frame = sceneEl.frame;\n if (!controller || !sceneEl.frame || !this.system.referenceSpace) { return; }\n if (!controller.hand) {\n this.pose = frame.getPose(controller.targetRaySpace, this.system.referenceSpace);\n this.updatePose();\n this.updateButtons();\n }\n },\n\n updatePose: function () {\n var object3D = this.el.object3D;\n var pose = this.pose;\n if (!pose) { return; }\n object3D.matrix.elements = pose.transform.matrix;\n object3D.matrix.decompose(object3D.position, object3D.rotation, object3D.scale);\n },\n\n /**\n * Handle button changes including axes, presses, touches, values.\n */\n updateButtons: function () {\n var buttonState;\n var id;\n var controller = this.controller;\n var gamepad;\n if (!controller || !controller.gamepad) { return; }\n\n gamepad = controller.gamepad;\n // Check every button.\n for (id = 0; id < gamepad.buttons.length; ++id) {\n // Initialize button state.\n if (!this.buttonStates[id]) {\n this.buttonStates[id] = {pressed: false, touched: false, value: 0};\n }\n if (!this.buttonEventDetails[id]) {\n this.buttonEventDetails[id] = {id: id, state: this.buttonStates[id]};\n }\n\n buttonState = gamepad.buttons[id];\n this.handleButton(id, buttonState);\n }\n // Check axes.\n this.handleAxes();\n },\n\n /**\n * Handle presses and touches for a single button.\n *\n * @param {number} id - Index of button in Gamepad button array.\n * @param {number} buttonState - Value of button state from 0 to 1.\n * @returns {boolean} Whether button has changed in any way.\n */\n handleButton: function (id, buttonState) {\n var changed;\n changed = this.handlePress(id, buttonState) |\n this.handleTouch(id, buttonState) |\n this.handleValue(id, buttonState);\n if (!changed) { return false; }\n this.el.emit(EVENTS.BUTTONCHANGED, this.buttonEventDetails[id], false);\n return true;\n },\n\n /**\n * An axis is an array of values from -1 (up, left) to 1 (down, right).\n * Compare each component of the axis to the previous value to determine change.\n *\n * @returns {boolean} Whether axes changed.\n */\n handleAxes: function () {\n var changed = false;\n var controllerAxes = this.controller.gamepad.axes;\n var i;\n var previousAxis = this.axis;\n var changedAxes = this.changedAxes;\n\n // Check if axis changed.\n this.changedAxes.splice(0, this.changedAxes.length);\n for (i = 0; i < controllerAxes.length; ++i) {\n changedAxes.push(previousAxis[i] !== controllerAxes[i]);\n if (changedAxes[i]) { changed = true; }\n }\n if (!changed) { return false; }\n\n this.axis.splice(0, this.axis.length);\n for (i = 0; i < controllerAxes.length; i++) {\n this.axis.push(controllerAxes[i]);\n }\n this.el.emit(EVENTS.AXISMOVE, this.axisMoveEventDetail, false);\n return true;\n },\n\n /**\n * Determine whether a button press has occured and emit events as appropriate.\n *\n * @param {string} id - ID of the button to check.\n * @param {object} buttonState - State of the button to check.\n * @returns {boolean} Whether button press state changed.\n */\n handlePress: function (id, buttonState) {\n var evtName;\n var previousButtonState = this.buttonStates[id];\n\n // Not changed.\n if (buttonState.pressed === previousButtonState.pressed) { return false; }\n\n evtName = buttonState.pressed ? EVENTS.BUTTONDOWN : EVENTS.BUTTONUP;\n this.el.emit(evtName, this.buttonEventDetails[id], false);\n previousButtonState.pressed = buttonState.pressed;\n return true;\n },\n\n /**\n * Determine whether a button touch has occured and emit events as appropriate.\n *\n * @param {string} id - ID of the button to check.\n * @param {object} buttonState - State of the button to check.\n * @returns {boolean} Whether button touch state changed.\n */\n handleTouch: function (id, buttonState) {\n var evtName;\n var previousButtonState = this.buttonStates[id];\n\n // Not changed.\n if (buttonState.touched === previousButtonState.touched) { return false; }\n\n evtName = buttonState.touched ? EVENTS.TOUCHSTART : EVENTS.TOUCHEND;\n this.el.emit(evtName, this.buttonEventDetails[id], false);\n previousButtonState.touched = buttonState.touched;\n return true;\n },\n\n /**\n * Determine whether a button value has changed.\n *\n * @param {string} id - Id of the button to check.\n * @param {object} buttonState - State of the button to check.\n * @returns {boolean} Whether button value changed.\n */\n handleValue: function (id, buttonState) {\n var previousButtonState = this.buttonStates[id];\n\n // Not changed.\n if (buttonState.value === previousButtonState.value) { return false; }\n\n previousButtonState.value = buttonState.value;\n return true;\n }\n});\n","var registerComponent = require('../core/component').registerComponent;\n\n/**\n * Tracked controls.\n * Abstract controls that decide if the WebVR or WebXR version is going to be applied.\n *\n * @property {number} controller - Index of controller in array returned by Gamepad API.\n * Only used if hand property is not set.\n * @property {string} id - Selected controller among those returned by Gamepad API.\n * @property {number} hand - If multiple controllers found with id, choose the one with the\n * given value for hand. If set, we ignore 'controller' property\n */\nmodule.exports.Component = registerComponent('tracked-controls', {\n schema: {\n autoHide: {default: true},\n controller: {default: -1},\n id: {type: 'string', default: ''},\n hand: {type: 'string', default: ''},\n idPrefix: {type: 'string', default: ''},\n handTrackingEnabled: {default: false},\n orientationOffset: {type: 'vec3'},\n // Arm model parameters when not 6DoF.\n armModel: {default: false},\n headElement: {type: 'selector'},\n iterateControllerProfiles: {default: false}\n },\n\n update: function () {\n var data = this.data;\n var el = this.el;\n if (el.sceneEl.hasWebXR) {\n el.setAttribute('tracked-controls-webxr', {\n id: data.id,\n hand: data.hand,\n index: data.controller,\n iterateControllerProfiles: data.iterateControllerProfiles,\n handTrackingEnabled: data.handTrackingEnabled\n });\n } else {\n el.setAttribute('tracked-controls-webvr', data);\n }\n }\n});\n","var registerComponent = require('../core/component').registerComponent;\nvar bind = require('../utils/bind');\nvar THREE = require('../lib/three');\n\nvar trackedControlsUtils = require('../utils/tracked-controls');\nvar checkControllerPresentAndSetup = trackedControlsUtils.checkControllerPresentAndSetup;\nvar emitIfAxesChanged = trackedControlsUtils.emitIfAxesChanged;\nvar onButtonEvent = trackedControlsUtils.onButtonEvent;\n\nvar INDEX_CONTROLLER_MODEL_BASE_URL = 'https://cdn.aframe.io/controllers/valve/index/valve-index-';\nvar INDEX_CONTROLLER_MODEL_URL = {\n left: INDEX_CONTROLLER_MODEL_BASE_URL + 'left.glb',\n right: INDEX_CONTROLLER_MODEL_BASE_URL + 'right.glb'\n};\n\nvar GAMEPAD_ID_PREFIX = 'valve';\n\nvar isWebXRAvailable = require('../utils/').device.isWebXRAvailable;\n\nvar INDEX_CONTROLLER_POSITION_OFFSET_WEBVR = {\n left: {x: -0.00023692678902063457, y: 0.04724540367838371, z: -0.061959880395271096},\n right: {x: 0.002471558599671131, y: 0.055765208987076195, z: -0.061068168708348844}\n};\n\nvar INDEX_CONTROLLER_POSITION_OFFSET_WEBXR = {\n left: {x: 0, y: -0.05, z: 0.06},\n right: {x: 0, y: -0.05, z: 0.06}\n};\n\nvar INDEX_CONTROLLER_ROTATION_OFFSET_WEBVR = {\n left: {_x: 0.692295102620542, _y: -0.0627618864318427, _z: -0.06265893149611756, _order: 'XYZ'},\n right: {_x: 0.6484021229942998, _y: -0.032563619881892894, _z: -0.1327973171917482, _order: 'XYZ'}\n};\n\nvar INDEX_CONTROLLER_ROTATION_OFFSET_WEBXR = {\n left: {_x: Math.PI / 3, _y: 0, _z: 0, _order: 'XYZ'},\n right: {_x: Math.PI / 3, _y: 0, _z: 0, _order: 'XYZ'}\n};\n\nvar INDEX_CONTROLLER_ROTATION_OFFSET = isWebXRAvailable ? INDEX_CONTROLLER_ROTATION_OFFSET_WEBXR : INDEX_CONTROLLER_ROTATION_OFFSET_WEBVR;\n\nvar INDEX_CONTROLLER_POSITION_OFFSET = isWebXRAvailable ? INDEX_CONTROLLER_POSITION_OFFSET_WEBXR : INDEX_CONTROLLER_POSITION_OFFSET_WEBVR;\n/**\n * Vive controls.\n * Interface with Vive controllers and map Gamepad events to controller buttons:\n * trackpad, trigger, grip, menu, system\n * Load a controller model and highlight the pressed buttons.\n */\nmodule.exports.Component = registerComponent('valve-index-controls', {\n schema: {\n hand: {default: 'left'},\n buttonColor: {type: 'color', default: '#FAFAFA'}, // Off-white.\n buttonHighlightColor: {type: 'color', default: '#22D1EE'}, // Light blue.\n model: {default: true},\n orientationOffset: {type: 'vec3'}\n },\n\n mapping: {\n axes: {\n trackpad: [0, 1],\n thumbstick: [2, 3]\n },\n buttons: ['trigger', 'grip', 'trackpad', 'thumbstick', 'abutton']\n },\n\n init: function () {\n var self = this;\n this.controllerPresent = false;\n this.lastControllerCheck = 0;\n this.onButtonChanged = bind(this.onButtonChanged, this);\n this.onButtonDown = function (evt) { onButtonEvent(evt.detail.id, 'down', self); };\n this.onButtonUp = function (evt) { onButtonEvent(evt.detail.id, 'up', self); };\n this.onButtonTouchEnd = function (evt) { onButtonEvent(evt.detail.id, 'touchend', self); };\n this.onButtonTouchStart = function (evt) { onButtonEvent(evt.detail.id, 'touchstart', self); };\n this.previousButtonValues = {};\n this.rendererSystem = this.el.sceneEl.systems.renderer;\n\n this.bindMethods();\n },\n\n play: function () {\n this.checkIfControllerPresent();\n this.addControllersUpdateListener();\n },\n\n pause: function () {\n this.removeEventListeners();\n this.removeControllersUpdateListener();\n },\n\n bindMethods: function () {\n this.onModelLoaded = bind(this.onModelLoaded, this);\n this.onControllersUpdate = bind(this.onControllersUpdate, this);\n this.checkIfControllerPresent = bind(this.checkIfControllerPresent, this);\n this.removeControllersUpdateListener = bind(this.removeControllersUpdateListener, this);\n this.onAxisMoved = bind(this.onAxisMoved, this);\n },\n\n addEventListeners: function () {\n var el = this.el;\n el.addEventListener('buttonchanged', this.onButtonChanged);\n el.addEventListener('buttondown', this.onButtonDown);\n el.addEventListener('buttonup', this.onButtonUp);\n el.addEventListener('touchend', this.onButtonTouchEnd);\n el.addEventListener('touchstart', this.onButtonTouchStart);\n el.addEventListener('model-loaded', this.onModelLoaded);\n el.addEventListener('axismove', this.onAxisMoved);\n this.controllerEventsActive = true;\n },\n\n removeEventListeners: function () {\n var el = this.el;\n el.removeEventListener('buttonchanged', this.onButtonChanged);\n el.removeEventListener('buttondown', this.onButtonDown);\n el.removeEventListener('buttonup', this.onButtonUp);\n el.removeEventListener('touchend', this.onButtonTouchEnd);\n el.removeEventListener('touchstart', this.onButtonTouchStart);\n el.removeEventListener('model-loaded', this.onModelLoaded);\n el.removeEventListener('axismove', this.onAxisMoved);\n this.controllerEventsActive = false;\n },\n\n /**\n * Once OpenVR returns correct hand data in supporting browsers, we can use hand property.\n * var isPresent = checkControllerPresentAndSetup(this.el.sceneEl, GAMEPAD_ID_PREFIX,\n { hand: data.hand });\n * Until then, use hardcoded index.\n */\n checkIfControllerPresent: function () {\n var data = this.data;\n var controllerIndex = data.hand === 'right' ? 0 : data.hand === 'left' ? 1 : 2;\n checkControllerPresentAndSetup(this, GAMEPAD_ID_PREFIX, {index: controllerIndex, iterateControllerProfiles: true, hand: data.hand});\n },\n\n injectTrackedControls: function () {\n var el = this.el;\n var data = this.data;\n\n // If we have an OpenVR Gamepad, use the fixed mapping.\n el.setAttribute('tracked-controls', {\n idPrefix: GAMEPAD_ID_PREFIX,\n // Hand IDs: 1 = right, 0 = left, 2 = anything else.\n controller: data.hand === 'right' ? 1 : data.hand === 'left' ? 0 : 2,\n hand: data.hand,\n orientationOffset: data.orientationOffset\n });\n\n this.loadModel();\n },\n\n loadModel: function () {\n var data = this.data;\n if (!data.model) { return; }\n this.el.setAttribute('gltf-model', '' + INDEX_CONTROLLER_MODEL_URL[data.hand] + '');\n },\n\n addControllersUpdateListener: function () {\n this.el.sceneEl.addEventListener('controllersupdated', this.onControllersUpdate, false);\n },\n\n removeControllersUpdateListener: function () {\n this.el.sceneEl.removeEventListener('controllersupdated', this.onControllersUpdate, false);\n },\n\n onControllersUpdate: function () {\n this.checkIfControllerPresent();\n },\n\n /**\n * Rotate the trigger button based on how hard the trigger is pressed.\n */\n onButtonChanged: function (evt) {\n var button = this.mapping.buttons[evt.detail.id];\n var buttonMeshes = this.buttonMeshes;\n var analogValue;\n\n if (!button) { return; }\n\n if (button === 'trigger') {\n analogValue = evt.detail.state.value;\n // Update trigger rotation depending on button value.\n if (buttonMeshes && buttonMeshes.trigger) {\n buttonMeshes.trigger.rotation.x = this.triggerOriginalRotationX - analogValue * (Math.PI / 40);\n }\n }\n\n // Pass along changed event with button state, using button mapping for convenience.\n this.el.emit(button + 'changed', evt.detail.state);\n },\n\n onModelLoaded: function (evt) {\n var buttonMeshes;\n var controllerObject3D = evt.detail.model;\n var self = this;\n\n if (!this.data.model) { return; }\n\n // Store button meshes object to be able to change their colors.\n buttonMeshes = this.buttonMeshes = {};\n buttonMeshes.grip = {\n left: controllerObject3D.getObjectByName('leftgrip'),\n right: controllerObject3D.getObjectByName('rightgrip')\n };\n buttonMeshes.menu = controllerObject3D.getObjectByName('menubutton');\n buttonMeshes.system = controllerObject3D.getObjectByName('systembutton');\n buttonMeshes.trackpad = controllerObject3D.getObjectByName('touchpad');\n buttonMeshes.trigger = controllerObject3D.getObjectByName('trigger');\n this.triggerOriginalRotationX = buttonMeshes.trigger.rotation.x;\n\n // Set default colors.\n Object.keys(buttonMeshes).forEach(function (buttonName) {\n self.setButtonColor(buttonName, self.data.buttonColor);\n });\n\n // Offset pivot point.\n controllerObject3D.position.copy(INDEX_CONTROLLER_POSITION_OFFSET[this.data.hand]);\n controllerObject3D.rotation.copy(INDEX_CONTROLLER_ROTATION_OFFSET[this.data.hand]);\n\n this.el.emit('controllermodelready', {\n name: 'valve-index-controlls',\n model: this.data.model,\n rayOrigin: new THREE.Vector3(0, 0, 0)\n });\n },\n\n onAxisMoved: function (evt) {\n emitIfAxesChanged(this, this.mapping.axes, evt);\n },\n\n updateModel: function (buttonName, evtName) {\n var color;\n var isTouch;\n if (!this.data.model) { return; }\n\n isTouch = evtName.indexOf('touch') !== -1;\n // Don't change color for trackpad touch.\n if (isTouch) { return; }\n\n // Update colors.\n color = evtName === 'up' ? this.data.buttonColor : this.data.buttonHighlightColor;\n this.setButtonColor(buttonName, color);\n },\n setButtonColor: function (buttonName, color) {\n // TODO: The meshes aren't set up correctly now, skipping for the moment\n return;\n }\n});\n","var registerComponent = require('../core/component').registerComponent;\n\n/**\n * Visibility component.\n */\nmodule.exports.Component = registerComponent('visible', {\n schema: {default: true},\n\n update: function () {\n this.el.object3D.visible = this.data;\n }\n});\n","var registerComponent = require('../core/component').registerComponent;\nvar bind = require('../utils/bind');\n\nvar trackedControlsUtils = require('../utils/tracked-controls');\nvar checkControllerPresentAndSetup = trackedControlsUtils.checkControllerPresentAndSetup;\nvar emitIfAxesChanged = trackedControlsUtils.emitIfAxesChanged;\nvar onButtonEvent = trackedControlsUtils.onButtonEvent;\n\nvar VIVE_CONTROLLER_MODEL_OBJ_URL = 'https://cdn.aframe.io/controllers/vive/vr_controller_vive.obj';\nvar VIVE_CONTROLLER_MODEL_OBJ_MTL = 'https://cdn.aframe.io/controllers/vive/vr_controller_vive.mtl';\n\nvar isWebXRAvailable = require('../utils/').device.isWebXRAvailable;\n\nvar GAMEPAD_ID_WEBXR = 'htc-vive';\nvar GAMEPAD_ID_WEBVR = 'OpenVR ';\n\n// Prefix for Gen1 and Gen2 Oculus Touch Controllers.\nvar GAMEPAD_ID_PREFIX = isWebXRAvailable ? GAMEPAD_ID_WEBXR : GAMEPAD_ID_WEBVR;\n\n/**\n * Button IDs:\n * 0 - trackpad\n * 1 - trigger (intensity value from 0.5 to 1)\n * 2 - grip\n * 3 - menu (dispatch but better for menu options)\n * 4 - system (never dispatched on this layer)\n */\nvar INPUT_MAPPING_WEBVR = {\n axes: {trackpad: [0, 1]},\n buttons: ['trackpad', 'trigger', 'grip', 'menu', 'system']\n};\n\n/**\n * Button IDs:\n * 0 - trigger\n * 1 - squeeze\n * 2 - touchpad\n * 3 - none (dispatch but better for menu options)\n * 4 - menu (never dispatched on this layer)\n *\n * Axis:\n * 0 - touchpad x axis\n * 1 - touchpad y axis\n * Reference: https://github.com/immersive-web/webxr-input-profiles/blob/master/packages/registry/profiles/htc/htc-vive.json\n */\nvar INPUT_MAPPING_WEBXR = {\n axes: {thumbstick: [0, 1]},\n buttons: ['trigger', 'grip', 'trackpad', 'none', 'menu']\n};\n\nvar INPUT_MAPPING = isWebXRAvailable ? INPUT_MAPPING_WEBXR : INPUT_MAPPING_WEBVR;\n\n/**\n * Vive controls.\n * Interface with Vive controllers and map Gamepad events to controller buttons:\n * trackpad, trigger, grip, menu, system\n * Load a controller model and highlight the pressed buttons.\n */\nmodule.exports.Component = registerComponent('vive-controls', {\n schema: {\n hand: {default: 'left'},\n buttonColor: {type: 'color', default: '#FAFAFA'}, // Off-white.\n buttonHighlightColor: {type: 'color', default: '#22D1EE'}, // Light blue.\n model: {default: true},\n orientationOffset: {type: 'vec3'}\n },\n\n mapping: INPUT_MAPPING,\n\n init: function () {\n var self = this;\n this.controllerPresent = false;\n this.lastControllerCheck = 0;\n this.onButtonChanged = bind(this.onButtonChanged, this);\n this.onButtonDown = function (evt) { onButtonEvent(evt.detail.id, 'down', self); };\n this.onButtonUp = function (evt) { onButtonEvent(evt.detail.id, 'up', self); };\n this.onButtonTouchEnd = function (evt) { onButtonEvent(evt.detail.id, 'touchend', self); };\n this.onButtonTouchStart = function (evt) { onButtonEvent(evt.detail.id, 'touchstart', self); };\n this.previousButtonValues = {};\n this.rendererSystem = this.el.sceneEl.systems.renderer;\n\n this.bindMethods();\n },\n\n update: function () {\n var data = this.data;\n this.controllerIndex = data.hand === 'right' ? 0 : data.hand === 'left' ? 1 : 2;\n },\n\n play: function () {\n this.checkIfControllerPresent();\n this.addControllersUpdateListener();\n },\n\n pause: function () {\n this.removeEventListeners();\n this.removeControllersUpdateListener();\n },\n\n bindMethods: function () {\n this.onModelLoaded = bind(this.onModelLoaded, this);\n this.onControllersUpdate = bind(this.onControllersUpdate, this);\n this.checkIfControllerPresent = bind(this.checkIfControllerPresent, this);\n this.removeControllersUpdateListener = bind(this.removeControllersUpdateListener, this);\n this.onAxisMoved = bind(this.onAxisMoved, this);\n },\n\n addEventListeners: function () {\n var el = this.el;\n el.addEventListener('buttonchanged', this.onButtonChanged);\n el.addEventListener('buttondown', this.onButtonDown);\n el.addEventListener('buttonup', this.onButtonUp);\n el.addEventListener('touchend', this.onButtonTouchEnd);\n el.addEventListener('touchstart', this.onButtonTouchStart);\n el.addEventListener('model-loaded', this.onModelLoaded);\n el.addEventListener('axismove', this.onAxisMoved);\n this.controllerEventsActive = true;\n },\n\n removeEventListeners: function () {\n var el = this.el;\n el.removeEventListener('buttonchanged', this.onButtonChanged);\n el.removeEventListener('buttondown', this.onButtonDown);\n el.removeEventListener('buttonup', this.onButtonUp);\n el.removeEventListener('touchend', this.onButtonTouchEnd);\n el.removeEventListener('touchstart', this.onButtonTouchStart);\n el.removeEventListener('model-loaded', this.onModelLoaded);\n el.removeEventListener('axismove', this.onAxisMoved);\n this.controllerEventsActive = false;\n },\n\n /**\n * Once OpenVR returns correct hand data in supporting browsers, we can use hand property.\n * var isPresent = checkControllerPresentAndSetup(this.el.sceneEl, GAMEPAD_ID_PREFIX,\n { hand: data.hand });\n * Until then, use hardcoded index.\n */\n checkIfControllerPresent: function () {\n var data = this.data;\n checkControllerPresentAndSetup(this, GAMEPAD_ID_PREFIX, {index: this.controllerIndex, hand: data.hand});\n },\n\n injectTrackedControls: function () {\n var el = this.el;\n var data = this.data;\n\n // If we have an OpenVR Gamepad, use the fixed mapping.\n el.setAttribute('tracked-controls', {\n idPrefix: GAMEPAD_ID_PREFIX,\n hand: data.hand,\n controller: this.controllerIndex,\n orientationOffset: data.orientationOffset\n });\n\n // Load model.\n if (!this.data.model) { return; }\n this.el.setAttribute('obj-model', {\n obj: VIVE_CONTROLLER_MODEL_OBJ_URL,\n mtl: VIVE_CONTROLLER_MODEL_OBJ_MTL\n });\n },\n\n addControllersUpdateListener: function () {\n this.el.sceneEl.addEventListener('controllersupdated', this.onControllersUpdate, false);\n },\n\n removeControllersUpdateListener: function () {\n this.el.sceneEl.removeEventListener('controllersupdated', this.onControllersUpdate, false);\n },\n\n onControllersUpdate: function () {\n this.checkIfControllerPresent();\n },\n\n /**\n * Rotate the trigger button based on how hard the trigger is pressed.\n */\n onButtonChanged: function (evt) {\n var button = this.mapping.buttons[evt.detail.id];\n var buttonMeshes = this.buttonMeshes;\n var analogValue;\n\n if (!button) { return; }\n\n if (button === 'trigger') {\n analogValue = evt.detail.state.value;\n // Update trigger rotation depending on button value.\n if (buttonMeshes && buttonMeshes.trigger) {\n buttonMeshes.trigger.rotation.x = -analogValue * (Math.PI / 12);\n }\n }\n\n // Pass along changed event with button state, using button mapping for convenience.\n this.el.emit(button + 'changed', evt.detail.state);\n },\n\n onModelLoaded: function (evt) {\n var buttonMeshes;\n var controllerObject3D = evt.detail.model;\n var self = this;\n\n if (!this.data.model) { return; }\n\n // Store button meshes object to be able to change their colors.\n buttonMeshes = this.buttonMeshes = {};\n buttonMeshes.grip = {\n left: controllerObject3D.getObjectByName('leftgrip'),\n right: controllerObject3D.getObjectByName('rightgrip')\n };\n buttonMeshes.menu = controllerObject3D.getObjectByName('menubutton');\n buttonMeshes.system = controllerObject3D.getObjectByName('systembutton');\n buttonMeshes.trackpad = controllerObject3D.getObjectByName('touchpad');\n buttonMeshes.trigger = controllerObject3D.getObjectByName('trigger');\n\n // Set default colors.\n Object.keys(buttonMeshes).forEach(function (buttonName) {\n self.setButtonColor(buttonName, self.data.buttonColor);\n });\n\n // Offset pivot point.\n controllerObject3D.position.set(0, -0.015, 0.04);\n },\n\n onAxisMoved: function (evt) {\n emitIfAxesChanged(this, this.mapping.axes, evt);\n },\n\n updateModel: function (buttonName, evtName) {\n var color;\n var isTouch;\n if (!this.data.model) { return; }\n\n isTouch = evtName.indexOf('touch') !== -1;\n // Don't change color for trackpad touch.\n if (isTouch) { return; }\n\n // Update colors.\n color = evtName === 'up' ? this.data.buttonColor : this.data.buttonHighlightColor;\n this.setButtonColor(buttonName, color);\n },\n\n setButtonColor: function (buttonName, color) {\n var buttonMeshes = this.buttonMeshes;\n var rendererSystem = this.rendererSystem;\n\n if (!buttonMeshes) { return; }\n\n // Need to do both left and right sides for grip.\n if (buttonName === 'grip') {\n buttonMeshes.grip.left.material.color.set(color);\n buttonMeshes.grip.right.material.color.set(color);\n rendererSystem.applyColorCorrection(buttonMeshes.grip.left.material.color);\n rendererSystem.applyColorCorrection(buttonMeshes.grip.right.material.color);\n return;\n }\n buttonMeshes[buttonName].material.color.set(color);\n rendererSystem.applyColorCorrection(buttonMeshes[buttonName].material.color);\n }\n});\n","var registerComponent = require('../core/component').registerComponent;\nvar bind = require('../utils/bind');\n\nvar trackedControlsUtils = require('../utils/tracked-controls');\nvar checkControllerPresentAndSetup = trackedControlsUtils.checkControllerPresentAndSetup;\nvar emitIfAxesChanged = trackedControlsUtils.emitIfAxesChanged;\nvar onButtonEvent = trackedControlsUtils.onButtonEvent;\n\nvar GAMEPAD_ID_PREFIX = 'HTC Vive Focus';\n\nvar VIVE_FOCUS_CONTROLLER_MODEL_URL = 'https://cdn.aframe.io/controllers/vive/focus-controller/focus-controller.gltf';\n\n/**\n * Vive Focus controls.\n * Interface with Vive Focus controller and map Gamepad events to\n * controller buttons: trackpad, trigger\n * Load a controller model and highlight the pressed buttons.\n */\nmodule.exports.Component = registerComponent('vive-focus-controls', {\n schema: {\n hand: {default: ''}, // This informs the degenerate arm model.\n buttonTouchedColor: {type: 'color', default: '#BBBBBB'},\n buttonHighlightColor: {type: 'color', default: '#7A7A7A'},\n model: {default: true},\n orientationOffset: {type: 'vec3'},\n armModel: {default: true}\n },\n\n /**\n * Button IDs:\n * 0 - trackpad\n * 1 - trigger\n */\n mapping: {\n axes: {trackpad: [0, 1]},\n buttons: ['trackpad', 'trigger']\n },\n\n bindMethods: function () {\n this.onModelLoaded = bind(this.onModelLoaded, this);\n this.onControllersUpdate = bind(this.onControllersUpdate, this);\n this.checkIfControllerPresent = bind(this.checkIfControllerPresent, this);\n this.removeControllersUpdateListener = bind(this.removeControllersUpdateListener, this);\n this.onAxisMoved = bind(this.onAxisMoved, this);\n },\n\n init: function () {\n var self = this;\n this.onButtonChanged = bind(this.onButtonChanged, this);\n this.onButtonDown = function (evt) { onButtonEvent(evt.detail.id, 'down', self); };\n this.onButtonUp = function (evt) { onButtonEvent(evt.detail.id, 'up', self); };\n this.onButtonTouchStart = function (evt) { onButtonEvent(evt.detail.id, 'touchstart', self); };\n this.onButtonTouchEnd = function (evt) { onButtonEvent(evt.detail.id, 'touchend', self); };\n this.controllerPresent = false;\n this.lastControllerCheck = 0;\n this.bindMethods();\n },\n\n addEventListeners: function () {\n var el = this.el;\n el.addEventListener('buttonchanged', this.onButtonChanged);\n el.addEventListener('buttondown', this.onButtonDown);\n el.addEventListener('buttonup', this.onButtonUp);\n el.addEventListener('touchstart', this.onButtonTouchStart);\n el.addEventListener('touchend', this.onButtonTouchEnd);\n el.addEventListener('model-loaded', this.onModelLoaded);\n el.addEventListener('axismove', this.onAxisMoved);\n this.controllerEventsActive = true;\n this.addControllersUpdateListener();\n },\n\n removeEventListeners: function () {\n var el = this.el;\n el.removeEventListener('buttonchanged', this.onButtonChanged);\n el.removeEventListener('buttondown', this.onButtonDown);\n el.removeEventListener('buttonup', this.onButtonUp);\n el.removeEventListener('touchstart', this.onButtonTouchStart);\n el.removeEventListener('touchend', this.onButtonTouchEnd);\n el.removeEventListener('model-loaded', this.onModelLoaded);\n el.removeEventListener('axismove', this.onAxisMoved);\n this.controllerEventsActive = false;\n this.removeControllersUpdateListener();\n },\n\n checkIfControllerPresent: function () {\n checkControllerPresentAndSetup(this, GAMEPAD_ID_PREFIX,\n this.data.hand ? {hand: this.data.hand} : {});\n },\n\n play: function () {\n this.checkIfControllerPresent();\n this.addControllersUpdateListener();\n },\n\n pause: function () {\n this.removeEventListeners();\n this.removeControllersUpdateListener();\n },\n\n injectTrackedControls: function () {\n var el = this.el;\n var data = this.data;\n el.setAttribute('tracked-controls', {\n armModel: data.armModel,\n idPrefix: GAMEPAD_ID_PREFIX,\n orientationOffset: data.orientationOffset\n });\n if (!this.data.model) { return; }\n this.el.setAttribute('gltf-model', VIVE_FOCUS_CONTROLLER_MODEL_URL);\n },\n\n addControllersUpdateListener: function () {\n this.el.sceneEl.addEventListener('controllersupdated', this.onControllersUpdate, false);\n },\n\n removeControllersUpdateListener: function () {\n this.el.sceneEl.removeEventListener('controllersupdated', this.onControllersUpdate, false);\n },\n\n onControllersUpdate: function () {\n this.checkIfControllerPresent();\n },\n\n onModelLoaded: function (evt) {\n var controllerObject3D = evt.detail.model;\n var buttonMeshes;\n\n if (!this.data.model) { return; }\n buttonMeshes = this.buttonMeshes = {};\n buttonMeshes.trigger = controllerObject3D.getObjectByName('BumperKey');\n buttonMeshes.triggerPressed = controllerObject3D.getObjectByName('BumperKey_Press');\n if (buttonMeshes.triggerPressed) {\n buttonMeshes.triggerPressed.visible = false;\n }\n buttonMeshes.trackpad = controllerObject3D.getObjectByName('TouchPad');\n buttonMeshes.trackpadPressed = controllerObject3D.getObjectByName('TouchPad_Press');\n if (buttonMeshes.trackpadPressed) {\n buttonMeshes.trackpadPressed.visible = false;\n }\n },\n\n // No analog buttons, only emits 0/1 values\n onButtonChanged: function (evt) {\n var button = this.mapping.buttons[evt.detail.id];\n if (!button) return;\n // Pass along changed event with button state, using button mapping for convenience.\n this.el.emit(button + 'changed', evt.detail.state);\n },\n\n onAxisMoved: function (evt) {\n emitIfAxesChanged(this, this.mapping.axes, evt);\n },\n\n updateModel: function (buttonName, evtName) {\n if (!this.data.model) { return; }\n this.updateButtonModel(buttonName, evtName);\n },\n\n updateButtonModel: function (buttonName, state) {\n var buttonMeshes = this.buttonMeshes;\n var pressedName = buttonName + 'Pressed';\n if (!buttonMeshes || !buttonMeshes[buttonName] || !buttonMeshes[pressedName]) {\n return;\n }\n var color;\n switch (state) {\n case 'down':\n color = this.data.buttonHighlightColor;\n break;\n case 'touchstart':\n color = this.data.buttonTouchedColor;\n break;\n }\n if (color) {\n buttonMeshes[pressedName].material.color.set(color);\n }\n buttonMeshes[pressedName].visible = !!color;\n buttonMeshes[buttonName].visible = !color;\n }\n});\n","var KEYCODE_TO_CODE = require('../constants').keyboardevent.KEYCODE_TO_CODE;\nvar registerComponent = require('../core/component').registerComponent;\nvar THREE = require('../lib/three');\nvar utils = require('../utils/');\n\nvar bind = utils.bind;\nvar shouldCaptureKeyEvent = utils.shouldCaptureKeyEvent;\n\nvar CLAMP_VELOCITY = 0.00001;\nvar MAX_DELTA = 0.2;\nvar KEYS = [\n 'KeyW', 'KeyA', 'KeyS', 'KeyD',\n 'ArrowUp', 'ArrowLeft', 'ArrowRight', 'ArrowDown'\n];\n\n/**\n * WASD component to control entities using WASD keys.\n */\nmodule.exports.Component = registerComponent('wasd-controls', {\n schema: {\n acceleration: {default: 65},\n adAxis: {default: 'x', oneOf: ['x', 'y', 'z']},\n adEnabled: {default: true},\n adInverted: {default: false},\n enabled: {default: true},\n fly: {default: false},\n wsAxis: {default: 'z', oneOf: ['x', 'y', 'z']},\n wsEnabled: {default: true},\n wsInverted: {default: false}\n },\n\n init: function () {\n // To keep track of the pressed keys.\n this.keys = {};\n this.easing = 1.1;\n\n this.velocity = new THREE.Vector3();\n\n // Bind methods and add event listeners.\n this.onBlur = bind(this.onBlur, this);\n this.onContextMenu = bind(this.onContextMenu, this);\n this.onFocus = bind(this.onFocus, this);\n this.onKeyDown = bind(this.onKeyDown, this);\n this.onKeyUp = bind(this.onKeyUp, this);\n this.onVisibilityChange = bind(this.onVisibilityChange, this);\n this.attachVisibilityEventListeners();\n },\n\n tick: function (time, delta) {\n var data = this.data;\n var el = this.el;\n var velocity = this.velocity;\n\n if (!velocity[data.adAxis] && !velocity[data.wsAxis] &&\n isEmptyObject(this.keys)) { return; }\n\n // Update velocity.\n delta = delta / 1000;\n this.updateVelocity(delta);\n\n if (!velocity[data.adAxis] && !velocity[data.wsAxis]) { return; }\n\n // Get movement vector and translate position.\n el.object3D.position.add(this.getMovementVector(delta));\n },\n\n remove: function () {\n this.removeKeyEventListeners();\n this.removeVisibilityEventListeners();\n },\n\n play: function () {\n this.attachKeyEventListeners();\n },\n\n pause: function () {\n this.keys = {};\n this.removeKeyEventListeners();\n },\n\n updateVelocity: function (delta) {\n var acceleration;\n var adAxis;\n var adSign;\n var data = this.data;\n var keys = this.keys;\n var velocity = this.velocity;\n var wsAxis;\n var wsSign;\n\n adAxis = data.adAxis;\n wsAxis = data.wsAxis;\n\n // If FPS too low, reset velocity.\n if (delta > MAX_DELTA) {\n velocity[adAxis] = 0;\n velocity[wsAxis] = 0;\n return;\n }\n\n // https://gamedev.stackexchange.com/questions/151383/frame-rate-independant-movement-with-acceleration\n var scaledEasing = Math.pow(1 / this.easing, delta * 60);\n // Velocity Easing.\n if (velocity[adAxis] !== 0) {\n velocity[adAxis] = velocity[adAxis] * scaledEasing;\n }\n if (velocity[wsAxis] !== 0) {\n velocity[wsAxis] = velocity[wsAxis] * scaledEasing;\n }\n\n // Clamp velocity easing.\n if (Math.abs(velocity[adAxis]) < CLAMP_VELOCITY) { velocity[adAxis] = 0; }\n if (Math.abs(velocity[wsAxis]) < CLAMP_VELOCITY) { velocity[wsAxis] = 0; }\n\n if (!data.enabled) { return; }\n\n // Update velocity using keys pressed.\n acceleration = data.acceleration;\n if (data.adEnabled) {\n adSign = data.adInverted ? -1 : 1;\n if (keys.KeyA || keys.ArrowLeft) { velocity[adAxis] -= adSign * acceleration * delta; }\n if (keys.KeyD || keys.ArrowRight) { velocity[adAxis] += adSign * acceleration * delta; }\n }\n if (data.wsEnabled) {\n wsSign = data.wsInverted ? -1 : 1;\n if (keys.KeyW || keys.ArrowUp) { velocity[wsAxis] -= wsSign * acceleration * delta; }\n if (keys.KeyS || keys.ArrowDown) { velocity[wsAxis] += wsSign * acceleration * delta; }\n }\n },\n\n getMovementVector: (function () {\n var directionVector = new THREE.Vector3(0, 0, 0);\n var rotationEuler = new THREE.Euler(0, 0, 0, 'YXZ');\n\n return function (delta) {\n var rotation = this.el.getAttribute('rotation');\n var velocity = this.velocity;\n var xRotation;\n\n directionVector.copy(velocity);\n directionVector.multiplyScalar(delta);\n\n // Absolute.\n if (!rotation) { return directionVector; }\n\n xRotation = this.data.fly ? rotation.x : 0;\n\n // Transform direction relative to heading.\n rotationEuler.set(THREE.Math.degToRad(xRotation), THREE.Math.degToRad(rotation.y), 0);\n directionVector.applyEuler(rotationEuler);\n return directionVector;\n };\n })(),\n\n attachVisibilityEventListeners: function () {\n window.oncontextmenu = this.onContextMenu;\n window.addEventListener('blur', this.onBlur);\n window.addEventListener('focus', this.onFocus);\n document.addEventListener('visibilitychange', this.onVisibilityChange);\n },\n\n removeVisibilityEventListeners: function () {\n window.removeEventListener('blur', this.onBlur);\n window.removeEventListener('focus', this.onFocus);\n document.removeEventListener('visibilitychange', this.onVisibilityChange);\n },\n\n attachKeyEventListeners: function () {\n window.addEventListener('keydown', this.onKeyDown);\n window.addEventListener('keyup', this.onKeyUp);\n },\n\n removeKeyEventListeners: function () {\n window.removeEventListener('keydown', this.onKeyDown);\n window.removeEventListener('keyup', this.onKeyUp);\n },\n\n onContextMenu: function () {\n var keys = Object.keys(this.keys);\n for (var i = 0; i < keys.length; i++) {\n delete this.keys[keys[i]];\n }\n },\n\n onBlur: function () {\n this.pause();\n },\n\n onFocus: function () {\n this.play();\n },\n\n onVisibilityChange: function () {\n if (document.hidden) {\n this.onBlur();\n } else {\n this.onFocus();\n }\n },\n\n onKeyDown: function (event) {\n var code;\n if (!shouldCaptureKeyEvent(event)) { return; }\n code = event.code || KEYCODE_TO_CODE[event.keyCode];\n if (KEYS.indexOf(code) !== -1) { this.keys[code] = true; }\n },\n\n onKeyUp: function (event) {\n var code;\n code = event.code || KEYCODE_TO_CODE[event.keyCode];\n delete this.keys[code];\n }\n});\n\nfunction isEmptyObject (keys) {\n var key;\n for (key in keys) { return false; }\n return true;\n}\n","/* global THREE */\nvar registerComponent = require('../core/component').registerComponent;\nvar bind = require('../utils/bind');\n\nvar trackedControlsUtils = require('../utils/tracked-controls');\nvar checkControllerPresentAndSetup = trackedControlsUtils.checkControllerPresentAndSetup;\nvar emitIfAxesChanged = trackedControlsUtils.emitIfAxesChanged;\nvar onButtonEvent = trackedControlsUtils.onButtonEvent;\n\nvar utils = require('../utils/');\n\nvar debug = utils.debug('components:windows-motion-controls:debug');\nvar warn = utils.debug('components:windows-motion-controls:warn');\n\nvar DEFAULT_HANDEDNESS = require('../constants').DEFAULT_HANDEDNESS;\n\nvar MODEL_BASE_URL = 'https://cdn.aframe.io/controllers/microsoft/';\nvar MODEL_FILENAMES = { left: 'left.glb', right: 'right.glb', default: 'universal.glb' };\n\nvar isWebXRAvailable = require('../utils/').device.isWebXRAvailable;\n\nvar GAMEPAD_ID_WEBXR = 'windows-mixed-reality';\nvar GAMEPAD_ID_WEBVR = 'Spatial Controller (Spatial Interaction Source) ';\nvar GAMEPAD_ID_PATTERN = /([0-9a-zA-Z]+-[0-9a-zA-Z]+)$/;\n\nvar GAMEPAD_ID_PREFIX = isWebXRAvailable ? GAMEPAD_ID_WEBXR : GAMEPAD_ID_WEBVR;\n\nvar INPUT_MAPPING_WEBVR = {\n // A-Frame specific semantic axis names\n axes: {'thumbstick': [0, 1], 'trackpad': [2, 3]},\n // A-Frame specific semantic button names\n buttons: ['thumbstick', 'trigger', 'grip', 'menu', 'trackpad'],\n // A mapping of the semantic name to node name in the glTF model file,\n // that should be transformed by axis value.\n // This array mirrors the browser Gamepad.axes array, such that\n // the mesh corresponding to axis 0 is in this array index 0.\n axisMeshNames: [\n 'THUMBSTICK_X',\n 'THUMBSTICK_Y',\n 'TOUCHPAD_TOUCH_X',\n 'TOUCHPAD_TOUCH_Y'\n ],\n // A mapping of the semantic name to button node name in the glTF model file,\n // that should be transformed by button value.\n buttonMeshNames: {\n 'trigger': 'SELECT',\n 'menu': 'MENU',\n 'grip': 'GRASP',\n 'thumbstick': 'THUMBSTICK_PRESS',\n 'trackpad': 'TOUCHPAD_PRESS'\n },\n pointingPoseMeshName: 'POINTING_POSE'\n};\n\nvar INPUT_MAPPING_WEBXR = {\n // A-Frame specific semantic axis names\n axes: {'touchpad': [0, 1], 'thumbstick': [2, 3]},\n // A-Frame specific semantic button names\n buttons: ['trigger', 'squeeze', 'touchpad', 'thumbstick', 'menu'],\n // A mapping of the semantic name to node name in the glTF model file,\n // that should be transformed by axis value.\n // This array mirrors the browser Gamepad.axes array, such that\n // the mesh corresponding to axis 0 is in this array index 0.\n axisMeshNames: [\n 'TOUCHPAD_TOUCH_X',\n 'TOUCHPAD_TOUCH_X',\n 'THUMBSTICK_X',\n 'THUMBSTICK_Y'\n ],\n // A mapping of the semantic name to button node name in the glTF model file,\n // that should be transformed by button value.\n buttonMeshNames: {\n 'trigger': 'SELECT',\n 'menu': 'MENU',\n 'squeeze': 'GRASP',\n 'thumbstick': 'THUMBSTICK_PRESS',\n 'touchpad': 'TOUCHPAD_PRESS'\n },\n pointingPoseMeshName: 'POINTING_POSE'\n};\n\nvar INPUT_MAPPING = isWebXRAvailable ? INPUT_MAPPING_WEBXR : INPUT_MAPPING_WEBVR;\n\n/**\n * Windows Motion Controller controls.\n * Interface with Windows Motion Controller controllers and map Gamepad events to\n * controller buttons: trackpad, trigger, grip, menu, thumbstick\n * Load a controller model and transform the pressed buttons.\n */\nmodule.exports.Component = registerComponent('windows-motion-controls', {\n schema: {\n hand: {default: DEFAULT_HANDEDNESS},\n // It is possible to have multiple pairs of controllers attached (a pair has both left and right).\n // Set this to 1 to use a controller from the second pair, 2 from the third pair, etc.\n pair: {default: 0},\n // If true, loads the controller glTF asset.\n model: {default: true},\n // If true, will hide the model from the scene if no matching gamepad (based on ID & hand) is connected.\n hideDisconnected: {default: true}\n },\n\n mapping: INPUT_MAPPING,\n\n bindMethods: function () {\n this.onModelError = bind(this.onModelError, this);\n this.onModelLoaded = bind(this.onModelLoaded, this);\n this.onControllersUpdate = bind(this.onControllersUpdate, this);\n this.checkIfControllerPresent = bind(this.checkIfControllerPresent, this);\n this.onAxisMoved = bind(this.onAxisMoved, this);\n },\n\n init: function () {\n var self = this;\n var el = this.el;\n this.onButtonChanged = bind(this.onButtonChanged, this);\n this.onButtonDown = function (evt) { onButtonEvent(evt.detail.id, 'down', self); };\n this.onButtonUp = function (evt) { onButtonEvent(evt.detail.id, 'up', self); };\n this.onButtonTouchStart = function (evt) { onButtonEvent(evt.detail.id, 'touchstart', self); };\n this.onButtonTouchEnd = function (evt) { onButtonEvent(evt.detail.id, 'touchend', self); };\n this.onControllerConnected = function () { self.setModelVisibility(true); };\n this.onControllerDisconnected = function () { self.setModelVisibility(false); };\n this.controllerPresent = false;\n this.lastControllerCheck = 0;\n this.previousButtonValues = {};\n this.bindMethods();\n\n // Cache for submeshes that we have looked up by name.\n this.loadedMeshInfo = {\n buttonMeshes: null,\n axisMeshes: null\n };\n\n // Pointing poses\n this.rayOrigin = {\n origin: new THREE.Vector3(),\n direction: new THREE.Vector3(0, 0, -1),\n createdFromMesh: false\n };\n\n el.addEventListener('controllerconnected', this.onControllerConnected);\n el.addEventListener('controllerdisconnected', this.onControllerDisconnected);\n },\n\n addEventListeners: function () {\n var el = this.el;\n el.addEventListener('buttonchanged', this.onButtonChanged);\n el.addEventListener('buttondown', this.onButtonDown);\n el.addEventListener('buttonup', this.onButtonUp);\n el.addEventListener('touchstart', this.onButtonTouchStart);\n el.addEventListener('touchend', this.onButtonTouchEnd);\n el.addEventListener('axismove', this.onAxisMoved);\n el.addEventListener('model-error', this.onModelError);\n el.addEventListener('model-loaded', this.onModelLoaded);\n this.controllerEventsActive = true;\n },\n\n removeEventListeners: function () {\n var el = this.el;\n el.removeEventListener('buttonchanged', this.onButtonChanged);\n el.removeEventListener('buttondown', this.onButtonDown);\n el.removeEventListener('buttonup', this.onButtonUp);\n el.removeEventListener('touchstart', this.onButtonTouchStart);\n el.removeEventListener('touchend', this.onButtonTouchEnd);\n el.removeEventListener('axismove', this.onAxisMoved);\n el.removeEventListener('model-error', this.onModelError);\n el.removeEventListener('model-loaded', this.onModelLoaded);\n this.controllerEventsActive = false;\n },\n\n checkIfControllerPresent: function () {\n checkControllerPresentAndSetup(this, GAMEPAD_ID_PREFIX, {\n hand: this.data.hand,\n index: this.data.pair,\n iterateControllerProfiles: true\n });\n },\n\n play: function () {\n this.checkIfControllerPresent();\n this.addControllersUpdateListener();\n },\n\n pause: function () {\n this.removeEventListeners();\n this.removeControllersUpdateListener();\n },\n\n updateControllerModel: function () {\n // If we do not want to load a model, or, have already loaded the model, emit the controllermodelready event.\n if (!this.data.model || this.rayOrigin.createdFromMesh) {\n this.modelReady();\n return;\n }\n\n var sourceUrl = this.createControllerModelUrl();\n this.loadModel(sourceUrl);\n },\n\n /**\n * Helper function that constructs a URL from the controller ID suffix, for future proofed\n * art assets.\n */\n createControllerModelUrl: function (forceDefault) {\n // Determine the device specific folder based on the ID suffix\n var trackedControlsComponent = this.el.components['tracked-controls'];\n var controller = trackedControlsComponent ? trackedControlsComponent.controller : null;\n var device = 'default';\n var hand = this.data.hand;\n var filename;\n\n if (controller && !window.hasNativeWebXRImplementation) {\n // Read hand directly from the controller, rather than this.data, as in the case that the controller\n // is unhanded this.data will still have 'left' or 'right' (depending on what the user inserted in to the scene).\n // In this case, we want to load the universal model, so need to get the '' from the controller.\n hand = controller.hand;\n\n if (!forceDefault) {\n var match = controller.id.match(GAMEPAD_ID_PATTERN);\n device = ((match && match[0]) || device);\n }\n }\n\n // Hand\n filename = MODEL_FILENAMES[hand] || MODEL_FILENAMES.default;\n\n // Final url\n return MODEL_BASE_URL + device + '/' + filename;\n },\n\n injectTrackedControls: function () {\n var data = this.data;\n this.el.setAttribute('tracked-controls', {\n idPrefix: GAMEPAD_ID_PREFIX,\n controller: data.pair,\n hand: data.hand,\n armModel: false\n });\n\n this.updateControllerModel();\n },\n\n addControllersUpdateListener: function () {\n this.el.sceneEl.addEventListener('controllersupdated', this.onControllersUpdate, false);\n },\n\n removeControllersUpdateListener: function () {\n this.el.sceneEl.removeEventListener('controllersupdated', this.onControllersUpdate, false);\n },\n\n onControllersUpdate: function () {\n this.checkIfControllerPresent();\n },\n\n onModelError: function (evt) {\n var defaultUrl = this.createControllerModelUrl(true);\n if (evt.detail.src !== defaultUrl) {\n warn('Failed to load controller model for device, attempting to load default.');\n this.loadModel(defaultUrl);\n } else {\n warn('Failed to load default controller model.');\n }\n },\n\n loadModel: function (url) {\n // The model is loaded by the gltf-model compoent when this attribute is initially set,\n // removed and re-loaded if the given url changes.\n this.el.setAttribute('gltf-model', 'url(' + url + ')');\n },\n\n onModelLoaded: function (evt) {\n var rootNode = this.controllerModel = evt.detail.model;\n var loadedMeshInfo = this.loadedMeshInfo;\n var i;\n var meshName;\n var mesh;\n var meshInfo;\n\n debug('Processing model');\n\n // Reset the caches\n loadedMeshInfo.buttonMeshes = {};\n loadedMeshInfo.axisMeshes = {};\n\n // Cache our meshes so we aren't traversing the hierarchy per frame\n if (rootNode) {\n // Button Meshes\n for (i = 0; i < this.mapping.buttons.length; i++) {\n meshName = this.mapping.buttonMeshNames[this.mapping.buttons[i]];\n if (!meshName) {\n debug('Skipping unknown button at index: ' + i + ' with mapped name: ' + this.mapping.buttons[i]);\n continue;\n }\n\n mesh = rootNode.getObjectByName(meshName);\n if (!mesh) {\n warn('Missing button mesh with name: ' + meshName);\n continue;\n }\n\n meshInfo = {\n index: i,\n value: getImmediateChildByName(mesh, 'VALUE'),\n pressed: getImmediateChildByName(mesh, 'PRESSED'),\n unpressed: getImmediateChildByName(mesh, 'UNPRESSED')\n };\n if (meshInfo.value && meshInfo.pressed && meshInfo.unpressed) {\n loadedMeshInfo.buttonMeshes[this.mapping.buttons[i]] = meshInfo;\n } else {\n // If we didn't find the mesh, it simply means this button won't have transforms applied as mapped button value changes.\n warn('Missing button submesh under mesh with name: ' + meshName +\n '(VALUE: ' + !!meshInfo.value +\n ', PRESSED: ' + !!meshInfo.pressed +\n ', UNPRESSED:' + !!meshInfo.unpressed +\n ')');\n }\n }\n\n // Axis Meshes\n for (i = 0; i < this.mapping.axisMeshNames.length; i++) {\n meshName = this.mapping.axisMeshNames[i];\n if (!meshName) {\n debug('Skipping unknown axis at index: ' + i);\n continue;\n }\n\n mesh = rootNode.getObjectByName(meshName);\n if (!mesh) {\n warn('Missing axis mesh with name: ' + meshName);\n continue;\n }\n\n meshInfo = {\n index: i,\n value: getImmediateChildByName(mesh, 'VALUE'),\n min: getImmediateChildByName(mesh, 'MIN'),\n max: getImmediateChildByName(mesh, 'MAX')\n };\n if (meshInfo.value && meshInfo.min && meshInfo.max) {\n loadedMeshInfo.axisMeshes[i] = meshInfo;\n } else {\n // If we didn't find the mesh, it simply means this axis won't have transforms applied as mapped axis values change.\n warn('Missing axis submesh under mesh with name: ' + meshName +\n '(VALUE: ' + !!meshInfo.value +\n ', MIN: ' + !!meshInfo.min +\n ', MAX:' + !!meshInfo.max +\n ')');\n }\n }\n\n this.calculateRayOriginFromMesh(rootNode);\n // Determine if the model has to be visible or not.\n this.setModelVisibility();\n }\n\n debug('Model load complete.');\n\n // Look through only immediate children. This will return null if no mesh exists with the given name.\n function getImmediateChildByName (object3d, value) {\n for (var i = 0, l = object3d.children.length; i < l; i++) {\n var obj = object3d.children[i];\n if (obj && obj['name'] === value) {\n return obj;\n }\n }\n return undefined;\n }\n },\n\n calculateRayOriginFromMesh: (function () {\n var quaternion = new THREE.Quaternion();\n return function (rootNode) {\n var mesh;\n\n // Calculate the pointer pose (used for rays), by applying the world transform of th POINTER_POSE node\n // in the glTF (assumes that root node is at world origin)\n this.rayOrigin.origin.set(0, 0, 0);\n this.rayOrigin.direction.set(0, 0, -1);\n this.rayOrigin.createdFromMesh = true;\n\n // Try to read Pointing pose from the source model\n mesh = rootNode.getObjectByName(this.mapping.pointingPoseMeshName);\n if (mesh) {\n var parent = rootNode.parent;\n\n // We need to read pose transforms accumulated from the root of the glTF, not the scene.\n if (parent) {\n rootNode.parent = null;\n rootNode.updateMatrixWorld(true);\n rootNode.parent = parent;\n }\n\n mesh.getWorldPosition(this.rayOrigin.origin);\n mesh.getWorldQuaternion(quaternion);\n this.rayOrigin.direction.applyQuaternion(quaternion);\n\n // Recalculate the world matrices now that the rootNode is re-attached to the parent.\n if (parent) {\n rootNode.updateMatrixWorld(true);\n }\n } else {\n debug('Mesh does not contain pointing origin data, defaulting to none.');\n }\n\n // Emit event stating that our pointing ray is now accurate.\n this.modelReady();\n };\n })(),\n\n lerpAxisTransform: (function () {\n var quaternion = new THREE.Quaternion();\n return function (axis, axisValue) {\n var axisMeshInfo = this.loadedMeshInfo.axisMeshes[axis];\n if (!axisMeshInfo) return;\n\n var min = axisMeshInfo.min;\n var max = axisMeshInfo.max;\n var target = axisMeshInfo.value;\n\n // Convert from gamepad value range (-1 to +1) to lerp range (0 to 1)\n var lerpValue = axisValue * 0.5 + 0.5;\n target.setRotationFromQuaternion(quaternion.copy(min.quaternion).slerp(max.quaternion, lerpValue));\n target.position.lerpVectors(min.position, max.position, lerpValue);\n };\n })(),\n\n lerpButtonTransform: (function () {\n var quaternion = new THREE.Quaternion();\n return function (buttonName, buttonValue) {\n var buttonMeshInfo = this.loadedMeshInfo.buttonMeshes[buttonName];\n if (!buttonMeshInfo) return;\n\n var min = buttonMeshInfo.unpressed;\n var max = buttonMeshInfo.pressed;\n var target = buttonMeshInfo.value;\n\n target.setRotationFromQuaternion(quaternion.copy(min.quaternion).slerp(max.quaternion, buttonValue));\n target.position.lerpVectors(min.position, max.position, buttonValue);\n };\n })(),\n\n modelReady: function () {\n this.el.emit('controllermodelready', {\n name: 'windows-motion-controls',\n model: this.data.model,\n rayOrigin: this.rayOrigin\n });\n },\n\n onButtonChanged: function (evt) {\n var buttonName = this.mapping.buttons[evt.detail.id];\n\n if (buttonName) {\n // Update the button mesh transform\n if (this.loadedMeshInfo && this.loadedMeshInfo.buttonMeshes) {\n this.lerpButtonTransform(buttonName, evt.detail.state.value);\n }\n\n // Only emit events for buttons that we know how to map from index to name\n this.el.emit(buttonName + 'changed', evt.detail.state);\n }\n },\n\n onAxisMoved: function (evt) {\n var numAxes = this.mapping.axisMeshNames.length;\n\n // Only attempt to update meshes if we have valid data.\n if (this.loadedMeshInfo && this.loadedMeshInfo.axisMeshes) {\n for (var axis = 0; axis < numAxes; axis++) {\n // Update the button mesh transform\n this.lerpAxisTransform(axis, evt.detail.axis[axis] || 0.0);\n }\n }\n\n emitIfAxesChanged(this, this.mapping.axes, evt);\n },\n\n setModelVisibility: function (visible) {\n var model = this.el.getObject3D('mesh');\n visible = visible !== undefined ? visible : this.modelVisible;\n this.modelVisible = visible;\n if (!model) { return; }\n model.visible = visible;\n }\n});\n","module.exports = {\n AFRAME_INJECTED: 'aframe-injected',\n DEFAULT_CAMERA_HEIGHT: 1.6,\n DEFAULT_HANDEDNESS: 'right',\n keyboardevent: require('./keyboardevent')\n};\n","module.exports = {\n // Tiny KeyboardEvent.code polyfill.\n KEYCODE_TO_CODE: {\n '38': 'ArrowUp',\n '37': 'ArrowLeft',\n '40': 'ArrowDown',\n '39': 'ArrowRight',\n '87': 'KeyW',\n '65': 'KeyA',\n '83': 'KeyS',\n '68': 'KeyD'\n }\n};\n","var ANode = require('./a-node');\nvar bind = require('../utils/bind');\nvar debug = require('../utils/debug');\nvar registerElement = require('./a-register-element').registerElement;\nvar THREE = require('../lib/three');\n\nvar fileLoader = new THREE.FileLoader();\nvar warn = debug('core:a-assets:warn');\n\n/**\n * Asset management system. Handles blocking on asset loading.\n */\nmodule.exports = registerElement('a-assets', {\n prototype: Object.create(ANode.prototype, {\n createdCallback: {\n value: function () {\n this.isAssets = true;\n this.fileLoader = fileLoader;\n this.timeout = null;\n }\n },\n\n attachedCallback: {\n value: function () {\n var self = this;\n var i;\n var loaded = [];\n var mediaEl;\n var mediaEls;\n var imgEl;\n var imgEls;\n var timeout;\n\n if (!this.parentNode.isScene) {\n throw new Error('<a-assets> must be a child of a <a-scene>.');\n }\n\n // Wait for <img>s.\n imgEls = this.querySelectorAll('img');\n for (i = 0; i < imgEls.length; i++) {\n imgEl = fixUpMediaElement(imgEls[i]);\n loaded.push(new Promise(function (resolve, reject) {\n // Set in cache because we won't be needing to call three.js loader if we have.\n // a loaded media element.\n THREE.Cache.add(imgEls[i].getAttribute('src'), imgEl);\n imgEl.onload = resolve;\n imgEl.onerror = reject;\n }));\n }\n\n // Wait for <audio>s and <video>s.\n mediaEls = this.querySelectorAll('audio, video');\n for (i = 0; i < mediaEls.length; i++) {\n mediaEl = fixUpMediaElement(mediaEls[i]);\n if (!mediaEl.src && !mediaEl.srcObject) {\n warn('Audio/video asset has neither `src` nor `srcObject` attributes.');\n }\n loaded.push(mediaElementLoaded(mediaEl));\n }\n\n // Trigger loaded for scene to start rendering.\n Promise.all(loaded).then(bind(this.load, this));\n\n // Timeout to start loading anyways.\n timeout = parseInt(this.getAttribute('timeout'), 10) || 3000;\n this.timeout = setTimeout(function () {\n if (self.hasLoaded) { return; }\n warn('Asset loading timed out in ', timeout, 'ms');\n self.emit('timeout');\n self.load();\n }, timeout);\n }\n },\n\n detachedCallback: {\n value: function () {\n if (this.timeout) { clearTimeout(this.timeout); }\n }\n },\n\n load: {\n value: function () {\n ANode.prototype.load.call(this, null, function waitOnFilter (el) {\n return el.isAssetItem && el.hasAttribute('src');\n });\n }\n }\n })\n});\n\n/**\n * Preload using XHRLoader for any type of asset.\n */\nregisterElement('a-asset-item', {\n prototype: Object.create(ANode.prototype, {\n createdCallback: {\n value: function () {\n this.data = null;\n this.isAssetItem = true;\n }\n },\n\n attachedCallback: {\n value: function () {\n var self = this;\n var src = this.getAttribute('src');\n fileLoader.setResponseType(\n this.getAttribute('response-type') || inferResponseType(src));\n fileLoader.load(src, function handleOnLoad (response) {\n self.data = response;\n /*\n Workaround for a Chrome bug. If another XHR is sent to the same url before the\n previous one closes, the second request never finishes.\n setTimeout finishes the first request and lets the logic triggered by load open\n subsequent requests.\n setTimeout can be removed once the fix for the bug below ships:\n https://bugs.chromium.org/p/chromium/issues/detail?id=633696&q=component%3ABlink%3ENetwork%3EXHR%20&colspec=ID%20Pri%20M%20Stars%20ReleaseBlock%20Component%20Status%20Owner%20Summary%20OS%20Modified\n */\n setTimeout(function load () { ANode.prototype.load.call(self); });\n }, function handleOnProgress (xhr) {\n self.emit('progress', {\n loadedBytes: xhr.loaded,\n totalBytes: xhr.total,\n xhr: xhr\n });\n }, function handleOnError (xhr) {\n self.emit('error', {xhr: xhr});\n });\n }\n }\n })\n});\n\n/**\n * Create a Promise that resolves once the media element has finished buffering.\n *\n * @param {Element} el - HTMLMediaElement.\n * @returns {Promise}\n */\nfunction mediaElementLoaded (el) {\n if (!el.hasAttribute('autoplay') && el.getAttribute('preload') !== 'auto') {\n return;\n }\n\n // If media specifies autoplay or preload, wait until media is completely buffered.\n return new Promise(function (resolve, reject) {\n if (el.readyState === 4) { return resolve(); } // Already loaded.\n if (el.error) { return reject(); } // Error.\n\n el.addEventListener('loadeddata', checkProgress, false);\n el.addEventListener('progress', checkProgress, false);\n el.addEventListener('error', reject, false);\n\n function checkProgress () {\n // Add up the seconds buffered.\n var secondsBuffered = 0;\n for (var i = 0; i < el.buffered.length; i++) {\n secondsBuffered += el.buffered.end(i) - el.buffered.start(i);\n }\n\n // Compare seconds buffered to media duration.\n if (secondsBuffered >= el.duration) {\n // Set in cache because we won't be needing to call three.js loader if we have.\n // a loaded media element.\n // Store video elements only. three.js loader is used for audio elements.\n // See assetParse too.\n if (el.tagName === 'VIDEO') {\n THREE.Cache.add(el.getAttribute('src'), el);\n }\n resolve();\n }\n }\n });\n}\n\n/**\n * Automatically add attributes to media elements where convenient.\n * crossorigin, playsinline.\n */\nfunction fixUpMediaElement (mediaEl) {\n // Cross-origin.\n var newMediaEl = setCrossOrigin(mediaEl);\n\n // Plays inline for mobile.\n if (newMediaEl.tagName && newMediaEl.tagName.toLowerCase() === 'video') {\n newMediaEl.setAttribute('playsinline', '');\n newMediaEl.setAttribute('webkit-playsinline', '');\n }\n\n if (newMediaEl !== mediaEl) {\n mediaEl.parentNode.appendChild(newMediaEl);\n mediaEl.parentNode.removeChild(mediaEl);\n }\n return newMediaEl;\n}\n\n/**\n * Automatically set `crossorigin` if not defined on the media element.\n * If it is not defined, we must create and re-append a new media element <img> and\n * have the browser re-request it with `crossorigin` set.\n *\n * @param {Element} Media element (e.g., <img>, <audio>, <video>).\n * @returns {Element} Media element to be used to listen to for loaded events.\n */\nfunction setCrossOrigin (mediaEl) {\n var newMediaEl;\n var src;\n\n // Already has crossorigin set.\n if (mediaEl.hasAttribute('crossorigin')) { return mediaEl; }\n\n src = mediaEl.getAttribute('src');\n\n if (src !== null) {\n // Does not have protocol.\n if (src.indexOf('://') === -1) { return mediaEl; }\n\n // Determine if cross origin is actually needed.\n if (extractDomain(src) === window.location.host) { return mediaEl; }\n }\n\n warn('Cross-origin element (e.g., <img>) was requested without `crossorigin` set. ' +\n 'A-Frame will re-request the asset with `crossorigin` attribute set. ' +\n 'Please set `crossorigin` on the element (e.g., <img crossorigin=\"anonymous\">)', src);\n mediaEl.crossOrigin = 'anonymous';\n newMediaEl = mediaEl.cloneNode(true);\n return newMediaEl;\n}\n\n/**\n * Extract domain out of URL.\n *\n * @param {string} url\n * @returns {string}\n */\nfunction extractDomain (url) {\n // Find and remove protocol (e.g., http, ftp, etc.) to get domain.\n var domain = url.indexOf('://') > -1 ? url.split('/')[2] : url.split('/')[0];\n\n // Find and remove port number.\n return domain.substring(0, domain.indexOf(':'));\n}\n\n/**\n * Infer response-type attribute from src.\n * Default is text (default XMLHttpRequest.responseType)\n * and arraybuffer for .glb files.\n *\n * @param {string} src\n * @returns {string}\n */\nfunction inferResponseType (src) {\n var fileName = getFileNameFromURL(src);\n var dotLastIndex = fileName.lastIndexOf('.');\n if (dotLastIndex >= 0) {\n var extension = fileName.slice(dotLastIndex, src.search(/\\?|#|$/));\n if (extension === '.glb') {\n return 'arraybuffer';\n }\n }\n return 'text';\n}\nmodule.exports.inferResponseType = inferResponseType;\n\n/**\n * Extract filename from URL\n *\n * @param {string} url\n * @returns {string}\n */\nfunction getFileNameFromURL (url) {\n var parser = document.createElement('a');\n parser.href = url;\n var query = parser.search.replace(/^\\?/, '');\n var filePath = url.replace(query, '').replace('?', '');\n return filePath.substring(filePath.lastIndexOf('/') + 1);\n}\nmodule.exports.getFileNameFromURL = getFileNameFromURL;\n","var debug = require('../utils/debug');\nvar registerElement = require('./a-register-element').registerElement;\n\nvar warn = debug('core:cubemap:warn');\n\n/**\n * Cubemap element that handles validation and exposes list of URLs.\n * Does not listen to updates.\n */\nmodule.exports = registerElement('a-cubemap', {\n prototype: Object.create(window.HTMLElement.prototype, {\n /**\n * Calculates this.srcs.\n */\n attachedCallback: {\n value: function () {\n this.srcs = this.validate();\n },\n writable: window.debug\n },\n\n /**\n * Checks for exactly six elements with [src].\n * Does not check explicitly for <img>s in case user does not want\n * prefetching.\n *\n * @returns {Array|null} - six URLs if valid, else null.\n */\n validate: {\n value: function () {\n var elements = this.querySelectorAll('[src]');\n var i;\n var srcs = [];\n if (elements.length === 6) {\n for (i = 0; i < elements.length; i++) {\n srcs.push(elements[i].getAttribute('src'));\n }\n return srcs;\n }\n // Else if there are not six elements, throw a warning.\n warn(\n '<a-cubemap> did not contain exactly six elements each with a ' +\n '`src` attribute.');\n },\n writable: window.debug\n }\n })\n});\n","var ANode = require('./a-node');\nvar COMPONENTS = require('./component').components;\nvar registerElement = require('./a-register-element').registerElement;\nvar THREE = require('../lib/three');\nvar utils = require('../utils/');\n\nvar AEntity;\nvar debug = utils.debug('core:a-entity:debug');\nvar warn = utils.debug('core:a-entity:warn');\n\nvar MULTIPLE_COMPONENT_DELIMITER = '__';\nvar OBJECT3D_COMPONENTS = ['position', 'rotation', 'scale', 'visible'];\nvar ONCE = {once: true};\n\n/**\n * Entity is a container object that components are plugged into to comprise everything in\n * the scene. In A-Frame, they inherently have position, rotation, and scale.\n *\n * To be able to take components, the scene element inherits from the entity definition.\n *\n * @member {object} components - entity's currently initialized components.\n * @member {object} object3D - three.js object.\n * @member {array} states\n * @member {boolean} isPlaying - false if dynamic behavior of the entity is paused.\n */\nvar proto = Object.create(ANode.prototype, {\n createdCallback: {\n value: function () {\n this.components = {};\n // To avoid double initializations and infinite loops.\n this.initializingComponents = {};\n this.componentsToUpdate = {};\n this.isEntity = true;\n this.isPlaying = false;\n this.object3D = new THREE.Group();\n this.object3D.el = this;\n this.object3DMap = {};\n this.parentEl = null;\n this.rotationObj = {};\n this.states = [];\n }\n },\n\n /**\n * Handle changes coming from the browser DOM inspector.\n */\n attributeChangedCallback: {\n value: function (attr, oldVal, newVal) {\n var component = this.components[attr];\n // If the empty string is passed by the component initialization\n // logic we ignore the component update.\n if (component && component.justInitialized && newVal === '') {\n delete component.justInitialized;\n return;\n }\n // When a component is removed after calling el.removeAttribute('material')\n if (!component && newVal === null) { return; }\n this.setEntityAttribute(attr, oldVal, newVal);\n }\n },\n\n /**\n * Add to parent, load, play.\n */\n attachedCallback: {\n value: function () {\n var assetsEl; // Asset management system element.\n var sceneEl = this.sceneEl;\n var self = this; // Component.\n\n this.addToParent();\n\n // Don't .load() scene on attachedCallback.\n if (this.isScene) { return; }\n\n // Gracefully not error when outside of <a-scene> (e.g., tests).\n if (!sceneEl) {\n this.load();\n return;\n }\n\n // Wait for asset management system to finish before loading.\n assetsEl = sceneEl.querySelector('a-assets');\n if (assetsEl && !assetsEl.hasLoaded) {\n assetsEl.addEventListener('loaded', function () { self.load(); });\n return;\n }\n this.load();\n }\n },\n\n /**\n * Tell parent to remove this element's object3D from its object3D.\n * Do not call on scene element because that will cause a call to document.body.remove().\n */\n detachedCallback: {\n value: function () {\n var componentName;\n\n if (!this.parentEl) { return; }\n\n // Remove components.\n for (componentName in this.components) {\n this.removeComponent(componentName, false);\n }\n\n if (this.isScene) { return; }\n\n this.removeFromParent();\n ANode.prototype.detachedCallback.call(this);\n\n // Remove cyclic reference.\n this.object3D.el = null;\n }\n },\n\n getObject3D: {\n value: function (type) {\n return this.object3DMap[type];\n }\n },\n\n /**\n * Set a THREE.Object3D into the map.\n *\n * @param {string} type - Developer-set name of the type of object, will be unique per type.\n * @param {object} obj - A THREE.Object3D.\n */\n setObject3D: {\n value: function (type, obj) {\n var oldObj;\n var self = this;\n\n if (!(obj instanceof THREE.Object3D)) {\n throw new Error(\n '`Entity.setObject3D` was called with an object that was not an instance of ' +\n 'THREE.Object3D.'\n );\n }\n\n // Remove existing object of the type.\n oldObj = this.getObject3D(type);\n if (oldObj) { this.object3D.remove(oldObj); }\n\n // Set references to A-Frame entity.\n obj.el = this;\n if (obj.children.length) {\n obj.traverse(function bindEl (child) {\n child.el = self;\n });\n }\n\n // Add.\n this.object3D.add(obj);\n this.object3DMap[type] = obj;\n this.emit('object3dset', {object: obj, type: type});\n }\n },\n\n /**\n * Remove object from scene and entity object3D map.\n */\n removeObject3D: {\n value: function (type) {\n var obj = this.getObject3D(type);\n if (!obj) {\n warn('Tried to remove `Object3D` of type:', type, 'which was not defined.');\n return;\n }\n this.object3D.remove(obj);\n delete this.object3DMap[type];\n this.emit('object3dremove', {type: type});\n }\n },\n\n /**\n * Gets or creates an object3D of a given type.\n *\n * @param {string} type - Type of the object3D.\n * @param {string} Constructor - Constructor to use to create the object3D if needed.\n * @returns {object}\n */\n getOrCreateObject3D: {\n value: function (type, Constructor) {\n var object3D = this.getObject3D(type);\n if (!object3D && Constructor) {\n object3D = new Constructor();\n this.setObject3D(type, object3D);\n }\n warn('`getOrCreateObject3D` has been deprecated. Use `setObject3D()` ' +\n 'and `object3dset` event instead.');\n return object3D;\n }\n },\n\n /**\n * Add child entity.\n *\n * @param {Element} el - Child entity.\n */\n add: {\n value: function (el) {\n if (!el.object3D) {\n throw new Error(\"Trying to add an element that doesn't have an `object3D`\");\n }\n this.object3D.add(el.object3D);\n this.emit('child-attached', {el: el});\n }\n },\n\n /**\n * Tell parentNode to add this entity to itself.\n */\n addToParent: {\n value: function () {\n var parentNode = this.parentEl = this.parentNode;\n\n // `!parentNode` check primarily for unit tests.\n if (!parentNode || !parentNode.add || this.attachedToParent) { return; }\n\n parentNode.add(this);\n this.attachedToParent = true; // To prevent multiple attachments to same parent.\n }\n },\n\n /**\n * Tell parentNode to remove this entity from itself.\n */\n removeFromParent: {\n value: function () {\n var parentEl = this.parentEl;\n this.parentEl.remove(this);\n this.attachedToParent = false;\n this.parentEl = null;\n parentEl.emit('child-detached', {el: this});\n }\n },\n\n load: {\n value: function () {\n var self = this;\n\n if (this.hasLoaded || !this.parentEl) { return; }\n\n ANode.prototype.load.call(this, function entityLoadCallback () {\n // Check if entity was detached while it was waiting to load.\n if (!self.parentEl) { return; }\n\n self.updateComponents();\n if (self.isScene || self.parentEl.isPlaying) { self.play(); }\n });\n },\n writable: window.debug\n },\n\n /**\n * Remove child entity.\n *\n * @param {Element} el - Child entity.\n */\n remove: {\n value: function (el) {\n if (el) {\n this.object3D.remove(el.object3D);\n } else {\n this.parentNode.removeChild(this);\n }\n }\n },\n\n /**\n * @returns {array} Direct children that are entities.\n */\n getChildEntities: {\n value: function () {\n var children = this.children;\n var childEntities = [];\n\n for (var i = 0; i < children.length; i++) {\n var child = children[i];\n if (child instanceof AEntity) {\n childEntities.push(child);\n }\n }\n\n return childEntities;\n }\n },\n\n /**\n * Initialize component.\n *\n * @param {string} attrName - Attribute name asociated to the component.\n * @param {object} data - Component data\n * @param {boolean} isDependency - True if the component is a dependency.\n */\n initComponent: {\n value: function (attrName, data, isDependency) {\n var component;\n var componentId;\n var componentInfo;\n var componentName;\n var isComponentDefined;\n\n componentInfo = utils.split(attrName, MULTIPLE_COMPONENT_DELIMITER);\n componentName = componentInfo[0];\n componentId = componentInfo.length > 2\n ? componentInfo.slice(1).join('__')\n : componentInfo[1];\n\n // Not a registered component.\n if (!COMPONENTS[componentName]) { return; }\n\n // Component is not a dependency and is undefined.\n // If a component is a dependency, then it is okay to have no data.\n isComponentDefined = checkComponentDefined(this, attrName) ||\n data !== undefined;\n if (!isComponentDefined && !isDependency) { return; }\n\n // Component already initialized.\n if (attrName in this.components) { return; }\n\n // Initialize dependencies first\n this.initComponentDependencies(componentName);\n\n // If component name has an id we check component type multiplic\n if (componentId && !COMPONENTS[componentName].multiple) {\n throw new Error('Trying to initialize multiple ' +\n 'components of type `' + componentName +\n '`. There can only be one component of this type per entity.');\n }\n component = new COMPONENTS[componentName].Component(this, data, componentId);\n if (this.isPlaying) { component.play(); }\n\n // Components are reflected in the DOM as attributes but the state is not shown\n // hence we set the attribute to empty string.\n // The flag justInitialized is for attributeChangedCallback to not overwrite\n // the component with the empty string.\n if (!this.hasAttribute(attrName)) {\n component.justInitialized = true;\n window.HTMLElement.prototype.setAttribute.call(this, attrName, '');\n }\n\n debug('Component initialized: %s', attrName);\n },\n writable: window.debug\n },\n\n /**\n * Initialize dependencies of a component.\n *\n * @param {string} name - Root component name.\n */\n initComponentDependencies: {\n value: function (name) {\n var self = this;\n var component = COMPONENTS[name];\n var dependencies;\n var i;\n\n // Not a component.\n if (!component) { return; }\n\n // No dependencies.\n dependencies = COMPONENTS[name].dependencies;\n\n if (!dependencies) { return; }\n\n // Initialize dependencies.\n for (i = 0; i < dependencies.length; i++) {\n // Call getAttribute to initialize the data from the DOM.\n self.initComponent(\n dependencies[i],\n window.HTMLElement.prototype.getAttribute.call(self, dependencies[i]) || undefined,\n true\n );\n }\n }\n },\n\n removeComponent: {\n value: function (name, destroy) {\n var component;\n\n component = this.components[name];\n if (!component) { return; }\n\n // Wait for component to initialize.\n if (!component.initialized) {\n this.addEventListener('componentinitialized', function tryRemoveLater (evt) {\n if (evt.detail.name !== name) { return; }\n this.removeComponent(name, destroy);\n this.removeEventListener('componentinitialized', tryRemoveLater);\n });\n return;\n }\n\n component.pause();\n component.remove();\n\n // Keep component attached to entity in case of just full entity detach.\n if (destroy) {\n component.destroy();\n delete this.components[name];\n }\n\n this.emit('componentremoved', component.evtDetail, false);\n },\n writable: window.debug\n },\n\n /**\n * Initialize or update all components.\n * Build data using initial components, defined attributes, mixins, and defaults.\n * Update default components before the rest.\n *\n * @member {function} getExtraComponents - Can be implemented to include component data\n * from other sources (e.g., implemented by primitives).\n */\n updateComponents: {\n value: function () {\n var data;\n var extraComponents;\n var i;\n var name;\n var componentsToUpdate = this.componentsToUpdate;\n\n if (!this.hasLoaded) { return; }\n\n // Gather mixin-defined components.\n for (i = 0; i < this.mixinEls.length; i++) {\n for (name in this.mixinEls[i].componentCache) {\n if (isComponent(name)) { componentsToUpdate[name] = true; }\n }\n }\n\n // Gather from extra initial component data if defined (e.g., primitives).\n if (this.getExtraComponents) {\n extraComponents = this.getExtraComponents();\n for (name in extraComponents) {\n if (isComponent(name)) { componentsToUpdate[name] = true; }\n }\n }\n\n // Gather entity-defined components.\n for (i = 0; i < this.attributes.length; ++i) {\n name = this.attributes[i].name;\n if (OBJECT3D_COMPONENTS.indexOf(name) !== -1) { continue; }\n if (isComponent(name)) { componentsToUpdate[name] = true; }\n }\n\n // object3D components first (position, rotation, scale, visible).\n for (i = 0; i < OBJECT3D_COMPONENTS.length; i++) {\n name = OBJECT3D_COMPONENTS[i];\n if (!this.hasAttribute(name)) { continue; }\n this.updateComponent(name, this.getDOMAttribute(name));\n }\n\n // Initialize or update rest of components.\n for (name in componentsToUpdate) {\n data = mergeComponentData(this.getDOMAttribute(name),\n extraComponents && extraComponents[name]);\n this.updateComponent(name, data);\n delete componentsToUpdate[name];\n }\n },\n writable: window.debug\n },\n\n /**\n * Initialize, update, or remove a single component.\n *\n * When initializing, we set the component on `this.components`.\n *\n * @param {string} attr - Component name.\n * @param {object} attrValue - Value of the DOM attribute.\n * @param {boolean} clobber - If new attrValue completely replaces previous properties.\n */\n updateComponent: {\n value: function (attr, attrValue, clobber) {\n var component = this.components[attr];\n\n if (component) {\n // Remove component.\n if (attrValue === null && !checkComponentDefined(this, attr)) {\n this.removeComponent(attr, true);\n return;\n }\n // Component already initialized. Update component.\n component.updateProperties(attrValue, clobber);\n return;\n }\n\n // Component not yet initialized. Initialize component.\n this.initComponent(attr, attrValue, false);\n }\n },\n\n /**\n * If `attr` is a component name, detach the component from the entity.\n *\n * If `propertyName` is given, reset the component property value to its default.\n *\n * @param {string} attr - Attribute name, which could also be a component name.\n * @param {string} propertyName - Component prop name, if resetting an individual prop.\n */\n removeAttribute: {\n value: function (attr, propertyName) {\n var component = this.components[attr];\n\n // Remove component.\n if (component && propertyName === undefined) {\n this.removeComponent(attr, true);\n }\n\n // Reset component property value.\n if (component && propertyName !== undefined) {\n component.resetProperty(propertyName);\n return;\n }\n\n // Remove mixins.\n if (attr === 'mixin') {\n this.mixinUpdate('');\n }\n\n window.HTMLElement.prototype.removeAttribute.call(this, attr);\n }\n },\n\n /**\n * Start dynamic behavior associated with entity such as dynamic components and animations.\n * Tell all children entities to also play.\n */\n play: {\n value: function () {\n var entities;\n var i;\n var key;\n\n // Already playing.\n if (this.isPlaying || !this.hasLoaded) { return; }\n this.isPlaying = true;\n\n // Wake up all components.\n for (key in this.components) { this.components[key].play(); }\n\n // Tell all child entities to play.\n entities = this.getChildEntities();\n for (i = 0; i < entities.length; i++) { entities[i].play(); }\n\n this.emit('play');\n },\n writable: true\n },\n\n /**\n * Pause dynamic behavior associated with entity such as dynamic components and animations.\n * Tell all children entities to also pause.\n */\n pause: {\n value: function () {\n var entities;\n var i;\n var key;\n\n if (!this.isPlaying) { return; }\n this.isPlaying = false;\n\n // Sleep all components.\n for (key in this.components) { this.components[key].pause(); }\n\n // Tell all child entities to pause.\n entities = this.getChildEntities();\n for (i = 0; i < entities.length; i++) { entities[i].pause(); }\n\n this.emit('pause');\n },\n writable: true\n },\n\n /**\n * Deals with updates on entity-specific attributes (i.e., components and mixins).\n *\n * @param {string} attr\n * @param {string} oldVal\n * @param {string|object} newVal\n */\n setEntityAttribute: {\n value: function (attr, oldVal, newVal) {\n if (COMPONENTS[attr] || this.components[attr]) {\n this.updateComponent(attr, newVal);\n return;\n }\n if (attr === 'mixin') {\n // Ignore if `<a-node>` code is just updating computed mixin in the DOM.\n if (newVal === this.computedMixinStr) { return; }\n this.mixinUpdate(newVal, oldVal);\n }\n }\n },\n\n /**\n * When mixins updated, trigger init or optimized-update of relevant components.\n */\n mixinUpdate: {\n value: (function () {\n var componentsUpdated = [];\n\n return function (newMixins, oldMixins) {\n var component;\n var mixinEl;\n var mixinIds;\n var i;\n var self = this;\n\n if (!this.hasLoaded) {\n this.addEventListener('loaded', function () {\n self.mixinUpdate(newMixins, oldMixins);\n }, ONCE);\n return;\n }\n\n oldMixins = oldMixins || this.getAttribute('mixin');\n mixinIds = this.updateMixins(newMixins, oldMixins);\n\n // Loop over current mixins.\n componentsUpdated.length = 0;\n for (i = 0; i < this.mixinEls.length; i++) {\n for (component in this.mixinEls[i].componentCache) {\n if (componentsUpdated.indexOf(component) === -1) {\n if (this.components[component]) {\n // Update. Just rebuild data.\n this.components[component].handleMixinUpdate();\n } else {\n // Init. buildData will gather mixin values.\n this.initComponent(component, null);\n }\n componentsUpdated.push(component);\n }\n }\n }\n\n // Loop over old mixins to call for data rebuild.\n for (i = 0; i < mixinIds.oldMixinIds.length; i++) {\n mixinEl = document.getElementById(mixinIds.oldMixinIds[i]);\n if (!mixinEl) { continue; }\n for (component in mixinEl.componentCache) {\n if (componentsUpdated.indexOf(component) === -1) {\n if (this.components[component]) {\n if (this.getDOMAttribute(component)) {\n // Update component if explicitly defined.\n this.components[component].handleMixinUpdate();\n } else {\n // Remove component if not explicitly defined.\n this.removeComponent(component, true);\n }\n }\n }\n }\n }\n };\n })()\n },\n\n /**\n * setAttribute can:\n *\n * 1. Set a single property of a multi-property component.\n * 2. Set multiple properties of a multi-property component.\n * 3. Replace properties of a multi-property component.\n * 4. Set a value for a single-property component, mixin, or normal HTML attribute.\n *\n * @param {string} attrName - Component or attribute name.\n * @param {*} arg1 - Can be a value, property name, CSS-style property string, or\n * object of properties.\n * @param {*|bool} arg2 - If arg1 is a property name, this should be a value. Otherwise,\n * it is a boolean indicating whether to clobber previous values (defaults to false).\n */\n setAttribute: {\n value: (function () {\n var singlePropUpdate = {};\n\n return function (attrName, arg1, arg2) {\n var newAttrValue;\n var clobber;\n var componentName;\n var delimiterIndex;\n var isDebugMode;\n var key;\n\n delimiterIndex = attrName.indexOf(MULTIPLE_COMPONENT_DELIMITER);\n componentName = delimiterIndex > 0 ? attrName.substring(0, delimiterIndex) : attrName;\n\n // Not a component. Normal set attribute.\n if (!COMPONENTS[componentName]) {\n if (attrName === 'mixin') { this.mixinUpdate(arg1); }\n ANode.prototype.setAttribute.call(this, attrName, arg1);\n return;\n }\n\n // Initialize component first if not yet initialized.\n if (!this.components[attrName] && this.hasAttribute(attrName)) {\n this.updateComponent(\n attrName,\n window.HTMLElement.prototype.getAttribute.call(this, attrName));\n }\n\n // Determine new attributes from the arguments\n if (typeof arg2 !== 'undefined' &&\n typeof arg1 === 'string' &&\n arg1.length > 0 &&\n typeof utils.styleParser.parse(arg1) === 'string') {\n // Update a single property of a multi-property component\n for (key in singlePropUpdate) { delete singlePropUpdate[key]; }\n newAttrValue = singlePropUpdate;\n newAttrValue[arg1] = arg2;\n clobber = false;\n } else {\n // Update with a value, object, or CSS-style property string, with the possiblity\n // of clobbering previous values.\n newAttrValue = arg1;\n clobber = (arg2 === true);\n }\n\n // Update component\n this.updateComponent(attrName, newAttrValue, clobber);\n\n // In debug mode, write component data up to the DOM.\n isDebugMode = this.sceneEl && this.sceneEl.getAttribute('debug');\n if (isDebugMode) { this.components[attrName].flushToDOM(); }\n };\n })(),\n writable: window.debug\n },\n\n /**\n * Reflect component data in the DOM (as seen from the browser DOM Inspector).\n *\n * @param {bool} recursive - Also flushToDOM on the children.\n **/\n flushToDOM: {\n value: function (recursive) {\n var components = this.components;\n var child;\n var children = this.children;\n var i;\n var key;\n\n // Flush entity's components to DOM.\n for (key in components) {\n components[key].flushToDOM();\n }\n\n // Recurse.\n if (!recursive) { return; }\n for (i = 0; i < children.length; ++i) {\n child = children[i];\n if (!child.flushToDOM) { continue; }\n child.flushToDOM(recursive);\n }\n }\n },\n\n /**\n * If `attr` is a component, returns ALL component data including applied mixins and\n * defaults.\n *\n * If `attr` is not a component, fall back to HTML getAttribute.\n *\n * @param {string} attr\n * @returns {object|string} Object if component, else string.\n */\n getAttribute: {\n value: function (attr) {\n // If component, return component data.\n var component;\n if (attr === 'position') { return this.object3D.position; }\n if (attr === 'rotation') { return getRotation(this); }\n if (attr === 'scale') { return this.object3D.scale; }\n if (attr === 'visible') { return this.object3D.visible; }\n component = this.components[attr];\n if (component) { return component.data; }\n return window.HTMLElement.prototype.getAttribute.call(this, attr);\n },\n writable: window.debug\n },\n\n /**\n * If `attr` is a component, returns JUST the component data defined on the entity.\n * Like a partial version of `getComputedAttribute` as returned component data\n * does not include applied mixins or defaults.\n *\n * If `attr` is not a component, fall back to HTML getAttribute.\n *\n * @param {string} attr\n * @returns {object|string} Object if component, else string.\n */\n getDOMAttribute: {\n value: function (attr) {\n // If cached value exists, return partial component data.\n var component = this.components[attr];\n if (component) { return component.attrValue; }\n return window.HTMLElement.prototype.getAttribute.call(this, attr);\n },\n writable: window.debug\n },\n\n addState: {\n value: function (state) {\n if (this.is(state)) { return; }\n this.states.push(state);\n this.emit('stateadded', state);\n }\n },\n\n removeState: {\n value: function (state) {\n var stateIndex = this.states.indexOf(state);\n if (stateIndex === -1) { return; }\n this.states.splice(stateIndex, 1);\n this.emit('stateremoved', state);\n }\n },\n\n /**\n * Checks if the element is in a given state. e.g. el.is('alive');\n * @type {string} state - Name of the state we want to check\n */\n is: {\n value: function (state) {\n return this.states.indexOf(state) !== -1;\n }\n },\n\n /**\n * Open Inspector to this entity.\n */\n inspect: {\n value: function () {\n this.sceneEl.components.inspector.openInspector(this);\n }\n },\n\n /**\n * Clean up memory and return memory to object pools.\n */\n destroy: {\n value: function () {\n var key;\n if (this.parentNode) {\n warn('Entity can only be destroyed if detached from scenegraph.');\n return;\n }\n for (key in this.components) {\n this.components[key].destroy();\n }\n }\n }\n});\n\n/**\n * Check if a component is *defined* for an entity, including defaults and mixins.\n * Does not check whether the component has been *initialized* for an entity.\n *\n * @param {string} el - Entity.\n * @param {string} name - Component name.\n * @returns {boolean}\n */\nfunction checkComponentDefined (el, name) {\n // Check if element contains the component.\n if (el.components[name] && el.components[name].attrValue) { return true; }\n\n return isComponentMixedIn(name, el.mixinEls);\n}\n\n/**\n * Check if any mixins contains a component.\n *\n * @param {string} name - Component name.\n * @param {array} mixinEls - Array of <a-mixin>s.\n */\nfunction isComponentMixedIn (name, mixinEls) {\n var i;\n var inMixin = false;\n for (i = 0; i < mixinEls.length; ++i) {\n inMixin = mixinEls[i].hasAttribute(name);\n if (inMixin) { break; }\n }\n return inMixin;\n}\n\n/**\n * Given entity defined value, merge in extra data if necessary.\n * Handle both single and multi-property components.\n *\n * @param {string} attrValue - Entity data.\n * @param extraData - Entity data from another source to merge in.\n */\nfunction mergeComponentData (attrValue, extraData) {\n // Extra data not defined, just return attrValue.\n if (!extraData) { return attrValue; }\n\n // Merge multi-property data.\n if (extraData.constructor === Object) {\n return utils.extend(extraData, utils.styleParser.parse(attrValue || {}));\n }\n\n // Return data, precendence to the defined value.\n return attrValue || extraData;\n}\n\nfunction isComponent (componentName) {\n if (componentName.indexOf(MULTIPLE_COMPONENT_DELIMITER) !== -1) {\n componentName = utils.split(componentName, MULTIPLE_COMPONENT_DELIMITER)[0];\n }\n if (!COMPONENTS[componentName]) { return false; }\n return true;\n}\n\nfunction getRotation (entityEl) {\n var radToDeg = THREE.Math.radToDeg;\n var rotation = entityEl.object3D.rotation;\n var rotationObj = entityEl.rotationObj;\n rotationObj.x = radToDeg(rotation.x);\n rotationObj.y = radToDeg(rotation.y);\n rotationObj.z = radToDeg(rotation.z);\n return rotationObj;\n}\n\nAEntity = registerElement('a-entity', {prototype: proto});\nmodule.exports = AEntity;\n","var ANode = require('./a-node');\nvar registerElement = require('./a-register-element').registerElement;\nvar components = require('./component').components;\nvar utils = require('../utils');\n\nvar MULTIPLE_COMPONENT_DELIMITER = '__';\n\n/**\n * @member {object} componentCache - Cache of pre-parsed values. An object where the keys\n * are component names and the values are already parsed by the component.\n */\nmodule.exports = registerElement('a-mixin', {\n prototype: Object.create(ANode.prototype, {\n createdCallback: {\n value: function () {\n this.componentCache = {};\n this.id = this.getAttribute('id');\n this.isMixin = true;\n }\n },\n\n attributeChangedCallback: {\n value: function (attr, oldVal, newVal) {\n this.cacheAttribute(attr, newVal);\n this.updateEntities();\n }\n },\n\n attachedCallback: {\n value: function () {\n this.sceneEl = this.closestScene();\n this.cacheAttributes();\n this.updateEntities();\n this.load();\n }\n },\n\n /**\n * setAttribute that parses and caches component values.\n */\n setAttribute: {\n value: function (attr, value) {\n window.HTMLElement.prototype.setAttribute.call(this, attr, value);\n this.cacheAttribute(attr, value);\n }\n },\n\n /**\n * If `attr` is a component, then parse the value using the schema and store it.\n */\n cacheAttribute: {\n value: function (attr, value) {\n var component;\n var componentName;\n\n // Get component data.\n componentName = utils.split(attr, MULTIPLE_COMPONENT_DELIMITER)[0];\n component = components[componentName];\n if (!component) { return; }\n if (value === undefined) {\n value = window.HTMLElement.prototype.getAttribute.call(this, attr);\n }\n this.componentCache[attr] = component.parseAttrValueForCache(value);\n }\n },\n\n /**\n * If `attr` is a component, then grab pre-parsed value from the cache.\n * Else do a normal getAttribute.\n */\n getAttribute: {\n value: function (attr) {\n return this.componentCache[attr] ||\n window.HTMLElement.prototype.getAttribute.call(this, attr);\n }\n },\n\n /**\n * Parse and cache every component defined on the mixin.\n */\n cacheAttributes: {\n value: function () {\n var attributes = this.attributes;\n var attrName;\n var i;\n for (i = 0; i < attributes.length; i++) {\n attrName = attributes[i].name;\n this.cacheAttribute(attrName);\n }\n }\n },\n\n /**\n * For entities that already have been loaded by the time the mixin was attached, tell\n * those entities to register the mixin and refresh their component data.\n */\n updateEntities: {\n value: function () {\n var entity;\n var entities;\n var i;\n\n if (!this.sceneEl) { return; }\n\n entities = this.sceneEl.querySelectorAll('[mixin~=' + this.id + ']');\n for (i = 0; i < entities.length; i++) {\n entity = entities[i];\n if (!entity.hasLoaded || entity.isMixin) { continue; }\n entity.mixinUpdate(this.id);\n }\n }\n }\n })\n});\n","/* global CustomEvent */\nvar registerElement = require('./a-register-element').registerElement;\nvar isNode = require('./a-register-element').isNode;\nvar utils = require('../utils/');\n\nvar warn = utils.debug('core:a-node:warn');\nvar error = utils.debug('core:a-node:error');\n\n/**\n * Base class for A-Frame that manages loading of objects.\n *\n * Nodes can be modified using mixins.\n * Nodes emit a `loaded` event when they and their children have initialized.\n */\nmodule.exports = registerElement('a-node', {\n prototype: Object.create(window.HTMLElement.prototype, {\n createdCallback: {\n value: function () {\n this.computedMixinStr = '';\n this.hasLoaded = false;\n this.isNode = true;\n this.mixinEls = [];\n },\n writable: window.debug\n },\n\n attachedCallback: {\n value: function () {\n var mixins;\n this.sceneEl = this.closestScene();\n\n if (!this.sceneEl) {\n warn('You are attempting to attach <' + this.tagName + '> outside of an A-Frame ' +\n 'scene. Append this element to `<a-scene>` instead.');\n }\n\n this.hasLoaded = false;\n this.emit('nodeready', undefined, false);\n\n if (!this.isMixin) {\n mixins = this.getAttribute('mixin');\n if (mixins) { this.updateMixins(mixins); }\n }\n },\n writable: window.debug\n },\n\n /**\n * Handle mixin.\n */\n attributeChangedCallback: {\n value: function (attr, oldVal, newVal) {\n // Ignore if `<a-node>` code is just updating computed mixin in the DOM.\n if (newVal === this.computedMixinStr) { return; }\n\n if (attr === 'mixin' && !this.isMixin) {\n this.updateMixins(newVal, oldVal);\n }\n }\n },\n\n /**\n * Returns the first scene by traversing up the tree starting from and\n * including receiver element.\n */\n closestScene: {\n value: function closest () {\n var element = this;\n while (element) {\n if (element.isScene) { break; }\n element = element.parentElement;\n }\n return element;\n }\n },\n\n /**\n * Returns first element matching a selector by traversing up the tree starting\n * from and including receiver element.\n *\n * @param {string} selector - Selector of element to find.\n */\n closest: {\n value: function closest (selector) {\n var matches = this.matches || this.mozMatchesSelector ||\n this.msMatchesSelector || this.oMatchesSelector || this.webkitMatchesSelector;\n var element = this;\n while (element) {\n if (matches.call(element, selector)) { break; }\n element = element.parentElement;\n }\n return element;\n }\n },\n\n detachedCallback: {\n value: function () {\n this.hasLoaded = false;\n }\n },\n\n /**\n * Wait for children to load, if any.\n * Then emit `loaded` event and set `hasLoaded`.\n */\n load: {\n value: function (cb, childFilter) {\n var children;\n var childrenLoaded;\n var self = this;\n\n if (this.hasLoaded) { return; }\n\n // Default to waiting for all nodes.\n childFilter = childFilter || isNode;\n // Wait for children to load (if any), then load.\n children = this.getChildren();\n childrenLoaded = children.filter(childFilter).map(function (child) {\n return new Promise(function waitForLoaded (resolve) {\n if (child.hasLoaded) { return resolve(); }\n child.addEventListener('loaded', resolve);\n });\n });\n\n Promise.all(childrenLoaded).then(function emitLoaded () {\n self.hasLoaded = true;\n if (cb) { cb(); }\n self.emit('loaded', undefined, false);\n }).catch(function (err) {\n error('Failure loading node: ', err);\n });\n },\n writable: true\n },\n\n getChildren: {\n value: function () {\n return Array.prototype.slice.call(this.children, 0);\n }\n },\n\n /**\n * Unregister old mixins and listeners.\n * Register new mixins and listeners.\n * Registering means to update `this.mixinEls` with listeners.\n */\n updateMixins: {\n value: (function () {\n var newMixinIdArray = [];\n var oldMixinIdArray = [];\n var mixinIds = {};\n\n return function (newMixins, oldMixins) {\n var i;\n var newMixinIds;\n var oldMixinIds;\n\n newMixinIdArray.length = 0;\n oldMixinIdArray.length = 0;\n newMixinIds = newMixins ? utils.split(newMixins.trim(), /\\s+/) : newMixinIdArray;\n oldMixinIds = oldMixins ? utils.split(oldMixins.trim(), /\\s+/) : oldMixinIdArray;\n\n mixinIds.newMixinIds = newMixinIds;\n mixinIds.oldMixinIds = oldMixinIds;\n\n // Unregister old mixins.\n for (i = 0; i < oldMixinIds.length; i++) {\n if (newMixinIds.indexOf(oldMixinIds[i]) === -1) {\n this.unregisterMixin(oldMixinIds[i]);\n }\n }\n\n // Register new mixins.\n this.computedMixinStr = '';\n this.mixinEls.length = 0;\n for (i = 0; i < newMixinIds.length; i++) {\n this.registerMixin(document.getElementById(newMixinIds[i]));\n }\n\n // Update DOM. Keep track of `computedMixinStr` to not recurse back here after\n // update.\n if (this.computedMixinStr) {\n this.computedMixinStr = this.computedMixinStr.trim();\n window.HTMLElement.prototype.setAttribute.call(this, 'mixin',\n this.computedMixinStr);\n }\n\n return mixinIds;\n };\n })()\n },\n\n /**\n * From mixin ID, add mixin element to `mixinEls`.\n *\n * @param {Element} mixinEl\n */\n registerMixin: {\n value: function (mixinEl) {\n var compositedMixinIds;\n var i;\n var mixin;\n\n if (!mixinEl) { return; }\n\n // Register composited mixins (if mixin has mixins).\n mixin = mixinEl.getAttribute('mixin');\n if (mixin) {\n compositedMixinIds = utils.split(mixin.trim(), /\\s+/);\n for (i = 0; i < compositedMixinIds.length; i++) {\n this.registerMixin(document.getElementById(compositedMixinIds[i]));\n }\n }\n\n // Register mixin.\n this.computedMixinStr = this.computedMixinStr + ' ' + mixinEl.id;\n this.mixinEls.push(mixinEl);\n }\n },\n\n setAttribute: {\n value: function (attr, newValue) {\n if (attr === 'mixin') { this.updateMixins(newValue); }\n window.HTMLElement.prototype.setAttribute.call(this, attr, newValue);\n }\n },\n\n unregisterMixin: {\n value: function (mixinId) {\n var i;\n var mixinEls = this.mixinEls;\n var mixinEl;\n for (i = 0; i < mixinEls.length; ++i) {\n mixinEl = mixinEls[i];\n if (mixinId === mixinEl.id) {\n mixinEls.splice(i, 1);\n break;\n }\n }\n }\n },\n\n /**\n * Emit a DOM event.\n *\n * @param {string} name - Name of event.\n * @param {object} [detail={}] - Custom data to pass as `detail` to the event.\n * @param {boolean} [bubbles=true] - Whether the event should bubble.\n * @param {object} [extraData] - Extra data to pass to the event, if any.\n */\n emit: {\n value: (function () {\n var data = {};\n\n return function (name, detail, bubbles, extraData) {\n if (bubbles === undefined) { bubbles = true; }\n data.bubbles = !!bubbles;\n data.detail = detail;\n\n // If extra data is present, we need to create a new object.\n if (extraData) { data = utils.extend({}, extraData, data); }\n\n this.dispatchEvent(new CustomEvent(name, data));\n };\n })(),\n writable: window.debug\n }\n })\n});\n","/*\n ------------------------------------------------------------\n ------------- WARNING WARNING WARNING WARNING --------------\n ------------------------------------------------------------\n\n This module wraps registerElement to deal with components that inherit from\n `ANode` and `AEntity`. It's a pass through in any other case.\n\n It wraps some of the prototype methods of the created element to make sure\n that the corresponding functions in the base prototypes (`AEntity` and `ANode`)\n are also invoked. The method in the base prototype is always called before the one\n in the derived prototype.\n*/\n\n// Polyfill `document.registerElement`.\nrequire('document-register-element');\n\nvar ANode; // Must declare before AEntity. Initialized at the bottom.\nvar AEntity;\nvar knownTags = module.exports.knownTags = {};\n\nfunction addTagName (tagName) {\n knownTags[tagName.toLowerCase()] = true;\n}\n\n/**\n * Return whether the element type is one of our known registered ones.\n *\n * @param {string} node - The name of the tag to register.\n * @returns {boolean} Whether the tag name matches that of our registered custom elements.\n */\nmodule.exports.isNode = function (node) {\n return node.tagName.toLowerCase() in knownTags || node.isNode;\n};\n\n/**\n * @param {string} tagName - The name of the tag to register.\n * @param {object} obj - The prototype of the new element.\n * @returns {object} The prototype of the new element.\n */\nmodule.exports.registerElement = function (tagName, obj) {\n var proto = Object.getPrototypeOf(obj.prototype);\n var newObj = obj;\n var isANode = ANode && proto === ANode.prototype;\n var isAEntity = AEntity && proto === AEntity.prototype;\n\n if (isANode || isAEntity) { addTagName(tagName); }\n\n // Wrap if element inherits from `ANode`.\n if (isANode) {\n newObj = wrapANodeMethods(obj.prototype);\n newObj = {prototype: Object.create(proto, newObj)};\n }\n\n // Wrap if element inherits from `AEntity`.\n if (isAEntity) {\n newObj = wrapAEntityMethods(obj.prototype);\n newObj = {prototype: Object.create(proto, newObj)};\n }\n\n // Give all functions their proper name.\n Object.getOwnPropertyNames(newObj.prototype).forEach(function (propName) {\n var propVal = newObj.prototype[propName];\n if (typeof propVal === 'function') {\n propVal.displayName = propName;\n }\n });\n\n return document.registerElement(tagName, newObj);\n};\n\n/**\n * Wrap some obj methods to call those on `ANode` base prototype.\n *\n * @param {object} obj - Object that contains the methods that will be wrapped.\n * @return {object} An object with the same properties as the input parameter but\n * with some of methods wrapped.\n */\nfunction wrapANodeMethods (obj) {\n var newObj = {};\n var ANodeMethods = [\n 'attachedCallback',\n 'attributeChangedCallback',\n 'createdCallback',\n 'detachedCallback'\n ];\n wrapMethods(newObj, ANodeMethods, obj, ANode.prototype);\n copyProperties(obj, newObj);\n return newObj;\n}\n\n/**\n * This wraps some of the obj methods to call those on `AEntity` base prototype.\n *\n * @param {object} obj - The objects that contains the methods that will be wrapped.\n * @return {object} - An object with the same properties as the input parameter but\n * with some of methods wrapped.\n */\nfunction wrapAEntityMethods (obj) {\n var newObj = {};\n var ANodeMethods = [\n 'attachedCallback',\n 'attributeChangedCallback',\n 'createdCallback',\n 'detachedCallback'\n ];\n var AEntityMethods = [\n 'attachedCallback',\n 'attributeChangedCallback',\n 'createdCallback',\n 'detachedCallback'\n ];\n\n wrapMethods(newObj, ANodeMethods, obj, ANode.prototype);\n wrapMethods(newObj, AEntityMethods, obj, AEntity.prototype);\n // Copies the remaining properties into the new object.\n copyProperties(obj, newObj);\n return newObj;\n}\n\n/**\n * Wrap a list a methods to ensure that those in the base prototype are called\n * before the derived one.\n *\n * @param {object} targetObj - Object that will contain the wrapped methods.\n * @param {array} methodList - List of methods from the derivedObj that will be wrapped.\n * @param {object} derivedObject - Object that inherits from the baseObj.\n * @param {object} baseObj - Object that derivedObj inherits from.\n */\nfunction wrapMethods (targetObj, methodList, derivedObj, baseObj) {\n methodList.forEach(function (methodName) {\n wrapMethod(targetObj, methodName, derivedObj, baseObj);\n });\n}\nmodule.exports.wrapMethods = wrapMethods;\n\n/**\n * Wrap one method to ensure that the one in the base prototype is called before\n * the one in the derived one.\n *\n * @param {object} obj - Object that will contain the wrapped method.\n * @param {string} methodName - The name of the method that will be wrapped.\n * @param {object} derivedObject - Object that inherits from the baseObj.\n * @param {object} baseObj - Object that derivedObj inherits from.\n */\nfunction wrapMethod (obj, methodName, derivedObj, baseObj) {\n var derivedMethod = derivedObj[methodName];\n var baseMethod = baseObj[methodName];\n\n // Derived prototype does not define method, no need to wrap.\n if (!derivedMethod || !baseMethod) { return; }\n\n // Derived prototype doesn't override the one in the base one, no need to wrap.\n if (derivedMethod === baseMethod) { return; }\n\n // Wrap to ensure the base method is called before the one in the derived prototype.\n obj[methodName] = {\n value: function wrappedMethod () {\n baseMethod.apply(this, arguments);\n return derivedMethod.apply(this, arguments);\n },\n writable: window.debug\n };\n}\n\n/**\n * It copies the properties from source to destination object if they don't\n * exist already.\n *\n * @param {object} source - The object where properties are copied from.\n * @param {type} destination - The object where properties are copied to.\n */\nfunction copyProperties (source, destination) {\n var props = Object.getOwnPropertyNames(source);\n props.forEach(function (prop) {\n var desc;\n if (!destination[prop]) {\n desc = Object.getOwnPropertyDescriptor(source, prop);\n destination[prop] = {value: source[prop], writable: desc.writable};\n }\n });\n}\n\nANode = require('./a-node');\nAEntity = require('./a-entity');\n","/* global Node */\nvar schema = require('./schema');\nvar scenes = require('./scene/scenes');\nvar systems = require('./system');\nvar utils = require('../utils/');\n\nvar components = module.exports.components = {}; // Keep track of registered components.\nvar parseProperties = schema.parseProperties;\nvar parseProperty = schema.parseProperty;\nvar processSchema = schema.process;\nvar isSingleProp = schema.isSingleProperty;\nvar stringifyProperties = schema.stringifyProperties;\nvar stringifyProperty = schema.stringifyProperty;\nvar styleParser = utils.styleParser;\nvar warn = utils.debug('core:component:warn');\n\nvar aframeScript = document.currentScript;\nvar upperCaseRegExp = new RegExp('[A-Z]+');\n\n// Object pools by component, created upon registration.\nvar objectPools = {};\n\n/**\n * Component class definition.\n *\n * Components configure appearance, modify behavior, or add functionality to\n * entities. The behavior and appearance of an entity can be changed at runtime\n * by adding, removing, or updating components. Entities do not share instances\n * of components.\n *\n * @member {object} el - Reference to the entity element.\n * @member {string} attrValue - Value of the corresponding HTML attribute.\n * @member {object} data - Component data populated by parsing the\n * mapped attribute of the component plus applying defaults and mixins.\n */\nvar Component = module.exports.Component = function (el, attrValue, id) {\n var self = this;\n this.el = el;\n this.id = id;\n this.attrName = this.name + (id ? '__' + id : '');\n this.evtDetail = {id: this.id, name: this.name};\n this.initialized = false;\n this.isSingleProperty = isSingleProp(this.schema);\n this.isSinglePropertyObject = this.isSingleProperty &&\n isObject(parseProperty(undefined, this.schema)) &&\n !(this.schema.default instanceof window.HTMLElement);\n this.isObjectBased = !this.isSingleProperty || this.isSinglePropertyObject;\n this.el.components[this.attrName] = this;\n this.objectPool = objectPools[this.name];\n\n const events = this.events;\n this.events = {};\n eventsBind(this, events);\n\n // Store component data from previous update call.\n this.attrValue = undefined;\n if (this.isObjectBased) {\n this.nextData = this.objectPool.use();\n // Drop any properties added by dynamic schemas in previous use\n utils.objectPool.removeUnusedKeys(this.nextData, this.schema);\n this.oldData = this.objectPool.use();\n utils.objectPool.removeUnusedKeys(this.oldData, this.schema);\n this.previousOldData = this.objectPool.use();\n utils.objectPool.removeUnusedKeys(this.previousOldData, this.schema);\n this.parsingAttrValue = this.objectPool.use();\n utils.objectPool.removeUnusedKeys(this.parsingAttrValue, this.schema);\n } else {\n this.nextData = undefined;\n this.oldData = undefined;\n this.previousOldData = undefined;\n this.parsingAttrValue = undefined;\n }\n\n // Last value passed to updateProperties.\n this.throttledEmitComponentChanged = utils.throttle(function emitChange () {\n el.emit('componentchanged', self.evtDetail, false);\n }, 200);\n this.updateProperties(attrValue);\n};\n\nComponent.prototype = {\n /**\n * Contains the type schema and defaults for the data values.\n * Data is coerced into the types of the values of the defaults.\n */\n schema: {},\n\n /**\n * Init handler. Similar to attachedCallback.\n * Called during component initialization and is only run once.\n * Components can use this to set initial state.\n */\n init: function () { /* no-op */ },\n\n /**\n * Map of event names to binded event handlers that will be lifecycle-handled.\n * Will be detached on pause / remove.\n * Will be attached on play.\n */\n events: {},\n\n /**\n * Update handler. Similar to attributeChangedCallback.\n * Called whenever component's data changes.\n * Also called on component initialization when the component receives initial data.\n *\n * @param {object} prevData - Previous attributes of the component.\n */\n update: function (prevData) { /* no-op */ },\n\n updateSchema: undefined,\n\n /**\n * Tick handler.\n * Called on each tick of the scene render loop.\n * Affected by play and pause.\n *\n * @param {number} time - Scene tick time.\n * @param {number} timeDelta - Difference in current render time and previous render time.\n */\n tick: undefined,\n\n /**\n * Tock handler.\n * Called on each tock of the scene render loop.\n * Affected by play and pause.\n *\n * @param {number} time - Scene tick time.\n * @param {number} timeDelta - Difference in current render time and previous render time.\n * @param {object} camera - Camera used to render the last frame.\n */\n tock: undefined,\n\n /**\n * Called to start any dynamic behavior (e.g., animation, AI, events, physics).\n */\n play: function () { /* no-op */ },\n\n /**\n * Called to stop any dynamic behavior (e.g., animation, AI, events, physics).\n */\n pause: function () { /* no-op */ },\n\n /**\n * Remove handler. Similar to detachedCallback.\n * Called whenever component is removed from the entity (i.e., removeAttribute).\n * Components can use this to reset behavior on the entity.\n */\n remove: function () { /* no-op */ },\n\n /**\n * Parses each property based on property type.\n * If component is single-property, then parses the single property value.\n *\n * @param {string} value - HTML attribute value.\n * @param {boolean} silent - Suppress warning messages.\n * @returns {object} Component data.\n */\n parse: function (value, silent) {\n var schema = this.schema;\n if (this.isSingleProperty) { return parseProperty(value, schema); }\n return parseProperties(styleParser.parse(value), schema, true, this.name, silent);\n },\n\n /**\n * Stringify properties if necessary.\n *\n * Only called from `Entity.setAttribute` for properties whose parsers accept a non-string\n * value (e.g., selector, vec3 property types).\n *\n * @param {object} data - Complete component data.\n * @returns {string}\n */\n stringify: function (data) {\n var schema = this.schema;\n if (typeof data === 'string') { return data; }\n if (this.isSingleProperty) { return stringifyProperty(data, schema); }\n data = stringifyProperties(data, schema);\n return styleParser.stringify(data);\n },\n\n /**\n * Update the cache of the pre-parsed attribute value.\n *\n * @param {string} value - New data.\n * @param {boolean } clobber - Whether to wipe out and replace previous data.\n */\n updateCachedAttrValue: function (value, clobber) {\n var newAttrValue;\n var tempObject;\n var property;\n\n if (value === undefined) { return; }\n\n // If null value is the new attribute value, make the attribute value falsy.\n if (value === null) {\n if (this.isObjectBased && this.attrValue) {\n this.objectPool.recycle(this.attrValue);\n }\n this.attrValue = undefined;\n return;\n }\n\n if (value instanceof Object && !(value instanceof window.HTMLElement)) {\n // If value is an object, copy it to our pooled newAttrValue object to use to update\n // the attrValue.\n tempObject = this.objectPool.use();\n newAttrValue = utils.extend(tempObject, value);\n } else {\n newAttrValue = this.parseAttrValueForCache(value);\n }\n\n // Merge new data with previous `attrValue` if updating and not clobbering.\n if (this.isObjectBased && !clobber && this.attrValue) {\n for (property in this.attrValue) {\n if (newAttrValue[property] === undefined) {\n newAttrValue[property] = this.attrValue[property];\n }\n }\n }\n\n // Update attrValue.\n if (this.isObjectBased && !this.attrValue) {\n this.attrValue = this.objectPool.use();\n }\n utils.objectPool.clearObject(this.attrValue);\n this.attrValue = extendProperties(this.attrValue, newAttrValue, this.isObjectBased);\n utils.objectPool.clearObject(tempObject);\n },\n\n /**\n * Given an HTML attribute value parses the string based on the component schema.\n * To avoid double parsings of strings into strings we store the original instead\n * of the parsed one\n *\n * @param {string} value - HTML attribute value\n */\n parseAttrValueForCache: function (value) {\n var parsedValue;\n if (typeof value !== 'string') { return value; }\n if (this.isSingleProperty) {\n parsedValue = this.schema.parse(value);\n /**\n * To avoid bogus double parsings. Cached values will be parsed when building\n * component data. For instance when parsing a src id to its url, we want to cache\n * original string and not the parsed one (#monster -> models/monster.dae)\n * so when building data we parse the expected value.\n */\n if (typeof parsedValue === 'string') { parsedValue = value; }\n } else {\n // Parse using the style parser to avoid double parsing of individual properties.\n utils.objectPool.clearObject(this.parsingAttrValue);\n parsedValue = styleParser.parse(value, this.parsingAttrValue);\n }\n return parsedValue;\n },\n\n /**\n * Write cached attribute data to the entity DOM element.\n *\n * @param {boolean} isDefault - Whether component is a default component. Always flush for\n * default components.\n */\n flushToDOM: function (isDefault) {\n var attrValue = isDefault ? this.data : this.attrValue;\n if (attrValue === null || attrValue === undefined) { return; }\n window.HTMLElement.prototype.setAttribute.call(this.el, this.attrName,\n this.stringify(attrValue));\n },\n\n /**\n * Apply new component data if data has changed (from setAttribute).\n *\n * @param {string} attrValue - HTML attribute value.\n * If undefined, use the cached attribute value and continue updating properties.\n * @param {boolean} clobber - The previous component data is overwritten by the atrrValue\n */\n updateProperties: function (attrValue, clobber) {\n var el = this.el;\n\n // Just cache the attribute if the entity has not loaded\n // Components are not initialized until the entity has loaded\n if (!el.hasLoaded) {\n this.updateCachedAttrValue(attrValue);\n return;\n }\n\n // Parse the attribute value.\n // Cache current attrValue for future updates. Updates `this.attrValue`.\n // `null` means no value on purpose, do not set a default value, let mixins take over.\n if (attrValue !== null) {\n attrValue = this.parseAttrValueForCache(attrValue);\n }\n\n // Cache current attrValue for future updates.\n this.updateCachedAttrValue(attrValue, clobber);\n\n if (this.initialized) {\n this.updateComponent(attrValue, clobber);\n this.callUpdateHandler();\n } else {\n this.initComponent();\n }\n },\n\n initComponent: function () {\n var el = this.el;\n var initialOldData;\n\n // Build data.\n if (this.updateSchema) { this.updateSchema(this.buildData(this.attrValue, false, true)); }\n this.data = this.buildData(this.attrValue);\n\n // Component is being already initialized.\n if (el.initializingComponents[this.name]) { return; }\n\n // Prevent infinite loop in case of init method setting same component on the entity.\n el.initializingComponents[this.name] = true;\n // Initialize component.\n this.init();\n this.initialized = true;\n delete el.initializingComponents[this.name];\n\n // Store current data as previous data for future updates.\n this.oldData = extendProperties(this.oldData, this.data, this.isObjectBased);\n\n // For oldData, pass empty object to multiple-prop schemas or object single-prop schema.\n // Pass undefined to rest of types.\n initialOldData = this.isObjectBased ? this.objectPool.use() : undefined;\n this.update(initialOldData);\n if (this.isObjectBased) { this.objectPool.recycle(initialOldData); }\n\n // Play the component if the entity is playing.\n if (el.isPlaying) { this.play(); }\n el.emit('componentinitialized', this.evtDetail, false);\n },\n\n /**\n * @param attrValue - Passed argument from setAttribute.\n */\n updateComponent: function (attrValue, clobber) {\n var key;\n var mayNeedSchemaUpdate;\n\n if (clobber) {\n // Clobber. Rebuild.\n if (this.updateSchema) {\n this.updateSchema(this.buildData(this.attrValue, true, true));\n }\n this.data = this.buildData(this.attrValue, true, false);\n return;\n }\n\n // Apply new value to this.data in place since direct update.\n if (this.isSingleProperty) {\n if (this.isObjectBased) {\n parseProperty(attrValue, this.schema);\n }\n // Single-property (already parsed).\n this.data = attrValue;\n return;\n }\n\n parseProperties(attrValue, this.schema, true, this.name);\n\n // Check if we need to update schema.\n if (this.schemaChangeKeys.length) {\n for (key in attrValue) {\n if (this.schema[key].schemaChange) {\n mayNeedSchemaUpdate = true;\n break;\n }\n }\n }\n if (mayNeedSchemaUpdate) {\n // Rebuild data if need schema update.\n if (this.updateSchema) {\n this.updateSchema(this.buildData(this.attrValue, true, true));\n }\n this.data = this.buildData(this.attrValue, true, false);\n return;\n }\n\n // Normal update.\n for (key in attrValue) {\n if (attrValue[key] === undefined) { continue; }\n this.data[key] = attrValue[key];\n }\n },\n\n /**\n * Check if component should fire update and fire update lifecycle handler.\n */\n callUpdateHandler: function () {\n var hasComponentChanged;\n\n // Store the previous old data before we calculate the new oldData.\n if (this.previousOldData instanceof Object) {\n utils.objectPool.clearObject(this.previousOldData);\n }\n if (this.isObjectBased) {\n copyData(this.previousOldData, this.oldData);\n } else {\n this.previousOldData = this.oldData;\n }\n\n hasComponentChanged = !utils.deepEqual(this.oldData, this.data);\n\n // Don't update if properties haven't changed.\n // Always update rotation, position, scale.\n if (!this.isPositionRotationScale && !hasComponentChanged) { return; }\n\n // Store current data as previous data for future updates.\n // Reuse `this.oldData` object to try not to allocate another one.\n if (this.oldData instanceof Object) { utils.objectPool.clearObject(this.oldData); }\n this.oldData = extendProperties(this.oldData, this.data, this.isObjectBased);\n\n // Update component with the previous old data.\n this.update(this.previousOldData);\n\n this.throttledEmitComponentChanged();\n },\n\n handleMixinUpdate: function () {\n this.data = this.buildData(this.attrValue);\n this.callUpdateHandler();\n },\n\n /**\n * Reset value of a property to the property's default value.\n * If single-prop component, reset value to component's default value.\n *\n * @param {string} propertyName - Name of property to reset.\n */\n resetProperty: function (propertyName) {\n if (this.isObjectBased) {\n if (!(propertyName in this.attrValue)) { return; }\n delete this.attrValue[propertyName];\n this.data[propertyName] = this.schema[propertyName].default;\n } else {\n this.attrValue = this.schema.default;\n this.data = this.schema.default;\n }\n this.updateProperties(this.attrValue);\n },\n\n /**\n * Extend schema of component given a partial schema.\n *\n * Some components might want to mutate their schema based on certain properties.\n * e.g., Material component changes its schema based on `shader` to account for different\n * uniforms\n *\n * @param {object} schemaAddon - Schema chunk that extend base schema.\n */\n extendSchema: function (schemaAddon) {\n var extendedSchema;\n // Clone base schema.\n extendedSchema = utils.extend({}, components[this.name].schema);\n // Extend base schema with new schema chunk.\n utils.extend(extendedSchema, schemaAddon);\n this.schema = processSchema(extendedSchema);\n this.el.emit('schemachanged', this.evtDetail);\n },\n\n /**\n * Build component data from the current state of the entity.data.\n *\n * Precedence:\n * 1. Defaults data\n * 2. Mixin data.\n * 3. Attribute data.\n *\n * Finally coerce the data to the types of the defaults.\n *\n * @param {object} newData - Element new data.\n * @param {boolean} clobber - The previous data is completely replaced by the new one.\n * @param {boolean} silent - Suppress warning messages.\n * @return {object} The component data\n */\n buildData: function (newData, clobber, silent) {\n var componentDefined;\n var data;\n var defaultValue;\n var key;\n var mixinData;\n var nextData = this.nextData;\n var schema = this.schema;\n var i;\n var mixinEls = this.el.mixinEls;\n var previousData;\n\n // Whether component has a defined value. For arrays, treat empty as not defined.\n componentDefined = newData && newData.constructor === Array\n ? newData.length\n : newData !== undefined && newData !== null;\n\n if (this.isObjectBased) { utils.objectPool.clearObject(nextData); }\n\n // 1. Gather default values (lowest precendence).\n if (this.isSingleProperty) {\n if (this.isObjectBased) {\n // If object-based single-prop, then copy over the data to our pooled object.\n data = copyData(nextData, schema.default);\n } else {\n // If is plain single-prop, copy by value the default.\n data = isObjectOrArray(schema.default)\n ? utils.clone(schema.default)\n : schema.default;\n }\n } else {\n // Preserve previously set properties if clobber not enabled.\n previousData = !clobber && this.attrValue;\n\n // Clone default value if object so components don't share object\n data = previousData instanceof Object\n ? copyData(nextData, previousData)\n : nextData;\n\n // Apply defaults.\n for (key in schema) {\n defaultValue = schema[key].default;\n if (data[key] !== undefined) { continue; }\n // Clone default value if object so components don't share object\n data[key] = isObjectOrArray(defaultValue)\n ? utils.clone(defaultValue)\n : defaultValue;\n }\n }\n\n // 2. Gather mixin values.\n for (i = 0; i < mixinEls.length; i++) {\n mixinData = mixinEls[i].getAttribute(this.attrName);\n if (!mixinData) { continue; }\n data = extendProperties(data, mixinData, this.isObjectBased);\n }\n\n // 3. Gather attribute values (highest precendence).\n if (componentDefined) {\n if (this.isSingleProperty) {\n // If object-based, copy the value to not modify the original.\n if (isObject(newData)) {\n copyData(this.parsingAttrValue, newData);\n return parseProperty(this.parsingAttrValue, schema);\n }\n return parseProperty(newData, schema);\n }\n data = extendProperties(data, newData, this.isObjectBased);\n } else {\n // Parse and coerce using the schema.\n if (this.isSingleProperty) { return parseProperty(data, schema); }\n }\n\n return parseProperties(data, schema, undefined, this.name, silent);\n },\n\n /**\n * Attach events from component-defined events map.\n */\n eventsAttach: function () {\n var eventName;\n // Safety detach to prevent double-registration.\n this.eventsDetach();\n for (eventName in this.events) {\n this.el.addEventListener(eventName, this.events[eventName]);\n }\n },\n\n /**\n * Detach events from component-defined events map.\n */\n eventsDetach: function () {\n var eventName;\n for (eventName in this.events) {\n this.el.removeEventListener(eventName, this.events[eventName]);\n }\n },\n\n /**\n * Release and free memory.\n */\n destroy: function () {\n this.objectPool.recycle(this.attrValue);\n this.objectPool.recycle(this.oldData);\n this.objectPool.recycle(this.parsingAttrValue);\n this.attrValue = this.oldData = this.parsingAttrValue = undefined;\n }\n};\n\nfunction eventsBind (component, events) {\n var eventName;\n for (eventName in events) {\n component.events[eventName] = events[eventName].bind(component);\n }\n}\n\n// For testing.\nif (window.debug) {\n var registrationOrderWarnings = module.exports.registrationOrderWarnings = {};\n}\n\n/**\n * Register a component to A-Frame.\n *\n * @param {string} name - Component name.\n * @param {object} definition - Component schema and lifecycle method handlers.\n * @returns {object} Component.\n */\nmodule.exports.registerComponent = function (name, definition) {\n var NewComponent;\n var propertyName;\n var proto = {};\n var schema;\n var schemaIsSingleProp;\n\n // Warning if component is statically registered after the scene.\n if (document.currentScript && document.currentScript !== aframeScript) {\n scenes.forEach(function checkPosition (sceneEl) {\n // Okay to register component after the scene at runtime.\n if (sceneEl.hasLoaded) { return; }\n\n // Check that component is declared before the scene.\n if (document.currentScript.compareDocumentPosition(sceneEl) ===\n Node.DOCUMENT_POSITION_FOLLOWING) { return; }\n\n warn('The component `' + name + '` was registered in a <script> tag after the scene. ' +\n 'Component <script> tags in an HTML file should be declared *before* the scene ' +\n 'such that the component is available to entities during scene initialization.');\n\n // For testing.\n if (window.debug) { registrationOrderWarnings[name] = true; }\n });\n }\n\n if (upperCaseRegExp.test(name) === true) {\n warn('The component name `' + name + '` contains uppercase characters, but ' +\n 'HTML will ignore the capitalization of attribute names. ' +\n 'Change the name to be lowercase: `' + name.toLowerCase() + '`');\n }\n\n if (name.indexOf('__') !== -1) {\n throw new Error('The component name `' + name + '` is not allowed. ' +\n 'The sequence __ (double underscore) is reserved to specify an id' +\n ' for multiple components of the same type');\n }\n\n // Format definition object to prototype object.\n Object.keys(definition).forEach(function (key) {\n proto[key] = {\n value: definition[key],\n writable: true\n };\n });\n\n if (components[name]) {\n throw new Error('The component `' + name + '` has been already registered. ' +\n 'Check that you are not loading two versions of the same component ' +\n 'or two different components of the same name.');\n }\n\n NewComponent = function (el, attr, id) {\n Component.call(this, el, attr, id);\n };\n\n NewComponent.prototype = Object.create(Component.prototype, proto);\n NewComponent.prototype.name = name;\n NewComponent.prototype.isPositionRotationScale =\n name === 'position' || name === 'rotation' || name === 'scale';\n NewComponent.prototype.constructor = NewComponent;\n NewComponent.prototype.system = systems && systems.systems[name];\n NewComponent.prototype.play = wrapPlay(NewComponent.prototype.play);\n NewComponent.prototype.pause = wrapPause(NewComponent.prototype.pause);\n\n schema = utils.extend(processSchema(NewComponent.prototype.schema,\n NewComponent.prototype.name));\n schemaIsSingleProp = isSingleProp(NewComponent.prototype.schema);\n\n // Keep track of keys that may potentially change the schema.\n if (!schemaIsSingleProp) {\n NewComponent.prototype.schemaChangeKeys = [];\n for (propertyName in schema) {\n if (schema[propertyName].schemaChange) {\n NewComponent.prototype.schemaChangeKeys.push(propertyName);\n }\n }\n }\n\n // Create object pool for class of components.\n objectPools[name] = utils.objectPool.createPool();\n\n components[name] = {\n Component: NewComponent,\n dependencies: NewComponent.prototype.dependencies,\n isSingleProp: schemaIsSingleProp,\n multiple: NewComponent.prototype.multiple,\n name: name,\n parse: NewComponent.prototype.parse,\n parseAttrValueForCache: NewComponent.prototype.parseAttrValueForCache,\n schema: schema,\n stringify: NewComponent.prototype.stringify,\n type: NewComponent.prototype.type\n };\n return NewComponent;\n};\n\n/**\n* Clone component data.\n* Clone only the properties that are plain objects while keeping a reference for the rest.\n*\n* @param data - Component data to clone.\n* @returns Cloned data.\n*/\nfunction copyData (dest, sourceData) {\n var parsedProperty;\n var key;\n for (key in sourceData) {\n if (sourceData[key] === undefined) { continue; }\n parsedProperty = sourceData[key];\n dest[key] = isObjectOrArray(parsedProperty)\n ? utils.clone(parsedProperty)\n : parsedProperty;\n }\n return dest;\n}\n\n/**\n* Object extending with checking for single-property schema.\n*\n* @param dest - Destination object or value.\n* @param source - Source object or value\n* @param {boolean} isObjectBased - Whether values are objects.\n* @returns Overridden object or value.\n*/\nfunction extendProperties (dest, source, isObjectBased) {\n var key;\n if (isObjectBased && source.constructor === Object) {\n for (key in source) {\n if (source[key] === undefined) { continue; }\n if (source[key] && source[key].constructor === Object) {\n dest[key] = utils.clone(source[key]);\n } else {\n dest[key] = source[key];\n }\n }\n return dest;\n }\n return source;\n}\n\n/**\n * Checks if a component has defined a method that needs to run every frame.\n */\nfunction hasBehavior (component) {\n return component.tick || component.tock;\n}\n\n/**\n * Wrapper for defined pause method.\n * Pause component by removing tick behavior and calling user's pause method.\n *\n * @param pauseMethod {function}\n */\nfunction wrapPause (pauseMethod) {\n return function pause () {\n var sceneEl = this.el.sceneEl;\n if (!this.isPlaying) { return; }\n pauseMethod.call(this);\n this.isPlaying = false;\n this.eventsDetach();\n // Remove tick behavior.\n if (!hasBehavior(this)) { return; }\n sceneEl.removeBehavior(this);\n };\n}\n\n/**\n * Wrapper for defined play method.\n * Play component by adding tick behavior and calling user's play method.\n *\n * @param playMethod {function}\n */\nfunction wrapPlay (playMethod) {\n return function play () {\n var sceneEl = this.el.sceneEl;\n var shouldPlay = this.el.isPlaying && !this.isPlaying;\n if (!this.initialized || !shouldPlay) { return; }\n playMethod.call(this);\n this.isPlaying = true;\n this.eventsAttach();\n // Add tick behavior.\n if (!hasBehavior(this)) { return; }\n sceneEl.addBehavior(this);\n };\n}\n\nfunction isObject (value) {\n return value && value.constructor === Object && !(value instanceof window.HTMLElement);\n}\n\nfunction isObjectOrArray (value) {\n return value && (value.constructor === Object || value.constructor === Array) &&\n !(value instanceof window.HTMLElement);\n}\n","var schema = require('./schema');\n\nvar processSchema = schema.process;\nvar geometries = module.exports.geometries = {}; // Registered geometries.\nvar geometryNames = module.exports.geometryNames = []; // Names of registered geometries.\nvar THREE = require('../lib/three');\n\n/**\n * Geometry class definition.\n *\n * Geometries extend the geometry component API to create and register geometry types.\n */\nvar Geometry = module.exports.Geometry = function () {};\n\nGeometry.prototype = {\n /**\n * Contains the type schema and defaults for the data values.\n * Data is coerced into the types of the values of the defaults.\n */\n schema: {},\n\n /**\n * Init handler. Similar to attachedCallback.\n * Called during shader initialization and is only run once.\n */\n init: function (data) {\n this.geometry = new THREE.BufferGeometry();\n return this.geometry;\n },\n\n /**\n * Update handler. Similar to attributeChangedCallback.\n * Called whenever the associated geometry data changes.\n *\n * @param {object} data - New geometry data.\n */\n update: function (data) { /* no-op */ }\n};\n\n/**\n * Registers a geometry to A-Frame.\n *\n * @param {string} name - Geometry name.\n * @param {object} definition - Geometry property and methods.\n * @returns {object} Geometry.\n */\nmodule.exports.registerGeometry = function (name, definition) {\n var NewGeometry;\n var proto = {};\n\n // Format definition object to prototype object.\n Object.keys(definition).forEach(function expandDefinition (key) {\n proto[key] = {\n value: definition[key],\n writable: true\n };\n });\n\n if (geometries[name]) {\n throw new Error('The geometry `' + name + '` has been already registered');\n }\n NewGeometry = function () { Geometry.call(this); };\n NewGeometry.prototype = Object.create(Geometry.prototype, proto);\n NewGeometry.prototype.name = name;\n NewGeometry.prototype.constructor = NewGeometry;\n geometries[name] = {\n Geometry: NewGeometry,\n schema: processSchema(NewGeometry.prototype.schema)\n };\n geometryNames.push(name);\n return NewGeometry;\n};\n","var coordinates = require('../utils/coordinates');\nvar debug = require('debug');\n\nvar error = debug('core:propertyTypes:warn');\nvar warn = debug('core:propertyTypes:warn');\n\nvar propertyTypes = module.exports.propertyTypes = {};\nvar nonCharRegex = /[,> .[\\]:]/;\nvar urlRegex = /\\url\\((.+)\\)/;\n\n// Built-in property types.\nregisterPropertyType('audio', '', assetParse);\nregisterPropertyType('array', [], arrayParse, arrayStringify);\nregisterPropertyType('asset', '', assetParse);\nregisterPropertyType('boolean', false, boolParse);\nregisterPropertyType('color', '#FFF', defaultParse, defaultStringify);\nregisterPropertyType('int', 0, intParse);\nregisterPropertyType('number', 0, numberParse);\nregisterPropertyType('map', '', assetParse);\nregisterPropertyType('model', '', assetParse);\nregisterPropertyType('selector', null, selectorParse, selectorStringify);\nregisterPropertyType('selectorAll', null, selectorAllParse, selectorAllStringify);\nregisterPropertyType('src', '', srcParse);\nregisterPropertyType('string', '', defaultParse, defaultStringify);\nregisterPropertyType('time', 0, intParse);\nregisterPropertyType('vec2', {x: 0, y: 0}, vecParse, coordinates.stringify);\nregisterPropertyType('vec3', {x: 0, y: 0, z: 0}, vecParse, coordinates.stringify);\nregisterPropertyType('vec4', {x: 0, y: 0, z: 0, w: 1}, vecParse, coordinates.stringify);\n\n/**\n * Register a parser for re-use such that when someone uses `type` in the schema,\n * `schema.process` will set the property `parse` and `stringify`.\n *\n * @param {string} type - Type name.\n * @param [defaultValue=null] -\n * Default value to use if component does not define default value.\n * @param {function} [parse=defaultParse] - Parse string function.\n * @param {function} [stringify=defaultStringify] - Stringify to DOM function.\n */\nfunction registerPropertyType (type, defaultValue, parse, stringify) {\n if ('type' in propertyTypes) {\n error('Property type ' + type + ' is already registered.');\n return;\n }\n\n propertyTypes[type] = {\n default: defaultValue,\n parse: parse || defaultParse,\n stringify: stringify || defaultStringify\n };\n}\nmodule.exports.registerPropertyType = registerPropertyType;\n\nfunction arrayParse (value) {\n if (Array.isArray(value)) { return value; }\n if (!value || typeof value !== 'string') { return []; }\n return value.split(',').map(trim);\n function trim (str) { return str.trim(); }\n}\n\nfunction arrayStringify (value) {\n return value.join(', ');\n}\n\n/**\n * For general assets.\n *\n * @param {string} value - Can either be `url(<value>)`, an ID selector to an asset, or\n * just string.\n * @returns {string} Parsed value from `url(<value>)`, src from `<someasset src>`, or\n * just string.\n */\nfunction assetParse (value) {\n var el;\n var parsedUrl;\n\n // If an element was provided (e.g. canvas or video), just return it.\n if (typeof value !== 'string') { return value; }\n\n // Wrapped `url()` in case of data URI.\n parsedUrl = value.match(urlRegex);\n if (parsedUrl) { return parsedUrl[1]; }\n\n // ID.\n if (value.charAt(0) === '#') {\n el = document.getElementById(value.substring(1));\n if (el) {\n // Pass through media elements. If we have the elements, we don't have to call\n // three.js loaders which would re-request the assets.\n if (el.tagName === 'CANVAS' || el.tagName === 'VIDEO' || el.tagName === 'IMG') {\n return el;\n }\n return el.getAttribute('src');\n }\n warn('\"' + value + '\" asset not found.');\n return;\n }\n\n // Non-wrapped url().\n return value;\n}\n\nfunction defaultParse (value) {\n return value;\n}\n\nfunction defaultStringify (value) {\n if (value === null) { return 'null'; }\n return value.toString();\n}\n\nfunction boolParse (value) {\n return value !== 'false' && value !== false;\n}\n\nfunction intParse (value) {\n return parseInt(value, 10);\n}\n\nfunction numberParse (value) {\n return parseFloat(value, 10);\n}\n\nfunction selectorParse (value) {\n if (!value) { return null; }\n if (typeof value !== 'string') { return value; }\n if (value[0] === '#' && !nonCharRegex.test(value)) {\n // When selecting element by ID only, use getElementById for better performance.\n // Don't match like #myId .child.\n return document.getElementById(value.substring(1));\n }\n return document.querySelector(value);\n}\n\nfunction selectorAllParse (value) {\n if (!value) { return null; }\n if (typeof value !== 'string') { return value; }\n return Array.prototype.slice.call(document.querySelectorAll(value), 0);\n}\n\nfunction selectorStringify (value) {\n if (value.getAttribute) {\n return '#' + value.getAttribute('id');\n }\n return defaultStringify(value);\n}\n\nfunction selectorAllStringify (value) {\n if (value instanceof Array) {\n return value.map(function (element) {\n return '#' + element.getAttribute('id');\n }).join(', ');\n }\n return defaultStringify(value);\n}\n\nfunction srcParse (value) {\n warn('`src` property type is deprecated. Use `asset` instead.');\n return assetParse(value);\n}\n\nfunction vecParse (value) {\n return coordinates.parse(value, this.default);\n}\n\n/**\n * Validate the default values in a schema to match their type.\n *\n * @param {string} type - Property type name.\n * @param defaultVal - Property type default value.\n * @returns {boolean} Whether default value is accurate given the type.\n */\nfunction isValidDefaultValue (type, defaultVal) {\n if (type === 'audio' && typeof defaultVal !== 'string') { return false; }\n if (type === 'array' && !Array.isArray(defaultVal)) { return false; }\n if (type === 'asset' && typeof defaultVal !== 'string') { return false; }\n if (type === 'boolean' && typeof defaultVal !== 'boolean') { return false; }\n if (type === 'color' && typeof defaultVal !== 'string') { return false; }\n if (type === 'int' && typeof defaultVal !== 'number') { return false; }\n if (type === 'number' && typeof defaultVal !== 'number') { return false; }\n if (type === 'map' && typeof defaultVal !== 'string') { return false; }\n if (type === 'model' && typeof defaultVal !== 'string') { return false; }\n if (type === 'selector' && typeof defaultVal !== 'string' &&\n defaultVal !== null) { return false; }\n if (type === 'selectorAll' && typeof defaultVal !== 'string' &&\n defaultVal !== null) { return false; }\n if (type === 'src' && typeof defaultVal !== 'string') { return false; }\n if (type === 'string' && typeof defaultVal !== 'string') { return false; }\n if (type === 'time' && typeof defaultVal !== 'number') { return false; }\n if (type === 'vec2') { return isValidDefaultCoordinate(defaultVal, 2); }\n if (type === 'vec3') { return isValidDefaultCoordinate(defaultVal, 3); }\n if (type === 'vec4') { return isValidDefaultCoordinate(defaultVal, 4); }\n return true;\n}\nmodule.exports.isValidDefaultValue = isValidDefaultValue;\n\n/**\n * Checks if default coordinates are valid.\n *\n * @param possibleCoordinates\n * @param {number} dimensions - 2 for 2D Vector, 3 for 3D vector.\n * @returns {boolean} Whether coordinates are parsed correctly.\n */\nfunction isValidDefaultCoordinate (possibleCoordinates, dimensions) {\n if (possibleCoordinates === null) { return true; }\n if (typeof possibleCoordinates !== 'object') { return false; }\n\n if (Object.keys(possibleCoordinates).length !== dimensions) {\n return false;\n } else {\n var x = possibleCoordinates.x;\n var y = possibleCoordinates.y;\n var z = possibleCoordinates.z;\n var w = possibleCoordinates.w;\n\n if (typeof x !== 'number' || typeof y !== 'number') { return false; }\n if (dimensions > 2 && typeof z !== 'number') { return false; }\n if (dimensions > 3 && typeof w !== 'number') { return false; }\n }\n\n return true;\n}\nmodule.exports.isValidDefaultCoordinate = isValidDefaultCoordinate;\n","/* global Promise, screen, CustomEvent */\nvar initMetaTags = require('./metaTags').inject;\nvar initWakelock = require('./wakelock');\nvar loadingScreen = require('./loadingScreen');\nvar re = require('../a-register-element');\nvar scenes = require('./scenes');\nvar systems = require('../system').systems;\nvar THREE = require('../../lib/three');\nvar utils = require('../../utils/');\n// Require after.\nvar AEntity = require('../a-entity');\nvar ANode = require('../a-node');\nvar initPostMessageAPI = require('./postMessage');\n\nvar bind = utils.bind;\nvar isIOS = utils.device.isIOS();\nvar isMobile = utils.device.isMobile();\nvar isWebXRAvailable = utils.device.isWebXRAvailable;\nvar registerElement = re.registerElement;\nvar warn = utils.debug('core:a-scene:warn');\n\nif (isIOS) { require('../../utils/ios-orientationchange-blank-bug'); }\n\n/**\n * Scene element, holds all entities.\n *\n * @member {array} behaviors - Component instances that have registered themselves to be\n updated on every tick.\n * @member {object} camera - three.js Camera object.\n * @member {object} canvas\n * @member {bool} isScene - Differentiates as scene entity as opposed to other entites.\n * @member {bool} isMobile - Whether browser is mobile (via UA detection).\n * @member {object} object3D - Root three.js Scene object.\n * @member {object} renderer\n * @member {bool} renderStarted\n * @member {object} systems - Registered instantiated systems.\n * @member {number} time\n */\nmodule.exports.AScene = registerElement('a-scene', {\n prototype: Object.create(AEntity.prototype, {\n createdCallback: {\n value: function () {\n this.clock = new THREE.Clock();\n this.isIOS = isIOS;\n this.isMobile = isMobile;\n this.hasWebXR = isWebXRAvailable;\n this.isAR = false;\n this.isScene = true;\n this.object3D = new THREE.Scene();\n var self = this;\n this.object3D.onAfterRender = function (renderer, scene, camera) {\n // THREE may swap the camera used for the rendering if in VR, so we pass it to tock\n if (self.isPlaying) { self.tock(self.time, self.delta, camera); }\n };\n this.resize = bind(this.resize, this);\n this.render = bind(this.render, this);\n this.systems = {};\n this.systemNames = [];\n this.time = this.delta = 0;\n\n this.behaviors = {tick: [], tock: []};\n this.hasLoaded = false;\n this.isPlaying = false;\n this.originalHTML = this.innerHTML;\n\n // Default components.\n this.setAttribute('inspector', '');\n this.setAttribute('keyboard-shortcuts', '');\n this.setAttribute('screenshot', '');\n this.setAttribute('vr-mode-ui', '');\n this.setAttribute('device-orientation-permission-ui', '');\n }\n },\n\n addFullScreenStyles: {\n value: function () {\n document.documentElement.classList.add('a-fullscreen');\n }\n },\n\n removeFullScreenStyles: {\n value: function () {\n document.documentElement.classList.remove('a-fullscreen');\n }\n },\n\n attachedCallback: {\n value: function () {\n var self = this;\n var embedded = this.hasAttribute('embedded');\n // Renderer initialization\n setupCanvas(this);\n this.setupRenderer();\n loadingScreen.setup(this, getCanvasSize);\n\n this.resize();\n if (!embedded) { this.addFullScreenStyles(); }\n initPostMessageAPI(this);\n\n initMetaTags(this);\n initWakelock(this);\n\n // Handler to exit VR (e.g., Oculus Browser back button).\n this.onVRPresentChangeBound = bind(this.onVRPresentChange, this);\n window.addEventListener('vrdisplaypresentchange', this.onVRPresentChangeBound);\n\n // Bind functions.\n this.enterVRBound = function () { self.enterVR(); };\n this.exitVRBound = function () { self.exitVR(); };\n this.exitVRTrueBound = function () { self.exitVR(true); };\n this.pointerRestrictedBound = function () { self.pointerRestricted(); };\n this.pointerUnrestrictedBound = function () { self.pointerUnrestricted(); };\n\n if (!isWebXRAvailable) {\n // Exit VR on `vrdisplaydeactivate` (e.g. taking off Rift headset).\n window.addEventListener('vrdisplaydeactivate', this.exitVRBound);\n\n // Exit VR on `vrdisplaydisconnect` (e.g. unplugging Rift headset).\n window.addEventListener('vrdisplaydisconnect', this.exitVRTrueBound);\n\n // Register for mouse restricted events while in VR\n // (e.g. mouse no longer available on desktop 2D view)\n window.addEventListener('vrdisplaypointerrestricted', this.pointerRestrictedBound);\n\n // Register for mouse unrestricted events while in VR\n // (e.g. mouse once again available on desktop 2D view)\n window.addEventListener('vrdisplaypointerunrestricted',\n this.pointerUnrestrictedBound);\n }\n\n window.addEventListener('sessionend', this.resize);\n // Camera set up by camera system.\n this.addEventListener('cameraready', function () {\n self.attachedCallbackPostCamera();\n });\n\n this.initSystems();\n\n // WebXR Immersive navigation handler.\n if (this.hasWebXR && navigator.xr && navigator.xr.addEventListener) {\n navigator.xr.addEventListener('sessiongranted', function () { self.enterVR(); });\n }\n }\n },\n\n attachedCallbackPostCamera: {\n value: function () {\n var resize;\n var self = this;\n\n window.addEventListener('load', resize);\n window.addEventListener('resize', function () {\n // Workaround for a Webkit bug (https://bugs.webkit.org/show_bug.cgi?id=170595)\n // where the window does not contain the correct viewport size\n // after an orientation change. The window size is correct if the operation\n // is postponed a few milliseconds.\n // self.resize can be called directly once the bug above is fixed.\n if (self.isIOS) {\n setTimeout(self.resize, 100);\n } else {\n self.resize();\n }\n });\n this.play();\n\n // Add to scene index.\n scenes.push(this);\n },\n writable: window.debug\n },\n\n /**\n * Initialize all systems.\n */\n initSystems: {\n value: function () {\n var name;\n\n // Initialize camera system first.\n this.initSystem('camera');\n\n for (name in systems) {\n if (name === 'camera') { continue; }\n this.initSystem(name);\n }\n }\n },\n\n /**\n * Initialize a system.\n */\n initSystem: {\n value: function (name) {\n if (this.systems[name]) { return; }\n this.systems[name] = new systems[name](this);\n this.systemNames.push(name);\n }\n },\n\n /**\n * Shut down scene on detach.\n */\n detachedCallback: {\n value: function () {\n // Remove from scene index.\n var sceneIndex = scenes.indexOf(this);\n scenes.splice(sceneIndex, 1);\n\n window.removeEventListener('vrdisplaypresentchange', this.onVRPresentChangeBound);\n window.removeEventListener('vrdisplayactivate', this.enterVRBound);\n window.removeEventListener('vrdisplaydeactivate', this.exitVRBound);\n window.removeEventListener('vrdisplayconnect', this.enterVRBound);\n window.removeEventListener('vrdisplaydisconnect', this.exitVRTrueBound);\n window.removeEventListener('vrdisplaypointerrestricted', this.pointerRestrictedBound);\n window.removeEventListener('vrdisplaypointerunrestricted', this.pointerUnrestrictedBound);\n window.removeEventListener('sessionend', this.resize);\n this.renderer.xr.dispose();\n }\n },\n\n /**\n * Add ticks and tocks.\n *\n * @param {object} behavior - A component.\n */\n addBehavior: {\n value: function (behavior) {\n var behaviorArr;\n var behaviors = this.behaviors;\n var behaviorType;\n\n // Check if behavior has tick and/or tock and add the behavior to the appropriate list.\n for (behaviorType in behaviors) {\n if (!behavior[behaviorType]) { continue; }\n behaviorArr = this.behaviors[behaviorType];\n if (behaviorArr.indexOf(behavior) === -1) {\n behaviorArr.push(behavior);\n }\n }\n }\n },\n\n /**\n * For tests.\n */\n getPointerLockElement: {\n value: function () {\n return document.pointerLockElement;\n },\n writable: window.debug\n },\n\n /**\n * For tests.\n */\n checkHeadsetConnected: {\n value: utils.device.checkHeadsetConnected,\n writable: window.debug\n },\n\n enterAR: {\n value: function () {\n var errorMessage;\n if (!this.hasWebXR) {\n errorMessage = 'Failed to enter AR mode, WebXR not supported.';\n throw new Error(errorMessage);\n }\n if (!utils.device.checkARSupport()) {\n errorMessage = 'Failed to enter AR, WebXR immersive-ar mode not supported in your browser or device.';\n throw new Error(errorMessage);\n }\n return this.enterVR(true);\n }\n },\n\n /**\n * Call `requestPresent` if WebVR or WebVR polyfill.\n * Call `requestFullscreen` on desktop.\n * Handle events, states, fullscreen styles.\n *\n * @param {bool?} useAR - if true, try immersive-ar mode\n * @returns {Promise}\n */\n enterVR: {\n value: function (useAR) {\n var self = this;\n var vrDisplay;\n var vrManager = self.renderer.xr;\n var xrInit;\n\n // Don't enter VR if already in VR.\n if (this.is('vr-mode')) { return Promise.resolve('Already in VR.'); }\n\n // Has VR.\n if (this.checkHeadsetConnected() || this.isMobile) {\n vrManager.enabled = true;\n\n if (this.hasWebXR) {\n // XR API.\n if (this.xrSession) {\n this.xrSession.removeEventListener('end', this.exitVRBound);\n }\n var refspace = this.sceneEl.systems.webxr.sessionReferenceSpaceType;\n vrManager.setReferenceSpaceType(refspace);\n var xrMode = useAR ? 'immersive-ar' : 'immersive-vr';\n xrInit = this.sceneEl.systems.webxr.sessionConfiguration;\n return new Promise(function (resolve, reject) {\n navigator.xr.requestSession(xrMode, xrInit).then(\n function requestSuccess (xrSession) {\n self.xrSession = xrSession;\n vrManager.layersEnabled = xrInit.requiredFeatures.indexOf('layers') !== -1;\n vrManager.setSession(xrSession);\n xrSession.addEventListener('end', self.exitVRBound);\n enterVRSuccess(resolve);\n },\n function requestFail (error) {\n var useAR = xrMode === 'immersive-ar';\n var mode = useAR ? 'AR' : 'VR';\n throw new Error('Failed to enter ' + mode + ' mode (`requestSession`) ' + error);\n }\n );\n });\n } else {\n vrDisplay = utils.device.getVRDisplay();\n vrManager.setDevice(vrDisplay);\n if (vrDisplay.isPresenting &&\n !window.hasNativeWebVRImplementation) {\n enterVRSuccess();\n return Promise.resolve();\n }\n var rendererSystem = this.getAttribute('renderer');\n var presentationAttributes = {\n highRefreshRate: rendererSystem.highRefreshRate,\n foveationLevel: rendererSystem.foveationLevel\n };\n\n return vrDisplay.requestPresent([{\n source: this.canvas,\n attributes: presentationAttributes\n }]).then(enterVRSuccess, enterVRFailure);\n }\n }\n\n // No VR.\n enterVRSuccess();\n return Promise.resolve();\n\n // Callback that happens on enter VR success or enter fullscreen (any API).\n function enterVRSuccess (resolve) {\n // vrdisplaypresentchange fires only once when the first requestPresent is completed;\n // the first requestPresent could be called from ondisplayactivate and there is no way\n // to setup everything from there. Thus, we need to emulate another vrdisplaypresentchange\n // for the actual requestPresent. Need to make sure there are no issues with firing the\n // vrdisplaypresentchange multiple times.\n var event;\n if (window.hasNativeWebVRImplementation && !window.hasNativeWebXRImplementation) {\n event = new CustomEvent('vrdisplaypresentchange', {detail: {display: utils.device.getVRDisplay()}});\n window.dispatchEvent(event);\n }\n\n if (useAR) {\n self.addState('ar-mode');\n } else {\n self.addState('vr-mode');\n }\n self.emit('enter-vr', {target: self});\n // Lock to landscape orientation on mobile.\n if (!isWebXRAvailable && self.isMobile && screen.orientation && screen.orientation.lock) {\n screen.orientation.lock('landscape');\n }\n self.addFullScreenStyles();\n\n // On mobile, the polyfill handles fullscreen.\n // TODO: 07/16 Chromium builds break when `requestFullscreen`ing on a canvas\n // that we are also `requestPresent`ing. Until then, don't fullscreen if headset\n // connected.\n if (!self.isMobile && !self.checkHeadsetConnected()) {\n requestFullscreen(self.canvas);\n }\n\n self.resize();\n if (resolve) { resolve(); }\n }\n\n function enterVRFailure (err) {\n self.removeState('vr-mode');\n if (err && err.message) {\n throw new Error('Failed to enter VR mode (`requestPresent`): ' + err.message);\n } else {\n throw new Error('Failed to enter VR mode (`requestPresent`).');\n }\n }\n },\n writable: true\n },\n /**\n * Call `exitPresent` if WebVR / WebXR or WebVR polyfill.\n * Handle events, states, fullscreen styles.\n *\n * @returns {Promise}\n */\n exitVR: {\n value: function () {\n var self = this;\n var vrDisplay;\n var vrManager = this.renderer.xr;\n\n // Don't exit VR if not in VR.\n if (!this.is('vr-mode') && !this.is('ar-mode')) { return Promise.resolve('Not in immersive mode.'); }\n\n // Handle exiting VR if not yet already and in a headset or polyfill.\n if (this.checkHeadsetConnected() || this.isMobile) {\n vrManager.enabled = false;\n vrDisplay = utils.device.getVRDisplay();\n if (this.hasWebXR) {\n this.xrSession.removeEventListener('end', this.exitVRBound);\n // Capture promise to avoid errors.\n this.xrSession.end().then(function () {}, function () {});\n this.xrSession = undefined;\n vrManager.setSession(null);\n } else {\n if (vrDisplay.isPresenting) {\n return vrDisplay.exitPresent().then(exitVRSuccess, exitVRFailure);\n }\n }\n } else {\n exitFullscreen();\n }\n\n // Handle exiting VR in all other cases (2D fullscreen, external exit VR event).\n exitVRSuccess();\n\n return Promise.resolve();\n\n function exitVRSuccess () {\n self.removeState('vr-mode');\n self.removeState('ar-mode');\n // Lock to landscape orientation on mobile.\n if (self.isMobile && screen.orientation && screen.orientation.unlock) {\n screen.orientation.unlock();\n }\n // Exiting VR in embedded mode, no longer need fullscreen styles.\n if (self.hasAttribute('embedded')) { self.removeFullScreenStyles(); }\n\n self.resize();\n if (self.isIOS) { utils.forceCanvasResizeSafariMobile(self.canvas); }\n self.renderer.setPixelRatio(window.devicePixelRatio);\n self.emit('exit-vr', {target: self});\n }\n\n function exitVRFailure (err) {\n if (err && err.message) {\n throw new Error('Failed to exit VR mode (`exitPresent`): ' + err.message);\n } else {\n throw new Error('Failed to exit VR mode (`exitPresent`).');\n }\n }\n },\n writable: true\n },\n\n pointerRestricted: {\n value: function () {\n if (this.canvas) {\n var pointerLockElement = this.getPointerLockElement();\n if (pointerLockElement && pointerLockElement !== this.canvas && document.exitPointerLock) {\n // Recreate pointer lock on the canvas, if taken on another element.\n document.exitPointerLock();\n }\n\n if (this.canvas.requestPointerLock) {\n this.canvas.requestPointerLock();\n }\n }\n }\n },\n\n pointerUnrestricted: {\n value: function () {\n var pointerLockElement = this.getPointerLockElement();\n if (pointerLockElement && pointerLockElement === this.canvas && document.exitPointerLock) {\n document.exitPointerLock();\n }\n }\n },\n\n /**\n * Handle `vrdisplaypresentchange` event for exiting VR through other means than\n * `<ESC>` key. For example, GearVR back button on Oculus Browser.\n */\n onVRPresentChange: {\n value: function (evt) {\n // Polyfill places display inside the detail property\n var display = evt.display || evt.detail.display;\n // Entering VR.\n if (display && display.isPresenting) {\n this.enterVR();\n return;\n }\n // Exiting VR.\n this.exitVR();\n }\n },\n\n /**\n * Wraps Entity.getAttribute to take into account for systems.\n * If system exists, then return system data rather than possible component data.\n */\n getAttribute: {\n value: function (attr) {\n var system = this.systems[attr];\n if (system) { return system.data; }\n return AEntity.prototype.getAttribute.call(this, attr);\n }\n },\n\n /**\n * `getAttribute` used to be `getDOMAttribute` and `getComputedAttribute` used to be\n * what `getAttribute` is now. Now legacy code.\n */\n getComputedAttribute: {\n value: function (attr) {\n warn('`getComputedAttribute` is deprecated. Use `getAttribute` instead.');\n this.getAttribute(attr);\n }\n },\n\n /**\n * Wraps Entity.getDOMAttribute to take into account for systems.\n * If system exists, then return system data rather than possible component data.\n */\n getDOMAttribute: {\n value: function (attr) {\n var system = this.systems[attr];\n if (system) { return system.data; }\n return AEntity.prototype.getDOMAttribute.call(this, attr);\n }\n },\n\n /**\n * Wrap Entity.setAttribute to take into account for systems.\n * If system exists, then skip component initialization checks and do a normal\n * setAttribute.\n */\n setAttribute: {\n value: function (attr, value, componentPropValue) {\n var system = this.systems[attr];\n if (system) {\n ANode.prototype.setAttribute.call(this, attr, value);\n system.updateProperties(value);\n return;\n }\n AEntity.prototype.setAttribute.call(this, attr, value, componentPropValue);\n }\n },\n\n /**\n * @param {object} behavior - A component.\n */\n removeBehavior: {\n value: function (behavior) {\n var behaviorArr;\n var behaviorType;\n var behaviors = this.behaviors;\n var index;\n\n // Check if behavior has tick and/or tock and remove the behavior from the appropriate\n // array.\n for (behaviorType in behaviors) {\n if (!behavior[behaviorType]) { continue; }\n behaviorArr = this.behaviors[behaviorType];\n index = behaviorArr.indexOf(behavior);\n if (index !== -1) { behaviorArr.splice(index, 1); }\n }\n }\n },\n\n resize: {\n value: function () {\n var camera = this.camera;\n var canvas = this.canvas;\n var embedded;\n var isVRPresenting;\n var size;\n var isPresenting = this.renderer.xr.isPresenting;\n isVRPresenting = this.renderer.xr.enabled && isPresenting;\n\n // Do not update renderer, if a camera or a canvas have not been injected.\n // In VR mode, three handles canvas resize based on the dimensions returned by\n // the getEyeParameters function of the WebVR API. These dimensions are independent of\n // the window size, therefore should not be overwritten with the window's width and\n // height, // except when in fullscreen mode.\n if (!camera || !canvas || (this.is('vr-mode') && (this.isMobile || isVRPresenting))) {\n return;\n }\n\n // Update camera.\n embedded = this.getAttribute('embedded') && !this.is('vr-mode');\n size = getCanvasSize(canvas, embedded, this.maxCanvasSize, this.is('vr-mode'));\n camera.aspect = size.width / size.height;\n camera.updateProjectionMatrix();\n\n // Notify renderer of size change.\n this.renderer.setSize(size.width, size.height, false);\n this.emit('rendererresize', null, false);\n },\n writable: true\n },\n\n setupRenderer: {\n value: function () {\n var self = this;\n var renderer;\n var rendererAttr;\n var rendererAttrString;\n var rendererConfig;\n\n rendererConfig = {\n alpha: true,\n antialias: !isMobile,\n canvas: this.canvas,\n logarithmicDepthBuffer: false,\n powerPreference: 'high-performance'\n };\n\n this.maxCanvasSize = {height: 1920, width: 1920};\n\n if (this.hasAttribute('renderer')) {\n rendererAttrString = this.getAttribute('renderer');\n rendererAttr = utils.styleParser.parse(rendererAttrString);\n\n if (rendererAttr.precision) {\n rendererConfig.precision = rendererAttr.precision + 'p';\n }\n\n if (rendererAttr.antialias && rendererAttr.antialias !== 'auto') {\n rendererConfig.antialias = rendererAttr.antialias === 'true';\n }\n\n if (rendererAttr.logarithmicDepthBuffer && rendererAttr.logarithmicDepthBuffer !== 'auto') {\n rendererConfig.logarithmicDepthBuffer = rendererAttr.logarithmicDepthBuffer === 'true';\n }\n\n if (rendererAttr.alpha) {\n rendererConfig.alpha = rendererAttr.alpha === 'true';\n }\n\n this.maxCanvasSize = {\n width: rendererAttr.maxCanvasWidth\n ? parseInt(rendererAttr.maxCanvasWidth)\n : this.maxCanvasSize.width,\n height: rendererAttr.maxCanvasHeight\n ? parseInt(rendererAttr.maxCanvasHeight)\n : this.maxCanvasSize.height\n };\n }\n\n renderer = this.renderer = new THREE.WebGLRenderer(rendererConfig);\n renderer.setPixelRatio(window.devicePixelRatio);\n renderer.sortObjects = false;\n if (this.camera) { renderer.xr.setPoseTarget(this.camera.el.object3D); }\n this.addEventListener('camera-set-active', function () {\n renderer.xr.setPoseTarget(self.camera.el.object3D);\n });\n },\n writable: window.debug\n },\n\n /**\n * Handler attached to elements to help scene know when to kick off.\n * Scene waits for all entities to load.\n */\n play: {\n value: function () {\n var self = this;\n var sceneEl = this;\n\n if (this.renderStarted) {\n AEntity.prototype.play.call(this);\n return;\n }\n\n this.addEventListener('loaded', function () {\n var renderer = this.renderer;\n var vrDisplay;\n var vrManager = this.renderer.xr;\n AEntity.prototype.play.call(this); // .play() *before* render.\n\n if (sceneEl.renderStarted) { return; }\n sceneEl.resize();\n\n // Kick off render loop.\n if (sceneEl.renderer) {\n if (window.performance) { window.performance.mark('render-started'); }\n loadingScreen.remove();\n vrDisplay = utils.device.getVRDisplay();\n if (vrDisplay && vrDisplay.isPresenting) {\n vrManager.setDevice(vrDisplay);\n vrManager.enabled = true;\n sceneEl.enterVR();\n }\n renderer.setAnimationLoop(this.render);\n sceneEl.renderStarted = true;\n sceneEl.emit('renderstart');\n }\n });\n\n // setTimeout to wait for all nodes to attach and run their callbacks.\n setTimeout(function () {\n AEntity.prototype.load.call(self);\n });\n }\n },\n\n /**\n * Wrap `updateComponent` to not initialize the component if the component has a system\n * (aframevr/aframe#2365).\n */\n updateComponent: {\n value: function (componentName) {\n if (componentName in systems) { return; }\n AEntity.prototype.updateComponent.apply(this, arguments);\n }\n },\n\n /**\n * Behavior-updater meant to be called from scene render.\n * Abstracted to a different function to facilitate unit testing (`scene.tick()`) without\n * needing to render.\n */\n tick: {\n value: function (time, timeDelta) {\n var i;\n var systems = this.systems;\n\n // Components.\n for (i = 0; i < this.behaviors.tick.length; i++) {\n if (!this.behaviors.tick[i].el.isPlaying) { continue; }\n this.behaviors.tick[i].tick(time, timeDelta);\n }\n\n // Systems.\n for (i = 0; i < this.systemNames.length; i++) {\n if (!systems[this.systemNames[i]].tick) { continue; }\n systems[this.systemNames[i]].tick(time, timeDelta);\n }\n }\n },\n\n /**\n * Behavior-updater meant to be called after scene render for post processing purposes.\n * Abstracted to a different function to facilitate unit testing (`scene.tock()`) without\n * needing to render.\n */\n tock: {\n value: function (time, timeDelta, camera) {\n var i;\n var systems = this.systems;\n\n // Components.\n for (i = 0; i < this.behaviors.tock.length; i++) {\n if (!this.behaviors.tock[i].el.isPlaying) { continue; }\n this.behaviors.tock[i].tock(time, timeDelta, camera);\n }\n\n // Systems.\n for (i = 0; i < this.systemNames.length; i++) {\n if (!systems[this.systemNames[i]].tock) { continue; }\n systems[this.systemNames[i]].tock(time, timeDelta, camera);\n }\n }\n },\n\n /**\n * The render loop.\n *\n * Updates animations.\n * Updates behaviors.\n * Renders with request animation frame.\n */\n render: {\n value: function (time, frame) {\n var renderer = this.renderer;\n\n this.frame = frame;\n this.delta = this.clock.getDelta() * 1000;\n this.time = this.clock.elapsedTime * 1000;\n\n if (this.isPlaying) { this.tick(this.time, this.delta); }\n var savedBackground = null;\n if (this.is('ar-mode')) {\n // In AR mode, don't render the default background. Hide it, then\n // restore it again after rendering.\n savedBackground = this.object3D.background;\n this.object3D.background = null;\n }\n renderer.render(this.object3D, this.camera);\n if (savedBackground) {\n this.object3D.background = savedBackground;\n }\n },\n writable: true\n }\n })\n});\n\n/**\n * Return the canvas size where the scene will be rendered.\n * Will be always the window size except when the scene is embedded.\n * The parent size (less than max size) will be returned in that case.\n *\n * @param {object} canvasEl - the canvas element\n * @param {boolean} embedded - Is the scene embedded?\n * @param {object} max - Max size parameters\n * @param {boolean} isVR - If in VR\n */\nfunction getCanvasSize (canvasEl, embedded, maxSize, isVR) {\n if (!canvasEl.parentElement) { return {height: 0, width: 0}; }\n if (embedded) {\n return {\n height: canvasEl.parentElement.offsetHeight,\n width: canvasEl.parentElement.offsetWidth\n };\n }\n return getMaxSize(maxSize, isVR);\n}\n\n/**\n * Return the canvas size. Will be the window size unless that size is greater than the\n * maximum size (1920x1920 by default). The constrained size will be returned in that case,\n * maintaining aspect ratio\n *\n * @param {object} maxSize - Max size parameters (width and height).\n * @param {boolean} isVR - If in VR.\n * @returns {object} Width and height.\n */\nfunction getMaxSize (maxSize, isVR) {\n var aspectRatio;\n var size;\n var pixelRatio = window.devicePixelRatio;\n\n size = {height: document.body.offsetHeight, width: document.body.offsetWidth};\n if (!maxSize || isVR || (maxSize.width === -1 && maxSize.height === -1)) {\n return size;\n }\n\n if (size.width * pixelRatio < maxSize.width &&\n size.height * pixelRatio < maxSize.height) {\n return size;\n }\n\n aspectRatio = size.width / size.height;\n\n if ((size.width * pixelRatio) > maxSize.width && maxSize.width !== -1) {\n size.width = Math.round(maxSize.width / pixelRatio);\n size.height = Math.round(maxSize.width / aspectRatio / pixelRatio);\n }\n\n if ((size.height * pixelRatio) > maxSize.height && maxSize.height !== -1) {\n size.height = Math.round(maxSize.height / pixelRatio);\n size.width = Math.round(maxSize.height * aspectRatio / pixelRatio);\n }\n\n return size;\n}\n\nfunction requestFullscreen (canvas) {\n var requestFullscreen =\n canvas.requestFullscreen ||\n canvas.webkitRequestFullscreen ||\n canvas.mozRequestFullScreen || // The capitalized `S` is not a typo.\n canvas.msRequestFullscreen;\n // Hide navigation buttons on Android.\n requestFullscreen.apply(canvas, [{navigationUI: 'hide'}]);\n}\n\nfunction exitFullscreen () {\n var fullscreenEl =\n document.fullscreenElement ||\n document.webkitFullscreenElement ||\n document.mozFullScreenElement;\n if (!fullscreenEl) { return; }\n if (document.exitFullscreen) {\n document.exitFullscreen();\n } else if (document.mozCancelFullScreen) {\n document.mozCancelFullScreen();\n } else if (document.webkitExitFullscreen) {\n document.webkitExitFullscreen();\n }\n}\n\nfunction setupCanvas (sceneEl) {\n var canvasEl;\n\n canvasEl = document.createElement('canvas');\n canvasEl.classList.add('a-canvas');\n // Mark canvas as provided/injected by A-Frame.\n canvasEl.dataset.aframeCanvas = true;\n sceneEl.appendChild(canvasEl);\n\n document.addEventListener('fullscreenchange', onFullScreenChange);\n document.addEventListener('mozfullscreenchange', onFullScreenChange);\n document.addEventListener('webkitfullscreenchange', onFullScreenChange);\n document.addEventListener('MSFullscreenChange', onFullScreenChange);\n\n // Prevent overscroll on mobile.\n canvasEl.addEventListener('touchmove', function (event) { event.preventDefault(); });\n\n // Set canvas on scene.\n sceneEl.canvas = canvasEl;\n sceneEl.emit('render-target-loaded', {target: canvasEl});\n // For unknown reasons a synchronous resize does not work on desktop when\n // entering/exiting fullscreen.\n setTimeout(bind(sceneEl.resize, sceneEl), 0);\n\n function onFullScreenChange () {\n var fullscreenEl =\n document.fullscreenElement ||\n document.mozFullScreenElement ||\n document.webkitFullscreenElement;\n // No fullscren element === exit fullscreen\n if (!fullscreenEl) { sceneEl.exitVR(); }\n document.activeElement.blur();\n document.body.focus();\n }\n}\nmodule.exports.setupCanvas = setupCanvas; // For testing.\n","/* global THREE */\nvar utils = require('../../utils/');\nvar styleParser = utils.styleParser;\n\nvar sceneEl;\nvar titleEl;\nvar getSceneCanvasSize;\n\nvar ATTR_NAME = 'loading-screen';\nvar LOADER_TITLE_CLASS = 'a-loader-title';\n\nmodule.exports.setup = function setup (el, getCanvasSize) {\n sceneEl = el;\n getSceneCanvasSize = getCanvasSize;\n var loaderAttribute = sceneEl.hasAttribute(ATTR_NAME) ? styleParser.parse(sceneEl.getAttribute(ATTR_NAME)) : undefined;\n var dotsColor = loaderAttribute && loaderAttribute.dotsColor || 'white';\n var backgroundColor = loaderAttribute && loaderAttribute.backgroundColor || '#24CAFF';\n var loaderEnabled = loaderAttribute === undefined || loaderAttribute.enabled === 'true' || loaderAttribute.enabled === undefined; // true default\n var loaderScene;\n var sphereGeometry;\n var sphereMaterial;\n var sphereMesh1;\n var sphereMesh2;\n var sphereMesh3;\n var camera;\n var clock;\n var time;\n var render;\n\n if (!loaderEnabled) { return; }\n\n // Setup Scene.\n loaderScene = new THREE.Scene();\n sphereGeometry = new THREE.SphereGeometry(0.20, 36, 18, 0, 2 * Math.PI, 0, Math.PI);\n sphereMaterial = new THREE.MeshBasicMaterial({color: dotsColor});\n sphereMesh1 = new THREE.Mesh(sphereGeometry, sphereMaterial);\n sphereMesh2 = sphereMesh1.clone();\n sphereMesh3 = sphereMesh1.clone();\n camera = new THREE.PerspectiveCamera(80, window.innerWidth / window.innerHeight, 0.0005, 10000);\n clock = new THREE.Clock();\n time = 0;\n render = function () {\n sceneEl.renderer.render(loaderScene, camera);\n time = clock.getElapsedTime() % 4;\n sphereMesh1.visible = time >= 1;\n sphereMesh2.visible = time >= 2;\n sphereMesh3.visible = time >= 3;\n };\n\n loaderScene.background = new THREE.Color(backgroundColor);\n loaderScene.add(camera);\n sphereMesh1.position.set(-1, 0, -15);\n sphereMesh2.position.set(0, 0, -15);\n sphereMesh3.position.set(1, 0, -15);\n camera.add(sphereMesh1);\n camera.add(sphereMesh2);\n camera.add(sphereMesh3);\n setupTitle();\n\n // Delay 200ms to avoid loader flashes.\n setTimeout(function () {\n if (sceneEl.hasLoaded) { return; }\n resize(camera);\n titleEl.style.display = 'block';\n window.addEventListener('resize', function () { resize(camera); });\n sceneEl.renderer.setAnimationLoop(render);\n }, 200);\n};\n\nmodule.exports.remove = function remove () {\n window.removeEventListener('resize', resize);\n if (!titleEl) { return; }\n // Hide title.\n titleEl.style.display = 'none';\n};\n\nfunction resize (camera) {\n var embedded = sceneEl.hasAttribute('embedded');\n var size = getSceneCanvasSize(sceneEl.canvas, embedded, sceneEl.maxCanvasSize, sceneEl.is('vr-mode'));\n camera.aspect = size.width / size.height;\n camera.updateProjectionMatrix();\n // Notify renderer of size change.\n sceneEl.renderer.setSize(size.width, size.height, false);\n}\n\nfunction setupTitle () {\n titleEl = document.createElement('div');\n titleEl.className = LOADER_TITLE_CLASS;\n titleEl.innerHTML = document.title;\n titleEl.style.display = 'none';\n sceneEl.appendChild(titleEl);\n}\n","var constants = require('../../constants/');\nvar extend = require('../../utils').extend;\n\nvar MOBILE_HEAD_TAGS = module.exports.MOBILE_HEAD_TAGS = [\n Meta({name: 'viewport', content: 'width=device-width,initial-scale=1,maximum-scale=1,shrink-to-fit=no,user-scalable=no,minimal-ui,viewport-fit=cover'}),\n\n // W3C-standardised meta tags.\n Meta({name: 'mobile-web-app-capable', content: 'yes'}),\n Meta({name: 'theme-color', content: 'black'})\n];\n\nvar MOBILE_IOS_HEAD_TAGS = [\n // iOS-specific meta tags for fullscreen when pinning to homescreen.\n Meta({name: 'apple-mobile-web-app-capable', content: 'yes'}),\n Meta({name: 'apple-mobile-web-app-status-bar-style', content: 'black'}),\n Link({rel: 'apple-touch-icon', href: 'https://aframe.io/images/aframe-logo-152.png'})\n];\n\nfunction Meta (attrs) {\n return {\n tagName: 'meta',\n attributes: attrs,\n exists: function () { return document.querySelector('meta[name=\"' + attrs.name + '\"]'); }\n };\n}\n\nfunction Link (attrs) {\n return {\n tagName: 'link',\n attributes: attrs,\n exists: function () { return document.querySelector('link[rel=\"' + attrs.rel + '\"]'); }\n };\n}\n\n/**\n * Injects the necessary metatags in the document for mobile support:\n * 1. Prevent the user to zoom in the document.\n * 2. Ensure that window.innerWidth and window.innerHeight have the correct\n * values and the canvas is properly scaled.\n * 3. To allow fullscreen mode when pinning a web app on the home screen on\n * iOS.\n * Adapted from https://www.reddit.com/r/web_design/comments/3la04p/\n *\n * @param {object} scene - Scene element\n * @returns {Array}\n */\nmodule.exports.inject = function injectHeadTags (scene) {\n var headEl = document.head;\n var headScriptEl = headEl.querySelector('script');\n var tag;\n var headTags = [];\n MOBILE_HEAD_TAGS.forEach(createAndInjectTag);\n if (scene.isIOS) {\n MOBILE_IOS_HEAD_TAGS.forEach(createAndInjectTag);\n }\n return headTags;\n\n function createAndInjectTag (tagObj) {\n if (!tagObj || tagObj.exists()) { return; }\n\n tag = createTag(tagObj);\n if (!tag) { return; }\n\n if (headScriptEl) {\n headScriptEl.parentNode.insertBefore(tag, headScriptEl);\n } else {\n headEl.appendChild(tag);\n }\n\n headTags.push(tag);\n }\n};\n\nfunction createTag (tagObj) {\n if (!tagObj || !tagObj.tagName) { return; }\n var meta = document.createElement(tagObj.tagName);\n meta.setAttribute(constants.AFRAME_INJECTED, '');\n return extend(meta, tagObj.attributes);\n}\n","var bind = require('../../utils/bind');\nvar isIframed = require('../../utils/').isIframed;\n\n/**\n * Provides a post message API for scenes contained\n * in an iframe.\n */\nmodule.exports = function initPostMessageAPI (scene) {\n // Handles fullscreen behavior when inside an iframe.\n if (!isIframed()) { return; }\n // postMessage API handler\n window.addEventListener('message', bind(postMessageAPIHandler, scene));\n};\n\nfunction postMessageAPIHandler (event) {\n var scene = this;\n if (!event.data) { return; }\n\n switch (event.data.type) {\n case 'vr': {\n switch (event.data.data) {\n case 'enter':\n scene.enterVR();\n break;\n case 'exit':\n scene.exitVR();\n break;\n }\n }\n }\n}\n","/*\n Scene index for keeping track of created scenes.\n*/\nmodule.exports = [];\n","var Wakelock = require('../../../vendor/wakelock/wakelock');\n\nmodule.exports = function initWakelock (scene) {\n if (!scene.isMobile) { return; }\n\n var wakelock = scene.wakelock = new Wakelock();\n scene.addEventListener('enter-vr', function () { wakelock.request(); });\n scene.addEventListener('exit-vr', function () { wakelock.release(); });\n};\n","var utils = require('../utils/');\nvar PropertyTypes = require('./propertyTypes');\n\nvar debug = utils.debug;\nvar isValidDefaultValue = PropertyTypes.isValidDefaultValue;\nvar propertyTypes = PropertyTypes.propertyTypes;\n\nvar warn = debug('core:schema:warn');\n\n/**\n * A schema is classified as a schema for a single property if:\n * - `type` is defined on the schema as a string.\n * - OR `default` is defined on the schema, as a reserved keyword.\n * - OR schema is empty.\n */\nfunction isSingleProperty (schema) {\n if ('type' in schema) {\n return typeof schema.type === 'string';\n }\n return 'default' in schema;\n}\nmodule.exports.isSingleProperty = isSingleProperty;\n\n/**\n * Build step to schema to use `type` to inject default value, parser, and stringifier.\n *\n * @param {object} schema\n * @param {string} componentName\n * @returns {object} Schema.\n */\nmodule.exports.process = function (schema, componentName) {\n var propName;\n\n // For single property schema, run processPropDefinition over the whole schema.\n if (isSingleProperty(schema)) {\n return processPropertyDefinition(schema, componentName);\n }\n\n // For multi-property schema, run processPropDefinition over each property definition.\n for (propName in schema) {\n schema[propName] = processPropertyDefinition(schema[propName], componentName);\n }\n return schema;\n};\n\n/**\n * Inject default value, parser, stringifier for single property.\n *\n * @param {object} propDefinition\n * @param {string} componentName\n */\nfunction processPropertyDefinition (propDefinition, componentName) {\n var defaultVal = propDefinition.default;\n var isCustomType;\n var propType;\n var typeName = propDefinition.type;\n\n // Type inference.\n if (!propDefinition.type) {\n if (defaultVal !== undefined &&\n (typeof defaultVal === 'boolean' || typeof defaultVal === 'number')) {\n // Type inference.\n typeName = typeof defaultVal;\n } else if (Array.isArray(defaultVal)) {\n typeName = 'array';\n } else {\n // Fall back to string.\n typeName = 'string';\n }\n } else if (propDefinition.type === 'bool') {\n typeName = 'boolean';\n } else if (propDefinition.type === 'float') {\n typeName = 'number';\n }\n\n propType = propertyTypes[typeName];\n if (!propType) {\n warn('Unknown property type for component `' + componentName + '`: ' + typeName);\n }\n\n // Fill in parse and stringify using property types.\n isCustomType = !!propDefinition.parse;\n propDefinition.parse = propDefinition.parse || propType.parse;\n propDefinition.stringify = propDefinition.stringify || propType.stringify;\n\n // Fill in type name.\n propDefinition.type = typeName;\n\n // Check that default value exists.\n if ('default' in propDefinition) {\n // Check that default values are valid.\n if (!isCustomType && !isValidDefaultValue(typeName, defaultVal)) {\n warn('Default value `' + defaultVal + '` does not match type `' + typeName +\n '` in component `' + componentName + '`');\n }\n } else {\n // Fill in default value.\n propDefinition.default = propType.default;\n }\n\n return propDefinition;\n}\nmodule.exports.processPropertyDefinition = processPropertyDefinition;\n\n/**\n * Parse propData using schema. Use default values if not existing in propData.\n *\n * @param {object} propData - Unparsed properties.\n * @param {object} schema - Property types definition.\n * @param {boolean} getPartialData - Whether to return full component data or just the data\n * with keys in `propData`.\n * @param {string } componentName - Name of the component, used for the property warning.\n * @param {boolean} silent - Suppress warning messages.\n */\nmodule.exports.parseProperties = (function () {\n var propNames = [];\n\n return function (propData, schema, getPartialData, componentName, silent) {\n var i;\n var propName;\n var propDefinition;\n var propValue;\n\n propNames.length = 0;\n for (propName in (getPartialData ? propData : schema)) {\n if (getPartialData && propData[propName] === undefined) { continue; }\n propNames.push(propName);\n }\n\n if (propData === null || typeof propData !== 'object') { return propData; }\n\n // Validation errors.\n for (propName in propData) {\n if (propData[propName] !== undefined && !schema[propName] && !silent) {\n warn('Unknown property `' + propName +\n '` for component/system `' + componentName + '`.');\n }\n }\n\n for (i = 0; i < propNames.length; i++) {\n propName = propNames[i];\n propDefinition = schema[propName];\n propValue = propData[propName];\n if (!(schema[propName])) { return; }\n propData[propName] = parseProperty(propValue, propDefinition);\n }\n\n return propData;\n };\n})();\n\n/**\n * Deserialize a single property.\n */\nfunction parseProperty (value, propDefinition) {\n // Use default value if value is falsy.\n if (value === undefined || value === null || value === '') {\n value = propDefinition.default;\n if (Array.isArray(value)) { value = value.slice(); }\n }\n // Invoke property type parser.\n return propDefinition.parse(value, propDefinition.default);\n}\nmodule.exports.parseProperty = parseProperty;\n\n/**\n * Serialize a group of properties.\n */\nmodule.exports.stringifyProperties = function (propData, schema) {\n var propName;\n var propDefinition;\n var propValue;\n var stringifiedData = {};\n var value;\n\n for (propName in propData) {\n propDefinition = schema[propName];\n propValue = propData[propName];\n value = propValue;\n if (typeof value === 'object') {\n value = stringifyProperty(propValue, propDefinition);\n if (!propDefinition) { warn('Unknown component property: ' + propName); }\n }\n stringifiedData[propName] = value;\n }\n return stringifiedData;\n};\n\n/**\n * Serialize a single property.\n */\nfunction stringifyProperty (value, propDefinition) {\n // This function stringifies but it's used in a context where\n // there's always second stringification pass. By returning the original\n // value when it's not an object we save one unnecessary call\n // to JSON.stringify.\n if (typeof value !== 'object') { return value; }\n // if there's no schema for the property we use standar JSON stringify\n if (!propDefinition || value === null) { return JSON.stringify(value); }\n return propDefinition.stringify(value);\n}\nmodule.exports.stringifyProperty = stringifyProperty;\n","var schema = require('./schema');\n\nvar processSchema = schema.process;\nvar shaders = module.exports.shaders = {}; // Keep track of registered shaders.\nvar shaderNames = module.exports.shaderNames = []; // Keep track of the names of registered shaders.\nvar THREE = require('../lib/three');\nvar utils = require('../utils');\n\n// A-Frame properties to three.js uniform types.\nvar propertyToThreeMapping = {\n array: 'v3',\n color: 'v3',\n int: 'i',\n number: 'f',\n map: 't',\n time: 'f',\n vec2: 'v2',\n vec3: 'v3',\n vec4: 'v4'\n};\n\n/**\n * Shader class definition.\n *\n * Shaders extend the material component API so you can create your own library\n * of customized materials\n *\n */\nvar Shader = module.exports.Shader = function () {};\n\nShader.prototype = {\n /**\n * Contains the type schema and defaults for the data values.\n * Data is coerced into the types of the values of the defaults.\n */\n schema: {},\n\n vertexShader:\n 'void main() {' +\n 'gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);' +\n '}',\n\n fragmentShader:\n 'void main() {' +\n 'gl_FragColor = vec4(1.0, 0.0, 1.0, 1.0);' +\n '}',\n\n /**\n * Init handler. Similar to attachedCallback.\n * Called during shader initialization and is only run once.\n */\n init: function (data) {\n this.attributes = this.initVariables(data, 'attribute');\n this.uniforms = this.initVariables(data, 'uniform');\n this.material = new (this.raw ? THREE.RawShaderMaterial : THREE.ShaderMaterial)({\n // attributes: this.attributes,\n uniforms: this.uniforms,\n vertexShader: this.vertexShader,\n fragmentShader: this.fragmentShader\n });\n return this.material;\n },\n\n initVariables: function (data, type) {\n var key;\n var schema = this.schema;\n var variables = {};\n var varType;\n\n for (key in schema) {\n if (schema[key].is !== type) { continue; }\n varType = propertyToThreeMapping[schema[key].type];\n variables[key] = {\n type: varType,\n value: undefined // Let updateVariables handle setting these.\n };\n }\n return variables;\n },\n\n /**\n * Update handler. Similar to attributeChangedCallback.\n * Called whenever the associated material data changes.\n *\n * @param {object} data - New material data.\n */\n update: function (data) {\n this.updateVariables(data, 'attribute');\n this.updateVariables(data, 'uniform');\n },\n\n updateVariables: function (data, type) {\n var key;\n var materialKey;\n var schema = this.schema;\n var variables;\n\n variables = type === 'uniform' ? this.uniforms : this.attributes;\n for (key in data) {\n if (!schema[key] || schema[key].is !== type) { continue; }\n\n if (schema[key].type === 'map') {\n // If data unchanged, get out early.\n if (!variables[key] || variables[key].value === data[key]) { continue; }\n\n // Special handling is needed for textures.\n materialKey = '_texture_' + key;\n\n // We can't actually set the variable correctly until we've loaded the texture.\n this.setMapOnTextureLoad(variables, key, materialKey);\n\n // Kick off the texture update now that handler is added.\n utils.material.updateMapMaterialFromData(materialKey, key, this, data);\n continue;\n }\n variables[key].value = this.parseValue(schema[key].type, data[key]);\n variables[key].needsUpdate = true;\n }\n },\n\n parseValue: function (type, value) {\n var color;\n switch (type) {\n case 'vec2': {\n return new THREE.Vector2(value.x, value.y);\n }\n case 'vec3': {\n return new THREE.Vector3(value.x, value.y, value.z);\n }\n case 'vec4': {\n return new THREE.Vector4(value.x, value.y, value.z, value.w);\n }\n case 'color': {\n color = new THREE.Color(value);\n return new THREE.Vector3(color.r, color.g, color.b);\n }\n case 'map': {\n return THREE.ImageUtils.loadTexture(value);\n }\n default: {\n return value;\n }\n }\n },\n\n setMapOnTextureLoad: function (variables, key, materialKey) {\n var self = this;\n this.el.addEventListener('materialtextureloaded', function () {\n variables[key].value = self.material[materialKey];\n variables[key].needsUpdate = true;\n });\n }\n};\n\n/**\n * Registers a shader to A-Frame.\n *\n * @param {string} name - shader name.\n * @param {object} definition - shader property and methods.\n * @returns {object} Shader.\n */\nmodule.exports.registerShader = function (name, definition) {\n var NewShader;\n var proto = {};\n\n // Format definition object to prototype object.\n Object.keys(definition).forEach(function (key) {\n proto[key] = {\n value: definition[key],\n writable: true\n };\n });\n\n if (shaders[name]) {\n throw new Error('The shader ' + name + ' has been already registered');\n }\n NewShader = function () { Shader.call(this); };\n NewShader.prototype = Object.create(Shader.prototype, proto);\n NewShader.prototype.name = name;\n NewShader.prototype.constructor = NewShader;\n shaders[name] = {\n Shader: NewShader,\n schema: processSchema(NewShader.prototype.schema)\n };\n shaderNames.push(name);\n return NewShader;\n};\n","var components = require('./component');\nvar schema = require('./schema');\nvar utils = require('../utils/');\n\nvar parseProperties = schema.parseProperties;\nvar parseProperty = schema.parseProperty;\nvar processSchema = schema.process;\nvar isSingleProp = schema.isSingleProperty;\nvar styleParser = utils.styleParser;\n\nvar systems = module.exports.systems = {}; // Keep track of registered systems.\n\n/**\n * System class definition.\n *\n * Systems provide global scope and services to a group of instantiated components of the\n * same class. They can also help abstract logic away from components such that components\n * only have to worry about data.\n *\n * For example, a physics component that creates a physics world that oversees\n * all entities with a physics or rigid body component.\n *\n * TODO: Have the System prototype reuse the Component prototype. Most code is copied\n * and some pieces are missing from the Component facilities (e.g., attribute caching,\n * setAttribute behavior).\n *\n * @member {string} name - Name that system is registered under.\n * @member {Element} sceneEl - Handle to the scene element where system applies to.\n */\nvar System = module.exports.System = function (sceneEl) {\n var component = components && components.components[this.name];\n\n // Set reference to scene.\n this.el = sceneEl;\n this.sceneEl = sceneEl;\n\n // Set reference to matching component (if exists).\n if (component) { component.Component.prototype.system = this; }\n\n // Process system configuration.\n this.buildData();\n this.init();\n this.update({});\n};\n\nSystem.prototype = {\n /**\n * Schema to configure system.\n */\n schema: {},\n\n /**\n * Init handler. Called during scene initialization and is only run once.\n * Systems can use this to set initial state.\n */\n init: function () { /* no-op */ },\n\n /**\n * Update handler. Called during scene attribute updates.\n * Systems can use this to dynamically update their state.\n */\n update: function (oldData) { /* no-op */ },\n\n /**\n * Build data and call update handler.\n *\n * @private\n */\n updateProperties: function (rawData) {\n var oldData = this.data;\n if (!Object.keys(schema).length) { return; }\n this.buildData(rawData);\n this.update(oldData);\n },\n\n /**\n * Parse data.\n */\n buildData: function (rawData) {\n var schema = this.schema;\n if (!Object.keys(schema).length) { return; }\n rawData = rawData || window.HTMLElement.prototype.getAttribute.call(this.sceneEl, this.name);\n if (isSingleProp(schema)) {\n this.data = parseProperty(rawData, schema);\n } else {\n this.data = parseProperties(styleParser.parse(rawData) || {}, schema);\n }\n },\n\n /**\n * Tick handler.\n * Called on each tick of the scene render loop.\n * Affected by play and pause.\n *\n * @param {number} time - Scene tick time.\n * @param {number} timeDelta - Difference in current render time and previous render time.\n */\n tick: undefined,\n\n /**\n * Tock handler.\n * Called on each tock of the scene render loop.\n * Affected by play and pause.\n *\n * @param {number} time - Scene tick time.\n * @param {number} timeDelta - Difference in current render time and previous render time.\n */\n tock: undefined,\n\n /**\n * Called to start any dynamic behavior (e.g., animation, AI, events, physics).\n */\n play: function () { /* no-op */ },\n\n /**\n * Called to stop any dynamic behavior (e.g., animation, AI, events, physics).\n */\n pause: function () { /* no-op */ }\n};\n\n/**\n * Registers a system to A-Frame.\n *\n * @param {string} name - Component name.\n * @param {object} definition - Component property and methods.\n * @returns {object} Component.\n */\nmodule.exports.registerSystem = function (name, definition) {\n var i;\n var NewSystem;\n var proto = {};\n var scenes = utils.findAllScenes(document);\n\n // Format definition object to prototype object.\n Object.keys(definition).forEach(function (key) {\n proto[key] = {\n value: definition[key],\n writable: true\n };\n });\n\n if (systems[name]) {\n throw new Error('The system `' + name + '` has been already registered. ' +\n 'Check that you are not loading two versions of the same system ' +\n 'or two different systems of the same name.');\n }\n NewSystem = function (sceneEl) { System.call(this, sceneEl); };\n NewSystem.prototype = Object.create(System.prototype, proto);\n NewSystem.prototype.name = name;\n NewSystem.prototype.constructor = NewSystem;\n NewSystem.prototype.schema = utils.extend(processSchema(NewSystem.prototype.schema));\n systems[name] = NewSystem;\n\n // Initialize systems for existing scenes\n for (i = 0; i < scenes.length; i++) { scenes[i].initSystem(name); }\n};\n","require('./pivot');\n","var registerComponent = require('../../core/component').registerComponent;\nvar THREE = require('../../lib/three');\n\nvar originalPosition = new THREE.Vector3();\nvar originalRotation = new THREE.Vector3();\n\n/**\n * Wrap el.object3D within an outer group. Apply pivot to el.object3D as position.\n */\nregisterComponent('pivot', {\n dependencies: ['position'],\n\n schema: {type: 'vec3'},\n\n init: function () {\n var data = this.data;\n var el = this.el;\n var originalParent = el.object3D.parent;\n var originalGroup = el.object3D;\n var outerGroup = new THREE.Group();\n\n originalPosition.copy(originalGroup.position);\n originalRotation.copy(originalGroup.rotation);\n\n // Detach current group from parent.\n originalParent.remove(originalGroup);\n outerGroup.add(originalGroup);\n\n // Set new group as the outer group.\n originalParent.add(outerGroup);\n\n // Set outer group as new object3D.\n el.object3D = outerGroup;\n\n // Apply pivot to original group.\n originalGroup.position.set(-1 * data.x, -1 * data.y, -1 * data.z);\n\n // Offset the pivot so that world position not affected.\n // And restore position onto outer group.\n outerGroup.position.set(data.x + originalPosition.x, data.y + originalPosition.y,\n data.z + originalPosition.z);\n\n // Transfer rotation to outer group.\n outerGroup.rotation.copy(originalGroup.rotation);\n originalGroup.rotation.set(0, 0, 0);\n }\n});\n","/**\n * Common mesh defaults, mappings, and transforms.\n */\nvar components = require('../../core/component').components;\nvar shaders = require('../../core/shader').shaders;\nvar utils = require('../../utils/');\n\nvar materialMappings = {};\nObject.keys(components.material.schema).forEach(addMapping);\nObject.keys(shaders.standard.schema).forEach(addMapping);\n\nfunction addMapping (prop) {\n // To hyphenated.\n var htmlAttrName = prop.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n if (prop === 'fog') { htmlAttrName = 'material-fog'; }\n if (prop === 'visible') { htmlAttrName = 'material-visible'; }\n materialMappings[htmlAttrName] = 'material.' + prop;\n}\n\nmodule.exports = function getMeshMixin () {\n return {\n defaultComponents: {material: {}},\n mappings: utils.extend({}, materialMappings)\n };\n};\n","require('./primitives/a-camera');\nrequire('./primitives/a-cursor');\nrequire('./primitives/a-curvedimage');\nrequire('./primitives/a-gltf-model');\nrequire('./primitives/a-image');\nrequire('./primitives/a-light');\nrequire('./primitives/a-link');\nrequire('./primitives/a-obj-model');\nrequire('./primitives/a-sky');\nrequire('./primitives/a-sound');\nrequire('./primitives/a-text');\nrequire('./primitives/a-video');\nrequire('./primitives/a-videosphere');\nrequire('./primitives/meshPrimitives');\n","var AEntity = require('../../core/a-entity');\nvar components = require('../../core/component').components;\nvar registerElement = require('../../core/a-register-element').registerElement;\nvar utils = require('../../utils/');\n\nvar debug = utils.debug;\nvar setComponentProperty = utils.entity.setComponentProperty;\nvar log = debug('extras:primitives:debug');\nvar warn = debug('extras:primitives:warn');\n\nvar primitives = module.exports.primitives = {};\n\nmodule.exports.registerPrimitive = function registerPrimitive (name, definition) {\n name = name.toLowerCase();\n log('Registering <%s>', name);\n\n // Deprecation warning for defaultAttributes usage.\n if (definition.defaultAttributes) {\n warn(\"The 'defaultAttributes' object is deprecated. Use 'defaultComponents' instead.\");\n }\n\n var primitive = registerElement(name, {\n prototype: Object.create(AEntity.prototype, {\n defaultComponentsFromPrimitive: {\n value: definition.defaultComponents || definition.defaultAttributes || {}\n },\n deprecated: {value: definition.deprecated || null},\n deprecatedMappings: {value: definition.deprecatedMappings || {}},\n mappings: {value: definition.mappings || {}},\n\n createdCallback: {\n value: function () {\n if (definition.deprecated) { console.warn(definition.deprecated); }\n this.resolveMappingCollisions();\n }\n },\n\n /**\n * If a mapping collides with a registered component name\n * it renames the mapping to componentname-property\n */\n resolveMappingCollisions: {\n value: function () {\n var mappings = this.mappings;\n var self = this;\n Object.keys(mappings).forEach(function resolveCollision (key) {\n var newAttribute;\n if (key !== key.toLowerCase()) { warn('Mapping keys should be specified in lower case. The mapping key ' + key + ' may not be recognized'); }\n if (components[key]) {\n newAttribute = mappings[key].replace('.', '-');\n mappings[newAttribute] = mappings[key];\n delete mappings[key];\n console.warn('The primitive ' + self.tagName.toLowerCase() + ' has a mapping collision. ' +\n 'The attribute ' + key + ' has the same name as a registered component and' +\n ' has been renamed to ' + newAttribute);\n }\n });\n }\n },\n\n getExtraComponents: {\n value: function () {\n var attr;\n var data;\n var i;\n var mapping;\n var mixins;\n var path;\n var self = this;\n\n // Gather component data from default components.\n data = utils.clone(this.defaultComponentsFromPrimitive);\n\n // Factor in mixins to overwrite default components.\n mixins = this.getAttribute('mixin');\n if (mixins) {\n mixins = mixins.trim().split(' ');\n mixins.forEach(function applyMixin (mixinId) {\n var mixinComponents = self.sceneEl.querySelector('#' + mixinId).componentCache;\n Object.keys(mixinComponents).forEach(function setComponent (name) {\n data[name] = extend(data[name], mixinComponents[name]);\n });\n });\n }\n\n // Gather component data from mappings.\n for (i = 0; i < this.attributes.length; i++) {\n attr = this.attributes[i];\n mapping = this.mappings[attr.name];\n if (mapping) {\n path = utils.entity.getComponentPropertyPath(mapping);\n if (path.constructor === Array) {\n data[path[0]] = data[path[0]] || {};\n data[path[0]][path[1]] = attr.value.trim();\n } else {\n data[path] = attr.value.trim();\n }\n continue;\n }\n }\n\n return data;\n\n /**\n * For the base to be extensible, both objects must be pure JavaScript objects.\n * The function assumes that base is undefined, or null or a pure object.\n */\n function extend (base, extension) {\n if (isUndefined(base)) {\n return copy(extension);\n }\n if (isUndefined(extension)) {\n return copy(base);\n }\n if (isPureObject(base) && isPureObject(extension)) {\n return utils.extendDeep(base, extension);\n }\n return copy(extension);\n }\n\n function isUndefined (value) {\n return typeof value === 'undefined';\n }\n\n function copy (value) {\n if (isPureObject(value)) {\n return utils.extendDeep({}, value);\n }\n return value;\n }\n\n function isPureObject (value) {\n return value !== null && value.constructor === Object;\n }\n }\n },\n\n /**\n * Sync to attribute to component property whenever mapped attribute changes.\n * If attribute is mapped to a component property, set the component property using\n * the attribute value.\n */\n attributeChangedCallback: {\n value: function (attr, oldVal, value) {\n var componentName = this.mappings[attr];\n\n if (attr in this.deprecatedMappings) {\n console.warn(this.deprecatedMappings[attr]);\n }\n\n if (!attr || !componentName) { return; }\n\n // Set value.\n setComponentProperty(this, componentName, value);\n }\n }\n })\n });\n\n // Store.\n primitives[name] = primitive;\n return primitive;\n};\n\n/**\n * Add component mappings using schema.\n */\nfunction addComponentMapping (componentName, mappings) {\n var schema = components[componentName].schema;\n Object.keys(schema).map(function (prop) {\n // Hyphenate where there is camelCase.\n var attrName = prop.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n // If there is a mapping collision, prefix with component name and hyphen.\n if (mappings[attrName] !== undefined) { attrName = componentName + '-' + prop; }\n mappings[attrName] = componentName + '.' + prop;\n });\n}\n\n/**\n * Helper to define a primitive, building mappings using a component schema.\n */\nfunction definePrimitive (tagName, defaultComponents, mappings) {\n // If no initial mappings provided, start from empty map.\n mappings = mappings || {};\n\n // From the default components, add mapping automagically.\n Object.keys(defaultComponents).map(function buildMappings (componentName) {\n addComponentMapping(componentName, mappings);\n });\n\n // Register the primitive.\n module.exports.registerPrimitive(tagName, utils.extendDeep({}, null, {\n defaultComponents: defaultComponents,\n mappings: mappings\n }));\n}\nmodule.exports.definePrimitive = definePrimitive;\n","var registerPrimitive = require('../primitives').registerPrimitive;\n\nregisterPrimitive('a-camera', {\n defaultComponents: {\n 'camera': {},\n 'look-controls': {},\n 'wasd-controls': {},\n 'position': {x: 0, y: 1.6, z: 0}\n },\n\n mappings: {\n active: 'camera.active',\n far: 'camera.far',\n fov: 'camera.fov',\n 'look-controls-enabled': 'look-controls.enabled',\n near: 'camera.near',\n 'pointer-lock-enabled': 'look-controls.pointerLockEnabled',\n 'wasd-controls-enabled': 'wasd-controls.enabled',\n 'reverse-mouse-drag': 'look-controls.reverseMouseDrag',\n zoom: 'camera.zoom'\n }\n});\n","var getMeshMixin = require('../getMeshMixin');\nvar registerPrimitive = require('../primitives').registerPrimitive;\nvar utils = require('../../../utils/');\n\nregisterPrimitive('a-cursor', utils.extendDeep({}, getMeshMixin(), {\n defaultComponents: {\n cursor: {},\n geometry: {\n primitive: 'ring',\n radiusOuter: 0.016,\n radiusInner: 0.01,\n segmentsTheta: 32\n },\n material: {\n color: '#000',\n shader: 'flat',\n opacity: 0.8\n },\n position: {\n x: 0,\n y: 0,\n z: -1\n }\n },\n\n mappings: {\n far: 'raycaster.far',\n fuse: 'cursor.fuse',\n 'fuse-timeout': 'cursor.fuseTimeout',\n interval: 'raycaster.interval',\n objects: 'raycaster.objects'\n }\n}));\n","var getMeshMixin = require('../getMeshMixin');\nvar registerPrimitive = require('../primitives').registerPrimitive;\nvar utils = require('../../../utils/');\n\nregisterPrimitive('a-curvedimage', utils.extendDeep({}, getMeshMixin(), {\n defaultComponents: {\n geometry: {\n height: 1,\n primitive: 'cylinder',\n radius: 2,\n segmentsRadial: 48,\n thetaLength: 270,\n openEnded: true,\n thetaStart: 0\n },\n material: {\n color: '#FFF',\n shader: 'flat',\n side: 'double',\n transparent: true,\n repeat: '-1 1'\n }\n },\n\n mappings: {\n height: 'geometry.height',\n 'open-ended': 'geometry.openEnded',\n radius: 'geometry.radius',\n segments: 'geometry.segmentsRadial',\n start: 'geometry.thetaStart',\n 'theta-length': 'geometry.thetaLength',\n 'theta-start': 'geometry.thetaStart',\n 'width': 'geometry.thetaLength'\n }\n}));\n","var registerPrimitive = require('../primitives').registerPrimitive;\n\nregisterPrimitive('a-gltf-model', {\n mappings: {\n src: 'gltf-model'\n }\n});\n","var getMeshMixin = require('../getMeshMixin');\nvar registerPrimitive = require('../primitives').registerPrimitive;\nvar utils = require('../../../utils/');\n\nregisterPrimitive('a-image', utils.extendDeep({}, getMeshMixin(), {\n defaultComponents: {\n geometry: {\n primitive: 'plane'\n },\n material: {\n color: '#FFF',\n shader: 'flat',\n side: 'double',\n transparent: true\n }\n },\n\n mappings: {\n height: 'geometry.height',\n width: 'geometry.width'\n }\n}));\n","var registerPrimitive = require('../primitives').registerPrimitive;\n\nregisterPrimitive('a-light', {\n defaultComponents: {\n light: {}\n },\n\n mappings: {\n angle: 'light.angle',\n color: 'light.color',\n 'ground-color': 'light.groundColor',\n decay: 'light.decay',\n distance: 'light.distance',\n intensity: 'light.intensity',\n penumbra: 'light.penumbra',\n type: 'light.type',\n target: 'light.target',\n envmap: 'light.envMap'\n }\n});\n","var registerPrimitive = require('../primitives').registerPrimitive;\n\nregisterPrimitive('a-link', {\n defaultComponents: {\n link: {\n visualAspectEnabled: true\n }\n },\n\n mappings: {\n href: 'link.href',\n image: 'link.image',\n title: 'link.title'\n }\n});\n","var meshMixin = require('../getMeshMixin')();\nvar registerPrimitive = require('../primitives').registerPrimitive;\nvar utils = require('../../../utils/');\n\nregisterPrimitive('a-obj-model', utils.extendDeep({}, meshMixin, {\n defaultComponents: {\n 'obj-model': {}\n },\n\n mappings: {\n src: 'obj-model.obj',\n mtl: 'obj-model.mtl'\n }\n}));\n","var getMeshMixin = require('../getMeshMixin');\nvar registerPrimitive = require('../primitives').registerPrimitive;\nvar utils = require('../../../utils/');\nvar meshPrimitives = require('./meshPrimitives');\n\nregisterPrimitive('a-sky', utils.extendDeep({}, getMeshMixin(), {\n defaultComponents: {\n geometry: {\n primitive: 'sphere',\n radius: 500,\n segmentsWidth: 64,\n segmentsHeight: 32\n },\n material: {\n color: '#FFF',\n side: 'back',\n shader: 'flat',\n npot: true\n },\n scale: '-1 1 1'\n },\n\n mappings: utils.extendDeep({}, meshPrimitives['a-sphere'].prototype.mappings)\n}));\n","var registerPrimitive = require('../primitives').registerPrimitive;\n\nregisterPrimitive('a-sound', {\n defaultComponents: {\n sound: {}\n },\n\n mappings: {\n src: 'sound.src',\n on: 'sound.on',\n autoplay: 'sound.autoplay',\n loop: 'sound.loop',\n volume: 'sound.volume'\n }\n});\n","// <a-text> using `definePrimitive` helper.\nvar definePrimitive = require('../primitives').definePrimitive;\ndefinePrimitive('a-text', {text: {anchor: 'align', width: 5}});\n","var getMeshMixin = require('../getMeshMixin');\nvar registerPrimitive = require('../primitives').registerPrimitive;\nvar utils = require('../../../utils/');\n\nregisterPrimitive('a-video', utils.extendDeep({}, getMeshMixin(), {\n defaultComponents: {\n geometry: {\n primitive: 'plane'\n },\n material: {\n color: '#FFF',\n shader: 'flat',\n side: 'double',\n transparent: true\n }\n },\n\n mappings: {\n height: 'geometry.height',\n width: 'geometry.width'\n }\n}));\n","var getMeshMixin = require('../getMeshMixin');\nvar registerPrimitive = require('../primitives').registerPrimitive;\nvar utils = require('../../../utils/');\n\nregisterPrimitive('a-videosphere', utils.extendDeep({}, getMeshMixin(), {\n defaultComponents: {\n geometry: {\n primitive: 'sphere',\n radius: 500,\n segmentsWidth: 64,\n segmentsHeight: 32\n },\n material: {\n color: '#FFF',\n shader: 'flat',\n side: 'back',\n npot: true\n },\n scale: '-1 1 1'\n },\n\n mappings: {\n radius: 'geometry.radius',\n 'segments-height': 'geometry.segmentsHeight',\n 'segments-width': 'geometry.segmentsWidth'\n }\n}));\n","/**\n * Automated mesh primitive registration.\n */\nvar getMeshMixin = require('../getMeshMixin');\nvar geometries = require('../../../core/geometry').geometries;\nvar geometryNames = require('../../../core/geometry').geometryNames;\nvar registerPrimitive = require('../primitives').registerPrimitive;\nvar utils = require('../../../utils/');\n\n// For testing.\nvar meshPrimitives = module.exports = {};\n\n// Generate primitive for each geometry type.\ngeometryNames.forEach(function registerMeshPrimitive (geometryName) {\n var geometry = geometries[geometryName];\n var geometryHyphened = unCamelCase(geometryName);\n\n // Generate mappings.\n var mappings = {};\n Object.keys(geometry.schema).forEach(function createMapping (property) {\n mappings[unCamelCase(property)] = 'geometry.' + property;\n });\n\n // Register.\n var tagName = 'a-' + geometryHyphened;\n var primitive = registerPrimitive(tagName, utils.extendDeep({}, getMeshMixin(), {\n defaultComponents: {geometry: {primitive: geometryName}},\n mappings: mappings\n }));\n meshPrimitives[tagName] = primitive;\n});\n\n/**\n * camelCase to hyphened-string.\n */\nfunction unCamelCase (str) {\n return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n}\n","var registerGeometry = require('../core/geometry').registerGeometry;\nvar THREE = require('../lib/three');\n\nregisterGeometry('box', {\n schema: {\n depth: {default: 1, min: 0},\n height: {default: 1, min: 0},\n width: {default: 1, min: 0},\n segmentsHeight: {default: 1, min: 1, max: 20, type: 'int'},\n segmentsWidth: {default: 1, min: 1, max: 20, type: 'int'},\n segmentsDepth: {default: 1, min: 1, max: 20, type: 'int'}\n },\n\n init: function (data) {\n this.geometry = new THREE.BoxGeometry(\n data.width, data.height, data.depth,\n data.segmentsWidth, data.segmentsHeight, data.segmentsDepth);\n }\n});\n","var registerGeometry = require('../core/geometry').registerGeometry;\nvar THREE = require('../lib/three');\n\nvar degToRad = THREE.Math.degToRad;\n\nregisterGeometry('circle', {\n schema: {\n radius: {default: 1, min: 0},\n segments: {default: 32, min: 3, type: 'int'},\n thetaLength: {default: 360, min: 0},\n thetaStart: {default: 0}\n },\n\n init: function (data) {\n this.geometry = new THREE.CircleGeometry(\n data.radius, data.segments, degToRad(data.thetaStart), degToRad(data.thetaLength));\n }\n});\n","var registerGeometry = require('../core/geometry').registerGeometry;\nvar THREE = require('../lib/three');\n\nvar degToRad = THREE.Math.degToRad;\n\nregisterGeometry('cone', {\n schema: {\n height: {default: 1, min: 0},\n openEnded: {default: false},\n radiusBottom: {default: 1, min: 0},\n radiusTop: {default: 0.01, min: 0},\n segmentsHeight: {default: 18, min: 1, type: 'int'},\n segmentsRadial: {default: 36, min: 3, type: 'int'},\n thetaLength: {default: 360, min: 0},\n thetaStart: {default: 0}\n },\n\n init: function (data) {\n this.geometry = new THREE.CylinderGeometry(\n data.radiusTop, data.radiusBottom, data.height, data.segmentsRadial,\n data.segmentsHeight, data.openEnded, degToRad(data.thetaStart),\n degToRad(data.thetaLength));\n }\n});\n","var registerGeometry = require('../core/geometry').registerGeometry;\nvar THREE = require('../lib/three');\n\nvar degToRad = THREE.Math.degToRad;\n\nregisterGeometry('cylinder', {\n schema: {\n height: {default: 1, min: 0},\n openEnded: {default: false},\n radius: {default: 1, min: 0},\n segmentsHeight: {default: 18, min: 1, type: 'int'},\n segmentsRadial: {default: 36, min: 3, type: 'int'},\n thetaLength: {default: 360, min: 0},\n thetaStart: {default: 0}\n },\n\n init: function (data) {\n this.geometry = new THREE.CylinderGeometry(\n data.radius, data.radius, data.height, data.segmentsRadial, data.segmentsHeight,\n data.openEnded, degToRad(data.thetaStart), degToRad(data.thetaLength));\n }\n});\n","var registerGeometry = require('../core/geometry').registerGeometry;\nvar THREE = require('../lib/three');\n\nregisterGeometry('dodecahedron', {\n schema: {\n detail: {default: 0, min: 0, max: 5, type: 'int'},\n radius: {default: 1, min: 0}\n },\n\n init: function (data) {\n this.geometry = new THREE.DodecahedronGeometry(data.radius, data.detail);\n }\n});\n","var registerGeometry = require('../core/geometry').registerGeometry;\nvar THREE = require('../lib/three');\n\nregisterGeometry('icosahedron', {\n schema: {\n detail: {default: 0, min: 0, max: 5, type: 'int'},\n radius: {default: 1, min: 0}\n },\n\n init: function (data) {\n this.geometry = new THREE.IcosahedronGeometry(data.radius, data.detail);\n }\n});\n","require('./box.js');\nrequire('./circle.js');\nrequire('./cone.js');\nrequire('./cylinder.js');\nrequire('./dodecahedron.js');\nrequire('./icosahedron.js');\nrequire('./octahedron.js');\nrequire('./plane.js');\nrequire('./ring.js');\nrequire('./sphere.js');\nrequire('./tetrahedron.js');\nrequire('./torus.js');\nrequire('./torusKnot.js');\nrequire('./triangle.js');\n","var registerGeometry = require('../core/geometry').registerGeometry;\nvar THREE = require('../lib/three');\n\nregisterGeometry('octahedron', {\n schema: {\n detail: {default: 0, min: 0, max: 5, type: 'int'},\n radius: {default: 1, min: 0}\n },\n\n init: function (data) {\n this.geometry = new THREE.OctahedronGeometry(data.radius, data.detail);\n }\n});\n","var registerGeometry = require('../core/geometry').registerGeometry;\nvar THREE = require('../lib/three');\n\nregisterGeometry('plane', {\n schema: {\n height: {default: 1, min: 0},\n width: {default: 1, min: 0},\n segmentsHeight: {default: 1, min: 1, max: 20, type: 'int'},\n segmentsWidth: {default: 1, min: 1, max: 20, type: 'int'}\n },\n\n init: function (data) {\n this.geometry = new THREE.PlaneGeometry(data.width, data.height, data.segmentsWidth, data.segmentsHeight);\n }\n});\n","var registerGeometry = require('../core/geometry').registerGeometry;\nvar THREE = require('../lib/three');\n\nvar degToRad = THREE.Math.degToRad;\n\nregisterGeometry('ring', {\n schema: {\n radiusInner: {default: 0.8, min: 0},\n radiusOuter: {default: 1.2, min: 0},\n segmentsPhi: {default: 10, min: 1, type: 'int'},\n segmentsTheta: {default: 32, min: 3, type: 'int'},\n thetaLength: {default: 360, min: 0},\n thetaStart: {default: 0}\n },\n\n init: function (data) {\n this.geometry = new THREE.RingGeometry(\n data.radiusInner, data.radiusOuter, data.segmentsTheta, data.segmentsPhi,\n degToRad(data.thetaStart), degToRad(data.thetaLength));\n }\n});\n","var registerGeometry = require('../core/geometry').registerGeometry;\nvar THREE = require('../lib/three');\n\nvar degToRad = THREE.Math.degToRad;\n\nregisterGeometry('sphere', {\n schema: {\n radius: {default: 1, min: 0},\n phiLength: {default: 360},\n phiStart: {default: 0, min: 0},\n thetaLength: {default: 180, min: 0},\n thetaStart: {default: 0},\n segmentsHeight: {default: 18, min: 2, type: 'int'},\n segmentsWidth: {default: 36, min: 3, type: 'int'}\n },\n\n init: function (data) {\n this.geometry = new THREE.SphereGeometry(\n data.radius, data.segmentsWidth, data.segmentsHeight, degToRad(data.phiStart),\n degToRad(data.phiLength), degToRad(data.thetaStart), degToRad(data.thetaLength));\n }\n});\n","var registerGeometry = require('../core/geometry').registerGeometry;\nvar THREE = require('../lib/three');\n\nregisterGeometry('tetrahedron', {\n schema: {\n detail: {default: 0, min: 0, max: 5, type: 'int'},\n radius: {default: 1, min: 0}\n },\n\n init: function (data) {\n this.geometry = new THREE.TetrahedronGeometry(data.radius, data.detail);\n }\n});\n","var registerGeometry = require('../core/geometry').registerGeometry;\nvar THREE = require('../lib/three');\n\nvar degToRad = THREE.Math.degToRad;\n\nregisterGeometry('torus', {\n schema: {\n arc: {default: 360},\n radius: {default: 1, min: 0},\n radiusTubular: {default: 0.2, min: 0},\n segmentsRadial: {default: 36, min: 2, type: 'int'},\n segmentsTubular: {default: 32, min: 3, type: 'int'}\n },\n\n init: function (data) {\n this.geometry = new THREE.TorusGeometry(\n data.radius, data.radiusTubular * 2, data.segmentsRadial, data.segmentsTubular,\n degToRad(data.arc));\n }\n});\n","var registerGeometry = require('../core/geometry').registerGeometry;\nvar THREE = require('../lib/three');\n\nregisterGeometry('torusKnot', {\n schema: {\n p: {default: 2, min: 1},\n q: {default: 3, min: 1},\n radius: {default: 1, min: 0},\n radiusTubular: {default: 0.2, min: 0},\n segmentsRadial: {default: 8, min: 3, type: 'int'},\n segmentsTubular: {default: 100, min: 3, type: 'int'}\n },\n\n init: function (data) {\n this.geometry = new THREE.TorusKnotGeometry(\n data.radius, data.radiusTubular * 2, data.segmentsTubular, data.segmentsRadial,\n data.p, data.q);\n }\n});\n","var registerGeometry = require('../core/geometry').registerGeometry;\nvar THREE = require('../lib/three');\n\nvar quaternion = new THREE.Quaternion();\nvar rotateVector = new THREE.Vector3(0, 0, 1);\nvar uvMinVector = new THREE.Vector2();\nvar uvMaxVector = new THREE.Vector2();\nvar uvScaleVector = new THREE.Vector2();\n\nregisterGeometry('triangle', {\n schema: {\n vertexA: {type: 'vec3', default: {x: 0, y: 0.5, z: 0}},\n vertexB: {type: 'vec3', default: {x: -0.5, y: -0.5, z: 0}},\n vertexC: {type: 'vec3', default: {x: 0.5, y: -0.5, z: 0}}\n },\n\n init: function (data) {\n var geometry;\n var normal;\n var triangle;\n var uvA;\n var uvB;\n var uvC;\n\n var vertices;\n var normals;\n var uvs;\n\n triangle = new THREE.Triangle();\n triangle.a.set(data.vertexA.x, data.vertexA.y, data.vertexA.z);\n triangle.b.set(data.vertexB.x, data.vertexB.y, data.vertexB.z);\n triangle.c.set(data.vertexC.x, data.vertexC.y, data.vertexC.z);\n normal = triangle.getNormal(new THREE.Vector3());\n\n // Rotate the 3D triangle to be parallel to XY plane.\n quaternion.setFromUnitVectors(normal, rotateVector);\n uvA = triangle.a.clone().applyQuaternion(quaternion);\n uvB = triangle.b.clone().applyQuaternion(quaternion);\n uvC = triangle.c.clone().applyQuaternion(quaternion);\n\n // Compute UVs.\n // Normalize x/y values of UV so they are within 0 to 1.\n uvMinVector.set(Math.min(uvA.x, uvB.x, uvC.x), Math.min(uvA.y, uvB.y, uvC.y));\n uvMaxVector.set(Math.max(uvA.x, uvB.x, uvC.x), Math.max(uvA.y, uvB.y, uvC.y));\n uvScaleVector.set(0, 0).subVectors(uvMaxVector, uvMinVector);\n uvA = new THREE.Vector2().subVectors(uvA, uvMinVector).divide(uvScaleVector);\n uvB = new THREE.Vector2().subVectors(uvB, uvMinVector).divide(uvScaleVector);\n uvC = new THREE.Vector2().subVectors(uvC, uvMinVector).divide(uvScaleVector);\n\n geometry = this.geometry = new THREE.BufferGeometry();\n vertices = [\n triangle.a.x, triangle.a.y, triangle.a.z,\n triangle.b.x, triangle.b.y, triangle.b.z,\n triangle.c.x, triangle.c.y, triangle.c.z\n ];\n normals = [\n normal.x, normal.y, normal.z,\n normal.x, normal.y, normal.z,\n normal.x, normal.y, normal.z\n ];\n uvs = [\n uvA.x, uvA.y,\n uvB.x, uvB.y,\n uvC.x, uvC.y\n ];\n\n geometry.setAttribute('position', new THREE.Float32BufferAttribute(vertices, 3));\n geometry.setAttribute('normal', new THREE.Float32BufferAttribute(normals, 3));\n geometry.setAttribute('uv', new THREE.Float32BufferAttribute(uvs, 2));\n }\n});\n","// Polyfill `Promise`.\nwindow.Promise = window.Promise || require('promise-polyfill');\n\n// WebVR polyfill\n// Check before the polyfill runs.\nwindow.hasNativeWebVRImplementation = !!window.navigator.getVRDisplays ||\n !!window.navigator.getVRDevices;\nwindow.hasNativeWebXRImplementation = navigator.xr !== undefined;\n\n// If native WebXR or WebVR are defined WebVRPolyfill does not initialize.\nif (!window.hasNativeWebXRImplementation && !window.hasNativeWebVRImplementation) {\n var isIOSOlderThan10 = require('./utils/isIOSOlderThan10');\n // Workaround for iOS Safari canvas sizing issues in stereo (webvr-polyfill/issues/102).\n // Only for iOS on versions older than 10.\n var bufferScale = isIOSOlderThan10(window.navigator.userAgent) ? 1 / window.devicePixelRatio : 1;\n var WebVRPolyfill = require('webvr-polyfill');\n var polyfillConfig = {\n BUFFER_SCALE: bufferScale,\n CARDBOARD_UI_DISABLED: true,\n ROTATE_INSTRUCTIONS_DISABLED: true,\n MOBILE_WAKE_LOCK: !!window.cordova\n };\n window.webvrpolyfill = new WebVRPolyfill(polyfillConfig);\n}\n\nvar utils = require('./utils/');\nvar debug = utils.debug;\n\nif (utils.isIE11) {\n // Polyfill `CustomEvent`.\n require('custom-event-polyfill');\n // Polyfill String.startsWith.\n require('../vendor/starts-with-polyfill');\n}\n\nvar error = debug('A-Frame:error');\nvar warn = debug('A-Frame:warn');\n\nif (window.document.currentScript && window.document.currentScript.parentNode !==\n window.document.head && !window.debug) {\n warn('Put the A-Frame <script> tag in the <head> of the HTML *before* the scene to ' +\n 'ensure everything for A-Frame is properly registered before they are used from ' +\n 'HTML.');\n}\n\n// Error if not using a server.\nif (!window.cordova && window.location.protocol === 'file:') {\n error(\n 'This HTML file is currently being served via the file:// protocol. ' +\n 'Assets, textures, and models WILL NOT WORK due to cross-origin policy! ' +\n 'Please use a local or hosted server: ' +\n 'https://aframe.io/docs/0.5.0/introduction/getting-started.html#using-a-local-server.');\n}\n\nrequire('present'); // Polyfill `performance.now()`.\n\n// CSS.\nif (utils.device.isBrowserEnvironment) {\n require('./style/aframe.css');\n require('./style/rStats.css');\n}\n\n// Required before `AEntity` so that all components are registered.\nvar AScene = require('./core/scene/a-scene').AScene;\nvar components = require('./core/component').components;\nvar registerComponent = require('./core/component').registerComponent;\nvar registerGeometry = require('./core/geometry').registerGeometry;\nvar registerPrimitive = require('./extras/primitives/primitives').registerPrimitive;\nvar registerShader = require('./core/shader').registerShader;\nvar registerSystem = require('./core/system').registerSystem;\nvar shaders = require('./core/shader').shaders;\nvar systems = require('./core/system').systems;\n// Exports THREE to window so three.js can be used without alteration.\nvar THREE = window.THREE = require('./lib/three');\n\nvar pkg = require('../package');\n\nrequire('./components/index'); // Register standard components.\nrequire('./geometries/index'); // Register standard geometries.\nrequire('./shaders/index'); // Register standard shaders.\nrequire('./systems/index'); // Register standard systems.\nvar ANode = require('./core/a-node');\nvar AEntity = require('./core/a-entity'); // Depends on ANode and core components.\n\nrequire('./core/a-assets');\nrequire('./core/a-cubemap');\nrequire('./core/a-mixin');\n\n// Extras.\nrequire('./extras/components/');\nrequire('./extras/primitives/');\n\nconsole.log('A-Frame Version: 1.2.0 (Date 2021-11-22, Commit #cf65f451)');\nconsole.log('THREE Version (https://github.com/supermedium/three.js):',\n pkg.dependencies['super-three']);\nconsole.log('WebVR Polyfill Version:', pkg.dependencies['webvr-polyfill']);\n\nmodule.exports = window.AFRAME = {\n AComponent: require('./core/component').Component,\n AEntity: AEntity,\n ANode: ANode,\n ANIME: require('super-animejs'),\n AScene: AScene,\n components: components,\n coreComponents: Object.keys(components),\n geometries: require('./core/geometry').geometries,\n registerComponent: registerComponent,\n registerElement: require('./core/a-register-element').registerElement,\n registerGeometry: registerGeometry,\n registerPrimitive: registerPrimitive,\n registerShader: registerShader,\n registerSystem: registerSystem,\n primitives: {\n getMeshMixin: require('./extras/primitives/getMeshMixin'),\n primitives: require('./extras/primitives/primitives').primitives\n },\n scenes: require('./core/scene/scenes'),\n schema: require('./core/schema'),\n shaders: shaders,\n systems: systems,\n THREE: THREE,\n utils: utils,\n version: pkg.version\n};\n","window.aframeStats = function (scene) {\n var _rS = null;\n var _scene = scene;\n var _values = {\n te: {\n caption: 'Entities'\n },\n lt: {\n caption: 'Load Time'\n }\n };\n var _groups = [ {\n caption: 'A-Frame',\n values: [ 'te', 'lt' ]\n } ];\n\n function _update () {\n _rS('te').set(getEntityCount());\n if (window.performance.getEntriesByName) {\n _rS('lt').set(window.performance.getEntriesByName('render-started')[0].startTime.toFixed(0));\n }\n }\n\n function getEntityCount () {\n var elements = _scene.querySelectorAll('*');\n Array.prototype.slice.call(elements).filter(function (el) {\n return el.isEntity;\n });\n return elements.length;\n }\n\n function _start () {}\n\n function _end () {}\n\n function _attach (r) {\n _rS = r;\n }\n\n return {\n update: _update,\n start: _start,\n end: _end,\n attach: _attach,\n values: _values,\n groups: _groups,\n fractions: []\n };\n};\n\nif (typeof module === 'object') {\n module.exports = {\n aframeStats: window.aframeStats\n };\n}\n","var THREE = global.THREE = require('super-three');\n\n// Allow cross-origin images to be loaded.\n\n// This should not be on `THREE.Loader` nor `THREE.ImageUtils`.\n// Must be on `THREE.TextureLoader`.\nif (THREE.TextureLoader) {\n THREE.TextureLoader.prototype.crossOrigin = 'anonymous';\n}\n\n// This is for images loaded from the model loaders.\nif (THREE.ImageLoader) {\n THREE.ImageLoader.prototype.crossOrigin = 'anonymous';\n}\n\n// In-memory caching for XHRs (for images, audio files, textures, etc.).\nif (THREE.Cache) {\n THREE.Cache.enabled = true;\n}\n\n// TODO: Eventually include these only if they are needed by a component.\nrequire('../../vendor/DeviceOrientationControls'); // THREE.DeviceOrientationControls\nrequire('super-three/examples/js/loaders/DRACOLoader'); // THREE.DRACOLoader\nrequire('super-three/examples/js/loaders/GLTFLoader'); // THREE.GLTFLoader\nrequire('super-three/examples/js/loaders/OBJLoader'); // THREE.OBJLoader\nrequire('super-three/examples/js/loaders/MTLLoader'); // THREE.MTLLoader\nrequire('super-three/examples/js/utils/BufferGeometryUtils'); // THREE.BufferGeometryUtils\nrequire('super-three/examples/js/lights/LightProbeGenerator'); // THREE.LightProbeGenerator\n\nTHREE.DRACOLoader.prototype.crossOrigin = 'anonymous';\nTHREE.GLTFLoader.prototype.crossOrigin = 'anonymous';\nTHREE.MTLLoader.prototype.crossOrigin = 'anonymous';\nTHREE.OBJLoader.prototype.crossOrigin = 'anonymous';\n\nmodule.exports = THREE;\n","var registerShader = require('../core/shader').registerShader;\nvar THREE = require('../lib/three');\nvar utils = require('../utils/');\n\n/**\n * Flat shader using THREE.MeshBasicMaterial.\n */\nmodule.exports.Shader = registerShader('flat', {\n schema: {\n color: {type: 'color'},\n fog: {default: true},\n height: {default: 256},\n offset: {type: 'vec2', default: {x: 0, y: 0}},\n repeat: {type: 'vec2', default: {x: 1, y: 1}},\n src: {type: 'map'},\n width: {default: 512},\n wireframe: {default: false},\n wireframeLinewidth: {default: 2}\n },\n\n /**\n * Initializes the shader.\n * Adds a reference from the scene to this entity as the camera.\n */\n init: function (data) {\n this.rendererSystem = this.el.sceneEl.systems.renderer;\n this.materialData = {color: new THREE.Color()};\n this.textureSrc = null;\n getMaterialData(data, this.materialData);\n this.rendererSystem.applyColorCorrection(this.materialData.color);\n this.material = new THREE.MeshBasicMaterial(this.materialData);\n utils.material.updateMap(this, data);\n },\n\n update: function (data) {\n this.updateMaterial(data);\n utils.material.updateMap(this, data);\n },\n\n /**\n * Updating existing material.\n *\n * @param {object} data - Material component data.\n */\n updateMaterial: function (data) {\n var key;\n getMaterialData(data, this.materialData);\n this.rendererSystem.applyColorCorrection(this.materialData.color);\n for (key in this.materialData) {\n this.material[key] = this.materialData[key];\n }\n }\n});\n\n/**\n * Builds and normalize material data, normalizing stuff along the way.\n *\n * @param {object} data - Material data.\n * @param {object} materialData - Object to reuse.\n * @returns {object} Updated material data.\n */\nfunction getMaterialData (data, materialData) {\n materialData.color.set(data.color);\n materialData.fog = data.fog;\n materialData.wireframe = data.wireframe;\n materialData.wireframeLinewidth = data.wireframeLinewidth;\n return materialData;\n}\n","require('./flat');\nrequire('./standard');\nrequire('./sdf');\nrequire('./msdf');\nrequire('./ios10hls');\nrequire('./shadow');\n","var registerShader = require('../core/shader').registerShader;\n\n/**\n * Custom shader for iOS 10 HTTP Live Streaming (HLS).\n * For more information on HLS, see https://datatracker.ietf.org/doc/draft-pantos-http-live-streaming/\n */\nmodule.exports.Shader = registerShader('ios10hls', {\n schema: {\n src: {type: 'map', is: 'uniform'},\n opacity: {type: 'number', is: 'uniform', default: 1}\n },\n\n vertexShader: [\n 'varying vec2 vUV;',\n 'void main(void) {',\n ' gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);',\n ' vUV = uv;',\n '}'\n ].join('\\n'),\n\n fragmentShader: [\n 'uniform sampler2D src;',\n 'uniform float opacity;',\n 'varying vec2 vUV;',\n 'void main() {',\n ' vec2 offset = vec2(0, 0);',\n ' vec2 repeat = vec2(1, 1);',\n ' vec4 color = texture2D(src, vec2(vUV.x / repeat.x + offset.x, (1.0 - vUV.y) / repeat.y + offset.y)).bgra;',\n ' gl_FragColor = vec4(color.rgb, opacity);',\n '}'\n ].join('\\n')\n});\n\n","var registerShader = require('../core/shader').registerShader;\n\nvar isWebGL2AVailable = !!document.createElement('canvas').getContext('webgl2');\n\nvar VERTEX_SHADER_WEBGL1 = [\n 'attribute vec2 uv;',\n 'attribute vec3 position;',\n 'uniform mat4 projectionMatrix;',\n 'uniform mat4 modelViewMatrix;',\n 'varying vec2 vUV;',\n 'void main(void) {',\n ' gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);',\n ' vUV = uv;',\n '}'\n].join('\\n');\n\nvar VERTEX_SHADER_WEBGL2 = [\n '#version 300 es',\n 'in vec2 uv;',\n 'in vec3 position;',\n 'uniform mat4 projectionMatrix;',\n 'uniform mat4 modelViewMatrix;',\n 'out vec2 vUV;',\n 'void main(void) {',\n ' gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);',\n ' vUV = uv;',\n '}'\n].join('\\n');\n\nvar VERTEX_SHADER = isWebGL2AVailable ? VERTEX_SHADER_WEBGL2 : VERTEX_SHADER_WEBGL1;\n\nvar FRAGMENT_SHADER_WEBGL1 = [\n '#ifdef GL_OES_standard_derivatives',\n '#extension GL_OES_standard_derivatives: enable',\n '#endif',\n 'precision highp float;',\n 'uniform bool negate;',\n 'uniform float alphaTest;',\n 'uniform float opacity;',\n 'uniform sampler2D map;',\n 'uniform vec3 color;',\n 'varying vec2 vUV;',\n\n 'float median(float r, float g, float b) {',\n ' return max(min(r, g), min(max(r, g), b));',\n '}',\n\n // FIXME: Experimentally determined constants.\n '#define BIG_ENOUGH 0.001',\n '#define MODIFIED_ALPHATEST (0.02 * isBigEnough / BIG_ENOUGH)',\n\n 'void main() {',\n ' vec3 sampleColor = texture2D(map, vUV).rgb;',\n ' if (negate) { sampleColor = 1.0 - sampleColor; }',\n\n ' float sigDist = median(sampleColor.r, sampleColor.g, sampleColor.b) - 0.5;',\n ' float alpha = clamp(sigDist / fwidth(sigDist) + 0.5, 0.0, 1.0);',\n ' float dscale = 0.353505;',\n ' vec2 duv = dscale * (dFdx(vUV) + dFdy(vUV));',\n ' float isBigEnough = max(abs(duv.x), abs(duv.y));',\n\n // When texel is too small, blend raw alpha value rather than supersampling.\n // FIXME: Experimentally determined constant.\n ' // Do modified alpha test.',\n ' if (isBigEnough > BIG_ENOUGH) {',\n ' float ratio = BIG_ENOUGH / isBigEnough;',\n ' alpha = ratio * alpha + (1.0 - ratio) * (sigDist + 0.5);',\n ' }',\n\n ' // Do modified alpha test.',\n ' if (alpha < alphaTest * MODIFIED_ALPHATEST) { discard; return; }',\n ' gl_FragColor = vec4(color.xyz, alpha * opacity);',\n '}'\n].join('\\n');\n\nvar FRAGMENT_SHADER_WEBGL2 = [\n '#version 300 es',\n 'precision highp float;',\n 'uniform bool negate;',\n 'uniform float alphaTest;',\n 'uniform float opacity;',\n 'uniform sampler2D map;',\n 'uniform vec3 color;',\n 'in vec2 vUV;',\n 'out vec4 fragColor;',\n\n 'float median(float r, float g, float b) {',\n ' return max(min(r, g), min(max(r, g), b));',\n '}',\n\n // FIXME: Experimentally determined constants.\n '#define BIG_ENOUGH 0.001',\n '#define MODIFIED_ALPHATEST (0.02 * isBigEnough / BIG_ENOUGH)',\n\n 'void main() {',\n ' vec3 sampleColor = texture(map, vUV).rgb;',\n ' if (negate) { sampleColor = 1.0 - sampleColor; }',\n\n ' float sigDist = median(sampleColor.r, sampleColor.g, sampleColor.b) - 0.5;',\n ' float alpha = clamp(sigDist / fwidth(sigDist) + 0.5, 0.0, 1.0);',\n ' float dscale = 0.353505;',\n ' vec2 duv = dscale * (dFdx(vUV) + dFdy(vUV));',\n ' float isBigEnough = max(abs(duv.x), abs(duv.y));',\n\n // When texel is too small, blend raw alpha value rather than supersampling.\n // FIXME: Experimentally determined constant.\n ' // Do modified alpha test.',\n ' if (isBigEnough > BIG_ENOUGH) {',\n ' float ratio = BIG_ENOUGH / isBigEnough;',\n ' alpha = ratio * alpha + (1.0 - ratio) * (sigDist + 0.5);',\n ' }',\n\n ' // Do modified alpha test.',\n ' if (alpha < alphaTest * MODIFIED_ALPHATEST) { discard; return; }',\n ' fragColor = vec4(color.xyz, alpha * opacity);',\n '}'\n].join('\\n');\n\nvar FRAGMENT_SHADER = isWebGL2AVailable ? FRAGMENT_SHADER_WEBGL2 : FRAGMENT_SHADER_WEBGL1;\n\n/**\n * Multi-channel signed distance field.\n * Used by text component.\n */\nmodule.exports.Shader = registerShader('msdf', {\n schema: {\n alphaTest: {type: 'number', is: 'uniform', default: 0.5},\n color: {type: 'color', is: 'uniform', default: 'white'},\n map: {type: 'map', is: 'uniform'},\n negate: {type: 'boolean', is: 'uniform', default: true},\n opacity: {type: 'number', is: 'uniform', default: 1.0}\n },\n\n raw: true,\n\n vertexShader: VERTEX_SHADER,\n\n fragmentShader: FRAGMENT_SHADER\n});\n","var registerShader = require('../core/shader').registerShader;\n\nvar isWebGL2AVailable = !!document.createElement('canvas').getContext('webgl2');\n\nvar VERTEX_SHADER_WEBGL1 = [\n 'attribute vec2 uv;',\n 'attribute vec3 position;',\n 'uniform mat4 projectionMatrix;',\n 'uniform mat4 modelViewMatrix;',\n 'varying vec2 vUV;',\n 'void main(void) {',\n ' gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);',\n ' vUV = uv;',\n '}'\n].join('\\n');\n\nvar VERTEX_SHADER_WEBGL2 = [\n '#version 300 es',\n 'in vec2 uv;',\n 'in vec3 position;',\n 'uniform mat4 projectionMatrix;',\n 'uniform mat4 modelViewMatrix;',\n 'out vec2 vUV;',\n 'void main(void) {',\n ' gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);',\n ' vUV = uv;',\n '}'\n].join('\\n');\n\nvar VERTEX_SHADER = isWebGL2AVailable ? VERTEX_SHADER_WEBGL2 : VERTEX_SHADER_WEBGL1;\n\nvar FRAGMENT_SHADER_WEBGL1 = [\n '#ifdef GL_OES_standard_derivatives',\n '#extension GL_OES_standard_derivatives: enable',\n '#endif',\n\n 'precision highp float;',\n 'uniform float alphaTest;',\n 'uniform float opacity;',\n 'uniform sampler2D map;',\n 'uniform vec3 color;',\n 'varying vec2 vUV;',\n\n '#ifdef GL_OES_standard_derivatives',\n ' float contour(float width, float value) {',\n ' return smoothstep(0.5 - value, 0.5 + value, width);',\n ' }',\n '#else',\n ' float aastep(float value, float afwidth) {',\n ' return smoothstep(0.5 - afwidth, 0.5 + afwidth, value);',\n ' }',\n '#endif',\n\n // FIXME: Experimentally determined constants.\n '#define BIG_ENOUGH 0.001',\n '#define MODIFIED_ALPHATEST (0.02 * isBigEnough / BIG_ENOUGH)',\n '#define ALL_SMOOTH 0.4',\n '#define ALL_ROUGH 0.02',\n '#define DISCARD_ALPHA (alphaTest / (2.2 - 1.2 * ratio))',\n\n 'void main() {',\n // When we have derivatives and can get texel size for supersampling.\n ' #ifdef GL_OES_standard_derivatives',\n ' vec2 uv = vUV;',\n ' vec4 texColor = texture2D(map, uv);',\n ' float dist = texColor.a;',\n ' float width = fwidth(dist);',\n ' float alpha = contour(dist, width);',\n ' float dscale = 0.353505;',\n\n ' vec2 duv = dscale * (dFdx(uv) + dFdy(uv));',\n ' float isBigEnough = max(abs(duv.x), abs(duv.y));',\n\n // When texel is too small, blend raw alpha value rather than supersampling.\n // FIXME: experimentally determined constant\n ' if (isBigEnough > BIG_ENOUGH) {',\n ' float ratio = BIG_ENOUGH / isBigEnough;',\n ' alpha = ratio * alpha + (1.0 - ratio) * dist;',\n ' }',\n\n // Otherwise do weighted supersampling.\n // FIXME: why this weighting?\n ' if (isBigEnough <= BIG_ENOUGH) {',\n ' vec4 box = vec4 (uv - duv, uv + duv);',\n ' alpha = (alpha + 0.5 * (',\n ' contour(texture2D(map, box.xy).a, width)',\n ' + contour(texture2D(map, box.zw).a, width)',\n ' + contour(texture2D(map, box.xw).a, width)',\n ' + contour(texture2D(map, box.zy).a, width)',\n ' )) / 3.0;',\n ' }',\n\n // Do modified alpha test.\n ' if (alpha < alphaTest * MODIFIED_ALPHATEST) { discard; return; }',\n\n ' #else',\n // When we don't have derivatives, use approximations.\n ' vec4 texColor = texture2D(map, vUV);',\n ' float value = texColor.a;',\n // FIXME: if we understood font pixel dimensions, this could probably be improved\n ' float afwidth = (1.0 / 32.0) * (1.4142135623730951 / (2.0 * gl_FragCoord.w));',\n ' float alpha = aastep(value, afwidth);',\n\n // Use gl_FragCoord.w to guess when we should blend.\n // FIXME: If we understood font pixel dimensions, this could probably be improved.\n ' float ratio = (gl_FragCoord.w >= ALL_SMOOTH) ? 1.0 : (gl_FragCoord.w < ALL_ROUGH) ? 0.0 : (gl_FragCoord.w - ALL_ROUGH) / (ALL_SMOOTH - ALL_ROUGH);',\n ' if (alpha < alphaTest) { if (ratio >= 1.0) { discard; return; } alpha = 0.0; }',\n ' alpha = alpha * ratio + (1.0 - ratio) * value;',\n ' if (ratio < 1.0 && alpha <= DISCARD_ALPHA) { discard; return; }',\n ' #endif',\n\n ' gl_FragColor = vec4(color, opacity * alpha);',\n '}'\n].join('\\n');\n\nvar FRAGMENT_SHADER_WEBGL2 = [\n '#version 300 es',\n 'precision highp float;',\n 'uniform float alphaTest;',\n 'uniform float opacity;',\n 'uniform sampler2D map;',\n 'uniform vec3 color;',\n 'in vec2 vUV;',\n 'out vec4 fragColor;',\n\n '#ifdef GL_OES_standard_derivatives',\n ' float contour(float width, float value) {',\n ' return smoothstep(0.5 - value, 0.5 + value, width);',\n ' }',\n '#else',\n ' float aastep(float value, float afwidth) {',\n ' return smoothstep(0.5 - afwidth, 0.5 + afwidth, value);',\n ' }',\n '#endif',\n\n // FIXME: Experimentally determined constants.\n '#define BIG_ENOUGH 0.001',\n '#define MODIFIED_ALPHATEST (0.02 * isBigEnough / BIG_ENOUGH)',\n '#define ALL_SMOOTH 0.4',\n '#define ALL_ROUGH 0.02',\n '#define DISCARD_ALPHA (alphaTest / (2.2 - 1.2 * ratio))',\n\n 'void main() {',\n // When we have derivatives and can get texel size for supersampling.\n ' #ifdef GL_OES_standard_derivatives',\n ' vec2 uv = vUV;',\n ' vec4 texColor = texture(map, uv);',\n ' float dist = texColor.a;',\n ' float width = fwidth(dist);',\n ' float alpha = contour(dist, width);',\n ' float dscale = 0.353505;',\n\n ' vec2 duv = dscale * (dFdx(uv) + dFdy(uv));',\n ' float isBigEnough = max(abs(duv.x), abs(duv.y));',\n\n // When texel is too small, blend raw alpha value rather than supersampling.\n // FIXME: experimentally determined constant\n ' if (isBigEnough > BIG_ENOUGH) {',\n ' float ratio = BIG_ENOUGH / isBigEnough;',\n ' alpha = ratio * alpha + (1.0 - ratio) * dist;',\n ' }',\n\n // Otherwise do weighted supersampling.\n // FIXME: why this weighting?\n ' if (isBigEnough <= BIG_ENOUGH) {',\n ' vec4 box = vec4 (uv - duv, uv + duv);',\n ' alpha = (alpha + 0.5 * (',\n ' contour(texture(map, box.xy).a, width)',\n ' + contour(texture(map, box.zw).a, width)',\n ' + contour(texture(map, box.xw).a, width)',\n ' + contour(texture(map, box.zy).a, width)',\n ' )) / 3.0;',\n ' }',\n\n // Do modified alpha test.\n ' if (alpha < alphaTest * MODIFIED_ALPHATEST) { discard; return; }',\n\n ' #else',\n // When we don't have derivatives, use approximations.\n ' vec4 texColor = texture(map, vUV);',\n ' float value = texColor.a;',\n // FIXME: if we understood font pixel dimensions, this could probably be improved\n ' float afwidth = (1.0 / 32.0) * (1.4142135623730951 / (2.0 * gl_FragCoord.w));',\n ' float alpha = aastep(value, afwidth);',\n\n // Use gl_FragCoord.w to guess when we should blend.\n // FIXME: If we understood font pixel dimensions, this could probably be improved.\n ' float ratio = (gl_FragCoord.w >= ALL_SMOOTH) ? 1.0 : (gl_FragCoord.w < ALL_ROUGH) ? 0.0 : (gl_FragCoord.w - ALL_ROUGH) / (ALL_SMOOTH - ALL_ROUGH);',\n ' if (alpha < alphaTest) { if (ratio >= 1.0) { discard; return; } alpha = 0.0; }',\n ' alpha = alpha * ratio + (1.0 - ratio) * value;',\n ' if (ratio < 1.0 && alpha <= DISCARD_ALPHA) { discard; return; }',\n ' #endif',\n\n ' fragColor = vec4(color, opacity * alpha);',\n '}'\n].join('\\n');\n\nvar FRAGMENT_SHADER = isWebGL2AVailable ? FRAGMENT_SHADER_WEBGL2 : FRAGMENT_SHADER_WEBGL1;\n\n/**\n * Signed distance field.\n * Used by text component.\n */\nmodule.exports.Shader = registerShader('sdf', {\n schema: {\n alphaTest: {type: 'number', is: 'uniform', default: 0.5},\n color: {type: 'color', is: 'uniform', default: 'white'},\n map: {type: 'map', is: 'uniform'},\n opacity: {type: 'number', is: 'uniform', default: 1.0}\n },\n\n raw: true,\n\n vertexShader: VERTEX_SHADER,\n\n fragmentShader: FRAGMENT_SHADER\n});\n","var registerShader = require('../core/shader').registerShader;\nvar THREE = require('../lib/three');\n\n/**\n * Flat shader using THREE.ShadowMaterial.\n */\nmodule.exports.Shader = registerShader('shadow', {\n schema: {\n opacity: {default: 0.5},\n transparent: {default: true},\n alphaToCoverage: {default: true}\n },\n\n /**\n * Initializes the shader.\n * Adds a reference from the scene to this entity as the camera.\n */\n init: function (data) {\n this.rendererSystem = this.el.sceneEl.systems.renderer;\n this.material = new THREE.ShadowMaterial();\n },\n\n update: function (data) {\n this.material.opacity = data.opacity;\n this.material.alphaToCoverage = data.alphaToCoverage;\n this.material.transparent = data.transparent;\n }\n});\n\n","var registerShader = require('../core/shader').registerShader;\nvar THREE = require('../lib/three');\nvar utils = require('../utils/');\n\nvar CubeLoader = new THREE.CubeTextureLoader();\nvar texturePromises = {};\n\n/**\n * Standard (physically-based) shader using THREE.MeshStandardMaterial.\n */\nmodule.exports.Shader = registerShader('standard', {\n schema: {\n ambientOcclusionMap: {type: 'map'},\n ambientOcclusionMapIntensity: {default: 1},\n ambientOcclusionTextureOffset: {type: 'vec2'},\n ambientOcclusionTextureRepeat: {type: 'vec2', default: {x: 1, y: 1}},\n\n color: {type: 'color'},\n\n displacementMap: {type: 'map'},\n displacementScale: {default: 1},\n displacementBias: {default: 0.5},\n displacementTextureOffset: {type: 'vec2'},\n displacementTextureRepeat: {type: 'vec2', default: {x: 1, y: 1}},\n emissive: {type: 'color', default: '#000'},\n emissiveIntensity: {default: 1},\n envMap: {default: ''},\n\n fog: {default: true},\n height: {default: 256},\n\n metalness: {default: 0.0, min: 0.0, max: 1.0},\n metalnessMap: {type: 'map'},\n metalnessTextureOffset: {type: 'vec2'},\n metalnessTextureRepeat: {type: 'vec2', default: {x: 1, y: 1}},\n\n normalMap: {type: 'map'},\n normalScale: {type: 'vec2', default: {x: 1, y: 1}},\n normalTextureOffset: {type: 'vec2'},\n normalTextureRepeat: {type: 'vec2', default: {x: 1, y: 1}},\n\n offset: {type: 'vec2', default: {x: 0, y: 0}},\n repeat: {type: 'vec2', default: {x: 1, y: 1}},\n\n roughness: {default: 0.5, min: 0.0, max: 1.0},\n roughnessMap: {type: 'map'},\n roughnessTextureOffset: {type: 'vec2'},\n roughnessTextureRepeat: {type: 'vec2', default: {x: 1, y: 1}},\n\n sphericalEnvMap: {type: 'map'},\n src: {type: 'map'},\n width: {default: 512},\n wireframe: {default: false},\n wireframeLinewidth: {default: 2}\n },\n\n /**\n * Initializes the shader.\n * Adds a reference from the scene to this entity as the camera.\n */\n init: function (data) {\n this.rendererSystem = this.el.sceneEl.systems.renderer;\n this.materialData = {color: new THREE.Color(), emissive: new THREE.Color()};\n getMaterialData(data, this.materialData);\n this.rendererSystem.applyColorCorrection(this.materialData.color);\n this.rendererSystem.applyColorCorrection(this.materialData.emissive);\n this.material = new THREE.MeshStandardMaterial(this.materialData);\n\n utils.material.updateMap(this, data);\n if (data.normalMap) { utils.material.updateDistortionMap('normal', this, data); }\n if (data.displacementMap) { utils.material.updateDistortionMap('displacement', this, data); }\n if (data.ambientOcclusionMap) { utils.material.updateDistortionMap('ambientOcclusion', this, data); }\n if (data.metalnessMap) { utils.material.updateDistortionMap('metalness', this, data); }\n if (data.roughnessMap) { utils.material.updateDistortionMap('roughness', this, data); }\n this.updateEnvMap(data);\n },\n\n update: function (data) {\n this.updateMaterial(data);\n utils.material.updateMap(this, data);\n if (data.normalMap) { utils.material.updateDistortionMap('normal', this, data); }\n if (data.displacementMap) { utils.material.updateDistortionMap('displacement', this, data); }\n if (data.ambientOcclusionMap) { utils.material.updateDistortionMap('ambientOcclusion', this, data); }\n if (data.metalnessMap) { utils.material.updateDistortionMap('metalness', this, data); }\n if (data.roughnessMap) { utils.material.updateDistortionMap('roughness', this, data); }\n this.updateEnvMap(data);\n },\n\n /**\n * Updating existing material.\n *\n * @param {object} data - Material component data.\n * @returns {object} Material.\n */\n updateMaterial: function (data) {\n var key;\n var material = this.material;\n getMaterialData(data, this.materialData);\n this.rendererSystem.applyColorCorrection(this.materialData.color);\n this.rendererSystem.applyColorCorrection(this.materialData.emissive);\n for (key in this.materialData) {\n material[key] = this.materialData[key];\n }\n },\n\n /**\n * Handle environment cubemap. Textures are cached in texturePromises.\n */\n updateEnvMap: function (data) {\n var self = this;\n var material = this.material;\n var envMap = data.envMap;\n var sphericalEnvMap = data.sphericalEnvMap;\n\n // No envMap defined or already loading.\n if ((!envMap && !sphericalEnvMap) || this.isLoadingEnvMap) {\n material.envMap = null;\n material.needsUpdate = true;\n return;\n }\n this.isLoadingEnvMap = true;\n\n // if a spherical env map is defined then use it.\n if (sphericalEnvMap) {\n this.el.sceneEl.systems.material.loadTexture(sphericalEnvMap, {src: sphericalEnvMap}, function textureLoaded (texture) {\n self.isLoadingEnvMap = false;\n texture.mapping = THREE.EquirectangularReflectionMapping;\n material.envMap = texture;\n utils.material.handleTextureEvents(self.el, texture);\n material.needsUpdate = true;\n });\n return;\n }\n\n // Another material is already loading this texture. Wait on promise.\n if (texturePromises[envMap]) {\n texturePromises[envMap].then(function (cube) {\n self.isLoadingEnvMap = false;\n material.envMap = cube;\n utils.material.handleTextureEvents(self.el, cube);\n material.needsUpdate = true;\n });\n return;\n }\n\n // Material is first to load this texture. Load and resolve texture.\n texturePromises[envMap] = new Promise(function (resolve) {\n utils.srcLoader.validateCubemapSrc(envMap, function loadEnvMap (urls) {\n CubeLoader.load(urls, function (cube) {\n // Texture loaded.\n self.isLoadingEnvMap = false;\n material.envMap = cube;\n utils.material.handleTextureEvents(self.el, cube);\n resolve(cube);\n });\n });\n });\n }\n});\n\n/**\n * Builds and normalize material data, normalizing stuff along the way.\n *\n * @param {object} data - Material data.\n * @param {object} materialData - Object to use.\n * @returns {object} Updated materialData.\n */\nfunction getMaterialData (data, materialData) {\n materialData.color.set(data.color);\n materialData.emissive.set(data.emissive);\n materialData.emissiveIntensity = data.emissiveIntensity;\n materialData.fog = data.fog;\n materialData.metalness = data.metalness;\n materialData.roughness = data.roughness;\n materialData.wireframe = data.wireframe;\n materialData.wireframeLinewidth = data.wireframeLinewidth;\n\n if (data.normalMap) { materialData.normalScale = data.normalScale; }\n\n if (data.ambientOcclusionMap) {\n materialData.aoMapIntensity = data.ambientOcclusionMapIntensity;\n }\n\n if (data.displacementMap) {\n materialData.displacementScale = data.displacementScale;\n materialData.displacementBias = data.displacementBias;\n }\n\n return materialData;\n}\n","var constants = require('../constants/');\nvar registerSystem = require('../core/system').registerSystem;\n\nvar DEFAULT_CAMERA_ATTR = 'data-aframe-default-camera';\n\n/**\n * Camera system. Manages which camera is active among multiple cameras in scene.\n *\n * @member {object} activeCameraEl - Active camera entity.\n */\nmodule.exports.System = registerSystem('camera', {\n init: function () {\n this.activeCameraEl = null;\n\n this.render = this.render.bind(this);\n this.unwrapRender = this.unwrapRender.bind(this);\n this.wrapRender = this.wrapRender.bind(this);\n\n this.initialCameraFound = false;\n this.numUserCameras = 0;\n this.numUserCamerasChecked = 0;\n this.setupInitialCamera();\n },\n\n /**\n * Setup initial camera, either searching for camera or\n * creating a default camera if user has not added one during the initial scene traversal.\n * We want sceneEl.camera to be ready, set, and initialized before the rest of the scene\n * loads.\n *\n * Default camera offset height is at average eye level (~1.6m).\n */\n setupInitialCamera: function () {\n var cameraEls;\n var i;\n var sceneEl = this.sceneEl;\n var self = this;\n\n // Camera already defined or the one defined it is an spectator one.\n if (sceneEl.camera && !sceneEl.camera.el.getAttribute('camera').spectator) {\n sceneEl.emit('cameraready', {cameraEl: sceneEl.camera.el});\n return;\n }\n\n // Search for initial user-defined camera.\n cameraEls = sceneEl.querySelectorAll('a-camera, [camera]');\n\n // No user cameras, create default one.\n if (!cameraEls.length) {\n this.createDefaultCamera();\n return;\n }\n\n this.numUserCameras = cameraEls.length;\n for (i = 0; i < cameraEls.length; i++) {\n cameraEls[i].addEventListener('object3dset', function (evt) {\n if (evt.detail.type !== 'camera') { return; }\n self.checkUserCamera(this);\n });\n\n // Load camera and wait for camera to initialize.\n if (cameraEls[i].isNode) {\n cameraEls[i].load();\n } else {\n cameraEls[i].addEventListener('nodeready', function () {\n this.load();\n });\n }\n }\n },\n\n /**\n * Check if a user-defined camera entity is appropriate to be initial camera.\n * (active + non-spectator).\n *\n * Keep track of the number of cameras we checked and whether we found one.\n */\n checkUserCamera: function (cameraEl) {\n var cameraData;\n var sceneEl = this.el.sceneEl;\n this.numUserCamerasChecked++;\n\n // Already found one.\n if (this.initialCameraFound) { return; }\n\n // Check if camera is appropriate for being the initial camera.\n cameraData = cameraEl.getAttribute('camera');\n if (!cameraData.active || cameraData.spectator) {\n // No user cameras eligible, create default camera.\n if (this.numUserCamerasChecked === this.numUserCameras) {\n this.createDefaultCamera();\n }\n return;\n }\n\n this.initialCameraFound = true;\n sceneEl.camera = cameraEl.getObject3D('camera');\n sceneEl.emit('cameraready', {cameraEl: cameraEl});\n },\n\n createDefaultCamera: function () {\n var defaultCameraEl;\n var sceneEl = this.sceneEl;\n\n // Set up default camera.\n defaultCameraEl = document.createElement('a-entity');\n defaultCameraEl.setAttribute('camera', {active: true});\n defaultCameraEl.setAttribute('position', {\n x: 0,\n y: constants.DEFAULT_CAMERA_HEIGHT,\n z: 0\n });\n defaultCameraEl.setAttribute('wasd-controls', '');\n defaultCameraEl.setAttribute('look-controls', '');\n defaultCameraEl.setAttribute(constants.AFRAME_INJECTED, '');\n\n defaultCameraEl.addEventListener('object3dset', function (evt) {\n if (evt.detail.type !== 'camera') { return; }\n sceneEl.camera = evt.detail.object;\n sceneEl.emit('cameraready', {cameraEl: defaultCameraEl});\n });\n\n sceneEl.appendChild(defaultCameraEl);\n },\n\n /**\n * Set a different active camera.\n * When we choose a (sort of) random scene camera as the replacement, set its `active` to\n * true. The camera component will call `setActiveCamera` and handle passing the torch to\n * the new camera.\n */\n disableActiveCamera: function () {\n var cameraEls;\n var newActiveCameraEl;\n cameraEls = this.sceneEl.querySelectorAll('[camera]');\n newActiveCameraEl = cameraEls[cameraEls.length - 1];\n newActiveCameraEl.setAttribute('camera', 'active', true);\n },\n\n /**\n * Set active camera to be used by renderer.\n * Removes the default camera (if present).\n * Disables all other cameras in the scene.\n *\n * @param {Element} newCameraEl - Entity with camera component.\n */\n setActiveCamera: function (newCameraEl) {\n var cameraEl;\n var cameraEls;\n var i;\n var newCamera;\n var previousCamera = this.activeCameraEl;\n var sceneEl = this.sceneEl;\n\n // Same camera.\n newCamera = newCameraEl.getObject3D('camera');\n if (!newCamera || newCameraEl === this.activeCameraEl) { return; }\n\n // Grab the default camera.\n var defaultCameraWrapper = sceneEl.querySelector('[' + DEFAULT_CAMERA_ATTR + ']');\n var defaultCameraEl = defaultCameraWrapper &&\n defaultCameraWrapper.querySelector('[camera]');\n\n // Remove default camera if new camera is not the default camera.\n if (newCameraEl !== defaultCameraEl) { removeDefaultCamera(sceneEl); }\n\n // Make new camera active.\n this.activeCameraEl = newCameraEl;\n this.activeCameraEl.play();\n sceneEl.camera = newCamera;\n\n // Disable current camera\n if (previousCamera) {\n previousCamera.setAttribute('camera', 'active', false);\n }\n\n // Disable other cameras in the scene\n cameraEls = sceneEl.querySelectorAll('[camera]');\n for (i = 0; i < cameraEls.length; i++) {\n cameraEl = cameraEls[i];\n if (!cameraEl.isEntity || newCameraEl === cameraEl) { continue; }\n cameraEl.setAttribute('camera', 'active', false);\n cameraEl.pause();\n }\n sceneEl.emit('camera-set-active', {cameraEl: newCameraEl});\n },\n\n /**\n * Set spectator camera to render the scene on a 2D display.\n *\n * @param {Element} newCameraEl - Entity with camera component.\n */\n setSpectatorCamera: function (newCameraEl) {\n var newCamera;\n var previousCamera = this.spectatorCameraEl;\n var sceneEl = this.sceneEl;\n var spectatorCameraEl;\n\n // Same camera.\n newCamera = newCameraEl.getObject3D('camera');\n if (!newCamera || newCameraEl === this.spectatorCameraEl) { return; }\n\n // Disable current camera\n if (previousCamera) {\n previousCamera.setAttribute('camera', 'spectator', false);\n }\n\n spectatorCameraEl = this.spectatorCameraEl = newCameraEl;\n\n sceneEl.addEventListener('enter-vr', this.wrapRender);\n sceneEl.addEventListener('exit-vr', this.unwrapRender);\n\n spectatorCameraEl.setAttribute('camera', 'active', false);\n spectatorCameraEl.play();\n\n sceneEl.emit('camera-set-spectator', {cameraEl: newCameraEl});\n },\n\n /**\n * Disables current spectator camera.\n */\n disableSpectatorCamera: function () {\n this.spectatorCameraEl = undefined;\n },\n\n /**\n * Wrap the render method of the renderer to render\n * the spectator camera after vrDisplay.submitFrame.\n */\n wrapRender: function () {\n if (!this.spectatorCameraEl || this.originalRender) { return; }\n this.originalRender = this.sceneEl.renderer.render;\n this.sceneEl.renderer.render = this.render;\n },\n\n unwrapRender: function () {\n if (!this.originalRender) { return; }\n this.sceneEl.renderer.render = this.originalRender;\n this.originalRender = undefined;\n },\n\n render: function (scene, camera) {\n var isVREnabled;\n var sceneEl = this.sceneEl;\n var spectatorCamera;\n\n isVREnabled = sceneEl.renderer.xr.enabled;\n this.originalRender.call(sceneEl.renderer, scene, camera);\n if (!this.spectatorCameraEl || sceneEl.isMobile || !isVREnabled) { return; }\n spectatorCamera = this.spectatorCameraEl.components.camera.camera;\n sceneEl.renderer.xr.enabled = false;\n this.originalRender.call(sceneEl.renderer, scene, spectatorCamera);\n sceneEl.renderer.xr.enabled = isVREnabled;\n }\n});\n\n/**\n * Remove injected default camera from scene, if present.\n *\n * @param {Element} sceneEl\n */\nfunction removeDefaultCamera (sceneEl) {\n var defaultCamera;\n var camera = sceneEl.camera;\n if (!camera) { return; }\n\n // Remove default camera if present.\n defaultCamera = sceneEl.querySelector('[' + DEFAULT_CAMERA_ATTR + ']');\n if (!defaultCamera) { return; }\n sceneEl.removeChild(defaultCamera);\n}\n","var geometries = require('../core/geometry').geometries;\nvar registerSystem = require('../core/system').registerSystem;\n\n/**\n * System for geometry component.\n * Handle geometry caching.\n *\n * @member {object} cache - Mapping of stringified component data to THREE.BufferGeometry objects.\n * @member {object} cacheCount - Keep track of number of entities using a geometry to\n * know whether to dispose on removal.\n */\nmodule.exports.System = registerSystem('geometry', {\n init: function () {\n this.cache = {};\n this.cacheCount = {};\n },\n\n /**\n * Reset cache. Mainly for testing.\n */\n clearCache: function () {\n this.cache = {};\n this.cacheCount = {};\n },\n\n /**\n * Attempt to retrieve from cache.\n *\n * @returns {Object|null} A geometry if it exists, else null.\n */\n getOrCreateGeometry: function (data) {\n var cache = this.cache;\n var cachedGeometry;\n var hash;\n\n // Skip all caching logic.\n if (data.skipCache) { return createGeometry(data); }\n\n // Try to retrieve from cache first.\n hash = this.hash(data);\n cachedGeometry = cache[hash];\n incrementCacheCount(this.cacheCount, hash);\n\n if (cachedGeometry) { return cachedGeometry; }\n\n // Create geometry.\n cachedGeometry = createGeometry(data);\n\n // Cache and return geometry.\n cache[hash] = cachedGeometry;\n return cachedGeometry;\n },\n\n /**\n * Let system know that an entity is no longer using a geometry.\n */\n unuseGeometry: function (data) {\n var cache = this.cache;\n var cacheCount = this.cacheCount;\n var geometry;\n var hash;\n\n if (data.skipCache) { return; }\n\n hash = this.hash(data);\n\n if (!cache[hash]) { return; }\n\n decrementCacheCount(cacheCount, hash);\n\n // Another entity is still using this geometry. No need to do anything.\n if (cacheCount[hash] > 0) { return; }\n\n // No more entities are using this geometry. Dispose.\n geometry = cache[hash];\n geometry.dispose();\n delete cache[hash];\n delete cacheCount[hash];\n },\n\n /**\n * Use JSON.stringify to turn component data into hash.\n * Should be deterministic within a single browser engine.\n * If not, then look into json-stable-stringify.\n */\n hash: function (data) {\n return JSON.stringify(data);\n }\n});\n\n/**\n * Create geometry using component data.\n *\n * @param {object} data - Component data.\n * @returns {object} Geometry.\n */\nfunction createGeometry (data) {\n var geometryType = data.primitive;\n var GeometryClass = geometries[geometryType] && geometries[geometryType].Geometry;\n var geometryInstance = new GeometryClass();\n\n if (!GeometryClass) { throw new Error('Unknown geometry `' + geometryType + '`'); }\n\n geometryInstance.init(data);\n return geometryInstance.geometry;\n}\n\n/**\n * Decreate count of entity using a geometry.\n */\nfunction decrementCacheCount (cacheCount, hash) {\n cacheCount[hash]--;\n}\n\n/**\n * Increase count of entity using a geometry.\n */\nfunction incrementCacheCount (cacheCount, hash) {\n cacheCount[hash] = cacheCount[hash] === undefined ? 1 : cacheCount[hash] + 1;\n}\n","var registerSystem = require('../core/system').registerSystem;\nvar THREE = require('../lib/three');\n\nfunction fetchScript (src) {\n return new Promise(function (resolve, reject) {\n var script = document.createElement('script');\n document.body.appendChild(script);\n script.onload = resolve;\n script.onerror = reject;\n script.async = true;\n script.src = src;\n });\n}\n\n/**\n * glTF model system.\n *\n * Configures glTF loading options. Models using glTF compression require that a Draco decoder be\n * provided externally.\n *\n * @param {string} dracoDecoderPath - Base path from which to load Draco decoder library.\n * @param {string} meshoptDecoderPath - Full path from which to load Meshopt decoder.\n */\nmodule.exports.System = registerSystem('gltf-model', {\n schema: {\n dracoDecoderPath: {default: ''},\n meshoptDecoderPath: {default: ''}\n },\n\n init: function () {\n this.update();\n },\n\n update: function () {\n var dracoDecoderPath = this.data.dracoDecoderPath;\n var meshoptDecoderPath = this.data.meshoptDecoderPath;\n if (!this.dracoLoader && dracoDecoderPath) {\n this.dracoLoader = new THREE.DRACOLoader();\n this.dracoLoader.setDecoderPath(dracoDecoderPath);\n }\n if (!this.meshoptDecoder && meshoptDecoderPath) {\n this.meshoptDecoder = fetchScript(meshoptDecoderPath)\n .then(function () { return window.MeshoptDecoder.ready; })\n .then(function () { return window.MeshoptDecoder; });\n }\n },\n\n getDRACOLoader: function () {\n return this.dracoLoader;\n },\n\n getMeshoptDecoder: function () {\n return this.meshoptDecoder;\n }\n});\n","require('./camera');\nrequire('./geometry');\nrequire('./gltf-model');\nrequire('./light');\nrequire('./material');\nrequire('./renderer');\nrequire('./shadow');\nrequire('./tracked-controls-webvr');\nrequire('./tracked-controls-webxr');\nrequire('./webxr');\n","var registerSystem = require('../core/system').registerSystem;\nvar bind = require('../utils/bind');\nvar constants = require('../constants/');\n\nvar DEFAULT_LIGHT_ATTR = 'data-aframe-default-light';\n\n/**\n * Light system.\n *\n * Prescribes default lighting if not specified (one ambient, one directional).\n * Removes default lighting from the scene when a new light is added.\n *\n * @param {bool} defaultLights - Whether default lighting are defined.\n * @param {bool} userDefinedLights - Whether user lighting is defined.\n */\nmodule.exports.System = registerSystem('light', {\n schema: {\n defaultLightsEnabled: {default: true}\n },\n\n init: function () {\n this.defaultLights = false;\n this.userDefinedLights = false;\n // Wait for all entities to fully load before checking for existence of lights.\n // Since entities wait for <a-assets> to load, any lights attaching to the scene\n // will do so asynchronously.\n this.sceneEl.addEventListener('loaded', bind(this.setupDefaultLights, this));\n },\n\n /**\n * Notify scene that light has been added and to remove the default.\n *\n * @param {object} el - element holding the light component.\n */\n registerLight: function (el) {\n if (!el.hasAttribute(DEFAULT_LIGHT_ATTR)) {\n // User added a light, remove default lights through DOM.\n this.removeDefaultLights();\n this.userDefinedLights = true;\n }\n },\n\n removeDefaultLights: function () {\n var defaultLights;\n var sceneEl = this.sceneEl;\n\n if (!this.defaultLights) { return; }\n defaultLights = document.querySelectorAll('[' + DEFAULT_LIGHT_ATTR + ']');\n for (var i = 0; i < defaultLights.length; i++) {\n sceneEl.removeChild(defaultLights[i]);\n }\n this.defaultLights = false;\n },\n\n /**\n * Prescibe default lights to the scene.\n * Does so by injecting markup such that this state is not invisible.\n * These lights are removed if the user adds any lights.\n */\n setupDefaultLights: function () {\n var sceneEl = this.sceneEl;\n var ambientLight;\n var directionalLight;\n\n if (this.userDefinedLights || this.defaultLights || !this.data.defaultLightsEnabled) {\n return;\n }\n\n ambientLight = document.createElement('a-entity');\n ambientLight.setAttribute('light', {color: '#BBB', type: 'ambient'});\n ambientLight.setAttribute(DEFAULT_LIGHT_ATTR, '');\n ambientLight.setAttribute(constants.AFRAME_INJECTED, '');\n sceneEl.appendChild(ambientLight);\n\n directionalLight = document.createElement('a-entity');\n directionalLight.setAttribute('light', {color: '#FFF', intensity: 0.6, castShadow: true});\n directionalLight.setAttribute('position', {x: -0.5, y: 1, z: 1});\n directionalLight.setAttribute(DEFAULT_LIGHT_ATTR, '');\n directionalLight.setAttribute(constants.AFRAME_INJECTED, '');\n sceneEl.appendChild(directionalLight);\n\n this.defaultLights = true;\n }\n});\n","var registerSystem = require('../core/system').registerSystem;\nvar THREE = require('../lib/three');\nvar utils = require('../utils/');\nvar isHLS = require('../utils/material').isHLS;\nvar setTextureProperties = require('../utils/material').setTextureProperties;\n\nvar bind = utils.bind;\nvar debug = utils.debug;\nvar error = debug('components:texture:error');\nvar TextureLoader = new THREE.TextureLoader();\nvar warn = debug('components:texture:warn');\n\nTextureLoader.setCrossOrigin('anonymous');\n\n/**\n * System for material component.\n * Handle material registration, updates (for fog), and texture caching.\n *\n * @member {object} materials - Registered materials.\n * @member {object} textureCounts - Number of times each texture is used. Tracked\n * separately from textureCache, because the cache (1) is populated in\n * multiple places, and (2) may be cleared at any time.\n * @member {object} textureCache - Texture cache for:\n * - Images: textureCache has mapping of src -> repeat -> cached three.js texture.\n * - Videos: textureCache has mapping of videoElement -> cached three.js texture.\n */\nmodule.exports.System = registerSystem('material', {\n init: function () {\n this.materials = {};\n this.textureCounts = {};\n this.textureCache = {};\n\n this.sceneEl.addEventListener(\n 'materialtextureloaded',\n bind(this.onMaterialTextureLoaded, this)\n );\n },\n\n clearTextureCache: function () {\n this.textureCache = {};\n },\n\n /**\n * Determine whether `src` is a image or video. Then try to load the asset, then call back.\n *\n * @param {string, or element} src - Texture URL or element.\n * @param {string} data - Relevant texture data used for caching.\n * @param {function} cb - Callback to pass texture to.\n */\n loadTexture: function (src, data, cb) {\n var self = this;\n\n // Canvas.\n if (src.tagName === 'CANVAS') {\n this.loadCanvas(src, data, cb);\n return;\n }\n\n // Video element.\n if (src.tagName === 'VIDEO') {\n if (!src.src && !src.srcObject && !src.childElementCount) {\n warn('Video element was defined with neither `source` elements nor `src` / `srcObject` attributes.');\n }\n this.loadVideo(src, data, cb);\n return;\n }\n\n utils.srcLoader.validateSrc(src, loadImageCb, loadVideoCb);\n function loadImageCb (src) { self.loadImage(src, data, cb); }\n function loadVideoCb (src) { self.loadVideo(src, data, cb); }\n },\n\n /**\n * High-level function for loading image textures (THREE.Texture).\n *\n * @param {Element|string} src - Texture source.\n * @param {object} data - Texture data.\n * @param {function} cb - Callback to pass texture to.\n */\n loadImage: function (src, data, handleImageTextureLoaded) {\n var hash = this.hash(data);\n var textureCache = this.textureCache;\n\n // Texture already being loaded or already loaded. Wait on promise.\n if (textureCache[hash]) {\n textureCache[hash].then(handleImageTextureLoaded);\n return;\n }\n\n // Texture not yet being loaded. Start loading it.\n textureCache[hash] = loadImageTexture(src, data);\n textureCache[hash].then(handleImageTextureLoaded);\n },\n\n /**\n * High-level function for loading canvas textures (THREE.Texture).\n *\n * @param {Element|string} src - Texture source.\n * @param {object} data - Texture data.\n * @param {function} cb - Callback to pass texture to.\n */\n loadCanvas: function (src, data, cb) {\n var texture;\n texture = new THREE.CanvasTexture(src);\n setTextureProperties(texture, data);\n cb(texture);\n },\n\n /**\n * Load video texture (THREE.VideoTexture).\n * Which is just an image texture that RAFs + needsUpdate.\n * Note that creating a video texture is synchronous unlike loading an image texture.\n * Made asynchronous to be consistent with image textures.\n *\n * @param {Element|string} src - Texture source.\n * @param {object} data - Texture data.\n * @param {function} cb - Callback to pass texture to.\n */\n loadVideo: function (src, data, cb) {\n var hash;\n var texture;\n var textureCache = this.textureCache;\n var videoEl;\n var videoTextureResult;\n\n function handleVideoTextureLoaded (result) {\n result.texture.needsUpdate = true;\n cb(result.texture, result.videoEl);\n }\n\n // Video element provided.\n if (typeof src !== 'string') {\n // Check cache before creating texture.\n videoEl = src;\n hash = this.hashVideo(data, videoEl);\n if (textureCache[hash]) {\n textureCache[hash].then(handleVideoTextureLoaded);\n return;\n }\n // If not in cache, fix up the attributes then start to create the texture.\n fixVideoAttributes(videoEl);\n }\n\n // Only URL provided. Use video element to create texture.\n videoEl = videoEl || createVideoEl(src, data.width, data.height);\n\n // Generated video element already cached. Use that.\n hash = this.hashVideo(data, videoEl);\n if (textureCache[hash]) {\n textureCache[hash].then(handleVideoTextureLoaded);\n return;\n }\n\n // Create new video texture.\n texture = new THREE.VideoTexture(videoEl);\n texture.minFilter = THREE.LinearFilter;\n setTextureProperties(texture, data);\n\n // If iOS and video is HLS, do some hacks.\n if (this.sceneEl.isIOS &&\n isHLS(videoEl.src || videoEl.getAttribute('src'),\n videoEl.type || videoEl.getAttribute('type'))) {\n // Actually BGRA. Tell shader to correct later.\n texture.format = THREE.RGBAFormat;\n texture.needsCorrectionBGRA = true;\n // Apparently needed for HLS. Tell shader to correct later.\n texture.flipY = false;\n texture.needsCorrectionFlipY = true;\n }\n\n // Cache as promise to be consistent with image texture caching.\n videoTextureResult = {texture: texture, videoEl: videoEl};\n textureCache[hash] = Promise.resolve(videoTextureResult);\n handleVideoTextureLoaded(videoTextureResult);\n },\n\n /**\n * Create a hash of the material properties for texture cache key.\n */\n hash: function (data) {\n if (data.src.tagName) {\n // Since `data.src` can be an element, parse out the string if necessary for the hash.\n data = utils.extendDeep({}, data);\n data.src = data.src.src;\n }\n return JSON.stringify(data);\n },\n\n hashVideo: function (data, videoEl) {\n return calculateVideoCacheHash(data, videoEl);\n },\n\n /**\n * Keep track of material in case an update trigger is needed (e.g., fog).\n *\n * @param {object} material\n */\n registerMaterial: function (material) {\n this.materials[material.uuid] = material;\n },\n\n /**\n * Stop tracking material, and dispose of any textures not being used by\n * another material component.\n *\n * @param {object} material\n */\n unregisterMaterial: function (material) {\n delete this.materials[material.uuid];\n\n // If any textures on this material are no longer in use, dispose of them.\n var textureCounts = this.textureCounts;\n Object.keys(material)\n .filter(function (propName) {\n return material[propName] && material[propName].isTexture;\n })\n .forEach(function (mapName) {\n textureCounts[material[mapName].uuid]--;\n if (textureCounts[material[mapName].uuid] <= 0) {\n material[mapName].dispose();\n }\n });\n },\n\n /**\n * Trigger update to all registered materials.\n */\n updateMaterials: function (material) {\n var materials = this.materials;\n Object.keys(materials).forEach(function (uuid) {\n materials[uuid].needsUpdate = true;\n });\n },\n\n /**\n * Track textures used by material components, so that they can be safely\n * disposed when no longer in use. Textures must be registered here, and not\n * through registerMaterial(), because textures may not be attached at the\n * time the material is registered.\n *\n * @param {Event} e\n */\n onMaterialTextureLoaded: function (e) {\n if (!this.textureCounts[e.detail.texture.uuid]) {\n this.textureCounts[e.detail.texture.uuid] = 0;\n }\n this.textureCounts[e.detail.texture.uuid]++;\n }\n});\n\n/**\n * Calculates consistent hash from a video element using its attributes.\n * If the video element has an ID, use that.\n * Else build a hash that looks like `src:myvideo.mp4;height:200;width:400;`.\n *\n * @param data {object} - Texture data such as repeat.\n * @param videoEl {Element} - Video element.\n * @returns {string}\n */\nfunction calculateVideoCacheHash (data, videoEl) {\n var i;\n var id = videoEl.getAttribute('id');\n var hash;\n var videoAttributes;\n\n if (id) { return id; }\n\n // Calculate hash using sorted video attributes.\n hash = '';\n videoAttributes = data || {};\n for (i = 0; i < videoEl.attributes.length; i++) {\n videoAttributes[videoEl.attributes[i].name] = videoEl.attributes[i].value;\n }\n Object.keys(videoAttributes).sort().forEach(function (name) {\n hash += name + ':' + videoAttributes[name] + ';';\n });\n\n return hash;\n}\n\n/**\n * Load image texture.\n *\n * @private\n * @param {string|object} src - An <img> element or url to an image file.\n * @param {object} data - Data to set texture properties like `repeat`.\n * @returns {Promise} Resolves once texture is loaded.\n */\nfunction loadImageTexture (src, data) {\n return new Promise(doLoadImageTexture);\n\n function doLoadImageTexture (resolve, reject) {\n var isEl = typeof src !== 'string';\n\n function resolveTexture (texture) {\n setTextureProperties(texture, data);\n texture.needsUpdate = true;\n resolve(texture);\n }\n\n // Create texture from an element.\n if (isEl) {\n resolveTexture(new THREE.Texture(src));\n return;\n }\n\n // Request and load texture from src string. THREE will create underlying element.\n // Use THREE.TextureLoader (src, onLoad, onProgress, onError) to load texture.\n TextureLoader.load(\n src,\n resolveTexture,\n function () { /* no-op */ },\n function (xhr) {\n error('`$s` could not be fetched (Error code: %s; Response: %s)', xhr.status,\n xhr.statusText);\n }\n );\n }\n}\n\n/**\n * Create video element to be used as a texture.\n *\n * @param {string} src - Url to a video file.\n * @param {number} width - Width of the video.\n * @param {number} height - Height of the video.\n * @returns {Element} Video element.\n */\nfunction createVideoEl (src, width, height) {\n var videoEl = document.createElement('video');\n videoEl.width = width;\n videoEl.height = height;\n // Support inline videos for iOS webviews.\n videoEl.setAttribute('playsinline', '');\n videoEl.setAttribute('webkit-playsinline', '');\n videoEl.autoplay = true;\n videoEl.loop = true;\n videoEl.crossOrigin = 'anonymous';\n videoEl.addEventListener('error', function () {\n warn('`$s` is not a valid video', src);\n }, true);\n videoEl.src = src;\n return videoEl;\n}\n\n/**\n * Fixes a video element's attributes to prevent developers from accidentally passing the\n * wrong attribute values to commonly misused video attributes.\n *\n * <video> does not treat `autoplay`, `controls`, `crossorigin`, `loop`, and `preload` as\n * as booleans. Existence of those attributes will mean truthy.\n *\n * For example, translates <video loop=\"false\"> to <video>.\n *\n * @see https://developer.mozilla.org/docs/Web/HTML/Element/video#Attributes\n * @param {Element} videoEl - Video element.\n * @returns {Element} Video element with the correct properties updated.\n */\nfunction fixVideoAttributes (videoEl) {\n videoEl.autoplay = videoEl.hasAttribute('autoplay') && videoEl.getAttribute('autoplay') !== 'false';\n videoEl.controls = videoEl.hasAttribute('controls') && videoEl.getAttribute('controls') !== 'false';\n if (videoEl.getAttribute('loop') === 'false') {\n videoEl.removeAttribute('loop');\n }\n if (videoEl.getAttribute('preload') === 'false') {\n videoEl.preload = 'none';\n }\n videoEl.crossOrigin = videoEl.crossOrigin || 'anonymous';\n // To support inline videos in iOS webviews.\n videoEl.setAttribute('playsinline', '');\n videoEl.setAttribute('webkit-playsinline', '');\n return videoEl;\n}\n","var registerSystem = require('../core/system').registerSystem;\nvar utils = require('../utils/');\nvar THREE = require('../lib/three');\n\nvar debug = utils.debug;\nvar warn = debug('components:renderer:warn');\n\n/**\n * Determines state of various renderer properties.\n */\nmodule.exports.System = registerSystem('renderer', {\n schema: {\n antialias: {default: 'auto', oneOf: ['true', 'false', 'auto']},\n highRefreshRate: {default: utils.device.isOculusBrowser()},\n logarithmicDepthBuffer: {default: 'auto', oneOf: ['true', 'false', 'auto']},\n maxCanvasWidth: {default: 1920},\n maxCanvasHeight: {default: 1920},\n physicallyCorrectLights: {default: false},\n precision: {default: 'high', oneOf: ['high', 'medium', 'low']},\n sortObjects: {default: false},\n colorManagement: {default: false},\n gammaOutput: {default: false},\n alpha: {default: true},\n foveationLevel: {default: 0}\n },\n\n init: function () {\n var data = this.data;\n var sceneEl = this.el;\n // This is the rendering engine, such as THREE.js so copy over any persistent properties from the rendering system.\n var renderer = sceneEl.renderer;\n renderer.sortObjects = data.sortObjects;\n renderer.physicallyCorrectLights = data.physicallyCorrectLights;\n\n if (data.colorManagement || data.gammaOutput) {\n renderer.outputEncoding = THREE.sRGBEncoding;\n if (data.gammaOutput) {\n warn('Property `gammaOutput` is deprecated. Use `renderer=\"colorManagement: true;\"` instead.');\n }\n }\n\n if (sceneEl.hasAttribute('antialias')) {\n warn('Component `antialias` is deprecated. Use `renderer=\"antialias: true\"` instead.');\n }\n\n if (sceneEl.hasAttribute('logarithmicDepthBuffer')) {\n warn('Component `logarithmicDepthBuffer` is deprecated. Use `renderer=\"logarithmicDepthBuffer: true\"` instead.');\n }\n },\n\n applyColorCorrection: function (colorOrTexture) {\n if (!this.data.colorManagement || !colorOrTexture) {\n return;\n } else if (colorOrTexture.isColor) {\n colorOrTexture.convertSRGBToLinear();\n } else if (colorOrTexture.isTexture) {\n colorOrTexture.encoding = THREE.sRGBEncoding;\n }\n }\n});\n","var registerSystem = require('../core/system').registerSystem;\nvar THREE = require('../lib/three');\n\nvar SHADOW_MAP_TYPE_MAP = {\n basic: THREE.BasicShadowMap,\n pcf: THREE.PCFShadowMap,\n pcfsoft: THREE.PCFSoftShadowMap\n};\n\n/**\n * Shadow system.\n *\n * Enabled automatically when one or more shadow components are added to the scene, the system sets\n * options on the WebGLRenderer for configuring shadow appearance.\n */\nmodule.exports.System = registerSystem('shadow', {\n schema: {\n enabled: {default: true},\n autoUpdate: {default: true},\n type: {default: 'pcf', oneOf: ['basic', 'pcf', 'pcfsoft']}\n },\n\n init: function () {\n var sceneEl = this.sceneEl;\n var data = this.data;\n\n this.shadowMapEnabled = false;\n\n if (!sceneEl.renderer) { return; } // For tests.\n\n sceneEl.renderer.shadowMap.type = SHADOW_MAP_TYPE_MAP[data.type];\n sceneEl.renderer.shadowMap.autoUpdate = data.autoUpdate;\n this.setShadowMapEnabled(this.shadowMapEnabled);\n },\n\n update: function (prevData) {\n if (prevData.enabled !== this.data.enabled) {\n this.setShadowMapEnabled(this.data.enabled);\n }\n },\n\n /**\n * Enables/disables the renderer shadow map.\n * @param {boolean} enabled\n */\n setShadowMapEnabled: function (enabled) {\n var renderer = this.sceneEl.renderer;\n this.shadowMapEnabled = this.data.enabled && enabled;\n if (renderer) {\n renderer.shadowMap.enabled = this.shadowMapEnabled;\n }\n }\n});\n","var registerSystem = require('../core/system').registerSystem;\nvar utils = require('../utils');\nvar isWebXRAvailable = utils.device.isWebXRAvailable;\n\n/**\n * Tracked controls system.\n * Maintain list with available tracked controllers.\n */\nmodule.exports.System = registerSystem('tracked-controls-webvr', {\n init: function () {\n var self = this;\n\n this.controllers = [];\n this.isChrome = navigator.userAgent.indexOf('Chrome') !== -1;\n\n this.updateControllerList();\n this.throttledUpdateControllerList = utils.throttle(this.updateControllerList, 500, this);\n\n // Don't use WebVR if WebXR is available?\n if (isWebXRAvailable) { return; }\n\n if (!navigator.getVRDisplays) { return; }\n\n this.sceneEl.addEventListener('enter-vr', function () {\n navigator.getVRDisplays().then(function (displays) {\n if (displays.length) { self.vrDisplay = displays[0]; }\n });\n });\n },\n\n tick: function () {\n if (this.isChrome) {\n // Retrieve new controller handlers with updated state (pose, buttons...)\n this.updateControllerList();\n } else {\n this.throttledUpdateControllerList();\n }\n },\n\n /**\n * Update controller list.\n */\n updateControllerList: function () {\n var controllers = this.controllers;\n var gamepad;\n var gamepads;\n var i;\n var prevCount;\n\n gamepads = navigator.getGamepads && navigator.getGamepads();\n if (!gamepads) { return; }\n\n prevCount = controllers.length;\n controllers.length = 0;\n for (i = 0; i < gamepads.length; ++i) {\n gamepad = gamepads[i];\n if (gamepad && gamepad.pose) {\n controllers.push(gamepad);\n }\n }\n\n if (controllers.length !== prevCount) {\n this.el.emit('controllersupdated', undefined, false);\n }\n }\n});\n","var registerSystem = require('../core/system').registerSystem;\nvar utils = require('../utils');\n\n/**\n * Tracked controls system.\n * Maintain list with available tracked controllers.\n */\nmodule.exports.System = registerSystem('tracked-controls-webxr', {\n init: function () {\n this.controllers = [];\n this.oldControllers = [];\n this.oldControllersLength = 0;\n this.throttledUpdateControllerList = utils.throttle(this.updateControllerList, 500, this);\n this.updateReferenceSpace = this.updateReferenceSpace.bind(this);\n this.el.addEventListener('enter-vr', this.updateReferenceSpace);\n this.el.addEventListener('exit-vr', this.updateReferenceSpace);\n },\n\n tick: function () {\n this.throttledUpdateControllerList();\n },\n\n updateReferenceSpace: function () {\n var self = this;\n var xrSession = this.el.xrSession;\n\n if (!xrSession) {\n this.referenceSpace = undefined;\n this.controllers = [];\n if (this.oldControllersLength > 0) {\n this.oldControllersLength = 0;\n this.el.emit('controllersupdated', undefined, false);\n }\n return;\n }\n var refspace = self.el.sceneEl.systems.webxr.sessionReferenceSpaceType;\n xrSession.requestReferenceSpace(refspace).then(function (referenceSpace) {\n self.referenceSpace = referenceSpace;\n }).catch(function (err) {\n self.el.sceneEl.systems.webxr.warnIfFeatureNotRequested(\n refspace,\n 'tracked-controls-webxr uses reference space \"' + refspace + '\".');\n throw err;\n });\n },\n\n updateControllerList: function () {\n var xrSession = this.el.xrSession;\n var oldControllers = this.oldControllers;\n var i;\n if (!xrSession) {\n if (this.oldControllersLength === 0) { return; }\n // Broadcast that we now have zero controllers connected if there is\n // no session\n this.oldControllersLength = 0;\n this.controllers = [];\n this.el.emit('controllersupdated', undefined, false);\n return;\n }\n\n if (!xrSession.inputSources) { return; }\n this.controllers = xrSession.inputSources;\n if (this.oldControllersLength === this.controllers.length) {\n var equal = true;\n for (i = 0; i < this.controllers.length; ++i) {\n if (this.controllers[i] === oldControllers[i] &&\n this.controllers[i].gamepad === oldControllers[i].gamepad) { continue; }\n equal = false;\n break;\n }\n if (equal) { return; }\n }\n\n // Store reference to current controllers\n oldControllers.length = 0;\n for (i = 0; i < this.controllers.length; i++) {\n oldControllers.push(this.controllers[i]);\n }\n\n this.oldControllersLength = this.controllers.length;\n this.el.emit('controllersupdated', undefined, false);\n }\n});\n","var registerSystem = require('../core/system').registerSystem;\n\nvar utils = require('../utils/');\nvar warn = utils.debug('systems:webxr:warn');\n\n/**\n * WebXR session initialization and XR module support.\n */\nmodule.exports.System = registerSystem('webxr', {\n schema: {\n referenceSpaceType: {type: 'string', default: 'local-floor'},\n requiredFeatures: {type: 'array', default: ['local-floor']},\n optionalFeatures: {type: 'array', default: ['bounded-floor']},\n overlayElement: {type: 'selector'}\n },\n\n update: function () {\n var data = this.data;\n this.sessionConfiguration = {\n requiredFeatures: data.requiredFeatures,\n optionalFeatures: data.optionalFeatures\n };\n this.sessionReferenceSpaceType = data.referenceSpaceType;\n\n if (data.overlayElement) {\n // Update WebXR to support light-estimation\n data.overlayElement.classList.remove('a-dom-overlay');\n if (!data.optionalFeatures.includes('dom-overlay')) {\n data.optionalFeatures.push('dom-overlay');\n this.el.setAttribute('webxr', data);\n }\n this.warnIfFeatureNotRequested('dom-overlay');\n this.sessionConfiguration.domOverlay = {root: data.overlayElement};\n data.overlayElement.classList.add('a-dom-overlay');\n }\n },\n\n wasFeatureRequested: function (feature) {\n // Features available by default for immersive sessions don't need to\n // be requested explicitly.\n if (feature === 'viewer' || feature === 'local') { return true; }\n\n if (this.sessionConfiguration.requiredFeatures.includes(feature) ||\n this.sessionConfiguration.optionalFeatures.includes(feature)) {\n return true;\n }\n\n return false;\n },\n\n warnIfFeatureNotRequested: function (feature, optIntro) {\n if (!this.wasFeatureRequested(feature)) {\n var msg = 'Please add the feature \"' + feature + '\" to a-scene\\'s ' +\n 'webxr system options in requiredFeatures/optionalFeatures.';\n warn((optIntro ? optIntro + ' ' : '') + msg);\n }\n }\n});\n","/**\n * Faster version of Function.prototype.bind\n * @param {Function} fn - Function to wrap.\n * @param {Object} ctx - What to bind as context.\n * @param {...*} arguments - Arguments to pass through.\n */\nmodule.exports = function bind (fn, ctx/* , arg1, arg2 */) {\n return (function (prependedArgs) {\n return function bound () {\n // Concat the bound function arguments with those passed to original bind\n var args = prependedArgs.concat(Array.prototype.slice.call(arguments, 0));\n return fn.apply(ctx, args);\n };\n })(Array.prototype.slice.call(arguments, 2));\n};\n","/* global THREE */\nvar debug = require('./debug');\nvar extend = require('object-assign');\n\nvar warn = debug('utils:coordinates:warn');\n\n// Order of coordinates parsed by coordinates.parse.\nvar COORDINATE_KEYS = ['x', 'y', 'z', 'w'];\n\n// Coordinate string regex. Handles negative, positive, and decimals.\nvar regex = /^\\s*((-?\\d*\\.{0,1}\\d+(e-?\\d+)?)\\s+){2,3}(-?\\d*\\.{0,1}\\d+(e-?\\d+)?)\\s*$/;\nmodule.exports.regex = regex;\n\nvar OBJECT = 'object';\nvar whitespaceRegex = /\\s+/g;\n\n/**\n * Parses coordinates from an \"x y z\" string.\n * Example: \"3 10 -5\" to {x: 3, y: 10, z: -5}.\n *\n * @param {string} val - An \"x y z\" string.\n * @param {string} defaults - fallback value.\n * @returns {object} An object with keys [x, y, z].\n */\nfunction parse (value, defaultVec) {\n var coordinate;\n var defaultVal;\n var key;\n var i;\n var vec;\n var x;\n var y;\n var z;\n var w;\n\n if (value && value instanceof Object) {\n x = value.x === undefined ? defaultVec && defaultVec.x : value.x;\n y = value.y === undefined ? defaultVec && defaultVec.y : value.y;\n z = value.z === undefined ? defaultVec && defaultVec.z : value.z;\n w = value.w === undefined ? defaultVec && defaultVec.w : value.w;\n if (x !== undefined && x !== null) { value.x = parseIfString(x); }\n if (y !== undefined && y !== null) { value.y = parseIfString(y); }\n if (z !== undefined && z !== null) { value.z = parseIfString(z); }\n if (w !== undefined && w !== null) { value.w = parseIfString(w); }\n return value;\n }\n\n if (value === null || value === undefined) {\n return typeof defaultVec === OBJECT ? extend({}, defaultVec) : defaultVec;\n }\n\n coordinate = value.trim().split(whitespaceRegex);\n vec = {};\n for (i = 0; i < COORDINATE_KEYS.length; i++) {\n key = COORDINATE_KEYS[i];\n if (coordinate[i]) {\n vec[key] = parseFloat(coordinate[i], 10);\n } else {\n defaultVal = defaultVec && defaultVec[key];\n if (defaultVal === undefined) { continue; }\n vec[key] = parseIfString(defaultVal);\n }\n }\n return vec;\n}\nmodule.exports.parse = parse;\n\n/**\n * Stringify coordinates from an object with keys [x y z].\n * Example: {x: 3, y: 10, z: -5} to \"3 10 -5\".\n *\n * @param {object|string} data - An object with keys [x y z].\n * @returns {string} An \"x y z\" string.\n */\nfunction stringify (data) {\n var str;\n if (typeof data !== OBJECT) { return data; }\n str = data.x + ' ' + data.y;\n if (data.z != null) { str += ' ' + data.z; }\n if (data.w != null) { str += ' ' + data.w; }\n return str;\n}\nmodule.exports.stringify = stringify;\n\n/**\n * @returns {bool}\n */\nfunction isCoordinates (value) {\n return regex.test(value);\n}\nmodule.exports.isCoordinates = isCoordinates;\n\nmodule.exports.isCoordinate = function (value) {\n warn('`AFRAME.utils.isCoordinate` has been renamed to `AFRAME.utils.isCoordinates`');\n return isCoordinates(value);\n};\n\nfunction parseIfString (val) {\n if (val !== null && val !== undefined && val.constructor === String) {\n return parseFloat(val, 10);\n }\n return val;\n}\n\n/**\n * Convert {x, y, z} object to three.js Vector3.\n */\nmodule.exports.toVector3 = function (vec3) {\n return new THREE.Vector3(vec3.x, vec3.y, vec3.z);\n};\n","var debugLib = require('debug');\nvar extend = require('object-assign');\n\nvar settings = {\n colors: {\n debug: 'gray',\n error: 'red',\n info: 'gray',\n warn: 'orange'\n }\n};\n\n/**\n * Monkeypatches `debug` so we can colorize error/warning messages.\n *\n * (See issue: https://github.com/visionmedia/debug/issues/137)\n */\nvar debug = function (namespace) {\n var d = debugLib(namespace);\n\n d.color = getDebugNamespaceColor(namespace);\n\n return d;\n};\nextend(debug, debugLib);\n\n/**\n * Returns the type of the namespace (e.g., `error`, `warn`).\n *\n * @param {String} namespace\n * The debug logger's namespace (e.g., `components:geometry:warn`).\n * @returns {String} The type of the namespace (e.g., `warn`).\n * @api private\n */\nfunction getDebugNamespaceType (namespace) {\n var chunks = namespace.split(':');\n\n return chunks[chunks.length - 1]; // Return the last one\n}\n\n/**\n * Returns the color of the namespace (e.g., `orange`).\n *\n * @param {String} namespace\n * The debug logger's namespace (e.g., `components:geometry:warn`).\n * @returns {String} The color of the namespace (e.g., `orange`).\n * @api private\n */\nfunction getDebugNamespaceColor (namespace) {\n var type = getDebugNamespaceType(namespace);\n\n var color = settings.colors && settings.colors[type];\n\n return color || null;\n}\n\n/**\n * Returns `localStorage` if possible.\n *\n * This is necessary because Safari throws when a user disables\n * cookies or `localStorage` and you attempt to access it.\n *\n * @returns {localStorage}\n * @api private\n */\nfunction storage () {\n try {\n return window.localStorage;\n } catch (e) {\n }\n}\n\n/**\n * To enable console logging, type this in the Console of your Dev Tools:\n *\n * localStorage.logs = 1\n *\n * To disable console logging:\n *\n * localStorage.logs = 0\n *\n */\nvar ls = storage();\nif (ls && (parseInt(ls.logs, 10) || ls.logs === 'true')) {\n debug.enable('*');\n} else {\n debug.enable('*:error,*:info,*:warn');\n}\n\nif (process.browser) { window.logs = debug; }\n\nmodule.exports = debug;\n","var error = require('debug')('device:error');\n\nvar vrDisplay;\nvar supportsVRSession = false;\nvar supportsARSession = false;\n\n/**\n * Oculus Browser 7 doesn't support the WebXR gamepads module.\n * We fallback to WebVR API and will hotfix when implementation is complete.\n */\nvar isWebXRAvailable = module.exports.isWebXRAvailable = !window.debug && navigator.xr !== undefined;\n\n// Catch vrdisplayactivate early to ensure we can enter VR mode after the scene loads.\nwindow.addEventListener('vrdisplayactivate', function (evt) {\n var canvasEl;\n // WebXR takes priority if available.\n if (isWebXRAvailable) { return; }\n canvasEl = document.createElement('canvas');\n vrDisplay = evt.display;\n // We need to make sure the canvas has a WebGL context associated with it.\n // Otherwise, the requestPresent could be denied.\n canvasEl.getContext('webgl', {});\n // Request present immediately. a-scene will be allowed to enter VR without user gesture.\n vrDisplay.requestPresent([{source: canvasEl}]).then(function () {}, function () {});\n});\n\n// Support both WebVR and WebXR APIs.\nif (isWebXRAvailable) {\n var updateEnterInterfaces = function () {\n var sceneEl = document.querySelector('a-scene');\n if (!sceneEl) {\n window.addEventListener('DOMContentLoaded', updateEnterInterfaces);\n return;\n }\n if (sceneEl.hasLoaded) {\n sceneEl.components['vr-mode-ui'].updateEnterInterfaces();\n } else {\n sceneEl.addEventListener('loaded', updateEnterInterfaces);\n }\n };\n var errorHandler = function (err) {\n error('WebXR session support error: ' + err.message);\n };\n if (navigator.xr.isSessionSupported) {\n // Current WebXR spec uses a boolean-returning isSessionSupported promise\n navigator.xr.isSessionSupported('immersive-vr').then(function (supported) {\n supportsVRSession = supported;\n updateEnterInterfaces();\n }).catch(errorHandler);\n\n navigator.xr.isSessionSupported('immersive-ar').then(function (supported) {\n supportsARSession = supported;\n updateEnterInterfaces();\n }).catch(function () {});\n } else if (navigator.xr.supportsSession) {\n // Fallback for implementations that haven't updated to the new spec yet,\n // the old version used supportsSession which is rejected for missing\n // support.\n navigator.xr.supportsSession('immersive-vr').then(function () {\n supportsVRSession = true;\n updateEnterInterfaces();\n }).catch(errorHandler);\n navigator.xr.supportsSession('immersive-ar').then(function () {\n supportsARSession = true;\n updateEnterInterfaces();\n }).catch(function () {});\n } else {\n error('WebXR has neither isSessionSupported or supportsSession?!');\n }\n} else {\n if (navigator.getVRDisplays) {\n navigator.getVRDisplays().then(function (displays) {\n var sceneEl = document.querySelector('a-scene');\n vrDisplay = displays.length && displays[0];\n if (sceneEl) { sceneEl.emit('displayconnected', {vrDisplay: vrDisplay}); }\n });\n }\n}\n\nfunction getVRDisplay () { return vrDisplay; }\nmodule.exports.getVRDisplay = getVRDisplay;\n\n/**\n * Determine if a headset is connected by checking if a vrDisplay is available.\n */\nfunction checkHeadsetConnected () {\n return supportsVRSession || supportsARSession || !!getVRDisplay();\n}\nmodule.exports.checkHeadsetConnected = checkHeadsetConnected;\n\nfunction checkARSupport () { return supportsARSession; }\nmodule.exports.checkARSupport = checkARSupport;\n\n/**\n * Checks if browser is mobile and not stand-alone dedicated vr device.\n * @return {Boolean} True if mobile browser detected.\n */\nvar isMobile = (function () {\n var _isMobile = false;\n (function (a) {\n // eslint-disable-next-line no-useless-escape\n if (/(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i.test(a.substr(0, 4))) {\n _isMobile = true;\n }\n if (isIOS() || isTablet() || isR7()) {\n _isMobile = true;\n }\n if (isMobileVR()) {\n _isMobile = false;\n }\n })(window.navigator.userAgent || window.navigator.vendor || window.opera);\n\n return function () { return _isMobile; };\n})();\nmodule.exports.isMobile = isMobile;\n\n/**\n * Detect tablet devices.\n * @param {string} mockUserAgent - Allow passing a mock user agent for testing.\n */\nfunction isTablet (mockUserAgent) {\n var userAgent = mockUserAgent || window.navigator.userAgent;\n return /ipad|Nexus (7|9)|xoom|sch-i800|playbook|tablet|kindle/i.test(userAgent);\n}\nmodule.exports.isTablet = isTablet;\n\nfunction isIOS () {\n return /iPad|iPhone|iPod/.test(window.navigator.platform);\n}\nmodule.exports.isIOS = isIOS;\n\nfunction isMobileDeviceRequestingDesktopSite () {\n return !isMobile() && !isMobileVR() && window.orientation !== undefined;\n}\nmodule.exports.isMobileDeviceRequestingDesktopSite = isMobileDeviceRequestingDesktopSite;\n\n/**\n * Detect Oculus Browser (standalone headset)\n */\nfunction isOculusBrowser () {\n return /(OculusBrowser)/i.test(window.navigator.userAgent);\n}\nmodule.exports.isOculusBrowser = isOculusBrowser;\n\n/**\n * Detect Firefox Reality (standalone headset)\n */\nfunction isFirefoxReality () {\n return /(Mobile VR)/i.test(window.navigator.userAgent);\n}\nmodule.exports.isFirefoxReality = isFirefoxReality;\n\n/**\n * Detect browsers in Stand-Alone headsets\n */\nfunction isMobileVR () {\n return isOculusBrowser() || isFirefoxReality();\n}\nmodule.exports.isMobileVR = isMobileVR;\n\nfunction isR7 () {\n return /R7 Build/.test(window.navigator.userAgent);\n}\nmodule.exports.isR7 = isR7;\n\n/**\n * Checks mobile device orientation.\n * @return {Boolean} True if landscape orientation.\n */\nmodule.exports.isLandscape = function () {\n var orientation = window.orientation;\n if (isR7()) { orientation += 90; }\n return orientation === 90 || orientation === -90;\n};\n\n/**\n * Check if running in a browser or spoofed browser (bundler).\n * We need to check a node api that isn't mocked on either side.\n * `require` and `module.exports` are mocked in browser by bundlers.\n * `window` is mocked in node.\n * `process` is also mocked by browserify, but has custom properties.\n */\nmodule.exports.isBrowserEnvironment = !!(!process || process.browser);\n\n/**\n * Check if running in node on the server.\n */\nmodule.exports.isNodeEnvironment = !module.exports.isBrowserEnvironment;\n","/**\n * Split a delimited component property string (e.g., `material.color`) to an object\n * containing `component` name and `property` name. If there is no delimiter, just return the\n * string back.\n *\n * Cache arrays from splitting strings via delimiter to save on memory.\n *\n * @param {string} str - e.g., `material.opacity`.\n * @param {string} delimiter - e.g., `.`.\n * @returns {array} e.g., `['material', 'opacity']`.\n */\nvar propertyPathCache = {};\nfunction getComponentPropertyPath (str, delimiter) {\n delimiter = delimiter || '.';\n if (!propertyPathCache[delimiter]) { propertyPathCache[delimiter] = {}; }\n if (str.indexOf(delimiter) !== -1) {\n propertyPathCache[delimiter][str] = str.split(delimiter);\n } else {\n propertyPathCache[delimiter][str] = str;\n }\n return propertyPathCache[delimiter][str];\n}\nmodule.exports.getComponentPropertyPath = getComponentPropertyPath;\nmodule.exports.propertyPathCache = propertyPathCache;\n\n/**\n * Get component property using encoded component name + component property name with a\n * delimiter.\n */\nmodule.exports.getComponentProperty = function (el, name, delimiter) {\n var splitName;\n delimiter = delimiter || '.';\n if (name.indexOf(delimiter) !== -1) {\n splitName = getComponentPropertyPath(name, delimiter);\n if (splitName.constructor === String) {\n return el.getAttribute(splitName);\n }\n return el.getAttribute(splitName[0])[splitName[1]];\n }\n return el.getAttribute(name);\n};\n\n/**\n * Set component property using encoded component name + component property name with a\n * delimiter.\n */\nmodule.exports.setComponentProperty = function (el, name, value, delimiter) {\n var splitName;\n delimiter = delimiter || '.';\n if (name.indexOf(delimiter) !== -1) {\n splitName = getComponentPropertyPath(name, delimiter);\n if (splitName.constructor === String) {\n el.setAttribute(splitName, value);\n } else {\n el.setAttribute(splitName[0], splitName[1], value);\n }\n return;\n }\n el.setAttribute(name, value);\n};\n","module.exports = function forceCanvasResizeSafariMobile (canvasEl) {\n var width = canvasEl.style.width;\n var height = canvasEl.style.height;\n // Taken from webvr-polyfill (https://github.com/borismus/webvr-polyfill/blob/85f657cd502ec9417bf26b87c3cb2afa6a70e079/src/util.js#L200)\n // iOS only workaround for https://bugs.webkit.org/show_bug.cgi?id=152556\n // By changing the size 1 pixel and restoring the previous value\n // we trigger a size recalculation cycle.\n canvasEl.style.width = (parseInt(width, 10) + 1) + 'px';\n canvasEl.style.height = (parseInt(height, 10) + 1) + 'px';\n setTimeout(function () {\n canvasEl.style.width = width;\n canvasEl.style.height = height;\n }, 200);\n};\n","/* global location */\n\n/* Centralized place to reference utilities since utils is exposed to the user. */\nvar debug = require('./debug');\nvar deepAssign = require('deep-assign');\nvar device = require('./device');\nvar objectAssign = require('object-assign');\nvar objectPool = require('./object-pool');\n\nvar warn = debug('utils:warn');\n\nmodule.exports.bind = require('./bind');\nmodule.exports.coordinates = require('./coordinates');\nmodule.exports.debug = debug;\nmodule.exports.device = device;\nmodule.exports.entity = require('./entity');\nmodule.exports.forceCanvasResizeSafariMobile = require('./forceCanvasResizeSafariMobile');\nmodule.exports.isIE11 = require('./is-ie11');\nmodule.exports.material = require('./material');\nmodule.exports.objectPool = objectPool;\nmodule.exports.split = require('./split').split;\nmodule.exports.styleParser = require('./styleParser');\nmodule.exports.trackedControls = require('./tracked-controls');\n\nmodule.exports.checkHeadsetConnected = function () {\n warn('`utils.checkHeadsetConnected` has moved to `utils.device.checkHeadsetConnected`');\n return device.checkHeadsetConnected(arguments);\n};\nmodule.exports.isGearVR = module.exports.device.isGearVR = function () {\n warn('`utils.isGearVR` has been deprecated, use `utils.device.isMobileVR`');\n};\nmodule.exports.isIOS = function () {\n warn('`utils.isIOS` has moved to `utils.device.isIOS`');\n return device.isIOS(arguments);\n};\nmodule.exports.isOculusGo = module.exports.device.isOculusGo = function () {\n warn('`utils.isOculusGo` has been deprecated, use `utils.device.isMobileVR`');\n};\nmodule.exports.isMobile = function () {\n warn('`utils.isMobile has moved to `utils.device.isMobile`');\n return device.isMobile(arguments);\n};\n\n/**\n * Returns throttle function that gets called at most once every interval.\n *\n * @param {function} functionToThrottle\n * @param {number} minimumInterval - Minimal interval between calls (milliseconds).\n * @param {object} optionalContext - If given, bind function to throttle to this context.\n * @returns {function} Throttled function.\n */\nmodule.exports.throttle = function (functionToThrottle, minimumInterval, optionalContext) {\n var lastTime;\n if (optionalContext) {\n functionToThrottle = module.exports.bind(functionToThrottle, optionalContext);\n }\n return function () {\n var time = Date.now();\n var sinceLastTime = typeof lastTime === 'undefined' ? minimumInterval : time - lastTime;\n if (typeof lastTime === 'undefined' || (sinceLastTime >= minimumInterval)) {\n lastTime = time;\n functionToThrottle.apply(null, arguments);\n }\n };\n};\n\n/**\n * Returns throttle function that gets called at most once every interval.\n * Uses the time/timeDelta timestamps provided by the global render loop for better perf.\n *\n * @param {function} functionToThrottle\n * @param {number} minimumInterval - Minimal interval between calls (milliseconds).\n * @param {object} optionalContext - If given, bind function to throttle to this context.\n * @returns {function} Throttled function.\n */\nmodule.exports.throttleTick = function (functionToThrottle, minimumInterval, optionalContext) {\n var lastTime;\n if (optionalContext) {\n functionToThrottle = module.exports.bind(functionToThrottle, optionalContext);\n }\n return function (time, delta) {\n var sinceLastTime = typeof lastTime === 'undefined' ? delta : time - lastTime;\n if (typeof lastTime === 'undefined' || (sinceLastTime >= minimumInterval)) {\n lastTime = time;\n functionToThrottle(time, sinceLastTime);\n }\n };\n};\n\n/**\n * Returns debounce function that gets called only once after a set of repeated calls.\n *\n * @param {function} functionToDebounce\n * @param {number} wait - Time to wait for repeated function calls (milliseconds).\n * @param {boolean} immediate - Calls the function immediately regardless of if it should be waiting.\n * @returns {function} Debounced function.\n */\nmodule.exports.debounce = function (func, wait, immediate) {\n var timeout;\n return function () {\n var context = this;\n var args = arguments;\n var later = function () {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) func.apply(context, args);\n };\n};\n\n/**\n * Mix the properties of source object(s) into a destination object.\n *\n * @param {object} dest - The object to which properties will be copied.\n * @param {...object} source - The object(s) from which properties will be copied.\n */\nmodule.exports.extend = objectAssign;\nmodule.exports.extendDeep = deepAssign;\n\nmodule.exports.clone = function (obj) {\n return JSON.parse(JSON.stringify(obj));\n};\n\n/**\n * Checks if two values are equal.\n * Includes objects and arrays and nested objects and arrays.\n * Try to keep this function performant as it will be called often to see if a component\n * should be updated.\n *\n * @param {object} a - First object.\n * @param {object} b - Second object.\n * @returns {boolean} Whether two objects are deeply equal.\n */\nvar deepEqual = (function () {\n var arrayPool = objectPool.createPool(function () { return []; });\n\n return function (a, b) {\n var key;\n var keysA;\n var keysB;\n var i;\n var valA;\n var valB;\n\n // If not objects or arrays, compare as values.\n if (a === undefined || b === undefined || a === null || b === null ||\n !(a && b && (a.constructor === Object && b.constructor === Object) ||\n (a.constructor === Array && b.constructor === Array))) {\n return a === b;\n }\n\n // Different number of keys, not equal.\n keysA = arrayPool.use();\n keysB = arrayPool.use();\n keysA.length = 0;\n keysB.length = 0;\n for (key in a) { keysA.push(key); }\n for (key in b) { keysB.push(key); }\n if (keysA.length !== keysB.length) {\n arrayPool.recycle(keysA);\n arrayPool.recycle(keysB);\n return false;\n }\n\n // Return `false` at the first sign of inequality.\n for (i = 0; i < keysA.length; ++i) {\n valA = a[keysA[i]];\n valB = b[keysA[i]];\n // Check nested array and object.\n if ((typeof valA === 'object' || typeof valB === 'object') ||\n (Array.isArray(valA) && Array.isArray(valB))) {\n if (valA === valB) { continue; }\n if (!deepEqual(valA, valB)) {\n arrayPool.recycle(keysA);\n arrayPool.recycle(keysB);\n return false;\n }\n } else if (valA !== valB) {\n arrayPool.recycle(keysA);\n arrayPool.recycle(keysB);\n return false;\n }\n }\n\n arrayPool.recycle(keysA);\n arrayPool.recycle(keysB);\n return true;\n };\n})();\nmodule.exports.deepEqual = deepEqual;\n\n/**\n * Computes the difference between two objects.\n *\n * @param {object} a - First object to compare (e.g., oldData).\n * @param {object} b - Second object to compare (e.g., newData).\n * @returns {object}\n * Difference object where set of keys note which values were not equal, and values are\n * `b`'s values.\n */\nmodule.exports.diff = (function () {\n var keys = [];\n\n return function (a, b, targetObject) {\n var aVal;\n var bVal;\n var bKey;\n var diff;\n var key;\n var i;\n var isComparingObjects;\n\n diff = targetObject || {};\n\n // Collect A keys.\n keys.length = 0;\n for (key in a) { keys.push(key); }\n\n if (!b) { return diff; }\n\n // Collect B keys.\n for (bKey in b) {\n if (keys.indexOf(bKey) === -1) {\n keys.push(bKey);\n }\n }\n\n for (i = 0; i < keys.length; i++) {\n key = keys[i];\n aVal = a[key];\n bVal = b[key];\n isComparingObjects = aVal && bVal &&\n aVal.constructor === Object && bVal.constructor === Object;\n if ((isComparingObjects && !deepEqual(aVal, bVal)) ||\n (!isComparingObjects && aVal !== bVal)) {\n diff[key] = bVal;\n }\n }\n return diff;\n };\n})();\n\n/**\n * Returns whether we should capture this keyboard event for keyboard shortcuts.\n * @param {Event} event Event object.\n * @returns {Boolean} Whether the key event should be captured.\n */\nmodule.exports.shouldCaptureKeyEvent = function (event) {\n if (event.metaKey) { return false; }\n return document.activeElement === document.body;\n};\n\n/**\n * Splits a string into an array based on a delimiter.\n *\n * @param {string=} [str=''] Source string\n * @param {string=} [delimiter=' '] Delimiter to use\n * @returns {array} Array of delimited strings\n */\nmodule.exports.splitString = function (str, delimiter) {\n if (typeof delimiter === 'undefined') { delimiter = ' '; }\n // First collapse the whitespace (or whatever the delimiter is).\n var regex = new RegExp(delimiter, 'g');\n str = (str || '').replace(regex, delimiter);\n // Then split.\n return str.split(delimiter);\n};\n\n/**\n * Extracts data from the element given an object that contains expected keys.\n *\n * @param {Element} Source element.\n * @param {Object} [defaults={}] Object of default key-value pairs.\n * @returns {Object}\n */\nmodule.exports.getElData = function (el, defaults) {\n defaults = defaults || {};\n var data = {};\n Object.keys(defaults).forEach(copyAttribute);\n function copyAttribute (key) {\n if (el.hasAttribute(key)) {\n data[key] = el.getAttribute(key);\n }\n }\n return data;\n};\n\n/**\n * Retrieves querystring value.\n * @param {String} name Name of querystring key.\n * @return {String} Value\n */\nmodule.exports.getUrlParameter = function (name) {\n // eslint-disable-next-line no-useless-escape\n name = name.replace(/[\\[]/, '\\\\[').replace(/[\\]]/, '\\\\]');\n var regex = new RegExp('[\\\\?&]' + name + '=([^&#]*)');\n var results = regex.exec(location.search);\n return results === null ? '' : decodeURIComponent(results[1].replace(/\\+/g, ' '));\n};\n\n/**\n * Detects whether context is within iframe.\n */\nmodule.exports.isIframed = function () {\n return window.top !== window.self;\n};\n\n/**\n * Finds all elements under the element that have the isScene\n * property set to true\n */\nmodule.exports.findAllScenes = function (el) {\n var matchingElements = [];\n var allElements = el.getElementsByTagName('*');\n for (var i = 0, n = allElements.length; i < n; i++) {\n if (allElements[i].isScene) {\n // Element exists with isScene set.\n matchingElements.push(allElements[i]);\n }\n }\n return matchingElements;\n};\n\n// Must be at bottom to avoid circular dependency.\nmodule.exports.srcLoader = require('./src-loader');\n","// https://stackoverflow.com/a/17907562\nfunction getInternetExplorerVersion () {\n var version = -1;\n var userAgent = navigator.userAgent;\n var re;\n if (navigator.appName === 'Microsoft Internet Explorer') {\n re = new RegExp('MSIE ([0-9]{1,}[\\\\.0-9]{0,})');\n if (re.exec(userAgent) != null) { version = parseFloat(RegExp.$1); }\n } else if (navigator.appName === 'Netscape') {\n re = new RegExp('Trident/.*rv:([0-9]{1,}[\\\\.0-9]{0,})');\n if (re.exec(userAgent) != null) { version = parseFloat(RegExp.$1); }\n }\n return version;\n}\n\nmodule.exports = getInternetExplorerVersion() === 11;\n","/**\n * Check if device is iOS and older than version 10.\n */\nmodule.exports = function isIOSOlderThan10 (userAgent) {\n return /(iphone|ipod|ipad).*os.(7_|8_|9_)/i.test(userAgent);\n};\n","var THREE = require('../lib/three');\n\nvar HLS_MIMETYPES = ['application/x-mpegurl', 'application/vnd.apple.mpegurl'];\n\nvar COLOR_MAPS = new Set([\n 'emissiveMap',\n 'envMap',\n 'map',\n 'specularMap'\n]);\n\n/**\n * Set texture properties such as repeat and offset.\n *\n * @param {object} data - With keys like `repeat`.\n*/\nfunction setTextureProperties (texture, data) {\n var offset = data.offset || {x: 0, y: 0};\n var repeat = data.repeat || {x: 1, y: 1};\n var npot = data.npot || false;\n // To support NPOT textures, wrap must be ClampToEdge (not Repeat),\n // and filters must not use mipmaps (i.e. Nearest or Linear).\n if (npot) {\n texture.wrapS = THREE.ClampToEdgeWrapping;\n texture.wrapT = THREE.ClampToEdgeWrapping;\n texture.magFilter = THREE.LinearFilter;\n texture.minFilter = THREE.LinearFilter;\n }\n\n // Don't bother setting repeat if it is 1/1. Power-of-two is required to repeat.\n if (repeat.x !== 1 || repeat.y !== 1) {\n texture.wrapS = THREE.RepeatWrapping;\n texture.wrapT = THREE.RepeatWrapping;\n texture.repeat.set(repeat.x, repeat.y);\n }\n // Don't bother setting offset if it is 0/0.\n if (offset.x !== 0 || offset.y !== 0) {\n texture.offset.set(offset.x, offset.y);\n }\n}\nmodule.exports.setTextureProperties = setTextureProperties;\n\n/**\n * Update `material` texture property (usually but not always `map`)\n * from `data` property (usually but not always `src`)\n *\n * @param {object} shader - A-Frame shader instance.\n * @param {object} data\n */\nmodule.exports.updateMapMaterialFromData = function (materialName, dataName, shader, data) {\n var el = shader.el;\n var material = shader.material;\n var rendererSystem = el.sceneEl.systems.renderer;\n var src = data[dataName];\n\n // Because a single material / shader may have multiple textures,\n // we need to remember the source value for this data property\n // to avoid redundant operations which can be expensive otherwise\n // (e.g. video texture loads).\n if (!shader.materialSrcs) { shader.materialSrcs = {}; }\n\n if (!src) {\n // Forget the prior material src.\n delete shader.materialSrcs[materialName];\n // Remove the texture.\n setMap(null);\n return;\n }\n\n // Don't process if material src hasn't changed.\n if (src === shader.materialSrcs[materialName]) { return; }\n\n // Remember the new src for this texture (there may be multiple).\n shader.materialSrcs[materialName] = src;\n\n // If the new material src is already a texture, just use it.\n if (src instanceof THREE.Texture) { setMap(src); } else {\n // Load texture for the new material src.\n // (And check if we should still use it once available in callback.)\n el.sceneEl.systems.material.loadTexture(src,\n {src: src, repeat: data.repeat, offset: data.offset, npot: data.npot},\n checkSetMap);\n }\n\n function checkSetMap (texture) {\n // If the source has been changed, don't use loaded texture.\n if (shader.materialSrcs[materialName] !== src) { return; }\n setMap(texture);\n }\n\n function setMap (texture) {\n material[materialName] = texture;\n if (texture && COLOR_MAPS.has(materialName)) {\n rendererSystem.applyColorCorrection(texture);\n }\n material.needsUpdate = true;\n handleTextureEvents(el, texture);\n }\n};\n\n/**\n * Update `material.map` given `data.src`. For standard and flat shaders.\n *\n * @param {object} shader - A-Frame shader instance.\n * @param {object} data\n */\nmodule.exports.updateMap = function (shader, data) {\n return module.exports.updateMapMaterialFromData('map', 'src', shader, data);\n};\n\n/**\n * Updates the material's maps which give the illusion of extra geometry.\n *\n * @param {string} longType - The friendly name of the map from the component e.g. ambientOcclusionMap becomes aoMap in THREE.js\n * @param {object} shader - A-Frame shader instance\n * @param {object} data\n */\nmodule.exports.updateDistortionMap = function (longType, shader, data) {\n var shortType = longType;\n if (longType === 'ambientOcclusion') { shortType = 'ao'; }\n var el = shader.el;\n var material = shader.material;\n var rendererSystem = el.sceneEl.systems.renderer;\n var src = data[longType + 'Map'];\n var info = {};\n info.src = src;\n\n // Pass through the repeat and offset to be handled by the material loader.\n info.offset = data[longType + 'TextureOffset'];\n info.repeat = data[longType + 'TextureRepeat'];\n info.wrap = data[longType + 'TextureWrap'];\n\n if (src) {\n if (src === shader[longType + 'TextureSrc']) { return; }\n\n // Texture added or changed.\n shader[longType + 'TextureSrc'] = src;\n el.sceneEl.systems.material.loadTexture(src, info, setMap);\n return;\n }\n\n // Texture removed.\n if (!material.map) { return; }\n setMap(null);\n\n function setMap (texture) {\n var slot = shortType + 'Map';\n material[slot] = texture;\n if (texture && COLOR_MAPS.has(slot)) {\n rendererSystem.applyColorCorrection(texture);\n }\n if (texture) {\n setTextureProperties(texture, data);\n }\n material.needsUpdate = true;\n handleTextureEvents(el, texture);\n }\n};\n\n/**\n * Emit event on entities on texture-related events.\n *\n * @param {Element} el - Entity.\n * @param {object} texture - three.js Texture.\n */\nfunction handleTextureEvents (el, texture) {\n if (!texture) { return; }\n\n el.emit('materialtextureloaded', {src: texture.image, texture: texture});\n\n // Video events.\n if (!texture.image || texture.image.tagName !== 'VIDEO') { return; }\n\n texture.image.addEventListener('loadeddata', function emitVideoTextureLoadedDataAll () {\n // Check to see if we need to use iOS 10 HLS shader.\n // Only override the shader if it is stock shader that we know doesn't correct.\n if (!el.components || !el.components.material) { return; }\n\n if (texture.needsCorrectionBGRA && texture.needsCorrectionFlipY &&\n ['standard', 'flat'].indexOf(el.components.material.data.shader) !== -1) {\n el.setAttribute('material', 'shader', 'ios10hls');\n }\n\n el.emit('materialvideoloadeddata', {src: texture.image, texture: texture});\n });\n texture.image.addEventListener('ended', function emitVideoTextureEndedAll () {\n // Works for non-looping videos only.\n el.emit('materialvideoended', {src: texture.image, texture: texture});\n });\n}\nmodule.exports.handleTextureEvents = handleTextureEvents;\n\n/**\n * Given video element src and type, guess whether stream is HLS.\n *\n * @param {string} src - src from video element (generally URL to content).\n * @param {string} type - type from video element (generally MIME type if present).\n */\nmodule.exports.isHLS = function (src, type) {\n if (type && HLS_MIMETYPES.includes(type.toLowerCase())) { return true; }\n if (src && src.toLowerCase().indexOf('.m3u8') > 0) { return true; }\n return false;\n};\n","/*\n Adapted deePool by Kyle Simpson.\n MIT License: http://getify.mit-license.org\n*/\nvar EMPTY_SLOT = Object.freeze(Object.create(null));\n\n// Default object factory.\nfunction defaultObjectFactory () { return {}; }\n\n/**\n * Create a new pool.\n */\nmodule.exports.createPool = function createPool (objectFactory) {\n var objPool = [];\n var nextFreeSlot = null; // Pool location to look for a free object to use.\n\n objectFactory = objectFactory || defaultObjectFactory;\n\n function use () {\n var objToUse;\n if (nextFreeSlot === null || nextFreeSlot === objPool.length) {\n grow(objPool.length || 5);\n }\n objToUse = objPool[nextFreeSlot];\n objPool[nextFreeSlot++] = EMPTY_SLOT;\n clearObject(objToUse);\n return objToUse;\n }\n\n function recycle (obj) {\n if (!(obj instanceof Object)) { return; }\n if (nextFreeSlot === null || nextFreeSlot === -1) {\n objPool[objPool.length] = obj;\n return;\n }\n objPool[--nextFreeSlot] = obj;\n }\n\n function grow (count) {\n var currentLength;\n var i;\n\n count = count === undefined ? objPool.length : count;\n if (count > 0 && nextFreeSlot == null) {\n nextFreeSlot = 0;\n }\n\n if (count > 0) {\n currentLength = objPool.length;\n objPool.length += Number(count);\n for (i = currentLength; i < objPool.length; i++) {\n // Add new obj to pool.\n objPool[i] = objectFactory();\n }\n }\n\n return objPool.length;\n }\n\n function size () {\n return objPool.length;\n }\n\n return {\n grow: grow,\n pool: objPool,\n recycle: recycle,\n size: size,\n use: use\n };\n};\n\nfunction clearObject (obj) {\n var key;\n if (!obj || obj.constructor !== Object) { return; }\n for (key in obj) { obj[key] = undefined; }\n}\nmodule.exports.clearObject = clearObject;\n\nfunction removeUnusedKeys (obj, schema) {\n var key;\n if (!obj || obj.constructor !== Object) { return; }\n for (key in obj) {\n if (!(key in schema)) {\n delete obj[key];\n }\n }\n}\nmodule.exports.removeUnusedKeys = removeUnusedKeys;\n","/**\n * String split with cached result.\n */\nmodule.exports.split = (function () {\n var splitCache = {};\n\n return function (str, delimiter) {\n if (!(delimiter in splitCache)) { splitCache[delimiter] = {}; }\n\n if (str in splitCache[delimiter]) { return splitCache[delimiter][str]; }\n\n splitCache[delimiter][str] = str.split(delimiter);\n return splitCache[delimiter][str];\n };\n})();\n","/* global Image, XMLHttpRequest */\nvar debug = require('./debug');\n\nvar warn = debug('utils:src-loader:warn');\n\n/**\n * Validate a texture, either as a selector or as a URL.\n * Detects whether `src` is pointing to an image or video and invokes the appropriate\n * callback.\n *\n * `src` will be passed into the callback\n *\n * @params {string|Element} src - URL or media element.\n * @params {function} isImageCb - callback if texture is an image.\n * @params {function} isVideoCb - callback if texture is a video.\n */\nfunction validateSrc (src, isImageCb, isVideoCb) {\n checkIsImage(src, function isAnImageUrl (isImage) {\n if (isImage) {\n isImageCb(src);\n return;\n }\n isVideoCb(src);\n });\n}\n\n/**\n * Validates six images as a cubemap, either as selector or comma-separated\n * URLs.\n *\n * @param {string} src - A selector or comma-separated image URLs. Image URLs\n must be wrapped by `url()`.\n * @param {string} src - A selector or comma-separated image URLs. Image URLs\n must be wrapped by `url()`.\n */\nfunction validateCubemapSrc (src, cb) {\n var aCubemap;\n var cubemapSrcRegex = '';\n var i;\n var urls;\n var validatedUrls = [];\n\n for (i = 0; i < 5; i++) {\n cubemapSrcRegex += '(url\\\\((?:[^\\\\)]+)\\\\),\\\\s*)';\n }\n cubemapSrcRegex += '(url\\\\((?:[^\\\\)]+)\\\\)\\\\s*)';\n urls = src.match(new RegExp(cubemapSrcRegex));\n\n // `src` is a comma-separated list of URLs.\n // In this case, re-use validateSrc for each side of the cube.\n function isImageCb (url) {\n validatedUrls.push(url);\n if (validatedUrls.length === 6) {\n cb(validatedUrls);\n }\n }\n if (urls) {\n for (i = 1; i < 7; i++) {\n validateSrc(parseUrl(urls[i]), isImageCb);\n }\n return;\n }\n\n // `src` is a query selector to <a-cubemap> containing six $([src])s.\n aCubemap = validateAndGetQuerySelector(src);\n if (!aCubemap) { return; }\n if (aCubemap.tagName === 'A-CUBEMAP' && aCubemap.srcs) {\n return cb(aCubemap.srcs);\n }\n // Else if aCubeMap is not a <a-cubemap>.\n warn('Selector \"%s\" does not point to <a-cubemap>', src);\n}\n\n/**\n * Parses src from `url(src)`.\n * @param {string} src - String to parse.\n * @return {string} The parsed src, if parseable.\n */\nfunction parseUrl (src) {\n var parsedSrc = src.match(/\\url\\((.+)\\)/);\n if (!parsedSrc) { return; }\n return parsedSrc[1];\n}\n\n/**\n * Call back whether `src` is an image.\n *\n * @param {string|Element} src - URL or element that will be tested.\n * @param {function} onResult - Callback with whether `src` is an image.\n */\nfunction checkIsImage (src, onResult) {\n var request;\n\n if (src.tagName) {\n onResult(src.tagName === 'IMG');\n return;\n }\n request = new XMLHttpRequest();\n\n // Try to send HEAD request to check if image first.\n request.open('HEAD', src);\n request.addEventListener('load', function (event) {\n var contentType;\n if (request.status >= 200 && request.status < 300) {\n contentType = request.getResponseHeader('Content-Type');\n if (contentType == null) {\n checkIsImageFallback(src, onResult);\n } else {\n if (contentType.startsWith('image')) {\n onResult(true);\n } else {\n onResult(false);\n }\n }\n } else {\n checkIsImageFallback(src, onResult);\n }\n request.abort();\n });\n request.send();\n}\n\nfunction checkIsImageFallback (src, onResult) {\n var tester = new Image();\n tester.addEventListener('load', onLoad);\n function onLoad () { onResult(true); }\n tester.addEventListener('error', onError);\n function onError () { onResult(false); }\n tester.src = src;\n}\n\n/**\n * Query and validate a query selector,\n *\n * @param {string} selector - DOM selector.\n * @return {object|null|undefined} Selected DOM element if exists.\n null if query yields no results.\n undefined if `selector` is not a valid selector.\n */\nfunction validateAndGetQuerySelector (selector) {\n try {\n var el = document.querySelector(selector);\n if (!el) {\n warn('No element was found matching the selector: \"%s\"', selector);\n }\n return el;\n } catch (e) { // Capture exception if it's not a valid selector.\n warn('\"%s\" is not a valid selector', selector);\n return undefined;\n }\n}\n\nmodule.exports = {\n parseUrl: parseUrl,\n validateSrc: validateSrc,\n validateCubemapSrc: validateCubemapSrc\n};\n","/**\n * Utils for parsing style-like strings (e.g., \"primitive: box; width: 5; height: 4.5\").\n * Some code adapted from `style-attr` (https://github.com/joshwnj/style-attr)\n * by Josh Johnston (MIT License).\n */\nvar DASH_REGEX = /-([a-z])/g;\n\n/**\n * Deserialize style-like string into an object of properties.\n *\n * @param {string} value - HTML attribute value.\n * @param {object} obj - Reused object for object pooling.\n * @returns {object} Property data.\n */\nmodule.exports.parse = function (value, obj) {\n var parsedData;\n if (typeof value !== 'string') { return value; }\n parsedData = styleParse(value, obj);\n // The style parser returns an object { \"\" : \"test\"} when fed a string\n if (parsedData['']) { return value; }\n return transformKeysToCamelCase(parsedData);\n};\n\n/**\n * Serialize an object of properties into a style-like string.\n *\n * @param {object} data - Property data.\n * @returns {string}\n */\nmodule.exports.stringify = function (data) {\n if (typeof data === 'string') { return data; }\n return styleStringify(data);\n};\n\n/**\n * Converts string from hyphen to camelCase.\n *\n * @param {string} str - String to camelCase.\n * @return {string} CamelCased string.\n */\nfunction toCamelCase (str) {\n return str.replace(DASH_REGEX, upperCase);\n}\nmodule.exports.toCamelCase = toCamelCase;\n\n/**\n * Converts object's keys from hyphens to camelCase (e.g., `max-value` to\n * `maxValue`).\n *\n * @param {object} obj - The object to camelCase keys.\n * @return {object} The object with keys camelCased.\n */\nfunction transformKeysToCamelCase (obj) {\n var camelKey;\n var key;\n for (key in obj) {\n camelKey = toCamelCase(key);\n if (key === camelKey) { continue; }\n obj[camelKey] = obj[key];\n delete obj[key];\n }\n return obj;\n}\nmodule.exports.transformKeysToCamelCase = transformKeysToCamelCase;\n\n/**\n * Split a string into chunks matching `<key>: <value>`\n */\nvar getKeyValueChunks = (function () {\n var chunks = [];\n var hasUnclosedUrl = /url\\([^)]+$/;\n\n return function getKeyValueChunks (raw) {\n var chunk = '';\n var nextSplit;\n var offset = 0;\n var sep = ';';\n\n chunks.length = 0;\n\n while (offset < raw.length) {\n nextSplit = raw.indexOf(sep, offset);\n if (nextSplit === -1) { nextSplit = raw.length; }\n\n chunk += raw.substring(offset, nextSplit);\n\n // data URIs can contain semicolons, so make sure we get the whole thing\n if (hasUnclosedUrl.test(chunk)) {\n chunk += ';';\n offset = nextSplit + 1;\n continue;\n }\n\n chunks.push(chunk.trim());\n chunk = '';\n offset = nextSplit + 1;\n }\n\n return chunks;\n };\n})();\n\n/**\n * Convert a style attribute string to an object.\n *\n * @param {object} str - Attribute string.\n * @param {object} obj - Object to reuse as a base, else a new one will be allocated.\n */\nfunction styleParse (str, obj) {\n var chunks;\n var i;\n var item;\n var pos;\n var key;\n var val;\n\n obj = obj || {};\n\n chunks = getKeyValueChunks(str);\n for (i = 0; i < chunks.length; i++) {\n item = chunks[i];\n if (!item) { continue; }\n // Split with `.indexOf` rather than `.split` because the value may also contain colons.\n pos = item.indexOf(':');\n key = item.substr(0, pos).trim();\n val = item.substr(pos + 1).trim();\n obj[key] = val;\n }\n return obj;\n}\n\n/**\n * Convert an object into an attribute string\n **/\nfunction styleStringify (obj) {\n var key;\n var keyCount = 0;\n var i = 0;\n var str = '';\n\n for (key in obj) { keyCount++; }\n\n for (key in obj) {\n str += (key + ': ' + obj[key]);\n if (i < keyCount - 1) { str += '; '; }\n i++;\n }\n return str;\n}\n\nfunction upperCase (str) { return str[1].toUpperCase(); }\n","var DEFAULT_HANDEDNESS = require('../constants').DEFAULT_HANDEDNESS;\nvar AXIS_LABELS = ['x', 'y', 'z', 'w'];\nvar NUM_HANDS = 2; // Number of hands in a pair. Should always be 2.\n\n/**\n * Called on controller component `.play` handlers.\n * Check if controller matches parameters and inject tracked-controls component.\n * Handle event listeners.\n * Generate controllerconnected or controllerdisconnected events.\n *\n * @param {object} component - Tracked controls component.\n * @param {object} idPrefix - Prefix to match in gamepad id if any.\n * @param {object} queryObject - Map of values to match.\n */\nmodule.exports.checkControllerPresentAndSetup = function (component, idPrefix, queryObject) {\n var el = component.el;\n var controller;\n var hasWebXR = el.sceneEl.hasWebXR;\n var isControllerPresent = hasWebXR ? isControllerPresentWebXR : isControllerPresentWebVR;\n var isPresent;\n\n controller = isControllerPresent(component, idPrefix, queryObject);\n isPresent = !!controller;\n\n // If component was previously paused and now playing, re-add event listeners.\n // Handle the event listeners here since this helper method is control of calling\n // `.addEventListeners` and `.removeEventListeners`.\n if (component.controllerPresent && !component.controllerEventsActive && !hasWebXR) {\n component.addEventListeners();\n }\n\n // Nothing changed, no need to do anything.\n if (isPresent === component.controllerPresent) { return isPresent; }\n\n component.controllerPresent = isPresent;\n\n // Update controller presence.\n if (isPresent) {\n component.addEventListeners();\n component.injectTrackedControls(controller);\n el.emit('controllerconnected', {name: component.name, component: component});\n } else {\n component.removeEventListeners();\n el.emit('controllerdisconnected', {name: component.name, component: component});\n }\n};\n\n/**\n * Enumerate controller (that have pose) and check if they match parameters for WebVR\n *\n * @param {object} component - Tracked controls component.\n * @param {object} idPrefix - Prefix to match in gamepad id if any.\n * @param {object} queryObject - Map of values to match.\n */\nfunction isControllerPresentWebVR (component, idPrefix, queryObject) {\n var gamepads;\n var sceneEl = component.el.sceneEl;\n var trackedControlsSystem;\n var filterControllerIndex = queryObject.index || 0;\n\n if (!idPrefix) { return false; }\n\n trackedControlsSystem = sceneEl && sceneEl.systems['tracked-controls-webvr'];\n if (!trackedControlsSystem) { return false; }\n\n gamepads = trackedControlsSystem.controllers;\n if (!gamepads.length) { return false; }\n\n return !!findMatchingControllerWebVR(gamepads, null, idPrefix, queryObject.hand,\n filterControllerIndex);\n}\n\n/**\n *\n * @param {object} component - Tracked controls component.\n */\nfunction isControllerPresentWebXR (component, id, queryObject) {\n var controllers;\n var sceneEl = component.el.sceneEl;\n var trackedControlsSystem = sceneEl && sceneEl.systems['tracked-controls-webxr'];\n if (!trackedControlsSystem) { return false; }\n\n controllers = trackedControlsSystem.controllers;\n if (!controllers || !controllers.length) { return false; }\n\n return findMatchingControllerWebXR(\n controllers, id,\n queryObject.hand, queryObject.index, queryObject.iterateControllerProfiles, queryObject.handTracking);\n}\n\nmodule.exports.isControllerPresentWebVR = isControllerPresentWebVR;\nmodule.exports.isControllerPresentWebXR = isControllerPresentWebXR;\n\n/**\n * Walk through the given controllers to find any where the device ID equals\n * filterIdExact, or startsWith filterIdPrefix.\n * A controller where this considered true is considered a 'match'.\n *\n * For each matching controller:\n * If filterHand is set, and the controller:\n * is handed, we further verify that controller.hand equals filterHand.\n * is unhanded (controller.hand is ''), we skip until we have found a\n * number of matching controllers that equals filterControllerIndex\n * If filterHand is not set, we skip until we have found the nth matching\n * controller, where n equals filterControllerIndex\n *\n * The method should be called with one of: [filterIdExact, filterIdPrefix] AND\n * one or both of: [filterHand, filterControllerIndex]\n *\n * @param {object} controllers - Array of gamepads to search\n * @param {string} filterIdExact - If set, used to find controllers with id === this value\n * @param {string} filterIdPrefix - If set, used to find controllers with id startsWith this value\n * @param {object} filterHand - If set, further filters controllers with matching 'hand' property\n * @param {object} filterControllerIndex - Find the nth matching controller,\n * where n equals filterControllerIndex. defaults to 0.\n */\nfunction findMatchingControllerWebVR (controllers, filterIdExact, filterIdPrefix, filterHand,\n filterControllerIndex) {\n var controller;\n var i;\n var matchingControllerOccurence = 0;\n var targetControllerMatch = filterControllerIndex >= 0 ? filterControllerIndex : 0;\n\n for (i = 0; i < controllers.length; i++) {\n controller = controllers[i];\n\n // Determine if the controller ID matches our criteria.\n if (filterIdPrefix && !controller.id.startsWith(filterIdPrefix)) {\n continue;\n }\n\n if (!filterIdPrefix && controller.id !== filterIdExact) { continue; }\n\n // If the hand filter and controller handedness are defined we compare them.\n if (filterHand && controller.hand && filterHand !== controller.hand) { continue; }\n\n // If we have detected an unhanded controller and the component was asking\n // for a particular hand, we need to treat the controllers in the array as\n // pairs of controllers. This effectively means that we need to skip\n // NUM_HANDS matches for each controller number, instead of 1.\n if (filterHand && !controller.hand) {\n targetControllerMatch = NUM_HANDS * filterControllerIndex + ((filterHand === DEFAULT_HANDEDNESS) ? 0 : 1);\n } else {\n return controller;\n }\n\n // We are looking for the nth occurence of a matching controller\n // (n equals targetControllerMatch).\n if (matchingControllerOccurence === targetControllerMatch) { return controller; }\n ++matchingControllerOccurence;\n }\n return undefined;\n}\n\nfunction findMatchingControllerWebXR (controllers, idPrefix, handedness, index, iterateProfiles, handTracking) {\n var i;\n var j;\n var controller;\n var controllerMatch = false;\n var controllerHasHandedness;\n var profiles;\n for (i = 0; i < controllers.length; i++) {\n controller = controllers[i];\n profiles = controller.profiles;\n if (handTracking) {\n controllerMatch = controller.hand;\n } else {\n if (iterateProfiles) {\n for (j = 0; j < profiles.length; j++) {\n controllerMatch = profiles[j].startsWith(idPrefix);\n if (controllerMatch) { break; }\n }\n } else {\n controllerMatch = profiles.length > 0 && profiles[0].startsWith(idPrefix);\n }\n }\n if (!controllerMatch) { continue; }\n // Vive controllers are assigned handedness at runtime and it might not be always available.\n controllerHasHandedness = controller.handedness === 'right' || controller.handedness === 'left';\n if (controllerHasHandedness) {\n if (controller.handedness === handedness) { return controllers[i]; }\n } else { // Fallback to index if controller has no handedness.\n if ((i === index)) { return controllers[i]; }\n }\n }\n return undefined;\n}\n\nmodule.exports.findMatchingControllerWebVR = findMatchingControllerWebVR;\nmodule.exports.findMatchingControllerWebXR = findMatchingControllerWebXR;\n\n/**\n * Emit specific `moved` event(s) if axes changed based on original axismoved event.\n *\n * @param {object} component - Controller component in use.\n * @param {array} axesMapping - For example `{thumbstick: [0, 1]}`.\n * @param {object} evt - Event to process.\n */\nmodule.exports.emitIfAxesChanged = function (component, axesMapping, evt) {\n var axes;\n var buttonType;\n var changed;\n var detail;\n var j;\n\n for (buttonType in axesMapping) {\n axes = axesMapping[buttonType];\n\n changed = false;\n for (j = 0; j < axes.length; j++) {\n if (evt.detail.changed[axes[j]]) { changed = true; }\n }\n\n if (!changed) { continue; }\n\n // Axis has changed. Emit the specific moved event with axis values in detail.\n detail = {};\n for (j = 0; j < axes.length; j++) {\n detail[AXIS_LABELS[j]] = evt.detail.axis[axes[j]];\n }\n component.el.emit(buttonType + 'moved', detail);\n }\n};\n\n/**\n * Handle a button event and reemits the events.\n *\n * @param {string} id - id of the button.\n * @param {string} evtName - name of the reemitted event\n * @param {object} component - reference to the component\n * @param {string} hand - handedness of the controller: left or right.\n */\nmodule.exports.onButtonEvent = function (id, evtName, component, hand) {\n var mapping = hand ? component.mapping[hand] : component.mapping;\n var buttonName = mapping.buttons[id];\n component.el.emit(buttonName + evtName);\n if (component.updateModel) {\n component.updateModel(buttonName, evtName);\n }\n};\n","/**\n * @author richt / http://richt.me\n * @author WestLangley / http://github.com/WestLangley\n *\n * W3C Device Orientation control (http://w3c.github.io/deviceorientation/spec-source-orientation.html)\n */\n\nTHREE.DeviceOrientationControls = function ( object ) {\n\n var scope = this;\n\n this.object = object;\n this.object.rotation.reorder( 'YXZ' );\n\n this.enabled = true;\n\n this.deviceOrientation = {};\n this.screenOrientation = 0;\n\n this.alphaOffset = 0; // radians\n\n var onDeviceOrientationChangeEvent = function ( event ) {\n\n scope.deviceOrientation = event;\n\n };\n\n var onScreenOrientationChangeEvent = function () {\n\n scope.screenOrientation = window.orientation || 0;\n\n };\n\n // The angles alpha, beta and gamma form a set of intrinsic Tait-Bryan angles of type Z-X'-Y''\n\n var setObjectQuaternion = function () {\n\n var zee = new THREE.Vector3( 0, 0, 1 );\n\n var euler = new THREE.Euler();\n\n var q0 = new THREE.Quaternion();\n\n var q1 = new THREE.Quaternion( - Math.sqrt( 0.5 ), 0, 0, Math.sqrt( 0.5 ) ); // - PI/2 around the x-axis\n\n return function ( quaternion, alpha, beta, gamma, orient ) {\n\n euler.set( beta, alpha, - gamma, 'YXZ' ); // 'ZXY' for the device, but 'YXZ' for us\n\n quaternion.setFromEuler( euler ); // orient the device\n\n quaternion.multiply( q1 ); // camera looks out the back of the device, not the top\n\n quaternion.multiply( q0.setFromAxisAngle( zee, - orient ) ); // adjust for screen orientation\n\n };\n\n }();\n\n this.connect = function () {\n \n onScreenOrientationChangeEvent();\n\n window.addEventListener( 'orientationchange', onScreenOrientationChangeEvent, false );\n window.addEventListener( 'deviceorientation', onDeviceOrientationChangeEvent, false );\n\n scope.enabled = true;\n\n };\n\n this.disconnect = function () {\n\n window.removeEventListener( 'orientationchange', onScreenOrientationChangeEvent, false );\n window.removeEventListener( 'deviceorientation', onDeviceOrientationChangeEvent, false );\n\n scope.enabled = false;\n\n };\n\n this.update = function () {\n\n if ( scope.enabled === false ) return;\n\n var device = scope.deviceOrientation;\n\n if ( device ) {\n\n var alpha = device.alpha ? THREE.Math.degToRad( device.alpha ) + scope.alphaOffset : 0; // Z\n\n var beta = device.beta ? THREE.Math.degToRad( device.beta ) : 0; // X'\n\n var gamma = device.gamma ? THREE.Math.degToRad( device.gamma ) : 0; // Y''\n\n var orient = scope.screenOrientation ? THREE.Math.degToRad( scope.screenOrientation ) : 0; // O\n\n setObjectQuaternion( scope.object.quaternion, alpha, beta, gamma, orient );\n\n }\n\n\n };\n\n this.dispose = function () {\n\n scope.disconnect();\n\n };\n\n this.connect();\n\n};\n","window.glStats = function () {\n\n var _rS = null;\n\n var _totalDrawArraysCalls = 0,\n _totalDrawElementsCalls = 0,\n _totalUseProgramCalls = 0,\n _totalFaces = 0,\n _totalVertices = 0,\n _totalPoints = 0,\n _totalBindTexures = 0;\n\n function _h ( f, c ) {\n return function () {\n c.apply( this, arguments );\n f.apply( this, arguments );\n };\n }\n\n WebGLRenderingContext.prototype.drawArrays = _h( WebGLRenderingContext.prototype.drawArrays, function () {\n _totalDrawArraysCalls++;\n if ( arguments[ 0 ] == this.POINTS ) _totalPoints += arguments[ 2 ];\n else _totalVertices += arguments[ 2 ];\n } );\n\n WebGLRenderingContext.prototype.drawElements = _h( WebGLRenderingContext.prototype.drawElements, function () {\n _totalDrawElementsCalls++;\n _totalFaces += arguments[ 1 ] / 3;\n _totalVertices += arguments[ 1 ];\n } );\n\n WebGLRenderingContext.prototype.useProgram = _h( WebGLRenderingContext.prototype.useProgram, function () {\n _totalUseProgramCalls++;\n } );\n\n WebGLRenderingContext.prototype.bindTexture = _h( WebGLRenderingContext.prototype.bindTexture, function () {\n _totalBindTexures++;\n } );\n\n var _values = {\n allcalls: {\n over: 3000,\n caption: 'Calls (hook)'\n },\n drawelements: {\n caption: 'drawElements (hook)'\n },\n drawarrays: {\n caption: 'drawArrays (hook)'\n }\n };\n\n var _groups = [ {\n caption: 'WebGL',\n values: [ 'allcalls', 'drawelements', 'drawarrays', 'useprogram', 'bindtexture', 'glfaces', 'glvertices', 'glpoints' ]\n } ];\n\n var _fractions = [ {\n base: 'allcalls',\n steps: [ 'drawelements', 'drawarrays' ]\n } ];\n\n function _update () {\n _rS( 'allcalls' ).set( _totalDrawArraysCalls + _totalDrawElementsCalls );\n _rS( 'drawElements' ).set( _totalDrawElementsCalls );\n _rS( 'drawArrays' ).set( _totalDrawArraysCalls );\n _rS( 'bindTexture' ).set( _totalBindTexures );\n _rS( 'useProgram' ).set( _totalUseProgramCalls );\n _rS( 'glfaces' ).set( _totalFaces );\n _rS( 'glvertices' ).set( _totalVertices );\n _rS( 'glpoints' ).set( _totalPoints );\n }\n\n function _start () {\n _totalDrawArraysCalls = 0;\n _totalDrawElementsCalls = 0;\n _totalUseProgramCalls = 0;\n _totalFaces = 0;\n _totalVertices = 0;\n _totalPoints = 0;\n _totalBindTexures = 0;\n }\n\n function _end () {}\n\n function _attach ( r ) {\n _rS = r;\n }\n\n return {\n update: _update,\n start: _start,\n end: _end,\n attach: _attach,\n values: _values,\n groups: _groups,\n fractions: _fractions\n };\n\n};\n\nwindow.threeStats = function ( renderer ) {\n\n var _rS = null;\n\n var _values = {\n 'renderer.info.memory.geometries': {\n caption: 'Geometries'\n },\n 'renderer.info.memory.textures': {\n caption: 'Textures'\n },\n 'renderer.info.programs': {\n caption: 'Programs'\n },\n 'renderer.info.render.calls': {\n caption: 'Calls'\n },\n 'renderer.info.render.triangles': {\n caption: 'Triangles',\n over: 1000\n },\n 'renderer.info.render.points': {\n caption: 'Points'\n }\n };\n\n var _groups = [ {\n caption: 'Three.js - Memory',\n values: [ 'renderer.info.memory.geometries', 'renderer.info.programs', 'renderer.info.memory.textures' ]\n }, {\n caption: 'Three.js - Render',\n values: [ 'renderer.info.render.calls', 'renderer.info.render.triangles', 'renderer.info.render.points' ]\n } ];\n\n var _fractions = [];\n\n function _update () {\n\n _rS( 'renderer.info.memory.geometries' ).set( renderer.info.memory.geometries );\n _rS( 'renderer.info.programs' ).set( renderer.info.programs.length );\n _rS( 'renderer.info.memory.textures' ).set( renderer.info.memory.textures );\n _rS( 'renderer.info.render.calls' ).set( renderer.info.render.calls );\n _rS( 'renderer.info.render.triangles' ).set( renderer.info.render.triangles );\n _rS( 'renderer.info.render.points' ).set( renderer.info.render.points );\n\n }\n\n function _start () {}\n\n function _end () {}\n\n function _attach ( r ) {\n _rS = r;\n }\n\n return {\n update: _update,\n start: _start,\n end: _end,\n attach: _attach,\n values: _values,\n groups: _groups,\n fractions: _fractions\n };\n\n};\n\n/*\n * From https://github.com/paulirish/memory-stats.js\n */\n\nwindow.BrowserStats = function () {\n\n var _rS = null;\n\n var _usedJSHeapSize = 0,\n _totalJSHeapSize = 0;\n\n if ( window.performance && !performance.memory ) {\n performance.memory = {\n usedJSHeapSize: 0,\n totalJSHeapSize: 0\n };\n }\n\n if ( performance.memory.totalJSHeapSize === 0 ) {\n console.warn( 'totalJSHeapSize === 0... performance.memory is only available in Chrome .' );\n }\n\n var _values = {\n memory: {\n caption: 'Used Memory',\n average: true,\n avgMs: 1000,\n over: 22\n },\n total: {\n caption: 'Total Memory'\n }\n };\n\n var _groups = [ {\n caption: 'Browser',\n values: [ 'memory', 'total' ]\n } ];\n\n var _fractions = [ {\n base: 'total',\n steps: [ 'memory' ]\n } ];\n\n var log1024 = Math.log( 1024 );\n\n function _size ( v ) {\n\n var precision = 100; //Math.pow(10, 2);\n var i = Math.floor( Math.log( v ) / log1024 );\n return Math.round( v * precision / Math.pow( 1024, i ) ) / precision; // + ' ' + sizes[i];\n\n }\n\n function _update () {\n _usedJSHeapSize = _size( performance.memory.usedJSHeapSize );\n _totalJSHeapSize = _size( performance.memory.totalJSHeapSize );\n\n _rS( 'memory' ).set( _usedJSHeapSize );\n _rS( 'total' ).set( _totalJSHeapSize );\n }\n\n function _start () {\n _usedJSHeapSize = 0;\n }\n\n function _end () {}\n\n function _attach ( r ) {\n _rS = r;\n }\n\n return {\n update: _update,\n start: _start,\n end: _end,\n attach: _attach,\n values: _values,\n groups: _groups,\n fractions: _fractions\n };\n\n};\n\nif (typeof module === 'object') {\n module.exports = {\n glStats: window.glStats,\n threeStats: window.threeStats,\n BrowserStats: window.BrowserStats\n };\n}\n","// performance.now() polyfill from https://gist.github.com/paulirish/5438650\n'use strict';\n\n( function () {\n\n if ( 'performance' in window == false ) {\n window.performance = {};\n }\n\n var performance = window.performance;\n\n if ( 'now' in performance == false ) {\n\n var nowOffset = Date.now();\n\n if ( performance.timing && performance.timing.navigationStart ) {\n nowOffset = performance.timing.navigationStart;\n }\n\n performance.now = function now () {\n return Date.now() - nowOffset;\n };\n\n }\n\n if( !performance.mark ) {\n performance.mark = function(){}\n }\n\n if( !performance.measure ) {\n performance.measure = function(){}\n }\n\n} )();\n\nwindow.rStats = function rStats ( settings ) {\n\n function iterateKeys ( array, callback ) {\n var keys = Object.keys( array );\n for ( var j = 0, l = keys.length; j < l; j++ ) {\n callback( keys[ j ] );\n }\n }\n\n function importCSS ( url ) {\n\n var element = document.createElement( 'link' );\n element.href = url;\n element.rel = 'stylesheet';\n element.type = 'text/css';\n document.getElementsByTagName( 'head' )[ 0 ].appendChild( element );\n\n }\n\n var _settings = settings || {};\n var _colours = _settings.colours || [ '#850700', '#c74900', '#fcb300', '#284280', '#4c7c0c' ];\n\n var _cssFont = 'https://fonts.googleapis.com/css?family=Roboto+Condensed:400,700,300';\n var _cssRStats = ( _settings.CSSPath ? _settings.CSSPath : '' ) + 'rStats.css';\n\n var _css = _settings.css || [ _cssFont, _cssRStats ];\n _css.forEach(function (uri) {\n importCSS( uri );\n });\n\n if ( !_settings.values ) _settings.values = {};\n\n var _base, _div, _elHeight = 10, _elWidth = 200;\n var _perfCounters = {};\n\n\n function Graph ( _dom, _id, _defArg ) {\n\n var _def = _defArg || {};\n var _canvas = document.createElement( 'canvas' ),\n _ctx = _canvas.getContext( '2d' ),\n _max = 0,\n _current = 0;\n\n var c = _def.color ? _def.color : '#666666';\n\n var _dotCanvas = document.createElement( 'canvas' ),\n _dotCtx = _dotCanvas.getContext( '2d' );\n _dotCanvas.width = 1;\n _dotCanvas.height = 2 * _elHeight;\n _dotCtx.fillStyle = '#444444';\n _dotCtx.fillRect( 0, 0, 1, 2 * _elHeight );\n _dotCtx.fillStyle = c;\n _dotCtx.fillRect( 0, _elHeight, 1, _elHeight );\n _dotCtx.fillStyle = '#ffffff';\n _dotCtx.globalAlpha = 0.5;\n _dotCtx.fillRect( 0, _elHeight, 1, 1 );\n _dotCtx.globalAlpha = 1;\n\n var _alarmCanvas = document.createElement( 'canvas' ),\n _alarmCtx = _alarmCanvas.getContext( '2d' );\n _alarmCanvas.width = 1;\n _alarmCanvas.height = 2 * _elHeight;\n _alarmCtx.fillStyle = '#444444';\n _alarmCtx.fillRect( 0, 0, 1, 2 * _elHeight );\n _alarmCtx.fillStyle = '#b70000';\n _alarmCtx.fillRect( 0, _elHeight, 1, _elHeight );\n _alarmCtx.globalAlpha = 0.5;\n _alarmCtx.fillStyle = '#ffffff';\n _alarmCtx.fillRect( 0, _elHeight, 1, 1 );\n _alarmCtx.globalAlpha = 1;\n\n function _init () {\n\n _canvas.width = _elWidth;\n _canvas.height = _elHeight;\n _canvas.style.width = _canvas.width + 'px';\n _canvas.style.height = _canvas.height + 'px';\n _canvas.className = 'rs-canvas';\n _dom.appendChild( _canvas );\n\n _ctx.fillStyle = '#444444';\n _ctx.fillRect( 0, 0, _canvas.width, _canvas.height );\n\n }\n\n function _draw ( v, alarm ) {\n _current += ( v - _current ) * 0.1;\n _max *= 0.99;\n if ( _current > _max ) _max = _current;\n _ctx.drawImage( _canvas, 1, 0, _canvas.width - 1, _canvas.height, 0, 0, _canvas.width - 1, _canvas.height );\n if ( alarm ) {\n _ctx.drawImage( _alarmCanvas, _canvas.width - 1, _canvas.height - _current * _canvas.height / _max - _elHeight );\n } else {\n _ctx.drawImage( _dotCanvas, _canvas.width - 1, _canvas.height - _current * _canvas.height / _max - _elHeight );\n }\n }\n\n _init();\n\n return {\n draw: _draw\n };\n\n }\n\n function StackGraph ( _dom, _num ) {\n\n var _canvas = document.createElement( 'canvas' ),\n _ctx = _canvas.getContext( '2d' );\n\n function _init () {\n\n _canvas.width = _elWidth;\n _canvas.height = _elHeight * _num;\n _canvas.style.width = _canvas.width + 'px';\n _canvas.style.height = _canvas.height + 'px';\n _canvas.className = 'rs-canvas';\n _dom.appendChild( _canvas );\n\n _ctx.fillStyle = '#444444';\n _ctx.fillRect( 0, 0, _canvas.width, _canvas.height );\n\n }\n\n function _draw ( v ) {\n _ctx.drawImage( _canvas, 1, 0, _canvas.width - 1, _canvas.height, 0, 0, _canvas.width - 1, _canvas.height );\n var th = 0;\n iterateKeys( v, function ( j ) {\n var h = v[ j ] * _canvas.height;\n _ctx.fillStyle = _colours[ j ];\n _ctx.fillRect( _canvas.width - 1, th, 1, h );\n th += h;\n } );\n }\n\n _init();\n\n return {\n draw: _draw\n };\n\n }\n\n function PerfCounter ( id, group ) {\n\n var _id = id,\n _time,\n _value = 0,\n _total = 0,\n _averageValue = 0,\n _accumValue = 0,\n _accumStart = performance.now(),\n _accumSamples = 0,\n _dom = document.createElement( 'div' ),\n _spanId = document.createElement( 'span' ),\n _spanValue = document.createElement( 'div' ),\n _spanValueText = document.createTextNode( '' ),\n _def = _settings ? _settings.values[ _id.toLowerCase() ] : null,\n _graph = new Graph( _dom, _id, _def ),\n _started = false;\n\n _spanId.className = 'rs-counter-id';\n _spanId.textContent = ( _def && _def.caption ) ? _def.caption : _id;\n\n _spanValue.className = 'rs-counter-value';\n _spanValue.appendChild( _spanValueText );\n\n _dom.appendChild( _spanId );\n _dom.appendChild( _spanValue );\n if ( group ) group.div.appendChild( _dom );\n else _div.appendChild( _dom );\n\n _time = performance.now();\n\n function _average ( v ) {\n if ( _def && _def.average ) {\n _accumValue += v;\n _accumSamples++;\n var t = performance.now();\n if ( t - _accumStart >= ( _def.avgMs || 1000 ) ) {\n _averageValue = _accumValue / _accumSamples;\n _accumValue = 0;\n _accumStart = t;\n _accumSamples = 0;\n }\n }\n }\n\n function _start () {\n _time = performance.now();\n if( _settings.userTimingAPI ) performance.mark( _id + '-start' );\n _started = true;\n }\n\n function _end () {\n _value = performance.now() - _time;\n if( _settings.userTimingAPI ) {\n performance.mark( _id + '-end' );\n if( _started ) {\n performance.measure( _id, _id + '-start', _id + '-end' );\n }\n }\n _average( _value );\n }\n\n function _tick () {\n _end();\n _start();\n }\n\n function _draw () {\n var v = ( _def && _def.average ) ? _averageValue : _value;\n _spanValueText.nodeValue = Math.round( v * 100 ) / 100;\n var a = ( _def && ( ( _def.below && _value < _def.below ) || ( _def.over && _value > _def.over ) ) );\n _graph.draw( _value, a );\n _dom.className = a ? 'rs-counter-base alarm' : 'rs-counter-base';\n\n }\n\n function _frame () {\n var t = performance.now();\n var e = t - _time;\n _total++;\n if ( e > 1000 ) {\n if ( _def && _def.interpolate === false ) {\n _value = _total;\n } else {\n _value = _total * 1000 / e;\n }\n _total = 0;\n _time = t;\n _average( _value );\n }\n }\n\n function _set ( v ) {\n _value = v;\n _average( _value );\n }\n\n return {\n set: _set,\n start: _start,\n tick: _tick,\n end: _end,\n frame: _frame,\n value: function () {\n return _value;\n },\n draw: _draw\n };\n\n }\n\n function sample () {\n\n var _value = 0;\n\n function _set ( v ) {\n _value = v;\n }\n\n return {\n set: _set,\n value: function () {\n return _value;\n }\n };\n\n }\n\n function _perf ( idArg ) {\n\n var id = idArg.toLowerCase();\n if ( id === undefined ) id = 'default';\n if ( _perfCounters[ id ] ) return _perfCounters[ id ];\n\n var group = null;\n if ( _settings && _settings.groups ) {\n iterateKeys( _settings.groups, function ( j ) {\n var g = _settings.groups[ parseInt( j, 10 ) ];\n if ( !group && g.values.indexOf( id.toLowerCase() ) !== -1 ) {\n group = g;\n }\n } );\n }\n\n var p = new PerfCounter( id, group );\n _perfCounters[ id ] = p;\n return p;\n\n }\n\n function _init () {\n\n if ( _settings.plugins ) {\n if ( !_settings.values ) _settings.values = {};\n if ( !_settings.groups ) _settings.groups = [];\n if ( !_settings.fractions ) _settings.fractions = [];\n for ( var j = 0; j < _settings.plugins.length; j++ ) {\n _settings.plugins[ j ].attach( _perf );\n iterateKeys( _settings.plugins[ j ].values, function ( k ) {\n _settings.values[ k ] = _settings.plugins[ j ].values[ k ];\n } );\n _settings.groups = _settings.groups.concat( _settings.plugins[ j ].groups );\n _settings.fractions = _settings.fractions.concat( _settings.plugins[ j ].fractions );\n }\n } else {\n _settings.plugins = {};\n }\n\n _base = document.createElement( 'div' );\n _base.className = 'rs-base';\n _div = document.createElement( 'div' );\n _div.className = 'rs-container';\n _div.style.height = 'auto';\n _base.appendChild( _div );\n document.body.appendChild( _base );\n\n if ( !_settings ) return;\n\n if ( _settings.groups ) {\n iterateKeys( _settings.groups, function ( j ) {\n var g = _settings.groups[ parseInt( j, 10 ) ];\n var div = document.createElement( 'div' );\n div.className = 'rs-group';\n g.div = div;\n var h1 = document.createElement( 'h1' );\n h1.textContent = g.caption;\n h1.addEventListener( 'click', function ( e ) {\n this.classList.toggle( 'hidden' );\n e.preventDefault();\n }.bind( div ) );\n _div.appendChild( h1 );\n _div.appendChild( div );\n } );\n }\n\n if ( _settings.fractions ) {\n iterateKeys( _settings.fractions, function ( j ) {\n var f = _settings.fractions[ parseInt( j, 10 ) ];\n var div = document.createElement( 'div' );\n div.className = 'rs-fraction';\n var legend = document.createElement( 'div' );\n legend.className = 'rs-legend';\n\n var h = 0;\n iterateKeys( _settings.fractions[ j ].steps, function ( k ) {\n var p = document.createElement( 'p' );\n p.textContent = _settings.fractions[ j ].steps[ k ];\n p.style.color = _colours[ h ];\n legend.appendChild( p );\n h++;\n } );\n div.appendChild( legend );\n div.style.height = h * _elHeight + 'px';\n f.div = div;\n var graph = new StackGraph( div, h );\n f.graph = graph;\n _div.appendChild( div );\n } );\n }\n\n }\n\n function _update () {\n\n iterateKeys( _settings.plugins, function ( j ) {\n _settings.plugins[ j ].update();\n } );\n\n iterateKeys( _perfCounters, function ( j ) {\n _perfCounters[ j ].draw();\n } );\n\n if ( _settings && _settings.fractions ) {\n iterateKeys( _settings.fractions, function ( j ) {\n var f = _settings.fractions[ parseInt( j, 10 ) ];\n var v = [];\n var base = _perfCounters[ f.base.toLowerCase() ];\n if ( base ) {\n base = base.value();\n iterateKeys( _settings.fractions[ j ].steps, function ( k ) {\n var s = _settings.fractions[ j ].steps[ parseInt( k, 10 ) ].toLowerCase();\n var val = _perfCounters[ s ];\n if ( val ) {\n v.push( val.value() / base );\n }\n } );\n }\n f.graph.draw( v );\n } );\n }\n\n /*if( _height != _div.clientHeight ) {\n _height = _div.clientHeight;\n _base.style.height = _height + 2 * _elHeight + 'px';\n console.log( _base.clientHeight );\n }*/\n\n }\n\n _init();\n\n return function ( id ) {\n if ( id ) return _perf( id );\n return {\n element: _base,\n update: _update\n };\n };\n\n}\n\nif (typeof module === 'object') {\n module.exports = window.rStats;\n}\n","// https://stackoverflow.com/a/36213464\nif (!String.prototype.startsWith) {\n String.prototype.startsWith = function(searchString, position){\n position = position || 0;\n return this.substr(position, searchString.length) === searchString;\n };\n}\n","/*\n * Copyright 2015 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nvar Util = {};\n\nUtil.base64 = function(mimeType, base64) {\n return 'data:' + mimeType + ';base64,' + base64;\n};\n\nUtil.isMobile = function() {\n var check = false;\n (function(a){if(/(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i.test(a.substr(0,4)))check = true})(navigator.userAgent||navigator.vendor||window.opera);\n return check;\n};\n\nUtil.isIOS = function() {\n return /(iPad|iPhone|iPod)/g.test(navigator.userAgent);\n};\n\nUtil.isIFrame = function() {\n try {\n return window.self !== window.top;\n } catch (e) {\n return true;\n }\n};\n\nUtil.appendQueryParameter = function(url, key, value) {\n // Determine delimiter based on if the URL already GET parameters in it.\n var delimiter = (url.indexOf('?') < 0 ? '?' : '&');\n url += delimiter + key + '=' + value;\n return url;\n};\n\n// From http://goo.gl/4WX3tg\nUtil.getQueryParameter = function(name) {\n name = name.replace(/[\\[]/, \"\\\\[\").replace(/[\\]]/, \"\\\\]\");\n var regex = new RegExp(\"[\\\\?&]\" + name + \"=([^&#]*)\"),\n results = regex.exec(location.search);\n return results === null ? \"\" : decodeURIComponent(results[1].replace(/\\+/g, \" \"));\n};\n\nUtil.isLandscapeMode = function() {\n return (window.orientation == 90 || window.orientation == -90);\n};\n\n\nmodule.exports = Util;\n","/*\n * Copyright 2015 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nvar Util = require('./util.js');\n\n/**\n * Android and iOS compatible wakelock implementation.\n *\n * Refactored thanks to dkovalev@.\n */\nfunction AndroidWakeLock() {\n var video = document.createElement('video');\n\n video.addEventListener('ended', function() {\n video.play();\n });\n\n this.request = function() {\n if (video.paused) {\n // Base64 version of videos_src/no-sleep-60s.webm.\n video.src = Util.base64('video/webm', 'GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4ECQoWBAhhTgGcBAAAAAAAH4xFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwTbuMU6uEHFO7a1OsggfG7AEAAAAAAACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmAQAAAAAAAEUq17GDD0JATYCNTGF2ZjU2LjQwLjEwMVdBjUxhdmY1Ni40MC4xMDFzpJAGSJTMbsLpDt/ySkipgX1fRImIQO1MAAAAAAAWVK5rAQAAAAAAADuuAQAAAAAAADLXgQFzxYEBnIEAIrWcg3VuZIaFVl9WUDmDgQEj44OEO5rKAOABAAAAAAAABrCBsLqBkB9DtnUBAAAAAAAAo+eBAKOmgQAAgKJJg0IAAV4BHsAHBIODCoAACmH2MAAAZxgz4dPSTFi5JACjloED6ACmAECSnABMQAADYAAAWi0quoCjloEH0ACmAECSnABNwAADYAAAWi0quoCjloELuACmAECSnABNgAADYAAAWi0quoCjloEPoACmAECSnABNYAADYAAAWi0quoCjloETiACmAECSnABNIAADYAAAWi0quoAfQ7Z1AQAAAAAAAJTnghdwo5aBAAAApgBAkpwATOAAA2AAAFotKrqAo5aBA+gApgBAkpwATMAAA2AAAFotKrqAo5aBB9AApgBAkpwATIAAA2AAAFotKrqAo5aBC7gApgBAkpwATEAAA2AAAFotKrqAo5aBD6AApgDAkpwAQ2AAA2AAAFotKrqAo5aBE4gApgBAkpwATCAAA2AAAFotKrqAH0O2dQEAAAAAAACU54Iu4KOWgQAAAKYAQJKcAEvAAANgAABaLSq6gKOWgQPoAKYAQJKcAEtgAANgAABaLSq6gKOWgQfQAKYAQJKcAEsAAANgAABaLSq6gKOWgQu4AKYAQJKcAEqAAANgAABaLSq6gKOWgQ+gAKYAQJKcAEogAANgAABaLSq6gKOWgROIAKYAQJKcAEnAAANgAABaLSq6gB9DtnUBAAAAAAAAlOeCRlCjloEAAACmAECSnABJgAADYAAAWi0quoCjloED6ACmAECSnABJIAADYAAAWi0quoCjloEH0ACmAMCSnABDYAADYAAAWi0quoCjloELuACmAECSnABI4AADYAAAWi0quoCjloEPoACmAECSnABIoAADYAAAWi0quoCjloETiACmAECSnABIYAADYAAAWi0quoAfQ7Z1AQAAAAAAAJTngl3Ao5aBAAAApgBAkpwASCAAA2AAAFotKrqAo5aBA+gApgBAkpwASAAAA2AAAFotKrqAo5aBB9AApgBAkpwAR8AAA2AAAFotKrqAo5aBC7gApgBAkpwAR4AAA2AAAFotKrqAo5aBD6AApgBAkpwAR2AAA2AAAFotKrqAo5aBE4gApgBAkpwARyAAA2AAAFotKrqAH0O2dQEAAAAAAACU54J1MKOWgQAAAKYAwJKcAENgAANgAABaLSq6gKOWgQPoAKYAQJKcAEbgAANgAABaLSq6gKOWgQfQAKYAQJKcAEagAANgAABaLSq6gKOWgQu4AKYAQJKcAEaAAANgAABaLSq6gKOWgQ+gAKYAQJKcAEZAAANgAABaLSq6gKOWgROIAKYAQJKcAEYAAANgAABaLSq6gB9DtnUBAAAAAAAAlOeCjKCjloEAAACmAECSnABF4AADYAAAWi0quoCjloED6ACmAECSnABFwAADYAAAWi0quoCjloEH0ACmAECSnABFoAADYAAAWi0quoCjloELuACmAECSnABFgAADYAAAWi0quoCjloEPoACmAMCSnABDYAADYAAAWi0quoCjloETiACmAECSnABFYAADYAAAWi0quoAfQ7Z1AQAAAAAAAJTngqQQo5aBAAAApgBAkpwARUAAA2AAAFotKrqAo5aBA+gApgBAkpwARSAAA2AAAFotKrqAo5aBB9AApgBAkpwARQAAA2AAAFotKrqAo5aBC7gApgBAkpwARQAAA2AAAFotKrqAo5aBD6AApgBAkpwAROAAA2AAAFotKrqAo5aBE4gApgBAkpwARMAAA2AAAFotKrqAH0O2dQEAAAAAAACU54K7gKOWgQAAAKYAQJKcAESgAANgAABaLSq6gKOWgQPoAKYAQJKcAESAAANgAABaLSq6gKOWgQfQAKYAwJKcAENgAANgAABaLSq6gKOWgQu4AKYAQJKcAERgAANgAABaLSq6gKOWgQ+gAKYAQJKcAERAAANgAABaLSq6gKOWgROIAKYAQJKcAEQgAANgAABaLSq6gB9DtnUBAAAAAAAAlOeC0vCjloEAAACmAECSnABEIAADYAAAWi0quoCjloED6ACmAECSnABEAAADYAAAWi0quoCjloEH0ACmAECSnABD4AADYAAAWi0quoCjloELuACmAECSnABDwAADYAAAWi0quoCjloEPoACmAECSnABDoAADYAAAWi0quoCjloETiACmAECSnABDgAADYAAAWi0quoAcU7trAQAAAAAAABG7j7OBALeK94EB8YIBd/CBAw==');\n video.play();\n }\n };\n\n this.release = function() {\n video.pause();\n video.src = '';\n };\n}\n\nfunction iOSWakeLock() {\n var timer = null;\n\n this.request = function() {\n if (!timer) {\n timer = setInterval(function() {\n window.location.href = '/';\n setTimeout(window.stop, 0);\n }, 15000);\n }\n }\n\n this.release = function() {\n if (timer) {\n clearInterval(timer);\n timer = null;\n }\n }\n}\n\n\nfunction getWakeLock() {\n var userAgent = navigator.userAgent || navigator.vendor || window.opera;\n if (userAgent.match(/iPhone/i) || userAgent.match(/iPod/i)) {\n return iOSWakeLock;\n } else {\n return AndroidWakeLock;\n }\n}\n\nmodule.exports = getWakeLock();\n"]}