UNPKG

474 kBJavaScriptView Raw
1!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.GWebGPU=t():e.GWebGPU=t()}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=55)}([function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(12);t.METADATA_KEY=r;var i=n(62);t.Container=i.Container;var a=n(18);t.BindingScopeEnum=a.BindingScopeEnum,t.BindingTypeEnum=a.BindingTypeEnum,t.TargetTypeEnum=a.TargetTypeEnum;var o=n(78);t.AsyncContainerModule=o.AsyncContainerModule,t.ContainerModule=o.ContainerModule;var u=n(79);t.injectable=u.injectable;var s=n(80);t.tagged=s.tagged;var c=n(81);t.named=c.named;var f=n(38);t.inject=f.inject,t.LazyServiceIdentifer=f.LazyServiceIdentifer;var l=n(82);t.optional=l.optional;var p=n(83);t.unmanaged=p.unmanaged;var h=n(84);t.multiInject=h.multiInject;var d=n(85);t.targetName=d.targetName;var m=n(86);t.postConstruct=m.postConstruct;var y=n(36);t.MetadataReader=y.MetadataReader;var v=n(20);t.id=v.id;var g=n(19);t.decorate=g.decorate;var b=n(41);t.traverseAncerstors=b.traverseAncerstors,t.taggedConstraint=b.taggedConstraint,t.namedConstraint=b.namedConstraint,t.typeConstraint=b.typeConstraint;var A=n(22);t.getServiceIdentifierAsString=A.getServiceIdentifierAsString;var E=n(87);t.multiBindToService=E.multiBindToService},function(e,t,n){e.exports=n(60)},function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}},function(e,t){e.exports=function(e,t,n,r){n&&Object.defineProperty(e,t,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(r):void 0})}},function(e,t){e.exports=function(e,t,n,r,i){var a={};return Object.keys(r).forEach((function(e){a[e]=r[e]})),a.enumerable=!!a.enumerable,a.configurable=!!a.configurable,("value"in a||a.initializer)&&(a.writable=!0),a=n.slice().reverse().reduce((function(n,r){return r(e,t,n)||n}),a),i&&void 0!==a.initializer&&(a.value=a.initializer?a.initializer.call(i):void 0,a.initializer=void 0),void 0===a.initializer&&(Object.defineProperty(e,t,a),a=null),a}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.AnisotropicFiltering="anisotropic-filtering"}(t.ExtensionName||(t.ExtensionName={})),function(e){e.ClampToEdge="clamp-to-edge",e.Repeat="repeat",e.MirrorRepeat="mirror-repeat"}(t.AddressMode||(t.AddressMode={})),function(e){e.UniformBuffer="uniform-buffer",e.StorageBuffer="storage-buffer",e.ReadonlyStorageBuffer="readonly-storage-buffer",e.Sampler="sampler",e.SampledTexture="sampled-texture",e.StorageTexture="storage-texture"}(t.BindingType||(t.BindingType={})),function(e){e.Zero="zero",e.One="one",e.SrcColor="src-color",e.OneMinusSrcColor="one-minus-src-color",e.SrcAlpha="src-alpha",e.OneMinusSrcAlpha="one-minus-src-alpha",e.DstColor="dst-color",e.OneMinusDstColor="one-minus-dst-color",e.DstAlpha="dst-alpha",e.OneMinusDstAlpha="one-minus-dst-alpha",e.SrcAlphaSaturated="src-alpha-saturated",e.BlendColor="blend-color",e.OneMinusBlendColor="one-minus-blend-color"}(t.BlendFactor||(t.BlendFactor={})),function(e){e.Add="add",e.Subtract="subtract",e.ReverseSubtract="reverse-subtract",e.Min="min",e.Max="max"}(t.BlendOperation||(t.BlendOperation={})),function(e){e.Never="never",e.Less="less",e.Equal="equal",e.LessEqual="less-equal",e.Greater="greater",e.NotEqual="not-equal",e.GreaterEqual="greater-equal",e.Always="always"}(t.CompareFunction||(t.CompareFunction={})),function(e){e.None="none",e.Front="front",e.Back="back"}(t.CullMode||(t.CullMode={})),function(e){e.Nearest="nearest",e.Linear="linear"}(t.FilterMode||(t.FilterMode={})),function(e){e.CCW="ccw",e.CW="cw"}(t.FrontFace||(t.FrontFace={})),function(e){e.Uint16="uint16",e.Uint32="uint32"}(t.IndexFormat||(t.IndexFormat={})),function(e){e.Vertex="vertex",e.Instance="instance"}(t.InputStepMode||(t.InputStepMode={})),function(e){e.Load="load"}(t.LoadOp||(t.LoadOp={})),function(e){e.PointList="point-list",e.LineList="line-list",e.LineStrip="line-strip",e.TriangleList="triangle-list",e.TriangleStrip="triangle-strip"}(t.PrimitiveTopology||(t.PrimitiveTopology={})),function(e){e.Keep="keep",e.Zero="zero",e.Replace="replace",e.Invert="invert",e.IncrementClamp="increment-clamp",e.DecrementClamp="decrement-clamp",e.IncrementWrap="increment-wrap",e.DecrementWrap="decrement-wrap"}(t.StencilOperation||(t.StencilOperation={})),function(e){e.Store="store",e.Clear="clear"}(t.StoreOp||(t.StoreOp={})),function(e){e.E1d="1d",e.E2d="2d",e.E3d="3d"}(t.TextureDimension||(t.TextureDimension={})),function(e){e.R8Unorm="r8unorm",e.R8Snorm="r8snorm",e.R8Uint="r8uint",e.R8Sint="r8sint",e.R16Uint="r16uint",e.R16Sint="r16sint",e.R16Float="r16float",e.RG8Unorm="rg8unorm",e.RG8Snorm="rg8snorm",e.RG8Uint="rg8uint",e.RG8Sint="rg8sint",e.R32Uint="r32uint",e.R32Sint="r32sint",e.R32Float="r32float",e.RG16Uint="rg16uint",e.RG16Sint="rg16sint",e.RG16Float="rg16float",e.RGBA8Unorm="rgba8unorm",e.RGBA8UnormSRGB="rgba8unorm-srgb",e.RGBA8Snorm="rgba8snorm",e.RGBA8Uint="rgba8uint",e.RGBA8Sint="rgba8sint",e.BGRA8Unorm="bgra8unorm",e.BGRA8UnormSRGB="bgra8unorm-srgb",e.RGB10A2Unorm="rgb10a2unorm",e.RGB11B10Float="rg11b10float",e.RG32Uint="rg32uint",e.RG32Sint="rg32sint",e.RG32Float="rg32float",e.RGBA16Uint="rgba16uint",e.RGBA16Sint="rgba16sint",e.RGBA16Float="rgba16float",e.RGBA32Uint="rgba32uint",e.RGBA32Sint="rgba32sint",e.RGBA32Float="rgba32float",e.Depth32Float="depth32float",e.Depth24Plus="depth24plus",e.Depth24PlusStencil8="depth24plus-stencil8"}(t.TextureFormat||(t.TextureFormat={})),function(e){e.Float="float",e.Sint="sint",e.Uint="uint"}(t.TextureComponentType||(t.TextureComponentType={})),function(e){e.E1d="1d",e.E2d="2d",e.E2dArray="2d-array",e.Cube="cube",e.CubeArray="cube-array",e.E3d="3d"}(t.TextureViewDimension||(t.TextureViewDimension={})),function(e){e.Uchar2="uchar2",e.Uchar4="uchar4",e.Char2="char2",e.Char4="char4",e.Uchar2Norm="uchar2norm",e.Uchar4Norm="uchar4norm",e.Char2Norm="char2norm",e.Char4Norm="char4norm",e.Ushort2="ushort2",e.Ushort4="ushort4",e.Short2="short2",e.Short4="short4",e.Ushort2Norm="ushort2norm",e.Ushort4Norm="ushort4norm",e.Short2Norm="short2norm",e.Short4Norm="short4norm",e.Half2="half2",e.Half4="half4",e.Float="float",e.Float2="float2",e.Float3="float3",e.Float4="float4",e.Uint="uint",e.Uint2="uint2",e.Uint3="uint3",e.Uint4="uint4",e.Int="int",e.Int2="int2",e.Int3="int3",e.Int4="int4"}(t.VertexFormat||(t.VertexFormat={})),function(e){e.All="all",e.StencilOnly="stencil-only",e.DepthOnly="depth-only"}(t.TextureAspect||(t.TextureAspect={})),function(e){e[e.MapRead=1]="MapRead",e[e.MapWrite=2]="MapWrite",e[e.CopySrc=4]="CopySrc",e[e.CopyDst=8]="CopyDst",e[e.Index=16]="Index",e[e.Vertex=32]="Vertex",e[e.Uniform=64]="Uniform",e[e.Storage=128]="Storage",e[e.Indirect=256]="Indirect"}(t.BufferUsage||(t.BufferUsage={})),function(e){e[e.Red=1]="Red",e[e.Green=2]="Green",e[e.Blue=4]="Blue",e[e.Alpha=8]="Alpha",e[e.All=15]="All"}(t.ColorWrite||(t.ColorWrite={})),function(e){e[e.Vertex=1]="Vertex",e[e.Fragment=2]="Fragment",e[e.Compute=4]="Compute"}(t.ShaderStage||(t.ShaderStage={})),function(e){e[e.CopySrc=1]="CopySrc",e[e.CopyDst=2]="CopyDst",e[e.Sampled=4]="Sampled",e[e.Storage=8]="Storage",e[e.OutputAttachment=16]="OutputAttachment"}(t.TextureUsage||(t.TextureUsage={}))},function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},n(t)}e.exports=n},function(e,t){function n(e,t,n,r,i,a,o){try{var u=e[a](o),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,i)}e.exports=function(e){return function(){var t=this,r=arguments;return new Promise((function(i,a){var o=e.apply(t,r);function u(e){n(o,i,a,u,s,"next",e)}function s(e){n(o,i,a,u,s,"throw",e)}u(void 0)}))}}},function(e,t,n){var r=n(29);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}},function(e,t,n){var r=n(93),i=n(13);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?i(e):t}},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NAMED_TAG="named",t.NAME_TAG="name",t.UNMANAGED_TAG="unmanaged",t.OPTIONAL_TAG="optional",t.INJECT_TAG="inject",t.MULTI_INJECT_TAG="multi_inject",t.TAGGED="inversify:tagged",t.TAGGED_PROP="inversify:tagged_props",t.PARAM_TYPES="inversify:paramtypes",t.DESIGN_PARAM_TYPES="design:paramtypes",t.POST_CONSTRUCT="post_construct"},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DUPLICATED_INJECTABLE_DECORATOR="Cannot apply @injectable decorator multiple times.",t.DUPLICATED_METADATA="Metadata key was used more than once in a parameter:",t.NULL_ARGUMENT="NULL argument",t.KEY_NOT_FOUND="Key Not Found",t.AMBIGUOUS_MATCH="Ambiguous match found for serviceIdentifier:",t.CANNOT_UNBIND="Could not unbind serviceIdentifier:",t.NOT_REGISTERED="No matching bindings found for serviceIdentifier:",t.MISSING_INJECTABLE_ANNOTATION="Missing required @injectable annotation in:",t.MISSING_INJECT_ANNOTATION="Missing required @inject or @multiInject annotation in:",t.UNDEFINED_INJECT_ANNOTATION=function(e){return"@inject called with undefined this could mean that the class "+e+" has a circular dependency problem. You can use a LazyServiceIdentifer to overcome this limitation."},t.CIRCULAR_DEPENDENCY="Circular dependency found:",t.NOT_IMPLEMENTED="Sorry, this feature is not fully implemented yet.",t.INVALID_BINDING_TYPE="Invalid binding type:",t.NO_MORE_SNAPSHOTS_AVAILABLE="No snapshot available to restore.",t.INVALID_MIDDLEWARE_RETURN="Invalid return type in middleware. Middleware must return!",t.INVALID_FUNCTION_BINDING="Value provided to function binding must be a function!",t.INVALID_TO_SELF_VALUE="The toSelf function can only be applied when a constructor is used as service identifier",t.INVALID_DECORATOR_OPERATION="The @inject @multiInject @tagged and @named decorators must be applied to the parameters of a class constructor or a class property.",t.ARGUMENTS_LENGTH_MISMATCH=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return"The number of constructor arguments in the derived class "+e[0]+" must be >= than the number of constructor arguments of its base class."},t.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT="Invalid Container constructor argument. Container options must be an object.",t.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE="Invalid Container option. Default scope must be a string ('singleton' or 'transient').",t.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE="Invalid Container option. Auto bind injectable must be a boolean",t.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK="Invalid Container option. Skip base check must be a boolean",t.MULTIPLE_POST_CONSTRUCT_METHODS="Cannot apply @postConstruct decorator multiple times in the same class",t.POST_CONSTRUCT_ERROR=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return"@postConstruct error in class "+e[0]+": "+e[1]},t.CIRCULAR_DEPENDENCY_IN_FACTORY=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return"It looks like there is a circular dependency in one of the '"+e[0]+"' bindings. Please investigate bindings withservice identifier '"+e[1]+"'."},t.STACK_OVERFLOW="Maximum call stack size exceeded"},function(e,t){e.exports=function(e,t){throw new Error("Decorating class property failed. Please ensure that proposal-class-properties is enabled and runs after the decorators transform.")}},function(e,t,n){var r=n(88),i=n(89),a=n(42),o=n(90);e.exports=function(e,t){return r(e)||i(e,t)||a(e,t)||o()}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(12),i=function(){function e(e,t){this.key=e,this.value=t}return e.prototype.toString=function(){return this.key===r.NAMED_TAG?"named: "+this.value.toString()+" ":"tagged: { key:"+this.key.toString()+", value: "+this.value+" }"},e}();t.Metadata=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.BindingScopeEnum={Request:"Request",Singleton:"Singleton",Transient:"Transient"};t.BindingTypeEnum={ConstantValue:"ConstantValue",Constructor:"Constructor",DynamicValue:"DynamicValue",Factory:"Factory",Function:"Function",Instance:"Instance",Invalid:"Invalid",Provider:"Provider"};t.TargetTypeEnum={ClassProperty:"ClassProperty",ConstructorArgument:"ConstructorArgument",Variable:"Variable"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(14),i=n(12);function a(e,t,n,i,a){var o={},u="number"==typeof a,s=void 0!==a&&u?a.toString():n;if(u&&void 0!==n)throw new Error(r.INVALID_DECORATOR_OPERATION);Reflect.hasOwnMetadata(e,t)&&(o=Reflect.getMetadata(e,t));var c=o[s];if(Array.isArray(c))for(var f=0,l=c;f<l.length;f++){var p=l[f];if(p.key===i.key)throw new Error(r.DUPLICATED_METADATA+" "+p.key.toString())}else c=[];c.push(i),o[s]=c,Reflect.defineMetadata(e,o,t)}function o(e,t){Reflect.decorate(e,t)}function u(e,t){return function(n,r){t(n,r,e)}}t.tagParameter=function(e,t,n,r){a(i.TAGGED,e,t,r,n)},t.tagProperty=function(e,t,n){a(i.TAGGED_PROP,e.constructor,t,n)},t.decorate=function(e,t,n){"number"==typeof n?o([u(n,e)],t):"string"==typeof n?Reflect.decorate([e],t,n):o([e],t)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=0;t.id=function(){return r++}},function(e,t,n){var r=n(44).isFinite;e.exports=function(e){return"number"==typeof e&&r(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(14);function i(e){return"function"==typeof e?e.name:"symbol"==typeof e?e.toString():e}function a(e){if(e.name)return e.name;var t=e.toString(),n=t.match(/^function\s*([^\s(]+)/);return n?n[1]:"Anonymous function: "+t}t.getServiceIdentifierAsString=i,t.listRegisteredBindingsForServiceIdentifier=function(e,t,n){var r="",i=n(e,t);return 0!==i.length&&(r="\nRegistered bindings:",i.forEach((function(e){var t="Object";null!==e.implementationType&&(t=a(e.implementationType)),r=r+"\n "+t,e.constraint.metaData&&(r=r+" - "+e.constraint.metaData)}))),r},t.circularDependencyToException=function e(t){t.childRequests.forEach((function(t){if(function e(t,n){return null!==t.parentRequest&&(t.parentRequest.serviceIdentifier===n||e(t.parentRequest,n))}(t,t.serviceIdentifier)){var n=function(e){return function e(t,n){void 0===n&&(n=[]);var r=i(t.serviceIdentifier);return n.push(r),null!==t.parentRequest?e(t.parentRequest,n):n}(e).reverse().join(" --\x3e ")}(t);throw new Error(r.CIRCULAR_DEPENDENCY+" "+n)}e(t)}))},t.listMetadataForTarget=function(e,t){if(t.isTagged()||t.isNamed()){var n="",r=t.getNamedTag(),i=t.getCustomTags();return null!==r&&(n+=r.toString()+"\n"),null!==i&&i.forEach((function(e){n+=e.toString()+"\n"}))," "+e+"\n "+e+" - "+n}return" "+e},t.getFunctionName=a},function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}},function(e,t,n){var r=n(28),i=n(91),a=n(92),o=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":o&&o in Object(e)?i(e):a(e)}},function(e,t,n){var r=n(103),i=n(104),a=n(42),o=n(105);e.exports=function(e){return r(e)||i(e)||a(e)||o()}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(27),i=function(){function e(e){this._binding=e}return e.prototype.onActivation=function(e){return this._binding.onActivation=e,new r.BindingWhenSyntax(this._binding)},e}();t.BindingOnSyntax=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(26),i=n(41),a=function(){function e(e){this._binding=e}return e.prototype.when=function(e){return this._binding.constraint=e,new r.BindingOnSyntax(this._binding)},e.prototype.whenTargetNamed=function(e){return this._binding.constraint=i.namedConstraint(e),new r.BindingOnSyntax(this._binding)},e.prototype.whenTargetIsDefault=function(){return this._binding.constraint=function(e){return null!==e.target&&!e.target.isNamed()&&!e.target.isTagged()},new r.BindingOnSyntax(this._binding)},e.prototype.whenTargetTagged=function(e,t){return this._binding.constraint=i.taggedConstraint(e)(t),new r.BindingOnSyntax(this._binding)},e.prototype.whenInjectedInto=function(e){return this._binding.constraint=function(t){return i.typeConstraint(e)(t.parentRequest)},new r.BindingOnSyntax(this._binding)},e.prototype.whenParentNamed=function(e){return this._binding.constraint=function(t){return i.namedConstraint(e)(t.parentRequest)},new r.BindingOnSyntax(this._binding)},e.prototype.whenParentTagged=function(e,t){return this._binding.constraint=function(n){return i.taggedConstraint(e)(t)(n.parentRequest)},new r.BindingOnSyntax(this._binding)},e.prototype.whenAnyAncestorIs=function(e){return this._binding.constraint=function(t){return i.traverseAncerstors(t,i.typeConstraint(e))},new r.BindingOnSyntax(this._binding)},e.prototype.whenNoAncestorIs=function(e){return this._binding.constraint=function(t){return!i.traverseAncerstors(t,i.typeConstraint(e))},new r.BindingOnSyntax(this._binding)},e.prototype.whenAnyAncestorNamed=function(e){return this._binding.constraint=function(t){return i.traverseAncerstors(t,i.namedConstraint(e))},new r.BindingOnSyntax(this._binding)},e.prototype.whenNoAncestorNamed=function(e){return this._binding.constraint=function(t){return!i.traverseAncerstors(t,i.namedConstraint(e))},new r.BindingOnSyntax(this._binding)},e.prototype.whenAnyAncestorTagged=function(e,t){return this._binding.constraint=function(n){return i.traverseAncerstors(n,i.taggedConstraint(e)(t))},new r.BindingOnSyntax(this._binding)},e.prototype.whenNoAncestorTagged=function(e,t){return this._binding.constraint=function(n){return!i.traverseAncerstors(n,i.taggedConstraint(e)(t))},new r.BindingOnSyntax(this._binding)},e.prototype.whenAnyAncestorMatches=function(e){return this._binding.constraint=function(t){return i.traverseAncerstors(t,e)},new r.BindingOnSyntax(this._binding)},e.prototype.whenNoAncestorMatches=function(e){return this._binding.constraint=function(t){return!i.traverseAncerstors(t,e)},new r.BindingOnSyntax(this._binding)},e}();t.BindingWhenSyntax=a},function(e,t,n){var r=n(44).Symbol;e.exports=r},function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(t,r)}e.exports=n},function(e,t){},function(e,t,n){var r=n(24),i=n(23);e.exports=function(e){return!0===e||!1===e||i(e)&&"[object Boolean]"==r(e)}},function(e,t,n){var r;
2/*! Hammer.JS - v2.0.7 - 2016-04-22
3 * http://hammerjs.github.io/
4 *
5 * Copyright (c) 2016 Jorik Tangelder;
6 * Licensed under the MIT license */!function(i,a,o,u){"use strict";var s,c=["","webkit","Moz","MS","ms","o"],f=a.createElement("div"),l=Math.round,p=Math.abs,h=Date.now;function d(e,t,n){return setTimeout(E(e,n),t)}function m(e,t,n){return!!Array.isArray(e)&&(y(e,n[t],n),!0)}function y(e,t,n){var r;if(e)if(e.forEach)e.forEach(t,n);else if(void 0!==e.length)for(r=0;r<e.length;)t.call(n,e[r],r,e),r++;else for(r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r,e)}function v(e,t,n){var r="DEPRECATED METHOD: "+t+"\n"+n+" AT \n";return function(){var t=new Error("get-stack-trace"),n=t&&t.stack?t.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",a=i.console&&(i.console.warn||i.console.log);return a&&a.call(i.console,r,n),e.apply(this,arguments)}}s="function"!=typeof Object.assign?function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(null!=r)for(var i in r)r.hasOwnProperty(i)&&(t[i]=r[i])}return t}:Object.assign;var g=v((function(e,t,n){for(var r=Object.keys(t),i=0;i<r.length;)(!n||n&&void 0===e[r[i]])&&(e[r[i]]=t[r[i]]),i++;return e}),"extend","Use `assign`."),b=v((function(e,t){return g(e,t,!0)}),"merge","Use `assign`.");function A(e,t,n){var r,i=t.prototype;(r=e.prototype=Object.create(i)).constructor=e,r._super=i,n&&s(r,n)}function E(e,t){return function(){return e.apply(t,arguments)}}function x(e,t){return"function"==typeof e?e.apply(t&&t[0]||void 0,t):e}function C(e,t){return void 0===e?t:e}function S(e,t,n){y(B(t),(function(t){e.addEventListener(t,n,!1)}))}function w(e,t,n){y(B(t),(function(t){e.removeEventListener(t,n,!1)}))}function T(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function D(e,t){return e.indexOf(t)>-1}function B(e){return e.trim().split(/\s+/g)}function _(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var r=0;r<e.length;){if(n&&e[r][n]==t||!n&&e[r]===t)return r;r++}return-1}function M(e){return Array.prototype.slice.call(e,0)}function F(e,t,n){for(var r=[],i=[],a=0;a<e.length;){var o=t?e[a][t]:e[a];_(i,o)<0&&r.push(e[a]),i[a]=o,a++}return n&&(r=t?r.sort((function(e,n){return e[t]>n[t]})):r.sort()),r}function O(e,t){for(var n,r,i=t[0].toUpperCase()+t.slice(1),a=0;a<c.length;){if((r=(n=c[a])?n+i:t)in e)return r;a++}}var k=1;function I(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow||i}var P="ontouchstart"in i,j=void 0!==O(i,"PointerEvent"),R=P&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),N=["x","y"],G=["clientX","clientY"];function L(e,t){var n=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){x(e.options.enable,[e])&&n.handler(t)},this.init()}function z(e,t,n){var r=n.pointers.length,i=n.changedPointers.length,a=1&t&&r-i==0,o=12&t&&r-i==0;n.isFirst=!!a,n.isFinal=!!o,a&&(e.session={}),n.eventType=t,function(e,t){var n=e.session,r=t.pointers,i=r.length;n.firstInput||(n.firstInput=V(t));i>1&&!n.firstMultiple?n.firstMultiple=V(t):1===i&&(n.firstMultiple=!1);var a=n.firstInput,o=n.firstMultiple,u=o?o.center:a.center,s=t.center=U(r);t.timeStamp=h(),t.deltaTime=t.timeStamp-a.timeStamp,t.angle=X(u,s),t.distance=H(u,s),function(e,t){var n=t.center,r=e.offsetDelta||{},i=e.prevDelta||{},a=e.prevInput||{};1!==t.eventType&&4!==a.eventType||(i=e.prevDelta={x:a.deltaX||0,y:a.deltaY||0},r=e.offsetDelta={x:n.x,y:n.y});t.deltaX=i.x+(n.x-r.x),t.deltaY=i.y+(n.y-r.y)}(n,t),t.offsetDirection=q(t.deltaX,t.deltaY);var c=W(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=c.x,t.overallVelocityY=c.y,t.overallVelocity=p(c.x)>p(c.y)?c.x:c.y,t.scale=o?(f=o.pointers,l=r,H(l[0],l[1],G)/H(f[0],f[1],G)):1,t.rotation=o?function(e,t){return X(t[1],t[0],G)+X(e[1],e[0],G)}(o.pointers,r):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,function(e,t){var n,r,i,a,o=e.lastInterval||t,u=t.timeStamp-o.timeStamp;if(8!=t.eventType&&(u>25||void 0===o.velocity)){var s=t.deltaX-o.deltaX,c=t.deltaY-o.deltaY,f=W(u,s,c);r=f.x,i=f.y,n=p(f.x)>p(f.y)?f.x:f.y,a=q(s,c),e.lastInterval=t}else n=o.velocity,r=o.velocityX,i=o.velocityY,a=o.direction;t.velocity=n,t.velocityX=r,t.velocityY=i,t.direction=a}(n,t);var f,l;var d=e.element;T(t.srcEvent.target,d)&&(d=t.srcEvent.target);t.target=d}(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function V(e){for(var t=[],n=0;n<e.pointers.length;)t[n]={clientX:l(e.pointers[n].clientX),clientY:l(e.pointers[n].clientY)},n++;return{timeStamp:h(),pointers:t,center:U(t),deltaX:e.deltaX,deltaY:e.deltaY}}function U(e){var t=e.length;if(1===t)return{x:l(e[0].clientX),y:l(e[0].clientY)};for(var n=0,r=0,i=0;i<t;)n+=e[i].clientX,r+=e[i].clientY,i++;return{x:l(n/t),y:l(r/t)}}function W(e,t,n){return{x:t/e||0,y:n/e||0}}function q(e,t){return e===t?1:p(e)>=p(t)?e<0?2:4:t<0?8:16}function H(e,t,n){n||(n=N);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.sqrt(r*r+i*i)}function X(e,t,n){n||(n=N);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return 180*Math.atan2(i,r)/Math.PI}L.prototype={handler:function(){},init:function(){this.evEl&&S(this.element,this.evEl,this.domHandler),this.evTarget&&S(this.target,this.evTarget,this.domHandler),this.evWin&&S(I(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&w(this.element,this.evEl,this.domHandler),this.evTarget&&w(this.target,this.evTarget,this.domHandler),this.evWin&&w(I(this.element),this.evWin,this.domHandler)}};var K={mousedown:1,mousemove:2,mouseup:4};function Y(){this.evEl="mousedown",this.evWin="mousemove mouseup",this.pressed=!1,L.apply(this,arguments)}A(Y,L,{handler:function(e){var t=K[e.type];1&t&&0===e.button&&(this.pressed=!0),2&t&&1!==e.which&&(t=4),this.pressed&&(4&t&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:"mouse",srcEvent:e}))}});var J={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},Q={2:"touch",3:"pen",4:"mouse",5:"kinect"},Z="pointerdown",$="pointermove pointerup pointercancel";function ee(){this.evEl=Z,this.evWin=$,L.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}i.MSPointerEvent&&!i.PointerEvent&&(Z="MSPointerDown",$="MSPointerMove MSPointerUp MSPointerCancel"),A(ee,L,{handler:function(e){var t=this.store,n=!1,r=e.type.toLowerCase().replace("ms",""),i=J[r],a=Q[e.pointerType]||e.pointerType,o="touch"==a,u=_(t,e.pointerId,"pointerId");1&i&&(0===e.button||o)?u<0&&(t.push(e),u=t.length-1):12&i&&(n=!0),u<0||(t[u]=e,this.callback(this.manager,i,{pointers:t,changedPointers:[e],pointerType:a,srcEvent:e}),n&&t.splice(u,1))}});var te={touchstart:1,touchmove:2,touchend:4,touchcancel:8};function ne(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,L.apply(this,arguments)}function re(e,t){var n=M(e.touches),r=M(e.changedTouches);return 12&t&&(n=F(n.concat(r),"identifier",!0)),[n,r]}A(ne,L,{handler:function(e){var t=te[e.type];if(1===t&&(this.started=!0),this.started){var n=re.call(this,e,t);12&t&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:"touch",srcEvent:e})}}});var ie={touchstart:1,touchmove:2,touchend:4,touchcancel:8};function ae(){this.evTarget="touchstart touchmove touchend touchcancel",this.targetIds={},L.apply(this,arguments)}function oe(e,t){var n=M(e.touches),r=this.targetIds;if(3&t&&1===n.length)return r[n[0].identifier]=!0,[n,n];var i,a,o=M(e.changedTouches),u=[],s=this.target;if(a=n.filter((function(e){return T(e.target,s)})),1===t)for(i=0;i<a.length;)r[a[i].identifier]=!0,i++;for(i=0;i<o.length;)r[o[i].identifier]&&u.push(o[i]),12&t&&delete r[o[i].identifier],i++;return u.length?[F(a.concat(u),"identifier",!0),u]:void 0}A(ae,L,{handler:function(e){var t=ie[e.type],n=oe.call(this,e,t);n&&this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:"touch",srcEvent:e})}});function ue(){L.apply(this,arguments);var e=E(this.handler,this);this.touch=new ae(this.manager,e),this.mouse=new Y(this.manager,e),this.primaryTouch=null,this.lastTouches=[]}function se(e,t){1&e?(this.primaryTouch=t.changedPointers[0].identifier,ce.call(this,t)):12&e&&ce.call(this,t)}function ce(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var n={x:t.clientX,y:t.clientY};this.lastTouches.push(n);var r=this.lastTouches;setTimeout((function(){var e=r.indexOf(n);e>-1&&r.splice(e,1)}),2500)}}function fe(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,r=0;r<this.lastTouches.length;r++){var i=this.lastTouches[r],a=Math.abs(t-i.x),o=Math.abs(n-i.y);if(a<=25&&o<=25)return!0}return!1}A(ue,L,{handler:function(e,t,n){var r="touch"==n.pointerType,i="mouse"==n.pointerType;if(!(i&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(r)se.call(this,t,n);else if(i&&fe.call(this,n))return;this.callback(e,t,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var le=O(f.style,"touchAction"),pe=void 0!==le,he=function(){if(!pe)return!1;var e={},t=i.CSS&&i.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach((function(n){e[n]=!t||i.CSS.supports("touch-action",n)})),e}();function de(e,t){this.manager=e,this.set(t)}de.prototype={set:function(e){"compute"==e&&(e=this.compute()),pe&&this.manager.element.style&&he[e]&&(this.manager.element.style[le]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var e=[];return y(this.manager.recognizers,(function(t){x(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))})),function(e){if(D(e,"none"))return"none";var t=D(e,"pan-x"),n=D(e,"pan-y");if(t&&n)return"none";if(t||n)return t?"pan-x":"pan-y";if(D(e,"manipulation"))return"manipulation";return"auto"}(e.join(" "))},preventDefaults:function(e){var t=e.srcEvent,n=e.offsetDirection;if(this.manager.session.prevented)t.preventDefault();else{var r=this.actions,i=D(r,"none")&&!he.none,a=D(r,"pan-y")&&!he["pan-y"],o=D(r,"pan-x")&&!he["pan-x"];if(i){var u=1===e.pointers.length,s=e.distance<2,c=e.deltaTime<250;if(u&&s&&c)return}if(!o||!a)return i||a&&6&n||o&&24&n?this.preventSrc(t):void 0}},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};function me(e){this.options=s({},this.defaults,e||{}),this.id=k++,this.manager=null,this.options.enable=C(this.options.enable,!0),this.state=1,this.simultaneous={},this.requireFail=[]}function ye(e){return 16&e?"cancel":8&e?"end":4&e?"move":2&e?"start":""}function ve(e){return 16==e?"down":8==e?"up":2==e?"left":4==e?"right":""}function ge(e,t){var n=t.manager;return n?n.get(e):e}function be(){me.apply(this,arguments)}function Ae(){be.apply(this,arguments),this.pX=null,this.pY=null}function Ee(){be.apply(this,arguments)}function xe(){me.apply(this,arguments),this._timer=null,this._input=null}function Ce(){be.apply(this,arguments)}function Se(){be.apply(this,arguments)}function we(){me.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function Te(e,t){return(t=t||{}).recognizers=C(t.recognizers,Te.defaults.preset),new De(e,t)}me.prototype={defaults:{},set:function(e){return s(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(m(e,"recognizeWith",this))return this;var t=this.simultaneous;return t[(e=ge(e,this)).id]||(t[e.id]=e,e.recognizeWith(this)),this},dropRecognizeWith:function(e){return m(e,"dropRecognizeWith",this)||(e=ge(e,this),delete this.simultaneous[e.id]),this},requireFailure:function(e){if(m(e,"requireFailure",this))return this;var t=this.requireFail;return-1===_(t,e=ge(e,this))&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(m(e,"dropRequireFailure",this))return this;e=ge(e,this);var t=_(this.requireFail,e);return t>-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){var t=this,n=this.state;function r(n){t.manager.emit(n,e)}n<8&&r(t.options.event+ye(n)),r(t.options.event),e.additionalEvent&&r(e.additionalEvent),n>=8&&r(t.options.event+ye(n))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=32},canEmit:function(){for(var e=0;e<this.requireFail.length;){if(!(33&this.requireFail[e].state))return!1;e++}return!0},recognize:function(e){var t=s({},e);if(!x(this.options.enable,[this,t]))return this.reset(),void(this.state=32);56&this.state&&(this.state=1),this.state=this.process(t),30&this.state&&this.tryEmit(t)},process:function(e){},getTouchAction:function(){},reset:function(){}},A(be,me,{defaults:{pointers:1},attrTest:function(e){var t=this.options.pointers;return 0===t||e.pointers.length===t},process:function(e){var t=this.state,n=e.eventType,r=6&t,i=this.attrTest(e);return r&&(8&n||!i)?16|t:r||i?4&n?8|t:2&t?4|t:2:32}}),A(Ae,be,{defaults:{event:"pan",threshold:10,pointers:1,direction:30},getTouchAction:function(){var e=this.options.direction,t=[];return 6&e&&t.push("pan-y"),24&e&&t.push("pan-x"),t},directionTest:function(e){var t=this.options,n=!0,r=e.distance,i=e.direction,a=e.deltaX,o=e.deltaY;return i&t.direction||(6&t.direction?(i=0===a?1:a<0?2:4,n=a!=this.pX,r=Math.abs(e.deltaX)):(i=0===o?1:o<0?8:16,n=o!=this.pY,r=Math.abs(e.deltaY))),e.direction=i,n&&r>t.threshold&&i&t.direction},attrTest:function(e){return be.prototype.attrTest.call(this,e)&&(2&this.state||!(2&this.state)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=ve(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),A(Ee,be,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return["none"]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),A(xe,me,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,i=e.deltaTime>t.time;if(this._input=e,!r||!n||12&e.eventType&&!i)this.reset();else if(1&e.eventType)this.reset(),this._timer=d((function(){this.state=8,this.tryEmit()}),t.time,this);else if(4&e.eventType)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&4&e.eventType?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=h(),this.manager.emit(this.options.event,this._input)))}}),A(Ce,be,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return["none"]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),A(Se,be,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return Ae.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return 30&n?t=e.overallVelocity:6&n?t=e.overallVelocityX:24&n&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&p(t)>this.options.velocity&&4&e.eventType},emit:function(e){var t=ve(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),A(we,me,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return["manipulation"]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,i=e.deltaTime<t.time;if(this.reset(),1&e.eventType&&0===this.count)return this.failTimeout();if(r&&i&&n){if(4!=e.eventType)return this.failTimeout();var a=!this.pTime||e.timeStamp-this.pTime<t.interval,o=!this.pCenter||H(this.pCenter,e.center)<t.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,o&&a?this.count+=1:this.count=1,this._input=e,0===this.count%t.taps)return this.hasRequireFailures()?(this._timer=d((function(){this.state=8,this.tryEmit()}),t.interval,this),2):8}return 32},failTimeout:function(){return this._timer=d((function(){this.state=32}),this.options.interval,this),32},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),Te.VERSION="2.0.7",Te.defaults={domEvents:!1,touchAction:"compute",enable:!0,inputTarget:null,inputClass:null,preset:[[Ce,{enable:!1}],[Ee,{enable:!1},["rotate"]],[Se,{direction:6}],[Ae,{direction:6},["swipe"]],[we],[we,{event:"doubletap",taps:2},["tap"]],[xe]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};function De(e,t){var n;this.options=s({},Te.defaults,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=new((n=this).options.inputClass||(j?ee:R?ae:P?ue:Y))(n,z),this.touchAction=new de(this,this.options.touchAction),Be(this,!0),y(this.options.recognizers,(function(e){var t=this.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])}),this)}function Be(e,t){var n,r=e.element;r.style&&(y(e.options.cssProps,(function(i,a){n=O(r.style,a),t?(e.oldCssProps[n]=r.style[n],r.style[n]=i):r.style[n]=e.oldCssProps[n]||""})),t||(e.oldCssProps={}))}De.prototype={set:function(e){return s(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},stop:function(e){this.session.stopped=e?2:1},recognize:function(e){var t=this.session;if(!t.stopped){var n;this.touchAction.preventDefaults(e);var r=this.recognizers,i=t.curRecognizer;(!i||i&&8&i.state)&&(i=t.curRecognizer=null);for(var a=0;a<r.length;)n=r[a],2===t.stopped||i&&n!=i&&!n.canRecognizeWith(i)?n.reset():n.recognize(e),!i&&14&n.state&&(i=t.curRecognizer=n),a++}},get:function(e){if(e instanceof me)return e;for(var t=this.recognizers,n=0;n<t.length;n++)if(t[n].options.event==e)return t[n];return null},add:function(e){if(m(e,"add",this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},remove:function(e){if(m(e,"remove",this))return this;if(e=this.get(e)){var t=this.recognizers,n=_(t,e);-1!==n&&(t.splice(n,1),this.touchAction.update())}return this},on:function(e,t){if(void 0!==e&&void 0!==t){var n=this.handlers;return y(B(e),(function(e){n[e]=n[e]||[],n[e].push(t)})),this}},off:function(e,t){if(void 0!==e){var n=this.handlers;return y(B(e),(function(e){t?n[e]&&n[e].splice(_(n[e],t),1):delete n[e]})),this}},emit:function(e,t){this.options.domEvents&&function(e,t){var n=a.createEvent("Event");n.initEvent(e,!0,!0),n.gesture=t,t.target.dispatchEvent(n)}(e,t);var n=this.handlers[e]&&this.handlers[e].slice();if(n&&n.length){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};for(var r=0;r<n.length;)n[r](t),r++}},destroy:function(){this.element&&Be(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},s(Te,{INPUT_START:1,INPUT_MOVE:2,INPUT_END:4,INPUT_CANCEL:8,STATE_POSSIBLE:1,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:32,DIRECTION_NONE:1,DIRECTION_LEFT:2,DIRECTION_RIGHT:4,DIRECTION_UP:8,DIRECTION_DOWN:16,DIRECTION_HORIZONTAL:6,DIRECTION_VERTICAL:24,DIRECTION_ALL:30,Manager:De,Input:L,TouchAction:de,TouchInput:ae,MouseInput:Y,PointerEventInput:ee,TouchMouseInput:ue,SingleTouchInput:ne,Recognizer:me,AttrRecognizer:be,Tap:we,Pan:Ae,Swipe:Se,Pinch:Ee,Rotate:Ce,Press:xe,on:S,off:w,each:y,merge:b,extend:g,assign:s,inherit:A,bindFn:E,prefixed:O}),(void 0!==i?i:"undefined"!=typeof self?self:{}).Hammer=Te,void 0===(r=function(){return Te}.call(t,n,t,e))||(e.exports=r)}(window,document)},function(e,t,n){var r=n(106),i=n(108),a=n(109),o=a&&a.isTypedArray,u=o?i(o):r;e.exports=u},function(e,t,n){(function(e,t){
7/*! *****************************************************************************
8Copyright (C) Microsoft. All rights reserved.
9Licensed under the Apache License, Version 2.0 (the "License"); you may not use
10this file except in compliance with the License. You may obtain a copy of the
11License at http://www.apache.org/licenses/LICENSE-2.0
12
13THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
15WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
16MERCHANTABLITY OR NON-INFRINGEMENT.
17
18See the Apache Version 2.0 License for specific language governing permissions
19and limitations under the License.
20***************************************************************************** */
21var n;!function(n){!function(r){var i="object"==typeof t?t:"object"==typeof self?self:"object"==typeof this?this:Function("return this;")(),a=o(n);function o(e,t){return function(n,r){"function"!=typeof e[n]&&Object.defineProperty(e,n,{configurable:!0,writable:!0,value:r}),t&&t(n,r)}}void 0===i.Reflect?i.Reflect=n:a=o(i.Reflect,a),function(t){var n=Object.prototype.hasOwnProperty,r="function"==typeof Symbol,i=r&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",a=r&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",o="function"==typeof Object.create,u={__proto__:[]}instanceof Array,s=!o&&!u,c={create:o?function(){return k(Object.create(null))}:u?function(){return k({__proto__:null})}:function(){return k({})},has:s?function(e,t){return n.call(e,t)}:function(e,t){return t in e},get:s?function(e,t){return n.call(e,t)?e[t]:void 0}:function(e,t){return e[t]}},f=Object.getPrototypeOf(Function),l="object"==typeof e&&e.env&&"true"===e.env.REFLECT_METADATA_USE_MAP_POLYFILL,p=l||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?function(){var e={},t=[],n=function(){function e(e,t,n){this._index=0,this._keys=e,this._values=t,this._selector=n}return e.prototype["@@iterator"]=function(){return this},e.prototype[a]=function(){return this},e.prototype.next=function(){var e=this._index;if(e>=0&&e<this._keys.length){var n=this._selector(this._keys[e],this._values[e]);return e+1>=this._keys.length?(this._index=-1,this._keys=t,this._values=t):this._index++,{value:n,done:!1}}return{value:void 0,done:!0}},e.prototype.throw=function(e){throw this._index>=0&&(this._index=-1,this._keys=t,this._values=t),e},e.prototype.return=function(e){return this._index>=0&&(this._index=-1,this._keys=t,this._values=t),{value:e,done:!0}},e}();return function(){function t(){this._keys=[],this._values=[],this._cacheKey=e,this._cacheIndex=-2}return Object.defineProperty(t.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),t.prototype.has=function(e){return this._find(e,!1)>=0},t.prototype.get=function(e){var t=this._find(e,!1);return t>=0?this._values[t]:void 0},t.prototype.set=function(e,t){var n=this._find(e,!0);return this._values[n]=t,this},t.prototype.delete=function(t){var n=this._find(t,!1);if(n>=0){for(var r=this._keys.length,i=n+1;i<r;i++)this._keys[i-1]=this._keys[i],this._values[i-1]=this._values[i];return this._keys.length--,this._values.length--,t===this._cacheKey&&(this._cacheKey=e,this._cacheIndex=-2),!0}return!1},t.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=e,this._cacheIndex=-2},t.prototype.keys=function(){return new n(this._keys,this._values,r)},t.prototype.values=function(){return new n(this._keys,this._values,i)},t.prototype.entries=function(){return new n(this._keys,this._values,o)},t.prototype["@@iterator"]=function(){return this.entries()},t.prototype[a]=function(){return this.entries()},t.prototype._find=function(e,t){return this._cacheKey!==e&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=e)),this._cacheIndex<0&&t&&(this._cacheIndex=this._keys.length,this._keys.push(e),this._values.push(void 0)),this._cacheIndex},t}();function r(e,t){return e}function i(e,t){return t}function o(e,t){return[e,t]}}():Map,h=l||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?function(){function e(){this._map=new p}return Object.defineProperty(e.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),e.prototype.has=function(e){return this._map.has(e)},e.prototype.add=function(e){return this._map.set(e,e),this},e.prototype.delete=function(e){return this._map.delete(e)},e.prototype.clear=function(){this._map.clear()},e.prototype.keys=function(){return this._map.keys()},e.prototype.values=function(){return this._map.values()},e.prototype.entries=function(){return this._map.entries()},e.prototype["@@iterator"]=function(){return this.keys()},e.prototype[a]=function(){return this.keys()},e}():Set,d=new(l||"function"!=typeof WeakMap?function(){var e=c.create(),t=r();return function(){function e(){this._key=r()}return e.prototype.has=function(e){var t=i(e,!1);return void 0!==t&&c.has(t,this._key)},e.prototype.get=function(e){var t=i(e,!1);return void 0!==t?c.get(t,this._key):void 0},e.prototype.set=function(e,t){return i(e,!0)[this._key]=t,this},e.prototype.delete=function(e){var t=i(e,!1);return void 0!==t&&delete t[this._key]},e.prototype.clear=function(){this._key=r()},e}();function r(){var t;do{t="@@WeakMap@@"+o()}while(c.has(e,t));return e[t]=!0,t}function i(e,r){if(!n.call(e,t)){if(!r)return;Object.defineProperty(e,t,{value:c.create()})}return e[t]}function a(e,t){for(var n=0;n<t;++n)e[n]=255*Math.random()|0;return e}function o(){var e,t=(e=16,"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(e)):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(new Uint8Array(e)):a(new Uint8Array(e),e):a(new Array(e),e));t[6]=79&t[6]|64,t[8]=191&t[8]|128;for(var n="",r=0;r<16;++r){var i=t[r];4!==r&&6!==r&&8!==r||(n+="-"),i<16&&(n+="0"),n+=i.toString(16).toLowerCase()}return n}}():WeakMap);function m(e,t,n){var r=d.get(e);if(E(r)){if(!n)return;r=new p,d.set(e,r)}var i=r.get(t);if(E(i)){if(!n)return;i=new p,r.set(t,i)}return i}function y(e,t,n){var r=m(t,n,!1);return!E(r)&&!!r.has(e)}function v(e,t,n){var r=m(t,n,!1);if(!E(r))return r.get(e)}function g(e,t,n,r){m(n,r,!0).set(e,t)}function b(e,t){var n=[],r=m(e,t,!1);if(E(r))return n;for(var i=function(e){var t=_(e,a);if(!D(t))throw new TypeError;var n=t.call(e);if(!C(n))throw new TypeError;return n}(r.keys()),o=0;;){var u=M(i);if(!u)return n.length=o,n;var s=u.value;try{n[o]=s}catch(e){try{F(i)}finally{throw e}}o++}}function A(e){if(null===e)return 1;switch(typeof e){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===e?1:6;default:return 6}}function E(e){return void 0===e}function x(e){return null===e}function C(e){return"object"==typeof e?null!==e:"function"==typeof e}function S(e,t){switch(A(e)){case 0:case 1:case 2:case 3:case 4:case 5:return e}var n=3===t?"string":5===t?"number":"default",r=_(e,i);if(void 0!==r){var a=r.call(e,n);if(C(a))throw new TypeError;return a}return function(e,t){if("string"===t){var n=e.toString;if(D(n))if(!C(i=n.call(e)))return i;if(D(r=e.valueOf))if(!C(i=r.call(e)))return i}else{var r;if(D(r=e.valueOf))if(!C(i=r.call(e)))return i;var i,a=e.toString;if(D(a))if(!C(i=a.call(e)))return i}throw new TypeError}(e,"default"===n?"number":n)}function w(e){var t=S(e,3);return"symbol"==typeof t?t:function(e){return""+e}(t)}function T(e){return Array.isArray?Array.isArray(e):e instanceof Object?e instanceof Array:"[object Array]"===Object.prototype.toString.call(e)}function D(e){return"function"==typeof e}function B(e){return"function"==typeof e}function _(e,t){var n=e[t];if(null!=n){if(!D(n))throw new TypeError;return n}}function M(e){var t=e.next();return!t.done&&t}function F(e){var t=e.return;t&&t.call(e)}function O(e){var t=Object.getPrototypeOf(e);if("function"!=typeof e||e===f)return t;if(t!==f)return t;var n=e.prototype,r=n&&Object.getPrototypeOf(n);if(null==r||r===Object.prototype)return t;var i=r.constructor;return"function"!=typeof i||i===e?t:i}function k(e){return e.__=void 0,delete e.__,e}t("decorate",(function(e,t,n,r){if(E(n)){if(!T(e))throw new TypeError;if(!B(t))throw new TypeError;return function(e,t){for(var n=e.length-1;n>=0;--n){var r=(0,e[n])(t);if(!E(r)&&!x(r)){if(!B(r))throw new TypeError;t=r}}return t}(e,t)}if(!T(e))throw new TypeError;if(!C(t))throw new TypeError;if(!C(r)&&!E(r)&&!x(r))throw new TypeError;return x(r)&&(r=void 0),function(e,t,n,r){for(var i=e.length-1;i>=0;--i){var a=(0,e[i])(t,n,r);if(!E(a)&&!x(a)){if(!C(a))throw new TypeError;r=a}}return r}(e,t,n=w(n),r)})),t("metadata",(function(e,t){return function(n,r){if(!C(n))throw new TypeError;if(!E(r)&&!function(e){switch(A(e)){case 3:case 4:return!0;default:return!1}}(r))throw new TypeError;g(e,t,n,r)}})),t("defineMetadata",(function(e,t,n,r){if(!C(n))throw new TypeError;return E(r)||(r=w(r)),g(e,t,n,r)})),t("hasMetadata",(function(e,t,n){if(!C(t))throw new TypeError;return E(n)||(n=w(n)),function e(t,n,r){if(y(t,n,r))return!0;var i=O(n);return!x(i)&&e(t,i,r)}(e,t,n)})),t("hasOwnMetadata",(function(e,t,n){if(!C(t))throw new TypeError;return E(n)||(n=w(n)),y(e,t,n)})),t("getMetadata",(function(e,t,n){if(!C(t))throw new TypeError;return E(n)||(n=w(n)),function e(t,n,r){if(y(t,n,r))return v(t,n,r);var i=O(n);return x(i)?void 0:e(t,i,r)}(e,t,n)})),t("getOwnMetadata",(function(e,t,n){if(!C(t))throw new TypeError;return E(n)||(n=w(n)),v(e,t,n)})),t("getMetadataKeys",(function(e,t){if(!C(e))throw new TypeError;return E(t)||(t=w(t)),function e(t,n){var r=b(t,n),i=O(t);if(null===i)return r;var a=e(i,n);if(a.length<=0)return r;if(r.length<=0)return a;for(var o=new h,u=[],s=0,c=r;s<c.length;s++){var f=c[s];o.has(f)||(o.add(f),u.push(f))}for(var l=0,p=a;l<p.length;l++){f=p[l];o.has(f)||(o.add(f),u.push(f))}return u}(e,t)})),t("getOwnMetadataKeys",(function(e,t){if(!C(e))throw new TypeError;return E(t)||(t=w(t)),b(e,t)})),t("deleteMetadata",(function(e,t,n){if(!C(t))throw new TypeError;E(n)||(n=w(n));var r=m(t,n,!1);if(E(r))return!1;if(!r.delete(e))return!1;if(r.size>0)return!0;var i=d.get(t);return i.delete(n),i.size>0||d.delete(t),!0}))}(a)}()}(n||(n={}))}).call(this,n(61),n(35))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(12),i=function(){function e(){}return e.prototype.getConstructorMetadata=function(e){return{compilerGeneratedMetadata:Reflect.getMetadata(r.PARAM_TYPES,e),userGeneratedMetadata:Reflect.getMetadata(r.TAGGED,e)||{}}},e.prototype.getPropertiesMetadata=function(e){return Reflect.getMetadata(r.TAGGED_PROP,e)||[]},e}();t.MetadataReader=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(14);t.isStackOverflowExeption=function(e){return e instanceof RangeError||e.message===r.STACK_OVERFLOW}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(14),i=n(12),a=n(17),o=n(19),u=function(){function e(e){this._cb=e}return e.prototype.unwrap=function(){return this._cb()},e}();t.LazyServiceIdentifer=u,t.inject=function(e){return function(t,n,u){if(void 0===e)throw new Error(r.UNDEFINED_INJECT_ANNOTATION(t.name));var s=new a.Metadata(i.INJECT_TAG,e);"number"==typeof u?o.tagParameter(t,n,u,s):o.tagProperty(t,n,s)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(12),i=n(20),a=n(17),o=n(69),u=function(){function e(e,t,n,u){this.id=i.id(),this.type=e,this.serviceIdentifier=n,this.name=new o.QueryableString(t||""),this.metadata=new Array;var s=null;"string"==typeof u?s=new a.Metadata(r.NAMED_TAG,u):u instanceof a.Metadata&&(s=u),null!==s&&this.metadata.push(s)}return e.prototype.hasTag=function(e){for(var t=0,n=this.metadata;t<n.length;t++){if(n[t].key===e)return!0}return!1},e.prototype.isArray=function(){return this.hasTag(r.MULTI_INJECT_TAG)},e.prototype.matchesArray=function(e){return this.matchesTag(r.MULTI_INJECT_TAG)(e)},e.prototype.isNamed=function(){return this.hasTag(r.NAMED_TAG)},e.prototype.isTagged=function(){return this.metadata.some((function(e){return e.key!==r.INJECT_TAG&&e.key!==r.MULTI_INJECT_TAG&&e.key!==r.NAME_TAG&&e.key!==r.UNMANAGED_TAG&&e.key!==r.NAMED_TAG}))},e.prototype.isOptional=function(){return this.matchesTag(r.OPTIONAL_TAG)(!0)},e.prototype.getNamedTag=function(){return this.isNamed()?this.metadata.filter((function(e){return e.key===r.NAMED_TAG}))[0]:null},e.prototype.getCustomTags=function(){return this.isTagged()?this.metadata.filter((function(e){return e.key!==r.INJECT_TAG&&e.key!==r.MULTI_INJECT_TAG&&e.key!==r.NAME_TAG&&e.key!==r.UNMANAGED_TAG&&e.key!==r.NAMED_TAG})):null},e.prototype.matchesNamedTag=function(e){return this.matchesTag(r.NAMED_TAG)(e)},e.prototype.matchesTag=function(e){var t=this;return function(n){for(var r=0,i=t.metadata;r<i.length;r++){var a=i[r];if(a.key===e&&a.value===n)return!0}return!1}},e}();t.Target=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(26),i=n(27),a=function(){function e(e){this._binding=e,this._bindingWhenSyntax=new i.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new r.BindingOnSyntax(this._binding)}return e.prototype.when=function(e){return this._bindingWhenSyntax.when(e)},e.prototype.whenTargetNamed=function(e){return this._bindingWhenSyntax.whenTargetNamed(e)},e.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},e.prototype.whenTargetTagged=function(e,t){return this._bindingWhenSyntax.whenTargetTagged(e,t)},e.prototype.whenInjectedInto=function(e){return this._bindingWhenSyntax.whenInjectedInto(e)},e.prototype.whenParentNamed=function(e){return this._bindingWhenSyntax.whenParentNamed(e)},e.prototype.whenParentTagged=function(e,t){return this._bindingWhenSyntax.whenParentTagged(e,t)},e.prototype.whenAnyAncestorIs=function(e){return this._bindingWhenSyntax.whenAnyAncestorIs(e)},e.prototype.whenNoAncestorIs=function(e){return this._bindingWhenSyntax.whenNoAncestorIs(e)},e.prototype.whenAnyAncestorNamed=function(e){return this._bindingWhenSyntax.whenAnyAncestorNamed(e)},e.prototype.whenAnyAncestorTagged=function(e,t){return this._bindingWhenSyntax.whenAnyAncestorTagged(e,t)},e.prototype.whenNoAncestorNamed=function(e){return this._bindingWhenSyntax.whenNoAncestorNamed(e)},e.prototype.whenNoAncestorTagged=function(e,t){return this._bindingWhenSyntax.whenNoAncestorTagged(e,t)},e.prototype.whenAnyAncestorMatches=function(e){return this._bindingWhenSyntax.whenAnyAncestorMatches(e)},e.prototype.whenNoAncestorMatches=function(e){return this._bindingWhenSyntax.whenNoAncestorMatches(e)},e.prototype.onActivation=function(e){return this._bindingOnSyntax.onActivation(e)},e}();t.BindingWhenOnSyntax=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(12),i=n(17),a=function(e,t){var n=e.parentRequest;return null!==n&&(!!t(n)||a(n,t))};t.traverseAncerstors=a;var o=function(e){return function(t){var n=function(n){return null!==n&&null!==n.target&&n.target.matchesTag(e)(t)};return n.metaData=new i.Metadata(e,t),n}};t.taggedConstraint=o;var u=o(r.NAMED_TAG);t.namedConstraint=u;t.typeConstraint=function(e){return function(t){var n=null;if(null!==t){if(n=t.bindings[0],"string"==typeof e)return n.serviceIdentifier===e;var r=t.bindings[0].implementationType;return e===r}return!1}}},function(e,t,n){var r=n(43);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}},function(e,t,n){var r=n(45),i="object"==typeof self&&self&&self.Object===Object&&self,a=r||i||Function("return this")();e.exports=a},function(e,t,n){(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e.exports=n}).call(this,n(35))},function(e,t){},function(e,t){e.exports=function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}},function(e,t){var n=Array.isArray;e.exports=n},function(e,t){},function(e,t,n){var r=n(7),i=n(29),a=n(94),o=n(95);function u(t){var n="function"==typeof Map?new Map:void 0;return e.exports=u=function(e){if(null===e||!a(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(e))return n.get(e);n.set(e,t)}function t(){return o(e,arguments,r(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),i(t,e)},u(t)}e.exports=u},function(e,t,n){var r=n(24),i=n(23);e.exports=function(e){return"number"==typeof e||i(e)&&"[object Number]"==r(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(97);t.default=function(e,t){return void 0===t&&(t=!0),{lazyInject:r.makePropertyInjectDecorator(e,t),lazyInjectNamed:r.makePropertyInjectNamedDecorator(e,t),lazyInjectTagged:r.makePropertyInjectTaggedDecorator(e,t),lazyMultiInject:r.makePropertyMultiInjectDecorator(e,t)}}},function(e,t,n){var r=n(47),i=n(98),a=n(102),o=n(48);e.exports=function(){var e=arguments.length;if(!e)return[];for(var t=Array(e-1),n=arguments[0],u=e;u--;)t[u-1]=arguments[u];return r(o(n)?a(n):[n],i(t,1))}},function(e,t,n){e.exports=function(){"use strict";var e=function(e){return e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Float32Array||e instanceof Float64Array||e instanceof Uint8ClampedArray},t=function(e,t){for(var n=Object.keys(t),r=0;r<n.length;++r)e[n[r]]=t[n[r]];return e};function n(e){var t=new Error("(regl) "+e);throw console.error(t),t}function r(e,t){e||n(t)}function i(e){return e?": "+e:""}function a(e,t){switch(t){case"number":return"number"==typeof e;case"object":return"object"==typeof e;case"string":return"string"==typeof e;case"boolean":return"boolean"==typeof e;case"function":return"function"==typeof e;case"undefined":return void 0===e;case"symbol":return"symbol"==typeof e}}function o(e,t,r){t.indexOf(e)<0&&n("invalid value"+i(r)+". must be one of: "+t)}var u=["gl","canvas","container","attributes","pixelRatio","extensions","optionalExtensions","profile","onDone"];function s(e,t){for(e+="";e.length<t;)e=" "+e;return e}function c(){this.name="unknown",this.lines=[],this.index={},this.hasErrors=!1}function f(e,t){this.number=e,this.line=t,this.errors=[]}function l(e,t,n){this.file=e,this.line=t,this.message=n}function p(){var e=new Error,t=(e.stack||e).toString(),n=/compileProcedure.*\n\s*at.*\((.*)\)/.exec(t);if(n)return n[1];var r=/compileProcedure.*\n\s*at\s+(.*)(\n|$)/.exec(t);return r?r[1]:"unknown"}function h(){var e=new Error,t=(e.stack||e).toString(),n=/at REGLCommand.*\n\s+at.*\((.*)\)/.exec(t);if(n)return n[1];var r=/at REGLCommand.*\n\s+at\s+(.*)\n/.exec(t);return r?r[1]:"unknown"}function d(e,t){var n,r=e.split("\n"),i=1,a=0,o={unknown:new c,0:new c};o.unknown.name=o[0].name=t||p(),o.unknown.lines.push(new f(0,""));for(var u=0;u<r.length;++u){var s=r[u],l=/^\s*#\s*(\w+)\s+(.+)\s*$/.exec(s);if(l)switch(l[1]){case"line":var h=/(\d+)(\s+\d+)?/.exec(l[2]);h&&(i=0|h[1],h[2]&&((a=0|h[2])in o||(o[a]=new c)));break;case"define":var d=/SHADER_NAME(_B64)?\s+(.*)$/.exec(l[2]);d&&(o[a].name=d[1]?(n=d[2],"undefined"!=typeof atob?atob(n):"base64:"+n):d[2])}o[a].lines.push(new f(i++,s))}return Object.keys(o).forEach((function(e){var t=o[e];t.lines.forEach((function(e){t.index[e.number]=e}))})),o}function m(e){e._commandRef=p()}function y(e,t){var r=h();n(e+" in command "+(t||p())+("unknown"===r?"":" called from "+r))}function v(e,t,n,r){a(e,t)||y("invalid parameter type"+i(n)+". expected "+t+", got "+typeof e,r||p())}var g={};function b(e,t){return 32820===e||32819===e||33635===e?2:34042===e?4:g[e]*t}function A(e){return!(e&e-1||!e)}g[5120]=g[5121]=1,g[5122]=g[5123]=g[36193]=g[33635]=g[32819]=g[32820]=2,g[5124]=g[5125]=g[5126]=g[34042]=4;var E=t(r,{optional:function(e){e()},raise:n,commandRaise:y,command:function(e,t,n){e||y(t,n||p())},parameter:function(e,t,r){e in t||n("unknown parameter ("+e+")"+i(r)+". possible values: "+Object.keys(t).join())},commandParameter:function(e,t,n,r){e in t||y("unknown parameter ("+e+")"+i(n)+". possible values: "+Object.keys(t).join(),r||p())},constructor:function(e){Object.keys(e).forEach((function(e){u.indexOf(e)<0&&n('invalid regl constructor argument "'+e+'". must be one of '+u)}))},type:function(e,t,r){a(e,t)||n("invalid parameter type"+i(r)+". expected "+t+", got "+typeof e)},commandType:v,isTypedArray:function(t,r){e(t)||n("invalid parameter type"+i(r)+". must be a typed array")},nni:function(e,t){e>=0&&(0|e)===e||n("invalid parameter type, ("+e+")"+i(t)+". must be a nonnegative integer")},oneOf:o,shaderError:function(e,t,n,i,a){if(!e.getShaderParameter(t,e.COMPILE_STATUS)){var o=e.getShaderInfoLog(t),u=i===e.FRAGMENT_SHADER?"fragment":"vertex";v(n,"string",u+" shader source must be a string",a);var c=d(n,a),f=function(e){var t=[];return e.split("\n").forEach((function(e){if(!(e.length<5)){var n=/^ERROR:\s+(\d+):(\d+):\s*(.*)$/.exec(e);n?t.push(new l(0|n[1],0|n[2],n[3].trim())):e.length>0&&t.push(new l("unknown",0,e))}})),t}(o);!function(e,t){t.forEach((function(t){var n=e[t.file];if(n){var r=n.index[t.line];if(r)return r.errors.push(t),void(n.hasErrors=!0)}e.unknown.hasErrors=!0,e.unknown.lines[0].errors.push(t)}))}(c,f),Object.keys(c).forEach((function(e){var t=c[e];if(t.hasErrors){var n=[""],r=[""];i("file number "+e+": "+t.name+"\n","color:red;text-decoration:underline;font-weight:bold"),t.lines.forEach((function(e){if(e.errors.length>0){i(s(e.number,4)+"| ","background-color:yellow; font-weight:bold"),i(e.line+"\n","color:red; background-color:yellow; font-weight:bold");var t=0;e.errors.forEach((function(n){var r=n.message,a=/^\s*'(.*)'\s*:\s*(.*)$/.exec(r);if(a){var o=a[1];switch(r=a[2],o){case"assign":o="="}t=Math.max(e.line.indexOf(o,t),0)}else t=0;i(s("| ",6)),i(s("^^^",t+3)+"\n","font-weight:bold"),i(s("| ",6)),i(r+"\n","font-weight:bold")})),i(s("| ",6)+"\n")}else i(s(e.number,4)+"| "),i(e.line+"\n","color:red")})),"undefined"==typeof document||window.chrome?console.log(n.join("")):(r[0]=n.join("%c"),console.log.apply(console,r))}function i(e,t){n.push(e),r.push(t||"")}})),r.raise("Error compiling "+u+" shader, "+c[0].name)}},linkError:function(e,t,n,i,a){if(!e.getProgramParameter(t,e.LINK_STATUS)){var o=e.getProgramInfoLog(t),u=d(n,a),s='Error linking program with vertex shader, "'+d(i,a)[0].name+'", and fragment shader "'+u[0].name+'"';"undefined"!=typeof document?console.log("%c"+s+"\n%c"+o,"color:red;text-decoration:underline;font-weight:bold","color:red"):console.log(s+"\n"+o),r.raise(s)}},callSite:h,saveCommandRef:m,saveDrawInfo:function(e,t,n,r){function i(e){return e?r.id(e):0}function a(e,t){Object.keys(t).forEach((function(t){e[r.id(t)]=!0}))}m(e),e._fragId=i(e.static.frag),e._vertId=i(e.static.vert);var o=e._uniformSet={};a(o,t.static),a(o,t.dynamic);var u=e._attributeSet={};a(u,n.static),a(u,n.dynamic),e._hasCount="count"in e.static||"count"in e.dynamic||"elements"in e.static||"elements"in e.dynamic},framebufferFormat:function(e,t,n){e.texture?o(e.texture._texture.internalformat,t,"unsupported texture format for attachment"):o(e.renderbuffer._renderbuffer.format,n,"unsupported renderbuffer format for attachment")},guessCommand:p,texture2D:function(e,t,n){var i,a=t.width,o=t.height,u=t.channels;r(a>0&&a<=n.maxTextureSize&&o>0&&o<=n.maxTextureSize,"invalid texture shape"),33071===e.wrapS&&33071===e.wrapT||r(A(a)&&A(o),"incompatible wrap mode for texture, both width and height must be power of 2"),1===t.mipmask?1!==a&&1!==o&&r(9984!==e.minFilter&&9986!==e.minFilter&&9985!==e.minFilter&&9987!==e.minFilter,"min filter requires mipmap"):(r(A(a)&&A(o),"texture must be a square power of 2 to support mipmapping"),r(t.mipmask===(a<<1)-1,"missing or incomplete mipmap data")),5126===t.type&&(n.extensions.indexOf("oes_texture_float_linear")<0&&r(9728===e.minFilter&&9728===e.magFilter,"filter not supported, must enable oes_texture_float_linear"),r(!e.genMipmaps,"mipmap generation not supported with float textures"));var s=t.images;for(i=0;i<16;++i)if(s[i]){var c=a>>i,f=o>>i;r(t.mipmask&1<<i,"missing mipmap data");var l=s[i];if(r(l.width===c&&l.height===f,"invalid shape for mip images"),r(l.format===t.format&&l.internalformat===t.internalformat&&l.type===t.type,"incompatible type for mip image"),l.compressed);else if(l.data){var p=Math.ceil(b(l.type,u)*c/l.unpackAlignment)*l.unpackAlignment;r(l.data.byteLength===p*f,"invalid data for image, buffer size is inconsistent with image format")}else l.element||l.copy}else e.genMipmaps||r(0==(t.mipmask&1<<i),"extra mipmap data");t.compressed&&r(!e.genMipmaps,"mipmap generation for compressed images not supported")},textureCube:function(e,t,n,i){var a=e.width,o=e.height,u=e.channels;r(a>0&&a<=i.maxTextureSize&&o>0&&o<=i.maxTextureSize,"invalid texture shape"),r(a===o,"cube map must be square"),r(33071===t.wrapS&&33071===t.wrapT,"wrap mode not supported by cube map");for(var s=0;s<n.length;++s){var c=n[s];r(c.width===a&&c.height===o,"inconsistent cube map face shape"),t.genMipmaps&&(r(!c.compressed,"can not generate mipmap for compressed textures"),r(1===c.mipmask,"can not specify mipmaps and generate mipmaps"));for(var f=c.images,l=0;l<16;++l){var p=f[l];if(p){var h=a>>l,d=o>>l;r(c.mipmask&1<<l,"missing mipmap data"),r(p.width===h&&p.height===d,"invalid shape for mip images"),r(p.format===e.format&&p.internalformat===e.internalformat&&p.type===e.type,"incompatible type for mip image"),p.compressed||(p.data?r(p.data.byteLength===h*d*Math.max(b(p.type,u),p.unpackAlignment),"invalid data for image, buffer size is inconsistent with image format"):p.element||p.copy)}}}}}),x=0;function C(e,t){this.id=x++,this.type=e,this.data=t}function S(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function w(e){return"["+function e(t){if(0===t.length)return[];var n=t.charAt(0),r=t.charAt(t.length-1);if(t.length>1&&n===r&&('"'===n||"'"===n))return['"'+S(t.substr(1,t.length-2))+'"'];var i=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(t);if(i)return e(t.substr(0,i.index)).concat(e(i[1])).concat(e(t.substr(i.index+i[0].length)));var a=t.split(".");if(1===a.length)return['"'+S(t)+'"'];for(var o=[],u=0;u<a.length;++u)o=o.concat(e(a[u]));return o}(e).join("][")+"]"}var T={DynamicVariable:C,define:function(e,t){return new C(e,w(t+""))},isDynamic:function(e){return"function"==typeof e&&!e._reglType||e instanceof C},unbox:function(e,t){return"function"==typeof e?new C(0,e):e},accessor:w},D={next:"function"==typeof requestAnimationFrame?function(e){return requestAnimationFrame(e)}:function(e){return setTimeout(e,16)},cancel:"function"==typeof cancelAnimationFrame?function(e){return cancelAnimationFrame(e)}:clearTimeout},B="undefined"!=typeof performance&&performance.now?function(){return performance.now()}:function(){return+new Date};function _(e){return"string"==typeof e?e.split():(E(Array.isArray(e),"invalid extension array"),e)}function M(e){return"string"==typeof e?(E("undefined"!=typeof document,"not supported outside of DOM"),document.querySelector(e)):e}function F(e){var n,r,i,a,o,u=e||{},s={},c=[],f=[],l="undefined"==typeof window?1:window.devicePixelRatio,p=!1,h=function(e){e&&E.raise(e)},d=function(){};if("string"==typeof u?(E("undefined"!=typeof document,"selector queries only supported in DOM enviroments"),n=document.querySelector(u),E(n,"invalid query string for element")):"object"==typeof u?"string"==typeof(o=u).nodeName&&"function"==typeof o.appendChild&&"function"==typeof o.getBoundingClientRect?n=u:function(e){return"function"==typeof e.drawArrays||"function"==typeof e.drawElements}(u)?i=(a=u).canvas:(E.constructor(u),"gl"in u?a=u.gl:"canvas"in u?i=M(u.canvas):"container"in u&&(r=M(u.container)),"attributes"in u&&(s=u.attributes,E.type(s,"object","invalid context attributes")),"extensions"in u&&(c=_(u.extensions)),"optionalExtensions"in u&&(f=_(u.optionalExtensions)),"onDone"in u&&(E.type(u.onDone,"function","invalid or missing onDone callback"),h=u.onDone),"profile"in u&&(p=!!u.profile),"pixelRatio"in u&&(l=+u.pixelRatio,E(l>0,"invalid pixel ratio"))):E.raise("invalid arguments to regl"),n&&("canvas"===n.nodeName.toLowerCase()?i=n:r=n),!a){if(!i){E("undefined"!=typeof document,"must manually specify webgl context outside of DOM environments");var m=function(e,n,r){var i,a=document.createElement("canvas");function o(){var n=window.innerWidth,i=window.innerHeight;if(e!==document.body){var o=e.getBoundingClientRect();n=o.right-o.left,i=o.bottom-o.top}a.width=r*n,a.height=r*i,t(a.style,{width:n+"px",height:i+"px"})}return t(a.style,{border:0,margin:0,padding:0,top:0,left:0}),e.appendChild(a),e===document.body&&(a.style.position="absolute",t(e.style,{margin:0,padding:0})),e!==document.body&&"function"==typeof ResizeObserver?(i=new ResizeObserver((function(){setTimeout(o)}))).observe(e):window.addEventListener("resize",o,!1),o(),{canvas:a,onDestroy:function(){i?i.disconnect():window.removeEventListener("resize",o),e.removeChild(a)}}}(r||document.body,0,l);if(!m)return null;i=m.canvas,d=m.onDestroy}void 0===s.premultipliedAlpha&&(s.premultipliedAlpha=!0),a=function(e,t){function n(n){try{return e.getContext(n,t)}catch(e){return null}}return n("webgl")||n("experimental-webgl")||n("webgl-experimental")}(i,s)}return a?{gl:a,canvas:i,container:r,extensions:c,optionalExtensions:f,pixelRatio:l,profile:p,onDone:h,onDestroy:d}:(d(),h("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function O(e,t){for(var n=Array(e),r=0;r<e;++r)n[r]=t(r);return n}function k(e){var t,n;return t=(e>65535)<<4,t|=n=((e>>>=t)>255)<<3,t|=n=((e>>>=n)>15)<<2,(t|=n=((e>>>=n)>3)<<1)|(e>>>=n)>>1}function I(){var e=O(8,(function(){return[]}));function t(t){var n=function(e){for(var t=16;t<=1<<28;t*=16)if(e<=t)return t;return 0}(t),r=e[k(n)>>2];return r.length>0?r.pop():new ArrayBuffer(n)}function n(t){e[k(t.byteLength)>>2].push(t)}return{alloc:t,free:n,allocType:function(e,n){var r=null;switch(e){case 5120:r=new Int8Array(t(n),0,n);break;case 5121:r=new Uint8Array(t(n),0,n);break;case 5122:r=new Int16Array(t(2*n),0,n);break;case 5123:r=new Uint16Array(t(2*n),0,n);break;case 5124:r=new Int32Array(t(4*n),0,n);break;case 5125:r=new Uint32Array(t(4*n),0,n);break;case 5126:r=new Float32Array(t(4*n),0,n);break;default:return null}return r.length!==n?r.subarray(0,n):r},freeType:function(e){n(e.buffer)}}}var P=I();function j(t){return!!t&&"object"==typeof t&&Array.isArray(t.shape)&&Array.isArray(t.stride)&&"number"==typeof t.offset&&t.shape.length===t.stride.length&&(Array.isArray(t.data)||e(t.data))}P.zero=I();var R=function(e){return Object.keys(e).map((function(t){return e[t]}))},N={shape:function(e){for(var t=[],n=e;n.length;n=n[0])t.push(n.length);return t},flatten:function(e,t,n,r){var i=1;if(t.length)for(var a=0;a<t.length;++a)i*=t[a];else i=0;var o=r||P.allocType(n,i);switch(t.length){case 0:break;case 1:!function(e,t,n){for(var r=0;r<t;++r)n[r]=e[r]}(e,t[0],o);break;case 2:!function(e,t,n,r){for(var i=0,a=0;a<t;++a)for(var o=e[a],u=0;u<n;++u)r[i++]=o[u]}(e,t[0],t[1],o);break;case 3:G(e,t[0],t[1],t[2],o,0);break;default:!function e(t,n,r,i,a){for(var o=1,u=r+1;u<n.length;++u)o*=n[u];var s=n[r];if(n.length-r==4){var c=n[r+1],f=n[r+2],l=n[r+3];for(u=0;u<s;++u)G(t[u],c,f,l,i,a),a+=o}else for(u=0;u<s;++u)e(t[u],n,r+1,i,a),a+=o}(e,t,0,o,0)}return o}};function G(e,t,n,r,i,a){for(var o=a,u=0;u<t;++u)for(var s=e[u],c=0;c<n;++c)for(var f=s[c],l=0;l<r;++l)i[o++]=f[l]}var L={"[object Int8Array]":5120,"[object Int16Array]":5122,"[object Int32Array]":5124,"[object Uint8Array]":5121,"[object Uint8ClampedArray]":5121,"[object Uint16Array]":5123,"[object Uint32Array]":5125,"[object Float32Array]":5126,"[object Float64Array]":5121,"[object ArrayBuffer]":5121},z={int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},V={dynamic:35048,stream:35040,static:35044},U=N.flatten,W=N.shape,q=[];function H(e){return 0|L[Object.prototype.toString.call(e)]}function X(e,t){for(var n=0;n<t.length;++n)e[n]=t[n]}function K(e,t,n,r,i,a,o){for(var u=0,s=0;s<n;++s)for(var c=0;c<r;++c)e[u++]=t[i*s+a*c+o]}q[5120]=1,q[5122]=2,q[5124]=4,q[5121]=1,q[5123]=2,q[5125]=4,q[5126]=4;var Y={points:0,point:0,lines:1,line:1,triangles:4,triangle:4,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},J=new Float32Array(1),Q=new Uint32Array(J.buffer);function Z(e){for(var t=P.allocType(5123,e.length),n=0;n<e.length;++n)if(isNaN(e[n]))t[n]=65535;else if(e[n]===1/0)t[n]=31744;else if(e[n]===-1/0)t[n]=64512;else{J[0]=e[n];var r=Q[0],i=r>>>31<<15,a=(r<<1>>>24)-127,o=r>>13&1023;if(a<-24)t[n]=i;else if(a<-14){var u=-14-a;t[n]=i+(o+1024>>u)}else t[n]=a>15?i+31744:i+(a+15<<10)+o}return t}function $(t){return Array.isArray(t)||e(t)}var ee=function(e){return!(e&e-1||!e)},te=[9984,9986,9985,9987],ne=[0,6409,6410,6407,6408],re={};function ie(e){return"[object "+e+"]"}re[6409]=re[6406]=re[6402]=1,re[34041]=re[6410]=2,re[6407]=re[35904]=3,re[6408]=re[35906]=4;var ae=ie("HTMLCanvasElement"),oe=ie("OffscreenCanvas"),ue=ie("CanvasRenderingContext2D"),se=ie("ImageBitmap"),ce=ie("HTMLImageElement"),fe=ie("HTMLVideoElement"),le=Object.keys(L).concat([ae,oe,ue,se,ce,fe]),pe=[];pe[5121]=1,pe[5126]=4,pe[36193]=2,pe[5123]=2,pe[5125]=4;var he=[];function de(e){return Array.isArray(e)&&(0===e.length||"number"==typeof e[0])}function me(e){return!!Array.isArray(e)&&!(0===e.length||!$(e[0]))}function ye(e){return Object.prototype.toString.call(e)}function ve(e){return ye(e)===ae}function ge(e){return ye(e)===oe}function be(e){if(!e)return!1;var t=ye(e);return le.indexOf(t)>=0||de(e)||me(e)||j(e)}function Ae(e){return 0|L[Object.prototype.toString.call(e)]}function Ee(e,t){return P.allocType(36193===e.type?5126:e.type,t)}function xe(e,t){36193===e.type?(e.data=Z(t),P.freeType(t)):e.data=t}function Ce(e,t,n,r,i,a){var o;if(o=void 0!==he[e]?he[e]:re[e]*pe[t],a&&(o*=6),i){for(var u=0,s=n;s>=1;)u+=o*s*s,s/=2;return u}return o*n*r}function Se(n,r,i,a,o,u,s){var c={"don't care":4352,"dont care":4352,nice:4354,fast:4353},f={repeat:10497,clamp:33071,mirror:33648},l={nearest:9728,linear:9729},p=t({mipmap:9987,"nearest mipmap nearest":9984,"linear mipmap nearest":9985,"nearest mipmap linear":9986,"linear mipmap linear":9987},l),h={none:0,browser:37444},d={uint8:5121,rgba4:32819,rgb565:33635,"rgb5 a1":32820},m={alpha:6406,luminance:6409,"luminance alpha":6410,rgb:6407,rgba:6408,rgba4:32854,"rgb5 a1":32855,rgb565:36194},y={};r.ext_srgb&&(m.srgb=35904,m.srgba=35906),r.oes_texture_float&&(d.float32=d.float=5126),r.oes_texture_half_float&&(d.float16=d["half float"]=36193),r.webgl_depth_texture&&(t(m,{depth:6402,"depth stencil":34041}),t(d,{uint16:5123,uint32:5125,"depth stencil":34042})),r.webgl_compressed_texture_s3tc&&t(y,{"rgb s3tc dxt1":33776,"rgba s3tc dxt1":33777,"rgba s3tc dxt3":33778,"rgba s3tc dxt5":33779}),r.webgl_compressed_texture_atc&&t(y,{"rgb atc":35986,"rgba atc explicit alpha":35987,"rgba atc interpolated alpha":34798}),r.webgl_compressed_texture_pvrtc&&t(y,{"rgb pvrtc 4bppv1":35840,"rgb pvrtc 2bppv1":35841,"rgba pvrtc 4bppv1":35842,"rgba pvrtc 2bppv1":35843}),r.webgl_compressed_texture_etc1&&(y["rgb etc1"]=36196);var v=Array.prototype.slice.call(n.getParameter(34467));Object.keys(y).forEach((function(e){var t=y[e];v.indexOf(t)>=0&&(m[e]=t)}));var g=Object.keys(m);i.textureFormats=g;var b=[];Object.keys(m).forEach((function(e){var t=m[e];b[t]=e}));var A=[];Object.keys(d).forEach((function(e){var t=d[e];A[t]=e}));var x=[];Object.keys(l).forEach((function(e){x[l[e]]=e}));var C=[];Object.keys(p).forEach((function(e){var t=p[e];C[t]=e}));var S=[];Object.keys(f).forEach((function(e){S[f[e]]=e}));var w=g.reduce((function(e,t){var n=m[t];return 6409===n||6406===n||6409===n||6410===n||6402===n||34041===n||r.ext_srgb&&(35904===n||35906===n)?e[n]=n:32855===n||t.indexOf("rgba")>=0?e[n]=6408:e[n]=6407,e}),{});function T(){this.internalformat=6408,this.format=6408,this.type=5121,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=37444,this.width=0,this.height=0,this.channels=0}function D(e,t){e.internalformat=t.internalformat,e.format=t.format,e.type=t.type,e.compressed=t.compressed,e.premultiplyAlpha=t.premultiplyAlpha,e.flipY=t.flipY,e.unpackAlignment=t.unpackAlignment,e.colorSpace=t.colorSpace,e.width=t.width,e.height=t.height,e.channels=t.channels}function B(e,t){if("object"==typeof t&&t){if("premultiplyAlpha"in t&&(E.type(t.premultiplyAlpha,"boolean","invalid premultiplyAlpha"),e.premultiplyAlpha=t.premultiplyAlpha),"flipY"in t&&(E.type(t.flipY,"boolean","invalid texture flip"),e.flipY=t.flipY),"alignment"in t&&(E.oneOf(t.alignment,[1,2,4,8],"invalid texture unpack alignment"),e.unpackAlignment=t.alignment),"colorSpace"in t&&(E.parameter(t.colorSpace,h,"invalid colorSpace"),e.colorSpace=h[t.colorSpace]),"type"in t){var n=t.type;E(r.oes_texture_float||!("float"===n||"float32"===n),"you must enable the OES_texture_float extension in order to use floating point textures."),E(r.oes_texture_half_float||!("half float"===n||"float16"===n),"you must enable the OES_texture_half_float extension in order to use 16-bit floating point textures."),E(r.webgl_depth_texture||!("uint16"===n||"uint32"===n||"depth stencil"===n),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),E.parameter(n,d,"invalid texture type"),e.type=d[n]}var a=e.width,o=e.height,u=e.channels,s=!1;"shape"in t?(E(Array.isArray(t.shape)&&t.shape.length>=2,"shape must be an array"),a=t.shape[0],o=t.shape[1],3===t.shape.length&&(u=t.shape[2],E(u>0&&u<=4,"invalid number of channels"),s=!0),E(a>=0&&a<=i.maxTextureSize,"invalid width"),E(o>=0&&o<=i.maxTextureSize,"invalid height")):("radius"in t&&(a=o=t.radius,E(a>=0&&a<=i.maxTextureSize,"invalid radius")),"width"in t&&(a=t.width,E(a>=0&&a<=i.maxTextureSize,"invalid width")),"height"in t&&(o=t.height,E(o>=0&&o<=i.maxTextureSize,"invalid height")),"channels"in t&&(u=t.channels,E(u>0&&u<=4,"invalid number of channels"),s=!0)),e.width=0|a,e.height=0|o,e.channels=0|u;var c=!1;if("format"in t){var f=t.format;E(r.webgl_depth_texture||!("depth"===f||"depth stencil"===f),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),E.parameter(f,m,"invalid texture format");var l=e.internalformat=m[f];e.format=w[l],f in d&&("type"in t||(e.type=d[f])),f in y&&(e.compressed=!0),c=!0}!s&&c?e.channels=re[e.format]:s&&!c?e.channels!==ne[e.format]&&(e.format=e.internalformat=ne[e.channels]):c&&s&&E(e.channels===re[e.format],"number of channels inconsistent with specified format")}}function _(e){n.pixelStorei(37440,e.flipY),n.pixelStorei(37441,e.premultiplyAlpha),n.pixelStorei(37443,e.colorSpace),n.pixelStorei(3317,e.unpackAlignment)}function M(){T.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function F(t,n){var r=null;if(be(n)?r=n:n&&(E.type(n,"object","invalid pixel data type"),B(t,n),"x"in n&&(t.xOffset=0|n.x),"y"in n&&(t.yOffset=0|n.y),be(n.data)&&(r=n.data)),E(!t.compressed||r instanceof Uint8Array,"compressed texture data must be stored in a uint8array"),n.copy){E(!r,"can not specify copy and data field for the same texture");var a=o.viewportWidth,u=o.viewportHeight;t.width=t.width||a-t.xOffset,t.height=t.height||u-t.yOffset,t.needsCopy=!0,E(t.xOffset>=0&&t.xOffset<a&&t.yOffset>=0&&t.yOffset<u&&t.width>0&&t.width<=a&&t.height>0&&t.height<=u,"copy texture read out of bounds")}else if(r){if(e(r))t.channels=t.channels||4,t.data=r,"type"in n||5121!==t.type||(t.type=Ae(r));else if(de(r))t.channels=t.channels||4,function(e,t){var n=t.length;switch(e.type){case 5121:case 5123:case 5125:case 5126:var r=P.allocType(e.type,n);r.set(t),e.data=r;break;case 36193:e.data=Z(t);break;default:E.raise("unsupported texture type, must specify a typed array")}}(t,r),t.alignment=1,t.needsFree=!0;else if(j(r)){var s=r.data;Array.isArray(s)||5121!==t.type||(t.type=Ae(s));var c,f,l,p,h,d,m=r.shape,y=r.stride;3===m.length?(l=m[2],d=y[2]):(E(2===m.length,"invalid ndarray pixel data, must be 2 or 3D"),l=1,d=1),c=m[0],f=m[1],p=y[0],h=y[1],t.alignment=1,t.width=c,t.height=f,t.channels=l,t.format=t.internalformat=ne[l],t.needsFree=!0,function(e,t,n,r,i,a){for(var o=e.width,u=e.height,s=e.channels,c=Ee(e,o*u*s),f=0,l=0;l<u;++l)for(var p=0;p<o;++p)for(var h=0;h<s;++h)c[f++]=t[n*p+r*l+i*h+a];xe(e,c)}(t,s,p,h,d,r.offset)}else if(ve(r)||ge(r)||ye(r)===ue)ve(r)||ge(r)?t.element=r:t.element=r.canvas,t.width=t.element.width,t.height=t.element.height,t.channels=4;else if(function(e){return ye(e)===se}(r))t.element=r,t.width=r.width,t.height=r.height,t.channels=4;else if(function(e){return ye(e)===ce}(r))t.element=r,t.width=r.naturalWidth,t.height=r.naturalHeight,t.channels=4;else if(function(e){return ye(e)===fe}(r))t.element=r,t.width=r.videoWidth,t.height=r.videoHeight,t.channels=4;else if(me(r)){var v=t.width||r[0].length,g=t.height||r.length,b=t.channels;b=$(r[0][0])?b||r[0][0].length:b||1;for(var A=N.shape(r),x=1,C=0;C<A.length;++C)x*=A[C];var S=Ee(t,x);N.flatten(r,A,"",S),xe(t,S),t.alignment=1,t.width=v,t.height=g,t.channels=b,t.format=t.internalformat=ne[b],t.needsFree=!0}}else t.width=t.width||1,t.height=t.height||1,t.channels=t.channels||4;5126===t.type?E(i.extensions.indexOf("oes_texture_float")>=0,"oes_texture_float extension not enabled"):36193===t.type&&E(i.extensions.indexOf("oes_texture_half_float")>=0,"oes_texture_half_float extension not enabled")}function O(e,t,r){var i=e.element,o=e.data,u=e.internalformat,s=e.format,c=e.type,f=e.width,l=e.height;_(e),i?n.texImage2D(t,r,s,s,c,i):e.compressed?n.compressedTexImage2D(t,r,u,f,l,0,o):e.needsCopy?(a(),n.copyTexImage2D(t,r,s,e.xOffset,e.yOffset,f,l,0)):n.texImage2D(t,r,s,f,l,0,s,c,o||null)}function k(e,t,r,i,o){var u=e.element,s=e.data,c=e.internalformat,f=e.format,l=e.type,p=e.width,h=e.height;_(e),u?n.texSubImage2D(t,o,r,i,f,l,u):e.compressed?n.compressedTexSubImage2D(t,o,r,i,c,p,h,s):e.needsCopy?(a(),n.copyTexSubImage2D(t,o,r,i,e.xOffset,e.yOffset,p,h)):n.texSubImage2D(t,o,r,i,p,h,f,l,s)}var I=[];function G(){return I.pop()||new M}function L(e){e.needsFree&&P.freeType(e.data),M.call(e),I.push(e)}function z(){T.call(this),this.genMipmaps=!1,this.mipmapHint=4352,this.mipmask=0,this.images=Array(16)}function V(e,t,n){var r=e.images[0]=G();e.mipmask=1,r.width=e.width=t,r.height=e.height=n,r.channels=e.channels=4}function U(e,t){var n=null;if(be(t))D(n=e.images[0]=G(),e),F(n,t),e.mipmask=1;else if(B(e,t),Array.isArray(t.mipmap))for(var r=t.mipmap,i=0;i<r.length;++i)D(n=e.images[i]=G(),e),n.width>>=i,n.height>>=i,F(n,r[i]),e.mipmask|=1<<i;else D(n=e.images[0]=G(),e),F(n,t),e.mipmask=1;D(e,e.images[0]),!e.compressed||33776!==e.internalformat&&33777!==e.internalformat&&33778!==e.internalformat&&33779!==e.internalformat||E(e.width%4==0&&e.height%4==0,"for compressed texture formats, mipmap level 0 must have width and height that are a multiple of 4")}function W(e,t){for(var n=e.images,r=0;r<n.length;++r){if(!n[r])return;O(n[r],t,r)}}var q=[];function H(){var e=q.pop()||new z;T.call(e),e.mipmask=0;for(var t=0;t<16;++t)e.images[t]=null;return e}function X(e){for(var t=e.images,n=0;n<t.length;++n)t[n]&&L(t[n]),t[n]=null;q.push(e)}function K(){this.minFilter=9728,this.magFilter=9728,this.wrapS=33071,this.wrapT=33071,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=4352}function Y(e,t){if("min"in t){var n=t.min;E.parameter(n,p),e.minFilter=p[n],te.indexOf(e.minFilter)>=0&&!("faces"in t)&&(e.genMipmaps=!0)}if("mag"in t){var r=t.mag;E.parameter(r,l),e.magFilter=l[r]}var a=e.wrapS,o=e.wrapT;if("wrap"in t){var u=t.wrap;"string"==typeof u?(E.parameter(u,f),a=o=f[u]):Array.isArray(u)&&(E.parameter(u[0],f),E.parameter(u[1],f),a=f[u[0]],o=f[u[1]])}else{if("wrapS"in t){var s=t.wrapS;E.parameter(s,f),a=f[s]}if("wrapT"in t){var h=t.wrapT;E.parameter(h,f),o=f[h]}}if(e.wrapS=a,e.wrapT=o,"anisotropic"in t){var d=t.anisotropic;E("number"==typeof d&&d>=1&&d<=i.maxAnisotropic,"aniso samples must be between 1 and "),e.anisotropic=t.anisotropic}if("mipmap"in t){var m=!1;switch(typeof t.mipmap){case"string":E.parameter(t.mipmap,c,"invalid mipmap hint"),e.mipmapHint=c[t.mipmap],e.genMipmaps=!0,m=!0;break;case"boolean":m=e.genMipmaps=t.mipmap;break;case"object":E(Array.isArray(t.mipmap),"invalid mipmap type"),e.genMipmaps=!1,m=!0;break;default:E.raise("invalid mipmap type")}m&&!("min"in t)&&(e.minFilter=9984)}}function J(e,t){n.texParameteri(t,10241,e.minFilter),n.texParameteri(t,10240,e.magFilter),n.texParameteri(t,10242,e.wrapS),n.texParameteri(t,10243,e.wrapT),r.ext_texture_filter_anisotropic&&n.texParameteri(t,34046,e.anisotropic),e.genMipmaps&&(n.hint(33170,e.mipmapHint),n.generateMipmap(t))}var Q=0,ie={},ae=i.maxTextureUnits,oe=Array(ae).map((function(){return null}));function le(e){T.call(this),this.mipmask=0,this.internalformat=6408,this.id=Q++,this.refCount=1,this.target=e,this.texture=n.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new K,s.profile&&(this.stats={size:0})}function pe(e){n.activeTexture(33984),n.bindTexture(e.target,e.texture)}function he(){var e=oe[0];e?n.bindTexture(e.target,e.texture):n.bindTexture(3553,null)}function Se(e){var t=e.texture;E(t,"must not double destroy texture");var r=e.unit,i=e.target;r>=0&&(n.activeTexture(33984+r),n.bindTexture(i,null),oe[r]=null),n.deleteTexture(t),e.texture=null,e.params=null,e.pixels=null,e.refCount=0,delete ie[e.id],u.textureCount--}return t(le.prototype,{bind:function(){this.bindCount+=1;var e=this.unit;if(e<0){for(var t=0;t<ae;++t){var r=oe[t];if(r){if(r.bindCount>0)continue;r.unit=-1}oe[t]=this,e=t;break}e>=ae&&E.raise("insufficient number of texture units"),s.profile&&u.maxTextureUnits<e+1&&(u.maxTextureUnits=e+1),this.unit=e,n.activeTexture(33984+e),n.bindTexture(this.target,this.texture)}return e},unbind:function(){this.bindCount-=1},decRef:function(){--this.refCount<=0&&Se(this)}}),s.profile&&(u.getTotalTextureSize=function(){var e=0;return Object.keys(ie).forEach((function(t){e+=ie[t].stats.size})),e}),{create2D:function(e,t){var r=new le(3553);function a(e,t){var n=r.texInfo;K.call(n);var o=H();return"number"==typeof e?V(o,0|e,"number"==typeof t?0|t:0|e):e?(E.type(e,"object","invalid arguments to regl.texture"),Y(n,e),U(o,e)):V(o,1,1),n.genMipmaps&&(o.mipmask=(o.width<<1)-1),r.mipmask=o.mipmask,D(r,o),E.texture2D(n,o,i),r.internalformat=o.internalformat,a.width=o.width,a.height=o.height,pe(r),W(o,3553),J(n,3553),he(),X(o),s.profile&&(r.stats.size=Ce(r.internalformat,r.type,o.width,o.height,n.genMipmaps,!1)),a.format=b[r.internalformat],a.type=A[r.type],a.mag=x[n.magFilter],a.min=C[n.minFilter],a.wrapS=S[n.wrapS],a.wrapT=S[n.wrapT],a}return ie[r.id]=r,u.textureCount++,a(e,t),a.subimage=function(e,t,n,i){E(!!e,"must specify image data");var o=0|t,u=0|n,s=0|i,c=G();return D(c,r),c.width=0,c.height=0,F(c,e),c.width=c.width||(r.width>>s)-o,c.height=c.height||(r.height>>s)-u,E(r.type===c.type&&r.format===c.format&&r.internalformat===c.internalformat,"incompatible format for texture.subimage"),E(o>=0&&u>=0&&o+c.width<=r.width&&u+c.height<=r.height,"texture.subimage write out of bounds"),E(r.mipmask&1<<s,"missing mipmap data"),E(c.data||c.element||c.needsCopy,"missing image data"),pe(r),k(c,3553,o,u,s),he(),L(c),a},a.resize=function(e,t){var i=0|e,o=0|t||i;if(i===r.width&&o===r.height)return a;a.width=r.width=i,a.height=r.height=o,pe(r);for(var u=0;r.mipmask>>u;++u){var c=i>>u,f=o>>u;if(!c||!f)break;n.texImage2D(3553,u,r.format,c,f,0,r.format,r.type,null)}return he(),s.profile&&(r.stats.size=Ce(r.internalformat,r.type,i,o,!1,!1)),a},a._reglType="texture2d",a._texture=r,s.profile&&(a.stats=r.stats),a.destroy=function(){r.decRef()},a},createCube:function(e,t,r,a,o,c){var f=new le(34067);ie[f.id]=f,u.cubeCount++;var l=new Array(6);function p(e,t,n,r,a,o){var u,c=f.texInfo;for(K.call(c),u=0;u<6;++u)l[u]=H();if("number"!=typeof e&&e)if("object"==typeof e)if(t)U(l[0],e),U(l[1],t),U(l[2],n),U(l[3],r),U(l[4],a),U(l[5],o);else if(Y(c,e),B(f,e),"faces"in e){var h=e.faces;for(E(Array.isArray(h)&&6===h.length,"cube faces must be a length 6 array"),u=0;u<6;++u)E("object"==typeof h[u]&&!!h[u],"invalid input for cube map face"),D(l[u],f),U(l[u],h[u])}else for(u=0;u<6;++u)U(l[u],e);else E.raise("invalid arguments to cube map");else{var d=0|e||1;for(u=0;u<6;++u)V(l[u],d,d)}for(D(f,l[0]),i.npotTextureCube||E(ee(f.width)&&ee(f.height),"your browser does not support non power or two texture dimensions"),c.genMipmaps?f.mipmask=(l[0].width<<1)-1:f.mipmask=l[0].mipmask,E.textureCube(f,c,l,i),f.internalformat=l[0].internalformat,p.width=l[0].width,p.height=l[0].height,pe(f),u=0;u<6;++u)W(l[u],34069+u);for(J(c,34067),he(),s.profile&&(f.stats.size=Ce(f.internalformat,f.type,p.width,p.height,c.genMipmaps,!0)),p.format=b[f.internalformat],p.type=A[f.type],p.mag=x[c.magFilter],p.min=C[c.minFilter],p.wrapS=S[c.wrapS],p.wrapT=S[c.wrapT],u=0;u<6;++u)X(l[u]);return p}return p(e,t,r,a,o,c),p.subimage=function(e,t,n,r,i){E(!!t,"must specify image data"),E("number"==typeof e&&e===(0|e)&&e>=0&&e<6,"invalid face");var a=0|n,o=0|r,u=0|i,s=G();return D(s,f),s.width=0,s.height=0,F(s,t),s.width=s.width||(f.width>>u)-a,s.height=s.height||(f.height>>u)-o,E(f.type===s.type&&f.format===s.format&&f.internalformat===s.internalformat,"incompatible format for texture.subimage"),E(a>=0&&o>=0&&a+s.width<=f.width&&o+s.height<=f.height,"texture.subimage write out of bounds"),E(f.mipmask&1<<u,"missing mipmap data"),E(s.data||s.element||s.needsCopy,"missing image data"),pe(f),k(s,34069+e,a,o,u),he(),L(s),p},p.resize=function(e){var t=0|e;if(t!==f.width){p.width=f.width=t,p.height=f.height=t,pe(f);for(var r=0;r<6;++r)for(var i=0;f.mipmask>>i;++i)n.texImage2D(34069+r,i,f.format,t>>i,t>>i,0,f.format,f.type,null);return he(),s.profile&&(f.stats.size=Ce(f.internalformat,f.type,p.width,p.height,!1,!0)),p}},p._reglType="textureCube",p._texture=f,s.profile&&(p.stats=f.stats),p.destroy=function(){f.decRef()},p},clear:function(){for(var e=0;e<ae;++e)n.activeTexture(33984+e),n.bindTexture(3553,null),oe[e]=null;R(ie).forEach(Se),u.cubeCount=0,u.textureCount=0},getTexture:function(e){return null},restore:function(){for(var e=0;e<ae;++e){var t=oe[e];t&&(t.bindCount=0,t.unit=-1,oe[e]=null)}R(ie).forEach((function(e){e.texture=n.createTexture(),n.bindTexture(e.target,e.texture);for(var t=0;t<32;++t)if(0!=(e.mipmask&1<<t))if(3553===e.target)n.texImage2D(3553,t,e.internalformat,e.width>>t,e.height>>t,0,e.internalformat,e.type,null);else for(var r=0;r<6;++r)n.texImage2D(34069+r,t,e.internalformat,e.width>>t,e.height>>t,0,e.internalformat,e.type,null);J(e.texInfo,e.target)}))}}}he[32854]=2,he[32855]=2,he[36194]=2,he[34041]=4,he[33776]=.5,he[33777]=.5,he[33778]=1,he[33779]=1,he[35986]=.5,he[35987]=1,he[34798]=1,he[35840]=.5,he[35841]=.25,he[35842]=.5,he[35843]=.25,he[36196]=.5;var we=[];function Te(e,t,n){return we[e]*t*n}we[32854]=2,we[32855]=2,we[36194]=2,we[33189]=2,we[36168]=1,we[34041]=4,we[35907]=4,we[34836]=16,we[34842]=8,we[34843]=6;var De=[6407,6408],Be=[];Be[6408]=4,Be[6407]=3;var _e=[];_e[5121]=1,_e[5126]=4,_e[36193]=2;var Me=[32854,32855,36194,35907,34842,34843,34836],Fe={};function Oe(){this.state=0,this.x=0,this.y=0,this.z=0,this.w=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=5126,this.offset=0,this.stride=0,this.divisor=0}function ke(t,n,r,i,a,o,u){function s(s){var c;null===n.next?(E(a.preserveDrawingBuffer,'you must create a webgl context with "preserveDrawingBuffer":true in order to read pixels from the drawing buffer'),c=5121):(E(null!==n.next.colorAttachments[0].texture,"You cannot read from a renderbuffer"),c=n.next.colorAttachments[0].texture._texture.type,o.oes_texture_float?(E(5121===c||5126===c,"Reading from a framebuffer is only allowed for the types 'uint8' and 'float'"),5126===c&&E(u.readFloat,"Reading 'float' values is not permitted in your browser. For a fallback, please see: https://www.npmjs.com/package/glsl-read-float")):E(5121===c,"Reading from a framebuffer is only allowed for the type 'uint8'"));var f=0,l=0,p=i.framebufferWidth,h=i.framebufferHeight,d=null;e(s)?d=s:s&&(E.type(s,"object","invalid arguments to regl.read()"),f=0|s.x,l=0|s.y,E(f>=0&&f<i.framebufferWidth,"invalid x offset for regl.read"),E(l>=0&&l<i.framebufferHeight,"invalid y offset for regl.read"),p=0|(s.width||i.framebufferWidth-f),h=0|(s.height||i.framebufferHeight-l),d=s.data||null),d&&(5121===c?E(d instanceof Uint8Array,"buffer must be 'Uint8Array' when reading from a framebuffer of type 'uint8'"):5126===c&&E(d instanceof Float32Array,"buffer must be 'Float32Array' when reading from a framebuffer of type 'float'")),E(p>0&&p+f<=i.framebufferWidth,"invalid width for read pixels"),E(h>0&&h+l<=i.framebufferHeight,"invalid height for read pixels"),r();var m=p*h*4;return d||(5121===c?d=new Uint8Array(m):5126===c&&(d=d||new Float32Array(m))),E.isTypedArray(d,"data buffer for regl.read() must be a typedarray"),E(d.byteLength>=m,"data buffer for regl.read() too small"),t.pixelStorei(3333,4),t.readPixels(f,l,p,h,6408,c,d),d}return function(e){return e&&"framebuffer"in e?function(e){var t;return n.setFBO({framebuffer:e.framebuffer},(function(){t=s(e)})),t}(e):s(e)}}function Ie(e){return Array.prototype.slice.call(e)}function Pe(e){return Ie(e).join("")}Fe[36053]="complete",Fe[36054]="incomplete attachment",Fe[36057]="incomplete dimensions",Fe[36055]="incomplete, missing attachment",Fe[36061]="unsupported";var je="xyzw".split(""),Re="profile",Ne="framebuffer",Ge="vert",Le="frag",ze="elements",Ve="primitive",Ue="count",We="offset",qe="instances",He="vao",Xe=Ne+"Width",Ke=Ne+"Height",Ye=["blend.func","blend.equation","stencil.func","stencil.opFront","stencil.opBack","sample.coverage","viewport","scissor.box","polygonOffset.offset"],Je={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},Qe=["constant color, constant alpha","one minus constant color, constant alpha","constant color, one minus constant alpha","one minus constant color, one minus constant alpha","constant alpha, constant color","constant alpha, one minus constant color","one minus constant alpha, constant color","one minus constant alpha, one minus constant color"],Ze={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},$e={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},et={frag:35632,vert:35633},tt={cw:2304,ccw:2305};function nt(t){return Array.isArray(t)||e(t)||j(t)}function rt(e){return e.sort((function(e,t){return"viewport"===e?-1:"viewport"===t?1:e<t?-1:1}))}function it(e,t,n,r){this.thisDep=e,this.contextDep=t,this.propDep=n,this.append=r}function at(e){return e&&!(e.thisDep||e.contextDep||e.propDep)}function ot(e){return new it(!1,!1,!1,e)}function ut(e,t){var n=e.type;if(0===n){var r=e.data.length;return new it(!0,r>=1,r>=2,t)}if(4===n){var i=e.data;return new it(i.thisDep,i.contextDep,i.propDep,t)}return new it(3===n,2===n,1===n,t)}var st=new it(!1,!1,!1,(function(){}));function ct(e,n,r,i,a,o,u,s,c,f,l,p,h,d,m){var y=f.Record,v={add:32774,subtract:32778,"reverse subtract":32779};r.ext_blend_minmax&&(v.min=32775,v.max=32776);var g=r.angle_instanced_arrays,b=r.webgl_draw_buffers,A={dirty:!0,profile:m.profile},x={},C=[],S={},w={};function D(e){return e.replace(".","_")}function B(e,t,n){var r=D(e);C.push(e),x[r]=A[r]=!!n,S[r]=t}function _(e,t,n){var r=D(e);C.push(e),Array.isArray(n)?(A[r]=n.slice(),x[r]=n.slice()):A[r]=x[r]=n,w[r]=t}B("dither",3024),B("blend.enable",3042),_("blend.color","blendColor",[0,0,0,0]),_("blend.equation","blendEquationSeparate",[32774,32774]),_("blend.func","blendFuncSeparate",[1,0,1,0]),B("depth.enable",2929,!0),_("depth.func","depthFunc",513),_("depth.range","depthRange",[0,1]),_("depth.mask","depthMask",!0),_("colorMask","colorMask",[!0,!0,!0,!0]),B("cull.enable",2884),_("cull.face","cullFace",1029),_("frontFace","frontFace",2305),_("lineWidth","lineWidth",1),B("polygonOffset.enable",32823),_("polygonOffset.offset","polygonOffset",[0,0]),B("sample.alpha",32926),B("sample.enable",32928),_("sample.coverage","sampleCoverage",[1,!1]),B("stencil.enable",2960),_("stencil.mask","stencilMask",-1),_("stencil.func","stencilFunc",[519,0,-1]),_("stencil.opFront","stencilOpSeparate",[1028,7680,7680,7680]),_("stencil.opBack","stencilOpSeparate",[1029,7680,7680,7680]),B("scissor.enable",3089),_("scissor.box","scissor",[0,0,e.drawingBufferWidth,e.drawingBufferHeight]),_("viewport","viewport",[0,0,e.drawingBufferWidth,e.drawingBufferHeight]);var M={gl:e,context:h,strings:n,next:x,current:A,draw:p,elements:o,buffer:a,shader:l,attributes:f.state,vao:f,uniforms:c,framebuffer:s,extensions:r,timer:d,isBufferArgs:nt},F={primTypes:Y,compareFuncs:Ze,blendFuncs:Je,blendEquations:v,stencilOps:$e,glTypes:z,orientationType:tt};E.optional((function(){M.isArrayLike=$})),b&&(F.backBuffer=[1029],F.drawBuffer=O(i.maxDrawbuffers,(function(e){return 0===e?[0]:O(e,(function(e){return 36064+e}))})));var k=0;function I(){var e=function(){var e=0,n=[],r=[];function i(){var n=[],r=[];return t((function(){n.push.apply(n,Ie(arguments))}),{def:function(){var t="v"+e++;return r.push(t),arguments.length>0&&(n.push(t,"="),n.push.apply(n,Ie(arguments)),n.push(";")),t},toString:function(){return Pe([r.length>0?"var "+r.join(",")+";":"",Pe(n)])}})}function a(){var e=i(),n=i(),r=e.toString,a=n.toString;function o(t,r){n(t,r,"=",e.def(t,r),";")}return t((function(){e.apply(e,Ie(arguments))}),{def:e.def,entry:e,exit:n,save:o,set:function(t,n,r){o(t,n),e(t,n,"=",r,";")},toString:function(){return r()+a()}})}var o=i(),u={};return{global:o,link:function(t){for(var i=0;i<r.length;++i)if(r[i]===t)return n[i];var a="g"+e++;return n.push(a),r.push(t),a},block:i,proc:function(e,n){var r=[];function i(){var e="a"+r.length;return r.push(e),e}n=n||0;for(var o=0;o<n;++o)i();var s=a(),c=s.toString;return u[e]=t(s,{arg:i,toString:function(){return Pe(["function(",r.join(),"){",c(),"}"])}})},scope:a,cond:function(){var e=Pe(arguments),n=a(),r=a(),i=n.toString,o=r.toString;return t(n,{then:function(){return n.apply(n,Ie(arguments)),this},else:function(){return r.apply(r,Ie(arguments)),this},toString:function(){var t=o();return t&&(t="else{"+t+"}"),Pe(["if(",e,"){",i(),"}",t])}})},compile:function(){var e=['"use strict";',o,"return {"];Object.keys(u).forEach((function(t){e.push('"',t,'":',u[t].toString(),",")})),e.push("}");var t=Pe(e).replace(/;/g,";\n").replace(/}/g,"}\n").replace(/{/g,"{\n");return Function.apply(null,n.concat(t)).apply(null,r)}}}(),r=e.link,i=e.global;e.id=k++,e.batchId="0";var a=r(M),o=e.shared={props:"a0"};Object.keys(M).forEach((function(e){o[e]=i.def(a,".",e)})),E.optional((function(){e.CHECK=r(E),e.commandStr=E.guessCommand(),e.command=r(e.commandStr),e.assert=function(e,t,n){e("if(!(",t,"))",this.CHECK,".commandRaise(",r(n),",",this.command,");")},F.invalidBlendCombinations=Qe}));var u=e.next={},s=e.current={};Object.keys(w).forEach((function(e){Array.isArray(A[e])&&(u[e]=i.def(o.next,".",e),s[e]=i.def(o.current,".",e))}));var c=e.constants={};Object.keys(F).forEach((function(e){c[e]=i.def(JSON.stringify(F[e]))})),e.invoke=function(t,n){switch(n.type){case 0:var i=["this",o.context,o.props,e.batchId];return t.def(r(n.data),".call(",i.slice(0,Math.max(n.data.length+1,4)),")");case 1:return t.def(o.props,n.data);case 2:return t.def(o.context,n.data);case 3:return t.def("this",n.data);case 4:return n.data.append(e,t),n.data.ref}},e.attribCache={};var l={};return e.scopeAttrib=function(e){var t=n.id(e);if(t in l)return l[t];var i=f.scope[t];return i||(i=f.scope[t]=new y),l[t]=r(i)},e}function P(e,t,u,c,p){var h=e.static,d=e.dynamic;E.optional((function(){var e=[Ne,Ge,Le,ze,Ve,We,Ue,qe,Re,He].concat(C);function t(t){Object.keys(t).forEach((function(t){E.command(e.indexOf(t)>=0,'unknown parameter "'+t+'"',p.commandStr)}))}t(h),t(d)}));var m=function(e,t){var n=e.static;if("string"==typeof n[Le]&&"string"==typeof n[Ge]){if(Object.keys(t.dynamic).length>0)return null;var r=t.static,i=Object.keys(r);if(i.length>0&&"number"==typeof r[i[0]]){for(var a=[],o=0;o<i.length;++o)E("number"==typeof r[i[o]],"must specify all vertex attribute locations when using vaos"),a.push([0|r[i[o]],i[o]]);return a}}return null}(e,t),b=function(e,t){var n=e.static,r=e.dynamic;if(Ne in n){var i=n[Ne];return i?(i=s.getFramebuffer(i),E.command(i,"invalid framebuffer object"),ot((function(e,t){var n=e.link(i),r=e.shared;t.set(r.framebuffer,".next",n);var a=r.context;return t.set(a,"."+Xe,n+".width"),t.set(a,"."+Ke,n+".height"),n}))):ot((function(e,t){var n=e.shared;t.set(n.framebuffer,".next","null");var r=n.context;return t.set(r,"."+Xe,r+".drawingBufferWidth"),t.set(r,"."+Ke,r+".drawingBufferHeight"),"null"}))}if(Ne in r){var a=r[Ne];return ut(a,(function(e,t){var n=e.invoke(t,a),r=e.shared,i=r.framebuffer,o=t.def(i,".getFramebuffer(",n,")");E.optional((function(){e.assert(t,"!"+n+"||"+o,"invalid framebuffer object")})),t.set(i,".next",o);var u=r.context;return t.set(u,"."+Xe,o+"?"+o+".width:"+u+".drawingBufferWidth"),t.set(u,"."+Ke,o+"?"+o+".height:"+u+".drawingBufferHeight"),o}))}return null}(e),A=function(e,t,n){var r=e.static,i=e.dynamic;function a(e){if(e in r){var a=r[e];E.commandType(a,"object","invalid "+e,n.commandStr);var o,u,s=!0,c=0|a.x,f=0|a.y;return"width"in a?(o=0|a.width,E.command(o>=0,"invalid "+e,n.commandStr)):s=!1,"height"in a?(u=0|a.height,E.command(u>=0,"invalid "+e,n.commandStr)):s=!1,new it(!s&&t&&t.thisDep,!s&&t&&t.contextDep,!s&&t&&t.propDep,(function(e,t){var n=e.shared.context,r=o;"width"in a||(r=t.def(n,".",Xe,"-",c));var i=u;return"height"in a||(i=t.def(n,".",Ke,"-",f)),[c,f,r,i]}))}if(e in i){var l=i[e],p=ut(l,(function(t,n){var r=t.invoke(n,l);E.optional((function(){t.assert(n,r+"&&typeof "+r+'==="object"',"invalid "+e)}));var i=t.shared.context,a=n.def(r,".x|0"),o=n.def(r,".y|0"),u=n.def('"width" in ',r,"?",r,".width|0:","(",i,".",Xe,"-",a,")"),s=n.def('"height" in ',r,"?",r,".height|0:","(",i,".",Ke,"-",o,")");return E.optional((function(){t.assert(n,u+">=0&&"+s+">=0","invalid "+e)})),[a,o,u,s]}));return t&&(p.thisDep=p.thisDep||t.thisDep,p.contextDep=p.contextDep||t.contextDep,p.propDep=p.propDep||t.propDep),p}return t?new it(t.thisDep,t.contextDep,t.propDep,(function(e,t){var n=e.shared.context;return[0,0,t.def(n,".",Xe),t.def(n,".",Ke)]})):null}var o=a("viewport");if(o){var u=o;o=new it(o.thisDep,o.contextDep,o.propDep,(function(e,t){var n=u.append(e,t),r=e.shared.context;return t.set(r,".viewportWidth",n[2]),t.set(r,".viewportHeight",n[3]),n}))}return{viewport:o,scissor_box:a("scissor.box")}}(e,b,p),x=function(e,t){var n=e.static,r=e.dynamic,i=function(){if(ze in n){var e=n[ze];nt(e)?e=o.getElements(o.create(e,!0)):e&&(e=o.getElements(e),E.command(e,"invalid elements",t.commandStr));var i=ot((function(t,n){if(e){var r=t.link(e);return t.ELEMENTS=r,r}return t.ELEMENTS=null,null}));return i.value=e,i}if(ze in r){var a=r[ze];return ut(a,(function(e,t){var n=e.shared,r=n.isBufferArgs,i=n.elements,o=e.invoke(t,a),u=t.def("null"),s=t.def(r,"(",o,")"),c=e.cond(s).then(u,"=",i,".createStream(",o,");").else(u,"=",i,".getElements(",o,");");return E.optional((function(){e.assert(c.else,"!"+o+"||"+u,"invalid elements")})),t.entry(c),t.exit(e.cond(s).then(i,".destroyStream(",u,");")),e.ELEMENTS=u,u}))}return null}();function a(e,a){if(e in n){var o=0|n[e];return E.command(!a||o>=0,"invalid "+e,t.commandStr),ot((function(e,t){return a&&(e.OFFSET=o),o}))}if(e in r){var u=r[e];return ut(u,(function(t,n){var r=t.invoke(n,u);return a&&(t.OFFSET=r,E.optional((function(){t.assert(n,r+">=0","invalid "+e)}))),r}))}return a&&i?ot((function(e,t){return e.OFFSET="0",0})):null}var u=a(We,!0);return{elements:i,primitive:function(){if(Ve in n){var e=n[Ve];return E.commandParameter(e,Y,"invalid primitve",t.commandStr),ot((function(t,n){return Y[e]}))}if(Ve in r){var a=r[Ve];return ut(a,(function(e,t){var n=e.constants.primTypes,r=e.invoke(t,a);return E.optional((function(){e.assert(t,r+" in "+n,"invalid primitive, must be one of "+Object.keys(Y))})),t.def(n,"[",r,"]")}))}return i?at(i)?i.value?ot((function(e,t){return t.def(e.ELEMENTS,".primType")})):ot((function(){return 4})):new it(i.thisDep,i.contextDep,i.propDep,(function(e,t){var n=e.ELEMENTS;return t.def(n,"?",n,".primType:",4)})):null}(),count:function(){if(Ue in n){var e=0|n[Ue];return E.command("number"==typeof e&&e>=0,"invalid vertex count",t.commandStr),ot((function(){return e}))}if(Ue in r){var a=r[Ue];return ut(a,(function(e,t){var n=e.invoke(t,a);return E.optional((function(){e.assert(t,"typeof "+n+'==="number"&&'+n+">=0&&"+n+"===("+n+"|0)","invalid vertex count")})),n}))}if(i){if(at(i)){if(i)return u?new it(u.thisDep,u.contextDep,u.propDep,(function(e,t){var n=t.def(e.ELEMENTS,".vertCount-",e.OFFSET);return E.optional((function(){e.assert(t,n+">=0","invalid vertex offset/element buffer too small")})),n})):ot((function(e,t){return t.def(e.ELEMENTS,".vertCount")}));var o=ot((function(){return-1}));return E.optional((function(){o.MISSING=!0})),o}var s=new it(i.thisDep||u.thisDep,i.contextDep||u.contextDep,i.propDep||u.propDep,(function(e,t){var n=e.ELEMENTS;return e.OFFSET?t.def(n,"?",n,".vertCount-",e.OFFSET,":-1"):t.def(n,"?",n,".vertCount:-1")}));return E.optional((function(){s.DYNAMIC=!0})),s}return null}(),instances:a(qe,!1),offset:u}}(e,p),S=function(e,t){var n=e.static,r=e.dynamic,a={};return C.forEach((function(e){var o=D(e);function u(t,i){if(e in n){var u=t(n[e]);a[o]=ot((function(){return u}))}else if(e in r){var s=r[e];a[o]=ut(s,(function(e,t){return i(e,t,e.invoke(t,s))}))}}switch(e){case"cull.enable":case"blend.enable":case"dither":case"stencil.enable":case"depth.enable":case"scissor.enable":case"polygonOffset.enable":case"sample.alpha":case"sample.enable":case"depth.mask":return u((function(n){return E.commandType(n,"boolean",e,t.commandStr),n}),(function(t,n,r){return E.optional((function(){t.assert(n,"typeof "+r+'==="boolean"',"invalid flag "+e,t.commandStr)})),r}));case"depth.func":return u((function(n){return E.commandParameter(n,Ze,"invalid "+e,t.commandStr),Ze[n]}),(function(t,n,r){var i=t.constants.compareFuncs;return E.optional((function(){t.assert(n,r+" in "+i,"invalid "+e+", must be one of "+Object.keys(Ze))})),n.def(i,"[",r,"]")}));case"depth.range":return u((function(e){return E.command($(e)&&2===e.length&&"number"==typeof e[0]&&"number"==typeof e[1]&&e[0]<=e[1],"depth range is 2d array",t.commandStr),e}),(function(e,t,n){return E.optional((function(){e.assert(t,e.shared.isArrayLike+"("+n+")&&"+n+".length===2&&typeof "+n+'[0]==="number"&&typeof '+n+'[1]==="number"&&'+n+"[0]<="+n+"[1]","depth range must be a 2d array")})),[t.def("+",n,"[0]"),t.def("+",n,"[1]")]}));case"blend.func":return u((function(e){E.commandType(e,"object","blend.func",t.commandStr);var n="srcRGB"in e?e.srcRGB:e.src,r="srcAlpha"in e?e.srcAlpha:e.src,i="dstRGB"in e?e.dstRGB:e.dst,a="dstAlpha"in e?e.dstAlpha:e.dst;return E.commandParameter(n,Je,o+".srcRGB",t.commandStr),E.commandParameter(r,Je,o+".srcAlpha",t.commandStr),E.commandParameter(i,Je,o+".dstRGB",t.commandStr),E.commandParameter(a,Je,o+".dstAlpha",t.commandStr),E.command(-1===Qe.indexOf(n+", "+i),"unallowed blending combination (srcRGB, dstRGB) = ("+n+", "+i+")",t.commandStr),[Je[n],Je[i],Je[r],Je[a]]}),(function(t,n,r){var i=t.constants.blendFuncs;function a(a,o){var u=n.def('"',a,o,'" in ',r,"?",r,".",a,o,":",r,".",a);return E.optional((function(){t.assert(n,u+" in "+i,"invalid "+e+"."+a+o+", must be one of "+Object.keys(Je))})),u}E.optional((function(){t.assert(n,r+"&&typeof "+r+'==="object"',"invalid blend func, must be an object")}));var o=a("src","RGB"),u=a("dst","RGB");E.optional((function(){var e=t.constants.invalidBlendCombinations;t.assert(n,e+".indexOf("+o+'+", "+'+u+") === -1 ","unallowed blending combination for (srcRGB, dstRGB)")}));var s=n.def(i,"[",o,"]"),c=n.def(i,"[",a("src","Alpha"),"]");return[s,n.def(i,"[",u,"]"),c,n.def(i,"[",a("dst","Alpha"),"]")]}));case"blend.equation":return u((function(n){return"string"==typeof n?(E.commandParameter(n,v,"invalid "+e,t.commandStr),[v[n],v[n]]):"object"==typeof n?(E.commandParameter(n.rgb,v,e+".rgb",t.commandStr),E.commandParameter(n.alpha,v,e+".alpha",t.commandStr),[v[n.rgb],v[n.alpha]]):void E.commandRaise("invalid blend.equation",t.commandStr)}),(function(t,n,r){var i=t.constants.blendEquations,a=n.def(),o=n.def(),u=t.cond("typeof ",r,'==="string"');return E.optional((function(){function n(e,n,r){t.assert(e,r+" in "+i,"invalid "+n+", must be one of "+Object.keys(v))}n(u.then,e,r),t.assert(u.else,r+"&&typeof "+r+'==="object"',"invalid "+e),n(u.else,e+".rgb",r+".rgb"),n(u.else,e+".alpha",r+".alpha")})),u.then(a,"=",o,"=",i,"[",r,"];"),u.else(a,"=",i,"[",r,".rgb];",o,"=",i,"[",r,".alpha];"),n(u),[a,o]}));case"blend.color":return u((function(e){return E.command($(e)&&4===e.length,"blend.color must be a 4d array",t.commandStr),O(4,(function(t){return+e[t]}))}),(function(e,t,n){return E.optional((function(){e.assert(t,e.shared.isArrayLike+"("+n+")&&"+n+".length===4","blend.color must be a 4d array")})),O(4,(function(e){return t.def("+",n,"[",e,"]")}))}));case"stencil.mask":return u((function(e){return E.commandType(e,"number",o,t.commandStr),0|e}),(function(e,t,n){return E.optional((function(){e.assert(t,"typeof "+n+'==="number"',"invalid stencil.mask")})),t.def(n,"|0")}));case"stencil.func":return u((function(n){E.commandType(n,"object",o,t.commandStr);var r=n.cmp||"keep",i=n.ref||0,a="mask"in n?n.mask:-1;return E.commandParameter(r,Ze,e+".cmp",t.commandStr),E.commandType(i,"number",e+".ref",t.commandStr),E.commandType(a,"number",e+".mask",t.commandStr),[Ze[r],i,a]}),(function(e,t,n){var r=e.constants.compareFuncs;return E.optional((function(){function i(){e.assert(t,Array.prototype.join.call(arguments,""),"invalid stencil.func")}i(n+"&&typeof ",n,'==="object"'),i('!("cmp" in ',n,")||(",n,".cmp in ",r,")")})),[t.def('"cmp" in ',n,"?",r,"[",n,".cmp]",":",7680),t.def(n,".ref|0"),t.def('"mask" in ',n,"?",n,".mask|0:-1")]}));case"stencil.opFront":case"stencil.opBack":return u((function(n){E.commandType(n,"object",o,t.commandStr);var r=n.fail||"keep",i=n.zfail||"keep",a=n.zpass||"keep";return E.commandParameter(r,$e,e+".fail",t.commandStr),E.commandParameter(i,$e,e+".zfail",t.commandStr),E.commandParameter(a,$e,e+".zpass",t.commandStr),["stencil.opBack"===e?1029:1028,$e[r],$e[i],$e[a]]}),(function(t,n,r){var i=t.constants.stencilOps;function a(a){return E.optional((function(){t.assert(n,'!("'+a+'" in '+r+")||("+r+"."+a+" in "+i+")","invalid "+e+"."+a+", must be one of "+Object.keys($e))})),n.def('"',a,'" in ',r,"?",i,"[",r,".",a,"]:",7680)}return E.optional((function(){t.assert(n,r+"&&typeof "+r+'==="object"',"invalid "+e)})),["stencil.opBack"===e?1029:1028,a("fail"),a("zfail"),a("zpass")]}));case"polygonOffset.offset":return u((function(e){E.commandType(e,"object",o,t.commandStr);var n=0|e.factor,r=0|e.units;return E.commandType(n,"number",o+".factor",t.commandStr),E.commandType(r,"number",o+".units",t.commandStr),[n,r]}),(function(t,n,r){return E.optional((function(){t.assert(n,r+"&&typeof "+r+'==="object"',"invalid "+e)})),[n.def(r,".factor|0"),n.def(r,".units|0")]}));case"cull.face":return u((function(e){var n=0;return"front"===e?n=1028:"back"===e&&(n=1029),E.command(!!n,o,t.commandStr),n}),(function(e,t,n){return E.optional((function(){e.assert(t,n+'==="front"||'+n+'==="back"',"invalid cull.face")})),t.def(n,'==="front"?',1028,":",1029)}));case"lineWidth":return u((function(e){return E.command("number"==typeof e&&e>=i.lineWidthDims[0]&&e<=i.lineWidthDims[1],"invalid line width, must be a positive number between "+i.lineWidthDims[0]+" and "+i.lineWidthDims[1],t.commandStr),e}),(function(e,t,n){return E.optional((function(){e.assert(t,"typeof "+n+'==="number"&&'+n+">="+i.lineWidthDims[0]+"&&"+n+"<="+i.lineWidthDims[1],"invalid line width")})),n}));case"frontFace":return u((function(e){return E.commandParameter(e,tt,o,t.commandStr),tt[e]}),(function(e,t,n){return E.optional((function(){e.assert(t,n+'==="cw"||'+n+'==="ccw"',"invalid frontFace, must be one of cw,ccw")})),t.def(n+'==="cw"?2304:2305')}));case"colorMask":return u((function(e){return E.command($(e)&&4===e.length,"color.mask must be length 4 array",t.commandStr),e.map((function(e){return!!e}))}),(function(e,t,n){return E.optional((function(){e.assert(t,e.shared.isArrayLike+"("+n+")&&"+n+".length===4","invalid color.mask")})),O(4,(function(e){return"!!"+n+"["+e+"]"}))}));case"sample.coverage":return u((function(e){E.command("object"==typeof e&&e,o,t.commandStr);var n="value"in e?e.value:1,r=!!e.invert;return E.command("number"==typeof n&&n>=0&&n<=1,"sample.coverage.value must be a number between 0 and 1",t.commandStr),[n,r]}),(function(e,t,n){return E.optional((function(){e.assert(t,n+"&&typeof "+n+'==="object"',"invalid sample.coverage")})),[t.def('"value" in ',n,"?+",n,".value:1"),t.def("!!",n,".invert")]}))}})),a}(e,p),w=function(e,t,r){var i=e.static,a=e.dynamic;function o(e){if(e in i){var t=n.id(i[e]);E.optional((function(){l.shader(et[e],t,E.guessCommand())}));var r=ot((function(){return t}));return r.id=t,r}if(e in a){var o=a[e];return ut(o,(function(t,n){var r=t.invoke(n,o),i=n.def(t.shared.strings,".id(",r,")");return E.optional((function(){n(t.shared.shader,".shader(",et[e],",",i,",",t.command,");")})),i}))}return null}var u,s=o(Le),c=o(Ge),f=null;return at(s)&&at(c)?(f=l.program(c.id,s.id,null,r),u=ot((function(e,t){return e.link(f)}))):u=new it(s&&s.thisDep||c&&c.thisDep,s&&s.contextDep||c&&c.contextDep,s&&s.propDep||c&&c.propDep,(function(e,t){var n,r=e.shared.shader;n=s?s.append(e,t):t.def(r,".",Le);var i=r+".program("+(c?c.append(e,t):t.def(r,".",Ge))+","+n;return E.optional((function(){i+=","+e.command})),t.def(i+")")})),{frag:s,vert:c,progVar:u,program:f}}(e,0,m);function T(e){var t=A[e];t&&(S[e]=t)}T("viewport"),T(D("scissor.box"));var B=Object.keys(S).length>0,_={framebuffer:b,draw:x,shader:w,state:S,dirty:B,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(_.profile=function(e){var t,n=e.static,r=e.dynamic;if(Re in n){var i=!!n[Re];(t=ot((function(e,t){return i}))).enable=i}else if(Re in r){var a=r[Re];t=ut(a,(function(e,t){return e.invoke(t,a)}))}return t}(e),_.uniforms=function(e,t){var n=e.static,r=e.dynamic,i={};return Object.keys(n).forEach((function(e){var r,a=n[e];if("number"==typeof a||"boolean"==typeof a)r=ot((function(){return a}));else if("function"==typeof a){var o=a._reglType;"texture2d"===o||"textureCube"===o?r=ot((function(e){return e.link(a)})):"framebuffer"===o||"framebufferCube"===o?(E.command(a.color.length>0,'missing color attachment for framebuffer sent to uniform "'+e+'"',t.commandStr),r=ot((function(e){return e.link(a.color[0])}))):E.commandRaise('invalid data for uniform "'+e+'"',t.commandStr)}else $(a)?r=ot((function(t){return t.global.def("[",O(a.length,(function(n){return E.command("number"==typeof a[n]||"boolean"==typeof a[n],"invalid uniform "+e,t.commandStr),a[n]})),"]")})):E.commandRaise('invalid or missing data for uniform "'+e+'"',t.commandStr);r.value=a,i[e]=r})),Object.keys(r).forEach((function(e){var t=r[e];i[e]=ut(t,(function(e,n){return e.invoke(n,t)}))})),i}(u,p),_.drawVAO=_.scopeVAO=function(e,t){var n=e.static,r=e.dynamic;if(He in n){var i=n[He];return null!==i&&null===f.getVAO(i)&&(i=f.createVAO(i)),ot((function(e){return e.link(f.getVAO(i))}))}if(He in r){var a=r[He];return ut(a,(function(e,t){var n=e.invoke(t,a);return t.def(e.shared.vao+".getVAO("+n+")")}))}return null}(e),!_.drawVAO&&w.program&&!m&&r.angle_instanced_arrays){var M=!0,F=w.program.attributes.map((function(e){var n=t.static[e];return M=M&&!!n,n}));if(M&&F.length>0){var k=f.getVAO(f.createVAO(F));_.drawVAO=new it(null,null,null,(function(e,t){return e.link(k)})),_.useVAO=!0}}return m?_.useVAO=!0:_.attributes=function(e,t){var r=e.static,i=e.dynamic,o={};return Object.keys(r).forEach((function(e){var i=r[e],u=n.id(e),s=new y;if(nt(i))s.state=1,s.buffer=a.getBuffer(a.create(i,34962,!1,!0)),s.type=0;else{var c=a.getBuffer(i);if(c)s.state=1,s.buffer=c,s.type=0;else if(E.command("object"==typeof i&&i,"invalid data for attribute "+e,t.commandStr),"constant"in i){var f=i.constant;s.buffer="null",s.state=2,"number"==typeof f?s.x=f:(E.command($(f)&&f.length>0&&f.length<=4,"invalid constant for attribute "+e,t.commandStr),je.forEach((function(e,t){t<f.length&&(s[e]=f[t])})))}else{c=nt(i.buffer)?a.getBuffer(a.create(i.buffer,34962,!1,!0)):a.getBuffer(i.buffer),E.command(!!c,'missing buffer for attribute "'+e+'"',t.commandStr);var l=0|i.offset;E.command(l>=0,'invalid offset for attribute "'+e+'"',t.commandStr);var p=0|i.stride;E.command(p>=0&&p<256,'invalid stride for attribute "'+e+'", must be integer betweeen [0, 255]',t.commandStr);var h=0|i.size;E.command(!("size"in i)||h>0&&h<=4,'invalid size for attribute "'+e+'", must be 1,2,3,4',t.commandStr);var d=!!i.normalized,m=0;"type"in i&&(E.commandParameter(i.type,z,"invalid type for attribute "+e,t.commandStr),m=z[i.type]);var v=0|i.divisor;"divisor"in i&&(E.command(0===v||g,'cannot specify divisor for attribute "'+e+'", instancing not supported',t.commandStr),E.command(v>=0,'invalid divisor for attribute "'+e+'"',t.commandStr)),E.optional((function(){var n=t.commandStr,r=["buffer","offset","divisor","normalized","type","size","stride"];Object.keys(i).forEach((function(t){E.command(r.indexOf(t)>=0,'unknown parameter "'+t+'" for attribute pointer "'+e+'" (valid parameters are '+r+")",n)}))})),s.buffer=c,s.state=1,s.size=h,s.normalized=d,s.type=m||c.dtype,s.offset=l,s.stride=p,s.divisor=v}}o[e]=ot((function(e,t){var n=e.attribCache;if(u in n)return n[u];var r={isStream:!1};return Object.keys(s).forEach((function(e){r[e]=s[e]})),s.buffer&&(r.buffer=e.link(s.buffer),r.type=r.type||r.buffer+".dtype"),n[u]=r,r}))})),Object.keys(i).forEach((function(e){var t=i[e];o[e]=ut(t,(function(n,r){var i=n.invoke(r,t),a=n.shared,o=n.constants,u=a.isBufferArgs,s=a.buffer;E.optional((function(){n.assert(r,i+"&&(typeof "+i+'==="object"||typeof '+i+'==="function")&&('+u+"("+i+")||"+s+".getBuffer("+i+")||"+s+".getBuffer("+i+".buffer)||"+u+"("+i+'.buffer)||("constant" in '+i+"&&(typeof "+i+'.constant==="number"||'+a.isArrayLike+"("+i+".constant))))",'invalid dynamic attribute "'+e+'"')}));var c={isStream:r.def(!1)},f=new y;f.state=1,Object.keys(f).forEach((function(e){c[e]=r.def(""+f[e])}));var l=c.buffer,p=c.type;function h(e){r(c[e],"=",i,".",e,"|0;")}return r("if(",u,"(",i,")){",c.isStream,"=true;",l,"=",s,".createStream(",34962,",",i,");",p,"=",l,".dtype;","}else{",l,"=",s,".getBuffer(",i,");","if(",l,"){",p,"=",l,".dtype;",'}else if("constant" in ',i,"){",c.state,"=",2,";","if(typeof "+i+'.constant === "number"){',c[je[0]],"=",i,".constant;",je.slice(1).map((function(e){return c[e]})).join("="),"=0;","}else{",je.map((function(e,t){return c[e]+"="+i+".constant.length>"+t+"?"+i+".constant["+t+"]:0;"})).join(""),"}}else{","if(",u,"(",i,".buffer)){",l,"=",s,".createStream(",34962,",",i,".buffer);","}else{",l,"=",s,".getBuffer(",i,".buffer);","}",p,'="type" in ',i,"?",o.glTypes,"[",i,".type]:",l,".dtype;",c.normalized,"=!!",i,".normalized;"),h("size"),h("offset"),h("stride"),h("divisor"),r("}}"),r.exit("if(",c.isStream,"){",s,".destroyStream(",l,");","}"),c}))})),o}(t,p),_.context=function(e){var t=e.static,n=e.dynamic,r={};return Object.keys(t).forEach((function(e){var n=t[e];r[e]=ot((function(e,t){return"number"==typeof n||"boolean"==typeof n?""+n:e.link(n)}))})),Object.keys(n).forEach((function(e){var t=n[e];r[e]=ut(t,(function(e,n){return e.invoke(n,t)}))})),r}(c),_}function j(e,t,n){var r=e.shared.context,i=e.scope();Object.keys(n).forEach((function(a){t.save(r,"."+a);var o=n[a];i(r,".",a,"=",o.append(e,t),";")})),t(i)}function R(e,t,n,r){var i,a=e.shared,o=a.gl,u=a.framebuffer;b&&(i=t.def(a.extensions,".webgl_draw_buffers"));var s,c=e.constants,f=c.drawBuffer,l=c.backBuffer;s=n?n.append(e,t):t.def(u,".next"),r||t("if(",s,"!==",u,".cur){"),t("if(",s,"){",o,".bindFramebuffer(",36160,",",s,".framebuffer);"),b&&t(i,".drawBuffersWEBGL(",f,"[",s,".colorAttachments.length]);"),t("}else{",o,".bindFramebuffer(",36160,",null);"),b&&t(i,".drawBuffersWEBGL(",l,");"),t("}",u,".cur=",s,";"),r||t("}")}function N(e,t,n){var r=e.shared,i=r.gl,a=e.current,o=e.next,u=r.current,s=r.next,c=e.cond(u,".dirty");C.forEach((function(t){var r,f,l=D(t);if(!(l in n.state))if(l in o){r=o[l],f=a[l];var p=O(A[l].length,(function(e){return c.def(r,"[",e,"]")}));c(e.cond(p.map((function(e,t){return e+"!=="+f+"["+t+"]"})).join("||")).then(i,".",w[l],"(",p,");",p.map((function(e,t){return f+"["+t+"]="+e})).join(";"),";"))}else{r=c.def(s,".",l);var h=e.cond(r,"!==",u,".",l);c(h),l in S?h(e.cond(r).then(i,".enable(",S[l],");").else(i,".disable(",S[l],");"),u,".",l,"=",r,";"):h(i,".",w[l],"(",r,");",u,".",l,"=",r,";")}})),0===Object.keys(n.state).length&&c(u,".dirty=false;"),t(c)}function G(e,t,n,r){var i=e.shared,a=e.current,o=i.current,u=i.gl;rt(Object.keys(n)).forEach((function(i){var s=n[i];if(!r||r(s)){var c=s.append(e,t);if(S[i]){var f=S[i];at(s)?t(u,c?".enable(":".disable(",f,");"):t(e.cond(c).then(u,".enable(",f,");").else(u,".disable(",f,");")),t(o,".",i,"=",c,";")}else if($(c)){var l=a[i];t(u,".",w[i],"(",c,");",c.map((function(e,t){return l+"["+t+"]="+e})).join(";"),";")}else t(u,".",w[i],"(",c,");",o,".",i,"=",c,";")}}))}function L(e,t){g&&(e.instancing=t.def(e.shared.extensions,".angle_instanced_arrays"))}function V(e,t,n,r,i){var a,o,u,s=e.shared,c=e.stats,f=s.current,l=s.timer,p=n.profile;function h(){return"undefined"==typeof performance?"Date.now()":"performance.now()"}function m(e){e(a=t.def(),"=",h(),";"),"string"==typeof i?e(c,".count+=",i,";"):e(c,".count++;"),d&&(r?e(o=t.def(),"=",l,".getNumPendingQueries();"):e(l,".beginQuery(",c,");"))}function y(e){e(c,".cpuTime+=",h(),"-",a,";"),d&&(r?e(l,".pushScopeStats(",o,",",l,".getNumPendingQueries(),",c,");"):e(l,".endQuery();"))}function v(e){var n=t.def(f,".profile");t(f,".profile=",e,";"),t.exit(f,".profile=",n,";")}if(p){if(at(p))return void(p.enable?(m(t),y(t.exit),v("true")):v("false"));v(u=p.append(e,t))}else u=t.def(f,".profile");var g=e.block();m(g),t("if(",u,"){",g,"}");var b=e.block();y(b),t.exit("if(",u,"){",b,"}")}function U(e,t,n,r,i){var a=e.shared;r.forEach((function(r){var o,u=r.name,s=n.attributes[u];if(s){if(!i(s))return;o=s.append(e,t)}else{if(!i(st))return;var c=e.scopeAttrib(u);E.optional((function(){e.assert(t,c+".state","missing attribute "+u)})),o={},Object.keys(new y).forEach((function(e){o[e]=t.def(c,".",e)}))}!function(n,r,i){var o=a.gl,u=t.def(n,".location"),s=t.def(a.attributes,"[",u,"]"),c=i.state,f=i.buffer,l=[i.x,i.y,i.z,i.w],p=["buffer","normalized","offset","stride"];function h(){t("if(!",s,".buffer){",o,".enableVertexAttribArray(",u,");}");var n,a=i.type;if(n=i.size?t.def(i.size,"||",r):r,t("if(",s,".type!==",a,"||",s,".size!==",n,"||",p.map((function(e){return s+"."+e+"!=="+i[e]})).join("||"),"){",o,".bindBuffer(",34962,",",f,".buffer);",o,".vertexAttribPointer(",[u,n,a,i.normalized,i.stride,i.offset],");",s,".type=",a,";",s,".size=",n,";",p.map((function(e){return s+"."+e+"="+i[e]+";"})).join(""),"}"),g){var c=i.divisor;t("if(",s,".divisor!==",c,"){",e.instancing,".vertexAttribDivisorANGLE(",[u,c],");",s,".divisor=",c,";}")}}function d(){t("if(",s,".buffer){",o,".disableVertexAttribArray(",u,");",s,".buffer=null;","}if(",je.map((function(e,t){return s+"."+e+"!=="+l[t]})).join("||"),"){",o,".vertexAttrib4f(",u,",",l,");",je.map((function(e,t){return s+"."+e+"="+l[t]+";"})).join(""),"}")}1===c?h():2===c?d():(t("if(",c,"===",1,"){"),h(),t("}else{"),d(),t("}"))}(e.link(r),function(e){switch(e){case 35664:case 35667:case 35671:return 2;case 35665:case 35668:case 35672:return 3;case 35666:case 35669:case 35673:return 4;default:return 1}}(r.info.type),o)}))}function W(e,t,r,i,a){for(var o,u=e.shared,s=u.gl,c=0;c<i.length;++c){var f,l=i[c],p=l.name,h=l.info.type,d=r.uniforms[p],m=e.link(l)+".location";if(d){if(!a(d))continue;if(at(d)){var y=d.value;if(E.command(null!=y,'missing uniform "'+p+'"',e.commandStr),35678===h||35680===h){E.command("function"==typeof y&&(35678===h&&("texture2d"===y._reglType||"framebuffer"===y._reglType)||35680===h&&("textureCube"===y._reglType||"framebufferCube"===y._reglType)),"invalid texture for uniform "+p,e.commandStr);var v=e.link(y._texture||y.color[0]._texture);t(s,".uniform1i(",m,",",v+".bind());"),t.exit(v,".unbind();")}else if(35674===h||35675===h||35676===h){E.optional((function(){E.command($(y),"invalid matrix for uniform "+p,e.commandStr),E.command(35674===h&&4===y.length||35675===h&&9===y.length||35676===h&&16===y.length,"invalid length for matrix uniform "+p,e.commandStr)}));var g=e.global.def("new Float32Array(["+Array.prototype.slice.call(y)+"])"),b=2;35675===h?b=3:35676===h&&(b=4),t(s,".uniformMatrix",b,"fv(",m,",false,",g,");")}else{switch(h){case 5126:E.commandType(y,"number","uniform "+p,e.commandStr),o="1f";break;case 35664:E.command($(y)&&2===y.length,"uniform "+p,e.commandStr),o="2f";break;case 35665:E.command($(y)&&3===y.length,"uniform "+p,e.commandStr),o="3f";break;case 35666:E.command($(y)&&4===y.length,"uniform "+p,e.commandStr),o="4f";break;case 35670:E.commandType(y,"boolean","uniform "+p,e.commandStr),o="1i";break;case 5124:E.commandType(y,"number","uniform "+p,e.commandStr),o="1i";break;case 35671:case 35667:E.command($(y)&&2===y.length,"uniform "+p,e.commandStr),o="2i";break;case 35672:case 35668:E.command($(y)&&3===y.length,"uniform "+p,e.commandStr),o="3i";break;case 35673:case 35669:E.command($(y)&&4===y.length,"uniform "+p,e.commandStr),o="4i"}t(s,".uniform",o,"(",m,",",$(y)?Array.prototype.slice.call(y):y,");")}continue}f=d.append(e,t)}else{if(!a(st))continue;f=t.def(u.uniforms,"[",n.id(p),"]")}35678===h?t("if(",f,"&&",f,'._reglType==="framebuffer"){',f,"=",f,".color[0];","}"):35680===h&&t("if(",f,"&&",f,'._reglType==="framebufferCube"){',f,"=",f,".color[0];","}"),E.optional((function(){function n(n,r){e.assert(t,n,'bad data or missing for uniform "'+p+'". '+r)}function r(e){n("typeof "+f+'==="'+e+'"',"invalid type, expected "+e)}function i(t,r){n(u.isArrayLike+"("+f+")&&"+f+".length==="+t,"invalid vector, should have length "+t,e.commandStr)}function a(t){n("typeof "+f+'==="function"&&'+f+'._reglType==="texture'+(3553===t?"2d":"Cube")+'"',"invalid texture type",e.commandStr)}switch(h){case 5124:r("number");break;case 35667:i(2);break;case 35668:i(3);break;case 35669:i(4);break;case 5126:r("number");break;case 35664:i(2);break;case 35665:i(3);break;case 35666:i(4);break;case 35670:r("boolean");break;case 35671:i(2);break;case 35672:i(3);break;case 35673:case 35674:i(4);break;case 35675:i(9);break;case 35676:i(16);break;case 35678:a(3553);break;case 35680:a(34067)}}));var A=1;switch(h){case 35678:case 35680:var x=t.def(f,"._texture");t(s,".uniform1i(",m,",",x,".bind());"),t.exit(x,".unbind();");continue;case 5124:case 35670:o="1i";break;case 35667:case 35671:o="2i",A=2;break;case 35668:case 35672:o="3i",A=3;break;case 35669:case 35673:o="4i",A=4;break;case 5126:o="1f";break;case 35664:o="2f",A=2;break;case 35665:o="3f",A=3;break;case 35666:o="4f",A=4;break;case 35674:o="Matrix2fv";break;case 35675:o="Matrix3fv";break;case 35676:o="Matrix4fv"}if(t(s,".uniform",o,"(",m,","),"M"===o.charAt(0)){var C=Math.pow(h-35674+2,2),S=e.global.def("new Float32Array(",C,")");t("false,(Array.isArray(",f,")||",f," instanceof Float32Array)?",f,":(",O(C,(function(e){return S+"["+e+"]="+f+"["+e+"]"})),",",S,")")}else t(A>1?O(A,(function(e){return f+"["+e+"]"})):f);t(");")}}function q(e,t,n,r){var i=e.shared,a=i.gl,o=i.draw,u=r.draw,s=function(){var i,s=u.elements,c=t;return s?((s.contextDep&&r.contextDynamic||s.propDep)&&(c=n),i=s.append(e,c)):i=c.def(o,".",ze),i&&c("if("+i+")"+a+".bindBuffer(34963,"+i+".buffer.buffer);"),i}();function c(i){var a=u[i];return a?a.contextDep&&r.contextDynamic||a.propDep?a.append(e,n):a.append(e,t):t.def(o,".",i)}var f,l,p=c(Ve),h=c(We),d=function(){var i,a=u.count,s=t;return a?((a.contextDep&&r.contextDynamic||a.propDep)&&(s=n),i=a.append(e,s),E.optional((function(){a.MISSING&&e.assert(t,"false","missing vertex count"),a.DYNAMIC&&e.assert(s,i+">=0","missing vertex count")}))):(i=s.def(o,".",Ue),E.optional((function(){e.assert(s,i+">=0","missing vertex count")}))),i}();if("number"==typeof d){if(0===d)return}else n("if(",d,"){"),n.exit("}");g&&(f=c(qe),l=e.instancing);var m=s+".type",y=u.elements&&at(u.elements);function v(){function e(){n(l,".drawElementsInstancedANGLE(",[p,d,m,h+"<<(("+m+"-5121)>>1)",f],");")}function t(){n(l,".drawArraysInstancedANGLE(",[p,h,d,f],");")}s?y?e():(n("if(",s,"){"),e(),n("}else{"),t(),n("}")):t()}function b(){function e(){n(a+".drawElements("+[p,d,m,h+"<<(("+m+"-5121)>>1)"]+");")}function t(){n(a+".drawArrays("+[p,h,d]+");")}s?y?e():(n("if(",s,"){"),e(),n("}else{"),t(),n("}")):t()}g&&("number"!=typeof f||f>=0)?"string"==typeof f?(n("if(",f,">0){"),v(),n("}else if(",f,"<0){"),b(),n("}")):v():b()}function H(e,t,n,r,i){var a=I(),o=a.proc("body",i);return E.optional((function(){a.commandStr=t.commandStr,a.command=a.link(t.commandStr)})),g&&(a.instancing=o.def(a.shared.extensions,".angle_instanced_arrays")),e(a,o,n,r),a.compile().body}function X(e,t,n,r){L(e,t),n.useVAO?n.drawVAO?t(e.shared.vao,".setVAO(",n.drawVAO.append(e,t),");"):t(e.shared.vao,".setVAO(",e.shared.vao,".targetVAO);"):(t(e.shared.vao,".setVAO(null);"),U(e,t,n,r.attributes,(function(){return!0}))),W(e,t,n,r.uniforms,(function(){return!0})),q(e,t,t,n)}function K(e,t,n,r){function i(){return!0}e.batchId="a1",L(e,t),U(e,t,n,r.attributes,i),W(e,t,n,r.uniforms,i),q(e,t,t,n)}function J(e,t,n,r){L(e,t);var i=n.contextDep,a=t.def(),o=t.def();e.shared.props=o,e.batchId=a;var u=e.scope(),s=e.scope();function c(e){return e.contextDep&&i||e.propDep}function f(e){return!c(e)}if(t(u.entry,"for(",a,"=0;",a,"<","a1",";++",a,"){",o,"=","a0","[",a,"];",s,"}",u.exit),n.needsContext&&j(e,s,n.context),n.needsFramebuffer&&R(e,s,n.framebuffer),G(e,s,n.state,c),n.profile&&c(n.profile)&&V(e,s,n,!1,!0),r)n.useVAO?n.drawVAO?c(n.drawVAO)?s(e.shared.vao,".setVAO(",n.drawVAO.append(e,s),");"):u(e.shared.vao,".setVAO(",n.drawVAO.append(e,u),");"):u(e.shared.vao,".setVAO(",e.shared.vao,".targetVAO);"):(u(e.shared.vao,".setVAO(null);"),U(e,u,n,r.attributes,f),U(e,s,n,r.attributes,c)),W(e,u,n,r.uniforms,f),W(e,s,n,r.uniforms,c),q(e,u,s,n);else{var l=e.global.def("{}"),p=n.shader.progVar.append(e,s),h=s.def(p,".id"),d=s.def(l,"[",h,"]");s(e.shared.gl,".useProgram(",p,".program);","if(!",d,"){",d,"=",l,"[",h,"]=",e.link((function(t){return H(K,e,n,t,2)})),"(",p,");}",d,".call(this,a0[",a,"],",a,");")}}function Q(e,t,n){var r=t.static[n];if(r&&function(e){if("object"==typeof e&&!$(e)){for(var t=Object.keys(e),n=0;n<t.length;++n)if(T.isDynamic(e[t[n]]))return!0;return!1}}(r)){var i=e.global,a=Object.keys(r),o=!1,u=!1,s=!1,c=e.global.def("{}");a.forEach((function(t){var n=r[t];if(T.isDynamic(n)){"function"==typeof n&&(n=r[t]=T.unbox(n));var a=ut(n,null);o=o||a.thisDep,s=s||a.propDep,u=u||a.contextDep}else{switch(i(c,".",t,"="),typeof n){case"number":i(n);break;case"string":i('"',n,'"');break;case"object":Array.isArray(n)&&i("[",n.join(),"]");break;default:i(e.link(n))}i(";")}})),t.dynamic[n]=new T.DynamicVariable(4,{thisDep:o,contextDep:u,propDep:s,ref:c,append:function(e,t){a.forEach((function(n){var i=r[n];if(T.isDynamic(i)){var a=e.invoke(t,i);t(c,".",n,"=",a,";")}}))}}),delete t.static[n]}}return{next:x,current:A,procs:function(){var e=I(),t=e.proc("poll"),n=e.proc("refresh"),a=e.block();t(a),n(a);var o,u=e.shared,s=u.gl,c=u.next,f=u.current;a(f,".dirty=false;"),R(e,t),R(e,n,null,!0),g&&(o=e.link(g)),r.oes_vertex_array_object&&n(e.link(r.oes_vertex_array_object),".bindVertexArrayOES(null);");for(var l=0;l<i.maxAttributes;++l){var p=n.def(u.attributes,"[",l,"]"),h=e.cond(p,".buffer");h.then(s,".enableVertexAttribArray(",l,");",s,".bindBuffer(",34962,",",p,".buffer.buffer);",s,".vertexAttribPointer(",l,",",p,".size,",p,".type,",p,".normalized,",p,".stride,",p,".offset);").else(s,".disableVertexAttribArray(",l,");",s,".vertexAttrib4f(",l,",",p,".x,",p,".y,",p,".z,",p,".w);",p,".buffer=null;"),n(h),g&&n(o,".vertexAttribDivisorANGLE(",l,",",p,".divisor);")}return n(e.shared.vao,".currentVAO=null;",e.shared.vao,".setVAO(",e.shared.vao,".targetVAO);"),Object.keys(S).forEach((function(r){var i=S[r],o=a.def(c,".",r),u=e.block();u("if(",o,"){",s,".enable(",i,")}else{",s,".disable(",i,")}",f,".",r,"=",o,";"),n(u),t("if(",o,"!==",f,".",r,"){",u,"}")})),Object.keys(w).forEach((function(r){var i,o,u=w[r],l=A[r],p=e.block();if(p(s,".",u,"("),$(l)){var h=l.length;i=e.global.def(c,".",r),o=e.global.def(f,".",r),p(O(h,(function(e){return i+"["+e+"]"})),");",O(h,(function(e){return o+"["+e+"]="+i+"["+e+"];"})).join("")),t("if(",O(h,(function(e){return i+"["+e+"]!=="+o+"["+e+"]"})).join("||"),"){",p,"}")}else i=a.def(c,".",r),o=a.def(f,".",r),p(i,");",f,".",r,"=",i,";"),t("if(",i,"!==",o,"){",p,"}");n(p)})),e.compile()}(),compile:function(e,t,r,i,a){var o=I();o.stats=o.link(a),Object.keys(t.static).forEach((function(e){Q(o,t,e)})),Ye.forEach((function(t){Q(o,e,t)}));var u=P(e,t,r,i,o);return function(e,t){var n=e.proc("draw",1);L(e,n),j(e,n,t.context),R(e,n,t.framebuffer),N(e,n,t),G(e,n,t.state),V(e,n,t,!1,!0);var r=t.shader.progVar.append(e,n);if(n(e.shared.gl,".useProgram(",r,".program);"),t.shader.program)X(e,n,t,t.shader.program);else{n(e.shared.vao,".setVAO(null);");var i=e.global.def("{}"),a=n.def(r,".id"),o=n.def(i,"[",a,"]");n(e.cond(o).then(o,".call(this,a0);").else(o,"=",i,"[",a,"]=",e.link((function(n){return H(X,e,t,n,1)})),"(",r,");",o,".call(this,a0);"))}Object.keys(t.state).length>0&&n(e.shared.current,".dirty=true;")}(o,u),function(e,t){var r=e.proc("scope",3);e.batchId="a2";var i=e.shared,a=i.current;function o(n){var a=t.shader[n];a&&r.set(i.shader,"."+n,a.append(e,r))}j(e,r,t.context),t.framebuffer&&t.framebuffer.append(e,r),rt(Object.keys(t.state)).forEach((function(n){var a=t.state[n].append(e,r);$(a)?a.forEach((function(t,i){r.set(e.next[n],"["+i+"]",t)})):r.set(i.next,"."+n,a)})),V(e,r,t,!0,!0),[ze,We,Ue,qe,Ve].forEach((function(n){var a=t.draw[n];a&&r.set(i.draw,"."+n,""+a.append(e,r))})),Object.keys(t.uniforms).forEach((function(a){r.set(i.uniforms,"["+n.id(a)+"]",t.uniforms[a].append(e,r))})),Object.keys(t.attributes).forEach((function(n){var i=t.attributes[n].append(e,r),a=e.scopeAttrib(n);Object.keys(new y).forEach((function(e){r.set(a,"."+e,i[e])}))})),t.scopeVAO&&r.set(i.vao,".targetVAO",t.scopeVAO.append(e,r)),o(Ge),o(Le),Object.keys(t.state).length>0&&(r(a,".dirty=true;"),r.exit(a,".dirty=true;")),r("a1(",e.shared.context,",a0,",e.batchId,");")}(o,u),function(e,t){var n=e.proc("batch",2);e.batchId="0",L(e,n);var r=!1,i=!0;Object.keys(t.context).forEach((function(e){r=r||t.context[e].propDep})),r||(j(e,n,t.context),i=!1);var a=t.framebuffer,o=!1;function u(e){return e.contextDep&&r||e.propDep}a?(a.propDep?r=o=!0:a.contextDep&&r&&(o=!0),o||R(e,n,a)):R(e,n,null),t.state.viewport&&t.state.viewport.propDep&&(r=!0),N(e,n,t),G(e,n,t.state,(function(e){return!u(e)})),t.profile&&u(t.profile)||V(e,n,t,!1,"a1"),t.contextDep=r,t.needsContext=i,t.needsFramebuffer=o;var s=t.shader.progVar;if(s.contextDep&&r||s.propDep)J(e,n,t,null);else{var c=s.append(e,n);if(n(e.shared.gl,".useProgram(",c,".program);"),t.shader.program)J(e,n,t,t.shader.program);else{n(e.shared.vao,".setVAO(null);");var f=e.global.def("{}"),l=n.def(c,".id"),p=n.def(f,"[",l,"]");n(e.cond(p).then(p,".call(this,a0,a1);").else(p,"=",f,"[",l,"]=",e.link((function(n){return H(J,e,t,n,2)})),"(",c,");",p,".call(this,a0,a1);"))}}Object.keys(t.state).length>0&&n(e.shared.current,".dirty=true;")}(o,u),o.compile()}}}var ft=function(e,t){if(!t.ext_disjoint_timer_query)return null;var n=[];function r(e){n.push(e)}var i=[];function a(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null}var o=[];function u(e){o.push(e)}var s=[];function c(e,t,n){var r=o.pop()||new a;r.startQueryIndex=e,r.endQueryIndex=t,r.sum=0,r.stats=n,s.push(r)}var f=[],l=[];return{beginQuery:function(e){var r=n.pop()||t.ext_disjoint_timer_query.createQueryEXT();t.ext_disjoint_timer_query.beginQueryEXT(35007,r),i.push(r),c(i.length-1,i.length,e)},endQuery:function(){t.ext_disjoint_timer_query.endQueryEXT(35007)},pushScopeStats:c,update:function(){var e,n,a=i.length;if(0!==a){l.length=Math.max(l.length,a+1),f.length=Math.max(f.length,a+1),f[0]=0,l[0]=0;var o=0;for(e=0,n=0;n<i.length;++n){var c=i[n];t.ext_disjoint_timer_query.getQueryObjectEXT(c,34919)?(o+=t.ext_disjoint_timer_query.getQueryObjectEXT(c,34918),r(c)):i[e++]=c,f[n+1]=o,l[n+1]=e}for(i.length=e,e=0,n=0;n<s.length;++n){var p=s[n],h=p.startQueryIndex,d=p.endQueryIndex;p.sum+=f[d]-f[h];var m=l[h],y=l[d];y===m?(p.stats.gpuTime+=p.sum/1e6,u(p)):(p.startQueryIndex=m,p.endQueryIndex=y,s[e++]=p)}s.length=e}},getNumPendingQueries:function(){return i.length},clear:function(){n.push.apply(n,i);for(var e=0;e<n.length;e++)t.ext_disjoint_timer_query.deleteQueryEXT(n[e]);i.length=0,n.length=0},restore:function(){i.length=0,n.length=0}}};function lt(e,t){for(var n=0;n<e.length;++n)if(e[n]===t)return n;return-1}return function(n){var r=F(n);if(!r)return null;var i=r.gl,a=i.getContextAttributes(),o=i.isContextLost(),u=function(e,t){var n={};function r(t){E.type(t,"string","extension name must be string");var r,i=t.toLowerCase();try{r=n[i]=e.getExtension(i)}catch(e){}return!!r}for(var i=0;i<t.extensions.length;++i){var a=t.extensions[i];if(!r(a))return t.onDestroy(),t.onDone('"'+a+'" extension is not supported by the current WebGL context, try upgrading your system or a different browser'),null}return t.optionalExtensions.forEach(r),{extensions:n,restore:function(){Object.keys(n).forEach((function(e){if(n[e]&&!r(e))throw new Error("(regl): error restoring extension "+e)}))}}}(i,r);if(!u)return null;var s,c,f=(s={"":0},c=[""],{id:function(e){var t=s[e];return t||(t=s[e]=c.length,c.push(e),t)},str:function(e){return c[e]}}),l={vaoCount:0,bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0},p=u.extensions,h=ft(0,p),d=B(),m=i.drawingBufferWidth,y=i.drawingBufferHeight,v={tick:0,time:0,viewportWidth:m,viewportHeight:y,framebufferWidth:m,framebufferHeight:y,drawingBufferWidth:m,drawingBufferHeight:y,pixelRatio:r.pixelRatio},g=function(e,t){var n=1;t.ext_texture_filter_anisotropic&&(n=e.getParameter(34047));var r=1,i=1;t.webgl_draw_buffers&&(r=e.getParameter(34852),i=e.getParameter(36063));var a=!!t.oes_texture_float;if(a){var o=e.createTexture();e.bindTexture(3553,o),e.texImage2D(3553,0,6408,1,1,0,6408,5126,null);var u=e.createFramebuffer();if(e.bindFramebuffer(36160,u),e.framebufferTexture2D(36160,36064,3553,o,0),e.bindTexture(3553,null),36053!==e.checkFramebufferStatus(36160))a=!1;else{e.viewport(0,0,1,1),e.clearColor(1,0,0,1),e.clear(16384);var s=P.allocType(5126,4);e.readPixels(0,0,1,1,6408,5126,s),e.getError()?a=!1:(e.deleteFramebuffer(u),e.deleteTexture(o),a=1===s[0]),P.freeType(s)}}var c=!0;if("undefined"==typeof navigator||!(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent))){var f=e.createTexture(),l=P.allocType(5121,36);e.activeTexture(33984),e.bindTexture(34067,f),e.texImage2D(34069,0,6408,3,3,0,6408,5121,l),P.freeType(l),e.bindTexture(34067,null),e.deleteTexture(f),c=!e.getError()}return{colorBits:[e.getParameter(3410),e.getParameter(3411),e.getParameter(3412),e.getParameter(3413)],depthBits:e.getParameter(3414),stencilBits:e.getParameter(3415),subpixelBits:e.getParameter(3408),extensions:Object.keys(t).filter((function(e){return!!t[e]})),maxAnisotropic:n,maxDrawbuffers:r,maxColorAttachments:i,pointSizeDims:e.getParameter(33901),lineWidthDims:e.getParameter(33902),maxViewportDims:e.getParameter(3386),maxCombinedTextureUnits:e.getParameter(35661),maxCubeMapSize:e.getParameter(34076),maxRenderbufferSize:e.getParameter(34024),maxTextureUnits:e.getParameter(34930),maxTextureSize:e.getParameter(3379),maxAttributes:e.getParameter(34921),maxVertexUniforms:e.getParameter(36347),maxVertexTextureUnits:e.getParameter(35660),maxVaryingVectors:e.getParameter(36348),maxFragmentUniforms:e.getParameter(36349),glsl:e.getParameter(35724),renderer:e.getParameter(7937),vendor:e.getParameter(7936),version:e.getParameter(7938),readFloat:a,npotTextureCube:c}}(i,p),b=function(t,n,r,i){var a=0,o={};function u(e){this.id=a++,this.buffer=t.createBuffer(),this.type=e,this.usage=35044,this.byteLength=0,this.dimension=1,this.dtype=5121,this.persistentData=null,r.profile&&(this.stats={size:0})}u.prototype.bind=function(){t.bindBuffer(this.type,this.buffer)},u.prototype.destroy=function(){l(this)};var s=[];function c(e,n,r){e.byteLength=n.byteLength,t.bufferData(e.type,n,r)}function f(t,n,r,i,a,o){var u,s;if(t.usage=r,Array.isArray(n)){if(t.dtype=i||5126,n.length>0)if(Array.isArray(n[0])){u=W(n);for(var f=1,l=1;l<u.length;++l)f*=u[l];t.dimension=f,c(t,s=U(n,u,t.dtype),r),o?t.persistentData=s:P.freeType(s)}else if("number"==typeof n[0]){t.dimension=a;var p=P.allocType(t.dtype,n.length);X(p,n),c(t,p,r),o?t.persistentData=p:P.freeType(p)}else e(n[0])?(t.dimension=n[0].length,t.dtype=i||H(n[0])||5126,c(t,s=U(n,[n.length,n[0].length],t.dtype),r),o?t.persistentData=s:P.freeType(s)):E.raise("invalid buffer data")}else if(e(n))t.dtype=i||H(n),t.dimension=a,c(t,n,r),o&&(t.persistentData=new Uint8Array(new Uint8Array(n.buffer)));else if(j(n)){u=n.shape;var h=n.stride,d=n.offset,m=0,y=0,v=0,g=0;1===u.length?(m=u[0],y=1,v=h[0],g=0):2===u.length?(m=u[0],y=u[1],v=h[0],g=h[1]):E.raise("invalid shape"),t.dtype=i||H(n.data)||5126,t.dimension=y;var b=P.allocType(t.dtype,m*y);K(b,n.data,m,y,v,g,d),c(t,b,r),o?t.persistentData=b:P.freeType(b)}else n instanceof ArrayBuffer?(t.dtype=5121,t.dimension=a,c(t,n,r),o&&(t.persistentData=new Uint8Array(new Uint8Array(n)))):E.raise("invalid buffer data")}function l(e){n.bufferCount--,i(e);var r=e.buffer;E(r,"buffer must not be deleted already"),t.deleteBuffer(r),e.buffer=null,delete o[e.id]}return r.profile&&(n.getTotalBufferSize=function(){var e=0;return Object.keys(o).forEach((function(t){e+=o[t].stats.size})),e}),{create:function(i,a,s,c){n.bufferCount++;var p=new u(a);function h(n){var i=35044,a=null,o=0,u=0,s=1;return Array.isArray(n)||e(n)||j(n)||n instanceof ArrayBuffer?a=n:"number"==typeof n?o=0|n:n&&(E.type(n,"object","buffer arguments must be an object, a number or an array"),"data"in n&&(E(null===a||Array.isArray(a)||e(a)||j(a),"invalid data for buffer"),a=n.data),"usage"in n&&(E.parameter(n.usage,V,"invalid buffer usage"),i=V[n.usage]),"type"in n&&(E.parameter(n.type,z,"invalid buffer type"),u=z[n.type]),"dimension"in n&&(E.type(n.dimension,"number","invalid dimension"),s=0|n.dimension),"length"in n&&(E.nni(o,"buffer length must be a nonnegative integer"),o=0|n.length)),p.bind(),a?f(p,a,i,u,s,c):(o&&t.bufferData(p.type,o,i),p.dtype=u||5121,p.usage=i,p.dimension=s,p.byteLength=o),r.profile&&(p.stats.size=p.byteLength*q[p.dtype]),h}function d(e,n){E(n+e.byteLength<=p.byteLength,"invalid buffer subdata call, buffer is too small. Can't write data of size "+e.byteLength+" starting from offset "+n+" to a buffer of size "+p.byteLength),t.bufferSubData(p.type,n,e)}return o[p.id]=p,s||h(i),h._reglType="buffer",h._buffer=p,h.subdata=function(t,n){var r,i=0|(n||0);if(p.bind(),e(t)||t instanceof ArrayBuffer)d(t,i);else if(Array.isArray(t)){if(t.length>0)if("number"==typeof t[0]){var a=P.allocType(p.dtype,t.length);X(a,t),d(a,i),P.freeType(a)}else if(Array.isArray(t[0])||e(t[0])){r=W(t);var o=U(t,r,p.dtype);d(o,i),P.freeType(o)}else E.raise("invalid buffer data")}else if(j(t)){r=t.shape;var u=t.stride,s=0,c=0,f=0,l=0;1===r.length?(s=r[0],c=1,f=u[0],l=0):2===r.length?(s=r[0],c=r[1],f=u[0],l=u[1]):E.raise("invalid shape");var m=Array.isArray(t.data)?p.dtype:H(t.data),y=P.allocType(m,s*c);K(y,t.data,s,c,f,l,t.offset),d(y,i),P.freeType(y)}else E.raise("invalid data for buffer subdata");return h},r.profile&&(h.stats=p.stats),h.destroy=function(){l(p)},h},createStream:function(e,t){var n=s.pop();return n||(n=new u(e)),n.bind(),f(n,t,35040,0,1,!1),n},destroyStream:function(e){s.push(e)},clear:function(){R(o).forEach(l),s.forEach(l)},getBuffer:function(e){return e&&e._buffer instanceof u?e._buffer:null},restore:function(){R(o).forEach((function(e){e.buffer=t.createBuffer(),t.bindBuffer(e.type,e.buffer),t.bufferData(e.type,e.persistentData||e.byteLength,e.usage)}))},_initBuffer:f}}(i,l,r,(function(e){return A.destroyBuffer(e)})),A=function(t,n,r,i,a){for(var o=r.maxAttributes,u=new Array(o),s=0;s<o;++s)u[s]=new Oe;var c=0,f={},l={Record:Oe,scope:{},state:u,currentVAO:null,targetVAO:null,restore:p()?function(){p()&&R(f).forEach((function(e){e.refresh()}))}:function(){},createVAO:function(t){var r=new d;function u(t){E(Array.isArray(t),"arguments to vertex array constructor must be an array"),E(t.length<o,"too many attributes"),E(t.length>0,"must specify at least one attribute");for(var i=0;i<r.buffers.length;++i)r.buffers[i].destroy();r.buffers.length=0;var s=r.attributes;s.length=t.length;for(var c=0;c<t.length;++c){var f=t[c],l=s[c]=new Oe;if(Array.isArray(f)||e(f)||j(f)){var p=a.create(f,34962,!1,!0);l.buffer=a.getBuffer(p),l.size=0|l.buffer.dimension,l.normalized=!1,l.type=l.buffer.dtype,l.offset=0,l.stride=0,l.divisor=0,l.state=1,r.buffers.push(p)}else a.getBuffer(f)?(l.buffer=a.getBuffer(f),l.size=0|l.buffer.dimension,l.normalized=!1,l.type=l.buffer.dtype,l.offset=0,l.stride=0,l.divisor=0,l.state=1):a.getBuffer(f.buffer)?(l.buffer=a.getBuffer(f.buffer),l.size=0|(+f.size||l.buffer.dimension),l.normalized=!!f.normalized||!1,"type"in f?(E.parameter(f.type,z,"invalid buffer type"),l.type=z[f.type]):l.type=l.buffer.dtype,l.offset=0|(f.offset||0),l.stride=0|(f.stride||0),l.divisor=0|(f.divisor||0),l.state=1,E(l.size>=1&&l.size<=4,"size must be between 1 and 4"),E(l.offset>=0,"invalid offset"),E(l.stride>=0&&l.stride<=255,"stride must be between 0 and 255"),E(l.divisor>=0,"divisor must be positive"),E(!l.divisor||!!n.angle_instanced_arrays,"ANGLE_instanced_arrays must be enabled to use divisor")):"x"in f?(E(c>0,"first attribute must not be a constant"),l.x=+f.x||0,l.y=+f.y||0,l.z=+f.z||0,l.w=+f.w||0,l.state=2):E(!1,"invalid attribute spec for location "+c)}return r.refresh(),u}return i.vaoCount+=1,u.destroy=function(){r.destroy()},u._vao=r,u._reglType="vao",u(t)},getVAO:function(e){return"function"==typeof e&&e._vao?e._vao:null},destroyBuffer:function(e){for(var n=0;n<u.length;++n){var r=u[n];r.buffer===e&&(t.disableVertexAttribArray(n),r.buffer=null)}},setVAO:p()?function(e){if(e!==l.currentVAO){var t=p();e?t.bindVertexArrayOES(e.vao):t.bindVertexArrayOES(null),l.currentVAO=e}}:function(e){if(e!==l.currentVAO){if(e)e.bindAttrs();else for(var n=h(),r=0;r<u.length;++r){var i=u[r];i.buffer?(t.enableVertexAttribArray(r),t.vertexAttribPointer(r,i.size,i.type,i.normalized,i.stride,i.offfset),n&&n.vertexAttribDivisorANGLE(r,i.divisor)):(t.disableVertexAttribArray(r),t.vertexAttrib4f(r,i.x,i.y,i.z,i.w))}l.currentVAO=e}},clear:p()?function(){R(f).forEach((function(e){e.destroy()}))}:function(){}};function p(){return n.oes_vertex_array_object}function h(){return n.angle_instanced_arrays}function d(){this.id=++c,this.attributes=[];var e=p();this.vao=e?e.createVertexArrayOES():null,f[this.id]=this,this.buffers=[]}return d.prototype.bindAttrs=function(){for(var e=h(),n=this.attributes,r=0;r<n.length;++r){var i=n[r];i.buffer?(t.enableVertexAttribArray(r),t.bindBuffer(34962,i.buffer.buffer),t.vertexAttribPointer(r,i.size,i.type,i.normalized,i.stride,i.offset),e&&e.vertexAttribDivisorANGLE(r,i.divisor)):(t.disableVertexAttribArray(r),t.vertexAttrib4f(r,i.x,i.y,i.z,i.w))}for(var a=n.length;a<o;++a)t.disableVertexAttribArray(a)},d.prototype.refresh=function(){var e=p();e&&(e.bindVertexArrayOES(this.vao),this.bindAttrs(),l.currentVAO=this)},d.prototype.destroy=function(){if(this.vao){var e=p();this===l.currentVAO&&(l.currentVAO=null,e.bindVertexArrayOES(null)),e.deleteVertexArrayOES(this.vao),this.vao=null}f[this.id]&&(delete f[this.id],i.vaoCount-=1)},l}(i,p,g,l,b),x=function(t,n,r,i){var a={},o=0,u={uint8:5121,uint16:5123};function s(e){this.id=o++,a[this.id]=this,this.buffer=e,this.primType=4,this.vertCount=0,this.type=0}n.oes_element_index_uint&&(u.uint32=5125),s.prototype.bind=function(){this.buffer.bind()};var c=[];function f(i,a,o,u,s,c,f){var l;if(i.buffer.bind(),a){var p=f;f||e(a)&&(!j(a)||e(a.data))||(p=n.oes_element_index_uint?5125:5123),r._initBuffer(i.buffer,a,o,p,3)}else t.bufferData(34963,c,o),i.buffer.dtype=l||5121,i.buffer.usage=o,i.buffer.dimension=3,i.buffer.byteLength=c;if(l=f,!f){switch(i.buffer.dtype){case 5121:case 5120:l=5121;break;case 5123:case 5122:l=5123;break;case 5125:case 5124:l=5125;break;default:E.raise("unsupported type for element array")}i.buffer.dtype=l}i.type=l,E(5125!==l||!!n.oes_element_index_uint,"32 bit element buffers not supported, enable oes_element_index_uint first");var h=s;h<0&&(h=i.buffer.byteLength,5123===l?h>>=1:5125===l&&(h>>=2)),i.vertCount=h;var d=u;if(u<0){d=4;var m=i.buffer.dimension;1===m&&(d=0),2===m&&(d=1),3===m&&(d=4)}i.primType=d}function l(e){i.elementsCount--,E(null!==e.buffer,"must not double destroy elements"),delete a[e.id],e.buffer.destroy(),e.buffer=null}return{create:function(t,n){var a=r.create(null,34963,!0),o=new s(a._buffer);function c(t){if(t)if("number"==typeof t)a(t),o.primType=4,o.vertCount=0|t,o.type=5121;else{var n=null,r=35044,i=-1,s=-1,l=0,p=0;Array.isArray(t)||e(t)||j(t)?n=t:(E.type(t,"object","invalid arguments for elements"),"data"in t&&(n=t.data,E(Array.isArray(n)||e(n)||j(n),"invalid data for element buffer")),"usage"in t&&(E.parameter(t.usage,V,"invalid element buffer usage"),r=V[t.usage]),"primitive"in t&&(E.parameter(t.primitive,Y,"invalid element buffer primitive"),i=Y[t.primitive]),"count"in t&&(E("number"==typeof t.count&&t.count>=0,"invalid vertex count for elements"),s=0|t.count),"type"in t&&(E.parameter(t.type,u,"invalid buffer type"),p=u[t.type]),"length"in t?l=0|t.length:(l=s,5123===p||5122===p?l*=2:5125!==p&&5124!==p||(l*=4))),f(o,n,r,i,s,l,p)}else a(),o.primType=4,o.vertCount=0,o.type=5121;return c}return i.elementsCount++,c(t),c._reglType="elements",c._elements=o,c.subdata=function(e,t){return a.subdata(e,t),c},c.destroy=function(){l(o)},c},createStream:function(e){var t=c.pop();return t||(t=new s(r.create(null,34963,!0,!1)._buffer)),f(t,e,35040,-1,-1,0,0),t},destroyStream:function(e){c.push(e)},getElements:function(e){return"function"==typeof e&&e._elements instanceof s?e._elements:null},clear:function(){R(a).forEach(l)}}}(i,p,b,l),C=function(e,t,n,r){var i={},a={};function o(e,t,n,r){this.name=e,this.id=t,this.location=n,this.info=r}function u(e,t){for(var n=0;n<e.length;++n)if(e[n].id===t.id)return void(e[n].location=t.location);e.push(t)}function s(n,r,o){var u=35632===n?i:a,s=u[r];if(!s){var c=t.str(r);s=e.createShader(n),e.shaderSource(s,c),e.compileShader(s),E.shaderError(e,s,c,n,o),u[r]=s}return s}var c={},f=[],l=0;function p(e,t){this.id=l++,this.fragId=e,this.vertId=t,this.program=null,this.uniforms=[],this.attributes=[],r.profile&&(this.stats={uniformsCount:0,attributesCount:0})}function h(n,i,a){var c,f,l=s(35632,n.fragId),p=s(35633,n.vertId),h=n.program=e.createProgram();if(e.attachShader(h,l),e.attachShader(h,p),a)for(c=0;c<a.length;++c){var d=a[c];e.bindAttribLocation(h,d[0],d[1])}e.linkProgram(h),E.linkError(e,h,t.str(n.fragId),t.str(n.vertId),i);var m=e.getProgramParameter(h,35718);r.profile&&(n.stats.uniformsCount=m);var y=n.uniforms;for(c=0;c<m;++c)if(f=e.getActiveUniform(h,c))if(f.size>1)for(var v=0;v<f.size;++v){var g=f.name.replace("[0]","["+v+"]");u(y,new o(g,t.id(g),e.getUniformLocation(h,g),f))}else u(y,new o(f.name,t.id(f.name),e.getUniformLocation(h,f.name),f));var b=e.getProgramParameter(h,35721);r.profile&&(n.stats.attributesCount=b);var A=n.attributes;for(c=0;c<b;++c)(f=e.getActiveAttrib(h,c))&&u(A,new o(f.name,t.id(f.name),e.getAttribLocation(h,f.name),f))}return r.profile&&(n.getMaxUniformsCount=function(){var e=0;return f.forEach((function(t){t.stats.uniformsCount>e&&(e=t.stats.uniformsCount)})),e},n.getMaxAttributesCount=function(){var e=0;return f.forEach((function(t){t.stats.attributesCount>e&&(e=t.stats.attributesCount)})),e}),{clear:function(){var t=e.deleteShader.bind(e);R(i).forEach(t),i={},R(a).forEach(t),a={},f.forEach((function(t){e.deleteProgram(t.program)})),f.length=0,c={},n.shaderCount=0},program:function(e,t,r,i){E.command(e>=0,"missing vertex shader",r),E.command(t>=0,"missing fragment shader",r);var a=c[t];a||(a=c[t]={});var o=a[e];if(o&&!i)return o;var u=new p(t,e);return n.shaderCount++,h(u,r,i),o||(a[e]=u),f.push(u),u},restore:function(){i={},a={};for(var e=0;e<f.length;++e)h(f[e],null,f[e].attributes.map((function(e){return[e.location,e.name]})))},shader:s,frag:-1,vert:-1}}(i,f,l,r),S=Se(i,p,g,(function(){M.procs.poll()}),v,l,r),w=function(e,t,n,r,i){var a={rgba4:32854,rgb565:36194,"rgb5 a1":32855,depth:33189,stencil:36168,"depth stencil":34041};t.ext_srgb&&(a.srgba=35907),t.ext_color_buffer_half_float&&(a.rgba16f=34842,a.rgb16f=34843),t.webgl_color_buffer_float&&(a.rgba32f=34836);var o=[];Object.keys(a).forEach((function(e){var t=a[e];o[t]=e}));var u=0,s={};function c(e){this.id=u++,this.refCount=1,this.renderbuffer=e,this.format=32854,this.width=0,this.height=0,i.profile&&(this.stats={size:0})}function f(t){var n=t.renderbuffer;E(n,"must not double destroy renderbuffer"),e.bindRenderbuffer(36161,null),e.deleteRenderbuffer(n),t.renderbuffer=null,t.refCount=0,delete s[t.id],r.renderbufferCount--}return c.prototype.decRef=function(){--this.refCount<=0&&f(this)},i.profile&&(r.getTotalRenderbufferSize=function(){var e=0;return Object.keys(s).forEach((function(t){e+=s[t].stats.size})),e}),{create:function(t,u){var f=new c(e.createRenderbuffer());function l(t,r){var u=0,s=0,c=32854;if("object"==typeof t&&t){var p=t;if("shape"in p){var h=p.shape;E(Array.isArray(h)&&h.length>=2,"invalid renderbuffer shape"),u=0|h[0],s=0|h[1]}else"radius"in p&&(u=s=0|p.radius),"width"in p&&(u=0|p.width),"height"in p&&(s=0|p.height);"format"in p&&(E.parameter(p.format,a,"invalid renderbuffer format"),c=a[p.format])}else"number"==typeof t?(u=0|t,s="number"==typeof r?0|r:u):t?E.raise("invalid arguments to renderbuffer constructor"):u=s=1;if(E(u>0&&s>0&&u<=n.maxRenderbufferSize&&s<=n.maxRenderbufferSize,"invalid renderbuffer size"),u!==f.width||s!==f.height||c!==f.format)return l.width=f.width=u,l.height=f.height=s,f.format=c,e.bindRenderbuffer(36161,f.renderbuffer),e.renderbufferStorage(36161,c,u,s),E(0===e.getError(),"invalid render buffer format"),i.profile&&(f.stats.size=Te(f.format,f.width,f.height)),l.format=o[f.format],l}return s[f.id]=f,r.renderbufferCount++,l(t,u),l.resize=function(t,r){var a=0|t,o=0|r||a;return a===f.width&&o===f.height||(E(a>0&&o>0&&a<=n.maxRenderbufferSize&&o<=n.maxRenderbufferSize,"invalid renderbuffer size"),l.width=f.width=a,l.height=f.height=o,e.bindRenderbuffer(36161,f.renderbuffer),e.renderbufferStorage(36161,f.format,a,o),E(0===e.getError(),"invalid render buffer format"),i.profile&&(f.stats.size=Te(f.format,f.width,f.height))),l},l._reglType="renderbuffer",l._renderbuffer=f,i.profile&&(l.stats=f.stats),l.destroy=function(){f.decRef()},l},clear:function(){R(s).forEach(f)},restore:function(){R(s).forEach((function(t){t.renderbuffer=e.createRenderbuffer(),e.bindRenderbuffer(36161,t.renderbuffer),e.renderbufferStorage(36161,t.format,t.width,t.height)})),e.bindRenderbuffer(36161,null)}}}(i,p,g,l,r),_=function(e,n,r,i,a,o){var u={cur:null,next:null,dirty:!1,setFBO:null},s=["rgba"],c=["rgba4","rgb565","rgb5 a1"];n.ext_srgb&&c.push("srgba"),n.ext_color_buffer_half_float&&c.push("rgba16f","rgb16f"),n.webgl_color_buffer_float&&c.push("rgba32f");var f=["uint8"];function l(e,t,n){this.target=e,this.texture=t,this.renderbuffer=n;var r=0,i=0;t?(r=t.width,i=t.height):n&&(r=n.width,i=n.height),this.width=r,this.height=i}function p(e){e&&(e.texture&&e.texture._texture.decRef(),e.renderbuffer&&e.renderbuffer._renderbuffer.decRef())}function h(e,t,n){if(e)if(e.texture){var r=e.texture._texture,i=Math.max(1,r.width),a=Math.max(1,r.height);E(i===t&&a===n,"inconsistent width/height for supplied texture"),r.refCount+=1}else{var o=e.renderbuffer._renderbuffer;E(o.width===t&&o.height===n,"inconsistent width/height for renderbuffer"),o.refCount+=1}}function d(t,n){n&&(n.texture?e.framebufferTexture2D(36160,t,n.target,n.texture._texture.texture,0):e.framebufferRenderbuffer(36160,t,36161,n.renderbuffer._renderbuffer.renderbuffer))}function m(e){var t=3553,n=null,r=null,i=e;"object"==typeof e&&(i=e.data,"target"in e&&(t=0|e.target)),E.type(i,"function","invalid attachment data");var a=i._reglType;return"texture2d"===a?(n=i,E(3553===t)):"textureCube"===a?(n=i,E(t>=34069&&t<34075,"invalid cube map target")):"renderbuffer"===a?(r=i,t=36161):E.raise("invalid regl object for attachment"),new l(t,n,r)}function y(e,t,n,r,o){if(n){var u=i.create2D({width:e,height:t,format:r,type:o});return u._texture.refCount=0,new l(3553,u,null)}var s=a.create({width:e,height:t,format:r});return s._renderbuffer.refCount=0,new l(36161,null,s)}function v(e){return e&&(e.texture||e.renderbuffer)}function g(e,t,n){e&&(e.texture?e.texture.resize(t,n):e.renderbuffer&&e.renderbuffer.resize(t,n),e.width=t,e.height=n)}n.oes_texture_half_float&&f.push("half float","float16"),n.oes_texture_float&&f.push("float","float32");var b=0,A={};function x(){this.id=b++,A[this.id]=this,this.framebuffer=e.createFramebuffer(),this.width=0,this.height=0,this.colorAttachments=[],this.depthAttachment=null,this.stencilAttachment=null,this.depthStencilAttachment=null}function C(e){e.colorAttachments.forEach(p),p(e.depthAttachment),p(e.stencilAttachment),p(e.depthStencilAttachment)}function S(t){var n=t.framebuffer;E(n,"must not double destroy framebuffer"),e.deleteFramebuffer(n),t.framebuffer=null,o.framebufferCount--,delete A[t.id]}function w(t){var n;e.bindFramebuffer(36160,t.framebuffer);var i=t.colorAttachments;for(n=0;n<i.length;++n)d(36064+n,i[n]);for(n=i.length;n<r.maxColorAttachments;++n)e.framebufferTexture2D(36160,36064+n,3553,null,0);e.framebufferTexture2D(36160,33306,3553,null,0),e.framebufferTexture2D(36160,36096,3553,null,0),e.framebufferTexture2D(36160,36128,3553,null,0),d(36096,t.depthAttachment),d(36128,t.stencilAttachment),d(33306,t.depthStencilAttachment);var a=e.checkFramebufferStatus(36160);e.isContextLost()||36053===a||E.raise("framebuffer configuration not supported, status = "+Fe[a]),e.bindFramebuffer(36160,u.next?u.next.framebuffer:null),u.cur=u.next,e.getError()}function T(e,i){var a=new x;function l(e,t){var i;E(u.next!==a,"can not update framebuffer which is currently in use");var o=0,p=0,d=!0,g=!0,b=null,A=!0,x="rgba",S="uint8",T=1,D=null,B=null,_=null,M=!1;if("number"==typeof e)o=0|e,p=0|t||o;else if(e){E.type(e,"object","invalid arguments for framebuffer");var F=e;if("shape"in F){var O=F.shape;E(Array.isArray(O)&&O.length>=2,"invalid shape for framebuffer"),o=O[0],p=O[1]}else"radius"in F&&(o=p=F.radius),"width"in F&&(o=F.width),"height"in F&&(p=F.height);("color"in F||"colors"in F)&&(b=F.color||F.colors,Array.isArray(b)&&E(1===b.length||n.webgl_draw_buffers,"multiple render targets not supported")),b||("colorCount"in F&&(T=0|F.colorCount,E(T>0,"invalid color buffer count")),"colorTexture"in F&&(A=!!F.colorTexture,x="rgba4"),"colorType"in F&&(S=F.colorType,A?(E(n.oes_texture_float||!("float"===S||"float32"===S),"you must enable OES_texture_float in order to use floating point framebuffer objects"),E(n.oes_texture_half_float||!("half float"===S||"float16"===S),"you must enable OES_texture_half_float in order to use 16-bit floating point framebuffer objects")):"half float"===S||"float16"===S?(E(n.ext_color_buffer_half_float,"you must enable EXT_color_buffer_half_float to use 16-bit render buffers"),x="rgba16f"):"float"!==S&&"float32"!==S||(E(n.webgl_color_buffer_float,"you must enable WEBGL_color_buffer_float in order to use 32-bit floating point renderbuffers"),x="rgba32f"),E.oneOf(S,f,"invalid color type")),"colorFormat"in F&&(x=F.colorFormat,s.indexOf(x)>=0?A=!0:c.indexOf(x)>=0?A=!1:A?E.oneOf(F.colorFormat,s,"invalid color format for texture"):E.oneOf(F.colorFormat,c,"invalid color format for renderbuffer"))),("depthTexture"in F||"depthStencilTexture"in F)&&(M=!(!F.depthTexture&&!F.depthStencilTexture),E(!M||n.webgl_depth_texture,"webgl_depth_texture extension not supported")),"depth"in F&&("boolean"==typeof F.depth?d=F.depth:(D=F.depth,g=!1)),"stencil"in F&&("boolean"==typeof F.stencil?g=F.stencil:(B=F.stencil,d=!1)),"depthStencil"in F&&("boolean"==typeof F.depthStencil?d=g=F.depthStencil:(_=F.depthStencil,d=!1,g=!1))}else o=p=1;var k=null,I=null,P=null,j=null;if(Array.isArray(b))k=b.map(m);else if(b)k=[m(b)];else for(k=new Array(T),i=0;i<T;++i)k[i]=y(o,p,A,x,S);E(n.webgl_draw_buffers||k.length<=1,"you must enable the WEBGL_draw_buffers extension in order to use multiple color buffers."),E(k.length<=r.maxColorAttachments,"too many color attachments, not supported"),o=o||k[0].width,p=p||k[0].height,D?I=m(D):d&&!g&&(I=y(o,p,M,"depth","uint32")),B?P=m(B):g&&!d&&(P=y(o,p,!1,"stencil","uint8")),_?j=m(_):!D&&!B&&g&&d&&(j=y(o,p,M,"depth stencil","depth stencil")),E(!!D+!!B+!!_<=1,"invalid framebuffer configuration, can specify exactly one depth/stencil attachment");var R=null;for(i=0;i<k.length;++i)if(h(k[i],o,p),E(!k[i]||k[i].texture&&De.indexOf(k[i].texture._texture.format)>=0||k[i].renderbuffer&&Me.indexOf(k[i].renderbuffer._renderbuffer.format)>=0,"framebuffer color attachment "+i+" is invalid"),k[i]&&k[i].texture){var N=Be[k[i].texture._texture.format]*_e[k[i].texture._texture.type];null===R?R=N:E(R===N,"all color attachments much have the same number of bits per pixel.")}return h(I,o,p),E(!I||I.texture&&6402===I.texture._texture.format||I.renderbuffer&&33189===I.renderbuffer._renderbuffer.format,"invalid depth attachment for framebuffer object"),h(P,o,p),E(!P||P.renderbuffer&&36168===P.renderbuffer._renderbuffer.format,"invalid stencil attachment for framebuffer object"),h(j,o,p),E(!j||j.texture&&34041===j.texture._texture.format||j.renderbuffer&&34041===j.renderbuffer._renderbuffer.format,"invalid depth-stencil attachment for framebuffer object"),C(a),a.width=o,a.height=p,a.colorAttachments=k,a.depthAttachment=I,a.stencilAttachment=P,a.depthStencilAttachment=j,l.color=k.map(v),l.depth=v(I),l.stencil=v(P),l.depthStencil=v(j),l.width=a.width,l.height=a.height,w(a),l}return o.framebufferCount++,l(e,i),t(l,{resize:function(e,t){E(u.next!==a,"can not resize a framebuffer which is currently in use");var n=Math.max(0|e,1),r=Math.max(0|t||n,1);if(n===a.width&&r===a.height)return l;for(var i=a.colorAttachments,o=0;o<i.length;++o)g(i[o],n,r);return g(a.depthAttachment,n,r),g(a.stencilAttachment,n,r),g(a.depthStencilAttachment,n,r),a.width=l.width=n,a.height=l.height=r,w(a),l},_reglType:"framebuffer",_framebuffer:a,destroy:function(){S(a),C(a)},use:function(e){u.setFBO({framebuffer:l},e)}})}return t(u,{getFramebuffer:function(e){if("function"==typeof e&&"framebuffer"===e._reglType){var t=e._framebuffer;if(t instanceof x)return t}return null},create:T,createCube:function(e){var a=Array(6);function o(e){var r;E(a.indexOf(u.next)<0,"can not update framebuffer which is currently in use");var c,l={color:null},p=0,h=null,d="rgba",m="uint8",y=1;if("number"==typeof e)p=0|e;else if(e){E.type(e,"object","invalid arguments for framebuffer");var v=e;if("shape"in v){var g=v.shape;E(Array.isArray(g)&&g.length>=2,"invalid shape for framebuffer"),E(g[0]===g[1],"cube framebuffer must be square"),p=g[0]}else"radius"in v&&(p=0|v.radius),"width"in v?(p=0|v.width,"height"in v&&E(v.height===p,"must be square")):"height"in v&&(p=0|v.height);("color"in v||"colors"in v)&&(h=v.color||v.colors,Array.isArray(h)&&E(1===h.length||n.webgl_draw_buffers,"multiple render targets not supported")),h||("colorCount"in v&&(y=0|v.colorCount,E(y>0,"invalid color buffer count")),"colorType"in v&&(E.oneOf(v.colorType,f,"invalid color type"),m=v.colorType),"colorFormat"in v&&(d=v.colorFormat,E.oneOf(v.colorFormat,s,"invalid color format for texture"))),"depth"in v&&(l.depth=v.depth),"stencil"in v&&(l.stencil=v.stencil),"depthStencil"in v&&(l.depthStencil=v.depthStencil)}else p=1;if(h)if(Array.isArray(h))for(c=[],r=0;r<h.length;++r)c[r]=h[r];else c=[h];else{c=Array(y);var b={radius:p,format:d,type:m};for(r=0;r<y;++r)c[r]=i.createCube(b)}for(l.color=Array(c.length),r=0;r<c.length;++r){var A=c[r];E("function"==typeof A&&"textureCube"===A._reglType,"invalid cube map"),p=p||A.width,E(A.width===p&&A.height===p,"invalid cube map shape"),l.color[r]={target:34069,data:c[r]}}for(r=0;r<6;++r){for(var x=0;x<c.length;++x)l.color[x].target=34069+r;r>0&&(l.depth=a[0].depth,l.stencil=a[0].stencil,l.depthStencil=a[0].depthStencil),a[r]?a[r](l):a[r]=T(l)}return t(o,{width:p,height:p,color:c})}return o(e),t(o,{faces:a,resize:function(e){var t,n=0|e;if(E(n>0&&n<=r.maxCubeMapSize,"invalid radius for cube fbo"),n===o.width)return o;var i=o.color;for(t=0;t<i.length;++t)i[t].resize(n);for(t=0;t<6;++t)a[t].resize(n);return o.width=o.height=n,o},_reglType:"framebufferCube",destroy:function(){a.forEach((function(e){e.destroy()}))}})},clear:function(){R(A).forEach(S)},restore:function(){u.cur=null,u.next=null,u.dirty=!0,R(A).forEach((function(t){t.framebuffer=e.createFramebuffer(),w(t)}))}})}(i,p,g,S,w,l),M=ct(i,f,p,g,b,x,0,_,{},A,C,{elements:null,primitive:4,count:-1,offset:0,instances:-1},v,h,r),O=ke(i,_,M.procs.poll,v,a,p,g),k=M.next,I=i.canvas,N=[],G=[],L=[],J=[r.onDestroy],Q=null;function Z(){if(0===N.length)return h&&h.update(),void(Q=null);Q=D.next(Z),se();for(var e=N.length-1;e>=0;--e){var t=N[e];t&&t(v,null,0)}i.flush(),h&&h.update()}function $(){!Q&&N.length>0&&(Q=D.next(Z))}function ee(){Q&&(D.cancel(Z),Q=null)}function te(e){e.preventDefault(),o=!0,ee(),G.forEach((function(e){e()}))}function ne(e){i.getError(),o=!1,u.restore(),C.restore(),b.restore(),S.restore(),w.restore(),_.restore(),A.restore(),h&&h.restore(),M.procs.refresh(),$(),L.forEach((function(e){e()}))}function re(e){function n(e){var t={},n={};return Object.keys(e).forEach((function(r){var i=e[r];T.isDynamic(i)?n[r]=T.unbox(i,r):t[r]=i})),{dynamic:n,static:t}}E(!!e,"invalid args to regl({...})"),E.type(e,"object","invalid args to regl({...})");var r=n(e.context||{}),i=n(e.uniforms||{}),a=n(e.attributes||{}),u=n(function(e){var n=t({},e);function r(e){if(e in n){var t=n[e];delete n[e],Object.keys(t).forEach((function(r){n[e+"."+r]=t[r]}))}}return delete n.uniforms,delete n.attributes,delete n.context,delete n.vao,"stencil"in n&&n.stencil.op&&(n.stencil.opBack=n.stencil.opFront=n.stencil.op,delete n.stencil.op),r("blend"),r("depth"),r("cull"),r("stencil"),r("polygonOffset"),r("scissor"),r("sample"),"vao"in e&&(n.vao=e.vao),n}(e)),s={gpuTime:0,cpuTime:0,count:0},c=M.compile(u,a,i,r,s),f=c.draw,l=c.batch,p=c.scope,h=[];return t((function(e,t){var n;if(o&&E.raise("context lost"),"function"==typeof e)return p.call(this,null,e,0);if("function"==typeof t)if("number"==typeof e)for(n=0;n<e;++n)p.call(this,null,t,n);else{if(!Array.isArray(e))return p.call(this,e,t,0);for(n=0;n<e.length;++n)p.call(this,e[n],t,n)}else if("number"==typeof e){if(e>0)return l.call(this,function(e){for(;h.length<e;)h.push(null);return h}(0|e),0|e)}else{if(!Array.isArray(e))return f.call(this,e);if(e.length)return l.call(this,e,e.length)}}),{stats:s})}I&&(I.addEventListener("webglcontextlost",te,!1),I.addEventListener("webglcontextrestored",ne,!1));var ie=_.setFBO=re({framebuffer:T.define.call(null,1,"framebuffer")});function ae(e,t){var n=0;M.procs.poll();var r=t.color;r&&(i.clearColor(+r[0]||0,+r[1]||0,+r[2]||0,+r[3]||0),n|=16384),"depth"in t&&(i.clearDepth(+t.depth),n|=256),"stencil"in t&&(i.clearStencil(0|t.stencil),n|=1024),E(!!n,"called regl.clear with no buffer specified"),i.clear(n)}function oe(e){return E.type(e,"function","regl.frame() callback must be a function"),N.push(e),$(),{cancel:function(){var t=lt(N,e);E(t>=0,"cannot cancel a frame twice"),N[t]=function e(){var t=lt(N,e);N[t]=N[N.length-1],N.length-=1,N.length<=0&&ee()}}}}function ue(){var e=k.viewport,t=k.scissor_box;e[0]=e[1]=t[0]=t[1]=0,v.viewportWidth=v.framebufferWidth=v.drawingBufferWidth=e[2]=t[2]=i.drawingBufferWidth,v.viewportHeight=v.framebufferHeight=v.drawingBufferHeight=e[3]=t[3]=i.drawingBufferHeight}function se(){v.tick+=1,v.time=fe(),ue(),M.procs.poll()}function ce(){ue(),M.procs.refresh(),h&&h.update()}function fe(){return(B()-d)/1e3}ce();var le=t(re,{clear:function(e){if(E("object"==typeof e&&e,"regl.clear() takes an object as input"),"framebuffer"in e)if(e.framebuffer&&"framebufferCube"===e.framebuffer_reglType)for(var n=0;n<6;++n)ie(t({framebuffer:e.framebuffer.faces[n]},e),ae);else ie(e,ae);else ae(0,e)},prop:T.define.bind(null,1),context:T.define.bind(null,2),this:T.define.bind(null,3),draw:re({}),buffer:function(e){return b.create(e,34962,!1,!1)},elements:function(e){return x.create(e,!1)},texture:S.create2D,cube:S.createCube,renderbuffer:w.create,framebuffer:_.create,framebufferCube:_.createCube,vao:A.createVAO,attributes:a,frame:oe,on:function(e,t){var n;switch(E.type(t,"function","listener callback must be a function"),e){case"frame":return oe(t);case"lost":n=G;break;case"restore":n=L;break;case"destroy":n=J;break;default:E.raise("invalid event, must be one of frame,lost,restore,destroy")}return n.push(t),{cancel:function(){for(var e=0;e<n.length;++e)if(n[e]===t)return n[e]=n[n.length-1],void n.pop()}}},limits:g,hasExtension:function(e){return g.extensions.indexOf(e.toLowerCase())>=0},read:O,destroy:function(){N.length=0,ee(),I&&(I.removeEventListener("webglcontextlost",te),I.removeEventListener("webglcontextrestored",ne)),C.clear(),_.clear(),w.clear(),S.clear(),x.clear(),b.clear(),A.clear(),h&&h.clear(),J.forEach((function(e){e()}))},_gl:i,_refresh:ce,poll:function(){se(),h&&h.update()},now:fe,stats:l});return r.onDone(null,le),le}}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(111);Object.keys(r).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}})}))},,,,,function(e,t,n){var r=function(e){"use strict";var t=Object.prototype,n=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",o=r.toStringTag||"@@toStringTag";function u(e,t,n,r){var i=t&&t.prototype instanceof f?t:f,a=Object.create(i.prototype),o=new x(r||[]);return a._invoke=function(e,t,n){var r="suspendedStart";return function(i,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw a;return S()}for(n.method=i,n.arg=a;;){var o=n.delegate;if(o){var u=b(o,n);if(u){if(u===c)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var f=s(e,t,n);if("normal"===f.type){if(r=n.done?"completed":"suspendedYield",f.arg===c)continue;return{value:f.arg,done:n.done}}"throw"===f.type&&(r="completed",n.method="throw",n.arg=f.arg)}}}(e,n,o),a}function s(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var c={};function f(){}function l(){}function p(){}var h={};h[i]=function(){return this};var d=Object.getPrototypeOf,m=d&&d(d(C([])));m&&m!==t&&n.call(m,i)&&(h=m);var y=p.prototype=f.prototype=Object.create(h);function v(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function g(e,t){var r;this._invoke=function(i,a){function o(){return new t((function(r,o){!function r(i,a,o,u){var c=s(e[i],e,a);if("throw"!==c.type){var f=c.arg,l=f.value;return l&&"object"==typeof l&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,o,u)}),(function(e){r("throw",e,o,u)})):t.resolve(l).then((function(e){f.value=e,o(f)}),(function(e){return r("throw",e,o,u)}))}u(c.arg)}(i,a,r,o)}))}return r=r?r.then(o,o):o()}}function b(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,b(e,t),"throw"===t.method))return c;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return c}var r=s(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,c;var i=r.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,c):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,c)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function x(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function C(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,a=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:S}}function S(){return{value:void 0,done:!0}}return l.prototype=y.constructor=p,p.constructor=l,p[o]=l.displayName="GeneratorFunction",e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===l||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,o in e||(e[o]="GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},v(g.prototype),g.prototype[a]=function(){return this},e.AsyncIterator=g,e.async=function(t,n,r,i,a){void 0===a&&(a=Promise);var o=new g(u(t,n,r,i),a);return e.isGeneratorFunction(n)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},v(y),y[o]="Generator",y[i]=function(){return this},y.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=C,x.prototype={constructor:x,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return o.type="throw",o.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],o=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),s=n.call(a,"finallyLoc");if(u&&s){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,c):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),c},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),E(n),c}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;E(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:C(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),c}},e}(e.exports);try{regeneratorRuntime=r}catch(e){Function("r","regeneratorRuntime = r")(r)}},function(e,t){var n,r,i=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function u(e){if(n===setTimeout)return setTimeout(e,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:a}catch(e){n=a}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var s,c=[],f=!1,l=-1;function p(){f&&s&&(f=!1,s.length?c=s.concat(c):l=-1,c.length&&h())}function h(){if(!f){var e=u(p);f=!0;for(var t=c.length;t;){for(s=c,c=[];++l<t;)s&&s[l].run();l=-1,t=c.length}s=null,f=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function d(e,t){this.fun=e,this.array=t}function m(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new d(e,t)),1!==c.length||f||u(h)},d.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=m,i.addListener=m,i.once=m,i.off=m,i.removeListener=m,i.removeAllListeners=m,i.emit=m,i.prependListener=m,i.prependOnceListener=m,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{s(r.next(e))}catch(e){a(e)}}function u(e){try{s(r.throw(e))}catch(e){a(e)}}function s(e){e.done?i(e.value):new n((function(t){t(e.value)})).then(o,u)}s((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=r[2&a[0]?"return":a[0]?"throw":"next"])&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[0,i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}};Object.defineProperty(t,"__esModule",{value:!0});var a=n(63),o=n(14),u=n(18),s=n(12),c=n(36),f=n(64),l=n(71),p=n(73),h=n(20),d=n(22),m=n(76),y=n(77),v=function(){function e(e){var t=e||{};if("object"!=typeof t)throw new Error(""+o.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT);if(void 0===t.defaultScope)t.defaultScope=u.BindingScopeEnum.Transient;else if(t.defaultScope!==u.BindingScopeEnum.Singleton&&t.defaultScope!==u.BindingScopeEnum.Transient&&t.defaultScope!==u.BindingScopeEnum.Request)throw new Error(""+o.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE);if(void 0===t.autoBindInjectable)t.autoBindInjectable=!1;else if("boolean"!=typeof t.autoBindInjectable)throw new Error(""+o.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE);if(void 0===t.skipBaseClassChecks)t.skipBaseClassChecks=!1;else if("boolean"!=typeof t.skipBaseClassChecks)throw new Error(""+o.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK);this.options={autoBindInjectable:t.autoBindInjectable,defaultScope:t.defaultScope,skipBaseClassChecks:t.skipBaseClassChecks},this.id=h.id(),this._bindingDictionary=new y.Lookup,this._snapshots=[],this._middleware=null,this.parent=null,this._metadataReader=new c.MetadataReader}return e.merge=function(t,n){var r=new e,i=f.getBindingDictionary(r),a=f.getBindingDictionary(t),o=f.getBindingDictionary(n);function u(e,t){e.traverse((function(e,n){n.forEach((function(e){t.add(e.serviceIdentifier,e.clone())}))}))}return u(a,i),u(o,i),r},e.prototype.load=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=this._getContainerModuleHelpersFactory(),r=0,i=e;r<i.length;r++){var a=i[r],o=n(a.id);a.registry(o.bindFunction,o.unbindFunction,o.isboundFunction,o.rebindFunction)}},e.prototype.loadAsync=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return r(this,void 0,void 0,(function(){var t,n,r,a,o;return i(this,(function(i){switch(i.label){case 0:t=this._getContainerModuleHelpersFactory(),n=0,r=e,i.label=1;case 1:return n<r.length?(a=r[n],o=t(a.id),[4,a.registry(o.bindFunction,o.unbindFunction,o.isboundFunction,o.rebindFunction)]):[3,4];case 2:i.sent(),i.label=3;case 3:return n++,[3,1];case 4:return[2]}}))}))},e.prototype.unload=function(){for(var e=this,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=function(e){return function(t){return t.moduleId===e}};t.forEach((function(t){var n=r(t.id);e._bindingDictionary.removeByCondition(n)}))},e.prototype.bind=function(e){var t=this.options.defaultScope||u.BindingScopeEnum.Transient,n=new a.Binding(e,t);return this._bindingDictionary.add(e,n),new p.BindingToSyntax(n)},e.prototype.rebind=function(e){return this.unbind(e),this.bind(e)},e.prototype.unbind=function(e){try{this._bindingDictionary.remove(e)}catch(t){throw new Error(o.CANNOT_UNBIND+" "+d.getServiceIdentifierAsString(e))}},e.prototype.unbindAll=function(){this._bindingDictionary=new y.Lookup},e.prototype.isBound=function(e){var t=this._bindingDictionary.hasKey(e);return!t&&this.parent&&(t=this.parent.isBound(e)),t},e.prototype.isBoundNamed=function(e,t){return this.isBoundTagged(e,s.NAMED_TAG,t)},e.prototype.isBoundTagged=function(e,t,n){var r=!1;if(this._bindingDictionary.hasKey(e)){var i=this._bindingDictionary.get(e),a=f.createMockRequest(this,e,t,n);r=i.some((function(e){return e.constraint(a)}))}return!r&&this.parent&&(r=this.parent.isBoundTagged(e,t,n)),r},e.prototype.snapshot=function(){this._snapshots.push(m.ContainerSnapshot.of(this._bindingDictionary.clone(),this._middleware))},e.prototype.restore=function(){var e=this._snapshots.pop();if(void 0===e)throw new Error(o.NO_MORE_SNAPSHOTS_AVAILABLE);this._bindingDictionary=e.bindings,this._middleware=e.middleware},e.prototype.createChild=function(t){var n=new e(t||this.options);return n.parent=this,n},e.prototype.applyMiddleware=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=this._middleware?this._middleware:this._planAndResolve();this._middleware=e.reduce((function(e,t){return t(e)}),n)},e.prototype.applyCustomMetadataReader=function(e){this._metadataReader=e},e.prototype.get=function(e){return this._get(!1,!1,u.TargetTypeEnum.Variable,e)},e.prototype.getTagged=function(e,t,n){return this._get(!1,!1,u.TargetTypeEnum.Variable,e,t,n)},e.prototype.getNamed=function(e,t){return this.getTagged(e,s.NAMED_TAG,t)},e.prototype.getAll=function(e){return this._get(!0,!0,u.TargetTypeEnum.Variable,e)},e.prototype.getAllTagged=function(e,t,n){return this._get(!1,!0,u.TargetTypeEnum.Variable,e,t,n)},e.prototype.getAllNamed=function(e,t){return this.getAllTagged(e,s.NAMED_TAG,t)},e.prototype.resolve=function(e){var t=this.createChild();return t.bind(e).toSelf(),t.get(e)},e.prototype._getContainerModuleHelpersFactory=function(){var e=this,t=function(e,t){e._binding.moduleId=t},n=function(n){return function(r){var i=e.rebind.bind(e)(r);return t(i,n),i}};return function(r){return{bindFunction:(i=r,function(n){var r=e.bind.bind(e)(n);return t(r,i),r}),isboundFunction:function(t){return e.isBound.bind(e)(t)},rebindFunction:n(r),unbindFunction:function(t){e.unbind.bind(e)(t)}};var i}},e.prototype._get=function(e,t,n,r,i,a){var u=null,s={avoidConstraints:e,contextInterceptor:function(e){return e},isMultiInject:t,key:i,serviceIdentifier:r,targetType:n,value:a};if(this._middleware){if(null==(u=this._middleware(s)))throw new Error(o.INVALID_MIDDLEWARE_RETURN)}else u=this._planAndResolve()(s);return u},e.prototype._planAndResolve=function(){var e=this;return function(t){var n=f.plan(e._metadataReader,e,t.isMultiInject,t.targetType,t.serviceIdentifier,t.key,t.value,t.avoidConstraints);return n=t.contextInterceptor(n),l.resolve(n)}},e}();t.Container=v},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(18),i=n(20),a=function(){function e(e,t){this.id=i.id(),this.activated=!1,this.serviceIdentifier=e,this.scope=t,this.type=r.BindingTypeEnum.Invalid,this.constraint=function(e){return!0},this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.onActivation=null,this.dynamicValue=null}return e.prototype.clone=function(){var t=new e(this.serviceIdentifier,this.scope);return t.activated=!1,t.implementationType=this.implementationType,t.dynamicValue=this.dynamicValue,t.scope=this.scope,t.type=this.type,t.factory=this.factory,t.provider=this.provider,t.constraint=this.constraint,t.onActivation=this.onActivation,t.cache=this.cache,t},e}();t.Binding=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(65),i=n(14),a=n(18),o=n(12),u=n(37),s=n(22),c=n(66),f=n(17),l=n(67),p=n(68),h=n(70),d=n(39);function m(e){return e._bindingDictionary}function y(e,t,n,a,o){var u=v(n.container,o.serviceIdentifier),c=[];return u.length===r.BindingCount.NoBindingsAvailable&&n.container.options.autoBindInjectable&&"function"==typeof o.serviceIdentifier&&e.getConstructorMetadata(o.serviceIdentifier).compilerGeneratedMetadata&&(n.container.bind(o.serviceIdentifier).toSelf(),u=v(n.container,o.serviceIdentifier)),c=t?u:u.filter((function(e){var t=new h.Request(e.serviceIdentifier,n,a,e,o);return e.constraint(t)})),function(e,t,n,a){switch(t.length){case r.BindingCount.NoBindingsAvailable:if(n.isOptional())return t;var o=s.getServiceIdentifierAsString(e),u=i.NOT_REGISTERED;throw u+=s.listMetadataForTarget(o,n),u+=s.listRegisteredBindingsForServiceIdentifier(a,o,v),new Error(u);case r.BindingCount.OnlyOneBindingAvailable:if(!n.isArray())return t;case r.BindingCount.MultipleBindingsAvailable:default:if(n.isArray())return t;o=s.getServiceIdentifierAsString(e),u=i.AMBIGUOUS_MATCH+" "+o;throw u+=s.listRegisteredBindingsForServiceIdentifier(a,o,v),new Error(u)}}(o.serviceIdentifier,c,o,n.container),c}function v(e,t){var n=[],r=m(e);return r.hasKey(t)?n=r.get(t):null!==e.parent&&(n=v(e.parent,t)),n}t.getBindingDictionary=m,t.plan=function(e,t,n,r,m,v,g,b){void 0===b&&(b=!1);var A=new c.Context(t),E=function(e,t,n,r,i,a){var u=e?o.MULTI_INJECT_TAG:o.INJECT_TAG,s=new f.Metadata(u,n),c=new d.Target(t,r,n,s);if(void 0!==i){var l=new f.Metadata(i,a);c.metadata.push(l)}return c}(n,r,m,"",v,g);try{return function e(t,n,r,o,u,s){var c,f;if(null===u){c=y(t,n,o,null,s),f=new h.Request(r,o,null,c,s);var d=new l.Plan(o,f);o.addPlan(d)}else c=y(t,n,o,u,s),f=u.addChildRequest(s.serviceIdentifier,c,s);c.forEach((function(n){var r=null;if(s.isArray())r=f.addChildRequest(n.serviceIdentifier,n,s);else{if(n.cache)return;r=f}if(n.type===a.BindingTypeEnum.Instance&&null!==n.implementationType){var u=p.getDependencies(t,n.implementationType);if(!o.container.options.skipBaseClassChecks){var c=p.getBaseClassDependencyCount(t,n.implementationType);if(u.length<c){var l=i.ARGUMENTS_LENGTH_MISMATCH(p.getFunctionName(n.implementationType));throw new Error(l)}}u.forEach((function(n){e(t,!1,n.serviceIdentifier,o,r,n)}))}}))}(e,b,m,A,null,E),A}catch(e){throw u.isStackOverflowExeption(e)&&A.plan&&s.circularDependencyToException(A.plan.rootRequest),e}},t.createMockRequest=function(e,t,n,r){var i=new d.Target(a.TargetTypeEnum.Variable,"",t,new f.Metadata(n,r)),o=new c.Context(e);return new h.Request(t,o,null,[],i)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.BindingCount={MultipleBindingsAvailable:2,NoBindingsAvailable:0,OnlyOneBindingAvailable:1}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(20),i=function(){function e(e){this.id=r.id(),this.container=e}return e.prototype.addPlan=function(e){this.plan=e},e.prototype.setCurrentRequest=function(e){this.currentRequest=e},e}();t.Context=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e,t){this.parentContext=e,this.rootRequest=t};t.Plan=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(38),i=n(14),a=n(18),o=n(12),u=n(22);t.getFunctionName=u.getFunctionName;var s=n(39);function c(e,t,n,r){var o=e.getConstructorMetadata(n),u=o.compilerGeneratedMetadata;if(void 0===u){var c=i.MISSING_INJECTABLE_ANNOTATION+" "+t+".";throw new Error(c)}var p=o.userGeneratedMetadata,h=Object.keys(p),d=function(e,t,n,r,i){for(var a=[],o=0;o<i;o++){var u=f(o,e,t,n,r);null!==u&&a.push(u)}return a}(r,t,u,p,0===n.length&&h.length>0?h.length:n.length),m=function e(t,n){for(var r=t.getPropertiesMetadata(n),i=[],o=Object.keys(r),u=0,c=o;u<c.length;u++){var f=c[u],p=r[f],h=l(r[f]),d=h.targetName||f,m=h.inject||h.multiInject,y=new s.Target(a.TargetTypeEnum.ClassProperty,d,m);y.metadata=p,i.push(y)}var v=Object.getPrototypeOf(n.prototype).constructor;if(v!==Object){var g=e(t,v);i=i.concat(g)}return i}(e,n);return d.concat(m)}function f(e,t,n,o,u){var c=u[e.toString()]||[],f=l(c),p=!0!==f.unmanaged,h=o[e],d=f.inject||f.multiInject;if((h=d||h)instanceof r.LazyServiceIdentifer&&(h=h.unwrap()),p){if(!t&&(h===Object||h===Function||void 0===h)){var m=i.MISSING_INJECT_ANNOTATION+" argument "+e+" in class "+n+".";throw new Error(m)}var y=new s.Target(a.TargetTypeEnum.ConstructorArgument,f.targetName,h);return y.metadata=c,y}return null}function l(e){var t={};return e.forEach((function(e){t[e.key.toString()]=e.value})),{inject:t[o.INJECT_TAG],multiInject:t[o.MULTI_INJECT_TAG],targetName:t[o.NAME_TAG],unmanaged:t[o.UNMANAGED_TAG]}}t.getDependencies=function(e,t){return c(e,u.getFunctionName(t),t,!1)},t.getBaseClassDependencyCount=function e(t,n){var r=Object.getPrototypeOf(n.prototype).constructor;if(r!==Object){var i=c(t,u.getFunctionName(r),r,!0),a=i.map((function(e){return e.metadata.filter((function(e){return e.key===o.UNMANAGED_TAG}))})),s=[].concat.apply([],a).length,f=i.length-s;return f>0?f:e(t,r)}return 0}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e){this.str=e}return e.prototype.startsWith=function(e){return 0===this.str.indexOf(e)},e.prototype.endsWith=function(e){var t,n=e.split("").reverse().join("");return t=this.str.split("").reverse().join(""),this.startsWith.call({str:t},n)},e.prototype.contains=function(e){return-1!==this.str.indexOf(e)},e.prototype.equals=function(e){return this.str===e},e.prototype.value=function(){return this.str},e}();t.QueryableString=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(20),i=function(){function e(e,t,n,i,a){this.id=r.id(),this.serviceIdentifier=e,this.parentContext=t,this.parentRequest=n,this.target=a,this.childRequests=[],this.bindings=Array.isArray(i)?i:[i],this.requestScope=null===n?new Map:null}return e.prototype.addChildRequest=function(t,n,r){var i=new e(t,this.parentContext,this,n,r);return this.childRequests.push(i),i},e}();t.Request=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(14),i=n(18),a=n(37),o=n(22),u=n(72),s=function(e,t,n){try{return n()}catch(n){throw a.isStackOverflowExeption(n)?new Error(r.CIRCULAR_DEPENDENCY_IN_FACTORY(e,t.toString())):n}},c=function(e){return function(t){t.parentContext.setCurrentRequest(t);var n=t.bindings,a=t.childRequests,f=t.target&&t.target.isArray(),l=!(t.parentRequest&&t.parentRequest.target&&t.target&&t.parentRequest.target.matchesArray(t.target.serviceIdentifier));if(f&&l)return a.map((function(t){return c(e)(t)}));var p=null;if(!t.target.isOptional()||0!==n.length){var h=n[0],d=h.scope===i.BindingScopeEnum.Singleton,m=h.scope===i.BindingScopeEnum.Request;if(d&&h.activated)return h.cache;if(m&&null!==e&&e.has(h.id))return e.get(h.id);if(h.type===i.BindingTypeEnum.ConstantValue)p=h.cache;else if(h.type===i.BindingTypeEnum.Function)p=h.cache;else if(h.type===i.BindingTypeEnum.Constructor)p=h.implementationType;else if(h.type===i.BindingTypeEnum.DynamicValue&&null!==h.dynamicValue)p=s("toDynamicValue",h.serviceIdentifier,(function(){return h.dynamicValue(t.parentContext)}));else if(h.type===i.BindingTypeEnum.Factory&&null!==h.factory)p=s("toFactory",h.serviceIdentifier,(function(){return h.factory(t.parentContext)}));else if(h.type===i.BindingTypeEnum.Provider&&null!==h.provider)p=s("toProvider",h.serviceIdentifier,(function(){return h.provider(t.parentContext)}));else{if(h.type!==i.BindingTypeEnum.Instance||null===h.implementationType){var y=o.getServiceIdentifierAsString(t.serviceIdentifier);throw new Error(r.INVALID_BINDING_TYPE+" "+y)}p=u.resolveInstance(h.implementationType,a,c(e))}return"function"==typeof h.onActivation&&(p=h.onActivation(t.parentContext,p)),d&&(h.cache=p,h.activated=!0),m&&null!==e&&!e.has(h.id)&&e.set(h.id,p),p}}};t.resolve=function(e){return c(e.plan.rootRequest.requestScope)(e.plan.rootRequest)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(14),i=n(18),a=n(12);t.resolveInstance=function(e,t,n){var o,u,s=null;if(t.length>0){var c=t.filter((function(e){return null!==e.target&&e.target.type===i.TargetTypeEnum.ConstructorArgument})).map(n);u=c,s=function(e,t,n){var r=t.filter((function(e){return null!==e.target&&e.target.type===i.TargetTypeEnum.ClassProperty})),a=r.map(n);return r.forEach((function(t,n){var r;r=t.target.name.value();var i=a[n];e[r]=i})),e}(s=new((o=e).bind.apply(o,[void 0].concat(u))),t,n)}else s=new e;return function(e,t){if(Reflect.hasMetadata(a.POST_CONSTRUCT,e)){var n=Reflect.getMetadata(a.POST_CONSTRUCT,e);try{t[n.value]()}catch(t){throw new Error(r.POST_CONSTRUCT_ERROR(e.name,t.message))}}}(e,s),s}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(14),i=n(18),a=n(74),o=n(40),u=function(){function e(e){this._binding=e}return e.prototype.to=function(e){return this._binding.type=i.BindingTypeEnum.Instance,this._binding.implementationType=e,new a.BindingInWhenOnSyntax(this._binding)},e.prototype.toSelf=function(){if("function"!=typeof this._binding.serviceIdentifier)throw new Error(""+r.INVALID_TO_SELF_VALUE);var e=this._binding.serviceIdentifier;return this.to(e)},e.prototype.toConstantValue=function(e){return this._binding.type=i.BindingTypeEnum.ConstantValue,this._binding.cache=e,this._binding.dynamicValue=null,this._binding.implementationType=null,new o.BindingWhenOnSyntax(this._binding)},e.prototype.toDynamicValue=function(e){return this._binding.type=i.BindingTypeEnum.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=e,this._binding.implementationType=null,new a.BindingInWhenOnSyntax(this._binding)},e.prototype.toConstructor=function(e){return this._binding.type=i.BindingTypeEnum.Constructor,this._binding.implementationType=e,new o.BindingWhenOnSyntax(this._binding)},e.prototype.toFactory=function(e){return this._binding.type=i.BindingTypeEnum.Factory,this._binding.factory=e,new o.BindingWhenOnSyntax(this._binding)},e.prototype.toFunction=function(e){if("function"!=typeof e)throw new Error(r.INVALID_FUNCTION_BINDING);var t=this.toConstantValue(e);return this._binding.type=i.BindingTypeEnum.Function,t},e.prototype.toAutoFactory=function(e){return this._binding.type=i.BindingTypeEnum.Factory,this._binding.factory=function(t){return function(){return t.container.get(e)}},new o.BindingWhenOnSyntax(this._binding)},e.prototype.toProvider=function(e){return this._binding.type=i.BindingTypeEnum.Provider,this._binding.provider=e,new o.BindingWhenOnSyntax(this._binding)},e.prototype.toService=function(e){this.toDynamicValue((function(t){return t.container.get(e)}))},e}();t.BindingToSyntax=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(75),i=n(26),a=n(27),o=function(){function e(e){this._binding=e,this._bindingWhenSyntax=new a.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new i.BindingOnSyntax(this._binding),this._bindingInSyntax=new r.BindingInSyntax(e)}return e.prototype.inRequestScope=function(){return this._bindingInSyntax.inRequestScope()},e.prototype.inSingletonScope=function(){return this._bindingInSyntax.inSingletonScope()},e.prototype.inTransientScope=function(){return this._bindingInSyntax.inTransientScope()},e.prototype.when=function(e){return this._bindingWhenSyntax.when(e)},e.prototype.whenTargetNamed=function(e){return this._bindingWhenSyntax.whenTargetNamed(e)},e.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},e.prototype.whenTargetTagged=function(e,t){return this._bindingWhenSyntax.whenTargetTagged(e,t)},e.prototype.whenInjectedInto=function(e){return this._bindingWhenSyntax.whenInjectedInto(e)},e.prototype.whenParentNamed=function(e){return this._bindingWhenSyntax.whenParentNamed(e)},e.prototype.whenParentTagged=function(e,t){return this._bindingWhenSyntax.whenParentTagged(e,t)},e.prototype.whenAnyAncestorIs=function(e){return this._bindingWhenSyntax.whenAnyAncestorIs(e)},e.prototype.whenNoAncestorIs=function(e){return this._bindingWhenSyntax.whenNoAncestorIs(e)},e.prototype.whenAnyAncestorNamed=function(e){return this._bindingWhenSyntax.whenAnyAncestorNamed(e)},e.prototype.whenAnyAncestorTagged=function(e,t){return this._bindingWhenSyntax.whenAnyAncestorTagged(e,t)},e.prototype.whenNoAncestorNamed=function(e){return this._bindingWhenSyntax.whenNoAncestorNamed(e)},e.prototype.whenNoAncestorTagged=function(e,t){return this._bindingWhenSyntax.whenNoAncestorTagged(e,t)},e.prototype.whenAnyAncestorMatches=function(e){return this._bindingWhenSyntax.whenAnyAncestorMatches(e)},e.prototype.whenNoAncestorMatches=function(e){return this._bindingWhenSyntax.whenNoAncestorMatches(e)},e.prototype.onActivation=function(e){return this._bindingOnSyntax.onActivation(e)},e}();t.BindingInWhenOnSyntax=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(18),i=n(40),a=function(){function e(e){this._binding=e}return e.prototype.inRequestScope=function(){return this._binding.scope=r.BindingScopeEnum.Request,new i.BindingWhenOnSyntax(this._binding)},e.prototype.inSingletonScope=function(){return this._binding.scope=r.BindingScopeEnum.Singleton,new i.BindingWhenOnSyntax(this._binding)},e.prototype.inTransientScope=function(){return this._binding.scope=r.BindingScopeEnum.Transient,new i.BindingWhenOnSyntax(this._binding)},e}();t.BindingInSyntax=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){}return e.of=function(t,n){var r=new e;return r.bindings=t,r.middleware=n,r},e}();t.ContainerSnapshot=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(14),i=function(){function e(){this._map=new Map}return e.prototype.getMap=function(){return this._map},e.prototype.add=function(e,t){if(null==e)throw new Error(r.NULL_ARGUMENT);if(null==t)throw new Error(r.NULL_ARGUMENT);var n=this._map.get(e);void 0!==n?(n.push(t),this._map.set(e,n)):this._map.set(e,[t])},e.prototype.get=function(e){if(null==e)throw new Error(r.NULL_ARGUMENT);var t=this._map.get(e);if(void 0!==t)return t;throw new Error(r.KEY_NOT_FOUND)},e.prototype.remove=function(e){if(null==e)throw new Error(r.NULL_ARGUMENT);if(!this._map.delete(e))throw new Error(r.KEY_NOT_FOUND)},e.prototype.removeByCondition=function(e){var t=this;this._map.forEach((function(n,r){var i=n.filter((function(t){return!e(t)}));i.length>0?t._map.set(r,i):t._map.delete(r)}))},e.prototype.hasKey=function(e){if(null==e)throw new Error(r.NULL_ARGUMENT);return this._map.has(e)},e.prototype.clone=function(){var t=new e;return this._map.forEach((function(e,n){e.forEach((function(e){return t.add(n,e.clone())}))})),t},e.prototype.traverse=function(e){this._map.forEach((function(t,n){e(n,t)}))},e}();t.Lookup=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(20),i=function(e){this.id=r.id(),this.registry=e};t.ContainerModule=i;var a=function(e){this.id=r.id(),this.registry=e};t.AsyncContainerModule=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(14),i=n(12);t.injectable=function(){return function(e){if(Reflect.hasOwnMetadata(i.PARAM_TYPES,e))throw new Error(r.DUPLICATED_INJECTABLE_DECORATOR);var t=Reflect.getMetadata(i.DESIGN_PARAM_TYPES,e)||[];return Reflect.defineMetadata(i.PARAM_TYPES,t,e),e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(17),i=n(19);t.tagged=function(e,t){return function(n,a,o){var u=new r.Metadata(e,t);"number"==typeof o?i.tagParameter(n,a,o,u):i.tagProperty(n,a,u)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(12),i=n(17),a=n(19);t.named=function(e){return function(t,n,o){var u=new i.Metadata(r.NAMED_TAG,e);"number"==typeof o?a.tagParameter(t,n,o,u):a.tagProperty(t,n,u)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(12),i=n(17),a=n(19);t.optional=function(){return function(e,t,n){var o=new i.Metadata(r.OPTIONAL_TAG,!0);"number"==typeof n?a.tagParameter(e,t,n,o):a.tagProperty(e,t,o)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(12),i=n(17),a=n(19);t.unmanaged=function(){return function(e,t,n){var o=new i.Metadata(r.UNMANAGED_TAG,!0);a.tagParameter(e,t,n,o)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(12),i=n(17),a=n(19);t.multiInject=function(e){return function(t,n,o){var u=new i.Metadata(r.MULTI_INJECT_TAG,e);"number"==typeof o?a.tagParameter(t,n,o,u):a.tagProperty(t,n,u)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(12),i=n(17),a=n(19);t.targetName=function(e){return function(t,n,o){var u=new i.Metadata(r.NAME_TAG,e);a.tagParameter(t,n,o,u)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(14),i=n(12),a=n(17);t.postConstruct=function(){return function(e,t,n){var o=new a.Metadata(i.POST_CONSTRUCT,t);if(Reflect.hasOwnMetadata(i.POST_CONSTRUCT,e.constructor))throw new Error(r.MULTIPLE_POST_CONSTRUCT_METHODS);Reflect.defineMetadata(i.POST_CONSTRUCT,o,e.constructor)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.multiBindToService=function(e){return function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return n.forEach((function(n){return e.bind(n).toService(t)}))}}}},function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,i=!1,a=void 0;try{for(var o,u=e[Symbol.iterator]();!(r=(o=u.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==u.return||u.return()}finally{if(i)throw a}}return n}}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(e,t,n){var r=n(28),i=Object.prototype,a=i.hasOwnProperty,o=i.toString,u=r?r.toStringTag:void 0;e.exports=function(e){var t=a.call(e,u),n=e[u];try{e[u]=void 0;var r=!0}catch(e){}var i=o.call(e);return r&&(t?e[u]=n:delete e[u]),i}},function(e,t){var n=Object.prototype.toString;e.exports=function(e){return n.call(e)}},function(e,t){function n(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=n=function(e){return typeof e}:e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(t)}e.exports=n},function(e,t){e.exports=function(e){return-1!==Function.toString.call(e).indexOf("[native code]")}},function(e,t,n){var r=n(29),i=n(96);function a(t,n,o){return i()?e.exports=a=Reflect.construct:e.exports=a=function(e,t,n){var i=[null];i.push.apply(i,t);var a=new(Function.bind.apply(e,i));return n&&r(a,n.prototype),a},a.apply(null,arguments)}e.exports=a},function(e,t){e.exports=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Symbol.for("INJECTION");function i(e,t,n,i){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:function(){return i&&!Reflect.hasMetadata(r,this,t)&&Reflect.defineMetadata(r,n(),this,t),Reflect.hasMetadata(r,this,t)?Reflect.getMetadata(r,this,t):n()},set:function(e){Reflect.defineMetadata(r,e,this,t)}})}t.makePropertyInjectDecorator=function(e,t){return function(n){return function(r,a){i(r,a,(function(){return e.get(n)}),t)}}},t.makePropertyInjectNamedDecorator=function(e,t){return function(n,r){return function(a,o){i(a,o,(function(){return e.getNamed(n,r)}),t)}}},t.makePropertyInjectTaggedDecorator=function(e,t){return function(n,r,a){return function(o,u){i(o,u,(function(){return e.getTagged(n,r,a)}),t)}}},t.makePropertyMultiInjectDecorator=function(e,t){return function(n){return function(r,a){i(r,a,(function(){return e.getAll(n)}),t)}}}},function(e,t,n){var r=n(47),i=n(99);e.exports=function e(t,n,a,o,u){var s=-1,c=t.length;for(a||(a=i),u||(u=[]);++s<c;){var f=t[s];n>0&&a(f)?n>1?e(f,n-1,a,o,u):r(u,f):o||(u[u.length]=f)}return u}},function(e,t,n){var r=n(28),i=n(100),a=n(48),o=r?r.isConcatSpreadable:void 0;e.exports=function(e){return a(e)||i(e)||!!(o&&e&&e[o])}},function(e,t,n){var r=n(101),i=n(23),a=Object.prototype,o=a.hasOwnProperty,u=a.propertyIsEnumerable,s=r(function(){return arguments}())?r:function(e){return i(e)&&o.call(e,"callee")&&!u.call(e,"callee")};e.exports=s},function(e,t,n){var r=n(24),i=n(23);e.exports=function(e){return i(e)&&"[object Arguments]"==r(e)}},function(e,t){e.exports=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}},function(e,t,n){var r=n(43);e.exports=function(e){if(Array.isArray(e))return r(e)}},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(e,t,n){var r=n(24),i=n(107),a=n(23),o={};o["[object Float32Array]"]=o["[object Float64Array]"]=o["[object Int8Array]"]=o["[object Int16Array]"]=o["[object Int32Array]"]=o["[object Uint8Array]"]=o["[object Uint8ClampedArray]"]=o["[object Uint16Array]"]=o["[object Uint32Array]"]=!0,o["[object Arguments]"]=o["[object Array]"]=o["[object ArrayBuffer]"]=o["[object Boolean]"]=o["[object DataView]"]=o["[object Date]"]=o["[object Error]"]=o["[object Function]"]=o["[object Map]"]=o["[object Number]"]=o["[object Object]"]=o["[object RegExp]"]=o["[object Set]"]=o["[object String]"]=o["[object WeakMap]"]=!1,e.exports=function(e){return a(e)&&i(e.length)&&!!o[r(e)]}},function(e,t){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},function(e,t){e.exports=function(e){return function(t){return e(t)}}},function(e,t,n){(function(e){var r=n(45),i=t&&!t.nodeType&&t,a=i&&"object"==typeof e&&e&&!e.nodeType&&e,o=a&&a.exports===i&&r.process,u=function(){try{var e=a&&a.require&&a.require("util").types;return e||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=u}).call(this,n(110)(e))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){"use strict";n.r(t),n.d(t,"Target",(function(){return de})),n.d(t,"Parser",(function(){return De})),n.d(t,"container",(function(){return Ru})),n.d(t,"lazyInject",(function(){return Gu})),n.d(t,"lazyMultiInject",(function(){return Lu})),n.d(t,"createEntity",(function(){return b})),n.d(t,"Component",(function(){return O})),n.d(t,"ComponentManager",(function(){return k})),n.d(t,"Entity",(function(){})),n.d(t,"ISystem",(function(){return qu.ISystem})),n.d(t,"IRenderEngine",(function(){return Wu.IRenderEngine})),n.d(t,"IWebGPUEngineOptions",(function(){return Wu.IWebGPUEngineOptions})),n.d(t,"IBoxGeometryParams",(function(){})),n.d(t,"IUniform",(function(){})),n.d(t,"IMeshParams",(function(){})),n.d(t,"IMaterialParams",(function(){})),n.d(t,"IRenderPath",(function(){return Xo.IRenderPath})),n.d(t,"IDENTIFIER",(function(){return G})),n.d(t,"CameraSystem",(function(){return L})),n.d(t,"ComputeSystem",(function(){return Ge})),n.d(t,"ComputeType",(function(){})),n.d(t,"FrameGraphSystem",(function(){return Ve})),n.d(t,"GeometrySystem",(function(){return ga})),n.d(t,"InteractionSystem",(function(){return Ea})),n.d(t,"MaterialSystem",(function(){return Da})),n.d(t,"MeshSystem",(function(){return go})),n.d(t,"SceneSystem",(function(){return bo})),n.d(t,"SceneGraphSystem",(function(){return Ao})),n.d(t,"CameraComponent",(function(){return wo})),n.d(t,"ComputeComponent",(function(){return Do})),n.d(t,"CullableComponent",(function(){return Oo})),n.d(t,"MeshComponent",(function(){return Io})),n.d(t,"TransformComponent",(function(){return jo})),n.d(t,"MaterialComponent",(function(){return Mo})),n.d(t,"WebGLEngine",(function(){return Zu})),n.d(t,"WebGPUEngine",(function(){return is})),n.d(t,"World",(function(){return cs}));var r={};n.r(r),n.d(r,"create",(function(){return He})),n.d(r,"fromMat4",(function(){return Xe})),n.d(r,"clone",(function(){return Ke})),n.d(r,"copy",(function(){return Ye})),n.d(r,"fromValues",(function(){return Je})),n.d(r,"set",(function(){return Qe})),n.d(r,"identity",(function(){return Ze})),n.d(r,"transpose",(function(){return $e})),n.d(r,"invert",(function(){return et})),n.d(r,"adjoint",(function(){return tt})),n.d(r,"determinant",(function(){return nt})),n.d(r,"multiply",(function(){return rt})),n.d(r,"translate",(function(){return it})),n.d(r,"rotate",(function(){return at})),n.d(r,"scale",(function(){return ot})),n.d(r,"fromTranslation",(function(){return ut})),n.d(r,"fromRotation",(function(){return st})),n.d(r,"fromScaling",(function(){return ct})),n.d(r,"fromMat2d",(function(){return ft})),n.d(r,"fromQuat",(function(){return lt})),n.d(r,"normalFromMat4",(function(){return pt})),n.d(r,"projection",(function(){return ht})),n.d(r,"str",(function(){return dt})),n.d(r,"frob",(function(){return mt})),n.d(r,"add",(function(){return yt})),n.d(r,"subtract",(function(){return vt})),n.d(r,"multiplyScalar",(function(){return gt})),n.d(r,"multiplyScalarAndAdd",(function(){return bt})),n.d(r,"exactEquals",(function(){return At})),n.d(r,"equals",(function(){return Et})),n.d(r,"mul",(function(){return xt})),n.d(r,"sub",(function(){return Ct}));var i={};n.r(i),n.d(i,"create",(function(){return St})),n.d(i,"clone",(function(){return wt})),n.d(i,"copy",(function(){return Tt})),n.d(i,"fromValues",(function(){return Dt})),n.d(i,"set",(function(){return Bt})),n.d(i,"identity",(function(){return _t})),n.d(i,"transpose",(function(){return Mt})),n.d(i,"invert",(function(){return Ft})),n.d(i,"adjoint",(function(){return Ot})),n.d(i,"determinant",(function(){return kt})),n.d(i,"multiply",(function(){return It})),n.d(i,"translate",(function(){return Pt})),n.d(i,"scale",(function(){return jt})),n.d(i,"rotate",(function(){return Rt})),n.d(i,"rotateX",(function(){return Nt})),n.d(i,"rotateY",(function(){return Gt})),n.d(i,"rotateZ",(function(){return Lt})),n.d(i,"fromTranslation",(function(){return zt})),n.d(i,"fromScaling",(function(){return Vt})),n.d(i,"fromRotation",(function(){return Ut})),n.d(i,"fromXRotation",(function(){return Wt})),n.d(i,"fromYRotation",(function(){return qt})),n.d(i,"fromZRotation",(function(){return Ht})),n.d(i,"fromRotationTranslation",(function(){return Xt})),n.d(i,"fromQuat2",(function(){return Kt})),n.d(i,"getTranslation",(function(){return Yt})),n.d(i,"getScaling",(function(){return Jt})),n.d(i,"getRotation",(function(){return Qt})),n.d(i,"fromRotationTranslationScale",(function(){return Zt})),n.d(i,"fromRotationTranslationScaleOrigin",(function(){return $t})),n.d(i,"fromQuat",(function(){return en})),n.d(i,"frustum",(function(){return tn})),n.d(i,"perspective",(function(){return nn})),n.d(i,"perspectiveFromFieldOfView",(function(){return rn})),n.d(i,"ortho",(function(){return an})),n.d(i,"lookAt",(function(){return on})),n.d(i,"targetTo",(function(){return un})),n.d(i,"str",(function(){return sn})),n.d(i,"frob",(function(){return cn})),n.d(i,"add",(function(){return fn})),n.d(i,"subtract",(function(){return ln})),n.d(i,"multiplyScalar",(function(){return pn})),n.d(i,"multiplyScalarAndAdd",(function(){return hn})),n.d(i,"exactEquals",(function(){return dn})),n.d(i,"equals",(function(){return mn})),n.d(i,"mul",(function(){return yn})),n.d(i,"sub",(function(){return vn}));var a={};n.r(a),n.d(a,"create",(function(){return gn})),n.d(a,"clone",(function(){return bn})),n.d(a,"length",(function(){return An})),n.d(a,"fromValues",(function(){return En})),n.d(a,"copy",(function(){return xn})),n.d(a,"set",(function(){return Cn})),n.d(a,"add",(function(){return Sn})),n.d(a,"subtract",(function(){return wn})),n.d(a,"multiply",(function(){return Tn})),n.d(a,"divide",(function(){return Dn})),n.d(a,"ceil",(function(){return Bn})),n.d(a,"floor",(function(){return _n})),n.d(a,"min",(function(){return Mn})),n.d(a,"max",(function(){return Fn})),n.d(a,"round",(function(){return On})),n.d(a,"scale",(function(){return kn})),n.d(a,"scaleAndAdd",(function(){return In})),n.d(a,"distance",(function(){return Pn})),n.d(a,"squaredDistance",(function(){return jn})),n.d(a,"squaredLength",(function(){return Rn})),n.d(a,"negate",(function(){return Nn})),n.d(a,"inverse",(function(){return Gn})),n.d(a,"normalize",(function(){return Ln})),n.d(a,"dot",(function(){return zn})),n.d(a,"cross",(function(){return Vn})),n.d(a,"lerp",(function(){return Un})),n.d(a,"hermite",(function(){return Wn})),n.d(a,"bezier",(function(){return qn})),n.d(a,"random",(function(){return Hn})),n.d(a,"transformMat4",(function(){return Xn})),n.d(a,"transformMat3",(function(){return Kn})),n.d(a,"transformQuat",(function(){return Yn})),n.d(a,"rotateX",(function(){return Jn})),n.d(a,"rotateY",(function(){return Qn})),n.d(a,"rotateZ",(function(){return Zn})),n.d(a,"angle",(function(){return $n})),n.d(a,"zero",(function(){return er})),n.d(a,"str",(function(){return tr})),n.d(a,"exactEquals",(function(){return nr})),n.d(a,"equals",(function(){return rr})),n.d(a,"sub",(function(){return ar})),n.d(a,"mul",(function(){return or})),n.d(a,"div",(function(){return ur})),n.d(a,"dist",(function(){return sr})),n.d(a,"sqrDist",(function(){return cr})),n.d(a,"len",(function(){return fr})),n.d(a,"sqrLen",(function(){return lr})),n.d(a,"forEach",(function(){return pr}));var o={};n.r(o),n.d(o,"create",(function(){return hr})),n.d(o,"clone",(function(){return dr})),n.d(o,"fromValues",(function(){return mr})),n.d(o,"copy",(function(){return yr})),n.d(o,"set",(function(){return vr})),n.d(o,"add",(function(){return gr})),n.d(o,"subtract",(function(){return br})),n.d(o,"multiply",(function(){return Ar})),n.d(o,"divide",(function(){return Er})),n.d(o,"ceil",(function(){return xr})),n.d(o,"floor",(function(){return Cr})),n.d(o,"min",(function(){return Sr})),n.d(o,"max",(function(){return wr})),n.d(o,"round",(function(){return Tr})),n.d(o,"scale",(function(){return Dr})),n.d(o,"scaleAndAdd",(function(){return Br})),n.d(o,"distance",(function(){return _r})),n.d(o,"squaredDistance",(function(){return Mr})),n.d(o,"length",(function(){return Fr})),n.d(o,"squaredLength",(function(){return Or})),n.d(o,"negate",(function(){return kr})),n.d(o,"inverse",(function(){return Ir})),n.d(o,"normalize",(function(){return Pr})),n.d(o,"dot",(function(){return jr})),n.d(o,"cross",(function(){return Rr})),n.d(o,"lerp",(function(){return Nr})),n.d(o,"random",(function(){return Gr})),n.d(o,"transformMat4",(function(){return Lr})),n.d(o,"transformQuat",(function(){return zr})),n.d(o,"zero",(function(){return Vr})),n.d(o,"str",(function(){return Ur})),n.d(o,"exactEquals",(function(){return Wr})),n.d(o,"equals",(function(){return qr})),n.d(o,"sub",(function(){return Hr})),n.d(o,"mul",(function(){return Xr})),n.d(o,"div",(function(){return Kr})),n.d(o,"dist",(function(){return Yr})),n.d(o,"sqrDist",(function(){return Jr})),n.d(o,"len",(function(){return Qr})),n.d(o,"sqrLen",(function(){return Zr})),n.d(o,"forEach",(function(){return $r}));var u={};n.r(u),n.d(u,"create",(function(){return ei})),n.d(u,"identity",(function(){return ti})),n.d(u,"setAxisAngle",(function(){return ni})),n.d(u,"getAxisAngle",(function(){return ri})),n.d(u,"getAngle",(function(){return ii})),n.d(u,"multiply",(function(){return ai})),n.d(u,"rotateX",(function(){return oi})),n.d(u,"rotateY",(function(){return ui})),n.d(u,"rotateZ",(function(){return si})),n.d(u,"calculateW",(function(){return ci})),n.d(u,"exp",(function(){return fi})),n.d(u,"ln",(function(){return li})),n.d(u,"pow",(function(){return pi})),n.d(u,"slerp",(function(){return hi})),n.d(u,"random",(function(){return di})),n.d(u,"invert",(function(){return mi})),n.d(u,"conjugate",(function(){return yi})),n.d(u,"fromMat3",(function(){return vi})),n.d(u,"fromEuler",(function(){return gi})),n.d(u,"str",(function(){return bi})),n.d(u,"clone",(function(){return ki})),n.d(u,"fromValues",(function(){return Ii})),n.d(u,"copy",(function(){return Pi})),n.d(u,"set",(function(){return ji})),n.d(u,"add",(function(){return Ri})),n.d(u,"mul",(function(){return Ni})),n.d(u,"scale",(function(){return Gi})),n.d(u,"dot",(function(){return Li})),n.d(u,"lerp",(function(){return zi})),n.d(u,"length",(function(){return Vi})),n.d(u,"len",(function(){return Ui})),n.d(u,"squaredLength",(function(){return Wi})),n.d(u,"sqrLen",(function(){return qi})),n.d(u,"normalize",(function(){return Hi})),n.d(u,"exactEquals",(function(){return Xi})),n.d(u,"equals",(function(){return Ki})),n.d(u,"rotationTo",(function(){return Yi})),n.d(u,"sqlerp",(function(){return Ji})),n.d(u,"setAxes",(function(){return Qi}));var s=n(11),c=n.n(s),f=n(2),l=n.n(f),p=n(8),h=n.n(p),d=n(0),m=n.n(d),y=n(3),v=n.n(y),g=(n(34),1);function b(){return g++}var A,E,x,C,S,w,T,D,B,_,M,F,O=function e(t){m()(this,e)},k=function(){function e(t){m()(this,e),this.clazz=void 0,this.components=[],this.entities=[],this.lookup={},this.clazz=t}return v()(e,[{key:"clear",value:function(){this.components=[],this.entities=[],this.lookup={}}},{key:"contains",value:function(e){return this.lookup[e]>-1}},{key:"create",value:function(e,t){this.lookup[e]=this.components.length;var n=new this.clazz(t||{});return this.components.push(n),this.entities.push(e),n}},{key:"remove",value:function(e){var t=this.lookup[e];t>-1&&t<this.components.length-1&&(this.components[t]=this.components[this.components.length-1],this.entities[t]=this.entities[this.entities.length-1],this.lookup[this.entities[t]]=t),this.components.pop(),this.entities.pop(),delete this.lookup[e]}},{key:"removeKeepSorted",value:function(e){var t=this.lookup[e];if(t>-1){var n=this.entities[t];if(t<this.components.length-1){for(var r=t+1;r<this.components.length;++r)this.components[r-1]=this.components[r];for(var i=t+1;i<this.entities.length;++i)this.entities[i-1]=this.entities[i],this.lookup[this.entities[i-1]]=i-1}this.components.pop(),this.entities.pop(),delete this.lookup[n]}}},{key:"moveItem",value:function(e,t){if(e!==t){for(var n=this.components[e],r=this.entities[e],i=e<t?1:-1,a=e;a!==t;a+=i){var o=a+i;this.components[a]=this.components[o],this.entities[a]=this.entities[o],this.lookup[this.entities[a]]=a}this.components[t]=n,this.entities[t]=r,this.lookup[r]=t}}},{key:"getEntity",value:function(e){return this.entities[e]}},{key:"getComponent",value:function(e){return this.components[e]}},{key:"getComponentByEntity",value:function(e){var t=this.lookup[e];return t>-1?this.components[t]:null}},{key:"getCount",value:function(){return this.components.length}},{key:"getEntityByComponentIndex",value:function(e){for(var t=0,n=Object.keys(this.lookup);t<n.length;t++){var r=n[t],i=Number(r);if(this.lookup[i]===e)return i}return-1}},{key:"find",value:function(e){for(var t=0;t<this.getCount();t++){var n=this.getComponent(t);if(e(n,t))return n}return null}},{key:"findIndex",value:function(e){for(var t=0;t<this.getCount();t++){if(e(this.getComponent(t),t))return t}return-1}},{key:"forEach",value:function(e){for(var t=0,n=Object.keys(this.lookup);t<n.length;t++){var r=n[t],i=Number(r),a=this.lookup[i];e(i,this.getComponent(a))}}},{key:"map",value:function(e){for(var t=[],n=0,r=Object.keys(this.lookup);n<r.length;n++){var i=r[n],a=Number(i),o=this.lookup[a];t.push(e(a,this.getComponent(o)))}return t}}]),e}(),I=n(4),P=n.n(I),j=n(5),R=n.n(j),N=(n(15),n(1)),G={HierarchyComponentManager:Symbol("HierarchyComponentManager"),TransformComponentManager:Symbol("TransformComponentManager"),NameComponentManager:Symbol("NameComponentManager"),SceneGraphSystem:Symbol("SceneGraphSystem"),SceneSystem:Symbol("SceneSystem"),SceneComponentManager:Symbol("SceneComponentManager"),CameraComponentManager:Symbol("CameraComponentManager"),CameraSystem:Symbol("CameraSystem"),FrameGraphSystem:Symbol("FrameGraphSystem"),ResourceHandleComponentManager:Symbol("ResourceHandleComponentManager"),PassNodeComponentManager:Symbol("PassNodeComponentManager"),InteractionSystem:Symbol("InteractionSystem"),MeshSystem:Symbol("MeshSystem"),MeshComponentManager:Symbol("MeshComponentManager"),CullableComponentManager:Symbol("CullableComponentManager"),GeometrySystem:Symbol("GeometrySystem"),GeometryComponentManager:Symbol("GeometryComponentManager"),MaterialSystem:Symbol("MaterialSystem"),MaterialComponentManager:Symbol("MaterialComponentManager"),ForwardRenderPath:Symbol("ForwardRenderPath"),ComputeSystem:Symbol("ComputeSystem"),ComputeComponentManager:Symbol("ComputeComponentManager"),ComputeStrategy:Symbol("ComputeStrategy"),Systems:Symbol("Systems"),World:Symbol("World"),RenderEngine:Symbol("RenderEngine"),WebGPUEngine:Symbol("WebGPUEngine"),WebGLEngine:Symbol("WebGLEngine")},L=(A=Object(N.injectable)(),E=Object(N.inject)(G.CameraComponentManager),x=Object(N.inject)(G.TransformComponentManager),A((S=function(){function e(){m()(this,e),P()(this,"camera",w,this),P()(this,"transform",T,this)}var t;return v()(e,[{key:"execute",value:(t=h()(l.a.mark((function e(){return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)}))),function(){return t.apply(this,arguments)})},{key:"tearDown",value:function(){this.camera.clear()}},{key:"createCamera",value:function(e){var t=b();this.camera.create(t,{}),this.transform.create(t,{});var n=this.camera.getComponentByEntity(t),r=e.near,i=e.far,a=e.angle,o=e.aspect;return null==n||n.setPerspective(r,i,a,o),t}},{key:"getTransformComponentManager",value:function(){return this.transform}}]),e}(),w=R()(S.prototype,"camera",[E],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),T=R()(S.prototype,"transform",[x],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),C=S))||C),z=n(16),V=n.n(z),U=n(31),W=n.n(U),q=n(21),H=n.n(q);!function(e){e.ArrayExpression="ArrayExpression",e.ArrayPattern="ArrayPattern",e.ArrowFunctionExpression="ArrowFunctionExpression",e.AssignmentExpression="AssignmentExpression",e.AssignmentPattern="AssignmentPattern",e.AwaitExpression="AwaitExpression",e.BigIntLiteral="BigIntLiteral",e.BinaryExpression="BinaryExpression",e.BlockStatement="BlockStatement",e.BreakStatement="BreakStatement",e.CallExpression="CallExpression",e.CatchClause="CatchClause",e.ClassBody="ClassBody",e.ClassDeclaration="ClassDeclaration",e.ClassExpression="ClassExpression",e.ClassProperty="ClassProperty",e.ConditionalExpression="ConditionalExpression",e.ContinueStatement="ContinueStatement",e.DebuggerStatement="DebuggerStatement",e.Decorator="Decorator",e.DoWhileStatement="DoWhileStatement",e.EmptyStatement="EmptyStatement",e.ExportAllDeclaration="ExportAllDeclaration",e.ExportDefaultDeclaration="ExportDefaultDeclaration",e.ExportNamedDeclaration="ExportNamedDeclaration",e.ExportSpecifier="ExportSpecifier",e.ExpressionStatement="ExpressionStatement",e.ForInStatement="ForInStatement",e.ForOfStatement="ForOfStatement",e.ForStatement="ForStatement",e.FunctionDeclaration="FunctionDeclaration",e.FunctionExpression="FunctionExpression",e.Identifier="Identifier",e.IfStatement="IfStatement",e.Import="Import",e.ImportDeclaration="ImportDeclaration",e.ImportDefaultSpecifier="ImportDefaultSpecifier",e.ImportNamespaceSpecifier="ImportNamespaceSpecifier",e.ImportSpecifier="ImportSpecifier",e.JSXAttribute="JSXAttribute",e.JSXClosingElement="JSXClosingElement",e.JSXClosingFragment="JSXClosingFragment",e.JSXElement="JSXElement",e.JSXEmptyExpression="JSXEmptyExpression",e.JSXExpressionContainer="JSXExpressionContainer",e.JSXFragment="JSXFragment",e.JSXIdentifier="JSXIdentifier",e.JSXMemberExpression="JSXMemberExpression",e.JSXOpeningElement="JSXOpeningElement",e.JSXOpeningFragment="JSXOpeningFragment",e.JSXSpreadAttribute="JSXSpreadAttribute",e.JSXSpreadChild="JSXSpreadChild",e.JSXText="JSXText",e.LabeledStatement="LabeledStatement",e.Literal="Literal",e.LogicalExpression="LogicalExpression",e.MemberExpression="MemberExpression",e.MetaProperty="MetaProperty",e.MethodDefinition="MethodDefinition",e.NewExpression="NewExpression",e.ObjectExpression="ObjectExpression",e.ObjectPattern="ObjectPattern",e.OptionalCallExpression="OptionalCallExpression",e.OptionalMemberExpression="OptionalMemberExpression",e.Program="Program",e.Property="Property",e.RestElement="RestElement",e.ReturnStatement="ReturnStatement",e.SequenceExpression="SequenceExpression",e.SpreadElement="SpreadElement",e.Super="Super",e.SwitchCase="SwitchCase",e.SwitchStatement="SwitchStatement",e.TaggedTemplateExpression="TaggedTemplateExpression",e.TemplateElement="TemplateElement",e.TemplateLiteral="TemplateLiteral",e.ThisExpression="ThisExpression",e.ThrowStatement="ThrowStatement",e.TryStatement="TryStatement",e.UnaryExpression="UnaryExpression",e.UpdateExpression="UpdateExpression",e.VariableDeclaration="VariableDeclaration",e.VariableDeclarator="VariableDeclarator",e.WhileStatement="WhileStatement",e.WithStatement="WithStatement",e.YieldExpression="YieldExpression",e.TSAbstractClassProperty="TSAbstractClassProperty",e.TSAbstractKeyword="TSAbstractKeyword",e.TSAbstractMethodDefinition="TSAbstractMethodDefinition",e.TSAnyKeyword="TSAnyKeyword",e.TSArrayType="TSArrayType",e.TSAsExpression="TSAsExpression",e.TSAsyncKeyword="TSAsyncKeyword",e.TSBooleanKeyword="TSBooleanKeyword",e.TSBigIntKeyword="TSBigIntKeyword",e.TSConditionalType="TSConditionalType",e.TSConstructorType="TSConstructorType",e.TSCallSignatureDeclaration="TSCallSignatureDeclaration",e.TSClassImplements="TSClassImplements",e.TSConstructSignatureDeclaration="TSConstructSignatureDeclaration",e.TSDeclareKeyword="TSDeclareKeyword",e.TSDeclareFunction="TSDeclareFunction",e.TSEmptyBodyFunctionExpression="TSEmptyBodyFunctionExpression",e.TSEnumDeclaration="TSEnumDeclaration",e.TSEnumMember="TSEnumMember",e.TSExportAssignment="TSExportAssignment",e.TSExportKeyword="TSExportKeyword",e.TSExternalModuleReference="TSExternalModuleReference",e.TSImportType="TSImportType",e.TSInferType="TSInferType",e.TSLiteralType="TSLiteralType",e.TSIndexedAccessType="TSIndexedAccessType",e.TSIndexSignature="TSIndexSignature",e.TSInterfaceBody="TSInterfaceBody",e.TSInterfaceDeclaration="TSInterfaceDeclaration",e.TSInterfaceHeritage="TSInterfaceHeritage",e.TSImportEqualsDeclaration="TSImportEqualsDeclaration",e.TSFunctionType="TSFunctionType",e.TSMethodSignature="TSMethodSignature",e.TSModuleBlock="TSModuleBlock",e.TSModuleDeclaration="TSModuleDeclaration",e.TSNamespaceExportDeclaration="TSNamespaceExportDeclaration",e.TSNonNullExpression="TSNonNullExpression",e.TSNeverKeyword="TSNeverKeyword",e.TSNullKeyword="TSNullKeyword",e.TSNumberKeyword="TSNumberKeyword",e.TSMappedType="TSMappedType",e.TSObjectKeyword="TSObjectKeyword",e.TSParameterProperty="TSParameterProperty",e.TSPrivateKeyword="TSPrivateKeyword",e.TSPropertySignature="TSPropertySignature",e.TSProtectedKeyword="TSProtectedKeyword",e.TSPublicKeyword="TSPublicKeyword",e.TSQualifiedName="TSQualifiedName",e.TSReadonlyKeyword="TSReadonlyKeyword",e.TSRestType="TSRestType",e.TSStaticKeyword="TSStaticKeyword",e.TSStringKeyword="TSStringKeyword",e.TSSymbolKeyword="TSSymbolKeyword",e.TSThisType="TSThisType",e.TSTypeAnnotation="TSTypeAnnotation",e.TSTypeAliasDeclaration="TSTypeAliasDeclaration",e.TSTypeAssertion="TSTypeAssertion",e.TSTypeLiteral="TSTypeLiteral",e.TSTypeOperator="TSTypeOperator",e.TSTypeParameter="TSTypeParameter",e.TSTypeParameterDeclaration="TSTypeParameterDeclaration",e.TSTypeParameterInstantiation="TSTypeParameterInstantiation",e.TSTypePredicate="TSTypePredicate",e.TSTypeReference="TSTypeReference",e.TSTypeQuery="TSTypeQuery",e.TSIntersectionType="TSIntersectionType",e.TSTupleType="TSTupleType",e.TSOptionalType="TSOptionalType",e.TSParenthesizedType="TSParenthesizedType",e.TSUnionType="TSUnionType",e.TSUndefinedKeyword="TSUndefinedKeyword",e.TSUnknownKeyword="TSUnknownKeyword",e.TSVoidKeyword="TSVoidKeyword"}(D||(D={})),function(e){e.Boolean="Boolean",e.Identifier="Identifier",e.JSXIdentifier="JSXIdentifier",e.JSXText="JSXText",e.Keyword="Keyword",e.Null="Null",e.Numeric="Numeric",e.Punctuator="Punctuator",e.RegularExpression="RegularExpression",e.String="String",e.Template="Template",e.Block="Block",e.Line="Line"}(B||(B={})),function(e){e.WebGPU="WebGPU",e.WebGL="WebGL"}(F||(F={}));var X=["float","int","vec2","vec3","vec4","bool","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","mat2","mat3","mat4"],K=["radians","degrees","sin","cos","tan","asin","acos","atan","pow","exp","log","exp2","log2","sqrt","abs","sign","floor","ceil","min","max"],Y=["r","g","b","a","x","y","z","w","s","t","p","q"],J={float:1,int:2,vec2:100,vec3:101,vec4:102},Q=(_={},c()(_,F.WebGL,"\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\n vec2 normAddr2D = float(address1D) * conv_const;\n return vec2(fract(normAddr2D.x), normAddr2D.y);\n}\n\nvoid barrier() {}\n "),c()(_,F.WebGPU,""),_),Z=(M={},c()(M,F.WebGL,{}),c()(M,F.WebGPU,{}),M),$=n(13),ee=n.n($),te=n(9),ne=n.n(te),re=n(10),ie=n.n(re),ae=n(7),oe=n.n(ae),ue=n(50);function se(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ce(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?se(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):se(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function fe(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=oe()(e);if(t){var i=oe()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ie()(this,n)}}var le=function(e){ne()(n,e);var t=fe(n);function n(e,r,i,a){var o;return m()(this,n),(o=t.call(this)).message=void 0,o.expected=void 0,o.found=void 0,o.location=void 0,o.name=void 0,o.message=e,o.expected=r,o.found=i,o.location=a,o.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(ee()(o),n),o}return v()(n,null,[{key:"buildMessage",value:function(e,t){function n(e){return e.charCodeAt(0).toString(16).toUpperCase()}function r(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+n(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+n(e)}))}function i(e){return e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+n(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+n(e)}))}function a(e){switch(e.type){case"literal":return'"'+r(e.text)+'"';case"class":var t=e.parts.map((function(e){return Array.isArray(e)?i(e[0])+"-"+i(e[1]):i(e)}));return"["+(e.inverted?"^":"")+t+"]";case"any":return"any character";case"end":return"end of input";case"other":return e.description}}return"Expected "+function(e){var t,n,r=e.map(a);if(r.sort(),r.length>0){for(t=1,n=1;t<r.length;t++)r[t-1]!==r[t]&&(r[n]=r[t],n++);r.length=n}switch(r.length){case 1:return r[0];case 2:return r[0]+" or "+r[1];default:return r.slice(0,-1).join(", ")+", or "+r[r.length-1]}}(e)+" but "+(((o=t)?'"'+r(o)+'"':"end of input")+" found.");var o}}]),n}(n.n(ue)()(Error));var pe,he,de,me=function(e,t){t=void 0!==t?t:{};var n,r={},i={Start:Kn},a=Kn,o={type:"any"},u=Un("whitespace"),s=zn("\t",!1),c=zn("\v",!1),f=zn("\f",!1),l=zn(" ",!1),p=zn(" ",!1),h=zn("\ufeff",!1),d=/^[\n\r\u2028\u2029]/,m=Vn(["\n","\r","\u2028","\u2029"],!1,!1),y=Un("end of line"),v=zn("\n",!1),g=zn("\r\n",!1),b=zn("\r",!1),A=zn("\u2028",!1),E=zn("\u2029",!1),x=Un("comment"),C=zn("/*",!1),S=zn("*/",!1),w=zn("//",!1),T=Un("identifier"),D=zn(":",!1),B=zn("[",!1),_=zn("]",!1),M=zn("$",!1),F=zn("_",!1),O=zn("‌",!1),k=zn("‍",!1),I=Un("number"),P=zn(".",!1),j=function(){return{type:"Literal",value:parseFloat(Ln())}},R=zn("0",!1),N=/^[0-9]/,G=Vn([["0","9"]],!1,!1),L=/^[1-9]/,z=Vn([["1","9"]],!1,!1),V=zn("e",!0),U=/^[+\-]/,W=Vn(["+","-"],!1,!1),q=Un("string"),H=zn('"',!1),X=function(e){return{type:"Literal",value:e.join("")}},K=zn("'",!1),Y=zn("\\",!1),J=function(){return Ln()},Q=zn("b",!1),Z=zn("f",!1),$=zn("n",!1),ee=zn("r",!1),te=zn("t",!1),ne=zn("v",!1),re=zn("x",!1),ie=zn("u",!1),ae=/^[a-z\xB5\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137-\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148-\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C-\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA-\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9-\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC-\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF-\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F-\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02AF\u0371\u0373\u0377\u037B-\u037D\u0390\u03AC-\u03CE\u03D0-\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB-\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE-\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0560-\u0588\u10D0-\u10FA\u10FD-\u10FF\u13F8-\u13FD\u1C80-\u1C88\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6-\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FC7\u1FD0-\u1FD3\u1FD6-\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6-\u1FF7\u210A\u210E-\u210F\u2113\u212F\u2134\u2139\u213C-\u213D\u2146-\u2149\u214E\u2184\u2C30-\u2C5E\u2C61\u2C65-\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73-\u2C74\u2C76-\u2C7B\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3-\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F\uA771-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7AF\uA7B5\uA7B7\uA7B9\uA7FA\uAB30-\uAB5A\uAB60-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A]/,oe=Vn([["a","z"],"µ",["ß","ö"],["ø","ÿ"],"ā","ă","ą","ć","ĉ","ċ","č","ď","đ","ē","ĕ","ė","ę","ě","ĝ","ğ","ġ","ģ","ĥ","ħ","ĩ","ī","ĭ","į","ı","ij","ĵ",["ķ","ĸ"],"ĺ","ļ","ľ","ŀ","ł","ń","ņ",["ň","ʼn"],"ŋ","ō","ŏ","ő","œ","ŕ","ŗ","ř","ś","ŝ","ş","š","ţ","ť","ŧ","ũ","ū","ŭ","ů","ű","ų","ŵ","ŷ","ź","ż",["ž","ƀ"],"ƃ","ƅ","ƈ",["ƌ","ƍ"],"ƒ","ƕ",["ƙ","ƛ"],"ƞ","ơ","ƣ","ƥ","ƨ",["ƪ","ƫ"],"ƭ","ư","ƴ","ƶ",["ƹ","ƺ"],["ƽ","ƿ"],"dž","lj","nj","ǎ","ǐ","ǒ","ǔ","ǖ","ǘ","ǚ",["ǜ","ǝ"],"ǟ","ǡ","ǣ","ǥ","ǧ","ǩ","ǫ","ǭ",["ǯ","ǰ"],"dz","ǵ","ǹ","ǻ","ǽ","ǿ","ȁ","ȃ","ȅ","ȇ","ȉ","ȋ","ȍ","ȏ","ȑ","ȓ","ȕ","ȗ","ș","ț","ȝ","ȟ","ȡ","ȣ","ȥ","ȧ","ȩ","ȫ","ȭ","ȯ","ȱ",["ȳ","ȹ"],"ȼ",["ȿ","ɀ"],"ɂ","ɇ","ɉ","ɋ","ɍ",["ɏ","ʓ"],["ʕ","ʯ"],"ͱ","ͳ","ͷ",["ͻ","ͽ"],"ΐ",["ά","ώ"],["ϐ","ϑ"],["ϕ","ϗ"],"ϙ","ϛ","ϝ","ϟ","ϡ","ϣ","ϥ","ϧ","ϩ","ϫ","ϭ",["ϯ","ϳ"],"ϵ","ϸ",["ϻ","ϼ"],["а","џ"],"ѡ","ѣ","ѥ","ѧ","ѩ","ѫ","ѭ","ѯ","ѱ","ѳ","ѵ","ѷ","ѹ","ѻ","ѽ","ѿ","ҁ","ҋ","ҍ","ҏ","ґ","ғ","ҕ","җ","ҙ","қ","ҝ","ҟ","ҡ","ң","ҥ","ҧ","ҩ","ҫ","ҭ","ү","ұ","ҳ","ҵ","ҷ","ҹ","һ","ҽ","ҿ","ӂ","ӄ","ӆ","ӈ","ӊ","ӌ",["ӎ","ӏ"],"ӑ","ӓ","ӕ","ӗ","ә","ӛ","ӝ","ӟ","ӡ","ӣ","ӥ","ӧ","ө","ӫ","ӭ","ӯ","ӱ","ӳ","ӵ","ӷ","ӹ","ӻ","ӽ","ӿ","ԁ","ԃ","ԅ","ԇ","ԉ","ԋ","ԍ","ԏ","ԑ","ԓ","ԕ","ԗ","ԙ","ԛ","ԝ","ԟ","ԡ","ԣ","ԥ","ԧ","ԩ","ԫ","ԭ","ԯ",["ՠ","ֈ"],["ა","ჺ"],["ჽ","ჿ"],["ᏸ","ᏽ"],["ᲀ","ᲈ"],["ᴀ","ᴫ"],["ᵫ","ᵷ"],["ᵹ","ᶚ"],"ḁ","ḃ","ḅ","ḇ","ḉ","ḋ","ḍ","ḏ","ḑ","ḓ","ḕ","ḗ","ḙ","ḛ","ḝ","ḟ","ḡ","ḣ","ḥ","ḧ","ḩ","ḫ","ḭ","ḯ","ḱ","ḳ","ḵ","ḷ","ḹ","ḻ","ḽ","ḿ","ṁ","ṃ","ṅ","ṇ","ṉ","ṋ","ṍ","ṏ","ṑ","ṓ","ṕ","ṗ","ṙ","ṛ","ṝ","ṟ","ṡ","ṣ","ṥ","ṧ","ṩ","ṫ","ṭ","ṯ","ṱ","ṳ","ṵ","ṷ","ṹ","ṻ","ṽ","ṿ","ẁ","ẃ","ẅ","ẇ","ẉ","ẋ","ẍ","ẏ","ẑ","ẓ",["ẕ","ẝ"],"ẟ","ạ","ả","ấ","ầ","ẩ","ẫ","ậ","ắ","ằ","ẳ","ẵ","ặ","ẹ","ẻ","ẽ","ế","ề","ể","ễ","ệ","ỉ","ị","ọ","ỏ","ố","ồ","ổ","ỗ","ộ","ớ","ờ","ở","ỡ","ợ","ụ","ủ","ứ","ừ","ử","ữ","ự","ỳ","ỵ","ỷ","ỹ","ỻ","ỽ",["ỿ","ἇ"],["ἐ","ἕ"],["ἠ","ἧ"],["ἰ","ἷ"],["ὀ","ὅ"],["ὐ","ὗ"],["ὠ","ὧ"],["ὰ","ώ"],["ᾀ","ᾇ"],["ᾐ","ᾗ"],["ᾠ","ᾧ"],["ᾰ","ᾴ"],["ᾶ","ᾷ"],"ι",["ῂ","ῄ"],["ῆ","ῇ"],["ῐ","ΐ"],["ῖ","ῗ"],["ῠ","ῧ"],["ῲ","ῴ"],["ῶ","ῷ"],"ℊ",["ℎ","ℏ"],"ℓ","ℯ","ℴ","ℹ",["ℼ","ℽ"],["ⅆ","ⅉ"],"ⅎ","ↄ",["ⰰ","ⱞ"],"ⱡ",["ⱥ","ⱦ"],"ⱨ","ⱪ","ⱬ","ⱱ",["ⱳ","ⱴ"],["ⱶ","ⱻ"],"ⲁ","ⲃ","ⲅ","ⲇ","ⲉ","ⲋ","ⲍ","ⲏ","ⲑ","ⲓ","ⲕ","ⲗ","ⲙ","ⲛ","ⲝ","ⲟ","ⲡ","ⲣ","ⲥ","ⲧ","ⲩ","ⲫ","ⲭ","ⲯ","ⲱ","ⲳ","ⲵ","ⲷ","ⲹ","ⲻ","ⲽ","ⲿ","ⳁ","ⳃ","ⳅ","ⳇ","ⳉ","ⳋ","ⳍ","ⳏ","ⳑ","ⳓ","ⳕ","ⳗ","ⳙ","ⳛ","ⳝ","ⳟ","ⳡ",["ⳣ","ⳤ"],"ⳬ","ⳮ","ⳳ",["ⴀ","ⴥ"],"ⴧ","ⴭ","ꙁ","ꙃ","ꙅ","ꙇ","ꙉ","ꙋ","ꙍ","ꙏ","ꙑ","ꙓ","ꙕ","ꙗ","ꙙ","ꙛ","ꙝ","ꙟ","ꙡ","ꙣ","ꙥ","ꙧ","ꙩ","ꙫ","ꙭ","ꚁ","ꚃ","ꚅ","ꚇ","ꚉ","ꚋ","ꚍ","ꚏ","ꚑ","ꚓ","ꚕ","ꚗ","ꚙ","ꚛ","ꜣ","ꜥ","ꜧ","ꜩ","ꜫ","ꜭ",["ꜯ","ꜱ"],"ꜳ","ꜵ","ꜷ","ꜹ","ꜻ","ꜽ","ꜿ","ꝁ","ꝃ","ꝅ","ꝇ","ꝉ","ꝋ","ꝍ","ꝏ","ꝑ","ꝓ","ꝕ","ꝗ","ꝙ","ꝛ","ꝝ","ꝟ","ꝡ","ꝣ","ꝥ","ꝧ","ꝩ","ꝫ","ꝭ","ꝯ",["ꝱ","ꝸ"],"ꝺ","ꝼ","ꝿ","ꞁ","ꞃ","ꞅ","ꞇ","ꞌ","ꞎ","ꞑ",["ꞓ","ꞕ"],"ꞗ","ꞙ","ꞛ","ꞝ","ꞟ","ꞡ","ꞣ","ꞥ","ꞧ","ꞩ","ꞯ","ꞵ","ꞷ","ꞹ","ꟺ",["ꬰ","ꭚ"],["ꭠ","ꭥ"],["ꭰ","ꮿ"],["ff","st"],["ﬓ","ﬗ"],["a","z"]],!1,!1),ue=/^[\u02B0-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0374\u037A\u0559\u0640\u06E5-\u06E6\u07F4-\u07F5\u07FA\u081A\u0824\u0828\u0971\u0E46\u0EC6\u10FC\u17D7\u1843\u1AA7\u1C78-\u1C7D\u1D2C-\u1D6A\u1D78\u1D9B-\u1DBF\u2071\u207F\u2090-\u209C\u2C7C-\u2C7D\u2D6F\u2E2F\u3005\u3031-\u3035\u303B\u309D-\u309E\u30FC-\u30FE\uA015\uA4F8-\uA4FD\uA60C\uA67F\uA69C-\uA69D\uA717-\uA71F\uA770\uA788\uA7F8-\uA7F9\uA9CF\uA9E6\uAA70\uAADD\uAAF3-\uAAF4\uAB5C-\uAB5F\uFF70\uFF9E-\uFF9F]/,se=Vn([["ʰ","ˁ"],["ˆ","ˑ"],["ˠ","ˤ"],"ˬ","ˮ","ʹ","ͺ","ՙ","ـ",["ۥ","ۦ"],["ߴ","ߵ"],"ߺ","ࠚ","ࠤ","ࠨ","ॱ","ๆ","ໆ","ჼ","ៗ","ᡃ","ᪧ",["ᱸ","ᱽ"],["ᴬ","ᵪ"],"ᵸ",["ᶛ","ᶿ"],"ⁱ","ⁿ",["ₐ","ₜ"],["ⱼ","ⱽ"],"ⵯ","ⸯ","々",["〱","〵"],"〻",["ゝ","ゞ"],["ー","ヾ"],"ꀕ",["ꓸ","ꓽ"],"ꘌ","ꙿ",["ꚜ","ꚝ"],["ꜗ","ꜟ"],"ꝰ","ꞈ",["ꟸ","ꟹ"],"ꧏ","ꧦ","ꩰ","ꫝ",["ꫳ","ꫴ"],["ꭜ","ꭟ"],"ー",["゙","゚"]],!1,!1),fe=/^[\xAA\xBA\u01BB\u01C0-\u01C3\u0294\u05D0-\u05EA\u05EF-\u05F2\u0620-\u063F\u0641-\u064A\u066E-\u066F\u0671-\u06D3\u06D5\u06EE-\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u0800-\u0815\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0972-\u0980\u0985-\u098C\u098F-\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC-\u09DD\u09DF-\u09E1\u09F0-\u09F1\u09FC\u0A05-\u0A0A\u0A0F-\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32-\u0A33\u0A35-\u0A36\u0A38-\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2-\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0-\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F-\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32-\u0B33\u0B35-\u0B39\u0B3D\u0B5C-\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99-\u0B9A\u0B9C\u0B9E-\u0B9F\u0BA3-\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60-\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0-\u0CE1\u0CF1-\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32-\u0E33\u0E40-\u0E45\u0E81-\u0E82\u0E84\u0E87-\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA-\u0EAB\u0EAD-\u0EB0\u0EB2-\u0EB3\u0EBD\u0EC0-\u0EC4\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065-\u1066\u106E-\u1070\u1075-\u1081\u108E\u1100-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17DC\u1820-\u1842\u1844-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE-\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C77\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5-\u1CF6\u2135-\u2138\u2D30-\u2D67\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3006\u303C\u3041-\u3096\u309F\u30A1-\u30FA\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA014\uA016-\uA48C\uA4D0-\uA4F7\uA500-\uA60B\uA610-\uA61F\uA62A-\uA62B\uA66E\uA6A0-\uA6E5\uA78F\uA7F7\uA7FB-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD-\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9E0-\uA9E4\uA9E7-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA6F\uAA71-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5-\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADC\uAAE0-\uAAEA\uAAF2\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40-\uFB41\uFB43-\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF66-\uFF6F\uFF71-\uFF9D\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,pe=Vn(["ª","º","ƻ",["ǀ","ǃ"],"ʔ",["א","ת"],["ׯ","ײ"],["ؠ","ؿ"],["ف","ي"],["ٮ","ٯ"],["ٱ","ۓ"],"ە",["ۮ","ۯ"],["ۺ","ۼ"],"ۿ","ܐ",["ܒ","ܯ"],["ݍ","ޥ"],"ޱ",["ߊ","ߪ"],["ࠀ","ࠕ"],["ࡀ","ࡘ"],["ࡠ","ࡪ"],["ࢠ","ࢴ"],["ࢶ","ࢽ"],["ऄ","ह"],"ऽ","ॐ",["क़","ॡ"],["ॲ","ঀ"],["অ","ঌ"],["এ","ঐ"],["ও","ন"],["প","র"],"ল",["শ","হ"],"ঽ","ৎ",["ড়","ঢ়"],["য়","ৡ"],["ৰ","ৱ"],"ৼ",["ਅ","ਊ"],["ਏ","ਐ"],["ਓ","ਨ"],["ਪ","ਰ"],["ਲ","ਲ਼"],["ਵ","ਸ਼"],["ਸ","ਹ"],["ਖ਼","ੜ"],"ਫ਼",["ੲ","ੴ"],["અ","ઍ"],["એ","ઑ"],["ઓ","ન"],["પ","ર"],["લ","ળ"],["વ","હ"],"ઽ","ૐ",["ૠ","ૡ"],"ૹ",["ଅ","ଌ"],["ଏ","ଐ"],["ଓ","ନ"],["ପ","ର"],["ଲ","ଳ"],["ଵ","ହ"],"ଽ",["ଡ଼","ଢ଼"],["ୟ","ୡ"],"ୱ","ஃ",["அ","ஊ"],["எ","ஐ"],["ஒ","க"],["ங","ச"],"ஜ",["ஞ","ட"],["ண","த"],["ந","ப"],["ம","ஹ"],"ௐ",["అ","ఌ"],["ఎ","ఐ"],["ఒ","న"],["ప","హ"],"ఽ",["ౘ","ౚ"],["ౠ","ౡ"],"ಀ",["ಅ","ಌ"],["ಎ","ಐ"],["ಒ","ನ"],["ಪ","ಳ"],["ವ","ಹ"],"ಽ","ೞ",["ೠ","ೡ"],["ೱ","ೲ"],["അ","ഌ"],["എ","ഐ"],["ഒ","ഺ"],"ഽ","ൎ",["ൔ","ൖ"],["ൟ","ൡ"],["ൺ","ൿ"],["අ","ඖ"],["ක","න"],["ඳ","ර"],"ල",["ව","ෆ"],["ก","ะ"],["า","ำ"],["เ","ๅ"],["ກ","ຂ"],"ຄ",["ງ","ຈ"],"ຊ","ຍ",["ດ","ທ"],["ນ","ຟ"],["ມ","ຣ"],"ລ","ວ",["ສ","ຫ"],["ອ","ະ"],["າ","ຳ"],"ຽ",["ເ","ໄ"],["ໜ","ໟ"],"ༀ",["ཀ","ཇ"],["ཉ","ཬ"],["ྈ","ྌ"],["က","ဪ"],"ဿ",["ၐ","ၕ"],["ၚ","ၝ"],"ၡ",["ၥ","ၦ"],["ၮ","ၰ"],["ၵ","ႁ"],"ႎ",["ᄀ","ቈ"],["ቊ","ቍ"],["ቐ","ቖ"],"ቘ",["ቚ","ቝ"],["በ","ኈ"],["ኊ","ኍ"],["ነ","ኰ"],["ኲ","ኵ"],["ኸ","ኾ"],"ዀ",["ዂ","ዅ"],["ወ","ዖ"],["ዘ","ጐ"],["ጒ","ጕ"],["ጘ","ፚ"],["ᎀ","ᎏ"],["ᐁ","ᙬ"],["ᙯ","ᙿ"],["ᚁ","ᚚ"],["ᚠ","ᛪ"],["ᛱ","ᛸ"],["ᜀ","ᜌ"],["ᜎ","ᜑ"],["ᜠ","ᜱ"],["ᝀ","ᝑ"],["ᝠ","ᝬ"],["ᝮ","ᝰ"],["ក","ឳ"],"ៜ",["ᠠ","ᡂ"],["ᡄ","ᡸ"],["ᢀ","ᢄ"],["ᢇ","ᢨ"],"ᢪ",["ᢰ","ᣵ"],["ᤀ","ᤞ"],["ᥐ","ᥭ"],["ᥰ","ᥴ"],["ᦀ","ᦫ"],["ᦰ","ᧉ"],["ᨀ","ᨖ"],["ᨠ","ᩔ"],["ᬅ","ᬳ"],["ᭅ","ᭋ"],["ᮃ","ᮠ"],["ᮮ","ᮯ"],["ᮺ","ᯥ"],["ᰀ","ᰣ"],["ᱍ","ᱏ"],["ᱚ","ᱷ"],["ᳩ","ᳬ"],["ᳮ","ᳱ"],["ᳵ","ᳶ"],["ℵ","ℸ"],["ⴰ","ⵧ"],["ⶀ","ⶖ"],["ⶠ","ⶦ"],["ⶨ","ⶮ"],["ⶰ","ⶶ"],["ⶸ","ⶾ"],["ⷀ","ⷆ"],["ⷈ","ⷎ"],["ⷐ","ⷖ"],["ⷘ","ⷞ"],"〆","〼",["ぁ","ゖ"],"ゟ",["ァ","ヺ"],"ヿ",["ㄅ","ㄯ"],["ㄱ","ㆎ"],["ㆠ","ㆺ"],["ㇰ","ㇿ"],["㐀","䶵"],["一","鿯"],["ꀀ","ꀔ"],["ꀖ","ꒌ"],["ꓐ","ꓷ"],["ꔀ","ꘋ"],["ꘐ","ꘟ"],["ꘪ","ꘫ"],"ꙮ",["ꚠ","ꛥ"],"ꞏ","ꟷ",["ꟻ","ꠁ"],["ꠃ","ꠅ"],["ꠇ","ꠊ"],["ꠌ","ꠢ"],["ꡀ","ꡳ"],["ꢂ","ꢳ"],["ꣲ","ꣷ"],"ꣻ",["ꣽ","ꣾ"],["ꤊ","ꤥ"],["ꤰ","ꥆ"],["ꥠ","ꥼ"],["ꦄ","ꦲ"],["ꧠ","ꧤ"],["ꧧ","ꧯ"],["ꧺ","ꧾ"],["ꨀ","ꨨ"],["ꩀ","ꩂ"],["ꩄ","ꩋ"],["ꩠ","ꩯ"],["ꩱ","ꩶ"],"ꩺ",["ꩾ","ꪯ"],"ꪱ",["ꪵ","ꪶ"],["ꪹ","ꪽ"],"ꫀ","ꫂ",["ꫛ","ꫜ"],["ꫠ","ꫪ"],"ꫲ",["ꬁ","ꬆ"],["ꬉ","ꬎ"],["ꬑ","ꬖ"],["ꬠ","ꬦ"],["ꬨ","ꬮ"],["ꯀ","ꯢ"],["가","힣"],["ힰ","ퟆ"],["ퟋ","ퟻ"],["豈","舘"],["並","龎"],"יִ",["ײַ","ﬨ"],["שׁ","זּ"],["טּ","לּ"],"מּ",["נּ","סּ"],["ףּ","פּ"],["צּ","ﮱ"],["ﯓ","ﴽ"],["ﵐ","ﶏ"],["ﶒ","ﷇ"],["ﷰ","ﷻ"],["ﹰ","ﹴ"],["ﹶ","ﻼ"],["ヲ","ッ"],["ア","ン"],["ᅠ","ᄒ"],["ᅡ","ᅦ"],["ᅧ","ᅬ"],["ᅭ","ᅲ"],["ᅳ","ᅵ"]],!1,!1),he=/^[\u01C5\u01C8\u01CB\u01F2\u1F88-\u1F8F\u1F98-\u1F9F\u1FA8-\u1FAF\u1FBC\u1FCC\u1FFC]/,de=Vn(["Dž","Lj","Nj","Dz",["ᾈ","ᾏ"],["ᾘ","ᾟ"],["ᾨ","ᾯ"],"ᾼ","ῌ","ῼ"],!1,!1),me=/^[A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178-\u0179\u017B\u017D\u0181-\u0182\u0184\u0186-\u0187\u0189-\u018B\u018E-\u0191\u0193-\u0194\u0196-\u0198\u019C-\u019D\u019F-\u01A0\u01A2\u01A4\u01A6-\u01A7\u01A9\u01AC\u01AE-\u01AF\u01B1-\u01B3\u01B5\u01B7-\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A-\u023B\u023D-\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E-\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9-\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0-\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1C90-\u1CBA\u1CBD-\u1CBF\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E-\u213F\u2145\u2183\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D-\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AE\uA7B0-\uA7B4\uA7B6\uA7B8\uFF21-\uFF3A]/,ye=Vn([["A","Z"],["À","Ö"],["Ø","Þ"],"Ā","Ă","Ą","Ć","Ĉ","Ċ","Č","Ď","Đ","Ē","Ĕ","Ė","Ę","Ě","Ĝ","Ğ","Ġ","Ģ","Ĥ","Ħ","Ĩ","Ī","Ĭ","Į","İ","IJ","Ĵ","Ķ","Ĺ","Ļ","Ľ","Ŀ","Ł","Ń","Ņ","Ň","Ŋ","Ō","Ŏ","Ő","Œ","Ŕ","Ŗ","Ř","Ś","Ŝ","Ş","Š","Ţ","Ť","Ŧ","Ũ","Ū","Ŭ","Ů","Ű","Ų","Ŵ","Ŷ",["Ÿ","Ź"],"Ż","Ž",["Ɓ","Ƃ"],"Ƅ",["Ɔ","Ƈ"],["Ɖ","Ƌ"],["Ǝ","Ƒ"],["Ɠ","Ɣ"],["Ɩ","Ƙ"],["Ɯ","Ɲ"],["Ɵ","Ơ"],"Ƣ","Ƥ",["Ʀ","Ƨ"],"Ʃ","Ƭ",["Ʈ","Ư"],["Ʊ","Ƴ"],"Ƶ",["Ʒ","Ƹ"],"Ƽ","DŽ","LJ","NJ","Ǎ","Ǐ","Ǒ","Ǔ","Ǖ","Ǘ","Ǚ","Ǜ","Ǟ","Ǡ","Ǣ","Ǥ","Ǧ","Ǩ","Ǫ","Ǭ","Ǯ","DZ","Ǵ",["Ƕ","Ǹ"],"Ǻ","Ǽ","Ǿ","Ȁ","Ȃ","Ȅ","Ȇ","Ȉ","Ȋ","Ȍ","Ȏ","Ȑ","Ȓ","Ȕ","Ȗ","Ș","Ț","Ȝ","Ȟ","Ƞ","Ȣ","Ȥ","Ȧ","Ȩ","Ȫ","Ȭ","Ȯ","Ȱ","Ȳ",["Ⱥ","Ȼ"],["Ƚ","Ⱦ"],"Ɂ",["Ƀ","Ɇ"],"Ɉ","Ɋ","Ɍ","Ɏ","Ͱ","Ͳ","Ͷ","Ϳ","Ά",["Έ","Ί"],"Ό",["Ύ","Ώ"],["Α","Ρ"],["Σ","Ϋ"],"Ϗ",["ϒ","ϔ"],"Ϙ","Ϛ","Ϝ","Ϟ","Ϡ","Ϣ","Ϥ","Ϧ","Ϩ","Ϫ","Ϭ","Ϯ","ϴ","Ϸ",["Ϲ","Ϻ"],["Ͻ","Я"],"Ѡ","Ѣ","Ѥ","Ѧ","Ѩ","Ѫ","Ѭ","Ѯ","Ѱ","Ѳ","Ѵ","Ѷ","Ѹ","Ѻ","Ѽ","Ѿ","Ҁ","Ҋ","Ҍ","Ҏ","Ґ","Ғ","Ҕ","Җ","Ҙ","Қ","Ҝ","Ҟ","Ҡ","Ң","Ҥ","Ҧ","Ҩ","Ҫ","Ҭ","Ү","Ұ","Ҳ","Ҵ","Ҷ","Ҹ","Һ","Ҽ","Ҿ",["Ӏ","Ӂ"],"Ӄ","Ӆ","Ӈ","Ӊ","Ӌ","Ӎ","Ӑ","Ӓ","Ӕ","Ӗ","Ә","Ӛ","Ӝ","Ӟ","Ӡ","Ӣ","Ӥ","Ӧ","Ө","Ӫ","Ӭ","Ӯ","Ӱ","Ӳ","Ӵ","Ӷ","Ӹ","Ӻ","Ӽ","Ӿ","Ԁ","Ԃ","Ԅ","Ԇ","Ԉ","Ԋ","Ԍ","Ԏ","Ԑ","Ԓ","Ԕ","Ԗ","Ԙ","Ԛ","Ԝ","Ԟ","Ԡ","Ԣ","Ԥ","Ԧ","Ԩ","Ԫ","Ԭ","Ԯ",["Ա","Ֆ"],["Ⴀ","Ⴥ"],"Ⴧ","Ⴭ",["Ꭰ","Ᏽ"],["Ა","Ჺ"],["Ჽ","Ჿ"],"Ḁ","Ḃ","Ḅ","Ḇ","Ḉ","Ḋ","Ḍ","Ḏ","Ḑ","Ḓ","Ḕ","Ḗ","Ḙ","Ḛ","Ḝ","Ḟ","Ḡ","Ḣ","Ḥ","Ḧ","Ḩ","Ḫ","Ḭ","Ḯ","Ḱ","Ḳ","Ḵ","Ḷ","Ḹ","Ḻ","Ḽ","Ḿ","Ṁ","Ṃ","Ṅ","Ṇ","Ṉ","Ṋ","Ṍ","Ṏ","Ṑ","Ṓ","Ṕ","Ṗ","Ṙ","Ṛ","Ṝ","Ṟ","Ṡ","Ṣ","Ṥ","Ṧ","Ṩ","Ṫ","Ṭ","Ṯ","Ṱ","Ṳ","Ṵ","Ṷ","Ṹ","Ṻ","Ṽ","Ṿ","Ẁ","Ẃ","Ẅ","Ẇ","Ẉ","Ẋ","Ẍ","Ẏ","Ẑ","Ẓ","Ẕ","ẞ","Ạ","Ả","Ấ","Ầ","Ẩ","Ẫ","Ậ","Ắ","Ằ","Ẳ","Ẵ","Ặ","Ẹ","Ẻ","Ẽ","Ế","Ề","Ể","Ễ","Ệ","Ỉ","Ị","Ọ","Ỏ","Ố","Ồ","Ổ","Ỗ","Ộ","Ớ","Ờ","Ở","Ỡ","Ợ","Ụ","Ủ","Ứ","Ừ","Ử","Ữ","Ự","Ỳ","Ỵ","Ỷ","Ỹ","Ỻ","Ỽ","Ỿ",["Ἀ","Ἇ"],["Ἐ","Ἕ"],["Ἠ","Ἧ"],["Ἰ","Ἷ"],["Ὀ","Ὅ"],"Ὑ","Ὓ","Ὕ","Ὗ",["Ὠ","Ὧ"],["Ᾰ","Ά"],["Ὲ","Ή"],["Ῐ","Ί"],["Ῠ","Ῥ"],["Ὸ","Ώ"],"ℂ","ℇ",["ℋ","ℍ"],["ℐ","ℒ"],"ℕ",["ℙ","ℝ"],"ℤ","Ω","ℨ",["K","ℭ"],["ℰ","ℳ"],["ℾ","ℿ"],"ⅅ","Ↄ",["Ⰰ","Ⱞ"],"Ⱡ",["Ɫ","Ɽ"],"Ⱨ","Ⱪ","Ⱬ",["Ɑ","Ɒ"],"Ⱳ","Ⱶ",["Ȿ","Ⲁ"],"Ⲃ","Ⲅ","Ⲇ","Ⲉ","Ⲋ","Ⲍ","Ⲏ","Ⲑ","Ⲓ","Ⲕ","Ⲗ","Ⲙ","Ⲛ","Ⲝ","Ⲟ","Ⲡ","Ⲣ","Ⲥ","Ⲧ","Ⲩ","Ⲫ","Ⲭ","Ⲯ","Ⲱ","Ⲳ","Ⲵ","Ⲷ","Ⲹ","Ⲻ","Ⲽ","Ⲿ","Ⳁ","Ⳃ","Ⳅ","Ⳇ","Ⳉ","Ⳋ","Ⳍ","Ⳏ","Ⳑ","Ⳓ","Ⳕ","Ⳗ","Ⳙ","Ⳛ","Ⳝ","Ⳟ","Ⳡ","Ⳣ","Ⳬ","Ⳮ","Ⳳ","Ꙁ","Ꙃ","Ꙅ","Ꙇ","Ꙉ","Ꙋ","Ꙍ","Ꙏ","Ꙑ","Ꙓ","Ꙕ","Ꙗ","Ꙙ","Ꙛ","Ꙝ","Ꙟ","Ꙡ","Ꙣ","Ꙥ","Ꙧ","Ꙩ","Ꙫ","Ꙭ","Ꚁ","Ꚃ","Ꚅ","Ꚇ","Ꚉ","Ꚋ","Ꚍ","Ꚏ","Ꚑ","Ꚓ","Ꚕ","Ꚗ","Ꚙ","Ꚛ","Ꜣ","Ꜥ","Ꜧ","Ꜩ","Ꜫ","Ꜭ","Ꜯ","Ꜳ","Ꜵ","Ꜷ","Ꜹ","Ꜻ","Ꜽ","Ꜿ","Ꝁ","Ꝃ","Ꝅ","Ꝇ","Ꝉ","Ꝋ","Ꝍ","Ꝏ","Ꝑ","Ꝓ","Ꝕ","Ꝗ","Ꝙ","Ꝛ","Ꝝ","Ꝟ","Ꝡ","Ꝣ","Ꝥ","Ꝧ","Ꝩ","Ꝫ","Ꝭ","Ꝯ","Ꝺ","Ꝼ",["Ᵹ","Ꝿ"],"Ꞁ","Ꞃ","Ꞅ","Ꞇ","Ꞌ","Ɥ","Ꞑ","Ꞓ","Ꞗ","Ꞙ","Ꞛ","Ꞝ","Ꞟ","Ꞡ","Ꞣ","Ꞥ","Ꞧ","Ꞩ",["Ɦ","Ɪ"],["Ʞ","Ꞵ"],"Ꞷ","Ꞹ",["A","Z"]],!1,!1),ve=/^[\u0903\u093B\u093E-\u0940\u0949-\u094C\u094E-\u094F\u0982-\u0983\u09BE-\u09C0\u09C7-\u09C8\u09CB-\u09CC\u09D7\u0A03\u0A3E-\u0A40\u0A83\u0ABE-\u0AC0\u0AC9\u0ACB-\u0ACC\u0B02-\u0B03\u0B3E\u0B40\u0B47-\u0B48\u0B4B-\u0B4C\u0B57\u0BBE-\u0BBF\u0BC1-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD7\u0C01-\u0C03\u0C41-\u0C44\u0C82-\u0C83\u0CBE\u0CC0-\u0CC4\u0CC7-\u0CC8\u0CCA-\u0CCB\u0CD5-\u0CD6\u0D02-\u0D03\u0D3E-\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D57\u0D82-\u0D83\u0DCF-\u0DD1\u0DD8-\u0DDF\u0DF2-\u0DF3\u0F3E-\u0F3F\u0F7F\u102B-\u102C\u1031\u1038\u103B-\u103C\u1056-\u1057\u1062-\u1064\u1067-\u106D\u1083-\u1084\u1087-\u108C\u108F\u109A-\u109C\u17B6\u17BE-\u17C5\u17C7-\u17C8\u1923-\u1926\u1929-\u192B\u1930-\u1931\u1933-\u1938\u1A19-\u1A1A\u1A55\u1A57\u1A61\u1A63-\u1A64\u1A6D-\u1A72\u1B04\u1B35\u1B3B\u1B3D-\u1B41\u1B43-\u1B44\u1B82\u1BA1\u1BA6-\u1BA7\u1BAA\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2-\u1BF3\u1C24-\u1C2B\u1C34-\u1C35\u1CE1\u1CF2-\u1CF3\u1CF7\u302E-\u302F\uA823-\uA824\uA827\uA880-\uA881\uA8B4-\uA8C3\uA952-\uA953\uA983\uA9B4-\uA9B5\uA9BA-\uA9BB\uA9BD-\uA9C0\uAA2F-\uAA30\uAA33-\uAA34\uAA4D\uAA7B\uAA7D\uAAEB\uAAEE-\uAAEF\uAAF5\uABE3-\uABE4\uABE6-\uABE7\uABE9-\uABEA\uABEC]/,ge=Vn(["ः","ऻ",["ा","ी"],["ॉ","ौ"],["ॎ","ॏ"],["ং","ঃ"],["া","ী"],["ে","ৈ"],["ো","ৌ"],"ৗ","ਃ",["ਾ","ੀ"],"ઃ",["ા","ી"],"ૉ",["ો","ૌ"],["ଂ","ଃ"],"ା","ୀ",["େ","ୈ"],["ୋ","ୌ"],"ୗ",["ா","ி"],["ு","ூ"],["ெ","ை"],["ொ","ௌ"],"ௗ",["ఁ","ః"],["ు","ౄ"],["ಂ","ಃ"],"ಾ",["ೀ","ೄ"],["ೇ","ೈ"],["ೊ","ೋ"],["ೕ","ೖ"],["ം","ഃ"],["ാ","ീ"],["െ","ൈ"],["ൊ","ൌ"],"ൗ",["ං","ඃ"],["ා","ෑ"],["ෘ","ෟ"],["ෲ","ෳ"],["༾","༿"],"ཿ",["ါ","ာ"],"ေ","း",["ျ","ြ"],["ၖ","ၗ"],["ၢ","ၤ"],["ၧ","ၭ"],["ႃ","ႄ"],["ႇ","ႌ"],"ႏ",["ႚ","ႜ"],"ា",["ើ","ៅ"],["ះ","ៈ"],["ᤣ","ᤦ"],["ᤩ","ᤫ"],["ᤰ","ᤱ"],["ᤳ","ᤸ"],["ᨙ","ᨚ"],"ᩕ","ᩗ","ᩡ",["ᩣ","ᩤ"],["ᩭ","ᩲ"],"ᬄ","ᬵ","ᬻ",["ᬽ","ᭁ"],["ᭃ","᭄"],"ᮂ","ᮡ",["ᮦ","ᮧ"],"᮪","ᯧ",["ᯪ","ᯬ"],"ᯮ",["᯲","᯳"],["ᰤ","ᰫ"],["ᰴ","ᰵ"],"᳡",["ᳲ","ᳳ"],"᳷",["〮","〯"],["ꠣ","ꠤ"],"ꠧ",["ꢀ","ꢁ"],["ꢴ","ꣃ"],["ꥒ","꥓"],"ꦃ",["ꦴ","ꦵ"],["ꦺ","ꦻ"],["ꦽ","꧀"],["ꨯ","ꨰ"],["ꨳ","ꨴ"],"ꩍ","ꩻ","ꩽ","ꫫ",["ꫮ","ꫯ"],"ꫵ",["ꯣ","ꯤ"],["ꯦ","ꯧ"],["ꯩ","ꯪ"],"꯬"],!1,!1),be=/^[\u0300-\u036F\u0483-\u0487\u0591-\u05BD\u05BF\u05C1-\u05C2\u05C4-\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7-\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962-\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2-\u09E3\u09FE\u0A01-\u0A02\u0A3C\u0A41-\u0A42\u0A47-\u0A48\u0A4B-\u0A4D\u0A51\u0A70-\u0A71\u0A75\u0A81-\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7-\u0AC8\u0ACD\u0AE2-\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B56\u0B62-\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55-\u0C56\u0C62-\u0C63\u0C81\u0CBC\u0CBF\u0CC6\u0CCC-\u0CCD\u0CE2-\u0CE3\u0D00-\u0D01\u0D3B-\u0D3C\u0D41-\u0D44\u0D4D\u0D62-\u0D63\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB-\u0EBC\u0EC8-\u0ECD\u0F18-\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86-\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039-\u103A\u103D-\u103E\u1058-\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085-\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752-\u1753\u1772-\u1773\u17B4-\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u1885-\u1886\u18A9\u1920-\u1922\u1927-\u1928\u1932\u1939-\u193B\u1A17-\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ABD\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80-\u1B81\u1BA2-\u1BA5\u1BA8-\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8-\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099-\u309A\uA66F\uA674-\uA67D\uA69E-\uA69F\uA6F0-\uA6F1\uA802\uA806\uA80B\uA825-\uA826\uA8C4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9E5\uAA29-\uAA2E\uAA31-\uAA32\uAA35-\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7-\uAAB8\uAABE-\uAABF\uAAC1\uAAEC-\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/,Ae=Vn([["̀","ͯ"],["҃","҇"],["֑","ֽ"],"ֿ",["ׁ","ׂ"],["ׄ","ׅ"],"ׇ",["ؐ","ؚ"],["ً","ٟ"],"ٰ",["ۖ","ۜ"],["۟","ۤ"],["ۧ","ۨ"],["۪","ۭ"],"ܑ",["ܰ","݊"],["ަ","ް"],["߫","߳"],"߽",["ࠖ","࠙"],["ࠛ","ࠣ"],["ࠥ","ࠧ"],["ࠩ","࠭"],["࡙","࡛"],["࣓","࣡"],["ࣣ","ं"],"ऺ","़",["ु","ै"],"्",["॑","ॗ"],["ॢ","ॣ"],"ঁ","়",["ু","ৄ"],"্",["ৢ","ৣ"],"৾",["ਁ","ਂ"],"਼",["ੁ","ੂ"],["ੇ","ੈ"],["ੋ","੍"],"ੑ",["ੰ","ੱ"],"ੵ",["ઁ","ં"],"઼",["ુ","ૅ"],["ે","ૈ"],"્",["ૢ","ૣ"],["ૺ","૿"],"ଁ","଼","ି",["ୁ","ୄ"],"୍","ୖ",["ୢ","ୣ"],"ஂ","ீ","்","ఀ","ఄ",["ా","ీ"],["ె","ై"],["ొ","్"],["ౕ","ౖ"],["ౢ","ౣ"],"ಁ","಼","ಿ","ೆ",["ೌ","್"],["ೢ","ೣ"],["ഀ","ഁ"],["഻","഼"],["ു","ൄ"],"്",["ൢ","ൣ"],"්",["ි","ු"],"ූ","ั",["ิ","ฺ"],["็","๎"],"ັ",["ິ","ູ"],["ົ","ຼ"],["່","ໍ"],["༘","༙"],"༵","༷","༹",["ཱ","ཾ"],["ྀ","྄"],["྆","྇"],["ྍ","ྗ"],["ྙ","ྼ"],"࿆",["ိ","ူ"],["ဲ","့"],["္","်"],["ွ","ှ"],["ၘ","ၙ"],["ၞ","ၠ"],["ၱ","ၴ"],"ႂ",["ႅ","ႆ"],"ႍ","ႝ",["፝","፟"],["ᜒ","᜔"],["ᜲ","᜴"],["ᝒ","ᝓ"],["ᝲ","ᝳ"],["឴","឵"],["ិ","ួ"],"ំ",["៉","៓"],"៝",["᠋","᠍"],["ᢅ","ᢆ"],"ᢩ",["ᤠ","ᤢ"],["ᤧ","ᤨ"],"ᤲ",["᤹","᤻"],["ᨗ","ᨘ"],"ᨛ","ᩖ",["ᩘ","ᩞ"],"᩠","ᩢ",["ᩥ","ᩬ"],["ᩳ","᩼"],"᩿",["᪰","᪽"],["ᬀ","ᬃ"],"᬴",["ᬶ","ᬺ"],"ᬼ","ᭂ",["᭫","᭳"],["ᮀ","ᮁ"],["ᮢ","ᮥ"],["ᮨ","ᮩ"],["᮫","ᮭ"],"᯦",["ᯨ","ᯩ"],"ᯭ",["ᯯ","ᯱ"],["ᰬ","ᰳ"],["ᰶ","᰷"],["᳐","᳒"],["᳔","᳠"],["᳢","᳨"],"᳭","᳴",["᳸","᳹"],["᷀","᷹"],["᷻","᷿"],["⃐","⃜"],"⃡",["⃥","⃰"],["⳯","⳱"],"⵿",["ⷠ","ⷿ"],["〪","〭"],["゙","゚"],"꙯",["ꙴ","꙽"],["ꚞ","ꚟ"],["꛰","꛱"],"ꠂ","꠆","ꠋ",["ꠥ","ꠦ"],["꣄","ꣅ"],["꣠","꣱"],"ꣿ",["ꤦ","꤭"],["ꥇ","ꥑ"],["ꦀ","ꦂ"],"꦳",["ꦶ","ꦹ"],"ꦼ","ꧥ",["ꨩ","ꨮ"],["ꨱ","ꨲ"],["ꨵ","ꨶ"],"ꩃ","ꩌ","ꩼ","ꪰ",["ꪲ","ꪴ"],["ꪷ","ꪸ"],["ꪾ","꪿"],"꫁",["ꫬ","ꫭ"],"꫶","ꯥ","ꯨ","꯭","ﬞ",["︀","️"],["︠","︯"]],!1,!1),Ee=/^[0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19]/,xe=Vn([["0","9"],["٠","٩"],["۰","۹"],["߀","߉"],["०","९"],["০","৯"],["੦","੯"],["૦","૯"],["୦","୯"],["௦","௯"],["౦","౯"],["೦","೯"],["൦","൯"],["෦","෯"],["๐","๙"],["໐","໙"],["༠","༩"],["၀","၉"],["႐","႙"],["០","៩"],["᠐","᠙"],["᥆","᥏"],["᧐","᧙"],["᪀","᪉"],["᪐","᪙"],["᭐","᭙"],["᮰","᮹"],["᱀","᱉"],["᱐","᱙"],["꘠","꘩"],["꣐","꣙"],["꤀","꤉"],["꧐","꧙"],["꧰","꧹"],["꩐","꩙"],["꯰","꯹"],["0","9"]],!1,!1),Ce=/^[\u16EE-\u16F0\u2160-\u2182\u2185-\u2188\u3007\u3021-\u3029\u3038-\u303A\uA6E6-\uA6EF]/,Se=Vn([["ᛮ","ᛰ"],["Ⅰ","ↂ"],["ↅ","ↈ"],"〇",["〡","〩"],["〸","〺"],["ꛦ","ꛯ"]],!1,!1),we=/^[_\u203F-\u2040\u2054\uFE33-\uFE34\uFE4D-\uFE4F\uFF3F]/,Te=Vn(["_",["‿","⁀"],"⁔",["︳","︴"],["﹍","﹏"],"_"],!1,!1),De=/^[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,Be=Vn([" "," "," ",[" "," "]," "," "," "],!1,!1),_e=zn("break",!1),Me=zn("class",!1),Fe=zn("continue",!1),Oe=zn("default",!1),ke=zn("do",!1),Ie=zn("else",!1),Pe=zn("enum",!1),je=zn("export",!1),Re=zn("false",!1),Ne=zn("for",!1),Ge=zn("function",!1),Le=zn("get",!1),ze=zn("if",!1),Ve=zn("import",!1),Ue=zn("in",!1),We=zn("return",!1),qe=zn("set",!1),He=zn("switch",!1),Xe=zn("true",!1),Ke=(zn("try",!1),zn("var",!1)),Ye=zn("let",!1),Je=zn("const",!1),Qe=zn("void",!1),Ze=zn("while",!1),$e=(zn("interface",!1),zn(";",!1)),et=zn("}",!1),tt=zn("(",!1),nt=zn(")",!1),rt=zn(",",!1),it=function(e,t,n){return Xi(qi(t,0)).concat(n)},at=function(e){return t=e.length+1,n=null,Array.apply(null,new Array(t)).map((function(){return n}));var t,n},ot=zn("{",!1),ut=function(e){return{type:"ObjectExpression",properties:e}},st=function(e,t){return Hi(e,t,3)},ct=function(e,t){return{property:t,computed:!0}},ft=function(e,t){return{property:t,computed:!1}},lt=function(e,t){return{type:"CallExpression",arguments:t}},pt=function(e,t){return{type:"MemberExpression",property:t,computed:!0}},ht=function(e,t){return{type:"MemberExpression",property:t,computed:!1}},dt=zn("++",!1),mt=zn("--",!1),yt=zn("+",!1),vt=zn("=",!1),gt=zn("-",!1),bt=zn("~",!1),At=zn("!",!1),Et=function(e,t){return function(e,t){return t.reduce((function(e,t){return{type:"BinaryExpression",operator:t[1],left:e,right:t[3]}}),e)}(e,t)},xt=zn("*",!1),Ct=zn("/",!1),St=zn("%",!1),wt=/^[+=]/,Tt=Vn(["+","="],!1,!1),Dt=/^[\-=]/,Bt=Vn(["-","="],!1,!1),_t=zn("<<",!1),Mt=zn(">>>",!1),Ft=zn(">>",!1),Ot=zn("<=",!1),kt=zn(">=",!1),It=zn("<",!1),Pt=zn(">",!1),jt=zn("===",!1),Rt=zn("!==",!1),Nt=zn("==",!1),Gt=zn("!=",!1),Lt=zn("&",!1),zt=/^[&=]/,Vt=Vn(["&","="],!1,!1),Ut=zn("^",!1),Wt=zn("|",!1),qt=/^[|=]/,Ht=Vn(["|","="],!1,!1),Xt=function(e,t){return function(e,t){return t.reduce((function(e,t){return{type:"LogicalExpression",operator:t[1],left:e,right:t[3]}}),e)}(e,t)},Kt=zn("&&",!1),Yt=zn("||",!1),Jt=zn("?",!1),Qt=function(e,t,n){return{type:"ConditionalExpression",test:e,consequent:t,alternate:n}},Zt=function(e,t){return{type:"AssignmentExpression",operator:"=",left:e,right:t}},$t=function(e,t,n){return{type:"AssignmentExpression",operator:t,left:e,right:n}},en=zn("*=",!1),tn=zn("/=",!1),nn=zn("%=",!1),rn=zn("+=",!1),an=zn("-=",!1),on=zn("<<=",!1),un=zn(">>=",!1),sn=zn(">>>=",!1),cn=zn("&=",!1),fn=zn("^=",!1),ln=zn("|=",!1),pn=function(e,t){return t.length>0?{type:"SequenceExpression",expressions:Hi(e,t,3)}:e},hn=function(e,t){return{type:"VariableDeclarator",id:e,init:qi(t,1)}},dn=zn("from",!1),mn=zn("as",!1),yn=function(e,t){return Hi(e,t,1)},vn=zn("@",!1),gn=zn("float",!1),bn=zn("int",!1),An=zn("uint",!1),En=zn("bool",!1),xn=zn("vec2",!1),Cn=zn("vec3",!1),Sn=zn("vec4",!1),wn=zn("bvec2",!1),Tn=zn("bvec3",!1),Dn=zn("bvec4",!1),Bn=zn("ivec2",!1),_n=zn("ivec3",!1),Mn=zn("ivec4",!1),Fn=zn("image2D",!1),On=zn("mat3",!1),kn=zn("mat4",!1),In=0,Pn=0,jn=[{line:1,column:1}],Rn=0,Nn=[],Gn=0;if(void 0!==t.startRule){if(!(t.startRule in i))throw new Error("Can't start parsing from rule \""+t.startRule+'".');a=i[t.startRule]}function Ln(){return e.substring(Pn,In)}function zn(e,t){return{type:"literal",text:e,ignoreCase:t}}function Vn(e,t,n){return{type:"class",parts:e,inverted:t,ignoreCase:n}}function Un(e){return{type:"other",description:e}}function Wn(t){var n,r=jn[t];if(r)return r;for(n=t-1;!jn[n];)n--;for(r={line:(r=jn[n]).line,column:r.column};n<t;)10===e.charCodeAt(n)?(r.line++,r.column=1):r.column++,n++;return jn[t]=r,r}function qn(e,t){var n=Wn(e),r=Wn(t);return{start:{offset:e,line:n.line,column:n.column},end:{offset:t,line:r.line,column:r.column}}}function Hn(e){In<Rn||(In>Rn&&(Rn=In,Nn=[]),Nn.push(e))}function Xn(e,t,n){return new le(le.buildMessage(e,t),e,t,n)}function Kn(){var e,t;return e=In,Ir()!==r&&(t=function(){var e,t;e=In,(t=Gi())===r&&(t=null);t!==r&&(Pn=e,t={type:"Program",body:Xi(t)});return e=t}())!==r&&Ir()!==r?(Pn=e,e=t):(In=e,e=r),e}function Yn(){var t;return e.length>In?(t=e.charAt(In),In++):(t=r,0===Gn&&Hn(o)),t}function Jn(){var t;return Gn++,9===e.charCodeAt(In)?(t="\t",In++):(t=r,0===Gn&&Hn(s)),t===r&&(11===e.charCodeAt(In)?(t="\v",In++):(t=r,0===Gn&&Hn(c)),t===r&&(12===e.charCodeAt(In)?(t="\f",In++):(t=r,0===Gn&&Hn(f)),t===r&&(32===e.charCodeAt(In)?(t=" ",In++):(t=r,0===Gn&&Hn(l)),t===r&&(160===e.charCodeAt(In)?(t=" ",In++):(t=r,0===Gn&&Hn(p)),t===r&&(65279===e.charCodeAt(In)?(t="\ufeff",In++):(t=r,0===Gn&&Hn(h)),t===r&&(t=function(){var t;De.test(e.charAt(In))?(t=e.charAt(In),In++):(t=r,0===Gn&&Hn(Be));return t}())))))),Gn--,t===r&&(r,0===Gn&&Hn(u)),t}function Qn(){var t;return d.test(e.charAt(In))?(t=e.charAt(In),In++):(t=r,0===Gn&&Hn(m)),t}function Zn(){var t;return Gn++,10===e.charCodeAt(In)?(t="\n",In++):(t=r,0===Gn&&Hn(v)),t===r&&("\r\n"===e.substr(In,2)?(t="\r\n",In+=2):(t=r,0===Gn&&Hn(g)),t===r&&(13===e.charCodeAt(In)?(t="\r",In++):(t=r,0===Gn&&Hn(b)),t===r&&(8232===e.charCodeAt(In)?(t="\u2028",In++):(t=r,0===Gn&&Hn(A)),t===r&&(8233===e.charCodeAt(In)?(t="\u2029",In++):(t=r,0===Gn&&Hn(E)))))),Gn--,t===r&&(r,0===Gn&&Hn(y)),t}function $n(){var t;return Gn++,(t=function(){var t,n,i,a,o,u;t=In,"/*"===e.substr(In,2)?(n="/*",In+=2):(n=r,0===Gn&&Hn(C));if(n!==r){for(i=[],a=In,o=In,Gn++,"*/"===e.substr(In,2)?(u="*/",In+=2):(u=r,0===Gn&&Hn(S)),Gn--,u===r?o=void 0:(In=o,o=r),o!==r&&(u=Yn())!==r?a=o=[o,u]:(In=a,a=r);a!==r;)i.push(a),a=In,o=In,Gn++,"*/"===e.substr(In,2)?(u="*/",In+=2):(u=r,0===Gn&&Hn(S)),Gn--,u===r?o=void 0:(In=o,o=r),o!==r&&(u=Yn())!==r?a=o=[o,u]:(In=a,a=r);i!==r?("*/"===e.substr(In,2)?(a="*/",In+=2):(a=r,0===Gn&&Hn(S)),a!==r?t=n=[n,i,a]:(In=t,t=r)):(In=t,t=r)}else In=t,t=r;return t}())===r&&(t=tr()),Gn--,t===r&&(r,0===Gn&&Hn(x)),t}function er(){var t,n,i,a,o,u;if(t=In,"/*"===e.substr(In,2)?(n="/*",In+=2):(n=r,0===Gn&&Hn(C)),n!==r){for(i=[],a=In,o=In,Gn++,"*/"===e.substr(In,2)?(u="*/",In+=2):(u=r,0===Gn&&Hn(S)),u===r&&(u=Qn()),Gn--,u===r?o=void 0:(In=o,o=r),o!==r&&(u=Yn())!==r?a=o=[o,u]:(In=a,a=r);a!==r;)i.push(a),a=In,o=In,Gn++,"*/"===e.substr(In,2)?(u="*/",In+=2):(u=r,0===Gn&&Hn(S)),u===r&&(u=Qn()),Gn--,u===r?o=void 0:(In=o,o=r),o!==r&&(u=Yn())!==r?a=o=[o,u]:(In=a,a=r);i!==r?("*/"===e.substr(In,2)?(a="*/",In+=2):(a=r,0===Gn&&Hn(S)),a!==r?t=n=[n,i,a]:(In=t,t=r)):(In=t,t=r)}else In=t,t=r;return t}function tr(){var t,n,i,a,o,u;if(t=In,"//"===e.substr(In,2)?(n="//",In+=2):(n=r,0===Gn&&Hn(w)),n!==r){for(i=[],a=In,o=In,Gn++,u=Qn(),Gn--,u===r?o=void 0:(In=o,o=r),o!==r&&(u=Yn())!==r?a=o=[o,u]:(In=a,a=r);a!==r;)i.push(a),a=In,o=In,Gn++,u=Qn(),Gn--,u===r?o=void 0:(In=o,o=r),o!==r&&(u=Yn())!==r?a=o=[o,u]:(In=a,a=r);i!==r?t=n=[n,i]:(In=t,t=r)}else In=t,t=r;return t}function nr(){var t,n,i;return t=In,n=In,Gn++,i=function(){var t;(t=function(){var t;(t=vr())===r&&(t=br())===r&&(t=function(){var t,n,i,a;t=In,"default"===e.substr(In,7)?(n="default",In+=7):(n=r,0===Gn&&Hn(Oe));n!==r?(i=In,Gn++,a=ar(),Gn--,a===r?i=void 0:(In=i,i=r),i!==r?t=n=[n,i]:(In=t,t=r)):(In=t,t=r);return t}())===r&&(t=Ar())===r&&(t=Er())===r&&(t=Cr())===r&&(t=Sr())===r&&(t=wr())===r&&(t=Br())===r&&(t=function(){var t,n,i,a;t=In,"switch"===e.substr(In,6)?(n="switch",In+=6):(n=r,0===Gn&&Hn(He));n!==r?(i=In,Gn++,a=ar(),Gn--,a===r?i=void 0:(In=i,i=r),i!==r?t=n=[n,i]:(In=t,t=r)):(In=t,t=r);return t}())===r&&(t=_r())===r&&(t=Or())===r&&(t=kr())===r&&(t=Fr())===r&&(t=function(){var t,n,i,a;t=In,"enum"===e.substr(In,4)?(n="enum",In+=4):(n=r,0===Gn&&Hn(Pe));n!==r?(i=In,Gn++,a=ar(),Gn--,a===r?i=void 0:(In=i,i=r),i!==r?t=n=[n,i]:(In=t,t=r)):(In=t,t=r);return t}())===r&&(t=xr())===r&&(t=Tr())===r&&(t=gr());return t}())===r&&(t=or());return t}(),Gn--,i===r?n=void 0:(In=n,n=r),n!==r&&(i=rr())!==r?(Pn=t,t=n=i):(In=t,t=r),t}function rr(){var t,n,i,a,o,u,s,c,f,l,p,h,d,m,y,v;if(Gn++,t=In,(n=ir())!==r){for(i=[],a=ar();a!==r;)i.push(a),a=ar();i!==r?(a=In,(o=Ir())!==r?(58===e.charCodeAt(In)?(u=":",In++):(u=r,0===Gn&&Hn(D)),u!==r&&(s=Ir())!==r&&(c=Vi())!==r?(f=In,91===e.charCodeAt(In)?(l="[",In++):(l=r,0===Gn&&Hn(B)),l!==r?((p=rr())===r&&(p=ur()),p===r&&(p=null),p!==r?(93===e.charCodeAt(In)?(h="]",In++):(h=r,0===Gn&&Hn(_)),h!==r?f=l=[l,p,h]:(In=f,f=r)):(In=f,f=r)):(In=f,f=r),f===r&&(f=null),f!==r?a=o=[o,u,s,c,f]:(In=a,a=r)):(In=a,a=r)):(In=a,a=r),a===r&&(a=null),a!==r?(Pn=t,d=n,m=i,v=qi(y=a,4)||[],t=n={type:"Identifier",name:d+m.join(""),typeAnnotation:Wi([qi(y,3),v.map((function(e){return e?"Literal"===e.type?e.value:"Identifier"===e.type?e.name:e:""})).join("")])}):(In=t,t=r)):(In=t,t=r)}else In=t,t=r;return Gn--,t===r&&(n=r,0===Gn&&Hn(T)),t}function ir(){var t;return(t=function(){var t;(t=function(){var t;me.test(e.charAt(In))?(t=e.charAt(In),In++):(t=r,0===Gn&&Hn(ye));return t}())===r&&(t=function(){var t;ae.test(e.charAt(In))?(t=e.charAt(In),In++):(t=r,0===Gn&&Hn(oe));return t}())===r&&(t=function(){var t;he.test(e.charAt(In))?(t=e.charAt(In),In++):(t=r,0===Gn&&Hn(de));return t}())===r&&(t=function(){var t;ue.test(e.charAt(In))?(t=e.charAt(In),In++):(t=r,0===Gn&&Hn(se));return t}())===r&&(t=function(){var t;fe.test(e.charAt(In))?(t=e.charAt(In),In++):(t=r,0===Gn&&Hn(pe));return t}())===r&&(t=function(){var t;Ce.test(e.charAt(In))?(t=e.charAt(In),In++):(t=r,0===Gn&&Hn(Se));return t}());return t}())===r&&(36===e.charCodeAt(In)?(t="$",In++):(t=r,0===Gn&&Hn(M)),t===r&&(95===e.charCodeAt(In)?(t="_",In++):(t=r,0===Gn&&Hn(F)))),t}function ar(){var t;return(t=ir())===r&&(t=function(){var t;(t=function(){var t;be.test(e.charAt(In))?(t=e.charAt(In),In++):(t=r,0===Gn&&Hn(Ae));return t}())===r&&(t=function(){var t;ve.test(e.charAt(In))?(t=e.charAt(In),In++):(t=r,0===Gn&&Hn(ge));return t}());return t}())===r&&(t=function(){var t;Ee.test(e.charAt(In))?(t=e.charAt(In),In++):(t=r,0===Gn&&Hn(xe));return t}())===r&&(t=function(){var t;we.test(e.charAt(In))?(t=e.charAt(In),In++):(t=r,0===Gn&&Hn(Te));return t}())===r&&(8204===e.charCodeAt(In)?(t="‌",In++):(t=r,0===Gn&&Hn(O)),t===r&&(8205===e.charCodeAt(In)?(t="‍",In++):(t=r,0===Gn&&Hn(k)))),t}function or(){var t,n;return t=In,(n=function(){var t,n,i,a;t=In,"true"===e.substr(In,4)?(n="true",In+=4):(n=r,0===Gn&&Hn(Xe));n!==r?(i=In,Gn++,a=ar(),Gn--,a===r?i=void 0:(In=i,i=r),i!==r?t=n=[n,i]:(In=t,t=r)):(In=t,t=r);return t}())!==r&&(Pn=t,n={type:"Literal",value:!0}),(t=n)===r&&(t=In,(n=function(){var t,n,i,a;t=In,"false"===e.substr(In,5)?(n="false",In+=5):(n=r,0===Gn&&Hn(Re));n!==r?(i=In,Gn++,a=ar(),Gn--,a===r?i=void 0:(In=i,i=r),i!==r?t=n=[n,i]:(In=t,t=r)):(In=t,t=r);return t}())!==r&&(Pn=t,n={type:"Literal",value:!1}),t=n),t}function ur(){var t,n,i,a;return Gn++,t=In,(n=function(){var t,n,i,a,o;if(t=In,(n=sr())!==r)if(46===e.charCodeAt(In)?(i=".",In++):(i=r,0===Gn&&Hn(P)),i!==r){for(a=[],o=cr();o!==r;)a.push(o),o=cr();a!==r?((o=fr())===r&&(o=null),o!==r?(Pn=t,n=j(),t=n):(In=t,t=r)):(In=t,t=r)}else In=t,t=r;else In=t,t=r;if(t===r){if(t=In,46===e.charCodeAt(In)?(n=".",In++):(n=r,0===Gn&&Hn(P)),n!==r){if(i=[],(a=cr())!==r)for(;a!==r;)i.push(a),a=cr();else i=r;i!==r?((a=fr())===r&&(a=null),a!==r?(Pn=t,n=j(),t=n):(In=t,t=r)):(In=t,t=r)}else In=t,t=r;t===r&&(t=In,(n=sr())!==r?((i=fr())===r&&(i=null),i!==r?(Pn=t,n=j(),t=n):(In=t,t=r)):(In=t,t=r))}return t}())!==r?(i=In,Gn++,(a=ir())===r&&(a=cr()),Gn--,a===r?i=void 0:(In=i,i=r),i!==r?(Pn=t,t=n=n):(In=t,t=r)):(In=t,t=r),Gn--,t===r&&(n=r,0===Gn&&Hn(I)),t}function sr(){var t,n,i,a;if(48===e.charCodeAt(In)?(t="0",In++):(t=r,0===Gn&&Hn(R)),t===r)if(t=In,(n=function(){var t;L.test(e.charAt(In))?(t=e.charAt(In),In++):(t=r,0===Gn&&Hn(z));return t}())!==r){for(i=[],a=cr();a!==r;)i.push(a),a=cr();i!==r?t=n=[n,i]:(In=t,t=r)}else In=t,t=r;return t}function cr(){var t;return N.test(e.charAt(In))?(t=e.charAt(In),In++):(t=r,0===Gn&&Hn(G)),t}function fr(){var t,n,i;return t=In,(n=function(){var t;"e"===e.substr(In,1).toLowerCase()?(t=e.charAt(In),In++):(t=r,0===Gn&&Hn(V));return t}())!==r&&(i=function(){var t,n,i,a;t=In,U.test(e.charAt(In))?(n=e.charAt(In),In++):(n=r,0===Gn&&Hn(W));n===r&&(n=null);if(n!==r){if(i=[],(a=cr())!==r)for(;a!==r;)i.push(a),a=cr();else i=r;i!==r?t=n=[n,i]:(In=t,t=r)}else In=t,t=r;return t}())!==r?t=n=[n,i]:(In=t,t=r),t}function lr(){var t,n,i,a;if(Gn++,t=In,34===e.charCodeAt(In)?(n='"',In++):(n=r,0===Gn&&Hn(H)),n!==r){for(i=[],a=pr();a!==r;)i.push(a),a=pr();i!==r?(34===e.charCodeAt(In)?(a='"',In++):(a=r,0===Gn&&Hn(H)),a!==r?(Pn=t,t=n=X(i)):(In=t,t=r)):(In=t,t=r)}else In=t,t=r;if(t===r)if(t=In,39===e.charCodeAt(In)?(n="'",In++):(n=r,0===Gn&&Hn(K)),n!==r){for(i=[],a=hr();a!==r;)i.push(a),a=hr();i!==r?(39===e.charCodeAt(In)?(a="'",In++):(a=r,0===Gn&&Hn(K)),a!==r?(Pn=t,t=n=X(i)):(In=t,t=r)):(In=t,t=r)}else In=t,t=r;return Gn--,t===r&&(n=r,0===Gn&&Hn(q)),t}function pr(){var t,n,i;return t=In,n=In,Gn++,34===e.charCodeAt(In)?(i='"',In++):(i=r,0===Gn&&Hn(H)),i===r&&(92===e.charCodeAt(In)?(i="\\",In++):(i=r,0===Gn&&Hn(Y)),i===r&&(i=Qn())),Gn--,i===r?n=void 0:(In=n,n=r),n!==r&&(i=Yn())!==r?(Pn=t,t=n=J()):(In=t,t=r),t===r&&(t=In,92===e.charCodeAt(In)?(n="\\",In++):(n=r,0===Gn&&Hn(Y)),n!==r&&(i=mr())!==r?(Pn=t,t=n=i):(In=t,t=r),t===r&&(t=dr())),t}function hr(){var t,n,i;return t=In,n=In,Gn++,39===e.charCodeAt(In)?(i="'",In++):(i=r,0===Gn&&Hn(K)),i===r&&(92===e.charCodeAt(In)?(i="\\",In++):(i=r,0===Gn&&Hn(Y)),i===r&&(i=Qn())),Gn--,i===r?n=void 0:(In=n,n=r),n!==r&&(i=Yn())!==r?(Pn=t,t=n=J()):(In=t,t=r),t===r&&(t=In,92===e.charCodeAt(In)?(n="\\",In++):(n=r,0===Gn&&Hn(Y)),n!==r&&(i=mr())!==r?(Pn=t,t=n=i):(In=t,t=r),t===r&&(t=dr())),t}function dr(){var t,n;return t=In,92===e.charCodeAt(In)?(n="\\",In++):(n=r,0===Gn&&Hn(Y)),n!==r&&Zn()!==r?(Pn=t,t=n=""):(In=t,t=r),t}function mr(){var t,n,i,a;return(t=function(){var t;(t=yr())===r&&(t=function(){var t,n,i;t=In,n=In,Gn++,(i=function(){var t;(t=yr())===r&&(t=cr())===r&&(120===e.charCodeAt(In)?(t="x",In++):(t=r,0===Gn&&Hn(re)),t===r&&(117===e.charCodeAt(In)?(t="u",In++):(t=r,0===Gn&&Hn(ie))));return t}())===r&&(i=Qn());Gn--,i===r?n=void 0:(In=n,n=r);n!==r&&(i=Yn())!==r?(Pn=t,n=J(),t=n):(In=t,t=r);return t}());return t}())===r&&(t=In,48===e.charCodeAt(In)?(n="0",In++):(n=r,0===Gn&&Hn(R)),n!==r?(i=In,Gn++,a=cr(),Gn--,a===r?i=void 0:(In=i,i=r),i!==r?(Pn=t,t=n="\0"):(In=t,t=r)):(In=t,t=r)),t}function yr(){var t,n;return 39===e.charCodeAt(In)?(t="'",In++):(t=r,0===Gn&&Hn(K)),t===r&&(34===e.charCodeAt(In)?(t='"',In++):(t=r,0===Gn&&Hn(H)),t===r&&(92===e.charCodeAt(In)?(t="\\",In++):(t=r,0===Gn&&Hn(Y)),t===r&&(t=In,98===e.charCodeAt(In)?(n="b",In++):(n=r,0===Gn&&Hn(Q)),n!==r&&(Pn=t,n="\b"),(t=n)===r&&(t=In,102===e.charCodeAt(In)?(n="f",In++):(n=r,0===Gn&&Hn(Z)),n!==r&&(Pn=t,n="\f"),(t=n)===r&&(t=In,110===e.charCodeAt(In)?(n="n",In++):(n=r,0===Gn&&Hn($)),n!==r&&(Pn=t,n="\n"),(t=n)===r&&(t=In,114===e.charCodeAt(In)?(n="r",In++):(n=r,0===Gn&&Hn(ee)),n!==r&&(Pn=t,n="\r"),(t=n)===r&&(t=In,116===e.charCodeAt(In)?(n="t",In++):(n=r,0===Gn&&Hn(te)),n!==r&&(Pn=t,n="\t"),(t=n)===r&&(t=In,118===e.charCodeAt(In)?(n="v",In++):(n=r,0===Gn&&Hn(ne)),n!==r&&(Pn=t,n="\v"),t=n)))))))),t}function vr(){var t,n,i,a;return t=In,"break"===e.substr(In,5)?(n="break",In+=5):(n=r,0===Gn&&Hn(_e)),n!==r?(i=In,Gn++,a=ar(),Gn--,a===r?i=void 0:(In=i,i=r),i!==r?t=n=[n,i]:(In=t,t=r)):(In=t,t=r),t}function gr(){var t,n,i,a;return t=In,"class"===e.substr(In,5)?(n="class",In+=5):(n=r,0===Gn&&Hn(Me)),n!==r?(i=In,Gn++,a=ar(),Gn--,a===r?i=void 0:(In=i,i=r),i!==r?t=n=[n,i]:(In=t,t=r)):(In=t,t=r),t}function br(){var t,n,i,a;return t=In,"continue"===e.substr(In,8)?(n="continue",In+=8):(n=r,0===Gn&&Hn(Fe)),n!==r?(i=In,Gn++,a=ar(),Gn--,a===r?i=void 0:(In=i,i=r),i!==r?t=n=[n,i]:(In=t,t=r)):(In=t,t=r),t}function Ar(){var t,n,i,a;return t=In,"do"===e.substr(In,2)?(n="do",In+=2):(n=r,0===Gn&&Hn(ke)),n!==r?(i=In,Gn++,a=ar(),Gn--,a===r?i=void 0:(In=i,i=r),i!==r?t=n=[n,i]:(In=t,t=r)):(In=t,t=r),t}function Er(){var t,n,i,a;return t=In,"else"===e.substr(In,4)?(n="else",In+=4):(n=r,0===Gn&&Hn(Ie)),n!==r?(i=In,Gn++,a=ar(),Gn--,a===r?i=void 0:(In=i,i=r),i!==r?t=n=[n,i]:(In=t,t=r)):(In=t,t=r),t}function xr(){var t,n,i,a;return t=In,"export"===e.substr(In,6)?(n="export",In+=6):(n=r,0===Gn&&Hn(je)),n!==r?(i=In,Gn++,a=ar(),Gn--,a===r?i=void 0:(In=i,i=r),i!==r?t=n=[n,i]:(In=t,t=r)):(In=t,t=r),t}function Cr(){var t,n,i,a;return t=In,"for"===e.substr(In,3)?(n="for",In+=3):(n=r,0===Gn&&Hn(Ne)),n!==r?(i=In,Gn++,a=ar(),Gn--,a===r?i=void 0:(In=i,i=r),i!==r?t=n=[n,i]:(In=t,t=r)):(In=t,t=r),t}function Sr(){var t,n,i,a;return t=In,"function"===e.substr(In,8)?(n="function",In+=8):(n=r,0===Gn&&Hn(Ge)),n!==r?(i=In,Gn++,a=ar(),Gn--,a===r?i=void 0:(In=i,i=r),i!==r?t=n=[n,i]:(In=t,t=r)):(In=t,t=r),t}function wr(){var t,n,i,a;return t=In,"if"===e.substr(In,2)?(n="if",In+=2):(n=r,0===Gn&&Hn(ze)),n!==r?(i=In,Gn++,a=ar(),Gn--,a===r?i=void 0:(In=i,i=r),i!==r?t=n=[n,i]:(In=t,t=r)):(In=t,t=r),t}function Tr(){var t,n,i,a;return t=In,"import"===e.substr(In,6)?(n="import",In+=6):(n=r,0===Gn&&Hn(Ve)),n!==r?(i=In,Gn++,a=ar(),Gn--,a===r?i=void 0:(In=i,i=r),i!==r?t=n=[n,i]:(In=t,t=r)):(In=t,t=r),t}function Dr(){var t,n,i,a;return t=In,"in"===e.substr(In,2)?(n="in",In+=2):(n=r,0===Gn&&Hn(Ue)),n!==r?(i=In,Gn++,a=ar(),Gn--,a===r?i=void 0:(In=i,i=r),i!==r?t=n=[n,i]:(In=t,t=r)):(In=t,t=r),t}function Br(){var t,n,i,a;return t=In,"return"===e.substr(In,6)?(n="return",In+=6):(n=r,0===Gn&&Hn(We)),n!==r?(i=In,Gn++,a=ar(),Gn--,a===r?i=void 0:(In=i,i=r),i!==r?t=n=[n,i]:(In=t,t=r)):(In=t,t=r),t}function _r(){var t,n,i,a;return t=In,"var"===e.substr(In,3)?(n="var",In+=3):(n=r,0===Gn&&Hn(Ke)),n!==r?(i=In,Gn++,a=ar(),Gn--,a===r?i=void 0:(In=i,i=r),i!==r?t=n=[n,i]:(In=t,t=r)):(In=t,t=r),t}function Mr(){var t,n,i,a;return t=In,"let"===e.substr(In,3)?(n="let",In+=3):(n=r,0===Gn&&Hn(Ye)),n!==r?(i=In,Gn++,a=ar(),Gn--,a===r?i=void 0:(In=i,i=r),i!==r?t=n=[n,i]:(In=t,t=r)):(In=t,t=r),t}function Fr(){var t,n,i,a;return t=In,"const"===e.substr(In,5)?(n="const",In+=5):(n=r,0===Gn&&Hn(Je)),n!==r?(i=In,Gn++,a=ar(),Gn--,a===r?i=void 0:(In=i,i=r),i!==r?t=n=[n,i]:(In=t,t=r)):(In=t,t=r),t}function Or(){var t,n,i,a;return t=In,"void"===e.substr(In,4)?(n="void",In+=4):(n=r,0===Gn&&Hn(Qe)),n!==r?(i=In,Gn++,a=ar(),Gn--,a===r?i=void 0:(In=i,i=r),i!==r?t=n=[n,i]:(In=t,t=r)):(In=t,t=r),t}function kr(){var t,n,i,a;return t=In,"while"===e.substr(In,5)?(n="while",In+=5):(n=r,0===Gn&&Hn(Ze)),n!==r?(i=In,Gn++,a=ar(),Gn--,a===r?i=void 0:(In=i,i=r),i!==r?t=n=[n,i]:(In=t,t=r)):(In=t,t=r),t}function Ir(){var e,t;for(e=[],(t=Jn())===r&&(t=Zn())===r&&(t=$n());t!==r;)e.push(t),(t=Jn())===r&&(t=Zn())===r&&(t=$n());return e}function Pr(){var e,t;for(e=[],(t=Jn())===r&&(t=er());t!==r;)e.push(t),(t=Jn())===r&&(t=er());return e}function jr(){var t,n,i,a;return t=In,(n=Ir())!==r?(59===e.charCodeAt(In)?(i=";",In++):(i=r,0===Gn&&Hn($e)),i!==r?t=n=[n,i]:(In=t,t=r)):(In=t,t=r),t===r&&(t=In,(n=Pr())!==r?((i=tr())===r&&(i=null),i!==r&&(a=Zn())!==r?t=n=[n,i,a]:(In=t,t=r)):(In=t,t=r),t===r&&(t=In,(n=Pr())!==r?(i=In,Gn++,125===e.charCodeAt(In)?(a="}",In++):(a=r,0===Gn&&Hn(et)),Gn--,a!==r?(In=i,i=void 0):i=r,i!==r?t=n=[n,i]:(In=t,t=r)):(In=t,t=r),t===r&&(t=In,(n=Ir())!==r&&(i=function(){var t,n;t=In,Gn++,e.length>In?(n=e.charAt(In),In++):(n=r,0===Gn&&Hn(o));Gn--,n===r?t=void 0:(In=t,t=r);return t}())!==r?t=n=[n,i]:(In=t,t=r)))),t}function Rr(){var t,n,i,a;return(t=nr())===r&&(t=function(){var e;return(e=or())===r&&(e=ur())===r&&(e=lr()),e}())===r&&(t=function(){var t,n,i,a,o,u,s,c;t=In,91===e.charCodeAt(In)?(n="[",In++):(n=r,0===Gn&&Hn(B));n!==r&&Ir()!==r?(i=In,(a=Gr())!==r&&(o=Ir())!==r?i=a=[a,o]:(In=i,i=r),i===r&&(i=null),i!==r?(93===e.charCodeAt(In)?(a="]",In++):(a=r,0===Gn&&Hn(_)),a!==r?(Pn=t,n={type:"ArrayExpression",elements:Xi(qi(i,0))},t=n):(In=t,t=r)):(In=t,t=r)):(In=t,t=r);t===r&&(t=In,91===e.charCodeAt(In)?(n="[",In++):(n=r,0===Gn&&Hn(B)),n!==r&&Ir()!==r&&(i=Nr())!==r&&(a=Ir())!==r?(93===e.charCodeAt(In)?(o="]",In++):(o=r,0===Gn&&Hn(_)),o!==r?(Pn=t,t=n={type:"ArrayExpression",elements:i}):(In=t,t=r)):(In=t,t=r),t===r&&(t=In,91===e.charCodeAt(In)?(n="[",In++):(n=r,0===Gn&&Hn(B)),n!==r&&Ir()!==r&&(i=Nr())!==r&&(a=Ir())!==r?(44===e.charCodeAt(In)?(o=",",In++):(o=r,0===Gn&&Hn(rt)),o!==r&&Ir()!==r?(u=In,(s=Gr())!==r&&(c=Ir())!==r?u=s=[s,c]:(In=u,u=r),u===r&&(u=null),u!==r?(93===e.charCodeAt(In)?(s="]",In++):(s=r,0===Gn&&Hn(_)),s!==r?(Pn=t,n=function(e,t){return{type:"ArrayExpression",elements:e.concat(Xi(qi(t,0)))}}(i,u),t=n):(In=t,t=r)):(In=t,t=r)):(In=t,t=r)):(In=t,t=r)));return t}())===r&&(t=function(){var t,n,i,a,o;t=In,123===e.charCodeAt(In)?(n="{",In++):(n=r,0===Gn&&Hn(ot));n!==r&&Ir()!==r?(125===e.charCodeAt(In)?(i="}",In++):(i=r,0===Gn&&Hn(et)),i!==r?(Pn=t,t=n={type:"ObjectExpression",properties:[]}):(In=t,t=r)):(In=t,t=r);t===r&&(t=In,123===e.charCodeAt(In)?(n="{",In++):(n=r,0===Gn&&Hn(ot)),n!==r&&Ir()!==r&&(i=Lr())!==r&&Ir()!==r?(125===e.charCodeAt(In)?(a="}",In++):(a=r,0===Gn&&Hn(et)),a!==r?(Pn=t,n=ut(i),t=n):(In=t,t=r)):(In=t,t=r),t===r&&(t=In,123===e.charCodeAt(In)?(n="{",In++):(n=r,0===Gn&&Hn(ot)),n!==r&&Ir()!==r&&(i=Lr())!==r&&Ir()!==r?(44===e.charCodeAt(In)?(a=",",In++):(a=r,0===Gn&&Hn(rt)),a!==r&&Ir()!==r?(125===e.charCodeAt(In)?(o="}",In++):(o=r,0===Gn&&Hn(et)),o!==r?(Pn=t,n=ut(i),t=n):(In=t,t=r)):(In=t,t=r)):(In=t,t=r)));return t}())===r&&(t=In,40===e.charCodeAt(In)?(n="(",In++):(n=r,0===Gn&&Hn(tt)),n!==r&&Ir()!==r&&(i=Ti())!==r&&Ir()!==r?(41===e.charCodeAt(In)?(a=")",In++):(a=r,0===Gn&&Hn(nt)),a!==r?(Pn=t,t=n=i):(In=t,t=r)):(In=t,t=r)),t}function Nr(){var t,n,i,a,o,u,s,c,f,l,p,h;if(t=In,n=In,i=In,(a=Gr())!==r&&(o=Ir())!==r?i=a=[a,o]:(In=i,i=r),i===r&&(i=null),i!==r&&(a=Ci())!==r?(Pn=n,l=a,n=i=Xi(qi(i,0)).concat(l)):(In=n,n=r),n!==r){for(i=[],a=In,(o=Ir())!==r?(44===e.charCodeAt(In)?(u=",",In++):(u=r,0===Gn&&Hn(rt)),u!==r&&Ir()!==r?(s=In,(c=Gr())!==r&&(f=Ir())!==r?s=c=[c,f]:(In=s,s=r),s===r&&(s=null),s!==r&&(c=Ci())!==r?(Pn=a,a=o=it(0,s,c)):(In=a,a=r)):(In=a,a=r)):(In=a,a=r);a!==r;)i.push(a),a=In,(o=Ir())!==r?(44===e.charCodeAt(In)?(u=",",In++):(u=r,0===Gn&&Hn(rt)),u!==r&&Ir()!==r?(s=In,(c=Gr())!==r&&(f=Ir())!==r?s=c=[c,f]:(In=s,s=r),s===r&&(s=null),s!==r&&(c=Ci())!==r?(Pn=a,a=o=it(0,s,c)):(In=a,a=r)):(In=a,a=r)):(In=a,a=r);i!==r?(Pn=t,p=n,h=i,t=n=Array.prototype.concat.apply(p,h)):(In=t,t=r)}else In=t,t=r;return t}function Gr(){var t,n,i,a,o,u;if(t=In,44===e.charCodeAt(In)?(n=",",In++):(n=r,0===Gn&&Hn(rt)),n!==r){for(i=[],a=In,(o=Ir())!==r?(44===e.charCodeAt(In)?(u=",",In++):(u=r,0===Gn&&Hn(rt)),u!==r?a=o=[o,u]:(In=a,a=r)):(In=a,a=r);a!==r;)i.push(a),a=In,(o=Ir())!==r?(44===e.charCodeAt(In)?(u=",",In++):(u=r,0===Gn&&Hn(rt)),u!==r?a=o=[o,u]:(In=a,a=r)):(In=a,a=r);i!==r?(Pn=t,t=n=at(i)):(In=t,t=r)}else In=t,t=r;return t}function Lr(){var t,n,i,a,o,u,s,c;if(t=In,(n=zr())!==r){for(i=[],a=In,(o=Ir())!==r?(44===e.charCodeAt(In)?(u=",",In++):(u=r,0===Gn&&Hn(rt)),u!==r&&(s=Ir())!==r&&(c=zr())!==r?a=o=[o,u,s,c]:(In=a,a=r)):(In=a,a=r);a!==r;)i.push(a),a=In,(o=Ir())!==r?(44===e.charCodeAt(In)?(u=",",In++):(u=r,0===Gn&&Hn(rt)),u!==r&&(s=Ir())!==r&&(c=zr())!==r?a=o=[o,u,s,c]:(In=a,a=r)):(In=a,a=r);i!==r?(Pn=t,t=n=st(n,i)):(In=t,t=r)}else In=t,t=r;return t}function zr(){var t,n,i,a,o,u,s,c,f;return t=In,(n=Vr())!==r&&Ir()!==r?(58===e.charCodeAt(In)?(i=":",In++):(i=r,0===Gn&&Hn(D)),i!==r&&Ir()!==r&&(a=Ci())!==r?(Pn=t,t=n={type:"Property",key:n,value:a,kind:"init"}):(In=t,t=r)):(In=t,t=r),t===r&&(t=In,(n=function(){var t,n,i,a;return t=In,"get"===e.substr(In,3)?(n="get",In+=3):(n=r,0===Gn&&Hn(Le)),n!==r?(i=In,Gn++,a=ar(),Gn--,a===r?i=void 0:(In=i,i=r),i!==r?t=n=[n,i]:(In=t,t=r)):(In=t,t=r),t}())!==r&&Ir()!==r&&(i=Vr())!==r&&Ir()!==r?(40===e.charCodeAt(In)?(a="(",In++):(a=r,0===Gn&&Hn(tt)),a!==r&&Ir()!==r?(41===e.charCodeAt(In)?(o=")",In++):(o=r,0===Gn&&Hn(nt)),o!==r&&Ir()!==r?(123===e.charCodeAt(In)?(u="{",In++):(u=r,0===Gn&&Hn(ot)),u!==r&&Ir()!==r&&(s=ji())!==r&&Ir()!==r?(125===e.charCodeAt(In)?(c="}",In++):(c=r,0===Gn&&Hn(et)),c!==r?(Pn=t,t=n=function(e,t){return{type:"Property",key:e,value:{type:"FunctionExpression",id:null,params:[],body:t},kind:"get"}}(i,s)):(In=t,t=r)):(In=t,t=r)):(In=t,t=r)):(In=t,t=r)):(In=t,t=r),t===r&&(t=In,(n=function(){var t,n,i,a;return t=In,"set"===e.substr(In,3)?(n="set",In+=3):(n=r,0===Gn&&Hn(qe)),n!==r?(i=In,Gn++,a=ar(),Gn--,a===r?i=void 0:(In=i,i=r),i!==r?t=n=[n,i]:(In=t,t=r)):(In=t,t=r),t}())!==r&&Ir()!==r&&(i=Vr())!==r&&Ir()!==r?(40===e.charCodeAt(In)?(a="(",In++):(a=r,0===Gn&&Hn(tt)),a!==r&&Ir()!==r&&(o=function(){var e,t;e=In,(t=nr())!==r&&(Pn=e,t=[t]);return e=t}())!==r&&Ir()!==r?(41===e.charCodeAt(In)?(u=")",In++):(u=r,0===Gn&&Hn(nt)),u!==r&&Ir()!==r?(123===e.charCodeAt(In)?(s="{",In++):(s=r,0===Gn&&Hn(ot)),s!==r&&Ir()!==r&&(c=ji())!==r&&Ir()!==r?(125===e.charCodeAt(In)?(f="}",In++):(f=r,0===Gn&&Hn(et)),f!==r?(Pn=t,t=n=function(e,t,n){return{type:"Property",key:e,value:{type:"FunctionExpression",id:null,params:t,body:n},kind:"set"}}(i,o,c)):(In=t,t=r)):(In=t,t=r)):(In=t,t=r)):(In=t,t=r)):(In=t,t=r))),t}function Vr(){var e;return(e=rr())===r&&(e=lr())===r&&(e=ur()),e}function Ur(){var t,n,i,a,o,u,s,c;if(t=In,(n=Rr())===r&&(n=ki()),n!==r){for(i=[],a=In,Ir()!==r?(91===e.charCodeAt(In)?(o="[",In++):(o=r,0===Gn&&Hn(B)),o!==r&&Ir()!==r&&(u=Ti())!==r&&Ir()!==r?(93===e.charCodeAt(In)?(s="]",In++):(s=r,0===Gn&&Hn(_)),s!==r?(Pn=a,a=ct(0,u)):(In=a,a=r)):(In=a,a=r)):(In=a,a=r),a===r&&(a=In,Ir()!==r?(46===e.charCodeAt(In)?(o=".",In++):(o=r,0===Gn&&Hn(P)),o!==r&&Ir()!==r&&(u=rr())!==r?(Pn=a,a=ft(0,u)):(In=a,a=r)):(In=a,a=r));a!==r;)i.push(a),a=In,Ir()!==r?(91===e.charCodeAt(In)?(o="[",In++):(o=r,0===Gn&&Hn(B)),o!==r&&Ir()!==r&&(u=Ti())!==r&&Ir()!==r?(93===e.charCodeAt(In)?(s="]",In++):(s=r,0===Gn&&Hn(_)),s!==r?(Pn=a,a=ct(0,u)):(In=a,a=r)):(In=a,a=r)):(In=a,a=r),a===r&&(a=In,Ir()!==r?(46===e.charCodeAt(In)?(o=".",In++):(o=r,0===Gn&&Hn(P)),o!==r&&Ir()!==r&&(u=rr())!==r?(Pn=a,a=ft(0,u)):(In=a,a=r)):(In=a,a=r));i!==r?(Pn=t,c=n,t=n=i.reduce((function(e,t){return{type:"MemberExpression",object:e,property:t.property,computed:t.computed}}),c)):(In=t,t=r)}else In=t,t=r;return t}function Wr(){var t,n,i,a,o,u,s,c,f;if(t=In,n=In,(i=Ur())!==r&&(a=Ir())!==r&&(o=qr())!==r?(Pn=n,n=i={type:"CallExpression",callee:i,arguments:o}):(In=n,n=r),n!==r){for(i=[],a=In,(o=Ir())!==r&&(u=qr())!==r?(Pn=a,a=o=lt(0,u)):(In=a,a=r),a===r&&(a=In,(o=Ir())!==r?(91===e.charCodeAt(In)?(u="[",In++):(u=r,0===Gn&&Hn(B)),u!==r&&Ir()!==r&&(s=Ti())!==r&&Ir()!==r?(93===e.charCodeAt(In)?(c="]",In++):(c=r,0===Gn&&Hn(_)),c!==r?(Pn=a,a=o=pt(0,s)):(In=a,a=r)):(In=a,a=r)):(In=a,a=r),a===r&&(a=In,(o=Ir())!==r?(46===e.charCodeAt(In)?(u=".",In++):(u=r,0===Gn&&Hn(P)),u!==r&&Ir()!==r&&(s=rr())!==r?(Pn=a,a=o=ht(0,s)):(In=a,a=r)):(In=a,a=r)));a!==r;)i.push(a),a=In,(o=Ir())!==r&&(u=qr())!==r?(Pn=a,a=o=lt(0,u)):(In=a,a=r),a===r&&(a=In,(o=Ir())!==r?(91===e.charCodeAt(In)?(u="[",In++):(u=r,0===Gn&&Hn(B)),u!==r&&Ir()!==r&&(s=Ti())!==r&&Ir()!==r?(93===e.charCodeAt(In)?(c="]",In++):(c=r,0===Gn&&Hn(_)),c!==r?(Pn=a,a=o=pt(0,s)):(In=a,a=r)):(In=a,a=r)):(In=a,a=r),a===r&&(a=In,(o=Ir())!==r?(46===e.charCodeAt(In)?(u=".",In++):(u=r,0===Gn&&Hn(P)),u!==r&&Ir()!==r&&(s=rr())!==r?(Pn=a,a=o=ht(0,s)):(In=a,a=r)):(In=a,a=r)));i!==r?(Pn=t,f=n,t=n=i.reduce((function(e,t){return t[Ui[t.type]]=e,t}),f)):(In=t,t=r)}else In=t,t=r;return t}function qr(){var t,n,i,a,o;return t=In,40===e.charCodeAt(In)?(n="(",In++):(n=r,0===Gn&&Hn(tt)),n!==r&&Ir()!==r?(i=In,(a=function(){var t,n,i,a,o,u,s,c;if(t=In,(n=Ci())!==r){for(i=[],a=In,(o=Ir())!==r?(44===e.charCodeAt(In)?(u=",",In++):(u=r,0===Gn&&Hn(rt)),u!==r&&(s=Ir())!==r&&(c=Ci())!==r?a=o=[o,u,s,c]:(In=a,a=r)):(In=a,a=r);a!==r;)i.push(a),a=In,(o=Ir())!==r?(44===e.charCodeAt(In)?(u=",",In++):(u=r,0===Gn&&Hn(rt)),u!==r&&(s=Ir())!==r&&(c=Ci())!==r?a=o=[o,u,s,c]:(In=a,a=r)):(In=a,a=r);i!==r?(Pn=t,n=st(n,i),t=n):(In=t,t=r)}else In=t,t=r;return t}())!==r&&(o=Ir())!==r?i=a=[a,o]:(In=i,i=r),i===r&&(i=null),i!==r?(41===e.charCodeAt(In)?(a=")",In++):(a=r,0===Gn&&Hn(nt)),a!==r?(Pn=t,t=n=Xi(qi(i,0))):(In=t,t=r)):(In=t,t=r)):(In=t,t=r),t}function Hr(){var e;return(e=Wr())===r&&(e=Ur()),e}function Xr(){var t,n,i;return t=In,(n=Hr())!==r&&Pr()!==r&&(i=function(){var t;"++"===e.substr(In,2)?(t="++",In+=2):(t=r,0===Gn&&Hn(dt));t===r&&("--"===e.substr(In,2)?(t="--",In+=2):(t=r,0===Gn&&Hn(mt)));return t}())!==r?(Pn=t,t=n={type:"UpdateExpression",operator:i,argument:n,prefix:!1}):(In=t,t=r),t===r&&(t=Hr()),t}function Kr(){var t,n,i,a;return(t=Xr())===r&&(t=In,(n=function(){var t,n,i,a,o;t=In,t=(n=Or())!==r?e.substring(t,In):n;t===r&&("++"===e.substr(In,2)?(t="++",In+=2):(t=r,0===Gn&&Hn(dt)),t===r&&("--"===e.substr(In,2)?(t="--",In+=2):(t=r,0===Gn&&Hn(mt)),t===r&&(t=In,n=In,43===e.charCodeAt(In)?(i="+",In++):(i=r,0===Gn&&Hn(yt)),i!==r?(a=In,Gn++,61===e.charCodeAt(In)?(o="=",In++):(o=r,0===Gn&&Hn(vt)),Gn--,o===r?a=void 0:(In=a,a=r),a!==r?n=i=[i,a]:(In=n,n=r)):(In=n,n=r),(t=n!==r?e.substring(t,In):n)===r&&(t=In,n=In,45===e.charCodeAt(In)?(i="-",In++):(i=r,0===Gn&&Hn(gt)),i!==r?(a=In,Gn++,61===e.charCodeAt(In)?(o="=",In++):(o=r,0===Gn&&Hn(vt)),Gn--,o===r?a=void 0:(In=a,a=r),a!==r?n=i=[i,a]:(In=n,n=r)):(In=n,n=r),(t=n!==r?e.substring(t,In):n)===r&&(126===e.charCodeAt(In)?(t="~",In++):(t=r,0===Gn&&Hn(bt)),t===r&&(33===e.charCodeAt(In)?(t="!",In++):(t=r,0===Gn&&Hn(At))))))));return t}())!==r&&Ir()!==r&&(i=Kr())!==r?(Pn=t,t=n={type:"++"===(a=n)||"--"===a?"UpdateExpression":"UnaryExpression",operator:a,argument:i,prefix:!0}):(In=t,t=r)),t}function Yr(){var e,t,n,i,a,o,u,s;if(e=In,(t=Kr())!==r){for(n=[],i=In,(a=Ir())!==r&&(o=Jr())!==r&&(u=Ir())!==r&&(s=Kr())!==r?i=a=[a,o,u,s]:(In=i,i=r);i!==r;)n.push(i),i=In,(a=Ir())!==r&&(o=Jr())!==r&&(u=Ir())!==r&&(s=Kr())!==r?i=a=[a,o,u,s]:(In=i,i=r);n!==r?(Pn=e,e=t=Et(t,n)):(In=e,e=r)}else In=e,e=r;return e}function Jr(){var t,n,i,a,o;return t=In,n=In,42===e.charCodeAt(In)?(i="*",In++):(i=r,0===Gn&&Hn(xt)),i!==r?(a=In,Gn++,61===e.charCodeAt(In)?(o="=",In++):(o=r,0===Gn&&Hn(vt)),Gn--,o===r?a=void 0:(In=a,a=r),a!==r?n=i=[i,a]:(In=n,n=r)):(In=n,n=r),(t=n!==r?e.substring(t,In):n)===r&&(t=In,n=In,47===e.charCodeAt(In)?(i="/",In++):(i=r,0===Gn&&Hn(Ct)),i!==r?(a=In,Gn++,61===e.charCodeAt(In)?(o="=",In++):(o=r,0===Gn&&Hn(vt)),Gn--,o===r?a=void 0:(In=a,a=r),a!==r?n=i=[i,a]:(In=n,n=r)):(In=n,n=r),(t=n!==r?e.substring(t,In):n)===r&&(t=In,n=In,37===e.charCodeAt(In)?(i="%",In++):(i=r,0===Gn&&Hn(St)),i!==r?(a=In,Gn++,61===e.charCodeAt(In)?(o="=",In++):(o=r,0===Gn&&Hn(vt)),Gn--,o===r?a=void 0:(In=a,a=r),a!==r?n=i=[i,a]:(In=n,n=r)):(In=n,n=r),t=n!==r?e.substring(t,In):n)),t}function Qr(){var e,t,n,i,a,o,u,s;if(e=In,(t=Yr())!==r){for(n=[],i=In,(a=Ir())!==r&&(o=Zr())!==r&&(u=Ir())!==r&&(s=Yr())!==r?i=a=[a,o,u,s]:(In=i,i=r);i!==r;)n.push(i),i=In,(a=Ir())!==r&&(o=Zr())!==r&&(u=Ir())!==r&&(s=Yr())!==r?i=a=[a,o,u,s]:(In=i,i=r);n!==r?(Pn=e,e=t=Et(t,n)):(In=e,e=r)}else In=e,e=r;return e}function Zr(){var t,n,i,a,o;return t=In,n=In,43===e.charCodeAt(In)?(i="+",In++):(i=r,0===Gn&&Hn(yt)),i!==r?(a=In,Gn++,wt.test(e.charAt(In))?(o=e.charAt(In),In++):(o=r,0===Gn&&Hn(Tt)),Gn--,o===r?a=void 0:(In=a,a=r),a!==r?n=i=[i,a]:(In=n,n=r)):(In=n,n=r),(t=n!==r?e.substring(t,In):n)===r&&(t=In,n=In,45===e.charCodeAt(In)?(i="-",In++):(i=r,0===Gn&&Hn(gt)),i!==r?(a=In,Gn++,Dt.test(e.charAt(In))?(o=e.charAt(In),In++):(o=r,0===Gn&&Hn(Bt)),Gn--,o===r?a=void 0:(In=a,a=r),a!==r?n=i=[i,a]:(In=n,n=r)):(In=n,n=r),t=n!==r?e.substring(t,In):n),t}function $r(){var e,t,n,i,a,o,u,s;if(e=In,(t=Qr())!==r){for(n=[],i=In,(a=Ir())!==r&&(o=ei())!==r&&(u=Ir())!==r&&(s=Qr())!==r?i=a=[a,o,u,s]:(In=i,i=r);i!==r;)n.push(i),i=In,(a=Ir())!==r&&(o=ei())!==r&&(u=Ir())!==r&&(s=Qr())!==r?i=a=[a,o,u,s]:(In=i,i=r);n!==r?(Pn=e,e=t=Et(t,n)):(In=e,e=r)}else In=e,e=r;return e}function ei(){var t,n,i,a,o;return t=In,n=In,"<<"===e.substr(In,2)?(i="<<",In+=2):(i=r,0===Gn&&Hn(_t)),i!==r?(a=In,Gn++,61===e.charCodeAt(In)?(o="=",In++):(o=r,0===Gn&&Hn(vt)),Gn--,o===r?a=void 0:(In=a,a=r),a!==r?n=i=[i,a]:(In=n,n=r)):(In=n,n=r),(t=n!==r?e.substring(t,In):n)===r&&(t=In,n=In,">>>"===e.substr(In,3)?(i=">>>",In+=3):(i=r,0===Gn&&Hn(Mt)),i!==r?(a=In,Gn++,61===e.charCodeAt(In)?(o="=",In++):(o=r,0===Gn&&Hn(vt)),Gn--,o===r?a=void 0:(In=a,a=r),a!==r?n=i=[i,a]:(In=n,n=r)):(In=n,n=r),(t=n!==r?e.substring(t,In):n)===r&&(t=In,n=In,">>"===e.substr(In,2)?(i=">>",In+=2):(i=r,0===Gn&&Hn(Ft)),i!==r?(a=In,Gn++,61===e.charCodeAt(In)?(o="=",In++):(o=r,0===Gn&&Hn(vt)),Gn--,o===r?a=void 0:(In=a,a=r),a!==r?n=i=[i,a]:(In=n,n=r)):(In=n,n=r),t=n!==r?e.substring(t,In):n)),t}function ti(){var e,t,n,i,a,o,u,s;if(e=In,(t=$r())!==r){for(n=[],i=In,(a=Ir())!==r&&(o=ni())!==r&&(u=Ir())!==r&&(s=$r())!==r?i=a=[a,o,u,s]:(In=i,i=r);i!==r;)n.push(i),i=In,(a=Ir())!==r&&(o=ni())!==r&&(u=Ir())!==r&&(s=$r())!==r?i=a=[a,o,u,s]:(In=i,i=r);n!==r?(Pn=e,e=t=Et(t,n)):(In=e,e=r)}else In=e,e=r;return e}function ni(){var t,n,i,a,o;return"<="===e.substr(In,2)?(t="<=",In+=2):(t=r,0===Gn&&Hn(Ot)),t===r&&(">="===e.substr(In,2)?(t=">=",In+=2):(t=r,0===Gn&&Hn(kt)),t===r&&(t=In,n=In,60===e.charCodeAt(In)?(i="<",In++):(i=r,0===Gn&&Hn(It)),i!==r?(a=In,Gn++,60===e.charCodeAt(In)?(o="<",In++):(o=r,0===Gn&&Hn(It)),Gn--,o===r?a=void 0:(In=a,a=r),a!==r?n=i=[i,a]:(In=n,n=r)):(In=n,n=r),(t=n!==r?e.substring(t,In):n)===r&&(t=In,n=In,62===e.charCodeAt(In)?(i=">",In++):(i=r,0===Gn&&Hn(Pt)),i!==r?(a=In,Gn++,62===e.charCodeAt(In)?(o=">",In++):(o=r,0===Gn&&Hn(Pt)),Gn--,o===r?a=void 0:(In=a,a=r),a!==r?n=i=[i,a]:(In=n,n=r)):(In=n,n=r),(t=n!==r?e.substring(t,In):n)===r&&(t=In,t=(n=Dr())!==r?e.substring(t,In):n)))),t}function ri(){var e,t,n,i,a,o,u,s;if(e=In,(t=$r())!==r){for(n=[],i=In,(a=Ir())!==r&&(o=ii())!==r&&(u=Ir())!==r&&(s=$r())!==r?i=a=[a,o,u,s]:(In=i,i=r);i!==r;)n.push(i),i=In,(a=Ir())!==r&&(o=ii())!==r&&(u=Ir())!==r&&(s=$r())!==r?i=a=[a,o,u,s]:(In=i,i=r);n!==r?(Pn=e,e=t=Et(t,n)):(In=e,e=r)}else In=e,e=r;return e}function ii(){var t,n,i,a,o;return"<="===e.substr(In,2)?(t="<=",In+=2):(t=r,0===Gn&&Hn(Ot)),t===r&&(">="===e.substr(In,2)?(t=">=",In+=2):(t=r,0===Gn&&Hn(kt)),t===r&&(t=In,n=In,60===e.charCodeAt(In)?(i="<",In++):(i=r,0===Gn&&Hn(It)),i!==r?(a=In,Gn++,60===e.charCodeAt(In)?(o="<",In++):(o=r,0===Gn&&Hn(It)),Gn--,o===r?a=void 0:(In=a,a=r),a!==r?n=i=[i,a]:(In=n,n=r)):(In=n,n=r),(t=n!==r?e.substring(t,In):n)===r&&(t=In,n=In,62===e.charCodeAt(In)?(i=">",In++):(i=r,0===Gn&&Hn(Pt)),i!==r?(a=In,Gn++,62===e.charCodeAt(In)?(o=">",In++):(o=r,0===Gn&&Hn(Pt)),Gn--,o===r?a=void 0:(In=a,a=r),a!==r?n=i=[i,a]:(In=n,n=r)):(In=n,n=r),t=n!==r?e.substring(t,In):n))),t}function ai(){var e,t,n,i,a,o,u,s;if(e=In,(t=ti())!==r){for(n=[],i=In,(a=Ir())!==r&&(o=ui())!==r&&(u=Ir())!==r&&(s=ti())!==r?i=a=[a,o,u,s]:(In=i,i=r);i!==r;)n.push(i),i=In,(a=Ir())!==r&&(o=ui())!==r&&(u=Ir())!==r&&(s=ti())!==r?i=a=[a,o,u,s]:(In=i,i=r);n!==r?(Pn=e,e=t=Et(t,n)):(In=e,e=r)}else In=e,e=r;return e}function oi(){var e,t,n,i,a,o,u,s;if(e=In,(t=ri())!==r){for(n=[],i=In,(a=Ir())!==r&&(o=ui())!==r&&(u=Ir())!==r&&(s=ri())!==r?i=a=[a,o,u,s]:(In=i,i=r);i!==r;)n.push(i),i=In,(a=Ir())!==r&&(o=ui())!==r&&(u=Ir())!==r&&(s=ri())!==r?i=a=[a,o,u,s]:(In=i,i=r);n!==r?(Pn=e,e=t=Et(t,n)):(In=e,e=r)}else In=e,e=r;return e}function ui(){var t;return"==="===e.substr(In,3)?(t="===",In+=3):(t=r,0===Gn&&Hn(jt)),t===r&&("!=="===e.substr(In,3)?(t="!==",In+=3):(t=r,0===Gn&&Hn(Rt)),t===r&&("=="===e.substr(In,2)?(t="==",In+=2):(t=r,0===Gn&&Hn(Nt)),t===r&&("!="===e.substr(In,2)?(t="!=",In+=2):(t=r,0===Gn&&Hn(Gt))))),t}function si(){var e,t,n,i,a,o,u,s;if(e=In,(t=ai())!==r){for(n=[],i=In,(a=Ir())!==r&&(o=fi())!==r&&(u=Ir())!==r&&(s=ai())!==r?i=a=[a,o,u,s]:(In=i,i=r);i!==r;)n.push(i),i=In,(a=Ir())!==r&&(o=fi())!==r&&(u=Ir())!==r&&(s=ai())!==r?i=a=[a,o,u,s]:(In=i,i=r);n!==r?(Pn=e,e=t=Et(t,n)):(In=e,e=r)}else In=e,e=r;return e}function ci(){var e,t,n,i,a,o,u,s;if(e=In,(t=oi())!==r){for(n=[],i=In,(a=Ir())!==r&&(o=fi())!==r&&(u=Ir())!==r&&(s=oi())!==r?i=a=[a,o,u,s]:(In=i,i=r);i!==r;)n.push(i),i=In,(a=Ir())!==r&&(o=fi())!==r&&(u=Ir())!==r&&(s=oi())!==r?i=a=[a,o,u,s]:(In=i,i=r);n!==r?(Pn=e,e=t=Et(t,n)):(In=e,e=r)}else In=e,e=r;return e}function fi(){var t,n,i,a,o;return t=In,n=In,38===e.charCodeAt(In)?(i="&",In++):(i=r,0===Gn&&Hn(Lt)),i!==r?(a=In,Gn++,zt.test(e.charAt(In))?(o=e.charAt(In),In++):(o=r,0===Gn&&Hn(Vt)),Gn--,o===r?a=void 0:(In=a,a=r),a!==r?n=i=[i,a]:(In=n,n=r)):(In=n,n=r),t=n!==r?e.substring(t,In):n}function li(){var e,t,n,i,a,o,u,s;if(e=In,(t=si())!==r){for(n=[],i=In,(a=Ir())!==r&&(o=hi())!==r&&(u=Ir())!==r&&(s=si())!==r?i=a=[a,o,u,s]:(In=i,i=r);i!==r;)n.push(i),i=In,(a=Ir())!==r&&(o=hi())!==r&&(u=Ir())!==r&&(s=si())!==r?i=a=[a,o,u,s]:(In=i,i=r);n!==r?(Pn=e,e=t=Et(t,n)):(In=e,e=r)}else In=e,e=r;return e}function pi(){var e,t,n,i,a,o,u,s;if(e=In,(t=ci())!==r){for(n=[],i=In,(a=Ir())!==r&&(o=hi())!==r&&(u=Ir())!==r&&(s=ci())!==r?i=a=[a,o,u,s]:(In=i,i=r);i!==r;)n.push(i),i=In,(a=Ir())!==r&&(o=hi())!==r&&(u=Ir())!==r&&(s=ci())!==r?i=a=[a,o,u,s]:(In=i,i=r);n!==r?(Pn=e,e=t=Et(t,n)):(In=e,e=r)}else In=e,e=r;return e}function hi(){var t,n,i,a,o;return t=In,n=In,94===e.charCodeAt(In)?(i="^",In++):(i=r,0===Gn&&Hn(Ut)),i!==r?(a=In,Gn++,61===e.charCodeAt(In)?(o="=",In++):(o=r,0===Gn&&Hn(vt)),Gn--,o===r?a=void 0:(In=a,a=r),a!==r?n=i=[i,a]:(In=n,n=r)):(In=n,n=r),t=n!==r?e.substring(t,In):n}function di(){var e,t,n,i,a,o,u,s;if(e=In,(t=li())!==r){for(n=[],i=In,(a=Ir())!==r&&(o=yi())!==r&&(u=Ir())!==r&&(s=li())!==r?i=a=[a,o,u,s]:(In=i,i=r);i!==r;)n.push(i),i=In,(a=Ir())!==r&&(o=yi())!==r&&(u=Ir())!==r&&(s=li())!==r?i=a=[a,o,u,s]:(In=i,i=r);n!==r?(Pn=e,e=t=Et(t,n)):(In=e,e=r)}else In=e,e=r;return e}function mi(){var e,t,n,i,a,o,u,s;if(e=In,(t=pi())!==r){for(n=[],i=In,(a=Ir())!==r&&(o=yi())!==r&&(u=Ir())!==r&&(s=pi())!==r?i=a=[a,o,u,s]:(In=i,i=r);i!==r;)n.push(i),i=In,(a=Ir())!==r&&(o=yi())!==r&&(u=Ir())!==r&&(s=pi())!==r?i=a=[a,o,u,s]:(In=i,i=r);n!==r?(Pn=e,e=t=Et(t,n)):(In=e,e=r)}else In=e,e=r;return e}function yi(){var t,n,i,a,o;return t=In,n=In,124===e.charCodeAt(In)?(i="|",In++):(i=r,0===Gn&&Hn(Wt)),i!==r?(a=In,Gn++,qt.test(e.charAt(In))?(o=e.charAt(In),In++):(o=r,0===Gn&&Hn(Ht)),Gn--,o===r?a=void 0:(In=a,a=r),a!==r?n=i=[i,a]:(In=n,n=r)):(In=n,n=r),t=n!==r?e.substring(t,In):n}function vi(){var e,t,n,i,a,o,u,s;if(e=In,(t=di())!==r){for(n=[],i=In,(a=Ir())!==r&&(o=bi())!==r&&(u=Ir())!==r&&(s=di())!==r?i=a=[a,o,u,s]:(In=i,i=r);i!==r;)n.push(i),i=In,(a=Ir())!==r&&(o=bi())!==r&&(u=Ir())!==r&&(s=di())!==r?i=a=[a,o,u,s]:(In=i,i=r);n!==r?(Pn=e,e=t=Xt(t,n)):(In=e,e=r)}else In=e,e=r;return e}function gi(){var e,t,n,i,a,o,u,s;if(e=In,(t=mi())!==r){for(n=[],i=In,(a=Ir())!==r&&(o=bi())!==r&&(u=Ir())!==r&&(s=mi())!==r?i=a=[a,o,u,s]:(In=i,i=r);i!==r;)n.push(i),i=In,(a=Ir())!==r&&(o=bi())!==r&&(u=Ir())!==r&&(s=mi())!==r?i=a=[a,o,u,s]:(In=i,i=r);n!==r?(Pn=e,e=t=Xt(t,n)):(In=e,e=r)}else In=e,e=r;return e}function bi(){var t;return"&&"===e.substr(In,2)?(t="&&",In+=2):(t=r,0===Gn&&Hn(Kt)),t}function Ai(){var e,t,n,i,a,o,u,s;if(e=In,(t=vi())!==r){for(n=[],i=In,(a=Ir())!==r&&(o=xi())!==r&&(u=Ir())!==r&&(s=vi())!==r?i=a=[a,o,u,s]:(In=i,i=r);i!==r;)n.push(i),i=In,(a=Ir())!==r&&(o=xi())!==r&&(u=Ir())!==r&&(s=vi())!==r?i=a=[a,o,u,s]:(In=i,i=r);n!==r?(Pn=e,e=t=Xt(t,n)):(In=e,e=r)}else In=e,e=r;return e}function Ei(){var e,t,n,i,a,o,u,s;if(e=In,(t=gi())!==r){for(n=[],i=In,(a=Ir())!==r&&(o=xi())!==r&&(u=Ir())!==r&&(s=gi())!==r?i=a=[a,o,u,s]:(In=i,i=r);i!==r;)n.push(i),i=In,(a=Ir())!==r&&(o=xi())!==r&&(u=Ir())!==r&&(s=gi())!==r?i=a=[a,o,u,s]:(In=i,i=r);n!==r?(Pn=e,e=t=Xt(t,n)):(In=e,e=r)}else In=e,e=r;return e}function xi(){var t;return"||"===e.substr(In,2)?(t="||",In+=2):(t=r,0===Gn&&Hn(Yt)),t}function Ci(){var t,n,i,a,o,u;return t=In,(n=Hr())!==r&&Ir()!==r?(61===e.charCodeAt(In)?(i="=",In++):(i=r,0===Gn&&Hn(vt)),i!==r?(a=In,Gn++,61===e.charCodeAt(In)?(o="=",In++):(o=r,0===Gn&&Hn(vt)),Gn--,o===r?a=void 0:(In=a,a=r),a!==r&&(o=Ir())!==r&&(u=Ci())!==r?(Pn=t,t=n=Zt(n,u)):(In=t,t=r)):(In=t,t=r)):(In=t,t=r),t===r&&(t=In,(n=Hr())!==r&&Ir()!==r&&(i=wi())!==r&&(a=Ir())!==r&&(o=Ci())!==r?(Pn=t,t=n=$t(n,i,o)):(In=t,t=r),t===r&&(t=function(){var t,n,i,a,o,u;return t=In,(n=Ai())!==r&&Ir()!==r?(63===e.charCodeAt(In)?(i="?",In++):(i=r,0===Gn&&Hn(Jt)),i!==r&&Ir()!==r&&(a=Ci())!==r&&Ir()!==r?(58===e.charCodeAt(In)?(o=":",In++):(o=r,0===Gn&&Hn(D)),o!==r&&Ir()!==r&&(u=Ci())!==r?(Pn=t,t=n=Qt(n,a,u)):(In=t,t=r)):(In=t,t=r)):(In=t,t=r),t===r&&(t=Ai()),t}())),t}function Si(){var t,n,i,a,o,u;return t=In,(n=Hr())!==r&&Ir()!==r?(61===e.charCodeAt(In)?(i="=",In++):(i=r,0===Gn&&Hn(vt)),i!==r?(a=In,Gn++,61===e.charCodeAt(In)?(o="=",In++):(o=r,0===Gn&&Hn(vt)),Gn--,o===r?a=void 0:(In=a,a=r),a!==r&&(o=Ir())!==r&&(u=Si())!==r?(Pn=t,t=n=Zt(n,u)):(In=t,t=r)):(In=t,t=r)):(In=t,t=r),t===r&&(t=In,(n=Hr())!==r&&Ir()!==r&&(i=wi())!==r&&(a=Ir())!==r&&(o=Si())!==r?(Pn=t,t=n=$t(n,i,o)):(In=t,t=r),t===r&&(t=function(){var t,n,i,a,o,u;return t=In,(n=Ei())!==r&&Ir()!==r?(63===e.charCodeAt(In)?(i="?",In++):(i=r,0===Gn&&Hn(Jt)),i!==r&&Ir()!==r&&(a=Ci())!==r&&Ir()!==r?(58===e.charCodeAt(In)?(o=":",In++):(o=r,0===Gn&&Hn(D)),o!==r&&Ir()!==r&&(u=Si())!==r?(Pn=t,t=n=Qt(n,a,u)):(In=t,t=r)):(In=t,t=r)):(In=t,t=r),t===r&&(t=Ei()),t}())),t}function wi(){var t;return"*="===e.substr(In,2)?(t="*=",In+=2):(t=r,0===Gn&&Hn(en)),t===r&&("/="===e.substr(In,2)?(t="/=",In+=2):(t=r,0===Gn&&Hn(tn)),t===r&&("%="===e.substr(In,2)?(t="%=",In+=2):(t=r,0===Gn&&Hn(nn)),t===r&&("+="===e.substr(In,2)?(t="+=",In+=2):(t=r,0===Gn&&Hn(rn)),t===r&&("-="===e.substr(In,2)?(t="-=",In+=2):(t=r,0===Gn&&Hn(an)),t===r&&("<<="===e.substr(In,3)?(t="<<=",In+=3):(t=r,0===Gn&&Hn(on)),t===r&&(">>="===e.substr(In,3)?(t=">>=",In+=3):(t=r,0===Gn&&Hn(un)),t===r&&(">>>="===e.substr(In,4)?(t=">>>=",In+=4):(t=r,0===Gn&&Hn(sn)),t===r&&("&="===e.substr(In,2)?(t="&=",In+=2):(t=r,0===Gn&&Hn(cn)),t===r&&("^="===e.substr(In,2)?(t="^=",In+=2):(t=r,0===Gn&&Hn(fn)),t===r&&("|="===e.substr(In,2)?(t="|=",In+=2):(t=r,0===Gn&&Hn(ln)))))))))))),t}function Ti(){var t,n,i,a,o,u,s,c;if(t=In,(n=Ci())!==r){for(i=[],a=In,(o=Ir())!==r?(44===e.charCodeAt(In)?(u=",",In++):(u=r,0===Gn&&Hn(rt)),u!==r&&(s=Ir())!==r&&(c=Ci())!==r?a=o=[o,u,s,c]:(In=a,a=r)):(In=a,a=r);a!==r;)i.push(a),a=In,(o=Ir())!==r?(44===e.charCodeAt(In)?(u=",",In++):(u=r,0===Gn&&Hn(rt)),u!==r&&(s=Ir())!==r&&(c=Ci())!==r?a=o=[o,u,s,c]:(In=a,a=r)):(In=a,a=r);i!==r?(Pn=t,t=n=pn(n,i)):(In=t,t=r)}else In=t,t=r;return t}function Di(){var t;return(t=function(){var t,n,i,a,o;t=In,123===e.charCodeAt(In)?(n="{",In++):(n=r,0===Gn&&Hn(ot));n!==r&&Ir()!==r?(i=In,(a=function(){var e,t,n,i,a,o;if(e=In,(t=Di())!==r){for(n=[],i=In,(a=Ir())!==r&&(o=Di())!==r?i=a=[a,o]:(In=i,i=r);i!==r;)n.push(i),i=In,(a=Ir())!==r&&(o=Di())!==r?i=a=[a,o]:(In=i,i=r);n!==r?(Pn=e,t=Hi(t,n,1),e=t):(In=e,e=r)}else In=e,e=r;return e}())!==r&&(o=Ir())!==r?i=a=[a,o]:(In=i,i=r),i===r&&(i=null),i!==r?(125===e.charCodeAt(In)?(a="}",In++):(a=r,0===Gn&&Hn(et)),a!==r?(Pn=t,n={type:"BlockStatement",body:Xi(qi(i,0))},t=n):(In=t,t=r)):(In=t,t=r)):(In=t,t=r);return t}())===r&&(t=function(){var e,t,n;e=In,(t=_r())!==r&&Ir()!==r&&(n=Bi())!==r&&jr()!==r?(Pn=e,e=t={type:"VariableDeclaration",declarations:n,kind:"var"}):(In=e,e=r);e===r&&(e=In,(t=Mr())!==r&&Ir()!==r&&(n=Bi())!==r&&jr()!==r?(Pn=e,t=function(e){return{type:"VariableDeclaration",declarations:e,kind:"let"}}(n),e=t):(In=e,e=r),e===r&&(e=In,(t=Fr())!==r&&Ir()!==r&&(n=Bi())!==r&&jr()!==r?(Pn=e,t=function(e){return{type:"VariableDeclaration",declarations:e,kind:"const"}}(n),e=t):(In=e,e=r)));return e}())===r&&(t=function(){var t,n;t=In,59===e.charCodeAt(In)?(n=";",In++):(n=r,0===Gn&&Hn($e));n!==r&&(Pn=t,n={type:"EmptyStatement"});return t=n}())===r&&(t=function(){var t,n,i;t=In,n=In,Gn++,123===e.charCodeAt(In)?(i="{",In++):(i=r,0===Gn&&Hn(ot));i===r&&(i=Sr());Gn--,i===r?n=void 0:(In=n,n=r);n!==r&&(i=Ti())!==r&&jr()!==r?(Pn=t,t=n={type:"ExpressionStatement",expression:i}):(In=t,t=r);return t}())===r&&(t=function(){var t,n,i,a,o,u,s;t=In,(n=wr())!==r&&Ir()!==r?(40===e.charCodeAt(In)?(i="(",In++):(i=r,0===Gn&&Hn(tt)),i!==r&&Ir()!==r&&(a=Ti())!==r&&Ir()!==r?(41===e.charCodeAt(In)?(o=")",In++):(o=r,0===Gn&&Hn(nt)),o!==r&&Ir()!==r&&(u=Di())!==r&&Ir()!==r&&Er()!==r&&Ir()!==r&&(s=Di())!==r?(Pn=t,t=n={type:"IfStatement",test:a,consequent:u,alternate:s}):(In=t,t=r)):(In=t,t=r)):(In=t,t=r);t===r&&(t=In,(n=wr())!==r&&Ir()!==r?(40===e.charCodeAt(In)?(i="(",In++):(i=r,0===Gn&&Hn(tt)),i!==r&&Ir()!==r&&(a=Ti())!==r&&Ir()!==r?(41===e.charCodeAt(In)?(o=")",In++):(o=r,0===Gn&&Hn(nt)),o!==r&&Ir()!==r&&(u=Di())!==r?(Pn=t,n=function(e,t){return{type:"IfStatement",test:e,consequent:t,alternate:null}}(a,u),t=n):(In=t,t=r)):(In=t,t=r)):(In=t,t=r));return t}())===r&&(t=function(){var t,n,i,a,o,u,s,c,f,l,p,h,d,m,y,v;t=In,(n=Ar())!==r&&Ir()!==r&&(i=Di())!==r&&Ir()!==r&&(a=kr())!==r&&(o=Ir())!==r?(40===e.charCodeAt(In)?(u="(",In++):(u=r,0===Gn&&Hn(tt)),u!==r&&(s=Ir())!==r&&(c=Ti())!==r&&(f=Ir())!==r?(41===e.charCodeAt(In)?(l=")",In++):(l=r,0===Gn&&Hn(nt)),l!==r&&(p=jr())!==r?(Pn=t,t=n={type:"DoWhileStatement",body:i,test:c}):(In=t,t=r)):(In=t,t=r)):(In=t,t=r);t===r&&(t=In,(n=kr())!==r&&Ir()!==r?(40===e.charCodeAt(In)?(i="(",In++):(i=r,0===Gn&&Hn(tt)),i!==r&&Ir()!==r&&(a=Ti())!==r&&(o=Ir())!==r?(41===e.charCodeAt(In)?(u=")",In++):(u=r,0===Gn&&Hn(nt)),u!==r&&(s=Ir())!==r&&(c=Di())!==r?(Pn=t,n=function(e,t){return{type:"WhileStatement",test:e,body:t}}(a,c),t=n):(In=t,t=r)):(In=t,t=r)):(In=t,t=r),t===r&&(t=In,(n=Cr())!==r&&Ir()!==r?(40===e.charCodeAt(In)?(i="(",In++):(i=r,0===Gn&&Hn(tt)),i!==r&&Ir()!==r?(a=In,(o=function(){var t,n,i,a,o,u,s,c;if(t=In,(n=Si())!==r){for(i=[],a=In,(o=Ir())!==r?(44===e.charCodeAt(In)?(u=",",In++):(u=r,0===Gn&&Hn(rt)),u!==r&&(s=Ir())!==r&&(c=Si())!==r?a=o=[o,u,s,c]:(In=a,a=r)):(In=a,a=r);a!==r;)i.push(a),a=In,(o=Ir())!==r?(44===e.charCodeAt(In)?(u=",",In++):(u=r,0===Gn&&Hn(rt)),u!==r&&(s=Ir())!==r&&(c=Si())!==r?a=o=[o,u,s,c]:(In=a,a=r)):(In=a,a=r);i!==r?(Pn=t,t=n=pn(n,i)):(In=t,t=r)}else In=t,t=r;return t}())!==r&&(u=Ir())!==r?a=o=[o,u]:(In=a,a=r),a===r&&(a=null),a!==r?(59===e.charCodeAt(In)?(o=";",In++):(o=r,0===Gn&&Hn($e)),o!==r&&(u=Ir())!==r?(s=In,(c=Ti())!==r&&(f=Ir())!==r?s=c=[c,f]:(In=s,s=r),s===r&&(s=null),s!==r?(59===e.charCodeAt(In)?(c=";",In++):(c=r,0===Gn&&Hn($e)),c!==r&&(f=Ir())!==r?(l=In,(p=Ti())!==r&&(h=Ir())!==r?l=p=[p,h]:(In=l,l=r),l===r&&(l=null),l!==r?(41===e.charCodeAt(In)?(p=")",In++):(p=r,0===Gn&&Hn(nt)),p!==r&&(h=Ir())!==r&&(d=Di())!==r?(Pn=t,n=function(e,t,n,r){return{type:"ForStatement",init:qi(e,0),test:qi(t,0),update:qi(n,0),body:r}}(a,s,l,d),t=n):(In=t,t=r)):(In=t,t=r)):(In=t,t=r)):(In=t,t=r)):(In=t,t=r)):(In=t,t=r)):(In=t,t=r)):(In=t,t=r),t===r&&(t=In,(n=Cr())!==r&&Ir()!==r?(40===e.charCodeAt(In)?(i="(",In++):(i=r,0===Gn&&Hn(tt)),i!==r&&Ir()!==r?((a=Mr())===r&&(a=_r()),a!==r&&(o=Ir())!==r&&(u=_i())!==r&&(s=Ir())!==r?(59===e.charCodeAt(In)?(c=";",In++):(c=r,0===Gn&&Hn($e)),c!==r&&(f=Ir())!==r?(l=In,(p=Ti())!==r&&(h=Ir())!==r?l=p=[p,h]:(In=l,l=r),l===r&&(l=null),l!==r?(59===e.charCodeAt(In)?(p=";",In++):(p=r,0===Gn&&Hn($e)),p!==r&&(h=Ir())!==r?(d=In,(m=Ti())!==r&&(y=Ir())!==r?d=m=[m,y]:(In=d,d=r),d===r&&(d=null),d!==r?(41===e.charCodeAt(In)?(m=")",In++):(m=r,0===Gn&&Hn(nt)),m!==r&&(y=Ir())!==r&&(v=Di())!==r?(Pn=t,n=function(e,t,n,r){return{type:"ForStatement",init:{type:"VariableDeclaration",declarations:e,kind:"var"},test:qi(t,0),update:qi(n,0),body:r}}(u,l,d,v),t=n):(In=t,t=r)):(In=t,t=r)):(In=t,t=r)):(In=t,t=r)):(In=t,t=r)):(In=t,t=r)):(In=t,t=r)):(In=t,t=r),t===r&&(t=In,(n=Cr())!==r&&Ir()!==r?(40===e.charCodeAt(In)?(i="(",In++):(i=r,0===Gn&&Hn(tt)),i!==r&&Ir()!==r&&(a=Hr())!==r&&(o=Ir())!==r&&(u=Dr())!==r&&(s=Ir())!==r&&(c=Ti())!==r&&(f=Ir())!==r?(41===e.charCodeAt(In)?(l=")",In++):(l=r,0===Gn&&Hn(nt)),l!==r&&(p=Ir())!==r&&(h=Di())!==r?(Pn=t,n=function(e,t,n){return{type:"ForInStatement",left:e,right:t,body:n}}(a,c,h),t=n):(In=t,t=r)):(In=t,t=r)):(In=t,t=r),t===r&&(t=In,(n=Cr())!==r&&Ir()!==r?(40===e.charCodeAt(In)?(i="(",In++):(i=r,0===Gn&&Hn(tt)),i!==r&&Ir()!==r?((a=Mr())===r&&(a=_r()),a!==r&&(o=Ir())!==r&&(u=_i())!==r&&(s=Ir())!==r&&(c=Dr())!==r&&(f=Ir())!==r&&(l=Ti())!==r&&(p=Ir())!==r?(41===e.charCodeAt(In)?(h=")",In++):(h=r,0===Gn&&Hn(nt)),h!==r&&(d=Ir())!==r&&(m=Di())!==r?(Pn=t,n=function(e,t,n){return{type:"ForInStatement",left:{type:"VariableDeclaration",declarations:e,kind:"var"},right:t,body:n}}(u,l,m),t=n):(In=t,t=r)):(In=t,t=r)):(In=t,t=r)):(In=t,t=r))))));return t}())===r&&(t=function(){var e,t;e=In,br()!==r&&jr()!==r?(Pn=e,e={type:"ContinueStatement",label:null}):(In=e,e=r);e===r&&(e=In,br()!==r&&Pr()!==r&&(t=nr())!==r&&jr()!==r?(Pn=e,e={type:"ContinueStatement",label:t}):(In=e,e=r));return e}())===r&&(t=function(){var e,t;e=In,vr()!==r&&jr()!==r?(Pn=e,e={type:"BreakStatement",label:null}):(In=e,e=r);e===r&&(e=In,vr()!==r&&Pr()!==r&&(t=nr())!==r&&jr()!==r?(Pn=e,e={type:"BreakStatement",label:t}):(In=e,e=r));return e}())===r&&(t=function(){var e,t;e=In,Br()!==r&&jr()!==r?(Pn=e,e={type:"ReturnStatement",argument:null}):(In=e,e=r);e===r&&(e=In,Br()!==r&&Pr()!==r&&(t=Ti())!==r&&jr()!==r?(Pn=e,e={type:"ReturnStatement",argument:t}):(In=e,e=r));return e}())===r&&(t=function(){var t,n,i,a;t=In,(n=nr())!==r&&Ir()!==r?(58===e.charCodeAt(In)?(i=":",In++):(i=r,0===Gn&&Hn(D)),i!==r&&Ir()!==r&&(a=Di())!==r?(Pn=t,t=n={type:"LabeledStatement",label:n,body:a}):(In=t,t=r)):(In=t,t=r);return t}())===r&&(t=function(){var t,n,i,a,o,u,s,c,f,l,p,h,d;if(t=In,(n=Tr())!==r)if(Ir()!==r)if(123===e.charCodeAt(In)?(i="{",In++):(i=r,0===Gn&&Hn(ot)),i!==r)if(Pr()!==r)if((a=nr())!==r){for(o=[],u=In,(s=Pr())!==r?(44===e.charCodeAt(In)?(c=",",In++):(c=r,0===Gn&&Hn(rt)),c!==r&&(f=Pr())!==r&&(l=nr())!==r?u=s=[s,c,f,l]:(In=u,u=r)):(In=u,u=r);u!==r;)o.push(u),u=In,(s=Pr())!==r?(44===e.charCodeAt(In)?(c=",",In++):(c=r,0===Gn&&Hn(rt)),c!==r&&(f=Pr())!==r&&(l=nr())!==r?u=s=[s,c,f,l]:(In=u,u=r)):(In=u,u=r);o!==r&&(u=Pr())!==r?(125===e.charCodeAt(In)?(s="}",In++):(s=r,0===Gn&&Hn(et)),s!==r&&(c=Pr())!==r?("from"===e.substr(In,4)?(f="from",In+=4):(f=r,0===Gn&&Hn(dn)),f!==r&&(l=Ir())!==r&&(p=lr())!==r&&(h=Pr())!==r?(59===e.charCodeAt(In)?(d=";",In++):(d=r,0===Gn&&Hn($e)),d!==r?(Pn=t,n={type:"ImportDeclaration",source:p,specifiers:Ki(a,o,3).map((function(e){return{type:"ImportSpecifier",local:e}}))},t=n):(In=t,t=r)):(In=t,t=r)):(In=t,t=r)):(In=t,t=r)}else In=t,t=r;else In=t,t=r;else In=t,t=r;else In=t,t=r;else In=t,t=r;t===r&&(t=In,(n=Tr())!==r&&Ir()!==r&&(i=nr())!==r&&Ir()!==r?("from"===e.substr(In,4)?(a="from",In+=4):(a=r,0===Gn&&Hn(dn)),a!==r&&(o=Ir())!==r&&(u=lr())!==r&&(s=Pr())!==r?(59===e.charCodeAt(In)?(c=";",In++):(c=r,0===Gn&&Hn($e)),c!==r?(Pn=t,n=function(e,t){return{type:"ImportDeclaration",source:t,specifiers:[{type:"ImportDefaultSpecifier",local:e}]}}(i,u),t=n):(In=t,t=r)):(In=t,t=r)):(In=t,t=r),t===r&&(t=In,(n=Tr())!==r&&Ir()!==r?(42===e.charCodeAt(In)?(i="*",In++):(i=r,0===Gn&&Hn(xt)),i!==r&&Ir()!==r?("as"===e.substr(In,2)?(a="as",In+=2):(a=r,0===Gn&&Hn(mn)),a!==r&&(o=Ir())!==r&&(u=nr())!==r&&(s=Ir())!==r?("from"===e.substr(In,4)?(c="from",In+=4):(c=r,0===Gn&&Hn(dn)),c!==r&&(f=Ir())!==r&&(l=lr())!==r&&(p=Pr())!==r?(59===e.charCodeAt(In)?(h=";",In++):(h=r,0===Gn&&Hn($e)),h!==r?(Pn=t,n=function(e,t){return{type:"ImportDeclaration",source:t,specifiers:[{type:"ImportNamespaceSpecifier",local:e}]}}(u,l),t=n):(In=t,t=r)):(In=t,t=r)):(In=t,t=r)):(In=t,t=r)):(In=t,t=r)));return t}())===r&&(t=function(){var e,t;e=In,xr()!==r&&Ir()!==r?((t=Oi())===r&&(t=Ri()),t!==r?(Pn=e,e={type:"ExportDefaultDeclaration",declaration:t}):(In=e,e=r)):(In=e,e=r);return e}()),t}function Bi(){var t,n,i,a,o,u,s,c;if(t=In,(n=Mi())!==r){for(i=[],a=In,(o=Ir())!==r?(44===e.charCodeAt(In)?(u=",",In++):(u=r,0===Gn&&Hn(rt)),u!==r&&(s=Ir())!==r&&(c=Mi())!==r?a=o=[o,u,s,c]:(In=a,a=r)):(In=a,a=r);a!==r;)i.push(a),a=In,(o=Ir())!==r?(44===e.charCodeAt(In)?(u=",",In++):(u=r,0===Gn&&Hn(rt)),u!==r&&(s=Ir())!==r&&(c=Mi())!==r?a=o=[o,u,s,c]:(In=a,a=r)):(In=a,a=r);i!==r?(Pn=t,t=n=st(n,i)):(In=t,t=r)}else In=t,t=r;return t}function _i(){var t,n,i,a,o,u,s,c;if(t=In,(n=Fi())!==r){for(i=[],a=In,(o=Ir())!==r?(44===e.charCodeAt(In)?(u=",",In++):(u=r,0===Gn&&Hn(rt)),u!==r&&(s=Ir())!==r&&(c=Fi())!==r?a=o=[o,u,s,c]:(In=a,a=r)):(In=a,a=r);a!==r;)i.push(a),a=In,(o=Ir())!==r?(44===e.charCodeAt(In)?(u=",",In++):(u=r,0===Gn&&Hn(rt)),u!==r&&(s=Ir())!==r&&(c=Fi())!==r?a=o=[o,u,s,c]:(In=a,a=r)):(In=a,a=r);i!==r?(Pn=t,t=n=st(n,i)):(In=t,t=r)}else In=t,t=r;return t}function Mi(){var t,n,i,a,o;return t=In,(n=nr())!==r?(i=In,(a=Ir())!==r&&(o=function(){var t,n,i,a,o;t=In,61===e.charCodeAt(In)?(n="=",In++):(n=r,0===Gn&&Hn(vt));n!==r?(i=In,Gn++,61===e.charCodeAt(In)?(a="=",In++):(a=r,0===Gn&&Hn(vt)),Gn--,a===r?i=void 0:(In=i,i=r),i!==r&&(a=Ir())!==r&&(o=Ci())!==r?(Pn=t,t=n=o):(In=t,t=r)):(In=t,t=r);return t}())!==r?i=a=[a,o]:(In=i,i=r),i===r&&(i=null),i!==r?(Pn=t,t=n=hn(n,i)):(In=t,t=r)):(In=t,t=r),t}function Fi(){var t,n,i,a,o;return t=In,(n=nr())!==r?(i=In,(a=Ir())!==r&&(o=function(){var t,n,i,a,o;t=In,61===e.charCodeAt(In)?(n="=",In++):(n=r,0===Gn&&Hn(vt));n!==r?(i=In,Gn++,61===e.charCodeAt(In)?(a="=",In++):(a=r,0===Gn&&Hn(vt)),Gn--,a===r?i=void 0:(In=i,i=r),i!==r&&(a=Ir())!==r&&(o=Si())!==r?(Pn=t,t=n=o):(In=t,t=r)):(In=t,t=r);return t}())!==r?i=a=[a,o]:(In=i,i=r),i===r&&(i=null),i!==r?(Pn=t,t=n=hn(n,i)):(In=t,t=r)):(In=t,t=r),t}function Oi(){var t,n,i,a,o,u,s,c,f,l,p,h,d,m;return t=In,Sr()!==r&&Ir()!==r&&(n=nr())!==r&&Ir()!==r?(40===e.charCodeAt(In)?(i="(",In++):(i=r,0===Gn&&Hn(tt)),i!==r&&Ir()!==r?(a=In,(o=Pi())!==r&&(u=Ir())!==r?a=o=[o,u]:(In=a,a=r),a===r&&(a=null),a!==r?(41===e.charCodeAt(In)?(o=")",In++):(o=r,0===Gn&&Hn(nt)),o!==r&&(u=Ir())!==r?(s=In,(c=Ir())!==r?(58===e.charCodeAt(In)?(f=":",In++):(f=r,0===Gn&&Hn(D)),f!==r&&(l=Ir())!==r&&(p=Vi())!==r&&(h=Ir())!==r?s=c=[c,f,l,p,h]:(In=s,s=r)):(In=s,s=r),s===r&&(s=null),s!==r?(123===e.charCodeAt(In)?(c="{",In++):(c=r,0===Gn&&Hn(ot)),c!==r&&(f=Ir())!==r&&(l=ji())!==r&&(p=Ir())!==r?(125===e.charCodeAt(In)?(h="}",In++):(h=r,0===Gn&&Hn(et)),h!==r?(Pn=t,d=s,m=l,t={type:"FunctionDeclaration",id:n,params:Xi(qi(a,0)),body:m,returnType:Xi(qi(d,3)).join("")}):(In=t,t=r)):(In=t,t=r)):(In=t,t=r)):(In=t,t=r)):(In=t,t=r)):(In=t,t=r)):(In=t,t=r),t}function ki(){var t,n,i,a,o,u,s,c,f,l,p,h,d,m,y,v,g;return t=In,(n=Sr())===r&&(n=null),n!==r&&Ir()!==r?(i=In,(a=nr())!==r&&(o=Ir())!==r?i=a=[a,o]:(In=i,i=r),i===r&&(i=null),i!==r?(40===e.charCodeAt(In)?(a="(",In++):(a=r,0===Gn&&Hn(tt)),a!==r&&(o=Ir())!==r?(u=In,(s=Pi())!==r&&(c=Ir())!==r?u=s=[s,c]:(In=u,u=r),u===r&&(u=null),u!==r?(41===e.charCodeAt(In)?(s=")",In++):(s=r,0===Gn&&Hn(nt)),s!==r&&(c=Ir())!==r?(f=In,(l=Ir())!==r?(58===e.charCodeAt(In)?(p=":",In++):(p=r,0===Gn&&Hn(D)),p!==r&&(h=Ir())!==r&&(d=Vi())!==r&&(m=Ir())!==r?f=l=[l,p,h,d,m]:(In=f,f=r)):(In=f,f=r),f===r&&(f=null),f!==r?(123===e.charCodeAt(In)?(l="{",In++):(l=r,0===Gn&&Hn(ot)),l!==r&&(p=Ir())!==r&&(h=ji())!==r&&(d=Ir())!==r?(125===e.charCodeAt(In)?(m="}",In++):(m=r,0===Gn&&Hn(et)),m!==r?(Pn=t,y=u,v=f,g=h,t=n={type:"FunctionExpression",id:qi(i,0),params:Xi(qi(y,0)),body:g,returnType:Xi(qi(v,3)).join("")}):(In=t,t=r)):(In=t,t=r)):(In=t,t=r)):(In=t,t=r)):(In=t,t=r)):(In=t,t=r)):(In=t,t=r)):(In=t,t=r),t}function Ii(){var e,t,n,i;return e=In,(t=zi())!==r&&(n=nr())!==r?(Pn=e,i=t,e=t=ce(ce({},n),{},{decorators:i})):(In=e,e=r),e}function Pi(){var t,n,i,a,o,u,s,c;if(t=In,(n=Ii())!==r){for(i=[],a=In,(o=Ir())!==r?(44===e.charCodeAt(In)?(u=",",In++):(u=r,0===Gn&&Hn(rt)),u!==r&&(s=Ir())!==r&&(c=Ii())!==r?a=o=[o,u,s,c]:(In=a,a=r)):(In=a,a=r);a!==r;)i.push(a),a=In,(o=Ir())!==r?(44===e.charCodeAt(In)?(u=",",In++):(u=r,0===Gn&&Hn(rt)),u!==r&&(s=Ir())!==r&&(c=Ii())!==r?a=o=[o,u,s,c]:(In=a,a=r)):(In=a,a=r);i!==r?(Pn=t,t=n=st(n,i)):(In=t,t=r)}else In=t,t=r;return t}function ji(){var e,t;return e=In,(t=Gi())===r&&(t=null),t!==r&&(Pn=e,t={type:"BlockStatement",body:Xi(t)}),e=t}function Ri(){var t,n,i,a,o,u;return t=In,(n=zi())!==r&&gr()!==r&&Ir()!==r&&(i=nr())!==r&&Ir()!==r?(123===e.charCodeAt(In)?(a="{",In++):(a=r,0===Gn&&Hn(ot)),a!==r&&Ir()!==r&&(o=function(){var e,t;e=In,(t=function(){var e,t,n,i,a,o;if(e=In,(t=Ni())!==r){for(n=[],i=In,(a=Ir())!==r&&(o=Ni())!==r?i=a=[a,o]:(In=i,i=r);i!==r;)n.push(i),i=In,(a=Ir())!==r&&(o=Ni())!==r?i=a=[a,o]:(In=i,i=r);n!==r?(Pn=e,t=yn(t,n),e=t):(In=e,e=r)}else In=e,e=r;return e}())===r&&(t=null);t!==r&&(Pn=e,t={type:"ClassBody",body:Xi(t)});return e=t}())!==r&&Ir()!==r?(125===e.charCodeAt(In)?(u="}",In++):(u=r,0===Gn&&Hn(et)),u!==r?(Pn=t,t=n={type:"ClassDeclaration",id:i,body:o,decorators:n}):(In=t,t=r)):(In=t,t=r)):(In=t,t=r),t}function Ni(){var e;return(e=function(){var e,t,n;e=In,(t=zi())!==r&&(n=nr())!==r&&jr()!==r?(Pn=e,e=t={type:"ClassProperty",key:n,decorators:t}):(In=e,e=r);return e}())===r&&(e=function(){var e,t,n;e=In,(t=zi())!==r&&(n=ki())!==r?(Pn=e,e=t={type:"MethodDefinition",value:n,decorators:t}):(In=e,e=r);return e}()),e}function Gi(){var e,t,n,i,a,o;if(e=In,(t=Li())!==r){for(n=[],i=In,(a=Ir())!==r&&(o=Li())!==r?i=a=[a,o]:(In=i,i=r);i!==r;)n.push(i),i=In,(a=Ir())!==r&&(o=Li())!==r?i=a=[a,o]:(In=i,i=r);n!==r?(Pn=e,e=t=yn(t,n)):(In=e,e=r)}else In=e,e=r;return e}function Li(){var e;return(e=Di())===r&&(e=Oi())===r&&(e=Ri()),e}function zi(){var t,n,i,a,o,u;for(t=In,n=[],i=In,64===e.charCodeAt(In)?(a="@",In++):(a=r,0===Gn&&Hn(vn)),a!==r&&(o=Ti())!==r&&(u=Ir())!==r?i=a=[a,o,u]:(In=i,i=r);i!==r;)n.push(i),i=In,64===e.charCodeAt(In)?(a="@",In++):(a=r,0===Gn&&Hn(vn)),a!==r&&(o=Ti())!==r&&(u=Ir())!==r?i=a=[a,o,u]:(In=i,i=r);return n!==r&&(Pn=t,n=n.map((function(e){return{type:"Decorator",expression:e[1]}}))),t=n}function Vi(){var t;return(t=function(){var t,n,i,a;return t=In,"float"===e.substr(In,5)?(n="float",In+=5):(n=r,0===Gn&&Hn(gn)),n!==r?(i=In,Gn++,a=ar(),Gn--,a===r?i=void 0:(In=i,i=r),i!==r?t=n=[n,i]:(In=t,t=r)):(In=t,t=r),t}())===r&&(t=function(){var t,n,i,a;return t=In,"int"===e.substr(In,3)?(n="int",In+=3):(n=r,0===Gn&&Hn(bn)),n!==r?(i=In,Gn++,a=ar(),Gn--,a===r?i=void 0:(In=i,i=r),i!==r?t=n=[n,i]:(In=t,t=r)):(In=t,t=r),t}())===r&&(t=function(){var t,n,i,a;return t=In,"uint"===e.substr(In,4)?(n="uint",In+=4):(n=r,0===Gn&&Hn(An)),n!==r?(i=In,Gn++,a=ar(),Gn--,a===r?i=void 0:(In=i,i=r),i!==r?t=n=[n,i]:(In=t,t=r)):(In=t,t=r),t}())===r&&(t=function(){var t,n,i,a;return t=In,"bool"===e.substr(In,4)?(n="bool",In+=4):(n=r,0===Gn&&Hn(En)),n!==r?(i=In,Gn++,a=ar(),Gn--,a===r?i=void 0:(In=i,i=r),i!==r?t=n=[n,i]:(In=t,t=r)):(In=t,t=r),t}())===r&&(t=function(){var t,n,i,a;return t=In,"vec2"===e.substr(In,4)?(n="vec2",In+=4):(n=r,0===Gn&&Hn(xn)),n!==r?(i=In,Gn++,a=ar(),Gn--,a===r?i=void 0:(In=i,i=r),i!==r?t=n=[n,i]:(In=t,t=r)):(In=t,t=r),t}())===r&&(t=function(){var t,n,i,a;return t=In,"vec3"===e.substr(In,4)?(n="vec3",In+=4):(n=r,0===Gn&&Hn(Cn)),n!==r?(i=In,Gn++,a=ar(),Gn--,a===r?i=void 0:(In=i,i=r),i!==r?t=n=[n,i]:(In=t,t=r)):(In=t,t=r),t}())===r&&(t=function(){var t,n,i,a;return t=In,"vec4"===e.substr(In,4)?(n="vec4",In+=4):(n=r,0===Gn&&Hn(Sn)),n!==r?(i=In,Gn++,a=ar(),Gn--,a===r?i=void 0:(In=i,i=r),i!==r?t=n=[n,i]:(In=t,t=r)):(In=t,t=r),t}())===r&&(t=function(){var t,n,i,a;return t=In,"bvec2"===e.substr(In,5)?(n="bvec2",In+=5):(n=r,0===Gn&&Hn(wn)),n!==r?(i=In,Gn++,a=ar(),Gn--,a===r?i=void 0:(In=i,i=r),i!==r?t=n=[n,i]:(In=t,t=r)):(In=t,t=r),t}())===r&&(t=function(){var t,n,i,a;return t=In,"bvec3"===e.substr(In,5)?(n="bvec3",In+=5):(n=r,0===Gn&&Hn(Tn)),n!==r?(i=In,Gn++,a=ar(),Gn--,a===r?i=void 0:(In=i,i=r),i!==r?t=n=[n,i]:(In=t,t=r)):(In=t,t=r),t}())===r&&(t=function(){var t,n,i,a;return t=In,"bvec4"===e.substr(In,5)?(n="bvec4",In+=5):(n=r,0===Gn&&Hn(Dn)),n!==r?(i=In,Gn++,a=ar(),Gn--,a===r?i=void 0:(In=i,i=r),i!==r?t=n=[n,i]:(In=t,t=r)):(In=t,t=r),t}())===r&&(t=function(){var t,n,i,a;return t=In,"ivec2"===e.substr(In,5)?(n="ivec2",In+=5):(n=r,0===Gn&&Hn(Bn)),n!==r?(i=In,Gn++,a=ar(),Gn--,a===r?i=void 0:(In=i,i=r),i!==r?t=n=[n,i]:(In=t,t=r)):(In=t,t=r),t}())===r&&(t=function(){var t,n,i,a;return t=In,"ivec3"===e.substr(In,5)?(n="ivec3",In+=5):(n=r,0===Gn&&Hn(_n)),n!==r?(i=In,Gn++,a=ar(),Gn--,a===r?i=void 0:(In=i,i=r),i!==r?t=n=[n,i]:(In=t,t=r)):(In=t,t=r),t}())===r&&(t=function(){var t,n,i,a;return t=In,"ivec4"===e.substr(In,5)?(n="ivec4",In+=5):(n=r,0===Gn&&Hn(Mn)),n!==r?(i=In,Gn++,a=ar(),Gn--,a===r?i=void 0:(In=i,i=r),i!==r?t=n=[n,i]:(In=t,t=r)):(In=t,t=r),t}())===r&&(t=function(){var t,n,i,a;return t=In,"mat3"===e.substr(In,4)?(n="mat3",In+=4):(n=r,0===Gn&&Hn(On)),n!==r?(i=In,Gn++,a=ar(),Gn--,a===r?i=void 0:(In=i,i=r),i!==r?t=n=[n,i]:(In=t,t=r)):(In=t,t=r),t}())===r&&(t=function(){var t,n,i,a;return t=In,"mat4"===e.substr(In,4)?(n="mat4",In+=4):(n=r,0===Gn&&Hn(kn)),n!==r?(i=In,Gn++,a=ar(),Gn--,a===r?i=void 0:(In=i,i=r),i!==r?t=n=[n,i]:(In=t,t=r)):(In=t,t=r),t}())===r&&(t=function(){var t,n,i,a;return t=In,"image2D"===e.substr(In,7)?(n="image2D",In+=7):(n=r,0===Gn&&Hn(Fn)),n!==r?(i=In,Gn++,a=ar(),Gn--,a===r?i=void 0:(In=i,i=r),i!==r?t=n=[n,i]:(In=t,t=r)):(In=t,t=r),t}()),t}var Ui={CallExpression:"callee",MemberExpression:"object"};function Wi(e){if(e instanceof Array){for(var t="",n=0;n<e.length;n++)t+=Wi(e[n]);return t}return e||""}function qi(e,t){return e?e[t]:null}function Hi(e,t,n){return[e].concat(function(e,t){return e.map((function(e){return e[t]}))}(t,n))}function Xi(e){return null!==e?e:[]}function Ki(e,t,n){return t?[e].concat(t.map((function(e){return e[n]}))):[e]}if((n=a())!==r&&In===e.length)return n;throw n!==r&&In<e.length&&Hn({type:"end"}),Xn(Nn,Rn<e.length?e.charAt(Rn):null,Rn<e.length?qn(Rn,Rn+1):qn(Rn,Rn))},ye=function(){function e(){m()(this,e),this.bufferBindingIndex=-1}return v()(e,[{key:"generateShaderCode",value:function(e,t){return this.bufferBindingIndex=-1,"\n#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n#else\n precision mediump float;\n#endif\n".concat(this.generateDefines(e),"\n").concat(this.generateUniforms(e),"\n").concat(Q[F.WebGL],"\n").concat(this.generateDataTextureGetters(e),"\nuniform vec2 u_OutputTextureSize;\nuniform int u_OutputTexelCount;\nvarying vec2 v_TexCoord;\n\n").concat(t,"\n ").replace(/this\./g,"")}},{key:"generateDefines",value:function(e){return e.defines.filter((function(e){return!e.runtime})).map((function(e){return"#define ".concat(e.name," ").concat(e.value)})).join("\n")}},{key:"generateUniforms",value:function(e){return e.uniforms.map((function(e){return"uniform ".concat(e.type," ").concat(e.name,";")})).join("\n").trim()}},{key:"generateDataTextureGetters",value:function(e){var t=this;return e.uniforms.filter((function(e){return"sampler2D"===e.type})).map((function(e){var n=e.name,r=e.format.replace("[]","");return"\nuniform vec2 ".concat(n,"Size;\n").concat(r," getData").concat(n,"(vec2 address2D) {\n return ").concat(r,"(texture2D(").concat(n,", address2D)").concat(t.generateSwizzling(r),");\n}\n").concat(r," getData").concat(n,"(float address1D) {\n return getData").concat(n,"(addrTranslation_1Dto2D(address1D, ").concat(n,"Size));\n}\n").concat(r," getData").concat(n,"(int address1D) {\n return getData").concat(n,"(float(address1D));\n}\n")})).join("\n")}},{key:"generateSwizzling",value:function(e){return e.endsWith("ec3")?".rgb":e.endsWith("ec2")?".rg":e.endsWith("ec4")?".rgba":".r"}}]),e}(),ve=function(){function e(){m()(this,e),this.bufferBindingIndex=-1}return v()(e,[{key:"generateShaderCode",value:function(e,t){return this.bufferBindingIndex=-1,"\n".concat(this.generateWorkGroups(e),"\n").concat(this.generateDefines(e),"\n").concat(this.generateUniforms(e),"\n").concat(this.generateBuffers(e),"\n").concat(this.generateGlobalVariableDeclarations(e),"\n").concat(t,"\n").replace(/this\./g,"")}},{key:"generateWorkGroups",value:function(e){return"layout (\n local_size_x = ".concat(e.threadGroupSize[0],",\n local_size_y = ").concat(e.threadGroupSize[1],",\n local_size_z = ").concat(e.threadGroupSize[2],"\n) in;\n")}},{key:"generateDefines",value:function(e){return e.defines.filter((function(e){return!e.runtime})).map((function(e){return"#define ".concat(e.name," ").concat(e.value)})).join("\n")}},{key:"generateUniforms",value:function(t){var n=t.uniforms.map((function(e){return"image2D"!==e.type&&"sampler2D"!==e.type?"".concat(e.type," ").concat(e.name,";"):""})).join("\n ").trim();return n&&"layout(std140, set = 0, binding = ".concat(++this.bufferBindingIndex,") uniform GWebGPUParams {\n ").concat(n,"\n} ").concat(e.GWEBGPU_UNIFORM_PARAMS,";")}},{key:"generateBuffers",value:function(t){var n=this,r=-1;return t.uniforms.map((function(t){return"sampler2D"===t.type?(r++,"layout(std430, set = 0, binding = ".concat(++n.bufferBindingIndex,") buffer ").concat(t.readonly?"readonly":""," ").concat(t.writeonly?"writeonly":""," GWebGPUBuffer").concat(r," {\n ").concat(t.format.replace("[]","")," ").concat(t.name,"[];\n} ").concat(e.GWEBGPU_BUFFER).concat(r,";\n")):"image2D"===t.type?"layout(set = 0, binding = ".concat(++n.bufferBindingIndex,") uniform texture2D ").concat(t.name,";\nlayout(set = 0, binding = ").concat(++n.bufferBindingIndex,") uniform sampler ").concat(t.name,"Sampler;\n"):""})).join("\n")}},{key:"generateGlobalVariableDeclarations",value:function(e){return"\nivec3 globalInvocationID = ivec3(gl_GlobalInvocationID);\nivec3 workGroupSize = ivec3(gl_WorkGroupSize);\nivec3 workGroupID = ivec3(gl_WorkGroupID);\nivec3 localInvocationID = ivec3(gl_LocalInvocationID);\nivec3 numWorkGroups = ivec3(gl_NumWorkGroups);\nint localInvocationIndex = int(gl_LocalInvocationIndex);\n".concat(e.globalDeclarations.map((function(e){return"".concat(e.shared?"shared":""," ").concat(e.type.replace("[]","")," ").concat(e.name,"[").concat(e.value,"];")})).join("\n"),"\n")}}]),e}();function ge(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return be(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return be(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return o=e.done,e},e:function(e){u=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(u)throw a}}}}function be(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}ve.GWEBGPU_UNIFORM_PARAMS="gWebGPUUniformParams",ve.GWEBGPU_BUFFER="gWebGPUBuffer",function(e){e.In="in",e.Out="out",e.Shared="shared"}(pe||(pe={})),function(e){e[e.Function=0]="Function",e[e.Variable=1]="Variable"}(he||(he={})),function(e){e.WebGPU="WebGPU",e.WebGL="WebGL"}(de||(de={}));var Ae,Ee,xe,Ce,Se,we,Te,De=function(){function e(){var t;m()(this,e),this.target=de.WebGL,this.glslContext={name:"",dispatch:[1,1,1],threadGroupSize:[1,1,1],maxIteration:1,defines:[],uniforms:[],globalDeclarations:[],output:{name:""}},this.generators=(t={},c()(t,de.WebGPU,new ve),c()(t,de.WebGL,new ye),t)}return v()(e,[{key:"setTarget",value:function(e){this.target=e}},{key:"getGLSLContext",value:function(){return this.glslContext}},{key:"parse",value:function(e){try{return me(e)}catch(e){throw console.error("[Parse error]:",e),e}}},{key:"generateCode",value:function(e){var t,n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.glslContext.maxIteration=r.maxIteration||1,this.glslContext.dispatch=r.dispatch||[1,1,1];var i="",a={parent:null,variables:[],children:[]};return e.body.forEach((function(e){if(e.type===D.ClassDeclaration){var t={parent:a,variables:[{name:"globalInvocationID",alias:[],typeAnnotation:"ivec3"},{name:"workGroupSize",alias:[],typeAnnotation:"ivec3"},{name:"workGroupID",alias:[],typeAnnotation:"ivec3"},{name:"localInvocationID",alias:[],typeAnnotation:"ivec3"},{name:"localInvocationIndex",alias:[],typeAnnotation:"int"},{name:"numWorkGroups",alias:[],typeAnnotation:"ivec3"},{name:"imageLoad",alias:[],type:he.Function,typeAnnotation:"vec4"}],children:[]};a.children.push(t),i+=n.compileClassDeclaration(e,t)}else e.type===D.ImportDeclaration?n.compileImportDeclaration(e,a):e.type===D.VariableDeclaration?n.compileVariableDeclaration(e,a):e.type===D.FunctionDeclaration&&(i+=n.compileFunctionExpression(e,a))})),null===(t=r.bindings)||void 0===t||t.forEach((function(e){var t=e.name,r=e.data;t===t.toUpperCase()&&H()(Number(r))&&n.glslContext.defines.push({name:t,value:r,runtime:!0})})),this.glslContext.uniforms.forEach((function(e){var t,i;if(e.data=null===(t=r.bindings)||void 0===t||null===(i=t.find((function(t){return t.name===e.name})))||void 0===i?void 0:i.data,!e.data)if("sampler2D"===e.type){var a=1;e.format.endsWith("ec4[]")?a=4:e.format.endsWith("ec3[]")?a=3:e.format.endsWith("ec2[]")&&(a=2),e.data=new Float32Array(n.glslContext.output.length*a).fill(0)}else"image2D"===e.type&&(buffer.data=new Uint8ClampedArray(context.output.length).fill(0))})),this.generators[this.target].generateShaderCode(this.glslContext,i)}},{key:"clear",value:function(){this.glslContext={name:"",dispatch:[1,1,1],threadGroupSize:[1,1,1],maxIteration:1,defines:[],uniforms:[],globalDeclarations:[],output:{name:""}}}},{key:"compileImportDeclaration",value:function(e,t){var n=this;return e.specifiers.map((function(e){if(e.type===D.ImportSpecifier){var r=Z[n.target][e.local.name];if(r){var i=r.content,a=r.returnType;return t.variables.push({name:e.local.name,alias:[],type:he.Function,typeAnnotation:a}),i}}})).join("\n")}},{key:"compileClassDeclaration",value:function(e,t){var n,r,i=this;return this.glslContext.name=(null==e||null===(n=e.id)||void 0===n?void 0:n.name)||"",null===(r=e.decorators)||void 0===r||r.forEach((function(e){e.expression.type===D.CallExpression&&e.expression.callee.type===D.Identifier&&"numthreads"===e.expression.callee.name&&(i.glslContext.threadGroupSize=e.expression.arguments.slice(0,3).map((function(e){return e.type===D.Literal&&Number(e.value)||1})))})),e.body.type===D.ClassBody?(e.body.body.filter((function(e){return e.type===D.ClassProperty})).forEach((function(e){if(e.key.type===D.Identifier){var n=e.key.typeAnnotation||"float",r=n;r.endsWith("[]")&&(r="sampler2D"),t.variables.push({name:e.key.name,alias:[],typeAnnotation:r}),e.decorators&&i.analyzeDecorators(e.key.name,r,n,e.decorators)}})),e.body.body.filter((function(e){return e.type===D.MethodDefinition})).map((function(e){var n="";if(e.value.type===D.FunctionExpression){if(e.decorators&&1===e.decorators.length&&(e.value.returnType="void",e.value.params=[],e.value.id.name="main",i.target===de.WebGL)){var r=V()(i.glslContext.threadGroupSize,3),a=r[0],o=r[1],u=r[2],s=V()(i.glslContext.dispatch,3),c=s[0],f=s[1],l=s[2];n="\nivec3 workGroupSize = ivec3(".concat(a,", ").concat(o,", ").concat(u,");\nivec3 numWorkGroups = ivec3(").concat(c,", ").concat(f,", ").concat(l,"); \nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\n")}return i.compileFunctionExpression(e.value,t,n)}})).join("\n")):""}},{key:"compileFunctionExpression",value:function(e,t,n){var r,i,a;return null===(r=t.parent)||void 0===r||r.variables.push({name:"".concat(null===(i=e.id)||void 0===i?void 0:i.name),alias:[],type:he.Function,typeAnnotation:"".concat(e.returnType)}),e.params.forEach((function(e){t.variables.push({name:e.type===D.Identifier&&e.name||"",alias:[],typeAnnotation:e.type===D.Identifier&&e.typeAnnotation||""})})),e.body?"".concat(e.returnType||"void"," ").concat(null===(a=e.id)||void 0===a?void 0:a.name,"(").concat((e.params||[]).map((function(e){return e.type===D.Identifier&&"".concat(e.typeAnnotation," ").concat(e.name)})).join(","),") {").concat(n||"","\n").concat(this.compileBlockStatement(e.body,t),"}"):""}},{key:"compileBlockStatement",value:function(e,t){var n=this;return e.body.map((function(e){return e.type===D.VariableDeclaration?n.compileVariableDeclaration(e,t):e.type===D.ExpressionStatement?n.compileExpression(e.expression,t,"",!1)+";":e.type===D.ReturnStatement?n.compileReturnStatement(e,t):e.type===D.IfStatement?n.compileIfStatement(e,t):e.type===D.ForStatement?n.compileForStatement(e,t):e.type===D.BreakStatement?"break;":e.type===D.ContinueStatement?"continue;":""})).join("\n")}},{key:"compileExpression",value:function(e,t,n,r){var i=this;if(e.type===D.AssignmentExpression||e.type===D.LogicalExpression||e.type===D.BinaryExpression){var a=n||this.inferTypeByExpression(e.left,t);this.target===de.WebGL&&this.isReferringDataTexture(e.left)&&(a="vec4");var o=this.compileExpression(e.right,t,a,!1);a&&X.indexOf(a)>-1&&(o="".concat(a,"(").concat(o,")"));var u=e.type===D.BinaryExpression;return"".concat(u?"(":"").concat(this.compileExpression(e.left,t,a,!0)," ").concat(e.operator," ").concat(o).concat(u?")":"")}if(e.type===D.UpdateExpression)return e.prefix?"".concat(e.operator).concat(e.argument.name):"".concat(e.argument.name).concat(e.operator);if(e.type===D.SequenceExpression)return e.expressions.map((function(e){return i.compileExpression(e,t,n,r)})).join("");if(e.type===D.CallExpression){if(this.target===de.WebGPU&&e.callee.type===D.Identifier&&"imageLoad"===e.callee.name){var s=e.arguments[0].type===D.MemberExpression&&e.arguments[0].property.type===D.Identifier&&e.arguments[0].property.name||"";return s&&"texture(sampler2D(".concat(s,", ").concat(s,"Sampler), ").concat(this.compileExpression(e.arguments[1],t,"vec2",!1),")")||""}return"".concat(this.compileExpression(e.callee,t,"",r),"(").concat(e.arguments.map((function(e){return e.type===D.CallExpression?i.compileExpression(e,t,"",!1):i.compileExpression(e,t,n,!1)})).join(","),")")}if(e.type===D.MemberExpression){if(e.object.type===D.MemberExpression)return this.target===de.WebGL&&this.isReferringDataTexture(e)?r?"gl_FragColor":this.compileExpression({type:D.CallExpression,callee:{type:D.Identifier,name:"getData".concat(e.object.property.type===D.Identifier&&e.object.property.name||""),typeAnnotation:""},arguments:[e.property]},t,"",r):"".concat(this.compileExpression(e.object,t,n,r)).concat(e.computed?"[":".").concat(this.compileExpression(e.property,t,"uint",r)).concat(e.computed?"]":"");if(e.object.type===D.Identifier){var c=e.object.name;if("this"===c&&e.property.type===D.Identifier){c=e.property.name;var f=this.findAliasVariableName(c,t);if(f)if(this.isDataTexture(f)){if(this.target===de.WebGPU){var l=this.glslContext.uniforms.filter((function(e){return"sampler2D"===e.type})).findIndex((function(e){return e.name===f}));if(l>-1)return"".concat(ve.GWEBGPU_BUFFER).concat(l,".").concat(f)}}else if(this.target===de.WebGPU)if(this.glslContext.uniforms.filter((function(e){return"sampler2D"!==e.type&&"image2D"!==e.type})).find((function(e){return e.name===f})))return"".concat(ve.GWEBGPU_UNIFORM_PARAMS,".").concat(f)}}return e.property.type===D.Identifier?e.computed?"".concat(e.object.name,"[").concat(e.property.name,"]"):"".concat(e.object.name,".").concat(e.property.name):e.property.type===D.Literal&&H()(Number(e.property.value))?"".concat(e.object.name,"[").concat(e.property.value,"]"):"".concat(e.object.name,"[").concat(this.compileExpression(e.property,t,"uint",r),"]")}if(e.type===D.ConditionalExpression)return"(".concat(this.compileExpression(e.test,t,"",!1),") ? (").concat(this.compileExpression(e.consequent,t,n,!1),") : (").concat(this.compileExpression(e.alternate,t,n,!1),")");if(e.type===D.UnaryExpression)return"".concat(e.operator,"(").concat(this.compileExpression(e.argument,t,n,r),")");if(e.type===D.ArrayExpression){var p=n||this.inferTypeByExpression(e,t);if(p){var h="v"===p[0]?"float":"number";return"".concat(p,"(").concat(e.elements.map((function(e){return i.compileExpression(e,t,h,r)})).join(","),")")}}else{if(e.type===D.Identifier)return e.name;if(e.type===D.Literal)return"float"===n?this.wrapFloat("".concat(e.value)):"".concat(e.value)}return""}},{key:"compileVariableDeclaration",value:function(e,t){var n=this;return e.declarations.map((function(r){var i,a,o=r.id;if(null===t.parent&&"const"===e.kind&&o.name===o.name.toUpperCase())return(null==r||null===(i=r.init)||void 0===i?void 0:i.type)===D.Literal&&null!==r.init.value&&H()(Number(r.init.value))&&(a=r.init.value,n.glslContext.defines.push({name:o.name,value:a,runtime:!1})),"";var u=o.typeAnnotation||n.inferTypeByExpression(r.init,t);if(u){var s="";if(r.init&&(s=n.compileExpression(r.init,t,u,!1)),r.init&&r.init.type===D.Identifier){var c=n.findAliasVariableName(r.init.name,t),f=t.variables.find((function(e){return e.name===c}));f&&f.alias.push(o.name)}return t.variables.push({name:o.name,alias:[],typeAnnotation:u}),""!==s?"".concat(u," ").concat(o.name," = ").concat(s,";"):"".concat(u," ").concat(o.name,";")}return""})).join("\n")}},{key:"compileIfStatement",value:function(e,t){var n="";return e.consequent.type===D.ExpressionStatement?n=this.compileExpression(e.consequent.expression,t,"",!1):e.consequent.type===D.BlockStatement?n=this.compileBlockStatement(e.consequent,t):e.consequent.type===D.ReturnStatement?n=this.compileReturnStatement(e.consequent,t):e.consequent.type===D.BreakStatement&&(n="break;"),"if (".concat(this.compileExpression(e.test,t,"",!1),") {").concat(n,"}")}},{key:"compileReturnStatement",value:function(e,t){return"return ".concat(e.argument&&this.compileExpression(e.argument,t,"",!1)||"",";")}},{key:"compileForStatement",value:function(e,t){var n,r,i="";return(null===(n=e.init)||void 0===n?void 0:n.type)===D.VariableDeclaration?(e.init.declarations.forEach((function(e){e.id.typeAnnotation="int"})),i=this.compileVariableDeclaration(e.init,t)):(null===(r=e.init)||void 0===r?void 0:r.type)===D.AssignmentExpression&&(i=this.compileExpression(e.init,t,"",!1)),"for (".concat(i," ").concat(e.test&&this.compileExpression(e.test,t,"",!1),"; ").concat(e.update&&this.compileExpression(e.update,t,"",!1),") {").concat(this.compileBlockStatement(e.body,t),"}")}},{key:"inferTypeByExpression",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if((null==e?void 0:e.type)===D.Literal){if(H()(e.value))return"float";if(W()(e.value))return"bool"}else if((null==e?void 0:e.type)===D.ArrayExpression){if(e.elements.length<=4)return e.elements.every((function(e){return e.type===D.Literal&&W()(e.value)}))?"bvec".concat(e.elements.length):"vec".concat(e.elements.length);if(9===e.elements.length)return"mat3";if(16===e.elements.length)return"mat4"}else{if((null==e?void 0:e.type)===D.Identifier){for(var n=t,r="";null!==n;){var i=n.variables.find((function(t){return t.type!==he.Function&&t.name===e.name}));if(i){r=i.typeAnnotation;break}n=n.parent}return r}if((null==e?void 0:e.type)===D.CallExpression){for(var a=t,o="";null!==a;){var u=a.variables.find((function(t){return t.type===he.Function&&(e.callee.type===D.Identifier&&t.name===e.callee.name||e.callee.type===D.MemberExpression&&e.callee.object.type===D.Identifier&&"this"===e.callee.object.name&&e.callee.property.type===D.Identifier&&e.callee.property.name===t.name)}));if(u){o=u.typeAnnotation;break}a=a.parent}if(!o&&e.callee.type===D.Identifier){if(X.indexOf(e.callee.name)>-1)return e.callee.name;if(K.indexOf(e.callee.name)>-1&&e.arguments.length)return this.inferTypeByExpression(e.arguments[0],t)}return o}if((null==e?void 0:e.type)===D.BinaryExpression)return this.compareTypePriority(this.inferTypeByExpression(e.left,t),this.inferTypeByExpression(e.right,t),e.operator);if((null==e?void 0:e.type)===D.MemberExpression){if(e.object.type===D.MemberExpression)return this.inferTypeByExpression(e.object,t);if(e.object.type===D.Identifier){var s=e.object.name,c=!1;"this"===s&&e.property.type===D.Identifier&&(s=e.property.name,c=!0);var f=this.findAliasVariableName(s,t);if(f){if(this.isDataTexture(f)){var l=this.glslContext.uniforms.find((function(e){return f===e.name}));return l&&l.format.replace("[]","")||"vec4"}if(c)return this.inferTypeByExpression(e.property,t)}}var p=this.inferTypeByExpression(e.object,t);if(e.property.type===D.Identifier){if(e.property.name.length<=4&&e.property.name.split("").every((function(e){return Y.indexOf(e)>-1}))){if(p.startsWith("vec"))return 1===e.property.name.length?"float":"vec".concat(e.property.name.length);if(p.startsWith("ivec"))return 1===e.property.name.length?"int":"ivec".concat(e.property.name.length);if(p.startsWith("bvec"))return 1===e.property.name.length?"bool":"bvec".concat(e.property.name.length)}}else if(e.property.type===D.Literal&&H()(Number(e.property.value))){if(p.startsWith("vec"))return"float";if(p.startsWith("ivec"))return"int";if(p.startsWith("bvec"))return"bool";if(p.startsWith("uvec"))return"uint"}}else if((null==e?void 0:e.type)===D.ConditionalExpression)return this.inferTypeByExpression(e.consequent,t)}return""}},{key:"compareTypePriority",value:function(e,t,n){if("+"===n||"-"===n||"*"===n||"/"===n){if(J[e]&&J[t]){var r=Math.max(J[e],J[t]);return J[e]===r?e:t}if(!e)return t;if(!t)return e}return""}},{key:"wrapFloat",value:function(e){return-1===e.indexOf(".")?"".concat(e,".0"):e}},{key:"findAliasVariableName",value:function(e,t){if(void 0!==e&&null!==t){var n,r=ge(t.variables);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(i.alias.indexOf(e)>-1)return this.findAliasVariableName(i.name,t)||e}}catch(e){r.e(e)}finally{r.f()}return e}}},{key:"isDataTexture",value:function(e){return!!this.glslContext.uniforms.find((function(t){return"sampler2D"===t.type&&e===t.name}))}},{key:"isReferringDataTexture",value:function(e){return e.type===D.MemberExpression&&e.object.type===D.MemberExpression&&e.object.object.type===D.Identifier&&"this"===e.object.object.name&&!1===e.object.computed}},{key:"analyzeDecorators",value:function(e,t,n,r){var i=this,a=r.map((function(e){return i.extractDecorator(e)}));a.forEach((function(r){var o=r.name,u=r.params;if(o===pe.Shared)i.glslContext.globalDeclarations.push({name:e,type:n,shared:!0,value:"".concat(u[0])});else if(o===pe.Out||o===pe.In){var s=i.glslContext.uniforms.find((function(t){return t.name===e}));s||(s={name:e,type:t,format:n,readonly:!a.find((function(e){return e.name===pe.Out})),writeonly:!a.find((function(e){return e.name===pe.In})),size:[Number(u[0])||1,Number(u[1])||1]},i.glslContext.uniforms.push(s)),o===pe.Out&&(i.glslContext.output.name=e,i.glslContext.output.size=s.size,i.glslContext.output.length=s.size[0]*s.size[1],"image2D"===t&&(i.glslContext.output.typedArrayConstructor=Uint8ClampedArray,i.glslContext.output.length*=4))}}))}},{key:"extractDecorator",value:function(e){var t="",n=[];return e.expression.type===D.Identifier?t=e.expression.name:e.expression.type===D.CallExpression&&e.expression.callee.type===D.Identifier&&(t=e.expression.callee.name,n=e.expression.arguments.map((function(e){return e.type===D.Literal&&Number(e.value)||0}))),{name:t,params:n}}}]),e}();function Be(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _e(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Be(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Be(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Me,Fe,Oe,ke,Ie,Pe,je,Re,Ne,Ge=(Ae=Object(N.injectable)(),Ee=Object(N.inject)(G.ComputeComponentManager),xe=Object(N.inject)(G.RenderEngine),Ae((Se=function(){function e(){m()(this,e),P()(this,"compute",we,this),P()(this,"engine",Te,this),this.parser=new De}var t,n;return v()(e,[{key:"execute",value:(n=h()(l.a.mark((function e(){var t=this;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(this.compute.map(function(){var e=h()(l.a.mark((function e(n,r){return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r.finished){e.next=19;break}if(!r.dirty){e.next=6;break}return e.next=4,t.compile(r);case 4:r.strategy.init(r.compiledBundle.context),r.dirty=!1;case 6:if(!(r.iteration<=r.maxIteration-1)){e.next=12;break}t.engine.setComputePipeline("compute-".concat(n),_e({layout:r.pipelineLayout},r.stageDescriptor)),t.engine.setComputeBindGroups([r.strategy.getBindingGroup()]),r.strategy.run(),e.next=19;break;case 12:if(r.finished=!0,!r.onCompleted){e.next=19;break}return e.t0=r,e.next=17,t.engine.readData(r.compiledBundle.context);case 17:e.t1=e.sent,e.t0.onCompleted.call(e.t0,e.t1);case 19:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()));case 2:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"tearDown",value:function(){this.compute.forEach((function(e,t){t.strategy.destroy()})),this.compute.clear()}},{key:"createComputePipeline",value:function(e){var t=e.type,n=void 0===t?"layout":t,r=e.shader,i=e.precompiled,a=void 0!==i&&i,o=e.dispatch,u=void 0===o?[1,1,1]:o,s=e.maxIteration,c=void 0===s?1:s,f=e.onCompleted,l=void 0===f?null:f,p=b(),h=Ru.getNamed(G.ComputeStrategy,n);return this.compute.create(p,{type:n,strategy:h,rawShaderCode:r,precompiled:a,dispatch:u,maxIteration:c,onCompleted:l}),h.component=this.compute.getComponentByEntity(p),p}},{key:"setBinding",value:function(e,t,n){var r=this.compute.getComponentByEntity(e);r&&r.bindings.push({name:t,data:n})}},{key:"getParticleBuffer",value:function(e){return this.compute.getComponentByEntity(e).strategy.getGPUBuffer()}},{key:"getPrecompiledBundle",value:function(e){var t=this,n=this.compute.getComponentByEntity(e);return Object.keys(n.compiledBundle.shaders).forEach((function(e){n.compiledBundle.shaders[e]||(t.parser.setTarget(e),n.compiledBundle.shaders[e]=t.parser.generateCode(t.parser.parse(n.rawShaderCode),{dispatch:n.dispatch,maxIteration:n.maxIteration,bindings:n.bindings}),t.parser.clear())})),n.compiledBundle.context.uniforms.forEach((function(e){e.data&&delete e.data})),JSON.stringify(n.compiledBundle).replace(/\\n/g,"\\\\n")}},{key:"compile",value:(t=h()(l.a.mark((function e(t){var n,r;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.precompiled?(t.compiledBundle=JSON.parse(t.rawShaderCode),t.compiledBundle.context.uniforms.forEach((function(e){var n=t.bindings.find((function(t){return t.name===e.name}));n&&n.data&&(e.data=n.data)}))):(r=this.engine.supportWebGPU?de.WebGPU:de.WebGL,this.parser.setTarget(r),t.compiledBundle={shaders:(n={},c()(n,de.WebGPU,""),c()(n,de.WebGL,""),n),context:this.parser.getGLSLContext()},t.compiledBundle.shaders[r]=this.parser.generateCode(this.parser.parse(t.rawShaderCode),{dispatch:t.dispatch,maxIteration:t.maxIteration,bindings:t.bindings})),e.next=3,this.engine.compileComputePipelineStageDescriptor("".concat(t.compiledBundle.context.defines.filter((function(e){return e.runtime})).map((function(e){return"#define ".concat(e.name," ").concat(e.value)})).join("\n"),"\n ").concat(t.compiledBundle.shaders[this.engine.supportWebGPU?de.WebGPU:de.WebGL]),t.compiledBundle.context);case 3:t.stageDescriptor=e.sent,t.precompiled||this.parser.clear(),t.precompiled=!0;case 6:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),e}(),we=R()(Se.prototype,"compute",[Ee],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Te=R()(Se.prototype,"engine",[xe],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ce=Se))||Ce);function Le(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return ze(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ze(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return o=e.done,e},e:function(e){u=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(u)throw a}}}}function ze(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ve=(Me=Object(N.injectable)(),Fe=Object(N.inject)(G.NameComponentManager),Oe=Object(N.inject)(G.PassNodeComponentManager),ke=Object(N.inject)(G.ResourceHandleComponentManager),Me((Pe=function(){function e(){m()(this,e),P()(this,"nameManager",je,this),P()(this,"passNodeManager",Re,this),P()(this,"resourceHandleManager",Ne,this),this.rootNodes=[]}var t;return v()(e,[{key:"execute",value:(t=h()(l.a.mark((function e(){return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)}))),function(){return t.apply(this,arguments)})},{key:"tearDown",value:function(){this.passNodeManager.clear(),this.resourceHandleManager.clear()}},{key:"setup",value:function(){this.passNodeManager.forEach((function(e,t){t.setup()}))}},{key:"compile",value:function(){var e=this;this.passNodeManager.forEach((function(t,n){e.compilePassNode(t,n),n.compiled=!0})),this.rootNodes=[],this.passNodeManager.forEach((function(t,n){0===n.prevs.length&&e.rootNodes.push(t)}))}},{key:"getPassNodeEntityByName",value:function(e){var t=this.nameManager.findIndex((function(t){return t.name===e})),n=this.nameManager.getEntityByComponentIndex(t);return this.passNodeManager.getComponentByEntity(n)?n:-1}},{key:"getResourceHandleEntityByName",value:function(e){var t=this.nameManager.findIndex((function(t){return t.name===e})),n=this.nameManager.getEntityByComponentIndex(t);return this.resourceHandleManager.getComponentByEntity(n)?n:-1}},{key:"registerPassNode",value:function(e,t){var n=this.getPassNodeEntityByName(e);if(-1===n){var r=b();return this.nameManager.create(r,{name:e}),this.passNodeManager.create(r,{}),r}return n}},{key:"confirmInput",value:function(e,t){var n=this,r=this.passNodeManager.getComponentByEntity(e);r&&(r.inputResources=[],t.forEach((function(e){var t=n.getResourceHandleEntityByName(e);if(-1===t){var i=b();n.nameManager.create(i,{name:e}),n.resourceHandleManager.create(i,{}),r.inputResources.push(i)}else r.inputResources.push(t)})))}},{key:"confirmOutput",value:function(e,t){var n=this,r=this.passNodeManager.getComponentByEntity(e);r&&(r.outputResources=[],t.forEach((function(t){var i=n.getResourceHandleEntityByName(t);if(-1===i){var a=b();n.nameManager.create(a,{name:t}),n.resourceHandleManager.create(a,{writer:e}),r.outputResources.push(a)}else r.outputResources.push(i)})))}},{key:"compilePassNode",value:function(e,t){var n,r=Le(t.inputResources);try{for(r.s();!(n=r.n()).done;){var i=n.value,a=this.resourceHandleManager.getComponentByEntity(i),o=this.nameManager.getComponentByEntity(i);if(a){var u=a.writer,s=this.passNodeManager.getComponentByEntity(u);if(!s)continue;if(!s.compiled&&!this.compilePassNode(u,s))return!1;this.hasOutput(s,(null==o?void 0:o.name)||"")&&this.addInputPass(t,s,e,u)}}}catch(e){r.e(e)}finally{r.f()}var c,f=Le(t.outputResources);try{for(f.s();!(c=f.n()).done;){var l=c.value,p=this.resourceHandleManager.getComponentByEntity(l);p&&(p.writer=e)}}catch(e){f.e(e)}finally{f.f()}return!0}},{key:"hasOutput",value:function(e,t){var n=this;return!!e.outputResources.find((function(e){var r=n.nameManager.getComponentByEntity(e);return r&&r.name===t}))}},{key:"addInputPass",value:function(e,t,n,r){var i=this;t.nexts.find((function(e){var t=(i.nameManager.getComponentByEntity(e)||{name:""}).name,r=(i.nameManager.getComponentByEntity(n)||{name:""}).name;return t===(void 0===r?"":r)}))||e.prevs.find((function(e){var t=(i.nameManager.getComponentByEntity(e)||{name:""}).name,n=(i.nameManager.getComponentByEntity(r)||{name:""}).name;return(void 0===n?"":n)===t}))||(t.nexts.push(n),e.prevs.push(r),t.ref++)}}]),e}(),je=R()(Pe.prototype,"nameManager",[Fe],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Re=R()(Pe.prototype,"passNodeManager",[Oe],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ne=R()(Pe.prototype,"resourceHandleManager",[ke],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ie=Pe))||Ie),Ue=1e-6,We="undefined"!=typeof Float32Array?Float32Array:Array,qe=Math.random;Math.PI;function He(){var e=new We(9);return We!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function Xe(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}function Ke(e){var t=new We(9);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function Ye(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function Je(e,t,n,r,i,a,o,u,s){var c=new We(9);return c[0]=e,c[1]=t,c[2]=n,c[3]=r,c[4]=i,c[5]=a,c[6]=o,c[7]=u,c[8]=s,c}function Qe(e,t,n,r,i,a,o,u,s,c){return e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=a,e[5]=o,e[6]=u,e[7]=s,e[8]=c,e}function Ze(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function $e(e,t){if(e===t){var n=t[1],r=t[2],i=t[5];e[1]=t[3],e[2]=t[6],e[3]=n,e[5]=t[7],e[6]=r,e[7]=i}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}function et(e,t){var n=t[0],r=t[1],i=t[2],a=t[3],o=t[4],u=t[5],s=t[6],c=t[7],f=t[8],l=f*o-u*c,p=-f*a+u*s,h=c*a-o*s,d=n*l+r*p+i*h;return d?(d=1/d,e[0]=l*d,e[1]=(-f*r+i*c)*d,e[2]=(u*r-i*o)*d,e[3]=p*d,e[4]=(f*n-i*s)*d,e[5]=(-u*n+i*a)*d,e[6]=h*d,e[7]=(-c*n+r*s)*d,e[8]=(o*n-r*a)*d,e):null}function tt(e,t){var n=t[0],r=t[1],i=t[2],a=t[3],o=t[4],u=t[5],s=t[6],c=t[7],f=t[8];return e[0]=o*f-u*c,e[1]=i*c-r*f,e[2]=r*u-i*o,e[3]=u*s-a*f,e[4]=n*f-i*s,e[5]=i*a-n*u,e[6]=a*c-o*s,e[7]=r*s-n*c,e[8]=n*o-r*a,e}function nt(e){var t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],u=e[6],s=e[7],c=e[8];return t*(c*a-o*s)+n*(-c*i+o*u)+r*(s*i-a*u)}function rt(e,t,n){var r=t[0],i=t[1],a=t[2],o=t[3],u=t[4],s=t[5],c=t[6],f=t[7],l=t[8],p=n[0],h=n[1],d=n[2],m=n[3],y=n[4],v=n[5],g=n[6],b=n[7],A=n[8];return e[0]=p*r+h*o+d*c,e[1]=p*i+h*u+d*f,e[2]=p*a+h*s+d*l,e[3]=m*r+y*o+v*c,e[4]=m*i+y*u+v*f,e[5]=m*a+y*s+v*l,e[6]=g*r+b*o+A*c,e[7]=g*i+b*u+A*f,e[8]=g*a+b*s+A*l,e}function it(e,t,n){var r=t[0],i=t[1],a=t[2],o=t[3],u=t[4],s=t[5],c=t[6],f=t[7],l=t[8],p=n[0],h=n[1];return e[0]=r,e[1]=i,e[2]=a,e[3]=o,e[4]=u,e[5]=s,e[6]=p*r+h*o+c,e[7]=p*i+h*u+f,e[8]=p*a+h*s+l,e}function at(e,t,n){var r=t[0],i=t[1],a=t[2],o=t[3],u=t[4],s=t[5],c=t[6],f=t[7],l=t[8],p=Math.sin(n),h=Math.cos(n);return e[0]=h*r+p*o,e[1]=h*i+p*u,e[2]=h*a+p*s,e[3]=h*o-p*r,e[4]=h*u-p*i,e[5]=h*s-p*a,e[6]=c,e[7]=f,e[8]=l,e}function ot(e,t,n){var r=n[0],i=n[1];return e[0]=r*t[0],e[1]=r*t[1],e[2]=r*t[2],e[3]=i*t[3],e[4]=i*t[4],e[5]=i*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function ut(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e}function st(e,t){var n=Math.sin(t),r=Math.cos(t);return e[0]=r,e[1]=n,e[2]=0,e[3]=-n,e[4]=r,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function ct(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function ft(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e}function lt(e,t){var n=t[0],r=t[1],i=t[2],a=t[3],o=n+n,u=r+r,s=i+i,c=n*o,f=r*o,l=r*u,p=i*o,h=i*u,d=i*s,m=a*o,y=a*u,v=a*s;return e[0]=1-l-d,e[3]=f-v,e[6]=p+y,e[1]=f+v,e[4]=1-c-d,e[7]=h-m,e[2]=p-y,e[5]=h+m,e[8]=1-c-l,e}function pt(e,t){var n=t[0],r=t[1],i=t[2],a=t[3],o=t[4],u=t[5],s=t[6],c=t[7],f=t[8],l=t[9],p=t[10],h=t[11],d=t[12],m=t[13],y=t[14],v=t[15],g=n*u-r*o,b=n*s-i*o,A=n*c-a*o,E=r*s-i*u,x=r*c-a*u,C=i*c-a*s,S=f*m-l*d,w=f*y-p*d,T=f*v-h*d,D=l*y-p*m,B=l*v-h*m,_=p*v-h*y,M=g*_-b*B+A*D+E*T-x*w+C*S;return M?(M=1/M,e[0]=(u*_-s*B+c*D)*M,e[1]=(s*T-o*_-c*w)*M,e[2]=(o*B-u*T+c*S)*M,e[3]=(i*B-r*_-a*D)*M,e[4]=(n*_-i*T+a*w)*M,e[5]=(r*T-n*B-a*S)*M,e[6]=(m*C-y*x+v*E)*M,e[7]=(y*A-d*C-v*b)*M,e[8]=(d*x-m*A+v*g)*M,e):null}function ht(e,t,n){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/n,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}function dt(e){return"mat3("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+")"}function mt(e){return Math.hypot(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])}function yt(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e}function vt(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e}function gt(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e}function bt(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e[2]=t[2]+n[2]*r,e[3]=t[3]+n[3]*r,e[4]=t[4]+n[4]*r,e[5]=t[5]+n[5]*r,e[6]=t[6]+n[6]*r,e[7]=t[7]+n[7]*r,e[8]=t[8]+n[8]*r,e}function At(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]}function Et(e,t){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],u=e[5],s=e[6],c=e[7],f=e[8],l=t[0],p=t[1],h=t[2],d=t[3],m=t[4],y=t[5],v=t[6],g=t[7],b=t[8];return Math.abs(n-l)<=Ue*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(r-p)<=Ue*Math.max(1,Math.abs(r),Math.abs(p))&&Math.abs(i-h)<=Ue*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(a-d)<=Ue*Math.max(1,Math.abs(a),Math.abs(d))&&Math.abs(o-m)<=Ue*Math.max(1,Math.abs(o),Math.abs(m))&&Math.abs(u-y)<=Ue*Math.max(1,Math.abs(u),Math.abs(y))&&Math.abs(s-v)<=Ue*Math.max(1,Math.abs(s),Math.abs(v))&&Math.abs(c-g)<=Ue*Math.max(1,Math.abs(c),Math.abs(g))&&Math.abs(f-b)<=Ue*Math.max(1,Math.abs(f),Math.abs(b))}Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});var xt=rt,Ct=vt;function St(){var e=new We(16);return We!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function wt(e){var t=new We(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Tt(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function Dt(e,t,n,r,i,a,o,u,s,c,f,l,p,h,d,m){var y=new We(16);return y[0]=e,y[1]=t,y[2]=n,y[3]=r,y[4]=i,y[5]=a,y[6]=o,y[7]=u,y[8]=s,y[9]=c,y[10]=f,y[11]=l,y[12]=p,y[13]=h,y[14]=d,y[15]=m,y}function Bt(e,t,n,r,i,a,o,u,s,c,f,l,p,h,d,m,y){return e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=a,e[5]=o,e[6]=u,e[7]=s,e[8]=c,e[9]=f,e[10]=l,e[11]=p,e[12]=h,e[13]=d,e[14]=m,e[15]=y,e}function _t(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Mt(e,t){if(e===t){var n=t[1],r=t[2],i=t[3],a=t[6],o=t[7],u=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=r,e[9]=a,e[11]=t[14],e[12]=i,e[13]=o,e[14]=u}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}function Ft(e,t){var n=t[0],r=t[1],i=t[2],a=t[3],o=t[4],u=t[5],s=t[6],c=t[7],f=t[8],l=t[9],p=t[10],h=t[11],d=t[12],m=t[13],y=t[14],v=t[15],g=n*u-r*o,b=n*s-i*o,A=n*c-a*o,E=r*s-i*u,x=r*c-a*u,C=i*c-a*s,S=f*m-l*d,w=f*y-p*d,T=f*v-h*d,D=l*y-p*m,B=l*v-h*m,_=p*v-h*y,M=g*_-b*B+A*D+E*T-x*w+C*S;return M?(M=1/M,e[0]=(u*_-s*B+c*D)*M,e[1]=(i*B-r*_-a*D)*M,e[2]=(m*C-y*x+v*E)*M,e[3]=(p*x-l*C-h*E)*M,e[4]=(s*T-o*_-c*w)*M,e[5]=(n*_-i*T+a*w)*M,e[6]=(y*A-d*C-v*b)*M,e[7]=(f*C-p*A+h*b)*M,e[8]=(o*B-u*T+c*S)*M,e[9]=(r*T-n*B-a*S)*M,e[10]=(d*x-m*A+v*g)*M,e[11]=(l*A-f*x-h*g)*M,e[12]=(u*w-o*D-s*S)*M,e[13]=(n*D-r*w+i*S)*M,e[14]=(m*b-d*E-y*g)*M,e[15]=(f*E-l*b+p*g)*M,e):null}function Ot(e,t){var n=t[0],r=t[1],i=t[2],a=t[3],o=t[4],u=t[5],s=t[6],c=t[7],f=t[8],l=t[9],p=t[10],h=t[11],d=t[12],m=t[13],y=t[14],v=t[15];return e[0]=u*(p*v-h*y)-l*(s*v-c*y)+m*(s*h-c*p),e[1]=-(r*(p*v-h*y)-l*(i*v-a*y)+m*(i*h-a*p)),e[2]=r*(s*v-c*y)-u*(i*v-a*y)+m*(i*c-a*s),e[3]=-(r*(s*h-c*p)-u*(i*h-a*p)+l*(i*c-a*s)),e[4]=-(o*(p*v-h*y)-f*(s*v-c*y)+d*(s*h-c*p)),e[5]=n*(p*v-h*y)-f*(i*v-a*y)+d*(i*h-a*p),e[6]=-(n*(s*v-c*y)-o*(i*v-a*y)+d*(i*c-a*s)),e[7]=n*(s*h-c*p)-o*(i*h-a*p)+f*(i*c-a*s),e[8]=o*(l*v-h*m)-f*(u*v-c*m)+d*(u*h-c*l),e[9]=-(n*(l*v-h*m)-f*(r*v-a*m)+d*(r*h-a*l)),e[10]=n*(u*v-c*m)-o*(r*v-a*m)+d*(r*c-a*u),e[11]=-(n*(u*h-c*l)-o*(r*h-a*l)+f*(r*c-a*u)),e[12]=-(o*(l*y-p*m)-f*(u*y-s*m)+d*(u*p-s*l)),e[13]=n*(l*y-p*m)-f*(r*y-i*m)+d*(r*p-i*l),e[14]=-(n*(u*y-s*m)-o*(r*y-i*m)+d*(r*s-i*u)),e[15]=n*(u*p-s*l)-o*(r*p-i*l)+f*(r*s-i*u),e}function kt(e){var t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],u=e[6],s=e[7],c=e[8],f=e[9],l=e[10],p=e[11],h=e[12],d=e[13],m=e[14],y=e[15];return(t*o-n*a)*(l*y-p*m)-(t*u-r*a)*(f*y-p*d)+(t*s-i*a)*(f*m-l*d)+(n*u-r*o)*(c*y-p*h)-(n*s-i*o)*(c*m-l*h)+(r*s-i*u)*(c*d-f*h)}function It(e,t,n){var r=t[0],i=t[1],a=t[2],o=t[3],u=t[4],s=t[5],c=t[6],f=t[7],l=t[8],p=t[9],h=t[10],d=t[11],m=t[12],y=t[13],v=t[14],g=t[15],b=n[0],A=n[1],E=n[2],x=n[3];return e[0]=b*r+A*u+E*l+x*m,e[1]=b*i+A*s+E*p+x*y,e[2]=b*a+A*c+E*h+x*v,e[3]=b*o+A*f+E*d+x*g,b=n[4],A=n[5],E=n[6],x=n[7],e[4]=b*r+A*u+E*l+x*m,e[5]=b*i+A*s+E*p+x*y,e[6]=b*a+A*c+E*h+x*v,e[7]=b*o+A*f+E*d+x*g,b=n[8],A=n[9],E=n[10],x=n[11],e[8]=b*r+A*u+E*l+x*m,e[9]=b*i+A*s+E*p+x*y,e[10]=b*a+A*c+E*h+x*v,e[11]=b*o+A*f+E*d+x*g,b=n[12],A=n[13],E=n[14],x=n[15],e[12]=b*r+A*u+E*l+x*m,e[13]=b*i+A*s+E*p+x*y,e[14]=b*a+A*c+E*h+x*v,e[15]=b*o+A*f+E*d+x*g,e}function Pt(e,t,n){var r,i,a,o,u,s,c,f,l,p,h,d,m=n[0],y=n[1],v=n[2];return t===e?(e[12]=t[0]*m+t[4]*y+t[8]*v+t[12],e[13]=t[1]*m+t[5]*y+t[9]*v+t[13],e[14]=t[2]*m+t[6]*y+t[10]*v+t[14],e[15]=t[3]*m+t[7]*y+t[11]*v+t[15]):(r=t[0],i=t[1],a=t[2],o=t[3],u=t[4],s=t[5],c=t[6],f=t[7],l=t[8],p=t[9],h=t[10],d=t[11],e[0]=r,e[1]=i,e[2]=a,e[3]=o,e[4]=u,e[5]=s,e[6]=c,e[7]=f,e[8]=l,e[9]=p,e[10]=h,e[11]=d,e[12]=r*m+u*y+l*v+t[12],e[13]=i*m+s*y+p*v+t[13],e[14]=a*m+c*y+h*v+t[14],e[15]=o*m+f*y+d*v+t[15]),e}function jt(e,t,n){var r=n[0],i=n[1],a=n[2];return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function Rt(e,t,n,r){var i,a,o,u,s,c,f,l,p,h,d,m,y,v,g,b,A,E,x,C,S,w,T,D,B=r[0],_=r[1],M=r[2],F=Math.hypot(B,_,M);return F<Ue?null:(B*=F=1/F,_*=F,M*=F,i=Math.sin(n),o=1-(a=Math.cos(n)),u=t[0],s=t[1],c=t[2],f=t[3],l=t[4],p=t[5],h=t[6],d=t[7],m=t[8],y=t[9],v=t[10],g=t[11],b=B*B*o+a,A=_*B*o+M*i,E=M*B*o-_*i,x=B*_*o-M*i,C=_*_*o+a,S=M*_*o+B*i,w=B*M*o+_*i,T=_*M*o-B*i,D=M*M*o+a,e[0]=u*b+l*A+m*E,e[1]=s*b+p*A+y*E,e[2]=c*b+h*A+v*E,e[3]=f*b+d*A+g*E,e[4]=u*x+l*C+m*S,e[5]=s*x+p*C+y*S,e[6]=c*x+h*C+v*S,e[7]=f*x+d*C+g*S,e[8]=u*w+l*T+m*D,e[9]=s*w+p*T+y*D,e[10]=c*w+h*T+v*D,e[11]=f*w+d*T+g*D,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}function Nt(e,t,n){var r=Math.sin(n),i=Math.cos(n),a=t[4],o=t[5],u=t[6],s=t[7],c=t[8],f=t[9],l=t[10],p=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*i+c*r,e[5]=o*i+f*r,e[6]=u*i+l*r,e[7]=s*i+p*r,e[8]=c*i-a*r,e[9]=f*i-o*r,e[10]=l*i-u*r,e[11]=p*i-s*r,e}function Gt(e,t,n){var r=Math.sin(n),i=Math.cos(n),a=t[0],o=t[1],u=t[2],s=t[3],c=t[8],f=t[9],l=t[10],p=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i-c*r,e[1]=o*i-f*r,e[2]=u*i-l*r,e[3]=s*i-p*r,e[8]=a*r+c*i,e[9]=o*r+f*i,e[10]=u*r+l*i,e[11]=s*r+p*i,e}function Lt(e,t,n){var r=Math.sin(n),i=Math.cos(n),a=t[0],o=t[1],u=t[2],s=t[3],c=t[4],f=t[5],l=t[6],p=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i+c*r,e[1]=o*i+f*r,e[2]=u*i+l*r,e[3]=s*i+p*r,e[4]=c*i-a*r,e[5]=f*i-o*r,e[6]=l*i-u*r,e[7]=p*i-s*r,e}function zt(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}function Vt(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Ut(e,t,n){var r,i,a,o=n[0],u=n[1],s=n[2],c=Math.hypot(o,u,s);return c<Ue?null:(o*=c=1/c,u*=c,s*=c,r=Math.sin(t),a=1-(i=Math.cos(t)),e[0]=o*o*a+i,e[1]=u*o*a+s*r,e[2]=s*o*a-u*r,e[3]=0,e[4]=o*u*a-s*r,e[5]=u*u*a+i,e[6]=s*u*a+o*r,e[7]=0,e[8]=o*s*a+u*r,e[9]=u*s*a-o*r,e[10]=s*s*a+i,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e)}function Wt(e,t){var n=Math.sin(t),r=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=r,e[6]=n,e[7]=0,e[8]=0,e[9]=-n,e[10]=r,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function qt(e,t){var n=Math.sin(t),r=Math.cos(t);return e[0]=r,e[1]=0,e[2]=-n,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=n,e[9]=0,e[10]=r,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Ht(e,t){var n=Math.sin(t),r=Math.cos(t);return e[0]=r,e[1]=n,e[2]=0,e[3]=0,e[4]=-n,e[5]=r,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Xt(e,t,n){var r=t[0],i=t[1],a=t[2],o=t[3],u=r+r,s=i+i,c=a+a,f=r*u,l=r*s,p=r*c,h=i*s,d=i*c,m=a*c,y=o*u,v=o*s,g=o*c;return e[0]=1-(h+m),e[1]=l+g,e[2]=p-v,e[3]=0,e[4]=l-g,e[5]=1-(f+m),e[6]=d+y,e[7]=0,e[8]=p+v,e[9]=d-y,e[10]=1-(f+h),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}function Kt(e,t){var n=new We(3),r=-t[0],i=-t[1],a=-t[2],o=t[3],u=t[4],s=t[5],c=t[6],f=t[7],l=r*r+i*i+a*a+o*o;return l>0?(n[0]=2*(u*o+f*r+s*a-c*i)/l,n[1]=2*(s*o+f*i+c*r-u*a)/l,n[2]=2*(c*o+f*a+u*i-s*r)/l):(n[0]=2*(u*o+f*r+s*a-c*i),n[1]=2*(s*o+f*i+c*r-u*a),n[2]=2*(c*o+f*a+u*i-s*r)),Xt(e,t,n),e}function Yt(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function Jt(e,t){var n=t[0],r=t[1],i=t[2],a=t[4],o=t[5],u=t[6],s=t[8],c=t[9],f=t[10];return e[0]=Math.hypot(n,r,i),e[1]=Math.hypot(a,o,u),e[2]=Math.hypot(s,c,f),e}function Qt(e,t){var n=new We(3);Jt(n,t);var r=1/n[0],i=1/n[1],a=1/n[2],o=t[0]*r,u=t[1]*i,s=t[2]*a,c=t[4]*r,f=t[5]*i,l=t[6]*a,p=t[8]*r,h=t[9]*i,d=t[10]*a,m=o+f+d,y=0;return m>0?(y=2*Math.sqrt(m+1),e[3]=.25*y,e[0]=(l-h)/y,e[1]=(p-s)/y,e[2]=(u-c)/y):o>f&&o>d?(y=2*Math.sqrt(1+o-f-d),e[3]=(l-h)/y,e[0]=.25*y,e[1]=(u+c)/y,e[2]=(p+s)/y):f>d?(y=2*Math.sqrt(1+f-o-d),e[3]=(p-s)/y,e[0]=(u+c)/y,e[1]=.25*y,e[2]=(l+h)/y):(y=2*Math.sqrt(1+d-o-f),e[3]=(u-c)/y,e[0]=(p+s)/y,e[1]=(l+h)/y,e[2]=.25*y),e}function Zt(e,t,n,r){var i=t[0],a=t[1],o=t[2],u=t[3],s=i+i,c=a+a,f=o+o,l=i*s,p=i*c,h=i*f,d=a*c,m=a*f,y=o*f,v=u*s,g=u*c,b=u*f,A=r[0],E=r[1],x=r[2];return e[0]=(1-(d+y))*A,e[1]=(p+b)*A,e[2]=(h-g)*A,e[3]=0,e[4]=(p-b)*E,e[5]=(1-(l+y))*E,e[6]=(m+v)*E,e[7]=0,e[8]=(h+g)*x,e[9]=(m-v)*x,e[10]=(1-(l+d))*x,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}function $t(e,t,n,r,i){var a=t[0],o=t[1],u=t[2],s=t[3],c=a+a,f=o+o,l=u+u,p=a*c,h=a*f,d=a*l,m=o*f,y=o*l,v=u*l,g=s*c,b=s*f,A=s*l,E=r[0],x=r[1],C=r[2],S=i[0],w=i[1],T=i[2],D=(1-(m+v))*E,B=(h+A)*E,_=(d-b)*E,M=(h-A)*x,F=(1-(p+v))*x,O=(y+g)*x,k=(d+b)*C,I=(y-g)*C,P=(1-(p+m))*C;return e[0]=D,e[1]=B,e[2]=_,e[3]=0,e[4]=M,e[5]=F,e[6]=O,e[7]=0,e[8]=k,e[9]=I,e[10]=P,e[11]=0,e[12]=n[0]+S-(D*S+M*w+k*T),e[13]=n[1]+w-(B*S+F*w+I*T),e[14]=n[2]+T-(_*S+O*w+P*T),e[15]=1,e}function en(e,t){var n=t[0],r=t[1],i=t[2],a=t[3],o=n+n,u=r+r,s=i+i,c=n*o,f=r*o,l=r*u,p=i*o,h=i*u,d=i*s,m=a*o,y=a*u,v=a*s;return e[0]=1-l-d,e[1]=f+v,e[2]=p-y,e[3]=0,e[4]=f-v,e[5]=1-c-d,e[6]=h+m,e[7]=0,e[8]=p+y,e[9]=h-m,e[10]=1-c-l,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function tn(e,t,n,r,i,a,o){var u=1/(n-t),s=1/(i-r),c=1/(a-o);return e[0]=2*a*u,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*a*s,e[6]=0,e[7]=0,e[8]=(n+t)*u,e[9]=(i+r)*s,e[10]=(o+a)*c,e[11]=-1,e[12]=0,e[13]=0,e[14]=o*a*2*c,e[15]=0,e}function nn(e,t,n,r,i){var a,o=1/Math.tan(t/2);return e[0]=o/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=i&&i!==1/0?(a=1/(r-i),e[10]=(i+r)*a,e[14]=2*i*r*a):(e[10]=-1,e[14]=-2*r),e}function rn(e,t,n,r){var i=Math.tan(t.upDegrees*Math.PI/180),a=Math.tan(t.downDegrees*Math.PI/180),o=Math.tan(t.leftDegrees*Math.PI/180),u=Math.tan(t.rightDegrees*Math.PI/180),s=2/(o+u),c=2/(i+a);return e[0]=s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=c,e[6]=0,e[7]=0,e[8]=-(o-u)*s*.5,e[9]=(i-a)*c*.5,e[10]=r/(n-r),e[11]=-1,e[12]=0,e[13]=0,e[14]=r*n/(n-r),e[15]=0,e}function an(e,t,n,r,i,a,o){var u=1/(t-n),s=1/(r-i),c=1/(a-o);return e[0]=-2*u,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*c,e[11]=0,e[12]=(t+n)*u,e[13]=(i+r)*s,e[14]=(o+a)*c,e[15]=1,e}function on(e,t,n,r){var i,a,o,u,s,c,f,l,p,h,d=t[0],m=t[1],y=t[2],v=r[0],g=r[1],b=r[2],A=n[0],E=n[1],x=n[2];return Math.abs(d-A)<Ue&&Math.abs(m-E)<Ue&&Math.abs(y-x)<Ue?_t(e):(f=d-A,l=m-E,p=y-x,i=g*(p*=h=1/Math.hypot(f,l,p))-b*(l*=h),a=b*(f*=h)-v*p,o=v*l-g*f,(h=Math.hypot(i,a,o))?(i*=h=1/h,a*=h,o*=h):(i=0,a=0,o=0),u=l*o-p*a,s=p*i-f*o,c=f*a-l*i,(h=Math.hypot(u,s,c))?(u*=h=1/h,s*=h,c*=h):(u=0,s=0,c=0),e[0]=i,e[1]=u,e[2]=f,e[3]=0,e[4]=a,e[5]=s,e[6]=l,e[7]=0,e[8]=o,e[9]=c,e[10]=p,e[11]=0,e[12]=-(i*d+a*m+o*y),e[13]=-(u*d+s*m+c*y),e[14]=-(f*d+l*m+p*y),e[15]=1,e)}function un(e,t,n,r){var i=t[0],a=t[1],o=t[2],u=r[0],s=r[1],c=r[2],f=i-n[0],l=a-n[1],p=o-n[2],h=f*f+l*l+p*p;h>0&&(f*=h=1/Math.sqrt(h),l*=h,p*=h);var d=s*p-c*l,m=c*f-u*p,y=u*l-s*f;return(h=d*d+m*m+y*y)>0&&(d*=h=1/Math.sqrt(h),m*=h,y*=h),e[0]=d,e[1]=m,e[2]=y,e[3]=0,e[4]=l*y-p*m,e[5]=p*d-f*y,e[6]=f*m-l*d,e[7]=0,e[8]=f,e[9]=l,e[10]=p,e[11]=0,e[12]=i,e[13]=a,e[14]=o,e[15]=1,e}function sn(e){return"mat4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+", "+e[9]+", "+e[10]+", "+e[11]+", "+e[12]+", "+e[13]+", "+e[14]+", "+e[15]+")"}function cn(e){return Math.hypot(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}function fn(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e[9]=t[9]+n[9],e[10]=t[10]+n[10],e[11]=t[11]+n[11],e[12]=t[12]+n[12],e[13]=t[13]+n[13],e[14]=t[14]+n[14],e[15]=t[15]+n[15],e}function ln(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e[9]=t[9]-n[9],e[10]=t[10]-n[10],e[11]=t[11]-n[11],e[12]=t[12]-n[12],e[13]=t[13]-n[13],e[14]=t[14]-n[14],e[15]=t[15]-n[15],e}function pn(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12]*n,e[13]=t[13]*n,e[14]=t[14]*n,e[15]=t[15]*n,e}function hn(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e[2]=t[2]+n[2]*r,e[3]=t[3]+n[3]*r,e[4]=t[4]+n[4]*r,e[5]=t[5]+n[5]*r,e[6]=t[6]+n[6]*r,e[7]=t[7]+n[7]*r,e[8]=t[8]+n[8]*r,e[9]=t[9]+n[9]*r,e[10]=t[10]+n[10]*r,e[11]=t[11]+n[11]*r,e[12]=t[12]+n[12]*r,e[13]=t[13]+n[13]*r,e[14]=t[14]+n[14]*r,e[15]=t[15]+n[15]*r,e}function dn(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}function mn(e,t){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],u=e[5],s=e[6],c=e[7],f=e[8],l=e[9],p=e[10],h=e[11],d=e[12],m=e[13],y=e[14],v=e[15],g=t[0],b=t[1],A=t[2],E=t[3],x=t[4],C=t[5],S=t[6],w=t[7],T=t[8],D=t[9],B=t[10],_=t[11],M=t[12],F=t[13],O=t[14],k=t[15];return Math.abs(n-g)<=Ue*Math.max(1,Math.abs(n),Math.abs(g))&&Math.abs(r-b)<=Ue*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(i-A)<=Ue*Math.max(1,Math.abs(i),Math.abs(A))&&Math.abs(a-E)<=Ue*Math.max(1,Math.abs(a),Math.abs(E))&&Math.abs(o-x)<=Ue*Math.max(1,Math.abs(o),Math.abs(x))&&Math.abs(u-C)<=Ue*Math.max(1,Math.abs(u),Math.abs(C))&&Math.abs(s-S)<=Ue*Math.max(1,Math.abs(s),Math.abs(S))&&Math.abs(c-w)<=Ue*Math.max(1,Math.abs(c),Math.abs(w))&&Math.abs(f-T)<=Ue*Math.max(1,Math.abs(f),Math.abs(T))&&Math.abs(l-D)<=Ue*Math.max(1,Math.abs(l),Math.abs(D))&&Math.abs(p-B)<=Ue*Math.max(1,Math.abs(p),Math.abs(B))&&Math.abs(h-_)<=Ue*Math.max(1,Math.abs(h),Math.abs(_))&&Math.abs(d-M)<=Ue*Math.max(1,Math.abs(d),Math.abs(M))&&Math.abs(m-F)<=Ue*Math.max(1,Math.abs(m),Math.abs(F))&&Math.abs(y-O)<=Ue*Math.max(1,Math.abs(y),Math.abs(O))&&Math.abs(v-k)<=Ue*Math.max(1,Math.abs(v),Math.abs(k))}var yn=It,vn=ln;function gn(){var e=new We(3);return We!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function bn(e){var t=new We(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function An(e){var t=e[0],n=e[1],r=e[2];return Math.hypot(t,n,r)}function En(e,t,n){var r=new We(3);return r[0]=e,r[1]=t,r[2]=n,r}function xn(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function Cn(e,t,n,r){return e[0]=t,e[1]=n,e[2]=r,e}function Sn(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}function wn(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}function Tn(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}function Dn(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e}function Bn(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}function _n(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}function Mn(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e}function Fn(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e}function On(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e}function kn(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}function In(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e[2]=t[2]+n[2]*r,e}function Pn(e,t){var n=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2];return Math.hypot(n,r,i)}function jn(e,t){var n=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2];return n*n+r*r+i*i}function Rn(e){var t=e[0],n=e[1],r=e[2];return t*t+n*n+r*r}function Nn(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function Gn(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}function Ln(e,t){var n=t[0],r=t[1],i=t[2],a=n*n+r*r+i*i;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}function zn(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Vn(e,t,n){var r=t[0],i=t[1],a=t[2],o=n[0],u=n[1],s=n[2];return e[0]=i*s-a*u,e[1]=a*o-r*s,e[2]=r*u-i*o,e}function Un(e,t,n,r){var i=t[0],a=t[1],o=t[2];return e[0]=i+r*(n[0]-i),e[1]=a+r*(n[1]-a),e[2]=o+r*(n[2]-o),e}function Wn(e,t,n,r,i,a){var o=a*a,u=o*(2*a-3)+1,s=o*(a-2)+a,c=o*(a-1),f=o*(3-2*a);return e[0]=t[0]*u+n[0]*s+r[0]*c+i[0]*f,e[1]=t[1]*u+n[1]*s+r[1]*c+i[1]*f,e[2]=t[2]*u+n[2]*s+r[2]*c+i[2]*f,e}function qn(e,t,n,r,i,a){var o=1-a,u=o*o,s=a*a,c=u*o,f=3*a*u,l=3*s*o,p=s*a;return e[0]=t[0]*c+n[0]*f+r[0]*l+i[0]*p,e[1]=t[1]*c+n[1]*f+r[1]*l+i[1]*p,e[2]=t[2]*c+n[2]*f+r[2]*l+i[2]*p,e}function Hn(e,t){t=t||1;var n=2*qe()*Math.PI,r=2*qe()-1,i=Math.sqrt(1-r*r)*t;return e[0]=Math.cos(n)*i,e[1]=Math.sin(n)*i,e[2]=r*t,e}function Xn(e,t,n){var r=t[0],i=t[1],a=t[2],o=n[3]*r+n[7]*i+n[11]*a+n[15];return o=o||1,e[0]=(n[0]*r+n[4]*i+n[8]*a+n[12])/o,e[1]=(n[1]*r+n[5]*i+n[9]*a+n[13])/o,e[2]=(n[2]*r+n[6]*i+n[10]*a+n[14])/o,e}function Kn(e,t,n){var r=t[0],i=t[1],a=t[2];return e[0]=r*n[0]+i*n[3]+a*n[6],e[1]=r*n[1]+i*n[4]+a*n[7],e[2]=r*n[2]+i*n[5]+a*n[8],e}function Yn(e,t,n){var r=n[0],i=n[1],a=n[2],o=n[3],u=t[0],s=t[1],c=t[2],f=i*c-a*s,l=a*u-r*c,p=r*s-i*u,h=i*p-a*l,d=a*f-r*p,m=r*l-i*f,y=2*o;return f*=y,l*=y,p*=y,h*=2,d*=2,m*=2,e[0]=u+f+h,e[1]=s+l+d,e[2]=c+p+m,e}function Jn(e,t,n,r){var i=[],a=[];return i[0]=t[0]-n[0],i[1]=t[1]-n[1],i[2]=t[2]-n[2],a[0]=i[0],a[1]=i[1]*Math.cos(r)-i[2]*Math.sin(r),a[2]=i[1]*Math.sin(r)+i[2]*Math.cos(r),e[0]=a[0]+n[0],e[1]=a[1]+n[1],e[2]=a[2]+n[2],e}function Qn(e,t,n,r){var i=[],a=[];return i[0]=t[0]-n[0],i[1]=t[1]-n[1],i[2]=t[2]-n[2],a[0]=i[2]*Math.sin(r)+i[0]*Math.cos(r),a[1]=i[1],a[2]=i[2]*Math.cos(r)-i[0]*Math.sin(r),e[0]=a[0]+n[0],e[1]=a[1]+n[1],e[2]=a[2]+n[2],e}function Zn(e,t,n,r){var i=[],a=[];return i[0]=t[0]-n[0],i[1]=t[1]-n[1],i[2]=t[2]-n[2],a[0]=i[0]*Math.cos(r)-i[1]*Math.sin(r),a[1]=i[0]*Math.sin(r)+i[1]*Math.cos(r),a[2]=i[2],e[0]=a[0]+n[0],e[1]=a[1]+n[1],e[2]=a[2]+n[2],e}function $n(e,t){var n=e[0],r=e[1],i=e[2],a=t[0],o=t[1],u=t[2],s=Math.sqrt(n*n+r*r+i*i)*Math.sqrt(a*a+o*o+u*u),c=s&&zn(e,t)/s;return Math.acos(Math.min(Math.max(c,-1),1))}function er(e){return e[0]=0,e[1]=0,e[2]=0,e}function tr(e){return"vec3("+e[0]+", "+e[1]+", "+e[2]+")"}function nr(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function rr(e,t){var n=e[0],r=e[1],i=e[2],a=t[0],o=t[1],u=t[2];return Math.abs(n-a)<=Ue*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(r-o)<=Ue*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-u)<=Ue*Math.max(1,Math.abs(i),Math.abs(u))}var ir,ar=wn,or=Tn,ur=Dn,sr=Pn,cr=jn,fr=An,lr=Rn,pr=(ir=gn(),function(e,t,n,r,i,a){var o,u;for(t||(t=3),n||(n=0),u=r?Math.min(r*t+n,e.length):e.length,o=n;o<u;o+=t)ir[0]=e[o],ir[1]=e[o+1],ir[2]=e[o+2],i(ir,ir,a),e[o]=ir[0],e[o+1]=ir[1],e[o+2]=ir[2];return e});function hr(){var e=new We(4);return We!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function dr(e){var t=new We(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function mr(e,t,n,r){var i=new We(4);return i[0]=e,i[1]=t,i[2]=n,i[3]=r,i}function yr(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function vr(e,t,n,r,i){return e[0]=t,e[1]=n,e[2]=r,e[3]=i,e}function gr(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}function br(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}function Ar(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e[3]=t[3]*n[3],e}function Er(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e[3]=t[3]/n[3],e}function xr(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e}function Cr(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e}function Sr(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e[3]=Math.min(t[3],n[3]),e}function wr(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e[3]=Math.max(t[3],n[3]),e}function Tr(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e[3]=Math.round(t[3]),e}function Dr(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}function Br(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e[2]=t[2]+n[2]*r,e[3]=t[3]+n[3]*r,e}function _r(e,t){var n=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2],a=t[3]-e[3];return Math.hypot(n,r,i,a)}function Mr(e,t){var n=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2],a=t[3]-e[3];return n*n+r*r+i*i+a*a}function Fr(e){var t=e[0],n=e[1],r=e[2],i=e[3];return Math.hypot(t,n,r,i)}function Or(e){var t=e[0],n=e[1],r=e[2],i=e[3];return t*t+n*n+r*r+i*i}function kr(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e}function Ir(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e}function Pr(e,t){var n=t[0],r=t[1],i=t[2],a=t[3],o=n*n+r*r+i*i+a*a;return o>0&&(o=1/Math.sqrt(o)),e[0]=n*o,e[1]=r*o,e[2]=i*o,e[3]=a*o,e}function jr(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function Rr(e,t,n,r){var i=n[0]*r[1]-n[1]*r[0],a=n[0]*r[2]-n[2]*r[0],o=n[0]*r[3]-n[3]*r[0],u=n[1]*r[2]-n[2]*r[1],s=n[1]*r[3]-n[3]*r[1],c=n[2]*r[3]-n[3]*r[2],f=t[0],l=t[1],p=t[2],h=t[3];return e[0]=l*c-p*s+h*u,e[1]=-f*c+p*o-h*a,e[2]=f*s-l*o+h*i,e[3]=-f*u+l*a-p*i,e}function Nr(e,t,n,r){var i=t[0],a=t[1],o=t[2],u=t[3];return e[0]=i+r*(n[0]-i),e[1]=a+r*(n[1]-a),e[2]=o+r*(n[2]-o),e[3]=u+r*(n[3]-u),e}function Gr(e,t){var n,r,i,a,o,u;t=t||1;do{o=(n=2*qe()-1)*n+(r=2*qe()-1)*r}while(o>=1);do{u=(i=2*qe()-1)*i+(a=2*qe()-1)*a}while(u>=1);var s=Math.sqrt((1-o)/u);return e[0]=t*n,e[1]=t*r,e[2]=t*i*s,e[3]=t*a*s,e}function Lr(e,t,n){var r=t[0],i=t[1],a=t[2],o=t[3];return e[0]=n[0]*r+n[4]*i+n[8]*a+n[12]*o,e[1]=n[1]*r+n[5]*i+n[9]*a+n[13]*o,e[2]=n[2]*r+n[6]*i+n[10]*a+n[14]*o,e[3]=n[3]*r+n[7]*i+n[11]*a+n[15]*o,e}function zr(e,t,n){var r=t[0],i=t[1],a=t[2],o=n[0],u=n[1],s=n[2],c=n[3],f=c*r+u*a-s*i,l=c*i+s*r-o*a,p=c*a+o*i-u*r,h=-o*r-u*i-s*a;return e[0]=f*c+h*-o+l*-s-p*-u,e[1]=l*c+h*-u+p*-o-f*-s,e[2]=p*c+h*-s+f*-u-l*-o,e[3]=t[3],e}function Vr(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}function Ur(e){return"vec4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}function Wr(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}function qr(e,t){var n=e[0],r=e[1],i=e[2],a=e[3],o=t[0],u=t[1],s=t[2],c=t[3];return Math.abs(n-o)<=Ue*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(r-u)<=Ue*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(i-s)<=Ue*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(a-c)<=Ue*Math.max(1,Math.abs(a),Math.abs(c))}var Hr=br,Xr=Ar,Kr=Er,Yr=_r,Jr=Mr,Qr=Fr,Zr=Or,$r=function(){var e=hr();return function(t,n,r,i,a,o){var u,s;for(n||(n=4),r||(r=0),s=i?Math.min(i*n+r,t.length):t.length,u=r;u<s;u+=n)e[0]=t[u],e[1]=t[u+1],e[2]=t[u+2],e[3]=t[u+3],a(e,e,o),t[u]=e[0],t[u+1]=e[1],t[u+2]=e[2],t[u+3]=e[3];return t}}();function ei(){var e=new We(4);return We!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function ti(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function ni(e,t,n){n*=.5;var r=Math.sin(n);return e[0]=r*t[0],e[1]=r*t[1],e[2]=r*t[2],e[3]=Math.cos(n),e}function ri(e,t){var n=2*Math.acos(t[3]),r=Math.sin(n/2);return r>Ue?(e[0]=t[0]/r,e[1]=t[1]/r,e[2]=t[2]/r):(e[0]=1,e[1]=0,e[2]=0),n}function ii(e,t){var n=Li(e,t);return Math.acos(2*n*n-1)}function ai(e,t,n){var r=t[0],i=t[1],a=t[2],o=t[3],u=n[0],s=n[1],c=n[2],f=n[3];return e[0]=r*f+o*u+i*c-a*s,e[1]=i*f+o*s+a*u-r*c,e[2]=a*f+o*c+r*s-i*u,e[3]=o*f-r*u-i*s-a*c,e}function oi(e,t,n){n*=.5;var r=t[0],i=t[1],a=t[2],o=t[3],u=Math.sin(n),s=Math.cos(n);return e[0]=r*s+o*u,e[1]=i*s+a*u,e[2]=a*s-i*u,e[3]=o*s-r*u,e}function ui(e,t,n){n*=.5;var r=t[0],i=t[1],a=t[2],o=t[3],u=Math.sin(n),s=Math.cos(n);return e[0]=r*s-a*u,e[1]=i*s+o*u,e[2]=a*s+r*u,e[3]=o*s-i*u,e}function si(e,t,n){n*=.5;var r=t[0],i=t[1],a=t[2],o=t[3],u=Math.sin(n),s=Math.cos(n);return e[0]=r*s+i*u,e[1]=i*s-r*u,e[2]=a*s+o*u,e[3]=o*s-a*u,e}function ci(e,t){var n=t[0],r=t[1],i=t[2];return e[0]=n,e[1]=r,e[2]=i,e[3]=Math.sqrt(Math.abs(1-n*n-r*r-i*i)),e}function fi(e,t){var n=t[0],r=t[1],i=t[2],a=t[3],o=Math.sqrt(n*n+r*r+i*i),u=Math.exp(a),s=o>0?u*Math.sin(o)/o:0;return e[0]=n*s,e[1]=r*s,e[2]=i*s,e[3]=u*Math.cos(o),e}function li(e,t){var n=t[0],r=t[1],i=t[2],a=t[3],o=Math.sqrt(n*n+r*r+i*i),u=o>0?Math.atan2(o,a)/o:0;return e[0]=n*u,e[1]=r*u,e[2]=i*u,e[3]=.5*Math.log(n*n+r*r+i*i+a*a),e}function pi(e,t,n){return li(e,t),Gi(e,e,n),fi(e,e),e}function hi(e,t,n,r){var i,a,o,u,s,c=t[0],f=t[1],l=t[2],p=t[3],h=n[0],d=n[1],m=n[2],y=n[3];return(a=c*h+f*d+l*m+p*y)<0&&(a=-a,h=-h,d=-d,m=-m,y=-y),1-a>Ue?(i=Math.acos(a),o=Math.sin(i),u=Math.sin((1-r)*i)/o,s=Math.sin(r*i)/o):(u=1-r,s=r),e[0]=u*c+s*h,e[1]=u*f+s*d,e[2]=u*l+s*m,e[3]=u*p+s*y,e}function di(e){var t=qe(),n=qe(),r=qe(),i=Math.sqrt(1-t),a=Math.sqrt(t);return e[0]=i*Math.sin(2*Math.PI*n),e[1]=i*Math.cos(2*Math.PI*n),e[2]=a*Math.sin(2*Math.PI*r),e[3]=a*Math.cos(2*Math.PI*r),e}function mi(e,t){var n=t[0],r=t[1],i=t[2],a=t[3],o=n*n+r*r+i*i+a*a,u=o?1/o:0;return e[0]=-n*u,e[1]=-r*u,e[2]=-i*u,e[3]=a*u,e}function yi(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function vi(e,t){var n,r=t[0]+t[4]+t[8];if(r>0)n=Math.sqrt(r+1),e[3]=.5*n,n=.5/n,e[0]=(t[5]-t[7])*n,e[1]=(t[6]-t[2])*n,e[2]=(t[1]-t[3])*n;else{var i=0;t[4]>t[0]&&(i=1),t[8]>t[3*i+i]&&(i=2);var a=(i+1)%3,o=(i+2)%3;n=Math.sqrt(t[3*i+i]-t[3*a+a]-t[3*o+o]+1),e[i]=.5*n,n=.5/n,e[3]=(t[3*a+o]-t[3*o+a])*n,e[a]=(t[3*a+i]+t[3*i+a])*n,e[o]=(t[3*o+i]+t[3*i+o])*n}return e}function gi(e,t,n,r){var i=.5*Math.PI/180;t*=i,n*=i,r*=i;var a=Math.sin(t),o=Math.cos(t),u=Math.sin(n),s=Math.cos(n),c=Math.sin(r),f=Math.cos(r);return e[0]=a*s*f-o*u*c,e[1]=o*u*f+a*s*c,e[2]=o*s*c-a*u*f,e[3]=o*s*f+a*u*c,e}function bi(e){return"quat("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}var Ai,Ei,xi,Ci,Si,wi,Ti,Di,Bi,_i,Mi,Fi,Oi,ki=dr,Ii=mr,Pi=yr,ji=vr,Ri=gr,Ni=ai,Gi=Dr,Li=jr,zi=Nr,Vi=Fr,Ui=Vi,Wi=Or,qi=Wi,Hi=Pr,Xi=Wr,Ki=qr,Yi=(Ai=gn(),Ei=En(1,0,0),xi=En(0,1,0),function(e,t,n){var r=zn(t,n);return r<-.999999?(Vn(Ai,Ei,t),fr(Ai)<1e-6&&Vn(Ai,xi,t),Ln(Ai,Ai),ni(e,Ai,Math.PI),e):r>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(Vn(Ai,t,n),e[0]=Ai[0],e[1]=Ai[1],e[2]=Ai[2],e[3]=1+r,Hi(e,e))}),Ji=(Ci=ei(),Si=ei(),function(e,t,n,r,i,a){return hi(Ci,t,i,a),hi(Si,n,r,a),hi(e,Ci,Si,2*a*(1-a)),e}),Qi=(wi=He(),function(e,t,n,r){return wi[0]=n[0],wi[3]=n[1],wi[6]=n[2],wi[1]=r[0],wi[4]=r[1],wi[7]=r[2],wi[2]=-t[0],wi[5]=-t[1],wi[8]=-t[2],Hi(e,vi(e,wi))}),Zi=function(){function e(t,n){m()(this,e),this.center=void 0,this.halfExtents=void 0,this.min=a.create(),this.max=a.create(),this.update(t,n)}return v()(e,[{key:"update",value:function(e,t){this.center=e||a.create(),this.halfExtents=t||a.fromValues(.5,.5,.5),this.min=a.sub(this.min,this.center,this.halfExtents),this.max=a.add(this.max,this.center,this.halfExtents)}},{key:"setMinMax",value:function(e,t){a.add(this.center,t,e),a.scale(this.center,this.center,.5),a.sub(this.halfExtents,t,e),a.scale(this.halfExtents,this.halfExtents,.5),a.copy(this.min,e),a.copy(this.max,t)}},{key:"getMin",value:function(){return this.min}},{key:"getMax",value:function(){return this.max}},{key:"add",value:function(e){var t=this.center,n=t[0],r=t[1],i=t[2],a=this.halfExtents,o=a[0],u=a[1],s=a[2],c=n-o,f=n+o,l=r-u,p=r+u,h=i-s,d=i+s,m=e.center,y=m[0],v=m[1],g=m[2],b=e.halfExtents,A=b[0],E=b[1],x=b[2],C=y-A,S=y+A,w=v-E,T=v+E,D=g-x,B=g+x;C<c&&(c=C),S>f&&(f=S),w<l&&(l=w),T>p&&(p=T),D<h&&(h=D),B>d&&(d=B),t[0]=.5*(c+f),t[1]=.5*(l+p),t[2]=.5*(h+d),a[0]=.5*(f-c),a[1]=.5*(p-l),a[2]=.5*(d-h),this.min[0]=c,this.min[1]=l,this.min[2]=h,this.max[0]=f,this.max[1]=p,this.max[2]=d}},{key:"intersects",value:function(e){var t=this.getMax(),n=this.getMin(),r=e.getMax(),i=e.getMin();return n[0]<=r[0]&&t[0]>=i[0]&&n[1]<=r[1]&&t[1]>=i[1]&&n[2]<=r[2]&&t[2]>=i[2]}},{key:"containsPoint",value:function(e){var t=this.getMin(),n=this.getMax();return!(e[0]<t[0]||e[0]>n[0]||e[1]<t[1]||e[1]>n[1]||e[2]<t[2]||e[2]>n[2])}},{key:"getNegativeFarPoint",value:function(e){return 273===e.pnVertexFlag?a.copy(a.create(),this.min):272===e.pnVertexFlag?a.fromValues(this.min[0],this.min[1],this.max[2]):257===e.pnVertexFlag?a.fromValues(this.min[0],this.max[1],this.min[2]):256===e.pnVertexFlag?a.fromValues(this.min[0],this.max[1],this.max[2]):17===e.pnVertexFlag?a.fromValues(this.max[0],this.min[1],this.min[2]):16===e.pnVertexFlag?a.fromValues(this.max[0],this.min[1],this.max[2]):1===e.pnVertexFlag?a.fromValues(this.max[0],this.max[1],this.min[2]):a.fromValues(this.max[0],this.max[1],this.max[2])}},{key:"getPositiveFarPoint",value:function(e){return 273===e.pnVertexFlag?a.copy(a.create(),this.max):272===e.pnVertexFlag?a.fromValues(this.max[0],this.max[1],this.min[2]):257===e.pnVertexFlag?a.fromValues(this.max[0],this.min[1],this.max[2]):256===e.pnVertexFlag?a.fromValues(this.max[0],this.min[1],this.min[2]):17===e.pnVertexFlag?a.fromValues(this.min[0],this.max[1],this.max[2]):16===e.pnVertexFlag?a.fromValues(this.min[0],this.max[1],this.min[2]):1===e.pnVertexFlag?a.fromValues(this.min[0],this.min[1],this.max[2]):a.fromValues(this.min[0],this.min[1],this.min[2])}}]),e}();function $i(e){for(var t=new Zi,n=a.fromValues(e[0],e[1],e[2]),r=a.fromValues(e[0],e[1],e[2]),i=3;i<e.length;){var o=e[i++],u=e[i++],s=e[i++];o<n[0]&&(n[0]=o),u<n[1]&&(n[1]=u),s<n[2]&&(n[2]=s),o>r[0]&&(r[0]=o),u>r[1]&&(r[1]=u),s>r[2]&&(r[2]=s)}return t.setMinMax(n,r),t}function ea(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ta(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ea(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ea(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var na,ra,ia,aa,oa,ua,sa,ca,fa,la,pa,ha,da,ma,ya,va,ga=(Ti=Object(N.injectable)(),Di=Object(N.inject)(G.GeometryComponentManager),Bi=Object(N.inject)(G.RenderEngine),Ti((Mi=function(){function e(){m()(this,e),P()(this,"geometry",Fi,this),P()(this,"engine",Oi,this)}var t;return v()(e,[{key:"execute",value:(t=h()(l.a.mark((function e(){var t=this;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.geometry.forEach((function(e,n){n.dirty&&(n.attributes.forEach((function(e){e.data&&(e.buffer=t.engine.createVertexBuffer(e.data))})),n.indices&&(n.indicesBuffer=t.engine.createIndexBuffer(n.indices)),n.dirty=!1)}));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"tearDown",value:function(){this.geometry.forEach((function(e,t){t.indicesBuffer&&t.indicesBuffer.destroy(),t.attributes.forEach((function(e){e.buffer&&e.buffer.destroy()}))})),this.geometry.clear()}},{key:"setAttribute",value:function(e,t,n,r,i){var a=this.geometry.getComponentByEntity(e);a&&a.attributes.push(ta(ta({name:t,data:n},r),{},{bufferGetter:i}))}},{key:"setIndex",value:function(e,t){var n=this.geometry.getComponentByEntity(e);n&&(n.indices=new Uint32Array(t.buffer))}},{key:"createBufferGeometry",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{vertexCount:3},t=e.vertexCount,n=b();return this.geometry.create(n,{vertexCount:t}),n}},{key:"createInstancedBufferGeometry",value:function(e){var t=e.maxInstancedCount,n=e.vertexCount,r=b();return this.geometry.create(r,{maxInstancedCount:t,vertexCount:n}),r}},{key:"createBox",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.widthSegments||1,n=e.heightSegments||1,r=e.depthSegments||1,i=e.halfExtents||a.fromValues(.5,.5,.5),o=V()(i,3),u=o[0],s=o[1],c=o[2],f=[a.fromValues(-u,-s,c),a.fromValues(u,-s,c),a.fromValues(u,s,c),a.fromValues(-u,s,c),a.fromValues(u,-s,-c),a.fromValues(-u,-s,-c),a.fromValues(-u,s,-c),a.fromValues(u,s,-c)],l=[[0,1,3],[4,5,7],[3,2,6],[1,0,4],[1,4,2],[5,0,6]],p=[[0,0,1],[0,0,-1],[0,1,0],[0,-1,0],[1,0,0],[-1,0,0]],h={FRONT:0,BACK:1,TOP:2,BOTTOM:3,RIGHT:4,LEFT:5},d=[],m=[],y=[],v=[],g=[],A=0,E=function(e,t,n){var r,i,o,u;for(o=0;o<=t;o++)for(u=0;u<=n;u++){var s=a.create(),c=a.create(),h=a.create(),b=a.create();a.lerp(s,f[l[e][0]],f[l[e][1]],o/t),a.lerp(c,f[l[e][0]],f[l[e][2]],u/n),a.sub(h,c,f[l[e][0]]),a.add(b,s,h),r=o/t,i=u/n,d.push(b[0],b[1],b[2]),m.push(p[e][0],p[e][1],p[e][2]),y.push(r,i),r=.875*(r/=3)+4/64,i=.875*(i/=3)+4/64,r+=e%3/3,i+=Math.floor(e/3)/3,v.push(r,i),o<t&&u<n&&(g.push(A+n+1,A+1,A),g.push(A+n+1,A+n+2,A+1)),A++}};E(h.FRONT,t,n),E(h.BACK,t,n),E(h.TOP,t,r),E(h.BOTTOM,t,r),E(h.RIGHT,r,n),E(h.LEFT,r,n);var x=$i(d),C=b();return this.geometry.create(C,{indices:Uint32Array.from(g),aabb:x,attributes:[{name:"position",data:Float32Array.from(d),arrayStride:12,stepMode:"vertex",attributes:[{shaderLocation:0,offset:0,format:"float3"}]},{name:"normal",data:Float32Array.from(m),arrayStride:12,stepMode:"vertex",attributes:[{shaderLocation:1,offset:0,format:"float3"}]},{name:"uv",data:Float32Array.from(y),arrayStride:8,stepMode:"vertex",attributes:[{shaderLocation:2,offset:0,format:"float2"}]}]}),C}}]),e}(),Fi=R()(Mi.prototype,"geometry",[Di],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Oi=R()(Mi.prototype,"engine",[Bi],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),_i=Mi))||_i),ba=n(32),Aa=n.n(ba),Ea=(na=Object(N.injectable)(),ra=Object(N.inject)(G.SceneComponentManager),ia=Object(N.inject)(G.CameraComponentManager),na((fa=ca=function(){function e(){var t=this;m()(this,e),this.isMoving=!1,this.lastX=-1,this.lastY=-1,this.deltaX=0,this.deltaY=0,this.deltaZ=0,this.hammertime=void 0,this.canvas=void 0,P()(this,"scene",ua,this),P()(this,"camera",sa,this),this.onPanend=function(e){t.isMoving=!1},this.onPanstart=function(e){t.lastX=e.center.x,t.lastY=e.center.y,t.isMoving=!0,t.deltaZ=0},this.onPanmove=function(e){t.isMoving&&(t.deltaX=e.center.x-t.lastX,t.deltaY=e.center.y-t.lastY,t.lastX=e.center.x,t.lastY=e.center.y,t.onChangeCamera({deltaX:t.deltaX,deltaY:t.deltaY,deltaZ:t.deltaZ}))},this.onMousewheel=function(e){t.deltaZ=e.deltaY,t.onChangeCamera({deltaX:t.deltaX,deltaY:t.deltaY,deltaZ:t.deltaZ})},this.onPinch=function(e){t.deltaZ=10*(1-e.scale)},this.onChangeCamera=function(e){var n=e.deltaX,r=e.deltaY,i=e.deltaZ;t.scene.forEach((function(e,a){var o=t.camera.getComponentByEntity(a.camera);o.rotate(n,r,0),o.dolly(i)}))}}return v()(e,[{key:"initialize",value:function(e){var t=new Aa.a(e);t.get("pan").set({direction:Aa.a.DIRECTION_ALL}),t.get("pinch").set({enable:!0}),t.on("panstart",this.onPanstart),t.on("panmove",this.onPanmove),t.on("panend",this.onPanend),t.on("pinch",this.onPinch),this.hammertime=t,e.addEventListener("wheel",this.onMousewheel),this.canvas=e}},{key:"tearDown",value:function(){this.hammertime.off("panstart",this.onPanstart),this.hammertime.off("panmove",this.onPanmove),this.hammertime.off("panend",this.onPanend),this.hammertime.off("pinch",this.onPinch),this.canvas.removeEventListener("wheel",this.onMousewheel)}}]),e}(),ca.UP_EVENT="mouseup",ca.MOVE_EVENT="mousemove",ca.DOWN_EVENT="mousedown",ca.OUT_EVENT="mouseout",ca.WHEEL_EVENT="mousewheel",oa=fa,ua=R()(oa.prototype,"scene",[ra],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),sa=R()(oa.prototype,"camera",[ia],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),aa=oa))||aa);function xa(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Ca(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ca(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return o=e.done,e},e:function(e){u=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(u)throw a}}}}function Ca(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Sa(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function wa(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Sa(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Sa(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ta,Da=(la=Object(N.injectable)(),pa=Object(N.inject)(G.MaterialComponentManager),ha=Object(N.inject)(G.RenderEngine),la((ma=function(){function e(){m()(this,e),P()(this,"material",ya,this),P()(this,"engine",va,this)}var t;return v()(e,[{key:"execute",value:(t=h()(l.a.mark((function e(){var t=this;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(this.material.map(function(){var e=h()(l.a.mark((function e(n,r){return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!r.dirty){e.next=6;break}return e.next=3,t.engine.compilePipelineStageDescriptor(r.vertexShaderGLSL,r.fragmentShaderGLSL,null);case 3:r.stageDescriptor=e.sent,t.generateUniforms(r),r.dirty=!1;case 6:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()));case 2:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"tearDown",value:function(){this.material.clear()}},{key:"createBasicMaterial",value:function(e){var t=b();return this.material.create(t,wa({vertexShaderGLSL:"layout(set = 0, binding = 0) uniform Builtin {\n mat4 projectionMatrix;\n mat4 modelViewMatrix;\n} builtin;\n\nlayout(set = 0, binding = 1) uniform Uniforms {\n vec4 color;\n} uniforms;\n\nlayout(location = 0) in vec3 position;\n// layout(location = 1) in vec3 barycentric;\n\nlayout(location = 0) out vec4 fragColor;\n// layout(location = 1) out vec3 v_Barycentric;\n\nvoid main() {\n gl_Position = builtin.projectionMatrix * builtin.modelViewMatrix * vec4(position, 1.0);\n fragColor = uniforms.color;\n // v_Barycentric = barycentric;\n}",fragmentShaderGLSL:"// layout(set = 0, binding = 1) uniform WireframeUniforms {\n// float lineWidth;\n// vec4 lineColor;\n// } wireframe;\n\nlayout(location = 0) in vec4 fragColor;\n// layout(location = 1) in vec3 v_Barycentric;\n\nlayout(location = 0) out vec4 outColor;\n\n// wireframe\n// float edgeFactor() {\n// vec3 d = fwidth(v_Barycentric);\n// vec3 a3 = smoothstep(vec3(0.0), d * wireframe.lineWidth, v_Barycentric);\n// return min(min(a3.x, a3.y), a3.z);\n// }\n\nvoid main() {\n // outColor = mix(fragColor, wireframe.lineColor, (1.0 - edgeFactor()));\n outColor = fragColor;\n}"},e)),this.addBuiltinUniforms(t),t}},{key:"createShaderMaterial",value:function(e){var t=b();return this.material.create(t,wa({vertexShaderGLSL:e.vertexShader,fragmentShaderGLSL:e.fragmentShader},e)),this.addBuiltinUniforms(t),t}},{key:"addUniform",value:function(e,t){var n=this.material.getComponentByEntity(e),r=n.uniforms[t.binding]||{},i=r.uniforms,a=r.length;i||(n.uniforms[t.binding]={uniforms:[],length:0});var o,u="float4"===(o=t.format)?4:"float3"===o?3:"float2"===o?2:"float"===o?1:"mat3"===o?9:"mat4"===o?16:0;n.uniforms[t.binding].uniforms.push({binding:t.binding,name:t.name,format:t.format,offset:a||0,length:u,data:t.data,dirty:t.dirty}),n.uniforms[t.binding].length+=4*u}},{key:"setUniform",value:function(e,t,n){var r,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=this.material.getComponentByEntity(e),o=xa(a.uniforms);try{for(o.s();!(r=o.n()).done;){var u=r.value,s=u.uniforms.find((function(e){return e.name===t}));if(s)return void(i?u.buffer&&n&&(this.engine.setSubData(u.buffer,s.offset||0,n),s.dirty=!1):(s.dirty=!0,s.data=n))}}catch(e){o.e(e)}finally{o.f()}}},{key:"addBuiltinUniforms",value:function(e){this.addUniform(e,{binding:0,name:"projectionMatrix",format:"mat4",data:null,dirty:!0}),this.addUniform(e,{binding:0,name:"modelViewMatrix",format:"mat4",data:null,dirty:!0})}},{key:"generateUniforms",value:function(e){var t=this,n=e.uniforms.map((function(e,t){return{binding:t,visibility:3,type:"uniform-buffer"}}));e.uniformsBindGroupLayout=this.engine.getDevice().createBindGroupLayout({entries:n}),e.pipelineLayout=this.engine.getDevice().createPipelineLayout({bindGroupLayouts:[e.uniformsBindGroupLayout]});var r=e.uniforms.map((function(e,n){var r=t.engine.createUniformBuffer(new Float32Array(e.length));return e.buffer=r,{binding:n,resource:{buffer:r}}}));e.uniformBindGroup=this.engine.getDevice().createBindGroup({layout:e.uniformsBindGroupLayout,entries:r})}}]),e}(),ya=R()(ma.prototype,"material",[pa],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),va=R()(ma.prototype,"engine",[ha],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),da=ma))||da),Ba=function(){function e(t,n){m()(this,e),this.distance=void 0,this.normal=void 0,this.pnVertexFlag=void 0,this.distance=t||0,this.normal=n||a.fromValues(0,1,0),this.updatePNVertexFlag()}return v()(e,[{key:"updatePNVertexFlag",value:function(){this.pnVertexFlag=(Number(this.normal[0]>=0)<<8)+(Number(this.normal[1]>=0)<<4)+Number(this.normal[2]>=0)}},{key:"distanceToPoint",value:function(e){return a.dot(e,this.normal)-this.distance}},{key:"normalize",value:function(){var e=1/a.len(this.normal);a.scale(this.normal,this.normal,e),this.distance*=e}},{key:"intersectsLine",value:function(e,t,n){var r=this.distanceToPoint(e),i=r/(r-this.distanceToPoint(t)),o=i>=0&&i<=1;return o&&n&&a.lerp(n,e,t,i),o}}]),e}();!function(e){e[e.OUTSIDE=4294967295]="OUTSIDE",e[e.INSIDE=0]="INSIDE",e[e.INDETERMINATE=2147483647]="INDETERMINATE"}(Ta||(Ta={}));var _a,Ma,Fa,Oa,ka,Ia,Pa,ja,Ra,Na,Ga,La,za,Va,Ua,Wa,qa,Ha,Xa,Ka,Ya,Ja=function(){function e(t){if(m()(this,e),this.planes=[],t)this.planes=t;else for(var n=0;n<6;n++)this.planes.push(new Ba)}return v()(e,[{key:"extractFromVPMatrix",value:function(e){var t=V()(e,16),n=t[0],r=t[1],i=t[2],o=t[3],u=t[4],s=t[5],c=t[6],f=t[7],l=t[8],p=t[9],h=t[10],d=t[11],m=t[12],y=t[13],v=t[14],g=t[15];a.set(this.planes[0].normal,o-n,f-u,d-l),this.planes[0].distance=-(g-m),a.set(this.planes[1].normal,o+n,f+u,d+l),this.planes[1].distance=-(g+m),a.set(this.planes[2].normal,o+r,f+s,d+p),this.planes[2].distance=-(g+y),a.set(this.planes[3].normal,o-r,f-s,d-p),this.planes[3].distance=-(g-y),a.set(this.planes[4].normal,o-i,f-c,d-h),this.planes[4].distance=-(g-v),a.set(this.planes[5].normal,o+i,f+c,d+h),this.planes[5].distance=-(g+v),this.planes.forEach((function(e){e.normalize(),e.updatePNVertexFlag()}))}}]),e}(),Qa=n(51),Za=n.n(Qa);function $a(e){return void 0===e?0:e>360||e<-360?e%360:e}function eo(e,t,n){return Za()(e)?a.fromValues(e,t,n):3===e.length?a.clone(e):a.fromValues(e[0],e[1],e[2])}var to,no,ro,io,ao,oo,uo,so,co,fo,lo,po,ho,mo,yo,vo,go=(_a=Object(N.injectable)(),Ma=Object(N.inject)(G.SceneComponentManager),Fa=Object(N.inject)(G.CameraComponentManager),Oa=Object(N.inject)(G.MeshComponentManager),ka=Object(N.inject)(G.CullableComponentManager),Ia=Object(N.inject)(G.GeometryComponentManager),Pa=Object(N.inject)(G.MaterialComponentManager),ja=Object(N.inject)(G.HierarchyComponentManager),Ra=Object(N.inject)(G.NameComponentManager),Na=Object(N.inject)(G.TransformComponentManager),_a((La=function(){function e(){m()(this,e),P()(this,"scene",za,this),P()(this,"camera",Va,this),P()(this,"mesh",Ua,this),P()(this,"cullable",Wa,this),P()(this,"geometry",qa,this),P()(this,"material",Ha,this),P()(this,"hierarchy",Xa,this),P()(this,"nameManager",Ka,this),P()(this,"transform",Ya,this),this.planes=void 0}var t;return v()(e,[{key:"setFrustumPlanes",value:function(e){this.planes=e}},{key:"execute",value:(t=h()(l.a.mark((function e(){var t=this;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.scene.forEach((function(e,n){var i=t.camera.getComponentByEntity(n.camera);t.mesh.forEach((function(e,n){var o,u,s=t.hierarchy.getComponentByEntity(e),c=t.cullable.getComponentByEntity(e),f=t.geometry.getComponentByEntity(n.geometry),l=t.transform.getComponentByEntity(e);if(f&&f.aabb&&l&&n.aabbDirty){var p=l.worldTransform,h=f.aabb,d=h.center,m=h.halfExtents,y=a.transformMat4(a.create(),d,p),v=(o=p,(u=r.create())[0]=o[0],u[1]=o[1],u[2]=o[2],u[3]=o[4],u[4]=o[5],u[5]=o[6],u[6]=o[8],u[7]=o[9],u[8]=o[10],u),g=a.transformMat3(a.create(),m,v);n.aabb.update(y,g),n.aabbDirty=!1}if(c&&f){var b=t.cullable.getComponentByEntity((null==s?void 0:s.parentID)||-1);c.visibilityPlaneMask=t.computeVisibilityWithPlaneMask(n.aabb,(null==b?void 0:b.visibilityPlaneMask)||Ta.INDETERMINATE,t.planes||i.getFrustum().planes),c.visible=c.visibilityPlaneMask!==Ta.OUTSIDE}}))}));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"tearDown",value:function(){this.cullable.clear(),this.mesh.clear()}},{key:"createMesh",value:function(e){var t=b();return this.mesh.create(t,e),this.transform.create(t),this.cullable.create(t),t}},{key:"computeVisibilityWithPlaneMask",value:function(e,t,n){if(t===Ta.OUTSIDE||t===Ta.INSIDE)return t;for(var r=Ta.INSIDE,i=0,o=n.length;i<o;++i){var u=i<31?1<<i:0;if(!(i<31&&0==(t&u))){var s=n[i],c=s.normal,f=s.distance;if(a.dot(c,e.getNegativeFarPoint(n[i]))+f>0)return Ta.OUTSIDE;a.dot(c,e.getPositiveFarPoint(n[i]))+f>0&&(r|=u)}}return r}}]),e}(),za=R()(La.prototype,"scene",[Ma],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Va=R()(La.prototype,"camera",[Fa],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ua=R()(La.prototype,"mesh",[Oa],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Wa=R()(La.prototype,"cullable",[ka],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),qa=R()(La.prototype,"geometry",[Ia],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ha=R()(La.prototype,"material",[Pa],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Xa=R()(La.prototype,"hierarchy",[ja],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ka=R()(La.prototype,"nameManager",[Ra],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ya=R()(La.prototype,"transform",[Na],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ga=La))||Ga),bo=(to=Object(N.injectable)(),no=Object(N.inject)(G.SceneComponentManager),to((io=function(){function e(){m()(this,e),P()(this,"scene",ao,this)}var t;return v()(e,[{key:"execute",value:(t=h()(l.a.mark((function e(){return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)}))),function(){return t.apply(this,arguments)})},{key:"tearDown",value:function(){this.scene.clear()}},{key:"createScene",value:function(e){var t=e.camera,n=b();return this.scene.create(n,{camera:t}),n}},{key:"addMesh",value:function(e,t){var n=this.scene.getComponentByEntity(e);n&&n.meshes.push(t)}}]),e}(),ao=R()(io.prototype,"scene",[no],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ro=io))||ro),Ao=(oo=Object(N.injectable)(),uo=Object(N.inject)(G.HierarchyComponentManager),so=Object(N.inject)(G.TransformComponentManager),co=Object(N.inject)(G.MeshComponentManager),oo((lo=function(){function e(){m()(this,e),P()(this,"hierarchy",po,this),P()(this,"transform",ho,this),P()(this,"mesh",mo,this)}var t;return v()(e,[{key:"execute",value:(t=h()(l.a.mark((function e(){return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.runTransformUpdateSystem(),this.runHierarchyUpdateSystem();case 2:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"tearDown",value:function(){this.hierarchy.clear(),this.transform.clear()}},{key:"getHierarchyComponentManager",value:function(){return this.hierarchy}},{key:"getTransformComponentManager",value:function(){return this.transform}},{key:"runTransformUpdateSystem",value:function(){var e=this;this.transform.forEach((function(t,n){if(n.isDirty()){var r=e.mesh.getComponentByEntity(t);r&&(r.aabbDirty=!0),n.updateTransform()}}))}},{key:"runHierarchyUpdateSystem",value:function(){var e=this;this.hierarchy.forEach((function(t,n){var r=e.transform.getComponentByEntity(t),i=e.transform.getComponentByEntity(n.parentID);null!==r&&null!==i&&r.updateTransformWithParent(i)}))}},{key:"attach",value:function(e,t,n){if(this.hierarchy.contains(e)&&this.detach(e),this.hierarchy.create(e,{parentID:t}),this.hierarchy.getCount()>1)for(var r=this.hierarchy.getCount()-1;r>0;--r)for(var a=this.hierarchy.getEntity(r),o=0;o<r;++o){if(this.hierarchy.getComponent(o).parentID===a){this.hierarchy.moveItem(r,o),++r;break}}this.hierarchy.getComponentByEntity(e);var u=this.transform.getComponentByEntity(t);null===u&&(u=this.transform.create(t));var s=this.transform.getComponentByEntity(e);null===s&&(s=this.transform.create(e),u=this.transform.getComponentByEntity(t)),!n&&u&&(s.matrixTransform(i.invert(i.create(),u.worldTransform)),s.updateTransform()),u&&s.updateTransformWithParent(u)}},{key:"detach",value:function(e){if(null!==this.hierarchy.getComponentByEntity(e)){var t=this.transform.getComponentByEntity(e);null!==t&&t.applyTransform(),this.hierarchy.removeKeepSorted(e)}}},{key:"detachChildren",value:function(e){for(var t=0;t<this.hierarchy.getCount();){var n;if((null===(n=this.hierarchy.getComponent(t))||void 0===n?void 0:n.parentID)===e){var r=this.hierarchy.getEntity(t);this.detach(r)}else++t}}}]),e}(),po=R()(lo.prototype,"hierarchy",[uo],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ho=R()(lo.prototype,"transform",[so],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),mo=R()(lo.prototype,"mesh",[co],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),fo=lo))||fo),Eo=function(){function e(t,n){m()(this,e),this.name=void 0,this.matrix=void 0,this.right=void 0,this.up=void 0,this.forward=void 0,this.position=void 0,this.focalPoint=void 0,this.distanceVector=void 0,this.distance=void 0,this.dollyingStep=void 0,this.azimuth=0,this.elevation=0,this.roll=0,this.relAzimuth=0,this.relElevation=0,this.relRoll=0,this.name=t,this.matrix=i.clone(n.matrix),this.right=a.clone(n.right),this.up=a.clone(n.up),this.forward=a.clone(n.forward),this.position=a.clone(n.position),this.focalPoint=a.clone(n.focalPoint),this.distanceVector=a.clone(n.distanceVector),this.azimuth=n.azimuth,this.elevation=n.elevation,this.roll=n.roll,this.relAzimuth=n.relAzimuth,this.relElevation=n.relElevation,this.relRoll=n.relRoll,this.dollyingStep=n.dollyingStep,this.distance=n.distance}return v()(e,[{key:"retrieve",value:function(e){e.matrix=i.copy(e.matrix,this.matrix),e.right=a.copy(e.right,this.right),e.up=a.copy(e.up,this.up),e.forward=a.copy(e.forward,this.forward),e.position=a.copy(e.position,this.position),e.focalPoint=a.copy(e.focalPoint,this.focalPoint),e.distanceVector=a.copy(e.distanceVector,this.distanceVector),e.azimuth=this.azimuth,e.elevation=this.elevation,e.roll=this.roll,e.relAzimuth=this.relAzimuth,e.relElevation=this.relElevation,e.relRoll=this.relRoll,e.dollyingStep=this.dollyingStep,e.distance=this.distance}}]),e}();function xo(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=oe()(e);if(t){var i=oe()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ie()(this,n)}}!function(e){e.ORBITING="ORBITING",e.EXPLORING="EXPLORING",e.TRACKING="TRACKING"}(yo||(yo={})),function(e){e.DEFAULT="DEFAULT",e.ROTATIONAL="ROTATIONAL",e.TRANSLATIONAL="TRANSLATIONAL",e.CINEMATIC="CINEMATIC"}(vo||(vo={}));var Co=Math.PI/180,So=180/Math.PI,wo=function(e){ne()(n,e);var t=xo(n);function n(e){var r;return m()(this,n),(r=t.call(this,e)).matrix=i.create(),r.right=a.fromValues(1,0,0),r.up=a.fromValues(0,1,0),r.forward=a.fromValues(0,0,1),r.position=a.fromValues(0,0,1),r.focalPoint=a.fromValues(0,0,0),r.distanceVector=a.fromValues(0,0,0),r.distance=1,r.azimuth=0,r.elevation=0,r.roll=0,r.relAzimuth=0,r.relElevation=0,r.relRoll=0,r.dollyingStep=0,r.rotateWorld=!1,r.fov=30,r.near=.1,r.far=1e4,r.aspect=1,r.perspective=i.create(),r.following=void 0,r.type=yo.EXPLORING,r.trackingMode=vo.DEFAULT,r.frustum=new Ja,r}return v()(n,[{key:"getPerspective",value:function(){return this.perspective}},{key:"getFrustum",value:function(){return this.frustum}},{key:"setType",value:function(e,t){this.type=e,this.type===yo.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===yo.TRACKING&&void 0!==t&&this.setTrackingMode(t)}},{key:"setTrackingMode",value:function(e){if(this.type!==yo.TRACKING)throw new Error("Impossible to set a tracking mode if the camera is not of tracking type");this.trackingMode=e}},{key:"setWorldRotation",value:function(e){this.rotateWorld=e,this._getAngles()}},{key:"getViewTransform",value:function(){return i.invert(i.create(),this.matrix)}},{key:"setMatrix",value:function(e){this.matrix=e,this._update()}},{key:"setPerspective",value:function(e,t,n,r){this.fov=n,this.near=e,this.far=t,this.aspect=r,this.updatePerspective()}},{key:"updatePerspective",value:function(){i.perspective(this.perspective,this.fov*Co,this.aspect,this.near,this.far)}},{key:"setPosition",value:function(e,t,n){return this._setPosition(e,t,n),this.setFocalPoint(this.focalPoint),this}},{key:"setFocalPoint",value:function(e,t,n){var r=a.fromValues(0,1,0);if(this.focalPoint=eo(e,t,n),this.trackingMode===vo.CINEMATIC){var o=a.subtract(a.create(),this.focalPoint,this.position);e=o[0],t=o[1],n=o[2];var u=a.length(o),s=Math.asin(t/u)*So,c=90+Math.atan2(n,e)*So,f=i.create();i.rotateY(f,f,c*Co),i.rotateX(f,f,s*Co),r=a.transformMat4(a.create(),[0,1,0],f)}return i.invert(this.matrix,i.lookAt(i.create(),this.position,this.focalPoint,r)),this._getAxes(),this._getDistance(),this._getAngles(),this}},{key:"setDistance",value:function(e){if(!(this.distance===e||e<0)){this.distance=e,this.dollyingStep=this.distance/100;var t=a.create(),n=this.forward,r=this.focalPoint;return t[0]=e*n[0]+r[0],t[1]=e*n[1]+r[1],t[2]=e*n[2]+r[2],this._setPosition(t),this}}},{key:"changeAzimuth",value:function(e){return this.setAzimuth(this.azimuth+e),this}},{key:"changeElevation",value:function(e){return this.setElevation(this.elevation+e),this}},{key:"changeRoll",value:function(e){return this.setRoll(this.roll+e),this}},{key:"setAzimuth",value:function(e){return this.azimuth=$a(e),this.computeMatrix(),this._getAxes(),this.type===yo.ORBITING||this.type===yo.EXPLORING?this._getPosition():this.type===yo.TRACKING&&this._getFocalPoint(),this}},{key:"getAzimuth",value:function(){return this.azimuth}},{key:"setElevation",value:function(e){return this.elevation=$a(e),this.computeMatrix(),this._getAxes(),this.type===yo.ORBITING||this.type===yo.EXPLORING?this._getPosition():this.type===yo.TRACKING&&this._getFocalPoint(),this}},{key:"setRoll",value:function(e){return this.roll=$a(e),this.computeMatrix(),this._getAxes(),this.type===yo.ORBITING||this.type===yo.EXPLORING?this._getPosition():this.type===yo.TRACKING&&this._getFocalPoint(),this}},{key:"rotate",value:function(e,t,n){if(this.type===yo.EXPLORING){e=$a(e),t=$a(t),n=$a(n);var r=u.setAxisAngle(u.create(),[1,0,0],(this.rotateWorld?1:-1)*t*Co),a=u.setAxisAngle(u.create(),[0,1,0],(this.rotateWorld?1:-1)*e*Co),o=u.setAxisAngle(u.create(),[0,0,1],n*Co),s=u.multiply(u.create(),a,r);s=u.multiply(u.create(),s,o);var c=i.fromQuat(i.create(),s);i.translate(this.matrix,this.matrix,[0,0,-this.distance]),i.multiply(this.matrix,this.matrix,c),i.translate(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation+t)>90)return;this.relElevation=$a(t),this.relAzimuth=$a(e),this.relRoll=$a(n),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.computeMatrix()}return this._getAxes(),this.type===yo.ORBITING||this.type===yo.EXPLORING?this._getPosition():this.type===yo.TRACKING&&this._getFocalPoint(),this._update(),this}},{key:"pan",value:function(e,t){var n=eo(e,t,0),r=a.clone(this.position);return a.add(r,r,a.scale(a.create(),this.right,n[0])),a.add(r,r,a.scale(a.create(),this.up,n[1])),this._setPosition(r),this}},{key:"dolly",value:function(e){var t=this.forward,n=a.clone(this.position),r=e*this.dollyingStep;return n[0]+=r*t[0],n[1]+=r*t[1],n[2]+=r*t[2],this._setPosition(n),this.type===yo.ORBITING||this.type===yo.EXPLORING?this._getDistance():this.type===yo.TRACKING&&a.add(this.focalPoint,n,this.distanceVector),this}},{key:"createLandmark",value:function(e){return new Eo(e,this)}},{key:"_update",value:function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles()}},{key:"computeMatrix",value:function(){var e,t,n=u.setAxisAngle(u.create(),[0,0,1],this.roll*Co);i.identity(this.matrix),e=u.setAxisAngle(u.create(),[1,0,0],(this.rotateWorld||this.type===yo.TRACKING?1:-1)*this.elevation*Co),t=u.setAxisAngle(u.create(),[0,1,0],(this.rotateWorld?1:-1)*this.azimuth*Co);var r=u.multiply(u.create(),t,e);r=u.multiply(u.create(),r,n);var a=i.fromQuat(i.create(),r);this.type===yo.ORBITING||this.type===yo.EXPLORING?(i.translate(this.matrix,this.matrix,this.focalPoint),i.multiply(this.matrix,this.matrix,a),i.translate(this.matrix,this.matrix,[0,0,this.distance])):this.type===yo.TRACKING&&(i.translate(this.matrix,this.matrix,this.position),i.multiply(this.matrix,this.matrix,a))}},{key:"_setPosition",value:function(e,t,n){this.position=eo(e,t,n);var r=this.matrix;r[12]=this.position[0],r[13]=this.position[1],r[14]=this.position[2],r[15]=1}},{key:"_getAxes",value:function(){a.copy(this.right,eo(o.transformMat4(o.create(),[1,0,0,0],this.matrix))),a.copy(this.up,eo(o.transformMat4(o.create(),[0,1,0,0],this.matrix))),a.copy(this.forward,eo(o.transformMat4(o.create(),[0,0,1,0],this.matrix))),a.normalize(this.right,this.right),a.normalize(this.up,this.up),a.normalize(this.forward,this.forward)}},{key:"_getAngles",value:function(){var e=this.distanceVector[0],t=this.distanceVector[1],n=this.distanceVector[2],r=a.length(this.distanceVector);if(0===r)return this.elevation=0,void(this.azimuth=0);this.type===yo.TRACKING||this.rotateWorld?(this.elevation=Math.asin(t/r)*So,this.azimuth=Math.atan2(-e,-n)*So):(this.elevation=-Math.asin(t/r)*So,this.azimuth=-Math.atan2(-e,-n)*So)}},{key:"_getPosition",value:function(){a.copy(this.position,eo(o.transformMat4(o.create(),[0,0,0,1],this.matrix))),this._getDistance()}},{key:"_getFocalPoint",value:function(){a.transformMat3(this.distanceVector,[0,0,-this.distance],r.fromMat4(r.create(),this.matrix)),a.add(this.focalPoint,this.position,this.distanceVector),this._getDistance()}},{key:"_getDistance",value:function(){this.distanceVector=a.subtract(a.create(),this.focalPoint,this.position),this.distance=a.length(this.distanceVector),this.dollyingStep=this.distance/100}}]),n}(O);function To(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=oe()(e);if(t){var i=oe()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ie()(this,n)}}var Do=function(e){ne()(n,e);var t=To(n);function n(e){var r;return m()(this,n),(r=t.call(this,e)).type="layout",r.strategy=void 0,r.dirty=!0,r.rawShaderCode=void 0,r.precompiled=!1,r.compiledBundle=void 0,r.stageDescriptor=void 0,r.pipelineLayout=void 0,r.bindings=[],r.dispatch=void 0,r.particleBuffers=new Array(2),r.particleBindGroups=new Array(2),r.iteration=0,r.maxIteration=void 0,r.finished=!1,r.onCompleted=void 0,Object.assign(ee()(r),e),r}return n}(O);function Bo(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=oe()(e);if(t){var i=oe()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ie()(this,n)}}var _o,Mo=function(e){ne()(n,e);var t=Bo(n);function n(e){var r;return m()(this,n),(r=t.call(this,e)).vertexShaderGLSL=void 0,r.fragmentShaderGLSL=void 0,r.dirty=!0,r.stageDescriptor=void 0,r.primitiveTopology="triangle-list",r.uniforms=[],r.uniformsBindGroupLayout=void 0,r.pipelineLayout=void 0,r.uniformBindGroup=void 0,r.colorStates=void 0,r.depthStencilState=void 0,r.rasterizationState=void 0,Object.assign(ee()(r),e),r}return n}(O);function Fo(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=oe()(e);if(t){var i=oe()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ie()(this,n)}}!function(e){e[e.Standard=0]="Standard"}(_o||(_o={}));var Oo=function(e){ne()(n,e);var t=Fo(n);function n(e){var r;return m()(this,n),(r=t.call(this,e)).strategy=_o.Standard,r.visibilityPlaneMask=0,r.visible=!1,Object.assign(ee()(r),e),r}return n}(O);function ko(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=oe()(e);if(t){var i=oe()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ie()(this,n)}}var Io=function(e){ne()(n,e);var t=ko(n);function n(e){var r;return m()(this,n),(r=t.call(this,e)).material=void 0,r.geometry=void 0,r.aabb=new Zi,r.aabbDirty=!0,Object.assign(ee()(r),e),r}return n}(O);function Po(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=oe()(e);if(t){var i=oe()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ie()(this,n)}}var jo=function(e){ne()(n,e);var t=Po(n);function n(e){var r,o,s,c,f,l,p,h,d,y,v,g,b,A,E;return m()(this,n),(r=t.call(this,e)).dirtyFlag=void 0,r.localTranslation=a.fromValues(0,0,0),r.localRotation=u.fromValues(0,0,0,1),r.localScale=a.fromValues(1,1,1),r.localTransform=i.create(),r.worldTransform=i.create(),r.getRotation=(o=u.create(),function(){return i.getRotation(o,r.worldTransform),o}),r.getScale=(s=a.create(),function(){return i.getScaling(s,r.worldTransform),s}),r.getPosition=(c=a.create(),function(){return i.getTranslation(c,r.worldTransform),c}),r.getLocalMatrix=(f=i.create(),function(){return i.fromRotationTranslationScale(f,r.localRotation,r.localTranslation,r.localScale),f}),r.matrixTransform=(l=i.create(),function(e){i.multiply(l,r.getLocalMatrix(),e),i.getScaling(r.localScale,l),i.getTranslation(r.localTranslation,l),i.getRotation(r.localRotation,l)}),r.rotateRollPitchYaw=(p=u.create(),h=u.create(),d=u.create(),function(e,t,n){r.setDirty(),u.fromEuler(p,e,0,0),u.fromEuler(h,0,t,0),u.fromEuler(d,0,0,n),u.multiply(r.localRotation,p,r.localRotation),u.multiply(r.localRotation,r.localRotation,h),u.multiply(r.localRotation,d,r.localRotation),u.normalize(r.localRotation,r.localRotation)}),r.lerp=(y=a.create(),v=u.create(),g=a.create(),b=a.create(),A=u.create(),E=a.create(),function(e,t,n){r.setDirty(),i.getScaling(y,e.worldTransform),i.getTranslation(g,e.worldTransform),i.getRotation(v,e.worldTransform),i.getScaling(b,t.worldTransform),i.getTranslation(E,t.worldTransform),i.getRotation(A,t.worldTransform),a.lerp(r.localScale,y,b,n),u.slerp(r.localRotation,v,A,n),a.lerp(r.localTranslation,g,E,n)}),r}return v()(n,[{key:"isDirty",value:function(){return this.dirtyFlag}},{key:"setDirty",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];e?this.dirtyFlag|=n.DIRTY:this.dirtyFlag&=~n.DIRTY}},{key:"updateTransform",value:function(){this.isDirty()&&(this.setDirty(!1),i.copy(this.worldTransform,this.getLocalMatrix()))}},{key:"updateTransformWithParent",value:function(e){i.multiply(this.worldTransform,this.getLocalMatrix(),e.worldTransform)}},{key:"applyTransform",value:function(){this.setDirty(),i.getScaling(this.localScale,this.worldTransform),i.getTranslation(this.localTranslation,this.worldTransform),i.getRotation(this.localRotation,this.worldTransform)}},{key:"clearTransform",value:function(){this.setDirty(),this.localTranslation=a.fromValues(0,0,0),this.localRotation=u.fromValues(0,0,0,1),this.localScale=a.fromValues(1,1,1)}},{key:"translate",value:function(e){this.setDirty(),a.add(this.localTranslation,this.localTranslation,e)}},{key:"scale",value:function(e){this.setDirty(),a.multiply(this.localScale,this.localScale,e)}},{key:"rotate",value:function(e){this.setDirty(),u.multiply(this.localRotation,this.localRotation,e),u.normalize(this.localRotation,this.localRotation)}}]),n}(O);jo.DIRTY=1;var Ro,No,Go,Lo,zo,Vo,Uo,Wo,qo,Ho,Xo=n(46),Ko=n(52),Yo=n.n(Ko),Jo=n(53),Qo=n.n(Jo),Zo=(Ro=Object(N.injectable)(),No=Object(N.inject)(G.RenderEngine),Ro((Lo=function(){function e(){m()(this,e),this.component=void 0,P()(this,"engine",zo,this)}return v()(e,[{key:"init",value:function(e){var t=this,n=this.component;if(this.engine.supportWebGPU){var r=e.uniforms.filter((function(e){return"sampler2D"===e.type||"image2D"})),i=e.uniforms.filter((function(e){return"sampler2D"!==e.type&&"image2D"!==e.type})),a=i.length?1:0,o=[],u=[];if(a){var s=Qo()(i.map((function(e){return e.data}))),c=this.engine.createUniformBuffer(s);o.push({binding:0,visibility:4,type:"uniform-buffer"}),u.push({binding:0,resource:{buffer:c,offset:0,size:4*s.length}})}r.forEach((function(n){if(n.data)if("sampler2D"===n.type){var r=t.engine.createVertexBuffer(isFinite(Number(n.data))?[n.data]:n.data,128);n.name===e.output.name&&(e.output={name:n.name,length:isFinite(Number(n.data))?1:n.data.length,typedArrayConstructor:Float32Array,gpuBuffer:r}),u.push({binding:a,resource:{buffer:r,offset:0,size:(isFinite(Number(n.data))?1:n.data.length)*(isFinite(Number(n.data))?1:n.data.BYTES_PER_ELEMENT||4)}}),o.push({binding:a,visibility:4,type:"storage-buffer"}),a++}else if("image2D"===n.type){if(!n.size)throw new Error("The size of ".concat(n.name," must be declared."));var i=t.engine.createTexture(n.size,n.data,4),s=t.engine.createSampler({magFilter:"linear",minFilter:"linear"});u.push({binding:a,resource:i.createView()}),u.push({binding:a+1,resource:s}),o.push({binding:a,visibility:4,type:"sampled-texture"}),o.push({binding:a+1,visibility:4,type:"sampler"}),a+=2}}));var f=this.engine.getDevice().createBindGroupLayout({entries:o});n.pipelineLayout=this.engine.getDevice().createPipelineLayout({bindGroupLayouts:[f]}),n.particleBindGroups[0]=this.engine.getDevice().createBindGroup({layout:f,entries:u})}}},{key:"run",value:function(){for(;this.component.iteration<=this.component.maxIteration-1;)this.engine.dispatch(this.component.compiledBundle.context),this.component.iteration++}},{key:"getBindingGroup",value:function(){return this.component.particleBindGroups[0]}},{key:"getGPUBuffer",value:function(){return this.component.particleBuffers[0]}},{key:"destroy",value:function(){this.component.particleBuffers[0]&&this.component.particleBuffers[0].destroy()}}]),e}(),zo=R()(Lo.prototype,"engine",[No],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Go=Lo))||Go),$o=(Vo=Object(N.injectable)(),Uo=Object(N.inject)(G.RenderEngine),Vo((qo=function(){function e(){m()(this,e),this.component=void 0,P()(this,"engine",Ho,this)}return v()(e,[{key:"init",value:function(){var e=this.component,t=this.engine.getDevice().createBindGroupLayout({entries:[{binding:0,visibility:4,type:"storage-buffer"},{binding:1,visibility:4,type:"storage-buffer"}]});e.pipelineLayout=this.engine.getDevice().createPipelineLayout({bindGroupLayouts:[t]})}},{key:"run",value:function(){this.engine.dispatch(this.component.compiledBundle.context),this.component.iteration++}},{key:"getBindingGroup",value:function(){return this.component.particleBindGroups[this.component.iteration%2]}},{key:"getGPUBuffer",value:function(){return this.component.particleBuffers[this.component.iteration%2]}},{key:"destroy",value:function(){this.component.particleBuffers.forEach((function(e){return e.destroy()}))}}]),e}(),Ho=R()(qo.prototype,"engine",[Uo],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Wo=qo))||Wo);function eu(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=oe()(e);if(t){var i=oe()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ie()(this,n)}}var tu=function(e){ne()(n,e);var t=eu(n);function n(e){var r;return m()(this,n),(r=t.call(this,e)).writer=void 0,r.inputResources=[],r.outputResources=[],r.nexts=[],r.prevs=[],r.compiled=!1,r.ref=0,r}return v()(n,[{key:"setup",value:function(){}},{key:"execute",value:function(){}}]),n}(O);function nu(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=oe()(e);if(t){var i=oe()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ie()(this,n)}}var ru=function(e){ne()(n,e);var t=nu(n);function n(e){var r;return m()(this,n),(r=t.call(this,e)).writer=void 0,r.writer=e.writer||-1,r}return n}(O);function iu(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=oe()(e);if(t){var i=oe()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ie()(this,n)}}var au,ou,uu,su,cu,fu,lu,pu,hu,du,mu,yu,vu,gu,bu,Au,Eu,xu,Cu,Su,wu,Tu,Du=function(e){ne()(n,e);var t=iu(n);function n(e){var r;return m()(this,n),(r=t.call(this,e)).dirty=!0,r.attributes=[],r.indices=void 0,r.indicesBuffer=void 0,r.vertexCount=void 0,r.maxInstancedCount=void 0,r.aabb=void 0,Object.assign(ee()(r),e),r}return n}(O);function Bu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Bu(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Mu=(au=Object(N.injectable)(),ou=Object(N.inject)(G.SceneComponentManager),uu=Object(N.inject)(G.CameraComponentManager),su=Object(N.inject)(G.MeshComponentManager),cu=Object(N.inject)(G.GeometryComponentManager),fu=Object(N.inject)(G.MaterialComponentManager),lu=Object(N.inject)(G.CullableComponentManager),pu=Object(N.inject)(G.TransformComponentManager),hu=Object(N.inject)(G.Systems),du=Object(N.named)(G.MaterialSystem),mu=Object(N.inject)(G.RenderEngine),au((vu=function(){function e(){m()(this,e),P()(this,"scene",gu,this),P()(this,"camera",bu,this),P()(this,"mesh",Au,this),P()(this,"geometry",Eu,this),P()(this,"material",xu,this),P()(this,"cullable",Cu,this),P()(this,"transform",Su,this),P()(this,"materialSystem",wu,this),P()(this,"engine",Tu,this)}return v()(e,[{key:"render",value:function(){var e=this;this.scene.forEach((function(t,n){var r=e.camera.getComponentByEntity(n.camera),a=r.getViewTransform(),o=i.multiply(i.create(),r.getPerspective(),a);r.getFrustum().extractFromVPMatrix(o),n.meshes.forEach((function(t){var n;if(null===(n=e.cullable.getComponentByEntity(t))||void 0===n?void 0:n.visible){var o=e.mesh.getComponentByEntity(t),u=e.material.getComponentByEntity(o.material),s=e.geometry.getComponentByEntity(o.geometry);if(!u.dirty&&!s.dirty){var c=e.transform.getComponentByEntity(t);if(c){var f=i.multiply(i.create(),a,c.worldTransform);e.materialSystem.setUniform(o.material,"projectionMatrix",r.getPerspective()),e.materialSystem.setUniform(o.material,"modelViewMatrix",f)}if(u.uniforms.forEach((function(t){t.uniforms.forEach((function(t){t.dirty&&e.materialSystem.setUniform(o.material,t.name,t.data,!0)}))})),e.engine.setRenderBindGroups([u.uniformBindGroup]),s.attributes.length){var l=s.attributes.map((function(e){return e.buffer?e.buffer:e.bufferGetter?e.bufferGetter():null})).filter((function(e){return e}));e.engine.bindVertexInputs({indexBuffer:s.indicesBuffer,indexOffset:0,vertexStartSlot:0,vertexBuffers:l,vertexOffsets:new Array(l.length).fill(0)})}s.indices&&s.indices.length?e.engine.drawElementsType("render-".concat(t,"-elements"),_u(_u({layout:u.pipelineLayout},u.stageDescriptor),{},{primitiveTopology:u.primitiveTopology||"triangle-list",vertexState:{indexFormat:"uint32",vertexBuffers:s.attributes.map((function(e){return{arrayStride:e.arrayStride,stepMode:e.stepMode,attributes:e.attributes}}))},rasterizationState:u.rasterizationState||{cullMode:"back"},depthStencilState:u.depthStencilState||{depthWriteEnabled:!0,depthCompare:"less",format:"depth24plus-stencil8"},colorStates:u.colorStates}),0,s.indices.length,s.maxInstancedCount||1):e.engine.drawArraysType("render-".concat(t,"-arrays"),_u(_u({layout:u.pipelineLayout},u.stageDescriptor),{},{primitiveTopology:u.primitiveTopology||"triangle-list",vertexState:{vertexBuffers:s.attributes.map((function(e){return{arrayStride:e.arrayStride,stepMode:e.stepMode,attributes:e.attributes}}))},rasterizationState:u.rasterizationState||{cullMode:"back"},depthStencilState:u.depthStencilState||{depthWriteEnabled:!0,depthCompare:"less",format:"depth24plus-stencil8"},colorStates:u.colorStates}),0,s.vertexCount||3,s.maxInstancedCount||1)}}}))}))}}]),e}(),gu=R()(vu.prototype,"scene",[ou],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),bu=R()(vu.prototype,"camera",[uu],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Au=R()(vu.prototype,"mesh",[su],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Eu=R()(vu.prototype,"geometry",[cu],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),xu=R()(vu.prototype,"material",[fu],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Cu=R()(vu.prototype,"cullable",[lu],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Su=R()(vu.prototype,"transform",[pu],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),wu=R()(vu.prototype,"materialSystem",[hu,du],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Tu=R()(vu.prototype,"engine",[mu],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),yu=vu))||yu);function Fu(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=oe()(e);if(t){var i=oe()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ie()(this,n)}}var Ou=function(e){ne()(n,e);var t=Fu(n);function n(e){var r;return m()(this,n),(r=t.call(this,e)).camera=void 0,r.meshes=[],Object.assign(ee()(r),e),r}return n}(O);function ku(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=oe()(e);if(t){var i=oe()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ie()(this,n)}}var Iu=function(e){ne()(n,e);var t=ku(n);function n(e){var r;return m()(this,n),(r=t.call(this,e)).parentID=void 0,r.parentID=e.parentID||-1,r}return n}(O);function Pu(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=oe()(e);if(t){var i=oe()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ie()(this,n)}}var ju=function(e){ne()(n,e);var t=Pu(n);function n(e){var r;return m()(this,n),(r=t.call(this,e)).name=void 0,r.name=e.name||"",r}return n}(O),Ru=new N.Container,Nu=Yo()(Ru,!1),Gu=function(e){var t=Nu.lazyInject(e);return function(e,n,r){t.call(this,e,n),r&&(r.initializer=function(){return e[n]})}},Lu=function(e){var t=Nu.lazyMultiInject(e);return function(e,n,r){t.call(this,e,n),r&&(r.initializer=function(){return e[n]})}};Ru.bind(G.NameComponentManager).toConstantValue(new k(ju)),Ru.bind(G.HierarchyComponentManager).toConstantValue(new k(Iu)),Ru.bind(G.TransformComponentManager).toConstantValue(new k(jo)),Ru.bind(G.CameraComponentManager).toConstantValue(new k(wo)),Ru.bind(G.ResourceHandleComponentManager).toConstantValue(new k(ru)),Ru.bind(G.PassNodeComponentManager).toConstantValue(new k(tu)),Ru.bind(G.MeshComponentManager).toConstantValue(new k(Io)),Ru.bind(G.CullableComponentManager).toConstantValue(new k(Oo)),Ru.bind(G.GeometryComponentManager).toConstantValue(new k(Du)),Ru.bind(G.MaterialComponentManager).toConstantValue(new k(Mo)),Ru.bind(G.SceneComponentManager).toConstantValue(new k(Ou)),Ru.bind(G.ComputeComponentManager).toConstantValue(new k(Do)),Ru.bind(G.Systems).to(Ao).whenTargetNamed(G.SceneGraphSystem),Ru.bind(G.Systems).to(bo).whenTargetNamed(G.SceneSystem),Ru.bind(G.Systems).to(L).whenTargetNamed(G.CameraSystem),Ru.bind(G.Systems).to(Ve).whenTargetNamed(G.FrameGraphSystem),Ru.bind(G.Systems).to(go).whenTargetNamed(G.MeshSystem),Ru.bind(G.Systems).to(ga).whenTargetNamed(G.GeometrySystem),Ru.bind(G.Systems).to(Da).whenTargetNamed(G.MaterialSystem),Ru.bind(G.Systems).to(Ea).whenTargetNamed(G.InteractionSystem),Ru.bind(G.Systems).to(Ge).whenTargetNamed(G.ComputeSystem),Ru.bind(G.ForwardRenderPath).to(Mu).inSingletonScope(),Ru.bind(G.ComputeStrategy).to($o).whenTargetNamed("particle"),Ru.bind(G.ComputeStrategy).to(Zo).whenTargetNamed("layout");var zu,Vu,Uu,Wu=n(30),qu=n(49),Hu=n(25),Xu=n.n(Hu),Ku=n(33),Yu=n.n(Ku),Ju=n(54),Qu=n.n(Ju),Zu=Object(N.injectable)()(zu=function(){function e(){m()(this,e),this.supportWebGPU=!1,this.canvas=void 0,this.options=void 0,this.gl=void 0,this.contextCache={}}var t,n,r;return v()(e,[{key:"startRecordBundle",value:function(){throw new Error("Method not implemented.")}},{key:"stopRecordBundle",value:function(){throw new Error("Method not implemented.")}},{key:"executeBundles",value:function(e){throw new Error("Method not implemented.")}},{key:"enableScissor",value:function(e,t,n,r){throw new Error("Method not implemented.")}},{key:"disableScissor",value:function(){throw new Error("Method not implemented.")}},{key:"compileRawPipelineStageDescriptor",value:function(e,t){throw new Error("Method not implemented.")}},{key:"compilePipelineStageDescriptor",value:function(e,t,n){throw new Error("Method not implemented.")}},{key:"drawElementsType",value:function(e,t,n,r,i){throw new Error("Method not implemented.")}},{key:"drawArraysType",value:function(e,t,n,r,i){throw new Error("Method not implemented.")}},{key:"createVertexBuffer",value:function(e,t){throw new Error("Method not implemented.")}},{key:"createUniformBuffer",value:function(e){throw new Error("Method not implemented.")}},{key:"createIndexBuffer",value:function(e){throw new Error("Method not implemented.")}},{key:"createTexture",value:function(e,t,n){var r=V()(e,2);r[0],r[1];throw new Error("Method not implemented.")}},{key:"createSampler",value:function(e){throw new Error("Method not implemented.")}},{key:"setRenderBindGroups",value:function(e){throw new Error("Method not implemented.")}},{key:"setSubData",value:function(e,t,n){throw new Error("Method not implemented.")}},{key:"bindVertexInputs",value:function(e){throw new Error("Method not implemented.")}},{key:"getDevice",value:function(){throw new Error("Method not implemented.")}},{key:"init",value:(r=h()(l.a.mark((function e(t){var n,r=this,i=arguments;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=i.length>1&&void 0!==i[1]?i[1]:{},this.canvas=t,this.options=n,e.next=5,new Promise((function(e,t){Qu()({container:r.canvas,attributes:{alpha:!0,antialias:n.antialiasing,premultipliedAlpha:!0},extensions:["OES_element_index_uint","OES_texture_float","WEBGL_depth_texture","angle_instanced_arrays"],optionalExtensions:["oes_texture_float_linear"],profile:!0,onDone:function(n,r){!n&&r||t(n),e(r)}})}));case 5:this.gl=e.sent;case 6:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"compileComputePipelineStageDescriptor",value:(n=h()(l.a.mark((function e(t,n){var r,i,a,o,u,s,c,f,p,h,d=this;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=this.contextCache[n.name])||(r={}),i={},a="",n.uniforms.forEach((function(e){var t=e.name,r=e.type,l=e.data,h=e.format;if("sampler2D"===r){var m=1;h.endsWith("ec4[]")?m=4:h.endsWith("ec3[]")?m=3:h.endsWith("ec2[]")&&(m=2);for(var y=[],v=0;v<l.length;v+=m)1===m?y.push(l[v],0,0,0):2===m?y.push(l[v],l[v+1],0,0):3===m?y.push(l[v],l[v+1],l[v+2],0):4===m&&y.push(l[v],l[v+1],l[v+2],l[v+3]);var g=l.length,b=Math.ceil(g/m),A=Math.ceil(Math.sqrt(b)),E=A*A;b<E&&y.push.apply(y,Xu()(new Array(4*(E-b)).fill(0))),t===n.output.name&&(a=t,o=y,c=g,u=A,f=b,p=m,Yu()(l)&&(s=l.constructor)),i[t]=d.gl.texture({width:A,height:A,data:y,type:"float"}),i["".concat(t,"Size")]=[A,A]}else{if(l&&(Array.isArray(l)||Yu()(l))&&l.length>16)throw new Error("invalid data type ".concat(r));i[t]=l}})),i.u_OutputTextureSize=[u,u],i.u_OutputTexelCount=f,n.maxIteration>1?(r.texInput=i[a],i[a]=function(){return r.texInput},r.texOutput=this.gl.texture({width:u,height:u,data:o,type:"float"})):r.texOutput=this.gl.texture({width:u,height:u,type:"float"}),n.output.typedArrayConstructor=s,n.output.length=c,n.output.outputElementsPerTexel=p,h={attributes:{a_Position:[[-1,1,0],[-1,-1,0],[1,1,0],[1,-1,0]],a_TexCoord:[[0,1],[0,0],[1,1],[1,0]]},frag:t,uniforms:i,vert:"attribute vec3 a_Position;\nattribute vec2 a_TexCoord;\n\nvarying vec2 v_TexCoord;\n\nvoid main() {\n gl_Position = vec4(a_Position, 1.0);\n v_TexCoord = a_TexCoord;\n}",primitive:"triangle strip",count:4},r.computeCommand=this.gl(h),this.contextCache[n.name]=r,e.abrupt("return",{computeStage:{module:{label:"compute"},entryPoint:"main"}});case 15:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"dispatch",value:function(e){var t=this.contextCache[e.name];if(t&&(t.texFBO=this.gl.framebuffer({color:t.texOutput}),t.texFBO.use((function(){t.computeCommand()})),e.maxIteration>1)){var n=t.texOutput;t.texOutput=t.texInput,t.texInput=n}}},{key:"readData",value:(t=h()(l.a.mark((function e(t){var n,r,i,a,o,u,s,c,f,p=this;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=this.contextCache[t.name])){e.next=8;break}if(this.gl({framebuffer:n.texFBO})((function(){r=p.gl.read()})),!r){e.next=8;break}if(i=t.output,a=i.length,o=i.outputElementsPerTexel,u=i.typedArrayConstructor,s=void 0===u?Float32Array:u,c=[],4!==o)for(f=0;f<r.length;f+=4)1===o?c.push(r[f]):2===o?c.push(r[f],r[f+1]):c.push(r[f],r[f+1],r[f+2]);else c=r;return e.abrupt("return",new s(c.slice(0,a)));case 8:return e.abrupt("return",new Float32Array);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"setComputePipeline",value:function(e,t){}},{key:"setComputeBindGroups",value:function(e){}},{key:"clear",value:function(e,t,n){Array.isArray(e)||(e=[e.r,e.g,e.b,e.a]),this.gl.clear({color:e})}},{key:"beginFrame",value:function(){}},{key:"endFrame",value:function(){}},{key:"dispose",value:function(){}}]),e}())||zu,$u=n(6),es=function(){return ts.apply(this,arguments)};function ts(){return(ts=h()(l.a.mark((function e(){var t;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Vu){e.next=2;break}return e.abrupt("return",Vu);case 2:return e.next=4,import("https://cdn.jsdelivr.net/npm/@webgpu/glslang@0.0.15/dist/web-devel/glslang.js");case 4:return t=e.sent,e.next=7,t.default();case 7:return Vu=e.sent,e.abrupt("return",Vu);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ns(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function rs(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ns(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ns(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var is=Object(N.injectable)()(Uu=function(){function e(){m()(this,e),this.supportWebGPU=!0,this.canvas=void 0,this.context=void 0,this.glslang=void 0,this.adapter=void 0,this.device=void 0,this.swapChain=void 0,this.pipelines={},this.computePipelines={},this.mainPassSampleCount=void 0,this.mainTexture=void 0,this.depthTexture=void 0,this.mainColorAttachments=void 0,this.mainTextureExtends=void 0,this.mainDepthAttachment=void 0,this.uploadEncoder=void 0,this.renderEncoder=void 0,this.computeEncoder=void 0,this.commandBuffers=new Array(3).fill(void 0),this.currentRenderPass=null,this.currentComputePass=null,this.bundleEncoder=void 0,this.tempBuffers=[],this.options=void 0,this.defaultSampleCount=4,this.clearDepthValue=1,this.clearStencilValue=0,this.uploadEncoderDescriptor={label:"upload"},this.renderEncoderDescriptor={label:"render"},this.computeEncoderDescriptor={label:"compute"}}var t,n,r,i,a,o;return v()(e,[{key:"getDevice",value:function(){return this.device}},{key:"getSwapChain",value:function(){return this.swapChain}},{key:"init",value:(o=h()(l.a.mark((function e(t){var n,r=arguments;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.length>1&&void 0!==r[1]?r[1]:{},this.canvas=t,this.options=n,this.mainPassSampleCount=n.antialiasing?this.defaultSampleCount:1,e.next=6,this.initGlslang();case 6:this.initContextAndSwapChain(),this.initMainAttachments();case 8:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"beginFrame",value:function(){this.uploadEncoder=this.device.createCommandEncoder(this.uploadEncoderDescriptor),this.renderEncoder=this.device.createCommandEncoder(this.renderEncoderDescriptor),this.computeEncoder=this.device.createCommandEncoder(this.computeEncoderDescriptor)}},{key:"endFrame",value:function(){this.options.supportCompute?this.endComputePass():this.endRenderPass(),this.commandBuffers[0]=this.uploadEncoder.finish(),this.commandBuffers[1]=this.renderEncoder.finish(),this.commandBuffers[2]=this.computeEncoder.finish(),this.device.defaultQueue.submit(this.commandBuffers),this.tempBuffers.forEach((function(e){return e.destroy()})),this.tempBuffers=[]}},{key:"startRecordBundle",value:function(){this.bundleEncoder=this.device.createRenderBundleEncoder({colorFormats:[$u.TextureFormat.BGRA8Unorm],depthStencilFormat:$u.TextureFormat.Depth24PlusStencil8,sampleCount:this.mainPassSampleCount})}},{key:"stopRecordBundle",value:function(){var e=this.bundleEncoder.finish();return this.bundleEncoder=null,e}},{key:"executeBundles",value:function(e){var t;this.currentRenderPass||this.startMainRenderPass(),null===(t=this.currentRenderPass)||void 0===t||t.executeBundles(e)}},{key:"enableScissor",value:function(e,t,n,r){this.currentRenderPass||this.startMainRenderPass(),this.currentRenderPass.setScissorRect(e,t,n,r)}},{key:"disableScissor",value:function(){var e;this.currentRenderPass||this.startMainRenderPass(),null===(e=this.currentRenderPass)||void 0===e||e.setScissorRect(0,0,this.canvas.width,this.canvas.height)}},{key:"setSize",value:function(e,t){this.initMainAttachments()}},{key:"clear",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this.mainColorAttachments[0].loadValue=t?e:$u.LoadOp.Load,this.mainDepthAttachment.depthLoadValue=n?this.clearDepthValue:$u.LoadOp.Load,this.mainDepthAttachment.stencilLoadValue=r?this.clearStencilValue:$u.LoadOp.Load,this.options.supportCompute?this.startComputePass():this.startMainRenderPass()}},{key:"dispose",value:function(){this.mainTexture&&this.mainTexture.destroy(),this.depthTexture&&this.depthTexture.destroy()}},{key:"compileRawPipelineStageDescriptor",value:(a=h()(l.a.mark((function e(t,n){var r,i;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.compileRawShaderToSpirV(t,"vertex");case 2:return r=e.sent,e.next=5,this.compileRawShaderToSpirV(n,"fragment");case 5:return i=e.sent,e.abrupt("return",this.createPipelineStageDescriptor(r,i));case 7:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"compilePipelineStageDescriptor",value:(i=h()(l.a.mark((function e(t,n,r){var i,a,o;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i="#version 450\n",e.next=3,this.compileShaderToSpirV(t,"vertex",i);case 3:return a=e.sent,e.next=6,this.compileShaderToSpirV(n,"fragment",i);case 6:return o=e.sent,e.abrupt("return",this.createPipelineStageDescriptor(a,o));case 8:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return i.apply(this,arguments)})},{key:"compileComputePipelineStageDescriptor",value:(r=h()(l.a.mark((function e(t,n){var r;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=3,this.compileShaderToSpirV(t,"compute","#version 450\n");case 3:return r=e.sent,e.abrupt("return",{computeStage:{module:this.device.createShaderModule({code:r}),entryPoint:"main"}});case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"drawElementsType",value:function(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,a=this.bundleEncoder||this.currentRenderPass;this.setRenderPipeline(e,t),a.drawIndexed(r,i,n,0,0)}},{key:"drawArraysType",value:function(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,a=this.bundleEncoder||this.currentRenderPass;this.setRenderPipeline(e,t),a.draw(r,i,n,0)}},{key:"createVertexBuffer",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;t=e instanceof Array?new Float32Array(e):e instanceof ArrayBuffer?new Uint8Array(e):e;var r=this.createBuffer(t,$u.BufferUsage.Vertex|$u.BufferUsage.CopyDst|$u.BufferUsage.CopySrc|n);return r}},{key:"createUniformBuffer",value:function(e){var t;return t=e instanceof Array?new Float32Array(e):e instanceof ArrayBuffer?new Uint8Array(e):e,this.createBuffer(t,$u.BufferUsage.Uniform|$u.BufferUsage.CopyDst)}},{key:"createIndexBuffer",value:function(e){var t;return t=e instanceof Array?new Uint16Array(e):e instanceof ArrayBuffer?new Uint8Array(e):e,this.createBuffer(t,$u.BufferUsage.Index|$u.BufferUsage.CopyDst)}},{key:"createSampler",value:function(e){return this.device.createSampler(e)}},{key:"createTexture",value:function(e,t,n){var r=V()(e,2),i=r[0],a=r[1],o=null,u=256*Math.ceil(4*i/256);if(u===4*i)o=t;else{o=new Uint8Array(u*a);for(var s=0,c=0;c<a;++c)for(var f=0;f<i;++f){var l=4*f+c*u;o[l]=t[s],o[l+1]=t[s+1],o[l+2]=t[s+2],o[l+3]=t[s+3],s+=4}}var p=this.device.createTexture({size:{width:i,height:a,depth:1},format:"rgba8unorm",usage:GPUTextureUsage.COPY_DST|n}),h=this.createBuffer(o,$u.BufferUsage.CopyDst|$u.BufferUsage.CopySrc);return this.uploadEncoder.copyBufferToTexture({buffer:h,bytesPerRow:u},{texture:p},{width:i,height:a,depth:1}),p}},{key:"setRenderBindGroups",value:function(e){for(var t=this.bundleEncoder||this.currentRenderPass,n=0;n<e.length;n++)t.setBindGroup(n,e[n])}},{key:"setComputeBindGroups",value:function(e){if(this.currentComputePass)for(var t=0;t<e.length;t++)this.currentComputePass.setBindGroup(t,e[t])}},{key:"setComputePipeline",value:function(e,t){var n;if(!this.computePipelines[e]){var r=this.device.createComputePipeline(t);this.computePipelines[e]=r}null===(n=this.currentComputePass)||void 0===n||n.setPipeline(this.computePipelines[e])}},{key:"setSubData",value:function(e,t,n){var r=n.byteLength,i=this.device.createBufferMapped({size:r,usage:$u.BufferUsage.CopySrc}),a=V()(i,2),o=a[0],u=a[1];new Uint8Array(u).set(new Uint8Array(n.buffer)),o.unmap(),this.uploadEncoder.copyBufferToBuffer(o,0,e,t,r),this.tempBuffers.push(o)}},{key:"readData",value:(n=h()(l.a.mark((function e(t){var n,r,i,a,o,u,s;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=t.output)){e.next=15;break}if(r=n.length,i=n.typedArrayConstructor,!(a=n.gpuBuffer)){e.next=15;break}return o=r*i.BYTES_PER_ELEMENT,u=this.device.createBuffer({size:o,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ}),this.uploadEncoder.copyBufferToBuffer(a,0,u,0,o),this.commandBuffers[0]=this.uploadEncoder.finish(),this.device.defaultQueue.submit(this.commandBuffers),this.uploadEncoder=this.device.createCommandEncoder(this.uploadEncoderDescriptor),e.next=12,u.mapReadAsync();case 12:return s=e.sent,this.tempBuffers.push(u),e.abrupt("return",new i(s));case 15:return e.abrupt("return",new Float32Array);case 16:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"bindVertexInputs",value:function(e){var t=this.bundleEncoder||this.currentRenderPass;e.indexBuffer&&t.setIndexBuffer(e.indexBuffer,e.indexOffset);for(var n=0;n<e.vertexBuffers.length;n++){e.vertexBuffers[n]&&t.setVertexBuffer(e.vertexStartSlot+n,e.vertexBuffers[n],e.vertexOffsets[n])}}},{key:"dispatch",value:function(e){var t;this.currentComputePass&&(t=this.currentComputePass).dispatch.apply(t,Xu()(e.dispatch))}},{key:"createBuffer",value:function(e,t){var n=e.byteLength%4,r={size:e.byteLength+n,usage:t},i=this.device.createBuffer(r);return this.setSubData(i,0,e),i}},{key:"initGlslang",value:(t=h()(l.a.mark((function e(){var t,n;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,es();case 2:return this.glslang=e.sent,e.next=5,null===(t=navigator)||void 0===t||null===(n=t.gpu)||void 0===n?void 0:n.requestAdapter();case 5:return this.adapter=e.sent,e.next=8,this.adapter.requestDevice();case 8:this.device=e.sent;case 9:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"initContextAndSwapChain",value:function(){this.context=this.canvas.getContext("gpupresent"),this.swapChain=this.context.configureSwapChain({device:this.device,format:this.options.swapChainFormat,usage:$u.TextureUsage.OutputAttachment|$u.TextureUsage.CopySrc})}},{key:"initMainAttachments",value:function(){if(this.mainTextureExtends={width:this.canvas.width,height:this.canvas.height,depth:1},this.options.antialiasing){var e={size:this.mainTextureExtends,mipLevelCount:1,sampleCount:this.mainPassSampleCount,dimension:$u.TextureDimension.E2d,format:$u.TextureFormat.BGRA8Unorm,usage:$u.TextureUsage.OutputAttachment};this.mainTexture&&this.mainTexture.destroy(),this.mainTexture=this.device.createTexture(e),this.mainColorAttachments=[{attachment:this.mainTexture.createView(),loadValue:[0,0,0,1],storeOp:$u.StoreOp.Store}]}else this.mainColorAttachments=[{attachment:this.swapChain.getCurrentTexture().createView(),loadValue:[0,0,0,1],storeOp:$u.StoreOp.Store}];var t={size:this.mainTextureExtends,mipLevelCount:1,sampleCount:this.mainPassSampleCount,dimension:$u.TextureDimension.E2d,format:$u.TextureFormat.Depth24PlusStencil8,usage:$u.TextureUsage.OutputAttachment};this.depthTexture&&this.depthTexture.destroy(),this.depthTexture=this.device.createTexture(t),this.mainDepthAttachment={attachment:this.depthTexture.createView(),depthLoadValue:this.clearDepthValue,depthStoreOp:$u.StoreOp.Store,stencilLoadValue:this.clearStencilValue,stencilStoreOp:$u.StoreOp.Store}}},{key:"startComputePass",value:function(){this.currentComputePass&&this.endComputePass(),this.currentComputePass=this.computeEncoder.beginComputePass()}},{key:"startMainRenderPass",value:function(){this.currentRenderPass&&this.endRenderPass(),this.options.antialiasing?this.mainColorAttachments[0].resolveTarget=this.swapChain.getCurrentTexture().createView():this.mainColorAttachments[0].attachment=this.swapChain.getCurrentTexture().createView(),this.currentRenderPass=this.renderEncoder.beginRenderPass({colorAttachments:this.mainColorAttachments,depthStencilAttachment:this.mainDepthAttachment})}},{key:"endRenderPass",value:function(){this.currentRenderPass&&(this.currentRenderPass.endPass(),this.currentRenderPass=null)}},{key:"endComputePass",value:function(){this.currentComputePass&&(this.currentComputePass.endPass(),this.currentComputePass=null)}},{key:"setRenderPipeline",value:function(e,t){var n=this.bundleEncoder||this.currentRenderPass,r=this.getRenderPipeline(e,t);r&&n.setPipeline(r)}},{key:"compileRawShaderToSpirV",value:function(e,t){return this.glslang.compileGLSL(e,t)}},{key:"compileShaderToSpirV",value:function(e,t,n){return this.compileRawShaderToSpirV(n+e,t)}},{key:"createPipelineStageDescriptor",value:function(e,t){return{vertexStage:{module:this.device.createShaderModule({code:e}),entryPoint:"main"},fragmentStage:{module:this.device.createShaderModule({code:t}),entryPoint:"main"}}}},{key:"getRenderPipeline",value:function(e,t){if(this.pipelines[e])return this.pipelines[e];var n=t.primitiveTopology,r=t.rasterizationState,i=t.depthStencilState,a=t.colorStates,o=t.vertexStage,u=t.fragmentStage,s=t.vertexState,c=t.layout;if(o&&u){var f=this.device.createRenderPipeline({sampleCount:this.mainPassSampleCount,primitiveTopology:n||"triangle-list",rasterizationState:rs(rs({},this.getDefaultRasterizationStateDescriptor()),r),depthStencilState:rs(rs({},this.getDefaultDepthStencilStateDescriptor()),i),colorStates:a||this.getDefaultColorStateDescriptors(),layout:c,vertexStage:o,fragmentStage:u,vertexState:s});return this.pipelines[e]=f,f}return null}},{key:"getDefaultRasterizationStateDescriptor",value:function(){return{frontFace:$u.FrontFace.CCW,cullMode:$u.CullMode.None,depthBias:0,depthBiasSlopeScale:0,depthBiasClamp:0}}},{key:"getDefaultDepthStencilStateDescriptor",value:function(){var e={compare:$u.CompareFunction.Always,depthFailOp:$u.StencilOperation.Keep,failOp:$u.StencilOperation.Keep,passOp:$u.StencilOperation.Keep};return{depthWriteEnabled:!1,depthCompare:$u.CompareFunction.Always,format:$u.TextureFormat.Depth24PlusStencil8,stencilFront:e,stencilBack:e,stencilReadMask:4294967295,stencilWriteMask:4294967295}}},{key:"getDefaultColorStateDescriptors",value:function(){return[{format:this.options.swapChainFormat,alphaBlend:{srcFactor:$u.BlendFactor.One,dstFactor:$u.BlendFactor.Zero,operation:$u.BlendOperation.Add},colorBlend:{srcFactor:$u.BlendFactor.One,dstFactor:$u.BlendFactor.Zero,operation:$u.BlendOperation.Add},writeMask:$u.ColorWrite.All}]}}]),e}())||Uu;function as(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return os(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return os(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return o=e.done,e},e:function(e){u=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(u)throw a}}}}function os(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function us(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ss(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?us(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):us(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var cs=function(){function e(t){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};m()(this,e),this.systems=void 0,this.engine=void 0,this.canvas=void 0,this.forwardRenderPath=void 0,this.inited=!1,this.onInit=void 0,this.onUpdate=void 0,this.rafHandle=void 0,this.useRenderBundle=!1,this.renderBundleRecorded=!1,this.renderBundle=void 0,this.update=h()(l.a.mark((function e(){return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.render();case 2:n.systems.forEach((function(e){e.cleanup&&e.cleanup()})),n.rafHandle=window.requestAnimationFrame(n.update);case 4:case"end":return e.stop()}}),e)})));var i=navigator.gpu?is:Zu;Ru.isBound(G.RenderEngine)||Ru.bind(G.RenderEngine).to(i).inSingletonScope(),this.engine=Ru.get(G.RenderEngine),this.systems=Ru.getAll(G.Systems),this.forwardRenderPath=Ru.get(G.ForwardRenderPath),this.canvas=t,this.init(t,r.engineOptions),r.onInit&&(this.onInit=r.onInit),r.onUpdate&&(this.onUpdate=r.onUpdate),this.useRenderBundle=!!r.useRenderBundle}var t,n;return v()(e,[{key:"getCamera",value:function(e){return Ru.get(G.CameraComponentManager).getComponentByEntity(e)}},{key:"getTransform",value:function(e){return Ru.get(G.TransformComponentManager).getComponentByEntity(e)}},{key:"createScene",value:function(e){return Ru.getNamed(G.Systems,G.SceneSystem).createScene(e)}},{key:"createCamera",value:function(e){return Ru.getNamed(G.Systems,G.CameraSystem).createCamera(e)}},{key:"createMesh",value:function(e){return Ru.getNamed(G.Systems,G.MeshSystem).createMesh(e)}},{key:"createBoxGeometry",value:function(e){return Ru.getNamed(G.Systems,G.GeometrySystem).createBox(e)}},{key:"createBufferGeometry",value:function(e){return Ru.getNamed(G.Systems,G.GeometrySystem).createBufferGeometry(e)}},{key:"createInstancedBufferGeometry",value:function(e){return Ru.getNamed(G.Systems,G.GeometrySystem).createInstancedBufferGeometry(e)}},{key:"createBasicMaterial",value:function(){return Ru.getNamed(G.Systems,G.MaterialSystem).createBasicMaterial()}},{key:"createShaderMaterial",value:function(e){return Ru.getNamed(G.Systems,G.MaterialSystem).createShaderMaterial(e)}},{key:"setAttribute",value:function(e,t,n,r,i){return Ru.getNamed(G.Systems,G.GeometrySystem).setAttribute(e,t,n,r,i)}},{key:"createComputePipeline",value:function(e){return Ru.getNamed(G.Systems,G.ComputeSystem).createComputePipeline(ss(ss({},e),{},{type:e.type||"layout"}))}},{key:"getPrecompiledBundle",value:function(e){return Ru.getNamed(G.Systems,G.ComputeSystem).getPrecompiledBundle(e)}},{key:"addUniform",value:function(e,t){Ru.getNamed(G.Systems,G.MaterialSystem).addUniform(e,t)}},{key:"setUniform",value:function(e,t,n){return Ru.getNamed(G.Systems,G.MaterialSystem).setUniform(e,t,n)}},{key:"setIndex",value:function(e,t){Ru.getNamed(G.Systems,G.GeometrySystem).setIndex(e,t)}},{key:"setBinding",value:function(e,t,n){return Ru.getNamed(G.Systems,G.ComputeSystem).setBinding(e,t,n)}},{key:"getParticleBuffer",value:function(e){return Ru.getNamed(G.Systems,G.ComputeSystem).getParticleBuffer(e)}},{key:"add",value:function(e,t){Ru.getNamed(G.Systems,G.SceneSystem).addMesh(e,t)}},{key:"attach",value:function(e,t,n){Ru.getNamed(G.Systems,G.SceneGraphSystem).attach(e,t,n)}},{key:"init",value:(n=h()(l.a.mark((function e(t,n){return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.engine.init(t,ss({swapChainFormat:$u.TextureFormat.BGRA8Unorm,antialiasing:!0},n));case 2:return e.next=4,this.update();case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"destroy",value:function(){this.engine.dispose(),this.systems.forEach((function(e){e.tearDown&&e.tearDown()})),window.cancelAnimationFrame(this.rafHandle)}},{key:"render",value:(t=h()(l.a.mark((function e(){var t,n,r,i=this;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.engine.beginFrame(),this.engine.clear({r:0,g:0,b:0,a:1},!0,!0,!0),this.inited){e.next=8;break}if(this.systems.forEach((function(e){e.initialize&&e.initialize(i.canvas)})),!this.onInit){e.next=7;break}return e.next=7,this.onInit(this.engine);case 7:this.inited=!0;case 8:t=as(this.systems),e.prev=9,t.s();case 11:if((n=t.n()).done){e.next=18;break}if(!(r=n.value).execute){e.next=16;break}return e.next=16,r.execute();case 16:e.next=11;break;case 18:e.next=23;break;case 20:e.prev=20,e.t0=e.catch(9),t.e(e.t0);case 23:return e.prev=23,t.f(),e.finish(23);case 26:if(!this.useRenderBundle){e.next=37;break}if(this.renderBundleRecorded){e.next=34;break}if(this.engine.startRecordBundle(),!this.onUpdate){e.next=32;break}return e.next=32,this.onUpdate(this.engine);case 32:this.renderBundle=this.engine.stopRecordBundle(),this.renderBundleRecorded=!0;case 34:this.engine.executeBundles([this.renderBundle]),e.next=41;break;case 37:if(!this.onUpdate){e.next=40;break}return e.next=40,this.onUpdate(this.engine);case 40:this.forwardRenderPath.render();case 41:this.engine.endFrame();case 42:case"end":return e.stop()}}),e,this,[[9,20,23,26]])}))),function(){return t.apply(this,arguments)})}]),e}()}])}));
\No newline at end of file