diff --git a/src/app/babylon/model/data/institution/facility/all-facility-data.ts b/src/app/babylon/model/data/institution/facility/all-facility-data.ts index b36aa0a..b6decfa 100644 --- a/src/app/babylon/model/data/institution/facility/all-facility-data.ts +++ b/src/app/babylon/model/data/institution/facility/all-facility-data.ts @@ -1,6 +1,7 @@ import { Type } from 'class-transformer'; -import { ConfigManager } from 'src/assets/babylon/controller/config-manager'; -import { DataManager } from 'src/assets/babylon/controller/data-manager'; +import { ConfigManager } from 'src/app/babylon/controller/config-manager'; +import { DataManager } from 'src/app/babylon/controller/data-manager'; + import { FacilityPosType, FacilityType, ModelData_facility } from '../../model-data/model-data-facility'; import { TransformData } from '../../transform-data'; diff --git a/src/app/babylon/model/data/mark/all-mark-data.ts b/src/app/babylon/model/data/mark/all-mark-data.ts index 05e8c37..e567b20 100644 --- a/src/app/babylon/model/data/mark/all-mark-data.ts +++ b/src/app/babylon/model/data/mark/all-mark-data.ts @@ -5,7 +5,8 @@ import { MarkData, MarkType, MarkKindType, MarkTagPos, MarkTask } from "./mark-d import { MarkData_Line } from "./other/mark-data-line"; import { MarkData_multiLine } from "./other/mark-data-multi-line"; import { MarkData_multiArrow_CT, MarkData_multiArrow_JG } from "./other/mark-data-multi-arrow"; -import { ConfigManager } from "src/assets/babylon/controller/config-manager"; +import { ConfigManager } from "src/app/babylon/controller/config-manager"; + export class AllMarkData { /** diff --git a/src/app/babylon/model/data/mark/mark-data.ts b/src/app/babylon/model/data/mark/mark-data.ts index c2c4363..2d59abd 100644 --- a/src/app/babylon/model/data/mark/mark-data.ts +++ b/src/app/babylon/model/data/mark/mark-data.ts @@ -1,5 +1,6 @@ import { Type } from "class-transformer"; -import { ConfigManager } from "src/assets/babylon/controller/config-manager"; +import { ConfigManager } from "src/app/babylon/controller/config-manager"; + import { ModelData } from "../model-data/model-data"; import { TransformData } from "../transform-data"; diff --git a/src/app/babylon/model/data/mark/mark-plan-data.ts b/src/app/babylon/model/data/mark/mark-plan-data.ts index c24adde..68fb3f9 100644 --- a/src/app/babylon/model/data/mark/mark-plan-data.ts +++ b/src/app/babylon/model/data/mark/mark-plan-data.ts @@ -1,5 +1,6 @@ import { Type } from "class-transformer"; -import { TsTool } from "src/assets/babylon/tool/ts-tool"; +import { TsTool } from "src/app/babylon/tool/ts-tool"; + import { ArcRotateCameraData } from "../camera-data"; import { MarkData } from "./mark-data"; diff --git a/src/app/babylon/model/data/model-data/model-data-facility.ts b/src/app/babylon/model/data/model-data/model-data-facility.ts index 393f3ac..9291fbb 100644 --- a/src/app/babylon/model/data/model-data/model-data-facility.ts +++ b/src/app/babylon/model/data/model-data/model-data-facility.ts @@ -4,7 +4,8 @@ import { PropertyData_Base } from "../institution/facility/property-data/propert import { classToClass, Type } from "class-transformer"; import { Vector3 } from "@babylonjs/core"; -import { DataManager } from "src/assets/babylon/controller/data-manager"; +import { DataManager } from "src/app/babylon/controller/data-manager"; + //设备数据 export class ModelData_facility extends ModelData { diff --git a/src/app/babylon/model/data/model-data/model-edit-data.ts b/src/app/babylon/model/data/model-data/model-edit-data.ts index 526f999..c851a8a 100644 --- a/src/app/babylon/model/data/model-data/model-edit-data.ts +++ b/src/app/babylon/model/data/model-data/model-edit-data.ts @@ -1,5 +1,6 @@ import { Type } from "class-transformer"; -import { TsTool } from "src/assets/babylon/tool/ts-tool"; +import { TsTool } from "src/app/babylon/tool/ts-tool"; + import { ModelData } from "./model-data"; import { FacilityType, ModelData_facility } from "./model-data-facility"; diff --git a/src/app/babylon/model/info/building/building-info-environment.ts b/src/app/babylon/model/info/building/building-info-environment.ts index b62002c..1c4fc67 100644 --- a/src/app/babylon/model/info/building/building-info-environment.ts +++ b/src/app/babylon/model/info/building/building-info-environment.ts @@ -1,8 +1,9 @@ import { TransformNode } from '@babylonjs/core'; -import { BuildingStatus } from 'src/assets/babylon/controller/status/building-status'; -import { IndoorStatus } from 'src/assets/babylon/controller/status/indoor-status'; -import { StatusManager } from 'src/assets/babylon/controller/status/status-manager'; -import { TsTool } from 'src/assets/babylon/tool/ts-tool'; +import { BuildingStatus } from 'src/app/babylon/controller/status/building-status'; +import { IndoorStatus } from 'src/app/babylon/controller/status/indoor-status'; +import { StatusManager } from 'src/app/babylon/controller/status/status-manager'; +import { TsTool } from 'src/app/babylon/tool/ts-tool'; + import { BuildingInfo } from './building-info'; diff --git a/src/app/babylon/model/info/building/building-info.ts b/src/app/babylon/model/info/building/building-info.ts index 2e07bfe..ba9e858 100644 --- a/src/app/babylon/model/info/building/building-info.ts +++ b/src/app/babylon/model/info/building/building-info.ts @@ -1,9 +1,9 @@ import { Vector3 } from "@babylonjs/core"; -import { InfoManager } from "src/assets/babylon/controller/info-manager"; -import { SceneManager } from "src/assets/babylon/controller/scene-manager"; -import { BuildingStatus } from "src/assets/babylon/controller/status/building-status"; -import { StatusManager } from "src/assets/babylon/controller/status/status-manager"; -import { GizmoTool } from "src/assets/babylon/tool/gizmo-tool"; +import { InfoManager } from "src/app/babylon/controller/info-manager"; +import { SceneManager } from "src/app/babylon/controller/scene-manager"; +import { BuildingStatus } from "src/app/babylon/controller/status/building-status"; +import { StatusManager } from "src/app/babylon/controller/status/status-manager"; +import { GizmoTool } from "src/app/babylon/tool/gizmo-tool"; import { BuildingData } from "../../data/institution/building/building-data"; import { TransformData } from "../../data/transform-data"; diff --git a/src/app/babylon/model/info/mark/mark-plan-info.ts b/src/app/babylon/model/info/mark/mark-plan-info.ts index efad785..7ef67bf 100644 --- a/src/app/babylon/model/info/mark/mark-plan-info.ts +++ b/src/app/babylon/model/info/mark/mark-plan-info.ts @@ -1,5 +1,5 @@ -import { TsTool } from "src/assets/babylon/tool/ts-tool"; +import { TsTool } from "src/app/babylon/tool/ts-tool"; import { MarkTagPos, MarkType } from "../../data/mark/mark-data"; import { MarkNodeData, MarkPlanData } from "../../data/mark/mark-plan-data"; import { ModelInfo_mark } from "./model-info-mark"; diff --git a/src/app/babylon/model/info/mark/model-info-mark.ts b/src/app/babylon/model/info/mark/model-info-mark.ts index 9792ce2..7cf1488 100644 --- a/src/app/babylon/model/info/mark/model-info-mark.ts +++ b/src/app/babylon/model/info/mark/model-info-mark.ts @@ -6,15 +6,16 @@ import { Rectangle } from "@babylonjs/gui/2D/controls/rectangle"; import { TextBlock, TextWrapping } from "@babylonjs/gui/2D/controls/textBlock"; import { Vector2WithInfo } from "@babylonjs/gui/2D/math2D"; import { classToClass } from "class-transformer"; -import { ConfigManager } from "src/assets/babylon/controller/config-manager"; -import { MarkInfoChangeType, Event_MarkInfoChange } from "src/assets/babylon/controller/event-manager/events/event-mark-info-change"; -import { SceneManager } from "src/assets/babylon/controller/scene-manager"; -import { UIManager } from "src/assets/babylon/controller/ui-manager"; -import { BabylonTool } from "src/assets/babylon/tool/babylon-tool"; -import { BabylonUIStyleTool } from "src/assets/babylon/tool/babylon-ui-style-tool"; -import { ParticleSystemTool } from "src/assets/babylon/tool/particle-system-tool"; -import { TsTool } from "src/assets/babylon/tool/ts-tool"; -import { MarkWindow } from "src/assets/babylon/view/mark-window/mark-window"; +import { ConfigManager } from "src/app/babylon/controller/config-manager"; +import { MarkInfoChangeType, Event_MarkInfoChange } from "src/app/babylon/controller/event-manager/events/event-mark-info-change"; +import { SceneManager } from "src/app/babylon/controller/scene-manager"; +import { UIManager } from "src/app/babylon/controller/ui-manager"; +import { BabylonTool } from "src/app/babylon/tool/babylon-tool"; +import { BabylonUIStyleTool } from "src/app/babylon/tool/babylon-ui-style-tool"; +import { ParticleSystemTool } from "src/app/babylon/tool/particle-system-tool"; +import { TsTool } from "src/app/babylon/tool/ts-tool"; +import { MarkWindow } from "src/app/babylon/view/mark-window/mark-window"; + import { ChildNodeData, MarkData, MarkTask, MarkType } from "../../data/mark/mark-data"; import { BuildingInfo } from "../building/building-info"; import { ModelInfo } from "../model/model-info"; diff --git a/src/app/babylon/model/info/mark/other/mark-plan-area-info.ts b/src/app/babylon/model/info/mark/other/mark-plan-area-info.ts index 6923823..af38dfa 100644 --- a/src/app/babylon/model/info/mark/other/mark-plan-area-info.ts +++ b/src/app/babylon/model/info/mark/other/mark-plan-area-info.ts @@ -1,9 +1,10 @@ import { AbstractMesh, Color3, Material, Mesh, MeshBuilder, PointerDragBehavior, PolygonMeshBuilder, Vector2, Vector3 } from "@babylonjs/core"; import { StandardMaterial } from "@babylonjs/core/Materials/standardMaterial"; import { classToClass, plainToClass } from "class-transformer"; -import { SceneManager } from "src/assets/babylon/controller/scene-manager"; -import { BabylonTool } from "src/assets/babylon/tool/babylon-tool"; -import { MarkWindow } from "src/assets/babylon/view/mark-window/mark-window"; +import { SceneManager } from "src/app/babylon/controller/scene-manager"; +import { BabylonTool } from "src/app/babylon/tool/babylon-tool"; +import { MarkWindow } from "src/app/babylon/view/mark-window/mark-window"; + import { MarkData, MarkType } from "../../../data/mark/mark-data"; import { MarkData_Area } from "../../../data/mark/other/mark-data-area"; diff --git a/src/app/babylon/model/info/mark/other/mark-plan-line-info.ts b/src/app/babylon/model/info/mark/other/mark-plan-line-info.ts index 7ecd405..ccff6c3 100644 --- a/src/app/babylon/model/info/mark/other/mark-plan-line-info.ts +++ b/src/app/babylon/model/info/mark/other/mark-plan-line-info.ts @@ -1,9 +1,10 @@ import { Color3, EventState, Mesh, MeshBuilder, Observer, PointerEventTypes, PointerInfo, Scene, StandardMaterial, Vector3 } from "@babylonjs/core"; import { AbstractMesh } from "@babylonjs/core/Meshes/abstractMesh"; import { classToClass, plainToClass } from "class-transformer"; -import { SceneManager } from "src/assets/babylon/controller/scene-manager"; -import { BabylonTool } from "src/assets/babylon/tool/babylon-tool"; -import { MarkWindow } from "src/assets/babylon/view/mark-window/mark-window"; +import { SceneManager } from "src/app/babylon/controller/scene-manager"; +import { BabylonTool } from "src/app/babylon/tool/babylon-tool"; +import { MarkWindow } from "src/app/babylon/view/mark-window/mark-window"; + import { MarkData } from "../../../data/mark/mark-data"; import { MarkData_Line } from "../../../data/mark/other/mark-data-line"; diff --git a/src/app/babylon/model/info/mark/other/mark-plan-multi-arrow.ts b/src/app/babylon/model/info/mark/other/mark-plan-multi-arrow.ts index 80b2a9e..493e566 100644 --- a/src/app/babylon/model/info/mark/other/mark-plan-multi-arrow.ts +++ b/src/app/babylon/model/info/mark/other/mark-plan-multi-arrow.ts @@ -5,9 +5,10 @@ import { AbstractMesh } from "@babylonjs/core/Meshes/abstractMesh"; import { Mesh } from "@babylonjs/core/Meshes/mesh"; import { EventState, Observer } from "@babylonjs/core/Misc/observable"; import { classToClass, plainToClass } from "class-transformer"; -import { SceneManager } from "src/assets/babylon/controller/scene-manager"; -import { BabylonTool } from "src/assets/babylon/tool/babylon-tool"; -import { MarkWindow } from "src/assets/babylon/view/mark-window/mark-window"; +import { SceneManager } from "src/app/babylon/controller/scene-manager"; +import { BabylonTool } from "src/app/babylon/tool/babylon-tool"; +import { MarkWindow } from "src/app/babylon/view/mark-window/mark-window"; + import { MarkData, MarkType } from "../../../data/mark/mark-data"; import { MarkData_multiArrow } from "../../../data/mark/other/mark-data-multi-arrow"; diff --git a/src/app/babylon/model/info/mark/other/mark-plan-multi-line-info.ts b/src/app/babylon/model/info/mark/other/mark-plan-multi-line-info.ts index 398c118..bd7c152 100644 --- a/src/app/babylon/model/info/mark/other/mark-plan-multi-line-info.ts +++ b/src/app/babylon/model/info/mark/other/mark-plan-multi-line-info.ts @@ -5,9 +5,10 @@ import { AbstractMesh } from "@babylonjs/core/Meshes/abstractMesh"; import { Mesh } from "@babylonjs/core/Meshes/mesh"; import { EventState, Observer } from "@babylonjs/core/Misc/observable"; import { classToClass, plainToClass } from "class-transformer"; -import { SceneManager } from "src/assets/babylon/controller/scene-manager"; -import { BabylonTool } from "src/assets/babylon/tool/babylon-tool"; -import { MarkWindow } from "src/assets/babylon/view/mark-window/mark-window"; +import { SceneManager } from "src/app/babylon/controller/scene-manager"; +import { BabylonTool } from "src/app/babylon/tool/babylon-tool"; +import { MarkWindow } from "src/app/babylon/view/mark-window/mark-window"; + import { MarkData } from "../../../data/mark/mark-data"; import { MarkData_multiLine } from "../../../data/mark/other/mark-data-multi-line"; diff --git a/src/app/babylon/model/info/mark/other/mark-plan-particle-info.ts b/src/app/babylon/model/info/mark/other/mark-plan-particle-info.ts index 1844c97..0a1a9ce 100644 --- a/src/app/babylon/model/info/mark/other/mark-plan-particle-info.ts +++ b/src/app/babylon/model/info/mark/other/mark-plan-particle-info.ts @@ -1,8 +1,9 @@ import { Mesh, ParticleSystem, ParticleSystemSet, Vector3 } from "@babylonjs/core"; import { AbstractMesh } from "@babylonjs/core/Meshes/abstractMesh"; import { classToClass } from "class-transformer"; -import { BabylonTool } from "src/assets/babylon/tool/babylon-tool"; -import { ParticleSystemTool } from "src/assets/babylon/tool/particle-system-tool"; +import { BabylonTool } from "src/app/babylon/tool/babylon-tool"; +import { ParticleSystemTool } from "src/app/babylon/tool/particle-system-tool"; + import { MarkType, MarkData } from "../../../data/mark/mark-data"; import { ModelInfo_mark } from "../model-info-mark"; diff --git a/src/app/babylon/model/info/model/facilityinfo-tool/facility-area.ts b/src/app/babylon/model/info/model/facilityinfo-tool/facility-area.ts index 990070f..6d1184a 100644 --- a/src/app/babylon/model/info/model/facilityinfo-tool/facility-area.ts +++ b/src/app/babylon/model/info/model/facilityinfo-tool/facility-area.ts @@ -5,13 +5,14 @@ import { Button, Vector2WithInfo } from "@babylonjs/gui"; import { ModelInfo_facility } from "../model-info-facility"; import * as earcut from "earcut"; -import { ModeManager, ModeType } from "src/assets/babylon/controller/mode-manager"; -import { SceneManager } from "src/assets/babylon/controller/scene-manager"; -import { UIManager } from "src/assets/babylon/controller/ui-manager"; -import { BabylonUIStyleTool } from "src/assets/babylon/tool/babylon-ui-style-tool"; -import { GizmoTool } from "src/assets/babylon/tool/gizmo-tool"; -import { PosPointTool } from "src/assets/babylon/tool/pos-point-tool"; + import { FacilityType, ModelData_facility } from "../../../data/model-data/model-data-facility"; +import { ModeManager, ModeType } from "src/app/babylon/controller/mode-manager"; +import { SceneManager } from "src/app/babylon/controller/scene-manager"; +import { UIManager } from "src/app/babylon/controller/ui-manager"; +import { BabylonUIStyleTool } from "src/app/babylon/tool/babylon-ui-style-tool"; +import { GizmoTool } from "src/app/babylon/tool/gizmo-tool"; +import { PosPointTool } from "src/app/babylon/tool/pos-point-tool"; (window as any).earcut = earcut; diff --git a/src/app/babylon/model/info/model/facilityinfo-tool/facility-gd.ts b/src/app/babylon/model/info/model/facilityinfo-tool/facility-gd.ts index a8e6bae..9037f0a 100644 --- a/src/app/babylon/model/info/model/facilityinfo-tool/facility-gd.ts +++ b/src/app/babylon/model/info/model/facilityinfo-tool/facility-gd.ts @@ -3,11 +3,12 @@ import { AbstractMesh, MeshBuilder, Color3, Vector3, Mesh, Observer, Scene, Vector2 } from "@babylonjs/core"; import { Control, Button } from "@babylonjs/gui"; import { GridMaterial } from "@babylonjs/materials"; -import { ModeManager, ModeType } from "src/assets/babylon/controller/mode-manager"; -import { SceneManager } from "src/assets/babylon/controller/scene-manager"; -import { UIManager } from "src/assets/babylon/controller/ui-manager"; -import { BabylonUIStyleTool, UI_LineInfo } from "src/assets/babylon/tool/babylon-ui-style-tool"; -import { GizmoTool, TransformUIType } from "src/assets/babylon/tool/gizmo-tool"; +import { ModeManager, ModeType } from "src/app/babylon/controller/mode-manager"; +import { SceneManager } from "src/app/babylon/controller/scene-manager"; +import { UIManager } from "src/app/babylon/controller/ui-manager"; +import { BabylonUIStyleTool, UI_LineInfo } from "src/app/babylon/tool/babylon-ui-style-tool"; +import { GizmoTool, TransformUIType } from "src/app/babylon/tool/gizmo-tool"; + import { PropertyData_GD } from "../../../data/institution/facility/property-data/outdoor/property-data-gd"; import { ModelData_facility } from "../../../data/model-data/model-data-facility"; diff --git a/src/app/babylon/model/info/model/model-info-building.ts b/src/app/babylon/model/info/model/model-info-building.ts index 01ea2fb..5ca3014 100644 --- a/src/app/babylon/model/info/model/model-info-building.ts +++ b/src/app/babylon/model/info/model/model-info-building.ts @@ -1,16 +1,17 @@ import { Observer, Scene, TransformNode } from "@babylonjs/core"; import { Button, Rectangle } from "@babylonjs/gui"; -import { ModelChangeType } from "src/assets/babylon/controller/data-manager"; -import { Event_ModelInfoChange } from "src/assets/babylon/controller/event-manager/events/event-modelinfo-change"; -import { InfoManager } from "src/assets/babylon/controller/info-manager"; -import { ModeManager, ModeType } from "src/assets/babylon/controller/mode-manager"; -import { SceneManager } from "src/assets/babylon/controller/scene-manager"; -import { BuildingStatus } from "src/assets/babylon/controller/status/building-status"; -import { IndoorStatus } from "src/assets/babylon/controller/status/indoor-status"; -import { StatusManager } from "src/assets/babylon/controller/status/status-manager"; -import { BabylonUIStyleTool } from "src/assets/babylon/tool/babylon-ui-style-tool"; -import { GizmoTool } from "src/assets/babylon/tool/gizmo-tool"; -import { TsTool } from "src/assets/babylon/tool/ts-tool"; +import { ModelChangeType } from "src/app/babylon/controller/data-manager"; +import { Event_ModelInfoChange } from "src/app/babylon/controller/event-manager/events/event-modelinfo-change"; +import { InfoManager } from "src/app/babylon/controller/info-manager"; +import { ModeManager, ModeType } from "src/app/babylon/controller/mode-manager"; +import { SceneManager } from "src/app/babylon/controller/scene-manager"; +import { BuildingStatus } from "src/app/babylon/controller/status/building-status"; +import { IndoorStatus } from "src/app/babylon/controller/status/indoor-status"; +import { StatusManager } from "src/app/babylon/controller/status/status-manager"; +import { BabylonUIStyleTool } from "src/app/babylon/tool/babylon-ui-style-tool"; +import { GizmoTool } from "src/app/babylon/tool/gizmo-tool"; +import { TsTool } from "src/app/babylon/tool/ts-tool"; + import { BuildingType } from "../../data/institution/building/building-data"; import { ModelInfo_mark } from "../mark/model-info-mark"; diff --git a/src/app/babylon/model/info/model/model-info-facility.ts b/src/app/babylon/model/info/model/model-info-facility.ts index c62ca80..7da26c3 100644 --- a/src/app/babylon/model/info/model/model-info-facility.ts +++ b/src/app/babylon/model/info/model/model-info-facility.ts @@ -1,11 +1,11 @@ import { AbstractMesh, EventState } from "@babylonjs/core"; import { Button, Control, Ellipse, Rectangle, Vector2WithInfo } from "@babylonjs/gui"; -import { ConfigManager } from "src/assets/babylon/controller/config-manager"; -import { SceneManager } from "src/assets/babylon/controller/scene-manager"; -import { BabylonUIStyleTool } from "src/assets/babylon/tool/babylon-ui-style-tool"; -import { FacilityWindow } from "src/assets/babylon/view/facility-window/facility-window"; -import { FacilityInfoInSceneWindow } from "src/assets/babylon/view/facilityinfoinscene-window/facilityinfoinscene-window"; -import { PropertyBaseWindow } from "src/assets/babylon/view/property-window/property-base-window"; +import { ConfigManager } from "src/app/babylon/controller/config-manager"; +import { SceneManager } from "src/app/babylon/controller/scene-manager"; +import { BabylonUIStyleTool } from "src/app/babylon/tool/babylon-ui-style-tool"; +import { FacilityWindow } from "src/app/babylon/view/facility-window/facility-window"; +import { FacilityInfoInSceneWindow } from "src/app/babylon/view/facilityinfoinscene-window/facilityinfoinscene-window"; +import { PropertyBaseWindow } from "src/app/babylon/view/property-window/property-base-window"; import { ModelData } from "../../data/model-data/model-data"; import { FacilityShowType, FacilityType, ModelData_facility } from "../../data/model-data/model-data-facility"; import { BuildingInfo } from "../building/building-info"; diff --git a/src/app/babylon/model/info/model/model-info.ts b/src/app/babylon/model/info/model/model-info.ts index 9421c39..5f3ee40 100644 --- a/src/app/babylon/model/info/model/model-info.ts +++ b/src/app/babylon/model/info/model/model-info.ts @@ -11,9 +11,10 @@ import { } from '@babylonjs/core'; import { Button, Rectangle, Vector2WithInfo } from '@babylonjs/gui'; import { classToClass } from 'class-transformer'; -import { UIManager } from 'src/assets/babylon/controller/ui-manager'; -import { BabylonTool } from 'src/assets/babylon/tool/babylon-tool'; -import { GizmoTool } from 'src/assets/babylon/tool/gizmo-tool'; +import { UIManager } from 'src/app/babylon/controller/ui-manager'; +import { BabylonTool } from 'src/app/babylon/tool/babylon-tool'; +import { GizmoTool } from 'src/app/babylon/tool/gizmo-tool'; + import { ModelData } from '../../data/model-data/model-data'; diff --git a/src/app/babylon/tool/load-tool.ts b/src/app/babylon/tool/load-tool.ts index e73417b..d135607 100644 --- a/src/app/babylon/tool/load-tool.ts +++ b/src/app/babylon/tool/load-tool.ts @@ -1,4 +1,3 @@ -import { ThreeDimensionalHomeComponent } from "src/app/gis/three-dimensional-home/three-dimensional-home.component"; /** * 加载管理器 @@ -51,7 +50,7 @@ export class LoadTool { */ static onStart() { console.log("开始加载"); - ThreeDimensionalHomeComponent.instance.maskLayerService.sendMessage(true) + //ThreeDimensionalHomeComponent.instance.maskLayerService.sendMessage(true) } /** @@ -59,7 +58,7 @@ export class LoadTool { */ static onEnd() { console.log("结束加载"); - ThreeDimensionalHomeComponent.instance.maskLayerService.sendMessage(false) + //ThreeDimensionalHomeComponent.instance.maskLayerService.sendMessage(false) } } \ No newline at end of file diff --git a/src/assets/js/babylon.ktx2Decoder.js b/src/assets/js/babylon.ktx2Decoder.js new file mode 100644 index 0000000..7e58c3b --- /dev/null +++ b/src/assets/js/babylon.ktx2Decoder.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.KTX2DECODER=t():e.KTX2DECODER=t()}("undefined"!=typeof self?self:"undefined"!=typeof global?global:this,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.l=!0,a.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)r.d(n,a,function(t){return e[t]}.bind(null,a));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/dist/",r(r.s=1)}([function(e,t,r){"use strict";r.d(t,"b",(function(){return C})),r.d(t,"j",(function(){return i})),r.d(t,"c",(function(){return u})),r.d(t,"o",(function(){return n})),r.d(t,"p",(function(){return a})),r.d(t,"k",(function(){return s})),r.d(t,"l",(function(){return c})),r.d(t,"m",(function(){return d})),r.d(t,"n",(function(){return U})),r.d(t,"a",(function(){return o})),r.d(t,"d",(function(){return m})),r.d(t,"e",(function(){return _})),r.d(t,"f",(function(){return g})),r.d(t,"h",(function(){return b})),r.d(t,"g",(function(){return B})),r.d(t,"i",(function(){return T}));var n,a,o=function(){function e(e,t,r){e.buffer?this._dataView=new DataView(e.buffer,e.byteOffset+(null!=t?t:0),null!=r?r:e.byteLength):this._dataView=new DataView(e,null!=t?t:0,null!=r?r:e.byteLength),this._dataByteOffset=0}return Object.defineProperty(e.prototype,"byteOffset",{get:function(){return this._dataByteOffset},enumerable:!1,configurable:!0}),e.prototype.readUint8=function(){var e=this._dataView.getUint8(this._dataByteOffset);return this._dataByteOffset+=1,e},e.prototype.readInt8=function(){var e=this._dataView.getInt8(this._dataByteOffset);return this._dataByteOffset+=1,e},e.prototype.readUint16=function(){var e=this._dataView.getUint16(this._dataByteOffset,!0);return this._dataByteOffset+=2,e},e.prototype.readInt16=function(){var e=this._dataView.getInt16(this._dataByteOffset,!0);return this._dataByteOffset+=2,e},e.prototype.readUint32=function(){var e=this._dataView.getUint32(this._dataByteOffset,!0);return this._dataByteOffset+=4,e},e.prototype.readInt32=function(){var e=this._dataView.getInt32(this._dataByteOffset,!0);return this._dataByteOffset+=4,e},e.prototype.readUint64=function(){var e=this._dataView.getUint32(this._dataByteOffset,!0),t=this._dataView.getUint32(this._dataByteOffset+4,!0),r=e+Math.pow(2,32)*t;return this._dataByteOffset+=8,r},e.prototype.readUint8Array=function(e){var t=new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+this._dataByteOffset,e);return this._dataByteOffset+=e,t},e.prototype.skipBytes=function(e){return this._dataByteOffset+=e,this},e}();!function(e){e[e.ETC1S=0]="ETC1S",e[e.UASTC4x4=1]="UASTC4x4"}(n||(n={})),function(e){e[e.ASTC_4x4_RGBA=0]="ASTC_4x4_RGBA",e[e.BC7_RGBA=1]="BC7_RGBA",e[e.BC3_RGBA=2]="BC3_RGBA",e[e.BC1_RGB=3]="BC1_RGB",e[e.PVRTC1_4_RGBA=4]="PVRTC1_4_RGBA",e[e.PVRTC1_4_RGB=5]="PVRTC1_4_RGB",e[e.ETC2_RGBA=6]="ETC2_RGBA",e[e.ETC1_RGB=7]="ETC1_RGB",e[e.RGBA32=8]="RGBA32"}(a||(a={}));var i,s=function(){function e(){}return e.CanTranscode=function(e,t,r){return!1},e.prototype.getName=function(){return e.Name},e.prototype.initialize=function(){},e.prototype.needMemoryManager=function(){return!1},e.prototype.setMemoryManager=function(e){},e.prototype.transcode=function(e,t,r,n,a,o,i,s,u){return Promise.resolve(null)},e.Name="Transcoder",e}();!function(e){e[e.None=0]="None",e[e.BasisLZ=1]="BasisLZ",e[e.ZStandard=2]="ZStandard",e[e.ZLib=3]="ZLib"}(i||(i={}));var u=function(){function e(e){this._data=e}return Object.defineProperty(e.prototype,"data",{get:function(){return this._data},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"header",{get:function(){return this._header},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"levels",{get:function(){return this._levels},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dfdBlock",{get:function(){return this._dfdBlock},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"supercompressionGlobalData",{get:function(){return this._supercompressionGlobalData},enumerable:!1,configurable:!0}),e.prototype.isValid=function(){return e.IsValid(this._data)},e.prototype.parse=function(){var e=12,t=new o(this._data,e,68),r=this._header={vkFormat:t.readUint32(),typeSize:t.readUint32(),pixelWidth:t.readUint32(),pixelHeight:t.readUint32(),pixelDepth:t.readUint32(),layerCount:t.readUint32(),faceCount:t.readUint32(),levelCount:t.readUint32(),supercompressionScheme:t.readUint32(),dfdByteOffset:t.readUint32(),dfdByteLength:t.readUint32(),kvdByteOffset:t.readUint32(),kvdByteLength:t.readUint32(),sgdByteOffset:t.readUint64(),sgdByteLength:t.readUint64()};if(r.pixelDepth>0)throw new Error("Failed to parse KTX2 file - Only 2D textures are currently supported.");if(r.layerCount>1)throw new Error("Failed to parse KTX2 file - Array textures are not currently supported.");if(r.faceCount>1)throw new Error("Failed to parse KTX2 file - Cube textures are not currently supported.");e+=t.byteOffset;for(var n=Math.max(1,r.levelCount),a=new o(this._data,e,3*n*8),i=this._levels=[];n--;)i.push({byteOffset:a.readUint64(),byteLength:a.readUint64(),uncompressedByteLength:a.readUint64()});e+=a.byteOffset;var s=new o(this._data,r.dfdByteOffset,r.dfdByteLength),u=this._dfdBlock={vendorId:s.skipBytes(4).readUint16(),descriptorType:s.readUint16(),versionNumber:s.readUint16(),descriptorBlockSize:s.readUint16(),colorModel:s.readUint8(),colorPrimaries:s.readUint8(),transferFunction:s.readUint8(),flags:s.readUint8(),texelBlockDimension:{x:s.readUint8()+1,y:s.readUint8()+1,z:s.readUint8()+1,w:s.readUint8()+1},bytesPlane:[s.readUint8(),s.readUint8(),s.readUint8(),s.readUint8(),s.readUint8(),s.readUint8(),s.readUint8(),s.readUint8()],numSamples:0,samples:new Array};u.numSamples=(u.descriptorBlockSize-24)/16;for(var d=0;d>4,c.channelType=15&c.channelType,u.samples.push(c)}var f=this._supercompressionGlobalData={};if(r.sgdByteLength>0){var l=new o(this._data,r.sgdByteOffset,r.sgdByteLength);f.endpointCount=l.readUint16(),f.selectorCount=l.readUint16(),f.endpointsByteLength=l.readUint32(),f.selectorsByteLength=l.readUint32(),f.tablesByteLength=l.readUint32(),f.extendedByteLength=l.readUint32(),f.imageDescs=[];var h=this._getImageCount();for(d=0;d>t,1);return Math.max(this._header.layerCount,1)*this._header.faceCount*e},Object.defineProperty(e.prototype,"textureFormat",{get:function(){return 166===this._dfdBlock.colorModel?n.UASTC4x4:n.ETC1S},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasAlpha",{get:function(){switch(this.textureFormat){case n.ETC1S:return 2===this._dfdBlock.numSamples&&(15===this._dfdBlock.samples[0].channelType||15===this._dfdBlock.samples[1].channelType);case n.UASTC4x4:return 3===this._dfdBlock.samples[0].channelType}return!1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"needZSTDDecoder",{get:function(){return this._header.supercompressionScheme===i.ZStandard},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isInGammaSpace",{get:function(){return 2===this._dfdBlock.transferFunction},enumerable:!1,configurable:!0}),e.IsValid=function(e){if(e.byteLength>=12){var t=new Uint8Array(e.buffer,e.byteOffset,12);if(171===t[0]&&75===t[1]&&84===t[2]&&88===t[3]&&32===t[4]&&50===t[5]&&48===t[6]&&187===t[7]&&13===t[8]&&10===t[9]&&26===t[10]&&10===t[11])return!0}return!1},e}(),d=function(){function e(t){void 0===t&&(t=e.InitialMemoryPages),this._numPages=t,this._memory=new WebAssembly.Memory({initial:this._numPages}),this._memoryViewByteLength=this._numPages<<16,this._memoryViewOffset=0,this._memoryView=new Uint8Array(this._memory.buffer,this._memoryViewOffset,this._memoryViewByteLength)}return e.LoadWASM=function(e){if(this.LoadBinariesFromCurrentThread)return new Promise((function(t,r){fetch(e).then((function(t){if(t.ok)return t.arrayBuffer();throw new Error('Could not fetch the wasm component from "'+e+'": '+t.status+" - "+t.statusText)})).then((function(e){return t(e)})).catch((function(e){r(e)}))}));var t=this._RequestId++;return new Promise((function(r){var n=function(e){"wasmLoaded"===e.data.action&&e.data.id===t&&(self.removeEventListener("message",n),r(e.data.wasmBinary))};self.addEventListener("message",n),postMessage({action:"loadWASM",path:e,id:t})}))},Object.defineProperty(e.prototype,"wasmMemory",{get:function(){return this._memory},enumerable:!1,configurable:!0}),e.prototype.getMemoryView=function(e,t,r){return void 0===t&&(t=0),r=null!=r?r:e<<16,this._numPages>2)*(t+3>>2);a&&(r=e*(t+3>>2)*4*4);var i=1+(16*o+65535+(this._transcodeInPlace?0:r)>>16),s=this.memoryManager.getMemoryView(i,65536,16*o),u=this._transcodeInPlace?null:new Uint8Array(this._memoryManager.wasmMemory.buffer,65536+16*o,a?e*t*4:r);return s.set(n),[s,u,o]},t}(s),_=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.CanTranscode=function(e,t,r){return e===n.UASTC4x4&&t===a.ASTC_4x4_RGBA},t.prototype.getName=function(){return t.Name},t.prototype.initialize=function(){e.prototype.initialize.call(this),this.setModulePath(t.WasmModuleURL)},t.WasmModuleURL="https://preview.babylonjs.com/ktx2Transcoders/uastc_astc.wasm",t.Name="UniversalTranscoder_UASTC_ASTC",t}(m),g=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.CanTranscode=function(e,t,r){return e===n.UASTC4x4&&t===a.BC7_RGBA},t.prototype.getName=function(){return t.Name},t.prototype.initialize=function(){e.prototype.initialize.call(this),this.setModulePath(t.WasmModuleURL)},t.WasmModuleURL="https://preview.babylonjs.com/ktx2Transcoders/uastc_bc7.wasm",t.Name="UniversalTranscoder_UASTC_BC7",t}(m),b=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.CanTranscode=function(e,t,r){return e===n.UASTC4x4&&t===a.RGBA32&&!r},t.prototype.getName=function(){return t.Name},t.prototype.initialize=function(){e.prototype.initialize.call(this),this._transcodeInPlace=!1,this.setModulePath(t.WasmModuleURL)},t.prototype.transcode=function(e,t,r,n,a,o,i,s,u){var d=this;return this._loadModule().then((function(e){var t=e.module,r=d._prepareTranscoding(n,a,o,u,!0)[1];return 0===t.decodeRGBA32(n,a)?r.slice():null}))},t.WasmModuleURL="https://preview.babylonjs.com/ktx2Transcoders/uastc_rgba32_unorm.wasm",t.Name="UniversalTranscoder_UASTC_RGBA_UNORM",t}(m),B=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.CanTranscode=function(e,t,r){return e===n.UASTC4x4&&t===a.RGBA32&&r},t.prototype.getName=function(){return t.Name},t.prototype.initialize=function(){e.prototype.initialize.call(this),this._transcodeInPlace=!1,this.setModulePath(t.WasmModuleURL)},t.prototype.transcode=function(e,t,r,n,a,o,i,s,u){var d=this;return this._loadModule().then((function(e){var t=e.module,r=d._prepareTranscoding(n,a,o,u,!0)[1];return 0===t.decodeRGBA32(n,a)?r.slice():null}))},t.WasmModuleURL="https://preview.babylonjs.com/ktx2Transcoders/uastc_rgba32_srgb.wasm",t.Name="UniversalTranscoder_UASTC_RGBA_SRGB",t}(m),T=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.getName=function(){return t.Name},t.prototype._getMSCBasisTranscoder=function(){var e=this;return this._mscBasisTranscoderPromise||(this._mscBasisTranscoderPromise=d.LoadWASM(t.WasmModuleURL).then((function(r){return t.UseFromWorkerThread&&importScripts(t.JSModuleURL),new Promise((function(t){MSC_TRANSCODER({wasmBinary:r}).then((function(r){r.initTranscoders(),e._mscBasisModule=r,t()}))}))}))),this._mscBasisTranscoderPromise},t.CanTranscode=function(e,t,r){return!0},t.prototype.transcode=function(e,t,r,o,i,s,u,d,c){var f=this;return this._getMSCBasisTranscoder().then((function(){var l,h=f._mscBasisModule,p=e===n.UASTC4x4?new h.UastcImageTranscoder:new h.BasisLzEtc1sImageTranscoder,y=e===n.UASTC4x4?h.TextureFormat.UASTC4x4:h.TextureFormat.ETC1S,m=new h.ImageInfo(y,o,i,r),_=h.TranscodeTarget[a[t]];if(!h.isFormatSupported(_,y))throw new Error('MSCTranscoder: Transcoding from "'+n[e]+'" to "'+a[t]+'" not supported by current transcoder build.');if(e===n.ETC1S){var g=u.supercompressionGlobalData;p.decodePalettes(g.endpointCount,g.endpointsData,g.selectorCount,g.selectorsData),p.decodeTables(g.tablesData),m.flags=d.imageFlags,m.rgbByteOffset=0,m.rgbByteLength=d.rgbSliceByteLength,m.alphaByteOffset=d.alphaSliceByteOffset>0?d.rgbSliceByteLength:0,m.alphaByteLength=d.alphaSliceByteLength,l=p.transcodeImage(_,c,m,0,!1)}else m.flags=0,m.rgbByteOffset=0,m.rgbByteLength=s,m.alphaByteOffset=0,m.alphaByteLength=0,l=p.transcodeImage(_,c,m,0,u.hasAlpha,!1);if(l&&void 0!==l.transcodedImage){var b=l.transcodedImage.get_typed_memory_view().slice();return l.transcodedImage.delete(),b}return null}))},t.JSModuleURL="https://preview.babylonjs.com/ktx2Transcoders/msc_basis_transcoder.js",t.WasmModuleURL="https://preview.babylonjs.com/ktx2Transcoders/msc_basis_transcoder.wasm",t.UseFromWorkerThread=!0,t.Name="MSCTranscoder",t}(s),w={env:{emscripten_notify_memory_growth:function(e){y=new Uint8Array(p.exports.memory.buffer)}}},U=function(){function e(){}return e.prototype.init=function(){return h||(h="undefined"!=typeof fetch?fetch(e.WasmModuleURL).then((function(e){if(e.ok)return e.arrayBuffer();throw new Error("Could not fetch the wasm component for the Zstandard decompression lib: "+e.status+" - "+e.statusText)})).then((function(e){return WebAssembly.instantiate(e,w)})).then(this._init):WebAssembly.instantiateStreaming(fetch(e.WasmModuleURL),w).then(this._init))},e.prototype._init=function(e){p=e.instance,w.env.emscripten_notify_memory_growth(0)},e.prototype.decode=function(e,t){if(void 0===t&&(t=0),!p)throw new Error("ZSTDDecoder: Await .init() before decoding.");var r=e.byteLength,n=p.exports.malloc(r);y.set(e,n),t=t||Number(p.exports.ZSTD_findDecompressedSize(n,r));var a=p.exports.malloc(t),o=p.exports.ZSTD_decompress(a,t,n,r),i=y.slice(a,a+o);return p.exports.free(n),p.exports.free(a),i},e.WasmModuleURL="https://preview.babylonjs.com/zstddec.wasm",e}(),v=function(e){return 0==(e&e-1)&&0!==e},C=function(){function e(){this._transcoderMgr=new c}return e.prototype.decode=function(e,t,r){var n=this;return Promise.resolve().then((function(){var a=new u(e);if(!a.isValid())throw new Error("Invalid KT2 file: wrong signature");return a.parse(),a.needZSTDDecoder?(n._zstdDecoder||(n._zstdDecoder=new U),n._zstdDecoder.init().then((function(){return n._decodeData(a,t,r)}))):n._decodeData(a,t,r)}))},e.prototype._decodeData=function(e,t,r){var o=e.header.pixelWidth,s=e.header.pixelHeight,u=e.textureFormat,d=v(o)&&v(s),c=-1,f=-1,l=!0;(null==r?void 0:r.forceRGBA)?(c=a.RGBA32,f=32856,l=!1):t.astc?(c=a.ASTC_4x4_RGBA,f=37808):t.bptc?(c=a.BC7_RGBA,f=36492):(null==r?void 0:r.useRGBAIfASTCBC7NotAvailableWhenUASTC)&&u===n.UASTC4x4?(c=a.RGBA32,f=32856,l=!1):t.s3tc?(c=e.hasAlpha?a.BC3_RGBA:a.BC1_RGB,f=e.hasAlpha?33779:33777):t.pvrtc&&d?(c=e.hasAlpha?a.PVRTC1_4_RGBA:a.PVRTC1_4_RGB,f=e.hasAlpha?35842:35840):t.etc2?(c=e.hasAlpha?a.ETC2_RGBA:a.ETC1_RGB,f=e.hasAlpha?37496:37492):t.etc1?(c=a.ETC1_RGB,f=36196):(c=a.RGBA32,f=32856,l=!1);var h=this._transcoderMgr.findTranscoder(u,c,e.isInGammaSpace,null==r?void 0:r.bypassTranscoders);if(null===h)throw new Error('no transcoder found to transcode source texture format "'+n[u]+'" to format "'+a[c]+'"');for(var p=[],y=[],m={width:0,height:0,transcodedFormat:f,mipmaps:p,isInGammaSpace:e.isInGammaSpace,transcoderName:h.getName()},_=0,g=0;g0&&(_+=Math.max(e.header.layerCount,1)*e.header.faceCount*Math.max(e.header.pixelDepth>>g-1,1));var b=Math.floor(o/(1<>2)*(B+3>>2)*e.dfdBlock.bytesPlane[0],U=e.levels[g].uncompressedByteLength,C=e.data.buffer,A=e.levels[g].byteOffset+e.data.byteOffset,S=0;e.header.supercompressionScheme===i.ZStandard&&(C=this._zstdDecoder.decode(new Uint8Array(C,A,e.levels[g].byteLength),U),A=0),0===g&&(m.width=l?b+3&-4:b,m.height=l?B+3&-4:B);for(var M=function(t){var r=void 0,n=null;e.header.supercompressionScheme===i.BasisLZ?(n=e.supercompressionGlobalData.imageDescs[_+t],r=new Uint8Array(C,A+n.rgbSliceByteOffset,n.rgbSliceByteLength+n.alphaSliceByteLength)):(r=new Uint8Array(C,A+S,w),S+=w);var a={data:null,width:b,height:B},o=h.transcode(u,c,g,b,B,U,e,n,r).then((function(e){return a.data=e,e})).catch((function(e){var t;return m.errors=null!==(t=m.errors)&&void 0!==t?t:"",m.errors+=e+"\n",null}));y.push(o),p.push(a)},O=0;O1){Module["thisProgram"]=process["argv"][1].replace(/\\/g,"/")}Module["arguments"]=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);Module["quit"]=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"}}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){Module["read"]=function shell_read(f){return read(f)}}Module["readBinary"]=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){Module["arguments"]=scriptArgs}else if(typeof arguments!="undefined"){Module["arguments"]=arguments}if(typeof quit==="function"){Module["quit"]=function(status){quit(status)}}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}Module["read"]=function shell_read(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){Module["readBinary"]=function readBinary(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}Module["readAsync"]=function readAsync(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function xhr_onload(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)};Module["setWindowTitle"]=function(title){document.title=title}}else{}var out=Module["print"]||(typeof console!=="undefined"?console.log.bind(console):typeof print!=="undefined"?print:null);var err=Module["printErr"]||(typeof printErr!=="undefined"?printErr:typeof console!=="undefined"&&console.warn.bind(console)||out);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=undefined;var asm2wasmImports={"f64-rem":function(x,y){return x%y},"debugger":function(){debugger}};var functionPointers=new Array(0);var tempRet0=0;var setTempRet0=function(value){tempRet0=value};if(typeof WebAssembly!=="object"){err("no native wasm support detected")}var wasmMemory;var wasmTable;var ABORT=false;var EXITSTATUS=0;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}var UTF8Decoder=typeof TextDecoder!=="undefined"?new TextDecoder("utf8"):undefined;function UTF8ArrayToString(u8Array,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var endPtr=idx;while(u8Array[endPtr]&&!(endPtr>=endIdx))++endPtr;if(endPtr-idx>16&&u8Array.subarray&&UTF8Decoder){return UTF8Decoder.decode(u8Array.subarray(idx,endPtr))}else{var str="";while(idx>10,56320|ch&1023)}}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,outU8Array,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;outU8Array[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;outU8Array[outIdx++]=192|u>>6;outU8Array[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;outU8Array[outIdx++]=224|u>>12;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;outU8Array[outIdx++]=240|u>>18;outU8Array[outIdx++]=128|u>>12&63;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}}outU8Array[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}var UTF16Decoder=typeof TextDecoder!=="undefined"?new TextDecoder("utf-16le"):undefined;var WASM_PAGE_SIZE=65536;function alignUp(x,multiple){if(x%multiple>0){x+=multiple-x%multiple}return x}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferViews(){Module["HEAP8"]=HEAP8=new Int8Array(buffer);Module["HEAP16"]=HEAP16=new Int16Array(buffer);Module["HEAP32"]=HEAP32=new Int32Array(buffer);Module["HEAPU8"]=HEAPU8=new Uint8Array(buffer);Module["HEAPU16"]=HEAPU16=new Uint16Array(buffer);Module["HEAPU32"]=HEAPU32=new Uint32Array(buffer);Module["HEAPF32"]=HEAPF32=new Float32Array(buffer);Module["HEAPF64"]=HEAPF64=new Float64Array(buffer)}var DYNAMIC_BASE=5401280,DYNAMICTOP_PTR=158368;var TOTAL_STACK=5242880;var INITIAL_TOTAL_MEMORY=Module["TOTAL_MEMORY"]||16777216;if(INITIAL_TOTAL_MEMORY>2]=DYNAMIC_BASE;function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback();continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){Module["dynCall_v"](func)}else{Module["dynCall_vi"](func,callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function ensureInitRuntime(){if(runtimeInitialized)return;runtimeInitialized=true;callRuntimeCallbacks(__ATINIT__)}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function postRun(){if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function addRunDependency(id){runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return String.prototype.startsWith?filename.startsWith(dataURIPrefix):filename.indexOf(dataURIPrefix)===0}var wasmBinaryFile="basis_transcoder.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(){try{if(Module["wasmBinary"]){return new Uint8Array(Module["wasmBinary"])}if(Module["readBinary"]){return Module["readBinary"](wasmBinaryFile)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!Module["wasmBinary"]&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary()})}return new Promise(function(resolve,reject){resolve(getBinary())})}function createWasm(env){var info={"env":env,"global":{"NaN":NaN,Infinity:Infinity},"global.Math":Math,"asm2wasm":asm2wasmImports};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;removeRunDependency("wasm-instantiate")}addRunDependency("wasm-instantiate");if(Module["instantiateWasm"]){try{return Module["instantiateWasm"](info,receiveInstance)}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}function receiveInstantiatedSource(output){receiveInstance(output["instance"])}function instantiateArrayBuffer(receiver){getBinaryPromise().then(function(binary){return WebAssembly.instantiate(binary,info)}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}if(!Module["wasmBinary"]&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&typeof fetch==="function"){WebAssembly.instantiateStreaming(fetch(wasmBinaryFile,{credentials:"same-origin"}),info).then(receiveInstantiatedSource,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");instantiateArrayBuffer(receiveInstantiatedSource)})}else{instantiateArrayBuffer(receiveInstantiatedSource)}return{}}Module["asm"]=function(global,env,providedBuffer){env["memory"]=wasmMemory;env["table"]=wasmTable=new WebAssembly.Table({"initial":70,"maximum":70,"element":"anyfunc"});env["__memory_base"]=1024;env["__table_base"]=0;var exports=createWasm(env);return exports};__ATINIT__.push({func:function(){globalCtors()}});function ___cxa_allocate_exception(size){return _malloc(size)}function __ZSt18uncaught_exceptionv(){return!!__ZSt18uncaught_exceptionv.uncaught_exception}function ___cxa_free_exception(ptr){try{return _free(ptr)}catch(e){}}var EXCEPTIONS={last:0,caught:[],infos:{},deAdjust:function(adjusted){if(!adjusted||EXCEPTIONS.infos[adjusted])return adjusted;for(var key in EXCEPTIONS.infos){var ptr=+key;var adj=EXCEPTIONS.infos[ptr].adjusted;var len=adj.length;for(var i=0;i0);info.refcount--;if(info.refcount===0&&!info.rethrown){if(info.destructor){Module["dynCall_vi"](info.destructor,ptr)}delete EXCEPTIONS.infos[ptr];___cxa_free_exception(ptr)}},clearRef:function(ptr){if(!ptr)return;var info=EXCEPTIONS.infos[ptr];info.refcount=0}};function ___cxa_throw(ptr,type,destructor){EXCEPTIONS.infos[ptr]={ptr:ptr,adjusted:[ptr],type:type,destructor:destructor,refcount:0,caught:false,rethrown:false};EXCEPTIONS.last=ptr;if(!("uncaught_exception"in __ZSt18uncaught_exceptionv)){__ZSt18uncaught_exceptionv.uncaught_exception=1}else{__ZSt18uncaught_exceptionv.uncaught_exception++}throw ptr}var SYSCALLS={buffers:[null,[],[]],printChar:function(stream,curr){var buffer=SYSCALLS.buffers[stream];if(curr===0||curr===10){(stream===1?out:err)(UTF8ArrayToString(buffer,0));buffer.length=0}else{buffer.push(curr)}},varargs:0,get:function(varargs){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(){var ret=UTF8ToString(SYSCALLS.get());return ret},get64:function(){var low=SYSCALLS.get(),high=SYSCALLS.get();return low},getZero:function(){SYSCALLS.get()}};function ___syscall140(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),offset_high=SYSCALLS.get(),offset_low=SYSCALLS.get(),result=SYSCALLS.get(),whence=SYSCALLS.get();return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall146(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.get(),iov=SYSCALLS.get(),iovcnt=SYSCALLS.get();var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];for(var j=0;j=char_0&&f<=char_9){return"_"+name}else{return name}}function createNamedFunction(name,body){name=makeLegalFunctionName(name);return new Function("body","return function "+name+"() {\n"+' "use strict";'+" return body.apply(this, arguments);\n"+"};\n")(body)}function extendError(baseErrorType,errorName){var errorClass=createNamedFunction(errorName,function(message){this.name=errorName;this.message=message;var stack=new Error(message).stack;if(stack!==undefined){this.stack=this.toString()+"\n"+stack.replace(/^Error(:[^\n]*)?\n/,"")}});errorClass.prototype=Object.create(baseErrorType.prototype);errorClass.prototype.constructor=errorClass;errorClass.prototype.toString=function(){if(this.message===undefined){return this.name}else{return this.name+": "+this.message}};return errorClass}var BindingError=undefined;function throwBindingError(message){throw new BindingError(message)}var InternalError=undefined;function throwInternalError(message){throw new InternalError(message)}function whenDependentTypesAreResolved(myTypes,dependentTypes,getTypeConverters){myTypes.forEach(function(type){typeDependencies[type]=dependentTypes});function onComplete(typeConverters){var myTypeConverters=getTypeConverters(typeConverters);if(myTypeConverters.length!==myTypes.length){throwInternalError("Mismatched type converter count")}for(var i=0;i>shift])},destructorFunction:null})}function ClassHandle_isAliasOf(other){if(!(this instanceof ClassHandle)){return false}if(!(other instanceof ClassHandle)){return false}var leftClass=this.$$.ptrType.registeredClass;var left=this.$$.ptr;var rightClass=other.$$.ptrType.registeredClass;var right=other.$$.ptr;while(leftClass.baseClass){left=leftClass.upcast(left);leftClass=leftClass.baseClass}while(rightClass.baseClass){right=rightClass.upcast(right);rightClass=rightClass.baseClass}return leftClass===rightClass&&left===right}function shallowCopyInternalPointer(o){return{count:o.count,deleteScheduled:o.deleteScheduled,preservePointerOnDelete:o.preservePointerOnDelete,ptr:o.ptr,ptrType:o.ptrType,smartPtr:o.smartPtr,smartPtrType:o.smartPtrType}}function throwInstanceAlreadyDeleted(obj){function getInstanceTypeName(handle){return handle.$$.ptrType.registeredClass.name}throwBindingError(getInstanceTypeName(obj)+" instance already deleted")}function ClassHandle_clone(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.preservePointerOnDelete){this.$$.count.value+=1;return this}else{var clone=Object.create(Object.getPrototypeOf(this),{$$:{value:shallowCopyInternalPointer(this.$$)}});clone.$$.count.value+=1;clone.$$.deleteScheduled=false;return clone}}function runDestructor(handle){var $$=handle.$$;if($$.smartPtr){$$.smartPtrType.rawDestructor($$.smartPtr)}else{$$.ptrType.registeredClass.rawDestructor($$.ptr)}}function ClassHandle_delete(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete){throwBindingError("Object already scheduled for deletion")}this.$$.count.value-=1;var toDelete=0===this.$$.count.value;if(toDelete){runDestructor(this)}if(!this.$$.preservePointerOnDelete){this.$$.smartPtr=undefined;this.$$.ptr=undefined}}function ClassHandle_isDeleted(){return!this.$$.ptr}var delayFunction=undefined;var deletionQueue=[];function flushPendingDeletes(){while(deletionQueue.length){var obj=deletionQueue.pop();obj.$$.deleteScheduled=false;obj["delete"]()}}function ClassHandle_deleteLater(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete){throwBindingError("Object already scheduled for deletion")}deletionQueue.push(this);if(deletionQueue.length===1&&delayFunction){delayFunction(flushPendingDeletes)}this.$$.deleteScheduled=true;return this}function init_ClassHandle(){ClassHandle.prototype["isAliasOf"]=ClassHandle_isAliasOf;ClassHandle.prototype["clone"]=ClassHandle_clone;ClassHandle.prototype["delete"]=ClassHandle_delete;ClassHandle.prototype["isDeleted"]=ClassHandle_isDeleted;ClassHandle.prototype["deleteLater"]=ClassHandle_deleteLater}function ClassHandle(){}var registeredPointers={};function ensureOverloadTable(proto,methodName,humanName){if(undefined===proto[methodName].overloadTable){var prevFunc=proto[methodName];proto[methodName]=function(){if(!proto[methodName].overloadTable.hasOwnProperty(arguments.length)){throwBindingError("Function '"+humanName+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+proto[methodName].overloadTable+")!")}return proto[methodName].overloadTable[arguments.length].apply(this,arguments)};proto[methodName].overloadTable=[];proto[methodName].overloadTable[prevFunc.argCount]=prevFunc}}function exposePublicSymbol(name,value,numArguments){if(Module.hasOwnProperty(name)){if(undefined===numArguments||undefined!==Module[name].overloadTable&&undefined!==Module[name].overloadTable[numArguments]){throwBindingError("Cannot register public name '"+name+"' twice")}ensureOverloadTable(Module,name,name);if(Module.hasOwnProperty(numArguments)){throwBindingError("Cannot register multiple overloads of a function with the same number of arguments ("+numArguments+")!")}Module[name].overloadTable[numArguments]=value}else{Module[name]=value;if(undefined!==numArguments){Module[name].numArguments=numArguments}}}function RegisteredClass(name,constructor,instancePrototype,rawDestructor,baseClass,getActualType,upcast,downcast){this.name=name;this.constructor=constructor;this.instancePrototype=instancePrototype;this.rawDestructor=rawDestructor;this.baseClass=baseClass;this.getActualType=getActualType;this.upcast=upcast;this.downcast=downcast;this.pureVirtualFunctions=[]}function upcastPointer(ptr,ptrClass,desiredClass){while(ptrClass!==desiredClass){if(!ptrClass.upcast){throwBindingError("Expected null or instance of "+desiredClass.name+", got an instance of "+ptrClass.name)}ptr=ptrClass.upcast(ptr);ptrClass=ptrClass.baseClass}return ptr}function constNoSmartPtrRawPointerToWireType(destructors,handle){if(handle===null){if(this.isReference){throwBindingError("null is not a valid "+this.name)}return 0}if(!handle.$$){throwBindingError('Cannot pass "'+_embind_repr(handle)+'" as a '+this.name)}if(!handle.$$.ptr){throwBindingError("Cannot pass deleted object as a pointer of type "+this.name)}var handleClass=handle.$$.ptrType.registeredClass;var ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);return ptr}function genericPointerToWireType(destructors,handle){var ptr;if(handle===null){if(this.isReference){throwBindingError("null is not a valid "+this.name)}if(this.isSmartPointer){ptr=this.rawConstructor();if(destructors!==null){destructors.push(this.rawDestructor,ptr)}return ptr}else{return 0}}if(!handle.$$){throwBindingError('Cannot pass "'+_embind_repr(handle)+'" as a '+this.name)}if(!handle.$$.ptr){throwBindingError("Cannot pass deleted object as a pointer of type "+this.name)}if(!this.isConst&&handle.$$.ptrType.isConst){throwBindingError("Cannot convert argument of type "+(handle.$$.smartPtrType?handle.$$.smartPtrType.name:handle.$$.ptrType.name)+" to parameter type "+this.name)}var handleClass=handle.$$.ptrType.registeredClass;ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);if(this.isSmartPointer){if(undefined===handle.$$.smartPtr){throwBindingError("Passing raw pointer to smart pointer is illegal")}switch(this.sharingPolicy){case 0:if(handle.$$.smartPtrType===this){ptr=handle.$$.smartPtr}else{throwBindingError("Cannot convert argument of type "+(handle.$$.smartPtrType?handle.$$.smartPtrType.name:handle.$$.ptrType.name)+" to parameter type "+this.name)}break;case 1:ptr=handle.$$.smartPtr;break;case 2:if(handle.$$.smartPtrType===this){ptr=handle.$$.smartPtr}else{var clonedHandle=handle["clone"]();ptr=this.rawShare(ptr,__emval_register(function(){clonedHandle["delete"]()}));if(destructors!==null){destructors.push(this.rawDestructor,ptr)}}break;default:throwBindingError("Unsupporting sharing policy")}}return ptr}function nonConstNoSmartPtrRawPointerToWireType(destructors,handle){if(handle===null){if(this.isReference){throwBindingError("null is not a valid "+this.name)}return 0}if(!handle.$$){throwBindingError('Cannot pass "'+_embind_repr(handle)+'" as a '+this.name)}if(!handle.$$.ptr){throwBindingError("Cannot pass deleted object as a pointer of type "+this.name)}if(handle.$$.ptrType.isConst){throwBindingError("Cannot convert argument of type "+handle.$$.ptrType.name+" to parameter type "+this.name)}var handleClass=handle.$$.ptrType.registeredClass;var ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);return ptr}function simpleReadValueFromPointer(pointer){return this["fromWireType"](HEAPU32[pointer>>2])}function RegisteredPointer_getPointee(ptr){if(this.rawGetPointee){ptr=this.rawGetPointee(ptr)}return ptr}function RegisteredPointer_destructor(ptr){if(this.rawDestructor){this.rawDestructor(ptr)}}function RegisteredPointer_deleteObject(handle){if(handle!==null){handle["delete"]()}}function downcastPointer(ptr,ptrClass,desiredClass){if(ptrClass===desiredClass){return ptr}if(undefined===desiredClass.baseClass){return null}var rv=downcastPointer(ptr,ptrClass,desiredClass.baseClass);if(rv===null){return null}return desiredClass.downcast(rv)}function getInheritedInstanceCount(){return Object.keys(registeredInstances).length}function getLiveInheritedInstances(){var rv=[];for(var k in registeredInstances){if(registeredInstances.hasOwnProperty(k)){rv.push(registeredInstances[k])}}return rv}function setDelayFunction(fn){delayFunction=fn;if(deletionQueue.length&&delayFunction){delayFunction(flushPendingDeletes)}}function init_embind(){Module["getInheritedInstanceCount"]=getInheritedInstanceCount;Module["getLiveInheritedInstances"]=getLiveInheritedInstances;Module["flushPendingDeletes"]=flushPendingDeletes;Module["setDelayFunction"]=setDelayFunction}var registeredInstances={};function getBasestPointer(class_,ptr){if(ptr===undefined){throwBindingError("ptr should not be undefined")}while(class_.baseClass){ptr=class_.upcast(ptr);class_=class_.baseClass}return ptr}function getInheritedInstance(class_,ptr){ptr=getBasestPointer(class_,ptr);return registeredInstances[ptr]}function makeClassHandle(prototype,record){if(!record.ptrType||!record.ptr){throwInternalError("makeClassHandle requires ptr and ptrType")}var hasSmartPtrType=!!record.smartPtrType;var hasSmartPtr=!!record.smartPtr;if(hasSmartPtrType!==hasSmartPtr){throwInternalError("Both smartPtrType and smartPtr must be specified")}record.count={value:1};return Object.create(prototype,{$$:{value:record}})}function RegisteredPointer_fromWireType(ptr){var rawPointer=this.getPointee(ptr);if(!rawPointer){this.destructor(ptr);return null}var registeredInstance=getInheritedInstance(this.registeredClass,rawPointer);if(undefined!==registeredInstance){if(0===registeredInstance.$$.count.value){registeredInstance.$$.ptr=rawPointer;registeredInstance.$$.smartPtr=ptr;return registeredInstance["clone"]()}else{var rv=registeredInstance["clone"]();this.destructor(ptr);return rv}}function makeDefaultHandle(){if(this.isSmartPointer){return makeClassHandle(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:rawPointer,smartPtrType:this,smartPtr:ptr})}else{return makeClassHandle(this.registeredClass.instancePrototype,{ptrType:this,ptr:ptr})}}var actualType=this.registeredClass.getActualType(rawPointer);var registeredPointerRecord=registeredPointers[actualType];if(!registeredPointerRecord){return makeDefaultHandle.call(this)}var toType;if(this.isConst){toType=registeredPointerRecord.constPointerType}else{toType=registeredPointerRecord.pointerType}var dp=downcastPointer(rawPointer,this.registeredClass,toType.registeredClass);if(dp===null){return makeDefaultHandle.call(this)}if(this.isSmartPointer){return makeClassHandle(toType.registeredClass.instancePrototype,{ptrType:toType,ptr:dp,smartPtrType:this,smartPtr:ptr})}else{return makeClassHandle(toType.registeredClass.instancePrototype,{ptrType:toType,ptr:dp})}}function init_RegisteredPointer(){RegisteredPointer.prototype.getPointee=RegisteredPointer_getPointee;RegisteredPointer.prototype.destructor=RegisteredPointer_destructor;RegisteredPointer.prototype["argPackAdvance"]=8;RegisteredPointer.prototype["readValueFromPointer"]=simpleReadValueFromPointer;RegisteredPointer.prototype["deleteObject"]=RegisteredPointer_deleteObject;RegisteredPointer.prototype["fromWireType"]=RegisteredPointer_fromWireType}function RegisteredPointer(name,registeredClass,isReference,isConst,isSmartPointer,pointeeType,sharingPolicy,rawGetPointee,rawConstructor,rawShare,rawDestructor){this.name=name;this.registeredClass=registeredClass;this.isReference=isReference;this.isConst=isConst;this.isSmartPointer=isSmartPointer;this.pointeeType=pointeeType;this.sharingPolicy=sharingPolicy;this.rawGetPointee=rawGetPointee;this.rawConstructor=rawConstructor;this.rawShare=rawShare;this.rawDestructor=rawDestructor;if(!isSmartPointer&®isteredClass.baseClass===undefined){if(isConst){this["toWireType"]=constNoSmartPtrRawPointerToWireType;this.destructorFunction=null}else{this["toWireType"]=nonConstNoSmartPtrRawPointerToWireType;this.destructorFunction=null}}else{this["toWireType"]=genericPointerToWireType}}function replacePublicSymbol(name,value,numArguments){if(!Module.hasOwnProperty(name)){throwInternalError("Replacing nonexistant public symbol")}if(undefined!==Module[name].overloadTable&&undefined!==numArguments){Module[name].overloadTable[numArguments]=value}else{Module[name]=value;Module[name].argCount=numArguments}}function embind__requireFunction(signature,rawFunction){signature=readLatin1String(signature);function makeDynCaller(dynCall){var args=[];for(var i=1;i>2)+i])}return array}function runDestructors(destructors){while(destructors.length){var ptr=destructors.pop();var del=destructors.pop();del(ptr)}}function __embind_register_class_constructor(rawClassType,argCount,rawArgTypesAddr,invokerSignature,invoker,rawConstructor){var rawArgTypes=heap32VectorToArray(argCount,rawArgTypesAddr);invoker=embind__requireFunction(invokerSignature,invoker);whenDependentTypesAreResolved([],[rawClassType],function(classType){classType=classType[0];var humanName="constructor "+classType.name;if(undefined===classType.registeredClass.constructor_body){classType.registeredClass.constructor_body=[]}if(undefined!==classType.registeredClass.constructor_body[argCount-1]){throw new BindingError("Cannot register multiple constructors with identical number of parameters ("+(argCount-1)+") for class '"+classType.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!")}classType.registeredClass.constructor_body[argCount-1]=function unboundTypeHandler(){throwUnboundTypeError("Cannot construct "+classType.name+" due to unbound types",rawArgTypes)};whenDependentTypesAreResolved([],rawArgTypes,function(argTypes){classType.registeredClass.constructor_body[argCount-1]=function constructor_body(){if(arguments.length!==argCount-1){throwBindingError(humanName+" called with "+arguments.length+" arguments, expected "+(argCount-1))}var destructors=[];var args=new Array(argCount);args[0]=rawConstructor;for(var i=1;i0?", ":"")+argsListWired}invokerFnBody+=(returns?"var rv = ":"")+"invoker(fn"+(argsListWired.length>0?", ":"")+argsListWired+");\n";if(needsDestructorStack){invokerFnBody+="runDestructors(destructors);\n"}else{for(var i=isClassMethodFunc?1:2;i4&&0===--emval_handle_array[handle].refcount){emval_handle_array[handle]=undefined;emval_free_list.push(handle)}}function count_emval_handles(){var count=0;for(var i=5;i>2])};case 3:return function(pointer){return this["fromWireType"](HEAPF64[pointer>>3])};default:throw new TypeError("Unknown float type: "+name)}}function __embind_register_float(rawType,name,size){var shift=getShiftFromSize(size);name=readLatin1String(name);registerType(rawType,{name:name,"fromWireType":function(value){return value},"toWireType":function(destructors,value){if(typeof value!=="number"&&typeof value!=="boolean"){throw new TypeError('Cannot convert "'+_embind_repr(value)+'" to '+this.name)}return value},"argPackAdvance":8,"readValueFromPointer":floatReadValueFromPointer(name,shift),destructorFunction:null})}function __embind_register_function(name,argCount,rawArgTypesAddr,signature,rawInvoker,fn){var argTypes=heap32VectorToArray(argCount,rawArgTypesAddr);name=readLatin1String(name);rawInvoker=embind__requireFunction(signature,rawInvoker);exposePublicSymbol(name,function(){throwUnboundTypeError("Cannot call "+name+" due to unbound types",argTypes)},argCount-1);whenDependentTypesAreResolved([],argTypes,function(argTypes){var invokerArgsArray=[argTypes[0],null].concat(argTypes.slice(1));replacePublicSymbol(name,craftInvokerFunction(name,invokerArgsArray,null,rawInvoker,fn),argCount-1);return[]})}function integerReadValueFromPointer(name,shift,signed){switch(shift){case 0:return signed?function readS8FromPointer(pointer){return HEAP8[pointer]}:function readU8FromPointer(pointer){return HEAPU8[pointer]};case 1:return signed?function readS16FromPointer(pointer){return HEAP16[pointer>>1]}:function readU16FromPointer(pointer){return HEAPU16[pointer>>1]};case 2:return signed?function readS32FromPointer(pointer){return HEAP32[pointer>>2]}:function readU32FromPointer(pointer){return HEAPU32[pointer>>2]};default:throw new TypeError("Unknown integer type: "+name)}}function __embind_register_integer(primitiveType,name,size,minRange,maxRange){name=readLatin1String(name);if(maxRange===-1){maxRange=4294967295}var shift=getShiftFromSize(size);var fromWireType=function(value){return value};if(minRange===0){var bitshift=32-8*size;fromWireType=function(value){return value<>>bitshift}}var isUnsignedType=name.indexOf("unsigned")!=-1;registerType(primitiveType,{name:name,"fromWireType":fromWireType,"toWireType":function(destructors,value){if(typeof value!=="number"&&typeof value!=="boolean"){throw new TypeError('Cannot convert "'+_embind_repr(value)+'" to '+this.name)}if(valuemaxRange){throw new TypeError('Passing a number "'+_embind_repr(value)+'" from JS side to C/C++ side to an argument of type "'+name+'", which is outside the valid range ['+minRange+", "+maxRange+"]!")}return isUnsignedType?value>>>0:value|0},"argPackAdvance":8,"readValueFromPointer":integerReadValueFromPointer(name,shift,minRange!==0),destructorFunction:null})}function __embind_register_memory_view(rawType,dataTypeIndex,name){var typeMapping=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];var TA=typeMapping[dataTypeIndex];function decodeMemoryView(handle){handle=handle>>2;var heap=HEAPU32;var size=heap[handle];var data=heap[handle+1];return new TA(heap["buffer"],data,size)}name=readLatin1String(name);registerType(rawType,{name:name,"fromWireType":decodeMemoryView,"argPackAdvance":8,"readValueFromPointer":decodeMemoryView},{ignoreDuplicateRegistrations:true})}function __embind_register_std_string(rawType,name){name=readLatin1String(name);var stdStringIsUTF8=name==="std::string";registerType(rawType,{name:name,"fromWireType":function(value){var length=HEAPU32[value>>2];var str;if(stdStringIsUTF8){var endChar=HEAPU8[value+4+length];var endCharSwap=0;if(endChar!=0){endCharSwap=endChar;HEAPU8[value+4+length]=0}var decodeStartPtr=value+4;for(var i=0;i<=length;++i){var currentBytePtr=value+4+i;if(HEAPU8[currentBytePtr]==0){var stringSegment=UTF8ToString(decodeStartPtr);if(str===undefined)str=stringSegment;else{str+=String.fromCharCode(0);str+=stringSegment}decodeStartPtr=currentBytePtr+1}}if(endCharSwap!=0)HEAPU8[value+4+length]=endCharSwap}else{var a=new Array(length);for(var i=0;i>2]=length;if(stdStringIsUTF8&&valueIsOfTypeString){stringToUTF8(value,ptr+4,length+1)}else{if(valueIsOfTypeString){for(var i=0;i255){_free(ptr);throwBindingError("String has UTF-16 code units that do not fit in 8 bits")}HEAPU8[ptr+4+i]=charCode}}else{for(var i=0;i>2];var a=new Array(length);var start=value+4>>shift;for(var i=0;i>2]=length;var start=ptr+4>>shift;for(var i=0;i>2]=rd;return returnType["toWireType"](destructors,handle)}var emval_symbols={};function getStringOrSymbol(address){var symbol=emval_symbols[address];if(symbol===undefined){return readLatin1String(address)}else{return symbol}}var emval_methodCallers=[];function __emval_call_void_method(caller,handle,methodName,args){caller=emval_methodCallers[caller];handle=requireHandle(handle);methodName=getStringOrSymbol(methodName);caller(handle,methodName,null,args)}function emval_get_global(){return function(){return Function}()("return this")()}function __emval_get_global(name){if(name===0){return __emval_register(emval_get_global())}else{name=getStringOrSymbol(name);return __emval_register(emval_get_global()[name])}}function __emval_addMethodCaller(caller){var id=emval_methodCallers.length;emval_methodCallers.push(caller);return id}function __emval_lookupTypes(argCount,argTypes,argWireTypes){var a=new Array(argCount);for(var i=0;i>2)+i],"parameter "+i)}return a}function __emval_get_method_caller(argCount,argTypes){var types=__emval_lookupTypes(argCount,argTypes);var retType=types[0];var signatureName=retType.name+"_$"+types.slice(1).map(function(t){return t.name}).join("_")+"$";var params=["retType"];var args=[retType];var argsList="";for(var i=0;i4){emval_handle_array[handle].refcount+=1}}function craftEmvalAllocator(argCount){var argsList="";for(var i=0;i> 2) + "+i+'], "parameter '+i+'");\n'+"var arg"+i+" = argType"+i+".readValueFromPointer(args);\n"+"args += argType"+i+"['argPackAdvance'];\n"}functionBody+="var obj = new constructor("+argsList+");\n"+"return __emval_register(obj);\n"+"}\n";return new Function("requireRegisteredType","Module","__emval_register",functionBody)(requireRegisteredType,Module,__emval_register)}var emval_newers={};function __emval_new(handle,argCount,argTypes,args){handle=requireHandle(handle);var newer=emval_newers[argCount];if(!newer){newer=craftEmvalAllocator(argCount);emval_newers[argCount]=newer}return newer(handle,argTypes,args)}function __emval_new_cstring(v){return __emval_register(getStringOrSymbol(v))}function __emval_run_destructors(handle){var destructors=emval_handle_array[handle].value;runDestructors(destructors);__emval_decref(handle)}function _abort(){Module["abort"]()}function _emscripten_get_heap_size(){return HEAP8.length}function abortOnCannotGrowMemory(requestedSize){abort("OOM")}function emscripten_realloc_buffer(size){var PAGE_MULTIPLE=65536;size=alignUp(size,PAGE_MULTIPLE);var oldSize=buffer.byteLength;try{var result=wasmMemory.grow((size-oldSize)/65536);if(result!==(-1|0)){buffer=wasmMemory.buffer;return true}else{return false}}catch(e){return false}}function _emscripten_resize_heap(requestedSize){var oldSize=_emscripten_get_heap_size();var PAGE_MULTIPLE=65536;var LIMIT=2147483648-PAGE_MULTIPLE;if(requestedSize>LIMIT){return false}var MIN_TOTAL_MEMORY=16777216;var newSize=Math.max(oldSize,MIN_TOTAL_MEMORY);while(newSize>2]=value;return value}embind_init_charCodes();BindingError=Module["BindingError"]=extendError(Error,"BindingError");InternalError=Module["InternalError"]=extendError(Error,"InternalError");init_ClassHandle();init_RegisteredPointer();init_embind();UnboundTypeError=Module["UnboundTypeError"]=extendError(Error,"UnboundTypeError");init_emval();var asmGlobalArg={};var asmLibraryArg={"d":abort,"B":setTempRet0,"i":___cxa_allocate_exception,"h":___cxa_throw,"n":___setErrNo,"A":___syscall140,"m":___syscall146,"z":___syscall6,"y":__embind_register_bool,"x":__embind_register_class,"w":__embind_register_class_constructor,"g":__embind_register_class_function,"K":__embind_register_emval,"v":__embind_register_float,"J":__embind_register_function,"f":__embind_register_integer,"c":__embind_register_memory_view,"u":__embind_register_std_string,"I":__embind_register_std_wstring,"H":__embind_register_void,"t":__emval_as,"s":__emval_call_void_method,"b":__emval_decref,"G":__emval_get_global,"r":__emval_get_method_caller,"q":__emval_get_module_property,"k":__emval_get_property,"l":__emval_incref,"p":__emval_new,"j":__emval_new_cstring,"o":__emval_run_destructors,"e":_abort,"F":_emscripten_get_heap_size,"E":_emscripten_memcpy_big,"D":_emscripten_resize_heap,"C":abortOnCannotGrowMemory,"a":DYNAMICTOP_PTR};var asm=Module["asm"](asmGlobalArg,asmLibraryArg,buffer);Module["asm"]=asm;var ___errno_location=Module["___errno_location"]=function(){return Module["asm"]["L"].apply(null,arguments)};var ___getTypeName=Module["___getTypeName"]=function(){return Module["asm"]["M"].apply(null,arguments)};var _free=Module["_free"]=function(){return Module["asm"]["N"].apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return Module["asm"]["O"].apply(null,arguments)};var globalCtors=Module["globalCtors"]=function(){return Module["asm"]["ca"].apply(null,arguments)};var dynCall_ii=Module["dynCall_ii"]=function(){return Module["asm"]["P"].apply(null,arguments)};var dynCall_iidiiii=Module["dynCall_iidiiii"]=function(){return Module["asm"]["Q"].apply(null,arguments)};var dynCall_iii=Module["dynCall_iii"]=function(){return Module["asm"]["R"].apply(null,arguments)};var dynCall_iiii=Module["dynCall_iiii"]=function(){return Module["asm"]["S"].apply(null,arguments)};var dynCall_iiiii=Module["dynCall_iiiii"]=function(){return Module["asm"]["T"].apply(null,arguments)};var dynCall_iiiiii=Module["dynCall_iiiiii"]=function(){return Module["asm"]["U"].apply(null,arguments)};var dynCall_iiiiiiii=Module["dynCall_iiiiiiii"]=function(){return Module["asm"]["V"].apply(null,arguments)};var dynCall_iiiiiiiii=Module["dynCall_iiiiiiiii"]=function(){return Module["asm"]["W"].apply(null,arguments)};var dynCall_jiji=Module["dynCall_jiji"]=function(){return Module["asm"]["X"].apply(null,arguments)};var dynCall_v=Module["dynCall_v"]=function(){return Module["asm"]["Y"].apply(null,arguments)};var dynCall_vi=Module["dynCall_vi"]=function(){return Module["asm"]["Z"].apply(null,arguments)};var dynCall_vii=Module["dynCall_vii"]=function(){return Module["asm"]["_"].apply(null,arguments)};var dynCall_viiii=Module["dynCall_viiii"]=function(){return Module["asm"]["$"].apply(null,arguments)};var dynCall_viiiii=Module["dynCall_viiiii"]=function(){return Module["asm"]["aa"].apply(null,arguments)};var dynCall_viiiiii=Module["dynCall_viiiiii"]=function(){return Module["asm"]["ba"].apply(null,arguments)};Module["asm"]=asm;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}ExitStatus.prototype=new Error;ExitStatus.prototype.constructor=ExitStatus;dependenciesFulfilled=function runCaller(){if(!Module["calledRun"])run();if(!Module["calledRun"])dependenciesFulfilled=runCaller};function run(args){args=args||Module["arguments"];if(runDependencies>0){return}preRun();if(runDependencies>0)return;if(Module["calledRun"])return;function doRun(){if(Module["calledRun"])return;Module["calledRun"]=true;if(ABORT)return;ensureInitRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(what!==undefined){out(what);err(what);what=JSON.stringify(what)}else{what=""}ABORT=true;EXITSTATUS=1;throw"abort("+what+"). Build with -s ASSERTIONS=1 for more info."}Module["abort"]=abort;if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}Module["noExitRuntime"]=true;run(); diff --git a/src/assets/js/basisTranscoder/basis_transcoder.wasm b/src/assets/js/basisTranscoder/basis_transcoder.wasm new file mode 100644 index 0000000..c5b4d20 Binary files /dev/null and b/src/assets/js/basisTranscoder/basis_transcoder.wasm differ diff --git a/src/assets/js/draco_decoder_gltf.js b/src/assets/js/draco_decoder_gltf.js new file mode 100644 index 0000000..13ec1e5 --- /dev/null +++ b/src/assets/js/draco_decoder_gltf.js @@ -0,0 +1,48 @@ + +var DracoDecoderModule = (function() { + var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined; + if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename; + return ( +function(DracoDecoderModule) { + DracoDecoderModule = DracoDecoderModule || {}; + +var Module=typeof DracoDecoderModule!=="undefined"?DracoDecoderModule:{};var isRuntimeInitialized=false;var isModuleParsed=false;Module["onRuntimeInitialized"]=function(){isRuntimeInitialized=true;if(isModuleParsed){if(typeof Module["onModuleLoaded"]==="function"){Module["onModuleLoaded"](Module)}}};Module["onModuleParsed"]=function(){isModuleParsed=true;if(isRuntimeInitialized){if(typeof Module["onModuleLoaded"]==="function"){Module["onModuleLoaded"](Module)}}};function isVersionSupported(versionString){if(typeof versionString!=="string")return false;const version=versionString.split(".");if(version.length<2||version.length>3)return false;if(version[0]==1&&version[1]>=0&&version[1]<=3)return true;if(version[0]!=0||version[1]>10)return false;return true}Module["isVersionSupported"]=isVersionSupported;var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){var ret=tryParseAsDataURI(filename);if(ret){return binary?ret:ret.toString()}if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"}}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){var data=tryParseAsDataURI(f);if(data){return intArrayToString(data)}return read(f)}}readBinary=function readBinary(f){var data;data=tryParseAsDataURI(f);if(data){return data}if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(document.currentScript){scriptDirectory=document.currentScript.src}if(_scriptDir){scriptDirectory=_scriptDir}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}{read_=function shell_read(url){try{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText}catch(err){var data=tryParseAsDataURI(url);if(data){return intArrayToString(data)}throw err}};if(ENVIRONMENT_IS_WORKER){readBinary=function readBinary(url){try{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}catch(err){var data=tryParseAsDataURI(url);if(data){return data}throw err}}}readAsync=function readAsync(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function xhr_onload(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}var data=tryParseAsDataURI(url);if(data){onload(data.buffer);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function dynamicAlloc(size){var ret=HEAP32[DYNAMICTOP_PTR>>2];var end=ret+size+15&-16;HEAP32[DYNAMICTOP_PTR>>2]=end;return ret}function getNativeTypeSize(type){switch(type){case"i1":case"i8":return 1;case"i16":return 2;case"i32":return 4;case"i64":return 8;case"float":return 4;case"double":return 8;default:{if(type[type.length-1]==="*"){return 4}else if(type[0]==="i"){var bits=Number(type.substr(1));assert(bits%8===0,"getNativeTypeSize invalid bits "+bits+", type "+type);return bits/8}else{return 0}}}}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}function convertJsFunctionToWasm(func,sig){return func}var freeTableIndexes=[];function addFunctionWasm(func,sig){var table=wasmTable;var ret;if(freeTableIndexes.length){ret=freeTableIndexes.pop()}else{ret=table.length;try{table.grow(1)}catch(err){if(!(err instanceof RangeError)){throw err}throw"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH."}}try{table.set(ret,func)}catch(err){if(!(err instanceof TypeError)){throw err}assert(typeof sig!=="undefined","Missing signature argument to addFunction");var wrapped=convertJsFunctionToWasm(func,sig);table.set(ret,wrapped)}return ret}function removeFunctionWasm(index){freeTableIndexes.push(index)}var funcWrappers={};function dynCall(sig,ptr,args){if(args&&args.length){return Module["dynCall_"+sig].apply(null,[ptr].concat(args))}else{return Module["dynCall_"+sig].call(null,ptr)}}var tempRet0=0;var setTempRet0=function(value){tempRet0=value};var getTempRet0=function(){return tempRet0};var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime;if(Module["noExitRuntime"])noExitRuntime=Module["noExitRuntime"];var Promise=function(){function noop(){}function bind(fn,thisArg){return function(){fn.apply(thisArg,arguments)}}function Promise(fn){if(!(this instanceof Promise))throw new TypeError("Promises must be constructed via new");if(typeof fn!=="function")throw new TypeError("not a function");this._state=0;this._handled=false;this._value=undefined;this._deferreds=[];doResolve(fn,this)}function handle(self,deferred){while(self._state===3){self=self._value}if(self._state===0){self._deferreds.push(deferred);return}self._handled=true;Promise._immediateFn(function(){var cb=self._state===1?deferred.onFulfilled:deferred.onRejected;if(cb===null){(self._state===1?resolve:reject)(deferred.promise,self._value);return}var ret;try{ret=cb(self._value)}catch(e){reject(deferred.promise,e);return}resolve(deferred.promise,ret)})}function resolve(self,newValue){try{if(newValue===self)throw new TypeError("A promise cannot be resolved with itself.");if(newValue&&(typeof newValue==="object"||typeof newValue==="function")){var then=newValue.then;if(newValue instanceof Promise){self._state=3;self._value=newValue;finale(self);return}else if(typeof then==="function"){doResolve(bind(then,newValue),self);return}}self._state=1;self._value=newValue;finale(self)}catch(e){reject(self,e)}}function reject(self,newValue){self._state=2;self._value=newValue;finale(self)}function finale(self){if(self._state===2&&self._deferreds.length===0){Promise._immediateFn(function(){if(!self._handled){Promise._unhandledRejectionFn(self._value)}})}for(var i=0,len=self._deferreds.length;i=294+0){abort("Unable to grow wasm table. Use a higher value for RESERVED_FUNCTION_POINTERS or set ALLOW_TABLE_GROWTH.")}ret.push(null)};ret.set=function(i,func){ret[i]=func};ret.get=function(i){return ret[i]};return ret},Module:function(binary){return{}},Instance:function(module,info){var exports=( +// EMSCRIPTEN_START_ASM +function a(asmLibraryArg,wasmMemory,wasmTable){var scratchBuffer=new ArrayBuffer(8);var b=new Int32Array(scratchBuffer);var c=new Float32Array(scratchBuffer);var d=new Float64Array(scratchBuffer);function e(index){return b[index]}function f(index,value){b[index]=value}function g(){return d[0]}function h(value){d[0]=value}function i(low,high){b[0]=low;b[1]=high}function j(global,env,buffer){var k=env.memory;var l=wasmTable;var m=new global.Int8Array(buffer);var n=new global.Int16Array(buffer);var o=new global.Int32Array(buffer);var p=new global.Uint8Array(buffer);var q=new global.Uint16Array(buffer);var r=new global.Uint32Array(buffer);var s=new global.Float32Array(buffer);var t=new global.Float64Array(buffer);var u=global.Math.imul;var v=global.Math.fround;var w=global.Math.abs;var x=global.Math.clz32;var y=global.Math.min;var z=global.Math.max;var A=global.Math.floor;var B=global.Math.ceil;var C=global.Math.sqrt;var D=env.abort;var E=global.NaN;var F=global.Infinity;var G=env.__cxa_allocate_exception;var H=env.__cxa_throw;var I=env.fd_close;var J=env.fd_write;var K=env.abort;var L=env.environ_sizes_get;var M=env.environ_get;var N=env.emscripten_resize_heap;var O=env.emscripten_memcpy_big;var P=env.setTempRet0;var Q=env.fd_seek;var R=5256720;var S=13836;var T=0; +// EMSCRIPTEN_START_FUNCS +function il(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;l=R-16|0;R=l;a:{b:{c:{d:{e:{f:{g:{h:{i:{j:{k:{if(a>>>0<=244){f=o[3333];h=a>>>0<11?16:a+11&-8;b=h>>>3|0;a=f>>>b|0;if(a&3){d=b+((a^-1)&1)|0;b=d<<3;e=o[b+13380>>2];a=e+8|0;c=o[e+8>>2];b=b+13372|0;l:{if((c|0)==(b|0)){m=13332,n=Sl(d)&f,o[m>>2]=n;break l}o[c+12>>2]=b;o[b+8>>2]=c}b=d<<3;o[e+4>>2]=b|3;b=b+e|0;o[b+4>>2]=o[b+4>>2]|1;break a}k=o[3335];if(h>>>0<=k>>>0){break k}if(a){c=a<>>12&16;c=a;b=b>>>a|0;a=b>>>5&8;c=c|a;b=b>>>a|0;a=b>>>2&4;c=c|a;b=b>>>a|0;a=b>>>1&2;c=c|a;b=b>>>a|0;a=b>>>1&1;c=(c|a)+(b>>>a|0)|0;a=c<<3;g=o[a+13380>>2];b=o[g+8>>2];a=a+13372|0;m:{if((b|0)==(a|0)){f=Sl(c)&f;o[3333]=f;break m}o[b+12>>2]=a;o[a+8>>2]=b}a=g+8|0;o[g+4>>2]=h|3;d=g+h|0;b=c<<3;e=b-h|0;o[d+4>>2]=e|1;o[b+g>>2]=e;if(k){b=k>>>3|0;c=(b<<3)+13372|0;h=o[3338];b=1<>2]}o[c+8>>2]=h;o[b+12>>2]=h;o[h+12>>2]=c;o[h+8>>2]=b}o[3338]=d;o[3335]=e;break a}i=o[3334];if(!i){break k}b=(i&0-i)+ -1|0;a=b>>>12&16;c=a;b=b>>>a|0;a=b>>>5&8;c=c|a;b=b>>>a|0;a=b>>>2&4;c=c|a;b=b>>>a|0;a=b>>>1&2;c=c|a;b=b>>>a|0;a=b>>>1&1;b=o[((c|a)+(b>>>a|0)<<2)+13636>>2];d=(o[b+4>>2]&-8)-h|0;c=b;while(1){o:{a=o[c+16>>2];if(!a){a=o[c+20>>2];if(!a){break o}}c=(o[a+4>>2]&-8)-h|0;e=c>>>0>>0;d=e?c:d;b=e?a:b;c=a;continue}break}j=o[b+24>>2];e=o[b+12>>2];if((e|0)!=(b|0)){a=o[b+8>>2];o[a+12>>2]=e;o[e+8>>2]=a;break b}c=b+20|0;a=o[c>>2];if(!a){a=o[b+16>>2];if(!a){break j}c=b+16|0}while(1){g=c;e=a;c=a+20|0;a=o[c>>2];if(a){continue}c=e+16|0;a=o[e+16>>2];if(a){continue}break}o[g>>2]=0;break b}h=-1;if(a>>>0>4294967231){break k}a=a+11|0;h=a&-8;i=o[3334];if(!i){break k}a=a>>>8|0;g=0;p:{if(!a){break p}g=31;if(h>>>0>16777215){break p}b=a+1048320>>>16&8;a=a<>>16&4;a=a<>>16&2;a=(a<>>15|0)-(c|(b|d))|0;g=(a<<1|h>>>a+21&1)+28|0}c=0-h|0;d=o[(g<<2)+13636>>2];q:{r:{s:{if(!d){a=0;break s}b=h<<((g|0)==31?0:25-(g>>>1|0)|0);a=0;while(1){t:{f=(o[d+4>>2]&-8)-h|0;if(f>>>0>=c>>>0){break t}e=d;c=f;if(c){break t}c=0;a=d;break r}f=o[d+20>>2];d=o[((b>>>29&4)+d|0)+16>>2];a=f?(f|0)==(d|0)?a:f:a;b=b<<((d|0)!=0);if(d){continue}break}}if(!(a|e)){a=2<>>12&16;d=a;b=b>>>a|0;a=b>>>5&8;d=d|a;b=b>>>a|0;a=b>>>2&4;d=d|a;b=b>>>a|0;a=b>>>1&2;d=d|a;b=b>>>a|0;a=b>>>1&1;a=o[((d|a)+(b>>>a|0)<<2)+13636>>2]}if(!a){break q}}while(1){b=(o[a+4>>2]&-8)-h|0;d=b>>>0>>0;c=d?b:c;e=d?a:e;b=o[a+16>>2];if(b){a=b}else{a=o[a+20>>2]}if(a){continue}break}}if(!e|c>>>0>=o[3335]-h>>>0){break k}g=o[e+24>>2];b=o[e+12>>2];if((e|0)!=(b|0)){a=o[e+8>>2];o[a+12>>2]=b;o[b+8>>2]=a;break c}d=e+20|0;a=o[d>>2];if(!a){a=o[e+16>>2];if(!a){break i}d=e+16|0}while(1){f=d;b=a;d=a+20|0;a=o[d>>2];if(a){continue}d=b+16|0;a=o[b+16>>2];if(a){continue}break}o[f>>2]=0;break c}c=o[3335];if(c>>>0>=h>>>0){d=o[3338];b=c-h|0;u:{if(b>>>0>=16){o[3335]=b;a=d+h|0;o[3338]=a;o[a+4>>2]=b|1;o[c+d>>2]=b;o[d+4>>2]=h|3;break u}o[3338]=0;o[3335]=0;o[d+4>>2]=c|3;a=c+d|0;o[a+4>>2]=o[a+4>>2]|1}a=d+8|0;break a}j=o[3336];if(j>>>0>h>>>0){b=j-h|0;o[3336]=b;c=o[3339];a=c+h|0;o[3339]=a;o[a+4>>2]=b|1;o[c+4>>2]=h|3;a=c+8|0;break a}a=0;i=h+47|0;b=i;if(o[3451]){c=o[3453]}else{o[3454]=-1;o[3455]=-1;o[3452]=4096;o[3453]=4096;o[3451]=l+12&-16^1431655768;o[3456]=0;o[3444]=0;c=4096}g=b+c|0;f=0-c|0;c=g&f;if(c>>>0<=h>>>0){break a}e=o[3443];if(e){d=o[3441];b=d+c|0;if(b>>>0<=d>>>0|b>>>0>e>>>0){break a}}if(p[13776]&4){break f}v:{w:{d=o[3339];if(d){a=13780;while(1){b=o[a>>2];if(b+o[a+4>>2]>>>0>d>>>0?b>>>0<=d>>>0:0){break w}a=o[a+8>>2];if(a){continue}break}}b=kl(0);if((b|0)==-1){break g}f=c;d=o[3452];a=d+ -1|0;if(a&b){f=(c-b|0)+(a+b&0-d)|0}if(f>>>0<=h>>>0|f>>>0>2147483646){break g}e=o[3443];if(e){d=o[3441];a=d+f|0;if(a>>>0<=d>>>0|a>>>0>e>>>0){break g}}a=kl(f);if((b|0)!=(a|0)){break v}break e}f=f&g-j;if(f>>>0>2147483646){break g}b=kl(f);if((b|0)==(o[a>>2]+o[a+4>>2]|0)){break h}a=b}if(!((a|0)==-1|h+48>>>0<=f>>>0)){b=o[3453];b=b+(i-f|0)&0-b;if(b>>>0>2147483646){b=a;break e}if((kl(b)|0)!=-1){f=b+f|0;b=a;break e}kl(0-f|0);break g}b=a;if((a|0)!=-1){break e}break g}e=0;break b}b=0;break c}if((b|0)!=-1){break e}}o[3444]=o[3444]|4}if(c>>>0>2147483646){break d}b=kl(c);a=kl(0);if(b>>>0>=a>>>0|(b|0)==-1|(a|0)==-1){break d}f=a-b|0;if(f>>>0<=h+40>>>0){break d}}a=o[3441]+f|0;o[3441]=a;if(a>>>0>r[3442]){o[3442]=a}x:{y:{z:{d=o[3339];if(d){a=13780;while(1){e=o[a>>2];c=o[a+4>>2];if((e+c|0)==(b|0)){break z}a=o[a+8>>2];if(a){continue}break}break y}a=o[3337];if(!(b>>>0>=a>>>0?a:0)){o[3337]=b}a=0;o[3446]=f;o[3445]=b;o[3341]=-1;o[3342]=o[3451];o[3448]=0;while(1){d=a<<3;c=d+13372|0;o[d+13380>>2]=c;o[d+13384>>2]=c;a=a+1|0;if((a|0)!=32){continue}break}d=f+ -40|0;a=b+8&7?-8-b&7:0;c=d-a|0;o[3336]=c;a=a+b|0;o[3339]=a;o[a+4>>2]=c|1;o[(b+d|0)+4>>2]=40;o[3340]=o[3455];break x}if(p[a+12|0]&8|b>>>0<=d>>>0|e>>>0>d>>>0){break y}o[a+4>>2]=c+f;a=d+8&7?-8-d&7:0;c=a+d|0;o[3339]=c;b=o[3336]+f|0;a=b-a|0;o[3336]=a;o[c+4>>2]=a|1;o[(b+d|0)+4>>2]=40;o[3340]=o[3455];break x}e=o[3337];if(b>>>0>>0){o[3337]=b;e=0}c=b+f|0;a=13780;A:{B:{C:{D:{E:{F:{while(1){if((c|0)!=o[a>>2]){a=o[a+8>>2];if(a){continue}break F}break}if(!(p[a+12|0]&8)){break E}}a=13780;while(1){c=o[a>>2];if(c>>>0<=d>>>0){g=c+o[a+4>>2]|0;if(g>>>0>d>>>0){break D}}a=o[a+8>>2];continue}}o[a>>2]=b;o[a+4>>2]=o[a+4>>2]+f;j=(b+8&7?-8-b&7:0)+b|0;o[j+4>>2]=h|3;b=c+(c+8&7?-8-c&7:0)|0;a=(b-j|0)-h|0;g=h+j|0;if((b|0)==(d|0)){o[3339]=g;a=o[3336]+a|0;o[3336]=a;o[g+4>>2]=a|1;break B}if(o[3338]==(b|0)){o[3338]=g;a=o[3335]+a|0;o[3335]=a;o[g+4>>2]=a|1;o[a+g>>2]=a;break B}c=o[b+4>>2];if((c&3)==1){i=c&-8;G:{if(c>>>0<=255){e=o[b+8>>2];c=c>>>3|0;d=o[b+12>>2];if((d|0)==(e|0)){m=13332,n=o[3333]&Sl(c),o[m>>2]=n;break G}o[e+12>>2]=d;o[d+8>>2]=e;break G}k=o[b+24>>2];f=o[b+12>>2];H:{if((f|0)!=(b|0)){c=o[b+8>>2];o[c+12>>2]=f;o[f+8>>2]=c;break H}I:{d=b+20|0;h=o[d>>2];if(h){break I}d=b+16|0;h=o[d>>2];if(h){break I}f=0;break H}while(1){c=d;f=h;d=f+20|0;h=o[d>>2];if(h){continue}d=f+16|0;h=o[f+16>>2];if(h){continue}break}o[c>>2]=0}if(!k){break G}d=o[b+28>>2];c=(d<<2)+13636|0;J:{if(o[c>>2]==(b|0)){o[c>>2]=f;if(f){break J}m=13336,n=o[3334]&Sl(d),o[m>>2]=n;break G}o[k+(o[k+16>>2]==(b|0)?16:20)>>2]=f;if(!f){break G}}o[f+24>>2]=k;c=o[b+16>>2];if(c){o[f+16>>2]=c;o[c+24>>2]=f}c=o[b+20>>2];if(!c){break G}o[f+20>>2]=c;o[c+24>>2]=f}b=b+i|0;a=a+i|0}o[b+4>>2]=o[b+4>>2]&-2;o[g+4>>2]=a|1;o[a+g>>2]=a;if(a>>>0<=255){a=a>>>3|0;b=(a<<3)+13372|0;c=o[3333];a=1<>2]}o[b+8>>2]=g;o[a+12>>2]=g;o[g+12>>2]=b;o[g+8>>2]=a;break B}b=g;d=a>>>8|0;c=0;L:{if(!d){break L}c=31;if(a>>>0>16777215){break L}c=d;d=d+1048320>>>16&8;c=c<>>16&4;c=c<>>16&2;c=(c<>>15|0)-(e|(d|f))|0;c=(c<<1|a>>>c+21&1)+28|0}o[b+28>>2]=c;o[g+16>>2]=0;o[g+20>>2]=0;e=(c<<2)+13636|0;d=o[3334];b=1<>2]=g;o[g+24>>2]=e;break M}d=a<<((c|0)==31?0:25-(c>>>1|0)|0);b=o[e>>2];while(1){c=b;if((o[b+4>>2]&-8)==(a|0)){break C}b=d>>>29|0;d=d<<1;e=(c+(b&4)|0)+16|0;b=o[e>>2];if(b){continue}break}o[e>>2]=g;o[g+24>>2]=c}o[g+12>>2]=g;o[g+8>>2]=g;break B}e=f+ -40|0;a=b+8&7?-8-b&7:0;c=e-a|0;o[3336]=c;a=a+b|0;o[3339]=a;o[a+4>>2]=c|1;o[(b+e|0)+4>>2]=40;o[3340]=o[3455];a=(g+(g+ -39&7?39-g&7:0)|0)+ -47|0;c=a>>>0>>0?d:a;o[c+4>>2]=27;a=o[3448];o[c+16>>2]=o[3447];o[c+20>>2]=a;a=o[3446];o[c+8>>2]=o[3445];o[c+12>>2]=a;o[3447]=c+8;o[3446]=f;o[3445]=b;o[3448]=0;a=c+24|0;while(1){o[a+4>>2]=7;b=a+8|0;a=a+4|0;if(g>>>0>b>>>0){continue}break}if((c|0)==(d|0)){break x}o[c+4>>2]=o[c+4>>2]&-2;g=c-d|0;o[d+4>>2]=g|1;o[c>>2]=g;if(g>>>0<=255){a=g>>>3|0;b=(a<<3)+13372|0;c=o[3333];a=1<>2]}o[b+8>>2]=d;o[a+12>>2]=d;o[d+12>>2]=b;o[d+8>>2]=a;break x}o[d+16>>2]=0;o[d+20>>2]=0;a=d;c=g>>>8|0;b=0;O:{if(!c){break O}b=31;if(g>>>0>16777215){break O}b=c;c=c+1048320>>>16&8;b=b<>>16&4;b=b<>>16&2;b=(b<>>15|0)-(e|(c|f))|0;b=(b<<1|g>>>b+21&1)+28|0}o[a+28>>2]=b;e=(b<<2)+13636|0;c=o[3334];a=1<>2]=d;o[d+24>>2]=e;break P}a=g<<((b|0)==31?0:25-(b>>>1|0)|0);b=o[e>>2];while(1){c=b;if((g|0)==(o[b+4>>2]&-8)){break A}b=a>>>29|0;a=a<<1;e=(c+(b&4)|0)+16|0;b=o[e>>2];if(b){continue}break}o[e>>2]=d;o[d+24>>2]=c}o[d+12>>2]=d;o[d+8>>2]=d;break x}a=o[c+8>>2];o[a+12>>2]=g;o[c+8>>2]=g;o[g+24>>2]=0;o[g+12>>2]=c;o[g+8>>2]=a}a=j+8|0;break a}a=o[c+8>>2];o[a+12>>2]=d;o[c+8>>2]=d;o[d+24>>2]=0;o[d+12>>2]=c;o[d+8>>2]=a}a=o[3336];if(a>>>0<=h>>>0){break d}b=a-h|0;o[3336]=b;c=o[3339];a=c+h|0;o[3339]=a;o[a+4>>2]=b|1;o[c+4>>2]=h|3;a=c+8|0;break a}o[3314]=48;a=0;break a}Q:{if(!g){break Q}d=o[e+28>>2];a=(d<<2)+13636|0;R:{if(o[a>>2]==(e|0)){o[a>>2]=b;if(b){break R}i=Sl(d)&i;o[3334]=i;break Q}o[g+(o[g+16>>2]==(e|0)?16:20)>>2]=b;if(!b){break Q}}o[b+24>>2]=g;a=o[e+16>>2];if(a){o[b+16>>2]=a;o[a+24>>2]=b}a=o[e+20>>2];if(!a){break Q}o[b+20>>2]=a;o[a+24>>2]=b}S:{if(c>>>0<=15){a=c+h|0;o[e+4>>2]=a|3;a=a+e|0;o[a+4>>2]=o[a+4>>2]|1;break S}o[e+4>>2]=h|3;d=e+h|0;o[d+4>>2]=c|1;o[c+d>>2]=c;if(c>>>0<=255){a=c>>>3|0;b=(a<<3)+13372|0;c=o[3333];a=1<>2]}o[b+8>>2]=d;o[a+12>>2]=d;o[d+12>>2]=b;o[d+8>>2]=a;break S}a=d;f=c>>>8|0;b=0;U:{if(!f){break U}b=31;if(c>>>0>16777215){break U}b=f;f=f+1048320>>>16&8;b=b<>>16&4;b=b<>>16&2;b=(b<>>15|0)-(h|(f|g))|0;b=(b<<1|c>>>b+21&1)+28|0}o[a+28>>2]=b;o[d+16>>2]=0;o[d+20>>2]=0;f=(b<<2)+13636|0;V:{a=1<>2]=d;o[d+24>>2]=f;break W}a=c<<((b|0)==31?0:25-(b>>>1|0)|0);h=o[f>>2];while(1){b=h;if((o[b+4>>2]&-8)==(c|0)){break V}f=a>>>29|0;a=a<<1;f=(b+(f&4)|0)+16|0;h=o[f>>2];if(h){continue}break}o[f>>2]=d;o[d+24>>2]=b}o[d+12>>2]=d;o[d+8>>2]=d;break S}a=o[b+8>>2];o[a+12>>2]=d;o[b+8>>2]=d;o[d+24>>2]=0;o[d+12>>2]=b;o[d+8>>2]=a}a=e+8|0;break a}X:{if(!j){break X}c=o[b+28>>2];a=(c<<2)+13636|0;Y:{if(o[a>>2]==(b|0)){o[a>>2]=e;if(e){break Y}m=13336,n=Sl(c)&i,o[m>>2]=n;break X}o[(o[j+16>>2]==(b|0)?16:20)+j>>2]=e;if(!e){break X}}o[e+24>>2]=j;a=o[b+16>>2];if(a){o[e+16>>2]=a;o[a+24>>2]=e}a=o[b+20>>2];if(!a){break X}o[e+20>>2]=a;o[a+24>>2]=e}Z:{if(d>>>0<=15){a=d+h|0;o[b+4>>2]=a|3;a=a+b|0;o[a+4>>2]=o[a+4>>2]|1;break Z}o[b+4>>2]=h|3;e=b+h|0;o[e+4>>2]=d|1;o[d+e>>2]=d;if(k){a=k>>>3|0;c=(a<<3)+13372|0;h=o[3338];a=1<>2]}o[c+8>>2]=h;o[a+12>>2]=h;o[h+12>>2]=c;o[h+8>>2]=a}o[3338]=e;o[3335]=d}a=b+8|0}R=l+16|0;return a|0}function ah(a,b){var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,n=0,q=0,r=0,s=0,t=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0;h=R-96|0;R=h;o[h+72>>2]=0;o[h+64>>2]=0;o[h+68>>2]=0;o[h+48>>2]=0;o[h+52>>2]=0;o[h+40>>2]=0;o[h+44>>2]=0;o[h+56>>2]=1065353216;o[h+32>>2]=0;o[h+24>>2]=0;o[h+28>>2]=0;y=o[a+124>>2];a:{b:{c:{d:{e:{f:{g:{if((b|0)>=1){t=o[a+216>>2]!=o[a+220>>2];while(1){h:{i:{j:{k:{l:{m:{n:{o:{if(!p[a+308|0]){break o}p:{q:{g=o[a+296>>2];i=o[a+304>>2];d=g+(i>>>3|0)|0;f=o[a+300>>2];if(d>>>0>=f>>>0){break q}d=p[d|0];e=i+1|0;o[a+304>>2]=e;if(!(d>>>(i&7)&1)){break q}j=e>>>3|0;d=g+j|0;r:{if(d>>>0>=f>>>0){d=e;e=0;break r}c=p[d|0];d=i+2|0;o[a+304>>2]=d;j=d>>>3|0;e=c>>>(e&7)&1}c=g+j|0;if(c>>>0>>0){c=p[c|0];o[a+304>>2]=d+1;d=c>>>(d&7)<<1&2}else{d=0}e=(d|e)<<1|1;switch(e+ -2|0){case 0:case 2:case 4:break b;case 5:break n;case 1:case 3:break p;default:break o}}e=o[h+68>>2];if((e|0)==o[h+64>>2]){d=-1;break g}c=-1;n=o[a+8>>2];i=o[n+24>>2];f=i;g=e+ -4|0;s=o[g>>2];d=-1;s:{if((s|0)==-1){break s}e=s+1|0;e=(e>>>0)%3|0?e:s+ -2|0;d=-1;if((e|0)==-1){break s}d=o[o[n>>2]+(e<<2)>>2]}f=o[f+(d<<2)>>2];if((f|0)!=-1){e=f+1|0;c=(e>>>0)%3|0?e:f+ -2|0}f=o[n+12>>2];r=u(k,3);e=r+1|0;o[f+(s<<2)>>2]=e;e=e<<2;o[e+f>>2]=s;q=r+2|0;o[f+(c<<2)>>2]=q;j=q<<2;o[j+f>>2]=c;l=o[n>>2];o[l+(r<<2)>>2]=d;x=e+l|0;f=-1;t:{if((c|0)==-1){break t}e=c+1|0;e=(e>>>0)%3|0?e:c+ -2|0;f=-1;if((e|0)==-1){break t}f=o[l+(e<<2)>>2]}o[x>>2]=f;u:{v:{if((s|0)!=-1){e=s+((s>>>0)%3|0?-1:2)|0;if((e|0)!=-1){break v}}o[j+l>>2]=-1;break u}e=o[l+(e<<2)>>2];o[j+l>>2]=e;if((e|0)==-1){break u}o[i+(e<<2)>>2]=q}c=o[a+120>>2]+(d>>>3&536870908)|0;e=o[c>>2];A=c,B=Sl(d)&e,o[A>>2]=B;o[g>>2]=r;break h}c=o[h+68>>2];if((c|0)==o[h+64>>2]){d=-1;break g}q=o[a+8>>2];d=o[q+12>>2];n=u(k,3);i=(e|0)==5;g=n+(i?2:1)|0;e=g<<2;r=o[c+ -4>>2];o[d+e>>2]=r;o[d+(r<<2)>>2]=g;eh(q+24|0,8268);d=-1;f=o[a+8>>2];j=o[f+24>>2];if(o[f+28>>2]-j>>2>(y|0)){break g}c=n+2|0;f=o[f>>2];x=f+e|0;e=o[q+28>>2]-o[q+24>>2]|0;d=(e>>2)+ -1|0;o[x>>2]=d;if(e){o[j+(d<<2)>>2]=g}c=i?n:c;i=f+(i+n<<2)|0;w:{x:{y:{if((r|0)!=-1){d=r+((r>>>0)%3|0?-1:2)|0;if((d|0)==-1){break y}d=o[f+(d<<2)>>2];o[f+(c<<2)>>2]=d;if((d|0)==-1){break x}o[j+(d<<2)>>2]=c;break x}o[f+(c<<2)>>2]=-1;e=-1;break w}o[f+(c<<2)>>2]=-1}d=r+1|0;d=(d>>>0)%3|0?d:r+ -2|0;e=-1;if((d|0)==-1){break w}e=o[f+(d<<2)>>2]}o[i>>2]=e;o[o[h+68>>2]+ -4>>2]=n;break m}d=-1;g=o[h+68>>2];f=o[h+64>>2];if((g|0)==(f|0)){break g}i=g+ -4|0;z=o[i>>2];o[h+68>>2]=i;n=o[h+44>>2];if(!n){break j}x=o[h+40>>2];q=Rl(n)>>>0>1;c=n+2147483647&k;z:{if(!q){break z}e=k;c=e;if(e>>>0>>0){break z}c=(k>>>0)%(n>>>0)|0}e=c;c=o[x+(e<<2)>>2];if(!c){break j}l=o[c>>2];if(!l){break j}j=n+ -1|0;while(1){A:{c=o[l+4>>2];B:{if((k|0)!=(c|0)){C:{if(!q){c=c&j;break C}if(c>>>0>>0){break C}c=(c>>>0)%(n>>>0)|0}if((c|0)!=(e|0)){break j}break B}if(o[l+8>>2]==(k|0)){break A}}l=o[l>>2];if(l){continue}break j}break}e=o[h+72>>2];if((e|0)!=(i|0)){o[i>>2]=o[l+12>>2];o[h+68>>2]=g;c=f;break i}q=i-f|0;i=q>>2;j=i+1|0;if(j>>>0>=1073741824){break l}g=e-f|0;e=g>>1;e=g>>2>>>0<536870911?e>>>0>>0?j:e:1073741823;c=0;D:{if(!e){break D}if(e>>>0>=1073741824){break a}c=yk(e<<2)}g=c+(i<<2)|0;o[g>>2]=o[l+12>>2];e=(e<<2)+c|0;g=g+4|0;if((q|0)>=1){ll(c,f,q)}o[h+72>>2]=e;o[h+68>>2]=g;o[h+64>>2]=c;if(!f){break i}jl(f);g=o[h+68>>2];c=o[h+64>>2];break i}e=o[a+8>>2];eh(e+24|0,8268);d=-1;c=o[a+8>>2];n=u(k,3);i=o[e+28>>2]-o[e+24>>2]|0;j=i>>2;f=j+ -1|0;o[o[c>>2]+(n<<2)>>2]=f;eh(c+24|0,8268);g=n+1|0;o[o[c>>2]+(g<<2)>>2]=(o[c+28>>2]-o[c+24>>2]>>2)+ -1;e=o[a+8>>2];eh(e+24|0,8268);c=n+2|0;o[o[e>>2]+(c<<2)>>2]=(o[e+28>>2]-o[e+24>>2]>>2)+ -1;e=o[a+8>>2];q=o[e+24>>2];if(o[e+28>>2]-q>>2>(y|0)){break g}E:{F:{if(!i){o[q+(j<<2)>>2]=g;d=1;break F}o[q+(f<<2)>>2]=n;d=0;if((i|0)==-4){break F}o[q+(j<<2)>>2]=g;d=j+1|0;if((d|0)==-1){break E}}o[q+(d<<2)>>2]=c}d=o[h+68>>2];e=o[h+72>>2];if((d|0)!=(e|0)){o[d>>2]=n;o[h+68>>2]=d+4;break m}j=o[h+64>>2];i=d-j|0;f=i>>2;g=f+1|0;if(g>>>0>=1073741824){break k}c=e-j|0;e=c>>1;c=c>>2>>>0<536870911?e>>>0>>0?g:e:1073741823;d=0;G:{if(!c){break G}if(c>>>0>=1073741824){break a}d=yk(c<<2)}e=d+(f<<2)|0;o[e>>2]=n;c=d+(c<<2)|0;e=e+4|0;if((i|0)>=1){ll(d,j,i)}o[h+72>>2]=c;o[h+68>>2]=e;o[h+64>>2]=d;if(!j){break m}jl(j)}l=o[a+40>>2];if((l|0)==o[a+36>>2]){break h}g=(k^-1)+b|0;while(1){d=-1;e=o[l+ -8>>2];if(e>>>0>g>>>0){break g}if((e|0)!=(g|0)){break h}c=p[l+ -4|0];e=l+ -12|0;f=o[e>>2];o[a+40>>2]=e;if((f|0)<0){break g}e=o[o[h+68>>2]+ -4>>2];o[h+20>>2]=(f^-1)+b;o[h+88>>2]=h+20;fh(h,h+40|0,h+20|0,h+88|0);f=o[h>>2];H:{if(c&1){d=-1;if((e|0)==-1){break H}d=e+1|0;d=(d>>>0)%3|0?d:e+ -2|0;break H}d=-1;if((e|0)==-1){break H}d=e+ -1|0;if((e>>>0)%3){break H}d=e+2|0}o[f+12>>2]=d;l=o[a+40>>2];if((l|0)!=o[a+36>>2]){continue}break}break h}Nk();D()}Nk();D()}g=i;c=f}if((c|0)==(g|0)){break g}w=o[g+ -4>>2];e=(w|0)==-1;s=o[a+8>>2];if(o[o[s+12>>2]+(w<<2)>>2]!=-1?!e:0){break g}j=(z|0)==-1;l=o[s+12>>2];if(o[l+(z<<2)>>2]!=-1?!j:0){break g}r=u(k,3);q=r+2|0;o[l+(w<<2)>>2]=q;n=q<<2;o[n+l>>2]=w;d=r+1|0;o[l+(z<<2)>>2]=d;i=d<<2;o[i+l>>2]=z;I:{if(!e){d=-1;e=-1;v=o[s>>2];f=v+(r<<2)|0;c=w+((w>>>0)%3|0?-1:2)|0;if((c|0)!=-1){e=o[(c<<2)+v>>2]}o[f>>2]=e;c=w+1|0;c=(c>>>0)%3|0?c:w+ -2|0;if((c|0)==-1){break I}d=o[(c<<2)+v>>2];break I}e=-1;v=o[s>>2];o[v+(r<<2)>>2]=-1;d=-1}o[i+v>>2]=d;J:{K:{L:{if(!j){d=z+((z>>>0)%3|0?-1:2)|0;if((d|0)==-1){break L}d=o[(d<<2)+v>>2];o[n+v>>2]=d;if((d|0)==-1){break K}o[o[s+24>>2]+(d<<2)>>2]=q;break K}o[n+v>>2]=-1;x=-1;d=-1;break J}o[n+v>>2]=-1}x=-1;c=z+1|0;c=(c>>>0)%3|0?c:z+ -2|0;d=-1;if((c|0)==-1){break J}x=o[(c<<2)+v>>2];d=c}c=o[s+24>>2];f=c+(x<<2)|0;if((e|0)!=-1){o[c+(e<<2)>>2]=o[f>>2]}M:{if((d|0)==-1){break M}while(1){o[(d<<2)+v>>2]=e;c=d+1|0;d=(c>>>0)%3|0?c:d+ -2|0;if((d|0)==-1){break M}c=o[l+(d<<2)>>2];if((c|0)==-1){break M}d=c+1|0;d=(d>>>0)%3|0?d:c+ -2|0;if((d|0)!=-1){continue}break}}o[f>>2]=-1;N:{if(t){break N}d=o[h+28>>2];e=o[h+32>>2];if((d|0)!=(e|0)){o[d>>2]=x;o[h+28>>2]=d+4;break N}q=o[h+24>>2];j=d-q|0;f=j>>2;i=f+1|0;O:{if(i>>>0<1073741824){c=e-q|0;e=c>>1;c=c>>2>>>0<536870911?e>>>0>>0?i:e:1073741823;d=0;P:{if(!c){break P}if(c>>>0>=1073741824){break O}d=yk(c<<2)}e=d+(f<<2)|0;o[e>>2]=x;c=d+(c<<2)|0;e=e+4|0;if((j|0)>=1){ll(d,q,j)}o[h+32>>2]=c;o[h+28>>2]=e;o[h+24>>2]=d;if(!q){break N}jl(q);g=o[h+68>>2];break N}Nk();D()}break a}o[g+ -4>>2]=r}k=k+1|0;if((k|0)!=(b|0)){continue}break}e=b}d=-1;l=o[a+8>>2];if(o[l+28>>2]-o[l+24>>2]>>2>(y|0)){break g}k=o[h+68>>2];if((k|0)!=o[h+64>>2]){n=a+72|0;b=a+60|0;q=a+312|0;while(1){c=k+ -4|0;r=o[c>>2];o[h+68>>2]=c;Q:{if(Uf(q)){j=o[a+8>>2];w=o[j>>2];if((e|0)>=((o[j+4>>2]-w>>2>>>0)/3|0)){break g}g=-1;v=-1;k=o[j+24>>2];i=k;c=-1;R:{if((r|0)==-1){break R}f=r+1|0;f=(f>>>0)%3|0?f:r+ -2|0;c=-1;if((f|0)==-1){break R}c=o[w+(f<<2)>>2]}i=o[i+(c<<2)>>2];S:{if((i|0)==-1){break S}f=i+1|0;f=(f>>>0)%3|0?f:i+ -2|0;if((f|0)==-1){break S}g=f+1|0;g=(g>>>0)%3|0?g:f+ -2|0;if((g|0)!=-1){v=o[w+(g<<2)>>2]}g=f}y=-1;x=-1;k=o[k+(v<<2)>>2];i=-1;T:{if((k|0)==-1){break T}f=k+1|0;f=(f>>>0)%3|0?f:k+ -2|0;i=-1;if((f|0)==-1){break T}i=f+1|0;i=(i>>>0)%3|0?i:f+ -2|0;if((i|0)!=-1){x=o[w+(i<<2)>>2]}i=f}l=o[j+12>>2];s=u(e,3);j=s<<2;o[l+j>>2]=r;o[l+(r<<2)>>2]=s;r=s+1|0;k=r<<2;o[k+l>>2]=g;o[l+(g<<2)>>2]=r;t=s+2|0;f=t<<2;o[f+l>>2]=i;o[l+(i<<2)>>2]=t;o[j+w>>2]=v;k=k+w|0;o[k>>2]=x;i=f+w|0;o[i>>2]=c;j=o[a+120>>2];g=r>>>0>>0?-1:v;f=j+(g>>>3&536870908)|0;c=o[f>>2];A=f,B=Sl(g)&c,o[A>>2]=B;y=(r|0)!=-1?o[k>>2]:y;f=j+(y>>>3&536870908)|0;c=o[f>>2];A=f,B=Sl(y)&c,o[A>>2]=B;k=-1;k=(t|0)!=-1?o[i>>2]:k;f=j+(k>>>3&536870908)|0;c=o[f>>2];A=f,B=Sl(k)&c,o[A>>2]=B;k=o[a+64>>2];f=o[a+68>>2];if((k|0)==f<<5){if((k+1|0)<=-1){break e}c=b;if(k>>>0<=1073741822){g=k+32&-32;f=f<<6;f=f>>>0>>0?g:f}else{f=2147483647}fb(c,f);k=o[a+64>>2]}e=e+1|0;o[a+64>>2]=k+1;c=o[a+60>>2]+(k>>>3&536870908)|0;o[c>>2]=o[c>>2]|1<<(k&31);c=o[a+76>>2];f=o[a+80>>2];if((c|0)!=(f|0)){o[c>>2]=s;o[a+76>>2]=c+4;break Q}t=o[n>>2];j=c-t|0;i=j>>2;k=i+1|0;if(k>>>0>=1073741824){break d}g=f-t|0;f=g>>1;g=g>>2>>>0<536870911?f>>>0>>0?k:f:1073741823;c=0;U:{if(!g){break U}if(g>>>0>=1073741824){break a}c=yk(g<<2)}f=c+(i<<2)|0;o[f>>2]=s;g=c+(g<<2)|0;f=f+4|0;if((j|0)>=1){ll(c,t,j)}o[a+80>>2]=g;o[a+76>>2]=f;o[a+72>>2]=c;if(!t){break Q}jl(t);break Q}l=o[a+64>>2];f=o[a+68>>2];if((l|0)==f<<5){if((l+1|0)<=-1){break e}c=b;if(l>>>0<=1073741822){g=l+32&-32;f=f<<6;f=f>>>0>>0?g:f}else{f=2147483647}fb(c,f);l=o[a+64>>2]}o[a+64>>2]=l+1;f=o[a+60>>2]+(l>>>3&536870908)|0;c=o[f>>2];A=f,B=Sl(l)&c,o[A>>2]=B;c=o[a+76>>2];f=o[a+80>>2];if((c|0)!=(f|0)){o[c>>2]=r;o[a+76>>2]=c+4;break Q}t=o[n>>2];j=c-t|0;i=j>>2;k=i+1|0;if(k>>>0>=1073741824){break d}g=f-t|0;f=g>>1;g=g>>2>>>0<536870911?f>>>0>>0?k:f:1073741823;c=0;V:{if(!g){break V}if(g>>>0>=1073741824){break c}c=yk(g<<2)}f=c+(i<<2)|0;o[f>>2]=r;g=c+(g<<2)|0;f=f+4|0;if((j|0)>=1){ll(c,t,j)}o[a+80>>2]=g;o[a+76>>2]=f;o[a+72>>2]=c;if(!t){break Q}jl(t)}k=o[h+68>>2];if((k|0)!=o[h+64>>2]){continue}break}l=o[a+8>>2]}if(((o[l+4>>2]-o[l>>2]>>2>>>0)/3|0)!=(e|0)){break g}d=o[l+28>>2]-o[l+24>>2]>>2;j=o[h+24>>2];f=o[h+28>>2];if((j|0)==(f|0)){break f}while(1){g=o[j>>2];c=o[l+24>>2];k=d+ -1|0;W:{if(o[c+(k<<2)>>2]!=-1){e=d;break W}c=o[l+24>>2];while(1){k=d+ -2|0;e=d+ -1|0;d=e;if(o[(k<<2)+c>>2]==-1){continue}break}}if(!(k>>>0>>0)){o[h>>2]=l;b=k<<2;d=o[b+c>>2];m[h+12|0]=1;o[h+8>>2]=d;o[h+4>>2]=d;if((d|0)!=-1){while(1){o[o[l>>2]+(d<<2)>>2]=g;of(h);l=o[a+8>>2];d=o[h+8>>2];if((d|0)!=-1){continue}break}}d=b;b=o[l+24>>2];d=d+b|0;if((g|0)!=-1){o[b+(g<<2)>>2]=o[d>>2]}o[d>>2]=-1;i=1<<(g&31);b=o[a+120>>2];c=b+(g>>>3&536870908)|0;d=c;g=b+(k>>>3&536870908)|0;b=1<<(k&31);k=i|o[c>>2];X:{if(o[g>>2]&b){break X}k=o[c>>2]&(i^-1)}o[d>>2]=k;o[g>>2]=o[g>>2]&(b^-1);e=e+ -1|0}d=e;j=j+4|0;if((f|0)!=(j|0)){continue}break}}j=o[h+24>>2]}if(j){o[h+28>>2]=j;jl(j)}a=o[h+48>>2];if(a){while(1){b=o[a>>2];jl(a);a=b;if(a){continue}break}}a=o[h+40>>2];o[h+40>>2]=0;if(a){jl(a)}a=o[h+64>>2];if(a){o[h+68>>2]=a;jl(a)}R=h+96|0;return d}Nk();D()}Nk();D()}db(8832)}D()}db(8832);D()}function lh(a,b){var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,n=0,q=0,r=0,s=0,t=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0;i=R-96|0;R=i;o[i+72>>2]=0;o[i+64>>2]=0;o[i+68>>2]=0;o[i+48>>2]=0;o[i+52>>2]=0;o[i+40>>2]=0;o[i+44>>2]=0;o[i+56>>2]=1065353216;o[i+32>>2]=0;o[i+24>>2]=0;o[i+28>>2]=0;w=o[a+124>>2];a:{b:{c:{d:{e:{if((b|0)>=1){t=a+232|0;v=o[a+216>>2]!=o[a+220>>2];while(1){f:{g:{h:{i:{j:{c=o[a+404>>2];k:{l:{if((c|0)!=-1){g=-1;d=o[a+428>>2]+(c<<2)|0;e=o[d>>2];c=e+ -1|0;o[d>>2]=c;if((e|0)<1){break e}c=o[o[o[a+416>>2]+u(o[a+404>>2],12)>>2]+(c<<2)>>2];d=o[(c<<2)+8912>>2];o[a+400>>2]=d;if(!c){d=o[i+68>>2];if((d|0)==o[i+64>>2]){break e}c=-1;e=o[a+8>>2];k=o[e+24>>2];h=k;n=d+ -4|0;d=o[n>>2];g=-1;m:{if((d|0)==-1){break m}f=d+1|0;f=(f>>>0)%3|0?f:d+ -2|0;g=-1;if((f|0)==-1){break m}g=o[o[e>>2]+(f<<2)>>2]}j=o[h+(g<<2)>>2];if((j|0)!=-1){c=j+1|0;c=(c>>>0)%3|0?c:j+ -2|0}f=o[e+12>>2];j=u(q,3);h=j+1|0;o[f+(d<<2)>>2]=h;s=h<<2;o[s+f>>2]=d;h=j+2|0;o[f+(c<<2)>>2]=h;l=h<<2;o[l+f>>2]=c;e=o[e>>2];o[e+(j<<2)>>2]=g;f=e+s|0;r=-1;n:{if((c|0)==-1){break n}r=c+1|0;c=(r>>>0)%3|0?r:c+ -2|0;r=-1;if((c|0)==-1){break n}r=o[e+(c<<2)>>2]}o[f>>2]=r;o:{p:{if((d|0)!=-1){c=d+((d>>>0)%3|0?-1:2)|0;if((c|0)!=-1){break p}}o[e+l>>2]=-1;break o}c=o[e+(c<<2)>>2];o[e+l>>2]=c;if((c|0)==-1){break o}o[k+(c<<2)>>2]=h}c=o[a+120>>2]+(g>>>3&536870908)|0;d=o[c>>2];A=c,B=Sl(g)&d,o[A>>2]=B;o[n>>2]=j;nh(t,j);break f}d=d+ -1|0;if(d>>>0>6){break e}q:{switch(d-1|0){case 1:case 3:j=o[i+68>>2];if((j|0)==o[i+64>>2]){break e}e=o[a+8>>2];g=o[e+12>>2];d=u(q,3);f=(c|0)==3;h=d+(f?2:1)|0;k=h<<2;c=o[j+ -4>>2];o[g+k>>2]=c;o[g+(c<<2)>>2]=h;eh(e+24|0,8268);g=-1;l=o[a+8>>2];j=o[l+24>>2];if(o[l+28>>2]-j>>2>(w|0)){break e}n=d+2|0;g=o[l>>2];e=o[e+28>>2]-o[e+24>>2]|0;l=(e>>2)+ -1|0;o[g+k>>2]=l;if(e){o[j+(l<<2)>>2]=h}e=f?d:n;h=g+(d+f<<2)|0;r:{s:{t:{if((c|0)!=-1){f=c+((c>>>0)%3|0?-1:2)|0;if((f|0)==-1){break t}f=o[g+(f<<2)>>2];o[g+(e<<2)>>2]=f;if((f|0)==-1){break s}o[j+(f<<2)>>2]=e;break s}o[g+(e<<2)>>2]=-1;f=-1;break r}o[g+(e<<2)>>2]=-1}j=c+1|0;c=(j>>>0)%3|0?j:c+ -2|0;f=-1;if((c|0)==-1){break r}f=o[g+(c<<2)>>2]}o[h>>2]=f;g=o[i+68>>2];o[g+ -4>>2]=d;break k;case 5:break l;case 0:case 2:case 4:break e;default:break q}}j=o[i+68>>2];d=o[i+64>>2];if((j|0)==(d|0)){break e}f=j+ -4|0;l=o[f>>2];o[i+68>>2]=f;k=o[i+44>>2];if(!k){break h}n=Rl(k)>>>0>1;u:{if(!n){e=k+2147483647&q;break u}e=q;if(e>>>0>>0){break u}e=(q>>>0)%(k>>>0)|0}c=o[o[i+40>>2]+(e<<2)>>2];if(!c){break h}h=o[c>>2];if(!h){break h}s=k+ -1|0;while(1){v:{c=o[h+4>>2];w:{if((q|0)!=(c|0)){x:{if(!n){c=c&s;break x}if(c>>>0>>0){break x}c=(c>>>0)%(k>>>0)|0}if((c|0)!=(e|0)){break h}break w}if(o[h+8>>2]==(q|0)){break v}}h=o[h>>2];if(h){continue}break h}break}k=o[i+72>>2];if((k|0)!=(f|0)){o[f>>2]=o[h+12>>2];o[i+68>>2]=j;c=d;break g}f=f-d|0;j=f>>2;e=j+1|0;if(e>>>0>=1073741824){break j}k=k-d|0;n=k>>1;e=k>>2>>>0<536870911?n>>>0>>0?e:n:1073741823;c=0;y:{if(!e){break y}if(e>>>0>=1073741824){break a}c=yk(e<<2)}j=c+(j<<2)|0;o[j>>2]=o[h+12>>2];e=(e<<2)+c|0;j=j+4|0;if((f|0)>=1){ll(c,d,f)}o[i+72>>2]=e;o[i+68>>2]=j;o[i+64>>2]=c;if(!d){break g}jl(d);j=o[i+68>>2];c=o[i+64>>2];break g}o[a+400>>2]=7}e=o[a+8>>2];eh(e+24|0,8268);g=-1;c=o[a+8>>2];d=u(q,3);j=o[e+28>>2]-o[e+24>>2]|0;e=j>>2;h=e+ -1|0;o[o[c>>2]+(d<<2)>>2]=h;eh(c+24|0,8268);f=d+1|0;o[o[c>>2]+(f<<2)>>2]=(o[c+28>>2]-o[c+24>>2]>>2)+ -1;c=o[a+8>>2];eh(c+24|0,8268);l=d+2|0;o[o[c>>2]+(l<<2)>>2]=(o[c+28>>2]-o[c+24>>2]>>2)+ -1;k=o[a+8>>2];c=o[k+24>>2];if(o[k+28>>2]-c>>2>(w|0)){break e}z:{A:{if(!j){o[c+(e<<2)>>2]=f;g=1;break A}o[c+(h<<2)>>2]=d;g=0;if((j|0)==-4){break A}o[c+(e<<2)>>2]=f;g=e+1|0;if((g|0)==-1){break z}}o[c+(g<<2)>>2]=l}c=o[i+68>>2];f=o[i+72>>2];if((c|0)!=(f|0)){o[c>>2]=d;g=c+4|0;o[i+68>>2]=g;break k}e=o[i+64>>2];j=c-e|0;h=j>>2;g=h+1|0;if(g>>>0>=1073741824){break i}f=f-e|0;l=f>>1;g=f>>2>>>0<536870911?l>>>0>>0?g:l:1073741823;c=0;B:{if(!g){break B}if(g>>>0>=1073741824){break a}c=yk(g<<2)}f=c+(h<<2)|0;o[f>>2]=d;d=c+(g<<2)|0;g=f+4|0;if((j|0)>=1){ll(c,e,j)}o[i+72>>2]=d;o[i+68>>2]=g;o[i+64>>2]=c;if(!e){break k}jl(e);g=o[i+68>>2]}nh(t,o[g+ -4>>2]);h=o[a+40>>2];if((h|0)==o[a+36>>2]){break f}d=(q^-1)+b|0;while(1){g=-1;c=o[h+ -8>>2];if(c>>>0>d>>>0){break e}if((c|0)!=(d|0)){break f}j=p[h+ -4|0];c=h+ -12|0;e=o[c>>2];o[a+40>>2]=c;if((e|0)<0){break e}c=o[o[i+68>>2]+ -4>>2];o[i+20>>2]=(e^-1)+b;o[i+88>>2]=i+20;fh(i,i+40|0,i+20|0,i+88|0);f=o[i>>2];C:{if(j&1){g=-1;if((c|0)==-1){break C}g=c+1|0;g=(g>>>0)%3|0?g:c+ -2|0;break C}g=-1;if((c|0)==-1){break C}g=c+ -1|0;if((c>>>0)%3){break C}g=c+2|0}o[f+12>>2]=g;h=o[a+40>>2];if((h|0)!=o[a+36>>2]){continue}break}break f}Nk();D()}Nk();D()}j=f;c=d}if((c|0)==(j|0)){break e}c=o[j+ -4>>2];d=(c|0)==-1;f=o[a+8>>2];if(o[o[f+12>>2]+(c<<2)>>2]!=-1?!d:0){break e}r=(l|0)==-1;h=o[f+12>>2];if(o[h+(l<<2)>>2]!=-1?!r:0){break e}k=u(q,3);s=k+2|0;o[h+(c<<2)>>2]=s;n=s<<2;o[n+h>>2]=c;g=k+1|0;o[h+(l<<2)>>2]=g;x=g<<2;o[x+h>>2]=l;D:{if(!d){g=-1;e=-1;d=o[f>>2];z=d+(k<<2)|0;y=c+((c>>>0)%3|0?-1:2)|0;if((y|0)!=-1){e=o[(y<<2)+d>>2]}o[z>>2]=e;y=c+1|0;c=(y>>>0)%3|0?y:c+ -2|0;if((c|0)==-1){break D}g=o[(c<<2)+d>>2];break D}e=-1;d=o[f>>2];o[d+(k<<2)>>2]=-1;g=-1}o[d+x>>2]=g;E:{F:{G:{if(!r){c=l+((l>>>0)%3|0?-1:2)|0;if((c|0)==-1){break G}c=o[(c<<2)+d>>2];o[d+n>>2]=c;if((c|0)==-1){break F}o[o[f+24>>2]+(c<<2)>>2]=s;break F}o[d+n>>2]=-1;n=-1;g=-1;break E}o[d+n>>2]=-1}n=-1;c=l+1|0;c=(c>>>0)%3|0?c:l+ -2|0;g=-1;if((c|0)==-1){break E}n=o[(c<<2)+d>>2];g=c}c=o[a+388>>2];l=e<<2;s=c+l|0;r=c;c=n<<2;o[s>>2]=o[s>>2]+o[r+c>>2];f=o[f+24>>2];c=f+c|0;if((e|0)!=-1){o[f+l>>2]=o[c>>2]}H:{if((g|0)==-1){break H}while(1){o[(g<<2)+d>>2]=e;f=g+1|0;g=(f>>>0)%3|0?f:g+ -2|0;if((g|0)==-1){break H}g=o[h+(g<<2)>>2];if((g|0)==-1){break H}f=g+1|0;g=(f>>>0)%3|0?f:g+ -2|0;if((g|0)!=-1){continue}break}}o[c>>2]=-1;I:{if(v){break I}c=o[i+28>>2];f=o[i+32>>2];if((c|0)!=(f|0)){o[c>>2]=n;o[i+28>>2]=c+4;break I}g=o[i+24>>2];e=c-g|0;h=e>>2;d=h+1|0;J:{if(d>>>0<1073741824){f=f-g|0;l=f>>1;d=f>>2>>>0<536870911?l>>>0>>0?d:l:1073741823;c=0;K:{if(!d){break K}if(d>>>0>=1073741824){break J}c=yk(d<<2)}f=c+(h<<2)|0;o[f>>2]=n;d=c+(d<<2)|0;f=f+4|0;if((e|0)>=1){ll(c,g,e)}o[i+32>>2]=d;o[i+28>>2]=f;o[i+24>>2]=c;if(!g){break I}jl(g);j=o[i+68>>2];break I}Nk();D()}break a}o[j+ -4>>2]=k;nh(t,k)}q=q+1|0;if((q|0)!=(b|0)){continue}break}q=b}g=-1;c=o[a+8>>2];if(o[c+28>>2]-o[c+24>>2]>>2>(w|0)){break e}h=o[i+68>>2];if((h|0)!=o[i+64>>2]){w=a+72|0;b=a+60|0;s=a+312|0;while(1){c=h+ -4|0;l=o[c>>2];o[i+68>>2]=c;L:{if(Uf(s)){n=o[a+8>>2];k=o[n>>2];if((q|0)>=((o[n+4>>2]-k>>2>>>0)/3|0)){break e}d=-1;e=-1;f=o[n+24>>2];c=f;j=-1;M:{if((l|0)==-1){break M}h=l+1|0;h=(h>>>0)%3|0?h:l+ -2|0;j=-1;if((h|0)==-1){break M}j=o[k+(h<<2)>>2]}h=j;c=o[c+(h<<2)>>2];N:{if((c|0)==-1){break N}j=c+1|0;c=(j>>>0)%3|0?j:c+ -2|0;if((c|0)==-1){break N}d=c+1|0;d=(d>>>0)%3|0?d:c+ -2|0;if((d|0)!=-1){e=o[k+(d<<2)>>2]}d=c}j=-1;t=-1;f=o[f+(e<<2)>>2];c=-1;O:{if((f|0)==-1){break O}v=f+1|0;f=(v>>>0)%3|0?v:f+ -2|0;c=-1;if((f|0)==-1){break O}c=f+1|0;c=(c>>>0)%3|0?c:f+ -2|0;if((c|0)!=-1){t=o[k+(c<<2)>>2]}c=f}n=o[n+12>>2];f=u(q,3);v=f<<2;o[n+v>>2]=l;o[n+(l<<2)>>2]=f;l=f+1|0;r=l<<2;o[r+n>>2]=d;o[n+(d<<2)>>2]=l;d=f+2|0;x=d<<2;o[x+n>>2]=c;o[n+(c<<2)>>2]=d;o[k+v>>2]=e;n=k+r|0;o[n>>2]=t;k=k+x|0;o[k>>2]=h;c=o[a+120>>2];e=l>>>0>>0?-1:e;h=c+(e>>>3&536870908)|0;t=o[h>>2];A=h,B=Sl(e)&t,o[A>>2]=B;j=(l|0)!=-1?o[n>>2]:j;e=c+(j>>>3&536870908)|0;h=o[e>>2];A=e,B=Sl(j)&h,o[A>>2]=B;h=-1;h=(d|0)!=-1?o[k>>2]:h;c=c+(h>>>3&536870908)|0;d=o[c>>2];A=c,B=Sl(h)&d,o[A>>2]=B;h=o[a+64>>2];d=o[a+68>>2];if((h|0)==d<<5){if((h+1|0)<=-1){break c}c=b;if(h>>>0<=1073741822){e=h+32&-32;d=d<<6;d=d>>>0>>0?e:d}else{d=2147483647}fb(c,d);h=o[a+64>>2]}q=q+1|0;o[a+64>>2]=h+1;c=o[a+60>>2]+(h>>>3&536870908)|0;o[c>>2]=o[c>>2]|1<<(h&31);c=o[a+76>>2];h=o[a+80>>2];if((c|0)!=(h|0)){o[c>>2]=f;o[a+76>>2]=c+4;break L}d=o[w>>2];j=c-d|0;l=j>>2;e=l+1|0;if(e>>>0>=1073741824){break b}h=h-d|0;k=h>>1;e=h>>2>>>0<536870911?k>>>0>>0?e:k:1073741823;c=0;P:{if(!e){break P}if(e>>>0>=1073741824){break a}c=yk(e<<2)}h=c+(l<<2)|0;o[h>>2]=f;e=c+(e<<2)|0;f=h+4|0;if((j|0)>=1){ll(c,d,j)}o[a+80>>2]=e;o[a+76>>2]=f;o[a+72>>2]=c;if(!d){break L}jl(d);break L}c=o[a+64>>2];e=o[a+68>>2];if((c|0)==e<<5){if((c+1|0)<=-1){break c}d=b;if(c>>>0<=1073741822){c=c+32&-32;e=e<<6;c=e>>>0>>0?c:e}else{c=2147483647}fb(d,c);c=o[a+64>>2]}o[a+64>>2]=c+1;d=o[a+60>>2]+(c>>>3&536870908)|0;e=o[d>>2];A=d,B=Sl(c)&e,o[A>>2]=B;c=o[a+76>>2];f=o[a+80>>2];if((c|0)!=(f|0)){o[c>>2]=l;o[a+76>>2]=c+4;break L}d=o[w>>2];j=c-d|0;h=j>>2;e=h+1|0;if(e>>>0>=1073741824){break b}f=f-d|0;k=f>>1;e=f>>2>>>0<536870911?k>>>0>>0?e:k:1073741823;c=0;Q:{if(!e){break Q}if(e>>>0>=1073741824){break a}c=yk(e<<2)}f=c+(h<<2)|0;o[f>>2]=l;e=c+(e<<2)|0;f=f+4|0;if((j|0)>=1){ll(c,d,j)}o[a+80>>2]=e;o[a+76>>2]=f;o[a+72>>2]=c;if(!d){break L}jl(d)}h=o[i+68>>2];if((h|0)!=o[i+64>>2]){continue}break}c=o[a+8>>2]}if(((o[c+4>>2]-o[c>>2]>>2>>>0)/3|0)!=(q|0)){break e}g=o[c+28>>2]-o[c+24>>2]>>2;q=o[i+24>>2];j=o[i+28>>2];if((q|0)==(j|0)){break d}while(1){e=o[q>>2];d=o[c+24>>2];h=g+ -1|0;R:{if(o[d+(h<<2)>>2]!=-1){b=g;break R}d=o[c+24>>2];while(1){h=g+ -2|0;b=g+ -1|0;g=b;if(o[(h<<2)+d>>2]==-1){continue}break}}if(h>>>0>=e>>>0){o[i>>2]=c;g=d;d=h<<2;g=o[g+d>>2];m[i+12|0]=1;o[i+8>>2]=g;o[i+4>>2]=g;if((g|0)!=-1){while(1){o[o[c>>2]+(g<<2)>>2]=e;of(i);c=o[a+8>>2];g=o[i+8>>2];if((g|0)!=-1){continue}break}}g=d;d=o[c+24>>2];g=g+d|0;if((e|0)!=-1){o[d+(e<<2)>>2]=o[g>>2]}o[g>>2]=-1;g=1<<(e&31);d=e>>>3&536870908;e=o[a+120>>2];d=d+e|0;f=d;e=e+(h>>>3&536870908)|0;h=1<<(h&31);k=g|o[d>>2];S:{if(o[e>>2]&h){break S}k=o[d>>2]&(g^-1)}o[f>>2]=k;o[e>>2]=o[e>>2]&(h^-1);b=b+ -1|0}g=b;q=q+4|0;if((j|0)!=(q|0)){continue}break}}q=o[i+24>>2]}if(q){o[i+28>>2]=q;jl(q)}a=o[i+48>>2];if(a){while(1){b=o[a>>2];jl(a);a=b;if(a){continue}break}}a=o[i+40>>2];o[i+40>>2]=0;if(a){jl(a)}a=o[i+64>>2];if(a){o[i+68>>2]=a;jl(a)}R=i+96|0;return g}Nk();D()}Nk();D()}db(8832);D()}function ji(a,b,c,d,e){var f=0,g=0;f=R-32|0;R=f;o[b+32>>2]=d;o[b+40>>2]=c;o[b+4>>2]=e;gi(a,d,f+16|0);a:{if(o[a>>2]){break a}c=a+4|0;if(m[a+15|0]<=-1){jl(o[c>>2])}e=p[f+23|0];if((l[o[o[b>>2]+8>>2]](b)|0)!=(e|0)){b=yk(64);o[f>>2]=b;o[f+4>>2]=50;o[f+8>>2]=-2147483584;m[b+50|0]=0;d=p[10289]|p[10290]<<8;m[b+48|0]=d;m[b+49|0]=d>>>8;d=p[10285]|p[10286]<<8|(p[10287]<<16|p[10288]<<24);e=p[10281]|p[10282]<<8|(p[10283]<<16|p[10284]<<24);m[b+40|0]=e;m[b+41|0]=e>>>8;m[b+42|0]=e>>>16;m[b+43|0]=e>>>24;m[b+44|0]=d;m[b+45|0]=d>>>8;m[b+46|0]=d>>>16;m[b+47|0]=d>>>24;d=p[10277]|p[10278]<<8|(p[10279]<<16|p[10280]<<24);e=p[10273]|p[10274]<<8|(p[10275]<<16|p[10276]<<24);m[b+32|0]=e;m[b+33|0]=e>>>8;m[b+34|0]=e>>>16;m[b+35|0]=e>>>24;m[b+36|0]=d;m[b+37|0]=d>>>8;m[b+38|0]=d>>>16;m[b+39|0]=d>>>24;d=p[10269]|p[10270]<<8|(p[10271]<<16|p[10272]<<24);e=p[10265]|p[10266]<<8|(p[10267]<<16|p[10268]<<24);m[b+24|0]=e;m[b+25|0]=e>>>8;m[b+26|0]=e>>>16;m[b+27|0]=e>>>24;m[b+28|0]=d;m[b+29|0]=d>>>8;m[b+30|0]=d>>>16;m[b+31|0]=d>>>24;d=p[10261]|p[10262]<<8|(p[10263]<<16|p[10264]<<24);e=p[10257]|p[10258]<<8|(p[10259]<<16|p[10260]<<24);m[b+16|0]=e;m[b+17|0]=e>>>8;m[b+18|0]=e>>>16;m[b+19|0]=e>>>24;m[b+20|0]=d;m[b+21|0]=d>>>8;m[b+22|0]=d>>>16;m[b+23|0]=d>>>24;d=p[10253]|p[10254]<<8|(p[10255]<<16|p[10256]<<24);e=p[10249]|p[10250]<<8|(p[10251]<<16|p[10252]<<24);m[b+8|0]=e;m[b+9|0]=e>>>8;m[b+10|0]=e>>>16;m[b+11|0]=e>>>24;m[b+12|0]=d;m[b+13|0]=d>>>8;m[b+14|0]=d>>>16;m[b+15|0]=d>>>24;d=p[10245]|p[10246]<<8|(p[10247]<<16|p[10248]<<24);e=p[10241]|p[10242]<<8|(p[10243]<<16|p[10244]<<24);m[b|0]=e;m[b+1|0]=e>>>8;m[b+2|0]=e>>>16;m[b+3|0]=e>>>24;m[b+4|0]=d;m[b+5|0]=d>>>8;m[b+6|0]=d>>>16;m[b+7|0]=d>>>24;o[a>>2]=-1;Bk(c,f);if(m[f+11|0]>-1){break a}jl(o[f>>2]);break a}d=p[f+21|0];m[b+36|0]=d;g=p[f+22|0];m[b+37|0]=g;if((d+ -1&255)>>>0>=2){b=yk(32);o[f>>2]=b;o[f+4>>2]=22;o[f+8>>2]=-2147483616;m[b+22|0]=0;d=p[10310]|p[10311]<<8|(p[10312]<<16|p[10313]<<24);e=p[10306]|p[10307]<<8|(p[10308]<<16|p[10309]<<24);m[b+14|0]=e;m[b+15|0]=e>>>8;m[b+16|0]=e>>>16;m[b+17|0]=e>>>24;m[b+18|0]=d;m[b+19|0]=d>>>8;m[b+20|0]=d>>>16;m[b+21|0]=d>>>24;d=p[10304]|p[10305]<<8|(p[10306]<<16|p[10307]<<24);e=p[10300]|p[10301]<<8|(p[10302]<<16|p[10303]<<24);m[b+8|0]=e;m[b+9|0]=e>>>8;m[b+10|0]=e>>>16;m[b+11|0]=e>>>24;m[b+12|0]=d;m[b+13|0]=d>>>8;m[b+14|0]=d>>>16;m[b+15|0]=d>>>24;d=p[10296]|p[10297]<<8|(p[10298]<<16|p[10299]<<24);e=p[10292]|p[10293]<<8|(p[10294]<<16|p[10295]<<24);m[b|0]=e;m[b+1|0]=e>>>8;m[b+2|0]=e>>>16;m[b+3|0]=e>>>24;m[b+4|0]=d;m[b+5|0]=d>>>8;m[b+6|0]=d>>>16;m[b+7|0]=d>>>24;o[a>>2]=-5;Bk(c,f);if(m[f+11|0]>-1){break a}jl(o[f>>2]);break a}if(!((d|0)!=2|(e?2:3)>>>0>=g>>>0)){b=yk(32);o[f>>2]=b;o[f+4>>2]=22;o[f+8>>2]=-2147483616;m[b+22|0]=0;d=p[10333]|p[10334]<<8|(p[10335]<<16|p[10336]<<24);e=p[10329]|p[10330]<<8|(p[10331]<<16|p[10332]<<24);m[b+14|0]=e;m[b+15|0]=e>>>8;m[b+16|0]=e>>>16;m[b+17|0]=e>>>24;m[b+18|0]=d;m[b+19|0]=d>>>8;m[b+20|0]=d>>>16;m[b+21|0]=d>>>24;d=p[10327]|p[10328]<<8|(p[10329]<<16|p[10330]<<24);e=p[10323]|p[10324]<<8|(p[10325]<<16|p[10326]<<24);m[b+8|0]=e;m[b+9|0]=e>>>8;m[b+10|0]=e>>>16;m[b+11|0]=e>>>24;m[b+12|0]=d;m[b+13|0]=d>>>8;m[b+14|0]=d>>>16;m[b+15|0]=d>>>24;d=p[10319]|p[10320]<<8|(p[10321]<<16|p[10322]<<24);e=p[10315]|p[10316]<<8|(p[10317]<<16|p[10318]<<24);m[b|0]=e;m[b+1|0]=e>>>8;m[b+2|0]=e>>>16;m[b+3|0]=e>>>24;m[b+4|0]=d;m[b+5|0]=d>>>8;m[b+6|0]=d>>>16;m[b+7|0]=d>>>24;o[a>>2]=-5;Bk(c,f);if(m[f+11|0]>-1){break a}jl(o[f>>2]);break a}d=d<<8|g;n[o[b+32>>2]+38>>1]=d;b:{if((d&65535)>>>0<259|n[f+26>>1]>-1){break b}hi(a,b);if(o[a>>2]){break a}if(m[c+11|0]>-1){break b}jl(o[c>>2])}if(!l[o[o[b>>2]+12>>2]](b)){b=yk(48);o[f>>2]=b;o[f+4>>2]=33;o[f+8>>2]=-2147483600;m[b+33|0]=0;m[b+32|0]=p[10370];d=p[10366]|p[10367]<<8|(p[10368]<<16|p[10369]<<24);e=p[10362]|p[10363]<<8|(p[10364]<<16|p[10365]<<24);m[b+24|0]=e;m[b+25|0]=e>>>8;m[b+26|0]=e>>>16;m[b+27|0]=e>>>24;m[b+28|0]=d;m[b+29|0]=d>>>8;m[b+30|0]=d>>>16;m[b+31|0]=d>>>24;d=p[10358]|p[10359]<<8|(p[10360]<<16|p[10361]<<24);e=p[10354]|p[10355]<<8|(p[10356]<<16|p[10357]<<24);m[b+16|0]=e;m[b+17|0]=e>>>8;m[b+18|0]=e>>>16;m[b+19|0]=e>>>24;m[b+20|0]=d;m[b+21|0]=d>>>8;m[b+22|0]=d>>>16;m[b+23|0]=d>>>24;d=p[10350]|p[10351]<<8|(p[10352]<<16|p[10353]<<24);e=p[10346]|p[10347]<<8|(p[10348]<<16|p[10349]<<24);m[b+8|0]=e;m[b+9|0]=e>>>8;m[b+10|0]=e>>>16;m[b+11|0]=e>>>24;m[b+12|0]=d;m[b+13|0]=d>>>8;m[b+14|0]=d>>>16;m[b+15|0]=d>>>24;d=p[10342]|p[10343]<<8|(p[10344]<<16|p[10345]<<24);e=p[10338]|p[10339]<<8|(p[10340]<<16|p[10341]<<24);m[b|0]=e;m[b+1|0]=e>>>8;m[b+2|0]=e>>>16;m[b+3|0]=e>>>24;m[b+4|0]=d;m[b+5|0]=d>>>8;m[b+6|0]=d>>>16;m[b+7|0]=d>>>24;o[a>>2]=-1;Bk(c,f);if(m[f+11|0]>-1){break a}jl(o[f>>2]);break a}if(!l[o[o[b>>2]+20>>2]](b)){b=yk(32);o[f>>2]=b;o[f+4>>2]=31;o[f+8>>2]=-2147483616;m[b+31|0]=0;d=p[10399]|p[10400]<<8|(p[10401]<<16|p[10402]<<24);e=p[10395]|p[10396]<<8|(p[10397]<<16|p[10398]<<24);m[b+23|0]=e;m[b+24|0]=e>>>8;m[b+25|0]=e>>>16;m[b+26|0]=e>>>24;m[b+27|0]=d;m[b+28|0]=d>>>8;m[b+29|0]=d>>>16;m[b+30|0]=d>>>24;d=p[10392]|p[10393]<<8|(p[10394]<<16|p[10395]<<24);e=p[10388]|p[10389]<<8|(p[10390]<<16|p[10391]<<24);m[b+16|0]=e;m[b+17|0]=e>>>8;m[b+18|0]=e>>>16;m[b+19|0]=e>>>24;m[b+20|0]=d;m[b+21|0]=d>>>8;m[b+22|0]=d>>>16;m[b+23|0]=d>>>24;d=p[10384]|p[10385]<<8|(p[10386]<<16|p[10387]<<24);e=p[10380]|p[10381]<<8|(p[10382]<<16|p[10383]<<24);m[b+8|0]=e;m[b+9|0]=e>>>8;m[b+10|0]=e>>>16;m[b+11|0]=e>>>24;m[b+12|0]=d;m[b+13|0]=d>>>8;m[b+14|0]=d>>>16;m[b+15|0]=d>>>24;d=p[10376]|p[10377]<<8|(p[10378]<<16|p[10379]<<24);e=p[10372]|p[10373]<<8|(p[10374]<<16|p[10375]<<24);m[b|0]=e;m[b+1|0]=e>>>8;m[b+2|0]=e>>>16;m[b+3|0]=e>>>24;m[b+4|0]=d;m[b+5|0]=d>>>8;m[b+6|0]=d>>>16;m[b+7|0]=d>>>24;o[a>>2]=-1;Bk(c,f);if(m[f+11|0]>-1){break a}jl(o[f>>2]);break a}if(!l[o[o[b>>2]+24>>2]](b)){b=yk(48);o[f>>2]=b;o[f+4>>2]=34;o[f+8>>2]=-2147483600;m[b+34|0]=0;d=p[10436]|p[10437]<<8;m[b+32|0]=d;m[b+33|0]=d>>>8;d=p[10432]|p[10433]<<8|(p[10434]<<16|p[10435]<<24);e=p[10428]|p[10429]<<8|(p[10430]<<16|p[10431]<<24);m[b+24|0]=e;m[b+25|0]=e>>>8;m[b+26|0]=e>>>16;m[b+27|0]=e>>>24;m[b+28|0]=d;m[b+29|0]=d>>>8;m[b+30|0]=d>>>16;m[b+31|0]=d>>>24;d=p[10424]|p[10425]<<8|(p[10426]<<16|p[10427]<<24);e=p[10420]|p[10421]<<8|(p[10422]<<16|p[10423]<<24);m[b+16|0]=e;m[b+17|0]=e>>>8;m[b+18|0]=e>>>16;m[b+19|0]=e>>>24;m[b+20|0]=d;m[b+21|0]=d>>>8;m[b+22|0]=d>>>16;m[b+23|0]=d>>>24;d=p[10416]|p[10417]<<8|(p[10418]<<16|p[10419]<<24);e=p[10412]|p[10413]<<8|(p[10414]<<16|p[10415]<<24);m[b+8|0]=e;m[b+9|0]=e>>>8;m[b+10|0]=e>>>16;m[b+11|0]=e>>>24;m[b+12|0]=d;m[b+13|0]=d>>>8;m[b+14|0]=d>>>16;m[b+15|0]=d>>>24;d=p[10408]|p[10409]<<8|(p[10410]<<16|p[10411]<<24);e=p[10404]|p[10405]<<8|(p[10406]<<16|p[10407]<<24);m[b|0]=e;m[b+1|0]=e>>>8;m[b+2|0]=e>>>16;m[b+3|0]=e>>>24;m[b+4|0]=d;m[b+5|0]=d>>>8;m[b+6|0]=d>>>16;m[b+7|0]=d>>>24;o[a>>2]=-1;Bk(c,f);if(m[f+11|0]>-1){break a}jl(o[f>>2]);break a}o[a>>2]=0;o[a+4>>2]=0;o[a+8>>2]=0;o[a+12>>2]=0}R=f+32|0}function gi(a,b,c){var d=0,e=0,f=0,g=0,h=0,i=0;e=R-16|0;R=e;g=o[b+12>>2];d=o[b+20>>2];f=o[b+16>>2];h=f+5|0;if(h>>>0<5){d=d+1|0}a:{if((g|0)<(d|0)?1:(g|0)<=(d|0)?r[b+8>>2]>=h>>>0?0:1:0){b=yk(32);o[e>>2]=b;o[e+4>>2]=29;o[e+8>>2]=-2147483616;m[b+29|0]=0;c=p[10185]|p[10186]<<8|(p[10187]<<16|p[10188]<<24);d=p[10181]|p[10182]<<8|(p[10183]<<16|p[10184]<<24);m[b+21|0]=d;m[b+22|0]=d>>>8;m[b+23|0]=d>>>16;m[b+24|0]=d>>>24;m[b+25|0]=c;m[b+26|0]=c>>>8;m[b+27|0]=c>>>16;m[b+28|0]=c>>>24;c=o[2545];d=o[2544];m[b+16|0]=d;m[b+17|0]=d>>>8;m[b+18|0]=d>>>16;m[b+19|0]=d>>>24;m[b+20|0]=c;m[b+21|0]=c>>>8;m[b+22|0]=c>>>16;m[b+23|0]=c>>>24;c=o[2543];d=o[2542];m[b+8|0]=d;m[b+9|0]=d>>>8;m[b+10|0]=d>>>16;m[b+11|0]=d>>>24;m[b+12|0]=c;m[b+13|0]=c>>>8;m[b+14|0]=c>>>16;m[b+15|0]=c>>>24;c=o[2541];d=o[2540];m[b|0]=d;m[b+1|0]=d>>>8;m[b+2|0]=d>>>16;m[b+3|0]=d>>>24;m[b+4|0]=c;m[b+5|0]=c>>>8;m[b+6|0]=c>>>16;m[b+7|0]=c>>>24;o[a>>2]=-2;Bk(a+4|0,e);if(m[e+11|0]>-1){break a}jl(o[e>>2]);break a}d=f+o[b>>2]|0;g=p[d|0]|p[d+1|0]<<8|(p[d+2|0]<<16|p[d+3|0]<<24);m[c|0]=g;m[c+1|0]=g>>>8;m[c+2|0]=g>>>16;m[c+3|0]=g>>>24;m[c+4|0]=p[d+4|0];g=b;d=o[b+20>>2];f=o[b+16>>2]+5|0;if(f>>>0<5){d=d+1|0}h=f;f=d;o[g+16>>2]=h;o[g+20>>2]=d;if(Vj(c,10190,5)){b=yk(32);o[e>>2]=b;o[e+4>>2]=17;o[e+8>>2]=-2147483616;m[b+17|0]=0;m[b+16|0]=p[10212];c=p[10208]|p[10209]<<8|(p[10210]<<16|p[10211]<<24);d=p[10204]|p[10205]<<8|(p[10206]<<16|p[10207]<<24);m[b+8|0]=d;m[b+9|0]=d>>>8;m[b+10|0]=d>>>16;m[b+11|0]=d>>>24;m[b+12|0]=c;m[b+13|0]=c>>>8;m[b+14|0]=c>>>16;m[b+15|0]=c>>>24;c=p[10200]|p[10201]<<8|(p[10202]<<16|p[10203]<<24);d=p[10196]|p[10197]<<8|(p[10198]<<16|p[10199]<<24);m[b|0]=d;m[b+1|0]=d>>>8;m[b+2|0]=d>>>16;m[b+3|0]=d>>>24;m[b+4|0]=c;m[b+5|0]=c>>>8;m[b+6|0]=c>>>16;m[b+7|0]=c>>>24;o[a>>2]=-1;Bk(a+4|0,e);if(m[e+11|0]>-1){break a}jl(o[e>>2]);break a}d=o[b+12>>2];if((d|0)<(f|0)?1:(d|0)<=(f|0)?r[b+8>>2]>h>>>0?0:1:0){b=yk(32);o[e>>2]=b;o[e+4>>2]=29;o[e+8>>2]=-2147483616;m[b+29|0]=0;c=p[10185]|p[10186]<<8|(p[10187]<<16|p[10188]<<24);d=p[10181]|p[10182]<<8|(p[10183]<<16|p[10184]<<24);m[b+21|0]=d;m[b+22|0]=d>>>8;m[b+23|0]=d>>>16;m[b+24|0]=d>>>24;m[b+25|0]=c;m[b+26|0]=c>>>8;m[b+27|0]=c>>>16;m[b+28|0]=c>>>24;c=o[2545];d=o[2544];m[b+16|0]=d;m[b+17|0]=d>>>8;m[b+18|0]=d>>>16;m[b+19|0]=d>>>24;m[b+20|0]=c;m[b+21|0]=c>>>8;m[b+22|0]=c>>>16;m[b+23|0]=c>>>24;c=o[2543];d=o[2542];m[b+8|0]=d;m[b+9|0]=d>>>8;m[b+10|0]=d>>>16;m[b+11|0]=d>>>24;m[b+12|0]=c;m[b+13|0]=c>>>8;m[b+14|0]=c>>>16;m[b+15|0]=c>>>24;c=o[2541];d=o[2540];m[b|0]=d;m[b+1|0]=d>>>8;m[b+2|0]=d>>>16;m[b+3|0]=d>>>24;m[b+4|0]=c;m[b+5|0]=c>>>8;m[b+6|0]=c>>>16;m[b+7|0]=c>>>24;o[a>>2]=-2;Bk(a+4|0,e);if(m[e+11|0]>-1){break a}jl(o[e>>2]);break a}m[c+5|0]=p[h+o[b>>2]|0];d=o[b+20>>2];f=o[b+16>>2]+1|0;if(f>>>0<1){d=d+1|0}o[b+16>>2]=f;o[g+20>>2]=d;g=o[b+12>>2];if((g|0)<(d|0)?1:(g|0)<=(d|0)?r[b+8>>2]>f>>>0?0:1:0){b=yk(32);o[e>>2]=b;o[e+4>>2]=29;o[e+8>>2]=-2147483616;m[b+29|0]=0;c=p[10185]|p[10186]<<8|(p[10187]<<16|p[10188]<<24);d=p[10181]|p[10182]<<8|(p[10183]<<16|p[10184]<<24);m[b+21|0]=d;m[b+22|0]=d>>>8;m[b+23|0]=d>>>16;m[b+24|0]=d>>>24;m[b+25|0]=c;m[b+26|0]=c>>>8;m[b+27|0]=c>>>16;m[b+28|0]=c>>>24;c=o[2545];d=o[2544];m[b+16|0]=d;m[b+17|0]=d>>>8;m[b+18|0]=d>>>16;m[b+19|0]=d>>>24;m[b+20|0]=c;m[b+21|0]=c>>>8;m[b+22|0]=c>>>16;m[b+23|0]=c>>>24;c=o[2543];d=o[2542];m[b+8|0]=d;m[b+9|0]=d>>>8;m[b+10|0]=d>>>16;m[b+11|0]=d>>>24;m[b+12|0]=c;m[b+13|0]=c>>>8;m[b+14|0]=c>>>16;m[b+15|0]=c>>>24;c=o[2541];d=o[2540];m[b|0]=d;m[b+1|0]=d>>>8;m[b+2|0]=d>>>16;m[b+3|0]=d>>>24;m[b+4|0]=c;m[b+5|0]=c>>>8;m[b+6|0]=c>>>16;m[b+7|0]=c>>>24;o[a>>2]=-2;Bk(a+4|0,e);if(m[e+11|0]>-1){break a}jl(o[e>>2]);break a}m[c+6|0]=p[f+o[b>>2]|0];d=o[b+20>>2];f=o[b+16>>2]+1|0;if(f>>>0<1){d=d+1|0}o[b+16>>2]=f;o[b+20>>2]=d;g=o[b+12>>2];if((g|0)<(d|0)?1:(g|0)<=(d|0)?r[b+8>>2]>f>>>0?0:1:0){b=yk(32);o[e>>2]=b;o[e+4>>2]=29;o[e+8>>2]=-2147483616;m[b+29|0]=0;c=p[10185]|p[10186]<<8|(p[10187]<<16|p[10188]<<24);d=p[10181]|p[10182]<<8|(p[10183]<<16|p[10184]<<24);m[b+21|0]=d;m[b+22|0]=d>>>8;m[b+23|0]=d>>>16;m[b+24|0]=d>>>24;m[b+25|0]=c;m[b+26|0]=c>>>8;m[b+27|0]=c>>>16;m[b+28|0]=c>>>24;c=o[2545];d=o[2544];m[b+16|0]=d;m[b+17|0]=d>>>8;m[b+18|0]=d>>>16;m[b+19|0]=d>>>24;m[b+20|0]=c;m[b+21|0]=c>>>8;m[b+22|0]=c>>>16;m[b+23|0]=c>>>24;c=o[2543];d=o[2542];m[b+8|0]=d;m[b+9|0]=d>>>8;m[b+10|0]=d>>>16;m[b+11|0]=d>>>24;m[b+12|0]=c;m[b+13|0]=c>>>8;m[b+14|0]=c>>>16;m[b+15|0]=c>>>24;c=o[2541];d=o[2540];m[b|0]=d;m[b+1|0]=d>>>8;m[b+2|0]=d>>>16;m[b+3|0]=d>>>24;m[b+4|0]=c;m[b+5|0]=c>>>8;m[b+6|0]=c>>>16;m[b+7|0]=c>>>24;o[a>>2]=-2;Bk(a+4|0,e);if(m[e+11|0]>-1){break a}jl(o[e>>2]);break a}m[c+7|0]=p[f+o[b>>2]|0];d=o[b+20>>2];f=o[b+16>>2]+1|0;if(f>>>0<1){d=d+1|0}o[b+16>>2]=f;o[b+20>>2]=d;g=o[b+12>>2];if((g|0)<(d|0)?1:(g|0)<=(d|0)?r[b+8>>2]>f>>>0?0:1:0){b=yk(32);o[e>>2]=b;o[e+4>>2]=29;o[e+8>>2]=-2147483616;m[b+29|0]=0;c=p[10185]|p[10186]<<8|(p[10187]<<16|p[10188]<<24);d=p[10181]|p[10182]<<8|(p[10183]<<16|p[10184]<<24);m[b+21|0]=d;m[b+22|0]=d>>>8;m[b+23|0]=d>>>16;m[b+24|0]=d>>>24;m[b+25|0]=c;m[b+26|0]=c>>>8;m[b+27|0]=c>>>16;m[b+28|0]=c>>>24;c=o[2545];d=o[2544];m[b+16|0]=d;m[b+17|0]=d>>>8;m[b+18|0]=d>>>16;m[b+19|0]=d>>>24;m[b+20|0]=c;m[b+21|0]=c>>>8;m[b+22|0]=c>>>16;m[b+23|0]=c>>>24;c=o[2543];d=o[2542];m[b+8|0]=d;m[b+9|0]=d>>>8;m[b+10|0]=d>>>16;m[b+11|0]=d>>>24;m[b+12|0]=c;m[b+13|0]=c>>>8;m[b+14|0]=c>>>16;m[b+15|0]=c>>>24;c=o[2541];d=o[2540];m[b|0]=d;m[b+1|0]=d>>>8;m[b+2|0]=d>>>16;m[b+3|0]=d>>>24;m[b+4|0]=c;m[b+5|0]=c>>>8;m[b+6|0]=c>>>16;m[b+7|0]=c>>>24;o[a>>2]=-2;Bk(a+4|0,e);if(m[e+11|0]>-1){break a}jl(o[e>>2]);break a}m[c+8|0]=p[f+o[b>>2]|0];d=o[b+20>>2];f=d;i=o[b+16>>2];h=i+1|0;if(h>>>0<1){d=d+1|0}o[b+16>>2]=h;o[b+20>>2]=d;g=o[b+12>>2];d=f;f=i+3|0;if(f>>>0<3){d=d+1|0}if((g|0)<(d|0)?1:(g|0)<=(d|0)?r[b+8>>2]>=f>>>0?0:1:0){b=yk(32);o[e>>2]=b;o[e+4>>2]=29;o[e+8>>2]=-2147483616;m[b+29|0]=0;c=p[10185]|p[10186]<<8|(p[10187]<<16|p[10188]<<24);d=p[10181]|p[10182]<<8|(p[10183]<<16|p[10184]<<24);m[b+21|0]=d;m[b+22|0]=d>>>8;m[b+23|0]=d>>>16;m[b+24|0]=d>>>24;m[b+25|0]=c;m[b+26|0]=c>>>8;m[b+27|0]=c>>>16;m[b+28|0]=c>>>24;c=o[2545];d=o[2544];m[b+16|0]=d;m[b+17|0]=d>>>8;m[b+18|0]=d>>>16;m[b+19|0]=d>>>24;m[b+20|0]=c;m[b+21|0]=c>>>8;m[b+22|0]=c>>>16;m[b+23|0]=c>>>24;c=o[2543];d=o[2542];m[b+8|0]=d;m[b+9|0]=d>>>8;m[b+10|0]=d>>>16;m[b+11|0]=d>>>24;m[b+12|0]=c;m[b+13|0]=c>>>8;m[b+14|0]=c>>>16;m[b+15|0]=c>>>24;c=o[2541];d=o[2540];m[b|0]=d;m[b+1|0]=d>>>8;m[b+2|0]=d>>>16;m[b+3|0]=d>>>24;m[b+4|0]=c;m[b+5|0]=c>>>8;m[b+6|0]=c>>>16;m[b+7|0]=c>>>24;o[a>>2]=-2;Bk(a+4|0,e);if(m[e+11|0]>-1){break a}jl(o[e>>2]);break a}f=c;c=h+o[b>>2]|0;n[f+10>>1]=p[c|0]|p[c+1|0]<<8;c=b;f=b;d=o[b+20>>2];b=o[b+16>>2]+2|0;if(b>>>0<2){d=d+1|0}o[f+16>>2]=b;o[c+20>>2]=d;o[a+8>>2]=0;o[a+12>>2]=0;o[a>>2]=0;o[a+4>>2]=0}R=e+16|0}function Oj(a,b,c,d,f,g){a=a|0;b=+b;c=c|0;d=d|0;f=f|0;g=g|0;var i=0,j=0,k=0,l=0,n=0,q=0,r=0,s=0,t=0,v=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0;n=R-560|0;R=n;o[n+44>>2]=0;h(+b);i=e(1)|0;a:{if(G=1,H=(J=e(0)>>>0>4294967295?0:1,K=0,L=(i|0)<=-1,L?J:K),I=(i|0)<-1,I?G:H){C=1;b=-b;h(+b);i=e(1)|0;e(0)|0;D=11632;break a}if(f&2048){C=1;D=11635;break a}C=f&1;D=C?11638:11633}b:{if((i&2146435072)==2146435072){r=C+3|0;Kj(a,32,c,r,f&-65537);Hj(a,D,C);d=g>>>5&1;Hj(a,b!=b?d?11659:11663:d?11651:11655,3);break b}y=n+16|0;c:{d:{e:{b=Ej(b,n+44|0);b=b+b;if(b!=0){i=o[n+44>>2];o[n+44>>2]=i+ -1;z=g|32;if((z|0)!=97){break e}break c}z=g|32;if((z|0)==97){break c}j=o[n+44>>2];q=(d|0)<0?6:d;break d}j=i+ -29|0;o[n+44>>2]=j;b=b*268435456;q=(d|0)<0?6:d}s=(j|0)<0?n+48|0:n+336|0;l=s;while(1){d=l;if(b<4294967296&b>=0){i=~~b>>>0}else{i=0}o[d>>2]=i;l=l+4|0;b=(b- +(i>>>0))*1e9;if(b!=0){continue}break}f:{if((j|0)<1){i=l;k=s;break f}k=s;while(1){v=(j|0)<29?j:29;i=l+ -4|0;g:{if(i>>>0>>0){break g}d=v;j=0;while(1){r=i;E=j;x=o[i>>2];t=d&31;if(32<=(d&63)>>>0){j=x<>>32-t;x=x<>>0>>0?j+1|0:j;j=Ql(t,j,1e9,0);x=r;r=Ol(j,T,1e9,0);o[x>>2]=t-r;i=i+ -4|0;if(i>>>0>=k>>>0){continue}break}if(!j){break g}k=k+ -4|0;o[k>>2]=j}while(1){i=l;if(i>>>0>k>>>0){l=i+ -4|0;if(!o[l>>2]){continue}}break}j=o[n+44>>2]-v|0;o[n+44>>2]=j;l=i;if((j|0)>0){continue}break}}if((j|0)<=-1){A=((q+25|0)/9|0)+1|0;v=(z|0)==102;while(1){d=(j|0)<-9?9:0-j|0;h:{if(k>>>0>=i>>>0){k=o[k>>2]?k:k+4|0;break h}r=1e9>>>d|0;t=-1<>2];o[l>>2]=x+(j>>>d|0);j=u(r,j&t);l=l+4|0;if(l>>>0>>0){continue}break}k=o[k>>2]?k:k+4|0;if(!j){break h}o[i>>2]=j;i=i+4|0}j=d+o[n+44>>2]|0;o[n+44>>2]=j;d=v?s:k;i=i-d>>2>(A|0)?d+(A<<2)|0:i;if((j|0)<0){continue}break}}l=0;i:{if(k>>>0>=i>>>0){break i}l=u(s-k>>2,9);j=10;d=o[k>>2];if(d>>>0<10){break i}while(1){l=l+1|0;j=u(j,10);if(d>>>0>=j>>>0){continue}break}}d=(q-((z|0)==102?0:l)|0)-((z|0)==103&(q|0)!=0)|0;if((d|0)<(u(i-s>>2,9)+ -9|0)){d=d+9216|0;v=(d|0)/9|0;r=(s+(v<<2)|0)+ -4092|0;j=10;d=d-u(v,9)|0;if((d|0)<=7){while(1){j=u(j,10);d=d+1|0;if((d|0)!=8){continue}break}}v=o[r>>2];t=(v>>>0)/(j>>>0)|0;A=r+4|0;d=v-u(j,t)|0;j:{if(d?0:(A|0)==(i|0)){break j}x=j>>>1|0;B=d>>>0>>0?.5:(i|0)==(A|0)?(x|0)==(d|0)?1:1.5:1.5;b=t&1?9007199254740994:9007199254740992;if(!(!C|p[D|0]!=45)){B=-B;b=-b}d=v-d|0;o[r>>2]=d;if(b+B==b){break j}d=d+j|0;o[r>>2]=d;if(d>>>0>=1e9){while(1){o[r>>2]=0;r=r+ -4|0;if(r>>>0>>0){k=k+ -4|0;o[k>>2]=0}d=o[r>>2]+1|0;o[r>>2]=d;if(d>>>0>999999999){continue}break}}l=u(s-k>>2,9);j=10;d=o[k>>2];if(d>>>0<10){break j}while(1){l=l+1|0;j=u(j,10);if(d>>>0>=j>>>0){continue}break}}d=r+4|0;i=i>>>0>d>>>0?d:i}k:{while(1){j=i;v=0;if(i>>>0<=k>>>0){break k}i=j+ -4|0;if(!o[i>>2]){continue}break}v=1}l:{if((z|0)!=103){t=f&8;break l}d=q?q:1;i=(d|0)>(l|0)&(l|0)>-5;q=(i?l^-1:-1)+d|0;g=(i?-1:-2)+g|0;t=f&8;if(t){break l}i=9;m:{if(!v){break m}r=o[j+ -4>>2];if(!r){break m}d=10;i=0;if((r>>>0)%10){break m}while(1){i=i+1|0;d=u(d,10);if(!((r>>>0)%(d>>>0))){continue}break}}d=u(j-s>>2,9)+ -9|0;if((g|32)==102){t=0;d=d-i|0;d=(d|0)>0?d:0;q=(q|0)<(d|0)?q:d;break l}t=0;d=(d+l|0)-i|0;d=(d|0)>0?d:0;q=(q|0)<(d|0)?q:d}z=q|t;x=(z|0)!=0;d=a;E=c;F=g|32;i=(l|0)>0?l:0;n:{if((F|0)==102){break n}i=l>>31;i=Nj(i+l^i,0,y);if((y-i|0)<=1){while(1){i=i+ -1|0;m[i|0]=48;if((y-i|0)<2){continue}break}}A=i+ -2|0;m[A|0]=g;m[i+ -1|0]=(l|0)<0?45:43;i=y-A|0}r=(i+(x+(q+C|0)|0)|0)+1|0;Kj(d,32,E,r,f);Hj(a,D,C);Kj(a,48,c,r,f^65536);o:{p:{q:{if((F|0)==102){d=n+16|8;g=n+16|9;l=k>>>0>s>>>0?s:k;k=l;while(1){i=Nj(o[k>>2],0,g);r:{if((k|0)!=(l|0)){if(i>>>0<=n+16>>>0){break r}while(1){i=i+ -1|0;m[i|0]=48;if(i>>>0>n+16>>>0){continue}break}break r}if((g|0)!=(i|0)){break r}m[n+24|0]=48;i=d}Hj(a,i,g-i|0);k=k+4|0;if(k>>>0<=s>>>0){continue}break}if(z){Hj(a,11667,1)}if((q|0)<1|k>>>0>=j>>>0){break q}while(1){i=Nj(o[k>>2],0,g);if(i>>>0>n+16>>>0){while(1){i=i+ -1|0;m[i|0]=48;if(i>>>0>n+16>>>0){continue}break}}Hj(a,i,(q|0)<9?q:9);i=q+ -9|0;k=k+4|0;if(k>>>0>=j>>>0){break p}d=(q|0)>9;q=i;if(d){continue}break}break p}s:{if((q|0)<0){break s}s=v?j:k+4|0;d=n+16|8;g=n+16|9;l=k;while(1){i=Nj(o[l>>2],0,g);if((g|0)==(i|0)){m[n+24|0]=48;i=d}t:{if((k|0)!=(l|0)){if(i>>>0<=n+16>>>0){break t}while(1){i=i+ -1|0;m[i|0]=48;if(i>>>0>n+16>>>0){continue}break}break t}Hj(a,i,1);i=i+1|0;if((q|0)<1?!t:0){break t}Hj(a,11667,1)}j=i;i=g-i|0;Hj(a,j,(q|0)>(i|0)?i:q);q=q-i|0;l=l+4|0;if(l>>>0>=s>>>0){break s}if((q|0)>-1){continue}break}}Kj(a,48,q+18|0,18,0);Hj(a,A,y-A|0);break o}i=q}Kj(a,48,i+9|0,9,0)}break b}q=g&32;j=q?D+9|0:D;u:{if(d>>>0>11){break u}i=12-d|0;if(!i){break u}B=8;while(1){B=B*16;i=i+ -1|0;if(i){continue}break}if(p[j|0]==45){b=-(B+(-b-B));break u}b=b+B-B}l=o[n+44>>2];i=l>>31;i=Nj(i^i+l,0,y);if((y|0)==(i|0)){m[n+15|0]=48;i=n+15|0}l=C|2;k=o[n+44>>2];s=i+ -2|0;m[s|0]=g+15;m[i+ -1|0]=(k|0)<0?45:43;D=f&8;k=n+16|0;while(1){g=k;r=q;if(w(b)<2147483648){i=~~b}else{i=-2147483648}m[k|0]=r|p[i+11616|0];b=(b- +(i|0))*16;k=g+1|0;if(!((k-(n+16|0)|0)!=1|(b==0?!((d|0)>0|D):0))){m[g+1|0]=46;k=g+2|0}if(b!=0){continue}break}g=a;i=c;if(!d|((k-n|0)+ -18|0)>=(d|0)){q=((y-(n+16|0)|0)-s|0)+k|0}else{q=((d+y|0)-s|0)+2|0}d=q;r=d+l|0;Kj(g,32,i,r,f);Hj(a,j,l);Kj(a,48,c,r,f^65536);g=k-(n+16|0)|0;Hj(a,n+16|0,g);d=y-s|0;Kj(a,48,q-(d+g|0)|0,0,0);Hj(a,s,d)}Kj(a,32,c,r,f^8192);R=n+560|0;return((r|0)<(c|0)?c:r)|0}function Ie(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,p=0,q=0,r=0,s=0,t=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0;i=R+ -64|0;R=i;o[a+8>>2]=e;f=a+32|0;j=o[f>>2];d=o[a+36>>2]-j>>2;a:{if(d>>>0>>0){Ia(f,e-d|0);break a}if(d>>>0<=e>>>0){break a}o[a+36>>2]=j+(e<<2)}o[i+56>>2]=0;o[i+60>>2]=0;o[i+48>>2]=0;o[i+52>>2]=0;o[i+40>>2]=0;o[i+44>>2]=0;f=i+32|0;o[f>>2]=0;o[f+4>>2]=0;o[i+24>>2]=0;o[i+28>>2]=0;o[i+16>>2]=0;o[i+20>>2]=0;o[i>>2]=0;d=0;if(e){Dd(i+16|0,e,i);h=o[i+28>>2];d=o[f>>2]}o[i>>2]=0;d=d-h>>2;b:{if(d>>>0>=e>>>0){if(d>>>0<=e>>>0){break b}o[i+32>>2]=(e<<2)+h;break b}Dd(i+16|12,e-d|0,i)}o[i>>2]=0;f=o[i+40>>2];d=o[i+44>>2]-f>>2;c:{if(d>>>0>=e>>>0){if(d>>>0<=e>>>0){break c}o[i+44>>2]=f+(e<<2);break c}Dd(i+40|0,e-d|0,i)}o[i>>2]=0;f=o[i+52>>2];d=o[i+56>>2]-f>>2;d:{if(d>>>0>=e>>>0){if(d>>>0<=e>>>0){break d}o[i+56>>2]=f+(e<<2);break d}Dd(i+52|0,e-d|0,i)}e:{if(o[a+8>>2]<=0){break e}g=o[i+16>>2];h=0;while(1){d=h<<2;f=o[d+g>>2];k=o[a+16>>2];f:{if((f|0)>(k|0)){j=o[a+32>>2];o[d+j>>2]=k;break f}j=o[a+32>>2];d=d+j|0;k=o[a+12>>2];if((f|0)<(k|0)){o[d>>2]=k;break f}o[d>>2]=f}h=h+1|0;d=o[a+8>>2];if((h|0)<(d|0)){continue}break}if((d|0)<1){break e}d=0;while(1){g=d<<2;f=g+c|0;g=o[b+g>>2]+o[g+j>>2]|0;o[f>>2]=g;g:{if((g|0)>o[a+16>>2]){g=g-o[a+20>>2]|0}else{if((g|0)>=o[a+12>>2]){break g}g=g+o[a+20>>2]|0}o[f>>2]=g}d=d+1|0;if((d|0)>2]){continue}break}}z=o[a+52>>2];p=o[a+48>>2];t=yk(16);d=t;o[d>>2]=0;o[d+4>>2]=0;o[d+8>>2]=0;o[d+12>>2]=0;o[i+8>>2]=0;o[i>>2]=0;o[i+4>>2]=0;h:{if(e){if(e>>>0>=1073741824){break h}d=e<<2;s=yk(d);o[i>>2]=s;f=d+s|0;o[i+8>>2]=f;ml(s,0,d);o[i+4>>2]=f}d=1;f=o[a+56>>2];y=o[f>>2];f=o[f+4>>2]-y|0;i:{if((f|0)<5){break i}d=f>>2;A=(d|0)>2?d:2;B=d>>>0>1?d:1;C=e<<2;k=1;while(1){j:{k:{l:{if((k|0)!=(B|0)){m:{n:{j=o[(k<<2)+y>>2];if((j|0)==-1){break n}m=j+((j>>>0)%3|0?-1:2)|0;v=m>>>5|0;l=1;w=1<<(m&31);x=o[p>>2];f=0;d=j;o:{while(1){p:{if(o[x+(d>>>3&536870908)>>2]>>>(d&31)&1){break p}g=o[o[o[p+64>>2]+12>>2]+(d<<2)>>2];if((g|0)==-1){break p}q=o[z>>2];h=o[p+28>>2];r=o[q+(o[h+(g<<2)>>2]<<2)>>2];if((r|0)>=(k|0)){break p}n=g+1|0;n=o[q+(o[h+(((n>>>0)%3|0?n:g+ -2|0)<<2)>>2]<<2)>>2];if((n|0)>=(k|0)){break p}g=o[q+(o[h+(g+((g>>>0)%3|0?-1:2)<<2)>>2]<<2)>>2];if((g|0)>=(k|0)){break p}if((e|0)>=1){q=o[(i+16|0)+u(f,12)>>2];g=u(e,g);n=u(e,n);r=u(e,r);h=0;while(1){o[q+(h<<2)>>2]=(o[(g+h<<2)+c>>2]+o[(h+n<<2)+c>>2]|0)-o[(h+r<<2)+c>>2];h=h+1|0;if((h|0)!=(e|0)){continue}break}}g=4;f=f+1|0;if((f|0)==4){break o}}q:{if(l&1){h=-1;g=d+1|0;d=(g>>>0)%3|0?g:d+ -2|0;if((d|0)==-1|o[o[p>>2]+(d>>>3&536870908)>>2]>>>(d&31)&1){break q}d=o[o[o[p+64>>2]+12>>2]+(d<<2)>>2];if((d|0)==-1){break q}g=d+1|0;h=(g>>>0)%3|0?g:d+ -2|0;break q}h=-1;d=((d>>>0)%3|0?-1:2)+d|0;if((d|0)==-1|o[o[p>>2]+(d>>>3&536870908)>>2]>>>(d&31)&1){break q}d=o[o[o[p+64>>2]+12>>2]+(d<<2)>>2];if((d|0)==-1){break q}if((d>>>0)%3){h=d+ -1|0;break q}h=d+2|0}r:{if((h|0)==(j|0)){break r}d=h;g=(h|0)!=-1;h=(g|l^-1)&1;d=h?d:-1;l=g&l;if(!((m|0)==-1|h)){if(o[o[p>>2]+(v<<2)>>2]&w){break r}g=o[o[o[p+64>>2]+12>>2]+(m<<2)>>2];if((g|0)==-1){break r}l=0;if((g>>>0)%3){d=g+ -1|0}else{d=g+2|0}}if((d|0)!=-1){continue}}break}g=f;if((g|0)<1){break n}}m=(e|0)<1;if(!m){ml(s,0,C)}d=g+ -1|0;l=(d<<2)+t|0;d=u(d,12)+a|0;q=d+60|0;v=o[d- -64>>2];d=0;w=o[i>>2];j=0;f=0;while(1){h=o[l>>2];o[l>>2]=h+1;if(v>>>0<=h>>>0){break i}s:{if(o[o[q>>2]+(h>>>3&536870908)>>2]>>>(h&31)&1){break s}f=f+1|0;if(m){break s}x=o[(i+16|0)+u(j,12)>>2];h=0;while(1){r=h<<2;n=r+w|0;o[n>>2]=o[n>>2]+o[r+x>>2];h=h+1|0;if((h|0)!=(e|0)){continue}break}}j=j+1|0;if((g|0)!=(j|0)){continue}break}l=u(e,k);g=l;if(!f){break m}h=0;if((e|0)>0){break l}break k}g=u(e,k)}if(o[a+8>>2]<1){break j}l=(u(k+ -1|0,e)<<2)+c|0;h=0;while(1){d=h<<2;f=o[d+l>>2];m=o[a+16>>2];t:{if((f|0)>(m|0)){j=o[a+32>>2];o[d+j>>2]=m;break t}j=o[a+32>>2];d=d+j|0;m=o[a+12>>2];if((f|0)<(m|0)){o[d>>2]=m;break t}o[d>>2]=f}h=h+1|0;f=o[a+8>>2];if((h|0)<(f|0)){continue}break}d=0;if((f|0)<1){break j}f=g<<2;h=f+c|0;l=b+f|0;while(1){g=d<<2;f=g+h|0;g=o[g+l>>2]+o[g+j>>2]|0;o[f>>2]=g;u:{if((g|0)>o[a+16>>2]){g=g-o[a+20>>2]|0}else{if((g|0)>=o[a+12>>2]){break u}g=g+o[a+20>>2]|0}o[f>>2]=g}d=d+1|0;if((d|0)>2]){continue}break}break j}Ok();D()}while(1){d=(h<<2)+s|0;o[d>>2]=o[d>>2]/(f|0);h=h+1|0;if((h|0)!=(e|0)){continue}break}}if(o[a+8>>2]<1){break j}h=0;while(1){d=h<<2;f=o[d+s>>2];g=o[a+16>>2];v:{if((f|0)>(g|0)){j=o[a+32>>2];o[d+j>>2]=g;break v}j=o[a+32>>2];d=d+j|0;g=o[a+12>>2];if((f|0)<(g|0)){o[d>>2]=g;break v}o[d>>2]=f}h=h+1|0;f=o[a+8>>2];if((h|0)<(f|0)){continue}break}d=0;if((f|0)<1){break j}f=l<<2;h=f+c|0;l=b+f|0;while(1){g=d<<2;f=g+h|0;g=o[g+l>>2]+o[g+j>>2]|0;o[f>>2]=g;w:{if((g|0)>o[a+16>>2]){g=g-o[a+20>>2]|0}else{if((g|0)>=o[a+12>>2]){break w}g=g+o[a+20>>2]|0}o[f>>2]=g}d=d+1|0;if((d|0)>2]){continue}break}}d=1;k=k+1|0;if((A|0)!=(k|0)){continue}break}}a=o[i>>2];if(a){o[i+4>>2]=a;jl(a)}jl(t);a=o[i+52>>2];if(a){o[i+56>>2]=a;jl(a)}a=o[i+40>>2];if(a){o[i+44>>2]=a;jl(a)}a=o[i+28>>2];if(a){o[i+32>>2]=a;jl(a)}a=o[i+16>>2];if(a){o[i+20>>2]=a;jl(a)}R=i- -64|0;return d|0}Nk();D()}function ef(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,p=0,q=0,r=0,s=0,t=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0;h=R+ -64|0;R=h;o[a+8>>2]=e;f=a+32|0;j=o[f>>2];d=o[a+36>>2]-j>>2;a:{if(d>>>0>>0){Ia(f,e-d|0);break a}if(d>>>0<=e>>>0){break a}o[a+36>>2]=j+(e<<2)}o[h+56>>2]=0;o[h+60>>2]=0;o[h+48>>2]=0;o[h+52>>2]=0;o[h+40>>2]=0;o[h+44>>2]=0;d=h+32|0;o[d>>2]=0;o[d+4>>2]=0;o[h+24>>2]=0;o[h+28>>2]=0;o[h+16>>2]=0;o[h+20>>2]=0;o[h>>2]=0;f=0;if(e){Dd(h+16|0,e,h);i=o[h+28>>2];f=o[d>>2]}o[h>>2]=0;d=f-i>>2;b:{if(d>>>0>=e>>>0){if(d>>>0<=e>>>0){break b}o[h+32>>2]=(e<<2)+i;break b}Dd(h+16|12,e-d|0,h)}o[h>>2]=0;f=o[h+40>>2];d=o[h+44>>2]-f>>2;c:{if(d>>>0>=e>>>0){if(d>>>0<=e>>>0){break c}o[h+44>>2]=f+(e<<2);break c}Dd(h+40|0,e-d|0,h)}o[h>>2]=0;f=o[h+52>>2];d=o[h+56>>2]-f>>2;d:{if(d>>>0>=e>>>0){if(d>>>0<=e>>>0){break d}o[h+56>>2]=f+(e<<2);break d}Dd(h+52|0,e-d|0,h)}e:{if(o[a+8>>2]<=0){break e}g=o[h+16>>2];i=0;while(1){d=i<<2;f=o[d+g>>2];l=o[a+16>>2];f:{if((f|0)>(l|0)){j=o[a+32>>2];o[d+j>>2]=l;break f}j=o[a+32>>2];d=d+j|0;l=o[a+12>>2];if((f|0)<(l|0)){o[d>>2]=l;break f}o[d>>2]=f}i=i+1|0;d=o[a+8>>2];if((i|0)<(d|0)){continue}break}if((d|0)<1){break e}f=0;while(1){g=f<<2;d=g+c|0;g=o[b+g>>2]+o[g+j>>2]|0;o[d>>2]=g;g:{if((g|0)>o[a+16>>2]){g=g-o[a+20>>2]|0}else{if((g|0)>=o[a+12>>2]){break g}g=g+o[a+20>>2]|0}o[d>>2]=g}f=f+1|0;if((f|0)>2]){continue}break}}z=o[a+52>>2];x=o[a+48>>2];w=yk(16);d=w;o[d>>2]=0;o[d+4>>2]=0;o[d+8>>2]=0;o[d+12>>2]=0;o[h+8>>2]=0;o[h>>2]=0;o[h+4>>2]=0;h:{if(e){if(e>>>0>=1073741824){break h}d=e<<2;r=yk(d);o[h>>2]=r;f=d+r|0;o[h+8>>2]=f;ml(r,0,d);o[h+4>>2]=f}j=1;d=o[a+56>>2];y=o[d>>2];d=o[d+4>>2]-y|0;i:{if((d|0)<5){break i}d=d>>2;A=(d|0)>2?d:2;B=d>>>0>1?d:1;C=e<<2;l=1;while(1){j:{k:{l:{if((l|0)!=(B|0)){m:{n:{j=o[(l<<2)+y>>2];if((j|0)==-1){break n}m=o[x+12>>2];t=j+((j>>>0)%3|0?-1:2)|0;v=m+(t<<2)|0;k=1;f=0;d=j;o:{while(1){g=o[m+(d<<2)>>2];p:{if((g|0)==-1){break p}i=-1;q=o[z>>2];n=o[x>>2];s=o[q+(o[n+(g<<2)>>2]<<2)>>2];p=g+1|0;p=(p>>>0)%3|0?p:g+ -2|0;if((p|0)!=-1){p=o[n+(p<<2)>>2]}else{p=-1}g=g+((g>>>0)%3|0?-1:2)|0;if((g|0)!=-1){i=o[n+(g<<2)>>2]}if((s|0)>=(l|0)){break p}g=o[(p<<2)+q>>2];if((g|0)>=(l|0)){break p}i=o[q+(i<<2)>>2];if((i|0)>=(l|0)){break p}n=o[(h+16|0)+u(f,12)>>2];if((e|0)>=1){q=u(e,i);g=u(e,g);s=u(e,s);i=0;while(1){o[n+(i<<2)>>2]=(o[(i+q<<2)+c>>2]+o[(g+i<<2)+c>>2]|0)-o[(i+s<<2)+c>>2];i=i+1|0;if((i|0)!=(e|0)){continue}break}}g=4;f=f+1|0;if((f|0)==4){break o}}q:{if(k&1){n=d+1|0;d=(n>>>0)%3|0?n:d+ -2|0;g=-1;if((d|0)==-1){break q}d=o[m+(d<<2)>>2];g=-1;if((d|0)==-1){break q}g=d+1|0;g=(g>>>0)%3|0?g:d+ -2|0;break q}d=((d>>>0)%3|0?-1:2)+d|0;g=-1;if((d|0)==-1){break q}d=o[m+(d<<2)>>2];g=-1;if((d|0)==-1){break q}g=d+ -1|0;if((d>>>0)%3){break q}g=d+2|0}r:{if((g|0)==(j|0)){break r}d=g;g=(g|0)!=-1;i=(g|k^-1)&1;d=i?d:-1;k=g&k;if(!((t|0)==-1|i)){g=o[v>>2];if((g|0)==-1){break r}k=0;if((g>>>0)%3){d=g+ -1|0}else{d=g+2|0}}if((d|0)!=-1){continue}}break}g=f;if((g|0)<1){break n}}m=(e|0)<1;if(!m){ml(r,0,C)}d=g+ -1|0;k=(d<<2)+w|0;d=u(d,12)+a|0;n=d+60|0;q=o[d- -64>>2];j=0;s=o[h>>2];d=0;f=0;while(1){i=o[k>>2];o[k>>2]=i+1;if(q>>>0<=i>>>0){break i}s:{if(o[o[n>>2]+(i>>>3&536870908)>>2]>>>(i&31)&1){break s}f=f+1|0;if(m){break s}p=o[(h+16|0)+u(d,12)>>2];i=0;while(1){t=i<<2;v=t+s|0;o[v>>2]=o[v>>2]+o[p+t>>2];i=i+1|0;if((i|0)!=(e|0)){continue}break}}d=d+1|0;if((g|0)!=(d|0)){continue}break}g=u(e,l);d=g;if(!f){break m}i=0;if((e|0)>0){break l}break k}d=u(e,l)}if(o[a+8>>2]<1){break j}k=(u(l+ -1|0,e)<<2)+c|0;i=0;while(1){f=i<<2;g=o[f+k>>2];m=o[a+16>>2];t:{if((g|0)>(m|0)){j=o[a+32>>2];o[f+j>>2]=m;break t}j=o[a+32>>2];f=f+j|0;m=o[a+12>>2];if((g|0)<(m|0)){o[f>>2]=m;break t}o[f>>2]=g}i=i+1|0;g=o[a+8>>2];if((i|0)<(g|0)){continue}break}f=0;if((g|0)<1){break j}d=d<<2;i=d+c|0;k=b+d|0;while(1){g=f<<2;d=g+i|0;g=o[g+k>>2]+o[g+j>>2]|0;o[d>>2]=g;u:{if((g|0)>o[a+16>>2]){g=g-o[a+20>>2]|0}else{if((g|0)>=o[a+12>>2]){break u}g=g+o[a+20>>2]|0}o[d>>2]=g}f=f+1|0;if((f|0)>2]){continue}break}break j}Ok();D()}while(1){d=(i<<2)+r|0;o[d>>2]=o[d>>2]/(f|0);i=i+1|0;if((i|0)!=(e|0)){continue}break}}if(o[a+8>>2]<1){break j}i=0;while(1){d=i<<2;f=o[d+r>>2];k=o[a+16>>2];v:{if((f|0)>(k|0)){j=o[a+32>>2];o[d+j>>2]=k;break v}j=o[a+32>>2];d=d+j|0;k=o[a+12>>2];if((f|0)<(k|0)){o[d>>2]=k;break v}o[d>>2]=f}i=i+1|0;d=o[a+8>>2];if((i|0)<(d|0)){continue}break}f=0;if((d|0)<1){break j}d=g<<2;i=d+c|0;k=b+d|0;while(1){g=f<<2;d=g+i|0;g=o[g+k>>2]+o[g+j>>2]|0;o[d>>2]=g;w:{if((g|0)>o[a+16>>2]){g=g-o[a+20>>2]|0}else{if((g|0)>=o[a+12>>2]){break w}g=g+o[a+20>>2]|0}o[d>>2]=g}f=f+1|0;if((f|0)>2]){continue}break}}j=1;l=l+1|0;if((A|0)!=(l|0)){continue}break}}a=o[h>>2];if(a){o[h+4>>2]=a;jl(a)}jl(w);a=o[h+52>>2];if(a){o[h+56>>2]=a;jl(a)}a=o[h+40>>2];if(a){o[h+44>>2]=a;jl(a)}a=o[h+28>>2];if(a){o[h+32>>2]=a;jl(a)}a=o[h+16>>2];if(a){o[h+20>>2]=a;jl(a)}R=h- -64|0;return j|0}Nk();D()}function _j(a){var b=0,c=0,d=0,e=0,f=0,g=0,h=0,i=0;e=R-16|0;R=e;o[e+12>>2]=a;a:{if(a>>>0<=211){a=o[$j(11680,11872,e+12|0)>>2];break a}if(a>>>0>=4294967292){bk();D()}f=(a>>>0)/210|0;d=u(f,210);o[e+8>>2]=a-d;g=$j(11872,12064,e+8|0)-11872>>2;b:{while(1){a=o[(g<<2)+11872>>2]+d|0;d=5;c:{d:{e:{while(1){if((d|0)==47){break e}b=o[(d<<2)+11680>>2];c=(a>>>0)/(b>>>0)|0;h=c>>>0>>0;i=h?a:i;d=d+1|0;b=h?1:(u(b,c)|0)==(a|0)?7:0;if(!b){continue}break}d=b+ -4|0;if(d>>>0>3){break b}switch(d-1|0){case 0:case 1:break b;case 2:break d;default:break e}}d=211;while(1){b=(a>>>0)/(d>>>0)|0;if(b>>>0>>0){break c}if((u(b,d)|0)==(a|0)){break d}b=d+10|0;c=(a>>>0)/(b>>>0)|0;if(c>>>0>>0){break c}if((u(b,c)|0)==(a|0)){break d}b=d+12|0;c=(a>>>0)/(b>>>0)|0;if(c>>>0>>0){break c}if((u(b,c)|0)==(a|0)){break d}b=d+16|0;c=(a>>>0)/(b>>>0)|0;if(c>>>0>>0){break c}if((u(b,c)|0)==(a|0)){break d}b=d+18|0;c=(a>>>0)/(b>>>0)|0;if(c>>>0>>0){break c}if((u(b,c)|0)==(a|0)){break d}b=d+22|0;c=(a>>>0)/(b>>>0)|0;if(c>>>0>>0){break c}if((u(b,c)|0)==(a|0)){break d}b=d+28|0;c=(a>>>0)/(b>>>0)|0;if(c>>>0>>0){break c}if((u(b,c)|0)==(a|0)){break d}b=d+30|0;c=(a>>>0)/(b>>>0)|0;if(c>>>0>>0){break c}if((u(b,c)|0)==(a|0)){break d}b=d+36|0;c=(a>>>0)/(b>>>0)|0;if(c>>>0>>0){break c}if((u(b,c)|0)==(a|0)){break d}b=d+40|0;c=(a>>>0)/(b>>>0)|0;if(c>>>0>>0){break c}if((u(b,c)|0)==(a|0)){break d}b=d+42|0;c=(a>>>0)/(b>>>0)|0;if(c>>>0>>0){break c}if((u(b,c)|0)==(a|0)){break d}b=d+46|0;c=(a>>>0)/(b>>>0)|0;if(c>>>0>>0){break c}if((u(b,c)|0)==(a|0)){break d}b=d+52|0;c=(a>>>0)/(b>>>0)|0;if(c>>>0>>0){break c}if((u(b,c)|0)==(a|0)){break d}b=d+58|0;c=(a>>>0)/(b>>>0)|0;if(c>>>0>>0){break c}if((u(b,c)|0)==(a|0)){break d}b=d+60|0;c=(a>>>0)/(b>>>0)|0;if(c>>>0>>0){break c}if((u(b,c)|0)==(a|0)){break d}b=d+66|0;c=(a>>>0)/(b>>>0)|0;if(c>>>0>>0){break c}if((u(b,c)|0)==(a|0)){break d}b=d+70|0;c=(a>>>0)/(b>>>0)|0;if(c>>>0>>0){break c}if((u(b,c)|0)==(a|0)){break d}b=d+72|0;c=(a>>>0)/(b>>>0)|0;if(c>>>0>>0){break c}if((u(b,c)|0)==(a|0)){break d}b=d+78|0;c=(a>>>0)/(b>>>0)|0;if(c>>>0>>0){break c}if((u(b,c)|0)==(a|0)){break d}b=d+82|0;c=(a>>>0)/(b>>>0)|0;if(c>>>0>>0){break c}if((u(b,c)|0)==(a|0)){break d}b=d+88|0;c=(a>>>0)/(b>>>0)|0;if(c>>>0>>0){break c}if((u(b,c)|0)==(a|0)){break d}b=d+96|0;c=(a>>>0)/(b>>>0)|0;if(c>>>0>>0){break c}if((u(b,c)|0)==(a|0)){break d}b=d+100|0;c=(a>>>0)/(b>>>0)|0;if(c>>>0>>0){break c}if((u(b,c)|0)==(a|0)){break d}b=d+102|0;c=(a>>>0)/(b>>>0)|0;if(c>>>0>>0){break c}if((u(b,c)|0)==(a|0)){break d}b=d+106|0;c=(a>>>0)/(b>>>0)|0;if(c>>>0>>0){break c}if((u(b,c)|0)==(a|0)){break d}b=d+108|0;c=(a>>>0)/(b>>>0)|0;if(c>>>0>>0){break c}if((u(b,c)|0)==(a|0)){break d}b=d+112|0;c=(a>>>0)/(b>>>0)|0;if(c>>>0>>0){break c}if((u(b,c)|0)==(a|0)){break d}b=d+120|0;c=(a>>>0)/(b>>>0)|0;if(c>>>0>>0){break c}if((u(b,c)|0)==(a|0)){break d}b=d+126|0;c=(a>>>0)/(b>>>0)|0;if(c>>>0>>0){break c}if((u(b,c)|0)==(a|0)){break d}b=d+130|0;c=(a>>>0)/(b>>>0)|0;if(c>>>0>>0){break c}if((u(b,c)|0)==(a|0)){break d}b=d+136|0;c=(a>>>0)/(b>>>0)|0;if(c>>>0>>0){break c}if((u(b,c)|0)==(a|0)){break d}b=d+138|0;c=(a>>>0)/(b>>>0)|0;if(c>>>0>>0){break c}if((u(b,c)|0)==(a|0)){break d}b=d+142|0;c=(a>>>0)/(b>>>0)|0;if(c>>>0>>0){break c}if((u(b,c)|0)==(a|0)){break d}b=d+148|0;c=(a>>>0)/(b>>>0)|0;if(c>>>0>>0){break c}if((u(b,c)|0)==(a|0)){break d}b=d+150|0;c=(a>>>0)/(b>>>0)|0;if(c>>>0>>0){break c}if((u(b,c)|0)==(a|0)){break d}b=d+156|0;c=(a>>>0)/(b>>>0)|0;if(c>>>0>>0){break c}if((u(b,c)|0)==(a|0)){break d}b=d+162|0;c=(a>>>0)/(b>>>0)|0;if(c>>>0>>0){break c}if((u(b,c)|0)==(a|0)){break d}b=d+166|0;c=(a>>>0)/(b>>>0)|0;if(c>>>0>>0){break c}if((u(b,c)|0)==(a|0)){break d}b=d+168|0;c=(a>>>0)/(b>>>0)|0;if(c>>>0>>0){break c}if((u(b,c)|0)==(a|0)){break d}b=d+172|0;c=(a>>>0)/(b>>>0)|0;if(c>>>0>>0){break c}if((u(b,c)|0)==(a|0)){break d}b=d+178|0;c=(a>>>0)/(b>>>0)|0;if(c>>>0>>0){break c}if((u(b,c)|0)==(a|0)){break d}b=d+180|0;c=(a>>>0)/(b>>>0)|0;if(c>>>0>>0){break c}if((u(b,c)|0)==(a|0)){break d}b=d+186|0;c=(a>>>0)/(b>>>0)|0;if(c>>>0>>0){break c}if((u(b,c)|0)==(a|0)){break d}b=d+190|0;c=(a>>>0)/(b>>>0)|0;if(c>>>0>>0){break c}if((u(b,c)|0)==(a|0)){break d}b=d+192|0;c=(a>>>0)/(b>>>0)|0;if(c>>>0>>0){break c}if((u(b,c)|0)==(a|0)){break d}b=d+196|0;c=(a>>>0)/(b>>>0)|0;if(c>>>0>>0){break c}if((u(b,c)|0)==(a|0)){break d}b=d+198|0;c=(a>>>0)/(b>>>0)|0;if(c>>>0>>0){break c}if((u(b,c)|0)==(a|0)){break d}b=d+208|0;c=(a>>>0)/(b>>>0)|0;if(c>>>0>>0){break c}d=d+210|0;if((u(b,c)|0)!=(a|0)){continue}break}}d=g+1|0;a=(d|0)==48;g=a?0:d;f=a+f|0;d=u(f,210);continue}break}o[e+12>>2]=a;break a}o[e+12>>2]=a;a=i}R=e+16|0;return a}function Gj(a,b,c,d){var e=0,f=0,g=0,h=0,i=0,j=0,k=0,q=0,r=0,s=0,v=0,w=0,x=0,y=0,z=0,A=0;f=R-80|0;R=f;o[f+76>>2]=12431;A=f+55|0;x=f+56|0;a:{b:{c:while(1){d:{if((s|0)<0){break d}if((e|0)>(2147483647-s|0)){o[3314]=61;s=-1;break d}s=e+s|0}e:{f:{g:{h:{i:{j:{k:{l:{m:{n:{o:{p:{q:{j=o[f+76>>2];e=j;i=p[e|0];if(i){while(1){r:{s:{g=i&255;t:{if(!g){i=e;break t}if((g|0)!=37){break s}i=e;while(1){if(p[e+1|0]!=37){break t}g=e+2|0;o[f+76>>2]=g;i=i+1|0;h=p[e+2|0];e=g;if((h|0)==37){continue}break}}e=i-j|0;if(a){Hj(a,j,e)}if(e){continue c}v=-1;i=1;g=f;k=!Bj(m[o[f+76>>2]+1|0]);e=o[f+76>>2];if(!(k|p[e+2|0]!=36)){v=m[e+1|0]+ -48|0;y=1;i=3}e=i+e|0;o[g+76>>2]=e;i=0;w=m[e|0];h=w+ -32|0;u:{if(h>>>0>31){g=e;break u}g=e;h=1<>2]=g;i=h|i;w=m[e+1|0];h=w+ -32|0;if(h>>>0>31){break u}e=g;h=1<>2];if(p[e+2|0]!=36){break x}o[((m[e+1|0]<<2)+d|0)+ -192>>2]=10;r=o[((m[e+1|0]<<3)+c|0)+ -384>>2];y=1;e=e+3|0;break w}if(y){break b}y=0;r=0;if(a){e=o[b>>2];o[b>>2]=e+4;r=o[e>>2]}e=o[f+76>>2]+1|0}o[k+76>>2]=e;if((r|0)>-1){break v}r=0-r|0;i=i|8192;break v}r=Ij(f+76|0);if((r|0)<0){break b}e=o[f+76>>2]}h=-1;y:{if(p[e|0]!=46){break y}if(p[e+1|0]==42){z:{if(!Bj(m[e+2|0])){break z}e=o[f+76>>2];if(p[e+3|0]!=36){break z}o[((m[e+2|0]<<2)+d|0)+ -192>>2]=10;h=o[((m[e+2|0]<<3)+c|0)+ -384>>2];e=e+4|0;o[f+76>>2]=e;break y}if(y){break b}if(a){e=o[b>>2];o[b>>2]=e+4;h=o[e>>2]}else{h=0}e=o[f+76>>2]+2|0;o[f+76>>2]=e;break y}o[f+76>>2]=e+1;h=Ij(f+76|0);e=o[f+76>>2]}g=0;while(1){z=g;q=-1;if(m[e|0]+ -65>>>0>57){break a}w=e+1|0;o[f+76>>2]=w;g=m[e|0];e=w;g=p[(g+u(z,58)|0)+11087|0];if(g+ -1>>>0<8){continue}break}if(!g){break a}A:{B:{C:{if((g|0)==19){if((v|0)<=-1){break C}break a}if((v|0)<0){break B}o[(v<<2)+d>>2]=g;e=(v<<3)+c|0;g=o[e+4>>2];o[f+64>>2]=o[e>>2];o[f+68>>2]=g}e=0;if(!a){continue c}break A}if(!a){break e}Jj(f- -64|0,g,b);w=o[f+76>>2]}k=i&-65537;i=i&8192?k:i;q=0;v=11120;g=x;e=m[w+ -1|0];e=z?(e&15)==3?e&-33:e:e;w=e+ -88|0;if(w>>>0<=32){break r}D:{E:{F:{G:{k=e+ -65|0;if(k>>>0>6){if((e|0)!=83){break f}if(!h){break G}g=o[f+64>>2];break E}switch(k-1|0){case 1:break F;case 0:case 2:break f;default:break q}}e=0;Kj(a,32,r,0,i);break D}o[f+12>>2]=0;o[f+8>>2]=o[f+64>>2];o[f+64>>2]=f+8;h=-1;g=f+8|0}e=0;H:{while(1){j=o[g>>2];if(!j){break H}j=Dj(f+4|0,j);k=(j|0)<0;if(!(k|j>>>0>h-e>>>0)){g=g+4|0;e=e+j|0;if(h>>>0>e>>>0){continue}break H}break}q=-1;if(k){break a}}Kj(a,32,r,e,i);if(!e){e=0;break D}h=0;g=o[f+64>>2];while(1){j=o[g>>2];if(!j){break D}j=Dj(f+4|0,j);h=j+h|0;if((h|0)>(e|0)){break D}Hj(a,f+4|0,j);g=g+4|0;if(h>>>0>>0){continue}break}}Kj(a,32,r,e,i^8192);e=(r|0)>(e|0)?r:e;continue c}g=e+1|0;o[f+76>>2]=g;i=p[e+1|0];e=g;continue}break}switch(w-1|0){case 28:break i;case 21:break j;case 23:break l;case 22:break m;case 11:case 16:break n;case 10:break o;case 26:break p;case 8:case 12:case 13:case 14:break q;case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 9:case 15:case 17:case 18:case 19:case 20:case 24:case 25:case 27:case 29:case 30:break f;default:break k}}q=s;if(a){break a}if(!y){break e}e=1;while(1){a=o[(e<<2)+d>>2];if(a){Jj((e<<3)+c|0,a,b);q=1;e=e+1|0;if((e|0)!=10){continue}break a}break}q=1;if(e>>>0>9){break a}while(1){a=e;e=e+1|0;if(o[(e<<2)+d>>2]?0:(e|0)!=10){continue}break}q=a>>>0<9?-1:1;break a}e=l[274](a,t[f+64>>3],r,h,i,e)|0;continue}e=o[f+64>>2];j=e?e:11130;e=Uj(j,h);g=e?e:h+j|0;i=k;h=e?e-j|0:h;break f}m[f+55|0]=o[f+64>>2];h=1;j=A;i=k;break f}k=o[f+68>>2];e=k;j=o[f+64>>2];if((e|0)<-1?1:(e|0)<=-1?j>>>0>4294967295?0:1:0){e=0-(e+(0>>0)|0)|0;j=0-j|0;o[f+64>>2]=j;o[f+68>>2]=e;q=1;v=11120;break h}if(i&2048){q=1;v=11121;break h}q=i&1;v=q?11122:11120;break h}j=Lj(o[f+64>>2],o[f+68>>2],x);if(!(i&8)){break g}e=x-j|0;h=(h|0)>(e|0)?h:e+1|0;break g}h=h>>>0>8?h:8;i=i|8;e=120}j=Mj(o[f+64>>2],o[f+68>>2],x,e&32);if(!(i&8)|!(o[f+64>>2]|o[f+68>>2])){break g}v=(e>>>4|0)+11120|0;q=2;break g}e=0;g=z&255;if(g>>>0>7){continue}I:{switch(g-1|0){default:o[o[f+64>>2]>>2]=s;continue;case 0:o[o[f+64>>2]>>2]=s;continue;case 1:g=o[f+64>>2];o[g>>2]=s;o[g+4>>2]=s>>31;continue;case 2:n[o[f+64>>2]>>1]=s;continue;case 3:m[o[f+64>>2]]=s;continue;case 5:o[o[f+64>>2]>>2]=s;continue;case 4:continue;case 6:break I}}g=o[f+64>>2];o[g>>2]=s;o[g+4>>2]=s>>31;continue}j=o[f+64>>2];e=o[f+68>>2];v=11120}j=Nj(j,e,x)}i=(h|0)>-1?i&-65537:i;e=o[f+64>>2];k=o[f+68>>2];J:{if(!(!!(e|k)|h)){j=x;h=0;break J}e=!(e|k)+(x-j|0)|0;h=(h|0)>(e|0)?h:e}}k=g-j|0;h=(h|0)<(k|0)?k:h;g=h+q|0;e=(r|0)<(g|0)?g:r;Kj(a,32,e,g,i);Hj(a,v,q);Kj(a,48,e,g,i^65536);Kj(a,48,h,k,0);Hj(a,j,k);Kj(a,32,e,g,i^8192);continue}break}q=0;break a}q=-1}R=f+80|0;return q}function Wg(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,s=0,t=0,v=0;g=R+ -64|0;R=g;o[a+132>>2]=0;if(o[a+148>>2]){c=o[a+144>>2];if(c){while(1){d=o[c>>2];jl(c);c=d;if(d){continue}break}}o[a+144>>2]=0;d=o[a+140>>2];if(d){c=0;while(1){o[o[a+136>>2]+(c<<2)>>2]=0;c=c+1|0;if((d|0)!=(c|0)){continue}break}}o[a+148>>2]=0}a:{if(!Xg(1,g+52|0,o[o[a+4>>2]+32>>2])){break a}o[a+156>>2]=o[g+52>>2];if(!Xg(1,g+48|0,o[o[a+4>>2]+32>>2])){break a}f=o[g+48>>2];if(f>>>0>1431655765|r[a+156>>2]>u(f,3)>>>0){break a}d=o[o[a+4>>2]+32>>2];j=o[d+16>>2];e=o[d+12>>2];c=o[d+20>>2];if((e|0)<(c|0)?1:(e|0)<=(c|0)?r[d+8>>2]>j>>>0?0:1:0){break a}h=p[j+o[d>>2]|0];j=j+1|0;if(j>>>0<1){c=c+1|0}o[d+16>>2]=j;o[d+20>>2]=c;if(!Xg(1,g+44|0,d)){break a}k=o[g+44>>2];if(f>>>0>>0|f>>>0>k+((k>>>0)/3|0)>>>0){break a}if(!Xg(1,g+40|0,o[o[a+4>>2]+32>>2])){break a}e=o[g+40>>2];if(e>>>0>k>>>0){break a}o[a+28>>2]=o[a+24>>2];c=yk(88);Ci(c);d=o[a+8>>2];o[a+8>>2]=c;j=a+8|0;if(d){za(j,d);if(!o[j>>2]){break a}}b=o[a+160>>2];o[a+164>>2]=b;b:{c:{d:{e:{f:{if(o[a+168>>2]-b>>2>>>0>=f>>>0){break f}if(f>>>0>=1073741824){break e}c=f<<2;d=yk(c);o[a+164>>2]=d;o[a+160>>2]=d;o[a+168>>2]=c+d;if(!b){break f}jl(b)}b=o[a+172>>2];o[a+176>>2]=b;g:{if(o[a+180>>2]-b>>2>>>0>=f>>>0){break g}if(f>>>0>=1073741824){break d}c=f<<2;d=yk(c);o[a+176>>2]=d;o[a+172>>2]=d;o[a+180>>2]=c+d;if(!b){break g}jl(b)}o[a+92>>2]=-1;o[a+84>>2]=-1;o[a+88>>2]=-1;o[a+40>>2]=o[a+36>>2];o[a- -64>>2]=0;o[a+52>>2]=o[a+48>>2];o[a+76>>2]=o[a+72>>2];n=a+216|0;d=o[a+220>>2];b=o[a+216>>2];if((d|0)==(b|0)){break c}while(1){c=o[d+ -12>>2];if(c){o[d+ -8>>2]=c;jl(c)}c=o[d+ -28>>2];if(c){o[d+ -24>>2]=c;jl(c)}c=d+ -144|0;i=o[d+ -40>>2];if(i){o[d+ -36>>2]=i;jl(i)}Yg(d+ -140|0);d=c;if((b|0)!=(d|0)){continue}break}d=o[n>>2];break b}db(8832);D()}db(8832);D()}d=b}o[a+220>>2]=b;c=(b-d|0)/144|0;h:{if(c>>>0>>0){Zg(n,h-c|0);break h}if(c>>>0<=h>>>0){break h}c=d+u(h,144)|0;if((c|0)!=(b|0)){while(1){d=o[b+ -12>>2];if(d){o[b+ -8>>2]=d;jl(d)}d=o[b+ -28>>2];if(d){o[b+ -24>>2]=d;jl(d)}d=b+ -144|0;i=o[b+ -40>>2];if(i){o[b+ -36>>2]=i;jl(i)}Yg(b+ -140|0);b=d;if((b|0)!=(c|0)){continue}break}}o[a+220>>2]=c}b=0;if(!Mi(o[a+8>>2],f,o[a+156>>2]+e|0)){break a}d=o[a+156>>2];m[g|0]=1;eb(a+120|0,d+e|0,g);if((_g(a,o[o[a+4>>2]+32>>2])|0)==-1){break a}o[a+376>>2]=a;e=a+232|0;b=o[(l[o[o[a>>2]+32>>2]](a)|0)+32>>2];f=o[b>>2]+o[b+16>>2]|0;c=o[(l[o[o[a>>2]+32>>2]](a)|0)+32>>2];b=o[c+8>>2];d=o[c+16>>2];ti(e,f,b-d|0,q[o[(l[o[o[a>>2]+32>>2]](a)|0)+32>>2]+38>>1]);o[a+372>>2]=h;d=si(g);b=o[a+268>>2];o[a+304>>2]=o[a+264>>2];o[a+308>>2]=b;b=o[a+260>>2];o[a+296>>2]=o[a+256>>2];o[a+300>>2]=b;c=a+248|0;b=c;f=o[b+4>>2];o[a+288>>2]=o[b>>2];o[a+292>>2]=f;h=a+240|0;b=h;f=o[b+4>>2];o[a+280>>2]=o[b>>2];o[a+284>>2]=f;b=o[a+236>>2];f=a+272|0;o[f>>2]=o[a+232>>2];o[f+4>>2]=b;i:{j:{if(ui(f,1,g+56|0)){b=o[f+4>>2];o[e>>2]=o[f>>2];o[e+4>>2]=b;b=o[f+36>>2];o[e+32>>2]=o[f+32>>2];o[e+36>>2]=b;b=o[f+28>>2];o[e+24>>2]=o[f+24>>2];o[e+28>>2]=b;b=o[f+20>>2];o[e+16>>2]=o[f+16>>2];o[e+20>>2]=b;b=o[f+12>>2];o[e+8>>2]=o[f+8>>2];o[e+12>>2]=b;i=o[h>>2];b=o[c>>2];t=i-b|0;s=o[g+60>>2];v=o[h+4>>2];h=o[c+4>>2];c=v-(h+(i>>>0>>0)|0)|0;i=o[g+56>>2];if((s|0)==(c|0)&i>>>0<=t>>>0|s>>>0>>0){break j}}b=0;break i}h=h+s|0;i=b+i|0;if(i>>>0>>0){h=h+1|0}o[a+248>>2]=i;o[a+252>>2]=h;b=0;if(!Sf(a+312|0,e)){break i}if(!$g(e)){break i}c=o[e+36>>2];o[g+32>>2]=o[e+32>>2];o[g+36>>2]=c;c=o[e+28>>2];o[g+24>>2]=o[e+24>>2];o[g+28>>2]=c;c=o[e+20>>2];o[g+16>>2]=o[e+16>>2];o[g+20>>2]=c;c=o[e+12>>2];o[g+8>>2]=o[e+8>>2];o[g+12>>2]=c;c=o[e+4>>2];o[g>>2]=o[e>>2];o[g+4>>2]=c;h=ah(a,k);if((h|0)==-1){break i}c=o[o[a+4>>2]+32>>2];b=o[d+16>>2];e=b+o[d>>2]|0;d=o[d+8>>2];ti(c,e,d-b|0,q[c+38>>1]);k:{if(o[a+220>>2]==o[a+216>>2]){break k}b=o[j>>2];if(o[b+4>>2]==o[b>>2]){break k}d=0;while(1){if(bh(a,d)){d=d+3|0;b=o[j>>2];if(d>>>0>2]-o[b>>2]>>2>>>0){continue}break k}break}b=0;break i}if(p[a+308|0]){wi(f)}c=o[a+216>>2];if((c|0)!=o[a+220>>2]){b=0;while(1){e=u(b,144);Wi((e+c|0)+4|0,o[j>>2]);d=o[n>>2];f=e+d|0;c=o[f+132>>2];f=o[f+136>>2];if((c|0)!=(f|0)){while(1){Yi((d+e|0)+4|0,o[c>>2]);d=o[n>>2];c=c+4|0;if((f|0)!=(c|0)){continue}break}}Xi((d+e|0)+4|0);b=b+1|0;c=o[a+216>>2];if(b>>>0<(o[a+220>>2]-c|0)/144>>>0){continue}break}}b=o[a+8>>2];ch(a+184|0,o[b+28>>2]-o[b+24>>2]>>2);d=o[a+216>>2];if((d|0)!=o[a+220>>2]){c=0;while(1){b=u(c,144)+d|0;d=o[b+60>>2]-o[b+56>>2]>>2;e=b+104|0;b=o[a+8>>2];b=o[b+28>>2]-o[b+24>>2]>>2;ch(e,(d|0)<(b|0)?b:d);c=c+1|0;d=o[a+216>>2];if(c>>>0<(o[a+220>>2]-d|0)/144>>>0){continue}break}}b=dh(a,h)}}R=g- -64|0;return b|0}function dh(a,b){var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;d=R-48|0;R=d;c=o[o[a+4>>2]+44>>2];f=o[a+8>>2];e=o[f>>2];f=o[f+4>>2];o[d+40>>2]=0;o[d+32>>2]=0;o[d+36>>2]=0;f=(f-e>>2>>>0)/3|0;h=o[c+96>>2];e=(o[c+100>>2]-h|0)/12|0;a:{if(f>>>0>e>>>0){gh(c+96|0,f-e|0,d+32|0);break a}if(f>>>0>=e>>>0){break a}o[c+100>>2]=h+u(f,12)}b:{if(o[a+216>>2]==o[a+220>>2]){j=o[a+4>>2];c=o[j+44>>2];f=o[c+100>>2];l=o[c+96>>2];if((f|0)!=(l|0)){c=(f-l|0)/12|0;i=c>>>0>1?c:1;k=d+40|0;c=0;while(1){o[k>>2]=0;o[d+32>>2]=0;o[d+36>>2]=0;e=d;c:{d:{e:{h=u(c,3);if((h|0)==-1){f=-1;o[d+32>>2]=-1;g=0;break e}f=o[o[o[a+8>>2]>>2]+(h<<2)>>2];o[d+32>>2]=f;g=h+1|0;if((g|0)!=-1){break e}o[d+36>>2]=-1;h=0;break d}o[d+36>>2]=o[o[o[a+8>>2]>>2]+(g<<2)>>2];h=h+2|0;g=-1;if((h|0)==-1){break c}}g=o[o[o[a+8>>2]>>2]+(h<<2)>>2]}o[e+40>>2]=g;e=l+u(c,12)|0;o[e>>2]=f;o[e+4>>2]=o[d+36>>2];o[e+8>>2]=o[d+40>>2];c=c+1|0;if((i|0)!=(c|0)){continue}break}}o[o[j+4>>2]+80>>2]=b;c=1;break b}o[d+40>>2]=0;o[d+32>>2]=0;o[d+36>>2]=0;h=o[a+8>>2];b=o[h>>2];c=o[h+4>>2];o[d+24>>2]=0;o[d+16>>2]=0;o[d+20>>2]=0;f:{g:{h:{i:{j:{k:{l:{b=c-b|0;if(b){f=b>>2;if(f>>>0>=1073741824){break l}c=yk(b);o[d+16>>2]=c;f=c+(f<<2)|0;o[d+24>>2]=f;ml(c,0,b);o[d+20>>2]=f}if((o[h+28>>2]-o[h+24>>2]|0)<1){break g}while(1){f=o[o[h+24>>2]+(l<<2)>>2];m:{if((f|0)==-1){break m}n:{if(o[o[a+120>>2]+(l>>>3&536870908)>>2]>>>(l&31)&1){break n}b=o[a+220>>2];j=o[a+216>>2];if((b|0)==(j|0)){break n}m=(b-j|0)/144|0;i=((f>>>0)%3|0?-1:2)+f|0;g=0;while(1){n=f<<2;k=j+u(g,144)|0;b=o[n+o[o[k+68>>2]>>2]>>2];o:{if(!(o[o[k+16>>2]+(b>>>3&536870908)>>2]>>>(b&31)&1)){break o}b=f;c=-1;p:{if((i|0)==-1){break p}e=o[o[h+12>>2]+(i<<2)>>2];c=-1;if((e|0)==-1){break p}c=e+ -1|0;if((e>>>0)%3){break p}c=e+2|0}if((b|0)==(c|0)){break o}k=o[k+32>>2];n=o[k+n>>2];while(1){b=0;if((c|0)==-1){break f}if((n|0)!=o[k+(c<<2)>>2]){f=c;break n}b=f;c=((c>>>0)%3|0?-1:2)+c|0;e=-1;q:{if((c|0)==-1){break q}c=o[o[h+12>>2]+(c<<2)>>2];e=-1;if((c|0)==-1){break q}e=c+ -1|0;if((c>>>0)%3){break q}e=c+2|0}c=e;if((b|0)!=(c|0)){continue}break}}g=g+1|0;if(g>>>0>>0){continue}break}}b=o[d+36>>2];c=o[d+32>>2];g=b-c|0;j=g>>2;o[o[d+16>>2]+(f<<2)>>2]=j;i=o[d+40>>2];r:{if(i>>>0>b>>>0){o[b>>2]=f;o[d+36>>2]=b+4;break r}e=j+1|0;if(e>>>0>=1073741824){break k}i=i-c|0;k=i>>1;e=i>>2>>>0<536870911?k>>>0>>0?e:k:1073741823;b=0;s:{if(!e){break s}if(e>>>0>=1073741824){break j}b=yk(e<<2)}j=b+(j<<2)|0;o[j>>2]=f;e=b+(e<<2)|0;j=j+4|0;if((g|0)>=1){ll(b,c,g)}o[d+40>>2]=e;o[d+36>>2]=j;o[d+32>>2]=b;if(!c){break r}jl(c);h=o[a+8>>2]}if((f|0)==-1){break m}b=((f>>>0)%3|0?-1:2)+f|0;if((b|0)==-1){break m}b=o[o[h+12>>2]+(b<<2)>>2];if((b|0)==-1){break m}c=b+((b>>>0)%3|0?-1:2)|0;if((c|0)==-1){break m}e=f;if((c|0)==(f|0)){break m}while(1){b=c;t:{u:{c=o[a+220>>2];g=o[a+216>>2];if((c|0)==(g|0)){break u}j=(c-g|0)/144|0;c=0;while(1){i=o[(g+u(c,144)|0)+32>>2];k=b<<2;if(o[i+k>>2]==o[i+(e<<2)>>2]){c=c+1|0;if(c>>>0>>0){continue}break u}break}c=o[d+36>>2];e=o[d+32>>2];j=c-e|0;i=j>>2;o[k+o[d+16>>2]>>2]=i;k=o[d+40>>2];if(k>>>0>c>>>0){o[c>>2]=b;o[d+36>>2]=c+4;break t}g=i+1|0;if(g>>>0>=1073741824){break i}k=k-e|0;m=k>>1;g=k>>2>>>0<536870911?m>>>0>>0?g:m:1073741823;c=0;v:{if(!g){break v}if(g>>>0>=1073741824){break h}c=yk(g<<2)}i=c+(i<<2)|0;o[i>>2]=b;g=c+(g<<2)|0;i=i+4|0;if((j|0)>=1){ll(c,e,j)}o[d+40>>2]=g;o[d+36>>2]=i;o[d+32>>2]=c;if(!e){break t}jl(e);h=o[a+8>>2];break t}c=o[d+16>>2];o[c+(b<<2)>>2]=o[c+(e<<2)>>2]}if((b|0)==-1){break m}c=b+((b>>>0)%3|0?-1:2)|0;if((c|0)==-1){break m}c=o[o[h+12>>2]+(c<<2)>>2];if((c|0)==-1){break m}c=c+((c>>>0)%3|0?-1:2)|0;if((c|0)==-1){break m}e=b;if((c|0)!=(f|0)){continue}break}}l=l+1|0;if((l|0)>2]-o[h+24>>2]>>2){continue}break}break g}Nk();D()}Nk();D()}db(8832);D()}Nk();D()}db(8832);D()}f=o[a+4>>2];a=o[f+44>>2];b=o[a+100>>2];a=o[a+96>>2];if((b|0)!=(a|0)){b=(b-a|0)/12|0;e=b>>>0>1?b:1;c=0;h=o[d+16>>2];while(1){l=d+8|0;g=u(c,12);b=g+h|0;o[l>>2]=o[b+8>>2];j=o[b+4>>2];i=o[b>>2];o[d>>2]=i;o[d+4>>2]=j;b=a+g|0;o[b>>2]=i;o[b+4>>2]=o[d+4>>2];o[b+8>>2]=o[l>>2];c=c+1|0;if((e|0)!=(c|0)){continue}break}}o[o[f+4>>2]+80>>2]=o[d+36>>2]-o[d+32>>2]>>2;b=1}c=b;a=o[d+16>>2];if(a){o[d+20>>2]=a;jl(a)}a=o[d+32>>2];if(!a){break b}o[d+36>>2]=a;jl(a)}R=d+48|0;return c}function Re(a,b,c,d){var e=0,f=0,g=0,h=0,i=v(0),j=0,k=0;a:{b:{if(!d){break b}e=o[a+28>>2]+ -1|0;if(e>>>0>10){break b}c:{d:{e:{switch(e-1|0){default:e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){g=o[o[a>>2]>>2];e=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=g+e|0;while(1){e=(f<<3)+d|0;h=m[b|0];o[e>>2]=h;o[e+4>>2]=h>>31;b=b+1|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 0:e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){g=o[o[a>>2]>>2];e=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=g+e|0;while(1){e=(f<<3)+d|0;o[e>>2]=p[b|0];o[e+4>>2]=0;b=b+1|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 1:e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){g=o[o[a>>2]>>2];e=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=g+e|0;while(1){e=(f<<3)+d|0;h=n[b>>1];o[e>>2]=h;o[e+4>>2]=h>>31;b=b+2|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 2:e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){g=o[o[a>>2]>>2];e=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=g+e|0;while(1){e=(f<<3)+d|0;o[e>>2]=q[b>>1];o[e+4>>2]=0;b=b+2|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 3:e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){g=o[o[a>>2]>>2];e=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=g+e|0;while(1){e=(f<<3)+d|0;h=o[b>>2];o[e>>2]=h;o[e+4>>2]=h>>31;b=b+4|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 4:e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){g=o[o[a>>2]>>2];e=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=g+e|0;while(1){e=(f<<3)+d|0;o[e>>2]=o[b>>2];o[e+4>>2]=0;b=b+4|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 5:e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){g=o[o[a>>2]>>2];e=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=g+e|0;while(1){h=o[b+4>>2];e=(f<<3)+d|0;o[e>>2]=o[b>>2];o[e+4>>2]=h;b=b+8|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 6:e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){g=o[o[a>>2]>>2];e=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=g+e|0;while(1){h=o[b+4>>2];e=(f<<3)+d|0;o[e>>2]=o[b>>2];o[e+4>>2]=h;b=b+8|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 7:e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24<1){break c}g=o[o[a>>2]>>2];e=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=g+e|0;while(1){e=(f<<3)+d|0;g=e;i=s[b>>2];f:{if(v(w(i))=v(1)?i>v(0)?~~v(y(v(A(v(i/v(4294967296)))),v(4294967296)))>>>0:~~v(B(v(v(i-v(~~i>>>0>>>0))/v(4294967296))))>>>0:0;k=~~i>>>0;break f}h=-2147483648;k=0}o[g>>2]=k;o[e+4>>2]=h;b=b+4|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}break c;case 8:e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24<1){break d}g=o[o[a>>2]>>2];e=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=g+e|0;while(1){e=(f<<3)+d|0;g=e;j=t[b>>3];g:{if(w(j)<0x8000000000000000){h=w(j)>=1?j>0?~~y(A(j/4294967296),4294967295)>>>0:~~B((j- +(~~j>>>0>>>0))/4294967296)>>>0:0;k=~~j>>>0;break g}h=-2147483648;k=0}o[g>>2]=k;o[e+4>>2]=h;b=b+8|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}break d;case 9:break e}}e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){g=o[o[a>>2]>>2];e=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=g+e|0;while(1){e=(f<<3)+d|0;o[e>>2]=p[b|0];o[e+4>>2]=0;b=b+1|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}ml((e<<3)+d|0,0,c-e<<3);break b}if((e|0)>=(c|0)){break b}break a}if((e|0)>=(c|0)){break b}ml((e<<3)+d|0,0,c-e<<3)}return}ml((e<<3)+d|0,0,c-e<<3)}function Yh(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,s=0,t=0,u=0;c=R-32|0;R=c;a:{if(!Zh(1,c+28|0,o[a+32>>2])){break a}if(!Zh(1,c+24|0,o[a+32>>2])){break a}n=o[c+28>>2];if(n>>>0>1431655765){break a}f=Ol(n,0,3,0);b=T;u=o[c+24>>2];if(!b&f>>>0>>0|b>>>0<0){break a}d=o[a+32>>2];g=o[d+16>>2];e=o[d+12>>2];b=o[d+20>>2];if((e|0)<(b|0)?1:(e|0)<=(b|0)?r[d+8>>2]>g>>>0?0:1:0){break a}h=p[g+o[d>>2]|0];f=b;k=g+1|0;if(k>>>0<1){f=f+1|0}o[d+16>>2]=k;o[d+20>>2]=f;b:{if(!h){if(!_h(a,n)){break a}break b}i=d+16|0;c:{if(u>>>0<=255){if(!n){break b}m=c+16|0;o[m>>2]=0;o[c+8>>2]=0;o[c+12>>2]=0;l=o[d+8>>2];e=o[d+12>>2];b=e;if((b|0)<(f|0)?1:(b|0)<=(f|0)?l>>>0>k>>>0?0:1:0){break c}while(1){g=o[d>>2];j=p[g+k|0];b=f;h=k+1|0;if(h>>>0<1){b=b+1|0}o[d+16>>2]=h;o[d+20>>2]=b;o[c+8>>2]=j;if((e|0)<(b|0)?1:(e|0)<=(b|0)?l>>>0>h>>>0?0:1:0){break c}j=p[g+h|0];b=f;d=k+2|0;if(d>>>0<2){b=b+1|0}h=i;o[h>>2]=d;o[h+4>>2]=b;o[c+12>>2]=j;if((e|0)<(b|0)?1:(e|0)<=(b|0)?l>>>0>d>>>0?0:1:0){break c}b=p[d+g|0];e=k+3|0;if(e>>>0<3){f=f+1|0}o[i>>2]=e;o[i+4>>2]=f;o[c+16>>2]=b;$h(o[a+44>>2]+96|0,c+8|0);s=s+1|0;if((s|0)==(n|0)){break b}d=o[a+32>>2];b=d;k=o[b+16>>2];f=o[b+20>>2];o[m>>2]=0;o[c+8>>2]=0;o[c+12>>2]=0;i=b+16|0;l=o[b+8>>2];e=o[b+12>>2];b=e;if((b|0)>(f|0)?1:(b|0)>=(f|0)?l>>>0<=k>>>0?0:1:0){continue}break}break c}if(u>>>0<=65535){if(!n){break b}t=c+16|0;o[t>>2]=0;o[c+8>>2]=0;o[c+12>>2]=0;h=o[d+12>>2];j=h;e=g+3|0;if(e>>>0<3){b=b+1|0}m=o[d+8>>2];l=e;e=b;if((j|0)<(b|0)?1:(j|0)<=(b|0)?m>>>0>=l>>>0?0:1:0){break c}while(1){g=o[d>>2];b=g+k|0;b=p[b|0]|p[b+1|0]<<8;o[d+16>>2]=l;o[d+20>>2]=e;o[c+8>>2]=b;e=h;b=f;d=k+4|0;if(d>>>0<4){b=b+1|0}j=d;d=b;if((e|0)<(b|0)?1:(e|0)<=(b|0)?m>>>0>=j>>>0?0:1:0){break c}b=g+l|0;b=p[b|0]|p[b+1|0]<<8;o[i>>2]=j;o[i+4>>2]=d;o[c+12>>2]=b;b=f;f=k+6|0;if(f>>>0<6){b=b+1|0}e=f;f=b;if((h|0)<(b|0)?1:(h|0)<=(b|0)?m>>>0>=e>>>0?0:1:0){break c}b=g+j|0;b=p[b|0]|p[b+1|0]<<8;o[i>>2]=e;o[i+4>>2]=f;o[c+16>>2]=b;$h(o[a+44>>2]+96|0,c+8|0);s=s+1|0;if((s|0)==(n|0)){break b}d=o[a+32>>2];b=d;k=o[b+16>>2];f=o[b+20>>2];o[t>>2]=0;o[c+8>>2]=0;o[c+12>>2]=0;i=b+16|0;g=o[b+12>>2];h=g;m=o[b+8>>2];j=m;b=f;e=k+2|0;if(e>>>0<2){b=b+1|0}l=e;e=b;if((g|0)>(b|0)?1:(g|0)>=(b|0)?j>>>0>>0?0:1:0){continue}break}break c}d:{if(r[o[a+44>>2]+80>>2]>2097151){break d}e=q[a+36>>1];if((e<<24|e<<8&16711680)>>>16>>>0<514){break d}if(!n){break b}i=0;f=c+16|0;o[f>>2]=0;o[c+8>>2]=0;o[c+12>>2]=0;if(!Zh(1,c+4|0,d)){break c}while(1){o[c+8>>2]=o[c+4>>2];if(!Zh(1,c+4|0,o[a+32>>2])){break c}o[c+12>>2]=o[c+4>>2];if(!Zh(1,c+4|0,o[a+32>>2])){break c}o[c+16>>2]=o[c+4>>2];$h(o[a+44>>2]+96|0,c+8|0);i=i+1|0;if((n|0)==(i|0)){break b}b=o[a+32>>2];o[f>>2]=0;o[c+8>>2]=0;o[c+12>>2]=0;if(Zh(1,c+4|0,b)){continue}break}break c}if(!n){break b}t=c+16|0;o[t>>2]=0;o[c+8>>2]=0;o[c+12>>2]=0;h=o[d+12>>2];j=h;e=g+5|0;if(e>>>0<5){b=b+1|0}m=o[d+8>>2];l=e;e=b;if((j|0)<(b|0)?1:(j|0)<=(b|0)?m>>>0>=l>>>0?0:1:0){break c}while(1){g=o[d>>2];b=g+k|0;b=p[b|0]|p[b+1|0]<<8|(p[b+2|0]<<16|p[b+3|0]<<24);o[d+16>>2]=l;o[d+20>>2]=e;o[c+8>>2]=b;e=h;b=f;d=k+8|0;if(d>>>0<8){b=b+1|0}j=d;d=b;if((e|0)<(b|0)?1:(e|0)<=(b|0)?m>>>0>=j>>>0?0:1:0){break c}b=g+l|0;b=p[b|0]|p[b+1|0]<<8|(p[b+2|0]<<16|p[b+3|0]<<24);o[i>>2]=j;o[i+4>>2]=d;o[c+12>>2]=b;b=k+12|0;if(b>>>0<12){f=f+1|0}e=b;b=f;if((h|0)<(b|0)?1:(h|0)<=(b|0)?m>>>0>=e>>>0?0:1:0){break c}f=g+j|0;f=p[f|0]|p[f+1|0]<<8|(p[f+2|0]<<16|p[f+3|0]<<24);o[i>>2]=e;o[i+4>>2]=b;o[c+16>>2]=f;$h(o[a+44>>2]+96|0,c+8|0);s=s+1|0;if((s|0)==(n|0)){break b}d=o[a+32>>2];b=d;k=o[b+16>>2];f=o[b+20>>2];o[t>>2]=0;o[c+8>>2]=0;o[c+12>>2]=0;i=b+16|0;g=o[b+12>>2];h=g;m=o[b+8>>2];j=m;b=f;e=k+4|0;if(e>>>0<4){b=b+1|0}l=e;e=b;if((g|0)>(b|0)?1:(g|0)>=(b|0)?j>>>0>>0?0:1:0){continue}break}}i=0;break a}o[o[a+4>>2]+80>>2]=u;i=1}R=c+32|0;return i|0}function Dh(a,b){var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,p=0,q=0;a:{b:{c:{d:{e:{f:{g:{if(o[a+92>>2]==o[a+88>>2]){break g}d=o[a+52>>2];e=o[a+56>>2];h:{if((d|0)!=(e|0)){o[d>>2]=b;o[a+52>>2]=d+4;break h}i=o[a+48>>2];h=d-i|0;f=h>>2;g=f+1|0;if(g>>>0>=1073741824){break a}c=e-i|0;e=c>>1;c=c>>2>>>0<536870911?e>>>0>>0?g:e:1073741823;d=0;i:{if(!c){break i}if(c>>>0>=1073741824){break b}d=yk(c<<2)}e=d+(f<<2)|0;o[e>>2]=b;c=d+(c<<2)|0;e=e+4|0;if((h|0)>=1){ll(d,i,h)}o[a+56>>2]=c;o[a+52>>2]=e;o[a+48>>2]=d;if(!i){break h}jl(i)}o[a+84>>2]=0;e=-1;d=-1;j:{if((b|0)==-1){break j}f=o[a+4>>2];c=b+1|0;c=(c>>>0)%3|0?c:b+ -2|0;if((c|0)!=-1){e=o[o[f>>2]+(c<<2)>>2]}c=((b>>>0)%3|0?-1:2)+b|0;if((c|0)==-1){break j}d=o[o[f>>2]+(c<<2)>>2]}c=o[a+36>>2];h=c+(e>>>3&536870908)|0;g=o[h>>2];f=1<<(e&31);if(!(g&f)){o[h>>2]=f|g;f=a+8|0;if((b|0)!=-1){c=b+1|0;c=(c>>>0)%3|0?c:b+ -2|0}else{c=-1}Eh(f,e,c);c=o[a+36>>2]}f=(d>>>3&536870908)+c|0;c=o[f>>2];e=1<<(d&31);if(!(c&e)){o[f>>2]=c|e;e=a+8|0;c=-1;k:{if((b|0)==-1){break k}c=b+ -1|0;if((b>>>0)%3){break k}c=b+2|0}Eh(e,d,c)}e=-1;e=(b|0)!=-1?o[o[o[a+4>>2]>>2]+(b<<2)>>2]:e;f=o[a+36>>2]+(e>>>3&536870908)|0;c=o[f>>2];d=1<<(e&31);if(!(c&d)){o[f>>2]=c|d;Eh(a+8|0,e,b)}c=o[a+84>>2];if((c|0)>2){break g}p=a+8|0;while(1){b=u(c,12)+a|0;e=b+52|0;d=o[e>>2];if((d|0)==o[b+48>>2]){c=c+1|0;if((c|0)!=3){continue}break g}d=d+ -4|0;b=o[d>>2];o[e>>2]=d;o[a+84>>2]=c;if((b|0)==-1){break g}e=o[a+24>>2];d=(b>>>0)/3|0;l:{if(o[e+(d>>>3&268435452)>>2]>>>(d&31)&1){break l}m:{while(1){g=(b>>>0)/3|0;d=(g>>>3&268435452)+e|0;o[d>>2]=o[d>>2]|1<<(g&31);e=-1;e=(b|0)!=-1?o[o[o[a+4>>2]>>2]+(b<<2)>>2]:e;f=o[a+36>>2]+(e>>>3&536870908)|0;c=o[f>>2];d=1<<(e&31);if(!(c&d)){o[f>>2]=c|d;Eh(p,e,b)}if((b|0)==-1){break m}h=o[a+4>>2];d=-1;e=-1;c=b+1|0;c=(c>>>0)%3|0?c:b+ -2|0;if((c|0)!=-1){e=o[o[h+12>>2]+(c<<2)>>2]}b=(b-u(g,3)|0?-1:2)+b|0;if((b|0)!=-1){d=o[o[h+12>>2]+(b<<2)>>2]}g=(d|0)==-1;f=(d>>>0)/3|0;c=(e>>>0)/3|0;n:{o:{p:{q:{b=(e|0)==-1;if(!b){b=b?-1:c;b=o[o[a+24>>2]+(b>>>3&536870908)>>2]&1<<(b&31);if(g){break q}n=(b|0)!=0;break p}n=1;if(!g){break p}break m}if(!b){break o}break m}b=g?-1:f;r:{if(o[o[a+24>>2]+(b>>>3&536870908)>>2]>>>(b&31)&1){break r}b=0;c=o[o[h>>2]+(d<<2)>>2];if(!(o[o[a+36>>2]+(c>>>3&536870908)>>2]>>>(c&31)&1)){b=o[a+88>>2]+(c<<2)|0;c=o[b>>2];o[b>>2]=c+1;b=(c|0)<1?2:1}if(!(!n|(b|0)>o[a+84>>2])){b=d;e=o[a+24>>2];continue}c=u(b,12)+a|0;j=c+52|0;g=o[j>>2];m=c+56|0;f=o[m>>2];s:{if((g|0)!=(f|0)){o[g>>2]=d;o[j>>2]=g+4;break s}i=c+48|0;h=o[i>>2];k=g-h|0;c=k>>2;l=c+1|0;if(l>>>0>=1073741824){break f}q=c<<2;g=f-h|0;f=g>>1;f=g>>2>>>0<536870911?f>>>0>>0?l:f:1073741823;c=0;t:{if(!f){break t}if(f>>>0>=1073741824){break e}c=yk(f<<2)}g=q+c|0;o[g>>2]=d;f=c+(f<<2)|0;d=g+4|0;if((k|0)>=1){ll(c,h,k)}o[i>>2]=c;o[j>>2]=d;o[m>>2]=f;if(!h){break s}jl(h)}if(o[a+84>>2]<=(b|0)){break r}o[a+84>>2]=b}if(n){break m}b=-1;if((e|0)==-1){break n}}b=o[o[o[a+4>>2]>>2]+(e<<2)>>2]}d=0;if(!(o[o[a+36>>2]+(b>>>3&536870908)>>2]>>>(b&31)&1)){b=o[a+88>>2]+(b<<2)|0;d=o[b>>2];o[b>>2]=d+1;d=(d|0)<1?2:1}if((d|0)<=o[a+84>>2]){b=e;e=o[a+24>>2];continue}break}b=u(d,12)+a|0;k=b+52|0;f=o[k>>2];i=b+56|0;c=o[i>>2];u:{if((f|0)!=(c|0)){o[f>>2]=e;o[k>>2]=f+4;break u}h=b+48|0;j=o[h>>2];l=f-j|0;g=l>>2;m=g+1|0;if(m>>>0>=1073741824){break d}f=c-j|0;c=f>>1;c=f>>2>>>0<536870911?c>>>0>>0?m:c:1073741823;b=0;v:{if(!c){break v}if(c>>>0>=1073741824){break c}b=yk(c<<2)}f=b+(g<<2)|0;o[f>>2]=e;c=b+(c<<2)|0;e=f+4|0;if((l|0)>=1){ll(b,j,l)}o[h>>2]=b;o[k>>2]=e;o[i>>2]=c;if(!j){break u}jl(j)}c=o[a+84>>2];if((c|0)<=(d|0)){break l}o[a+84>>2]=d;c=d;break l}c=o[a+84>>2]}if((c|0)<3){continue}break}}return 1}Nk();D()}db(8832);D()}Nk();D()}db(8832);D()}db(8832);D()}Nk();D()}function jh(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,s=0,t=0,v=0;g=R+ -64|0;R=g;o[a+132>>2]=0;if(o[a+148>>2]){b=o[a+144>>2];if(b){while(1){c=o[b>>2];jl(b);b=c;if(b){continue}break}}o[a+144>>2]=0;c=o[a+140>>2];if(c){b=0;while(1){o[o[a+136>>2]+(b<<2)>>2]=0;b=b+1|0;if((c|0)!=(b|0)){continue}break}}o[a+148>>2]=0}a:{if(!Xg(1,g+60|0,o[o[a+4>>2]+32>>2])){break a}o[a+156>>2]=o[g+60>>2];if(!Xg(1,g+56|0,o[o[a+4>>2]+32>>2])){break a}e=o[g+56>>2];if(e>>>0>1431655765|r[a+156>>2]>u(e,3)>>>0){break a}b=o[o[a+4>>2]+32>>2];f=o[b+16>>2];h=o[b+12>>2];c=o[b+20>>2];if((h|0)<(c|0)?1:(h|0)<=(c|0)?r[b+8>>2]>f>>>0?0:1:0){break a}j=p[f+o[b>>2]|0];f=f+1|0;if(f>>>0<1){c=c+1|0}o[b+16>>2]=f;o[b+20>>2]=c;if(!Xg(1,g+52|0,b)){break a}f=o[g+52>>2];if(e>>>0>>0|e>>>0>f+((f>>>0)/3|0)>>>0){break a}if(!Xg(1,g+48|0,o[o[a+4>>2]+32>>2])){break a}k=o[g+48>>2];if(k>>>0>f>>>0){break a}o[a+28>>2]=o[a+24>>2];c=yk(88);Ci(c);b=o[a+8>>2];o[a+8>>2]=c;h=a+8|0;if(b){za(h,b);if(!o[h>>2]){break a}}d=o[a+160>>2];o[a+164>>2]=d;b:{c:{d:{e:{f:{if(o[a+168>>2]-d>>2>>>0>=e>>>0){break f}if(e>>>0>=1073741824){break e}c=e<<2;b=yk(c);o[a+164>>2]=b;o[a+160>>2]=b;o[a+168>>2]=b+c;if(!d){break f}jl(d)}d=o[a+172>>2];o[a+176>>2]=d;g:{if(o[a+180>>2]-d>>2>>>0>=e>>>0){break g}if(e>>>0>=1073741824){break d}c=e<<2;b=yk(c);o[a+176>>2]=b;o[a+172>>2]=b;o[a+180>>2]=b+c;if(!d){break g}jl(d)}o[a+92>>2]=-1;o[a+84>>2]=-1;o[a+88>>2]=-1;o[a+40>>2]=o[a+36>>2];o[a- -64>>2]=0;o[a+52>>2]=o[a+48>>2];o[a+76>>2]=o[a+72>>2];n=a+216|0;c=o[a+220>>2];d=o[a+216>>2];if((c|0)==(d|0)){break c}while(1){b=o[c+ -12>>2];if(b){o[c+ -8>>2]=b;jl(b)}b=o[c+ -28>>2];if(b){o[c+ -24>>2]=b;jl(b)}b=c+ -144|0;i=o[c+ -40>>2];if(i){o[c+ -36>>2]=i;jl(i)}Yg(c+ -140|0);c=b;if((d|0)!=(b|0)){continue}break}b=o[n>>2];break b}db(8832);D()}db(8832);D()}b=d}o[a+220>>2]=d;c=(d-b|0)/144|0;h:{if(c>>>0>>0){Zg(n,j-c|0);break h}if(c>>>0<=j>>>0){break h}c=b+u(j,144)|0;if((c|0)!=(d|0)){while(1){b=o[d+ -12>>2];if(b){o[d+ -8>>2]=b;jl(b)}b=o[d+ -28>>2];if(b){o[d+ -24>>2]=b;jl(b)}b=d+ -144|0;i=o[d+ -40>>2];if(i){o[d+ -36>>2]=i;jl(i)}Yg(d+ -140|0);d=b;if((b|0)!=(c|0)){continue}break}}o[a+220>>2]=c}d=0;if(!Mi(o[a+8>>2],e,o[a+156>>2]+k|0)){break a}b=o[a+156>>2];m[g+8|0]=1;eb(a+120|0,b+k|0,g+8|0);if((_g(a,o[o[a+4>>2]+32>>2])|0)==-1){break a}o[a+376>>2]=a;i=a+232|0;b=o[(l[o[o[a>>2]+32>>2]](a)|0)+32>>2];s=o[b>>2]+o[b+16>>2]|0;e=o[(l[o[o[a>>2]+32>>2]](a)|0)+32>>2];b=o[e+8>>2];c=o[e+16>>2];ti(i,s,b-c|0,q[o[(l[o[o[a>>2]+32>>2]](a)|0)+32>>2]+38>>1]);t=a,v=l[o[o[a>>2]+36>>2]](a)|0,o[t+380>>2]=v;o[a+372>>2]=j;o[a+384>>2]=o[a+156>>2]+k;b=si(g+8|0);i:{if(!kh(i,b)){break i}j=lh(a,f);if((j|0)==-1){break i}e=o[o[a+4>>2]+32>>2];c=o[b+16>>2];f=c+o[b>>2]|0;b=o[b+8>>2];ti(e,f,b-c|0,q[e+38>>1]);j:{if(o[a+220>>2]==o[a+216>>2]){break j}b=o[h>>2];if(o[b+4>>2]==o[b>>2]){break j}b=0;while(1){if(bh(a,b)){b=b+3|0;c=o[h>>2];if(b>>>0>2]-o[c>>2]>>2>>>0){continue}break j}break}break i}if(p[a+308|0]){wi(a+272|0)}b=o[a+216>>2];if((b|0)!=o[a+220>>2]){while(1){e=u(d,144);Wi((e+b|0)+4|0,o[h>>2]);c=o[n>>2];f=e+c|0;b=o[f+132>>2];f=o[f+136>>2];if((b|0)!=(f|0)){while(1){Yi((c+e|0)+4|0,o[b>>2]);c=o[n>>2];b=b+4|0;if((f|0)!=(b|0)){continue}break}}Xi((c+e|0)+4|0);d=d+1|0;b=o[a+216>>2];if(d>>>0<(o[a+220>>2]-b|0)/144>>>0){continue}break}}d=o[a+8>>2];ch(a+184|0,o[d+28>>2]-o[d+24>>2]>>2);c=o[a+216>>2];if((c|0)!=o[a+220>>2]){b=0;while(1){d=u(b,144)+c|0;c=o[d+60>>2]-o[d+56>>2]>>2;h=d+104|0;d=o[a+8>>2];d=o[d+28>>2]-o[d+24>>2]>>2;ch(h,(c|0)<(d|0)?d:c);b=b+1|0;c=o[a+216>>2];if(b>>>0<(o[a+220>>2]-c|0)/144>>>0){continue}break}}d=dh(a,j)}}R=g- -64|0;return d|0}function Ga(a,b,c,d){var e=0,f=0,g=v(0),h=0,i=0;a:{b:{if(!d){break b}e=o[a+28>>2]+ -1|0;if(e>>>0>10){break b}c:{switch(e-1|0){default:i=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;h=p[a+32|0];while(1){g=v(m[b|0]);s[(f<<2)+d>>2]=h?v(g/v(127)):g;b=b+1|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 0:i=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;h=p[a+32|0];while(1){g=v(p[b|0]);s[(f<<2)+d>>2]=h?v(g/v(255)):g;b=b+1|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 1:i=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;h=p[a+32|0];while(1){g=v(n[b>>1]);s[(f<<2)+d>>2]=h?v(g/v(32767)):g;b=b+2|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 2:i=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;h=p[a+32|0];while(1){g=v(q[b>>1]);s[(f<<2)+d>>2]=h?v(g/v(65535)):g;b=b+2|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 3:i=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;h=p[a+32|0];while(1){g=v(o[b>>2]);s[(f<<2)+d>>2]=h?v(g*v(4.656612873077393e-10)):g;b=b+4|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 4:i=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;h=p[a+32|0];while(1){g=v(r[b>>2]);s[(f<<2)+d>>2]=h?v(g*v(2.3283064365386963e-10)):g;b=b+4|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 5:i=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;h=p[a+32|0];while(1){g=v(+r[b>>2]+4294967296*+o[b+4>>2]);s[(f<<2)+d>>2]=h?v(g*v(1.0842021724855044e-19)):g;b=b+8|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 6:i=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;h=p[a+32|0];while(1){g=v(+r[b>>2]+4294967296*+r[b+4>>2]);s[(f<<2)+d>>2]=h?v(g*v(5.421010862427522e-20)):g;b=b+8|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 7:i=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){o[(f<<2)+d>>2]=o[b>>2];b=b+4|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 8:i=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){s[(f<<2)+d>>2]=t[b>>3];b=b+8|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 9:break c}}i=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){s[(f<<2)+d>>2]=p[b|0]?v(1):v(0);b=b+1|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}ml((e<<2)+d|0,0,c-e<<2)}return i}ml((e<<2)+d|0,0,c-e<<2);return 1}function jf(a,b,c,d){var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,n=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,E=0,F=0,G=0;g=R-80|0;R=g;e=-1;f=-1;a:{if((b|0)==-1){break a}h=((b>>>0)%3|0?-1:2)+b|0;i=o[a+32>>2];k=b+1|0;b=(k>>>0)%3|0?k:b+ -2|0;if((b|0)!=-1){e=o[o[i>>2]+(b<<2)>>2]}if((h|0)==-1){break a}f=o[o[i>>2]+(h<<2)>>2]}h=o[a+36>>2];b=o[h>>2];h=o[h+4>>2]-b>>2;b:{c:{d:{e:{if(!(h>>>0<=e>>>0|h>>>0<=f>>>0)){f:{g:{q=o[b+(e<<2)>>2];s=(q|0)>=(d|0);if(s){break g}f=o[b+(f<<2)>>2];if((f|0)>=(d|0)){break g}b=f<<3;x=o[(b|4)+c>>2];e=q<<3;k=o[(e|4)+c>>2];u=o[b+c>>2];w=o[c+e>>2];if(!((u|0)!=(w|0)|(k|0)!=(x|0))){o[a+8>>2]=w;o[a+12>>2]=k;break f}b=o[o[a+4>>2]+(d<<2)>>2];o[g+72>>2]=0;o[g+76>>2]=0;e=g- -64|0;o[e>>2]=0;o[e+4>>2]=0;o[g+56>>2]=0;o[g+60>>2]=0;e=o[a>>2];if(!p[e+84|0]){b=o[o[e+68>>2]+(b<<2)>>2]}Re(e,b,m[e+24|0],g+56|0);b=o[o[a+4>>2]+(q<<2)>>2];o[g+48>>2]=0;o[g+52>>2]=0;o[g+40>>2]=0;o[g+44>>2]=0;o[g+32>>2]=0;o[g+36>>2]=0;e=o[a>>2];if(!p[e+84|0]){b=o[o[e+68>>2]+(b<<2)>>2]}Re(e,b,m[e+24|0],g+32|0);b=o[o[a+4>>2]+(f<<2)>>2];o[g+24>>2]=0;o[g+28>>2]=0;o[g+16>>2]=0;o[g+20>>2]=0;o[g+8>>2]=0;o[g+12>>2]=0;e=o[a>>2];if(!p[e+84|0]){b=o[o[e+68>>2]+(b<<2)>>2]}Re(e,b,m[e+24|0],g+8|0);y=o[g+44>>2];b=o[g+16>>2];j=o[g+40>>2];e=j;f=o[g+20>>2]-(y+(b>>>0>>0)|0)|0;A=b-e|0;b=Ol(A,f,A,f);e=T;n=b;z=o[g+36>>2];b=o[g+8>>2];l=o[g+32>>2];i=l;h=o[g+12>>2]-(z+(b>>>0>>0)|0)|0;B=b-i|0;i=Ol(B,h,B,h);b=n+i|0;e=T+e|0;e=b>>>0>>0?e+1|0:e;t=b;E=o[g+52>>2];b=o[g+24>>2];n=o[g+48>>2];i=n;r=o[g+28>>2]-(E+(b>>>0>>0)|0)|0;C=b-i|0;i=Ol(C,r,C,r);b=t+i|0;e=T+e|0;v=b;i=b>>>0>>0?e+1|0:e;if(!(b|i)){break g}d=1;b=0;e=o[g+64>>2];c=o[g+68>>2]-((e>>>0>>0)+y|0)|0;e=e-j|0;q=e;s=c;c=Ol(A,f,e,c);e=T;t=c;j=o[g+56>>2];c=j-l|0;y=o[g+60>>2]-((j>>>0>>0)+z|0)|0;l=Ol(c,y,B,h);j=t+l|0;e=T+e|0;e=j>>>0>>0?e+1|0:e;t=j;j=o[g+72>>2];l=j-n|0;z=o[g+76>>2]-((j>>>0>>0)+E|0)|0;n=Ol(l,z,C,r);j=t+n|0;e=T+e|0;e=j>>>0>>0?e+1|0:e;n=j;j=e;f=Pl(Ol(n,e,A,f),T,v,i);s=s-(T+(q>>>0>>0)|0)|0;f=q-f|0;f=Ol(f,s,f,s);q=T;t=f;e=Pl(Ol(B,h,n,e),T,v,i);f=y-(T+(c>>>0>>0)|0)|0;c=c-e|0;f=Ol(c,f,c,f);c=t+f|0;e=T+q|0;e=c>>>0>>0?e+1|0:e;h=c;c=Pl(Ol(n,j,C,r),T,v,i);f=z-(T+(l>>>0>>0)|0)|0;c=l-c|0;f=Ol(c,f,c,f);c=h+f|0;e=T+e|0;f=Ol(c,c>>>0>>0?e+1|0:e,v,i);c=T;h=c;if(!c&f>>>0<=1|c>>>0<0){break e}r=f;c=h;while(1){e=b<<1|d>>>31;d=d<<1;b=e;l=!c&r>>>0>7|c>>>0>0;r=(c&3)<<30|r>>>2;c=c>>>2|0;if(l){continue}break}break d}e=a;if(s){if((d|0)<=0){o[a+8>>2]=0;o[a+12>>2]=0;break f}b=(d<<1)+ -2|0}else{b=q<<1}b=(b<<2)+c|0;o[e+8>>2]=o[b>>2];o[a+12>>2]=o[b+4>>2]}c=1;break b}Ok();D()}d=f;b=h;if(f-1){break c}}while(1){c=Ql(f,h,d,b)+d|0;e=b+T|0;e=c>>>0>>0?e+1|0:e;d=(e&1)<<31|c>>>1;b=e>>>1|0;c=Ol(d,b,d,b);e=T;if((h|0)==(e|0)&c>>>0>f>>>0|e>>>0>h>>>0){continue}break}}e=o[a+20>>2];c=0;if(!e){break b}h=e+ -1|0;r=o[o[a+16>>2]+(h>>>3&536870908)>>2];o[a+20>>2]=h;c=x;e=k;l=c-e|0;k=e>>31;x=(c>>31)-(k+(c>>>0>>0)|0)|0;c=Ol(n,j,l,x);f=T;k=Ol(e,k,v,i);c=k+c|0;e=T+f|0;e=c>>>0>>0?e+1|0:e;t=c;c=u;f=w;q=c-f|0;w=f>>31;k=(c>>31)-(w+(c>>>0>>0)|0)|0;c=Ol(d,b,q,k);u=c;c=r>>>(h&31)&1;s=c?0-u|0:u;h=t+s|0;r=e;e=T;e=r+(c?0-(e+(0>>0)|0)|0:e)|0;F=a,G=Pl(h,h>>>0>>0?e+1|0:e,v,i),o[F+12>>2]=G;e=Ol(n,j,q,k);h=T;u=a;f=Ol(f,w,v,i);a=f+e|0;e=T+h|0;e=a>>>0>>0?e+1|0:e;j=a;a=Ol(d,b,l,x);d=c?a:0-a|0;b=j+d|0;j=e;e=T;a=j+(c?e:0-((0>>0)+e|0)|0)|0;F=u,G=Pl(b,b>>>0>>0?a+1|0:a,v,i),o[F+8>>2]=G;c=1}R=g+80|0;return c}function Qe(a,b,c,d){var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,n=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,E=0,F=0,G=0;g=R-80|0;R=g;f=-1;e=-1;a:{if((b|0)==-1){break a}e=b+1|0;f=(e>>>0)%3|0?e:b+ -2|0;e=b+ -1|0;if((b>>>0)%3){break a}e=b+2|0}h=o[a+36>>2];b=o[h>>2];b:{c:{d:{e:{f:{h=o[h+4>>2]-b>>2;i=f<<2;f=o[o[a+32>>2]+28>>2];j=o[i+f>>2];if(h>>>0<=j>>>0){break f}e=o[f+(e<<2)>>2];if(h>>>0<=e>>>0){break f}g:{h:{n=o[b+(j<<2)>>2];s=(n|0)>=(d|0);if(s){break h}f=o[b+(e<<2)>>2];if((f|0)>=(d|0)){break h}b=f<<3;x=o[(b|4)+c>>2];e=n<<3;q=o[(e|4)+c>>2];u=o[b+c>>2];w=o[c+e>>2];if(!((u|0)!=(w|0)|(q|0)!=(x|0))){o[a+8>>2]=w;o[a+12>>2]=q;break g}b=o[o[a+4>>2]+(d<<2)>>2];o[g+72>>2]=0;o[g+76>>2]=0;e=g- -64|0;o[e>>2]=0;o[e+4>>2]=0;o[g+56>>2]=0;o[g+60>>2]=0;e=o[a>>2];if(!p[e+84|0]){b=o[o[e+68>>2]+(b<<2)>>2]}Re(e,b,m[e+24|0],g+56|0);b=o[o[a+4>>2]+(n<<2)>>2];o[g+48>>2]=0;o[g+52>>2]=0;o[g+40>>2]=0;o[g+44>>2]=0;o[g+32>>2]=0;o[g+36>>2]=0;e=o[a>>2];if(!p[e+84|0]){b=o[o[e+68>>2]+(b<<2)>>2]}Re(e,b,m[e+24|0],g+32|0);b=o[o[a+4>>2]+(f<<2)>>2];o[g+24>>2]=0;o[g+28>>2]=0;o[g+16>>2]=0;o[g+20>>2]=0;o[g+8>>2]=0;o[g+12>>2]=0;e=o[a>>2];if(!p[e+84|0]){b=o[o[e+68>>2]+(b<<2)>>2]}Re(e,b,m[e+24|0],g+8|0);y=o[g+44>>2];b=o[g+16>>2];i=o[g+40>>2];e=i;f=o[g+20>>2]-(y+(b>>>0>>0)|0)|0;A=b-e|0;b=Ol(A,f,A,f);e=T;l=b;z=o[g+36>>2];b=o[g+8>>2];k=o[g+32>>2];j=k;h=o[g+12>>2]-(z+(b>>>0>>0)|0)|0;B=b-j|0;j=Ol(B,h,B,h);b=l+j|0;e=T+e|0;e=b>>>0>>0?e+1|0:e;t=b;E=o[g+52>>2];b=o[g+24>>2];l=o[g+48>>2];j=l;r=o[g+28>>2]-(E+(b>>>0>>0)|0)|0;C=b-j|0;j=Ol(C,r,C,r);b=t+j|0;e=T+e|0;v=b;j=b>>>0>>0?e+1|0:e;if(!(b|j)){break h}d=1;b=0;e=o[g+64>>2];c=o[g+68>>2]-((e>>>0>>0)+y|0)|0;e=e-i|0;n=e;s=c;c=Ol(A,f,e,c);e=T;t=c;i=o[g+56>>2];c=i-k|0;y=o[g+60>>2]-((i>>>0>>0)+z|0)|0;k=Ol(c,y,B,h);i=t+k|0;e=T+e|0;e=i>>>0>>0?e+1|0:e;t=i;i=o[g+72>>2];k=i-l|0;z=o[g+76>>2]-((i>>>0>>0)+E|0)|0;l=Ol(k,z,C,r);i=t+l|0;e=T+e|0;e=i>>>0>>0?e+1|0:e;l=i;i=e;f=Pl(Ol(l,e,A,f),T,v,j);s=s-(T+(n>>>0>>0)|0)|0;f=n-f|0;f=Ol(f,s,f,s);n=T;t=f;e=Pl(Ol(B,h,l,e),T,v,j);f=y-(T+(c>>>0>>0)|0)|0;c=c-e|0;f=Ol(c,f,c,f);c=t+f|0;e=T+n|0;e=c>>>0>>0?e+1|0:e;h=c;c=Pl(Ol(l,i,C,r),T,v,j);f=z-(T+(k>>>0>>0)|0)|0;c=k-c|0;f=Ol(c,f,c,f);c=h+f|0;e=T+e|0;f=Ol(c,c>>>0>>0?e+1|0:e,v,j);c=T;h=c;if(!c&f>>>0<=1|c>>>0<0){break e}r=f;c=h;while(1){e=b<<1|d>>>31;d=d<<1;b=e;k=!c&r>>>0>7|c>>>0>0;r=(c&3)<<30|r>>>2;c=c>>>2|0;if(k){continue}break}break d}e=a;if(s){if((d|0)<=0){o[a+8>>2]=0;o[a+12>>2]=0;break g}b=(d<<1)+ -2|0}else{b=n<<1}b=(b<<2)+c|0;o[e+8>>2]=o[b>>2];o[a+12>>2]=o[b+4>>2]}c=1;break b}Ok();D()}d=f;b=h;if(f-1){break c}}while(1){c=Ql(f,h,d,b)+d|0;e=b+T|0;e=c>>>0>>0?e+1|0:e;d=(e&1)<<31|c>>>1;b=e>>>1|0;c=Ol(d,b,d,b);e=T;if((h|0)==(e|0)&c>>>0>f>>>0|e>>>0>h>>>0){continue}break}}e=o[a+20>>2];c=0;if(!e){break b}h=e+ -1|0;r=o[o[a+16>>2]+(h>>>3&536870908)>>2];o[a+20>>2]=h;c=x;e=q;k=c-e|0;q=e>>31;x=(c>>31)-(q+(c>>>0>>0)|0)|0;c=Ol(l,i,k,x);f=T;q=Ol(e,q,v,j);c=q+c|0;e=T+f|0;e=c>>>0>>0?e+1|0:e;t=c;c=u;f=w;n=c-f|0;w=f>>31;q=(c>>31)-(w+(c>>>0>>0)|0)|0;c=Ol(d,b,n,q);u=c;c=r>>>(h&31)&1;s=c?0-u|0:u;h=t+s|0;r=e;e=T;e=r+(c?0-(e+(0>>0)|0)|0:e)|0;F=a,G=Pl(h,h>>>0>>0?e+1|0:e,v,j),o[F+12>>2]=G;e=Ol(l,i,n,q);h=T;u=a;f=Ol(f,w,v,j);a=f+e|0;e=T+h|0;e=a>>>0>>0?e+1|0:e;i=a;a=Ol(d,b,k,x);d=c?a:0-a|0;b=i+d|0;i=e;e=T;a=i+(c?e:0-((0>>0)+e|0)|0)|0;F=u,G=Pl(b,b>>>0>>0?a+1|0:a,v,j),o[F+8>>2]=G;c=1}R=g+80|0;return c}function Ua(a,b,c,d){var e=0,f=0,g=0,h=0,i=v(0),j=0;a:{b:{if(!d){break b}e=o[a+28>>2]+ -1|0;if(e>>>0>10){break b}c:{d:{e:{switch(e-1|0){default:g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){o[(f<<2)+d>>2]=m[b|0];b=b+1|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 0:g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){o[(f<<2)+d>>2]=p[b|0];b=b+1|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 1:g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){o[(f<<2)+d>>2]=n[b>>1];b=b+2|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 2:g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){o[(f<<2)+d>>2]=q[b>>1];b=b+2|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 3:g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){o[(f<<2)+d>>2]=o[b>>2];b=b+4|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 4:g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){o[(f<<2)+d>>2]=o[b>>2];b=b+4|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 5:g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){o[(f<<2)+d>>2]=o[b>>2];b=b+8|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 6:g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){o[(f<<2)+d>>2]=o[b>>2];b=b+8|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 7:g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24<1){break c}e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){e=(f<<2)+d|0;i=s[b>>2];f:{if(v(w(i))>2]=h;b=b+4|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}break c;case 8:g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24<1){break d}e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){e=(f<<2)+d|0;j=t[b>>3];g:{if(w(j)<2147483648){h=~~j;break g}h=-2147483648}o[e>>2]=h;b=b+8|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}break d;case 9:break e}}g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){o[(f<<2)+d>>2]=p[b|0];b=b+1|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}ml((e<<2)+d|0,0,c-e<<2);break b}if((e|0)>=(c|0)){break b}break a}if((e|0)>=(c|0)){break b}break a}return g}ml((e<<2)+d|0,0,c-e<<2);return 1}function Qa(a,b,c,d){var e=0,f=0,g=0,h=0,i=v(0),j=0;a:{b:{if(!d){break b}e=o[a+28>>2]+ -1|0;if(e>>>0>10){break b}c:{d:{e:{switch(e-1|0){default:g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){n[(f<<1)+d>>1]=m[b|0];b=b+1|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 0:g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){n[(f<<1)+d>>1]=p[b|0];b=b+1|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 1:g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){n[(f<<1)+d>>1]=q[b>>1];b=b+2|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 2:g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){n[(f<<1)+d>>1]=q[b>>1];b=b+2|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 3:g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){n[(f<<1)+d>>1]=o[b>>2];b=b+4|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 4:g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){n[(f<<1)+d>>1]=o[b>>2];b=b+4|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 5:g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){n[(f<<1)+d>>1]=o[b>>2];b=b+8|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 6:g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){n[(f<<1)+d>>1]=o[b>>2];b=b+8|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 7:g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24<1){break c}e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){e=(f<<1)+d|0;i=s[b>>2];f:{if(v(w(i))>1]=h;b=b+4|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}break c;case 8:g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24<1){break d}e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){e=(f<<1)+d|0;j=t[b>>3];g:{if(w(j)<2147483648){h=~~j;break g}h=-2147483648}n[e>>1]=h;b=b+8|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}break d;case 9:break e}}g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){n[(f<<1)+d>>1]=p[b|0];b=b+1|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}ml((e<<1)+d|0,0,c-e<<1);break b}if((e|0)>=(c|0)){break b}break a}if((e|0)>=(c|0)){break b}break a}return g}ml((e<<1)+d|0,0,c-e<<1);return 1}function Wa(a,b,c,d){var e=0,f=0,g=0,h=0,i=v(0),j=0;a:{b:{if(!d){break b}e=o[a+28>>2]+ -1|0;if(e>>>0>10){break b}c:{d:{e:{switch(e-1|0){default:g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){o[(f<<2)+d>>2]=m[b|0];b=b+1|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 0:g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){o[(f<<2)+d>>2]=p[b|0];b=b+1|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 1:g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){o[(f<<2)+d>>2]=n[b>>1];b=b+2|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 2:g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){o[(f<<2)+d>>2]=q[b>>1];b=b+2|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 3:g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){o[(f<<2)+d>>2]=o[b>>2];b=b+4|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 4:g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){o[(f<<2)+d>>2]=o[b>>2];b=b+4|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 5:g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){o[(f<<2)+d>>2]=o[b>>2];b=b+8|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 6:g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){o[(f<<2)+d>>2]=o[b>>2];b=b+8|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 7:g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24<1){break c}e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){e=(f<<2)+d|0;i=s[b>>2];f:{if(i=v(0)){h=~~i>>>0;break f}h=0}o[e>>2]=h;b=b+4|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}break c;case 8:g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24<1){break d}e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){e=(f<<2)+d|0;j=t[b>>3];g:{if(j<4294967296&j>=0){h=~~j>>>0;break g}h=0}o[e>>2]=h;b=b+8|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}break d;case 9:break e}}g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){o[(f<<2)+d>>2]=p[b|0];b=b+1|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}ml((e<<2)+d|0,0,c-e<<2);break b}if((e|0)>=(c|0)){break b}break a}if((e|0)>=(c|0)){break b}break a}return g}ml((e<<2)+d|0,0,c-e<<2);return 1}function Sa(a,b,c,d){var e=0,f=0,g=0,h=0,i=v(0),j=0;a:{b:{if(!d){break b}e=o[a+28>>2]+ -1|0;if(e>>>0>10){break b}c:{d:{e:{switch(e-1|0){default:g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){n[(f<<1)+d>>1]=m[b|0];b=b+1|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 0:g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){n[(f<<1)+d>>1]=p[b|0];b=b+1|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 1:g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){n[(f<<1)+d>>1]=q[b>>1];b=b+2|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 2:g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){n[(f<<1)+d>>1]=q[b>>1];b=b+2|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 3:g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){n[(f<<1)+d>>1]=o[b>>2];b=b+4|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 4:g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){n[(f<<1)+d>>1]=o[b>>2];b=b+4|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 5:g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){n[(f<<1)+d>>1]=o[b>>2];b=b+8|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 6:g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){n[(f<<1)+d>>1]=o[b>>2];b=b+8|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 7:g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24<1){break c}e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){e=(f<<1)+d|0;i=s[b>>2];f:{if(i=v(0)){h=~~i>>>0;break f}h=0}n[e>>1]=h;b=b+4|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}break c;case 8:g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24<1){break d}e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){e=(f<<1)+d|0;j=t[b>>3];g:{if(j<4294967296&j>=0){h=~~j>>>0;break g}h=0}n[e>>1]=h;b=b+8|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}break d;case 9:break e}}g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){n[(f<<1)+d>>1]=p[b|0];b=b+1|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}ml((e<<1)+d|0,0,c-e<<1);break b}if((e|0)>=(c|0)){break b}break a}if((e|0)>=(c|0)){break b}break a}return g}ml((e<<1)+d|0,0,c-e<<1);return 1}function Pg(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,r=0,s=0,t=0,v=0,w=0;e=R-80|0;R=e;a:{b:{v=o[a+4>>2];c=o[v+32>>2];n=o[c+8>>2];j=o[c+16>>2];k=o[c+12>>2];d=k;g=o[c+20>>2];h=g;c:{if((d|0)<(h|0)?1:(d|0)<=(h|0)?n>>>0>j>>>0?0:1:0){break c}s=o[c>>2];i=p[s+j|0];d=g;t=j+1|0;if(t>>>0<1){d=d+1|0}h=c;o[c+16>>2]=t;o[c+20>>2]=d;if((k|0)<(d|0)?1:(k|0)<=(d|0)?n>>>0>t>>>0?0:1:0){break c}t=p[t+s|0];d=g;w=j+2|0;if(w>>>0<2){d=d+1|0}o[c+16>>2]=w;o[h+20>>2]=d;h=i<<24>>24;d:{if((h|0)>=0){r=o[a+216>>2];if((o[a+220>>2]-r|0)/144>>>0<=i>>>0){break c}r=r+u(i,144)|0;if(o[r>>2]<=-1){break d}break c}if(o[a+212>>2]>-1){break c}r=a+212|0}o[r>>2]=b;e:{f:{r=q[v+36>>1];g:{if((r<<24|r<<8&16711680)>>>16>>>0>=258){if((k|0)<(d|0)?1:(k|0)<=(d|0)?n>>>0>w>>>0?0:1:0){break c}d=p[s+w|0];j=j+3|0;if(j>>>0<3){g=g+1|0}o[c+16>>2]=j;o[c+20>>2]=g;if(!t){break g}if(d){break c}break f}if(t){break f}d=0}if((h|0)<=-1){c=a+184|0}else{c=o[a+216>>2]+u(i,144)|0;m[c+100|0]=0;c=c+104|0}if(d>>>0>1){break c}h:{if(d-1){Qg(e+16|0,a,c);break h}Rg(e+16|0,a,c)}c=o[e+16>>2];if(!c){break c}break e}if((h|0)<0){break c}g=o[v+44>>2];f=o[a+216>>2];c=yk(80);o[c+12>>2]=0;o[c+16>>2]=0;o[c>>2]=9700;o[c+4>>2]=0;o[c+76>>2]=0;o[c+68>>2]=g;o[c+64>>2]=0;o[c+56>>2]=0;o[c+60>>2]=0;o[c+8>>2]=8568;d=c+20|0;o[d>>2]=0;o[d+4>>2]=0;j=c+28|0;h=j;o[h>>2]=0;o[h+4>>2]=0;o[c+36>>2]=0;o[c+40>>2]=0;h=c+44|0;o[h>>2]=0;o[h+4>>2]=0;o[c+52>>2]=0;f=f+u(i,144)|0;i=f+104|0;o[c+72>>2]=i;k=e+56|0;o[k>>2]=0;o[k+4>>2]=0;o[e+48>>2]=0;o[e+52>>2]=0;v=e+32|0;n=v;o[n>>2]=0;o[n+4>>2]=0;o[e+72>>2]=0;o[e+40>>2]=0;o[e+44>>2]=0;o[e+24>>2]=0;o[e+28>>2]=0;o[e+64>>2]=0;o[e+68>>2]=0;o[e+16>>2]=8568;n=f+4|0;o[e+20>>2]=n;f=o[f+68>>2];s=o[f>>2];f=o[f+4>>2];m[e+79|0]=0;eb(e+40|0,(f-s>>2>>>0)/3|0,e+79|0);f=o[e+20>>2];s=o[f+56>>2];f=o[f+52>>2];m[e+79|0]=0;eb(e+52|0,s-f>>2,e+79|0);o[e+36>>2]=c;o[v>>2]=g;g=e+28|0;o[g>>2]=i;o[e+24>>2]=n;o[j>>2]=c;f=o[g+4>>2];o[d>>2]=o[g>>2];o[d+4>>2]=f;g=o[e+24>>2];o[c+12>>2]=o[e+20>>2];o[c+16>>2]=g;g=c;f=o[e+44>>2];if(f){d=c+32|0;i:{if(f>>>0<=o[c+40>>2]<<5>>>0){i=f+ -1>>>5|0;f=o[d>>2];break i}d=o[d>>2];if(d){jl(d);o[c+40>>2]=0;o[c+32>>2]=0;o[c+36>>2]=0;f=o[e+44>>2]}if((f|0)<=-1){break b}i=f+ -1>>>5|0;d=i+1|0;f=yk(d<<2);o[c+40>>2]=d;o[c+36>>2]=0;o[c+32>>2]=f}nl(f,o[e+40>>2],(i<<2)+4|0);d=o[e+44>>2]}else{d=0}o[g+36>>2]=d;g=c;f=o[k>>2];if(f){j:{if(f>>>0<=o[c+52>>2]<<5>>>0){d=f+ -1>>>5|0;f=o[h>>2];break j}d=o[h>>2];if(d){jl(d);o[c+52>>2]=0;o[c+44>>2]=0;o[c+48>>2]=0;f=o[e+56>>2]}if((f|0)<=-1){break a}d=f+ -1>>>5|0;h=d+1|0;f=yk(h<<2);o[c+52>>2]=h;o[c+48>>2]=0;o[c+44>>2]=f}nl(f,o[e+52>>2],(d<<2)+4|0);h=o[e+56>>2]}else{h=0}o[g+48>>2]=h;yd(c+56|0,o[e+64>>2],o[e+68>>2]);o[e+16>>2]=8568;g=o[e+64>>2];if(g){o[e+68>>2]=g;jl(g)}o[e+16>>2]=8820;g=o[e+52>>2];if(g){jl(g)}g=o[e+40>>2];if(!g){break e}jl(g)}g=yk(64);o[e+8>>2]=c;Vd(g,e+8|0);c=o[e+8>>2];o[e+8>>2]=0;if(c){l[o[o[c>>2]+4>>2]](c)}if((b|0)>=0){a=o[a+4>>2];f=a+8|0;c=o[a+12>>2];i=o[a+8>>2];d=c-i>>2;k:{if((d|0)>(b|0)){break k}h=b+1|0;if(d>>>0<=b>>>0){Sg(f,h-d|0);break k}if(h>>>0>=d>>>0){break k}h=i+(h<<2)|0;if((h|0)!=(c|0)){while(1){c=c+ -4|0;d=o[c>>2];o[c>>2]=0;if(d){l[o[o[d>>2]+4>>2]](d)}if((c|0)!=(h|0)){continue}break}}o[a+12>>2]=h}b=o[f>>2]+(b<<2)|0;a=o[b>>2];o[b>>2]=g;f=1;if(!a){break c}l[o[o[a>>2]+4>>2]](a);break c}l[o[o[g>>2]+4>>2]](g);f=0}R=e+80|0;return f|0}Nk();D()}Nk();D()}function La(a,b,c,d){var e=0,f=0,g=0,h=0,i=v(0),j=0;a:{b:{if(!d){break b}e=o[a+28>>2]+ -1|0;if(e>>>0>10){break b}c:{d:{e:{switch(e-1|0){default:g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){m[d+f|0]=p[b|0];b=b+1|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 0:g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){m[d+f|0]=p[b|0];b=b+1|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 1:g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){m[d+f|0]=p[b|0];b=b+2|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 2:g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){m[d+f|0]=p[b|0];b=b+2|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 3:g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){m[d+f|0]=o[b>>2];b=b+4|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 4:g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){m[d+f|0]=o[b>>2];b=b+4|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 5:g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){m[d+f|0]=o[b>>2];b=b+8|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 6:g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){m[d+f|0]=o[b>>2];b=b+8|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 7:g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24<1){break c}e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){e=d+f|0;i=s[b>>2];f:{if(v(w(i))(c|0)?c:e)<<24>>24){continue}break}break c;case 8:g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24<1){break d}e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){e=d+f|0;j=t[b>>3];g:{if(w(j)<2147483648){h=~~j;break g}h=-2147483648}m[e|0]=h;b=b+8|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}break d;case 9:break e}}g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){m[d+f|0]=p[b|0];b=b+1|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}ml(d+e|0,0,c-e|0);break b}if((e|0)>=(c|0)){break b}break a}if((e|0)>=(c|0)){break b}break a}return g}ml(d+e|0,0,c-e|0);return 1}function Na(a,b,c,d){var e=0,f=0,g=0,h=0,i=v(0),j=0;a:{b:{if(!d){break b}e=o[a+28>>2]+ -1|0;if(e>>>0>10){break b}c:{d:{e:{switch(e-1|0){default:g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){m[d+f|0]=p[b|0];b=b+1|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 0:g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){m[d+f|0]=p[b|0];b=b+1|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 1:g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){m[d+f|0]=p[b|0];b=b+2|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 2:g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){m[d+f|0]=p[b|0];b=b+2|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 3:g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){m[d+f|0]=o[b>>2];b=b+4|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 4:g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){m[d+f|0]=o[b>>2];b=b+4|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 5:g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){m[d+f|0]=o[b>>2];b=b+8|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 6:g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){m[d+f|0]=o[b>>2];b=b+8|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}break a;case 7:g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24<1){break c}e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){e=d+f|0;i=s[b>>2];f:{if(i=v(0)){h=~~i>>>0;break f}h=0}m[e|0]=h;b=b+4|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}break c;case 8:g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24<1){break d}e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){e=d+f|0;j=t[b>>3];g:{if(j<4294967296&j>=0){h=~~j>>>0;break g}h=0}m[e|0]=h;b=b+8|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}break d;case 9:break e}}g=1;e=m[a+24|0];if(((e|0)>(c|0)?c:e)<<24>>24>=1){e=o[o[a>>2]>>2];b=o[a+48>>2]+Ol(o[a+40>>2],o[a+44>>2],b,0)|0;b=e+b|0;while(1){m[d+f|0]=p[b|0];b=b+1|0;f=f+1|0;e=m[a+24|0];if((f|0)<((e|0)>(c|0)?c:e)<<24>>24){continue}break}}if((e|0)>=(c|0)){break b}ml(d+e|0,0,c-e|0);break b}if((e|0)>=(c|0)){break b}break a}if((e|0)>=(c|0)){break b}break a}return g}ml(d+e|0,0,c-e|0);return 1}function jl(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0;a:{if(!a){break a}d=a+ -8|0;c=o[a+ -4>>2];a=c&-8;f=d+a|0;b:{if(c&1){break b}if(!(c&3)){break a}c=o[d>>2];d=d-c|0;if(d>>>0>>0<=255){e=o[d+8>>2];c=c>>>3|0;b=o[d+12>>2];if((b|0)==(e|0)){i=13332,j=o[3333]&Sl(c),o[i>>2]=j;break b}o[e+12>>2]=b;o[b+8>>2]=e;break b}h=o[d+24>>2];c=o[d+12>>2];c:{if((c|0)!=(d|0)){b=o[d+8>>2];o[b+12>>2]=c;o[c+8>>2]=b;break c}d:{e=d+20|0;b=o[e>>2];if(b){break d}e=d+16|0;b=o[e>>2];if(b){break d}c=0;break c}while(1){g=e;c=b;e=c+20|0;b=o[e>>2];if(b){continue}e=c+16|0;b=o[c+16>>2];if(b){continue}break}o[g>>2]=0}if(!h){break b}e=o[d+28>>2];b=(e<<2)+13636|0;e:{if(o[b>>2]==(d|0)){o[b>>2]=c;if(c){break e}i=13336,j=o[3334]&Sl(e),o[i>>2]=j;break b}o[h+(o[h+16>>2]==(d|0)?16:20)>>2]=c;if(!c){break b}}o[c+24>>2]=h;b=o[d+16>>2];if(b){o[c+16>>2]=b;o[b+24>>2]=c}b=o[d+20>>2];if(!b){break b}o[c+20>>2]=b;o[b+24>>2]=c;break b}c=o[f+4>>2];if((c&3)!=3){break b}o[3335]=a;o[f+4>>2]=c&-2;o[d+4>>2]=a|1;o[a+d>>2]=a;return}if(f>>>0<=d>>>0){break a}c=o[f+4>>2];if(!(c&1)){break a}f:{if(!(c&2)){if((f|0)==o[3339]){o[3339]=d;a=o[3336]+a|0;o[3336]=a;o[d+4>>2]=a|1;if(o[3338]!=(d|0)){break a}o[3335]=0;o[3338]=0;return}if((f|0)==o[3338]){o[3338]=d;a=o[3335]+a|0;o[3335]=a;o[d+4>>2]=a|1;o[a+d>>2]=a;return}a=(c&-8)+a|0;g:{if(c>>>0<=255){b=o[f+8>>2];c=c>>>3|0;e=o[f+12>>2];if((b|0)==(e|0)){i=13332,j=o[3333]&Sl(c),o[i>>2]=j;break g}o[b+12>>2]=e;o[e+8>>2]=b;break g}h=o[f+24>>2];c=o[f+12>>2];h:{if((f|0)!=(c|0)){b=o[f+8>>2];o[b+12>>2]=c;o[c+8>>2]=b;break h}i:{e=f+20|0;b=o[e>>2];if(b){break i}e=f+16|0;b=o[e>>2];if(b){break i}c=0;break h}while(1){g=e;c=b;e=c+20|0;b=o[e>>2];if(b){continue}e=c+16|0;b=o[c+16>>2];if(b){continue}break}o[g>>2]=0}if(!h){break g}e=o[f+28>>2];b=(e<<2)+13636|0;j:{if((f|0)==o[b>>2]){o[b>>2]=c;if(c){break j}i=13336,j=o[3334]&Sl(e),o[i>>2]=j;break g}o[h+((f|0)==o[h+16>>2]?16:20)>>2]=c;if(!c){break g}}o[c+24>>2]=h;b=o[f+16>>2];if(b){o[c+16>>2]=b;o[b+24>>2]=c}b=o[f+20>>2];if(!b){break g}o[c+20>>2]=b;o[b+24>>2]=c}o[d+4>>2]=a|1;o[a+d>>2]=a;if(o[3338]!=(d|0)){break f}o[3335]=a;return}o[f+4>>2]=c&-2;o[d+4>>2]=a|1;o[a+d>>2]=a}if(a>>>0<=255){a=a>>>3|0;c=(a<<3)+13372|0;b=o[3333];a=1<>2]}o[c+8>>2]=d;o[a+12>>2]=d;o[d+12>>2]=c;o[d+8>>2]=a;return}o[d+16>>2]=0;o[d+20>>2]=0;c=d;e=a>>>8|0;b=0;l:{if(!e){break l}b=31;if(a>>>0>16777215){break l}b=e;e=e+1048320>>>16&8;b=b<>>16&4;b=b<>>16&2;b=(b<>>15|0)-(g|(e|h))|0;b=(b<<1|a>>>b+21&1)+28|0}o[c+28>>2]=b;g=(b<<2)+13636|0;m:{n:{e=o[3334];c=1<>2]=d;o[d+24>>2]=g;break o}e=a<<((b|0)==31?0:25-(b>>>1|0)|0);c=o[g>>2];while(1){b=c;if((o[c+4>>2]&-8)==(a|0)){break n}c=e>>>29|0;e=e<<1;g=(b+(c&4)|0)+16|0;c=o[g>>2];if(c){continue}break}o[g>>2]=d;o[d+24>>2]=b}o[d+12>>2]=d;o[d+8>>2]=d;break m}a=o[b+8>>2];o[a+12>>2]=d;o[b+8>>2]=d;o[d+24>>2]=0;o[d+12>>2]=b;o[d+8>>2]=a}a=o[3341]+ -1|0;o[3341]=a;if(a){break a}d=13788;while(1){a=o[d>>2];d=a+8|0;if(a){continue}break}o[3341]=-1}}function Xi(a){var b=0,c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,p=0;o[a+56>>2]=o[a+52>>2];o[a+44>>2]=o[a+40>>2];a:{b:{c:{d=o[a+64>>2];if(o[d+28>>2]!=o[d+24>>2]){m=a+40|0;n=a+52|0;while(1){e=c;j=o[o[d+24>>2]+(l<<2)>>2];d:{if((j|0)==-1){break d}c=o[a+56>>2];b=o[a+60>>2];e:{if((c|0)!=(b|0)){o[c>>2]=e;o[a+56>>2]=c+4;break e}h=o[n>>2];i=c-h|0;f=i>>2;g=f+1|0;if(g>>>0>=1073741824){break c}d=b-h|0;b=d>>1;d=d>>2>>>0<536870911?b>>>0>>0?g:b:1073741823;c=0;f:{if(!d){break f}if(d>>>0>=1073741824){break a}c=yk(d<<2)}b=c+(f<<2)|0;o[b>>2]=e;d=c+(d<<2)|0;b=b+4|0;if((i|0)>=1){ll(c,h,i)}o[a+60>>2]=d;o[a+56>>2]=b;o[a+52>>2]=c;if(!h){break e}jl(h)}g:{if(!(o[o[a+12>>2]+(l>>>3&536870908)>>2]>>>(l&31)&1)){break g}c=j+1|0;c=(c>>>0)%3|0?c:j+ -2|0;if((c|0)==-1|o[o[a>>2]+(c>>>3&536870908)>>2]>>>(c&31)&1){break g}b=o[o[o[a+64>>2]+12>>2]+(c<<2)>>2];if((b|0)==-1){break g}c=b+1|0;d=(c>>>0)%3|0?c:b+ -2|0;if((d|0)==-1){break g}while(1){c=d+1|0;j=d;c=(c>>>0)%3|0?c:d+ -2|0;if((c|0)==-1|o[o[a>>2]+(c>>>3&536870908)>>2]>>>(c&31)&1){break g}b=o[o[o[a+64>>2]+12>>2]+(c<<2)>>2];if((b|0)==-1){break g}c=b+1|0;d=(c>>>0)%3|0?c:b+ -2|0;if((d|0)!=-1){continue}break}}o[o[a+28>>2]+(j<<2)>>2]=e;c=o[a+44>>2];b=o[a+48>>2];h:{if((c|0)!=(b|0)){o[c>>2]=j;o[a+44>>2]=c+4;break h}h=o[m>>2];i=c-h|0;f=i>>2;g=f+1|0;if(g>>>0>=1073741824){break b}d=b-h|0;b=d>>1;d=d>>2>>>0<536870911?b>>>0>>0?g:b:1073741823;c=0;i:{if(!d){break i}if(d>>>0>=1073741824){break a}c=yk(d<<2)}b=c+(f<<2)|0;o[b>>2]=j;d=c+(d<<2)|0;b=b+4|0;if((i|0)>=1){ll(c,h,i)}o[a+48>>2]=d;o[a+44>>2]=b;o[a+40>>2]=c;if(!h){break h}jl(h)}c=e+1|0;b=((j>>>0)%3|0?-1:2)+j|0;if((b|0)==-1){break d}b=o[o[o[a+64>>2]+12>>2]+(b<<2)>>2];if((b|0)==-1){break d}d=b+((b>>>0)%3|0?-1:2)|0;if((d|0)==-1|(d|0)==(j|0)){break d}while(1){b=d+1|0;b=(b>>>0)%3|0?b:d+ -2|0;if(o[o[a>>2]+(b>>>3&536870908)>>2]>>>(b&31)&1){e=o[a+56>>2];b=o[a+60>>2];j:{if((e|0)!=(b|0)){o[e>>2]=c;o[a+56>>2]=e+4;break j}k=o[n>>2];h=e-k|0;g=h>>2;i=g+1|0;if(i>>>0>=1073741824){break c}f=b-k|0;b=f>>1;f=f>>2>>>0<536870911?b>>>0>>0?i:b:1073741823;e=0;k:{if(!f){break k}if(f>>>0>=1073741824){break a}e=yk(f<<2)}b=e+(g<<2)|0;o[b>>2]=c;f=e+(f<<2)|0;b=b+4|0;if((h|0)>=1){ll(e,k,h)}o[a+60>>2]=f;o[a+56>>2]=b;o[a+52>>2]=e;if(!k){break j}jl(k)}b=c+1|0;e=o[a+44>>2];f=o[a+48>>2];l:{if((e|0)!=(f|0)){o[e>>2]=d;o[a+44>>2]=e+4;break l}i=o[m>>2];k=e-i|0;e=k>>2;h=e+1|0;if(h>>>0>=1073741824){break b}p=e<<2;g=f-i|0;f=g>>1;g=g>>2>>>0<536870911?f>>>0>>0?h:f:1073741823;e=0;m:{if(!g){break m}if(g>>>0>=1073741824){break a}e=yk(g<<2)}f=p+e|0;o[f>>2]=d;g=e+(g<<2)|0;f=f+4|0;if((k|0)>=1){ll(e,i,k)}o[a+48>>2]=g;o[a+44>>2]=f;o[a+40>>2]=e;if(!i){break l}jl(i)}e=c;c=b}o[o[a+28>>2]+(d<<2)>>2]=e;b=((d>>>0)%3|0?-1:2)+d|0;if((b|0)==-1){break d}b=o[o[o[a+64>>2]+12>>2]+(b<<2)>>2];if((b|0)==-1){break d}d=b+((b>>>0)%3|0?-1:2)|0;if((d|0)==-1){break d}if((d|0)!=(j|0)){continue}break}}l=l+1|0;d=o[a+64>>2];if(l>>>0>2]-o[d+24>>2]>>2>>>0){continue}break}}return}Nk();D()}Nk();D()}db(10720);D()}function nf(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,n=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,E=0;f=R-96|0;R=f;e=o[a+16>>2];m[f+92|0]=1;o[f+88>>2]=b;o[f+84>>2]=b;o[f+80>>2]=e;d=-1;d=(b|0)!=-1?o[o[e>>2]+(b<<2)>>2]:d;g=o[a+20>>2];e=o[g>>2];a:{b:{c:{d:{if(o[g+4>>2]-e>>2>>>0>d>>>0){e=o[o[a+8>>2]+(o[e+(d<<2)>>2]<<2)>>2];d=o[a+4>>2];if(!p[d+84|0]){e=o[o[d+68>>2]+(e<<2)>>2]}o[f+72>>2]=0;o[f+76>>2]=0;g=f- -64|0;o[g>>2]=0;o[g+4>>2]=0;o[f+56>>2]=0;o[f+60>>2]=0;Re(d,e,m[d+24|0],f+56|0);if((b|0)==-1){break a}d=b+1|0;g=(d>>>0)%3|0?d:b+ -2|0;t=((b>>>0)%3|0?-1:2)+b|0;j=!o[a+28>>2];A=f+48|0;B=f+40|0;while(1){e=g;d=t;e:{if(j){break e}d=b+1|0;e=(d>>>0)%3|0?d:b+ -2|0;d=b+ -1|0;if((b>>>0)%3){break e}d=b+2|0}b=-1;b=(e|0)!=-1?o[o[o[a+16>>2]>>2]+(e<<2)>>2]:b;j=o[a+20>>2];e=o[j>>2];if(o[j+4>>2]-e>>2>>>0<=b>>>0){break d}e=o[o[a+8>>2]+(o[e+(b<<2)>>2]<<2)>>2];b=o[a+4>>2];if(!p[b+84|0]){e=o[o[b+68>>2]+(e<<2)>>2]}o[A>>2]=0;o[A+4>>2]=0;o[B>>2]=0;o[B+4>>2]=0;o[f+32>>2]=0;o[f+36>>2]=0;Re(b,e,m[b+24|0],f+32|0);b=-1;b=(d|0)!=-1?o[o[o[a+16>>2]>>2]+(d<<2)>>2]:b;e=o[a+20>>2];d=o[e>>2];if(o[e+4>>2]-d>>2>>>0<=b>>>0){break c}d=o[o[a+8>>2]+(o[d+(b<<2)>>2]<<2)>>2];b=o[a+4>>2];if(!p[b+84|0]){d=o[o[b+68>>2]+(d<<2)>>2]}e=f+24|0;o[e>>2]=0;o[e+4>>2]=0;j=f+16|0;k=j;o[k>>2]=0;o[k+4>>2]=0;o[f+8>>2]=0;o[f+12>>2]=0;Re(b,d,m[b+24|0],f+8|0);d=o[f+8>>2];b=o[f+56>>2];u=d-b|0;v=o[f+60>>2];k=o[f+12>>2]-(v+(d>>>0>>0)|0)|0;w=o[f+40>>2];d=o[f+64>>2];C=w-d|0;x=o[f+68>>2];w=o[f+44>>2]-(x+(w>>>0>>0)|0)|0;y=Ol(u,k,C,w);z=h-y|0;l=l-(T+(h>>>0>>0)|0)|0;h=o[j>>2];y=h-d|0;j=o[j+4>>2]-((h>>>0>>0)+x|0)|0;h=o[f+32>>2];x=h-b|0;v=o[f+36>>2]-((h>>>0>>0)+v|0)|0;d=Ol(y,j,x,v);h=d+z|0;b=T+l|0;b=h>>>0>>0?b+1|0:b;l=b;d=i;q=u;E=k;i=o[f+48>>2];b=o[f+72>>2];k=i-b|0;u=o[f+76>>2];z=o[f+52>>2]-(u+(i>>>0>>0)|0)|0;q=Ol(q,E,k,z);i=d+q|0;d=T+r|0;d=i>>>0>>0?d+1|0:d;r=i;i=o[e>>2];q=i-b|0;b=o[e+4>>2]-((i>>>0>>0)+u|0)|0;e=Ol(q,b,x,v);i=r-e|0;r=d-(T+(r>>>0>>0)|0)|0;d=Ol(y,j,k,z);e=n-d|0;s=s-(T+(n>>>0>>0)|0)|0;d=Ol(q,b,C,w);n=d+e|0;b=T+s|0;b=n>>>0>>0?b+1|0:b;s=b;of(f+80|0);k=o[a+28>>2];j=!k;b=o[f+88>>2];if((b|0)!=-1){continue}break}b=r;d=b>>31;a=b>>31;b=a+b|0;g=d+i|0;if(g>>>0>>0){b=b+1|0}d=d^g;j=a^b;b=s;a=b>>31;b=b>>31;g=a;t=s+a|0;e=b+n|0;if(e>>>0>>0){t=t+1|0}a=b^e;e=g^t;f:{if((l|0)<-1?1:(l|0)<=-1?h>>>0>4294967295?0:1:0){b=h;g=a+(d-b|0)|0;b=e+(j-((d>>>0>>0)+l|0)|0)|0;d=g;a=d>>>0>>0?b+1|0:b;if(!k){break f}break b}b=j+l|0;g=d;d=h;g=g+d|0;if(g>>>0>>0){b=b+1|0}d=a;g=d+g|0;a=b+e|0;a=g>>>0>>0?a+1|0:a;d=g;if(k){break b}}if((d|0)<536870913){break a}a=((a&536870911)<<3|d>>>29)&7;b=0;h=Pl(h,l,a,b);i=Pl(i,r,a,b);n=Pl(n,s,a,b);break a}Ok();D()}Ok();D()}Ok();D()}if((a|0)<0?1:(a|0)<=0?d>>>0>=536870913?0:1:0){break a}b=a>>>29|0;a=(a&536870911)<<3|d>>>29;h=Pl(h,l,a,b);i=Pl(i,r,a,b);n=Pl(n,s,a,b)}o[c+8>>2]=h;o[c+4>>2]=i;o[c>>2]=n;R=f+96|0}function Uh(a,b){var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;if((b|0)==-1){return 1}i=1;d=(b>>>0)/3|0;a:{if(o[o[a+24>>2]+(d>>>3&268435452)>>2]>>>(d&31)&1){break a}c=o[a+48>>2];o[a+52>>2]=c;b:{if((c|0)!=o[a+56>>2]){o[c>>2]=b;o[a+52>>2]=c+4;break b}e=yk(4);o[e>>2]=b;f=e+4|0;o[a+56>>2]=f;o[a+52>>2]=f;o[a+48>>2]=e;if(!c){break b}jl(c)}i=0;f=o[o[a+4>>2]+28>>2];c=b+1|0;e=(c>>>0)%3|0?c:b+ -2|0;c=o[f+(e<<2)>>2];if((c|0)==-1){break a}h=(b-u(d,3)|0?-1:2)+b|0;d=o[f+(h<<2)>>2];if((d|0)==-1){break a}b=o[a+36>>2];f=b+(c>>>3&536870908)|0;i=o[f>>2];g=1<<(c&31);if(!(i&g)){o[f>>2]=g|i;Eh(a+8|0,c,e);b=o[a+36>>2]}b=(d>>>3&536870908)+b|0;c=o[b>>2];e=1<<(d&31);if(!(c&e)){o[b>>2]=c|e;Eh(a+8|0,d,h)}c=o[a+52>>2];if((c|0)==o[a+48>>2]){return 1}j=a+48|0;k=a+8|0;while(1){c=c+ -4|0;b=o[c>>2];d=(b>>>0)/3|0;c:{d:{e:{if((b|0)==-1){break e}e=o[a+24>>2]+(d>>>3&268435452)|0;f=o[e>>2];d=1<<(d&31);if(f&d){break e}o[e>>2]=d|f;i=0;f=o[a+4>>2];d=o[o[f+28>>2]+(b<<2)>>2];if((d|0)==-1){break a}f:{while(1){g:{c=b;b=o[a+36>>2]+(d>>>3&536870908)|0;e=o[b>>2];h=1<<(d&31);h:{i:{if(e&h){break i}g=o[o[f+40>>2]+(d<<2)>>2];if((g|0)!=-1){j:{l=g+1|0;g=(l>>>0)%3|0?l:g+ -2|0;if((g|0)==-1|o[o[f>>2]+(g>>>3&536870908)>>2]>>>(g&31)&1){break j}f=o[o[o[f+64>>2]+12>>2]+(g<<2)>>2];if((f|0)==-1){break j}o[b>>2]=e|h;Eh(k,d,c);b=f+1|0;if((((b>>>0)%3|0?b:f+ -2|0)|0)==-1){break i}b=-1;f=o[a+4>>2];k:{if((c|0)==-1){break k}d=c+1|0;c=(d>>>0)%3|0?d:c+ -2|0;if((c|0)==-1|o[o[f>>2]+(c>>>3&536870908)>>2]>>>(c&31)&1){break k}b=o[o[o[f+64>>2]+12>>2]+(c<<2)>>2]}c=(b>>>0)/3|0;break h}}o[b>>2]=e|h;Eh(k,d,c)}if((c|0)==-1){break d}f=o[a+4>>2];d=-1;e=c+1|0;e=(e>>>0)%3|0?e:c+ -2|0;b=-1;l:{if((e|0)==-1){break l}b=-1;if(o[o[f>>2]+(e>>>3&536870908)>>2]>>>(e&31)&1){break l}b=o[o[o[f+64>>2]+12>>2]+(e<<2)>>2]}c=c+((c>>>0)%3|0?-1:2)|0;if(!((c|0)==-1|o[o[f>>2]+(c>>>3&536870908)>>2]>>>(c&31)&1)){d=o[o[o[f+64>>2]+12>>2]+(c<<2)>>2]}h=(d|0)==-1;e=(d>>>0)/3|0;c=(b>>>0)/3|0;m:{g=(b|0)==-1;n:{if(!g){g=g?-1:c;g=o[o[a+24>>2]+(g>>>3&536870908)>>2]&1<<(g&31);if(h){break m}g=(g|0)!=0;break n}c=-1;g=1;if((d|0)==-1){break d}}h=h?-1:e;h=o[o[a+24>>2]+(h>>>3&536870908)>>2]&1<<(h&31);if(g){c=e;b=d;if(!h){break h}break d}if(h){break h}c=o[a+52>>2];o[c+ -4>>2]=d;h=o[a+56>>2];if((h|0)!=(c|0)){o[c>>2]=b;c=c+4|0;break e}e=o[j>>2];f=c-e|0;i=f>>2;c=i+1|0;if(c>>>0>=1073741824){break g}h=h-e|0;g=h>>1;c=h>>2>>>0<536870911?g>>>0>>0?c:g:1073741823;d=0;o:{if(!c){break o}if(c>>>0>=1073741824){break f}d=yk(c<<2)}h=d+(i<<2)|0;o[h>>2]=b;b=d+(c<<2)|0;c=h+4|0;if((f|0)>=1){ll(d,e,f)}o[a+56>>2]=b;o[a+52>>2]=c;o[a+48>>2]=d;if(!e){break c}jl(e);c=o[a+52>>2];break c}if(g){break d}}d=o[a+24>>2]+(c>>>3&536870908)|0;o[d>>2]=o[d>>2]|1<<(c&31);d=o[o[f+28>>2]+(b<<2)>>2];if((d|0)!=-1){continue}break a}break}Nk();D()}db(8832);D()}o[a+52>>2]=c;break c}c=o[a+52>>2]+ -4|0;o[a+52>>2]=c}i=1;if(o[j>>2]!=(c|0)){continue}break}}return i}function Ze(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,n=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,E=0;e=R-96|0;R=e;d=o[a+16>>2];m[e+92|0]=1;o[e+88>>2]=b;o[e+84>>2]=b;o[e+80>>2]=d;g=o[a+20>>2];f=o[g>>2];d=o[o[d+28>>2]+(b<<2)>>2];a:{b:{c:{d:{if(o[g+4>>2]-f>>2>>>0>d>>>0){d=o[o[a+8>>2]+(o[f+(d<<2)>>2]<<2)>>2];f=o[a+4>>2];if(!p[f+84|0]){d=o[o[f+68>>2]+(d<<2)>>2]}o[e+72>>2]=0;o[e+76>>2]=0;g=e- -64|0;o[g>>2]=0;o[g+4>>2]=0;o[e+56>>2]=0;o[e+60>>2]=0;Re(f,d,m[f+24|0],e+56|0);if((b|0)==-1){break a}d=b+1|0;g=(d>>>0)%3|0?d:b+ -2|0;t=((b>>>0)%3|0?-1:2)+b|0;j=!o[a+28>>2];A=e+48|0;B=e+40|0;while(1){f=g;d=t;e:{if(j){break e}d=b+1|0;f=(d>>>0)%3|0?d:b+ -2|0;d=b+ -1|0;if((b>>>0)%3){break e}d=b+2|0}j=o[a+20>>2];b=o[j>>2];f=o[o[o[a+16>>2]+28>>2]+(f<<2)>>2];if(o[j+4>>2]-b>>2>>>0<=f>>>0){break d}f=o[o[a+8>>2]+(o[b+(f<<2)>>2]<<2)>>2];b=o[a+4>>2];if(!p[b+84|0]){f=o[o[b+68>>2]+(f<<2)>>2]}o[A>>2]=0;o[A+4>>2]=0;o[B>>2]=0;o[B+4>>2]=0;o[e+32>>2]=0;o[e+36>>2]=0;Re(b,f,m[b+24|0],e+32|0);f=o[a+20>>2];b=o[f>>2];d=o[o[o[a+16>>2]+28>>2]+(d<<2)>>2];if(o[f+4>>2]-b>>2>>>0<=d>>>0){break c}f=o[o[a+8>>2]+(o[b+(d<<2)>>2]<<2)>>2];b=o[a+4>>2];if(!p[b+84|0]){f=o[o[b+68>>2]+(f<<2)>>2]}j=e+24|0;d=j;o[d>>2]=0;o[d+4>>2]=0;k=e+16|0;d=k;o[d>>2]=0;o[d+4>>2]=0;o[e+8>>2]=0;o[e+12>>2]=0;Re(b,f,m[b+24|0],e+8|0);d=o[e+8>>2];b=o[e+56>>2];u=d-b|0;v=o[e+60>>2];f=o[e+12>>2]-(v+(d>>>0>>0)|0)|0;w=o[e+40>>2];d=o[e+64>>2];C=w-d|0;x=o[e+68>>2];w=o[e+44>>2]-(x+(w>>>0>>0)|0)|0;y=Ol(u,f,C,w);z=h-y|0;l=l-(T+(h>>>0>>0)|0)|0;h=o[k>>2];y=h-d|0;k=o[k+4>>2]-((h>>>0>>0)+x|0)|0;h=o[e+32>>2];x=h-b|0;v=o[e+36>>2]-((h>>>0>>0)+v|0)|0;d=Ol(y,k,x,v);h=d+z|0;b=T+l|0;b=h>>>0>>0?b+1|0:b;l=b;d=i;q=u;E=f;i=o[e+48>>2];b=o[e+72>>2];f=i-b|0;u=o[e+76>>2];z=o[e+52>>2]-(u+(i>>>0>>0)|0)|0;q=Ol(q,E,f,z);i=d+q|0;d=T+r|0;d=i>>>0>>0?d+1|0:d;r=i;i=o[j>>2];q=i-b|0;b=o[j+4>>2]-((i>>>0>>0)+u|0)|0;j=Ol(q,b,x,v);i=r-j|0;r=d-(T+(r>>>0>>0)|0)|0;d=Ol(y,k,f,z);f=n-d|0;s=s-(T+(n>>>0>>0)|0)|0;d=Ol(q,b,C,w);n=d+f|0;b=T+s|0;b=n>>>0>>0?b+1|0:b;s=b;$e(e+80|0);k=o[a+28>>2];j=!k;b=o[e+88>>2];if((b|0)!=-1){continue}break}b=r;d=b>>31;a=b>>31;b=a+b|0;g=d+i|0;if(g>>>0>>0){b=b+1|0}d=d^g;j=a^b;b=s;a=b>>31;b=b>>31;g=a;t=s+a|0;f=b+n|0;if(f>>>0>>0){t=t+1|0}a=b^f;f=g^t;f:{if((l|0)<-1?1:(l|0)<=-1?h>>>0>4294967295?0:1:0){b=h;g=a+(d-b|0)|0;b=f+(j-((d>>>0>>0)+l|0)|0)|0;d=g;a=d>>>0>>0?b+1|0:b;if(!k){break f}break b}b=j+l|0;g=d;d=h;g=g+d|0;if(g>>>0>>0){b=b+1|0}d=a;g=d+g|0;a=b+f|0;a=g>>>0>>0?a+1|0:a;d=g;if(k){break b}}if((d|0)<536870913){break a}a=((a&536870911)<<3|d>>>29)&7;b=0;h=Pl(h,l,a,b);i=Pl(i,r,a,b);n=Pl(n,s,a,b);break a}Ok();D()}Ok();D()}Ok();D()}if((a|0)<0?1:(a|0)<=0?d>>>0>=536870913?0:1:0){break a}b=a>>>29|0;a=(a&536870911)<<3|d>>>29;h=Pl(h,l,a,b);i=Pl(i,r,a,b);n=Pl(n,s,a,b)}o[c+8>>2]=h;o[c+4>>2]=i;o[c>>2]=n;R=e+96|0}function Oh(a,b){var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;if((b|0)==-1){return 1}i=1;d=(b>>>0)/3|0;a:{if(o[o[a+24>>2]+(d>>>3&268435452)>>2]>>>(d&31)&1){break a}c=o[a+48>>2];o[a+52>>2]=c;b:{if((c|0)!=o[a+56>>2]){o[c>>2]=b;o[a+52>>2]=c+4;break b}e=yk(4);o[e>>2]=b;g=e+4|0;o[a+56>>2]=g;o[a+52>>2]=g;o[a+48>>2]=e;if(!c){break b}jl(c)}c=o[a+4>>2];f=-1;i=0;e=b+1|0;e=(e>>>0)%3|0?e:b+ -2|0;if((e|0)!=-1){f=o[o[c>>2]+(e<<2)>>2]}d=(b-u(d,3)|0?-1:2)+b|0;if((d|0)==-1|(f|0)==-1){break a}c=o[o[c>>2]+(d<<2)>>2];if((c|0)==-1){break a}b=o[a+36>>2];g=b+(f>>>3&536870908)|0;i=o[g>>2];j=1<<(f&31);if(!(i&j)){o[g>>2]=i|j;Eh(a+8|0,f,e);b=o[a+36>>2]}b=(c>>>3&536870908)+b|0;e=o[b>>2];g=1<<(c&31);if(!(e&g)){o[b>>2]=e|g;Eh(a+8|0,c,d)}c=o[a+52>>2];if((c|0)==o[a+48>>2]){return 1}j=a+48|0;k=a+8|0;while(1){c=c+ -4|0;b=o[c>>2];d=(b>>>0)/3|0;c:{d:{e:{if((b|0)==-1){break e}e=o[a+24>>2]+(d>>>3&268435452)|0;g=o[e>>2];d=1<<(d&31);if(g&d){break e}o[e>>2]=d|g;f:{while(1){i=0;f=o[a+4>>2];c=o[o[f>>2]+(b<<2)>>2];if((c|0)==-1){break a}g:{d=o[a+36>>2]+(c>>>3&536870908)|0;e=o[d>>2];g=1<<(c&31);h:{i:{if(e&g){break i}h=o[o[f+24>>2]+(c<<2)>>2];if((h|0)!=-1){l=h+1|0;h=(l>>>0)%3|0?l:h+ -2|0;if((h|0)!=-1){f=o[o[f+12>>2]+(h<<2)>>2];if((f|0)!=-1){o[d>>2]=e|g;Eh(k,c,b);c=f+1|0;if((((c>>>0)%3|0?c:f+ -2|0)|0)==-1){break i}d=b+ -2|0;c=b+1|0;b=-1;c=(c>>>0)%3|0?c:d;if((c|0)!=-1){b=o[o[o[a+4>>2]+12>>2]+(c<<2)>>2]}c=(b>>>0)/3|0;f=o[a+24>>2];break h}}}o[d>>2]=e|g;Eh(k,c,b)}c=o[a+4>>2];j:{k:{l:{m:{n:{d=b+1|0;e=(d>>>0)%3|0?d:b+ -2|0;o:{if((e|0)!=-1){d=((b>>>0)%3|0?-1:2)+b|0;c=o[c+12>>2];b=o[c+(e<<2)>>2];if((d|0)==-1){break n}d=o[c+(d<<2)>>2];if((b|0)!=-1){break m}b=d;break o}b=((b>>>0)%3|0?-1:2)+b|0;if((b|0)==-1){break d}b=o[o[c+12>>2]+(b<<2)>>2]}if((b|0)==-1){break d}f=o[a+24>>2];h=1;e=-1;d=-1;c=(b>>>0)/3|0;break k}if((b|0)==-1){break d}c=(b>>>0)/3|0;d=-1;g=-1;break l}c=(b>>>0)/3|0;g=-1;if((d|0)==-1){d=-1;break l}g=(d>>>0)/3|0}f=o[a+24>>2];e=o[f+(c>>>3&268435452)>>2]&1<<(c&31);if((g|0)==-1){break j}h=(e|0)!=0;e=b;b=d;d=c;c=g}g=o[(c>>>3&536870908)+f>>2]&1<<(c&31);if(h){if(!g){break h}break d}if(g){c=d;b=e;break h}c=o[a+52>>2];o[c+ -4>>2]=b;f=o[a+56>>2];if((f|0)!=(c|0)){o[c>>2]=e;c=c+4|0;break e}d=o[j>>2];g=c-d|0;i=g>>2;c=i+1|0;if(c>>>0>=1073741824){break g}f=f-d|0;h=f>>1;c=f>>2>>>0<536870911?h>>>0>>0?c:h:1073741823;b=0;p:{if(!c){break p}if(c>>>0>=1073741824){break f}b=yk(c<<2)}f=b+(i<<2)|0;o[f>>2]=e;e=b+(c<<2)|0;c=f+4|0;if((g|0)>=1){ll(b,d,g)}o[a+56>>2]=e;o[a+52>>2]=c;o[a+48>>2]=b;if(!d){break c}jl(d);c=o[a+52>>2];break c}if(e){break d}}d=(c>>>3&536870908)+f|0;o[d>>2]=o[d>>2]|1<<(c&31);if((b|0)!=-1){continue}break a}break}Nk();D()}db(8832);D()}o[a+52>>2]=c;break c}c=o[a+52>>2]+ -4|0;o[a+52>>2]=c}i=1;if(o[j>>2]!=(c|0)){continue}break}}return i}function bf(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,p=0,q=0,r=0,s=0,t=0;o[a+8>>2]=e;f=a+32|0;g=o[f>>2];d=o[a+36>>2]-g>>2;a:{if(d>>>0>>0){Ia(f,e-d|0);break a}if(d>>>0<=e>>>0){break a}o[a+36>>2]=g+(e<<2)}r=o[a+52>>2];p=o[a+48>>2];d=0;f=(e&1073741823)!=(e|0)?-1:e<<2;n=ml(yk(f),0,f);f=o[a+8>>2];b:{if((f|0)<1){break b}while(1){f=d<<2;g=o[f+n>>2];j=o[a+16>>2];c:{if((g|0)>(j|0)){h=o[a+32>>2];o[f+h>>2]=j;break c}h=o[a+32>>2];f=f+h|0;j=o[a+12>>2];if((g|0)<(j|0)){o[f>>2]=j;break c}o[f>>2]=g}d=d+1|0;f=o[a+8>>2];if((d|0)<(f|0)){continue}break}if((f|0)<1){break b}g=0;while(1){f=g<<2;d=f+c|0;f=o[b+f>>2]+o[f+h>>2]|0;o[d>>2]=f;d:{if((f|0)>o[a+16>>2]){f=f-o[a+20>>2]|0}else{if((f|0)>=o[a+12>>2]){break d}f=f+o[a+20>>2]|0}o[d>>2]=f}g=g+1|0;f=o[a+8>>2];if((g|0)<(f|0)){continue}break}}d=o[a+56>>2];q=o[d>>2];d=o[d+4>>2]-q|0;if((d|0)>=5){d=d>>2;s=(d|0)>2?d:2;t=d>>>0>1?d:1;j=1;while(1){e:{f:{if((j|0)!=(t|0)){m=u(e,j);d=o[(j<<2)+q>>2];if((d|0)==-1){break f}d=o[o[p+12>>2]+(d<<2)>>2];if((d|0)==-1){break f}g=-1;i=o[r>>2];h=o[p>>2];k=o[i+(o[h+(d<<2)>>2]<<2)>>2];l=d+1|0;l=(l>>>0)%3|0?l:d+ -2|0;if((l|0)!=-1){l=o[h+(l<<2)>>2]}else{l=-1}d=d+((d>>>0)%3|0?-1:2)|0;if((d|0)!=-1){g=o[h+(d<<2)>>2]}if((k|0)>=(j|0)){break f}d=o[(l<<2)+i>>2];if((d|0)>=(j|0)){break f}g=o[i+(g<<2)>>2];if((g|0)>=(j|0)){break f}if((e|0)>=1){g=u(e,g);h=u(d,e);i=u(e,k);d=0;while(1){o[(d<<2)+n>>2]=(o[(d+g<<2)+c>>2]+o[(d+h<<2)+c>>2]|0)-o[(d+i<<2)+c>>2];d=d+1|0;if((e|0)!=(d|0)){continue}break}}if((f|0)<1){break e}d=0;while(1){f=d<<2;g=o[f+n>>2];i=o[a+16>>2];g:{if((g|0)>(i|0)){h=o[a+32>>2];o[f+h>>2]=i;break g}h=o[a+32>>2];f=f+h|0;i=o[a+12>>2];if((g|0)<(i|0)){o[f>>2]=i;break g}o[f>>2]=g}d=d+1|0;f=o[a+8>>2];if((d|0)<(f|0)){continue}break}g=0;if((f|0)<1){break e}d=m<<2;m=d+c|0;i=b+d|0;while(1){f=g<<2;d=f+m|0;f=o[f+i>>2]+o[f+h>>2]|0;o[d>>2]=f;h:{if((f|0)>o[a+16>>2]){f=f-o[a+20>>2]|0}else{if((f|0)>=o[a+12>>2]){break h}f=f+o[a+20>>2]|0}o[d>>2]=f}g=g+1|0;f=o[a+8>>2];if((g|0)<(f|0)){continue}break}break e}Ok();D()}if((f|0)<1){break e}i=(u(j+ -1|0,e)<<2)+c|0;d=0;while(1){f=d<<2;g=o[f+i>>2];k=o[a+16>>2];i:{if((g|0)>(k|0)){h=o[a+32>>2];o[f+h>>2]=k;break i}h=o[a+32>>2];f=f+h|0;k=o[a+12>>2];if((g|0)<(k|0)){o[f>>2]=k;break i}o[f>>2]=g}d=d+1|0;f=o[a+8>>2];if((d|0)<(f|0)){continue}break}g=0;if((f|0)<1){break e}d=m<<2;m=d+c|0;i=b+d|0;while(1){f=g<<2;d=f+m|0;f=o[f+i>>2]+o[f+h>>2]|0;o[d>>2]=f;j:{if((f|0)>o[a+16>>2]){f=f-o[a+20>>2]|0}else{if((f|0)>=o[a+12>>2]){break j}f=f+o[a+20>>2]|0}o[d>>2]=f}g=g+1|0;f=o[a+8>>2];if((g|0)<(f|0)){continue}break}}j=j+1|0;if((s|0)!=(j|0)){continue}break}}jl(n);return 1}function Be(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,p=0,q=0,r=0,s=0;o[a+8>>2]=e;f=a+32|0;g=o[f>>2];d=o[a+36>>2]-g>>2;a:{if(d>>>0>>0){Ia(f,e-d|0);break a}if(d>>>0<=e>>>0){break a}o[a+36>>2]=g+(e<<2)}q=o[a+52>>2];n=o[a+48>>2];d=0;f=(e&1073741823)!=(e|0)?-1:e<<2;m=ml(yk(f),0,f);f=o[a+8>>2];b:{if((f|0)<1){break b}while(1){f=d<<2;g=o[f+m>>2];i=o[a+16>>2];c:{if((g|0)>(i|0)){h=o[a+32>>2];o[f+h>>2]=i;break c}h=o[a+32>>2];f=f+h|0;i=o[a+12>>2];if((g|0)<(i|0)){o[f>>2]=i;break c}o[f>>2]=g}d=d+1|0;f=o[a+8>>2];if((d|0)<(f|0)){continue}break}if((f|0)<1){break b}g=0;while(1){f=g<<2;d=f+c|0;f=o[b+f>>2]+o[f+h>>2]|0;o[d>>2]=f;d:{if((f|0)>o[a+16>>2]){f=f-o[a+20>>2]|0}else{if((f|0)>=o[a+12>>2]){break d}f=f+o[a+20>>2]|0}o[d>>2]=f}g=g+1|0;f=o[a+8>>2];if((g|0)<(f|0)){continue}break}}d=o[a+56>>2];p=o[d>>2];d=o[d+4>>2]-p|0;if((d|0)>=5){d=d>>2;r=(d|0)>2?d:2;s=d>>>0>1?d:1;i=1;while(1){e:{f:{if((i|0)!=(s|0)){l=u(e,i);d=o[(i<<2)+p>>2];if((d|0)==-1|o[o[n>>2]+(d>>>3&536870908)>>2]>>>(d&31)&1){break f}d=o[o[o[n+64>>2]+12>>2]+(d<<2)>>2];if((d|0)==-1){break f}h=o[q>>2];g=o[n+28>>2];j=o[h+(o[g+(d<<2)>>2]<<2)>>2];if((j|0)>=(i|0)){break f}k=d+1|0;k=o[h+(o[g+(((k>>>0)%3|0?k:d+ -2|0)<<2)>>2]<<2)>>2];if((k|0)>=(i|0)){break f}d=o[h+(o[g+(d+((d>>>0)%3|0?-1:2)<<2)>>2]<<2)>>2];if((d|0)>=(i|0)){break f}if((e|0)>=1){g=u(d,e);h=u(e,k);j=u(e,j);d=0;while(1){o[(d<<2)+m>>2]=(o[(d+g<<2)+c>>2]+o[(d+h<<2)+c>>2]|0)-o[(d+j<<2)+c>>2];d=d+1|0;if((e|0)!=(d|0)){continue}break}}if((f|0)<1){break e}d=0;while(1){f=d<<2;g=o[f+m>>2];j=o[a+16>>2];g:{if((g|0)>(j|0)){h=o[a+32>>2];o[f+h>>2]=j;break g}h=o[a+32>>2];f=f+h|0;j=o[a+12>>2];if((g|0)<(j|0)){o[f>>2]=j;break g}o[f>>2]=g}d=d+1|0;f=o[a+8>>2];if((d|0)<(f|0)){continue}break}g=0;if((f|0)<1){break e}d=l<<2;l=d+c|0;j=b+d|0;while(1){f=g<<2;d=f+l|0;f=o[f+j>>2]+o[f+h>>2]|0;o[d>>2]=f;h:{if((f|0)>o[a+16>>2]){f=f-o[a+20>>2]|0}else{if((f|0)>=o[a+12>>2]){break h}f=f+o[a+20>>2]|0}o[d>>2]=f}g=g+1|0;f=o[a+8>>2];if((g|0)<(f|0)){continue}break}break e}Ok();D()}if((f|0)<1){break e}j=(u(i+ -1|0,e)<<2)+c|0;d=0;while(1){f=d<<2;g=o[f+j>>2];k=o[a+16>>2];i:{if((g|0)>(k|0)){h=o[a+32>>2];o[f+h>>2]=k;break i}h=o[a+32>>2];f=f+h|0;k=o[a+12>>2];if((g|0)<(k|0)){o[f>>2]=k;break i}o[f>>2]=g}d=d+1|0;f=o[a+8>>2];if((d|0)<(f|0)){continue}break}g=0;if((f|0)<1){break e}d=l<<2;l=d+c|0;j=b+d|0;while(1){f=g<<2;d=f+l|0;f=o[f+j>>2]+o[f+h>>2]|0;o[d>>2]=f;j:{if((f|0)>o[a+16>>2]){f=f-o[a+20>>2]|0}else{if((f|0)>=o[a+12>>2]){break j}f=f+o[a+20>>2]|0}o[d>>2]=f}g=g+1|0;f=o[a+8>>2];if((g|0)<(f|0)){continue}break}}i=i+1|0;if((r|0)!=(i|0)){continue}break}}jl(m);return 1}function Gi(a,b){var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0;d=R-48|0;R=d;if(b){u=a+12|0;k=o[a+4>>2];l=o[a>>2];h=k-l|0;g=h>>2;c=o[a+12>>2];e=o[a+16>>2]-c>>2;a:{if(g>>>0>e>>>0){Ji(u,g-e|0);k=o[a+4>>2];l=o[a>>2];h=k-l|0;g=h>>2;break a}if(g>>>0>=e>>>0){break a}o[a+16>>2]=c+(g<<2)}e=0;o[d+40>>2]=0;o[d+32>>2]=0;o[d+36>>2]=0;b:{c:{d:{if(!g){c=0;f=0;break d}if(g>>>0>=1073741824){break c}c=yk(h);o[d+36>>2]=c;o[d+32>>2]=c;o[d+40>>2]=(g<<2)+c;f=c}if(!h){break b}e=f;i=e;h=0;while(1){j=o[(h<<2)+l>>2];i=i-e>>2;if(j>>>0>=i>>>0){o[d+16>>2]=0;c=j+1|0;e:{if(c>>>0>i>>>0){Dd(d+32|0,c-i|0,d+16|0);l=o[a>>2];k=o[a+4>>2];break e}if(c>>>0>=i>>>0){break e}o[d+36>>2]=(c<<2)+e}c=o[d+32>>2];f=c}e=(j<<2)+c|0;o[e>>2]=o[e>>2]+1;h=h+1|0;e=k-l|0;g=e>>2;if(h>>>0>=g>>>0){break b}i=o[d+36>>2];e=c;continue}}db(10528);D()}o[d+24>>2]=0;o[d+16>>2]=0;o[d+20>>2]=0;h=0;f:{g:{if(e){if(g>>>0>=536870912){break g}h=yk(e<<1);o[d+16>>2]=h;j=g<<3;e=j+h|0;o[d+24>>2]=e;ml(h,255,j);o[d+20>>2]=e}o[d+8>>2]=0;o[d>>2]=0;o[d+4>>2]=0;f=o[d+36>>2]-f|0;n=f>>2;h:{if(f){if(n>>>0>=1073741824){break h}m=yk(f);o[d>>2]=m;e=(n<<2)+m|0;o[d+8>>2]=e;g=0;i=ml(m,0,f);o[d+4>>2]=e;j=n>>>0>1?n:1;e=0;while(1){f=e<<2;o[f+i>>2]=g;g=o[c+f>>2]+g|0;e=e+1|0;if((j|0)!=(e|0)){continue}break}}if((k|0)==(l|0)){break f}x=k-l>>2;j=0;v=o[d+32>>2];while(1){s=j<<2;r=o[s+l>>2];k=-1;e=j+1|0;c=(e>>>0)%3|0?e:j+ -2|0;if((c|0)!=-1){k=o[(c<<2)+l>>2]}p=-1;f=(j>>>0)%3|0;c=(f?-1:2)+j|0;if((c|0)!=-1){p=o[(c<<2)+l>>2]}i:{j:{if(f){break j}k:{if((k|0)==(p|0)){break k}c=o[l+s>>2];if((c|0)==(k|0)){break k}if((c|0)!=(p|0)){break j}}o[a+40>>2]=o[a+40>>2]+1;e=j+3|0;break i}c=p<<2;t=o[c+v>>2];l:{m:{if((t|0)<1){break m}c=o[c+m>>2];g=0;while(1){i=(c<<3)+h|0;f=o[i>>2];if((f|0)==-1){break m}n:{if((f|0)!=(k|0)){break n}q=o[i+4>>2];if((q|0)!=-1){f=o[(q<<2)+l>>2]}else{f=-1}if((f|0)==(r|0)){break n}while(1){o:{f=c;g=g+1|0;if((g|0)>=(t|0)){break o}w=(f<<3)+h|0;c=f+1|0;r=(c<<3)+h|0;i=o[r>>2];o[w>>2]=i;o[w+4>>2]=o[r+4>>2];if((i|0)!=-1){continue}}break}o[(f<<3)+h>>2]=-1;if((q|0)==-1){break m}c=o[u>>2];o[c+s>>2]=q;o[c+(q<<2)>>2]=j;break l}c=c+1|0;g=g+1|0;if((t|0)!=(g|0)){continue}break}}c=k<<2;f=o[c+v>>2];if((f|0)<1){break l}c=o[c+m>>2];g=0;while(1){i=(c<<3)+h|0;if(o[i>>2]==-1){o[i>>2]=p;o[i+4>>2]=j;break l}c=c+1|0;g=g+1|0;if((f|0)!=(g|0)){continue}break}}}j=e;if(j>>>0>>0){continue}break}break f}Nk();D()}Nk();D()}o[b>>2]=n;if(m){o[d+4>>2]=m;jl(m)}a=o[d+16>>2];if(a){o[d+20>>2]=a;jl(a)}a=o[d+32>>2];if(a){o[d+36>>2]=a;jl(a)}a=1}else{a=0}R=d+48|0;return a}function Ii(a,b){var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,n=0,p=0,q=0,r=0,s=0,t=0,v=0;h=R-48|0;R=h;o[a+36>>2]=b;n=a+24|0;e=o[a+24>>2];c=o[a+28>>2]-e>>2;a:{if(c>>>0>>0){Ji(n,b-c|0);break a}if(c>>>0<=b>>>0){break a}o[a+28>>2]=e+(b<<2)}m[h+16|0]=0;i=Ki(h+32|0,b,h+16|0);c=o[a>>2];e=o[a+4>>2];m[h+8|0]=0;p=Ki(h+16|0,e-c>>2,h+8|0);c=o[a>>2];b:{if(o[a+4>>2]-c>>2>>>0<3){break b}s=a+48|0;while(1){k=u(q,3);f=o[(k<<2)+c>>2];g=0;d=-1;e=k+1|0;c:{if((e|0)!=-1){d=o[(e<<2)+c>>2];g=k+2|0;e=-1;if((g|0)==-1){break c}}e=o[(g<<2)+c>>2]}d:{if(!((e|0)==(d|0)|(d|0)==(f|0)|(e|0)==(f|0))){j=o[p>>2];l=0;while(1){e=k+l|0;e:{if(o[(e>>>3&536870908)+j>>2]>>>(e&31)&1){break e}g=o[o[a>>2]+(e<<2)>>2];o[h+8>>2]=g;c=1<<(g&31);d=o[i>>2];g=g>>>5|0;j=o[d+(g<<2)>>2];f=0;f:{if(!(c&j)){break f}eh(n,10524);Li(s,h+8|0);c=o[i+4>>2];f=o[i+8>>2];if((c|0)==f<<5){if((c+1|0)<=-1){break d}d=i;if(c>>>0<=1073741822){c=c+32&-32;f=f<<6;c=f>>>0>>0?c:f}else{c=2147483647}fb(d,c);c=o[i+4>>2]}o[i+4>>2]=c+1;d=o[i>>2];f=d+(c>>>3&536870908)|0;g=o[f>>2];t=f,v=Sl(c)&g,o[t>>2]=v;o[h+8>>2]=b;c=1<<(b&31);g=b>>>5|0;j=o[(g<<2)+d>>2];b=b+1|0;f=1}o[(g<<2)+d>>2]=c|j;j=o[p>>2];c=e;g:{while(1){if((c|0)==-1){break g}d=(c>>>3&536870908)+j|0;o[d>>2]=o[d>>2]|1<<(c&31);d=o[h+8>>2];o[o[n>>2]+(d<<2)>>2]=c;if(f){o[o[a>>2]+(c<<2)>>2]=d}g=e;d=c+1|0;c=(d>>>0)%3|0?d:c+ -2|0;d=-1;h:{if((c|0)==-1){break h}c=o[o[a+12>>2]+(c<<2)>>2];d=-1;if((c|0)==-1){break h}d=c+1|0;d=(d>>>0)%3|0?d:c+ -2|0}c=d;if((g|0)!=(c|0)){continue}break}if((e|0)!=-1){break e}}c=e+((e>>>0)%3|0?-1:2)|0;if((c|0)==-1){break e}c=o[o[a+12>>2]+(c<<2)>>2];if((c|0)==-1){break e}c=c+((c>>>0)%3|0?-1:2)|0;if((c|0)==-1){break e}while(1){e=(c>>>3&536870908)+j|0;o[e>>2]=o[e>>2]|1<<(c&31);if(f){o[o[a>>2]+(c<<2)>>2]=o[h+8>>2]}c=((c>>>0)%3|0?-1:2)+c|0;if((c|0)==-1){break e}c=o[o[a+12>>2]+(c<<2)>>2];if((c|0)==-1){break e}c=c+((c>>>0)%3|0?-1:2)|0;if((c|0)!=-1){continue}break}}l=l+1|0;if((l|0)!=3){continue}break}}q=q+1|0;c=o[a>>2];if(q>>>0<(o[a+4>>2]-c>>2>>>0)/3>>>0){continue}break b}break}Nk();D()}o[a+44>>2]=0;b=o[i>>2];c=o[i+4>>2];e=c>>>5|0;f=c&31;if(e|f){e=(e<<2)+b|0;d=b;c=0;while(1){if(!(o[d>>2]>>>c&1)){r=r+1|0;o[a+44>>2]=r}g=(c|0)==31;c=g?0:c+1|0;d=g?d+4|0:d;if((e|0)!=(d|0)|(c|0)!=(f|0)){continue}break}}a=o[p>>2];if(a){jl(a);b=o[i>>2]}if(b){jl(b)}R=h+48|0}function pj(a,b){var c=0,d=0,e=0,f=0,g=0,h=0;a:{b:{d=b;g=o[b>>2];if(g){c=o[b+4>>2];if(!c){break b}while(1){d=c;c=o[c>>2];if(c){continue}break}}g=o[d+4>>2];if(g){break b}g=0;e=0;break a}o[g+8>>2]=o[d+8>>2];e=1}f=o[d+8>>2];c=o[f>>2];c:{if((c|0)==(d|0)){o[f>>2]=g;if((a|0)==(d|0)){c=0;a=g;break c}c=o[f+4>>2];break c}o[f+4>>2]=g}d:{e:{f:{h=!p[d+12|0];if((b|0)!=(d|0)){f=o[b+8>>2];o[d+8>>2]=f;o[f+((o[o[b+8>>2]>>2]!=(b|0))<<2)>>2]=d;f=o[b>>2];o[d>>2]=f;o[f+8>>2]=d;f=o[b+4>>2];o[d+4>>2]=f;if(f){o[f+8>>2]=d}m[d+12|0]=p[b+12|0];a=(a|0)==(b|0)?d:a}if(!(h|!a)){if(!e){while(1){b=p[c+12|0];g:{e=o[c+8>>2];if(o[e>>2]!=(c|0)){if(!b){m[c+12|0]=1;m[e+12|0]=0;d=o[e+4>>2];b=o[d>>2];o[e+4>>2]=b;if(b){o[b+8>>2]=e}o[d+8>>2]=o[e+8>>2];b=o[e+8>>2];o[(((e|0)!=o[b>>2])<<2)+b>>2]=d;o[d>>2]=e;o[e+8>>2]=d;b=o[c>>2];a=(b|0)==(a|0)?c:a;c=o[b+4>>2]}d=o[c>>2];if(!(p[d+12|0]?0:d)){b=o[c+4>>2];if(p[b+12|0]?0:b){break f}m[c+12|0]=0;c=o[c+8>>2];h:{if((c|0)==(a|0)){c=a;break h}if(p[c+12|0]){break g}}m[c+12|0]=1;return}b=o[c+4>>2];if(b){break f}break e}i:{if(b){b=c;break i}m[c+12|0]=1;m[e+12|0]=0;b=o[c+4>>2];o[e>>2]=b;if(b){o[b+8>>2]=e}o[c+8>>2]=o[e+8>>2];d=o[e+8>>2];j:{if((e|0)==o[d>>2]){o[d>>2]=c;b=o[e>>2];break j}o[d+4>>2]=c}o[c+4>>2]=e;o[e+8>>2]=c;a=(a|0)==(e|0)?c:a}d=o[b>>2];k:{if(!(!d|p[d+12|0])){c=b;break k}c=o[b+4>>2];if(!(p[c+12|0]?0:c)){m[b+12|0]=0;c=o[b+8>>2];if(p[c+12|0]?(c|0)!=(a|0):0){break g}m[c+12|0]=1;return}if(!(p[d+12|0]|!d)){c=b;break k}m[c+12|0]=1;m[b+12|0]=0;a=o[c>>2];o[b+4>>2]=a;if(a){o[a+8>>2]=b}o[c+8>>2]=o[b+8>>2];a=o[b+8>>2];o[((o[a>>2]!=(b|0))<<2)+a>>2]=c;o[c>>2]=b;o[b+8>>2]=c;d=b}a=c;c=o[c+8>>2];m[a+12|0]=p[c+12|0];m[c+12|0]=1;m[d+12|0]=1;b=o[c>>2];a=o[b+4>>2];o[c>>2]=a;if(a){o[a+8>>2]=c}o[b+8>>2]=o[c+8>>2];a=o[c+8>>2];o[(((c|0)!=o[a>>2])<<2)+a>>2]=b;o[b+4>>2]=c;o[c+8>>2]=b;return}b=o[c+8>>2];c=o[((o[b>>2]==(c|0))<<2)+b>>2];continue}}m[g+12|0]=1}return}if(p[b+12|0]){break e}d=c;break d}m[d+12|0]=1;m[c+12|0]=0;a=o[d+4>>2];o[c>>2]=a;if(a){o[a+8>>2]=c}o[d+8>>2]=o[c+8>>2];a=o[c+8>>2];o[((o[a>>2]!=(c|0))<<2)+a>>2]=d;o[d+4>>2]=c;o[c+8>>2]=d;b=c}c=o[d+8>>2];m[d+12|0]=p[c+12|0];m[c+12|0]=1;m[b+12|0]=1;b=o[c+4>>2];a=o[b>>2];o[c+4>>2]=a;if(a){o[a+8>>2]=c}o[b+8>>2]=o[c+8>>2];a=o[c+8>>2];o[(((c|0)!=o[a>>2])<<2)+a>>2]=b;o[b>>2]=c;o[c+8>>2]=b}function mf(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,p=0;h=R-32|0;R=h;o[a+68>>2]=f;d=o[a+56>>2];e=o[d>>2];f=o[d+4>>2];o[h+24>>2]=0;o[h+16>>2]=0;o[h+20>>2]=0;f=f-e|0;a:{if((f|0)<1){break a}e=o[d>>2];if((e|0)!=o[d+4>>2]){m=a+60|0;d=f>>2;n=(d|0)>1?d:1;p=a+108|0;while(1){nf(m,o[(k<<2)+e>>2],h+16|0);e=o[h+20>>2];g=e>>31;f=o[h+16>>2];i=f>>31;l=o[h+24>>2];j=l>>31;d=0;j=j^j+l;g=j+((g^e+g)+(i^f+i)|0)|0;if(g>>>0>>0){d=1}b:{if(!(d|g)){o[h+16>>2]=o[a+104>>2];break b}i=o[a+104>>2];j=i>>31;e=Pl(Ol(i,j,e,e>>31),T,g,d);o[h+20>>2]=e;d=Pl(Ol(i,j,f,f>>31),T,g,d);o[h+16>>2]=d;f=d;d=d>>31;d=(i-(f+d^d)|0)+((e|0)<0?e:0-e|0)|0;if((l|0)>=0){o[h+24>>2]=d;break b}o[h+24>>2]=0-d}d=Uf(p);f=o[h+16>>2];c:{if(!d){e=o[h+20>>2];break c}o[h+24>>2]=0-o[h+24>>2];e=0-o[h+20>>2]|0;o[h+20>>2]=e;f=0-f|0;o[h+16>>2]=f}d:{if((f|0)>=0){d=o[a+104>>2];f=d+o[h+24>>2]|0;d=d+e|0;break d}e:{if((e|0)<=-1){f=o[h+24>>2];d=f>>31;d=d^d+f;break e}f=o[h+24>>2];d=f>>31;d=o[a+100>>2]-(d^d+f)|0}if((f|0)<=-1){f=e;e=e>>31;f=f+e^e;break d}f=e;e=e>>31;f=o[a+100>>2]-(f+e^e)|0}f:{if(!(d|f)){f=o[a+100>>2];e=f;break f}g=o[a+100>>2];g:{h:{i:{if(!d){if((f|0)==(g|0)){e=f;break f}e=0;if(f|g){break i}f=0;break f}if(!((d|0)!=(g|0)|f)){f=d;e=d;break f}if((d|0)!=(g|0)){break g}i=o[a+104>>2];break h}i=o[a+104>>2];if((i|0)<(f|0)){f=(i<<1)-f|0;break f}if(g){break g}}g=d;if((i|0)<=(f|0)){break g}f=(i<<1)-f|0;e=d;break f}j:{if((f|0)!=(g|0)){break j}e=o[a+104>>2];if((e|0)<=(d|0)){break j}e=(e<<1)-d|0;break f}if(f){e=d;break f}f=0;e=o[a+104>>2];if((e|0)>=(d|0)){e=d;break f}e=(e<<1)-d|0}o[h+12>>2]=f;o[h+8>>2]=e;k:{if(o[a+8>>2]<1){break k}f=0;while(1){g=o[a+16>>2];l:{if((e|0)>(g|0)){d=o[a+32>>2];o[d+(f<<2)>>2]=g;break l}d=o[a+32>>2];g=d+(f<<2)|0;i=o[a+12>>2];if((e|0)<(i|0)){o[g>>2]=i;break l}o[g>>2]=e}f=f+1|0;g=o[a+8>>2];if((f|0)<(g|0)){e=o[(h+8|0)+(f<<2)>>2];continue}break}e=0;if((g|0)<1){break k}f=k<<3;i=f+c|0;l=b+f|0;while(1){g=e<<2;f=g+i|0;g=o[g+l>>2]+o[d+g>>2]|0;o[f>>2]=g;m:{if((g|0)>o[a+16>>2]){g=g-o[a+20>>2]|0}else{if((g|0)>=o[a+12>>2]){break m}g=g+o[a+20>>2]|0}o[f>>2]=g}e=e+1|0;if((e|0)>2]){continue}break}}k=k+1|0;if((n|0)==(k|0)){break a}d=o[a+56>>2];e=o[d>>2];if(o[d+4>>2]-e>>2>>>0>k>>>0){continue}break}}Ok();D()}R=h+32|0;return 1}function Ye(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,p=0;h=R-32|0;R=h;o[a+68>>2]=f;d=o[a+56>>2];e=o[d>>2];f=o[d+4>>2];o[h+24>>2]=0;o[h+16>>2]=0;o[h+20>>2]=0;f=f-e|0;a:{if((f|0)<1){break a}e=o[d>>2];if((e|0)!=o[d+4>>2]){m=a+60|0;d=f>>2;n=(d|0)>1?d:1;p=a+108|0;while(1){Ze(m,o[(k<<2)+e>>2],h+16|0);e=o[h+20>>2];g=e>>31;f=o[h+16>>2];i=f>>31;l=o[h+24>>2];j=l>>31;d=0;j=j^j+l;g=j+((g^e+g)+(i^f+i)|0)|0;if(g>>>0>>0){d=1}b:{if(!(d|g)){o[h+16>>2]=o[a+104>>2];break b}i=o[a+104>>2];j=i>>31;e=Pl(Ol(i,j,e,e>>31),T,g,d);o[h+20>>2]=e;d=Pl(Ol(i,j,f,f>>31),T,g,d);o[h+16>>2]=d;f=d;d=d>>31;d=(i-(f+d^d)|0)+((e|0)<0?e:0-e|0)|0;if((l|0)>=0){o[h+24>>2]=d;break b}o[h+24>>2]=0-d}d=Uf(p);f=o[h+16>>2];c:{if(!d){e=o[h+20>>2];break c}o[h+24>>2]=0-o[h+24>>2];e=0-o[h+20>>2]|0;o[h+20>>2]=e;f=0-f|0;o[h+16>>2]=f}d:{if((f|0)>=0){d=o[a+104>>2];f=d+o[h+24>>2]|0;d=d+e|0;break d}e:{if((e|0)<=-1){f=o[h+24>>2];d=f>>31;d=d^d+f;break e}f=o[h+24>>2];d=f>>31;d=o[a+100>>2]-(d^d+f)|0}if((f|0)<=-1){f=e;e=e>>31;f=f+e^e;break d}f=e;e=e>>31;f=o[a+100>>2]-(f+e^e)|0}f:{if(!(d|f)){f=o[a+100>>2];e=f;break f}g=o[a+100>>2];g:{h:{i:{if(!d){if((f|0)==(g|0)){e=f;break f}e=0;if(f|g){break i}f=0;break f}if(!((d|0)!=(g|0)|f)){f=d;e=d;break f}if((d|0)!=(g|0)){break g}i=o[a+104>>2];break h}i=o[a+104>>2];if((i|0)<(f|0)){f=(i<<1)-f|0;break f}if(g){break g}}g=d;if((i|0)<=(f|0)){break g}f=(i<<1)-f|0;e=d;break f}j:{if((f|0)!=(g|0)){break j}e=o[a+104>>2];if((e|0)<=(d|0)){break j}e=(e<<1)-d|0;break f}if(f){e=d;break f}f=0;e=o[a+104>>2];if((e|0)>=(d|0)){e=d;break f}e=(e<<1)-d|0}o[h+12>>2]=f;o[h+8>>2]=e;k:{if(o[a+8>>2]<1){break k}f=0;while(1){g=o[a+16>>2];l:{if((e|0)>(g|0)){d=o[a+32>>2];o[d+(f<<2)>>2]=g;break l}d=o[a+32>>2];g=d+(f<<2)|0;i=o[a+12>>2];if((e|0)<(i|0)){o[g>>2]=i;break l}o[g>>2]=e}f=f+1|0;g=o[a+8>>2];if((f|0)<(g|0)){e=o[(h+8|0)+(f<<2)>>2];continue}break}e=0;if((g|0)<1){break k}f=k<<3;i=f+c|0;l=b+f|0;while(1){g=e<<2;f=g+i|0;g=o[g+l>>2]+o[d+g>>2]|0;o[f>>2]=g;m:{if((g|0)>o[a+16>>2]){g=g-o[a+20>>2]|0}else{if((g|0)>=o[a+12>>2]){break m}g=g+o[a+20>>2]|0}o[f>>2]=g}e=e+1|0;if((e|0)>2]){continue}break}}k=k+1|0;if((n|0)==(k|0)){break a}d=o[a+56>>2];e=o[d>>2];if(o[d+4>>2]-e>>2>>>0>k>>>0){continue}break}}Ok();D()}R=h+32|0;return 1}function te(a,b,c,d,e){var f=0,g=0,h=0,i=0,j=0,k=0,l=0;a:{b:{c:{d:{b=b+ -1|0;e:{if(b>>>0>5){break e}f:{switch(b-1|0){default:b=yk(60);o[b+4>>2]=c;o[b>>2]=2732;c=o[d+8>>2];f=o[d+12>>2];g=o[d+16>>2];h=o[d+20>>2];i=o[d>>2];j=o[d+4>>2];o[b+40>>2]=0;o[b+32>>2]=0;o[b+36>>2]=0;o[b+24>>2]=g;o[b+28>>2]=h;o[b+16>>2]=c;o[b+20>>2]=f;o[b+8>>2]=i;o[b+12>>2]=j;f=o[d+24>>2];c=o[d+28>>2]-f|0;g:{if(!c){break g}g=c>>2;if(g>>>0>=1073741824){break d}d=yk(c);o[b+32>>2]=d;o[b+36>>2]=d;o[b+40>>2]=d+(g<<2);if((c|0)<1){break g}k=b,l=ll(d,f,c)+c|0,o[k+36>>2]=l}c=o[e+4>>2];o[b+44>>2]=o[e>>2];o[b+48>>2]=c;c=o[e+12>>2];o[b+52>>2]=o[e+8>>2];o[b+56>>2]=c;o[b>>2]=3928;break a;case 2:b=yk(112);o[b+4>>2]=c;o[b>>2]=2732;c=o[d+8>>2];f=o[d+12>>2];g=o[d+16>>2];h=o[d+20>>2];i=o[d>>2];j=o[d+4>>2];o[b+40>>2]=0;o[b+32>>2]=0;o[b+36>>2]=0;o[b+24>>2]=g;o[b+28>>2]=h;o[b+16>>2]=c;o[b+20>>2]=f;o[b+8>>2]=i;o[b+12>>2]=j;f=o[d+24>>2];c=o[d+28>>2]-f|0;h:{if(!c){break h}g=c>>2;if(g>>>0>=1073741824){break c}d=yk(c);o[b+32>>2]=d;o[b+36>>2]=d;o[b+40>>2]=d+(g<<2);if((c|0)<1){break h}k=b,l=ll(d,f,c)+c|0,o[k+36>>2]=l}c=o[e+4>>2];o[b+44>>2]=o[e>>2];o[b+48>>2]=c;c=o[e+12>>2];o[b+52>>2]=o[e+8>>2];o[b+56>>2]=c;o[b+60>>2]=0;o[b+64>>2]=0;o[b>>2]=4352;o[b+68>>2]=0;o[b+72>>2]=0;o[b+76>>2]=0;o[b+80>>2]=0;o[b+84>>2]=0;o[b+88>>2]=0;o[b+92>>2]=0;o[b+96>>2]=0;o[b+100>>2]=0;o[b+104>>2]=0;o[b+108>>2]=0;break a;case 3:b=yk(104);o[b+4>>2]=c;o[b>>2]=2732;c=o[d+8>>2];f=o[d+12>>2];g=o[d+16>>2];h=o[d+20>>2];i=o[d>>2];j=o[d+4>>2];o[b+40>>2]=0;o[b+32>>2]=0;o[b+36>>2]=0;o[b+24>>2]=g;o[b+28>>2]=h;o[b+16>>2]=c;o[b+20>>2]=f;o[b+8>>2]=i;o[b+12>>2]=j;f=o[d+24>>2];c=o[d+28>>2]-f|0;i:{if(!c){break i}g=c>>2;if(g>>>0>=1073741824){break b}d=yk(c);o[b+32>>2]=d;o[b+36>>2]=d;o[b+40>>2]=d+(g<<2);if((c|0)<1){break i}k=b,l=ll(d,f,c)+c|0,o[k+36>>2]=l}c=o[e+4>>2];o[b+44>>2]=o[e>>2];o[b+48>>2]=c;c=e+8|0;d=o[c>>2];f=o[c+4>>2];o[b+84>>2]=0;o[b+76>>2]=0;o[b+80>>2]=0;o[b+60>>2]=0;o[b+64>>2]=0;o[b>>2]=4588;o[b+52>>2]=d;o[b+56>>2]=f;d=o[e+4>>2];o[b+88>>2]=o[e>>2];o[b+92>>2]=d;d=o[c+4>>2];o[b+96>>2]=o[c>>2];o[b+100>>2]=d;break a;case 0:case 1:break e;case 4:break f}}f=yk(124);af(f,c,d,e)}o[a>>2]=f;return}Nk();D()}Nk();D()}Nk();D()}o[a>>2]=b}function se(a,b,c,d,e){var f=0,g=0,h=0,i=0,j=0,k=0,l=0;a:{b:{c:{d:{b=b+ -1|0;e:{if(b>>>0>5){break e}f:{switch(b-1|0){default:b=yk(60);o[b+4>>2]=c;o[b>>2]=2732;c=o[d+8>>2];f=o[d+12>>2];g=o[d+16>>2];h=o[d+20>>2];i=o[d>>2];j=o[d+4>>2];o[b+40>>2]=0;o[b+32>>2]=0;o[b+36>>2]=0;o[b+24>>2]=g;o[b+28>>2]=h;o[b+16>>2]=c;o[b+20>>2]=f;o[b+8>>2]=i;o[b+12>>2]=j;f=o[d+24>>2];c=o[d+28>>2]-f|0;g:{if(!c){break g}g=c>>2;if(g>>>0>=1073741824){break d}d=yk(c);o[b+32>>2]=d;o[b+36>>2]=d;o[b+40>>2]=d+(g<<2);if((c|0)<1){break g}k=b,l=ll(d,f,c)+c|0,o[k+36>>2]=l}c=o[e+4>>2];o[b+44>>2]=o[e>>2];o[b+48>>2]=c;c=o[e+12>>2];o[b+52>>2]=o[e+8>>2];o[b+56>>2]=c;o[b>>2]=2024;break a;case 2:b=yk(112);o[b+4>>2]=c;o[b>>2]=2732;c=o[d+8>>2];f=o[d+12>>2];g=o[d+16>>2];h=o[d+20>>2];i=o[d>>2];j=o[d+4>>2];o[b+40>>2]=0;o[b+32>>2]=0;o[b+36>>2]=0;o[b+24>>2]=g;o[b+28>>2]=h;o[b+16>>2]=c;o[b+20>>2]=f;o[b+8>>2]=i;o[b+12>>2]=j;f=o[d+24>>2];c=o[d+28>>2]-f|0;h:{if(!c){break h}g=c>>2;if(g>>>0>=1073741824){break c}d=yk(c);o[b+32>>2]=d;o[b+36>>2]=d;o[b+40>>2]=d+(g<<2);if((c|0)<1){break h}k=b,l=ll(d,f,c)+c|0,o[k+36>>2]=l}c=o[e+4>>2];o[b+44>>2]=o[e>>2];o[b+48>>2]=c;c=o[e+12>>2];o[b+52>>2]=o[e+8>>2];o[b+56>>2]=c;o[b+60>>2]=0;o[b+64>>2]=0;o[b>>2]=2788;o[b+68>>2]=0;o[b+72>>2]=0;o[b+76>>2]=0;o[b+80>>2]=0;o[b+84>>2]=0;o[b+88>>2]=0;o[b+92>>2]=0;o[b+96>>2]=0;o[b+100>>2]=0;o[b+104>>2]=0;o[b+108>>2]=0;break a;case 3:b=yk(104);o[b+4>>2]=c;o[b>>2]=2732;c=o[d+8>>2];f=o[d+12>>2];g=o[d+16>>2];h=o[d+20>>2];i=o[d>>2];j=o[d+4>>2];o[b+40>>2]=0;o[b+32>>2]=0;o[b+36>>2]=0;o[b+24>>2]=g;o[b+28>>2]=h;o[b+16>>2]=c;o[b+20>>2]=f;o[b+8>>2]=i;o[b+12>>2]=j;f=o[d+24>>2];c=o[d+28>>2]-f|0;i:{if(!c){break i}g=c>>2;if(g>>>0>=1073741824){break b}d=yk(c);o[b+32>>2]=d;o[b+36>>2]=d;o[b+40>>2]=d+(g<<2);if((c|0)<1){break i}k=b,l=ll(d,f,c)+c|0,o[k+36>>2]=l}c=o[e+4>>2];o[b+44>>2]=o[e>>2];o[b+48>>2]=c;c=e+8|0;d=o[c>>2];f=o[c+4>>2];o[b+84>>2]=0;o[b+76>>2]=0;o[b+80>>2]=0;o[b+60>>2]=0;o[b+64>>2]=0;o[b>>2]=3036;o[b+52>>2]=d;o[b+56>>2]=f;d=o[e+4>>2];o[b+88>>2]=o[e>>2];o[b+92>>2]=d;d=o[c+4>>2];o[b+96>>2]=o[c>>2];o[b+100>>2]=d;break a;case 0:case 1:break e;case 4:break f}}f=yk(124);ue(f,c,d,e)}o[a>>2]=f;return}Nk();D()}Nk();D()}Nk();D()}o[a>>2]=b}function If(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,p=0,q=0;g=R-48|0;R=g;d=o[a+8>>2];if(d+ -2>>>0<=28){o[a+72>>2]=d;d=-1<>2]=e;o[a+76>>2]=d^-1;o[a+84>>2]=(e|0)/2}o[a+48>>2]=f;e=o[a+36>>2];d=o[e>>2];f=o[e+4>>2];o[g+16>>2]=0;o[g+8>>2]=0;o[g+12>>2]=0;f=f-d|0;a:{if((f|0)<1){break a}d=o[e>>2];if((d|0)!=o[e+4>>2]){m=a+8|0;n=a+40|0;e=f>>2;p=(e|0)>1?e:1;q=a+88|0;while(1){nf(n,o[(k<<2)+d>>2],g+8|0);e=o[g+12>>2];h=e>>31;f=o[g+8>>2];i=f>>31;l=o[g+16>>2];j=l>>31;d=0;j=j^j+l;h=j+((h^e+h)+(i^f+i)|0)|0;if(h>>>0>>0){d=1}b:{if(!(d|h)){o[g+8>>2]=o[a+84>>2];break b}i=o[a+84>>2];j=i>>31;e=Pl(Ol(i,j,e,e>>31),T,h,d);o[g+12>>2]=e;d=Pl(Ol(i,j,f,f>>31),T,h,d);o[g+8>>2]=d;f=d;d=d>>31;d=(i-(f+d^d)|0)+((e|0)<0?e:0-e|0)|0;if((l|0)>=0){o[g+16>>2]=d;break b}o[g+16>>2]=0-d}d=Uf(q);f=o[g+8>>2];c:{if(!d){e=o[g+12>>2];break c}o[g+16>>2]=0-o[g+16>>2];e=0-o[g+12>>2]|0;o[g+12>>2]=e;f=0-f|0;o[g+8>>2]=f}d:{if((f|0)>=0){d=o[a+84>>2];f=d+o[g+16>>2]|0;d=d+e|0;break d}e:{if((e|0)<=-1){f=o[g+16>>2];d=f>>31;d=d^d+f;break e}f=o[g+16>>2];d=f>>31;d=o[a+80>>2]-(d^d+f)|0}if((f|0)<=-1){f=e;e=e>>31;f=f+e^e;break d}f=e;e=e>>31;f=o[a+80>>2]-(f+e^e)|0}f:{if(!(d|f)){f=o[a+80>>2];e=f;break f}h=o[a+80>>2];g:{h:{i:{if(!d){if((f|0)==(h|0)){e=f;break f}e=0;if(f|h){break i}f=0;break f}if(!((d|0)!=(h|0)|f)){f=d;e=d;break f}if((d|0)!=(h|0)){break g}i=o[a+84>>2];break h}i=o[a+84>>2];if((i|0)<(f|0)){f=(i<<1)-f|0;break f}if(h){break g}}h=d;if((i|0)<=(f|0)){break g}f=(i<<1)-f|0;e=d;break f}j:{if((f|0)!=(h|0)){break j}e=o[a+84>>2];if((e|0)<=(d|0)){break j}e=(e<<1)-d|0;break f}if(f){e=d;break f}f=0;e=o[a+84>>2];if((e|0)>=(d|0)){e=d;break f}e=(e<<1)-d|0}d=k<<3;h=d+b|0;i=o[h+4>>2];h=o[h>>2];o[g+36>>2]=f;o[g+32>>2]=e;o[g+24>>2]=h;o[g+28>>2]=i;Ef(g+40|0,m,g+32|0,g+24|0);d=c+d|0;o[d>>2]=o[g+40>>2];o[d+4>>2]=o[g+44>>2];k=k+1|0;if((p|0)==(k|0)){break a}e=o[a+36>>2];d=o[e>>2];if(o[e+4>>2]-d>>2>>>0>k>>>0){continue}break}}Ok();D()}R=g+48|0;return 1}function Df(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,p=0,q=0;g=R-48|0;R=g;d=o[a+8>>2];if(d+ -2>>>0<=28){o[a+72>>2]=d;d=-1<>2]=e;o[a+76>>2]=d^-1;o[a+84>>2]=(e|0)/2}o[a+48>>2]=f;e=o[a+36>>2];d=o[e>>2];f=o[e+4>>2];o[g+16>>2]=0;o[g+8>>2]=0;o[g+12>>2]=0;f=f-d|0;a:{if((f|0)<1){break a}d=o[e>>2];if((d|0)!=o[e+4>>2]){m=a+8|0;n=a+40|0;e=f>>2;p=(e|0)>1?e:1;q=a+88|0;while(1){Ze(n,o[(k<<2)+d>>2],g+8|0);e=o[g+12>>2];h=e>>31;f=o[g+8>>2];i=f>>31;l=o[g+16>>2];j=l>>31;d=0;j=j^j+l;h=j+((h^e+h)+(i^f+i)|0)|0;if(h>>>0>>0){d=1}b:{if(!(d|h)){o[g+8>>2]=o[a+84>>2];break b}i=o[a+84>>2];j=i>>31;e=Pl(Ol(i,j,e,e>>31),T,h,d);o[g+12>>2]=e;d=Pl(Ol(i,j,f,f>>31),T,h,d);o[g+8>>2]=d;f=d;d=d>>31;d=(i-(f+d^d)|0)+((e|0)<0?e:0-e|0)|0;if((l|0)>=0){o[g+16>>2]=d;break b}o[g+16>>2]=0-d}d=Uf(q);f=o[g+8>>2];c:{if(!d){e=o[g+12>>2];break c}o[g+16>>2]=0-o[g+16>>2];e=0-o[g+12>>2]|0;o[g+12>>2]=e;f=0-f|0;o[g+8>>2]=f}d:{if((f|0)>=0){d=o[a+84>>2];f=d+o[g+16>>2]|0;d=d+e|0;break d}e:{if((e|0)<=-1){f=o[g+16>>2];d=f>>31;d=d^d+f;break e}f=o[g+16>>2];d=f>>31;d=o[a+80>>2]-(d^d+f)|0}if((f|0)<=-1){f=e;e=e>>31;f=f+e^e;break d}f=e;e=e>>31;f=o[a+80>>2]-(f+e^e)|0}f:{if(!(d|f)){f=o[a+80>>2];e=f;break f}h=o[a+80>>2];g:{h:{i:{if(!d){if((f|0)==(h|0)){e=f;break f}e=0;if(f|h){break i}f=0;break f}if(!((d|0)!=(h|0)|f)){f=d;e=d;break f}if((d|0)!=(h|0)){break g}i=o[a+84>>2];break h}i=o[a+84>>2];if((i|0)<(f|0)){f=(i<<1)-f|0;break f}if(h){break g}}h=d;if((i|0)<=(f|0)){break g}f=(i<<1)-f|0;e=d;break f}j:{if((f|0)!=(h|0)){break j}e=o[a+84>>2];if((e|0)<=(d|0)){break j}e=(e<<1)-d|0;break f}if(f){e=d;break f}f=0;e=o[a+84>>2];if((e|0)>=(d|0)){e=d;break f}e=(e<<1)-d|0}d=k<<3;h=d+b|0;i=o[h+4>>2];h=o[h>>2];o[g+36>>2]=f;o[g+32>>2]=e;o[g+24>>2]=h;o[g+28>>2]=i;Ef(g+40|0,m,g+32|0,g+24|0);d=c+d|0;o[d>>2]=o[g+40>>2];o[d+4>>2]=o[g+44>>2];k=k+1|0;if((p|0)==(k|0)){break a}e=o[a+36>>2];d=o[e>>2];if(o[e+4>>2]-d>>2>>>0>k>>>0){continue}break}}Ok();D()}R=g+48|0;return 1}function Hi(a){var b=0,c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,n=0,p=0,q=0,r=0,s=0;f=R-32|0;R=f;n=o[a>>2];c=o[a+4>>2];m[f|0]=0;p=Ki(f+16|0,c-n>>2,f);o[f+8>>2]=0;o[f>>2]=0;o[f+4>>2]=0;g=o[a>>2];b=o[a+4>>2];a:{b:{while(1){c:{r=0;j=0;if((b|0)==(g|0)){break c}while(1){h=o[p>>2];d:{if(o[h+(j>>>3&536870908)>>2]>>>(j&31)&1){break d}i=o[f>>2];o[f+4>>2]=i;b=j;while(1){e:{c=b+1|0;n=b;c=(c>>>0)%3|0?c:b+ -2|0;if((c|0)==-1){break e}d=o[o[a+12>>2]+(c<<2)>>2];if((d|0)==-1){break e}c=d+1|0;b=(c>>>0)%3|0?c:d+ -2|0;if((j|0)==(b|0)|(b|0)==-1){break e}if(!(o[(b>>>3&536870908)+h>>2]>>>(b&31)&1)){continue}}break}d=i;b=d;e=n;while(1){c=(e>>>3&536870908)+h|0;o[c>>2]=o[c>>2]|1<<(e&31);c=e+1|0;c=(c>>>0)%3|0?c:e+ -2|0;l=((e>>>0)%3|0?-1:2)+e|0;if((b|0)!=(d|0)){h=o[(c<<2)+g>>2];while(1){f:{if((h|0)!=o[b>>2]){break f}e=-1;k=o[b+4>>2];e=(l|0)!=-1?o[o[a+12>>2]+(l<<2)>>2]:e;if((k|0)==(e|0)){break f}d=-1;d=(k|0)!=-1?o[o[a+12>>2]+(k<<2)>>2]:d;if((e|0)!=-1){o[o[a+12>>2]+(e<<2)>>2]=-1}c=o[a+12>>2];if((d|0)!=-1){o[c+(d<<2)>>2]=-1}o[c+(l<<2)>>2]=-1;o[c+(k<<2)>>2]=-1;r=1;break d}b=b+8|0;if((d|0)!=(b|0)){continue}break}}k=l<<2;h=o[k+g>>2];b=o[f+8>>2];g:{if((b|0)!=(d|0)){o[d>>2]=h;o[d+4>>2]=c;o[f+4>>2]=o[f+4>>2]+8;break g}q=d-i|0;d=q>>3;g=d+1|0;if(g>>>0>=536870912){break b}s=d<<3;e=b-i|0;b=e>>2;g=e>>3>>>0<268435455?b>>>0>>0?g:b:536870911;d=0;h:{if(!g){break h}if(g>>>0>=536870912){break a}d=yk(g<<3)}e=s+d|0;b=e;o[b>>2]=h;o[b+4>>2]=c;b=d+(g<<3)|0;c=e+8|0;if((q|0)>=1){ll(d,i,q)}o[f+8>>2]=b;o[f+4>>2]=c;o[f>>2]=d;if(!i){break g}jl(i)}i:{if((l|0)==-1){break i}c=o[k+o[a+12>>2]>>2];if((c|0)==-1){break i}e=c+((c>>>0)%3|0?-1:2)|0;if((n|0)==(e|0)|(e|0)==-1){break i}g=o[a>>2];h=o[p>>2];d=o[f+4>>2];i=o[f>>2];b=i;continue}break}g=o[a>>2]}j=j+1|0;b=o[a+4>>2];if(j>>>0>2>>>0){continue}break}if(r){continue}}break}a=o[f>>2];if(a){o[f+4>>2]=a;jl(a)}a=o[p>>2];if(a){jl(a)}R=f+32|0;return}Nk();D()}db(10528);D()}function aj(a,b){var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,n=0;d=R-48|0;R=d;c=yk(8);o[c+4>>2]=b;o[c>>2]=0;b=c+8|0;o[d+40>>2]=b;o[d+36>>2]=b;o[d+32>>2]=c;a:{b:{c:{d:{while(1){b=b+ -8|0;i=o[b+4>>2];n=o[b>>2];o[d+36>>2]=b;if(n){o[d+24>>2]=0;o[d+16>>2]=0;o[d+20>>2]=0;j=1;b=o[a>>2];g=o[b+16>>2];f=o[b+12>>2];c=o[b+20>>2];e:{if((f|0)<(c|0)?1:(f|0)<=(c|0)?r[b+8>>2]>g>>>0?0:1:0){break e}e=p[g+o[b>>2]|0];f=g+1|0;if(f>>>0<1){c=c+1|0}o[b+16>>2]=f;o[b+20>>2]=c;Gk(d+16|0,e);if(e){f=o[a>>2];l=Kk(d+16|0);h=o[f+12>>2];g=o[f+20>>2];k=o[f+16>>2];b=e;c=k+b|0;if(c>>>0>>0){g=g+1|0}if((h|0)<(g|0)?1:(h|0)<=(g|0)?r[f+8>>2]>=c>>>0?0:1:0){break e}ll(l,k+o[f>>2]|0,e);c=f;f=c;g=o[c+20>>2];e=b+o[c+16>>2]|0;if(e>>>0>>0){g=g+1|0}o[f+16>>2]=e;o[c+20>>2]=g}i=yk(24);b=i;o[b+4>>2]=0;o[b+8>>2]=0;o[b+16>>2]=0;o[b+20>>2]=0;o[b>>2]=b+4;o[b+12>>2]=b+16;o[d+8>>2]=b;oj(n,d+16|0,d+8|0);b=o[d+8>>2];j=0;o[d+8>>2]=0;if(!b){break e}Kc(b+12|0,o[b+16>>2]);Lc(b,o[b+4>>2]);jl(b)}if(m[d+27|0]<=-1){jl(o[d+16>>2])}if(j){break b}}if(!i){break b}o[d+16>>2]=0;if(!bj(1,d+16|0,o[a>>2])){break b}b=0;c=o[d+16>>2];if(c){while(1){if(!cj(a,i)){break b}b=b+1|0;if((c|0)!=(b|0)){continue}break}}o[d+4>>2]=0;if(!bj(1,d+4|0,o[a>>2])){break b}g=o[d+4>>2];if(g){j=0;while(1){b=o[d+36>>2];c=o[d+40>>2];f:{if(b>>>0>>0){o[b+4>>2]=0;o[b>>2]=i;o[d+36>>2]=o[d+36>>2]+8;break f}h=o[d+32>>2];l=b-h|0;b=l>>3;k=b+1|0;if(k>>>0>=536870912){break d}f=b<<3;e=c-h|0;c=e>>2;e=e>>3>>>0<268435455?c>>>0>>0?k:c:536870911;b=0;g:{if(!e){break g}if(e>>>0>=536870912){break c}b=yk(e<<3)}c=f+b|0;o[c+4>>2]=0;o[c>>2]=i;e=b+(e<<3)|0;c=c+8|0;if((l|0)>=1){ll(b,h,l)}o[d+40>>2]=e;o[d+36>>2]=c;o[d+32>>2]=b;if(!h){break f}jl(h)}j=j+1|0;if((g|0)!=(j|0)){continue}break}}b=o[d+36>>2];c=o[d+32>>2];if((b|0)!=(c|0)){continue}break}a=1;break a}Nk();D()}db(10856);D()}c=o[d+32>>2];a=0}if(c){o[d+36>>2]=c;jl(c)}R=d+48|0;return a}function ke(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,q=0,s=0,t=0;a:{q=l[o[o[a>>2]+44>>2]](a)|0;if((q|0)<1){break a}h=o[b+4>>2]-o[b>>2]>>2;le(a,h,q);d=o[a+16>>2];if(!o[d+80>>2]){break a}f=o[o[d>>2]>>2];if(!f){break a}j=o[c+8>>2];i=o[c+16>>2];g=o[c+12>>2];k=g;e=o[c+20>>2];if((k|0)<(e|0)?1:(k|0)<=(e|0)?j>>>0>i>>>0?0:1:0){break a}k=u(h,q);n=f+o[d+48>>2]|0;s=o[c>>2];t=p[s+i|0];h=c;d=e;f=i+1|0;if(f>>>0<1){d=d+1|0}m=f;f=d;o[h+16>>2]=m;o[h+20>>2]=d;b:{c:{d:{if(t){if(dg(k,q,c,n)){break d}break a}if((g|0)<(f|0)?1:(g|0)<=(f|0)?j>>>0>m>>>0?0:1:0){break a}h=p[m+s|0];d=e;e=i+2|0;if(e>>>0<2){d=d+1|0}o[c+16>>2]=e;o[c+20>>2]=d;d=xi(5);e=o[o[a+16>>2]+64>>2];e=o[e+4>>2]-o[e>>2]|0;e:{if((d|0)==(h|0)){h=k<<2;if(e>>>0>>0){break a}f=o[c+12>>2];d=o[c+20>>2];i=o[c+16>>2];e=h;g=i+e|0;if(g>>>0>>0){d=d+1|0}if((f|0)>(d|0)?1:(f|0)>=(d|0)?r[c+8>>2]>>0?0:1:0){break e}break a}if(e>>>0>>0){break a}i=o[c+12>>2];d=o[c+20>>2];j=o[c+8>>2];f=j;m=o[c+16>>2];g=m;e=h;t=f-g>>>0>=Ol(e,0,k,0)>>>0?0:1;f=i-(d+(f>>>0>>0)|0)|0;g=T;if((f|0)<(g|0)?1:(f|0)<=(g|0)?t:0){break a}f=0;if(!k){break c}g=0;f=j;j=e+m|0;if(j>>>0>>0){d=d+1|0}if((i|0)<(d|0)?1:(i|0)<=(d|0)?f>>>0>=j>>>0?0:1:0){break b}j=0;while(1){ll(n+(j<<2)|0,m+o[c>>2]|0,h);d=o[c+20>>2];m=e+o[c+16>>2]|0;if(m>>>0>>0){d=d+1|0}o[c+16>>2]=m;o[c+20>>2]=d;j=j+1|0;if((k|0)==(j|0)){break d}i=o[c+12>>2];s=e+m|0;if(s>>>0>>0){d=d+1|0}if((i|0)>(d|0)?1:(i|0)>=(d|0)?r[c+8>>2]>>0?0:1:0){continue}break}break b}ll(n,i+o[c>>2]|0,h);d=o[c+20>>2];f=e+o[c+16>>2]|0;if(f>>>0>>0){d=d+1|0}o[c+16>>2]=f;o[c+20>>2]=d}f=0;if(!k){break c}e=o[a+20>>2];if(e){f=1;if(l[o[o[e>>2]+32>>2]](e)){break c}}ni(n,k,n);f=1}e=o[a+20>>2];f:{if(!e){break f}if(!l[o[o[e>>2]+40>>2]](e,c)){break a}if(!f){break f}g=0;a=o[a+20>>2];if(!l[o[o[a>>2]+44>>2]](a,n,n,k,q,o[b>>2])){break b}}g=1}return g|0}return 0}function Qg(a,b,c){var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,n=0;d=R+ -64|0;R=d;f=o[o[b+4>>2]+44>>2];e=yk(80);o[e+12>>2]=0;o[e+16>>2]=0;o[e>>2]=9408;o[e+4>>2]=0;o[e+76>>2]=0;o[e+72>>2]=c;o[e+68>>2]=f;o[e+64>>2]=0;o[e+56>>2]=0;o[e+60>>2]=0;o[e+8>>2]=9572;g=e+20|0;o[g>>2]=0;o[g+4>>2]=0;l=e+28|0;i=l;o[i>>2]=0;o[i+4>>2]=0;o[e+36>>2]=0;o[e+40>>2]=0;i=e+44|0;o[i>>2]=0;o[i+4>>2]=0;o[e+52>>2]=0;b=o[b+8>>2];n=d+40|0;j=n;o[j>>2]=0;o[j+4>>2]=0;o[d+32>>2]=0;o[d+36>>2]=0;j=d+16|0;h=j;o[h>>2]=0;o[h+4>>2]=0;o[d+56>>2]=0;o[d+24>>2]=0;o[d+28>>2]=0;o[d+8>>2]=0;o[d+12>>2]=0;o[d+48>>2]=0;o[d+52>>2]=0;o[d>>2]=9572;o[d+4>>2]=b;h=o[b>>2];k=o[b+4>>2];m[d+63|0]=0;eb(d+24|0,(k-h>>2>>>0)/3|0,d+63|0);h=o[d+4>>2];k=o[h+28>>2];h=o[h+24>>2];m[d+63|0]=0;eb(d+36|0,k-h>>2,d+63|0);o[d+20>>2]=e;o[j>>2]=f;f=d+12|0;o[f>>2]=c;o[d+8>>2]=b;o[l>>2]=e;b=o[f+4>>2];o[g>>2]=o[f>>2];o[g+4>>2]=b;b=o[d+8>>2];o[e+12>>2]=o[d+4>>2];o[e+16>>2]=b;a:{b:{c=e;b=o[d+28>>2];if(b){f=e+32|0;c:{if(b>>>0<=o[e+40>>2]<<5>>>0){g=b+ -1>>>5|0;b=o[f>>2];break c}f=o[f>>2];if(f){jl(f);o[e+40>>2]=0;o[e+32>>2]=0;o[e+36>>2]=0;b=o[d+28>>2]}if((b|0)<=-1){break b}g=b+ -1>>>5|0;f=g+1|0;b=yk(f<<2);o[e+40>>2]=f;o[e+36>>2]=0;o[e+32>>2]=b}nl(b,o[d+24>>2],(g<<2)+4|0);b=o[d+28>>2]}else{b=0}o[c+36>>2]=b;j=e;b=o[n>>2];if(b){d:{if(b>>>0<=o[e+52>>2]<<5>>>0){c=b+ -1>>>5|0;b=o[i>>2];break d}c=o[i>>2];if(c){jl(c);o[e+52>>2]=0;o[e+44>>2]=0;o[e+48>>2]=0;b=o[d+40>>2]}if((b|0)<=-1){break a}c=b+ -1>>>5|0;g=c+1|0;b=yk(g<<2);o[e+52>>2]=g;o[e+48>>2]=0;o[e+44>>2]=b}nl(b,o[d+36>>2],(c<<2)+4|0);b=o[d+40>>2]}else{b=0}o[j+48>>2]=b;yd(e+56|0,o[d+48>>2],o[d+52>>2]);o[a>>2]=e;o[d>>2]=9572;a=o[d+48>>2];if(a){o[d+52>>2]=a;jl(a)}o[d>>2]=9388;a=o[d+36>>2];if(a){jl(a)}a=o[d+24>>2];if(a){jl(a)}R=d- -64|0;return}Nk();D()}Nk();D()}function _i(a,b,c){var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,p=0,q=0,r=0,s=0,t=0,v=0;d=u(b,12)+a|0;k=d+12|0;m=d+8|0;o[k>>2]=o[m>>2];i=(c|0)==-1?-1:(c>>>0)/3|0;q=d+16|0;d=0;h=c;a:{b:{c:{while(1){d:{n=d;r=(d|0)!=1;if(!r){if((h|0)==-1){break d}if(($i(a,((h>>>0)%3|0?-1:2)+h|0)|0)==-1){break a}c=h+1|0;d=(c>>>0)%3|0?c:h+ -2|0;if((d|0)==-1){break a}c=d+1|0;c=(c>>>0)%3|0?c:d+ -2|0;if((c|0)==-1){break a}d=o[o[o[a+4>>2]+12>>2]+(c<<2)>>2];if((d|0)==-1){break a}c=d+1|0;c=(c>>>0)%3|0?c:d+ -2|0;if((c|0)==-1){break a}i=(c>>>0)/3|0}j=o[a+56>>2]+(i>>>3&536870908)|0;g=o[j>>2];f=1<<(i&31);e:{if(g&f){break e}d=0;while(1){o[j>>2]=g|f;e=o[k>>2];f=o[q>>2];f:{if((e|0)!=(f|0)){o[e>>2]=i;o[k>>2]=e+4;break f}l=o[m>>2];p=e-l|0;e=p>>2;j=e+1|0;if(j>>>0>=1073741824){break c}s=e<<2;g=f-l|0;f=g>>1;g=g>>2>>>0<536870911?f>>>0>>0?j:f:1073741823;e=0;g:{if(!g){break g}if(g>>>0>=1073741824){break b}e=yk(g<<2)}f=s+e|0;o[f>>2]=i;g=e+(g<<2)|0;f=f+4|0;if((p|0)>=1){ll(e,l,p)}o[m>>2]=e;o[k>>2]=f;o[q>>2]=g;if(!l){break f}jl(l)}e=d+1|0;h:{if(!d){break h}if(e&1){if((c|0)==-1){c=-1;break h}d=c+1|0;c=(d>>>0)%3|0?d:c+ -2|0;break h}h=(n|0)==1?c:h;if((c|0)==-1){c=-1;break h}if((c>>>0)%3){c=c+ -1|0;break h}c=c+2|0}c=$i(a,c);if((c|0)!=-1){d=e;i=(c>>>0)/3|0;j=o[a+56>>2]+(i>>>3&268435452)|0;g=o[j>>2];f=1<<(i&31);if(!(g&f)){continue}}break}if(r|!(e&1)){break e}g=o[k>>2]+ -4|0;f=o[g>>2];e=o[a+56>>2]+(f>>>3&536870908)|0;d=o[e>>2];t=e,v=Sl(f)&d,o[t>>2]=v;o[k>>2]=g}d=1;if(!n){continue}break a}break}h=-1;$i(a,-1);break a}Nk();D()}db(10788);D()}o[((b<<2)+a|0)+44>>2]=h;b=o[k>>2];h=o[m>>2];if((b|0)!=(h|0)){b=b-h>>2;n=b>>>0>1?b:1;e=o[a+56>>2];c=0;while(1){d=o[h+(c<<2)>>2];b=e+(d>>>3&536870908)|0;a=o[b>>2];t=b,v=Sl(d)&a,o[t>>2]=v;c=c+1|0;if((n|0)!=(c|0)){continue}break}}}function Ef(a,b,c,d){var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;k=o[b+12>>2];f=o[c+4>>2]-k|0;e=o[c>>2]-k|0;o[c>>2]=e;o[c+4>>2]=f;g=f>>31;h=g+f^g;g=e>>31;i=o[b+12>>2];l=(h+(g+e^g)|0)<=(i|0);if(!l){a:{b:{if((e|0)>=0){g=1;j=1;if((f|0)>-1){break a}h=1;g=-1;j=-1;if((e|0)>=1){break b}break a}h=-1;g=-1;j=-1;if((f|0)<1){break a}}g=(f|0)<1?-1:1;j=h}h=f<<1;f=u(g,i);h=h-f|0;o[c+4>>2]=h;i=u(i,j);e=(e<<1)-i|0;o[c>>2]=e;c:{if((u(g,j)|0)>=0){h=0-h|0;o[c>>2]=h;e=0-e|0;break c}o[c>>2]=h}f=(e+f|0)/2|0;o[c+4>>2]=f;e=(i+h|0)/2|0;o[c>>2]=e}d:{e:{f:{g:{h:{i:{j:{k:{if(!e){if(f){break j}i=1;j=0;break k}i=1;g=(e|0)<0&(f|0)<1;if((e|0)>=1){j=(f|0)>-1?2:1;if(g){break k}break i}j=(f|0)>0?3:0;if(!g){break i}}g=f;h=e;break d}if((f|0)>=1){break f}break h}g=j+ -1|0;if(g>>>0>2){g=f;f=e;j=0;break e}switch(g-1|0){case 0:break g;case 1:break f;default:break h}}g=0-e|0;j=1;break e}g=0-f|0;f=0-e|0;j=2;break e}g=e;f=0-f|0;j=3}e=c;h=f;o[e>>2]=f;o[e+4>>2]=g;i=0}f=o[d>>2]+h|0;o[a>>2]=f;e=o[d+4>>2]+g|0;o[a+4>>2]=e;g=o[b+12>>2];l:{if((g|0)<(f|0)){f=f-o[b+4>>2]|0;break l}if((f|0)>=(0-g|0)){break l}f=o[b+4>>2]+f|0}o[a>>2]=f;m:{if((g|0)<(e|0)){e=e-o[b+4>>2]|0;break m}if((e|0)>=(0-g|0)){break m}e=o[b+4>>2]+e|0}o[a+4>>2]=e;n:{if(i){c=e;e=f;break n}b=(4-j&3)+ -1|0;o:{if(b>>>0>2){c=e;e=f;break o}p:{switch(b-1|0){default:c=0-f|0;break o;case 0:c=0-e|0;e=0-f|0;break o;case 1:break p}}e=0-e|0;c=f}o[a>>2]=e;o[a+4>>2]=c}if(!l){q:{r:{if((e|0)>=0){b=1;i=1;if((c|0)>-1){break q}f=1;b=-1;i=-1;if((e|0)>=1){break r}break q}f=-1;b=-1;i=-1;if((c|0)<1){break q}}b=(c|0)<1?-1:1;i=f}d=c<<1;c=u(b,g);f=d-c|0;o[a+4>>2]=f;d=u(g,i);e=(e<<1)-d|0;o[a>>2]=e;s:{if((u(b,i)|0)>=0){f=0-f|0;o[a>>2]=f;e=0-e|0;break s}o[a>>2]=f}c=(c+e|0)/2|0;o[a+4>>2]=c;e=(d+f|0)/2|0;o[a>>2]=e}o[a>>2]=e+k;o[a+4>>2]=c+k}function Vh(a,b){var c=0,d=0,e=0;o[a>>2]=o[b>>2];o[a+4>>2]=o[b+4>>2];o[a+8>>2]=o[b+8>>2];c=b+12|0;o[a+12>>2]=o[c>>2];o[c>>2]=0;o[b+4>>2]=0;o[b+8>>2]=0;c=b+16|0;o[a+16>>2]=o[c>>2];o[a+20>>2]=o[b+20>>2];d=b+24|0;o[a+24>>2]=o[d>>2];o[d>>2]=0;o[c>>2]=0;o[c+4>>2]=0;d=p[b+28|0];e=a+40|0;o[e>>2]=0;c=a+32|0;o[c>>2]=0;o[c+4>>2]=0;m[a+28|0]=d;d=c;c=b+32|0;o[d>>2]=o[c>>2];o[a+36>>2]=o[b+36>>2];d=b+40|0;o[e>>2]=o[d>>2];o[d>>2]=0;o[c>>2]=0;o[c+4>>2]=0;d=a+52|0;o[d>>2]=0;c=a+44|0;o[c>>2]=0;o[c+4>>2]=0;e=c;c=b+44|0;o[e>>2]=o[c>>2];o[a+48>>2]=o[b+48>>2];e=d;d=b+52|0;o[e>>2]=o[d>>2];o[d>>2]=0;o[c>>2]=0;o[c+4>>2]=0;d=a- -64|0;o[d>>2]=0;c=a+56|0;o[c>>2]=0;o[c+4>>2]=0;e=c;c=b+56|0;o[e>>2]=o[c>>2];o[a+60>>2]=o[b+60>>2];e=d;d=b- -64|0;o[e>>2]=o[d>>2];o[d>>2]=0;o[c>>2]=0;o[c+4>>2]=0;o[a+68>>2]=o[b+68>>2];d=o[b+72>>2];e=a+84|0;o[e>>2]=0;c=a+76|0;o[c>>2]=0;o[c+4>>2]=0;o[a+72>>2]=d;d=c;c=b+76|0;o[d>>2]=o[c>>2];o[a+80>>2]=o[b+80>>2];d=b+84|0;o[e>>2]=o[d>>2];o[d>>2]=0;o[c>>2]=0;o[c+4>>2]=0;d=a+96|0;o[d>>2]=0;c=a+88|0;o[c>>2]=0;o[c+4>>2]=0;e=c;c=b+88|0;o[e>>2]=o[c>>2];o[a+92>>2]=o[b+92>>2];e=d;d=b+96|0;o[e>>2]=o[d>>2];o[d>>2]=0;o[c>>2]=0;o[c+4>>2]=0;c=p[b+100|0];d=a+112|0;o[d>>2]=0;o[a+104>>2]=0;o[a+108>>2]=0;m[a+100|0]=c;o[a+104>>2]=o[b+104>>2];o[a+108>>2]=o[b+108>>2];c=b+112|0;o[d>>2]=o[c>>2];o[c>>2]=0;o[b+104>>2]=0;o[b+108>>2]=0;d=a+124|0;o[d>>2]=0;c=a+116|0;o[c>>2]=0;o[c+4>>2]=0;e=c;c=b+116|0;o[e>>2]=o[c>>2];o[a+120>>2]=o[b+120>>2];e=d;d=b+124|0;o[e>>2]=o[d>>2];o[d>>2]=0;o[c>>2]=0;o[c+4>>2]=0;c=o[b+128>>2];d=a+140|0;o[d>>2]=0;o[a+132>>2]=0;o[a+136>>2]=0;o[a+128>>2]=c;o[a+132>>2]=o[b+132>>2];o[a+136>>2]=o[b+136>>2];c=b+140|0;o[d>>2]=o[c>>2];o[c>>2]=0;o[b+132>>2]=0;o[b+136>>2]=0;return a}function bh(a,b){var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,p=0;h=R-16|0;R=h;o[h>>2]=b;g=-1;a:{if((b|0)==-1){o[h+4>>2]=-1;break a}c=b+1|0;o[h+4>>2]=(c>>>0)%3|0?c:b+ -2|0;if((b>>>0)%3){g=b+ -1|0;break a}g=b+2|0}o[h+8>>2]=g;p=(b|0)==-1?-1:(b>>>0)/3|0;b:{c:{d:{e:{while(1){f:{g:{if((b|0)!=-1){c=o[o[o[a+8>>2]+12>>2]+(b<<2)>>2];if((c|0)!=-1){break g}}g=0;c=o[a+216>>2];if((c|0)==o[a+220>>2]){break f}while(1){f=u(g,144)+c|0;i=f+136|0;c=o[i>>2];k=f+140|0;d=o[k>>2];h:{if(c>>>0>>0){o[c>>2]=b;o[i>>2]=c+4;break h}l=f+132|0;f=o[l>>2];j=c-f|0;c=j>>2;e=c+1|0;if(e>>>0>=1073741824){break e}m=c<<2;d=d-f|0;c=d>>1;e=d>>2>>>0<536870911?c>>>0>>0?e:c:1073741823;c=0;i:{if(!e){break i}if(e>>>0>=1073741824){break d}c=yk(e<<2)}d=m+c|0;o[d>>2]=b;e=c+(e<<2)|0;d=d+4|0;if((j|0)>=1){ll(c,f,j)}o[l>>2]=c;o[i>>2]=d;o[k>>2]=e;if(!f){break h}jl(f)}g=g+1|0;c=o[a+216>>2];if(g>>>0<(o[a+220>>2]-c|0)/144>>>0){continue}break}break f}if((c>>>0)/3>>>0

>>0){break f}g=0;if(o[a+220>>2]==o[a+216>>2]){break f}while(1){j:{if(!Uf(o[a+368>>2]+(g<<4)|0)){break j}f=o[a+216>>2]+u(g,144)|0;i=f+136|0;c=o[i>>2];k=f+140|0;d=o[k>>2];if(c>>>0>>0){o[c>>2]=b;o[i>>2]=c+4;break j}l=f+132|0;f=o[l>>2];j=c-f|0;c=j>>2;e=c+1|0;if(e>>>0>=1073741824){break c}m=c<<2;d=d-f|0;c=d>>1;e=d>>2>>>0<536870911?c>>>0>>0?e:c:1073741823;c=0;k:{if(!e){break k}if(e>>>0>=1073741824){break b}c=yk(e<<2)}d=m+c|0;o[d>>2]=b;e=c+(e<<2)|0;d=d+4|0;if((j|0)>=1){ll(c,f,j)}o[l>>2]=c;o[i>>2]=d;o[k>>2]=e;if(!f){break j}jl(f)}g=g+1|0;if(g>>>0<(o[a+220>>2]-o[a+216>>2]|0)/144>>>0){continue}break}}n=n+1|0;if((n|0)!=3){b=o[(n<<2)+h>>2];continue}break}R=h+16|0;return 1}Nk();D()}db(8832);D()}Nk();D()}db(8832);D()}function yj(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,i=0;a:{if((b|0)<0){break a}c=o[a+12>>2];d=o[a+8>>2];if(c-d>>2>>>0<=b>>>0){break a}d=d+(b<<2)|0;e=o[d>>2];h=o[e+60>>2];f=o[e+56>>2];e=d+4|0;b:{if((e|0)!=(c|0)){while(1){i=o[e>>2];o[e>>2]=0;g=o[d>>2];o[d>>2]=i;if(g){Kb(g)}d=d+4|0;e=e+4|0;if((e|0)!=(c|0)){continue}break}c=o[a+12>>2];if((d|0)==(c|0)){break b}}while(1){c=c+ -4|0;e=o[c>>2];o[c>>2]=0;if(e){Kb(e)}if((c|0)!=(d|0)){continue}break}}o[a+12>>2]=d;c=o[a+4>>2];if(c){zj(c,h)}c:{if((f|0)>4){break c}d:{d=u(f,12)+a|0;c=o[d+20>>2];e=d+24|0;d=o[e>>2];if((c|0)==(d|0)){break d}while(1){if(o[c>>2]==(b|0)){break d}c=c+4|0;if((d|0)!=(c|0)){continue}break}break c}if((c|0)==(d|0)){break c}f=c+4|0;d=d-f|0;g=d>>2;if(d){nl(c,f,d)}o[e>>2]=(g<<2)+c}c=o[a+24>>2];d=o[a+20>>2];if((c|0)!=(d|0)){c=c-d>>2;e=c>>>0>1?c:1;c=0;while(1){f=d+(c<<2)|0;g=o[f>>2];if((g|0)>(b|0)){o[f>>2]=g+ -1}c=c+1|0;if((e|0)!=(c|0)){continue}break}}c=o[a+36>>2];d=o[a+32>>2];if((c|0)!=(d|0)){c=c-d>>2;e=c>>>0>1?c:1;c=0;while(1){f=d+(c<<2)|0;g=o[f>>2];if((g|0)>(b|0)){o[f>>2]=g+ -1}c=c+1|0;if((e|0)!=(c|0)){continue}break}}c=o[a+48>>2];d=o[a+44>>2];if((c|0)!=(d|0)){c=c-d>>2;e=c>>>0>1?c:1;c=0;while(1){f=d+(c<<2)|0;g=o[f>>2];if((g|0)>(b|0)){o[f>>2]=g+ -1}c=c+1|0;if((e|0)!=(c|0)){continue}break}}c=o[a+60>>2];d=o[a+56>>2];if((c|0)!=(d|0)){c=c-d>>2;e=c>>>0>1?c:1;c=0;while(1){f=d+(c<<2)|0;g=o[f>>2];if((g|0)>(b|0)){o[f>>2]=g+ -1}c=c+1|0;if((e|0)!=(c|0)){continue}break}}c=o[a+72>>2];a=o[a+68>>2];if((c|0)==(a|0)){break a}c=c-a>>2;d=c>>>0>1?c:1;c=0;while(1){e=a+(c<<2)|0;f=o[e>>2];if((f|0)>(b|0)){o[e>>2]=f+ -1}c=c+1|0;if((d|0)!=(c|0)){continue}break}}}function pg(a,b,c){var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;d=R+ -64|0;R=d;o[d+48>>2]=0;o[d+40>>2]=0;o[d+44>>2]=0;o[d+32>>2]=0;o[d+36>>2]=0;o[d+24>>2]=0;o[d+28>>2]=0;o[d+16>>2]=0;o[d+20>>2]=0;o[d+8>>2]=0;o[d+12>>2]=0;o[d>>2]=0;o[d+4>>2]=0;a:{if(!yg(d,b)|(o[d+12>>2]?0:a)){break a}if(!sg(1,d+56|0,b)){break a}f=o[b+8>>2];l=o[b+16>>2];g=l;j=f-g|0;i=o[d+60>>2];e=i;k=o[b+20>>2];g=o[b+12>>2]-(k+(f>>>0>>0)|0)|0;f=o[d+56>>2];if((e|0)==(g|0)&f>>>0>j>>>0|e>>>0>g>>>0){break a}i=i+k|0;g=l;k=g+f|0;if(k>>>0>>0){i=i+1|0}o[b+16>>2]=k;o[b+20>>2]=i;if((f|0)<1){break a}j=l+o[b>>2]|0;o[d+40>>2]=j;g=d;b:{c:{d:{e:{f:{b=f+ -1|0;e=j+b|0;switch((p[e|0]>>>6|0)-1|0){case 2:break d;case 1:break e;case 0:break f;default:break c}}if((f|0)<2){break a}b=f+ -2|0;o[d+44>>2]=b;e=(f+j|0)+ -2|0;e=p[e+1|0]<<8&16128|p[e|0];break b}if((f|0)<3){break a}b=f+ -3|0;o[d+44>>2]=b;e=(f+j|0)+ -3|0;e=p[e+1|0]<<8|p[e+2|0]<<16&4128768|p[e|0];break b}b=f+ -4|0;o[d+44>>2]=b;e=(f+j|0)+ -4|0;e=p[e+2|0]<<16|p[e+3|0]<<24&1056964608|p[e+1|0]<<8|p[e|0];break b}o[d+44>>2]=b;e=p[e|0]&63}h=e+4194304|0;o[g+48>>2]=h;m=h>>>0<1073741824;if(!a|h>>>0>1073741823){break a}k=o[d+28>>2];i=0;l=o[d+16>>2];while(1){g:{if(h>>>0>4194303){break g}while(1){if((b|0)<1){break g}b=b+ -1|0;o[d+44>>2]=b;h=p[b+j|0]|h<<8;o[d+48>>2]=h;if(h>>>0<4194304){continue}break}}f=h&1048575;e=o[(f<<2)+l>>2];g=(e<<3)+k|0;h=(u(o[g>>2],h>>>20|0)+f|0)-o[g+4>>2]|0;o[d+48>>2]=h;o[(i<<2)+c>>2]=e;m=1;i=i+1|0;if((i|0)!=(a|0)){continue}break}}a=o[d+28>>2];if(a){o[d+32>>2]=a;jl(a)}a=o[d+16>>2];if(a){o[d+20>>2]=a;jl(a)}a=o[d>>2];if(a){o[d+4>>2]=a;jl(a)}R=d- -64|0;return m}function ng(a,b,c){var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;d=R+ -64|0;R=d;o[d+48>>2]=0;o[d+40>>2]=0;o[d+44>>2]=0;o[d+32>>2]=0;o[d+36>>2]=0;o[d+24>>2]=0;o[d+28>>2]=0;o[d+16>>2]=0;o[d+20>>2]=0;o[d+8>>2]=0;o[d+12>>2]=0;o[d>>2]=0;o[d+4>>2]=0;a:{if(!wg(d,b)|(o[d+12>>2]?0:a)){break a}if(!sg(1,d+56|0,b)){break a}f=o[b+8>>2];l=o[b+16>>2];g=l;j=f-g|0;i=o[d+60>>2];e=i;k=o[b+20>>2];g=o[b+12>>2]-(k+(f>>>0>>0)|0)|0;f=o[d+56>>2];if((e|0)==(g|0)&f>>>0>j>>>0|e>>>0>g>>>0){break a}i=i+k|0;g=l;k=g+f|0;if(k>>>0>>0){i=i+1|0}o[b+16>>2]=k;o[b+20>>2]=i;if((f|0)<1){break a}j=l+o[b>>2]|0;o[d+40>>2]=j;g=d;b:{c:{d:{e:{f:{b=f+ -1|0;e=j+b|0;switch((p[e|0]>>>6|0)-1|0){case 2:break d;case 1:break e;case 0:break f;default:break c}}if((f|0)<2){break a}b=f+ -2|0;o[d+44>>2]=b;e=(f+j|0)+ -2|0;e=p[e+1|0]<<8&16128|p[e|0];break b}if((f|0)<3){break a}b=f+ -3|0;o[d+44>>2]=b;e=(f+j|0)+ -3|0;e=p[e+1|0]<<8|p[e+2|0]<<16&4128768|p[e|0];break b}b=f+ -4|0;o[d+44>>2]=b;e=(f+j|0)+ -4|0;e=p[e+2|0]<<16|p[e+3|0]<<24&1056964608|p[e+1|0]<<8|p[e|0];break b}o[d+44>>2]=b;e=p[e|0]&63}h=e- -1048576|0;o[g+48>>2]=h;m=h>>>0<268435456;if(!a|h>>>0>268435455){break a}k=o[d+28>>2];i=0;l=o[d+16>>2];while(1){g:{if(h>>>0>1048575){break g}while(1){if((b|0)<1){break g}b=b+ -1|0;o[d+44>>2]=b;h=p[b+j|0]|h<<8;o[d+48>>2]=h;if(h>>>0<1048576){continue}break}}f=h&262143;e=o[(f<<2)+l>>2];g=(e<<3)+k|0;h=(u(o[g>>2],h>>>18|0)+f|0)-o[g+4>>2]|0;o[d+48>>2]=h;o[(i<<2)+c>>2]=e;m=1;i=i+1|0;if((i|0)!=(a|0)){continue}break}}a=o[d+28>>2];if(a){o[d+32>>2]=a;jl(a)}a=o[d+16>>2];if(a){o[d+20>>2]=a;jl(a)}a=o[d>>2];if(a){o[d+4>>2]=a;jl(a)}R=d- -64|0;return m}function og(a,b,c){var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;d=R+ -64|0;R=d;o[d+48>>2]=0;o[d+40>>2]=0;o[d+44>>2]=0;o[d+32>>2]=0;o[d+36>>2]=0;o[d+24>>2]=0;o[d+28>>2]=0;o[d+16>>2]=0;o[d+20>>2]=0;o[d+8>>2]=0;o[d+12>>2]=0;o[d>>2]=0;o[d+4>>2]=0;a:{if(!xg(d,b)|(o[d+12>>2]?0:a)){break a}if(!sg(1,d+56|0,b)){break a}f=o[b+8>>2];l=o[b+16>>2];g=l;j=f-g|0;i=o[d+60>>2];e=i;k=o[b+20>>2];g=o[b+12>>2]-(k+(f>>>0>>0)|0)|0;f=o[d+56>>2];if((e|0)==(g|0)&f>>>0>j>>>0|e>>>0>g>>>0){break a}i=i+k|0;g=l;k=g+f|0;if(k>>>0>>0){i=i+1|0}o[b+16>>2]=k;o[b+20>>2]=i;if((f|0)<1){break a}j=l+o[b>>2]|0;o[d+40>>2]=j;g=d;b:{c:{d:{e:{f:{b=f+ -1|0;e=j+b|0;switch((p[e|0]>>>6|0)-1|0){case 2:break d;case 1:break e;case 0:break f;default:break c}}if((f|0)<2){break a}b=f+ -2|0;o[d+44>>2]=b;e=(f+j|0)+ -2|0;e=p[e+1|0]<<8&16128|p[e|0];break b}if((f|0)<3){break a}b=f+ -3|0;o[d+44>>2]=b;e=(f+j|0)+ -3|0;e=p[e+1|0]<<8|p[e+2|0]<<16&4128768|p[e|0];break b}b=f+ -4|0;o[d+44>>2]=b;e=(f+j|0)+ -4|0;e=p[e+2|0]<<16|p[e+3|0]<<24&1056964608|p[e+1|0]<<8|p[e|0];break b}o[d+44>>2]=b;e=p[e|0]&63}h=e+2097152|0;o[g+48>>2]=h;m=h>>>0<536870912;if(!a|h>>>0>536870911){break a}k=o[d+28>>2];i=0;l=o[d+16>>2];while(1){g:{if(h>>>0>2097151){break g}while(1){if((b|0)<1){break g}b=b+ -1|0;o[d+44>>2]=b;h=p[b+j|0]|h<<8;o[d+48>>2]=h;if(h>>>0<2097152){continue}break}}f=h&524287;e=o[(f<<2)+l>>2];g=(e<<3)+k|0;h=(u(o[g>>2],h>>>19|0)+f|0)-o[g+4>>2]|0;o[d+48>>2]=h;o[(i<<2)+c>>2]=e;m=1;i=i+1|0;if((i|0)!=(a|0)){continue}break}}a=o[d+28>>2];if(a){o[d+32>>2]=a;jl(a)}a=o[d+16>>2];if(a){o[d+20>>2]=a;jl(a)}a=o[d>>2];if(a){o[d+4>>2]=a;jl(a)}R=d- -64|0;return m}function mg(a,b,c){var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;d=R+ -64|0;R=d;o[d+48>>2]=0;o[d+40>>2]=0;o[d+44>>2]=0;o[d+32>>2]=0;o[d+36>>2]=0;o[d+24>>2]=0;o[d+28>>2]=0;o[d+16>>2]=0;o[d+20>>2]=0;o[d+8>>2]=0;o[d+12>>2]=0;o[d>>2]=0;o[d+4>>2]=0;a:{if(!vg(d,b)|(o[d+12>>2]?0:a)){break a}if(!sg(1,d+56|0,b)){break a}f=o[b+8>>2];l=o[b+16>>2];g=l;j=f-g|0;i=o[d+60>>2];e=i;k=o[b+20>>2];g=o[b+12>>2]-(k+(f>>>0>>0)|0)|0;f=o[d+56>>2];if((e|0)==(g|0)&f>>>0>j>>>0|e>>>0>g>>>0){break a}i=i+k|0;g=l;k=g+f|0;if(k>>>0>>0){i=i+1|0}o[b+16>>2]=k;o[b+20>>2]=i;if((f|0)<1){break a}j=l+o[b>>2]|0;o[d+40>>2]=j;g=d;b:{c:{d:{e:{f:{b=f+ -1|0;e=j+b|0;switch((p[e|0]>>>6|0)-1|0){case 2:break d;case 1:break e;case 0:break f;default:break c}}if((f|0)<2){break a}b=f+ -2|0;o[d+44>>2]=b;e=(f+j|0)+ -2|0;e=p[e+1|0]<<8&16128|p[e|0];break b}if((f|0)<3){break a}b=f+ -3|0;o[d+44>>2]=b;e=(f+j|0)+ -3|0;e=p[e+1|0]<<8|p[e+2|0]<<16&4128768|p[e|0];break b}b=f+ -4|0;o[d+44>>2]=b;e=(f+j|0)+ -4|0;e=p[e+2|0]<<16|p[e+3|0]<<24&1056964608|p[e+1|0]<<8|p[e|0];break b}o[d+44>>2]=b;e=p[e|0]&63}h=e+262144|0;o[g+48>>2]=h;m=h>>>0<67108864;if(!a|h>>>0>67108863){break a}k=o[d+28>>2];i=0;l=o[d+16>>2];while(1){g:{if(h>>>0>262143){break g}while(1){if((b|0)<1){break g}b=b+ -1|0;o[d+44>>2]=b;h=p[b+j|0]|h<<8;o[d+48>>2]=h;if(h>>>0<262144){continue}break}}f=h&65535;e=o[(f<<2)+l>>2];g=(e<<3)+k|0;h=(u(o[g>>2],h>>>16|0)+f|0)-o[g+4>>2]|0;o[d+48>>2]=h;o[(i<<2)+c>>2]=e;m=1;i=i+1|0;if((i|0)!=(a|0)){continue}break}}a=o[d+28>>2];if(a){o[d+32>>2]=a;jl(a)}a=o[d+16>>2];if(a){o[d+20>>2]=a;jl(a)}a=o[d>>2];if(a){o[d+4>>2]=a;jl(a)}R=d- -64|0;return m}function lg(a,b,c){var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;d=R+ -64|0;R=d;o[d+48>>2]=0;o[d+40>>2]=0;o[d+44>>2]=0;o[d+32>>2]=0;o[d+36>>2]=0;o[d+24>>2]=0;o[d+28>>2]=0;o[d+16>>2]=0;o[d+20>>2]=0;o[d+8>>2]=0;o[d+12>>2]=0;o[d>>2]=0;o[d+4>>2]=0;a:{if(!ug(d,b)|(o[d+12>>2]?0:a)){break a}if(!sg(1,d+56|0,b)){break a}f=o[b+8>>2];l=o[b+16>>2];g=l;j=f-g|0;i=o[d+60>>2];e=i;k=o[b+20>>2];g=o[b+12>>2]-(k+(f>>>0>>0)|0)|0;f=o[d+56>>2];if((e|0)==(g|0)&f>>>0>j>>>0|e>>>0>g>>>0){break a}i=i+k|0;g=l;k=g+f|0;if(k>>>0>>0){i=i+1|0}o[b+16>>2]=k;o[b+20>>2]=i;if((f|0)<1){break a}j=l+o[b>>2]|0;o[d+40>>2]=j;g=d;b:{c:{d:{e:{f:{b=f+ -1|0;e=j+b|0;switch((p[e|0]>>>6|0)-1|0){case 2:break d;case 1:break e;case 0:break f;default:break c}}if((f|0)<2){break a}b=f+ -2|0;o[d+44>>2]=b;e=(f+j|0)+ -2|0;e=p[e+1|0]<<8&16128|p[e|0];break b}if((f|0)<3){break a}b=f+ -3|0;o[d+44>>2]=b;e=(f+j|0)+ -3|0;e=p[e+1|0]<<8|p[e+2|0]<<16&4128768|p[e|0];break b}b=f+ -4|0;o[d+44>>2]=b;e=(f+j|0)+ -4|0;e=p[e+2|0]<<16|p[e+3|0]<<24&1056964608|p[e+1|0]<<8|p[e|0];break b}o[d+44>>2]=b;e=p[e|0]&63}h=e+131072|0;o[g+48>>2]=h;m=h>>>0<33554432;if(!a|h>>>0>33554431){break a}k=o[d+28>>2];i=0;l=o[d+16>>2];while(1){g:{if(h>>>0>131071){break g}while(1){if((b|0)<1){break g}b=b+ -1|0;o[d+44>>2]=b;h=p[b+j|0]|h<<8;o[d+48>>2]=h;if(h>>>0<131072){continue}break}}f=h&32767;e=o[(f<<2)+l>>2];g=(e<<3)+k|0;h=(u(o[g>>2],h>>>15|0)+f|0)-o[g+4>>2]|0;o[d+48>>2]=h;o[(i<<2)+c>>2]=e;m=1;i=i+1|0;if((i|0)!=(a|0)){continue}break}}a=o[d+28>>2];if(a){o[d+32>>2]=a;jl(a)}a=o[d+16>>2];if(a){o[d+20>>2]=a;jl(a)}a=o[d>>2];if(a){o[d+4>>2]=a;jl(a)}R=d- -64|0;return m}function kg(a,b,c){var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;d=R+ -64|0;R=d;o[d+48>>2]=0;o[d+40>>2]=0;o[d+44>>2]=0;o[d+32>>2]=0;o[d+36>>2]=0;o[d+24>>2]=0;o[d+28>>2]=0;o[d+16>>2]=0;o[d+20>>2]=0;o[d+8>>2]=0;o[d+12>>2]=0;o[d>>2]=0;o[d+4>>2]=0;a:{if(!tg(d,b)|(o[d+12>>2]?0:a)){break a}if(!sg(1,d+56|0,b)){break a}f=o[b+8>>2];l=o[b+16>>2];g=l;j=f-g|0;i=o[d+60>>2];e=i;k=o[b+20>>2];g=o[b+12>>2]-(k+(f>>>0>>0)|0)|0;f=o[d+56>>2];if((e|0)==(g|0)&f>>>0>j>>>0|e>>>0>g>>>0){break a}i=i+k|0;g=l;k=g+f|0;if(k>>>0>>0){i=i+1|0}o[b+16>>2]=k;o[b+20>>2]=i;if((f|0)<1){break a}j=l+o[b>>2]|0;o[d+40>>2]=j;g=d;b:{c:{d:{e:{f:{b=f+ -1|0;e=j+b|0;switch((p[e|0]>>>6|0)-1|0){case 2:break d;case 1:break e;case 0:break f;default:break c}}if((f|0)<2){break a}b=f+ -2|0;o[d+44>>2]=b;e=(f+j|0)+ -2|0;e=p[e+1|0]<<8&16128|p[e|0];break b}if((f|0)<3){break a}b=f+ -3|0;o[d+44>>2]=b;e=(f+j|0)+ -3|0;e=p[e+1|0]<<8|p[e+2|0]<<16&4128768|p[e|0];break b}b=f+ -4|0;o[d+44>>2]=b;e=(f+j|0)+ -4|0;e=p[e+2|0]<<16|p[e+3|0]<<24&1056964608|p[e+1|0]<<8|p[e|0];break b}o[d+44>>2]=b;e=p[e|0]&63}h=e+32768|0;o[g+48>>2]=h;m=h>>>0<8388608;if(!a|h>>>0>8388607){break a}k=o[d+28>>2];i=0;l=o[d+16>>2];while(1){g:{if(h>>>0>32767){break g}while(1){if((b|0)<1){break g}b=b+ -1|0;o[d+44>>2]=b;h=p[b+j|0]|h<<8;o[d+48>>2]=h;if(h>>>0<32768){continue}break}}f=h&8191;e=o[(f<<2)+l>>2];g=(e<<3)+k|0;h=(u(o[g>>2],h>>>13|0)+f|0)-o[g+4>>2]|0;o[d+48>>2]=h;o[(i<<2)+c>>2]=e;m=1;i=i+1|0;if((i|0)!=(a|0)){continue}break}}a=o[d+28>>2];if(a){o[d+32>>2]=a;jl(a)}a=o[d+16>>2];if(a){o[d+20>>2]=a;jl(a)}a=o[d>>2];if(a){o[d+4>>2]=a;jl(a)}R=d- -64|0;return m}function ig(a,b,c){var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;d=R+ -64|0;R=d;o[d+48>>2]=0;o[d+40>>2]=0;o[d+44>>2]=0;o[d+32>>2]=0;o[d+36>>2]=0;o[d+24>>2]=0;o[d+28>>2]=0;o[d+16>>2]=0;o[d+20>>2]=0;o[d+8>>2]=0;o[d+12>>2]=0;o[d>>2]=0;o[d+4>>2]=0;a:{if(!gg(d,b)|(o[d+12>>2]?0:a)){break a}if(!sg(1,d+56|0,b)){break a}f=o[b+8>>2];l=o[b+16>>2];g=l;j=f-g|0;i=o[d+60>>2];e=i;k=o[b+20>>2];g=o[b+12>>2]-(k+(f>>>0>>0)|0)|0;f=o[d+56>>2];if((e|0)==(g|0)&f>>>0>j>>>0|e>>>0>g>>>0){break a}i=i+k|0;g=l;k=g+f|0;if(k>>>0>>0){i=i+1|0}o[b+16>>2]=k;o[b+20>>2]=i;if((f|0)<1){break a}j=l+o[b>>2]|0;o[d+40>>2]=j;g=d;b:{c:{d:{e:{f:{b=f+ -1|0;e=j+b|0;switch((p[e|0]>>>6|0)-1|0){case 2:break d;case 1:break e;case 0:break f;default:break c}}if((f|0)<2){break a}b=f+ -2|0;o[d+44>>2]=b;e=(f+j|0)+ -2|0;e=p[e+1|0]<<8&16128|p[e|0];break b}if((f|0)<3){break a}b=f+ -3|0;o[d+44>>2]=b;e=(f+j|0)+ -3|0;e=p[e+1|0]<<8|p[e+2|0]<<16&4128768|p[e|0];break b}b=f+ -4|0;o[d+44>>2]=b;e=(f+j|0)+ -4|0;e=p[e+2|0]<<16|p[e+3|0]<<24&1056964608|p[e+1|0]<<8|p[e|0];break b}o[d+44>>2]=b;e=p[e|0]&63}h=e+16384|0;o[g+48>>2]=h;m=h>>>0<4194304;if(!a|h>>>0>4194303){break a}k=o[d+28>>2];i=0;l=o[d+16>>2];while(1){g:{if(h>>>0>16383){break g}while(1){if((b|0)<1){break g}b=b+ -1|0;o[d+44>>2]=b;h=p[b+j|0]|h<<8;o[d+48>>2]=h;if(h>>>0<16384){continue}break}}f=h&4095;e=o[(f<<2)+l>>2];g=(e<<3)+k|0;h=(u(o[g>>2],h>>>12|0)+f|0)-o[g+4>>2]|0;o[d+48>>2]=h;o[(i<<2)+c>>2]=e;m=1;i=i+1|0;if((i|0)!=(a|0)){continue}break}}a=o[d+28>>2];if(a){o[d+32>>2]=a;jl(a)}a=o[d+16>>2];if(a){o[d+20>>2]=a;jl(a)}a=o[d>>2];if(a){o[d+4>>2]=a;jl(a)}R=d- -64|0;return m}function yg(a,b){var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;a:{if(!q[b+38>>1]){break a}l=a+12|0;if(!qg(1,l,b)){break a}f=o[a+12>>2];c=o[a>>2];d=o[a+4>>2]-c>>2;b:{if(f>>>0>d>>>0){Ia(a,f-d|0);f=o[a+12>>2];break b}if(f>>>0>=d>>>0){break b}o[a+4>>2]=c+(f<<2)}if(!f){return 1}m=o[b+8>>2];i=o[b+12>>2];while(1){e=o[b+16>>2];d=o[b+20>>2];c=d;if((i|0)<(c|0)?1:(i|0)<=(c|0)?m>>>0>e>>>0?0:1:0){break a}n=o[b>>2];j=p[n+e|0];e=e+1|0;if(e>>>0<1){d=d+1|0}c=b;h=e;o[c+16>>2]=e;o[c+20>>2]=d;e=j>>>2|0;c:{d:{e:{k=j&3;if(k>>>0>3){c=0;break e}c=0;f:{switch(k-1|0){case 0:case 1:break e;case 2:break f;default:break d}}d=e+g|0;if(d>>>0>=f>>>0){break a}ml(o[a>>2]+(g<<2)|0,0,(j&252)+4|0);g=d;break c}while(1){if((i|0)<(d|0)?1:(i|0)<=(d|0)?m>>>0>h>>>0?0:1:0){break a}j=p[h+n|0];h=h+1|0;if(h>>>0<1){d=d+1|0}f=b;o[f+16>>2]=h;o[f+20>>2]=d;e=j<<(c<<3|6)|e;c=c+1|0;if((k|0)!=(c|0)){continue}break}}o[o[a>>2]+(g<<2)>>2]=e}g=g+1|0;f=o[l>>2];if(g>>>0>>0){continue}break}d=a+16|0;i=o[a>>2];b=o[a+16>>2];c=o[a+20>>2]-b|0;g=c>>2;g:{if(g>>>0<=1048575){Ia(d,1048576-g|0);break g}if((c|0)==4194304){break g}o[a+20>>2]=b+4194304}h:{c=a+28|0;b=o[c>>2];g=o[a+32>>2]-b>>3;if(f>>>0>g>>>0){rg(c,f-g|0);b=o[c>>2];break h}if(f>>>0>>0){o[a+32>>2]=(f<<3)+b}if(f){break h}break a}e=0;c=0;while(1){a=i+(e<<2)|0;g=o[a>>2];h=(e<<3)+b|0;o[h+4>>2]=c;o[h>>2]=g;a=o[a>>2]+c|0;if(a>>>0>1048576){break a}if(c>>>0>>0){g=o[d>>2];while(1){o[g+(c<<2)>>2]=e;c=c+1|0;if((a|0)!=(c|0)){continue}break}}c=a;e=e+1|0;if((f|0)!=(e|0)){continue}break}return(a|0)==1048576}return 0}function wg(a,b){var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;a:{if(!q[b+38>>1]){break a}l=a+12|0;if(!qg(1,l,b)){break a}f=o[a+12>>2];c=o[a>>2];d=o[a+4>>2]-c>>2;b:{if(f>>>0>d>>>0){Ia(a,f-d|0);f=o[a+12>>2];break b}if(f>>>0>=d>>>0){break b}o[a+4>>2]=c+(f<<2)}if(!f){return 1}m=o[b+8>>2];i=o[b+12>>2];while(1){e=o[b+16>>2];d=o[b+20>>2];c=d;if((i|0)<(c|0)?1:(i|0)<=(c|0)?m>>>0>e>>>0?0:1:0){break a}n=o[b>>2];j=p[n+e|0];e=e+1|0;if(e>>>0<1){d=d+1|0}c=b;h=e;o[c+16>>2]=e;o[c+20>>2]=d;e=j>>>2|0;c:{d:{e:{k=j&3;if(k>>>0>3){c=0;break e}c=0;f:{switch(k-1|0){case 0:case 1:break e;case 2:break f;default:break d}}d=e+g|0;if(d>>>0>=f>>>0){break a}ml(o[a>>2]+(g<<2)|0,0,(j&252)+4|0);g=d;break c}while(1){if((i|0)<(d|0)?1:(i|0)<=(d|0)?m>>>0>h>>>0?0:1:0){break a}j=p[h+n|0];h=h+1|0;if(h>>>0<1){d=d+1|0}f=b;o[f+16>>2]=h;o[f+20>>2]=d;e=j<<(c<<3|6)|e;c=c+1|0;if((k|0)!=(c|0)){continue}break}}o[o[a>>2]+(g<<2)>>2]=e}g=g+1|0;f=o[l>>2];if(g>>>0>>0){continue}break}d=a+16|0;i=o[a>>2];b=o[a+16>>2];c=o[a+20>>2]-b|0;g=c>>2;g:{if(g>>>0<=262143){Ia(d,262144-g|0);break g}if((c|0)==1048576){break g}o[a+20>>2]=b- -1048576}h:{c=a+28|0;b=o[c>>2];g=o[a+32>>2]-b>>3;if(f>>>0>g>>>0){rg(c,f-g|0);b=o[c>>2];break h}if(f>>>0>>0){o[a+32>>2]=(f<<3)+b}if(f){break h}break a}e=0;c=0;while(1){a=i+(e<<2)|0;g=o[a>>2];h=(e<<3)+b|0;o[h+4>>2]=c;o[h>>2]=g;a=o[a>>2]+c|0;if(a>>>0>262144){break a}if(c>>>0>>0){g=o[d>>2];while(1){o[g+(c<<2)>>2]=e;c=c+1|0;if((a|0)!=(c|0)){continue}break}}c=a;e=e+1|0;if((f|0)!=(e|0)){continue}break}return(a|0)==262144}return 0}function xg(a,b){var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;a:{if(!q[b+38>>1]){break a}l=a+12|0;if(!qg(1,l,b)){break a}f=o[a+12>>2];c=o[a>>2];d=o[a+4>>2]-c>>2;b:{if(f>>>0>d>>>0){Ia(a,f-d|0);f=o[a+12>>2];break b}if(f>>>0>=d>>>0){break b}o[a+4>>2]=c+(f<<2)}if(!f){return 1}m=o[b+8>>2];i=o[b+12>>2];while(1){e=o[b+16>>2];d=o[b+20>>2];c=d;if((i|0)<(c|0)?1:(i|0)<=(c|0)?m>>>0>e>>>0?0:1:0){break a}n=o[b>>2];j=p[n+e|0];e=e+1|0;if(e>>>0<1){d=d+1|0}c=b;h=e;o[c+16>>2]=e;o[c+20>>2]=d;e=j>>>2|0;c:{d:{e:{k=j&3;if(k>>>0>3){c=0;break e}c=0;f:{switch(k-1|0){case 0:case 1:break e;case 2:break f;default:break d}}d=e+g|0;if(d>>>0>=f>>>0){break a}ml(o[a>>2]+(g<<2)|0,0,(j&252)+4|0);g=d;break c}while(1){if((i|0)<(d|0)?1:(i|0)<=(d|0)?m>>>0>h>>>0?0:1:0){break a}j=p[h+n|0];h=h+1|0;if(h>>>0<1){d=d+1|0}f=b;o[f+16>>2]=h;o[f+20>>2]=d;e=j<<(c<<3|6)|e;c=c+1|0;if((k|0)!=(c|0)){continue}break}}o[o[a>>2]+(g<<2)>>2]=e}g=g+1|0;f=o[l>>2];if(g>>>0>>0){continue}break}d=a+16|0;i=o[a>>2];b=o[a+16>>2];c=o[a+20>>2]-b|0;g=c>>2;g:{if(g>>>0<=524287){Ia(d,524288-g|0);break g}if((c|0)==2097152){break g}o[a+20>>2]=b+2097152}h:{c=a+28|0;b=o[c>>2];g=o[a+32>>2]-b>>3;if(f>>>0>g>>>0){rg(c,f-g|0);b=o[c>>2];break h}if(f>>>0>>0){o[a+32>>2]=(f<<3)+b}if(f){break h}break a}e=0;c=0;while(1){a=i+(e<<2)|0;g=o[a>>2];h=(e<<3)+b|0;o[h+4>>2]=c;o[h>>2]=g;a=o[a>>2]+c|0;if(a>>>0>524288){break a}if(c>>>0>>0){g=o[d>>2];while(1){o[g+(c<<2)>>2]=e;c=c+1|0;if((a|0)!=(c|0)){continue}break}}c=a;e=e+1|0;if((f|0)!=(e|0)){continue}break}return(a|0)==524288}return 0}function vg(a,b){var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;a:{if(!q[b+38>>1]){break a}l=a+12|0;if(!qg(1,l,b)){break a}f=o[a+12>>2];c=o[a>>2];d=o[a+4>>2]-c>>2;b:{if(f>>>0>d>>>0){Ia(a,f-d|0);f=o[a+12>>2];break b}if(f>>>0>=d>>>0){break b}o[a+4>>2]=c+(f<<2)}if(!f){return 1}m=o[b+8>>2];i=o[b+12>>2];while(1){e=o[b+16>>2];d=o[b+20>>2];c=d;if((i|0)<(c|0)?1:(i|0)<=(c|0)?m>>>0>e>>>0?0:1:0){break a}n=o[b>>2];j=p[n+e|0];e=e+1|0;if(e>>>0<1){d=d+1|0}c=b;h=e;o[c+16>>2]=e;o[c+20>>2]=d;e=j>>>2|0;c:{d:{e:{k=j&3;if(k>>>0>3){c=0;break e}c=0;f:{switch(k-1|0){case 0:case 1:break e;case 2:break f;default:break d}}d=e+g|0;if(d>>>0>=f>>>0){break a}ml(o[a>>2]+(g<<2)|0,0,(j&252)+4|0);g=d;break c}while(1){if((i|0)<(d|0)?1:(i|0)<=(d|0)?m>>>0>h>>>0?0:1:0){break a}j=p[h+n|0];h=h+1|0;if(h>>>0<1){d=d+1|0}f=b;o[f+16>>2]=h;o[f+20>>2]=d;e=j<<(c<<3|6)|e;c=c+1|0;if((k|0)!=(c|0)){continue}break}}o[o[a>>2]+(g<<2)>>2]=e}g=g+1|0;f=o[l>>2];if(g>>>0>>0){continue}break}d=a+16|0;i=o[a>>2];b=o[a+16>>2];c=o[a+20>>2]-b|0;g=c>>2;g:{if(g>>>0<=65535){Ia(d,65536-g|0);break g}if((c|0)==262144){break g}o[a+20>>2]=b+262144}h:{c=a+28|0;b=o[c>>2];g=o[a+32>>2]-b>>3;if(f>>>0>g>>>0){rg(c,f-g|0);b=o[c>>2];break h}if(f>>>0>>0){o[a+32>>2]=(f<<3)+b}if(f){break h}break a}e=0;c=0;while(1){a=i+(e<<2)|0;g=o[a>>2];h=(e<<3)+b|0;o[h+4>>2]=c;o[h>>2]=g;a=o[a>>2]+c|0;if(a>>>0>65536){break a}if(c>>>0>>0){g=o[d>>2];while(1){o[g+(c<<2)>>2]=e;c=c+1|0;if((a|0)!=(c|0)){continue}break}}c=a;e=e+1|0;if((f|0)!=(e|0)){continue}break}return(a|0)==65536}return 0}function ug(a,b){var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;a:{if(!q[b+38>>1]){break a}l=a+12|0;if(!qg(1,l,b)){break a}f=o[a+12>>2];c=o[a>>2];d=o[a+4>>2]-c>>2;b:{if(f>>>0>d>>>0){Ia(a,f-d|0);f=o[a+12>>2];break b}if(f>>>0>=d>>>0){break b}o[a+4>>2]=c+(f<<2)}if(!f){return 1}m=o[b+8>>2];i=o[b+12>>2];while(1){e=o[b+16>>2];d=o[b+20>>2];c=d;if((i|0)<(c|0)?1:(i|0)<=(c|0)?m>>>0>e>>>0?0:1:0){break a}n=o[b>>2];j=p[n+e|0];e=e+1|0;if(e>>>0<1){d=d+1|0}c=b;h=e;o[c+16>>2]=e;o[c+20>>2]=d;e=j>>>2|0;c:{d:{e:{k=j&3;if(k>>>0>3){c=0;break e}c=0;f:{switch(k-1|0){case 0:case 1:break e;case 2:break f;default:break d}}d=e+g|0;if(d>>>0>=f>>>0){break a}ml(o[a>>2]+(g<<2)|0,0,(j&252)+4|0);g=d;break c}while(1){if((i|0)<(d|0)?1:(i|0)<=(d|0)?m>>>0>h>>>0?0:1:0){break a}j=p[h+n|0];h=h+1|0;if(h>>>0<1){d=d+1|0}f=b;o[f+16>>2]=h;o[f+20>>2]=d;e=j<<(c<<3|6)|e;c=c+1|0;if((k|0)!=(c|0)){continue}break}}o[o[a>>2]+(g<<2)>>2]=e}g=g+1|0;f=o[l>>2];if(g>>>0>>0){continue}break}d=a+16|0;i=o[a>>2];b=o[a+16>>2];c=o[a+20>>2]-b|0;g=c>>2;g:{if(g>>>0<=32767){Ia(d,32768-g|0);break g}if((c|0)==131072){break g}o[a+20>>2]=b+131072}h:{c=a+28|0;b=o[c>>2];g=o[a+32>>2]-b>>3;if(f>>>0>g>>>0){rg(c,f-g|0);b=o[c>>2];break h}if(f>>>0>>0){o[a+32>>2]=(f<<3)+b}if(f){break h}break a}e=0;c=0;while(1){a=i+(e<<2)|0;g=o[a>>2];h=(e<<3)+b|0;o[h+4>>2]=c;o[h>>2]=g;a=o[a>>2]+c|0;if(a>>>0>32768){break a}if(c>>>0>>0){g=o[d>>2];while(1){o[g+(c<<2)>>2]=e;c=c+1|0;if((a|0)!=(c|0)){continue}break}}c=a;e=e+1|0;if((f|0)!=(e|0)){continue}break}return(a|0)==32768}return 0}function tg(a,b){var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;a:{if(!q[b+38>>1]){break a}l=a+12|0;if(!qg(1,l,b)){break a}f=o[a+12>>2];c=o[a>>2];d=o[a+4>>2]-c>>2;b:{if(f>>>0>d>>>0){Ia(a,f-d|0);f=o[a+12>>2];break b}if(f>>>0>=d>>>0){break b}o[a+4>>2]=c+(f<<2)}if(!f){return 1}m=o[b+8>>2];i=o[b+12>>2];while(1){e=o[b+16>>2];d=o[b+20>>2];c=d;if((i|0)<(c|0)?1:(i|0)<=(c|0)?m>>>0>e>>>0?0:1:0){break a}n=o[b>>2];j=p[n+e|0];e=e+1|0;if(e>>>0<1){d=d+1|0}c=b;h=e;o[c+16>>2]=e;o[c+20>>2]=d;e=j>>>2|0;c:{d:{e:{k=j&3;if(k>>>0>3){c=0;break e}c=0;f:{switch(k-1|0){case 0:case 1:break e;case 2:break f;default:break d}}d=e+g|0;if(d>>>0>=f>>>0){break a}ml(o[a>>2]+(g<<2)|0,0,(j&252)+4|0);g=d;break c}while(1){if((i|0)<(d|0)?1:(i|0)<=(d|0)?m>>>0>h>>>0?0:1:0){break a}j=p[h+n|0];h=h+1|0;if(h>>>0<1){d=d+1|0}f=b;o[f+16>>2]=h;o[f+20>>2]=d;e=j<<(c<<3|6)|e;c=c+1|0;if((k|0)!=(c|0)){continue}break}}o[o[a>>2]+(g<<2)>>2]=e}g=g+1|0;f=o[l>>2];if(g>>>0>>0){continue}break}d=a+16|0;i=o[a>>2];b=o[a+16>>2];c=o[a+20>>2]-b|0;g=c>>2;g:{if(g>>>0<=8191){Ia(d,8192-g|0);break g}if((c|0)==32768){break g}o[a+20>>2]=b+32768}h:{c=a+28|0;b=o[c>>2];g=o[a+32>>2]-b>>3;if(f>>>0>g>>>0){rg(c,f-g|0);b=o[c>>2];break h}if(f>>>0>>0){o[a+32>>2]=(f<<3)+b}if(f){break h}break a}e=0;c=0;while(1){a=i+(e<<2)|0;g=o[a>>2];h=(e<<3)+b|0;o[h+4>>2]=c;o[h>>2]=g;a=o[a>>2]+c|0;if(a>>>0>8192){break a}if(c>>>0>>0){g=o[d>>2];while(1){o[g+(c<<2)>>2]=e;c=c+1|0;if((a|0)!=(c|0)){continue}break}}c=a;e=e+1|0;if((f|0)!=(e|0)){continue}break}return(a|0)==8192}return 0}function gg(a,b){var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;a:{if(!q[b+38>>1]){break a}l=a+12|0;if(!qg(1,l,b)){break a}f=o[a+12>>2];c=o[a>>2];d=o[a+4>>2]-c>>2;b:{if(f>>>0>d>>>0){Ia(a,f-d|0);f=o[a+12>>2];break b}if(f>>>0>=d>>>0){break b}o[a+4>>2]=c+(f<<2)}if(!f){return 1}m=o[b+8>>2];i=o[b+12>>2];while(1){e=o[b+16>>2];d=o[b+20>>2];c=d;if((i|0)<(c|0)?1:(i|0)<=(c|0)?m>>>0>e>>>0?0:1:0){break a}n=o[b>>2];j=p[n+e|0];e=e+1|0;if(e>>>0<1){d=d+1|0}c=b;h=e;o[c+16>>2]=e;o[c+20>>2]=d;e=j>>>2|0;c:{d:{e:{k=j&3;if(k>>>0>3){c=0;break e}c=0;f:{switch(k-1|0){case 0:case 1:break e;case 2:break f;default:break d}}d=e+g|0;if(d>>>0>=f>>>0){break a}ml(o[a>>2]+(g<<2)|0,0,(j&252)+4|0);g=d;break c}while(1){if((i|0)<(d|0)?1:(i|0)<=(d|0)?m>>>0>h>>>0?0:1:0){break a}j=p[h+n|0];h=h+1|0;if(h>>>0<1){d=d+1|0}f=b;o[f+16>>2]=h;o[f+20>>2]=d;e=j<<(c<<3|6)|e;c=c+1|0;if((k|0)!=(c|0)){continue}break}}o[o[a>>2]+(g<<2)>>2]=e}g=g+1|0;f=o[l>>2];if(g>>>0>>0){continue}break}d=a+16|0;i=o[a>>2];b=o[a+16>>2];c=o[a+20>>2]-b|0;g=c>>2;g:{if(g>>>0<=4095){Ia(d,4096-g|0);break g}if((c|0)==16384){break g}o[a+20>>2]=b+16384}h:{c=a+28|0;b=o[c>>2];g=o[a+32>>2]-b>>3;if(f>>>0>g>>>0){rg(c,f-g|0);b=o[c>>2];break h}if(f>>>0>>0){o[a+32>>2]=(f<<3)+b}if(f){break h}break a}e=0;c=0;while(1){a=i+(e<<2)|0;g=o[a>>2];h=(e<<3)+b|0;o[h+4>>2]=c;o[h>>2]=g;a=o[a>>2]+c|0;if(a>>>0>4096){break a}if(c>>>0>>0){g=o[d>>2];while(1){o[g+(c<<2)>>2]=e;c=c+1|0;if((a|0)!=(c|0)){continue}break}}c=a;e=e+1|0;if((f|0)!=(e|0)){continue}break}return(a|0)==4096}return 0}function Bd(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,q=0,r=0,s=0,t=0;f=R-96|0;R=f;a:{if(!Cd(1,f+92|0,b)){break a}c=o[f+92>>2];if(!c){break a}e=o[a+4>>2];d=o[a+8>>2]-e>>2;b:{if(c>>>0>d>>>0){Ia(a+4|0,c-d|0);break b}if(c>>>0>=d>>>0){break b}o[a+8>>2]=e+(c<<2)}t=c>>>0>1?c:1;q=a+16|0;r=o[a+32>>2];while(1){k=o[b+8>>2];j=o[b+16>>2];g=o[b+12>>2];c=g;d=o[b+20>>2];if((c|0)<(d|0)?1:(c|0)<=(d|0)?k>>>0>j>>>0?0:1:0){d=0;break a}l=o[b>>2];s=p[l+j|0];c=d;h=j+1|0;if(h>>>0<1){c=c+1|0}e=b;o[e+16>>2]=h;o[e+20>>2]=c;if((g|0)<(c|0)?1:(g|0)<=(c|0)?k>>>0>h>>>0?0:1:0){d=0;break a}h=p[h+l|0];c=d;i=j+2|0;if(i>>>0<2){c=c+1|0}o[b+16>>2]=i;o[e+20>>2]=c;if((g|0)<(c|0)?1:(g|0)<=(c|0)?k>>>0>i>>>0?0:1:0){d=0;break a}i=p[i+l|0];c=d;m=j+3|0;if(m>>>0<3){c=c+1|0}o[b+16>>2]=m;o[e+20>>2]=c;if((g|0)<(c|0)?1:(g|0)<=(c|0)?k>>>0>m>>>0?0:1:0){d=0;break a}g=p[m+l|0];c=d;d=j+4|0;if(d>>>0<4){c=c+1|0}o[b+16>>2]=d;o[e+20>>2]=c;if(s>>>0>4){d=0;break a}if((h+ -1&255)>>>0>10){d=0;break a}d=qd(f+24|0);c=u(xi(h),i);rd(d,s,i<<24>>24,h,(g|0)!=0,c,c>>31);Cd(1,f+20|0,b);e=o[f+20>>2];o[f+84>>2]=e;c=yk(96);vd(c,d);o[f+16>>2]=c;d=vj(r,f+16|0);c=o[f+16>>2];o[f+16>>2]=0;if(c){Kb(c)}g=d<<2;o[o[g+o[r+8>>2]>>2]+60>>2]=e;o[o[a+4>>2]+(n<<2)>>2]=d;c=o[a+16>>2];e=o[a+20>>2]-c>>2;c:{if((d|0)<(e|0)){break c}o[f+12>>2]=-1;d=d+1|0;if(d>>>0>e>>>0){Dd(q,d-e|0,f+12|0);c=o[q>>2];break c}if(d>>>0>=e>>>0){break c}o[a+20>>2]=(d<<2)+c}o[c+g>>2]=n;d=1;n=n+1|0;if((t|0)!=(n|0)){continue}break}}R=f+96|0;return d|0}function $d(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,q=0;e=R-16|0;R=e;b=1;g=l[o[o[a>>2]+24>>2]](a)|0;a:{if((g|0)<1){break a}q=a+48|0;while(1){b:{c:{if(!o[(l[o[o[a>>2]+28>>2]](a)|0)+40>>2]){break c}h=f<<2;b=o[h+o[a+36>>2]>>2];c=o[b+8>>2];i=Qd(b);if(!i){break c}j=o[(l[o[o[a>>2]+28>>2]](a)|0)+40>>2];k=o[c+56>>2];b=yk(32);o[e>>2]=b;o[e+4>>2]=24;o[e+8>>2]=-2147483616;m[b+24|0]=0;c=p[1764]|p[1765]<<8|(p[1766]<<16|p[1767]<<24);d=p[1760]|p[1761]<<8|(p[1762]<<16|p[1763]<<24);m[b+16|0]=d;m[b+17|0]=d>>>8;m[b+18|0]=d>>>16;m[b+19|0]=d>>>24;m[b+20|0]=c;m[b+21|0]=c>>>8;m[b+22|0]=c>>>16;m[b+23|0]=c>>>24;c=p[1756]|p[1757]<<8|(p[1758]<<16|p[1759]<<24);d=p[1752]|p[1753]<<8|(p[1754]<<16|p[1755]<<24);m[b+8|0]=d;m[b+9|0]=d>>>8;m[b+10|0]=d>>>16;m[b+11|0]=d>>>24;m[b+12|0]=c;m[b+13|0]=c>>>8;m[b+14|0]=c>>>16;m[b+15|0]=c>>>24;c=p[1748]|p[1749]<<8|(p[1750]<<16|p[1751]<<24);d=p[1744]|p[1745]<<8|(p[1746]<<16|p[1747]<<24);m[b|0]=d;m[b+1|0]=d>>>8;m[b+2|0]=d>>>16;m[b+3|0]=d>>>24;m[b+4|0]=c;m[b+5|0]=c>>>8;m[b+6|0]=c>>>16;m[b+7|0]=c>>>24;d:{e:{d=j+16|0;c=d;b=o[c>>2];if(!b){break e}while(1){n=o[b+16>>2]<(k|0);c=n?c:b;b=o[(n<<2)+b>>2];if(b){continue}break}if((c|0)==(d|0)|(k|0)>2]){break e}b=c+20|0;if(!ja(b,e)){break e}b=Bi(b,e);break d}b=Bi(j,e)}if(m[e+11|0]<=-1){jl(o[e>>2])}if(!b){break c}xd(o[o[o[a+36>>2]+h>>2]+8>>2],i);break b}b=o[o[a+36>>2]+(f<<2)>>2];if(l[o[o[b>>2]+24>>2]](b,q)){break b}b=0;break a}b=1;f=f+1|0;if((g|0)!=(f|0)){continue}break}}R=e+16|0;return b|0}function _g(a,b){var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,n=0,s=0,t=0;j=R-16|0;R=j;n=-1;a:{b:{c:{if(!Xg(1,j+12|0,b)){break c}d=o[j+12>>2];if(d){c=o[a+8>>2];if(d>>>0>(o[c+4>>2]-o[c>>2]>>2>>>0)/3>>>0){break c}s=a+36|0;while(1){Xg(1,j+8|0,b);c=o[j+8>>2];Xg(1,j+8|0,b);h=c+h|0;c=o[j+8>>2];if(h>>>0>>0){break c}g=h-c|0;c=o[a+40>>2];i=o[a+44>>2];d:{if((c|0)!=(i|0)){o[c+4>>2]=h;o[c>>2]=g;o[a+40>>2]=o[a+40>>2]+12;break d}e=c;c=o[s>>2];k=e-c|0;e=(k|0)/12|0;f=e+1|0;if(f>>>0>=357913942){break b}t=u(e,12);i=(i-c|0)/12|0;e=i<<1;f=i>>>0<178956970?e>>>0>>0?f:e:357913941;e=0;e:{if(!f){break e}if(f>>>0>=357913942){break a}e=yk(u(f,12))}i=t+e|0;o[i+4>>2]=h;o[i>>2]=g;g=i+u((k|0)/-12|0,12)|0;e=e+u(f,12)|0;f=i+12|0;if((k|0)>=1){ll(g,c,k)}o[a+44>>2]=e;o[a+40>>2]=f;o[a+36>>2]=g;if(!c){break d}jl(c)}l=l+1|0;if((d|0)!=(l|0)){continue}break}h=0;ui(b,0,0);k=d>>>0>1?d:1;while(1){d=p[b+36|0];c=q[o[a+4>>2]+36>>1];f:{if((c<<24|c<<8&16711680)>>>16>>>0<=513){if(!d){break f}g=0;d=o[b+32>>2];l=d>>>3|0;e=o[b+24>>2];c=l+e|0;f=o[b+28>>2];g:{if(c>>>0>=f>>>0){c=d;break g}g=p[c|0];c=d+1|0;o[b+32>>2]=c;l=c>>>3|0;g=g>>>(d&7)&1}if(e+l>>>0>=f>>>0){break f}o[b+32>>2]=c+1;break f}if(!d){break f}g=0;d=o[b+32>>2];c=o[b+24>>2]+(d>>>3|0)|0;if(c>>>0>=r[b+28>>2]){break f}c=p[c|0];o[b+32>>2]=d+1;g=c>>>(d&7)&1}d=o[a+36>>2]+u(h,12)|0;m[d+8|0]=p[d+8|0]&254|g&1;h=h+1|0;if((k|0)!=(h|0)){continue}break}wi(b)}n=o[b+16>>2]}R=j+16|0;return n}Nk();D()}db(8832);D()}function bg(a,b,c,d,e){var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;a:{b:{c:{d:{e:{l=a+4|0;f:{if((l|0)==(b|0)){break f}f=p[b+27|0];i=f<<24>>24<0;h=p[e+11|0];n=h<<24>>24;g=(n|0)<0;f=i?o[b+20>>2]:f;h=g?o[e+4>>2]:h;j=f>>>0>>0;k=j?f:h;if(k){g=g?o[e>>2]:e;m=b+16|0;i=i?o[m>>2]:m;m=Vj(g,i,k);if(!m){if(h>>>0>>0){break f}break e}if((m|0)>-1){break e}break f}if(h>>>0>=f>>>0){break d}}i=o[b>>2];g:{h:{if(o[a>>2]==(b|0)){f=b;break h}i:{if(!i){d=b;while(1){f=o[d+8>>2];h=o[f>>2]==(d|0);d=f;if(h){continue}break}break i}d=i;while(1){f=d;d=o[f+4>>2];if(d){continue}break}}g=p[e+11|0];d=g<<24>>24<0;j=p[f+27|0];h=j<<24>>24<0;j:{g=d?o[e+4>>2]:g;j=h?o[f+20>>2]:j;k=g>>>0>>0?g:j;if(k){l=f+16|0;d=Vj(h?o[l>>2]:l,d?o[e>>2]:e,k);if(d){break j}}if(j>>>0>>0){break h}break g}if((d|0)>-1){break g}}if(!i){o[c>>2]=b;return b}o[c>>2]=f;return f+4|0}return cg(a,c,e)}f=Vj(i,g,k);if(f){break c}}if(j){break b}break a}if((f|0)>-1){break a}}i=o[b+4>>2];k:{if(i){f=i;while(1){d=f;f=o[f>>2];if(f){continue}break}break k}d=o[b+8>>2];if(o[d>>2]==(b|0)){break k}f=b+8|0;while(1){g=o[f>>2];f=g+8|0;d=o[g+8>>2];if((g|0)!=o[d>>2]){continue}break}}l:{m:{if((d|0)==(l|0)){break m}g=p[d+27|0];f=g<<24>>24<0;n:{g=f?o[d+20>>2]:g;j=g>>>0>>0?g:h;if(j){k=d+16|0;f=Vj((n|0)<0?o[e>>2]:e,f?o[k>>2]:k,j);if(f){break n}}if(h>>>0>>0){break m}break l}if((f|0)>-1){break l}}if(!i){o[c>>2]=b;return b+4|0}o[c>>2]=d;return d}return cg(a,c,e)}o[c>>2]=b;o[d>>2]=b;return d}function kh(a,b){var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;h=R-16|0;R=h;a:{if(!Sf(a+80|0,a)){break a}if(!$g(a)){break a}c=o[a+4>>2];o[b>>2]=o[a>>2];o[b+4>>2]=c;c=o[a+36>>2];o[b+32>>2]=o[a+32>>2];o[b+36>>2]=c;c=o[a+28>>2];o[b+24>>2]=o[a+24>>2];o[b+28>>2]=c;c=o[a+20>>2];o[b+16>>2]=o[a+16>>2];o[b+20>>2]=c;c=o[a+12>>2];o[b+8>>2]=o[a+8>>2];o[b+12>>2]=c;o[a+176>>2]=2;o[a+180>>2]=7;c=o[a+152>>2];if((c|0)<0){break a}o[h+12>>2]=0;d=2;f=o[a+156>>2];g=o[a+160>>2]-f>>2;b:{if(c>>>0>g>>>0){Dd(a+156|0,c-g|0,h+12|0);d=o[a+176>>2];e=o[a+180>>2];break b}e=7;if(c>>>0>=g>>>0){break b}o[a+160>>2]=f+(c<<2)}g=a+184|0;e=(e-d|0)+1|0;c=o[a+188>>2];f=o[a+184>>2];d=(c-f|0)/12|0;c:{if(e>>>0>d>>>0){mh(g,e-d|0);e=o[a+188>>2];break c}if(e>>>0>=d>>>0){e=c;break c}e=f+u(e,12)|0;if((e|0)!=(c|0)){while(1){d=c+ -12|0;f=o[d>>2];if(f){o[c+ -8>>2]=f;jl(f)}c=d;if((c|0)!=(e|0)){continue}break}}o[a+188>>2]=e}k=a+196|0;c=o[a+184>>2];d=(e-c|0)/12|0;i=o[a+196>>2];f=o[a+200>>2]-i>>2;d:{if(d>>>0>f>>>0){Ia(k,d-f|0);c=o[a+184>>2];e=o[a+188>>2];break d}if(d>>>0>=f>>>0){break d}o[a+200>>2]=i+(d<<2)}d=1;if((c|0)==(e|0)){break a}c=0;while(1){Xg(1,h+8|0,b);d=o[h+8>>2];if(d){e=o[g>>2];l=u(c,12);f=e+l|0;i=o[f>>2];j=o[f+4>>2]-i>>2;e:{if(d>>>0>j>>>0){Ia(f,d-j|0);e=o[g>>2];break e}if(d>>>0>=j>>>0){break e}o[f+4>>2]=(d<<2)+i}dg(d,1,b,o[e+l>>2]);o[o[k>>2]+(c<<2)>>2]=d}d=1;c=c+1|0;if(c>>>0<(o[a+188>>2]-o[a+184>>2]|0)/12>>>0){continue}break}}R=h+16|0;return d}function Xf(a,b,c,d){var e=0,f=0,g=0;e=R-80|0;R=e;f=o[c+36>>2];o[e+72>>2]=o[c+32>>2];o[e+76>>2]=f;g=o[c+28>>2];f=e- -64|0;o[f>>2]=o[c+24>>2];o[f+4>>2]=g;f=o[c+20>>2];o[e+56>>2]=o[c+16>>2];o[e+60>>2]=f;f=o[c+12>>2];o[e+48>>2]=o[c+8>>2];o[e+52>>2]=f;f=o[c+4>>2];o[e+40>>2]=o[c>>2];o[e+44>>2]=f;gi(a,e+40|0,e+24|0);a:{if(o[a>>2]){break a}f=a+4|0;if(m[a+15|0]<=-1){jl(o[f>>2])}if(p[e+31|0]!=1){b=yk(32);o[e>>2]=b;o[e+4>>2]=20;o[e+8>>2]=-2147483616;m[b+20|0]=0;c=p[7916]|p[7917]<<8|(p[7918]<<16|p[7919]<<24);m[b+16|0]=c;m[b+17|0]=c>>>8;m[b+18|0]=c>>>16;m[b+19|0]=c>>>24;c=p[7912]|p[7913]<<8|(p[7914]<<16|p[7915]<<24);d=p[7908]|p[7909]<<8|(p[7910]<<16|p[7911]<<24);m[b+8|0]=d;m[b+9|0]=d>>>8;m[b+10|0]=d>>>16;m[b+11|0]=d>>>24;m[b+12|0]=c;m[b+13|0]=c>>>8;m[b+14|0]=c>>>16;m[b+15|0]=c>>>24;c=p[7904]|p[7905]<<8|(p[7906]<<16|p[7907]<<24);d=p[7900]|p[7901]<<8|(p[7902]<<16|p[7903]<<24);m[b|0]=d;m[b+1|0]=d>>>8;m[b+2|0]=d>>>16;m[b+3|0]=d>>>24;m[b+4|0]=c;m[b+5|0]=c>>>8;m[b+6|0]=c>>>16;m[b+7|0]=c>>>24;o[a>>2]=-1;Bk(f,e);if(m[e+11|0]>-1){break a}jl(o[e>>2]);break a}Vf(e,p[e+32|0]);g=o[e>>2];b:{if(g){o[a>>2]=g;Bk(f,e|4);break b}g=o[e+16>>2];o[e+16>>2]=0;o[g+44>>2]=d;ji(a,g,b,c,d);if(!o[a>>2]){if(m[f+11|0]<=-1){jl(o[f>>2])}o[a>>2]=0;o[a+4>>2]=0;o[a+8>>2]=0;o[a+12>>2]=0}if(!g){break b}l[o[o[g>>2]+4>>2]](g)}a=o[e+16>>2];o[e+16>>2]=0;if(a){l[o[o[a>>2]+4>>2]](a)}if(m[e+15|0]>-1){break a}jl(o[e+4>>2])}R=e+80|0}function pf(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,p=0,q=0;o[a+8>>2]=e;h=a+32|0;g=o[h>>2];f=o[a+36>>2]-g>>2;a:{if(f>>>0>>0){Ia(h,e-f|0);break a}if(f>>>0<=e>>>0){break a}o[a+36>>2]=g+(e<<2)}h=0;f=(e&1073741823)!=(e|0)?-1:e<<2;m=ml(yk(f),0,f);g=o[a+8>>2];b:{if((g|0)<1){break b}while(1){f=h<<2;g=o[f+m>>2];i=o[a+16>>2];c:{if((g|0)>(i|0)){j=o[a+32>>2];o[f+j>>2]=i;break c}j=o[a+32>>2];f=f+j|0;i=o[a+12>>2];if((g|0)<(i|0)){o[f>>2]=i;break c}o[f>>2]=g}h=h+1|0;g=o[a+8>>2];if((h|0)<(g|0)){continue}break}if((g|0)<1){break b}i=0;while(1){h=i<<2;f=h+c|0;h=o[b+h>>2]+o[h+j>>2]|0;o[f>>2]=h;d:{if((h|0)>o[a+16>>2]){h=h-o[a+20>>2]|0}else{if((h|0)>=o[a+12>>2]){break d}h=h+o[a+20>>2]|0}o[f>>2]=h}i=i+1|0;g=o[a+8>>2];if((i|0)<(g|0)){continue}break}}if((e|0)<(d|0)){p=0-e<<2;f=e;while(1){e:{if((g|0)<1){break e}l=f<<2;n=l+c|0;q=n+p|0;h=0;while(1){g=h<<2;i=o[g+q>>2];k=o[a+16>>2];f:{if((i|0)>(k|0)){j=o[a+32>>2];o[g+j>>2]=k;break f}j=o[a+32>>2];g=g+j|0;k=o[a+12>>2];if((i|0)<(k|0)){o[g>>2]=k;break f}o[g>>2]=i}h=h+1|0;g=o[a+8>>2];if((h|0)<(g|0)){continue}break}i=0;if((g|0)<1){break e}l=b+l|0;while(1){g=i<<2;h=g+n|0;g=o[g+l>>2]+o[g+j>>2]|0;o[h>>2]=g;g:{if((g|0)>o[a+16>>2]){g=g-o[a+20>>2]|0}else{if((g|0)>=o[a+12>>2]){break g}g=g+o[a+20>>2]|0}o[h>>2]=g}i=i+1|0;g=o[a+8>>2];if((i|0)<(g|0)){continue}break}}f=e+f|0;if((f|0)<(d|0)){continue}break}}jl(m);return 1}function hi(a,b){var c=0,d=0,e=0;e=R-48|0;R=e;c=yk(36);o[c+4>>2]=0;o[c+8>>2]=0;o[c+16>>2]=0;o[c+20>>2]=0;o[c+32>>2]=0;o[c+24>>2]=0;o[c+28>>2]=0;o[c>>2]=c+4;o[c+12>>2]=c+16;o[e+40>>2]=c;d=e+32|0;o[d>>2]=0;a:{if(!dj(d,o[b+32>>2],c)){b=yk(32);o[e+16>>2]=b;o[e+20>>2]=26;o[e+24>>2]=-2147483616;m[b+26|0]=0;c=p[10238]|p[10239]<<8;m[b+24|0]=c;m[b+25|0]=c>>>8;c=p[10234]|p[10235]<<8|(p[10236]<<16|p[10237]<<24);d=p[10230]|p[10231]<<8|(p[10232]<<16|p[10233]<<24);m[b+16|0]=d;m[b+17|0]=d>>>8;m[b+18|0]=d>>>16;m[b+19|0]=d>>>24;m[b+20|0]=c;m[b+21|0]=c>>>8;m[b+22|0]=c>>>16;m[b+23|0]=c>>>24;c=p[10226]|p[10227]<<8|(p[10228]<<16|p[10229]<<24);d=p[10222]|p[10223]<<8|(p[10224]<<16|p[10225]<<24);m[b+8|0]=d;m[b+9|0]=d>>>8;m[b+10|0]=d>>>16;m[b+11|0]=d>>>24;m[b+12|0]=c;m[b+13|0]=c>>>8;m[b+14|0]=c>>>16;m[b+15|0]=c>>>24;c=p[10218]|p[10219]<<8|(p[10220]<<16|p[10221]<<24);d=p[10214]|p[10215]<<8|(p[10216]<<16|p[10217]<<24);m[b|0]=d;m[b+1|0]=d>>>8;m[b+2|0]=d>>>16;m[b+3|0]=d>>>24;m[b+4|0]=c;m[b+5|0]=c>>>8;m[b+6|0]=c>>>16;m[b+7|0]=c>>>24;o[a>>2]=-1;Bk(a+4|0,e+16|0);if(m[e+27|0]>-1){break a}jl(o[e+16>>2]);break a}b=o[b+4>>2];o[e+8>>2]=0;o[e+40>>2]=0;d=o[b+4>>2];o[b+4>>2]=c;b:{if(!d){o[e+8>>2]=0;break b}ii(d);b=o[e+8>>2];o[e+8>>2]=0;if(!b){break b}ii(b)}o[a>>2]=0;o[a+4>>2]=0;o[a+8>>2]=0;o[a+12>>2]=0}a=o[e+40>>2];o[e+40>>2]=0;if(a){ii(a)}R=e+48|0}function Rg(a,b,c){var d=0,e=0,f=0,g=0,h=0,i=0,j=0;d=R-112|0;R=d;j=o[o[b+4>>2]+44>>2];f=yk(120);e=f;o[e+12>>2]=0;o[e+16>>2]=0;o[e>>2]=8940;o[e+4>>2]=0;o[e+8>>2]=9152;o[e+116>>2]=0;o[e+112>>2]=c;o[e+108>>2]=j;o[e+104>>2]=0;o[e+96>>2]=0;o[e+100>>2]=0;o[e+20>>2]=0;o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;o[e+36>>2]=0;o[e+40>>2]=0;o[e+44>>2]=0;o[e+48>>2]=0;o[e+52>>2]=0;o[e+56>>2]=0;o[e+60>>2]=0;e=e- -64|0;o[e>>2]=0;o[e+4>>2]=0;o[f+72>>2]=0;o[f+76>>2]=0;o[f+80>>2]=0;o[f+84>>2]=0;o[f+88>>2]=0;b=o[b+8>>2];o[d+48>>2]=0;o[d+52>>2]=0;o[d+40>>2]=0;o[d+44>>2]=0;e=d+24|0;o[e>>2]=0;o[e+4>>2]=0;h=d- -64|0;o[h>>2]=0;o[h+4>>2]=0;o[d+72>>2]=0;o[d+76>>2]=0;h=d+80|0;g=h;o[g>>2]=0;o[g+4>>2]=0;o[d+88>>2]=0;o[d+104>>2]=0;o[d+32>>2]=0;o[d+36>>2]=0;o[d+16>>2]=0;o[d+20>>2]=0;o[d+56>>2]=0;o[d+60>>2]=0;o[d+8>>2]=9152;o[d+96>>2]=0;o[d+100>>2]=0;o[d+12>>2]=b;g=o[b>>2];i=o[b+4>>2];m[d+111|0]=0;eb(d+32|0,(i-g>>2>>>0)/3|0,d+111|0);g=o[d+12>>2];i=o[g+28>>2];g=o[g+24>>2];m[d+111|0]=0;eb(d+44|0,i-g>>2,d+111|0);o[d+28>>2]=f;o[e>>2]=j;o[d+20>>2]=c;o[d+16>>2]=b;Tg(f,d+8|0);o[a>>2]=f;o[d+8>>2]=9152;a=o[d+96>>2];if(a){o[d+100>>2]=a;jl(a)}a=o[h>>2];if(a){o[d+84>>2]=a;jl(a)}a=o[d+68>>2];if(a){o[d+72>>2]=a;jl(a)}a=o[d+56>>2];if(a){o[d+60>>2]=a;jl(a)}o[d+8>>2]=9388;a=o[d+44>>2];if(a){jl(a)}a=o[d+32>>2];if(a){jl(a)}R=d+112|0}function nh(a,b){var c=0,d=0,e=0,f=0,g=0;f=-1;d=-1;a:{if((b|0)==-1){break a}d=b+1|0;f=(d>>>0)%3|0?d:b+ -2|0;d=b+ -1|0;if((b>>>0)%3){break a}d=b+2|0}c=o[a+168>>2];b:{if(c>>>0>7){break b}c:{d:{switch(c-2|0){default:c=o[a+148>>2];e=1;b=o[a+156>>2];g=b+(((f|0)!=-1?o[o[c>>2]+(f<<2)>>2]:-1)<<2)|0;o[g>>2]=o[g>>2]+1;b=(((d|0)!=-1?o[o[c>>2]+(d<<2)>>2]:-1)<<2)+b|0;break c;case 3:e=o[a+148>>2];c=-1;c=((b|0)!=-1?o[o[e>>2]+(b<<2)>>2]:c)<<2;b=o[a+156>>2];c=c+b|0;o[c>>2]=o[c>>2]+1;c=(((f|0)!=-1?o[o[e>>2]+(f<<2)>>2]:-1)<<2)+b|0;o[c>>2]=o[c>>2]+1;c=-1;c=(d|0)!=-1?o[o[e>>2]+(d<<2)>>2]:c;e=2;b=b+(c<<2)|0;break c;case 1:e=o[a+148>>2];c=-1;c=((b|0)!=-1?o[o[e>>2]+(b<<2)>>2]:c)<<2;b=o[a+156>>2];c=c+b|0;o[c>>2]=o[c>>2]+1;c=(((f|0)!=-1?o[o[e>>2]+(f<<2)>>2]:-1)<<2)+b|0;o[c>>2]=o[c>>2]+2;b=(((d|0)!=-1?o[o[e>>2]+(d<<2)>>2]:-1)<<2)+b|0;e=1;break c;case 0:case 2:case 4:break b;case 5:break d}}e=o[a+148>>2];c=-1;c=((b|0)!=-1?o[o[e>>2]+(b<<2)>>2]:c)<<2;b=o[a+156>>2];c=c+b|0;o[c>>2]=o[c>>2]+2;c=(((f|0)!=-1?o[o[e>>2]+(f<<2)>>2]:-1)<<2)+b|0;o[c>>2]=o[c>>2]+2;c=-1;c=(d|0)!=-1?o[o[e>>2]+(d<<2)>>2]:c;e=2;b=b+(c<<2)|0}o[b>>2]=o[b>>2]+e}c=-1;c=(f|0)!=-1?o[o[o[a+148>>2]>>2]+(f<<2)>>2]:c;f=o[a+176>>2];b=f;d=a;c=o[o[a+156>>2]+(c<<2)>>2];if((c|0)>=(b|0)){a=o[a+180>>2];b=(c|0)>(a|0)?a:c}o[d+172>>2]=b-f}function Oe(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;j=R-16|0;R=j;e=o[b+12>>2];c=o[b+20>>2];f=o[b+16>>2];d=f+4|0;if(d>>>0<4){c=c+1|0}g=d;d=c;a:{if((e|0)<(c|0)?1:(e|0)<=(c|0)?r[b+8>>2]>=g>>>0?0:1:0){break a}c=f+o[b>>2]|0;c=p[c|0]|p[c+1|0]<<8|(p[c+2|0]<<16|p[c+3|0]<<24);o[b+16>>2]=g;o[b+20>>2]=d;if((c|0)<0){break a}He(a+76|0,c);g=Rf(j);b:{if(!Sf(g,b)){break b}if((c|0)>=1){e=1;while(1){f=1<<(i&31);h=Uf(g);d=o[a+76>>2]+(i>>>3&536870908)|0;e=e^h;h=o[d>>2]|f;c:{if(!(e&1)){break c}h=o[d>>2]&(f^-1)}f=h;e=e^1;o[d>>2]=f;i=i+1|0;if((c|0)!=(i|0)){continue}break}}d=o[b+12>>2];i=d;c=o[b+20>>2];e=c;g=o[b+16>>2];f=g+4|0;if(f>>>0<4){c=c+1|0}k=o[b+8>>2];h=f;f=c;if((d|0)<(c|0)?1:(d|0)<=(c|0)?k>>>0>=h>>>0?0:1:0){break b}l=o[b>>2];c=l+g|0;d=p[c|0]|p[c+1|0]<<8|(p[c+2|0]<<16|p[c+3|0]<<24);o[b+16>>2]=h;o[b+20>>2]=f;c=e;e=g+8|0;if(e>>>0<8){c=c+1|0}f=e;e=c;if((i|0)<(c|0)?1:(i|0)<=(c|0)?k>>>0>=f>>>0?0:1:0){break b}c=h+l|0;c=p[c|0]|p[c+1|0]<<8|(p[c+2|0]<<16|p[c+3|0]<<24);o[b+16>>2]=f;o[b+20>>2]=e;if((d|0)>(c|0)){break b}o[a+16>>2]=c;o[a+12>>2]=d;b=d;d=(c>>31)-((c>>>0>>0)+(b>>31)|0)|0;b=c-b|0;if(!d&b>>>0>2147483646|d>>>0>0){break b}m=1;b=b+1|0;o[a+20>>2]=b;c=(b|0)/2|0;o[a+24>>2]=c;o[a+28>>2]=0-c;if(b&1){break b}o[a+24>>2]=c+ -1}}R=j+16|0;return m|0}function Nl(a,b,c,d){var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;a:{b:{c:{d:{e:{f:{g:{h:{i:{j:{g=b;if(g){e=c;if(!e){break j}f=d;if(!f){break i}f=x(f)-x(g)|0;if(f>>>0<=31){break h}break b}if((d|0)==1&c>>>0>=0|d>>>0>1){break b}b=(a>>>0)/(c>>>0)|0;Kl(a-u(b,c)|0,0);T=0;return b}e=d;if(!a){break g}if(!e){break f}f=e+ -1|0;if(f&e){break f}Kl(a,f&g);a=g>>>(Tl(e)&31)|0;T=0;return a}f=e+ -1|0;if(!(f&e)){break e}j=(x(e)+33|0)-x(g)|0;h=0-j|0;break c}j=f+1|0;h=63-f|0;break c}a=(g>>>0)/(e>>>0)|0;Kl(0,g-u(a,e)|0);T=0;return a}f=x(e)-x(g)|0;if(f>>>0<31){break d}break b}Kl(a&f,0);if((e|0)==1){break a}c=a;a=Tl(e);d=a&31;if(32<=(a&63)>>>0){f=0;a=b>>>d|0}else{f=b>>>d|0;a=((1<>>d}T=f;return a}j=f+1|0;h=63-f|0}e=b;g=a;f=j&63;i=f&31;if(32<=(f&63)>>>0){f=0;l=e>>>i|0}else{f=e>>>i|0;l=((1<>>i}a=h&63;h=a&31;if(32<=(a&63)>>>0){e=g<>>32-h|b<>>0<4294967295){g=g+1|0}h=e;while(1){e=l;f=f<<1|e>>>31;e=e<<1;k=f;f=b>>>31|e;m=k;e=k;k=f;i=g-((h>>>0>>0)+e|0)|0;e=i>>31;i=i>>31;f=c&i;l=k-f|0;f=m-((d&e)+(k>>>0>>0)|0)|0;e=b<<1|a>>>31;a=n|a<<1;b=e|o;e=0;m=e;k=i&1;n=k;j=j+ -1|0;if(j){continue}break}}Kl(l,f);e=b<<1|a>>>31;a=k|a<<1;T=e|m;return a}Kl(a,b);a=0;b=0}T=b;return a}function me(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;d=o[a+8>>2];c=o[d+28>>2]+ -1|0;if(c>>>0>5){return 0}a:{switch(c-1|0){case 2:ne(a,b);return 1;case 1:ne(a,b);return 1;case 4:f=m[d+24|0];h=f<<2;i=yk((f|0)!=(f&1073741823)?-1:h);c=o[a+16>>2];d=0;b:{if(!o[c+80>>2]){break b}d=o[o[c>>2]>>2]+o[c+48>>2]|0}if(b){while(1){c=j;e=0;if((f|0)>0){while(1){o[i+(e<<2)>>2]=o[d+(c<<2)>>2];c=c+1|0;e=e+1|0;if((f|0)!=(e|0)){continue}break}j=j+f|0}ll(o[o[o[a+8>>2]+64>>2]>>2]+k|0,i,h);k=h+k|0;g=g+1|0;if((g|0)!=(b|0)){continue}break}}jl(i);return 1;case 3:f=m[d+24|0];h=f<<2;i=yk((f|0)!=(f&1073741823)?-1:h);c=o[a+16>>2];d=0;c:{if(!o[c+80>>2]){break c}d=o[o[c>>2]>>2]+o[c+48>>2]|0}if(b){while(1){c=j;e=0;if((f|0)>0){while(1){o[i+(e<<2)>>2]=o[d+(c<<2)>>2];c=c+1|0;e=e+1|0;if((f|0)!=(e|0)){continue}break}j=j+f|0}ll(o[o[o[a+8>>2]+64>>2]>>2]+k|0,i,h);k=h+k|0;g=g+1|0;if((g|0)!=(b|0)){continue}break}}jl(i);return 1;default:break a}}g=m[d+24|0];h=yk((g|0)>-1?g:-1);c=o[a+16>>2];d=0;d:{if(!o[c+80>>2]){break d}d=o[o[c>>2]>>2]+o[c+48>>2]|0}if(b){while(1){c=j;e=0;if((g|0)>0){while(1){m[e+h|0]=o[d+(c<<2)>>2];c=c+1|0;e=e+1|0;if((g|0)!=(e|0)){continue}break}j=g+j|0}ll(o[o[o[a+8>>2]+64>>2]>>2]+k|0,h,g);k=g+k|0;i=i+1|0;if((i|0)!=(b|0)){continue}break}}jl(h);return 1}function Zg(a,b){var c=0,d=0,e=0,f=0,g=0;a:{e=o[a+8>>2];c=o[a+4>>2];if((e-c|0)/144>>>0>=b>>>0){while(1){o[c>>2]=-1;Vi(c+4|0);o[c+104>>2]=0;o[c+108>>2]=0;m[c+100|0]=1;o[c+112>>2]=0;o[c+116>>2]=0;o[c+120>>2]=0;o[c+124>>2]=0;o[c+128>>2]=0;o[c+132>>2]=0;o[c+136>>2]=0;o[c+140>>2]=0;c=o[a+4>>2]+144|0;o[a+4>>2]=c;b=b+ -1|0;if(b){continue}break a}}d=c;c=o[a>>2];f=(d-c|0)/144|0;g=f+b|0;b:{c:{d:{if(g>>>0<29826162){e=(e-c|0)/144|0;c=e<<1;c=e>>>0<14913080?c>>>0>>0?g:c:29826161;d=0;e:{if(!c){break e}if(c>>>0>=29826162){break d}d=yk(u(c,144))}e=d+u(c,144)|0;f=d+u(f,144)|0;c=f;while(1){o[c>>2]=-1;Vi(c+4|0);o[c+104>>2]=0;o[c+108>>2]=0;m[c+100|0]=1;o[c+112>>2]=0;o[c+116>>2]=0;o[c+120>>2]=0;o[c+124>>2]=0;o[c+128>>2]=0;o[c+132>>2]=0;o[c+136>>2]=0;o[c+140>>2]=0;c=c+144|0;b=b+ -1|0;if(b){continue}break}d=d+u(g,144)|0;b=o[a+4>>2];c=o[a>>2];if((b|0)==(c|0)){break c}while(1){b=b+ -144|0;f=Vh(f+ -144|0,b);if((b|0)!=(c|0)){continue}break}c=o[a+4>>2];b=o[a>>2];break b}Nk();D()}db(8832);D()}b=c}o[a+8>>2]=e;o[a+4>>2]=d;o[a>>2]=f;if((b|0)!=(c|0)){while(1){a=o[c+ -12>>2];if(a){o[c+ -8>>2]=a;jl(a)}a=o[c+ -28>>2];if(a){o[c+ -24>>2]=a;jl(a)}a=c+ -144|0;d=o[c+ -40>>2];if(d){o[c+ -36>>2]=d;jl(d)}Yg(c+ -140|0);c=a;if((b|0)!=(c|0)){continue}break}}if(!b){break a}jl(b)}}function _f(a,b){var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0;e=R-32|0;R=e;f=a+16|0;d=o[f>>2];a:{b:{if(!d){break b}h=o[b>>2];c=f;while(1){g=o[d+16>>2]<(h|0);c=g?c:d;d=o[(g<<2)+d>>2];if(d){continue}break}if((c|0)==(f|0)){break b}if((h|0)>=o[c+16>>2]){break a}}j=yi(e+16|0);b=o[b>>2];i=e+8|0;o[i>>2]=0;o[i+4>>2]=0;o[e>>2]=b;o[e+4>>2]=i;c=o[j>>2];h=j+4|0;if((c|0)!=(h|0)){g=e|4;while(1){b=c;d=c+16|0;$f(g,i,d,d);d=o[c+4>>2];c:{if(!d){c=o[b+8>>2];if((b|0)==o[c>>2]){break c}d=b+8|0;while(1){b=o[d>>2];d=b+8|0;c=o[b+8>>2];if((b|0)!=o[c>>2]){continue}break}break c}while(1){c=d;d=o[c>>2];if(d){continue}break}}if((c|0)!=(h|0)){continue}break}}d=o[a+16>>2];d:{if(d){f=a+16|0;g=o[e>>2];while(1){b=o[d+16>>2];e:{if((g|0)<(b|0)){c=o[d>>2];if(c){break e}f=d;break d}if((b|0)>=(g|0)){break d}f=d+4|0;c=o[d+4>>2];if(!c){break d}d=f}f=d;d=c;continue}}d=f}c=o[f>>2];if(!c){c=yk(32);o[c+16>>2]=o[e>>2];o[c+20>>2]=o[e+4>>2];g=o[e+8>>2];o[c+24>>2]=g;b=o[e+12>>2];o[c+28>>2]=b;h=c+24|0;f:{if(!b){o[c+20>>2]=h;break f}o[g+8>>2]=h;o[e+8>>2]=0;o[e+12>>2]=0;o[e+4>>2]=i}o[c+8>>2]=d;o[c>>2]=0;o[c+4>>2]=0;o[f>>2]=c;d=o[o[a+12>>2]>>2];b=c;g:{if(!d){break g}o[a+12>>2]=d;b=o[f>>2]}ag(o[a+16>>2],b);a=a+20|0;o[a>>2]=o[a>>2]+1}Fc(e|4,o[e+8>>2]);Fc(j,o[j+4>>2])}R=e+32|0;return c+20|0}function Vf(a,b){var c=0,d=0,e=0;e=R-32|0;R=e;a:{if(b>>>0<=1){if(b-1){b=yk(48);zg(b);o[b>>2]=9880;o[a+8>>2]=0;o[a+12>>2]=0;o[a>>2]=0;o[a+4>>2]=0;o[a+16>>2]=b;break a}b=yk(52);zg(b);o[b+48>>2]=0;o[b>>2]=8120;o[a+8>>2]=0;o[a+12>>2]=0;o[a>>2]=0;o[a+4>>2]=0;o[a+16>>2]=b;break a}b=yk(32);o[e>>2]=b;o[e+4>>2]=28;o[e+8>>2]=-2147483616;m[b+28|0]=0;c=p[7868]|p[7869]<<8|(p[7870]<<16|p[7871]<<24);m[b+24|0]=c;m[b+25|0]=c>>>8;m[b+26|0]=c>>>16;m[b+27|0]=c>>>24;c=p[7864]|p[7865]<<8|(p[7866]<<16|p[7867]<<24);d=p[7860]|p[7861]<<8|(p[7862]<<16|p[7863]<<24);m[b+16|0]=d;m[b+17|0]=d>>>8;m[b+18|0]=d>>>16;m[b+19|0]=d>>>24;m[b+20|0]=c;m[b+21|0]=c>>>8;m[b+22|0]=c>>>16;m[b+23|0]=c>>>24;c=p[7856]|p[7857]<<8|(p[7858]<<16|p[7859]<<24);d=p[7852]|p[7853]<<8|(p[7854]<<16|p[7855]<<24);m[b+8|0]=d;m[b+9|0]=d>>>8;m[b+10|0]=d>>>16;m[b+11|0]=d>>>24;m[b+12|0]=c;m[b+13|0]=c>>>8;m[b+14|0]=c>>>16;m[b+15|0]=c>>>24;c=p[7848]|p[7849]<<8|(p[7850]<<16|p[7851]<<24);d=p[7844]|p[7845]<<8|(p[7846]<<16|p[7847]<<24);m[b|0]=d;m[b+1|0]=d>>>8;m[b+2|0]=d>>>16;m[b+3|0]=d>>>24;m[b+4|0]=c;m[b+5|0]=c>>>8;m[b+6|0]=c>>>16;m[b+7|0]=c>>>24;o[e+16>>2]=-1;b=Bk(e+16|4,e);o[a>>2]=o[e+16>>2];Bk(a+4|0,b);o[a+16>>2]=0;if(m[b+11|0]<=-1){jl(o[b>>2])}if(m[e+11|0]>-1){break a}jl(o[e>>2])}R=e+32|0}function cj(a,b){var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;d=R-32|0;R=d;o[d+24>>2]=0;o[d+16>>2]=0;o[d+20>>2]=0;a:{e=o[a>>2];c=e;g=o[c+16>>2];h=r[c+8>>2]>g>>>0?0:1;f=o[c+12>>2];c=o[c+20>>2];b:{if((f|0)<(c|0)?1:(f|0)<=(c|0)?h:0){break b}h=p[g+o[e>>2]|0];f=c;c=g+1|0;if(c>>>0<1){f=f+1|0}o[e+16>>2]=c;o[e+20>>2]=f;Gk(d+16|0,h);if(h){f=o[a>>2];j=Kk(d+16|0);l=o[f+12>>2];g=o[f+20>>2];k=o[f+16>>2];e=h;c=k+e|0;if(c>>>0>>0){g=g+1|0}if((l|0)<(g|0)?1:(l|0)<=(g|0)?r[f+8>>2]>=c>>>0?0:1:0){break b}ll(j,k+o[f>>2]|0,h);c=f;f=c;g=o[c+20>>2];h=e+o[c+16>>2]|0;if(h>>>0>>0){g=g+1|0}o[f+16>>2]=h;o[c+20>>2]=g}o[d+12>>2]=0;c=bj(1,d+12|0,o[a>>2]);e=o[d+12>>2];if(!e|!c){break b}o[d+8>>2]=0;o[d>>2]=0;o[d+4>>2]=0;if((e|0)<=-1){break a}i=yk(e);o[d>>2]=i;o[d+4>>2]=i;o[d+8>>2]=e+i;c=e;while(1){m[i|0]=0;i=o[d+4>>2]+1|0;o[d+4>>2]=i;c=c+ -1|0;if(c){continue}break}i=0;c=o[a>>2];a=o[c+8>>2];k=o[c+12>>2];f=a;j=o[c+20>>2];g=o[c+16>>2];a=e;h=g+e|0;if(h>>>0>>0){j=j+1|0}if((k|0)>(j|0)?1:(k|0)>=(j|0)?f>>>0>>0?0:1:0){ll(o[d>>2],g+o[c>>2]|0,e);e=c;h=c;f=o[c+20>>2];c=a+o[c+16>>2]|0;if(c>>>0>>0){f=f+1|0}o[h+16>>2]=c;o[e+20>>2]=f;nj(b,d+16|0,d);i=1}a=o[d>>2];if(!a){break b}o[d+4>>2]=a;jl(a)}if(m[d+27|0]<=-1){jl(o[d+16>>2])}R=d+32|0;return i}Nk();D()}function eg(a,b,c,d){var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,q=0,r=0,s=0,t=0,v=0,w=0,x=0;e=R+ -64|0;R=e;o[e+56>>2]=0;o[e+48>>2]=0;o[e+52>>2]=0;o[e+40>>2]=0;o[e+44>>2]=0;o[e+32>>2]=0;o[e+36>>2]=0;o[e+24>>2]=0;o[e+28>>2]=0;o[e+16>>2]=0;o[e+20>>2]=0;o[e+8>>2]=0;o[e+12>>2]=0;a:{if(!gg(e+8|0,c)){break a}if(!hg(e+8|0,c)){break a}b:{if(!a){ui(c,0,0);break b}if(!o[e+20>>2]){break a}ui(c,0,0);g=o[e+56>>2];s=o[e+36>>2];t=o[e+48>>2];v=o[e+24>>2];while(1){c:{if(g>>>0>16383){break c}f=o[e+52>>2];while(1){if((f|0)<1){break c}f=f+ -1|0;o[e+52>>2]=f;g=p[f+t|0]|g<<8;o[e+56>>2]=g;if(g>>>0<16384){continue}break}}h=g&4095;m=o[(h<<2)+v>>2];i=(m<<3)+s|0;g=(u(o[i>>2],g>>>12|0)+h|0)-o[i+4>>2]|0;o[e+56>>2]=g;if((b|0)>=1){j=0;i=q;if(!p[c+36|0]){break a}while(1){n=0;if((m|0)>=1){h=o[c+32>>2];w=o[c+28>>2];x=o[c+24>>2];f=0;while(1){k=(h>>>3|0)+x|0;d:{if(k>>>0>=w>>>0){l=0;break d}l=p[k|0];k=h+1|0;o[c+32>>2]=k;l=l>>>(h&7)&1;h=k}n=l<>2]=n;i=i+1|0;j=j+1|0;if((j|0)!=(b|0)){continue}break}q=b+q|0}r=b+r|0;if(r>>>0>>0){continue}break}}wi(c);j=1}a=o[e+36>>2];if(a){o[e+40>>2]=a;jl(a)}a=o[e+24>>2];if(a){o[e+28>>2]=a;jl(a)}a=o[e+8>>2];if(a){o[e+12>>2]=a;jl(a)}R=e- -64|0;return j}function Ca(a,b,c){var d=0,e=0,f=0,g=0,h=0,i=0,j=0;e=R-16|0;R=e;o[a+68>>2]=o[a+68>>2]+1;d=u(b,12)+a|0;d=o[d+12>>2]-o[d+8>>2]|0;if((d|0)>=1){d=d>>2;j=(d|0)>1?d:1;d=o[((b<<2)+a|0)+44>>2];while(1){b=d;g=(b>>>0)/3|0;f=(b|0)==-1;d=f?-1:g;h=o[a+56>>2]+(d>>>3&536870908)|0;o[h>>2]=o[h>>2]|1<<(d&31);o[a+72>>2]=o[a+72>>2]+1;a:{b:{if(!i){o[e+12>>2]=(b|0)<0?-1:o[(o[o[a>>2]+96>>2]+u(g,12)|0)+((b>>>0)%3<<2)>>2];o[e+8>>2]=c;Ba(e+8|0,e+12|0);c:{if(!f){d=-1;g=e;f=b+1|0;f=(f>>>0)%3|0?f:b+ -2|0;if((f|0)>=0){h=(f>>>0)/3|0;f=o[(o[o[a>>2]+96>>2]+u(h,12)|0)+(f-u(h,3)<<2)>>2]}else{f=-1}o[g+12>>2]=f;o[e+8>>2]=c;Ba(e+8|0,e+12|0);g=((b>>>0)%3|0?-1:2)+b|0;if((g|0)<0){break c}d=(g>>>0)/3|0;d=o[(o[o[a>>2]+96>>2]+u(d,12)|0)+(g-u(d,3)<<2)>>2];break c}d=-1;o[e+12>>2]=-1;o[e+8>>2]=c;Ba(e+8|0,e+12|0)}o[a+76>>2]=d;o[e+12>>2]=d;o[e+8>>2]=c;Ba(e+8|0,e+12|0);break b}f=(b|0)<0?-1:o[(o[o[a>>2]+96>>2]+u(g,12)|0)+((b>>>0)%3<<2)>>2];o[a+76>>2]=f;o[e+12>>2]=f;o[e+8>>2]=c;Ba(e+8|0,e+12|0);if(i&1){d=-1;if((b|0)==-1){break a}if(b-u(g,3)){b=b+ -1|0;break b}b=b+2|0;break b}d=-1;if((b|0)==-1){break a}d=b+1|0;b=(d>>>0)%3|0?d:b+ -2|0}d=-1;if((b|0)==-1){break a}d=o[o[o[a+4>>2]+12>>2]+(b<<2)>>2]}i=i+1|0;if((j|0)!=(i|0)){continue}break}}R=e+16|0}function Zj(a,b,c,d){var e=0,h=0,i=0,j=0,k=0,l=0,m=0;i=R-32|0;R=i;e=d&2147483647;k=e;e=e+ -1006698496|0;j=c;h=c;if(c>>>0<0){e=e+1|0}l=h;h=e;e=k+ -1140785152|0;m=j;if(j>>>0<0){e=e+1|0}a:{if((e|0)==(h|0)&l>>>0>>0|h>>>0>>0){e=d<<4|c>>>28;c=c<<4|b>>>28;b=b&268435455;j=b;if((b|0)==134217728&a>>>0>=1|b>>>0>134217728){e=e+1073741824|0;a=c+1|0;if(a>>>0<1){e=e+1|0}h=a;break a}h=c;e=e-((c>>>0<0)+ -1073741824|0)|0;if(a|j^134217728){break a}a=h+(h&1)|0;if(a>>>0>>0){e=e+1|0}h=a;break a}if(!(!j&(k|0)==2147418112?!(a|b):(k|0)==2147418112&j>>>0<0|k>>>0<2147418112)){e=d<<4|c>>>28;h=c<<4|b>>>28;e=e&524287|2146959360;break a}h=0;e=2146435072;if((k|0)==1140785151&j>>>0>4294967295|k>>>0>1140785151){break a}e=0;j=k>>>16|0;if(j>>>0<15249){break a}e=d&65535|65536;Xj(i+16|0,a,b,c,e,j+ -15233|0);Yj(i,a,b,c,e,15361-j|0);c=o[i+4>>2];a=o[i+8>>2];e=o[i+12>>2]<<4|a>>>28;h=a<<4|c>>>28;a=c&268435455;c=a;b=o[i>>2]|((o[i+16>>2]|o[i+24>>2])!=0|(o[i+20>>2]|o[i+28>>2])!=0);if((a|0)==134217728&b>>>0>=1|a>>>0>134217728){a=h+1|0;if(a>>>0<1){e=e+1|0}h=a;break a}if(b|c^134217728){break a}a=h+(h&1)|0;if(a>>>0>>0){e=e+1|0}h=a}R=i+32|0;f(0,h|0);f(1,d&-2147483648|e);return+g()}function fh(a,b,c,d){var e=0,f=0,g=0,h=0,i=v(0),j=0,k=v(0),l=0,n=0;f=o[c>>2];l=a;a:{b:{e=o[b+4>>2];if(!e){break b}h=o[b>>2];j=Rl(e);g=f&e+ -1;c:{if(j>>>0<=1){break c}c=f;g=c;if(c>>>0>>0){break c}g=(f>>>0)%(e>>>0)|0}c=g;g=c;c=o[(c<<2)+h>>2];if(!c){break b}n=e+ -1|0;j=j>>>0>1;while(1){c=o[c>>2];if(!c){break b}h=o[c+4>>2];if((f|0)!=(h|0)){d:{if(!j){h=h&n;break d}if(h>>>0>>0){break d}h=(h>>>0)%(e>>>0)|0}if((h|0)!=(g|0)){break b}}if((f|0)!=o[c+8>>2]){continue}break}b=0;break a}c=yk(16);d=o[o[d>>2]>>2];o[c+12>>2]=0;o[c+8>>2]=d;o[c+4>>2]=f;o[c>>2]=0;i=s[b+16>>2];k=v(o[b+12>>2]+1>>>0);e:{if(v(i*v(e>>>0))>>0<3|e<<1;d=b;i=v(B(v(k/i)));f:{if(i=v(0)){g=~~i>>>0;break f}g=0}Wh(d,e>>>0>>0?g:e);e=o[b+4>>2];if(!(e&e+ -1)){g=f&e+ -1;break e}if(f>>>0>>0){g=f;break e}g=(f>>>0)%(e>>>0)|0}f=o[b>>2]+(g<<2)|0;d=o[f>>2];g:{h:{if(!d){o[c>>2]=o[b+8>>2];o[b+8>>2]=c;o[f>>2]=b+8;d=o[c>>2];if(!d){break g}d=o[d+4>>2];f=e+ -1|0;i:{if(!(f&e)){d=d&f;break i}if(d>>>0>>0){break i}d=(d>>>0)%(e>>>0)|0}d=o[b>>2]+(d<<2)|0;break h}o[c>>2]=o[d>>2]}o[d>>2]=c}o[b+12>>2]=o[b+12>>2]+1;b=1}m[l+4|0]=b;o[a>>2]=c}function ki(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;a:{b=o[a+32>>2];e=o[b+16>>2];g=o[b+12>>2];d=o[b+20>>2];b:{if((g|0)<(d|0)?1:(g|0)<=(d|0)?r[b+8>>2]>e>>>0?0:1:0){break b}h=p[e+o[b>>2]|0];i=e+1|0;if(i>>>0<1){d=d+1|0}o[b+16>>2]=i;o[b+20>>2]=d;c:{if(!h){break c}while(1){if(l[o[o[a>>2]+16>>2]](a,c)){c=c+1|0;if((h|0)!=(c|0)){continue}break c}break}return 0}c=o[a+8>>2];d=o[a+12>>2];if((c|0)!=(d|0)){while(1){b=o[c>>2];if(!l[o[o[b>>2]+8>>2]](b,a,o[a+4>>2])){break b}c=c+4|0;if((d|0)!=(c|0)){continue}break}}if(h){c=0;while(1){b=o[o[a+8>>2]+(c<<2)>>2];if(!l[o[o[b>>2]+12>>2]](b,o[a+32>>2])){break a}c=c+1|0;if((h|0)!=(c|0)){continue}break}g=a+20|0;while(1){c=0;i=j<<2;b=o[i+o[a+8>>2]>>2];d=l[o[o[b>>2]+24>>2]](b)|0;if((d|0)>0){while(1){b=o[o[a+8>>2]+i>>2];b=l[o[o[b>>2]+20>>2]](b,c)|0;k=o[a+20>>2];e=o[a+24>>2]-k>>2;d:{if(b>>>0>>0){break d}f=b+1|0;if(f>>>0>e>>>0){Ia(g,f-e|0);k=o[g>>2];break d}if(f>>>0>=e>>>0){break d}o[a+24>>2]=(f<<2)+k}o[(b<<2)+k>>2]=j;c=c+1|0;if((d|0)!=(c|0)){continue}break}}j=j+1|0;if((j|0)!=(h|0)){continue}break}}f=0;if(!l[o[o[a>>2]+28>>2]](a)){break b}f=l[o[o[a>>2]+32>>2]](a)|0}return f|0}return 0}function Ma(a,b,c){var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;e=R-16|0;R=e;i=o[a+80>>2];g=m[b+24|0];f=u(i,g);a:{a=o[b+28>>2];b:{if(!(!p[b+84|0]|((a|0)!=2?(a|0)!=1:0))){h=o[b+48>>2];b=o[o[b>>2]>>2];o[e+8>>2]=0;o[e>>2]=0;o[e+4>>2]=0;a=0;if(f){if((f|0)<=-1){break a}a=yk(f);o[e>>2]=a;d=a+f|0;o[e+8>>2]=d;ll(a,b+h|0,f);o[e+4>>2]=d}b=o[c>>2];if(b){o[c+4>>2]=b;jl(b);o[c+8>>2]=0;o[c>>2]=0;o[c+4>>2]=0}o[c+8>>2]=d;o[c+4>>2]=d;o[c>>2]=a;d=1;break b}o[e+8>>2]=0;o[e>>2]=0;o[e+4>>2]=0;if(g){if((g|0)<=-1){break a}d=yk(g);o[e>>2]=d;o[e+4>>2]=d;o[e+8>>2]=d+g;a=g;while(1){m[d|0]=0;d=o[e+4>>2]+1|0;o[e+4>>2]=d;a=a+ -1|0;if(a){continue}break}}a=o[c>>2];h=o[c+4>>2]-a|0;c:{if(f>>>0>h>>>0){Ka(c,f-h|0);break c}if(f>>>0>=h>>>0){break c}o[c+4>>2]=a+f}d:{if(i){k=(g|0)<1;f=0;while(1){a=f;h=b;if(!p[b+84|0]){a=o[o[b+68>>2]+(f<<2)>>2]}l=a;a=o[e>>2];d=0;if(!Na(h,l,m[b+24|0],a)){break d}if(!k){m[o[c>>2]+j|0]=p[a|0];d=1;a=j;if((g|0)!=1){while(1){a=a+1|0;m[a+o[c>>2]|0]=p[o[e>>2]+d|0];d=d+1|0;if((g|0)!=(d|0)){continue}break}}j=g+j|0}f=f+1|0;if((i|0)!=(f|0)){continue}break}}a=o[e>>2];d=1}if(!a){break b}o[e+4>>2]=a;jl(a)}R=e+16|0;return d}Nk();D()}function Ja(a,b,c){var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;e=R-16|0;R=e;i=o[a+80>>2];g=m[b+24|0];f=u(i,g);a:{a=o[b+28>>2];b:{if(!(!p[b+84|0]|((a|0)!=2?(a|0)!=1:0))){h=o[b+48>>2];b=o[o[b>>2]>>2];o[e+8>>2]=0;o[e>>2]=0;o[e+4>>2]=0;a=0;if(f){if((f|0)<=-1){break a}a=yk(f);o[e>>2]=a;d=a+f|0;o[e+8>>2]=d;ll(a,b+h|0,f);o[e+4>>2]=d}b=o[c>>2];if(b){o[c+4>>2]=b;jl(b);o[c+8>>2]=0;o[c>>2]=0;o[c+4>>2]=0}o[c+8>>2]=d;o[c+4>>2]=d;o[c>>2]=a;d=1;break b}o[e+8>>2]=0;o[e>>2]=0;o[e+4>>2]=0;if(g){if((g|0)<=-1){break a}d=yk(g);o[e>>2]=d;o[e+4>>2]=d;o[e+8>>2]=d+g;a=g;while(1){m[d|0]=0;d=o[e+4>>2]+1|0;o[e+4>>2]=d;a=a+ -1|0;if(a){continue}break}}a=o[c>>2];h=o[c+4>>2]-a|0;c:{if(f>>>0>h>>>0){Ka(c,f-h|0);break c}if(f>>>0>=h>>>0){break c}o[c+4>>2]=a+f}d:{if(i){k=(g|0)<1;f=0;while(1){a=f;h=b;if(!p[b+84|0]){a=o[o[b+68>>2]+(f<<2)>>2]}l=a;a=o[e>>2];d=0;if(!La(h,l,m[b+24|0],a)){break d}if(!k){m[o[c>>2]+j|0]=p[a|0];d=1;a=j;if((g|0)!=1){while(1){a=a+1|0;m[a+o[c>>2]|0]=p[o[e>>2]+d|0];d=d+1|0;if((g|0)!=(d|0)){continue}break}}j=g+j|0}f=f+1|0;if((i|0)!=(f|0)){continue}break}}a=o[e>>2];d=1}if(!a){break b}o[e+4>>2]=a;jl(a)}R=e+16|0;return d}Nk();D()}function Va(a,b,c){var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;e=R-16|0;R=e;k=o[a+80>>2];h=m[b+24|0];i=u(k,h);a:{a=o[b+28>>2];b:{if(!(!p[b+84|0]|((a|0)!=6?(a|0)!=5:0))){j=o[b+48>>2];b=o[o[b>>2]>>2];o[e+8>>2]=0;o[e>>2]=0;o[e+4>>2]=0;a=0;f=i<<2;c:{if(!f){break c}a=f>>2;if(a>>>0>=1073741824){break a}d=yk(f);o[e>>2]=d;o[e+4>>2]=d;g=(a<<2)+d|0;o[e+8>>2]=g;if((f|0)<1){a=d;break c}a=ll(d,b+j|0,f);d=a+f|0;o[e+4>>2]=d}b=o[c>>2];if(b){o[c+4>>2]=b;jl(b);o[c+8>>2]=0;o[c>>2]=0;o[c+4>>2]=0}o[c+8>>2]=g;o[c+4>>2]=d;o[c>>2]=a;a=1;break b}o[e+8>>2]=0;o[e>>2]=0;o[e+4>>2]=0;if(h){if((h|0)<=-1){break a}d=h<<2;g=yk(d);o[e>>2]=g;a=d+g|0;o[e+8>>2]=a;ml(g,0,d);o[e+4>>2]=a}a=o[c>>2];d=o[c+4>>2]-a>>2;d:{if(i>>>0>d>>>0){Ia(c,i-d|0);break d}if(i>>>0>=d>>>0){break d}o[c+4>>2]=a+(i<<2)}e:{if(!k){a=1;break e}l=(h|0)<1;while(1){a=f;d=b;if(!p[d+84|0]){a=o[o[b+68>>2]+(f<<2)>>2]}if(!Wa(d,a,m[b+24|0],g)){a=0;break e}if(!l){i=o[c>>2];a=0;d=j;while(1){o[i+(d<<2)>>2]=o[(a<<2)+g>>2];d=d+1|0;a=a+1|0;if((h|0)!=(a|0)){continue}break}j=h+j|0}a=1;f=f+1|0;if((k|0)!=(f|0)){continue}break}}if(!g){break b}o[e+4>>2]=g;jl(g)}R=e+16|0;return a}Nk();D()}function Ta(a,b,c){var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;e=R-16|0;R=e;k=o[a+80>>2];h=m[b+24|0];i=u(k,h);a:{a=o[b+28>>2];b:{if(!(!p[b+84|0]|((a|0)!=6?(a|0)!=5:0))){j=o[b+48>>2];b=o[o[b>>2]>>2];o[e+8>>2]=0;o[e>>2]=0;o[e+4>>2]=0;a=0;f=i<<2;c:{if(!f){break c}a=f>>2;if(a>>>0>=1073741824){break a}d=yk(f);o[e>>2]=d;o[e+4>>2]=d;g=(a<<2)+d|0;o[e+8>>2]=g;if((f|0)<1){a=d;break c}a=ll(d,b+j|0,f);d=a+f|0;o[e+4>>2]=d}b=o[c>>2];if(b){o[c+4>>2]=b;jl(b);o[c+8>>2]=0;o[c>>2]=0;o[c+4>>2]=0}o[c+8>>2]=g;o[c+4>>2]=d;o[c>>2]=a;a=1;break b}o[e+8>>2]=0;o[e>>2]=0;o[e+4>>2]=0;if(h){if((h|0)<=-1){break a}d=h<<2;g=yk(d);o[e>>2]=g;a=d+g|0;o[e+8>>2]=a;ml(g,0,d);o[e+4>>2]=a}a=o[c>>2];d=o[c+4>>2]-a>>2;d:{if(i>>>0>d>>>0){Ia(c,i-d|0);break d}if(i>>>0>=d>>>0){break d}o[c+4>>2]=a+(i<<2)}e:{if(!k){a=1;break e}l=(h|0)<1;while(1){a=f;d=b;if(!p[d+84|0]){a=o[o[b+68>>2]+(f<<2)>>2]}if(!Ua(d,a,m[b+24|0],g)){a=0;break e}if(!l){i=o[c>>2];a=0;d=j;while(1){o[i+(d<<2)>>2]=o[(a<<2)+g>>2];d=d+1|0;a=a+1|0;if((h|0)!=(a|0)){continue}break}j=h+j|0}a=1;f=f+1|0;if((k|0)!=(f|0)){continue}break}}if(!g){break b}o[e+4>>2]=g;jl(g)}R=e+16|0;return a}Nk();D()}function ll(a,b,c){var d=0,e=0,f=0;if(c>>>0>=512){O(a|0,b|0,c|0)|0;return a}e=a+c|0;a:{if(!((a^b)&3)){b:{if((c|0)<1){c=a;break b}if(!(a&3)){c=a;break b}c=a;while(1){m[c|0]=p[b|0];b=b+1|0;c=c+1|0;if(c>>>0>=e>>>0){break b}if(c&3){continue}break}}d=e&-4;c:{if(d>>>0<64){break c}f=d+ -64|0;if(c>>>0>f>>>0){break c}while(1){o[c>>2]=o[b>>2];o[c+4>>2]=o[b+4>>2];o[c+8>>2]=o[b+8>>2];o[c+12>>2]=o[b+12>>2];o[c+16>>2]=o[b+16>>2];o[c+20>>2]=o[b+20>>2];o[c+24>>2]=o[b+24>>2];o[c+28>>2]=o[b+28>>2];o[c+32>>2]=o[b+32>>2];o[c+36>>2]=o[b+36>>2];o[c+40>>2]=o[b+40>>2];o[c+44>>2]=o[b+44>>2];o[c+48>>2]=o[b+48>>2];o[c+52>>2]=o[b+52>>2];o[c+56>>2]=o[b+56>>2];o[c+60>>2]=o[b+60>>2];b=b- -64|0;c=c- -64|0;if(c>>>0<=f>>>0){continue}break}}if(c>>>0>=d>>>0){break a}while(1){o[c>>2]=o[b>>2];b=b+4|0;c=c+4|0;if(c>>>0>>0){continue}break}break a}if(e>>>0<4){c=a;break a}d=e+ -4|0;if(d>>>0>>0){c=a;break a}c=a;while(1){m[c|0]=p[b|0];m[c+1|0]=p[b+1|0];m[c+2|0]=p[b+2|0];m[c+3|0]=p[b+3|0];b=b+4|0;c=c+4|0;if(c>>>0<=d>>>0){continue}break}}if(c>>>0>>0){while(1){m[c|0]=p[b|0];b=b+1|0;c=c+1|0;if((e|0)!=(c|0)){continue}break}}return a}function Fe(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;i=R-32|0;R=i;a:{b:{while(1){if(!Ge(1,i+28|0,b)){break b}c=o[i+28>>2];if(c){f=(u(d,12)+a|0)+60|0;He(f,c);h=Rf(i+8|0);if(!Sf(h,b)){break b}g=0;while(1){j=1<<(g&31);k=Uf(h);e=o[f>>2]+(g>>>3&536870908)|0;l=e;if(k){e=o[e>>2]|j}else{e=o[e>>2]&(j^-1)}o[l>>2]=e;g=g+1|0;if((c|0)!=(g|0)){continue}break}}d=d+1|0;if((d|0)!=4){continue}break}g=0;d=o[b+12>>2];j=d;c=o[b+20>>2];e=c;h=o[b+16>>2];f=h+4|0;if(f>>>0<4){c=c+1|0}l=o[b+8>>2];k=f;f=c;if((d|0)<(c|0)?1:(d|0)<=(c|0)?l>>>0>=k>>>0?0:1:0){break a}m=o[b>>2];c=m+h|0;d=p[c|0]|p[c+1|0]<<8|(p[c+2|0]<<16|p[c+3|0]<<24);o[b+16>>2]=k;o[b+20>>2]=f;c=e;e=h+8|0;if(e>>>0<8){c=c+1|0}f=e;e=c;if((j|0)<(c|0)?1:(j|0)<=(c|0)?l>>>0>=f>>>0?0:1:0){break a}c=k+m|0;c=p[c|0]|p[c+1|0]<<8|(p[c+2|0]<<16|p[c+3|0]<<24);o[b+16>>2]=f;o[b+20>>2]=e;if((d|0)>(c|0)){break a}o[a+16>>2]=c;o[a+12>>2]=d;b=d;d=(c>>31)-((c>>>0>>0)+(b>>31)|0)|0;b=c-b|0;if(!d&b>>>0>2147483646|d>>>0>0){break a}g=1;b=b+1|0;o[a+20>>2]=b;c=(b|0)/2|0;o[a+24>>2]=c;o[a+28>>2]=0-c;if(b&1){break a}o[a+24>>2]=c+ -1;break a}g=0}R=i+32|0;return g|0}function oh(a){a=a|0;var b=0,c=0,d=0,e=0;o[a>>2]=8228;b=a+368|0;d=o[b>>2];o[b>>2]=0;if(d){c=d+ -4|0;b=o[c>>2];if(b){b=d+(b<<4)|0;while(1){b=b+ -16|0;if((d|0)!=(b|0)){continue}break}}jl(c)}d=o[a+216>>2];if(d){b=o[a+220>>2];c=d;a:{if((d|0)==(b|0)){break a}while(1){c=o[b+ -12>>2];if(c){o[b+ -8>>2]=c;jl(c)}c=o[b+ -28>>2];if(c){o[b+ -24>>2]=c;jl(c)}c=b+ -144|0;e=o[b+ -40>>2];if(e){o[b+ -36>>2]=e;jl(e)}Yg(b+ -140|0);b=c;if((d|0)!=(b|0)){continue}break}c=o[a+216>>2]}o[a+220>>2]=d;jl(c)}b=o[a+196>>2];if(b){o[a+200>>2]=b;jl(b)}b=o[a+184>>2];if(b){o[a+188>>2]=b;jl(b)}b=o[a+172>>2];if(b){o[a+176>>2]=b;jl(b)}b=o[a+160>>2];if(b){o[a+164>>2]=b;jl(b)}b=o[a+144>>2];if(b){while(1){d=o[b>>2];jl(b);b=d;if(b){continue}break}}b=o[a+136>>2];o[a+136>>2]=0;if(b){jl(b)}b=o[a+120>>2];if(b){jl(b)}b=o[a+108>>2];if(b){jl(b)}b=o[a+96>>2];if(b){jl(b)}b=o[a+72>>2];if(b){o[a+76>>2]=b;jl(b)}b=o[a+60>>2];if(b){jl(b)}b=o[a+48>>2];if(b){o[a+52>>2]=b;jl(b)}b=o[a+36>>2];if(b){o[a+40>>2]=b;jl(b)}b=o[a+24>>2];if(b){o[a+28>>2]=b;jl(b)}b=o[a+12>>2];if(b){o[a+16>>2]=b;jl(b)}b=o[a+8>>2];o[a+8>>2]=0;if(b){za(a+8|0,b)}return a|0}function Ra(a,b,c){var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;e=R-16|0;R=e;k=o[a+80>>2];h=m[b+24|0];a=u(k,h);a:{g=o[b+28>>2];b:{if(!(!p[b+84|0]|((g|0)!=4?(g|0)!=3:0))){i=o[b+48>>2];j=o[o[b>>2]>>2];o[e+8>>2]=0;o[e>>2]=0;o[e+4>>2]=0;b=0;a=a<<1;if(a){if((a|0)<=-1){break a}d=yk(a);o[e>>2]=d;f=(a>>1<<1)+d|0;o[e+8>>2]=f;b=ll(d,i+j|0,a)+a|0;o[e+4>>2]=b}a=o[c>>2];if(a){o[c+4>>2]=a;jl(a);o[c+8>>2]=0;o[c>>2]=0;o[c+4>>2]=0}o[c+8>>2]=f;o[c+4>>2]=b;o[c>>2]=d;a=1;break b}o[e+8>>2]=0;o[e>>2]=0;o[e+4>>2]=0;if(h){if((h|0)<=-1){break a}d=h<<1;f=yk(d);o[e>>2]=f;g=d+f|0;o[e+8>>2]=g;ml(f,0,d);o[e+4>>2]=g}g=o[c>>2];d=o[c+4>>2]-g>>1;c:{if(a>>>0>d>>>0){Pa(c,a-d|0);break c}if(a>>>0>=d>>>0){break c}o[c+4>>2]=g+(a<<1)}d:{if(!k){a=1;break d}g=(h|0)<1;while(1){a=i;d=b;if(!p[d+84|0]){a=o[o[b+68>>2]+(i<<2)>>2]}if(!Sa(d,a,m[b+24|0],f)){a=0;break d}if(!g){l=o[c>>2];a=0;d=j;while(1){n[l+(d<<1)>>1]=q[(a<<1)+f>>1];d=d+1|0;a=a+1|0;if((h|0)!=(a|0)){continue}break}j=h+j|0}a=1;i=i+1|0;if((k|0)!=(i|0)){continue}break}}if(!f){break b}o[e+4>>2]=f;jl(f)}R=e+16|0;return a}Nk();D()}function Oa(a,b,c){var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;e=R-16|0;R=e;k=o[a+80>>2];h=m[b+24|0];a=u(k,h);a:{g=o[b+28>>2];b:{if(!(!p[b+84|0]|((g|0)!=4?(g|0)!=3:0))){i=o[b+48>>2];j=o[o[b>>2]>>2];o[e+8>>2]=0;o[e>>2]=0;o[e+4>>2]=0;b=0;a=a<<1;if(a){if((a|0)<=-1){break a}d=yk(a);o[e>>2]=d;f=(a>>1<<1)+d|0;o[e+8>>2]=f;b=ll(d,i+j|0,a)+a|0;o[e+4>>2]=b}a=o[c>>2];if(a){o[c+4>>2]=a;jl(a);o[c+8>>2]=0;o[c>>2]=0;o[c+4>>2]=0}o[c+8>>2]=f;o[c+4>>2]=b;o[c>>2]=d;a=1;break b}o[e+8>>2]=0;o[e>>2]=0;o[e+4>>2]=0;if(h){if((h|0)<=-1){break a}d=h<<1;f=yk(d);o[e>>2]=f;g=d+f|0;o[e+8>>2]=g;ml(f,0,d);o[e+4>>2]=g}g=o[c>>2];d=o[c+4>>2]-g>>1;c:{if(a>>>0>d>>>0){Pa(c,a-d|0);break c}if(a>>>0>=d>>>0){break c}o[c+4>>2]=g+(a<<1)}d:{if(!k){a=1;break d}g=(h|0)<1;while(1){a=i;d=b;if(!p[d+84|0]){a=o[o[b+68>>2]+(i<<2)>>2]}if(!Qa(d,a,m[b+24|0],f)){a=0;break d}if(!g){l=o[c>>2];a=0;d=j;while(1){n[l+(d<<1)>>1]=q[(a<<1)+f>>1];d=d+1|0;a=a+1|0;if((h|0)!=(a|0)){continue}break}j=h+j|0}a=1;i=i+1|0;if((k|0)!=(i|0)){continue}break}}if(!f){break b}o[e+4>>2]=f;jl(f)}R=e+16|0;return a}Nk();D()}function hf(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0;d=0;a:{if((e|0)!=2){break a}o[a+8>>2]=2;o[a- -64>>2]=f;d=a+32|0;e=o[d>>2];f=o[a+36>>2]-e|0;g=f>>2;b:{if(g>>>0<=1){Ia(d,2-g|0);break b}if((f|0)==8){break b}o[a+36>>2]=e+8}d=1;f=o[a+56>>2];e=o[f>>2];f=o[f+4>>2]-e|0;if((f|0)<1){break a}j=a+60|0;d=f>>2;k=(d|0)>1?d:1;while(1){if(!jf(j,o[(i<<2)+e>>2],c,i)){d=0;break a}c:{if(o[a+8>>2]<1){break c}e=0;while(1){d=e<<2;f=o[(d+a|0)+68>>2];h=o[a+16>>2];d:{if((f|0)>(h|0)){g=o[a+32>>2];o[d+g>>2]=h;break d}g=o[a+32>>2];d=d+g|0;h=o[a+12>>2];if((f|0)<(h|0)){o[d>>2]=h;break d}o[d>>2]=f}e=e+1|0;f=o[a+8>>2];if((e|0)<(f|0)){continue}break}d=0;if((f|0)<1){break c}e=i<<3;h=e+c|0;l=b+e|0;while(1){f=d<<2;e=f+h|0;f=o[f+l>>2]+o[f+g>>2]|0;o[e>>2]=f;e:{if((f|0)>o[a+16>>2]){f=f-o[a+20>>2]|0}else{if((f|0)>=o[a+12>>2]){break e}f=f+o[a+20>>2]|0}o[e>>2]=f}d=d+1|0;if((d|0)>2]){continue}break}}d=1;i=i+1|0;if((k|0)==(i|0)){break a}d=o[a+56>>2];e=o[d>>2];if(o[d+4>>2]-e>>2>>>0>i>>>0){continue}break}Ok();D()}return d|0}function Pe(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0;d=0;a:{if((e|0)!=2){break a}o[a+8>>2]=2;o[a- -64>>2]=f;d=a+32|0;e=o[d>>2];f=o[a+36>>2]-e|0;g=f>>2;b:{if(g>>>0<=1){Ia(d,2-g|0);break b}if((f|0)==8){break b}o[a+36>>2]=e+8}d=1;f=o[a+56>>2];e=o[f>>2];f=o[f+4>>2]-e|0;if((f|0)<1){break a}j=a+60|0;d=f>>2;k=(d|0)>1?d:1;while(1){if(!Qe(j,o[(i<<2)+e>>2],c,i)){d=0;break a}c:{if(o[a+8>>2]<1){break c}e=0;while(1){d=e<<2;f=o[(d+a|0)+68>>2];h=o[a+16>>2];d:{if((f|0)>(h|0)){g=o[a+32>>2];o[d+g>>2]=h;break d}g=o[a+32>>2];d=d+g|0;h=o[a+12>>2];if((f|0)<(h|0)){o[d>>2]=h;break d}o[d>>2]=f}e=e+1|0;f=o[a+8>>2];if((e|0)<(f|0)){continue}break}d=0;if((f|0)<1){break c}e=i<<3;h=e+c|0;l=b+e|0;while(1){f=d<<2;e=f+h|0;f=o[f+l>>2]+o[f+g>>2]|0;o[e>>2]=f;e:{if((f|0)>o[a+16>>2]){f=f-o[a+20>>2]|0}else{if((f|0)>=o[a+12>>2]){break e}f=f+o[a+20>>2]|0}o[e>>2]=f}d=d+1|0;if((d|0)>2]){continue}break}}d=1;i=i+1|0;if((k|0)==(i|0)){break a}d=o[a+56>>2];e=o[d>>2];if(o[d+4>>2]-e>>2>>>0>i>>>0){continue}break}Ok();D()}return d|0}function ag(a,b){var c=0,d=0,e=0;c=(a|0)==(b|0);m[b+12|0]=c;a:{if(c){break a}while(1){d=o[b+8>>2];if(p[d+12|0]){break a}b:{c=o[d+8>>2];e=o[c>>2];if((e|0)==(d|0)){e=o[c+4>>2];if(!(!e|p[e+12|0])){break b}c:{if(o[d>>2]==(b|0)){b=d;break c}b=o[d+4>>2];e=o[b>>2];o[d+4>>2]=e;a=b;if(e){o[e+8>>2]=d;c=o[d+8>>2]}o[a+8>>2]=c;a=o[d+8>>2];o[(((d|0)!=o[a>>2])<<2)+a>>2]=b;o[b>>2]=d;o[d+8>>2]=b;c=o[b+8>>2]}m[b+12|0]=1;m[c+12|0]=0;a=o[c>>2];b=o[a+4>>2];o[c>>2]=b;if(b){o[b+8>>2]=c}o[a+8>>2]=o[c+8>>2];b=o[c+8>>2];o[((o[b>>2]!=(c|0))<<2)+b>>2]=a;o[a+4>>2]=c;o[c+8>>2]=a;return}if(!(p[e+12|0]|!e)){break b}d:{if(o[d>>2]!=(b|0)){b=d;break d}e=o[b+4>>2];o[d>>2]=e;a=b;if(e){o[e+8>>2]=d;c=o[d+8>>2]}o[a+8>>2]=c;a=o[d+8>>2];o[(((d|0)!=o[a>>2])<<2)+a>>2]=b;o[b+4>>2]=d;o[d+8>>2]=b;c=o[b+8>>2]}m[b+12|0]=1;m[c+12|0]=0;a=o[c+4>>2];b=o[a>>2];o[c+4>>2]=b;if(b){o[b+8>>2]=c}o[a+8>>2]=o[c+8>>2];b=o[c+8>>2];o[((o[b>>2]!=(c|0))<<2)+b>>2]=a;o[a>>2]=c;o[c+8>>2]=a;break a}b=e+12|0;m[d+12|0]=1;m[c+12|0]=(a|0)==(c|0);m[b|0]=1;b=c;if((a|0)!=(b|0)){continue}break}}}function wf(a,b,c,d,e,f){var g=0,h=0,i=0,j=0;j=o[o[o[b+4>>2]+8>>2]+(d<<2)>>2];a:{b:{if((l[o[o[b>>2]+8>>2]](b)|0)!=1|c+ -1>>>0>5){break b}h=l[o[o[b>>2]+36>>2]](b)|0;f=l[o[o[b>>2]+44>>2]](b,d)|0;if(!h|!f){break b}g=f+12|0;i=l[o[o[b>>2]+40>>2]](b,d)|0;d=o[b+44>>2];c:{if(i){if((c|0)!=6){break c}b=yk(104);o[b+4>>2]=j;c=o[e+4>>2];o[b+8>>2]=o[e>>2];o[b+12>>2]=c;c=o[e+12>>2];o[b+16>>2]=o[e+8>>2];o[b+20>>2]=c;o[b+36>>2]=f;o[b+32>>2]=g;o[b+28>>2]=i;o[b+24>>2]=d;o[b+64>>2]=f;o[b+60>>2]=g;o[b+56>>2]=i;o[b+52>>2]=d;o[b+44>>2]=0;o[b+48>>2]=0;o[b>>2]=5700;o[b+72>>2]=-1;o[b+76>>2]=-1;o[b+68>>2]=1;o[b+40>>2]=6264;break a}if((c|0)!=6){break c}b=yk(104);o[b+4>>2]=j;c=o[e+4>>2];o[b+8>>2]=o[e>>2];o[b+12>>2]=c;c=o[e+12>>2];o[b+16>>2]=o[e+8>>2];o[b+20>>2]=c;o[b+36>>2]=f;o[b+32>>2]=g;o[b+28>>2]=h;o[b+24>>2]=d;o[b+64>>2]=f;o[b+60>>2]=g;o[b+56>>2]=h;o[b+52>>2]=d;o[b+44>>2]=0;o[b+48>>2]=0;o[b>>2]=6704;o[b+72>>2]=-1;o[b+76>>2]=-1;o[b+68>>2]=1;o[b+40>>2]=7124;break a}o[a>>2]=0}o[a>>2]=0;return}o[b+80>>2]=-1;o[b+84>>2]=-1;Rf(b+88|0);o[a>>2]=b}function hb(a,b,c,d){var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;f=o[b>>2];e=o[c+4>>2]+(o[c>>2]-f<<3)|0;c=o[b+4>>2];g=e-c|0;a:{if((g|0)<=0){c=o[d+4>>2];break a}b:{if(!c){c=o[d+4>>2];break b}e=o[d+4>>2];j=32-e|0;k=32-c|0;h=(g|0)<(k|0)?g:k;i=j>>>0>>0?j:h;l=o[d>>2];f=o[f>>2]&(-1<>>k-h);o[l>>2]=o[l>>2]&(-1<>>j-i^-1)|(e>>>0>c>>>0?f<>>c-e|0);e=e+i|0;c=e&31;o[d+4>>2]=c;j=l+(e>>>3&536870908)|0;o[d>>2]=j;e=h-i|0;if((e|0)>=1){o[j>>2]=o[j>>2]&(-1>>>32-e^-1)|f>>>i+o[b+4>>2];o[d+4>>2]=e;c=e}g=g-h|0;f=o[b>>2]+4|0;o[b>>2]=f}i=-1<>2];f=o[f>>2];o[e>>2]=j&o[e>>2]|f<>2]=e+4;o[e+4>>2]=i&o[e+4>>2]|f>>>h;f=o[b>>2]+4|0;o[b>>2]=f;k=(g|0)>63;e=g+ -32|0;g=e;if(k){continue}break}}if((e|0)<1){break a}b=o[d>>2];g=(h|0)<(e|0)?h:e;i=o[b>>2]&(i&-1>>>h-g^-1);h=o[f>>2]&-1>>>32-e;o[b>>2]=i|h<>2]=c;f=b+(f>>>3&536870908)|0;o[d>>2]=f;b=e-g|0;if((b|0)<1){break a}o[f>>2]=o[f>>2]&(-1>>>32-b^-1)|h>>>g;o[d+4>>2]=b;c=b}b=o[d>>2];o[a+4>>2]=c;o[a>>2]=b}function Wd(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,q=0,s=0;g=R-16|0;R=g;a:{if(!Bd(a,b)){break a}k=a+36|0;h=l[o[o[a>>2]+24>>2]](a)|0;e=o[a+40>>2];d=o[a+36>>2];c=e-d>>2;b:{if(h>>>0>c>>>0){Xd(k,h-c|0);break b}if(h>>>0>=c>>>0){break b}d=d+(h<<2)|0;if((d|0)!=(e|0)){while(1){e=e+ -4|0;c=o[e>>2];o[e>>2]=0;if(c){l[o[o[c>>2]+4>>2]](c)}if((e|0)!=(d|0)){continue}break}}o[a+40>>2]=d}j=1;if((h|0)<1){break a}j=0;e=0;while(1){f=o[b+16>>2];d=o[b+12>>2];c=o[b+20>>2];if((d|0)<(c|0)?1:(d|0)<=(c|0)?r[b+8>>2]>f>>>0?0:1:0){break a}i=p[f+o[b>>2]|0];f=f+1|0;if(f>>>0<1){c=c+1|0}d=b;o[d+16>>2]=f;o[d+20>>2]=c;l[o[o[a>>2]+48>>2]](g+8|0,a,i);c=o[a+36>>2];d=o[g+8>>2];o[g+8>>2]=0;f=e<<2;i=c+f|0;c=o[i>>2];o[i>>2]=d;if(c){l[o[o[c>>2]+4>>2]](c)}c=o[g+8>>2];o[g+8>>2]=0;if(c){l[o[o[c>>2]+4>>2]](c)}c=o[o[k>>2]+f>>2];if(!c){break a}if(!(n=c,q=l[o[o[a>>2]+28>>2]](a)|0,s=l[o[o[a>>2]+20>>2]](a,e)|0,m=o[o[c>>2]+8>>2],l[m](n|0,q|0,s|0)|0)){break a}e=e+1|0;if((h|0)!=(e|0)){continue}break}j=1}R=g+16|0;return j|0}function Nf(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0;b=m[o[a+8>>2]+24|0];d=b<<2;b=yk((b|0)!=(b&1073741823)?-1:d);c=o[a+28>>2];o[a+28>>2]=b;if(c){jl(c)}c=o[o[a+4>>2]+32>>2];b=o[c+8>>2];i=o[c+12>>2];g=b;f=o[c+20>>2];h=o[c+16>>2];b=d;e=h+b|0;if(e>>>0>>0){f=f+1|0}a:{if((i|0)<(f|0)?1:(i|0)<=(f|0)?g>>>0>=e>>>0?0:1:0){break a}ll(o[a+28>>2],h+o[c>>2]|0,d);d=c;g=c;e=o[c+20>>2];c=b+o[c+16>>2]|0;if(c>>>0>>0){e=e+1|0}o[g+16>>2]=c;o[d+20>>2]=e;e=o[a+4>>2];d=o[e+32>>2];b=o[d+8>>2];f=o[d+12>>2];g=b;h=o[d+20>>2];c=o[d+16>>2];b=c+4|0;if(b>>>0<4){h=h+1|0}if((f|0)<(h|0)?1:(f|0)<=(h|0)?g>>>0>=b>>>0?0:1:0){break a}b=c+o[d>>2]|0;o[a+32>>2]=p[b|0]|p[b+1|0]<<8|(p[b+2|0]<<16|p[b+3|0]<<24);b=d;g=b;c=o[b+20>>2];d=o[b+16>>2]+4|0;if(d>>>0<4){c=c+1|0}o[g+16>>2]=d;o[b+20>>2]=c;b=o[e+32>>2];f=o[b+16>>2];e=o[b+12>>2];d=o[b+20>>2];c=d;if((e|0)<(c|0)?1:(e|0)<=(c|0)?r[b+8>>2]>f>>>0?0:1:0){break a}e=p[f+o[b>>2]|0];c=f+1|0;if(c>>>0<1){d=d+1|0}o[b+16>>2]=c;o[b+20>>2]=d;if(e>>>0>31){break a}o[a+24>>2]=e;j=1}return j|0}function qh(a){a=a|0;var b=0,c=0,d=0,e=0;o[a>>2]=8280;rh(a+232|0);e=o[a+216>>2];if(e){c=e;b=o[a+220>>2];d=c;a:{if((c|0)==(b|0)){break a}while(1){c=o[b+ -12>>2];if(c){o[b+ -8>>2]=c;jl(c)}c=o[b+ -28>>2];if(c){o[b+ -24>>2]=c;jl(c)}c=b+ -144|0;d=o[b+ -40>>2];if(d){o[b+ -36>>2]=d;jl(d)}Yg(b+ -140|0);b=c;if((e|0)!=(b|0)){continue}break}d=o[a+216>>2]}c=d;o[a+220>>2]=e;jl(c)}b=o[a+196>>2];if(b){o[a+200>>2]=b;jl(b)}b=o[a+184>>2];if(b){o[a+188>>2]=b;jl(b)}b=o[a+172>>2];if(b){o[a+176>>2]=b;jl(b)}b=o[a+160>>2];if(b){o[a+164>>2]=b;jl(b)}b=o[a+144>>2];if(b){while(1){c=o[b>>2];jl(b);b=c;if(b){continue}break}}b=o[a+136>>2];o[a+136>>2]=0;if(b){jl(b)}b=o[a+120>>2];if(b){jl(b)}b=o[a+108>>2];if(b){jl(b)}b=o[a+96>>2];if(b){jl(b)}b=o[a+72>>2];if(b){o[a+76>>2]=b;jl(b)}b=o[a+60>>2];if(b){jl(b)}b=o[a+48>>2];if(b){o[a+52>>2]=b;jl(b)}b=o[a+36>>2];if(b){o[a+40>>2]=b;jl(b)}b=o[a+24>>2];if(b){o[a+28>>2]=b;jl(b)}b=o[a+12>>2];if(b){o[a+16>>2]=b;jl(b)}b=o[a+8>>2];o[a+8>>2]=0;if(b){za(a+8|0,b)}return a|0}function He(a,b){var c=0,d=0,e=0,f=0,g=0,h=0;d=R-32|0;R=d;a:{c=o[a+4>>2];b:{if(c>>>0>>0){g=o[a+8>>2];e=g<<5;f=b-c|0;c:{if(!(e>>>0>>0|c>>>0>e-f>>>0)){o[a+4>>2]=b;b=c&31;a=o[a>>2]+(c>>>3&536870908)|0;break c}o[d+24>>2]=0;o[d+16>>2]=0;o[d+20>>2]=0;if((b|0)<=-1){break a}c=d+16|0;if(e>>>0<=1073741822){b=b+31&-32;e=g<<6;b=e>>>0>>0?b:e}else{b=2147483647}fb(c,b);c=o[a+4>>2];o[d+20>>2]=c+f;b=o[d+16>>2];d:{if((c|0)<1){c=0;break d}g=o[a>>2];e=c>>>5<<2;b=nl(b,g,e)+e|0;c=c&31;if(!c){c=0;break d}h=-1>>>32-c|0;o[b>>2]=o[b>>2]&(h^-1)|o[e+g>>2]&h}o[d+12>>2]=c;o[d+8>>2]=b;c=o[d+8>>2];b=o[d+12>>2];e=o[a>>2];o[a>>2]=o[d+16>>2];o[d+16>>2]=e;g=o[a+4>>2];o[a+4>>2]=o[d+20>>2];o[d+20>>2]=g;g=o[a+8>>2];o[a+8>>2]=o[d+24>>2];o[d+24>>2]=g;if(e){jl(e)}a=c}if(!f){break b}if(b){c=32-b|0;e=c>>>0>f>>>0?f:c;o[a>>2]=o[a>>2]&(-1<>>c-e^-1);f=f-e|0;a=a+4|0}b=a;a=f>>>5<<2;b=ml(b,0,a);c=f&31;if(!c){break b}a=a+b|0;o[a>>2]=o[a>>2]&(-1>>>32-c^-1);break b}o[a+4>>2]=b}R=d+32|0;return}Nk();D()}function Sf(a,b){var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,n=0;g=R-16|0;R=g;f=o[b+16>>2];d=o[b+12>>2];c=o[b+20>>2];a:{if((d|0)<(c|0)?1:(d|0)<=(c|0)?r[b+8>>2]>f>>>0?0:1:0){break a}m[a+12|0]=p[f+o[b>>2]|0];d=o[b+20>>2];c=o[b+16>>2]+1|0;if(c>>>0<1){d=d+1|0}o[b+16>>2]=c;o[b+20>>2]=d;if(!Tf(1,g+12|0,b)){break a}d=o[b+8>>2];h=o[b+16>>2];c=h;e=o[g+12>>2];f=e;i=d-c>>>0>=e>>>0?0:1;c=d>>>0>>0;d=o[b+20>>2];c=o[b+12>>2]-(c+d|0)|0;if(((c|0)<0?1:(c|0)<=0?i:0)|(e|0)<1){break a}c=h+o[b>>2]|0;o[a>>2]=c;j=e+ -1|0;k=j+c|0;l=p[k|0]>>>6|0;if((l|0)==3){break a}i=a;b:{c:{switch(l-1|0){default:o[a+4>>2]=j;a=p[k|0]&63;break b;case 0:if((e|0)<2){break a}o[a+4>>2]=e+ -2;a=(c+e|0)+ -2|0;a=p[a+1|0]<<8&16128|p[a|0];break b;case 1:break c}}if((e|0)<3){break a}o[a+4>>2]=e+ -3;a=(c+e|0)+ -3|0;a=p[a+1|0]<<8|p[a+2|0]<<16&4128768|p[a|0]}a=a+4096|0;o[i+8>>2]=a;if(a>>>0>1048575){break a}a=d;d=f+h|0;if(d>>>0>>0){a=a+1|0}o[b+16>>2]=d;o[b+20>>2]=a;n=1}R=g+16|0;return n}function Ch(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0,h=0;f=R-16|0;R=f;b=o[a+4>>2];c=o[b>>2];a:{d=o[a+12>>2];e=o[d+28>>2]-o[d+24>>2]|0;d=e>>2;b:{if(o[b+8>>2]-c>>2>>>0>=d>>>0){break b}if(d>>>0>=1073741824){break a}g=o[b+4>>2];h=d<<2;d=yk(e);h=h+d|0;e=g-c|0;g=e+d|0;if((e|0)>=1){ll(d,c,e)}o[b+8>>2]=h;o[b+4>>2]=g;o[b>>2]=d;if(!c){break b}jl(c)}b=o[a+12>>2];c=o[b+28>>2];b=o[b+24>>2];o[f+12>>2]=0;b=c-b>>2;d=a+96|0;e=o[d>>2];c=o[a+100>>2]-e>>2;c:{if(b>>>0>c>>>0){Dd(d,b-c|0,f+12|0);break c}if(b>>>0>=c>>>0){break c}o[a+100>>2]=e+(b<<2)}e=a+8|0;d:{e:{b=o[a+116>>2];if(b){d=o[b>>2];c=1;if((d|0)==o[b+4>>2]){break d}b=0;while(1){if(!Dh(e,o[(b<<2)+d>>2])){break e}c=o[a+116>>2];d=o[c>>2];b=b+1|0;if(b>>>0>2]-d>>2>>>0){continue}break}c=1;break d}b=0;a=o[a+12>>2];a=(o[a+4>>2]-o[a>>2]>>2>>>0)/3|0;c=1;if((a|0)<=0){break d}while(1){if(!Dh(e,u(b,3))){break e}b=b+1|0;if((a|0)!=(b|0)){continue}break}c=1;break d}c=0}R=f+16|0;return c|0}db(8832);D()}function Wi(a,b){var c=0,d=0,e=0,f=0,g=0,h=0;h=R-16|0;R=h;a:{b:{if(b){o[a+88>>2]=0;o[a+92>>2]=0;c=a+84|0;d=o[c>>2];o[c>>2]=0;if(d){jl(d)}o[a+76>>2]=0;o[a+80>>2]=0;c=a+72|0;d=o[c>>2];o[c>>2]=0;if(d){jl(d)}d=o[b>>2];c=o[b+4>>2];m[h+15|0]=0;eb(a,c-d>>2,h+15|0);c=b+28|0;d=o[c>>2];e=o[b+24>>2];m[h+14|0]=0;eb(a+12|0,d-e>>2,h+14|0);Ni(a+28|0,o[b+4>>2]-o[b>>2]>>2,10716);d=o[a+52>>2];e=o[c>>2]-o[b+24>>2]|0;c=e>>2;c:{if(o[a+60>>2]-d>>2>>>0>=c>>>0){break c}if(c>>>0>=1073741824){break b}f=o[a+56>>2];g=c<<2;c=yk(e);g=g+c|0;e=f-d|0;f=e+c|0;if((e|0)>=1){ll(c,d,e)}o[a+60>>2]=g;o[a+56>>2]=f;o[a+52>>2]=c;if(!d){break c}jl(d)}d=o[a+40>>2];e=o[b+28>>2]-o[b+24>>2]|0;c=e>>2;d:{if(o[a+48>>2]-d>>2>>>0>=c>>>0){break d}if(c>>>0>=1073741824){break a}f=o[a+44>>2];g=c<<2;c=yk(e);g=g+c|0;e=f-d|0;f=e+c|0;if((e|0)>=1){ll(c,d,e)}o[a+48>>2]=g;o[a+44>>2]=f;o[a+40>>2]=c;if(!d){break d}jl(d)}m[a+24|0]=1;o[a+64>>2]=b}R=h+16|0;return}db(10720);D()}db(10720);D()}function Bh(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,n=0;l=o[a+12>>2];d=o[a+108>>2];e=o[d+80>>2];m[b+84|0]=0;f=o[b+68>>2];c=o[b+72>>2]-f>>2;a:{if(e>>>0>c>>>0){pd(b+68|0,e-c|0,9140);d=o[a+108>>2];e=o[d+80>>2];break a}if(e>>>0>=c>>>0){break a}o[b+72>>2]=f+(e<<2)}k=o[d+96>>2];c=o[d+100>>2]-k|0;d=(c|0)/12|0;if(!c){return 1}n=d>>>0>1?d:1;d=0;b:{while(1){c:{if((d|0)==1431655765){break c}c=o[l>>2]+(u(d,3)<<2)|0;h=o[c>>2];if((h|0)==-1){break c}f=u(d,12)+k|0;g=o[f>>2];if(g>>>0>=e>>>0){break c}j=o[o[a+112>>2]+12>>2];i=o[j+(h<<2)>>2];if(i>>>0>=e>>>0){break c}h=o[b+68>>2];o[h+(g<<2)>>2]=i;g=o[c+4>>2];if((g|0)==-1){break c}i=o[f+4>>2];if(i>>>0>=e>>>0){break c}g=o[(g<<2)+j>>2];if(g>>>0>=e>>>0){break c}o[h+(i<<2)>>2]=g;c=o[c+8>>2];if((c|0)==-1){break c}f=o[f+8>>2];if(f>>>0>=e>>>0){break c}c=o[(c<<2)+j>>2];if(c>>>0>=e>>>0){break c}o[h+(f<<2)>>2]=c;c=1;d=d+1|0;if((n|0)!=(d|0)){continue}break b}break}c=0}return c|0}function Mh(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,n=0;l=o[a+12>>2];d=o[a+68>>2];e=o[d+80>>2];m[b+84|0]=0;f=o[b+68>>2];c=o[b+72>>2]-f>>2;a:{if(e>>>0>c>>>0){pd(b+68|0,e-c|0,9140);d=o[a+68>>2];e=o[d+80>>2];break a}if(e>>>0>=c>>>0){break a}o[b+72>>2]=f+(e<<2)}k=o[d+96>>2];c=o[d+100>>2]-k|0;d=(c|0)/12|0;if(!c){return 1}n=d>>>0>1?d:1;d=0;b:{while(1){c:{if((d|0)==1431655765){break c}c=o[l>>2]+(u(d,3)<<2)|0;h=o[c>>2];if((h|0)==-1){break c}f=u(d,12)+k|0;g=o[f>>2];if(g>>>0>=e>>>0){break c}j=o[o[a+72>>2]+12>>2];i=o[j+(h<<2)>>2];if(i>>>0>=e>>>0){break c}h=o[b+68>>2];o[h+(g<<2)>>2]=i;g=o[c+4>>2];if((g|0)==-1){break c}i=o[f+4>>2];if(i>>>0>=e>>>0){break c}g=o[(g<<2)+j>>2];if(g>>>0>=e>>>0){break c}o[h+(i<<2)>>2]=g;c=o[c+8>>2];if((c|0)==-1){break c}f=o[f+8>>2];if(f>>>0>=e>>>0){break c}c=o[(c<<2)+j>>2];if(c>>>0>=e>>>0){break c}o[h+(f<<2)>>2]=c;c=1;d=d+1|0;if((n|0)!=(d|0)){continue}break b}break}c=0}return c|0}function wj(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;i=a+8|0;d=o[a+12>>2];h=o[a+8>>2];e=d-h>>2;a:{if((e|0)>(b|0)){break a}f=b+1|0;if(f>>>0>e>>>0){xj(i,f-e|0);break a}if(f>>>0>=e>>>0){break a}e=h+(f<<2)|0;if((e|0)!=(d|0)){while(1){d=d+ -4|0;f=o[d>>2];o[d>>2]=0;if(f){Kb(f)}if((d|0)!=(e|0)){continue}break}}o[a+12>>2]=e}b:{c:{d=o[o[c>>2]+56>>2];d:{if((d|0)>4){break d}d=u(d,12)+a|0;f=d+24|0;a=o[f>>2];j=d+28|0;g=o[j>>2];if((a|0)!=(g|0)){o[a>>2]=b;o[f>>2]=a+4;break d}k=d+20|0;d=o[k>>2];h=a-d|0;a=h>>2;e=a+1|0;if(e>>>0>=1073741824){break c}l=a<<2;g=g-d|0;a=g>>1;e=g>>2>>>0<536870911?a>>>0>>0?e:a:1073741823;a=0;e:{if(!e){break e}if(e>>>0>=1073741824){break b}a=yk(e<<2)}g=l+a|0;o[g>>2]=b;e=a+(e<<2)|0;g=g+4|0;if((h|0)>=1){ll(a,d,h)}o[k>>2]=a;o[f>>2]=g;o[j>>2]=e;if(!d){break d}jl(d)}d=o[c>>2];o[d+60>>2]=b;a=o[i>>2];o[c>>2]=0;b=a+(b<<2)|0;a=o[b>>2];o[b>>2]=d;if(a){Kb(a)}return}Nk();D()}db(11048);D()}function Sh(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,n=0;h=o[a+12>>2];d=o[a+68>>2];e=o[d+80>>2];m[b+84|0]=0;g=o[b+68>>2];c=o[b+72>>2]-g>>2;a:{if(e>>>0>c>>>0){pd(b+68|0,e-c|0,9140);d=o[a+68>>2];e=o[d+80>>2];break a}if(e>>>0>=c>>>0){break a}o[b+72>>2]=g+(e<<2)}k=o[d+96>>2];c=o[d+100>>2]-k|0;d=(c|0)/12|0;if(!c){return 1}l=d>>>0>1?d:1;n=o[h+28>>2];d=0;b:{while(1){c:{c=(u(d,3)<<2)+n|0;g=o[c>>2];if((g|0)==-1){break c}h=u(d,12)+k|0;i=o[h>>2];if(i>>>0>=e>>>0){break c}f=g<<2;g=o[o[a+72>>2]+12>>2];f=o[f+g>>2];if(f>>>0>=e>>>0){break c}j=i<<2;i=o[b+68>>2];o[j+i>>2]=f;f=o[c+4>>2];if((f|0)==-1){break c}j=o[h+4>>2];if(j>>>0>=e>>>0){break c}f=o[g+(f<<2)>>2];if(f>>>0>=e>>>0){break c}o[i+(j<<2)>>2]=f;c=o[c+8>>2];if((c|0)==-1){break c}h=o[h+8>>2];if(h>>>0>=e>>>0){break c}c=o[g+(c<<2)>>2];if(c>>>0>=e>>>0){break c}o[i+(h<<2)>>2]=c;c=1;d=d+1|0;if((l|0)!=(d|0)){continue}break b}break}c=0}return c|0}function $e(a){var b=0,c=0,d=0;b=o[a+8>>2];d=o[a>>2];a:{if(p[a+12|0]){b:{c:{d:{e:{if((b|0)==-1){break e}c=b+1|0;b=(c>>>0)%3|0?c:b+ -2|0;if((b|0)==-1|o[o[d>>2]+(b>>>3&536870908)>>2]>>>(b&31)&1){break e}b=o[o[o[d+64>>2]+12>>2]+(b<<2)>>2];if((b|0)!=-1){break d}}o[a+8>>2]=-1;break c}c=b+1|0;b=(c>>>0)%3|0?c:b+ -2|0;o[a+8>>2]=b;if((b|0)!=-1){break b}}b=-1;c=o[a+4>>2];f:{if((c|0)==-1){break f}c=c+((c>>>0)%3|0?-1:2)|0;if((c|0)==-1|o[o[d>>2]+(c>>>3&536870908)>>2]>>>(c&31)&1){break f}d=o[o[o[d+64>>2]+12>>2]+(c<<2)>>2];if((d|0)==-1){break f}if((d>>>0)%3){b=d+ -1|0;break f}b=d+2|0}m[a+12|0]=0;o[a+8>>2]=b;return}if((b|0)!=o[a+4>>2]){break a}o[a+8>>2]=-1;return}c=-1;g:{if((b|0)==-1){break g}b=b+((b>>>0)%3|0?-1:2)|0;if((b|0)==-1|o[o[d>>2]+(b>>>3&536870908)>>2]>>>(b&31)&1){break g}b=o[o[o[d+64>>2]+12>>2]+(b<<2)>>2];if((b|0)==-1){break g}if((b>>>0)%3){c=b+ -1|0;break g}c=b+2|0}o[a+8>>2]=c}}function ue(a,b,c,d){var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;o[a+4>>2]=b;o[a>>2]=2732;b=c;e=o[b+8>>2];g=o[b+12>>2];h=o[b+16>>2];i=o[b+20>>2];j=o[b>>2];k=o[b+4>>2];o[a+40>>2]=0;f=a+32|0;o[f>>2]=0;o[f+4>>2]=0;o[a+24>>2]=h;o[a+28>>2]=i;o[a+16>>2]=e;o[a+20>>2]=g;o[a+8>>2]=j;o[a+12>>2]=k;a:{b=o[b+28>>2]-o[b+24>>2]|0;b:{if(!b){break b}e=b>>2;if(e>>>0>=1073741824){break a}b=yk(b);o[a+32>>2]=b;o[a+36>>2]=b;o[a+40>>2]=b+(e<<2);e=o[c+24>>2];c=o[c+28>>2]-e|0;if((c|0)<1){break b}l=a,m=ll(b,e,c)+c|0,o[l+36>>2]=m}o[a>>2]=2676;b=o[d+4>>2];o[a+44>>2]=o[d>>2];o[a+48>>2]=b;b=d+8|0;e=o[b+4>>2];o[a+52>>2]=o[b>>2];o[a+56>>2]=e;c=a- -64|0;o[c>>2]=0;o[c+4>>2]=0;o[a+60>>2]=3900;o[a>>2]=3272;c=o[d+4>>2];o[a+72>>2]=o[d>>2];o[a+76>>2]=c;c=o[b+4>>2];o[a+80>>2]=o[b>>2];o[a+84>>2]=c;o[a+92>>2]=-1;o[a+96>>2]=-1;o[a+88>>2]=1;o[a+60>>2]=3508;o[a+100>>2]=-1;o[a+104>>2]=-1;Rf(a+108|0);return}Nk();D()}function af(a,b,c,d){var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;o[a+4>>2]=b;o[a>>2]=2732;b=c;e=o[b+8>>2];g=o[b+12>>2];h=o[b+16>>2];i=o[b+20>>2];j=o[b>>2];k=o[b+4>>2];o[a+40>>2]=0;f=a+32|0;o[f>>2]=0;o[f+4>>2]=0;o[a+24>>2]=h;o[a+28>>2]=i;o[a+16>>2]=e;o[a+20>>2]=g;o[a+8>>2]=j;o[a+12>>2]=k;a:{b=o[b+28>>2]-o[b+24>>2]|0;b:{if(!b){break b}e=b>>2;if(e>>>0>=1073741824){break a}b=yk(b);o[a+32>>2]=b;o[a+36>>2]=b;o[a+40>>2]=b+(e<<2);e=o[c+24>>2];c=o[c+28>>2]-e|0;if((c|0)<1){break b}l=a,m=ll(b,e,c)+c|0,o[l+36>>2]=m}o[a>>2]=4296;b=o[d+4>>2];o[a+44>>2]=o[d>>2];o[a+48>>2]=b;b=d+8|0;e=o[b+4>>2];o[a+52>>2]=o[b>>2];o[a+56>>2]=e;c=a- -64|0;o[c>>2]=0;o[c+4>>2]=0;o[a+60>>2]=5396;o[a>>2]=4812;c=o[d+4>>2];o[a+72>>2]=o[d>>2];o[a+76>>2]=c;c=o[b+4>>2];o[a+80>>2]=o[b>>2];o[a+84>>2]=c;o[a+92>>2]=-1;o[a+96>>2]=-1;o[a+88>>2]=1;o[a+60>>2]=5032;o[a+100>>2]=-1;o[a+104>>2]=-1;Rf(a+108|0);return}Nk();D()}function Yf(a){var b=0,c=0,d=0,e=0;e=R-16|0;R=e;b=yk(32);o[e>>2]=b;o[e+4>>2]=26;o[e+8>>2]=-2147483616;m[b+26|0]=0;c=p[7897]|p[7898]<<8;m[b+24|0]=c;m[b+25|0]=c>>>8;d=p[7893]|p[7894]<<8|(p[7895]<<16|p[7896]<<24);c=p[7889]|p[7890]<<8|(p[7891]<<16|p[7892]<<24);m[b+16|0]=c;m[b+17|0]=c>>>8;m[b+18|0]=c>>>16;m[b+19|0]=c>>>24;m[b+20|0]=d;m[b+21|0]=d>>>8;m[b+22|0]=d>>>16;m[b+23|0]=d>>>24;d=p[7885]|p[7886]<<8|(p[7887]<<16|p[7888]<<24);c=p[7881]|p[7882]<<8|(p[7883]<<16|p[7884]<<24);m[b+8|0]=c;m[b+9|0]=c>>>8;m[b+10|0]=c>>>16;m[b+11|0]=c>>>24;m[b+12|0]=d;m[b+13|0]=d>>>8;m[b+14|0]=d>>>16;m[b+15|0]=d>>>24;d=p[7877]|p[7878]<<8|(p[7879]<<16|p[7880]<<24);c=p[7873]|p[7874]<<8|(p[7875]<<16|p[7876]<<24);m[b|0]=c;m[b+1|0]=c>>>8;m[b+2|0]=c>>>16;m[b+3|0]=c>>>24;m[b+4|0]=d;m[b+5|0]=d>>>8;m[b+6|0]=d>>>16;m[b+7|0]=d>>>24;o[a>>2]=-1;Bk(a+4|0,e);if(m[e+11|0]<=-1){jl(o[e>>2])}R=e+16|0}function xd(a,b){var c=0,d=0,e=0,f=0,g=0,h=0;if(!o[a+64>>2]){d=yk(32);c=oi(d);e=o[a+64>>2];o[a+64>>2]=d;d=a;if(e){c=o[e>>2];if(c){o[e+4>>2]=c;jl(c)}jl(e);c=o[a+64>>2]}td(d,c,0,0)}a:{b:{if(!sd(a,b)){break b}m[a+84|0]=p[b+84|0];o[a+80>>2]=o[b+80>>2];if((a|0)!=(b|0)){yd(a+68|0,o[b+68>>2],o[b+72>>2])}c=o[b+88>>2];if(c){b=yk(40);d=o[c>>2];o[b+16>>2]=0;o[b+8>>2]=0;o[b+12>>2]=0;o[b>>2]=d;d=o[c+12>>2]-o[c+8>>2]|0;c:{if(!d){break c}if((d|0)<=-1){break a}e=yk(d);o[b+8>>2]=e;o[b+12>>2]=e;o[b+16>>2]=d+e;f=o[c+8>>2];d=o[c+12>>2]-f|0;if((d|0)<1){break c}g=b,h=ll(e,f,d)+d|0,o[g+12>>2]=h}d=o[c+36>>2];o[b+32>>2]=o[c+32>>2];o[b+36>>2]=d;d=o[c+28>>2];o[b+24>>2]=o[c+24>>2];o[b+28>>2]=d;c=o[a+88>>2];o[a+88>>2]=b;if(!c){break b}a=o[c+8>>2];if(a){o[c+12>>2]=a;jl(a)}jl(c);return}b=o[a+88>>2];o[a+88>>2]=0;if(!b){break b}a=o[b+8>>2];if(a){o[b+12>>2]=a;jl(a)}jl(b)}return}Nk();D()}function hg(a,b){var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0;g=R-16|0;R=g;a:{if(!sg(1,g+8|0,b)){break a}c=o[b+8>>2];d=o[b+16>>2];h=c-d|0;e=o[g+12>>2];i=o[b+20>>2];f=o[b+12>>2]-(i+(c>>>0>>0)|0)|0;c=o[g+8>>2];if((e|0)==(f|0)&c>>>0>h>>>0|e>>>0>f>>>0){break a}e=e+i|0;f=c+d|0;if(f>>>0>>0){e=e+1|0}o[b+16>>2]=f;o[b+20>>2]=e;if((c|0)<1){break a}d=d+o[b>>2]|0;o[a+40>>2]=d;b=a;b:{c:{d:{e:{f:{f=c+ -1|0;h=d+f|0;switch((p[h|0]>>>6|0)-1|0){case 2:break c;case 1:break d;case 0:break e;default:break f}}o[a+44>>2]=f;a=p[h|0]&63;break b}if((c|0)<2){break a}o[a+44>>2]=c+ -2;a=(c+d|0)+ -2|0;a=p[a+1|0]<<8&16128|p[a|0];break b}if((c|0)<3){break a}o[a+44>>2]=c+ -3;a=(c+d|0)+ -3|0;a=p[a+1|0]<<8|p[a+2|0]<<16&4128768|p[a|0];break b}o[a+44>>2]=c+ -4;a=(c+d|0)+ -4|0;a=p[a+2|0]<<16|p[a+3|0]<<24&1056964608|p[a+1|0]<<8|p[a|0]}a=a+16384|0;o[b+48>>2]=a;j=a>>>0<4194304}R=g+16|0;return j}function Xh(a,b){var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;a:{b:{if(b){if(b>>>0>=1073741824){break a}c=yk(b<<2);d=o[a>>2];o[a>>2]=c;if(d){jl(d)}o[a+4>>2]=b;d=b>>>0>1?b:1;c=0;while(1){o[o[a>>2]+(c<<2)>>2]=0;c=c+1|0;if((d|0)!=(c|0)){continue}break}f=o[a+8>>2];if(!f){break b}d=a+8|0;g=o[f+4>>2];c=Rl(b);c:{if(c>>>0<=1){g=b+ -1&g;break c}if(g>>>0>>0){break c}g=(g>>>0)%(b>>>0)|0}o[o[a>>2]+(g<<2)>>2]=d;d=o[f>>2];if(!d){break b}j=b+ -1|0;k=c>>>0>1;while(1){e=o[d+4>>2];d:{if(!k){e=e&j;break d}if(e>>>0>>0){break d}e=(e>>>0)%(b>>>0)|0}e:{if((e|0)==(g|0)){f=d;break e}c=d;h=e<<2;i=h+o[a>>2]|0;if(!o[i>>2]){o[i>>2]=f;f=d;g=e;break e}while(1){e=c;c=o[c>>2];if(o[d+8>>2]==o[c+8>>2]?c:0){continue}break}o[f>>2]=c;o[e>>2]=o[o[o[a>>2]+h>>2]>>2];o[o[o[a>>2]+h>>2]>>2]=d}d=o[f>>2];if(d){continue}break}break b}b=o[a>>2];o[a>>2]=0;if(b){jl(b)}o[a+4>>2]=0}return}db(8832);D()}function ya(a,b,c){var d=0,e=0,f=0,g=0,h=0,i=0,j=0;e=R-16|0;R=e;a:{if(!Aa(a,b)){break a}d=1;f=o[b+100>>2];g=o[b+96>>2];if((f|0)==(g|0)){break a}while(1){if(!(o[o[a+56>>2]+(i>>>3&536870908)>>2]>>>(i&31)&1)){d=u(i,3);_i(a,0,d);f=o[a+8>>2];g=o[a+12>>2];_i(a,1,d+1|0);h=o[a+20>>2];j=o[a+24>>2];_i(a,2,d+2|0);h=j-h>>2;f=g-f|0;g=f>>2;d=h>>>0>g>>>0;g=o[a+36>>2]-o[a+32>>2]>>2>>>0>(d?h:g)>>>0?2:d?1:f?0:-1;b:{if(o[a+68>>2]<1){break b}o[e+12>>2]=o[a+76>>2];o[e+8>>2]=c;Ba(e+8|0,e+12|0);f=e;h=o[((g<<2)+a|0)+44>>2];d=-1;c:{if((h|0)<0){break c}d=(h>>>0)/3|0;d=o[(o[o[a>>2]+96>>2]+u(d,12)|0)+(h-u(d,3)<<2)>>2]}o[f+12>>2]=d;o[e+8>>2]=c;Ba(e+8|0,e+12|0);f=o[a+72>>2]+2|0;o[a+72>>2]=f;if(!(f&1)){break b}o[e+12>>2]=d;o[e+8>>2]=c;Ba(e+8|0,e+12|0);o[a+72>>2]=o[a+72>>2]+1}Ca(a,g,c);g=o[b+96>>2];f=o[b+100>>2]}d=1;i=i+1|0;if(i>>>0<(f-g|0)/12>>>0){continue}break}}R=e+16|0;return d}function ih(a){o[a>>2]=8280;ml(a+4|0,0,80);o[a+96>>2]=0;o[a+100>>2]=0;o[a+92>>2]=-1;o[a+84>>2]=-1;o[a+88>>2]=-1;o[a+104>>2]=0;o[a+108>>2]=0;o[a+112>>2]=0;o[a+116>>2]=0;o[a+120>>2]=0;o[a+124>>2]=0;o[a+128>>2]=0;o[a+132>>2]=0;o[a+136>>2]=0;o[a+140>>2]=0;o[a+144>>2]=0;o[a+148>>2]=0;o[a+156>>2]=0;o[a+160>>2]=0;o[a+152>>2]=1065353216;o[a+164>>2]=0;o[a+168>>2]=0;o[a+172>>2]=0;o[a+176>>2]=0;o[a+180>>2]=0;o[a+184>>2]=0;o[a+188>>2]=0;o[a+192>>2]=0;o[a+196>>2]=0;o[a+200>>2]=0;o[a+204>>2]=0;o[a+208>>2]=0;o[a+212>>2]=-1;o[a+216>>2]=0;o[a+220>>2]=0;o[a+224>>2]=0;si(a+232|0);si(a+272|0);Rf(a+312|0);si(a+328|0);o[a+392>>2]=0;o[a+396>>2]=0;o[a+384>>2]=0;o[a+388>>2]=0;o[a+376>>2]=0;o[a+380>>2]=0;o[a+368>>2]=0;o[a+372>>2]=0;o[a+416>>2]=0;o[a+420>>2]=0;o[a+408>>2]=2;o[a+412>>2]=7;o[a+400>>2]=-1;o[a+404>>2]=-1;o[a+424>>2]=0;o[a+428>>2]=0;o[a+432>>2]=0;o[a+436>>2]=0}function Yi(a,b){var c=0,d=0,e=0,f=0,g=0,h=0;e=o[a>>2];c=e+(b>>>3&536870908)|0;o[c>>2]=o[c>>2]|1<<(b&31);g=o[a+64>>2];f=(b|0)==-1;c=-1;a:{if(f){break a}d=b+1|0;d=(d>>>0)%3|0?d:b+ -2|0;c=-1;if((d|0)==-1){break a}c=o[o[g>>2]+(d<<2)>>2]}d=o[a+12>>2];h=(c>>>3&536870908)+d|0;o[h>>2]=o[h>>2]|1<<(c&31);b:{c:{if(!f){c=-1;f=((b>>>0)%3|0?-1:2)+b|0;if((f|0)!=-1){c=o[o[g>>2]+(f<<2)>>2]}f=d+(c>>>3&536870908)|0;o[f>>2]=o[f>>2]|1<<(c&31);b=o[o[g+12>>2]+(b<<2)>>2];if((b|0)==-1){break b}m[a+24|0]=0;a=(b>>>3&536870908)+e|0;o[a>>2]=o[a>>2]|1<<(b&31);a=-1;c=-1;e=b+1|0;e=(e>>>0)%3|0?e:b+ -2|0;if((e|0)!=-1){c=o[o[g>>2]+(e<<2)>>2]}e=d+(c>>>3&536870908)|0;o[e>>2]=o[e>>2]|1<<(c&31);b=b+((b>>>0)%3|0?-1:2)|0;if((b|0)!=-1){a=o[o[g>>2]+(b<<2)>>2]}b=1<<(a&31);a=d+(a>>>3&536870908)|0;c=o[a>>2];break c}a=d+536870908|0;b=o[d+536870908>>2];c=-2147483648}o[a>>2]=b|c}}function jg(a,b,c){var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;d=R+ -64|0;R=d;o[d+56>>2]=0;o[d+48>>2]=0;o[d+52>>2]=0;o[d+40>>2]=0;o[d+44>>2]=0;o[d+32>>2]=0;o[d+36>>2]=0;o[d+24>>2]=0;o[d+28>>2]=0;o[d+16>>2]=0;o[d+20>>2]=0;o[d+8>>2]=0;o[d+12>>2]=0;a:{if(!gg(d+8|0,b)){break a}if(a){if(!o[d+20>>2]){break a}if(!hg(d+8|0,b)){break a}b=o[d+56>>2];i=o[d+36>>2];j=o[d+48>>2];k=o[d+24>>2];while(1){b:{if(b>>>0>16383){break b}e=o[d+52>>2];while(1){if((e|0)<1){break b}e=e+ -1|0;o[d+52>>2]=e;b=p[e+j|0]|b<<8;o[d+56>>2]=b;if(b>>>0<16384){continue}break}}e=b&4095;g=o[(e<<2)+k>>2];h=(g<<3)+i|0;b=(u(o[h>>2],b>>>12|0)+e|0)-o[h+4>>2]|0;o[d+56>>2]=b;o[(f<<2)+c>>2]=g;e=1;f=f+1|0;if((f|0)!=(a|0)){continue}break}break a}e=hg(d+8|0,b)}a=o[d+36>>2];if(a){o[d+40>>2]=a;jl(a)}a=o[d+24>>2];if(a){o[d+28>>2]=a;jl(a)}a=o[d+8>>2];if(a){o[d+12>>2]=a;jl(a)}R=d- -64|0;return e}function Zf(a,b){var c=0,d=0,e=0;e=R-16|0;R=e;o[e+12>>2]=b;b=yk(32);o[e>>2]=b;o[e+4>>2]=24;o[e+8>>2]=-2147483616;m[b+24|0]=0;c=p[7941]|p[7942]<<8|(p[7943]<<16|p[7944]<<24);d=p[7937]|p[7938]<<8|(p[7939]<<16|p[7940]<<24);m[b+16|0]=d;m[b+17|0]=d>>>8;m[b+18|0]=d>>>16;m[b+19|0]=d>>>24;m[b+20|0]=c;m[b+21|0]=c>>>8;m[b+22|0]=c>>>16;m[b+23|0]=c>>>24;c=p[7933]|p[7934]<<8|(p[7935]<<16|p[7936]<<24);d=p[7929]|p[7930]<<8|(p[7931]<<16|p[7932]<<24);m[b+8|0]=d;m[b+9|0]=d>>>8;m[b+10|0]=d>>>16;m[b+11|0]=d>>>24;m[b+12|0]=c;m[b+13|0]=c>>>8;m[b+14|0]=c>>>16;m[b+15|0]=c>>>24;c=p[7925]|p[7926]<<8|(p[7927]<<16|p[7928]<<24);d=p[7921]|p[7922]<<8|(p[7923]<<16|p[7924]<<24);m[b|0]=d;m[b+1|0]=d>>>8;m[b+2|0]=d>>>16;m[b+3|0]=d>>>24;m[b+4|0]=c;m[b+5|0]=c>>>8;m[b+6|0]=c>>>16;m[b+7|0]=c>>>24;zi(_f(a,e+12|0),e);if(m[e+11|0]<=-1){jl(o[e>>2])}R=e+16|0}function mh(a,b){var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;e=o[a+8>>2];c=o[a+4>>2];if((e-c|0)/12>>>0>=b>>>0){d=a;a=u(b,12);j=d,k=ml(c,0,a)+a|0,o[j+4>>2]=k;return}f=o[a>>2];g=(c-f|0)/12|0;d=g+b|0;a:{if(d>>>0<357913942){g=u(g,12);e=(e-f|0)/12|0;h=e<<1;e=e>>>0<178956970?h>>>0>>0?d:h:357913941;if(e){if(e>>>0>=357913942){break a}i=yk(u(e,12))}d=g+i|0;b=u(b,12);b=ml(d,0,b)+b|0;e=u(e,12)+i|0;if((c|0)!=(f|0)){while(1){d=d+ -12|0;o[d+8>>2]=0;o[d>>2]=0;o[d+4>>2]=0;c=c+ -12|0;o[d>>2]=o[c>>2];o[d+4>>2]=o[c+4>>2];o[d+8>>2]=o[c+8>>2];o[c+8>>2]=0;o[c>>2]=0;o[c+4>>2]=0;if((c|0)!=(f|0)){continue}break}f=o[a>>2];c=o[a+4>>2]}o[a+8>>2]=e;o[a+4>>2]=b;o[a>>2]=d;if((c|0)!=(f|0)){while(1){a=c+ -12|0;b=o[a>>2];if(b){o[c+ -8>>2]=b;jl(b)}c=a;if((c|0)!=(f|0)){continue}break}}if(f){jl(f)}return}Nk();D()}db(8832);D()}function gb(a,b,c){var d=0,e=0,f=0,g=0,h=0,i=0;f=R-32|0;R=f;h=o[c+4>>2];d=o[b+4>>2];i=o[c>>2];g=o[b>>2];b=(h-d|0)+(i-g<<3)|0;c=o[a+4>>2];e=b+c|0;o[a+4>>2]=e;a:{if(!(!c|(e+ -1^c+ -1)>>>0>31)){a=o[a>>2];break a}a=o[a>>2];if(e>>>0<=32){o[a>>2]=0;break a}o[(e+ -1>>>3&536870908)+a>>2]=0}a=(c>>>3&536870908)+a|0;c=c&31;b:{if((c|0)==(d|0)){c:{if((b|0)<1){break c}d:{if(!d){c=0;break d}e=32-d|0;c=(b|0)<(e|0)?b:e;e=-1<>>e-c;o[a>>2]=o[a>>2]&(e^-1)|e&o[g>>2];b=b-c|0;d=c+d|0;c=d&31;a=(d>>>3&536870908)+a|0;g=g+4|0}d=(b|0)/32|0;e=d<<2;a=nl(a,g,e)+e|0;d=b-(d<<5)|0;if((d|0)<1){d=c;break c}b=-1>>>32-d|0;o[a>>2]=o[a>>2]&(b^-1)|b&o[e+g>>2]}o[f+4>>2]=d;o[f>>2]=a;break b}o[f+28>>2]=d;o[f+24>>2]=g;o[f+20>>2]=h;o[f+16>>2]=i;o[f+12>>2]=c;o[f+8>>2]=a;hb(f,f+24|0,f+16|0,f+8|0)}R=f+32|0}function nl(a,b,c){var d=0,e=0;a:{if((a|0)==(b|0)){break a}b:{if(b+c>>>0>a>>>0){e=a+c|0;if(e>>>0>b>>>0){break b}}return ll(a,b,c)}d=(a^b)&3;c:{d:{if(a>>>0>>0){if(d){d=a;break c}if(!(a&3)){d=a;break d}d=a;while(1){if(!c){break a}m[d|0]=p[b|0];b=b+1|0;c=c+ -1|0;d=d+1|0;if(d&3){continue}break}break d}e:{if(d){break e}if(e&3){while(1){if(!c){break a}c=c+ -1|0;d=c+a|0;m[d|0]=p[b+c|0];if(d&3){continue}break}}if(c>>>0<=3){break e}while(1){c=c+ -4|0;o[c+a>>2]=o[b+c>>2];if(c>>>0>3){continue}break}}if(!c){break a}while(1){c=c+ -1|0;m[c+a|0]=p[b+c|0];if(c){continue}break}break a}if(c>>>0<=3){break c}while(1){o[d>>2]=o[b>>2];b=b+4|0;d=d+4|0;c=c+ -4|0;if(c>>>0>3){continue}break}}if(!c){break a}while(1){m[d|0]=p[b|0];d=d+1|0;b=b+1|0;c=c+ -1|0;if(c){continue}break}}return a}function ej(a,b,c){var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;d=R-16|0;R=d;g=o[a+24>>2];l=o[a+28>>2];a:{if((g|0)!=(l|0)){n=d+8|0;while(1){o[n>>2]=0;o[d>>2]=0;o[d+4>>2]=0;a=mj(o[g>>2],b,d);h=p[d+11|0];k=h<<24>>24;b:{c:{d:{if(!a){a=3;break d}a=0;e=p[c+11|0];f=e<<24>>24;j=(k|0)<0?o[d+4>>2]:h;if((j|0)!=(((f|0)<0?o[c+4>>2]:e)|0)){break d}i=(f|0)<0?o[c>>2]:c;f=o[d>>2];e=(k|0)<0;e:{if(!e){if(!j){break e}e=d;if(p[i|0]!=(f&255)){break d}while(1){h=h+ -1|0;if(!h){break e}f=p[i+1|0];i=i+1|0;e=e+1|0;if((f|0)==p[e|0]){continue}break}break d}if(!j){break e}if(Vj(e?f:d,i,j)){break c}}m=o[g>>2];a=1}if((k|0)>-1){break b}}jl(o[d>>2])}if(a>>>0>3){break a}f:{switch(a-1|0){case 0:case 1:break a;default:break f}}g=g+4|0;if((l|0)!=(g|0)){continue}break}}m=0}R=d+16|0;return m}function id(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0;o[b>>2]=1;f=b+8|0;c=o[b+8>>2];d=o[b+12>>2]-c|0;if(d>>>0<=4294967291){ri(f,d+4|0);c=o[f>>2]}d=c+d|0;c=p[a+4|0]|p[a+5|0]<<8|(p[a+6|0]<<16|p[a+7|0]<<24);m[d|0]=c;m[d+1|0]=c>>>8;m[d+2|0]=c>>>16;m[d+3|0]=c>>>24;c=o[a+8>>2];if((c|0)!=o[a+12>>2]){while(1){d=(g<<2)+c|0;c=o[b+8>>2];e=o[b+12>>2]-c|0;if(e>>>0<=4294967291){ri(f,e+4|0);c=o[f>>2]}e=c+e|0;c=p[d|0]|p[d+1|0]<<8|(p[d+2|0]<<16|p[d+3|0]<<24);m[e|0]=c;m[e+1|0]=c>>>8;m[e+2|0]=c>>>16;m[e+3|0]=c>>>24;g=g+1|0;c=o[a+8>>2];if(g>>>0>2]-c>>2>>>0){continue}break}}c=o[b+12>>2];b=o[b+8>>2];c=c-b|0;if(c>>>0<=4294967291){ri(f,c+4|0);b=o[f>>2]}b=b+c|0;a=p[a+20|0]|p[a+21|0]<<8|(p[a+22|0]<<16|p[a+23|0]<<24);m[b|0]=a;m[b+1|0]=a>>>8;m[b+2|0]=a>>>16;m[b+3|0]=a>>>24}function Xe(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;d=o[b+12>>2];g=d;c=o[b+20>>2];f=c;h=o[b+16>>2];e=h+4|0;if(e>>>0<4){c=c+1|0}j=o[b+8>>2];i=e;e=c;a:{if((d|0)<(c|0)?1:(d|0)<=(c|0)?j>>>0>=i>>>0?0:1:0){break a}k=o[b>>2];c=k+h|0;d=p[c|0]|p[c+1|0]<<8|(p[c+2|0]<<16|p[c+3|0]<<24);o[b+16>>2]=i;o[b+20>>2]=e;c=f;f=h+8|0;if(f>>>0<8){c=c+1|0}e=f;f=c;if((g|0)<(c|0)?1:(g|0)<=(c|0)?j>>>0>=e>>>0?0:1:0){break a}c=i+k|0;c=p[c|0]|p[c+1|0]<<8|(p[c+2|0]<<16|p[c+3|0]<<24);o[b+16>>2]=e;o[b+20>>2]=f;if((d|0)>(c|0)){break a}o[a+16>>2]=c;o[a+12>>2]=d;g=d;d=(c>>31)-((d>>31)+(c>>>0>>0)|0)|0;c=c-g|0;if(!d&c>>>0>2147483646|d>>>0>0){break a}c=c+1|0;o[a+20>>2]=c;d=(c|0)/2|0;o[a+24>>2]=d;o[a+28>>2]=0-d;if(!(c&1)){o[a+24>>2]=d+ -1}l=Sf(a+108|0,b)}return l|0}function Ae(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;d=o[b+12>>2];i=d;c=o[b+20>>2];f=c;g=o[b+16>>2];e=g+4|0;if(e>>>0<4){c=c+1|0}j=o[b+8>>2];h=e;e=c;a:{if((d|0)<(c|0)?1:(d|0)<=(c|0)?j>>>0>=h>>>0?0:1:0){break a}k=o[b>>2];c=k+g|0;d=p[c|0]|p[c+1|0]<<8|(p[c+2|0]<<16|p[c+3|0]<<24);o[b+16>>2]=h;o[b+20>>2]=e;c=f;f=g+8|0;if(f>>>0<8){c=c+1|0}e=f;f=c;if((i|0)<(c|0)?1:(i|0)<=(c|0)?j>>>0>=e>>>0?0:1:0){break a}c=h+k|0;c=p[c|0]|p[c+1|0]<<8|(p[c+2|0]<<16|p[c+3|0]<<24);o[b+16>>2]=e;o[b+20>>2]=f;if((d|0)>(c|0)){break a}o[a+16>>2]=c;o[a+12>>2]=d;b=d;d=(c>>31)-((c>>>0>>0)+(b>>31)|0)|0;b=c-b|0;if(!d&b>>>0>2147483646|d>>>0>0){break a}l=1;b=b+1|0;o[a+20>>2]=b;c=(b|0)/2|0;o[a+24>>2]=c;o[a+28>>2]=0-c;if(b&1){break a}o[a+24>>2]=c+ -1}return l|0}function of(a){var b=0,c=0,d=0;b=o[a+8>>2];d=o[a>>2];a:{if(p[a+12|0]){b:{c:{d:{e:{if((b|0)==-1){break e}c=b+1|0;b=(c>>>0)%3|0?c:b+ -2|0;if((b|0)==-1){break e}b=o[o[d+12>>2]+(b<<2)>>2];if((b|0)!=-1){break d}}o[a+8>>2]=-1;break c}c=b+1|0;b=(c>>>0)%3|0?c:b+ -2|0;o[a+8>>2]=b;if((b|0)!=-1){break b}}c=o[a+4>>2];b=-1;f:{if((c|0)==-1){break f}c=c+((c>>>0)%3|0?-1:2)|0;b=-1;if((c|0)==-1){break f}c=o[o[d+12>>2]+(c<<2)>>2];b=-1;if((c|0)==-1){break f}b=c+ -1|0;if((c>>>0)%3){break f}b=c+2|0}m[a+12|0]=0;o[a+8>>2]=b;return}if((b|0)!=o[a+4>>2]){break a}o[a+8>>2]=-1;return}c=-1;g:{if((b|0)==-1){break g}b=b+((b>>>0)%3|0?-1:2)|0;c=-1;if((b|0)==-1){break g}b=o[o[d+12>>2]+(b<<2)>>2];c=-1;if((b|0)==-1){break g}c=b+ -1|0;if((b>>>0)%3){break g}c=b+2|0}o[a+8>>2]=c}}function gh(a,b,c){var d=0,e=0,f=0,g=0,h=0,i=0;a:{b:{f=o[a+8>>2];d=o[a+4>>2];c:{if((f-d|0)/12>>>0>=b>>>0){while(1){e=o[c+4>>2];o[d>>2]=o[c>>2];o[d+4>>2]=e;o[d+8>>2]=o[c+8>>2];d=o[a+4>>2]+12|0;o[a+4>>2]=d;b=b+ -1|0;if(b){continue}break c}}e=d;d=o[a>>2];g=(e-d|0)/12|0;h=g+b|0;if(h>>>0>=357913942){break b}d=(f-d|0)/12|0;f=d<<1;d=d>>>0<178956970?f>>>0>>0?h:f:357913941;e=0;d:{if(!d){break d}if(d>>>0>=357913942){break a}e=yk(u(d,12))}f=e+u(d,12)|0;g=e+u(g,12)|0;d=g;while(1){i=o[c+4>>2];o[d>>2]=o[c>>2];o[d+4>>2]=i;o[d+8>>2]=o[c+8>>2];d=d+12|0;b=b+ -1|0;if(b){continue}break}d=e+u(h,12)|0;b=o[a>>2];c=o[a+4>>2]-b|0;e=g+u((c|0)/-12|0,12)|0;if((c|0)>=1){ll(e,b,c)}o[a+8>>2]=f;o[a+4>>2]=d;o[a>>2]=e;if(!b){break c}jl(b)}return}Nk();D()}db(8832);D()}function Ya(a,b,c,d){var e=0,f=0,g=0,h=0,i=0,j=0,k=0;f=R-16|0;R=f;a:{g=m[b+24|0];i=o[a+80>>2];b:{if((u(g,i)|0)!=(c|0)){break b}if(!(!p[b+84|0]|o[b+28>>2]!=1)){ll(d,o[o[b>>2]>>2]+o[b+48>>2]|0,c);e=1;break b}o[f+8>>2]=0;o[f>>2]=0;o[f+4>>2]=0;if(g){if((g|0)<=-1){break a}e=yk(g);o[f>>2]=e;o[f+4>>2]=e;o[f+8>>2]=e+g;c=g;while(1){m[e|0]=0;e=o[f+4>>2]+1|0;o[f+4>>2]=e;c=c+ -1|0;if(c){continue}break}}c:{if(!i){e=1;a=o[f>>2];break c}a=o[f>>2];k=(g|0)<1;while(1){c=h;e=b;if(!p[e+84|0]){c=o[o[b+68>>2]+(h<<2)>>2]}if(!La(e,c,m[b+24|0],a)){e=0;break c}e=0;c=j;if(!k){while(1){m[c+d|0]=p[a+e|0];c=c+1|0;e=e+1|0;if((g|0)!=(e|0)){continue}break}j=g+j|0}e=1;h=h+1|0;if((i|0)!=(h|0)){continue}break}}if(!a){break b}o[f+4>>2]=a;jl(a)}R=f+16|0;return e}Nk();D()}function $a(a,b,c,d){var e=0,f=0,g=0,h=0,i=0,j=0,k=0;f=R-16|0;R=f;a:{g=m[b+24|0];i=o[a+80>>2];b:{if((u(g,i)|0)!=(c|0)){break b}if(!(!p[b+84|0]|o[b+28>>2]!=2)){ll(d,o[o[b>>2]>>2]+o[b+48>>2]|0,c);e=1;break b}o[f+8>>2]=0;o[f>>2]=0;o[f+4>>2]=0;if(g){if((g|0)<=-1){break a}e=yk(g);o[f>>2]=e;o[f+4>>2]=e;o[f+8>>2]=e+g;c=g;while(1){m[e|0]=0;e=o[f+4>>2]+1|0;o[f+4>>2]=e;c=c+ -1|0;if(c){continue}break}}c:{if(!i){e=1;a=o[f>>2];break c}a=o[f>>2];k=(g|0)<1;while(1){c=h;e=b;if(!p[e+84|0]){c=o[o[b+68>>2]+(h<<2)>>2]}if(!Na(e,c,m[b+24|0],a)){e=0;break c}e=0;c=j;if(!k){while(1){m[c+d|0]=p[a+e|0];c=c+1|0;e=e+1|0;if((g|0)!=(e|0)){continue}break}j=g+j|0}e=1;h=h+1|0;if((i|0)!=(h|0)){continue}break}}if(!a){break b}o[f+4>>2]=a;jl(a)}R=f+16|0;return e}Nk();D()}function he(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,n=0,p=0;f=R-16|0;R=f;j=o[c+8>>2];g=o[c+16>>2];h=o[c+12>>2];d=h;e=o[c+20>>2];a:{if((d|0)<(e|0)?1:(d|0)<=(e|0)?j>>>0>g>>>0?0:1:0){break a}k=o[c>>2];n=m[k+g|0];d=e;i=g+1|0;if(i>>>0<1){d=d+1|0}o[c+16>>2]=i;o[c+20>>2]=d;b:{if((n|0)==-2){break b}if((h|0)<(d|0)?1:(h|0)<=(d|0)?j>>>0>i>>>0?0:1:0){break a}h=m[i+k|0];g=g+2|0;if(g>>>0<2){e=e+1|0}d=c;o[d+16>>2]=g;o[d+20>>2]=e;l[o[o[a>>2]+40>>2]](f+8|0,a,n,h);e=o[f+8>>2];o[f+8>>2]=0;d=o[a+20>>2];o[a+20>>2]=e;if(!d){o[f+8>>2]=0;break b}l[o[o[d>>2]+4>>2]](d);d=o[f+8>>2];o[f+8>>2]=0;if(!d){break b}l[o[o[d>>2]+4>>2]](d)}d=o[a+20>>2];if(d){if(!l[o[o[a>>2]+28>>2]](a,d)){break a}}p=l[o[o[a>>2]+36>>2]](a,b,c)|0}R=f+16|0;return p|0}function oa(a,b,c){var d=0,e=0,f=0;a:{if(o[a+12>>2]==(b|0)){break a}d=o[a>>2];e=o[a+4>>2];if((d|0)!=(e|0)){while(1){f=e+ -12|0;if(m[e+ -1|0]<=-1){jl(o[f>>2])}e=f;if((e|0)!=(d|0)){continue}break}}o[a+12>>2]=b;o[a+4>>2]=d;e=o[b>>2];f=b+4|0;if((e|0)==(f|0)){break a}while(1){b=e+16|0;b:{if(o[a+8>>2]!=(d|0)){Bk(d,b);o[a+4>>2]=o[a+4>>2]+12;break b}pa(a,b)}d=o[e+4>>2];c:{if(!d){b=o[e+8>>2];if(o[b>>2]==(e|0)){break c}e=e+8|0;while(1){d=o[e>>2];e=d+8|0;b=o[d+8>>2];if((d|0)!=o[b>>2]){continue}break}break c}while(1){b=d;d=o[d>>2];if(d){continue}break}}if((b|0)==(f|0)){break a}d=o[a+4>>2];e=b;continue}}d=0;d:{if((c|0)<0){break d}b=o[a+4>>2];a=o[a>>2];if((b-a|0)/12>>>0<=c>>>0){break d}d=a+u(c,12)|0;if(m[d+11|0]>-1){break d}d=o[d>>2]}return d}function ml(a,b,c){var d=0,e=0,f=0,g=0;a:{if(!c){break a}d=a+c|0;m[d+ -1|0]=b;m[a|0]=b;if(c>>>0<3){break a}m[d+ -2|0]=b;m[a+1|0]=b;m[d+ -3|0]=b;m[a+2|0]=b;if(c>>>0<7){break a}m[d+ -4|0]=b;m[a+3|0]=b;if(c>>>0<9){break a}d=0-a&3;e=d+a|0;b=u(b&255,16843009);o[e>>2]=b;c=c-d&-4;d=c+e|0;o[d+ -4>>2]=b;if(c>>>0<9){break a}o[e+8>>2]=b;o[e+4>>2]=b;o[d+ -8>>2]=b;o[d+ -12>>2]=b;if(c>>>0<25){break a}o[e+24>>2]=b;o[e+20>>2]=b;o[e+16>>2]=b;o[e+12>>2]=b;o[d+ -16>>2]=b;o[d+ -20>>2]=b;o[d+ -24>>2]=b;o[d+ -28>>2]=b;g=e&4|24;c=c-g|0;if(c>>>0<32){break a}d=b;f=b;b=e+g|0;while(1){o[b+24>>2]=f;o[b+28>>2]=d;o[b+16>>2]=f;o[b+20>>2]=d;o[b+8>>2]=f;o[b+12>>2]=d;o[b>>2]=f;o[b+4>>2]=d;b=b+32|0;c=c+ -32|0;if(c>>>0>31){continue}break}}return a}function Th(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0;b=o[a+4>>2];e=o[b>>2];a:{c=o[a+12>>2];d=o[c+56>>2]-o[c+52>>2]|0;c=d>>2;b:{if(o[b+8>>2]-e>>2>>>0>=c>>>0){break b}if(c>>>0>=1073741824){break a}f=o[b+4>>2];g=c<<2;c=yk(d);g=g+c|0;d=f-e|0;f=d+c|0;if((d|0)>=1){ll(c,e,d)}o[b+8>>2]=g;o[b+4>>2]=f;o[b>>2]=c;if(!e){break b}jl(e)}c=a+8|0;c:{d:{b=o[a+76>>2];if(b){e=o[b>>2];d=1;if((e|0)==o[b+4>>2]){break c}b=0;while(1){if(!Uh(c,o[(b<<2)+e>>2])){break d}d=o[a+76>>2];e=o[d>>2];b=b+1|0;if(b>>>0>2]-e>>2>>>0){continue}break}return 1}b=0;a=o[o[a+12>>2]+64>>2];a=(o[a+4>>2]-o[a>>2]>>2>>>0)/3|0;if((a|0)<=0){return 1}while(1){if(!Uh(c,u(b,3))){break d}b=b+1|0;if((a|0)!=(b|0)){continue}break}return 1}d=0}return d|0}db(8832);D()}function $i(a,b){var c=0,d=0,e=0,f=0,g=0;d=-1;f=-1;e=-1;a:{b:{if((b|0)==-1){break b}g=1;f=o[o[o[a+4>>2]+12>>2]+(b<<2)>>2];c=b+1|0;c=(c>>>0)%3|0?c:b+ -2|0;if((c|0)>=0){e=(c>>>0)/3|0;e=o[(o[o[a>>2]+96>>2]+u(e,12)|0)+(c-u(e,3)<<2)>>2]}c:{if((f|0)==-1){break c}g=0;c=((f>>>0)%3|0?-1:2)+f|0;if((c|0)<0){break c}d=(c>>>0)/3|0;d=o[(o[o[a>>2]+96>>2]+u(d,12)|0)+(c-u(d,3)<<2)>>2]}c=-1;if((d|0)!=(e|0)){break a}e=-1;d:{b=((b>>>0)%3|0?-1:2)+b|0;if((b|0)>=0){d=(b>>>0)/3|0;d=o[(o[o[a>>2]+96>>2]+u(d,12)|0)+(b-u(d,3)<<2)>>2];if(g){break b}break d}d=-1;if(!g){break d}break b}b=f+1|0;b=(b>>>0)%3|0?b:f+ -2|0;if((b|0)<0){break b}e=o[o[a>>2]+96>>2];a=(b>>>0)/3|0;e=o[(e+u(a,12)|0)+(b-u(a,3)<<2)>>2]}c=(d|0)==(e|0)?f:-1}return c}function Nh(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0;b=o[a+4>>2];e=o[b>>2];a:{c=o[a+12>>2];d=o[c+28>>2]-o[c+24>>2]|0;c=d>>2;b:{if(o[b+8>>2]-e>>2>>>0>=c>>>0){break b}if(c>>>0>=1073741824){break a}f=o[b+4>>2];g=c<<2;c=yk(d);g=g+c|0;d=f-e|0;f=d+c|0;if((d|0)>=1){ll(c,e,d)}o[b+8>>2]=g;o[b+4>>2]=f;o[b>>2]=c;if(!e){break b}jl(e)}c=a+8|0;c:{d:{b=o[a+76>>2];if(b){e=o[b>>2];d=1;if((e|0)==o[b+4>>2]){break c}b=0;while(1){if(!Oh(c,o[(b<<2)+e>>2])){break d}d=o[a+76>>2];e=o[d>>2];b=b+1|0;if(b>>>0>2]-e>>2>>>0){continue}break}return 1}b=0;a=o[a+12>>2];a=(o[a+4>>2]-o[a>>2]>>2>>>0)/3|0;if((a|0)<=0){return 1}while(1){if(!Oh(c,u(b,3))){break d}b=b+1|0;if((a|0)!=(b|0)){continue}break}return 1}d=0}return d|0}db(8832);D()}function pa(a,b){var c=0,d=0,e=0,f=0,g=0;e=o[a>>2];g=(o[a+4>>2]-e|0)/12|0;c=g+1|0;a:{b:{c:{if(c>>>0<357913942){e=(o[a+8>>2]-e|0)/12|0;f=e<<1;c=e>>>0<178956970?f>>>0>>0?c:f:357913941;d=0;d:{if(!c){break d}if(c>>>0>=357913942){break c}d=yk(u(c,12))}e=d+u(c,12)|0;b=Bk(d+u(g,12)|0,b);g=b+12|0;c=o[a+4>>2];d=o[a>>2];if((c|0)==(d|0)){break b}while(1){c=c+ -12|0;f=o[c+4>>2];b=b+ -12|0;o[b>>2]=o[c>>2];o[b+4>>2]=f;f=c+8|0;o[b+8>>2]=o[f>>2];o[c>>2]=0;o[c+4>>2]=0;o[f>>2]=0;if((c|0)!=(d|0)){continue}break}d=o[a+4>>2];c=o[a>>2];break a}Nk();D()}db(1040);D()}c=d}o[a+8>>2]=e;o[a+4>>2]=g;o[a>>2]=b;if((c|0)!=(d|0)){while(1){a=d+ -12|0;if(m[d+ -1|0]<=-1){jl(o[a>>2])}d=a;if((a|0)!=(c|0)){continue}break}}if(c){jl(c)}}function Xa(a,b,c,d,e){var f=0,g=0,h=0,i=0,j=0,k=0;g=R-16|0;R=g;c=c+ -1|0;a:{if(c>>>0>8){break a}b:{switch(c-1|0){default:f=Ya(a,b,d,e);break a;case 1:f=Za(a,b,d,e);break a;case 3:f=_a(a,b,d,e);break a;case 0:f=$a(a,b,d,e);break a;case 2:f=ab(a,b,d,e);break a;case 4:f=bb(a,b,d,e);break a;case 5:case 6:break a;case 7:break b}}c=d;d=m[b+24|0];i=d<<2;h=o[a+80>>2];if((c|0)!=(u(i,h)|0)){break a}c=0;a=o[259];o[g+8>>2]=o[258];o[g+12>>2]=a;a=o[257];o[g>>2]=o[256];o[g+4>>2]=a;if(!h){f=1;break a}j=((d|0)>0?d:0)<<2;k=(d|0)<1;while(1){a=c;d=b;if(!p[d+84|0]){a=o[o[b+68>>2]+(c<<2)>>2]}if(!Ga(d,a,m[b+24|0],g)){f=0;break a}if(!k){ll(u(c,j)+e|0,g,i)}f=1;c=c+1|0;if((h|0)!=(c|0)){continue}break}}R=g+16|0;return f}function Sj(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,i=0;d=R-32|0;R=d;e=o[a+28>>2];o[d+16>>2]=e;f=o[a+20>>2];o[d+28>>2]=c;o[d+24>>2]=b;b=f-e|0;o[d+20>>2]=b;e=b+c|0;h=2;b=d+16|0;a:{b:{c:{if(!Wj(J(o[a+60>>2],d+16|0,2,d+12|0)|0)){while(1){f=o[d+12>>2];if((f|0)==(e|0)){break c}if((f|0)<=-1){break b}g=o[b+4>>2];i=f>>>0>g>>>0;b=i?b+8|0:b;g=f-(i?g:0)|0;o[b>>2]=g+o[b>>2];o[b+4>>2]=o[b+4>>2]-g;e=e-f|0;h=h-i|0;if(!Wj(J(o[a+60>>2],b|0,h|0,d+12|0)|0)){continue}break}}o[d+12>>2]=-1;if((e|0)!=-1){break b}}b=o[a+44>>2];o[a+28>>2]=b;o[a+20>>2]=b;o[a+16>>2]=b+o[a+48>>2];a=c;break a}o[a+28>>2]=0;o[a+16>>2]=0;o[a+20>>2]=0;o[a>>2]=o[a>>2]|32;a=0;if((h|0)==2){break a}a=c-o[b+4>>2]|0}R=d+32|0;return a|0}function va(a,b,c){var d=0,e=0,f=0,g=0;d=R-32|0;R=d;o[d+24>>2]=0;o[d+16>>2]=0;o[d+20>>2]=0;g=rl(b);a:{if(g>>>0<4294967280){b:{c:{if(g>>>0>=11){e=g+16&-16;f=yk(e);o[d+24>>2]=e|-2147483648;o[d+16>>2]=f;o[d+20>>2]=g;break c}m[d+27|0]=g;f=d+16|0;if(!g){break b}}ll(f,b,g)}m[f+g|0]=0;o[d+8>>2]=0;o[d>>2]=0;o[d+4>>2]=0;e=rl(c);if(e>>>0>=4294967280){break a}d:{e:{if(e>>>0>=11){b=e+16&-16;f=yk(b);o[d+8>>2]=b|-2147483648;o[d>>2]=f;o[d+4>>2]=e;break e}m[d+11|0]=e;f=d;if(!e){break d}}ll(f,c,e)}m[e+f|0]=0;c=o[a+4>>2];b=-1;f:{if(!c){break f}c=ej(c,d+16|0,d);b=-1;if(!c){break f}b=uj(a,o[c+24>>2])}a=b;if(m[d+11|0]<=-1){jl(o[d>>2])}if(m[d+27|0]<=-1){jl(o[d+16>>2])}R=d+32|0;return a}Ak();D()}Ak();D()}function bb(a,b,c,d){var e=0,f=0,g=0,h=0,i=0,j=0,k=0;f=R-16|0;R=f;a:{j=o[a+80>>2];g=m[b+24|0];h=g<<2;b:{if((u(j,h)|0)!=(c|0)){break b}if(!(!p[b+84|0]|o[b+28>>2]!=6)){ll(d,o[o[b>>2]>>2]+o[b+48>>2]|0,c);e=1;break b}a=0;o[f+8>>2]=0;o[f>>2]=0;o[f+4>>2]=0;if(g){if((g|0)<=-1){break a}a=yk(h);o[f>>2]=a;c=(g<<2)+a|0;o[f+8>>2]=c;ml(a,0,h);o[f+4>>2]=c}c:{if(!j){e=1;break c}h=0;k=(g|0)<1;while(1){c=i;e=b;if(!p[b+84|0]){c=o[o[b+68>>2]+(i<<2)>>2]}if(!Wa(e,c,m[b+24|0],a)){e=0;break c}e=0;c=h;if(!k){while(1){o[(c<<2)+d>>2]=o[(e<<2)+a>>2];c=c+1|0;e=e+1|0;if((g|0)!=(e|0)){continue}break}h=h+g|0}e=1;i=i+1|0;if((j|0)!=(i|0)){continue}break}}if(!a){break b}o[f+4>>2]=a;jl(a)}R=f+16|0;return e}Nk();D()}function ab(a,b,c,d){var e=0,f=0,g=0,h=0,i=0,j=0,k=0;f=R-16|0;R=f;a:{j=o[a+80>>2];g=m[b+24|0];h=g<<1;b:{if((u(j,h)|0)!=(c|0)){break b}if(!(!p[b+84|0]|o[b+28>>2]!=4)){ll(d,o[o[b>>2]>>2]+o[b+48>>2]|0,c);e=1;break b}a=0;o[f+8>>2]=0;o[f>>2]=0;o[f+4>>2]=0;if(g){if((g|0)<=-1){break a}a=yk(h);o[f>>2]=a;c=(g<<1)+a|0;o[f+8>>2]=c;ml(a,0,h);o[f+4>>2]=c}c:{if(!j){e=1;break c}h=0;k=(g|0)<1;while(1){c=i;e=b;if(!p[b+84|0]){c=o[o[b+68>>2]+(i<<2)>>2]}if(!Sa(e,c,m[b+24|0],a)){e=0;break c}e=0;c=h;if(!k){while(1){n[(c<<1)+d>>1]=q[(e<<1)+a>>1];c=c+1|0;e=e+1|0;if((g|0)!=(e|0)){continue}break}h=h+g|0}e=1;i=i+1|0;if((j|0)!=(i|0)){continue}break}}if(!a){break b}o[f+4>>2]=a;jl(a)}R=f+16|0;return e}Nk();D()}function _a(a,b,c,d){var e=0,f=0,g=0,h=0,i=0,j=0,k=0;f=R-16|0;R=f;a:{j=o[a+80>>2];g=m[b+24|0];h=g<<2;b:{if((u(j,h)|0)!=(c|0)){break b}if(!(!p[b+84|0]|o[b+28>>2]!=5)){ll(d,o[o[b>>2]>>2]+o[b+48>>2]|0,c);e=1;break b}a=0;o[f+8>>2]=0;o[f>>2]=0;o[f+4>>2]=0;if(g){if((g|0)<=-1){break a}a=yk(h);o[f>>2]=a;c=(g<<2)+a|0;o[f+8>>2]=c;ml(a,0,h);o[f+4>>2]=c}c:{if(!j){e=1;break c}h=0;k=(g|0)<1;while(1){c=i;e=b;if(!p[b+84|0]){c=o[o[b+68>>2]+(i<<2)>>2]}if(!Ua(e,c,m[b+24|0],a)){e=0;break c}e=0;c=h;if(!k){while(1){o[(c<<2)+d>>2]=o[(e<<2)+a>>2];c=c+1|0;e=e+1|0;if((g|0)!=(e|0)){continue}break}h=h+g|0}e=1;i=i+1|0;if((j|0)!=(i|0)){continue}break}}if(!a){break b}o[f+4>>2]=a;jl(a)}R=f+16|0;return e}Nk();D()}function Za(a,b,c,d){var e=0,f=0,g=0,h=0,i=0,j=0,k=0;f=R-16|0;R=f;a:{j=o[a+80>>2];g=m[b+24|0];h=g<<1;b:{if((u(j,h)|0)!=(c|0)){break b}if(!(!p[b+84|0]|o[b+28>>2]!=3)){ll(d,o[o[b>>2]>>2]+o[b+48>>2]|0,c);e=1;break b}a=0;o[f+8>>2]=0;o[f>>2]=0;o[f+4>>2]=0;if(g){if((g|0)<=-1){break a}a=yk(h);o[f>>2]=a;c=(g<<1)+a|0;o[f+8>>2]=c;ml(a,0,h);o[f+4>>2]=c}c:{if(!j){e=1;break c}h=0;k=(g|0)<1;while(1){c=i;e=b;if(!p[b+84|0]){c=o[o[b+68>>2]+(i<<2)>>2]}if(!Qa(e,c,m[b+24|0],a)){e=0;break c}e=0;c=h;if(!k){while(1){n[(c<<1)+d>>1]=q[(e<<1)+a>>1];c=c+1|0;e=e+1|0;if((g|0)!=(e|0)){continue}break}h=h+g|0}e=1;i=i+1|0;if((j|0)!=(i|0)){continue}break}}if(!a){break b}o[f+4>>2]=a;jl(a)}R=f+16|0;return e}Nk();D()}function Zi(a,b){var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,q=0;d=R-16|0;R=d;h=sj(b);a:{if(!h){o[a>>2]=0;break a}e=o[b+100>>2];i=o[b+96>>2];o[d+8>>2]=0;o[d>>2]=0;o[d+4>>2]=0;b=e-i|0;c=(b|0)/12|0;b:{c:{if(b){if(c>>>0>=357913942){break c}g=yk(b);o[d>>2]=g;o[d+8>>2]=u(c,12)+g;n=d,q=ml(g,0,b)+b|0,o[n+4>>2]=q}if((e|0)==(i|0)){break b}l=c>>>0>1?c:1;b=0;m=p[h+84|0];while(1){j=u(b,12);c=j+i|0;e=o[c>>2];d:{if(m){k=c+8|0;c=c+4|0;break d}f=o[h+68>>2];k=f+(o[c+8>>2]<<2)|0;e=o[f+(e<<2)>>2];c=f+(o[c+4>>2]<<2)|0}f=o[c>>2];c=g+j|0;o[c+8>>2]=o[k>>2];o[c+4>>2]=f;o[c>>2]=e;b=b+1|0;if((l|0)!=(b|0)){continue}break}break b}Nk();D()}Di(a,d);a=o[d>>2];if(!a){break a}o[d+4>>2]=a;jl(a)}R=d+16|0}function Xd(a,b){var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;d=o[a+8>>2];c=o[a+4>>2];if(d-c>>2>>>0>=b>>>0){e=a;a=b<<2;j=e,k=ml(c,0,a)+a|0,o[j+4>>2]=k;return}e=o[a>>2];g=c-e>>2;f=g+b|0;a:{if(f>>>0<1073741824){g=g<<2;d=d-e|0;i=d>>1;f=d>>2>>>0<536870911?i>>>0>>0?f:i:1073741823;if(f){if(f>>>0>=1073741824){break a}h=yk(f<<2)}d=h+g|0;b=b<<2;b=ml(d,0,b)+b|0;f=(f<<2)+h|0;if((c|0)!=(e|0)){while(1){c=c+ -4|0;h=o[c>>2];o[c>>2]=0;d=d+ -4|0;o[d>>2]=h;if((c|0)!=(e|0)){continue}break}e=o[a>>2];c=o[a+4>>2]}o[a+8>>2]=f;o[a+4>>2]=b;o[a>>2]=d;if((c|0)!=(e|0)){while(1){c=c+ -4|0;a=o[c>>2];o[c>>2]=0;if(a){l[o[o[a>>2]+4>>2]](a)}if((c|0)!=(e|0)){continue}break}}if(e){jl(e)}return}Nk();D()}db(1832);D()}function Sg(a,b){var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;d=o[a+8>>2];c=o[a+4>>2];if(d-c>>2>>>0>=b>>>0){e=a;a=b<<2;j=e,k=ml(c,0,a)+a|0,o[j+4>>2]=k;return}e=o[a>>2];g=c-e>>2;f=g+b|0;a:{if(f>>>0<1073741824){g=g<<2;d=d-e|0;i=d>>1;f=d>>2>>>0<536870911?i>>>0>>0?f:i:1073741823;if(f){if(f>>>0>=1073741824){break a}h=yk(f<<2)}d=h+g|0;b=b<<2;b=ml(d,0,b)+b|0;f=(f<<2)+h|0;if((c|0)!=(e|0)){while(1){c=c+ -4|0;h=o[c>>2];o[c>>2]=0;d=d+ -4|0;o[d>>2]=h;if((c|0)!=(e|0)){continue}break}e=o[a>>2];c=o[a+4>>2]}o[a+8>>2]=f;o[a+4>>2]=b;o[a>>2]=d;if((c|0)!=(e|0)){while(1){c=c+ -4|0;a=o[c>>2];o[c>>2]=0;if(a){l[o[o[a>>2]+4>>2]](a)}if((c|0)!=(e|0)){continue}break}}if(e){jl(e)}return}Nk();D()}db(8832);D()}function Ni(a,b,c){var d=0,e=0,f=0,g=0,h=0;d=o[a+8>>2];f=o[a>>2];a:{if(d-f>>2>>>0>=b>>>0){h=o[a+4>>2];g=h-f>>2;e=g>>>0>>0?g:b;if(e){d=f;while(1){o[d>>2]=o[c>>2];d=d+4|0;e=e+ -1|0;if(e){continue}break}}a=a+4|0;if(g>>>0>>0){d=h;b=b-g|0;e=b;while(1){o[d>>2]=o[c>>2];d=d+4|0;e=e+ -1|0;if(e){continue}break}o[a>>2]=(b<<2)+h;return}break a}if(f){o[a+4>>2]=f;jl(f);o[a+8>>2]=0;o[a>>2]=0;o[a+4>>2]=0;d=0}b:{if(b>>>0>=1073741824){break b}e=d>>1;d=d>>2>>>0<536870911?e>>>0>>0?b:e:1073741823;if(d>>>0>=1073741824){break b}d=d<<2;f=yk(d);o[a>>2]=f;o[a+4>>2]=f;o[a+8>>2]=d+f;a=a+4|0;d=f;e=b;while(1){o[d>>2]=o[c>>2];d=d+4|0;e=e+ -1|0;if(e){continue}break}break a}Nk();D()}o[a>>2]=f+(b<<2)}function je(a,b,c,d,e){var f=0,g=0,h=0,i=0,j=0,k=0;a:{b:{if((b|0)!=-2){g=o[o[o[d+4>>2]+8>>2]+(c<<2)>>2];if((l[o[o[d>>2]+8>>2]](d)|0)==1){f=b;b=q[d+36>>1];re(a,d,f,c,e,(b<<24|b<<8&16711680)>>>16|0);if(o[a>>2]){break b}o[a>>2]=0}f=yk(44);o[f+4>>2]=g;o[f>>2]=2732;b=o[e+8>>2];c=o[e+12>>2];d=o[e+16>>2];g=o[e+20>>2];h=o[e>>2];i=o[e+4>>2];o[f+40>>2]=0;o[f+32>>2]=0;o[f+36>>2]=0;o[f+24>>2]=d;o[f+28>>2]=g;o[f+16>>2]=b;o[f+20>>2]=c;o[f+8>>2]=h;o[f+12>>2]=i;d=o[e+24>>2];b=o[e+28>>2]-d|0;c:{if(!b){break c}e=b>>2;if(e>>>0>=1073741824){break a}c=yk(b);o[f+32>>2]=c;o[f+36>>2]=c;o[f+40>>2]=c+(e<<2);if((b|0)<1){break c}j=f,k=ll(c,d,b)+b|0,o[j+36>>2]=k}o[f>>2]=5424}o[a>>2]=f}return}Nk();D()}function _h(a,b){var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0;d=R-32|0;R=d;o[d+24>>2]=0;o[d+16>>2]=0;o[d+20>>2]=0;a:{f=u(b,3);if(f){if(f>>>0>=1073741824){break a}c=u(b,12);e=yk(c);o[d+16>>2]=e;g=(f<<2)+e|0;o[d+24>>2]=g;ml(e,0,c);o[d+20>>2]=g}b:{if(!dg(f,1,o[a+32>>2],e)){break b}if(!b){h=1;break b}f=0;c=0;while(1){g=d+8|0;o[g>>2]=0;o[d>>2]=0;o[d+4>>2]=0;i=c;e=(f<<2)+e|0;c=o[e>>2];j=c>>>1|0;c=i+(c&1?0-j|0:j)|0;o[d>>2]=c;i=c;c=o[e+4>>2];j=c>>>1|0;c=i+(c&1?0-j|0:j)|0;o[d+4>>2]=c;i=c;e=o[e+8>>2];c=e>>>1|0;c=i+(e&1?0-c|0:c)|0;o[g>>2]=c;$h(o[a+44>>2]+96|0,d);h=h+1|0;if((h|0)!=(b|0)){f=f+3|0;e=o[d+16>>2];continue}break}h=1;e=o[d+16>>2]}if(e){o[d+20>>2]=e;jl(e)}R=d+32|0;return h}Nk();D()}function Jj(a,b,c){a:{b:{if(b>>>0>20){break b}b=b+ -9|0;if(b>>>0>9){break b}c:{switch(b-1|0){default:b=o[c>>2];o[c>>2]=b+4;o[a>>2]=o[b>>2];return;case 0:b=o[c>>2];o[c>>2]=b+4;b=o[b>>2];o[a>>2]=b;o[a+4>>2]=b>>31;return;case 1:b=o[c>>2];o[c>>2]=b+4;o[a>>2]=o[b>>2];o[a+4>>2]=0;return;case 3:b=o[c>>2];o[c>>2]=b+4;b=n[b>>1];o[a>>2]=b;o[a+4>>2]=b>>31;return;case 4:b=o[c>>2];o[c>>2]=b+4;o[a>>2]=q[b>>1];o[a+4>>2]=0;return;case 5:b=o[c>>2];o[c>>2]=b+4;b=m[b|0];o[a>>2]=b;o[a+4>>2]=b>>31;return;case 6:b=o[c>>2];o[c>>2]=b+4;o[a>>2]=p[b|0];o[a+4>>2]=0;return;case 2:case 7:break a;case 8:break c}}l[275](a,c)}return}b=o[c>>2]+7&-8;o[c>>2]=b+8;c=o[b+4>>2];o[a>>2]=o[b>>2];o[a+4>>2]=c}function Of(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,n=0,p=0,q=0,r=0,t=v(0);g=R-16|0;R=g;d=o[a+24>>2];f=m[o[a+8>>2]+24|0];h=f<<2;i=yk((f&1073741823)!=(f|0)?-1:h);j=g+8|0;o[j>>2]=1065353216;d=-1<>2]=s[a+32>>2]/v(d|0);c=1}b:{if(!c){break b}c=o[a+16>>2];d=0;c:{if(!o[c+80>>2]){break c}d=o[o[c>>2]>>2]+o[c+48>>2]|0}if(!b){e=1;break b}q=(f|0)<1;while(1){if(!q){r=o[a+28>>2];t=s[j>>2];e=0;c=k;while(1){l=e<<2;s[l+i>>2]=v(t*v(o[d+(c<<2)>>2]))+s[r+l>>2];c=c+1|0;e=e+1|0;if((f|0)!=(e|0)){continue}break}k=f+k|0}ll(o[o[o[a+8>>2]+64>>2]>>2]+n|0,i,h);n=h+n|0;e=1;p=p+1|0;if((p|0)!=(b|0)){continue}break}}jl(i);R=g+16|0;return e|0}function xj(a,b){var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;d=o[a+8>>2];c=o[a+4>>2];if(d-c>>2>>>0>=b>>>0){e=a;a=b<<2;j=e,k=ml(c,0,a)+a|0,o[j+4>>2]=k;return}e=o[a>>2];g=c-e>>2;f=g+b|0;a:{if(f>>>0<1073741824){g=g<<2;d=d-e|0;i=d>>1;f=d>>2>>>0<536870911?i>>>0>>0?f:i:1073741823;if(f){if(f>>>0>=1073741824){break a}h=yk(f<<2)}d=h+g|0;b=b<<2;b=ml(d,0,b)+b|0;f=(f<<2)+h|0;if((c|0)!=(e|0)){while(1){c=c+ -4|0;h=o[c>>2];o[c>>2]=0;d=d+ -4|0;o[d>>2]=h;if((c|0)!=(e|0)){continue}break}e=o[a>>2];c=o[a+4>>2]}o[a+8>>2]=f;o[a+4>>2]=b;o[a>>2]=d;if((c|0)!=(e|0)){while(1){c=c+ -4|0;a=o[c>>2];o[c>>2]=0;if(a){Kb(a)}if((c|0)!=(e|0)){continue}break}}if(e){jl(e)}return}Nk();D()}db(11048);D()}function gj(a,b){var c=0,d=0,e=0,f=0,g=0;e=o[a>>2];f=o[a+4>>2]-e>>2;c=f+1|0;a:{b:{c:{if(c>>>0<1073741824){e=o[a+8>>2]-e|0;g=e>>1;c=e>>2>>>0<536870911?g>>>0>>0?c:g:1073741823;if(c){if(c>>>0>=1073741824){break c}d=yk(c<<2)}e=o[b>>2];o[b>>2]=0;b=(f<<2)+d|0;o[b>>2]=e;e=(c<<2)+d|0;f=b+4|0;c=o[a+4>>2];d=o[a>>2];if((c|0)==(d|0)){break b}while(1){c=c+ -4|0;g=o[c>>2];o[c>>2]=0;b=b+ -4|0;o[b>>2]=g;if((c|0)!=(d|0)){continue}break}d=o[a+4>>2];c=o[a>>2];break a}Nk();D()}db(10924);D()}c=d}o[a+8>>2]=e;o[a+4>>2]=f;o[a>>2]=b;if((c|0)!=(d|0)){while(1){d=d+ -4|0;a=o[d>>2];o[d>>2]=0;if(a){Kc(a+12|0,o[a+16>>2]);Lc(a,o[a+4>>2]);jl(a)}if((c|0)!=(d|0)){continue}break}}if(c){jl(c)}}function uf(a,b,c){var d=0,e=0,f=v(0),g=v(0),h=v(0),i=0,j=0;f=v(a+b);a:{b:{h=v(a-b);if(h<=v(.5)^1|h>=v(-.5)^1|f>=v(.5)^1){break b}e=1;if(!(f<=v(1.5))){break b}g=b;break a}c:{if(!!(f<=v(.5))){g=v(v(.5)-a);a=v(v(.5)-b);break c}if(!!(f>=v(1.5))){g=v(v(1.5)-a);a=v(v(1.5)-b);break c}if(!!(h<=v(-.5))){g=v(a+v(.5));a=v(b+v(-.5));break c}g=v(a+v(-.5));a=v(b+v(.5))}h=v(a-g);f=v(g+a);e=-1}d=+g;b=v(d+d+ -1);d=+a;a=v(d+d+ -1);j=e;e=+h;e=e+e;d=1-e;e=e+1;e=d>2]=0;f=v(0);a=v(0);break d}h=v(v(1)/v(C(f)));s[c>>2]=h*g;f=v(h*b);a=v(h*a)}s[c+8>>2]=f;s[c+4>>2]=a}function yd(a,b,c){var d=0,e=0,f=0,g=0,h=0,i=0,j=0;a:{d=c-b|0;g=d>>2;f=o[a+8>>2];e=o[a>>2];b:{if(g>>>0<=f-e>>2>>>0){h=o[a+4>>2];d=h-e|0;f=d>>2;d=g>>>0>f>>>0?b+d|0:c;if((d|0)!=(b|0)){while(1){o[e>>2]=o[b>>2];e=e+4|0;b=b+4|0;if((d|0)!=(b|0)){continue}break}}if(g>>>0>f>>>0){b=c-d|0;if((b|0)<1){break b}ll(h,d,b);o[a+4>>2]=b+o[a+4>>2];return}o[a+4>>2]=e;return}if(e){o[a+4>>2]=e;jl(e);o[a+8>>2]=0;o[a>>2]=0;o[a+4>>2]=0;f=0}if(g>>>0>=1073741824){break a}c=f>>1;c=f>>2>>>0<536870911?c>>>0>>0?g:c:1073741823;if(c>>>0>=1073741824){break a}e=c<<2;c=yk(e);o[a>>2]=c;o[a+4>>2]=c;o[a+8>>2]=c+e;if((d|0)<1){break b}i=a,j=ll(c,b,d)+d|0,o[i+4>>2]=j}return}Nk();D()}function eb(a,b,c){var d=0,e=0,f=0,g=0,h=0;e=R-16|0;R=e;o[a+4>>2]=0;a:{b:{if(!b){break b}f=o[a+8>>2];d=f<<5;c:{if(d>>>0>=b>>>0){o[a+4>>2]=b;break c}o[e+8>>2]=0;o[e>>2]=0;o[e+4>>2]=0;if((b|0)<=-1){break a}h=e;if(d>>>0<=1073741822){g=b+31&-32;d=f<<6;g=d>>>0>>0?g:d}else{g=2147483647}fb(h,g);d=o[a>>2];o[a>>2]=o[e>>2];o[e>>2]=d;f=o[a+4>>2];o[a+4>>2]=b;o[e+4>>2]=f;f=o[a+8>>2];o[a+8>>2]=o[e+8>>2];o[e+8>>2]=f;if(!d){break c}jl(d)}d=b>>>5|0;f=d<<2;a=o[a>>2];if(p[c|0]){a=ml(a,255,f);b=b&31;if(!b){break b}a=a+(d<<2)|0;o[a>>2]=o[a>>2]|-1>>>32-b;break b}a=ml(a,0,f);b=b&31;if(!b){break b}a=a+(d<<2)|0;o[a>>2]=o[a>>2]&(-1>>>32-b^-1)}R=e+16|0;return}Nk();D()}function ai(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,i=0;f=R-16|0;R=f;g=yk(64);c=yk(12);o[c+8>>2]=o[o[a+4>>2]+80>>2];o[c>>2]=10052;o[c+4>>2]=0;o[f+8>>2]=c;Vd(g,f+8|0);a:{if((b|0)>=0){h=a+8|0;c=o[a+12>>2];i=o[a+8>>2];d=c-i>>2;b:{if((d|0)>(b|0)){break b}e=b+1|0;if(d>>>0<=b>>>0){Sg(h,e-d|0);break b}if(e>>>0>=d>>>0){break b}e=i+(e<<2)|0;if((e|0)!=(c|0)){while(1){c=c+ -4|0;d=o[c>>2];o[c>>2]=0;if(d){l[o[o[d>>2]+4>>2]](d)}if((c|0)!=(e|0)){continue}break}}o[a+12>>2]=e}b=o[h>>2]+(b<<2)|0;a=o[b>>2];o[b>>2]=g;d=1;if(!a){break a}l[o[o[a>>2]+4>>2]](a);break a}l[o[o[g>>2]+4>>2]](g)}a=o[f+8>>2];o[f+8>>2]=0;if(a){l[o[o[a>>2]+4>>2]](a)}R=f+16|0;return d|0}function Lg(a){o[a>>2]=8228;ml(a+4|0,0,80);o[a+96>>2]=0;o[a+100>>2]=0;o[a+92>>2]=-1;o[a+84>>2]=-1;o[a+88>>2]=-1;o[a+104>>2]=0;o[a+108>>2]=0;o[a+112>>2]=0;o[a+116>>2]=0;o[a+120>>2]=0;o[a+124>>2]=0;o[a+128>>2]=0;o[a+132>>2]=0;o[a+136>>2]=0;o[a+140>>2]=0;o[a+144>>2]=0;o[a+148>>2]=0;o[a+156>>2]=0;o[a+160>>2]=0;o[a+152>>2]=1065353216;o[a+164>>2]=0;o[a+168>>2]=0;o[a+172>>2]=0;o[a+176>>2]=0;o[a+180>>2]=0;o[a+184>>2]=0;o[a+188>>2]=0;o[a+192>>2]=0;o[a+196>>2]=0;o[a+200>>2]=0;o[a+204>>2]=0;o[a+208>>2]=0;o[a+212>>2]=-1;o[a+216>>2]=0;o[a+220>>2]=0;o[a+224>>2]=0;si(a+232|0);si(a+272|0);Rf(a+312|0);si(a+328|0);o[a+376>>2]=0;o[a+368>>2]=0;o[a+372>>2]=0}function Ei(a,b){var c=0,d=0,e=0,f=0,g=0,h=0;f=R-16|0;R=f;o[a+80>>2]=0;o[a+84>>2]=0;c=a+76|0;d=o[c>>2];o[c>>2]=0;if(d){jl(d)}o[a+68>>2]=0;o[a+72>>2]=0;c=a- -64|0;d=o[c>>2];o[c>>2]=0;if(d){jl(d)}c=o[b+4>>2];d=o[b>>2];e=u((c-d|0)/12|0,3);h=o[a>>2];g=o[a+4>>2]-h>>2;a:{if(e>>>0>g>>>0){Fi(a,e-g|0);d=o[b>>2];c=o[b+4>>2];break a}if(e>>>0>=g>>>0){break a}o[a+4>>2]=h+(e<<2)}if((c|0)!=(d|0)){b=(c-d|0)/12|0;g=b>>>0>1?b:1;h=o[a>>2];b=0;while(1){e=u(b,12);c=e+h|0;e=d+e|0;o[c>>2]=o[e>>2];o[c+4>>2]=o[e+4>>2];o[c+8>>2]=o[e+8>>2];b=b+1|0;if((g|0)!=(b|0)){continue}break}}o[f+12>>2]=-1;b=0;if(Gi(a,f+12|0)){Hi(a);Ii(a,o[f+12>>2]);b=1}R=f+16|0;return b}function Eh(a,b,c){var d=0,e=0,f=0,g=0,h=0,i=0,j=0;d=(c>>>0)/3|0;Fh(o[a+12>>2],o[(o[o[a+8>>2]+96>>2]+u(d,12)|0)+(c-u(d,3)<<2)>>2]);a:{b:{g=o[a+4>>2];d=o[g+4>>2];f=o[g+8>>2];c:{if((d|0)!=(f|0)){o[d>>2]=c;o[g+4>>2]=d+4;break c}h=o[g>>2];i=d-h|0;d=i>>2;e=d+1|0;if(e>>>0>=1073741824){break b}j=d<<2;f=f-h|0;d=f>>1;e=f>>2>>>0<536870911?d>>>0>>0?e:d:1073741823;d=0;d:{if(!e){break d}if(e>>>0>=1073741824){break a}d=yk(e<<2)}f=j+d|0;o[f>>2]=c;c=d+(e<<2)|0;e=f+4|0;if((i|0)>=1){ll(d,h,i)}o[g+8>>2]=c;o[g+4>>2]=e;o[g>>2]=d;if(!h){break c}jl(h)}a=o[a+4>>2];o[o[a+12>>2]+(b<<2)>>2]=o[a+24>>2];o[a+24>>2]=o[a+24>>2]+1;return}Nk();D()}db(8832);D()}function Jf(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;f=R-32|0;R=f;h=(e&1073741823)!=(e|0)?-1:e<<2;h=ml(yk(h),0,h);g=o[b>>2];i=o[b+4>>2];k=o[h+4>>2];o[f+16>>2]=o[h>>2];o[f+20>>2]=k;o[f+8>>2]=g;o[f+12>>2]=i;i=a+8|0;Ef(f+24|0,i,f+16|0,f+8|0);o[c>>2]=o[f+24>>2];o[c+4>>2]=o[f+28>>2];if((e|0)<(d|0)){k=0-e<<2;a=e;while(1){g=a<<2;j=g+b|0;m=o[j>>2];j=o[j+4>>2];g=c+g|0;l=g+k|0;n=o[l+4>>2];o[f+16>>2]=o[l>>2];o[f+20>>2]=n;o[f+8>>2]=m;o[f+12>>2]=j;Ef(f+24|0,i,f+16|0,f+8|0);o[g>>2]=o[f+24>>2];o[g+4>>2]=o[f+28>>2];a=a+e|0;if((a|0)<(d|0)){continue}break}}jl(h);R=f+32|0;return 1}function fg(a,b,c){var d=0,e=0,f=0,g=0;a:{b:{e=o[b+16>>2];f=o[b+12>>2];d=o[b+20>>2];c:{if((f|0)<(d|0)?1:(f|0)<=(d|0)?r[b+8>>2]>e>>>0?0:1:0){break c}f=p[e+o[b>>2]|0];e=e+1|0;if(e>>>0<1){d=d+1|0}o[b+16>>2]=e;o[b+20>>2]=d;d=f+ -1|0;if(d>>>0>17){break c}d:{e:{f:{g:{h:{i:{j:{switch(d-1|0){case 12:case 13:case 14:case 15:break a;case 8:break h;case 7:break i;case 3:break j;case 16:break d;case 11:break e;case 10:break f;case 9:break g;default:break b}}return jg(a,b,c)}return kg(a,b,c)}return lg(a,b,c)}return mg(a,b,c)}return ng(a,b,c)}return og(a,b,c)}g=pg(a,b,c)}return g}return ig(a,b,c)}return pg(a,b,c)}function Dg(a){a=a|0;var b=0,c=0,d=0,e=0;b=o[a+32>>2];d=o[b+16>>2];e=o[b+12>>2];c=o[b+20>>2];if((e|0)>(c|0)?1:(e|0)>=(c|0)?r[b+8>>2]<=d>>>0?0:1:0){e=p[d+o[b>>2]|0];d=d+1|0;if(d>>>0<1){c=c+1|0}o[b+16>>2]=d;o[b+20>>2]=c;b=o[a+48>>2];o[a+48>>2]=0;if(b){l[o[o[b>>2]+4>>2]](b)}a:{b:{if(e>>>0>2){break b}c:{switch(e-1|0){default:c=yk(384);Lg(c);b=o[a+48>>2];o[a+48>>2]=c;if(!b){break a}l[o[o[b>>2]+4>>2]](b);break b;case 0:break b;case 1:break c}}c=yk(440);ih(c);b=o[a+48>>2];o[a+48>>2]=c;if(!b){break a}l[o[o[b>>2]+4>>2]](b)}c=o[a+48>>2];if(c){break a}return 0}a=l[o[o[c>>2]+8>>2]](c,a)|0}else{a=0}return a|0}function kd(a,b,c){var d=0,e=0,f=0,g=0,h=0,i=0,j=0;a:{f=c-b|0;g=f>>2;d=o[a+8>>2];e=o[a>>2];b:{if(g>>>0<=d-e>>2>>>0){d=o[a+4>>2]-e|0;f=d>>2;d=g>>>0>f>>>0?b+d|0:c;h=d-b|0;if(h){nl(e,b,h)}if(g>>>0>f>>>0){b=c-d|0;if((b|0)<1){break b}ll(o[a+4>>2],d,b);o[a+4>>2]=b+o[a+4>>2];return}o[a+4>>2]=e+(h>>2<<2);return}if(e){o[a+4>>2]=e;jl(e);o[a+8>>2]=0;o[a>>2]=0;o[a+4>>2]=0;d=0}if(g>>>0>=1073741824){break a}c=d>>1;c=d>>2>>>0<536870911?c>>>0>>0?g:c:1073741823;if(c>>>0>=1073741824){break a}e=c<<2;c=yk(e);o[a>>2]=c;o[a+4>>2]=c;o[a+8>>2]=c+e;if((f|0)<1){break b}i=a,j=ll(c,b,f)+f|0,o[i+4>>2]=j}return}Nk();D()}function Cf(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;c=o[b+12>>2];h=c;e=c;c=o[b+20>>2];f=c;g=o[b+16>>2];d=g+4|0;if(d>>>0<4){c=c+1|0}i=o[b+8>>2];j=d;d=c;a:{if((e|0)<(c|0)?1:(e|0)<=(c|0)?i>>>0>=j>>>0?0:1:0){break a}c=g+o[b>>2]|0;e=p[c|0]|p[c+1|0]<<8|(p[c+2|0]<<16|p[c+3|0]<<24);o[b+16>>2]=j;o[b+20>>2]=d;c=f;d=g+8|0;if(d>>>0<8){c=c+1|0}f=d;d=c;if((h|0)<(c|0)?1:(h|0)<=(c|0)?i>>>0>=f>>>0?0:1:0){break a}o[b+16>>2]=f;o[b+20>>2]=d;if(!(e&1)){break a}c=x(e)^31;if(c+ -1>>>0>28){break a}o[a+8>>2]=c+1;d=-2<>2]=c;o[a+12>>2]=d^-1;o[a+20>>2]=(c|0)/2;k=Sf(a+88|0,b)}return k|0}function Ha(a,b,c){var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;e=R-16|0;R=e;i=o[a+80>>2];f=m[b+24|0];a=o[259];o[e+8>>2]=o[258];o[e+12>>2]=a;a=o[257];o[e>>2]=o[256];o[e+4>>2]=a;a=u(f,i);g=o[c>>2];d=o[c+4>>2]-g>>2;a:{if(a>>>0>d>>>0){Ia(c,a-d|0);break a}if(a>>>0>=d>>>0){break a}o[c+4>>2]=g+(a<<2)}b:{if(!i){a=1;break b}g=(f|0)<1;while(1){a=h;d=b;if(!p[d+84|0]){a=o[o[b+68>>2]+(h<<2)>>2]}if(!Ga(d,a,m[b+24|0],e)){a=0;break b}if(!g){k=o[c>>2];a=0;d=j;while(1){o[k+(d<<2)>>2]=o[(a<<2)+e>>2];d=d+1|0;a=a+1|0;if((f|0)!=(a|0)){continue}break}j=f+j|0}a=1;h=h+1|0;if((i|0)!=(h|0)){continue}break}}R=e+16|0;return a}function $h(a,b){var c=0,d=0,e=0,f=0,g=0,h=0;e=o[a+4>>2];f=o[a+8>>2];if((e|0)!=(f|0)){d=o[b+4>>2];o[e>>2]=o[b>>2];o[e+4>>2]=d;o[e+8>>2]=o[b+8>>2];o[a+4>>2]=o[a+4>>2]+12;return}c=e;e=o[a>>2];g=c-e|0;c=(g|0)/12|0;d=c+1|0;a:{if(d>>>0<357913942){h=u(c,12);f=(f-e|0)/12|0;c=f<<1;f=f>>>0<178956970?c>>>0>>0?d:c:357913941;c=0;b:{if(!f){break b}if(f>>>0>=357913942){break a}c=yk(u(f,12))}d=h+c|0;h=o[b+4>>2];o[d>>2]=o[b>>2];o[d+4>>2]=h;o[d+8>>2]=o[b+8>>2];b=d+u((g|0)/-12|0,12)|0;c=c+u(f,12)|0;d=d+12|0;if((g|0)>=1){ll(b,e,g)}o[a+8>>2]=c;o[a+4>>2]=d;o[a>>2]=b;if(e){jl(e)}return}Nk();D()}db(9976);D()}function hd(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0;d=o[b+88>>2];if(!(!d|o[d>>2]!=1)){f=o[d+8>>2];c=f;o[a+4>>2]=p[c|0]|p[c+1|0]<<8|(p[c+2|0]<<16|p[c+3|0]<<24);g=a+8|0;h=o[a+8>>2];e=o[a+12>>2]-h>>2;c=m[b+24|0];a:{if(e>>>0>>0){Ia(g,c-e|0);f=o[d+8>>2];c=p[b+24|0];break a}if(e>>>0<=c>>>0){break a}o[a+12>>2]=h+(c<<2)}e=1;b=f;d=p[b+4|0]|p[b+5|0]<<8|(p[b+6|0]<<16|p[b+7|0]<<24);if(c<<24>>24>=1){b=c&255;h=b>>>0>1?b:1;g=o[g>>2];b=0;c=4;while(1){o[g+(b<<2)>>2]=d;c=c+4|0;d=f+c|0;d=p[d|0]|p[d+1|0]<<8|(p[d+2|0]<<16|p[d+3|0]<<24);b=b+1|0;if((h|0)!=(b|0)){continue}break}}o[a+20>>2]=d}return e|0}function Ff(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;c=o[b+12>>2];h=c;e=c;c=o[b+20>>2];f=c;g=o[b+16>>2];d=g+4|0;if(d>>>0<4){c=c+1|0}i=o[b+8>>2];j=d;d=c;a:{if((e|0)<(c|0)?1:(e|0)<=(c|0)?i>>>0>=j>>>0?0:1:0){break a}c=g+o[b>>2]|0;e=p[c|0]|p[c+1|0]<<8|(p[c+2|0]<<16|p[c+3|0]<<24);o[b+16>>2]=j;o[b+20>>2]=d;c=f;d=g+8|0;if(d>>>0<8){c=c+1|0}f=d;d=c;if((h|0)<(c|0)?1:(h|0)<=(c|0)?i>>>0>=f>>>0?0:1:0){break a}o[b+16>>2]=f;o[b+20>>2]=d;if(!(e&1)){break a}b=x(e)^31;if(b+ -1>>>0>28){break a}k=1;o[a+8>>2]=b+1;c=-2<>2]=b;o[a+12>>2]=c^-1;o[a+20>>2]=(b|0)/2}return k|0}function pd(a,b,c){var d=0,e=0,f=0,g=0,h=0,i=0,j=0;e=o[a+8>>2];f=o[a+4>>2];if(e-f>>2>>>0>=b>>>0){e=f;d=b;while(1){o[e>>2]=o[c>>2];e=e+4|0;d=d+ -1|0;if(d){continue}break}o[a+4>>2]=f+(b<<2);return}g=o[a>>2];j=f-g|0;h=j>>2;d=h+b|0;a:{if(d>>>0<1073741824){e=e-g|0;i=e>>1;d=e>>2>>>0<536870911?i>>>0>>0?d:i:1073741823;f=0;b:{if(!d){break b}if(d>>>0>=1073741824){break a}f=yk(d<<2)}i=f+(d<<2)|0;h=f+(h<<2)|0;e=h;d=b;while(1){o[e>>2]=o[c>>2];e=e+4|0;d=d+ -1|0;if(d){continue}break}b=h+(b<<2)|0;if((j|0)>=1){ll(f,g,j)}o[a+8>>2]=i;o[a+4>>2]=b;o[a>>2]=f;if(g){jl(g)}return}Nk();D()}db(1308);D()}function Dd(a,b,c){var d=0,e=0,f=0,g=0,h=0,i=0,j=0;e=o[a+8>>2];f=o[a+4>>2];if(e-f>>2>>>0>=b>>>0){e=f;d=b;while(1){o[e>>2]=o[c>>2];e=e+4|0;d=d+ -1|0;if(d){continue}break}o[a+4>>2]=f+(b<<2);return}g=o[a>>2];j=f-g|0;h=j>>2;d=h+b|0;a:{if(d>>>0<1073741824){e=e-g|0;i=e>>1;d=e>>2>>>0<536870911?i>>>0>>0?d:i:1073741823;f=0;b:{if(!d){break b}if(d>>>0>=1073741824){break a}f=yk(d<<2)}i=f+(d<<2)|0;h=f+(h<<2)|0;e=h;d=b;while(1){o[e>>2]=o[c>>2];e=e+4|0;d=d+ -1|0;if(d){continue}break}b=h+(b<<2)|0;if((j|0)>=1){ll(f,g,j)}o[a+8>>2]=i;o[a+4>>2]=b;o[a>>2]=f;if(g){jl(g)}return}Nk();D()}db(1520);D()}function Ji(a,b){var c=0,d=0,e=0,f=0,g=0,h=0,i=0;d=o[a+8>>2];e=o[a+4>>2];if(d-e>>2>>>0>=b>>>0){d=e;c=b;while(1){o[d>>2]=o[2631];d=d+4|0;c=c+ -1|0;if(c){continue}break}o[a+4>>2]=e+(b<<2);return}f=o[a>>2];i=e-f|0;g=i>>2;c=g+b|0;a:{if(c>>>0<1073741824){d=d-f|0;h=d>>1;c=d>>2>>>0<536870911?h>>>0>>0?c:h:1073741823;e=0;b:{if(!c){break b}if(c>>>0>=1073741824){break a}e=yk(c<<2)}h=e+(c<<2)|0;g=e+(g<<2)|0;d=g;c=b;while(1){o[d>>2]=o[2631];d=d+4|0;c=c+ -1|0;if(c){continue}break}b=g+(b<<2)|0;if((i|0)>=1){ll(e,f,i)}o[a+8>>2]=h;o[a+4>>2]=b;o[a>>2]=e;if(f){jl(f)}return}Nk();D()}db(10528);D()}function tf(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,i=v(0),j=0;d=R-32|0;R=d;f=m[o[a+8>>2]+24|0];c=o[a+16>>2];if(o[c+80>>2]){g=o[o[c>>2]>>2]+o[c+48>>2]|0}o[d+8>>2]=-1;o[d+12>>2]=-1;o[d>>2]=-1;o[d+4>>2]=-1;a:{c=o[a+24>>2];if(c+ -2>>>0>28){break a}o[d>>2]=c;c=-1<>2]=e;o[d+4>>2]=c^-1;o[d+12>>2]=(e|0)/2;if(!b){e=1;break a}h=f<<2;c=0;f=0;while(1){i=v(v(1)/v(e|0));e=c<<2;uf(v(i*v(o[e+g>>2])),v(i*v(o[(e|4)+g>>2])),d+20|0);ll(o[o[o[a+8>>2]+64>>2]>>2]+f|0,d+20|0,h);e=1;j=j+1|0;if((j|0)==(b|0)){break a}c=c+2|0;f=f+h|0;e=o[d+8>>2];continue}}R=d+32|0;return e|0}function qi(a,b,c,d){var e=0,f=0,g=0;a:{if(!b){b=c;d=b>>>0<0?d+1|0:d;if((d|0)<0?1:(d|0)<=0?b>>>0>=0?0:1:0){return 0}d=o[a>>2];c=o[a+4>>2]-d|0;if(c>>>0>>0){Ka(a,b-c|0);break a}if(c>>>0<=b>>>0){break a}o[a+4>>2]=b+d;break a}if((d|0)<0?1:(d|0)<=0?c>>>0>=0?0:1:0){return 0}f=c;if(c>>>0<0){d=d+1|0}g=o[a>>2];e=o[a+4>>2]-g|0;b:{if((d|0)<0?1:(d|0)<=0?f>>>0>e>>>0?0:1:0){break b}d=f;if(e>>>0>>0){Ka(a,d-e|0);break b}if(e>>>0<=d>>>0){break b}o[a+4>>2]=d+g}if(!c){break a}nl(o[a>>2],b,c)}b=a+24|0;c=b;d=b;a=o[b+4>>2];b=o[b>>2]+1|0;if(b>>>0<1){a=a+1|0}o[d>>2]=b;o[c+4>>2]=a;return 1}function vf(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0;e=R-32|0;R=e;a:{if((d|0)==3){d=o[b+4>>2];b=o[b+12>>2];o[e+24>>2]=-1;o[e+28>>2]=-1;o[e+16>>2]=-1;o[e+20>>2]=-1;if((c|0)==-2){o[e+8>>2]=0;o[a>>2]=0;break a}f=o[o[o[d+4>>2]+8>>2]+(b<<2)>>2];if((l[o[o[d>>2]+8>>2]](d)|0)==1){g=b;b=q[d+36>>1];wf(e+8|0,d,c,g,e+16|0,(b<<24|b<<8&16711680)>>>16|0);b=o[e+8>>2];if(b){o[a>>2]=b;break a}o[e+8>>2]=0}b=yk(24);o[b+4>>2]=f;c=o[e+20>>2];o[b+8>>2]=o[e+16>>2];o[b+12>>2]=c;c=o[e+28>>2];o[b+16>>2]=o[e+24>>2];o[b+20>>2]=c;o[b>>2]=7536;o[e+8>>2]=b;o[a>>2]=b;break a}o[a>>2]=0}R=e+32|0}function Ti(a,b){var c=0,d=0,e=0,f=0,g=0,h=0,i=0;d=o[a+8>>2];e=o[a+4>>2];if(d-e>>2>>>0>=b>>>0){d=e;c=b;while(1){o[d>>2]=1;d=d+4|0;c=c+ -1|0;if(c){continue}break}o[a+4>>2]=e+(b<<2);return}f=o[a>>2];i=e-f|0;g=i>>2;c=g+b|0;a:{if(c>>>0<1073741824){d=d-f|0;h=d>>1;c=d>>2>>>0<536870911?h>>>0>>0?c:h:1073741823;e=0;b:{if(!c){break b}if(c>>>0>=1073741824){break a}e=yk(c<<2)}h=e+(c<<2)|0;g=e+(g<<2)|0;d=g;c=b;while(1){o[d>>2]=1;d=d+4|0;c=c+ -1|0;if(c){continue}break}b=g+(b<<2)|0;if((i|0)>=1){ll(e,f,i)}o[a+8>>2]=h;o[a+4>>2]=b;o[a>>2]=e;if(f){jl(f)}return}Nk();D()}db(10648);D()}function cg(a,b,c){var d=0,e=0,f=0,g=0,h=0,i=0,j=0;f=a+4|0;a:{a=o[a+4>>2];if(a){e=p[c+11|0];d=e<<24>>24<0;i=d?o[c>>2]:c;e=d?o[c+4>>2]:e;while(1){c=p[a+27|0];d=c<<24>>24<0;c=d?o[a+20>>2]:c;j=c>>>0>>0;b:{c:{d:{e:{f:{h=j?c:e;g:{if(h){g=a+16|0;d=d?o[g>>2]:g;g=Vj(i,d,h);if(!g){if(e>>>0>>0){break g}break f}if((g|0)>-1){break f}break g}if(e>>>0>=c>>>0){break e}}c=o[a>>2];if(c){break b}o[b>>2]=a;return a}c=Vj(d,i,h);if(c){break d}}if(j){break c}break a}if((c|0)>-1){break a}}f=a+4|0;c=o[a+4>>2];if(!c){break a}a=f}f=a;a=c;continue}}o[b>>2]=f;return f}o[b>>2]=a;return f}function vd(a,b){var c=0;c=o[b+4>>2];o[a>>2]=o[b>>2];o[a+4>>2]=c;c=o[b+60>>2];o[a+56>>2]=o[b+56>>2];o[a+60>>2]=c;c=o[b+52>>2];o[a+48>>2]=o[b+48>>2];o[a+52>>2]=c;c=o[b+44>>2];o[a+40>>2]=o[b+40>>2];o[a+44>>2]=c;c=o[b+36>>2];o[a+32>>2]=o[b+32>>2];o[a+36>>2]=c;c=o[b+28>>2];o[a+24>>2]=o[b+24>>2];o[a+28>>2]=c;c=o[b+20>>2];o[a+16>>2]=o[b+16>>2];o[a+20>>2]=c;c=o[b+12>>2];o[a+8>>2]=o[b+8>>2];o[a+12>>2]=c;o[a+88>>2]=0;o[a+64>>2]=0;o[a+68>>2]=0;o[a+72>>2]=0;o[a+76>>2]=0;m[a+77|0]=0;m[a+78|0]=0;m[a+79|0]=0;m[a+80|0]=0;m[a+81|0]=0;m[a+82|0]=0;m[a+83|0]=0;m[a+84|0]=0;return a}function Ai(a,b){var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0;g=a+4|0;a=o[a+4>>2];a:{b:{if(!a){break b}d=p[b+11|0];c=d<<24>>24<0;i=c?o[b>>2]:b;e=c?o[b+4>>2]:d;c=g;while(1){b=p[a+27|0];j=b<<24>>24<0;h=j?o[a+20>>2]:b;f=e>>>0>>0;d=f?e:h;c:{if(d){b=a+16|0;b=Vj(j?o[b>>2]:b,i,d);if(b){break c}}b=h>>>0>>0?-1:f}c=(b|0)<0?c:a;a=o[(b>>>29&4)+a>>2];if(a){continue}break}if((c|0)==(g|0)){break b}a=p[c+27|0];f=a<<24>>24<0;d:{d=f?o[c+20>>2]:a;b=d>>>0>>0?d:e;if(b){a=c+16|0;a=Vj(i,f?o[a>>2]:a,b);if(a){break d}}if(e>>>0>>0){break b}break a}if((a|0)>-1){break a}}c=g}return c}function ij(a,b,c,d){var e=0,f=0,g=0,h=0,i=0,j=0,k=0;g=R-16|0;R=g;j=a;h=cg(b,g+12|0,c);c=o[h>>2];if(c){b=0}else{c=yk(40);e=d+8|0;o[c+24>>2]=o[e>>2];f=o[d+4>>2];o[c+16>>2]=o[d>>2];o[c+20>>2]=f;o[d>>2]=0;o[d+4>>2]=0;o[e>>2]=0;o[c+36>>2]=0;o[c+28>>2]=0;o[c+32>>2]=0;f=o[d+16>>2];e=o[d+12>>2];i=f-e|0;if(i){e=c+28|0;Ka(e,i);f=o[d+16>>2];k=o[e>>2];e=o[d+12>>2]}ll(k,e,f-e|0);o[c+8>>2]=o[g+12>>2];o[c>>2]=0;o[c+4>>2]=0;o[h>>2]=c;e=o[o[b>>2]>>2];d=c;a:{if(!e){break a}o[b>>2]=e;d=o[h>>2]}ag(o[b+4>>2],d);o[b+8>>2]=o[b+8>>2]+1;b=1}m[j+4|0]=b;o[a>>2]=c;R=g+16|0}function xa(a,b){var c=0,d=0;c=R-96|0;R=c;ml(c+16|0,0,76);o[c+92>>2]=-1;o[c+8>>2]=0;o[c>>2]=0;o[c+4>>2]=0;a:{if(ya(c+16|0,a,c)){a=o[b>>2];if(a){o[b+4>>2]=a;jl(a);o[b+8>>2]=0;o[b>>2]=0;o[b+4>>2]=0}o[b>>2]=o[c>>2];o[b+4>>2]=o[c+4>>2];o[b+8>>2]=o[c+8>>2];o[c+8>>2]=0;o[c>>2]=0;o[c+4>>2]=0;d=o[c+84>>2];break a}a=o[c>>2];if(!a){break a}o[c+4>>2]=a;jl(a)}a=o[c+72>>2];if(a){jl(a)}a=o[c+48>>2];if(a){o[c+52>>2]=a;jl(a)}a=o[c+36>>2];if(a){o[c+40>>2]=a;jl(a)}a=o[c+24>>2];if(a){o[c+28>>2]=a;jl(a)}a=o[c+20>>2];o[c+20>>2]=0;if(a){za(c+16|4,a)}R=c+96|0;return d}function Fj(a){var b=0,c=0,d=0,e=0;b=R-208|0;R=b;o[b+204>>2]=0;ml(b+160|0,0,40);o[b+200>>2]=o[b+204>>2];a:{if((Gj(0,b+200|0,b+80|0,b+160|0)|0)<0){break a}d=o[a+76>>2]>=0?1:d;c=o[a>>2];if(m[a+74|0]<=0){o[a>>2]=c&-33}e=c&32;b:{if(o[a+48>>2]){Gj(a,b+200|0,b+80|0,b+160|0);break b}o[a+48>>2]=80;o[a+16>>2]=b+80;o[a+28>>2]=b;o[a+20>>2]=b;c=o[a+44>>2];o[a+44>>2]=b;Gj(a,b+200|0,b+80|0,b+160|0);if(!c){break b}l[o[a+36>>2]](a,0,0)|0;o[a+48>>2]=0;o[a+44>>2]=c;o[a+28>>2]=0;o[a+16>>2]=0;o[a+20>>2]=0}o[a>>2]=e|o[a>>2];if(!d){break a}}R=b+208|0}function dj(a,b,c){var d=0,e=0,f=0;e=R-16|0;R=e;a:{b:{if(!c){break b}o[a>>2]=b;o[e+12>>2]=0;d=0;if(!bj(1,e+12|0,b)){break a}c:{f=o[e+12>>2];if(f){b=0;while(1){if(!bj(1,e+8|0,o[a>>2])){break b}d=yk(28);o[d+4>>2]=0;o[d+8>>2]=0;o[d+16>>2]=0;o[d+20>>2]=0;o[d>>2]=d+4;o[d+12>>2]=d+16;o[d+24>>2]=o[e+8>>2];if(!aj(a,d)){break c}o[e>>2]=d;fj(c,e);d=o[e>>2];o[e>>2]=0;if(d){Kc(d+12|0,o[d+16>>2]);Lc(d,o[d+4>>2]);jl(d)}b=b+1|0;if((f|0)!=(b|0)){continue}break}}d=aj(a,c);break a}Kc(d+12|0,o[d+16>>2]);Lc(d,o[d+4>>2]);jl(d)}d=0}R=e+16|0;return d}function ua(a,b){var c=0,d=0,e=0,f=0;c=R-32|0;R=c;o[c+24>>2]=0;o[c+16>>2]=0;o[c+20>>2]=0;d=rl(b);if(d>>>0<4294967280){a:{b:{if(d>>>0>=11){f=d+16&-16;e=yk(f);o[c+24>>2]=f|-2147483648;o[c+16>>2]=e;o[c+20>>2]=d;break b}m[c+27|0]=d;e=c+16|0;if(!d){break a}}ll(e,b,d)}m[d+e|0]=0;o[c+8>>2]=0;o[c>>2]=0;o[c+4>>2]=0;m[c+11|0]=4;m[c+4|0]=0;o[c>>2]=1701667182;d=o[a+4>>2];b=-1;c:{if(!d){break c}d=ej(d,c,c+16|0);b=-1;if(!d){break c}b=uj(a,o[d+24>>2])}if(m[c+11|0]<=-1){jl(o[c>>2])}if(m[c+27|0]<=-1){jl(o[c+16>>2])}R=c+32|0;return b}Ak();D()}function rg(a,b){var c=0,d=0,e=0,f=0,g=0,h=0,i=0;a:{b:{d=o[a+8>>2];c=o[a+4>>2];c:{if(d-c>>3>>>0>=b>>>0){while(1){o[c>>2]=0;o[c+4>>2]=0;c=o[a+4>>2]+8|0;o[a+4>>2]=c;b=b+ -1|0;if(b){continue}break c}}f=o[a>>2];h=c-f|0;g=h>>3;e=g+b|0;if(e>>>0>=536870912){break b}c=0;g=g<<3;d=d-f|0;i=d>>2;d=d>>3>>>0<268435455?i>>>0>>0?e:i:536870911;if(d){if(d>>>0>=536870912){break a}c=yk(d<<3)}ml(c+g|0,0,b<<3);b=(e<<3)+c|0;e=(d<<3)+c|0;if((h|0)>=1){ll(c,f,h)}o[a+8>>2]=e;o[a+4>>2]=b;o[a>>2]=c;if(!f){break c}jl(f)}return}Nk();D()}db(7946);D()}function re(a,b,c,d,e,f){var g=0,h=0,i=0;f=R-32|0;R=f;h=o[o[o[b+4>>2]+8>>2]+(d<<2)>>2];a:{b:{if((l[o[o[b>>2]+8>>2]](b)|0)!=1|c+ -1>>>0>5){break b}i=l[o[o[b>>2]+36>>2]](b)|0;g=l[o[o[b>>2]+44>>2]](b,d)|0;if(!(g?i:0)){o[a>>2]=0;break a}d=l[o[o[b>>2]+40>>2]](b,d)|0;if(d){b=o[b+44>>2];o[f+12>>2]=d;o[f+8>>2]=b;o[f+20>>2]=g;o[f+16>>2]=g+12;se(a,c,h,e,f+8|0);if(o[a>>2]){break a}o[a>>2]=0;break b}b=o[b+44>>2];o[f+12>>2]=i;o[f+8>>2]=b;o[f+20>>2]=g;o[f+16>>2]=g+12;te(a,c,h,e,f+8|0);if(o[a>>2]){break a}o[a>>2]=0}o[a>>2]=0}R=f+32|0}function Wf(a,b){var c=0,d=0,e=0;c=R-80|0;R=c;d=o[b+36>>2];o[c+72>>2]=o[b+32>>2];o[c+76>>2]=d;e=o[b+28>>2];d=c- -64|0;o[d>>2]=o[b+24>>2];o[d+4>>2]=e;d=o[b+20>>2];o[c+56>>2]=o[b+16>>2];o[c+60>>2]=d;d=o[b+12>>2];o[c+48>>2]=o[b+8>>2];o[c+52>>2]=d;d=o[b+4>>2];o[c+40>>2]=o[b>>2];o[c+44>>2]=d;gi(c+8|0,c+40|0,c+24|0);b=o[c+8>>2];a:{if(b){o[a>>2]=b;Bk(a+4|0,c+8|4);if(m[c+23|0]>-1){break a}jl(o[c+12>>2]);break a}if(m[c+23|0]<=-1){jl(o[c+12>>2])}b=p[c+31|0];o[a>>2]=0;o[a+4>>2]=0;o[a+16>>2]=b;o[a+8>>2]=0;o[a+12>>2]=0}R=c+80|0}function _k(a){var b=0,c=0,d=0,e=0;b=R+ -64|0;R=b;d=o[a>>2];c=o[d+ -4>>2];d=o[d+ -8>>2];o[b+20>>2]=0;o[b+16>>2]=12680;o[b+12>>2]=a;o[b+8>>2]=12728;ml(b+24|0,0,39);a=a+d|0;a:{if(Yk(c,12728,0)){o[b+56>>2]=1;l[o[o[c>>2]+20>>2]](c,b+8|0,a,a,1,0);e=o[b+32>>2]==1?a:0;break a}l[o[o[c>>2]+24>>2]](c,b+8|0,a,1,0);a=o[b+44>>2];if(a>>>0>1){break a}if(a-1){e=o[b+48>>2]==1?o[b+36>>2]==1?o[b+40>>2]==1?o[b+28>>2]:0:0:0;break a}if(o[b+32>>2]!=1){if(o[b+48>>2]|o[b+36>>2]!=1|o[b+40>>2]!=1){break a}}e=o[b+24>>2]}R=b- -64|0;return e}function zj(a,b){var c=0,d=0,e=0,f=0;a:{if((b|0)<0){break a}c=o[a+28>>2];e=o[a+24>>2];while(1){d=e;if((c|0)==(d|0)){break a}e=d+4|0;if(o[o[d>>2]+24>>2]!=(b|0)){continue}break}b:{if((c|0)!=(e|0)){while(1){b=o[e>>2];o[e>>2]=0;f=o[d>>2];o[d>>2]=b;if(f){Kc(f+12|0,o[f+16>>2]);Lc(f,o[f+4>>2]);jl(f)}d=d+4|0;e=e+4|0;if((c|0)!=(e|0)){continue}break}c=o[a+28>>2];if((c|0)==(d|0)){break b}}while(1){c=c+ -4|0;b=o[c>>2];o[c>>2]=0;if(b){Kc(b+12|0,o[b+16>>2]);Lc(b,o[b+4>>2]);jl(b)}if((d|0)!=(c|0)){continue}break}}o[a+28>>2]=d}}function zi(a,b){var c=0,d=0,e=0,f=0;d=R-16|0;R=d;Lk(d);e=cg(a,d+12|0,b);c=o[e>>2];if(!c){c=yk(40);Bk(c+16|0,b);o[c+36>>2]=0;o[c+28>>2]=0;o[c+32>>2]=0;o[c+8>>2]=o[d+12>>2];o[c>>2]=0;o[c+4>>2]=0;o[e>>2]=c;b=o[o[a>>2]>>2];f=c;a:{if(!b){break a}o[a>>2]=b;f=o[e>>2]}b=f;ag(o[a+4>>2],b);o[a+8>>2]=o[a+8>>2]+1}a=c+28|0;b:{if(m[c+39|0]>=0){m[a+11|0]=0;m[a|0]=0;break b}m[o[c+28>>2]]=0;o[c+32>>2]=0;if(m[c+39|0]>-1){break b}jl(o[c+28>>2]);o[c+36>>2]=0}b=o[d+4>>2];o[a>>2]=o[d>>2];o[a+4>>2]=b;o[a+8>>2]=o[d+8>>2];R=d+16|0}function Yd(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0;c=o[a+60>>2];a:{if(!c){break a}o[c+4>>2]=a+48;if(!l[o[o[c>>2]+12>>2]](c)){break a}b:{d=l[o[o[a>>2]+24>>2]](a)|0;if((d|0)<1){break b}c=0;while(1){c:{f=o[(l[o[o[a>>2]+28>>2]](a)|0)+4>>2];g=l[o[o[a>>2]+20>>2]](a,c)|0;e=o[a+60>>2];if(!l[o[o[e>>2]+8>>2]](e,o[o[f+8>>2]+(g<<2)>>2])){break c}c=c+1|0;if((d|0)!=(c|0)){continue}break b}break}return 0}if(!l[o[o[a>>2]+36>>2]](a,b)){break a}if(!l[o[o[a>>2]+40>>2]](a,b)){break a}h=l[o[o[a>>2]+44>>2]](a)|0}return h|0}function el(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;if(Yk(a,o[b+8>>2],e)){dl(b,c,d);return}a:{if(Yk(a,o[b>>2],e)){if(!(o[b+20>>2]!=(c|0)?o[b+16>>2]!=(c|0):0)){if((d|0)!=1){break a}o[b+32>>2]=1;return}o[b+32>>2]=d;b:{if(o[b+44>>2]==4){break b}n[b+52>>1]=0;a=o[a+8>>2];l[o[o[a>>2]+20>>2]](a,b,c,c,1,e);if(p[b+53|0]){o[b+44>>2]=3;if(!p[b+52|0]){break b}break a}o[b+44>>2]=4}o[b+20>>2]=c;o[b+40>>2]=o[b+40>>2]+1;if(o[b+36>>2]!=1|o[b+24>>2]!=2){break a}m[b+54|0]=1;return}a=o[a+8>>2];l[o[o[a>>2]+24>>2]](a,b,c,d,e)}}function Ng(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0;c=o[a+216>>2];if((c|0)!=o[a+220>>2]){while(1){a:{c=o[u(e,144)+c>>2];if((c|0)<0){break a}f=o[a+4>>2];d=o[f+8>>2];if((c|0)>=o[f+12>>2]-d>>2){break a}c=o[d+(c<<2)>>2];if((l[o[o[c>>2]+24>>2]](c)|0)<1){break a}d=0;while(1){if((l[o[o[c>>2]+20>>2]](c,d)|0)!=(b|0)){d=d+1|0;if((d|0)<(l[o[o[c>>2]+24>>2]](c)|0)){continue}break a}break}a=o[a+216>>2]+u(e,144)|0;return(p[a+100|0]?a+4|0:0)|0}e=e+1|0;c=o[a+216>>2];if(e>>>0<(o[a+220>>2]-c|0)/144>>>0){continue}break}}return 0}function Mi(a,b,c){var d=0,e=0,f=0;a:{b:{if((b|c)<0|b>>>0>1431655765){break b}b=u(b,3);Ni(a,b,10520);Ni(a+12|0,b,10524);b=o[a+24>>2];c:{if(o[a+32>>2]-b>>2>>>0>=c>>>0){break c}if(c>>>0>=1073741824){break a}d=o[a+28>>2];e=c<<2;c=yk(e);e=c+e|0;d=d-b|0;f=d+c|0;if((d|0)>=1){ll(c,b,d)}o[a+32>>2]=e;o[a+28>>2]=f;o[a+24>>2]=c;if(!b){break c}jl(b)}o[a+80>>2]=0;o[a+84>>2]=0;c=a+76|0;b=o[c>>2];o[c>>2]=0;if(b){jl(b)}o[a+68>>2]=0;o[a+72>>2]=0;b=a- -64|0;a=o[b>>2];o[b>>2]=0;d=1;if(!a){break b}jl(a)}return d}db(10528);D()}function Yj(a,b,c,d,e,f){var g=0,h=0,i=0,j=0;a:{if(f&64){c=f+ -64|0;b=c&31;if(32<=(c&63)>>>0){c=0;b=e>>>b|0}else{c=e>>>b|0;b=((1<>>b}d=0;e=0;break a}if(!f){break a}h=e;i=d;j=64-f|0;g=j&31;if(32<=(j&63)>>>0){h=i<>>32-g|h<>>0){g=0;b=c>>>b|0}else{g=c>>>b|0;b=((1<>>b}b=j|b;c=g|h;g=d;d=f&31;if(32<=(f&63)>>>0){h=0;d=e>>>d|0}else{h=e>>>d|0;d=((1<>>d}e=h}o[a>>2]=b;o[a+4>>2]=c;o[a+8>>2]=d;o[a+12>>2]=e}function la(a,b,c){var d=0,e=0,f=0,g=0;d=R-32|0;R=d;o[d+24>>2]=0;o[d+16>>2]=0;o[d+20>>2]=0;e=rl(b);if(e>>>0<4294967280){a:{b:{if(e>>>0>=11){g=e+16&-16;f=yk(g);o[d+24>>2]=g|-2147483648;o[d+16>>2]=f;o[d+20>>2]=e;break b}m[d+27|0]=e;f=d+16|0;if(!e){break a}}ll(f,b,e)}m[e+f|0]=0;o[d+8>>2]=0;o[d>>2]=0;o[d+4>>2]=0;kj(a,d+16|0,d);a=o[c>>2];if(a){o[c+4>>2]=a;jl(a);o[c+8>>2]=0;o[c>>2]=0;o[c+4>>2]=0}o[c>>2]=o[d>>2];o[c+4>>2]=o[d+4>>2];o[c+8>>2]=o[d+8>>2];if(m[d+27|0]<=-1){jl(o[d+16>>2])}R=d+32|0;return}Ak();D()}function fb(a,b){var c=0,d=0;c=R-32|0;R=c;a:{b:{if(o[a+8>>2]<<5>>>0>=b>>>0){break b}o[c+24>>2]=0;o[c+16>>2]=0;o[c+20>>2]=0;if((b|0)<=-1){break a}b=(b+ -1>>>5|0)+1|0;d=yk(b<<2);o[c+24>>2]=b;o[c+20>>2]=0;o[c+16>>2]=d;b=o[a>>2];o[c+12>>2]=0;o[c+8>>2]=b;d=o[a+4>>2];o[c+4>>2]=d&31;o[c>>2]=b+(d>>>3&536870908);gb(c+16|0,c+8|0,c);b=o[a>>2];o[a>>2]=o[c+16>>2];o[c+16>>2]=b;d=o[a+4>>2];o[a+4>>2]=o[c+20>>2];o[c+20>>2]=d;d=o[a+8>>2];o[a+8>>2]=o[c+24>>2];o[c+24>>2]=d;if(!b){break b}jl(b)}R=c+32|0;return}Nk();D()}function Og(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0;c=o[a+216>>2];if((c|0)!=o[a+220>>2]){while(1){a:{c=o[u(e,144)+c>>2];if((c|0)<0){break a}f=o[a+4>>2];d=o[f+8>>2];if((c|0)>=o[f+12>>2]-d>>2){break a}c=o[d+(c<<2)>>2];if((l[o[o[c>>2]+24>>2]](c)|0)<1){break a}d=0;while(1){if((l[o[o[c>>2]+20>>2]](c,d)|0)!=(b|0)){d=d+1|0;if((d|0)<(l[o[o[c>>2]+24>>2]](c)|0)){continue}break a}break}return(o[a+216>>2]+u(e,144)|0)+104|0}e=e+1|0;c=o[a+216>>2];if(e>>>0<(o[a+220>>2]-c|0)/144>>>0){continue}break}}return a+184|0}function Sd(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;d=o[b>>2];e=o[b+4>>2];b=o[o[a+8>>2]+40>>2];f=b;g=yk((b|0)>-1?b:-1);d=e-d|0;if((d|0)>=1){d=d>>2;m=(d|0)>1?d:1;while(1){i=o[c+12>>2];d=n+o[c+20>>2]|0;j=o[c+16>>2];h=b+j|0;if(h>>>0>>0){d=d+1|0}e=d;if((i|0)<(d|0)?1:(i|0)<=(d|0)?r[c+8>>2]>=h>>>0?0:1:0){jl(g);return 0}d=ll(g,j+o[c>>2]|0,f);o[c+16>>2]=h;o[c+20>>2]=e;ll(o[o[o[a+8>>2]+64>>2]>>2]+k|0,d,f);k=f+k|0;l=l+1|0;if((m|0)!=(l|0)){continue}break}}jl(g);return 1}function Xj(a,b,c,d,e,f){var g=0,h=0,i=0,j=0;a:{if(f&64){d=b;e=f+ -64|0;b=e&31;if(32<=(e&63)>>>0){e=d<>>32-b|c<>>0){h=g<>>32-d|e<>>0){f=0;d=d>>>e|0}else{f=d>>>e|0;d=((1<>>e}d=j|d;e=f|h;f=b;b=i&31;if(32<=(i&63)>>>0){h=f<>>32-b|c<>2]=b;o[a+4>>2]=c;o[a+8>>2]=d;o[a+12>>2]=e}function nj(a,b,c){var d=0,e=0,f=0,g=0;d=R-48|0;R=d;f=Ai(a,b);if((f|0)!=(a+4|0)){hj(a,f)}f=0;o[d+8>>2]=0;o[d>>2]=0;o[d+4>>2]=0;g=o[c>>2];e=o[c+4>>2]-g|0;if(e){Ka(d,e);g=o[c>>2];c=o[d>>2]}else{c=0}ll(c,g,e);g=Bk(d+16|0,b);o[d+36>>2]=0;o[d+28>>2]=0;o[d+32>>2]=0;b=o[d+4>>2];c=o[d>>2];e=b-c|0;if(e){Ka(d+28|0,e);c=o[d>>2];f=o[d+28>>2];b=o[d+4>>2]}ll(f,c,b-c|0);ij(d+40|0,a,g,d+16|0);a=o[d+28>>2];if(a){o[d+32>>2]=a;jl(a)}if(m[d+27|0]<=-1){jl(o[d+16>>2])}a=o[d>>2];if(a){o[d+4>>2]=a;jl(a)}R=d+48|0}function Qd(a){var b=0,c=0,d=0,e=0,f=0;b=o[a+8>>2];a:{if(p[b+84|0]){break a}c=o[a+16>>2];if(!c|!p[c+84|0]){break a}d=o[b+72>>2];e=o[b+68>>2];m[c+84|0]=0;d=d-e>>2;f=o[c+68>>2];e=o[c+72>>2]-f>>2;b:{if(d>>>0>e>>>0){pd(c+68|0,d-e|0,1680);b=o[a+8>>2];break b}if(d>>>0>=e>>>0){break b}o[c+72>>2]=f+(d<<2)}if(p[b+84|0]){break a}c=o[b+68>>2];b=o[b+72>>2]-c|0;if(!b){break a}d=b>>2;e=o[o[a+16>>2]+68>>2];b=0;while(1){f=b<<2;o[f+e>>2]=o[c+f>>2];b=b+1|0;if(b>>>0>>0){continue}break}}return o[a+16>>2]}function Fa(a,b,c){var d=0,e=0,f=0,g=0;d=R-32|0;R=d;e=m[a+24|0];f=o[259];o[d+24>>2]=o[258];o[d+28>>2]=f;f=o[257];o[d+16>>2]=o[256];o[d+20>>2]=f;a:{if(Ga(a,b,e,d+16|0)){a=0;o[d+8>>2]=0;o[d>>2]=0;o[d+4>>2]=0;b=0;if(e){if((e|0)<=-1){break a}b=e<<2;g=yk(b);o[d>>2]=g;a=(e<<2)+g|0;o[d+8>>2]=a;ll(g,d+16|0,b);o[d+4>>2]=a;b=a}e=c;f=o[c>>2];if(f){o[c+4>>2]=f;jl(f);o[c+8>>2]=0;o[c>>2]=0;o[c+4>>2]=0;b=o[d+4>>2];g=o[d>>2];a=o[d+8>>2]}o[e+8>>2]=a;o[c+4>>2]=b;o[c>>2]=g;g=1}R=d+32|0;return g}Nk();D()}function $g(a){var b=0,c=0,d=0,e=0;c=1;d=o[a+140>>2];a:{if((d|0)<1){break a}b=d<<4;c=yk((d|0)!=(d&268435455)?-1:b|4);o[c>>2]=d;c=c+4|0;d=c+b|0;b=c;while(1){b=Rf(b)+16|0;if((d|0)!=(b|0)){continue}break}e=o[a+136>>2];o[a+136>>2]=c;if(e){d=e+ -4|0;c=o[d>>2];if(c){b=e+(c<<4)|0;while(1){b=b+ -16|0;if((e|0)!=(b|0)){continue}break}}jl(d)}c=1;if(o[a+140>>2]<1){break a}c=0;b=0;while(1){if(!Sf(o[a+136>>2]+(b<<4)|0,a)){break a}b=b+1|0;if((b|0)>2]){continue}break}c=1}return c}function Qi(a){a=a|0;var b=0,c=0,d=0,e=0;o[a>>2]=11e3;b=o[a+68>>2];if(b){o[a+72>>2]=b;jl(b)}b=o[a+56>>2];if(b){o[a+60>>2]=b;jl(b)}b=o[a+44>>2];if(b){o[a+48>>2]=b;jl(b)}b=o[a+32>>2];if(b){o[a+36>>2]=b;jl(b)}b=o[a+20>>2];if(b){o[a+24>>2]=b;jl(b)}d=o[a+8>>2];if(d){b=d;c=o[a+12>>2];e=b;a:{if((b|0)==(c|0)){break a}while(1){c=c+ -4|0;b=o[c>>2];o[c>>2]=0;if(b){Kb(b)}if((c|0)!=(d|0)){continue}break}e=o[a+8>>2]}b=e;o[a+12>>2]=d;jl(b)}b=o[a+4>>2];o[a+4>>2]=0;if(b){ii(b)}return a|0}function Fi(a,b){var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;e=o[a+8>>2];d=o[a+4>>2];if(e-d>>2>>>0>=b>>>0){c=a;a=b<<2;j=c,k=ml(d,0,a)+a|0,o[j+4>>2]=k;return}f=o[a>>2];h=d-f|0;g=h>>2;c=g+b|0;a:{if(c>>>0<1073741824){d=0;g=g<<2;e=e-f|0;i=e>>1;c=e>>2>>>0<536870911?i>>>0>>0?c:i:1073741823;if(c){if(c>>>0>=1073741824){break a}d=yk(c<<2)}b=b<<2;b=ml(d+g|0,0,b)+b|0;c=(c<<2)+d|0;if((h|0)>=1){ll(d,f,h)}o[a+8>>2]=c;o[a+4>>2]=b;o[a>>2]=d;if(f){jl(f)}return}Nk();D()}db(10528);D()}function ei(a,b){var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;e=o[a+8>>2];d=o[a+4>>2];if(e-d>>2>>>0>=b>>>0){c=a;a=b<<2;j=c,k=ml(d,0,a)+a|0,o[j+4>>2]=k;return}f=o[a>>2];h=d-f|0;g=h>>2;c=g+b|0;a:{if(c>>>0<1073741824){d=0;g=g<<2;e=e-f|0;i=e>>1;c=e>>2>>>0<536870911?i>>>0>>0?c:i:1073741823;if(c){if(c>>>0>=1073741824){break a}d=yk(c<<2)}b=b<<2;b=ml(d+g|0,0,b)+b|0;c=(c<<2)+d|0;if((h|0)>=1){ll(d,f,h)}o[a+8>>2]=c;o[a+4>>2]=b;o[a>>2]=d;if(f){jl(f)}return}Nk();D()}db(9976);D()}function Ia(a,b){var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;e=o[a+8>>2];d=o[a+4>>2];if(e-d>>2>>>0>=b>>>0){c=a;a=b<<2;j=c,k=ml(d,0,a)+a|0,o[j+4>>2]=k;return}f=o[a>>2];h=d-f|0;g=h>>2;c=g+b|0;a:{if(c>>>0<1073741824){d=0;g=g<<2;e=e-f|0;i=e>>1;c=e>>2>>>0<536870911?i>>>0>>0?c:i:1073741823;if(c){if(c>>>0>=1073741824){break a}d=yk(c<<2)}b=b<<2;b=ml(d+g|0,0,b)+b|0;c=(c<<2)+d|0;if((h|0)>=1){ll(d,f,h)}o[a+8>>2]=c;o[a+4>>2]=b;o[a>>2]=d;if(f){jl(f)}return}Nk();D()}db(1040);D()}function Ba(a,b){var c=0,d=0,e=0,f=0,g=0,h=0;e=o[a>>2];a=o[e+4>>2];d=o[e+8>>2];if(a>>>0>>0){o[a>>2]=o[b>>2];o[e+4>>2]=a+4;return}f=o[e>>2];g=a-f|0;a=g>>2;c=a+1|0;a:{if(c>>>0<1073741824){h=a<<2;d=d-f|0;a=d>>1;c=d>>2>>>0<536870911?a>>>0>>0?c:a:1073741823;a=0;b:{if(!c){break b}if(c>>>0>=1073741824){break a}a=yk(c<<2)}d=h+a|0;o[d>>2]=o[b>>2];b=a+(c<<2)|0;c=d+4|0;if((g|0)>=1){ll(a,f,g)}o[e+8>>2]=b;o[e+4>>2]=c;o[e>>2]=a;if(f){jl(f)}return}Nk();D()}db(1040);D()}function ja(a,b){var c=0,d=0,e=0,f=0,g=0,h=0;a=o[a+4>>2];if(a){c=p[b+11|0];d=c<<24>>24<0;g=d?o[b>>2]:b;b=d?o[b+4>>2]:c;while(1){c=p[a+27|0];d=c<<24>>24<0;c=d?o[a+20>>2]:c;h=c>>>0>>0;a:{b:{f=h?c:b;c:{if(f){e=a+16|0;d=d?o[e>>2]:e;e=Vj(g,d,f);d:{if(!e){if(b>>>0>=c>>>0){break d}break a}if((e|0)<=-1){break a}}c=Vj(d,g,f);if(!c){break c}if((c|0)<=-1){break b}return 1}if(b>>>0>>0){break a}}if(h){break b}return 1}a=a+4|0}a=o[a>>2];if(a){continue}break}}return 0}function Li(a,b){var c=0,d=0,e=0,f=0,g=0,h=0;c=o[a+4>>2];e=o[a+8>>2];if((c|0)!=(e|0)){o[c>>2]=o[b>>2];o[a+4>>2]=c+4;return}f=o[a>>2];g=c-f|0;c=g>>2;d=c+1|0;a:{if(d>>>0<1073741824){h=c<<2;e=e-f|0;c=e>>1;d=e>>2>>>0<536870911?c>>>0>>0?d:c:1073741823;c=0;b:{if(!d){break b}if(d>>>0>=1073741824){break a}c=yk(d<<2)}e=h+c|0;o[e>>2]=o[b>>2];b=c+(d<<2)|0;d=e+4|0;if((g|0)>=1){ll(c,f,g)}o[a+8>>2]=b;o[a+4>>2]=d;o[a>>2]=c;if(f){jl(f)}return}Nk();D()}db(10528);D()}function eh(a,b){var c=0,d=0,e=0,f=0,g=0,h=0;c=o[a+4>>2];e=o[a+8>>2];if((c|0)!=(e|0)){o[c>>2]=o[b>>2];o[a+4>>2]=c+4;return}f=o[a>>2];g=c-f|0;c=g>>2;d=c+1|0;a:{if(d>>>0<1073741824){h=c<<2;e=e-f|0;c=e>>1;d=e>>2>>>0<536870911?c>>>0>>0?d:c:1073741823;c=0;b:{if(!d){break b}if(d>>>0>=1073741824){break a}c=yk(d<<2)}e=h+c|0;o[e>>2]=o[b>>2];b=c+(d<<2)|0;d=e+4|0;if((g|0)>=1){ll(c,f,g)}o[a+8>>2]=b;o[a+4>>2]=d;o[a>>2]=c;if(f){jl(f)}return}Nk();D()}db(8832);D()}function Fh(a,b){var c=0,d=0,e=0,f=0,g=0,h=0;e=o[a+4>>2];a=o[e+4>>2];d=o[e+8>>2];if((a|0)!=(d|0)){o[a>>2]=b;o[e+4>>2]=a+4;return}f=o[e>>2];g=a-f|0;a=g>>2;c=a+1|0;a:{if(c>>>0<1073741824){h=a<<2;d=d-f|0;a=d>>1;c=d>>2>>>0<536870911?a>>>0>>0?c:a:1073741823;a=0;b:{if(!c){break b}if(c>>>0>=1073741824){break a}a=yk(c<<2)}d=h+a|0;o[d>>2]=b;b=a+(c<<2)|0;c=d+4|0;if((g|0)>=1){ll(a,f,g)}o[e+8>>2]=b;o[e+4>>2]=c;o[e>>2]=a;if(f){jl(f)}return}Nk();D()}db(8832);D()}function oj(a,b,c){var d=0,e=0,f=0,g=0,h=0;e=R-16|0;R=e;f=a+12|0;a:{if((Ai(f,b)|0)!=(a+16|0)){break a}g=cg(f,e+12|0,b);d=o[g>>2];if(!d){d=yk(32);Bk(d+16|0,b);o[d+28>>2]=0;o[d+8>>2]=o[e+12>>2];o[d>>2]=0;o[d+4>>2]=0;o[g>>2]=d;b=o[o[f>>2]>>2];h=d;b:{if(!b){break b}o[f>>2]=b;h=o[g>>2]}b=h;ag(o[a+16>>2],b);a=a+20|0;o[a>>2]=o[a>>2]+1}b=o[c>>2];o[c>>2]=0;c=d+28|0;a=o[c>>2];o[c>>2]=b;if(!a){break a}Kc(a+12|0,o[a+16>>2]);Lc(a,o[a+4>>2]);jl(a)}R=e+16|0}function be(a){a=a|0;var b=0,c=0,d=0,e=0;o[a>>2]=1692;b=o[a+60>>2];o[a+60>>2]=0;if(b){l[o[o[b>>2]+4>>2]](b)}b=o[a+48>>2];if(b){o[a+52>>2]=b;jl(b)}d=o[a+36>>2];if(d){b=d;c=o[a+40>>2];e=b;a:{if((b|0)==(c|0)){break a}while(1){c=c+ -4|0;b=o[c>>2];o[c>>2]=0;if(b){l[o[o[b>>2]+4>>2]](b)}if((c|0)!=(d|0)){continue}break}e=o[a+36>>2]}b=e;o[a+40>>2]=d;jl(b)}o[a>>2]=1384;b=o[a+16>>2];if(b){o[a+20>>2]=b;jl(b)}b=o[a+4>>2];if(b){o[a+8>>2]=b;jl(b)}return a|0}function Cj(a,b){a:{if(a){if(b>>>0<=127){break a}b:{if(!o[o[3298]>>2]){if((b&-128)==57216){break a}break b}if(b>>>0<=2047){m[a+1|0]=b&63|128;m[a|0]=b>>>6|192;return 2}if(!((b&-8192)!=57344?b>>>0>=55296:0)){m[a+2|0]=b&63|128;m[a|0]=b>>>12|224;m[a+1|0]=b>>>6&63|128;return 3}if(b+ -65536>>>0<=1048575){m[a+3|0]=b&63|128;m[a|0]=b>>>18|240;m[a+2|0]=b>>>6&63|128;m[a+1|0]=b>>>12&63|128;return 4}}o[3314]=25;a=-1}else{a=1}return a}m[a|0]=b;return 1}function ce(a){a=a|0;var b=0,c=0,d=0,e=0;o[a>>2]=1692;b=o[a+60>>2];o[a+60>>2]=0;if(b){l[o[o[b>>2]+4>>2]](b)}b=o[a+48>>2];if(b){o[a+52>>2]=b;jl(b)}d=o[a+36>>2];if(d){b=d;c=o[a+40>>2];e=b;a:{if((b|0)==(c|0)){break a}while(1){c=c+ -4|0;b=o[c>>2];o[c>>2]=0;if(b){l[o[o[b>>2]+4>>2]](b)}if((c|0)!=(d|0)){continue}break}e=o[a+36>>2]}b=e;o[a+40>>2]=d;jl(b)}o[a>>2]=1384;b=o[a+16>>2];if(b){o[a+20>>2]=b;jl(b)}b=o[a+4>>2];if(b){o[a+8>>2]=b;jl(b)}jl(a)}function Pa(a,b){var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0;e=o[a+8>>2];d=o[a+4>>2];if(e-d>>1>>>0>=b>>>0){c=a;a=b<<1;i=c,j=ml(d,0,a)+a|0,o[i+4>>2]=j;return}f=o[a>>2];g=d-f|0;h=g>>1;c=h+b|0;a:{if((c|0)>-1){d=0;e=e-f|0;c=e>>1>>>0<1073741823?e>>>0>>0?c:e:2147483647;if(c){if((c|0)<=-1){break a}d=yk(c<<1)}b=b<<1;b=ml((h<<1)+d|0,0,b)+b|0;c=(c<<1)+d|0;if((g|0)>=1){ll(d,f,g)}o[a+8>>2]=c;o[a+4>>2]=b;o[a>>2]=d;if(f){jl(f)}return}Nk();D()}db(1040);D()}function rh(a){var b=0,c=0,d=0,e=0;b=o[a+196>>2];if(b){o[a+200>>2]=b;jl(b)}b=o[a+184>>2];if(b){c=o[a+188>>2];d=b;a:{if((b|0)==(c|0)){break a}while(1){d=c+ -12|0;e=o[d>>2];if(e){o[c+ -8>>2]=e;jl(e)}c=d;if((c|0)!=(b|0)){continue}break}d=o[a+184>>2]}o[a+188>>2]=b;jl(d)}b=o[a+156>>2];if(b){o[a+160>>2]=b;jl(b)}b=o[a+136>>2];o[a+136>>2]=0;if(b){c=b+ -4|0;a=o[c>>2];if(a){a=b+(a<<4)|0;while(1){a=a+ -16|0;if((b|0)!=(a|0)){continue}break}}jl(c)}}function Di(a,b){var c=0,d=0,e=0;d=R-16|0;R=d;e=yk(88);c=e;o[c>>2]=0;o[c+4>>2]=0;o[c+64>>2]=0;o[c+68>>2]=0;o[c+56>>2]=0;o[c+48>>2]=0;o[c+52>>2]=0;o[c+40>>2]=0;o[c+44>>2]=0;o[c+32>>2]=0;o[c+36>>2]=0;o[c+24>>2]=0;o[c+28>>2]=0;o[c+16>>2]=0;o[c+20>>2]=0;o[c+8>>2]=0;o[c+12>>2]=0;o[c+72>>2]=0;o[c+76>>2]=0;o[c+80>>2]=0;o[c+84>>2]=0;o[c+60>>2]=c;o[d+8>>2]=c;a:{if(Ei(c,b)){o[a>>2]=e;o[d+8>>2]=0;break a}o[a>>2]=0;o[d+8>>2]=0;za(d+8|0,e)}R=d+16|0}function Ka(a,b){var c=0,d=0,e=0,f=0,g=0,h=0,i=0;a:{f=o[a+8>>2];d=o[a+4>>2];b:{if(f-d>>>0>=b>>>0){while(1){m[d|0]=0;d=o[a+4>>2]+1|0;o[a+4>>2]=d;b=b+ -1|0;if(b){continue}break b}}e=o[a>>2];h=d-e|0;c=h+b|0;if((c|0)<=-1){break a}f=f-e|0;i=f<<1;c=f>>>0<1073741823?i>>>0>>0?c:i:2147483647;if(c){g=yk(c)}ml(g+h|0,0,b);c=c+g|0;b=((b+d|0)-e|0)+g|0;if((h|0)>=1){ll(g,e,h)}o[a+8>>2]=c;o[a+4>>2]=b;o[a>>2]=g;if(!e){break b}jl(e)}return}Nk();D()}function vi(a,b,c){var d=0,e=0,f=0,g=0,h=0,i=0;a:{if(a>>>0>10){break a}f=o[c+16>>2];d=o[c+12>>2];e=o[c+20>>2];g=e;if((d|0)<(g|0)?1:(d|0)<=(g|0)?r[c+8>>2]>f>>>0?0:1:0){break a}h=m[f+o[c>>2]|0];d=f+1|0;if(d>>>0<1){e=e+1|0}o[c+16>>2]=d;o[c+20>>2]=e;g=b;f=b;d=h;b:{if((d|0)<=-1){if(!vi(a+1|0,b,c)){break a}a=b;c=o[b+4>>2];b=o[b>>2];e=c<<7|b>>>25;b=b<<7;o[a>>2]=b;o[a+4>>2]=e;a=d&127|b;break b}e=0;a=d&255}o[f>>2]=a;o[g+4>>2]=e;i=1}return i}function sg(a,b,c){var d=0,e=0,f=0,g=0,h=0,i=0;a:{if(a>>>0>10){break a}f=o[c+16>>2];d=o[c+12>>2];e=o[c+20>>2];g=e;if((d|0)<(g|0)?1:(d|0)<=(g|0)?r[c+8>>2]>f>>>0?0:1:0){break a}h=m[f+o[c>>2]|0];d=f+1|0;if(d>>>0<1){e=e+1|0}o[c+16>>2]=d;o[c+20>>2]=e;g=b;f=b;d=h;b:{if((d|0)<=-1){if(!sg(a+1|0,b,c)){break a}a=b;c=o[b+4>>2];b=o[b>>2];e=c<<7|b>>>25;b=b<<7;o[a>>2]=b;o[a+4>>2]=e;a=d&127|b;break b}e=0;a=d&255}o[f>>2]=a;o[g+4>>2]=e;i=1}return i}function sd(a,b){var c=0,d=0,e=0;d=o[a>>2];a:{if(!d){break a}c=o[b>>2];if(!c){break a}e=d;d=o[c>>2];pi(e,d,o[c+4>>2]-d|0,0);m[a+24|0]=p[b+24|0];o[a+28>>2]=o[b+28>>2];m[a+32|0]=p[b+32|0];c=o[b+44>>2];o[a+40>>2]=o[b+40>>2];o[a+44>>2]=c;c=o[b+52>>2];o[a+48>>2]=o[b+48>>2];o[a+52>>2]=c;o[a+56>>2]=o[b+56>>2];c=o[b+12>>2];o[a+8>>2]=o[b+8>>2];o[a+12>>2]=c;c=o[b+20>>2];o[a+16>>2]=o[b+16>>2];o[a+20>>2]=c;o[a+60>>2]=o[b+60>>2];e=1}return e}function Uj(a,b){var c=0;c=(b|0)!=0;a:{b:{c:{d:{if(!b|!(a&3)){break d}while(1){if(!p[a|0]){break c}a=a+1|0;b=b+ -1|0;c=(b|0)!=0;if(!b){break d}if(a&3){continue}break}}if(!c){break b}}if(!p[a|0]){break a}e:{if(b>>>0>=4){while(1){c=o[a>>2];if((c^-1)&c+ -16843009&-2139062144){break e}a=a+4|0;b=b+ -4|0;if(b>>>0>3){continue}break}}if(!b){break b}}while(1){if(!p[a|0]){break a}a=a+1|0;b=b+ -1|0;if(b){continue}break}}return 0}return a}function Ki(a,b,c){var d=0,e=0,f=0;o[a+8>>2]=0;o[a>>2]=0;o[a+4>>2]=0;a:{b:{if(!b){break b}if((b|0)<=-1){break a}e=b+ -1>>>5|0;f=e+1|0;d=yk(f<<2);o[a+8>>2]=f;o[a>>2]=d;f=p[c|0];o[a+4>>2]=b;o[(b>>>0<33?d:d+(e<<2)|0)>>2]=0;c=b>>>5|0;e=c<<2;if(f){d=ml(d,255,e);b=b&31;if(!b){break b}c=d+(c<<2)|0;o[c>>2]=o[c>>2]|-1>>>32-b;return a}d=ml(d,0,e);b=b&31;if(!b){break b}c=d+(c<<2)|0;o[c>>2]=o[c>>2]&(-1>>>32-b^-1)}return a}Nk();D()}function Wh(a,b){var c=0,d=0,e=v(0),f=0;c=2;a:{if((b|0)==1){break a}c=b;if(!(b+ -1&b)){break a}c=_j(b)}d=o[a+4>>2];if(c>>>0>d>>>0){Xh(a,c);return}b:{if(c>>>0>=d>>>0){break b}f=d>>>0<3;e=v(B(v(v(r[a+12>>2])/s[a+16>>2])));c:{if(e=v(0)){b=~~e>>>0;break c}b=0}d:{e:{if(f){break e}if(Rl(d)>>>0>1){break e}b=b>>>0<2?b:1<<32-x(b+ -1|0);break d}b=_j(b)}b=c>>>0>>0?b:c;if(b>>>0>=d>>>0){break b}Xh(a,b)}}function sf(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0;d=R-16|0;R=d;a:{b:{if(p[o[a+4>>2]+36|0]<=1){b=o[a+24>>2];break b}g=o[c+16>>2];e=o[c+12>>2];f=o[c+20>>2];b=f;h=0;if((e|0)<(b|0)?1:(e|0)<=(b|0)?r[c+8>>2]>g>>>0?0:1:0){break a}b=p[g+o[c>>2]|0];e=g+1|0;if(e>>>0<1){f=f+1|0}o[c+16>>2]=e;o[c+20>>2]=f;o[a+24>>2]=b}o[d+12>>2]=-1;o[d+8>>2]=1116;o[(d+8|0)+4>>2]=b;h=od(d+8|0,o[a+16>>2])}a=h;R=d+16|0;return a|0}function ne(a,b){var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;c=m[o[a+8>>2]+24|0];e=c+c|0;g=yk(e>>>0>>0?-1:e);d=o[a+16>>2];e=0;a:{if(!o[d+80>>2]){break a}e=o[o[d>>2]>>2]+o[d+48>>2]|0}if(b){h=c<<1;while(1){d=i;f=0;if((c|0)>0){while(1){n[(f<<1)+g>>1]=o[(d<<2)+e>>2];d=d+1|0;f=f+1|0;if((f|0)!=(c|0)){continue}break}i=c+i|0}ll(o[o[o[a+8>>2]+64>>2]>>2]+j|0,g,h);j=h+j|0;k=k+1|0;if((k|0)!=(b|0)){continue}break}}jl(g)}function ma(a,b){var c=0,d=0,e=0,f=0,g=0;c=R-32|0;R=c;o[c+24>>2]=0;o[c+28>>2]=0;o[c+16>>2]=0;o[c+8>>2]=0;o[c+12>>2]=0;d=rl(b);if(d>>>0<4294967280){a:{b:{if(d>>>0>=11){e=d+16&-16;f=yk(e);o[c+16>>2]=e|-2147483648;o[c+8>>2]=f;o[c+12>>2]=d;e=c+8|0;break b}m[c+19|0]=d;e=c+8|0;f=e;if(!d){break a}}ll(f,b,d)}m[d+f|0]=0;lj(a,c+8|0,c+24|0);g=t[c+24>>3];if(m[e+11|0]<=-1){jl(o[c+8>>2])}R=c+32|0;return g}Ak();D()}function na(a,b,c){var d=0,e=0,f=0,g=0;d=R-16|0;R=d;o[d+8>>2]=0;o[d>>2]=0;o[d+4>>2]=0;e=rl(c);if(e>>>0<4294967280){a:{b:{if(e>>>0>=11){g=e+16&-16;f=yk(g);o[d+8>>2]=g|-2147483648;o[d>>2]=f;o[d+4>>2]=e;break b}m[d+11|0]=e;f=d;if(!e){break a}}ll(f,c,e)}m[e+f|0]=0;a=a+16|0;c=0;c:{if(!mj(b,d,a)){break c}c=o[a>>2];if(m[a+11|0]<=-1){break c}c=a}if(m[d+11|0]<=-1){jl(o[d>>2])}R=d+16|0;return c}Ak();D()}function di(a){a=a|0;var b=0,c=0,d=0,e=0;a:{b=o[a+8>>2];b:{if((b|0)<0){break b}c=o[a+4>>2];e=o[c>>2];d=o[c+4>>2]-e>>2;c:{if(b>>>0>d>>>0){ei(c,b-d|0);b=o[a+8>>2];break c}if(b>>>0>=d>>>0){break c}o[c+4>>2]=e+(b<<2)}e=1;if((b|0)<1){break b}a=o[a+4>>2];c=o[a>>2];d=o[a+4>>2]-c>>2;a=0;while(1){if((a|0)==(d|0)){break a}o[c+(a<<2)>>2]=a;a=a+1|0;if((a|0)<(b|0)){continue}break}}return e|0}Ok();D()}function ch(a,b){var c=0,d=0,e=0,f=0;d=o[a+12>>2];c=o[a+16>>2]-d>>2;a:{if(c>>>0>>0){Ia(a+12|0,b-c|0);break a}if(c>>>0<=b>>>0){break a}o[a+16>>2]=d+(b<<2)}b:{c=o[a>>2];c:{if(o[a+8>>2]-c>>2>>>0>=b>>>0){break c}if(b>>>0>=1073741824){break b}d=o[a+4>>2];e=b<<2;b=yk(e);e=b+e|0;d=d-c|0;f=d+b|0;if((d|0)>=1){ll(b,c,d)}o[a+8>>2]=e;o[a+4>>2]=f;o[a>>2]=b;if(!c){break c}jl(c)}return}db(8832);D()}function xh(a,b){var c=0,d=0,e=0;a:{if((a|0)!=(b|0)){e=a;c=o[b+4>>2];d=0;b:{if(!c){break b}c:{if(c>>>0<=o[a+8>>2]<<5>>>0){d=o[a>>2];break c}d=o[a>>2];if(d){jl(d);o[a+8>>2]=0;o[a>>2]=0;o[a+4>>2]=0;c=o[b+4>>2]}if((c|0)<=-1){break a}c=(c+ -1>>>5|0)+1|0;d=yk(c<<2);o[a+8>>2]=c;o[a+4>>2]=0;o[a>>2]=d;c=o[b+4>>2]}nl(d,o[b>>2],(c+ -1>>>3&536870908)+4|0);d=o[b+4>>2]}o[e+4>>2]=d}return}Nk();D()}function kj(a,b,c){var d=0,e=0,f=0;a:{b=Ai(a,b);b:{if((b|0)==(a+4|0)){break b}a=o[b+28>>2];d=o[b+32>>2];if((a|0)==(d|0)){break b}a=d-a|0;if(a&3){break b}d=a>>>2|0;e=o[c+4>>2];a=o[c>>2];f=e-a>>2;c:{if(d>>>0>f>>>0){Ia(c,d-f|0);a=o[c>>2];e=o[c+4>>2];break c}if(d>>>0>=f>>>0){break c}e=(d<<2)+a|0;o[c+4>>2]=e}if((a|0)==(e|0)){break a}c=a;a=o[b+28>>2];ll(c,a,o[b+32>>2]-a|0)}return}Ok();D()}function Tg(a,b){var c=0;c=o[b+8>>2];o[a+12>>2]=o[b+4>>2];o[a+16>>2]=c;o[a+28>>2]=o[b+20>>2];c=o[b+16>>2];o[a+20>>2]=o[b+12>>2];o[a+24>>2]=c;xh(a+32|0,b+24|0);xh(a+44|0,b+36|0);if((a+8|0)==(b|0)){o[a+92>>2]=o[b+84>>2];return}yd(a+56|0,o[b+48>>2],o[b+52>>2]);yd(a+68|0,o[b+60>>2],o[b- -64>>2]);yd(a+80|0,o[b+72>>2],o[b+76>>2]);o[a+92>>2]=o[b+84>>2];kd(a+96|0,o[b+88>>2],o[b+92>>2])}function hj(a,b){var c=0,d=0,e=0;c=o[b+4>>2];a:{if(!c){d=o[b+8>>2];if(o[d>>2]==(b|0)){break a}e=b+8|0;while(1){c=o[e>>2];e=c+8|0;d=o[c+8>>2];if((c|0)!=o[d>>2]){continue}break}break a}while(1){d=c;c=o[c>>2];if(c){continue}break}}if(o[a>>2]==(b|0)){o[a>>2]=d}o[a+8>>2]=o[a+8>>2]+ -1;pj(o[a+4>>2],b);a=o[b+28>>2];if(a){o[b+32>>2]=a;jl(a)}if(m[b+27|0]<=-1){jl(o[b+16>>2])}jl(b)}function Gg(a){a=a|0;var b=0,c=0,d=0,e=0;o[a>>2]=8120;b=o[a+48>>2];o[a+48>>2]=0;if(b){l[o[o[b>>2]+4>>2]](b)}o[a>>2]=10116;b=o[a+20>>2];if(b){o[a+24>>2]=b;jl(b)}d=o[a+8>>2];if(d){b=d;c=o[a+12>>2];e=b;a:{if((b|0)==(c|0)){break a}while(1){c=c+ -4|0;b=o[c>>2];o[c>>2]=0;if(b){l[o[o[b>>2]+4>>2]](b)}if((c|0)!=(d|0)){continue}break}e=o[a+8>>2]}b=e;o[a+12>>2]=d;jl(b)}return a|0}function Hg(a){a=a|0;var b=0,c=0,d=0,e=0;o[a>>2]=8120;b=o[a+48>>2];o[a+48>>2]=0;if(b){l[o[o[b>>2]+4>>2]](b)}o[a>>2]=10116;b=o[a+20>>2];if(b){o[a+24>>2]=b;jl(b)}d=o[a+8>>2];if(d){b=d;c=o[a+12>>2];e=b;a:{if((b|0)==(c|0)){break a}while(1){c=c+ -4|0;b=o[c>>2];o[c>>2]=0;if(b){l[o[o[b>>2]+4>>2]](b)}if((c|0)!=(d|0)){continue}break}e=o[a+8>>2]}b=e;o[a+12>>2]=d;jl(b)}jl(a)}function Lf(a,b,c){a=a|0;b=b|0;c=c|0;b=R-32|0;R=b;a:{if(p[o[a+4>>2]+36|0]>=2){c=0;if(!l[o[o[a>>2]+52>>2]](a)){break a}}o[b+24>>2]=0;o[b+28>>2]=0;o[b+16>>2]=0;o[b+20>>2]=0;o[b+12>>2]=-1;o[b+8>>2]=1232;jd(b+8|0,o[a+24>>2],o[a+28>>2],m[o[a+8>>2]+24|0],s[a+32>>2]);c=od(b+8|0,o[a+16>>2]);o[b+8>>2]=1232;a=o[b+16>>2];if(!a){break a}o[b+20>>2]=a;jl(a)}R=b+32|0;return c|0}function ka(a,b){var c=0,d=0,e=0,f=0;c=R-16|0;R=c;o[c+12>>2]=0;o[c+8>>2]=0;o[c>>2]=0;o[c+4>>2]=0;d=rl(b);if(d>>>0<4294967280){a:{b:{if(d>>>0>=11){e=d+16&-16;f=yk(e);o[c+8>>2]=e|-2147483648;o[c>>2]=f;o[c+4>>2]=d;e=c;break b}m[c+11|0]=d;e=c;f=c;if(!d){break a}}ll(f,b,d)}m[d+f|0]=0;jj(a,c,c+12|0);a=o[c+12>>2];if(m[e+11|0]<=-1){jl(o[c>>2])}R=c+16|0;return a}Ak();D()}function Fk(a,b,c,d,e,f,g){var h=0,i=0,j=0;h=R-16|0;R=h;if((b^-1)+ -17>>>0>=c>>>0){i=nk(a);a:{if(2147483623>b>>>0){o[h+8>>2]=b<<1;o[h+12>>2]=b+c;c=sk(o[fk(h+12|0,h+8|0)>>2]);break a}c=-18}j=c+1|0;c=tk(j);if(f){ek(c,g,f)}d=d-e|0;g=d;if(d){ek(c+f|0,e+i|0,g)}if((b|0)!=10){jl(i)}uk(a,c);vk(a,j);b=a;a=d+f|0;qk(b,a);m[h+7|0]=0;pk(a+c|0,h+7|0);R=h+16|0;return}Ak();D()}function le(a,b,c){var d=0,e=0,f=0,g=0;d=R-80|0;R=d;e=qd(d+16|0);f=o[o[a+8>>2]+56>>2];g=c<<24>>24;c=u(xi(5),c);rd(e,f,g,5,0,c,c>>31);c=yk(96);e=vd(c,e);m[c+84|0]=1;o[c+72>>2]=o[c+68>>2];wd(e,b);o[d>>2]=0;o[d+8>>2]=0;b=o[a+16>>2];o[a+16>>2]=c;a:{if(!b){o[d>>2]=0;break a}Kb(b);a=o[d>>2];o[d>>2]=0;if(!a){break a}Kb(a)}a=o[d+8>>2];o[d+8>>2]=0;if(a){Kb(a)}R=d+80|0}function ql(a,b,c){var d=0,e=0,f=0;a:{d=o[c+16>>2];if(!d){if(ol(c)){break a}d=o[c+16>>2]}f=o[c+20>>2];if(d-f>>>0>>0){l[o[c+36>>2]](c,a,b)|0;return}b:{if(m[c+75|0]<0){break b}d=b;while(1){e=d;if(!e){break b}d=e+ -1|0;if(p[d+a|0]!=10){continue}break}if(l[o[c+36>>2]](c,a,e)>>>0>>0){break a}b=b-e|0;a=a+e|0;f=o[c+20>>2]}ll(f,a,b);o[c+20>>2]=o[c+20>>2]+b}}function Tj(a){var b=0,c=0,d=0,e=0,f=0,g=0;while(1){b=a;a=b+1|0;c=m[b|0];if((c|0)==32|c+ -9>>>0<5){continue}break}c=m[b|0];e=c+ -43|0;a:{if(e>>>0>2){break a}b:{switch(e-1|0){case 1:f=1;break;case 0:break a;default:break b}}c=m[a|0];b=a;g=f}if(Bj(c)){while(1){d=(u(d,10)-m[b|0]|0)+48|0;a=m[b+1|0];b=b+1|0;if(Bj(a)){continue}break}}return g?d:0-d|0}function Aa(a,b){var c=0,d=0,e=0;c=R-16|0;R=c;o[a+68>>2]=0;o[a+72>>2]=0;o[a>>2]=b;Zi(c+8|0,b);d=o[c+8>>2];o[c+8>>2]=0;e=o[a+4>>2];o[a+4>>2]=d;a:{if(!e){o[c+8>>2]=0;break a}d=a+4|0;za(d,e);e=o[c+8>>2];o[c+8>>2]=0;if(e){za(c+8|0,e)}d=o[d>>2]}if(d){d=o[b+100>>2];b=o[b+96>>2];m[c+7|0]=0;eb(a+56|0,(d-b|0)/12|0,c+7|0);a=1}else{a=0}R=c+16|0;return a}function cl(a,b,c,d){m[a+53|0]=1;a:{if(o[a+4>>2]!=(c|0)){break a}m[a+52|0]=1;c=o[a+16>>2];if(!c){o[a+36>>2]=1;o[a+24>>2]=d;o[a+16>>2]=b;if((d|0)!=1|o[a+48>>2]!=1){break a}m[a+54|0]=1;return}if((b|0)==(c|0)){c=o[a+24>>2];if((c|0)==2){o[a+24>>2]=d;c=d}if(o[a+48>>2]!=1|(c|0)!=1){break a}m[a+54|0]=1;return}m[a+54|0]=1;o[a+36>>2]=o[a+36>>2]+1}}function ia(a,b){var c=0,d=0,e=0,f=0;c=R-16|0;R=c;o[c+8>>2]=0;o[c>>2]=0;o[c+4>>2]=0;d=rl(b);if(d>>>0<4294967280){a:{b:{if(d>>>0>=11){e=d+16&-16;f=yk(e);o[c+8>>2]=e|-2147483648;o[c>>2]=f;o[c+4>>2]=d;e=c;break b}m[c+11|0]=d;e=c;f=c;if(!d){break a}}ll(f,b,d)}m[d+f|0]=0;a=ja(a,c);if(m[e+11|0]<=-1){jl(o[c>>2])}R=c+16|0;return(a|0)!=0}Ak();D()}function Zk(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0;d=R+ -64|0;R=d;e=1;a:{if(Yk(a,b,0)){break a}e=0;if(!b){break a}b=_k(b);e=0;if(!b){break a}o[d+20>>2]=-1;o[d+16>>2]=a;o[d+12>>2]=0;o[d+8>>2]=b;ml(d+24|0,0,39);o[d+56>>2]=1;l[o[o[b>>2]+28>>2]](b,d+8|0,o[c>>2],1);e=0;if(o[d+32>>2]!=1){break a}o[c>>2]=o[d+24>>2];e=1}R=d- -64|0;return e|0}function qg(a,b,c){var d=0,e=0,f=0,g=0;a:{if(a>>>0>5){break a}f=o[c+16>>2];d=o[c+12>>2];e=o[c+20>>2];if((d|0)<(e|0)?1:(d|0)<=(e|0)?r[c+8>>2]>f>>>0?0:1:0){break a}d=p[f+o[c>>2]|0];f=f+1|0;if(f>>>0<1){e=e+1|0}o[c+16>>2]=f;o[c+20>>2]=e;e=b;if(d&128){if(!qg(a+1|0,b,c)){break a}a=o[b>>2]<<7;o[b>>2]=a;d=a|d&127}o[e>>2]=d;g=1}return g}function bj(a,b,c){var d=0,e=0,f=0,g=0;a:{if(a>>>0>5){break a}f=o[c+16>>2];d=o[c+12>>2];e=o[c+20>>2];if((d|0)<(e|0)?1:(d|0)<=(e|0)?r[c+8>>2]>f>>>0?0:1:0){break a}d=p[f+o[c>>2]|0];f=f+1|0;if(f>>>0<1){e=e+1|0}o[c+16>>2]=f;o[c+20>>2]=e;e=b;if(d&128){if(!bj(a+1|0,b,c)){break a}a=o[b>>2]<<7;o[b>>2]=a;d=a|d&127}o[e>>2]=d;g=1}return g}function Zh(a,b,c){var d=0,e=0,f=0,g=0;a:{if(a>>>0>5){break a}f=o[c+16>>2];d=o[c+12>>2];e=o[c+20>>2];if((d|0)<(e|0)?1:(d|0)<=(e|0)?r[c+8>>2]>f>>>0?0:1:0){break a}d=p[f+o[c>>2]|0];f=f+1|0;if(f>>>0<1){e=e+1|0}o[c+16>>2]=f;o[c+20>>2]=e;e=b;if(d&128){if(!Zh(a+1|0,b,c)){break a}a=o[b>>2]<<7;o[b>>2]=a;d=a|d&127}o[e>>2]=d;g=1}return g}function Xg(a,b,c){var d=0,e=0,f=0,g=0;a:{if(a>>>0>5){break a}f=o[c+16>>2];d=o[c+12>>2];e=o[c+20>>2];if((d|0)<(e|0)?1:(d|0)<=(e|0)?r[c+8>>2]>f>>>0?0:1:0){break a}d=p[f+o[c>>2]|0];f=f+1|0;if(f>>>0<1){e=e+1|0}o[c+16>>2]=f;o[c+20>>2]=e;e=b;if(d&128){if(!Xg(a+1|0,b,c)){break a}a=o[b>>2]<<7;o[b>>2]=a;d=a|d&127}o[e>>2]=d;g=1}return g}function Ug(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0;d=R-16|0;R=d;o[a+4>>2]=b;b=o[b+64>>2];e=o[b>>2];b=o[b+4>>2];m[d+15|0]=0;eb(a+24|0,(b-e>>2>>>0)/3|0,d+15|0);b=o[a+4>>2];e=o[b+56>>2];b=o[b+52>>2];m[d+14|0]=0;eb(a+36|0,e-b>>2,d+14|0);b=o[c+12>>2];o[a+16>>2]=o[c+8>>2];o[a+20>>2]=b;b=o[c+4>>2];o[a+8>>2]=o[c>>2];o[a+12>>2]=b;R=d+16|0}function Tf(a,b,c){var d=0,e=0,f=0,g=0;a:{if(a>>>0>5){break a}f=o[c+16>>2];d=o[c+12>>2];e=o[c+20>>2];if((d|0)<(e|0)?1:(d|0)<=(e|0)?r[c+8>>2]>f>>>0?0:1:0){break a}d=p[f+o[c>>2]|0];f=f+1|0;if(f>>>0<1){e=e+1|0}o[c+16>>2]=f;o[c+20>>2]=e;e=b;if(d&128){if(!Tf(a+1|0,b,c)){break a}a=o[b>>2]<<7;o[b>>2]=a;d=a|d&127}o[e>>2]=d;g=1}return g}function Ge(a,b,c){var d=0,e=0,f=0,g=0;a:{if(a>>>0>5){break a}f=o[c+16>>2];d=o[c+12>>2];e=o[c+20>>2];if((d|0)<(e|0)?1:(d|0)<=(e|0)?r[c+8>>2]>f>>>0?0:1:0){break a}d=p[f+o[c>>2]|0];f=f+1|0;if(f>>>0<1){e=e+1|0}o[c+16>>2]=f;o[c+20>>2]=e;e=b;if(d&128){if(!Ge(a+1|0,b,c)){break a}a=o[b>>2]<<7;o[b>>2]=a;d=a|d&127}o[e>>2]=d;g=1}return g}function Cd(a,b,c){var d=0,e=0,f=0,g=0;a:{if(a>>>0>5){break a}f=o[c+16>>2];d=o[c+12>>2];e=o[c+20>>2];if((d|0)<(e|0)?1:(d|0)<=(e|0)?r[c+8>>2]>f>>>0?0:1:0){break a}d=p[f+o[c>>2]|0];f=f+1|0;if(f>>>0<1){e=e+1|0}o[c+16>>2]=f;o[c+20>>2]=e;e=b;if(d&128){if(!Cd(a+1|0,b,c)){break a}a=o[b>>2]<<7;o[b>>2]=a;d=a|d&127}o[e>>2]=d;g=1}return g}function rl(a){var b=0,c=0,d=0;a:{b:{b=a;if(!(b&3)){break b}if(!p[a|0]){return 0}while(1){b=b+1|0;if(!(b&3)){break b}if(p[b|0]){continue}break}break a}while(1){c=b;b=b+4|0;d=o[c>>2];if(!((d^-1)&d+ -16843009&-2139062144)){continue}break}if(!(d&255)){return c-a|0}while(1){d=p[c+1|0];b=c+1|0;c=b;if(d){continue}break}}return b-a|0}function ie(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0;e=R-48|0;R=e;a:{if((d|0)!=1){o[a>>2]=0;break a}d=o[b+4>>2];b=o[b+12>>2];o[e+40>>2]=0;f=e+32|0;o[f>>2]=0;o[f+4>>2]=0;o[e+24>>2]=0;o[e+28>>2]=0;o[e+16>>2]=0;o[e+20>>2]=0;o[e+8>>2]=0;o[e+12>>2]=0;je(e,c,b,d,e+8|0);b=o[f>>2];if(b){o[e+36>>2]=b;jl(b)}o[a>>2]=o[e>>2]}R=e+48|0}function Da(a,b,c){var d=0,e=0,f=0,g=0;a:{if(r[a+80>>2]>65535){break a}d=b;e=o[a+96>>2];b=o[a+100>>2]-e|0;a=(b|0)/12|0;if((d|0)!=(u(a,6)|0)){break a}f=1;if(!b){break a}g=a>>>0>1?a:1;a=0;while(1){b=u(a,6)+c|0;d=u(a,12)+e|0;n[b>>1]=o[d>>2];n[b+2>>1]=o[d+4>>2];n[b+4>>1]=o[d+8>>2];a=a+1|0;if((g|0)!=(a|0)){continue}break}}return f}function Rd(a,b){a=a|0;b=b|0;var c=0,d=0,e=0;d=1;a:{if((l[o[o[b>>2]+20>>2]](b)|0)<1){break a}d=0;while(1){c=rj(o[o[a+4>>2]+4>>2],l[o[o[b>>2]+24>>2]](b,e)|0);if((c|0)==-1){break a}c=mi(o[a+4>>2],c);if(!c){break a}if(!l[o[o[b>>2]+28>>2]](b,c)){break a}e=e+1|0;if((e|0)<(l[o[o[b>>2]+20>>2]](b)|0)){continue}break}d=1}return d|0}function fl(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;if(Yk(a,o[b+8>>2],e)){dl(b,c,d);return}a:{if(!Yk(a,o[b>>2],e)){break a}if(!(o[b+20>>2]!=(c|0)?o[b+16>>2]!=(c|0):0)){if((d|0)!=1){break a}o[b+32>>2]=1;return}o[b+20>>2]=c;o[b+32>>2]=d;o[b+40>>2]=o[b+40>>2]+1;if(!(o[b+36>>2]!=1|o[b+24>>2]!=2)){m[b+54|0]=1}o[b+44>>2]=4}}function Vi(a){o[a>>2]=0;o[a+4>>2]=0;o[a+28>>2]=0;o[a+32>>2]=0;m[a+24|0]=1;o[a+16>>2]=0;o[a+20>>2]=0;o[a+8>>2]=0;o[a+12>>2]=0;o[a+36>>2]=0;o[a+40>>2]=0;o[a+44>>2]=0;o[a+48>>2]=0;o[a+52>>2]=0;o[a+56>>2]=0;o[a+60>>2]=0;o[a+64>>2]=0;o[a+72>>2]=0;o[a+76>>2]=0;o[a+80>>2]=0;o[a+84>>2]=0;o[a+88>>2]=0;o[a+92>>2]=0;o[a+68>>2]=a}function Nj(a,b,c){var d=0,e=0,f=0;a:{if((b|0)==1&a>>>0<0|b>>>0<1){d=a;break a}while(1){d=Ql(a,b,10,0);e=T;f=e;e=Ol(d,e,10,0);c=c+ -1|0;m[c|0]=a-e|48;e=(b|0)==9&a>>>0>4294967295|b>>>0>9;a=d;b=f;if(e){continue}break}}if(d){while(1){c=c+ -1|0;a=(d>>>0)/10|0;m[c|0]=d-u(a,10)|48;b=d>>>0>9;d=a;if(b){continue}break}}return c}function wh(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0;d=R-16|0;R=d;o[a+4>>2]=b;e=o[b>>2];b=o[b+4>>2];m[d+15|0]=0;eb(a+24|0,(b-e>>2>>>0)/3|0,d+15|0);b=o[a+4>>2];e=o[b+28>>2];b=o[b+24>>2];m[d+14|0]=0;eb(a+36|0,e-b>>2,d+14|0);b=o[c+12>>2];o[a+16>>2]=o[c+8>>2];o[a+20>>2]=b;b=o[c+4>>2];o[a+8>>2]=o[c>>2];o[a+12>>2]=b;R=d+16|0}function ae(a,b,c){a=a|0;b=b|0;c=c|0;if(c>>>0>3){o[a>>2]=0;return}a:{b:{switch(c-1|0){default:b=yk(20);Ld(b);break a;case 0:b=yk(24);ee(b);break a;case 1:b=yk(36);ee(b);o[b+32>>2]=0;o[b+24>>2]=-1;o[b+28>>2]=0;o[b>>2]=7720;break a;case 2:break b}}b=yk(28);ee(b);o[b+24>>2]=-1;o[b>>2]=5584;o[a>>2]=b;return}o[a>>2]=b}function wa(a,b,c){var d=0,e=0,f=0;d=R-16|0;R=d;e=o[a+96>>2];o[d+8>>2]=0;o[d>>2]=0;o[d+4>>2]=0;a=yk(12);o[d>>2]=a;o[d+4>>2]=a;f=a+12|0;o[d+8>>2]=f;a=ll(a,e+u(b,12)|0,12);b=a+12|0;o[d+4>>2]=b;e=o[c>>2];if(e){o[c+4>>2]=e;jl(e);o[c+8>>2]=0;o[c>>2]=0;o[c+4>>2]=0}o[c+8>>2]=f;o[c+4>>2]=b;o[c>>2]=a;R=d+16|0;return 1}function ii(a){var b=0,c=0,d=0,e=0;if(a){d=o[a+24>>2];if(d){b=d;c=o[a+28>>2];e=b;a:{if((c|0)==(b|0)){break a}while(1){c=c+ -4|0;b=o[c>>2];o[c>>2]=0;if(b){Kc(b+12|0,o[b+16>>2]);Lc(b,o[b+4>>2]);jl(b)}if((c|0)!=(d|0)){continue}break}e=o[a+24>>2]}b=e;o[a+28>>2]=d;jl(b)}Kc(a+12|0,o[a+16>>2]);Lc(a,o[a+4>>2]);jl(a)}}function Ci(a){var b=0;o[a>>2]=0;o[a+4>>2]=0;o[a+56>>2]=0;o[a+48>>2]=0;o[a+52>>2]=0;o[a+40>>2]=0;o[a+44>>2]=0;o[a+32>>2]=0;o[a+36>>2]=0;o[a+24>>2]=0;o[a+28>>2]=0;o[a+16>>2]=0;o[a+20>>2]=0;o[a+8>>2]=0;o[a+12>>2]=0;b=a- -64|0;o[b>>2]=0;o[b+4>>2]=0;o[a+72>>2]=0;o[a+76>>2]=0;o[a+80>>2]=0;o[a+84>>2]=0;o[a+60>>2]=a}function dg(a,b,c,d){var e=0,f=0,g=0,h=0,i=0;if(!a){return 1}e=o[c+16>>2];h=o[c+12>>2];g=o[c+20>>2];f=g;a:{if((h|0)<(f|0)?1:(h|0)<=(f|0)?r[c+8>>2]>e>>>0?0:1:0){break a}f=p[e+o[c>>2]|0];e=e+1|0;if(e>>>0<1){g=g+1|0}o[c+16>>2]=e;o[c+20>>2]=g;if(f>>>0>1){break a}if(f-1){return eg(a,b,c,d)}i=fg(a,c,d)}return i}function Si(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0;d=R-16|0;R=d;e=o[c>>2];o[c>>2]=0;o[d+8>>2]=e;wj(a,b,d+8|0);c=o[d+8>>2];o[d+8>>2]=0;if(c){Kb(c)}e=o[a+84>>2];c=o[a+88>>2]-e>>2;a:{if((c|0)>(b|0)){break a}b=b+1|0;if(b>>>0>c>>>0){Ti(a+84|0,b-c|0);break a}if(b>>>0>=c>>>0){break a}o[a+88>>2]=e+(b<<2)}R=d+16|0}function Bg(a){a=a|0;var b=0,c=0,d=0,e=0;o[a>>2]=10116;b=o[a+20>>2];if(b){o[a+24>>2]=b;jl(b)}d=o[a+8>>2];if(d){b=d;c=o[a+12>>2];e=b;a:{if((b|0)==(c|0)){break a}while(1){c=c+ -4|0;b=o[c>>2];o[c>>2]=0;if(b){l[o[o[b>>2]+4>>2]](b)}if((c|0)!=(d|0)){continue}break}e=o[a+8>>2]}b=e;o[a+12>>2]=d;jl(b)}return a|0}function Jk(a,b,c,d,e){var f=0,g=0,h=0;f=R-16|0;R=f;if(-17-b>>>0>=c>>>0){g=nk(a);a:{if(2147483623>b>>>0){o[f+8>>2]=b<<1;o[f+12>>2]=b+c;c=sk(o[fk(f+12|0,f+8|0)>>2]);break a}c=-18}h=c+1|0;c=tk(h);if(e){ek(c,g,e)}d=d-e|0;if(d){ek(c+e|0,e+g|0,d)}if((b|0)!=10){jl(g)}uk(a,c);vk(a,h);R=f+16|0;return}Ak();D()}function bi(a){a=a|0;var b=0,c=0,d=0,e=0;o[a>>2]=10116;b=o[a+20>>2];if(b){o[a+24>>2]=b;jl(b)}d=o[a+8>>2];if(d){b=d;c=o[a+12>>2];e=b;a:{if((b|0)==(c|0)){break a}while(1){c=c+ -4|0;b=o[c>>2];o[c>>2]=0;if(b){l[o[o[b>>2]+4>>2]](b)}if((c|0)!=(d|0)){continue}break}e=o[a+8>>2]}b=e;o[a+12>>2]=d;jl(b)}jl(a)}function xk(a,b,c){var d=0,e=0,f=0,g=0;e=R-16|0;R=e;d=c-b|0;if(d>>>0<=4294967279){a:{if(d>>>0<=10){rk(a,d);f=a;break a}g=sk(d)+1|0;f=tk(g);uk(a,f);vk(a,g);qk(a,d)}d=c-b|0;a=f;while(1){if((b|0)!=(c|0)){pk(a,b);a=a+1|0;b=b+1|0;continue}break}m[e+15|0]=0;pk(d+f|0,e+15|0);R=e+16|0;return}Ak();D()}function Ea(a,b,c){var d=0,e=0,f=0,g=0;e=o[a+96>>2];d=o[a+100>>2]-e|0;a=(d|0)/12|0;a:{if((b|0)!=(d|0)){break a}f=1;if(!b){break a}g=a>>>0>1?a:1;a=0;while(1){d=u(a,12);b=d+c|0;d=d+e|0;o[b>>2]=o[d>>2];o[b+4>>2]=o[d+4>>2];o[b+8>>2]=o[d+8>>2];a=a+1|0;if((g|0)!=(a|0)){continue}break}}return f}function wd(a,b){var c=0,d=0;a:{if(o[a+64>>2]){break a}d=yk(32);oi(d);c=o[a+64>>2];o[a+64>>2]=d;if(!c){break a}d=o[c>>2];if(d){o[c+4>>2]=d;jl(d)}jl(c)}c=xi(o[a+28>>2]);c=u(c,m[a+24|0]);d=c;c=c>>31;if(pi(o[a+64>>2],0,Ol(d,c,b,0),T)){td(a,o[a+64>>2],d,c);o[a+80>>2]=b;a=1}else{a=0}return a}function zh(a){a=a|0;var b=0;o[a+8>>2]=9152;o[a>>2]=8940;b=o[a+96>>2];if(b){o[a+100>>2]=b;jl(b)}b=o[a+80>>2];if(b){o[a+84>>2]=b;jl(b)}b=o[a+68>>2];if(b){o[a+72>>2]=b;jl(b)}b=o[a+56>>2];if(b){o[a+60>>2]=b;jl(b)}o[a+8>>2]=9388;b=o[a+44>>2];if(b){jl(b)}b=o[a+32>>2];if(b){jl(b)}return a|0}function Ah(a){a=a|0;var b=0;o[a+8>>2]=9152;o[a>>2]=8940;b=o[a+96>>2];if(b){o[a+100>>2]=b;jl(b)}b=o[a+80>>2];if(b){o[a+84>>2]=b;jl(b)}b=o[a+68>>2];if(b){o[a+72>>2]=b;jl(b)}b=o[a+56>>2];if(b){o[a+60>>2]=b;jl(b)}o[a+8>>2]=9388;b=o[a+44>>2];if(b){jl(b)}b=o[a+32>>2];if(b){jl(b)}jl(a)}function cb(a,b){var c=0,d=0;c=o[a+4>>2];if(!c){return 0}b=o[o[o[a+8>>2]+(b<<2)>>2]+60>>2];if((b|0)<0){return 0}a=o[c+24>>2];c=o[c+28>>2];if((a|0)==(c|0)){return 0}a:{while(1){d=o[a>>2];if((b|0)==o[d+24>>2]){break a}a=a+4|0;if((c|0)!=(a|0)){continue}break}return 0}return d}function Pk(a){var b=0;if(o[a+76>>2]<0){a:{if(m[a+75|0]==10){break a}b=o[a+20>>2];if(b>>>0>=r[a+16>>2]){break a}o[a+20>>2]=b+1;m[b|0]=10;return}pl(a);return}b:{c:{if(m[a+75|0]==10){break c}b=o[a+20>>2];if(b>>>0>=r[a+16>>2]){break c}o[a+20>>2]=b+1;m[b|0]=10;break b}pl(a)}}function yh(a){a=a|0;var b=0;o[a>>2]=9152;b=o[a+88>>2];if(b){o[a+92>>2]=b;jl(b)}b=o[a+72>>2];if(b){o[a+76>>2]=b;jl(b)}b=o[a+60>>2];if(b){o[a- -64>>2]=b;jl(b)}b=o[a+48>>2];if(b){o[a+52>>2]=b;jl(b)}o[a>>2]=9388;b=o[a+36>>2];if(b){jl(b)}b=o[a+24>>2];if(b){jl(b)}return a|0}function Zb(a){a=a|0;var b=0,c=0,d=0,e=0;if(a){if(m[a+27|0]<=-1){jl(o[a+16>>2])}c=o[a>>2];if(c){b=c;d=o[a+4>>2];e=b;a:{if((d|0)==(b|0)){break a}while(1){b=d+ -12|0;if(m[d+ -1|0]<=-1){jl(o[b>>2])}d=b;if((b|0)!=(c|0)){continue}break}e=o[a>>2]}b=e;o[a+4>>2]=c;jl(b)}jl(a)}}function jk(){var a=0,b=0,c=0;a=R-16|0;R=a;a:{if(L(a+12|0,a+8|0)){break a}b=il((o[a+12>>2]<<2)+4|0);o[3331]=b;if(!b){break a}b:{b=il(o[a+8>>2]);if(b){c=o[3331];if(c){break b}}o[3331]=0;break a}o[(o[a+12>>2]<<2)+c>>2]=0;if(!M(o[3331],b|0)){break a}o[3331]=0}R=a+16|0}function Uf(a){var b=0,c=0,d=0,e=0,f=0;d=0-p[a+12|0]|0;c=o[a+8>>2];a:{if(c>>>0>4095){break a}b=o[a+4>>2];if((b|0)<1){break a}b=b+ -1|0;o[a+4>>2]=b;c=p[b+o[a>>2]|0]|c<<8;o[a+8>>2]=c}d=d&255;b=u(d,c>>>8|0);e=c&255;f=e>>>0>>0;o[a+8>>2]=f?b+e|0:(c-d|0)-b|0;return f}function Gh(a){a=a|0;var b=0;o[a>>2]=9152;b=o[a+88>>2];if(b){o[a+92>>2]=b;jl(b)}b=o[a+72>>2];if(b){o[a+76>>2]=b;jl(b)}b=o[a+60>>2];if(b){o[a- -64>>2]=b;jl(b)}b=o[a+48>>2];if(b){o[a+52>>2]=b;jl(b)}o[a>>2]=9388;b=o[a+36>>2];if(b){jl(b)}b=o[a+24>>2];if(b){jl(b)}jl(a)}function $f(a,b,c,d){var e=0;e=R-16|0;R=e;c=bg(a,b,e+12|0,e+8|0,c);if(!o[c>>2]){b=yk(40);Bk(b+16|0,d);Bk(b+28|0,d+12|0);o[b+8>>2]=o[e+12>>2];o[b>>2]=0;o[b+4>>2]=0;o[c>>2]=b;d=o[o[a>>2]>>2];if(d){o[a>>2]=d;b=o[c>>2]}ag(o[a+4>>2],b);o[a+8>>2]=o[a+8>>2]+1}R=e+16|0}function Yg(a){var b=0;b=o[a+84>>2];if(b){o[a+88>>2]=b;jl(b)}b=o[a+72>>2];if(b){o[a+76>>2]=b;jl(b)}b=o[a+52>>2];if(b){o[a+56>>2]=b;jl(b)}b=o[a+40>>2];if(b){o[a+44>>2]=b;jl(b)}b=o[a+28>>2];if(b){o[a+32>>2]=b;jl(b)}b=o[a+12>>2];if(b){jl(b)}a=o[a>>2];if(a){jl(a)}}function Ej(a,b){var c=0,d=0,i=0;h(+a);c=e(1)|0;d=e(0)|0;i=c;c=c>>>20&2047;if((c|0)!=2047){if(!c){c=b;if(a==0){b=0}else{a=Ej(a*0x10000000000000000,b);b=o[b>>2]+ -64|0}o[c>>2]=b;return a}o[b>>2]=c+ -1022;f(0,d|0);f(1,i&-2146435073|1071644672);a=+g()}return a}function za(a,b){if(b){a=o[b+76>>2];if(a){o[b+80>>2]=a;jl(a)}a=o[b- -64>>2];if(a){o[b+68>>2]=a;jl(a)}a=o[b+48>>2];if(a){o[b+52>>2]=a;jl(a)}a=o[b+24>>2];if(a){o[b+28>>2]=a;jl(a)}a=o[b+12>>2];if(a){o[b+16>>2]=a;jl(a)}a=o[b>>2];if(a){o[b+4>>2]=a;jl(a)}jl(b)}}function _d(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0;c=1;e=l[o[o[a>>2]+24>>2]](a)|0;a:{if((e|0)<1){break a}g=a+48|0;c=0;while(1){f=o[o[a+36>>2]+(d<<2)>>2];if(!l[o[o[f>>2]+20>>2]](f,g,b)){break a}d=d+1|0;if((e|0)!=(d|0)){continue}break}c=1}return c|0}function Zd(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0;c=1;e=l[o[o[a>>2]+24>>2]](a)|0;a:{if((e|0)<1){break a}g=a+48|0;c=0;while(1){f=o[o[a+36>>2]+(d<<2)>>2];if(!l[o[o[f>>2]+16>>2]](f,g,b)){break a}d=d+1|0;if((e|0)!=(d|0)){continue}break}c=1}return c|0}function Ml(a,b,c,d){var e=0,f=0,g=0,h=0;e=b;f=e>>31;e=e>>31;a=a^e;g=a-e|0;h=(b^f)-((a>>>0>>0)+f|0)|0;e=d;f=e>>31;e=e>>31;a=c^e;e=Ql(g,h,a-e|0,(d^f)-((a>>>0>>0)+f|0)|0);b=b^d;c=b>>31;a=b>>31;b=e^a;d=b-a|0;T=(c^T)-((b>>>0>>0)+c|0)|0;return d}function dd(a,b){a=a|0;b=b|0;var c=0,d=0;o[b>>2]=2;c=o[b+8>>2];d=o[b+12>>2]-c|0;if(d>>>0<=4294967291){b=b+8|0;ri(b,d+4|0);c=o[b>>2]}b=c+d|0;a=p[a+4|0]|p[a+5|0]<<8|(p[a+6|0]<<16|p[a+7|0]<<24);m[b|0]=a;m[b+1|0]=a>>>8;m[b+2|0]=a>>>16;m[b+3|0]=a>>>24}function pl(a){var b=0,c=0,d=0;b=R-16|0;R=b;m[b+15|0]=10;c=o[a+16>>2];a:{if(!c){if(ol(a)){break a}c=o[a+16>>2]}d=o[a+20>>2];if(!(m[a+75|0]==10|d>>>0>=c>>>0)){o[a+20>>2]=d+1;m[d|0]=10;break a}if((l[o[a+36>>2]](a,b+15|0,1)|0)!=1){break a}}R=b+16|0}function ck(a,b,c){var d=0,e=0,f=0,g=0;d=R-16|0;R=d;b=b-a>>2;while(1){if(b){o[d+12>>2]=a;e=d+12|0;f=e;g=o[e>>2];e=b>>>1|0;o[f>>2]=g+(e<<2);if(dk(o[d+12>>2],c)){a=o[d+12>>2]+4|0;o[d+12>>2]=a;b=(e^-1)+b|0}else{b=e}continue}break}R=d+16|0;return a}function lj(a,b,c){var d=0;a:{d=a+4|0;a=Ai(a,b);if((d|0)==(a|0)){break a}b=o[a+32>>2];a=o[a+28>>2];if((b-a|0)!=8){break a}b=p[a+4|0]|p[a+5|0]<<8|(p[a+6|0]<<16|p[a+7|0]<<24);o[c>>2]=p[a|0]|p[a+1|0]<<8|(p[a+2|0]<<16|p[a+3|0]<<24);o[c+4>>2]=b}}function Kb(a){a=a|0;var b=0,c=0;if(a){b=o[a+88>>2];o[a+88>>2]=0;if(b){c=o[b+8>>2];if(c){o[b+12>>2]=c;jl(c)}jl(b)}b=o[a+68>>2];if(b){o[a+72>>2]=b;jl(b)}b=o[a+64>>2];o[a+64>>2]=0;if(b){c=o[b>>2];if(c){o[b+4>>2]=c;jl(c)}jl(b)}jl(a)}}function vj(a,b){var c=0,d=0,e=0,f=0;c=R-16|0;R=c;d=o[a+12>>2];e=o[a+8>>2];f=o[b>>2];o[b>>2]=0;o[c+8>>2]=f;l[o[o[a>>2]+8>>2]](a,d-e>>2,c+8|0);b=o[c+8>>2];o[c+8>>2]=0;if(b){Kb(b)}R=c+16|0;return(o[a+12>>2]-o[a+8>>2]>>2)+ -1|0}function Ll(a,b,c,d){var e=0,f=0,g=0,h=0,i=0,j=0;e=c>>>16|0;f=a>>>16|0;j=u(e,f);g=c&65535;h=a&65535;i=u(g,h);f=(i>>>16|0)+u(f,g)|0;e=(f&65535)+u(e,h)|0;a=(u(b,c)+j|0)+u(a,d)+(f>>>16)+(e>>>16)|0;b=i&65535|e<<16;T=a;return b}function tj(a,b){var c=0,d=0,e=0;c=o[a+8>>2];a=o[a+12>>2];a:{if((c|0)==(a|0)){break a}a=a-c>>2;e=a>>>0>1?a:1;a=0;while(1){d=o[(a<<2)+c>>2];if(o[d+60>>2]==(b|0)){break a}a=a+1|0;if((e|0)!=(a|0)){continue}break}d=0}return d}function si(a){n[a+38>>1]=0;o[a>>2]=0;o[a+8>>2]=0;o[a+12>>2]=0;o[a+16>>2]=0;o[a+20>>2]=0;o[a+24>>2]=0;o[a+28>>2]=0;m[a+29|0]=0;m[a+30|0]=0;m[a+31|0]=0;m[a+32|0]=0;m[a+33|0]=0;m[a+34|0]=0;m[a+35|0]=0;m[a+36|0]=0;return a}function ri(a,b){var c=0,d=0;d=o[a>>2];c=o[a+4>>2]-d|0;a:{if(c>>>0>>0){Ka(a,b-c|0);break a}if(c>>>0<=b>>>0){break a}o[a+4>>2]=b+d}b=a+24|0;c=b;d=b;a=o[b+4>>2];b=o[b>>2]+1|0;if(b>>>0<1){a=a+1|0}o[d>>2]=b;o[c+4>>2]=a}function li(a){a=a|0;var b=0,c=0,d=0,e=0;c=1;b=o[a+8>>2];d=o[a+12>>2];a:{if((b|0)==(d|0)){break a}while(1){e=o[b>>2];if(l[o[o[e>>2]+16>>2]](e,o[a+32>>2])){b=b+4|0;if((d|0)!=(b|0)){continue}break a}break}c=0}return c|0}function Ck(a,b,c){var d=0,e=0,f=0;d=R-16|0;R=d;if(4294967279>=c>>>0){a:{if(c>>>0<=10){rk(a,c);e=a;break a}f=sk(c)+1|0;e=tk(f);uk(a,e);vk(a,f);qk(a,c)}ek(e,b,c);m[d+15|0]=0;pk(c+e|0,d+15|0);R=d+16|0;return}Ak();D()}function Pf(a){a=a|0;var b=0;o[a>>2]=7720;b=o[a+28>>2];o[a+28>>2]=0;if(b){jl(b)}o[a>>2]=1908;b=o[a+20>>2];o[a+20>>2]=0;if(b){l[o[o[b>>2]+4>>2]](b)}o[a>>2]=1596;b=o[a+16>>2];o[a+16>>2]=0;if(b){Kb(b)}return a|0}function $k(a,b,c){var d=0;d=o[a+16>>2];if(!d){o[a+36>>2]=1;o[a+24>>2]=c;o[a+16>>2]=b;return}a:{if((b|0)==(d|0)){if(o[a+24>>2]!=2){break a}o[a+24>>2]=c;return}m[a+54|0]=1;o[a+24>>2]=2;o[a+36>>2]=o[a+36>>2]+1}}function wi(a){var b=0,c=0,d=0,e=0,f=0,g=0;m[a+36|0]=0;d=o[a+20>>2];e=a;f=a;g=o[a+16>>2];a=o[a+32>>2]+7|0;if(a>>>0<7){b=1}c=b>>>3|0;a=b<<29|a>>>3;b=g+a|0;c=c+d|0;o[f+16>>2]=b;o[e+20>>2]=b>>>0>>0?c+1|0:c}function cf(a){a=a|0;var b=0;o[a>>2]=4352;b=o[a+96>>2];if(b){jl(b)}b=o[a+84>>2];if(b){jl(b)}b=o[a+72>>2];if(b){jl(b)}b=o[a+60>>2];if(b){jl(b)}o[a>>2]=2732;b=o[a+32>>2];if(b){o[a+36>>2]=b;jl(b)}return a|0}function Qf(a){a=a|0;var b=0;o[a>>2]=7720;b=o[a+28>>2];o[a+28>>2]=0;if(b){jl(b)}o[a>>2]=1908;b=o[a+20>>2];o[a+20>>2]=0;if(b){l[o[o[b>>2]+4>>2]](b)}o[a>>2]=1596;b=o[a+16>>2];o[a+16>>2]=0;if(b){Kb(b)}jl(a)}function Ce(a){a=a|0;var b=0;o[a>>2]=2788;b=o[a+96>>2];if(b){jl(b)}b=o[a+84>>2];if(b){jl(b)}b=o[a+72>>2];if(b){jl(b)}b=o[a+60>>2];if(b){jl(b)}o[a>>2]=2732;b=o[a+32>>2];if(b){o[a+36>>2]=b;jl(b)}return a|0}function Ui(a,b){a=a|0;b=b|0;var c=0,d=0,e=0;yj(a,b);a:{if((b|0)<0){break a}c=o[a+88>>2];d=o[a+84>>2];if(c-d>>2<=(b|0)){break a}b=d+(b<<2)|0;d=b+4|0;c=c-d|0;e=c>>2;if(c){nl(b,d,c)}o[a+88>>2]=b+(e<<2)}}function Ek(a,b,c){var d=0,e=0,f=0,g=0;e=R-16|0;R=e;d=lk(a);a:{if(d>>>0>=c>>>0){f=nk(a);g=f;d=c;if(c){nl(g,b,d)}m[e+15|0]=0;pk(c+f|0,e+15|0);wk(a,c);break a}f=a;a=kk(a);Fk(f,d,c-d|0,a,a,c,b)}R=e+16|0}function df(a){a=a|0;var b=0;o[a>>2]=4352;b=o[a+96>>2];if(b){jl(b)}b=o[a+84>>2];if(b){jl(b)}b=o[a+72>>2];if(b){jl(b)}b=o[a+60>>2];if(b){jl(b)}o[a>>2]=2732;b=o[a+32>>2];if(b){o[a+36>>2]=b;jl(b)}jl(a)}function Kj(a,b,c,d,e){var f=0;f=R-256|0;R=f;if(!(e&73728|(c|0)<=(d|0))){c=c-d|0;d=c>>>0<256;ml(f,b,d?c:256);if(!d){while(1){Hj(a,f,256);c=c+ -256|0;if(c>>>0>255){continue}break}}Hj(a,f,c)}R=f+256|0}function De(a){a=a|0;var b=0;o[a>>2]=2788;b=o[a+96>>2];if(b){jl(b)}b=o[a+84>>2];if(b){jl(b)}b=o[a+72>>2];if(b){jl(b)}b=o[a+60>>2];if(b){jl(b)}o[a>>2]=2732;b=o[a+32>>2];if(b){o[a+36>>2]=b;jl(b)}jl(a)}function Hk(a,b){var c=0,d=0,e=0,f=0;e=R-16|0;R=e;if(b){d=lk(a);c=kk(a);f=c+b|0;if(d-c>>>0>>0){Jk(a,d,f-d|0,c,c)}d=c;c=nk(a);d=d+c|0;if(b){ml(d,0,b)}wk(a,f);m[e+15|0]=0;pk(c+f|0,e+15|0)}R=e+16|0}function mj(a,b,c){var d=0,e=0;d=a+4|0;a=Ai(a,b);a:{if((d|0)==(a|0)){break a}b=o[a+32>>2];d=o[a+28>>2];if((b|0)==(d|0)){break a}Gk(c,b-d|0);c=Kk(c);b=o[a+28>>2];ll(c,b,o[a+32>>2]-b|0);e=1}return e}function mi(a,b){var c=0,d=0;a:{if((b|0)<0){break a}c=o[a+4>>2];if(o[c+12>>2]-o[c+8>>2]>>2<=(b|0)){break a}a=o[o[a+8>>2]+(o[o[a+20>>2]+(b<<2)>>2]<<2)>>2];d=l[o[o[a>>2]+32>>2]](a,b)|0}return d}function ud(a){qd(a);o[a+64>>2]=0;o[a+68>>2]=0;o[a+88>>2]=0;o[a+72>>2]=0;o[a+76>>2]=0;m[a+77|0]=0;m[a+78|0]=0;m[a+79|0]=0;m[a+80|0]=0;m[a+81|0]=0;m[a+82|0]=0;m[a+83|0]=0;m[a+84|0]=0;return a}function td(a,b,c,d){var e=0;o[a>>2]=b;e=o[b+20>>2];o[a+8>>2]=o[b+16>>2];o[a+12>>2]=e;e=o[b+24>>2];b=o[b+28>>2];o[a+48>>2]=0;o[a+52>>2]=0;o[a+40>>2]=c;o[a+44>>2]=d;o[a+16>>2]=e;o[a+20>>2]=b}function qd(a){o[a+8>>2]=0;o[a+12>>2]=0;o[a>>2]=0;o[a+40>>2]=0;o[a+44>>2]=0;o[a+28>>2]=9;m[a+24|0]=1;o[a+56>>2]=-1;o[a+60>>2]=0;o[a+16>>2]=0;o[a+20>>2]=0;o[a+48>>2]=0;o[a+52>>2]=0;return a}function ol(a){var b=0;b=p[a+74|0];m[a+74|0]=b+ -1|b;b=o[a>>2];if(b&8){o[a>>2]=b|32;return-1}o[a+4>>2]=0;o[a+8>>2]=0;b=o[a+44>>2];o[a+28>>2]=b;o[a+20>>2]=b;o[a+16>>2]=b+o[a+48>>2];return 0}function uj(a,b){var c=0,d=0;c=o[a+8>>2];a=o[a+12>>2];if((c|0)!=(a|0)){d=a-c>>2;a=0;while(1){if(o[o[(a<<2)+c>>2]+60>>2]==(b|0)){return a}a=a+1|0;if(a>>>0>>0){continue}break}}return-1}function ik(a,b){var c=0,d=0;c=p[a|0];d=p[b|0];a:{if(!c|(c|0)!=(d|0)){break a}while(1){d=p[b+1|0];c=p[a+1|0];if(!c){break a}b=b+1|0;a=a+1|0;if((c|0)==(d|0)){continue}break}}return c-d|0}function Kc(a,b){var c=0;if(b){Kc(a,o[b>>2]);Kc(a,o[b+4>>2]);c=b+28|0;a=o[c>>2];o[c>>2]=0;if(a){Kc(a+12|0,o[a+16>>2]);Lc(a,o[a+4>>2]);jl(a)}if(m[b+27|0]<=-1){jl(o[b+16>>2])}jl(b)}}function Bk(a,b){var c=0,d=0,e=0;d=R-16|0;R=d;hk(a);c=a;a:{if(!mk(b)){o[c+8>>2]=o[b+8>>2];e=o[b+4>>2];o[c>>2]=o[b>>2];o[c+4>>2]=e;break a}Ck(a,o[b>>2],o[b+4>>2])}R=d+16|0;return a}function ui(a,b,c){var d=0;a:{if(b){b=0;if(!vi(1,c,a)){break a}}m[a+36|0]=1;o[a+32>>2]=0;b=o[a+16>>2];c=b+o[a>>2]|0;o[a+24>>2]=c;d=a;a=o[a+8>>2];o[d+28>>2]=c+(a-b|0);b=1}return b}function jj(a,b,c){var d=0;a:{d=a+4|0;a=Ai(a,b);if((d|0)==(a|0)){break a}b=o[a+32>>2];a=o[a+28>>2];if((b-a|0)!=4){break a}o[c>>2]=p[a|0]|p[a+1|0]<<8|(p[a+2|0]<<16|p[a+3|0]<<24)}}function de(a,b){a=a|0;b=b|0;var c=0,d=0;d=o[a+16>>2];c=0;a:{if(o[a+20>>2]-d>>2<=(b|0)){break a}b=o[(b<<2)+d>>2];c=0;if((b|0)<0){break a}c=Qd(o[o[a+36>>2]+(b<<2)>>2])}return c|0}function Qh(a){a=a|0;var b=0;o[a+8>>2]=8568;o[a>>2]=9700;b=o[a+56>>2];if(b){o[a+60>>2]=b;jl(b)}o[a+8>>2]=8820;b=o[a+44>>2];if(b){jl(b)}b=o[a+32>>2];if(b){jl(b)}return a|0}function Kh(a){a=a|0;var b=0;o[a+8>>2]=9572;o[a>>2]=9408;b=o[a+56>>2];if(b){o[a+60>>2]=b;jl(b)}o[a+8>>2]=9388;b=o[a+44>>2];if(b){jl(b)}b=o[a+32>>2];if(b){jl(b)}return a|0}function Od(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0;d=o[a+8>>2];a:{if(m[d+24|0]<1){break a}if(!wd(d,o[b+4>>2]-o[b>>2]>>2)){break a}e=l[o[o[a>>2]+32>>2]](a,b,c)|0}return e|0}function Vj(a,b,c){var d=0,e=0,f=0;a:{if(!c){break a}while(1){d=p[a|0];e=p[b|0];if((d|0)==(e|0)){b=b+1|0;a=a+1|0;c=c+ -1|0;if(c){continue}break a}break}f=d-e|0}return f}function Rh(a){a=a|0;var b=0;o[a+8>>2]=8568;o[a>>2]=9700;b=o[a+56>>2];if(b){o[a+60>>2]=b;jl(b)}o[a+8>>2]=8820;b=o[a+44>>2];if(b){jl(b)}b=o[a+32>>2];if(b){jl(b)}jl(a)}function Lh(a){a=a|0;var b=0;o[a+8>>2]=9572;o[a>>2]=9408;b=o[a+56>>2];if(b){o[a+60>>2]=b;jl(b)}o[a+8>>2]=9388;b=o[a+44>>2];if(b){jl(b)}b=o[a+32>>2];if(b){jl(b)}jl(a)}function od(a,b){var c=0;c=yk(40);o[c>>2]=-1;oi(c+8|0);l[o[o[a>>2]+16>>2]](a,c);a=o[b+88>>2];o[b+88>>2]=c;if(a){b=o[a+8>>2];if(b){o[a+12>>2]=b;jl(b)}jl(a)}return 1}function Ve(a){a=a|0;var b=0;a:{if(!o[a- -64>>2]|!o[a+68>>2]|(!o[a+44>>2]|!o[a+48>>2])){break a}if(!o[a+52>>2]|!o[a+56>>2]){break a}b=o[a+92>>2]!=-1}return b|0}function cd(a,b){a=a|0;b=b|0;var c=0;b=o[b+88>>2];if(!(!b|o[b>>2]!=2)){c=a;a=o[b+8>>2];o[c+4>>2]=p[a|0]|p[a+1|0]<<8|(p[a+2|0]<<16|p[a+3|0]<<24);c=1}return c|0}function zf(a){a=a|0;var b=0;a:{if(!o[a+44>>2]|!o[a+48>>2]|(!o[a+24>>2]|!o[a+28>>2])){break a}if(!o[a+32>>2]|!o[a+36>>2]){break a}b=o[a+72>>2]!=-1}return b|0}function oe(a){a=a|0;var b=0;o[a>>2]=1908;b=o[a+20>>2];o[a+20>>2]=0;if(b){l[o[o[b>>2]+4>>2]](b)}o[a>>2]=1596;b=o[a+16>>2];o[a+16>>2]=0;if(b){Kb(b)}return a|0}function fi(a){o[a+40>>2]=0;o[a>>2]=10116;o[a+4>>2]=0;o[a+8>>2]=0;o[a+12>>2]=0;o[a+16>>2]=0;o[a+20>>2]=0;o[a+24>>2]=0;o[a+28>>2]=0;o[a+32>>2]=0;n[a+36>>1]=0}function Ik(a,b){var c=0,d=0;c=R-16|0;R=c;a:{if(mk(a)){d=o[a>>2];m[c+15|0]=0;pk(b+d|0,c+15|0);qk(a,b);break a}m[c+14|0]=0;pk(a+b|0,c+14|0);rk(a,b)}R=c+16|0}function Vd(a,b){var c=0;zd(a);o[a+36>>2]=0;o[a+40>>2]=0;o[a>>2]=1692;o[a+44>>2]=0;o[a+48>>2]=0;o[a+52>>2]=0;o[a+56>>2]=0;c=o[b>>2];o[b>>2]=0;o[a+60>>2]=c}function Lk(a){var b=0,c=0,d=0,e=0;b=R-32|0;R=b;c=b+8|0;d=b+21|0;e=b+32|0;a:{if((d|0)==(e|0)){break a}}Mk(c,d,e);c=o[b+8>>2];hk(a);xk(a,b+21|0,c);R=b+32|0}function Ij(a){var b=0,c=0,d=0;if(Bj(m[o[a>>2]])){while(1){b=o[a>>2];d=m[b|0];o[a>>2]=b+1;c=(u(c,10)+d|0)+ -48|0;if(Bj(m[b+1|0])){continue}break}}return c}function Vg(a){a=a|0;var b=0;o[a>>2]=8568;b=o[a+48>>2];if(b){o[a+52>>2]=b;jl(b)}o[a>>2]=8820;b=o[a+36>>2];if(b){jl(b)}b=o[a+24>>2];if(b){jl(b)}return a|0}function Jh(a){a=a|0;var b=0;o[a>>2]=9572;b=o[a+48>>2];if(b){o[a+52>>2]=b;jl(b)}o[a>>2]=9388;b=o[a+36>>2];if(b){jl(b)}b=o[a+24>>2];if(b){jl(b)}return a|0}function Gd(a,b){a=a|0;b=b|0;var c=0;a:{if(!l[o[o[a>>2]+36>>2]](a,b)){break a}if(!l[o[o[a>>2]+40>>2]](a,b)){break a}c=l[o[o[a>>2]+44>>2]](a)|0}return c|0}function pe(a){a=a|0;var b=0;o[a>>2]=1908;b=o[a+20>>2];o[a+20>>2]=0;if(b){l[o[o[b>>2]+4>>2]](b)}o[a>>2]=1596;b=o[a+16>>2];o[a+16>>2]=0;if(b){Kb(b)}jl(a)}function Bi(a,b){var c=0;b=Ai(a,b);a:{if((b|0)==(a+4|0)){break a}a=b+28|0;if(m[b+39|0]<=-1){a=o[a>>2]}a=Tj(a);if((a|0)==-1){break a}c=(a|0)!=0}return c}function fj(a,b){var c=0,d=0;c=o[b>>2];if(!c){return}d=o[a+28>>2];if(d>>>0>2]){o[b>>2]=0;o[d>>2]=c;o[a+28>>2]=o[a+28>>2]+4;return}gj(a+24|0,b)}function th(a){a=a|0;var b=0;o[a>>2]=8568;b=o[a+48>>2];if(b){o[a+52>>2]=b;jl(b)}o[a>>2]=8820;b=o[a+36>>2];if(b){jl(b)}b=o[a+24>>2];if(b){jl(b)}jl(a)}function Ph(a){a=a|0;var b=0;o[a>>2]=9572;b=o[a+48>>2];if(b){o[a+52>>2]=b;jl(b)}o[a>>2]=9388;b=o[a+36>>2];if(b){jl(b)}b=o[a+24>>2];if(b){jl(b)}jl(a)}function Mk(a,b,c){var d=0,e=0;e=a;d=c-b|0;a:{if(!((1-(r[3096]>1)|0)>(d|0)?(d|0)<=9:0)){m[b|0]=49;o[a>>2]=b+1;a=0;break a}o[a>>2]=c;a=61}o[e+4>>2]=a}function kl(a){var b=0,c=0;c=U();a:{b=o[3460];a=b+(a+3&-4)|0;if(a>>>0<=c<<16>>>0){break a}if(N(a|0)){break a}o[3314]=48;return-1}o[3460]=a;return b}function gl(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;if(Yk(a,o[b+8>>2],f)){cl(b,c,d,e);return}a=o[a+8>>2];l[o[o[a>>2]+20>>2]](a,b,c,d,e,f)}function ta(a,b,c){var d=0;d=R-16|0;R=d;Xf(d,a,b,c);o[a+24>>2]=o[d>>2];Dk(a+28|0,d|4);a=a+24|0;if(m[d+15|0]<=-1){jl(o[d+4>>2])}R=d+16|0;return a}function Rj(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0;e=R-16|0;R=e;Wj(Q(o[a+60>>2],b|0,c|0,d&255,e+8|0)|0);R=e+16|0;T=o[e+12>>2];return o[e+8>>2]}function ni(a,b,c){var d=0,e=0,f=0;if((b|0)>0){while(1){e=d<<2;f=o[e+a>>2];o[c+e>>2]=0-(f&1)^f>>>1;d=d+1|0;if((d|0)!=(b|0)){continue}break}}}function sj(a){var b=0,c=0;b=o[a+20>>2];a:{if((o[a+24>>2]-b|0)<1){break a}b=o[b>>2];if((b|0)==-1){break a}c=o[o[a+8>>2]+(b<<2)>>2]}return c}function rj(a,b){var c=0;c=-1;a:{if((b|0)==-1|(b|0)>4){break a}b=u(b,12)+a|0;a=o[b+20>>2];if((o[b+24>>2]-a|0)<1){break a}c=o[a>>2]}return c}function rd(a,b,c,d,e,f,g){o[a>>2]=0;o[a+56>>2]=b;o[a+48>>2]=0;o[a+52>>2]=0;o[a+40>>2]=f;o[a+44>>2]=g;m[a+32|0]=e;o[a+28>>2]=d;m[a+24|0]=c}function Pj(a,b){a=a|0;b=b|0;var c=0,d=0,e=0;c=b;b=o[b>>2]+15&-16;o[c>>2]=b+16;d=a,e=Zj(o[b>>2],o[b+4>>2],o[b+8>>2],o[b+12>>2]),t[d>>3]=e}function Rf(a){o[a>>2]=0;o[a+4>>2]=0;m[a+5|0]=0;m[a+6|0]=0;m[a+7|0]=0;m[a+8|0]=0;m[a+9|0]=0;m[a+10|0]=0;m[a+11|0]=0;m[a+12|0]=0;return a}function Pi(a){a=a|0;var b=0;o[a>>2]=10604;b=o[a+96>>2];if(b){o[a+100>>2]=b;jl(b)}b=o[a+84>>2];if(b){o[a+88>>2]=b;jl(b)}Qi(a);return a|0}function Mj(a,b,c,d){if(a|b){while(1){c=c+ -1|0;m[c|0]=p[(a&15)+11616|0]|d;a=(b&15)<<28|a>>>4;b=b>>>4|0;if(a|b){continue}break}}return c}function sa(a){var b=0;b=R-16|0;R=b;Yf(b);o[a+24>>2]=o[b>>2];Dk(a+28|0,b|4);a=a+24|0;if(m[b+15|0]<=-1){jl(o[b+4>>2])}R=b+16|0;return a}function qf(a,b,c){a=a|0;b=b|0;c=c|0;var d=0;a:{if(!fe(a,b,c)){break a}a=o[a+8>>2];if(p[a+24|0]!=3){break a}d=o[a+28>>2]==9}return d|0}function qa(a){var b=0;yi(a);b=a+16|0;o[b>>2]=0;o[b+4>>2]=0;o[a+24>>2]=0;o[a+28>>2]=0;o[a+12>>2]=b;o[a+32>>2]=0;o[a+36>>2]=0;return a}function Ri(a){a=a|0;var b=0;o[a>>2]=10604;b=o[a+96>>2];if(b){o[a+100>>2]=b;jl(b)}b=o[a+84>>2];if(b){o[a+88>>2]=b;jl(b)}Qi(a);jl(a)}function Lc(a,b){if(b){Lc(a,o[b>>2]);Lc(a,o[b+4>>2]);a=o[b+28>>2];if(a){o[b+32>>2]=a;jl(a)}if(m[b+27|0]<=-1){jl(o[b+16>>2])}jl(b)}}function zd(a){o[a+4>>2]=0;o[a+8>>2]=0;o[a>>2]=1384;o[a+12>>2]=0;o[a+16>>2]=0;o[a+20>>2]=0;o[a+24>>2]=0;o[a+28>>2]=0;o[a+32>>2]=0}function ff(a){a=a|0;var b=0;o[a>>2]=4588;b=o[a+76>>2];if(b){jl(b)}o[a>>2]=2732;b=o[a+32>>2];if(b){o[a+36>>2]=b;jl(b)}return a|0}function Je(a){a=a|0;var b=0;o[a>>2]=3036;b=o[a+76>>2];if(b){jl(b)}o[a>>2]=2732;b=o[a+32>>2];if(b){o[a+36>>2]=b;jl(b)}return a|0}function Rb(){var a=0;a=yk(28);o[a>>2]=0;o[a+4>>2]=0;o[a+24>>2]=0;o[a+16>>2]=0;o[a+20>>2]=0;o[a+8>>2]=0;o[a+12>>2]=0;return a|0}function zk(a,b){var c=0,d=0,e=0,f=0;c=rl(b);d=yk(c+13|0);o[d+8>>2]=0;o[d+4>>2]=c;o[d>>2]=c;e=a,f=ll(d+12|0,b,c+1|0),o[e>>2]=f}function Ed(a){a=a|0;var b=0;o[a>>2]=1384;b=o[a+16>>2];if(b){o[a+20>>2]=b;jl(b)}b=o[a+4>>2];if(b){o[a+8>>2]=b;jl(b)}return a|0}function Fc(a,b){if(b){Fc(a,o[b>>2]);Fc(a,o[b+4>>2]);if(m[b+39|0]<=-1){jl(o[b+28>>2])}if(m[b+27|0]<=-1){jl(o[b+16>>2])}jl(b)}}function yk(a){var b=0,c=0;a=a?a:1;while(1){a:{b=il(a);if(b){break a}c=o[3332];if(!c){break a}l[c]();continue}break}return b}function bl(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;if(Yk(a,o[b+8>>2],0)){$k(b,c,d);return}a=o[a+8>>2];l[o[o[a>>2]+28>>2]](a,b,c,d)}function gf(a){a=a|0;var b=0;o[a>>2]=4588;b=o[a+76>>2];if(b){jl(b)}o[a>>2]=2732;b=o[a+32>>2];if(b){o[a+36>>2]=b;jl(b)}jl(a)}function Oi(a){qj(a);o[a+84>>2]=0;o[a+88>>2]=0;o[a>>2]=10604;o[a+92>>2]=0;o[a+96>>2]=0;o[a+100>>2]=0;o[a+104>>2]=0;return a}function Ke(a){a=a|0;var b=0;o[a>>2]=3036;b=o[a+76>>2];if(b){jl(b)}o[a>>2]=2732;b=o[a+32>>2];if(b){o[a+36>>2]=b;jl(b)}jl(a)}function Lj(a,b,c){if(a|b){while(1){c=c+ -1|0;m[c|0]=a&7|48;a=(b&7)<<29|a>>>3;b=b>>>3|0;if(a|b){continue}break}}return c}function Ic(){var a=0;a=yk(24);o[a+4>>2]=0;o[a+8>>2]=0;o[a+16>>2]=0;o[a+20>>2]=0;o[a>>2]=a+4;o[a+12>>2]=a+16;return a|0}function Nb(){var a=0;a=yk(24);o[a+8>>2]=0;o[a+12>>2]=0;o[a+4>>2]=-1;o[a>>2]=1232;o[a+16>>2]=0;o[a+20>>2]=0;return a|0}function Md(a,b,c){a=a|0;b=b|0;c=c|0;o[a+4>>2]=b;b=o[o[o[b+4>>2]+8>>2]+(c<<2)>>2];o[a+12>>2]=c;o[a+8>>2]=b;return 1}function Kf(a,b,c){a=a|0;b=b|0;c=c|0;if(fe(a,b,c)){a=o[o[o[o[b+4>>2]+8>>2]+(c<<2)>>2]+28>>2]==9}else{a=0}return a|0}function Me(a){a=a|0;var b=0;if(!(!o[a+60>>2]|!o[a+44>>2]|(!o[a+48>>2]|!o[a+52>>2]))){b=o[a+56>>2]!=0}return b|0}function ra(a){var b=0;b=R-32|0;R=b;Wf(b+8|0,a);a=o[b+24>>2];if(m[b+23|0]<=-1){jl(o[b+12>>2])}R=b+32|0;return a}function Yk(a,b,c){if(!c){return o[a+4>>2]==o[b+4>>2]}if((a|0)==(b|0)){return 1}return!ik(o[a+4>>2],o[b+4>>2])}function oi(a){o[a+16>>2]=0;o[a+20>>2]=0;o[a+8>>2]=0;o[a>>2]=0;o[a+4>>2]=0;o[a+24>>2]=0;o[a+28>>2]=0;return a}function Uk(a){var b=0,c=0;a:{b=o[a>>2]+ -12|0;c=b+8|0;a=o[c>>2]+ -1|0;o[c>>2]=a;if((a|0)>-1){break a}jl(b)}}function db(a){var b=0;b=G(8)|0;o[b>>2]=12484;o[b>>2]=12528;zk(b+4|0,a);o[b>>2]=12576;H(b|0,12608,1);D()}function Dc(a){a=a|0;if(a){if(m[a+39|0]<=-1){jl(o[a+28>>2])}Ec(a+12|0,o[a+16>>2]);Fc(a,o[a+4>>2]);jl(a)}}function kf(a){a=a|0;var b=0;o[a>>2]=4812;o[a>>2]=2732;b=o[a+32>>2];if(b){o[a+36>>2]=b;jl(b)}return a|0}function Se(a){a=a|0;var b=0;o[a>>2]=3272;o[a>>2]=2732;b=o[a+32>>2];if(b){o[a+36>>2]=b;jl(b)}return a|0}function uh(a){a=a|0;var b=0;o[a>>2]=8820;b=o[a+36>>2];if(b){jl(b)}b=o[a+24>>2];if(b){jl(b)}return a|0}function Hh(a){a=a|0;var b=0;o[a>>2]=9388;b=o[a+36>>2];if(b){jl(b)}b=o[a+24>>2];if(b){jl(b)}return a|0}function xe(a){a=a|0;var b=0;if(!(!o[a+52>>2]|(!o[a+44>>2]|!o[a+48>>2]))){b=o[a+56>>2]!=0}return b|0}function hl(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;if(Yk(a,o[b+8>>2],f)){cl(b,c,d,e)}} + + + +function lf(a){a=a|0;var b=0;o[a>>2]=4812;o[a>>2]=2732;b=o[a+32>>2];if(b){o[a+36>>2]=b;jl(b)}jl(a)}function Te(a){a=a|0;var b=0;o[a>>2]=3272;o[a>>2]=2732;b=o[a+32>>2];if(b){o[a+36>>2]=b;jl(b)}jl(a)}function Ne(a,b){a=a|0;b=b|0;var c=0;if(!(o[b+56>>2]|!b|p[b+24|0]!=3)){o[a+60>>2]=b;c=1}return c|0}function vh(a){a=a|0;var b=0;o[a>>2]=8820;b=o[a+36>>2];if(b){jl(b)}b=o[a+24>>2];if(b){jl(b)}jl(a)}function dc(a,b,c){a=a|0;b=b|0;c=c|0;o[a+16>>2]=0;o[a+20>>2]=0;o[a>>2]=b;o[a+8>>2]=c;o[a+12>>2]=0}function We(a,b){a=a|0;b=b|0;var c=0;if(!(o[b+56>>2]|p[b+24|0]!=3)){o[a- -64>>2]=b;c=1}return c|0}function Ih(a){a=a|0;var b=0;o[a>>2]=9388;b=o[a+36>>2];if(b){jl(b)}b=o[a+24>>2];if(b){jl(b)}jl(a)}function Fl(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;return l[a](b,c,d,e,f,g)|0}function Af(a,b){a=a|0;b=b|0;var c=0;if(!(o[b+56>>2]|p[b+24|0]!=3)){o[a+44>>2]=b;c=1}return c|0}function ti(a,b,c,d){n[a+38>>1]=d;o[a>>2]=b;o[a+16>>2]=0;o[a+20>>2]=0;o[a+8>>2]=c;o[a+12>>2]=0}function Gl(a,b,c,d,e,f,g){a=a|0;b=b|0;c=+c;d=d|0;e=e|0;f=f|0;g=g|0;return l[a](b,c,d,e,f,g)|0}function sk(a){var b=0;if(a>>>0>=11){b=a+16&-16;a=b+ -1|0;a=(a|0)==11?b:a}else{a=10}return a}function ve(a){a=a|0;var b=0;o[a>>2]=2732;b=o[a+32>>2];if(b){o[a+36>>2]=b;jl(b)}return a|0}function Td(a){a=a|0;var b=0;o[a>>2]=1596;b=o[a+16>>2];o[a+16>>2]=0;if(b){Kb(b)}return a|0}function ld(a){a=a|0;var b=0;o[a>>2]=1232;b=o[a+8>>2];if(b){o[a+12>>2]=b;jl(b)}return a|0}function Jl(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;a=l[a](b,c,d,e)|0;P(T|0);return a|0}function Hl(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;l[a](b,c,d,e,f,g)}function we(a){a=a|0;var b=0;o[a>>2]=2732;b=o[a+32>>2];if(b){o[a+36>>2]=b;jl(b)}jl(a)}function Ud(a){a=a|0;var b=0;o[a>>2]=1596;b=o[a+16>>2];o[a+16>>2]=0;if(b){Kb(b)}jl(a)}function Rl(a){var b=0,c=0;while(1){c=b;if(a){a=a-1&a;b=b+1|0;continue}break}return c}function md(a){a=a|0;var b=0;o[a>>2]=1232;b=o[a+8>>2];if(b){o[a+12>>2]=b;jl(b)}jl(a)}function Bc(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;return Xa(b,c,d,e,f)|0}function ge(a,b){a=a|0;b=b|0;return l[o[o[a>>2]+48>>2]](a,o[b+4>>2]-o[b>>2]>>2)|0}function Ec(a,b){if(b){Ec(a,o[b>>2]);Ec(a,o[b+4>>2]);Fc(b+20|0,o[b+24>>2]);jl(b)}}function Ag(a){a=a|0;if(o[a+44>>2]){return l[o[o[a>>2]+48>>2]](a)|0}return 0} + + + +function _e(a,b){a=a|0;b=b|0;if(b>>>0<=1){o[a+28>>2]=b;a=1}else{a=0}return a|0}function Mb(a){a=a|0;var b=0;if(a){b=o[a+8>>2];if(b){o[a+12>>2]=b;jl(b)}jl(a)}}function Ld(a){o[a+12>>2]=-1;o[a+16>>2]=0;o[a+4>>2]=0;o[a+8>>2]=0;o[a>>2]=1596}function al(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;if(Yk(a,o[b+8>>2],0)){$k(b,c,d)}}function Qk(){var a=0;a=R-16|0;R=a;o[a+12>>2]=0;a=o[2779];Fj(a);Pk(a);K();D()}function Il(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;l[a](b,c,d,e,f)}function pb(a){a=a|0;var b=0;if(a){b=o[a>>2];if(b){o[a+4>>2]=b;jl(b)}jl(a)}}function mb(){var a=0;a=yk(12);o[a>>2]=0;o[a+4>>2]=0;o[a+8>>2]=0;return a|0}function kb(a){a=a|0;var b=0;b=a+4|0;if(m[a+15|0]<=-1){b=o[b>>2]}return b|0}function Kg(a,b){a=a|0;b=b|0;a=o[a+48>>2];return l[o[o[a>>2]+16>>2]](a,b)|0}function Jg(a,b){a=a|0;b=b|0;a=o[a+48>>2];return l[o[o[a>>2]+12>>2]](a,b)|0}function Gk(a,b){var c=0;c=kk(a);if(c>>>0>>0){Hk(a,b-c|0);return}Ik(a,b)}function Cg(a,b){a=a|0;b=b|0;a=o[a+48>>2];return l[o[o[a>>2]+20>>2]](a,b)|0}function lk(a){if(mk(a)){a=(o[a+8>>2]&2147483647)+ -1|0}else{a=10}return a}function Sl(a){var b=0;b=a&31;a=0-a&31;return(-1>>>b&-2)<>>a}function xi(a){a=a+ -1|0;if(a>>>0<=10){return o[(a<<2)+10476>>2]}return-1}function gk(a,b){var c=0,d=0;c=R-16|0;R=c;d=dk(a,b);R=c+16|0;return d?b:a}function ci(a,b){a=a|0;b=b|0;m[b+84|0]=1;o[b+72>>2]=o[b+68>>2];return 1}function Jc(a){a=a|0;if(a){Kc(a+12|0,o[a+16>>2]);Lc(a,o[a+4>>2]);jl(a)}}function Ad(a,b,c){a=a|0;b=b|0;c=c|0;o[a+32>>2]=c;o[a+28>>2]=b;return 1}function jd(a,b,c,d,e){o[a+4>>2]=b;kd(a+8|0,c,(d<<2)+c|0);s[a+20>>2]=e}function dl(a,b,c){if(!(o[a+28>>2]==1|o[a+4>>2]!=(b|0))){o[a+28>>2]=c}}function ak(a,b,c){var d=0;d=R-16|0;R=d;a=ck(a,b,c);R=d+16|0;return a}function yb(){var a=0;a=yk(8);o[a+4>>2]=-1;o[a>>2]=1116;return a|0}function lc(a,b,c){a=a|0;b=b|0;c=c|0;return o[o[b+8>>2]+(c<<2)>>2]}function El(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;l[a](b,c,d,e)}function lb(a){a=a|0;if(a){if(m[a+15|0]<=-1){jl(o[a+4>>2])}jl(a)}}function Ig(a){a=a|0;a=o[a+48>>2];return l[o[o[a>>2]+36>>2]](a)|0}function Fg(a){a=a|0;a=o[a+48>>2];return l[o[o[a>>2]+28>>2]](a)|0}function Eg(a){a=a|0;a=o[a+48>>2];return l[o[o[a>>2]+24>>2]](a)|0}function Bl(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return l[a](b,c,d)|0}function zc(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return Ra(b,c,d)|0}function yc(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return Oa(b,c,d)|0}function xc(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return Ma(b,c,d)|0}function wc(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return Ja(b,c,d)|0}function vc(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return Ta(b,c,d)|0}function uc(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return Ha(b,c,d)|0}function tc(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return Fa(b,c,d)|0}function sc(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return Ea(b,c,d)|0}function rc(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return Da(b,c,d)|0}function pc(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return wa(b,c,d)|0}function kc(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return va(b,c,d)|0}function Nd(a,b){a=a|0;b=b|0;o[a+12>>2]=-1;o[a+8>>2]=b;return 1}function Ac(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return Va(b,c,d)|0}function zb(a,b){a=a|0;b=b|0;return l[o[o[a>>2]+12>>2]](a,b)|0}function tk(a){if(4294967295>>0){db(12086);D()}return yk(a)}function sl(a,b){a=a|0;b=b|0;if(!o[3457]){o[3458]=b;o[3457]=a}}function Mf(a,b){a=a|0;b=b|0;return l[o[o[a>>2]+56>>2]](a,b)|0}function Lb(){var a=0;a=yk(40);o[a>>2]=-1;oi(a+8|0);return a|0}function Ob(a,b){a=a|0;b=b|0;return v(s[o[a+8>>2]+(b<<2)>>2])}function yi(a){o[a+4>>2]=0;o[a+8>>2]=0;o[a>>2]=a+4;return a}function $b(a,b){a=a|0;b=b|0;return v(s[o[a>>2]+(b<<2)>>2])}function kk(a){if(mk(a)){return o[a+4>>2]}return p[a+11|0]}function Hd(a,b){a=a|0;b=b|0;return o[o[a+4>>2]+(b<<2)>>2]}function Hc(a){a=a|0;return(o[a+100>>2]-o[a+96>>2]|0)/12|0}function Tl(a){if(a){return 31-x(a+ -1^a)|0}return 32} + + + +function wb(a,b){a=a|0;b=b|0;return o[o[a>>2]+(b<<2)>>2]}function nb(a,b){a=a|0;b=b|0;return q[o[a>>2]+(b<<1)>>1]}function _b(a,b){a=a|0;b=b|0;return n[o[a>>2]+(b<<1)>>1]}function Dl(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;l[a](b,c,d)}function zl(a,b,c){a=a|0;b=b|0;c=c|0;return l[a](b,c)|0}function rf(a,b,c){a=a|0;b=b|0;c=c|0;return ke(a,b,c)|0}function hc(a,b,c){a=a|0;b=b|0;c=c|0;return ta(a,b,c)|0}function fe(a,b,c){a=a|0;b=b|0;c=c|0;return Md(a,b,c)|0}function Yb(a,b,c){a=a|0;b=b|0;c=c|0;return oa(a,b,c)|0}function Wb(a,b,c){a=a|0;b=b|0;c=c|0;return na(a,b,c)|0}function Tk(a){a=a|0;o[a>>2]=12528;Uk(a+4|0);return a|0}function Ub(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;la(b,c,d)}function qc(a,b,c){a=a|0;b=b|0;c=c|0;return xa(b,c)|0}function oc(a,b,c){a=a|0;b=b|0;c=c|0;return cb(b,c)|0}function mc(a,b,c){a=a|0;b=b|0;c=c|0;return tj(b,c)|0}function jc(a,b,c){a=a|0;b=b|0;c=c|0;return ua(b,c)|0}function ic(a,b,c){a=a|0;b=b|0;c=c|0;return rj(b,c)|0}function Tb(a,b,c){a=a|0;b=b|0;c=c|0;return ka(b,c)|0}function Sb(a,b,c){a=a|0;b=b|0;c=c|0;return ia(b,c)|0}function Kk(a){if(kk(a)>>>0<=0){bk();D()}return nk(a)}function Dk(a,b){if((a|0)!=(b|0)){Ek(a,nk(b),kk(b))}}function rb(a){a=a|0;return o[a+12>>2]-o[a+8>>2]>>2}function qj(a){o[a>>2]=11e3;ml(a+4|0,0,80);return a}function gc(a,b,c){a=a|0;b=b|0;c=c|0;return sa(a)|0}function Vb(a,b,c){a=a|0;b=b|0;c=c|0;return+ma(b,c)}function ub(a,b){a=a|0;b=b|0;return p[o[a>>2]+b|0]}function Qb(a,b){a=a|0;b=b|0;return m[o[a>>2]+b|0]}function Id(a){a=a|0;return o[a+8>>2]-o[a+4>>2]>>2}function wk(a,b){if(mk(a)){qk(a,b);return}rk(a,b)}function tb(a){a=a|0;if(a){l[o[o[a>>2]+4>>2]](a)}}function Wj(a){if(!a){return 0}o[3314]=a;return-1}function Mg(a,b){a=a|0;b=b|0;o[a+4>>2]=b;return 1}function xb(a){a=a|0;return o[a+4>>2]-o[a>>2]>>2}function ob(a){a=a|0;return o[a+4>>2]-o[a>>2]>>1}function nk(a){if(mk(a)){return o[a>>2]}return a}function hk(a){o[a>>2]=0;o[a+4>>2]=0;o[a+8>>2]=0}function vb(a){a=a|0;return o[a+4>>2]-o[a>>2]|0}function Dj(a,b){if(!a){return 0}return Cj(a,b)}function zg(a){fi(a);o[a+44>>2]=0;o[a>>2]=8024}function ee(a){Ld(a);o[a+20>>2]=0;o[a>>2]=1908}function Hj(a,b,c){if(!(p[a|0]&32)){ql(b,c,a)}}function Al(a,b,c){a=a|0;b=b|0;c=c|0;l[a](b,c)}function xl(a,b){a=a|0;b=b|0;return l[a](b)|0}function ul(a){a=a|0;a=R-a&-16;R=a;return a|0}function qe(a){a=a|0;return m[o[a+8>>2]+24|0]}function nc(a,b){a=a|0;b=b|0;return o[b+4>>2]}function Xb(a,b){a=a|0;b=b|0;return o[b+8>>2]}function Pd(a,b,c){a=a|0;b=b|0;c=c|0;return 1}function xf(a){a=a|0;o[a>>2]=5700;return a|0}function Gf(a){a=a|0;o[a>>2]=6704;return a|0}function fc(a,b){a=a|0;b=b|0;return ra(b)|0}function Ql(a,b,c,d){a=Nl(a,b,c,d);return a}function Qj(a){a=a|0;return I(o[a+60>>2])|0}function Pl(a,b,c,d){a=Ml(a,b,c,d);return a}function Ol(a,b,c,d){a=Ll(a,b,c,d);return a}function Pb(a){a=a|0;return v(s[a+20>>2])}function vk(a,b){o[a+8>>2]=b|-2147483648}function yf(a){a=a|0;o[a>>2]=5700;jl(a)}function pi(a,b,c,d){return qi(a,b,c,d)}function dk(a,b){return r[a>>2]>2]}function Hf(a){a=a|0;o[a>>2]=6704;jl(a)}function sb(a){a=a|0;return o[a+80>>2]}function Jb(a){a=a|0;return o[a+60>>2]}function Ib(a){a=a|0;return o[a+48>>2]}function Hb(a){a=a|0;return o[a+40>>2]}function Eb(a){a=a|0;return o[a+28>>2]}function Db(a){a=a|0;return o[a+56>>2]}function Cb(a){a=a|0;return o[a+88>>2]}function ze(a,b){a=a|0;b=b|0;return-1}function jb(a){a=a|0;return!o[a>>2]|0}function hh(a){a=a|0;return o[a+8>>2]}function Wk(a){a=a|0;return o[a+4>>2]}function Kd(a,b){a=a|0;b=b|0;return 1}function Jd(a,b){a=a|0;b=b|0;return 0}function Gb(a){a=a|0;return p[a+32|0]}function Fb(a){a=a|0;return m[a+24|0]}function Ab(a){a=a|0;return o[a+4>>2]}function yl(a,b){a=a|0;b=b|0;l[a](b)}function wl(a){a=a|0;return V(a|0)|0}function Cc(a,b){a=a|0;b=b|0;Zf(a,b)}function ib(a){a=a|0;return o[a>>2]}function ek(a,b,c){if(c){ll(a,b,c)}}function Bj(a){return a+ -48>>>0<10}function $j(a,b,c){return ak(a,b,c)}function Gc(){return Oi(yk(108))|0}function qb(){return qj(yk(84))|0}function mk(a){return m[a+11|0]<0}function ec(){return qa(yk(40))|0}function cc(){return si(yk(40))|0}function bc(a){a=a|0;if(a){jl(a)}}function ac(){return qd(yk(64))|0}function Sk(a){a=a|0;return 12461}function Bb(){return ud(yk(96))|0}function Xk(a){a=a|0;Tk(a);jl(a)}function fk(a,b){return gk(a,b)}function ed(a){a=a|0;return a|0}function sh(a){a=a|0;jl(qh(a))}function pk(a,b){m[a|0]=p[b|0]}function ph(a){a=a|0;jl(oh(a))}function Vk(a){a=a|0;jl(Tk(a))}function Aj(a){a=a|0;jl(Qi(a))}function ye(a){a=a|0;return 0}function nd(a){a=a|0;return 1}function gd(a){a=a|0;return 2}function Ue(a){a=a|0;return 6}function Le(a){a=a|0;return 5}function Ee(a){a=a|0;return 4}function Bf(a){a=a|0;return 3}function rk(a,b){m[a+11|0]=b}function qk(a,b){o[a+4>>2]=b}function Nk(){db(12424);D()}function Kl(a,b){i(a|0,b|0)}function Cl(a){a=a|0;l[a]()}function Ak(){db(12360);D()}function uk(a,b){o[a>>2]=b}function fd(a){a=a|0;jl(a)}function vl(a){a=a|0;R=a}function tl(){return R|0}function Fd(a){a=a|0;D()}function bd(){return 12}function ad(){return 11}function $c(){return 10}function _c(){return 9}function Zc(){return 8}function Yc(){return 7}function Xc(){return 6}function Wc(){return 5}function Vc(){return 4}function Uc(){return 3}function Tc(){return 2}function Sc(){return 1}function Rk(){Qk();D()}function Rc(){return-5}function Qc(){return-4}function Pc(){return-3}function Ok(){bk();D()}function Oc(){return-2}function Nc(){return-1}function Mc(){return 0}function bk(){K();D()}function ok(a){a=a|0}function ha(){jk()} +// EMSCRIPTEN_END_FUNCS +l[1]=Tk;l[2]=ed;l[3]=fd;l[4]=gd;l[5]=cd;l[6]=dd;l[7]=ld;l[8]=md;l[9]=nd;l[10]=hd;l[11]=id;l[12]=Ed;l[13]=Fd;l[14]=Ad;l[15]=Bd;l[16]=Gd;l[17]=Hd;l[18]=Id;l[19]=Eb;l[20]=Jd;l[21]=Rk;l[22]=Kd;l[23]=nd;l[24]=Td;l[25]=Ud;l[26]=Md;l[27]=Nd;l[28]=Od;l[29]=Pd;l[30]=Kd;l[31]=Rd;l[32]=Sd;l[33]=be;l[34]=ce;l[35]=Wd;l[36]=Yd;l[37]=de;l[38]=Zd;l[39]=_d;l[40]=$d;l[41]=ae;l[42]=oe;l[43]=pe;l[44]=fe;l[45]=ge;l[46]=he;l[47]=ke;l[48]=ie;l[49]=qe;l[50]=me;l[51]=ve;l[52]=we;l[53]=nd;l[54]=Ab;l[55]=xe;l[56]=ye;l[57]=ze;l[58]=Jd;l[59]=ye;l[60]=nd;l[61]=Ae;l[62]=Be;l[63]=Fd;l[64]=Fd;l[65]=Ce;l[66]=De;l[67]=Ee;l[68]=xe;l[69]=Fe;l[70]=Ie;l[71]=Je;l[72]=Ke;l[73]=Le;l[74]=Me;l[75]=nd;l[76]=Jd;l[77]=Ne;l[78]=Oe;l[79]=Pe;l[80]=Se;l[81]=Te;l[82]=Ue;l[83]=Ve;l[84]=nd;l[85]=Jd;l[86]=We;l[87]=Xe;l[88]=Ye;l[89]=ed;l[90]=fd;l[91]=_e;l[92]=Eb;l[93]=Ze;l[94]=Fd;l[95]=we;l[96]=nd;l[97]=xe;l[98]=bf;l[99]=Fd;l[100]=cf;l[101]=df;l[102]=Ee;l[103]=xe;l[104]=Fe;l[105]=ef;l[106]=ff;l[107]=gf;l[108]=Le;l[109]=Me;l[110]=nd;l[111]=Jd;l[112]=Ne;l[113]=Oe;l[114]=hf;l[115]=kf;l[116]=lf;l[117]=Ue;l[118]=Ve;l[119]=nd;l[120]=Jd;l[121]=We;l[122]=Xe;l[123]=mf;l[124]=ed;l[125]=fd;l[126]=_e;l[127]=Eb;l[128]=nf;l[129]=Fd;l[130]=we;l[131]=ye;l[132]=nd;l[133]=pf;l[134]=pe;l[135]=qf;l[136]=sf;l[137]=rf;l[138]=vf;l[139]=gd;l[140]=tf;l[141]=xf;l[142]=yf;l[143]=Ue;l[144]=Ab;l[145]=zf;l[146]=nd;l[147]=Jd;l[148]=Af;l[149]=nd;l[150]=Bf;l[151]=Cf;l[152]=Df;l[153]=ed;l[154]=fd;l[155]=_e;l[156]=Eb;l[157]=Ze;l[158]=Gf;l[159]=Hf;l[160]=Ue;l[161]=zf;l[162]=nd;l[163]=Jd;l[164]=Af;l[165]=Cf;l[166]=If;l[167]=ed;l[168]=fd;l[169]=_e;l[170]=Eb;l[171]=nf;l[172]=ed;l[173]=fd;l[174]=ye;l[175]=nd;l[176]=ye;l[177]=ze;l[178]=Jd;l[179]=Ff;l[180]=Jf;l[181]=Pf;l[182]=Qf;l[183]=Kf;l[184]=Lf;l[185]=rf;l[186]=Mf;l[187]=Nf;l[188]=Of;l[189]=Bg;l[190]=Fd;l[191]=nd;l[192]=nd;l[193]=Ag;l[194]=ki;l[195]=li;l[196]=nd;l[197]=ye;l[198]=Jd;l[199]=Jd;l[200]=Gg;l[201]=Hg;l[202]=Dg;l[203]=Cg;l[204]=Fg;l[205]=Ig;l[206]=Jg;l[207]=Kg;l[208]=Eg;l[209]=oh;l[210]=ph;l[211]=Mg;l[212]=Ng;l[213]=Og;l[214]=Pg;l[215]=Wg;l[216]=nd;l[217]=Ab;l[218]=hh;l[219]=qh;l[220]=sh;l[221]=Mg;l[222]=Ng;l[223]=Og;l[224]=Pg;l[225]=jh;l[226]=nd;l[227]=Ab;l[228]=hh;l[229]=Vg;l[230]=th;l[231]=Ug;l[232]=uh;l[233]=vh;l[234]=zh;l[235]=Ah;l[236]=Bh;l[237]=Ch;l[238]=yh;l[239]=Gh;l[240]=wh;l[241]=Hh;l[242]=Ih;l[243]=Kh;l[244]=Lh;l[245]=Mh;l[246]=Nh;l[247]=Jh;l[248]=Ph;l[249]=Qh;l[250]=Rh;l[251]=Sh;l[252]=Th;l[253]=bi;l[254]=ai;l[255]=Yh;l[256]=ed;l[257]=fd;l[258]=ci;l[259]=di;l[260]=Fd;l[261]=ye;l[262]=nd;l[263]=Pi;l[264]=Ri;l[265]=Si;l[266]=Ui;l[267]=Qi;l[268]=Aj;l[269]=wj;l[270]=yj;l[271]=Qj;l[272]=Sj;l[273]=Rj;l[274]=Oj;l[275]=Pj;l[276]=ed;l[277]=fd;l[278]=Sk;l[279]=Vk;l[280]=Wk;l[281]=Xk;l[282]=ed;l[283]=fd;l[284]=ok;l[285]=ok;l[286]=Zk;l[287]=hl;l[288]=fl;l[289]=al;l[290]=fd;l[291]=gl;l[292]=el;l[293]=bl;function U(){return buffer.byteLength/65536|0}function V(pagesToAdd){pagesToAdd=pagesToAdd|0;var W=U()|0;var X=W+pagesToAdd|0;if(W=0;--$){_[48+$]=52+$;_[65+$]=$;_[97+$]=26+$}_[43]=62;_[47]=63;function aa(uint8Array,offset,b64){var ba,ca,$=0,da=offset,ea=b64.length,fa=offset+(ea*3>>2);if(b64[ea-2]=="=")--fa;if(b64[ea-1]=="=")--fa;for(;$>4;if(da+1>2;if(da+2>0]=value;break;case"i8":HEAP8[ptr>>0]=value;break;case"i16":HEAP16[ptr>>1]=value;break;case"i32":HEAP32[ptr>>2]=value;break;case"i64":tempI64=[value>>>0,(tempDouble=value,+Math_abs(tempDouble)>=1?tempDouble>0?(Math_min(+Math_floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math_ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[ptr>>2]=tempI64[0],HEAP32[ptr+4>>2]=tempI64[1];break;case"float":HEAPF32[ptr>>2]=value;break;case"double":HEAPF64[ptr>>3]=value;break;default:abort("invalid type for setValue: "+type)}}var wasmMemory;var wasmTable=new WebAssembly.Table({"initial":294,"maximum":294+0,"element":"anyfunc"});var ABORT=false;var EXITSTATUS=0;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function getCFunc(ident){var func=Module["_"+ident];assert(func,"Cannot call unknown function "+ident+", make sure it is exported");return func}function ccall(ident,returnType,argTypes,args,opts){var toC={"string":function(str){var ret=0;if(str!==null&&str!==undefined&&str!==0){var len=(str.length<<2)+1;ret=stackAlloc(len);stringToUTF8(str,ret,len)}return ret},"array":function(arr){var ret=stackAlloc(arr.length);writeArrayToMemory(arr,ret);return ret}};function convertReturnValue(ret){if(returnType==="string")return UTF8ToString(ret);if(returnType==="boolean")return Boolean(ret);return ret}var func=getCFunc(ident);var cArgs=[];var stack=0;if(args){for(var i=0;i=endIdx))++endPtr;if(endPtr-idx>16&&u8Array.subarray&&UTF8Decoder){return UTF8Decoder.decode(u8Array.subarray(idx,endPtr))}else{var str="";while(idx>10,56320|ch&1023)}}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,outU8Array,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;outU8Array[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;outU8Array[outIdx++]=192|u>>6;outU8Array[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;outU8Array[outIdx++]=224|u>>12;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;outU8Array[outIdx++]=240|u>>18;outU8Array[outIdx++]=128|u>>12&63;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}}outU8Array[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}var UTF16Decoder=typeof TextDecoder!=="undefined"?new TextDecoder("utf-16le"):undefined;function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var WASM_PAGE_SIZE=65536;function alignUp(x,multiple){if(x%multiple>0){x+=multiple-x%multiple}return x}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var STACK_BASE=5256880,DYNAMIC_BASE=5256880,DYNAMICTOP_PTR=13840;var INITIAL_INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_INITIAL_MEMORY/WASM_PAGE_SIZE})}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);HEAP32[DYNAMICTOP_PTR>>2]=DYNAMIC_BASE;function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback();continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){Module["dynCall_v"](func)}else{Module["dynCall_vi"](func,callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;callRuntimeCallbacks(__ATINIT__)}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){runtimeExited=true}function postRun(){if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnPreMain(cb){__ATMAIN__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}if(!Math.imul||Math.imul(4294967295,5)!==-5)Math.imul=function imul(a,b){var ah=a>>>16;var al=a&65535;var bh=b>>>16;var bl=b&65535;return al*bl+(ah*bl+al*bh<<16)|0};if(!Math.fround){var froundBuffer=new Float32Array(1);Math.fround=function(x){froundBuffer[0]=x;return froundBuffer[0]}}if(!Math.clz32)Math.clz32=function(x){var n=32;var y=x>>16;if(y){n-=16;x=y}y=x>>8;if(y){n-=8;x=y}y=x>>4;if(y){n-=4;x=y}y=x>>2;if(y){n-=2;x=y}y=x>>1;if(y)return n-2;return n-x};if(!Math.trunc)Math.trunc=function(x){return x<0?Math.ceil(x):Math.floor(x)};var Math_abs=Math.abs;var Math_ceil=Math.ceil;var Math_floor=Math.floor;var Math_min=Math.min;var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function addRunDependency(id){runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}what+="";out(what);err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";throw new WebAssembly.RuntimeError(what)}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return String.prototype.startsWith?filename.startsWith(dataURIPrefix):filename.indexOf(dataURIPrefix)===0}var wasmBinaryFile="draco_decoder.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(){try{if(wasmBinary){return new Uint8Array(wasmBinary)}var binary=tryParseAsDataURI(wasmBinaryFile);if(binary){return binary}if(readBinary){return readBinary(wasmBinaryFile)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary()})}return new Promise(function(resolve,reject){resolve(getBinary())})}function createWasm(){var info={"env":asmLibraryArg,"wasi_snapshot_preview1":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;removeRunDependency("wasm-instantiate")}addRunDependency("wasm-instantiate");function receiveInstantiatedSource(output){receiveInstance(output["instance"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){return WebAssembly.instantiate(binary,info)}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&typeof fetch==="function"){fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiatedSource,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");instantiateArrayBuffer(receiveInstantiatedSource)})})}else{return instantiateArrayBuffer(receiveInstantiatedSource)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;__ATINIT__.push({func:function(){___wasm_call_ctors()}});function demangle(func){return func}function demangleAll(text){var regex=/\b_Z[\w\d_]+/g;return text.replace(regex,function(x){var y=demangle(x);return x===y?x:y+" ["+x+"]"})}function jsStackTrace(){var err=new Error;if(!err.stack){try{throw new Error}catch(e){err=e}if(!err.stack){return"(no stack trace available)"}}return err.stack.toString()}function ___cxa_allocate_exception(size){return _malloc(size)}var ___exception_infos={};var ___exception_last=0;function __ZSt18uncaught_exceptionv(){return __ZSt18uncaught_exceptionv.uncaught_exceptions>0}function ___cxa_throw(ptr,type,destructor){___exception_infos[ptr]={ptr:ptr,adjusted:[ptr],type:type,destructor:destructor,refcount:0,caught:false,rethrown:false};___exception_last=ptr;if(!("uncaught_exception"in __ZSt18uncaught_exceptionv)){__ZSt18uncaught_exceptionv.uncaught_exceptions=1}else{__ZSt18uncaught_exceptionv.uncaught_exceptions++}throw ptr}function _abort(){abort()}function _emscripten_get_sbrk_ptr(){return 13840}var _emscripten_memcpy_big=Uint8Array.prototype.copyWithin?function(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}:function(dest,src,num){HEAPU8.set(HEAPU8.subarray(src,src+num),dest)};function _emscripten_get_heap_size(){return HEAPU8.length}function emscripten_realloc_buffer(size){try{wasmMemory.grow(size-buffer.byteLength+65535>>16);updateGlobalBufferAndViews(wasmMemory.buffer);return 1}catch(e){}}function _emscripten_resize_heap(requestedSize){var oldSize=_emscripten_get_heap_size();var PAGE_MULTIPLE=65536;var maxHeapSize=2147483648-PAGE_MULTIPLE;if(requestedSize>maxHeapSize){return false}var minHeapSize=16777216;for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize*(1+.2/cutDown);overGrownHeapSize=Math.min(overGrownHeapSize,requestedSize+100663296);var newSize=Math.min(maxHeapSize,alignUp(Math.max(minHeapSize,requestedSize,overGrownHeapSize),PAGE_MULTIPLE));var replacement=emscripten_realloc_buffer(newSize);if(replacement){return true}}return false}var ENV={};function __getExecutableName(){return thisProgram||"./this.program"}function _emscripten_get_environ(){if(!_emscripten_get_environ.strings){var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8","_":__getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}_emscripten_get_environ.strings=strings}return _emscripten_get_environ.strings}function _environ_get(__environ,environ_buf){var strings=_emscripten_get_environ();var bufSize=0;strings.forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}function _environ_sizes_get(penviron_count,penviron_buf_size){var strings=_emscripten_get_environ();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};var SYSCALLS={mappings:{},buffers:[null,[],[]],printChar:function(stream,curr){var buffer=SYSCALLS.buffers[stream];if(curr===0||curr===10){(stream===1?out:err)(UTF8ArrayToString(buffer,0));buffer.length=0}else{buffer.push(curr)}},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},get64:function(low,high){return low}};function _fd_close(fd){return 0}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){}function _fd_write(fd,iov,iovcnt,pnum){var num=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];for(var j=0;j>2]=num;return 0}var ASSERTIONS=false;function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}function intArrayToString(array){var ret=[];for(var i=0;i255){if(ASSERTIONS){assert(false,"Character code "+chr+" ("+String.fromCharCode(chr)+") at offset "+i+" not in 0x00-0xFF.")}chr&=255}ret.push(String.fromCharCode(chr))}return ret.join("")}var decodeBase64=typeof atob==="function"?atob:function(input){var keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";var output="";var chr1,chr2,chr3;var enc1,enc2,enc3,enc4;var i=0;input=input.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{enc1=keyStr.indexOf(input.charAt(i++));enc2=keyStr.indexOf(input.charAt(i++));enc3=keyStr.indexOf(input.charAt(i++));enc4=keyStr.indexOf(input.charAt(i++));chr1=enc1<<2|enc2>>4;chr2=(enc2&15)<<4|enc3>>2;chr3=(enc3&3)<<6|enc4;output=output+String.fromCharCode(chr1);if(enc3!==64){output=output+String.fromCharCode(chr2)}if(enc4!==64){output=output+String.fromCharCode(chr3)}}while(i0){return}preRun();if(runDependencies>0)return;function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}noExitRuntime=true;run();function WrapperObject(){}WrapperObject.prototype=Object.create(WrapperObject.prototype);WrapperObject.prototype.constructor=WrapperObject;WrapperObject.prototype.__class__=WrapperObject;WrapperObject.__cache__={};Module["WrapperObject"]=WrapperObject;function getCache(__class__){return(__class__||WrapperObject).__cache__}Module["getCache"]=getCache;function wrapPointer(ptr,__class__){var cache=getCache(__class__);var ret=cache[ptr];if(ret)return ret;ret=Object.create((__class__||WrapperObject).prototype);ret.ptr=ptr;return cache[ptr]=ret}Module["wrapPointer"]=wrapPointer;function castObject(obj,__class__){return wrapPointer(obj.ptr,__class__)}Module["castObject"]=castObject;Module["NULL"]=wrapPointer(0);function destroy(obj){if(!obj["__destroy__"])throw"Error: Cannot destroy object. (Did you create it yourself?)";obj["__destroy__"]();delete getCache(obj.__class__)[obj.ptr]}Module["destroy"]=destroy;function compare(obj1,obj2){return obj1.ptr===obj2.ptr}Module["compare"]=compare;function getPointer(obj){return obj.ptr}Module["getPointer"]=getPointer;function getClass(obj){return obj.__class__}Module["getClass"]=getClass;var ensureCache={buffer:0,size:0,pos:0,temps:[],needed:0,prepare:function(){if(ensureCache.needed){for(var i=0;i=ensureCache.size){assert(len>0);ensureCache.needed+=len;ret=Module["_malloc"](len);ensureCache.temps.push(ret)}else{ret=ensureCache.buffer+ensureCache.pos;ensureCache.pos+=len}return ret},copy:function(array,view,offset){var offsetShifted=offset;var bytes=view.BYTES_PER_ELEMENT;switch(bytes){case 2:offsetShifted>>=1;break;case 4:offsetShifted>>=2;break;case 8:offsetShifted>>=3;break}for(var i=0;i=d);)++b;if(16k?d+=String.fromCharCode(k):(k-=65536,d+=String.fromCharCode(55296|k>>10,56320|k&1023))}}else d+=String.fromCharCode(k)}return d}function X(a,c){return a?h(ca,a,c):""}function e(a,c){0=d&&(d=65536+((d&1023)<<10)|a.charCodeAt(++b)&1023);127>=d?++c:c=2047>=d?c+2:65535>=d?c+3:c+4}c=Array(c+1);b=0;d=c.length;if(0=e){var f=a.charCodeAt(++k);e=65536+((e&1023)<<10)|f&1023}if(127>=e){if(b>=d)break;c[b++]=e}else{if(2047>=e){if(b+1>=d)break;c[b++]=192|e>>6}else{if(65535>=e){if(b+2>=d)break;c[b++]=224|e>>12}else{if(b+3>=d)break;c[b++]=240|e>>18;c[b++]=128|e>>12&63}c[b++]=128|e>>6&63}c[b++]=128| +e&63}}c[b]=0}a=n.alloc(c,T);n.copy(c,T,a)}return a}function x(){throw"cannot construct a Status, no constructor in IDL";}function A(){this.ptr=Oa();u(A)[this.ptr]=this}function B(){this.ptr=Pa();u(B)[this.ptr]=this}function C(){this.ptr=Qa();u(C)[this.ptr]=this}function D(){this.ptr=Ra();u(D)[this.ptr]=this}function E(){this.ptr=Sa();u(E)[this.ptr]=this}function q(){this.ptr=Ta();u(q)[this.ptr]=this}function J(){this.ptr=Ua();u(J)[this.ptr]=this}function w(){this.ptr=Va();u(w)[this.ptr]=this}function F(){this.ptr= +Wa();u(F)[this.ptr]=this}function r(){this.ptr=Xa();u(r)[this.ptr]=this}function G(){this.ptr=Ya();u(G)[this.ptr]=this}function H(){this.ptr=Za();u(H)[this.ptr]=this}function O(){this.ptr=$a();u(O)[this.ptr]=this}function K(){this.ptr=ab();u(K)[this.ptr]=this}function g(){this.ptr=bb();u(g)[this.ptr]=this}function y(){this.ptr=cb();u(y)[this.ptr]=this}function Q(){throw"cannot construct a VoidPtr, no constructor in IDL";}function I(){this.ptr=db();u(I)[this.ptr]=this}function L(){this.ptr=eb();u(L)[this.ptr]= +this}m=m||{};var a="undefined"!==typeof m?m:{},Ga=!1,Ha=!1;a.onRuntimeInitialized=function(){Ga=!0;if(Ha&&"function"===typeof a.onModuleLoaded)a.onModuleLoaded(a)};a.onModuleParsed=function(){Ha=!0;if(Ga&&"function"===typeof a.onModuleLoaded)a.onModuleLoaded(a)};a.isVersionSupported=function(a){if("string"!==typeof a)return!1;a=a.split(".");return 2>a.length||3=a[1]?!0:0!=a[0]||10>2]},getStr:function(){return X(R.get())}, +get64:function(){var a=R.get();R.get();return a},getZero:function(){R.get()}},Ka={__cxa_allocate_exception:function(a){return ib(a)},__cxa_throw:function(a,c,b){"uncaught_exception"in ta?ta.uncaught_exceptions++:ta.uncaught_exceptions=1;throw a;},abort:function(){z()},emscripten_get_sbrk_ptr:function(){return 13664},emscripten_memcpy_big:function(a,c,b){ca.set(ca.subarray(c,c+b),a)},emscripten_resize_heap:function(a){if(2147418112= +c?e(2*c,65536):Math.min(e((3*c+2147483648)/4,65536),2147418112);a:{try{ia.grow(c-ka.byteLength+65535>>16);l(ia.buffer);var b=1;break a}catch(d){}b=void 0}return b?!0:!1},environ_get:function(a,c){var b=0;ba().forEach(function(d,e){var f=c+b;e=P[a+4*e>>2]=f;for(f=0;f>0]=d.charCodeAt(f);T[e>>0]=0;b+=d.length+1});return 0},environ_sizes_get:function(a,c){var b=ba();P[a>>2]=b.length;var d=0;b.forEach(function(a){d+=a.length+1});P[c>>2]=d;return 0},fd_close:function(a){return 0},fd_seek:function(a, +c,b,d,e){return 0},fd_write:function(a,c,b,d){try{for(var e=0,f=0;f>2],k=P[c+(8*f+4)>>2],h=0;h>2]=e;return 0}catch(ua){return"undefined"!==typeof FS&&ua instanceof FS.ErrnoError||z(ua),ua.errno}},memory:ia,setTempRet0:function(a){},table:gb},La=function(){function e(c,b){a.asm=c.exports;aa--;a.monitorRunDependencies&&a.monitorRunDependencies(aa);0==aa&&(null!==sa&&(clearInterval(sa),sa=null),ja&&(c=ja,ja=null,c()))}function c(a){e(a.instance)} +function b(a){return Ma().then(function(a){return WebAssembly.instantiate(a,d)}).then(a,function(a){Y("failed to asynchronously prepare wasm: "+a);z(a)})}var d={env:Ka,wasi_unstable:Ka};aa++;a.monitorRunDependencies&&a.monitorRunDependencies(aa);if(a.instantiateWasm)try{return a.instantiateWasm(d,e)}catch(Na){return Y("Module.instantiateWasm callback failed with error: "+Na),!1}(function(){if(da||"function"!==typeof WebAssembly.instantiateStreaming||va(U)||"function"!==typeof fetch)return b(c);fetch(U, +{credentials:"same-origin"}).then(function(a){return WebAssembly.instantiateStreaming(a,d).then(c,function(a){Y("wasm streaming compile failed: "+a);Y("falling back to ArrayBuffer instantiation");b(c)})})})();return{}}();a.asm=La;var hb=a.___wasm_call_ctors=function(){return a.asm.__wasm_call_ctors.apply(null,arguments)},jb=a._emscripten_bind_Status_code_0=function(){return a.asm.emscripten_bind_Status_code_0.apply(null,arguments)},kb=a._emscripten_bind_Status_ok_0=function(){return a.asm.emscripten_bind_Status_ok_0.apply(null, +arguments)},lb=a._emscripten_bind_Status_error_msg_0=function(){return a.asm.emscripten_bind_Status_error_msg_0.apply(null,arguments)},mb=a._emscripten_bind_Status___destroy___0=function(){return a.asm.emscripten_bind_Status___destroy___0.apply(null,arguments)},Oa=a._emscripten_bind_DracoUInt16Array_DracoUInt16Array_0=function(){return a.asm.emscripten_bind_DracoUInt16Array_DracoUInt16Array_0.apply(null,arguments)},nb=a._emscripten_bind_DracoUInt16Array_GetValue_1=function(){return a.asm.emscripten_bind_DracoUInt16Array_GetValue_1.apply(null, +arguments)},ob=a._emscripten_bind_DracoUInt16Array_size_0=function(){return a.asm.emscripten_bind_DracoUInt16Array_size_0.apply(null,arguments)},pb=a._emscripten_bind_DracoUInt16Array___destroy___0=function(){return a.asm.emscripten_bind_DracoUInt16Array___destroy___0.apply(null,arguments)},Pa=a._emscripten_bind_PointCloud_PointCloud_0=function(){return a.asm.emscripten_bind_PointCloud_PointCloud_0.apply(null,arguments)},qb=a._emscripten_bind_PointCloud_num_attributes_0=function(){return a.asm.emscripten_bind_PointCloud_num_attributes_0.apply(null, +arguments)},rb=a._emscripten_bind_PointCloud_num_points_0=function(){return a.asm.emscripten_bind_PointCloud_num_points_0.apply(null,arguments)},sb=a._emscripten_bind_PointCloud___destroy___0=function(){return a.asm.emscripten_bind_PointCloud___destroy___0.apply(null,arguments)},Qa=a._emscripten_bind_DracoUInt8Array_DracoUInt8Array_0=function(){return a.asm.emscripten_bind_DracoUInt8Array_DracoUInt8Array_0.apply(null,arguments)},tb=a._emscripten_bind_DracoUInt8Array_GetValue_1=function(){return a.asm.emscripten_bind_DracoUInt8Array_GetValue_1.apply(null, +arguments)},ub=a._emscripten_bind_DracoUInt8Array_size_0=function(){return a.asm.emscripten_bind_DracoUInt8Array_size_0.apply(null,arguments)},vb=a._emscripten_bind_DracoUInt8Array___destroy___0=function(){return a.asm.emscripten_bind_DracoUInt8Array___destroy___0.apply(null,arguments)},Ra=a._emscripten_bind_DracoUInt32Array_DracoUInt32Array_0=function(){return a.asm.emscripten_bind_DracoUInt32Array_DracoUInt32Array_0.apply(null,arguments)},wb=a._emscripten_bind_DracoUInt32Array_GetValue_1=function(){return a.asm.emscripten_bind_DracoUInt32Array_GetValue_1.apply(null, +arguments)},xb=a._emscripten_bind_DracoUInt32Array_size_0=function(){return a.asm.emscripten_bind_DracoUInt32Array_size_0.apply(null,arguments)},yb=a._emscripten_bind_DracoUInt32Array___destroy___0=function(){return a.asm.emscripten_bind_DracoUInt32Array___destroy___0.apply(null,arguments)},Sa=a._emscripten_bind_AttributeOctahedronTransform_AttributeOctahedronTransform_0=function(){return a.asm.emscripten_bind_AttributeOctahedronTransform_AttributeOctahedronTransform_0.apply(null,arguments)},zb=a._emscripten_bind_AttributeOctahedronTransform_InitFromAttribute_1= +function(){return a.asm.emscripten_bind_AttributeOctahedronTransform_InitFromAttribute_1.apply(null,arguments)},Ab=a._emscripten_bind_AttributeOctahedronTransform_quantization_bits_0=function(){return a.asm.emscripten_bind_AttributeOctahedronTransform_quantization_bits_0.apply(null,arguments)},Bb=a._emscripten_bind_AttributeOctahedronTransform___destroy___0=function(){return a.asm.emscripten_bind_AttributeOctahedronTransform___destroy___0.apply(null,arguments)},Ta=a._emscripten_bind_PointAttribute_PointAttribute_0= +function(){return a.asm.emscripten_bind_PointAttribute_PointAttribute_0.apply(null,arguments)},Cb=a._emscripten_bind_PointAttribute_size_0=function(){return a.asm.emscripten_bind_PointAttribute_size_0.apply(null,arguments)},Db=a._emscripten_bind_PointAttribute_GetAttributeTransformData_0=function(){return a.asm.emscripten_bind_PointAttribute_GetAttributeTransformData_0.apply(null,arguments)},Eb=a._emscripten_bind_PointAttribute_attribute_type_0=function(){return a.asm.emscripten_bind_PointAttribute_attribute_type_0.apply(null, +arguments)},Fb=a._emscripten_bind_PointAttribute_data_type_0=function(){return a.asm.emscripten_bind_PointAttribute_data_type_0.apply(null,arguments)},Gb=a._emscripten_bind_PointAttribute_num_components_0=function(){return a.asm.emscripten_bind_PointAttribute_num_components_0.apply(null,arguments)},Hb=a._emscripten_bind_PointAttribute_normalized_0=function(){return a.asm.emscripten_bind_PointAttribute_normalized_0.apply(null,arguments)},Ib=a._emscripten_bind_PointAttribute_byte_stride_0=function(){return a.asm.emscripten_bind_PointAttribute_byte_stride_0.apply(null, +arguments)},Jb=a._emscripten_bind_PointAttribute_byte_offset_0=function(){return a.asm.emscripten_bind_PointAttribute_byte_offset_0.apply(null,arguments)},Kb=a._emscripten_bind_PointAttribute_unique_id_0=function(){return a.asm.emscripten_bind_PointAttribute_unique_id_0.apply(null,arguments)},Lb=a._emscripten_bind_PointAttribute___destroy___0=function(){return a.asm.emscripten_bind_PointAttribute___destroy___0.apply(null,arguments)},Ua=a._emscripten_bind_AttributeTransformData_AttributeTransformData_0= +function(){return a.asm.emscripten_bind_AttributeTransformData_AttributeTransformData_0.apply(null,arguments)},Mb=a._emscripten_bind_AttributeTransformData_transform_type_0=function(){return a.asm.emscripten_bind_AttributeTransformData_transform_type_0.apply(null,arguments)},Nb=a._emscripten_bind_AttributeTransformData___destroy___0=function(){return a.asm.emscripten_bind_AttributeTransformData___destroy___0.apply(null,arguments)},Va=a._emscripten_bind_AttributeQuantizationTransform_AttributeQuantizationTransform_0= +function(){return a.asm.emscripten_bind_AttributeQuantizationTransform_AttributeQuantizationTransform_0.apply(null,arguments)},Ob=a._emscripten_bind_AttributeQuantizationTransform_InitFromAttribute_1=function(){return a.asm.emscripten_bind_AttributeQuantizationTransform_InitFromAttribute_1.apply(null,arguments)},Pb=a._emscripten_bind_AttributeQuantizationTransform_quantization_bits_0=function(){return a.asm.emscripten_bind_AttributeQuantizationTransform_quantization_bits_0.apply(null,arguments)}, +Qb=a._emscripten_bind_AttributeQuantizationTransform_min_value_1=function(){return a.asm.emscripten_bind_AttributeQuantizationTransform_min_value_1.apply(null,arguments)},Rb=a._emscripten_bind_AttributeQuantizationTransform_range_0=function(){return a.asm.emscripten_bind_AttributeQuantizationTransform_range_0.apply(null,arguments)},Sb=a._emscripten_bind_AttributeQuantizationTransform___destroy___0=function(){return a.asm.emscripten_bind_AttributeQuantizationTransform___destroy___0.apply(null,arguments)}, +Wa=a._emscripten_bind_DracoInt8Array_DracoInt8Array_0=function(){return a.asm.emscripten_bind_DracoInt8Array_DracoInt8Array_0.apply(null,arguments)},Tb=a._emscripten_bind_DracoInt8Array_GetValue_1=function(){return a.asm.emscripten_bind_DracoInt8Array_GetValue_1.apply(null,arguments)},Ub=a._emscripten_bind_DracoInt8Array_size_0=function(){return a.asm.emscripten_bind_DracoInt8Array_size_0.apply(null,arguments)},Vb=a._emscripten_bind_DracoInt8Array___destroy___0=function(){return a.asm.emscripten_bind_DracoInt8Array___destroy___0.apply(null, +arguments)},Xa=a._emscripten_bind_MetadataQuerier_MetadataQuerier_0=function(){return a.asm.emscripten_bind_MetadataQuerier_MetadataQuerier_0.apply(null,arguments)},Wb=a._emscripten_bind_MetadataQuerier_HasEntry_2=function(){return a.asm.emscripten_bind_MetadataQuerier_HasEntry_2.apply(null,arguments)},Xb=a._emscripten_bind_MetadataQuerier_GetIntEntry_2=function(){return a.asm.emscripten_bind_MetadataQuerier_GetIntEntry_2.apply(null,arguments)},Yb=a._emscripten_bind_MetadataQuerier_GetIntEntryArray_3= +function(){return a.asm.emscripten_bind_MetadataQuerier_GetIntEntryArray_3.apply(null,arguments)},Zb=a._emscripten_bind_MetadataQuerier_GetDoubleEntry_2=function(){return a.asm.emscripten_bind_MetadataQuerier_GetDoubleEntry_2.apply(null,arguments)},$b=a._emscripten_bind_MetadataQuerier_GetStringEntry_2=function(){return a.asm.emscripten_bind_MetadataQuerier_GetStringEntry_2.apply(null,arguments)},ac=a._emscripten_bind_MetadataQuerier_NumEntries_1=function(){return a.asm.emscripten_bind_MetadataQuerier_NumEntries_1.apply(null, +arguments)},bc=a._emscripten_bind_MetadataQuerier_GetEntryName_2=function(){return a.asm.emscripten_bind_MetadataQuerier_GetEntryName_2.apply(null,arguments)},cc=a._emscripten_bind_MetadataQuerier___destroy___0=function(){return a.asm.emscripten_bind_MetadataQuerier___destroy___0.apply(null,arguments)},Ya=a._emscripten_bind_DracoInt16Array_DracoInt16Array_0=function(){return a.asm.emscripten_bind_DracoInt16Array_DracoInt16Array_0.apply(null,arguments)},dc=a._emscripten_bind_DracoInt16Array_GetValue_1= +function(){return a.asm.emscripten_bind_DracoInt16Array_GetValue_1.apply(null,arguments)},ec=a._emscripten_bind_DracoInt16Array_size_0=function(){return a.asm.emscripten_bind_DracoInt16Array_size_0.apply(null,arguments)},fc=a._emscripten_bind_DracoInt16Array___destroy___0=function(){return a.asm.emscripten_bind_DracoInt16Array___destroy___0.apply(null,arguments)},Za=a._emscripten_bind_DracoFloat32Array_DracoFloat32Array_0=function(){return a.asm.emscripten_bind_DracoFloat32Array_DracoFloat32Array_0.apply(null, +arguments)},gc=a._emscripten_bind_DracoFloat32Array_GetValue_1=function(){return a.asm.emscripten_bind_DracoFloat32Array_GetValue_1.apply(null,arguments)},hc=a._emscripten_bind_DracoFloat32Array_size_0=function(){return a.asm.emscripten_bind_DracoFloat32Array_size_0.apply(null,arguments)},ic=a._emscripten_bind_DracoFloat32Array___destroy___0=function(){return a.asm.emscripten_bind_DracoFloat32Array___destroy___0.apply(null,arguments)},$a=a._emscripten_bind_GeometryAttribute_GeometryAttribute_0=function(){return a.asm.emscripten_bind_GeometryAttribute_GeometryAttribute_0.apply(null, +arguments)},jc=a._emscripten_bind_GeometryAttribute___destroy___0=function(){return a.asm.emscripten_bind_GeometryAttribute___destroy___0.apply(null,arguments)},ab=a._emscripten_bind_DecoderBuffer_DecoderBuffer_0=function(){return a.asm.emscripten_bind_DecoderBuffer_DecoderBuffer_0.apply(null,arguments)},kc=a._emscripten_bind_DecoderBuffer_Init_2=function(){return a.asm.emscripten_bind_DecoderBuffer_Init_2.apply(null,arguments)},lc=a._emscripten_bind_DecoderBuffer___destroy___0=function(){return a.asm.emscripten_bind_DecoderBuffer___destroy___0.apply(null, +arguments)},bb=a._emscripten_bind_Decoder_Decoder_0=function(){return a.asm.emscripten_bind_Decoder_Decoder_0.apply(null,arguments)},mc=a._emscripten_bind_Decoder_GetEncodedGeometryType_1=function(){return a.asm.emscripten_bind_Decoder_GetEncodedGeometryType_1.apply(null,arguments)},nc=a._emscripten_bind_Decoder_DecodeBufferToPointCloud_2=function(){return a.asm.emscripten_bind_Decoder_DecodeBufferToPointCloud_2.apply(null,arguments)},oc=a._emscripten_bind_Decoder_DecodeBufferToMesh_2=function(){return a.asm.emscripten_bind_Decoder_DecodeBufferToMesh_2.apply(null, +arguments)},pc=a._emscripten_bind_Decoder_GetAttributeId_2=function(){return a.asm.emscripten_bind_Decoder_GetAttributeId_2.apply(null,arguments)},qc=a._emscripten_bind_Decoder_GetAttributeIdByName_2=function(){return a.asm.emscripten_bind_Decoder_GetAttributeIdByName_2.apply(null,arguments)},rc=a._emscripten_bind_Decoder_GetAttributeIdByMetadataEntry_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeIdByMetadataEntry_3.apply(null,arguments)},sc=a._emscripten_bind_Decoder_GetAttribute_2= +function(){return a.asm.emscripten_bind_Decoder_GetAttribute_2.apply(null,arguments)},tc=a._emscripten_bind_Decoder_GetAttributeByUniqueId_2=function(){return a.asm.emscripten_bind_Decoder_GetAttributeByUniqueId_2.apply(null,arguments)},uc=a._emscripten_bind_Decoder_GetMetadata_1=function(){return a.asm.emscripten_bind_Decoder_GetMetadata_1.apply(null,arguments)},vc=a._emscripten_bind_Decoder_GetAttributeMetadata_2=function(){return a.asm.emscripten_bind_Decoder_GetAttributeMetadata_2.apply(null, +arguments)},wc=a._emscripten_bind_Decoder_GetFaceFromMesh_3=function(){return a.asm.emscripten_bind_Decoder_GetFaceFromMesh_3.apply(null,arguments)},xc=a._emscripten_bind_Decoder_GetTriangleStripsFromMesh_2=function(){return a.asm.emscripten_bind_Decoder_GetTriangleStripsFromMesh_2.apply(null,arguments)},yc=a._emscripten_bind_Decoder_GetTrianglesUInt16Array_3=function(){return a.asm.emscripten_bind_Decoder_GetTrianglesUInt16Array_3.apply(null,arguments)},zc=a._emscripten_bind_Decoder_GetTrianglesUInt32Array_3= +function(){return a.asm.emscripten_bind_Decoder_GetTrianglesUInt32Array_3.apply(null,arguments)},Ac=a._emscripten_bind_Decoder_GetAttributeFloat_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeFloat_3.apply(null,arguments)},Bc=a._emscripten_bind_Decoder_GetAttributeFloatForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeFloatForAllPoints_3.apply(null,arguments)},Cc=a._emscripten_bind_Decoder_GetAttributeIntForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeIntForAllPoints_3.apply(null, +arguments)},Dc=a._emscripten_bind_Decoder_GetAttributeInt8ForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeInt8ForAllPoints_3.apply(null,arguments)},Ec=a._emscripten_bind_Decoder_GetAttributeUInt8ForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeUInt8ForAllPoints_3.apply(null,arguments)},Fc=a._emscripten_bind_Decoder_GetAttributeInt16ForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeInt16ForAllPoints_3.apply(null,arguments)}, +Gc=a._emscripten_bind_Decoder_GetAttributeUInt16ForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeUInt16ForAllPoints_3.apply(null,arguments)},Hc=a._emscripten_bind_Decoder_GetAttributeInt32ForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeInt32ForAllPoints_3.apply(null,arguments)},Ic=a._emscripten_bind_Decoder_GetAttributeUInt32ForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeUInt32ForAllPoints_3.apply(null,arguments)},Jc= +a._emscripten_bind_Decoder_GetAttributeDataArrayForAllPoints_5=function(){return a.asm.emscripten_bind_Decoder_GetAttributeDataArrayForAllPoints_5.apply(null,arguments)},Kc=a._emscripten_bind_Decoder_SkipAttributeTransform_1=function(){return a.asm.emscripten_bind_Decoder_SkipAttributeTransform_1.apply(null,arguments)},Lc=a._emscripten_bind_Decoder___destroy___0=function(){return a.asm.emscripten_bind_Decoder___destroy___0.apply(null,arguments)},cb=a._emscripten_bind_Mesh_Mesh_0=function(){return a.asm.emscripten_bind_Mesh_Mesh_0.apply(null, +arguments)},Mc=a._emscripten_bind_Mesh_num_faces_0=function(){return a.asm.emscripten_bind_Mesh_num_faces_0.apply(null,arguments)},Nc=a._emscripten_bind_Mesh_num_attributes_0=function(){return a.asm.emscripten_bind_Mesh_num_attributes_0.apply(null,arguments)},Oc=a._emscripten_bind_Mesh_num_points_0=function(){return a.asm.emscripten_bind_Mesh_num_points_0.apply(null,arguments)},Pc=a._emscripten_bind_Mesh___destroy___0=function(){return a.asm.emscripten_bind_Mesh___destroy___0.apply(null,arguments)}, +Qc=a._emscripten_bind_VoidPtr___destroy___0=function(){return a.asm.emscripten_bind_VoidPtr___destroy___0.apply(null,arguments)},db=a._emscripten_bind_DracoInt32Array_DracoInt32Array_0=function(){return a.asm.emscripten_bind_DracoInt32Array_DracoInt32Array_0.apply(null,arguments)},Rc=a._emscripten_bind_DracoInt32Array_GetValue_1=function(){return a.asm.emscripten_bind_DracoInt32Array_GetValue_1.apply(null,arguments)},Sc=a._emscripten_bind_DracoInt32Array_size_0=function(){return a.asm.emscripten_bind_DracoInt32Array_size_0.apply(null, +arguments)},Tc=a._emscripten_bind_DracoInt32Array___destroy___0=function(){return a.asm.emscripten_bind_DracoInt32Array___destroy___0.apply(null,arguments)},eb=a._emscripten_bind_Metadata_Metadata_0=function(){return a.asm.emscripten_bind_Metadata_Metadata_0.apply(null,arguments)},Uc=a._emscripten_bind_Metadata___destroy___0=function(){return a.asm.emscripten_bind_Metadata___destroy___0.apply(null,arguments)},Vc=a._emscripten_enum_draco_StatusCode_OK=function(){return a.asm.emscripten_enum_draco_StatusCode_OK.apply(null, +arguments)},Wc=a._emscripten_enum_draco_StatusCode_DRACO_ERROR=function(){return a.asm.emscripten_enum_draco_StatusCode_DRACO_ERROR.apply(null,arguments)},Xc=a._emscripten_enum_draco_StatusCode_IO_ERROR=function(){return a.asm.emscripten_enum_draco_StatusCode_IO_ERROR.apply(null,arguments)},Yc=a._emscripten_enum_draco_StatusCode_INVALID_PARAMETER=function(){return a.asm.emscripten_enum_draco_StatusCode_INVALID_PARAMETER.apply(null,arguments)},Zc=a._emscripten_enum_draco_StatusCode_UNSUPPORTED_VERSION= +function(){return a.asm.emscripten_enum_draco_StatusCode_UNSUPPORTED_VERSION.apply(null,arguments)},$c=a._emscripten_enum_draco_StatusCode_UNKNOWN_VERSION=function(){return a.asm.emscripten_enum_draco_StatusCode_UNKNOWN_VERSION.apply(null,arguments)},ad=a._emscripten_enum_draco_DataType_DT_INVALID=function(){return a.asm.emscripten_enum_draco_DataType_DT_INVALID.apply(null,arguments)},bd=a._emscripten_enum_draco_DataType_DT_INT8=function(){return a.asm.emscripten_enum_draco_DataType_DT_INT8.apply(null, +arguments)},cd=a._emscripten_enum_draco_DataType_DT_UINT8=function(){return a.asm.emscripten_enum_draco_DataType_DT_UINT8.apply(null,arguments)},dd=a._emscripten_enum_draco_DataType_DT_INT16=function(){return a.asm.emscripten_enum_draco_DataType_DT_INT16.apply(null,arguments)},ed=a._emscripten_enum_draco_DataType_DT_UINT16=function(){return a.asm.emscripten_enum_draco_DataType_DT_UINT16.apply(null,arguments)},fd=a._emscripten_enum_draco_DataType_DT_INT32=function(){return a.asm.emscripten_enum_draco_DataType_DT_INT32.apply(null, +arguments)},gd=a._emscripten_enum_draco_DataType_DT_UINT32=function(){return a.asm.emscripten_enum_draco_DataType_DT_UINT32.apply(null,arguments)},hd=a._emscripten_enum_draco_DataType_DT_INT64=function(){return a.asm.emscripten_enum_draco_DataType_DT_INT64.apply(null,arguments)},id=a._emscripten_enum_draco_DataType_DT_UINT64=function(){return a.asm.emscripten_enum_draco_DataType_DT_UINT64.apply(null,arguments)},jd=a._emscripten_enum_draco_DataType_DT_FLOAT32=function(){return a.asm.emscripten_enum_draco_DataType_DT_FLOAT32.apply(null, +arguments)},kd=a._emscripten_enum_draco_DataType_DT_FLOAT64=function(){return a.asm.emscripten_enum_draco_DataType_DT_FLOAT64.apply(null,arguments)},ld=a._emscripten_enum_draco_DataType_DT_BOOL=function(){return a.asm.emscripten_enum_draco_DataType_DT_BOOL.apply(null,arguments)},md=a._emscripten_enum_draco_DataType_DT_TYPES_COUNT=function(){return a.asm.emscripten_enum_draco_DataType_DT_TYPES_COUNT.apply(null,arguments)},nd=a._emscripten_enum_draco_EncodedGeometryType_INVALID_GEOMETRY_TYPE=function(){return a.asm.emscripten_enum_draco_EncodedGeometryType_INVALID_GEOMETRY_TYPE.apply(null, +arguments)},od=a._emscripten_enum_draco_EncodedGeometryType_POINT_CLOUD=function(){return a.asm.emscripten_enum_draco_EncodedGeometryType_POINT_CLOUD.apply(null,arguments)},pd=a._emscripten_enum_draco_EncodedGeometryType_TRIANGULAR_MESH=function(){return a.asm.emscripten_enum_draco_EncodedGeometryType_TRIANGULAR_MESH.apply(null,arguments)},qd=a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_INVALID_TRANSFORM=function(){return a.asm.emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_INVALID_TRANSFORM.apply(null, +arguments)},rd=a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_NO_TRANSFORM=function(){return a.asm.emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_NO_TRANSFORM.apply(null,arguments)},sd=a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_QUANTIZATION_TRANSFORM=function(){return a.asm.emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_QUANTIZATION_TRANSFORM.apply(null,arguments)},td=a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_OCTAHEDRON_TRANSFORM=function(){return a.asm.emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_OCTAHEDRON_TRANSFORM.apply(null, +arguments)},ud=a._emscripten_enum_draco_GeometryAttribute_Type_INVALID=function(){return a.asm.emscripten_enum_draco_GeometryAttribute_Type_INVALID.apply(null,arguments)},vd=a._emscripten_enum_draco_GeometryAttribute_Type_POSITION=function(){return a.asm.emscripten_enum_draco_GeometryAttribute_Type_POSITION.apply(null,arguments)},wd=a._emscripten_enum_draco_GeometryAttribute_Type_NORMAL=function(){return a.asm.emscripten_enum_draco_GeometryAttribute_Type_NORMAL.apply(null,arguments)},xd=a._emscripten_enum_draco_GeometryAttribute_Type_COLOR= +function(){return a.asm.emscripten_enum_draco_GeometryAttribute_Type_COLOR.apply(null,arguments)},yd=a._emscripten_enum_draco_GeometryAttribute_Type_TEX_COORD=function(){return a.asm.emscripten_enum_draco_GeometryAttribute_Type_TEX_COORD.apply(null,arguments)},zd=a._emscripten_enum_draco_GeometryAttribute_Type_GENERIC=function(){return a.asm.emscripten_enum_draco_GeometryAttribute_Type_GENERIC.apply(null,arguments)};a._setThrew=function(){return a.asm.setThrew.apply(null,arguments)};var ta=a.__ZSt18uncaught_exceptionv= +function(){return a.asm._ZSt18uncaught_exceptionv.apply(null,arguments)};a._free=function(){return a.asm.free.apply(null,arguments)};var ib=a._malloc=function(){return a.asm.malloc.apply(null,arguments)};a.stackSave=function(){return a.asm.stackSave.apply(null,arguments)};a.stackAlloc=function(){return a.asm.stackAlloc.apply(null,arguments)};a.stackRestore=function(){return a.asm.stackRestore.apply(null,arguments)};a.__growWasmMemory=function(){return a.asm.__growWasmMemory.apply(null,arguments)}; +a.dynCall_ii=function(){return a.asm.dynCall_ii.apply(null,arguments)};a.dynCall_vi=function(){return a.asm.dynCall_vi.apply(null,arguments)};a.dynCall_iii=function(){return a.asm.dynCall_iii.apply(null,arguments)};a.dynCall_vii=function(){return a.asm.dynCall_vii.apply(null,arguments)};a.dynCall_iiii=function(){return a.asm.dynCall_iiii.apply(null,arguments)};a.dynCall_v=function(){return a.asm.dynCall_v.apply(null,arguments)};a.dynCall_viii=function(){return a.asm.dynCall_viii.apply(null,arguments)}; +a.dynCall_viiii=function(){return a.asm.dynCall_viiii.apply(null,arguments)};a.dynCall_iiiiiii=function(){return a.asm.dynCall_iiiiiii.apply(null,arguments)};a.dynCall_iidiiii=function(){return a.asm.dynCall_iidiiii.apply(null,arguments)};a.dynCall_jiji=function(){return a.asm.dynCall_jiji.apply(null,arguments)};a.dynCall_viiiiii=function(){return a.asm.dynCall_viiiiii.apply(null,arguments)};a.dynCall_viiiii=function(){return a.asm.dynCall_viiiii.apply(null,arguments)};a.asm=La;var fa;a.then=function(e){if(fa)e(a); +else{var c=a.onRuntimeInitialized;a.onRuntimeInitialized=function(){c&&c();e(a)}}return a};ja=function c(){fa||ma();fa||(ja=c)};a.run=ma;if(a.preInit)for("function"==typeof a.preInit&&(a.preInit=[a.preInit]);0=n.size?(t(0>=1;break;case 4:d>>=2;break;case 8:d>>=3}for(var c=0;c 1) { + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + } + queue.push(new Item(fun, args)); + if (queue.length === 1 && !draining) { + runTimeout(drainQueue); + } +}; + +// v8 likes predictible objects +function Item(fun, array) { + this.fun = fun; + this.array = array; +} +Item.prototype.run = function () { + this.fun.apply(null, this.array); +}; +process.title = 'browser'; +process.browser = true; +process.env = {}; +process.argv = []; +process.version = ''; // empty string to avoid regexp issues +process.versions = {}; + +function noop() {} + +process.on = noop; +process.addListener = noop; +process.once = noop; +process.off = noop; +process.removeListener = noop; +process.removeAllListeners = noop; +process.emit = noop; +process.prependListener = noop; +process.prependOnceListener = noop; + +process.listeners = function (name) { return [] } + +process.binding = function (name) { + throw new Error('process.binding is not supported'); +}; + +process.cwd = function () { return '/' }; +process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); +}; +process.umask = function() { return 0; }; + +},{}],2:[function(require,module,exports){ +GLTFValidator = require('gltf-validator'); +},{"gltf-validator":4}],3:[function(require,module,exports){ +(function (process,global,__filename,__argument0,__argument1,__argument2,__argument3,__dirname){ +var dartNodePreambleSelf="undefined"!=typeof global?global:window,self=Object.create(dartNodePreambleSelf);if(self.scheduleImmediate=self.setImmediate?function(e){dartNodePreambleSelf.setImmediate(e)}:function(e){setTimeout(e,0)},self.require=require,self.exports=exports,"undefined"!=typeof process)self.process=process;if("undefined"!=typeof __dirname)self.__dirname=__dirname;if("undefined"!=typeof __filename)self.__filename=__filename;if(!dartNodePreambleSelf.window&&!('undefined'!==typeof WorkerGlobalScope&&dartNodePreambleSelf instanceof WorkerGlobalScope)){var url=("undefined"!=typeof __webpack_require__?__non_webpack_require__:require)("url");self.location={get href(){if(url.pathToFileURL)return url.pathToFileURL(process.cwd()).href+"/";else return"file://"+function(){var e=process.cwd();if("win32"!=process.platform)return e;else return"/"+e.replace(/\\/g,"/")}()+"/"}},function(){function e(){try{throw new Error}catch(t){var e=t.stack,r=new RegExp("^ *at [^(]*\\((.*):[0-9]*:[0-9]*\\)$","mg"),l=null;do{var n=r.exec(e);if(null!=n)l=n}while(null!=n);return l[1]}}var r=null;self.document={get currentScript(){if(null==r)r={src:e()};return r}}}(),self.dartDeferredLibraryLoader=function(e,r,l){try{load(e),r()}catch(e){l(e)}}}{}(function dartProgram(){function copyProperties(a,b){var u=Object.keys(a) +for(var t=0;t=0)return true +if(typeof version=="function"&&version.length==0){var s=version() +if(/^\d+\.\d+\.\d+\.\d+$/.test(s))return true}}catch(r){}return false}() +function setFunctionNamesIfNecessary(a){function t(){};if(typeof t.name=="string")return +for(var u=0;u36)throw H.e(P.S(b,2,36,"radix",null)) +if(b===10&&t!=null)return parseInt(a,10) +if(b<10||t==null){s=b<=10?47+b:86+b +r=u[1] +for(q=r.length,p=0;ps)return}return parseInt(a,b)}, +dg:function(a){return H.rK(a)+H.mo(H.bp(a),0,null)}, +rK:function(a){var u,t,s,r,q,p,o,n=J.m(a),m=n.constructor +if(typeof m=="function"){u=m.name +t=typeof u==="string"?u:null}else t=null +s=t==null +if(s||n===C.bp||!!n.$ibW){r=C.a0(a) +if(s)t=r +if(r==="Object"){q=a.constructor +if(typeof q=="function"){p=String(q).match(/^\s*function\s*([\w$]*)\s*\(/) +o=p==null?null:p[1] +if(typeof o==="string"&&/^\w+$/.test(o))t=o}}return t}t=t +return H.cd(t.length>1&&C.a.G(t,0)===36?C.a.aN(t,1):t)}, +np:function(a){var u,t,s,r,q=J.H(a) +if(q<=500)return String.fromCharCode.apply(null,a) +for(u="",t=0;t65535)return H.rN(a)}return H.np(a)}, +rO:function(a,b,c){var u,t,s,r +if(c<=500&&b===0&&c===a.length)return String.fromCharCode.apply(null,a) +for(u=b,t="";u>>0,56320|u&1023)}}throw H.e(P.S(a,0,1114111,null,null))}, +a8:function(a){if(a.date===void 0)a.date=new Date(a.a) +return a.date}, +df:function(a){return a.b?H.a8(a).getUTCFullYear()+0:H.a8(a).getFullYear()+0}, +nu:function(a){return a.b?H.a8(a).getUTCMonth()+1:H.a8(a).getMonth()+1}, +nq:function(a){return a.b?H.a8(a).getUTCDate()+0:H.a8(a).getDate()+0}, +nr:function(a){return a.b?H.a8(a).getUTCHours()+0:H.a8(a).getHours()+0}, +nt:function(a){return a.b?H.a8(a).getUTCMinutes()+0:H.a8(a).getMinutes()+0}, +nv:function(a){return a.b?H.a8(a).getUTCSeconds()+0:H.a8(a).getSeconds()+0}, +ns:function(a){return a.b?H.a8(a).getUTCMilliseconds()+0:H.a8(a).getMilliseconds()+0}, +bT:function(a,b,c){var u,t,s={} +s.a=0 +u=[] +t=[] +s.a=b.length +C.d.J(u,b) +s.b="" +if(c!=null&&c.a!==0)c.H(0,new H.ib(s,t,u)) +""+s.a +return J.qJ(a,new H.fH(C.cS,0,u,t,0))}, +rL:function(a,b,c){var u,t,s,r +if(b instanceof Array)u=c==null||c.a===0 +else u=!1 +if(u){t=b +s=t.length +if(s===0){if(!!a.$0)return a.$0()}else if(s===1){if(!!a.$1)return a.$1(t[0])}else if(s===2){if(!!a.$2)return a.$2(t[0],t[1])}else if(s===3){if(!!a.$3)return a.$3(t[0],t[1],t[2])}else if(s===4){if(!!a.$4)return a.$4(t[0],t[1],t[2],t[3])}else if(s===5)if(!!a.$5)return a.$5(t[0],t[1],t[2],t[3],t[4]) +r=a[""+"$"+s] +if(r!=null)return r.apply(a,t)}return H.rJ(a,b,c)}, +rJ:function(a,b,c){var u,t,s,r,q,p,o,n,m,l,k,j +if(b!=null)u=b instanceof Array?b:P.ni(b,!0,null) +else u=[] +t=u.length +s=a.$R +if(ts+p.length)return H.bT(a,u,null) +C.d.J(u,p.slice(t-s)) +return n.apply(a,u)}else{if(t>s)return H.bT(a,u,c) +m=Object.keys(p) +if(c==null)for(q=m.length,l=0;l=u)return P.d6(b,a,t,null,u) +return P.id(b,t)}, +u2:function(a,b,c){var u="Invalid value" +if(a<0||a>c)return new P.bU(0,c,!0,a,"start",u) +if(b!=null)if(bc)return new P.bU(a,c,!0,b,"end",u) +return new P.ab(!0,b,"end",null)}, +al:function(a){return new P.ab(!0,a,null,null)}, +e:function(a){var u +if(a==null)a=new P.cA() +u=new Error() +u.dartException=a +if("defineProperty" in Object){Object.defineProperty(u,"message",{get:H.ou}) +u.name=""}else u.toString=H.ou +return u}, +ou:function(){return J.aa(this.dartException)}, +O:function(a){throw H.e(a)}, +cc:function(a){throw H.e(P.X(a))}, +aA:function(a){var u,t,s,r,q,p +a=H.or(a.replace(String({}),'$receiver$')) +u=a.match(/\\\$[a-zA-Z]+\\\$/g) +if(u==null)u=H.a([],[P.d]) +t=u.indexOf("\\$arguments\\$") +s=u.indexOf("\\$argumentsExpr\\$") +r=u.indexOf("\\$expr\\$") +q=u.indexOf("\\$method\\$") +p=u.indexOf("\\$receiver\\$") +return new H.jz(a.replace(new RegExp('\\\\\\$arguments\\\\\\$','g'),'((?:x|[^x])*)').replace(new RegExp('\\\\\\$argumentsExpr\\\\\\$','g'),'((?:x|[^x])*)').replace(new RegExp('\\\\\\$expr\\\\\\$','g'),'((?:x|[^x])*)').replace(new RegExp('\\\\\\$method\\\\\\$','g'),'((?:x|[^x])*)').replace(new RegExp('\\\\\\$receiver\\\\\\$','g'),'((?:x|[^x])*)'),t,s,r,q,p)}, +jA:function(a){return function($expr$){var $argumentsExpr$='$arguments$' +try{$expr$.$method$($argumentsExpr$)}catch(u){return u.message}}(a)}, +nA:function(a){return function($expr$){try{$expr$.$method$}catch(u){return u.message}}(a)}, +no:function(a,b){return new H.i6(a,b==null?null:b.method)}, +m7:function(a,b){var u=b==null,t=u?null:b.method +return new H.fO(a,t,u?null:b.receiver)}, +z:function(a){var u,t,s,r,q,p,o,n,m,l,k,j,i,h,g=null,f=new H.lP(a) +if(a==null)return +if(a instanceof H.co)return f.$1(a.a) +if(typeof a!=="object")return a +if("dartException" in a)return f.$1(a.dartException) +else if(!("message" in a))return a +u=a.message +if("number" in a&&typeof a.number=="number"){t=a.number +s=t&65535 +if((C.c.ad(t,16)&8191)===10)switch(s){case 438:return f.$1(H.m7(H.b(u)+" (Error "+s+")",g)) +case 445:case 5007:return f.$1(H.no(H.b(u)+" (Error "+s+")",g))}}if(a instanceof TypeError){r=$.qo() +q=$.qp() +p=$.qq() +o=$.qr() +n=$.qu() +m=$.qv() +l=$.qt() +$.qs() +k=$.qx() +j=$.qw() +i=r.a3(u) +if(i!=null)return f.$1(H.m7(u,i)) +else{i=q.a3(u) +if(i!=null){i.method="call" +return f.$1(H.m7(u,i))}else{i=p.a3(u) +if(i==null){i=o.a3(u) +if(i==null){i=n.a3(u) +if(i==null){i=m.a3(u) +if(i==null){i=l.a3(u) +if(i==null){i=o.a3(u) +if(i==null){i=k.a3(u) +if(i==null){i=j.a3(u) +h=i!=null}else h=!0}else h=!0}else h=!0}else h=!0}else h=!0}else h=!0}else h=!0 +if(h)return f.$1(H.no(u,i))}}return f.$1(new H.jE(typeof u==="string"?u:""))}if(a instanceof RangeError){if(typeof u==="string"&&u.indexOf("call stack")!==-1)return new P.dm() +u=function(b){try{return String(b)}catch(e){}return null}(a) +return f.$1(new P.ab(!1,g,g,typeof u==="string"?u.replace(/^RangeError:\s*/,""):u))}if(typeof InternalError=="function"&&a instanceof InternalError)if(typeof u==="string"&&u==="too much recursion")return new P.dm() +return a}, +ao:function(a){var u +if(a instanceof H.co)return a.b +if(a==null)return new H.dA(a) +u=a.$cachedTrace +if(u!=null)return u +return a.$cachedTrace=new H.dA(a)}, +om:function(a){if(a==null||typeof a!='object')return J.ai(a) +else return H.bb(a)}, +ob:function(a,b){var u,t,s,r=a.length +for(u=0;u=27 +if(q)return H.r6(t,!r,u,b) +if(t===0){r=$.ap +$.ap=r+1 +p="self"+H.b(r) +r="return function(){var "+p+" = this." +q=$.ci +return new Function(r+H.b(q==null?$.ci=H.dZ("self"):q)+";return "+p+"."+H.b(u)+"();}")()}o="abcdefghijklmnopqrstuvwxyz".split("").splice(0,t).join(",") +r=$.ap +$.ap=r+1 +o+=H.b(r) +r="return function("+o+"){return this." +q=$.ci +return new Function(r+H.b(q==null?$.ci=H.dZ("self"):q)+"."+H.b(u)+"("+o+");}")()}, +r7:function(a,b,c,d){var u=H.m_,t=H.n8 +switch(b?-1:a){case 0:throw H.e(H.rQ("Intercepted function with no arguments.")) +case 1:return function(e,f,g){return function(){return f(this)[e](g(this))}}(c,u,t) +case 2:return function(e,f,g){return function(h){return f(this)[e](g(this),h)}}(c,u,t) +case 3:return function(e,f,g){return function(h,i){return f(this)[e](g(this),h,i)}}(c,u,t) +case 4:return function(e,f,g){return function(h,i,j){return f(this)[e](g(this),h,i,j)}}(c,u,t) +case 5:return function(e,f,g){return function(h,i,j,k){return f(this)[e](g(this),h,i,j,k)}}(c,u,t) +case 6:return function(e,f,g){return function(h,i,j,k,l){return f(this)[e](g(this),h,i,j,k,l)}}(c,u,t) +default:return function(e,f,g,h){return function(){h=[g(this)] +Array.prototype.push.apply(h,arguments) +return e.apply(f(this),h)}}(d,u,t)}}, +r8:function(a,b){var u,t,s,r,q,p,o,n=$.ci +if(n==null)n=$.ci=H.dZ("self") +u=$.n7 +if(u==null)u=$.n7=H.dZ("receiver") +t=b.$stubName +s=b.length +r=a[t] +q=b==null?r==null:b===r +p=!q||s>=28 +if(p)return H.r7(s,!q,t,b) +if(s===1){n="return function(){return this."+H.b(n)+"."+H.b(t)+"(this."+H.b(u)+");" +u=$.ap +$.ap=u+1 +return new Function(n+H.b(u)+"}")()}o="abcdefghijklmnopqrstuvwxyz".split("").splice(0,s-1).join(",") +n="return function("+o+"){return this."+H.b(n)+"."+H.b(t)+"(this."+H.b(u)+", "+o+");" +u=$.ap +$.ap=u+1 +return new Function(n+H.b(u)+"}")()}, +mr:function(a,b,c,d,e,f,g){return H.r9(a,b,c,d,!!e,!!f,g)}, +m_:function(a){return a.a}, +n8:function(a){return a.c}, +dZ:function(a){var u,t,s,r=new H.ch("self","target","receiver","name"),q=J.m3(Object.getOwnPropertyNames(r)) +for(u=q.length,t=0;t=b.length)return"unexpected-generic-index:"+H.b(a) +return H.b(b[b.length-a-1])}if('func' in a)return H.tx(a,b) +if('futureOr' in a)return"FutureOr<"+H.bk("type" in a?a.type:null,b)+">" +return"unknown-reified-type"}, +tx:function(a,a0){var u,t,s,r,q,p,o,n,m,l,k,j,i,h,g,f,e,d,c,b=", " +if("bounds" in a){u=a.bounds +if(a0==null){a0=H.a([],[P.d]) +t=null}else t=a0.length +s=a0.length +for(r=u.length,q=r;q>0;--q)a0.push("T"+(s+q)) +for(p="<",o="",q=0;q "+m}, +mo:function(a,b,c){var u,t,s,r,q,p +if(a==null)return"" +u=new P.N("") +for(t=b,s="",r=!0,q="";t"}, +cb:function(a,b){if(a==null)return b +a=a.apply(null,b) +if(a==null)return +if(typeof a==="object"&&a!==null&&a.constructor===Array)return a +if(typeof a=="function")return a.apply(null,b) +return b}, +a2:function(a,b,c,d){var u,t +if(a==null)return!1 +u=H.bp(a) +t=J.m(a) +if(t[b]==null)return!1 +return H.o6(H.cb(t[d],u),null,c,null)}, +dM:function(a,b,c,d){if(a==null)return a +if(H.a2(a,b,c,d))return a +throw H.e(H.m0(a,function(e,f){return e.replace(/[^<,> ]+/g,function(g){return f[g]||g})}(H.cd(b.substring(2))+H.mo(c,0,null),v.mangledGlobalNames)))}, +o6:function(a,b,c,d){var u,t +if(c==null)return!0 +if(a==null){u=c.length +for(t=0;tn)return!1 +if(o+m=0)return a.replace(/\$/g,"$$$$") +return a}, +or:function(a){if(/[[\]{}()*+?.\\^$|]/.test(a))return a.replace(/[[\]{}()*+?.\\^$|]/g,"\\$&") +return a}, +ot:function(a,b,c){var u=H.uB(a,b,c) +return u}, +uB:function(a,b,c){var u,t,s,r +if(b===""){if(a==="")return c +u=a.length +for(t=c,s=0;s=0)return a.split(b).join(c) +return a.replace(new RegExp(H.or(b),'g'),H.u3(c))}, +e8:function e8(a,b){this.a=a +this.$ti=b}, +e7:function e7(){}, +b2:function b2(a,b,c,d){var _=this +_.a=a +_.b=b +_.c=c +_.$ti=d}, +kg:function kg(a,b){this.a=a +this.$ti=b}, +aI:function aI(a,b){this.a=a +this.$ti=b}, +fH:function fH(a,b,c,d,e){var _=this +_.a=a +_.c=b +_.d=c +_.e=d +_.f=e}, +ib:function ib(a,b,c){this.a=a +this.b=b +this.c=c}, +jz:function jz(a,b,c,d,e,f){var _=this +_.a=a +_.b=b +_.c=c +_.d=d +_.e=e +_.f=f}, +i6:function i6(a,b){this.a=a +this.b=b}, +fO:function fO(a,b,c){this.a=a +this.b=b +this.c=c}, +jE:function jE(a){this.a=a}, +co:function co(a,b){this.a=a +this.b=b}, +lP:function lP(a){this.a=a}, +dA:function dA(a){this.a=a +this.b=null}, +ck:function ck(){}, +jy:function jy(){}, +jm:function jm(){}, +ch:function ch(a,b,c,d){var _=this +_.a=a +_.b=b +_.c=c +_.d=d}, +e0:function e0(a){this.a=a}, +ii:function ii(a){this.a=a}, +dn:function dn(a){this.a=a +this.d=this.b=null}, +bH:function bH(a){var _=this +_.a=0 +_.f=_.e=_.d=_.c=_.b=null +_.r=0 +_.$ti=a}, +fN:function fN(a){this.a=a}, +hw:function hw(a,b){this.a=a +this.b=b +this.c=null}, +b9:function b9(a,b){this.a=a +this.$ti=b}, +hx:function hx(a,b,c){var _=this +_.a=a +_.b=b +_.d=_.c=null +_.$ti=c}, +lz:function lz(a){this.a=a}, +lA:function lA(a){this.a=a}, +lB:function lB(a){this.a=a}, +fJ:function fJ(a,b){var _=this +_.a=a +_.b=b +_.d=_.c=null}, +kM:function kM(a){this.b=a}, +aR:function(a,b,c){}, +tw:function(a){return a}, +hU:function(a,b,c){var u +H.aR(a,b,c) +u=new DataView(a,b) +return u}, +rD:function(a){return new Float32Array(a)}, +rE:function(a){return new Int8Array(a)}, +nl:function(a,b,c){var u +H.aR(a,b,c) +u=new Uint16Array(a,b,c) +return u}, +nm:function(a,b,c){var u +H.aR(a,b,c) +u=new Uint32Array(a,b,c) +return u}, +ma:function(a,b,c){var u +H.aR(a,b,c) +u=new Uint8Array(a,b,c) +return u}, +aB:function(a,b,c){if(a>>>0!==a||a>=c)throw H.e(H.cV(b,a))}, +aQ:function(a,b,c){var u +if(!(a>>>0!==a))u=b>>>0!==b||a>b||b>c +else u=!0 +if(u)throw H.e(H.u2(a,b,c)) +return b}, +cz:function cz(){}, +dc:function dc(){}, +dd:function dd(){}, +cy:function cy(){}, +db:function db(){}, +hV:function hV(){}, +hW:function hW(){}, +hX:function hX(){}, +hY:function hY(){}, +hZ:function hZ(){}, +i_:function i_(){}, +de:function de(){}, +bP:function bP(){}, +cJ:function cJ(){}, +cK:function cK(){}, +cL:function cL(){}, +cM:function cM(){}, +u6:function(a){return J.cr(a?Object.keys(a):[],null)}, +uF:function(a){return v.mangledGlobalNames[a]}},J={ +mx:function(a,b,c,d){return{i:a,p:b,e:c,x:d}}, +lw:function(a){var u,t,s,r,q=a[v.dispatchPropertyName] +if(q==null)if($.mv==null){H.ue() +q=a[v.dispatchPropertyName]}if(q!=null){u=q.p +if(!1===u)return q.i +if(!0===u)return a +t=Object.getPrototypeOf(a) +if(u===t)return q.i +if(q.e===t)throw H.e(P.nB("Return interceptor for "+H.b(u(a,q))))}s=a.constructor +r=s==null?null:s[$.mI()] +if(r!=null)return r +r=H.up(a) +if(r!=null)return r +if(typeof a=="function")return C.bv +u=Object.getPrototypeOf(a) +if(u==null)return C.ao +if(u===Object.prototype)return C.ao +if(typeof s=="function"){Object.defineProperty(s,$.mI(),{value:C.O,enumerable:false,writable:true,configurable:true}) +return C.O}return C.O}, +rp:function(a,b){if(a<0||a>4294967295)throw H.e(P.S(a,0,4294967295,"length",null)) +return J.cr(new Array(a),b)}, +cr:function(a,b){return J.m3(H.a(a,[b]))}, +m3:function(a){a.fixed$length=Array +return a}, +rq:function(a){if(a<256)switch(a){case 9:case 10:case 11:case 12:case 13:case 32:case 133:case 160:return!0 +default:return!1}switch(a){case 5760:case 8192:case 8193:case 8194:case 8195:case 8196:case 8197:case 8198:case 8199:case 8200:case 8201:case 8202:case 8232:case 8233:case 8239:case 8287:case 12288:case 65279:return!0 +default:return!1}}, +nf:function(a,b){var u,t +for(;b>0;b=u){u=b-1 +t=C.a.v(a,u) +if(t!==32&&t!==13&&!J.rq(t))break}return b}, +m:function(a){if(typeof a=="number"){if(Math.floor(a)==a)return J.d9.prototype +return J.fG.prototype}if(typeof a=="string")return J.bG.prototype +if(a==null)return J.fI.prototype +if(typeof a=="boolean")return J.d8.prototype +if(a.constructor==Array)return J.b6.prototype +if(typeof a!="object"){if(typeof a=="function")return J.b7.prototype +return a}if(a instanceof P.c)return a +return J.lw(a)}, +K:function(a){if(typeof a=="string")return J.bG.prototype +if(a==null)return a +if(a.constructor==Array)return J.b6.prototype +if(typeof a!="object"){if(typeof a=="function")return J.b7.prototype +return a}if(a instanceof P.c)return a +return J.lw(a)}, +aU:function(a){if(a==null)return a +if(a.constructor==Array)return J.b6.prototype +if(typeof a!="object"){if(typeof a=="function")return J.b7.prototype +return a}if(a instanceof P.c)return a +return J.lw(a)}, +ua:function(a){if(typeof a=="number")return J.cs.prototype +if(a==null)return a +if(!(a instanceof P.c))return J.bW.prototype +return a}, +lu:function(a){if(typeof a=="string")return J.bG.prototype +if(a==null)return a +if(!(a instanceof P.c))return J.bW.prototype +return a}, +an:function(a){if(a==null)return a +if(typeof a!="object"){if(typeof a=="function")return J.b7.prototype +return a}if(a instanceof P.c)return a +return J.lw(a)}, +a5:function(a,b){if(a==null)return b==null +if(typeof a!="object")return b!=null&&a===b +return J.m(a).K(a,b)}, +mY:function(a,b){if(typeof b==="number")if(a.constructor==Array||typeof a=="string"||H.oj(a,a[v.dispatchPropertyName]))if(b>>>0===b&&b>>0===b&&b=4){t=b.aX() +b.a=a.a +b.c=a.c +P.c0(b,t)}else{t=b.c +b.a=2 +b.c=a +a.ce(t)}}, +c0:function(a,b){var u,t,s,r,q,p,o,n,m,l,k,j=null,i={},h=i.a=a +for(;!0;){u={} +t=h.a===8 +if(b==null){if(t){s=h.c +P.c7(j,j,h.b,s.a,s.b)}return}for(;r=b.a,r!=null;b=r){b.a=null +P.c0(i.a,b)}h=i.a +q=h.c +u.a=t +u.b=q +s=!t +if(s){p=b.c +p=(p&1)!==0||(p&15)===8}else p=!0 +if(p){p=b.b +o=p.b +if(t){n=h.b===o +n=!(n||n)}else n=!1 +if(n){P.c7(j,j,h.b,q.a,q.b) +return}m=$.p +if(m!==o)$.p=o +else m=j +h=b.c +if((h&15)===8)new P.kx(i,u,b,t).$0() +else if(s){if((h&1)!==0)new P.kw(u,b,q).$0()}else if((h&2)!==0)new P.kv(i,u,b).$0() +if(m!=null)$.p=m +h=u.b +if(!!J.m(h).$iR){if(h.a>=4){l=p.c +p.c=null +b=p.aY(l) +p.a=h.a +p.c=h.c +i.a=h +continue}else P.kp(h,p) +return}}k=b.b +l=k.c +k.c=null +b=k.aY(l) +h=u.a +s=u.b +if(!h){k.a=4 +k.c=s}else{k.a=8 +k.c=s}i.a=k +h=k}}, +tH:function(a,b){if(H.ca(a,{func:1,args:[P.c,P.a1]}))return b.bN(a) +if(H.ca(a,{func:1,args:[P.c]}))return a +throw H.e(P.n5(a,"onError","Error handler must accept one Object or one Object and a StackTrace as arguments, and return a a valid result"))}, +tE:function(){var u,t +for(;u=$.c6,u!=null;){$.cS=null +t=u.b +$.c6=t +if(t==null)$.cR=null +u.a.$0()}}, +tJ:function(){$.mm=!0 +try{P.tE()}finally{$.cS=null +$.mm=!1 +if($.c6!=null)$.mV().$1(P.o7())}}, +o3:function(a){var u=new P.du(a) +if($.c6==null){$.c6=$.cR=u +if(!$.mm)$.mV().$1(P.o7())}else $.cR=$.cR.b=u}, +tI:function(a){var u,t,s=$.c6 +if(s==null){P.o3(a) +$.cS=$.cR +return}u=new P.du(a) +t=$.cS +if(t==null){u.b=s +$.c6=$.cS=u}else{u.b=t.b +$.cS=t.b=u +if(u.b==null)$.cR=u}}, +os:function(a){var u=null,t=$.p +if(C.f===t){P.c8(u,u,C.f,a) +return}P.c8(u,u,t,t.co(a))}, +rU:function(a,b){var u=null,t=new P.dE(u,u,u,u,[b]) +a.am(0,new P.jp(t,b),new P.jq(t),P.A) +return new P.bi(t,[b])}, +mc:function(a,b){return new P.kz(new P.jr(a),[b])}, +x8:function(a){if(a==null)H.O(P.qZ("stream")) +return new P.kY()}, +nz:function(a,b,c,d){return new P.dv(null,b,c,a,[d])}, +mp:function(a){var u,t,s,r +if(a==null)return +try{a.$0()}catch(s){u=H.z(s) +t=H.ao(s) +r=$.p +P.c7(null,null,r,u,t)}}, +nJ:function(a,b,c,d){var u=$.p +u=new P.cF(u,d?1:0) +u.bV(a,b,c,d) +return u}, +nX:function(a,b){P.c7(null,null,$.p,a,b)}, +c7:function(a,b,c,d,e){var u={} +u.a=d +P.tI(new P.ll(u,e))}, +nZ:function(a,b,c,d){var u,t=$.p +if(t===c)return d.$0() +$.p=c +u=t +try{t=d.$0() +return t}finally{$.p=u}}, +o0:function(a,b,c,d,e){var u,t=$.p +if(t===c)return d.$1(e) +$.p=c +u=t +try{t=d.$1(e) +return t}finally{$.p=u}}, +o_:function(a,b,c,d,e,f){var u,t=$.p +if(t===c)return d.$2(e,f) +$.p=c +u=t +try{t=d.$2(e,f) +return t}finally{$.p=u}}, +c8:function(a,b,c,d){var u=C.f!==c +if(u)d=!(!u||!1)?c.co(d):c.dN(d) +P.o3(d)}, +k6:function k6(a){this.a=a}, +k5:function k5(a,b,c){this.a=a +this.b=b +this.c=c}, +k7:function k7(a){this.a=a}, +k8:function k8(a){this.a=a}, +l0:function l0(){}, +l1:function l1(a,b){this.a=a +this.b=b}, +k4:function k4(a,b){this.a=a +this.b=!1 +this.$ti=b}, +l7:function l7(a){this.a=a}, +l8:function l8(a){this.a=a}, +ln:function ln(a){this.a=a}, +c1:function c1(a,b){this.a=a +this.b=b}, +bj:function bj(a,b){var _=this +_.a=a +_.d=_.c=_.b=null +_.$ti=b}, +kZ:function kZ(a,b){this.a=a +this.$ti=b}, +R:function R(){}, +kf:function kf(){}, +aN:function aN(a,b){this.a=a +this.$ti=b}, +cH:function cH(a,b,c,d){var _=this +_.a=null +_.b=a +_.c=b +_.d=c +_.e=d}, +E:function E(a,b){var _=this +_.a=0 +_.b=a +_.c=null +_.$ti=b}, +km:function km(a,b){this.a=a +this.b=b}, +ku:function ku(a,b){this.a=a +this.b=b}, +kq:function kq(a){this.a=a}, +kr:function kr(a){this.a=a}, +ks:function ks(a,b,c){this.a=a +this.b=b +this.c=c}, +ko:function ko(a,b){this.a=a +this.b=b}, +kt:function kt(a,b){this.a=a +this.b=b}, +kn:function kn(a,b,c){this.a=a +this.b=b +this.c=c}, +kx:function kx(a,b,c,d){var _=this +_.a=a +_.b=b +_.c=c +_.d=d}, +ky:function ky(a){this.a=a}, +kw:function kw(a,b,c){this.a=a +this.b=b +this.c=c}, +kv:function kv(a,b,c){this.a=a +this.b=b +this.c=c}, +du:function du(a){this.a=a +this.b=null}, +jn:function jn(){}, +jp:function jp(a,b){this.a=a +this.b=b}, +jq:function jq(a){this.a=a}, +jr:function jr(a){this.a=a}, +js:function js(a,b){this.a=a +this.b=b}, +jt:function jt(a,b){this.a=a +this.b=b}, +jo:function jo(){}, +dB:function dB(){}, +kW:function kW(a){this.a=a}, +kV:function kV(a){this.a=a}, +l_:function l_(){}, +k9:function k9(){}, +dv:function dv(a,b,c,d,e){var _=this +_.a=null +_.b=0 +_.c=null +_.d=a +_.e=b +_.f=c +_.r=d +_.$ti=e}, +dE:function dE(a,b,c,d,e){var _=this +_.a=null +_.b=0 +_.c=null +_.d=a +_.e=b +_.f=c +_.r=d +_.$ti=e}, +bi:function bi(a,b){this.a=a +this.$ti=b}, +dw:function dw(a,b,c){var _=this +_.x=a +_.c=_.b=_.a=null +_.d=b +_.e=c +_.r=_.f=null}, +cF:function cF(a,b){var _=this +_.c=_.b=_.a=null +_.d=a +_.e=b +_.r=_.f=null}, +kc:function kc(a,b,c){this.a=a +this.b=b +this.c=c}, +kb:function kb(a){this.a=a}, +kX:function kX(){}, +kz:function kz(a,b){this.a=a +this.b=!1 +this.$ti=b}, +kF:function kF(a){this.b=a +this.a=0}, +kj:function kj(){}, +c_:function c_(a){this.b=a +this.a=null}, +dx:function dx(a,b){this.b=a +this.c=b +this.a=null}, +ki:function ki(){}, +kN:function kN(){}, +kO:function kO(a,b){this.a=a +this.b=b}, +dC:function dC(){this.c=this.b=null +this.a=0}, +kY:function kY(){}, +bw:function bw(a,b){this.a=a +this.b=b}, +l6:function l6(){}, +ll:function ll(a,b){this.a=a +this.b=b}, +kP:function kP(){}, +kR:function kR(a,b){this.a=a +this.b=b}, +kQ:function kQ(a,b){this.a=a +this.b=b}, +nL:function(a,b){var u=a[b] +return u===a?null:u}, +mi:function(a,b,c){if(c==null)a[b]=a +else a[b]=c}, +nM:function(){var u=Object.create(null) +P.mi(u,"",u) +delete u[""] +return u}, +m8:function(a,b,c){return H.ob(a,new H.bH([b,c]))}, +V:function(a,b){return new H.bH([a,b])}, +nh:function(a){return new P.c2([a])}, +at:function(a){return new P.c2([a])}, +au:function(a,b){return H.u7(a,new P.c2([b]))}, +mj:function(){var u=Object.create(null) +u[""]=u +delete u[""] +return u}, +rn:function(a,b,c){var u,t +if(P.mn(a)){if(b==="("&&c===")")return"(...)" +return b+"..."+c}u=H.a([],[P.d]) +$.bl.push(a) +try{P.tC(a,u)}finally{$.bl.pop()}t=P.md(b,u,", ")+c +return t.charCodeAt(0)==0?t:t}, +fF:function(a,b,c){var u,t +if(P.mn(a))return b+"..."+c +u=new P.N(b) +$.bl.push(a) +try{t=u +t.a=P.md(t.a,a,", ")}finally{$.bl.pop()}u.a+=c +t=u.a +return t.charCodeAt(0)==0?t:t}, +mn:function(a){var u,t +for(u=$.bl.length,t=0;t100){while(!0){if(!(m>75&&l>3))break +m-=b.pop().length+2;--l}b.push("...") +return}}s=H.b(r) +t=H.b(q) +m+=t.length+s.length+4}}if(l>b.length+2){m+=5 +o="..."}else o=null +while(!0){if(!(m>80&&b.length>3))break +m-=b.pop().length+2 +if(o==null){m+=5 +o="..."}}if(o!=null)b.push(o) +b.push(s) +b.push(t)}, +ry:function(a,b){var u,t=P.nh(b) +for(u=J.U(a);u.m();)t.A(0,u.gn()) +return t}, +m9:function(a){var u,t={} +if(P.mn(a))return"{...}" +u=new P.N("") +try{$.bl.push(a) +u.a+="{" +t.a=!0 +a.H(0,new P.hB(t,u)) +u.a+="}"}finally{$.bl.pop()}t=u.a +return t.charCodeAt(0)==0?t:t}, +kB:function kB(){}, +kE:function kE(a){var _=this +_.a=0 +_.e=_.d=_.c=_.b=null +_.$ti=a}, +kC:function kC(a,b){this.a=a +this.$ti=b}, +kD:function kD(a,b,c){var _=this +_.a=a +_.b=b +_.c=0 +_.d=null +_.$ti=c}, +c2:function c2(a){var _=this +_.a=0 +_.f=_.e=_.d=_.c=_.b=null +_.r=0 +_.$ti=a}, +kK:function kK(a){this.a=a +this.c=this.b=null}, +kL:function kL(a,b,c){var _=this +_.a=a +_.b=b +_.d=_.c=null +_.$ti=c}, +bX:function bX(a,b){this.a=a +this.$ti=b}, +fE:function fE(){}, +hy:function hy(){}, +J:function J(){}, +hA:function hA(){}, +hB:function hB(a,b){this.a=a +this.b=b}, +a7:function a7(){}, +hC:function hC(a){this.a=a}, +l2:function l2(){}, +hD:function hD(){}, +cE:function cE(a,b){this.a=a +this.$ti=b}, +kS:function kS(){}, +l3:function l3(a,b){this.a=a +this.$ti=b}, +dz:function dz(){}, +dF:function dF(){}, +nY:function(a,b){var u,t,s,r=null +try{r=JSON.parse(a)}catch(t){u=H.z(t) +s=P.y(String(u),null,null) +throw H.e(s)}s=P.la(r) +return s}, +la:function(a){var u +if(a==null)return +if(typeof a!="object")return a +if(Object.getPrototypeOf(a)!==Array.prototype)return new P.kI(a,Object.create(null)) +for(u=0;u=0){m=(m<<6|r)&16777215 +l=l+1&3 +if(l===0){q=e+1 +d[e]=m>>>16&255 +e=q+1 +d[q]=m>>>8&255 +q=e+1 +d[e]=m&255 +e=q +m=0}continue}else if(r===-1&&l>1){if(t>127)break +if(l===3){if((m&3)!==0)throw H.e(P.y(o,a,u)) +d[e]=m>>>10 +d[e+1]=m>>>2}else{if((m&15)!==0)throw H.e(P.y(o,a,u)) +d[e]=m>>>4}p=(3-l)*3 +if(s===37)p+=2 +return P.nI(a,u+1,c,-p-1)}throw H.e(P.y(n,a,u))}if(t>=0&&t<=127)return(m<<2|l)>>>0 +for(u=b;u127)break}throw H.e(P.y(n,a,u))}, +t7:function(a,b,c,d){var u=P.t8(a,b,c),t=(d&3)+(u-b),s=C.c.ad(t,2)*3,r=t&3 +if(r!==0&&u0)return new Uint8Array(s) +return}, +t8:function(a,b,c){var u,t=c,s=t,r=0 +while(!0){if(!(s>b&&r<2))break +c$0:{--s +u=C.a.v(a,s) +if(u===61){++r +t=s +break c$0}if((u|32)===100){if(s===b)break;--s +u=C.a.v(a,s)}if(u===51){if(s===b)break;--s +u=C.a.v(a,s)}if(u===37){++r +t=s +break c$0}break}}return t}, +nI:function(a,b,c,d){var u,t +if(b===c)return d +u=-d-1 +for(;u>0;){t=C.a.v(a,b) +if(u===3){if(t===61){u-=3;++b +break}if(t===37){--u;++b +if(b===c)break +t=C.a.v(a,b)}else break}if((u>3?u-3:u)===2){if(t!==51)break;++b;--u +if(b===c)break +t=C.a.v(a,b)}if((t|32)!==100)break;++b;--u +if(b===c)break}if(b!==c)throw H.e(P.y("Invalid padding character",a,b)) +return-u-1}, +kI:function kI(a,b){this.a=a +this.b=b +this.c=null}, +kJ:function kJ(a){this.a=a}, +kH:function kH(a,b,c){this.b=a +this.c=b +this.a=c}, +dW:function dW(){}, +dY:function dY(){}, +dX:function dX(){}, +ka:function ka(){this.a=0}, +e_:function e_(){}, +e3:function e3(){}, +kT:function kT(a,b,c){this.a=a +this.b=b +this.$ti=c}, +e5:function e5(){}, +eh:function eh(){}, +eS:function eS(){}, +fP:function fP(){}, +fQ:function fQ(a){this.a=a}, +ju:function ju(){}, +jv:function jv(){}, +dD:function dD(){}, +l5:function l5(a,b){this.a=a +this.b=b}, +jM:function jM(){}, +jN:function jN(a){this.a=a}, +dH:function dH(a,b){var _=this +_.a=a +_.b=b +_.c=!0 +_.f=_.e=_.d=0}, +aV:function(a,b,c){var u=H.rM(a,c) +if(u!=null)return u +if(b!=null)return b.$1(a) +throw H.e(P.y(a,null,null))}, +re:function(a){if(a instanceof H.ck)return a.k(0) +return"Instance of '"+H.b(H.dg(a))+"'"}, +hz:function(a,b,c){var u,t,s=J.rp(a,c) +if(a!==0&&!0)for(u=s.length,t=0;t0||c=1000)return""+a +if(u>=100)return t+"0"+u +if(u>=10)return t+"00"+u +return t+"000"+u}, +rd:function(a){var u=Math.abs(a),t=a<0?"-":"+" +if(u>=1e5)return t+u +return t+"0"+u}, +nb:function(a){if(a>=100)return""+a +if(a>=10)return"0"+a +return"00"+a}, +aq:function(a){if(a>=10)return""+a +return"0"+a}, +cn:function(a){if(typeof a==="number"||typeof a==="boolean"||null==a)return J.aa(a) +if(typeof a==="string")return JSON.stringify(a) +return P.re(a)}, +I:function(a){return new P.ab(!1,null,null,a)}, +n5:function(a,b,c){return new P.ab(!0,a,b,c)}, +qZ:function(a){return new P.ab(!1,null,a,"Must not be null")}, +id:function(a,b){return new P.bU(null,null,!0,a,b,"Value not in range")}, +S:function(a,b,c,d,e){return new P.bU(b,c,!0,a,d,"Invalid value")}, +az:function(a,b,c){if(0>a||a>c)throw H.e(P.S(a,0,c,"start",null)) +if(b!=null){if(a>b||b>c)throw H.e(P.S(b,a,c,"end",null)) +return b}return c}, +ay:function(a,b){if(a<0)throw H.e(P.S(a,0,null,b,null))}, +d6:function(a,b,c,d,e){var u=e==null?J.H(b):e +return new P.fz(u,!0,a,c,"Index out of range")}, +W:function(a){return new P.jG(a)}, +nB:function(a){return new P.jB(a)}, +aM:function(a){return new P.be(a)}, +X:function(a){return new P.e6(a)}, +y:function(a,b,c){return new P.ak(a,b,c)}, +ne:function(a,b,c){if(a<=0)return new H.d1([c]) +return new P.kA(a,b,[c])}, +nj:function(a,b,c,d){var u,t,s +if(c){u=H.a([],[d]) +C.d.sh(u,a)}else{t=new Array(a) +t.fixed$length=Array +u=H.a(t,[d])}for(s=0;s=5){u=P.o4(a,0) +if(u===0){t=P.jI(d=14)s[7]=d +r=s[1] +if(r>=0)if(P.o1(a,0,r,20,s)===20)s[7]=r +q=s[2]+1 +p=s[3] +o=s[4] +n=s[5] +m=s[6] +if(mr+3){k=e +l=!1}else{t=p>0 +if(t&&p+1===o){k=e +l=!1}else{if(!(no+2&&C.a.R(a,"/..",n-3) +else j=!0 +if(j){k=e +l=!1}else{if(r===4)if(C.a.R(a,"file",0)){if(q<=0){if(!C.a.R(a,"/",o)){i="file:///" +h=3}else{i="file://" +h=2}a=i+C.a.q(a,o,d) +r-=0 +t=h-0 +n+=t +m+=t +d=a.length +q=7 +p=7 +o=7}else if(o===n){g=n+1;++m +a=C.a.aw(a,o,n,"/");++d +n=g}k="file"}else if(C.a.R(a,"http",0)){if(t&&p+3===o&&C.a.R(a,"80",p+1)){f=o-3 +n-=3 +m-=3 +a=C.a.aw(a,p,o,"") +d-=3 +o=f}k="http"}else k=e +else if(r===5&&C.a.R(a,"https",0)){if(t&&p+4===o&&C.a.R(a,"443",p+1)){f=o-4 +n-=4 +m-=4 +a=C.a.aw(a,p,o,"") +d-=3 +o=f}k="https"}else k=e +l=!0}}}else k=e +if(l){if(d9)l.$2("invalid character",u)}else{if(s===3)l.$2(n,u) +q=P.aV(C.a.q(a,t,u),o,o) +if(q>255)l.$2(m,t) +p=s+1 +k[s]=q +t=u+1 +s=p}}if(s!==3)l.$2(n,c) +q=P.aV(C.a.q(a,t,c),o,o) +if(q>255)l.$2(m,t) +k[s]=q +return k}, +nE:function(a,b,c){var u,t,s,r,q,p,o,n,m,l,k,j,i,h,g=new P.jK(a),f=new P.jL(g,a) +if(a.length<2)g.$1("address is too short") +u=H.a([],[P.h]) +for(t=b,s=t,r=!1,q=!1;t>>0) +u.push((m[2]<<8|m[3])>>>0)}if(r){if(u.length>7)g.$1("an address with a wildcard must have less than 7 parts")}else if(u.length!==8)g.$1("an address without a wildcard must contain exactly 8 parts") +l=new Uint8Array(16) +for(n=u.length,k=9-n,t=0,j=0;tb)j=P.tk(a,b,d) +else{if(d===b)P.c4(a,b,"Invalid empty scheme") +j=""}if(e>b){u=d+3 +t=u=b&&s=b&&u>>4]&1<<(r&15))!==0){if(s&&65<=r&&90>=r){if(l==null)l=new P.N("") +if(t>>4]&1<<(q&15))!==0){if(r&&65<=q&&90>=q){if(s==null)s=new P.N("") +if(t>>4]&1<<(q&15))!==0)P.c4(a,u,"Invalid character") +else{if((q&64512)===55296&&u+1>>4]&1<<(s&15))!==0))P.c4(a,u,"Illegal scheme character") +if(65<=s&&s<=90)t=!0}a=C.a.q(a,b,c) +return P.tc(t?a.toLowerCase():a)}, +tc:function(a){if(a==="http")return"http" +if(a==="file")return"file" +if(a==="https")return"https" +if(a==="package")return"package" +return a}, +tl:function(a,b,c){return P.cN(a,b,c,C.cc,!1)}, +th:function(a,b,c,d,e,f){var u=e==="file",t=u||f,s=P.cN(a,b,c,C.ak,!0) +if(s.length===0){if(u)return"/"}else if(t&&!C.a.S(s,"/"))s="/"+s +return P.tm(s,e,f)}, +tm:function(a,b,c){var u=b.length===0 +if(u&&!c&&!C.a.S(a,"/"))return P.to(a,!u||c) +return P.tp(a)}, +tj:function(a,b,c,d){return P.cN(a,b,c,C.x,!0)}, +tf:function(a,b,c){return P.cN(a,b,c,C.x,!0)}, +ml:function(a,b,c){var u,t,s,r,q,p=b+2 +if(p>=a.length)return"%" +u=C.a.v(a,b+1) +t=C.a.v(a,p) +s=H.ly(u) +r=H.ly(t) +if(s<0||r<0)return"%" +q=s*16+r +if(q<127&&(C.ai[C.c.ad(q,4)]&1<<(q&15))!==0)return H.mb(c&&65<=q&&90>=q?(q|32)>>>0:q) +if(u>=97||t>=97)return C.a.q(a,b,b+3).toUpperCase() +return}, +mk:function(a){var u,t,s,r,q,p,o="0123456789ABCDEF" +if(a<128){u=new Array(3) +u.fixed$length=Array +t=H.a(u,[P.h]) +t[0]=37 +t[1]=C.a.G(o,a>>>4) +t[2]=C.a.G(o,a&15)}else{if(a>2047)if(a>65535){s=240 +r=4}else{s=224 +r=3}else{s=192 +r=2}u=new Array(3*r) +u.fixed$length=Array +t=H.a(u,[P.h]) +for(q=0;--r,r>=0;s=128){p=C.c.dJ(a,6*r)&63|s +t[q]=37 +t[q+1]=C.a.G(o,p>>>4) +t[q+2]=C.a.G(o,p&15) +q+=3}}return P.mf(t,0,null)}, +cN:function(a,b,c,d,e){var u=P.nR(a,b,c,d,e) +return u==null?C.a.q(a,b,c):u}, +nR:function(a,b,c,d,e){var u,t,s,r,q,p,o,n,m +for(u=!e,t=b,s=t,r=null;t>>4]&1<<(q&15))!==0)++t +else{if(q===37){p=P.ml(a,t,!1) +if(p==null){t+=3 +continue}if("%"===p){p="%25" +o=1}else o=3}else if(u&&q<=93&&(C.ab[q>>>4]&1<<(q&15))!==0){P.c4(a,t,"Invalid character") +p=null +o=null}else{if((q&64512)===55296){n=t+1 +if(n=2&&P.nP(J.lX(a,0)))for(u=1;u127||(C.ag[t>>>4]&1<<(t&15))===0)break}return a}, +te:function(a,b){var u,t,s +for(u=0,t=0;t<2;++t){s=C.a.v(a,b+t) +if(48<=s&&s<=57)u=u*16+s-48 +else{s|=32 +if(97<=s&&s<=102)u=u*16+s-87 +else throw H.e(P.I("Invalid URL encoding"))}}return u}, +tq:function(a,b,c,d,e){var u,t,s,r,q=b +while(!0){if(!(q127)throw H.e(P.I("Illegal percent encoding in URI")) +if(t===37){if(q+3>s)throw H.e(P.I("Truncated URI")) +r.push(P.te(a,q+1)) +q+=2}else r.push(t)}}return new P.jN(!1).dR(r)}, +nP:function(a){var u=a|32 +return 97<=u&&u<=122}, +nC:function(a){var u +if(a.length>=5){u=P.o4(a,0) +if(u===0)return P.jI(a,5,null) +if(u===32)return P.jI(C.a.aN(a,5),0,null)}throw H.e(P.y("Does not start with 'data:'",a,0))}, +jI:function(a,b,c){var u,t,s,r,q,p,o,n,m="Invalid MIME type",l=H.a([b-1],[P.h]) +for(u=a.length,t=b,s=-1,r=null;tb)throw H.e(P.y(m,a,t)) +for(;r!==44;){l.push(t);++t +for(q=-1;t=0)l.push(q) +else{p=C.d.gaH(l) +if(r!==44||t!==p+7||!C.a.R(a,"base64",p+1))throw H.e(P.y("Expecting '='",a,t)) +break}}l.push(t) +o=t+1 +if((l.length&1)===1)a=C.b3.e9(a,o,u) +else{n=P.nR(a,o,u,C.x,!0) +if(n!=null)a=C.a.aw(a,o,u,n)}return new P.jH(a,l,c)}, +tv:function(){var u="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-._~!$&'()*+,;=",t=".",s=":",r="/",q="?",p="#",o=P.nj(22,new P.lc(),!0,P.af),n=new P.lb(o),m=new P.ld(),l=new P.le(),k=n.$2(0,225) +m.$3(k,u,1) +m.$3(k,t,14) +m.$3(k,s,34) +m.$3(k,r,3) +m.$3(k,q,172) +m.$3(k,p,205) +k=n.$2(14,225) +m.$3(k,u,1) +m.$3(k,t,15) +m.$3(k,s,34) +m.$3(k,r,234) +m.$3(k,q,172) +m.$3(k,p,205) +k=n.$2(15,225) +m.$3(k,u,1) +m.$3(k,"%",225) +m.$3(k,s,34) +m.$3(k,r,9) +m.$3(k,q,172) +m.$3(k,p,205) +k=n.$2(1,225) +m.$3(k,u,1) +m.$3(k,s,34) +m.$3(k,r,10) +m.$3(k,q,172) +m.$3(k,p,205) +k=n.$2(2,235) +m.$3(k,u,139) +m.$3(k,r,131) +m.$3(k,t,146) +m.$3(k,q,172) +m.$3(k,p,205) +k=n.$2(3,235) +m.$3(k,u,11) +m.$3(k,r,68) +m.$3(k,t,18) +m.$3(k,q,172) +m.$3(k,p,205) +k=n.$2(4,229) +m.$3(k,u,5) +l.$3(k,"AZ",229) +m.$3(k,s,102) +m.$3(k,"@",68) +m.$3(k,"[",232) +m.$3(k,r,138) +m.$3(k,q,172) +m.$3(k,p,205) +k=n.$2(5,229) +m.$3(k,u,5) +l.$3(k,"AZ",229) +m.$3(k,s,102) +m.$3(k,"@",68) +m.$3(k,r,138) +m.$3(k,q,172) +m.$3(k,p,205) +k=n.$2(6,231) +l.$3(k,"19",7) +m.$3(k,"@",68) +m.$3(k,r,138) +m.$3(k,q,172) +m.$3(k,p,205) +k=n.$2(7,231) +l.$3(k,"09",7) +m.$3(k,"@",68) +m.$3(k,r,138) +m.$3(k,q,172) +m.$3(k,p,205) +m.$3(n.$2(8,8),"]",5) +k=n.$2(9,235) +m.$3(k,u,11) +m.$3(k,t,16) +m.$3(k,r,234) +m.$3(k,q,172) +m.$3(k,p,205) +k=n.$2(16,235) +m.$3(k,u,11) +m.$3(k,t,17) +m.$3(k,r,234) +m.$3(k,q,172) +m.$3(k,p,205) +k=n.$2(17,235) +m.$3(k,u,11) +m.$3(k,r,9) +m.$3(k,q,172) +m.$3(k,p,205) +k=n.$2(10,235) +m.$3(k,u,11) +m.$3(k,t,18) +m.$3(k,r,234) +m.$3(k,q,172) +m.$3(k,p,205) +k=n.$2(18,235) +m.$3(k,u,11) +m.$3(k,t,19) +m.$3(k,r,234) +m.$3(k,q,172) +m.$3(k,p,205) +k=n.$2(19,235) +m.$3(k,u,11) +m.$3(k,r,234) +m.$3(k,q,172) +m.$3(k,p,205) +k=n.$2(11,235) +m.$3(k,u,11) +m.$3(k,r,10) +m.$3(k,q,172) +m.$3(k,p,205) +k=n.$2(12,236) +m.$3(k,u,12) +m.$3(k,q,12) +m.$3(k,p,205) +k=n.$2(13,237) +m.$3(k,u,13) +m.$3(k,q,13) +l.$3(n.$2(20,245),"az",21) +k=n.$2(21,245) +l.$3(k,"az",21) +l.$3(k,"09",21) +m.$3(k,"+-.",21) +return o}, +o1:function(a,b,c,d,e){var u,t,s,r,q=$.qC() +for(u=b;u95?31:s] +d=r&31 +e[r>>>5]=u}return d}, +o4:function(a,b){return((C.a.G(a,b+4)^58)*3|C.a.G(a,b)^100|C.a.G(a,b+1)^97|C.a.G(a,b+2)^116|C.a.G(a,b+3)^97)>>>0}, +i1:function i1(a,b){this.a=a +this.b=b}, +aT:function aT(){}, +cm:function cm(a,b){this.a=a +this.b=b}, +w:function w(){}, +b3:function b3(){}, +cA:function cA(){}, +ab:function ab(a,b,c,d){var _=this +_.a=a +_.b=b +_.c=c +_.d=d}, +bU:function bU(a,b,c,d,e,f){var _=this +_.e=a +_.f=b +_.a=c +_.b=d +_.c=e +_.d=f}, +fz:function fz(a,b,c,d,e){var _=this +_.f=a +_.a=b +_.b=c +_.c=d +_.d=e}, +i0:function i0(a,b,c,d){var _=this +_.a=a +_.b=b +_.c=c +_.d=d}, +jG:function jG(a){this.a=a}, +jB:function jB(a){this.a=a}, +be:function be(a){this.a=a}, +e6:function e6(a){this.a=a}, +i7:function i7(){}, +dm:function dm(){}, +ei:function ei(a){this.a=a}, +kl:function kl(a){this.a=a}, +ak:function ak(a,b,c){this.a=a +this.b=b +this.c=c}, +bB:function bB(){}, +h:function h(){}, +t:function t(){}, +kA:function kA(a,b,c){this.a=a +this.b=b +this.$ti=c}, +Z:function Z(){}, +l:function l(){}, +f:function f(){}, +cv:function cv(a,b,c){this.a=a +this.b=b +this.$ti=c}, +A:function A(){}, +G:function G(){}, +c:function c(){}, +dl:function dl(){}, +a1:function a1(){}, +d:function d(){}, +N:function N(a){this.a=a}, +me:function me(){}, +bV:function bV(){}, +ah:function ah(){}, +bY:function bY(){}, +jJ:function jJ(a){this.a=a}, +jK:function jK(a){this.a=a}, +jL:function jL(a,b){this.a=a +this.b=b}, +dG:function dG(a,b,c,d,e,f,g){var _=this +_.a=a +_.b=b +_.c=c +_.d=d +_.e=e +_.f=f +_.r=g +_.z=_.y=null}, +l4:function l4(a,b){this.a=a +this.b=b}, +jH:function jH(a,b,c){this.a=a +this.b=b +this.c=c}, +lc:function lc(){}, +lb:function lb(a){this.a=a}, +ld:function ld(){}, +le:function le(){}, +kU:function kU(a,b,c,d,e,f,g,h){var _=this +_.a=a +_.b=b +_.c=c +_.d=d +_.e=e +_.f=f +_.r=g +_.x=h +_.y=null}, +kh:function kh(a,b,c,d,e,f,g){var _=this +_.a=a +_.b=b +_.c=c +_.d=d +_.e=e +_.f=f +_.r=g +_.z=_.y=null}, +mw:function(a){var u=J.m(a) +if(!u.$if&&!u.$it)throw H.e(P.I("object must be a Map or Iterable")) +return P.tu(a)}, +tu:function(a){return new P.l9(new P.kE([null,null])).$1(a)}, +l9:function l9(a){this.a=a}, +af:function af(){}, +tt:function(a){var u,t=a.$dart_jsFunction +if(t!=null)return t +u=function(b,c){return function(){return b(c,Array.prototype.slice.apply(arguments))}}(P.ts,a) +u[$.mB()]=a +a.$dart_jsFunction=u +return u}, +ts:function(a,b){return H.rL(a,b,null)}, +bm:function(a){if(typeof a=="function")return a +else return P.tt(a)}},M={ +qW:function(a,b){var u,t,s,r,q,p,o,n,m,l,k,j,i,h,g,f="byteOffset",e=null,d="normalized" +F.u(a,C.ck,b) +u=F.F(a,"bufferView",b,!1) +if(u===-1){t=a.u(f) +if(t)b.j($.ce(),H.a(["bufferView"],[P.c]),f) +s=0}else s=F.M(a,f,b,0,e,-1,0,!1) +r=F.M(a,"componentType",b,-1,C.bU,-1,0,!0) +q=F.M(a,"count",b,-1,e,-1,1,!0) +p=F.C(a,"type",b,e,C.k.gI(),e,!0) +o=F.oc(a,d,b) +if(p!=null&&r!==-1){n=C.k.i(0,p) +if(n!=null)if(r===5126){t=[P.h] +m=F.a3(a,"min",b,e,H.a([n],t),1/0,-1/0,!0) +l=F.a3(a,"max",b,e,H.a([n],t),1/0,-1/0,!0)}else{m=F.od(a,"min",b,r,n) +l=F.od(a,"max",b,r,n)}else{m=e +l=m}}else{m=e +l=m}k=F.a4(a,"sparse",b,M.tO(),!1) +if(o)t=r===5126||r===5125 +else t=!1 +if(t)b.p($.pM(),d) +if((p==="MAT2"||p==="MAT3"||p==="MAT4")&&s!==-1&&(s&3)!==0)b.p($.pL(),f) +switch(r){case 5120:case 5121:case 5122:case 5123:case 5125:t=P.h +j=[t] +H.dM(l,"$il",j,"$al") +H.dM(m,"$il",j,"$al") +F.C(a,"name",b,e,e,e,!1) +j=F.q(a,C.L,b,e,!1) +i=F.r(a,b) +h=new M.jY(u,s,r,q,p,o,l,m,k,Z.am(r),j,i) +if(m!=null){j=b.M() +i=P.hz(m.length,0,t) +g=new Array(m.length) +g.fixed$length=Array +b.U(h,new M.hT(i,H.a(g,[t]),J.dS(m,!1),j))}if(l!=null){j=b.M() +i=P.hz(l.length,0,t) +g=new Array(l.length) +g.fixed$length=Array +b.U(h,new M.hH(i,H.a(g,[t]),J.dS(l,!1),j))}break +default:t=P.w +j=[t] +H.dM(l,"$il",j,"$al") +H.dM(m,"$il",j,"$al") +F.C(a,"name",b,e,e,e,!1) +j=F.q(a,C.L,b,e,!1) +i=F.r(a,b) +h=new M.jT(u,s,r,q,p,o,l,m,k,Z.am(r),j,i) +b.U(h,new M.fA(b.M())) +if(m!=null){j=b.M() +i=P.hz(m.length,0,P.h) +g=new Array(m.length) +g.fixed$length=Array +b.U(h,new M.hS(i,H.a(g,[t]),J.dS(m,!1),j))}if(l!=null){j=b.M() +i=P.hz(l.length,0,P.h) +g=new Array(l.length) +g.fixed$length=Array +b.U(h,new M.hG(i,H.a(g,[t]),J.dS(l,!1),j))}break}return h}, +aG:function(a,b,c,d,e,f){var u,t,s="byteOffset" +if(a===-1)return!1 +if(a%b!==0)if(f!=null)f.j($.pN(),H.a([a,b],[P.c]),s) +else return!1 +u=d.y +if(u===-1)return!1 +t=u+a +if(t%b!==0)if(f!=null)f.B($.pc(),H.a([t,b],[P.c])) +else return!1 +u=d.z +if(a>u)if(f!=null)f.j($.mJ(),H.a([a,c,e,u],[P.c]),s) +else return!1 +else if(a+c>u)if(f!=null)f.B($.mJ(),H.a([a,c,e,u],[P.c])) +else return!1 +return!0}, +lZ:function(a,b,c,d){if(b==null||b.byteLengthr.gb4()))u=r.gcG()==r.gb4()&&r.ge8()>r.gbH() +else u=!0 +if(u)b.j($.q5(),H.a([t,s],[P.c]),p)}return r}, +bv:function bv(a,b,c,d,e){var _=this +_.e=a +_.f=b +_.r=c +_.a=d +_.b=e +_.c=!1}, +rm:function(a,b){var u,t,s,r,q,p,o,n,m,l,k="bufferView",j=null +F.u(a,C.c2,b) +r=F.F(a,k,b,!1) +q=b.k1 +p=F.C(a,"mimeType",b,j,q,j,!1) +u=F.C(a,"uri",b,j,j,j,!1) +o=r===-1 +n=!o +if(n&&p==null)b.j($.ce(),H.a(["mimeType"],[P.c]),k) +if(!(n&&u!=null))o=o&&u==null +else o=!0 +if(o)b.B($.mR(),H.a(["bufferView","uri"],[P.c])) +t=null +if(u!=null){s=null +try{s=P.nC(u)}catch(m){if(H.z(m) instanceof P.ak)t=F.oh(u,b) +else throw m}if(s!=null){if(b.id)b.p($.mH(),"uri") +l=s.cr() +if(p==null){o=C.d.D(q,s.gat()) +if(!o)b.j($.mS(),H.a([s.gat(),q],[P.c]),"uri") +p=s.gat()}}else l=j}else l=j +q=t +F.C(a,"name",b,j,j,j,!1) +return new T.b5(r,p,q,l,F.q(a,C.as,b,j,!1),F.r(a,b))}, +b5:function b5(a,b,c,d,e,f){var _=this +_.x=a +_.y=b +_.z=c +_.Q=d +_.cx=_.ch=null +_.a=e +_.b=f +_.c=!1}, +rR:function(a,b){var u=null +F.u(a,C.cw,b) +F.M(a,"magFilter",b,-1,C.bJ,-1,0,!1) +F.M(a,"minFilter",b,-1,C.bN,-1,0,!1) +F.M(a,"wrapS",b,10497,C.ac,-1,0,!1) +F.M(a,"wrapT",b,10497,C.ac,-1,0,!1) +F.C(a,"name",b,u,u,u,!1) +return new T.bc(F.q(a,C.dd,b,u,!1),F.r(a,b))}, +bc:function bc(a,b){this.a=a +this.b=b +this.c=!1}, +rA:function(){return new T.bO(new Float32Array(16))}, +rP:function(){return new T.di(new Float32Array(4))}, +nH:function(a){var u=new Float32Array(3) +u[2]=a[2] +u[1]=a[1] +u[0]=a[0] +return new T.bh(u)}, +nG:function(){return new T.bh(new Float32Array(3))}, +bO:function bO(a){this.a=a}, +di:function di(a){this.a=a}, +bh:function bh(a){this.a=a}, +ds:function ds(a){this.a=a}},Q={ +r1:function(a,b){var u,t,s,r,q,p,o,n,m,l="byteLength",k=null,j="uri" +F.u(a,C.cD,b) +r=F.M(a,l,b,-1,k,-1,1,!0) +u=null +q=a.u(j) +if(q){t=F.C(a,j,b,k,k,k,!1) +if(t!=null){s=null +try{s=P.nC(t)}catch(p){if(H.z(p) instanceof P.ak)u=F.oh(t,b) +else throw p}if(s!=null){if(b.id)b.p($.mH(),j) +if(s.gat()==="application/octet-stream"||s.gat()==="application/gltf-buffer")o=s.cr() +else{b.j($.pQ(),H.a([s.gat()],[P.c]),j) +o=k}}else o=k +if(o!=null&&r!==-1&&o.length!==r){n=$.oO() +m=o.length +b.j(n,H.a([m,r],[P.c]),l) +r=m}}else o=k}else o=k +n=u +F.C(a,"name",b,k,k,k,!1) +return new Q.b_(n,r,q,o,F.q(a,C.d_,b,k,!1),F.r(a,b))}, +b_:function b_(a,b,c,d,e,f){var _=this +_.x=a +_.y=b +_.z=c +_.Q=d +_.a=e +_.b=f +_.c=!1}, +ol:function(){var u=new Q.lN() +J.qM(self.exports,P.bm(new Q.lJ(u))) +J.qN(self.exports,P.bm(new Q.lK(u))) +J.qO(self.exports,P.bm(new Q.lL())) +J.qL(self.exports,P.bm(new Q.lM()))}, +dN:function(a,b){return Q.uH(a,b)}, +uH:function(a,b){var u=0,t=P.cT([P.f,P.d,P.c]),s,r=2,q,p=[],o,n,m,l,k,j,i +var $async$dN=P.cU(function(c,d){if(c===1){q=d +u=r}while(true)switch(u){case 0:if(!J.m(a).$iaf)throw H.e(P.I("data: Argument must be a Uint8Array.")) +l=Q.nT(b) +o=Q.nV(l) +n=null +r=4 +k=[P.l,P.h] +u=7 +return P.c5(K.ri(P.mc(H.a([a],[k]),k),o),$async$dN) +case 7:m=d +u=8 +return P.c5(m.bM(),$async$dN) +case 8:n=d +r=2 +u=6 +break +case 4:r=3 +i=q +if(H.z(i) instanceof K.d5)throw i +else throw i +u=6 +break +case 3:u=2 +break +case 6:s=Q.dK(l,o,n) +u=1 +break +case 1:return P.cP(s,t) +case 2:return P.cO(q,t)}}) +return P.cQ($async$dN,t)}, +mA:function(a,b){var u=0,t=P.cT([P.f,P.d,P.c]),s,r,q +var $async$mA=P.cU(function(c,d){if(c===1)return P.cO(d,t) +while(true)switch(u){case 0:if(typeof a!=="string")throw H.e(P.I("json: Argument must be a string.")) +r=Q.nT(b) +q=Q.nV(r) +s=Q.dK(r,q,K.rh(a,q)) +u=1 +break +case 1:return P.cP(s,t)}}) +return P.cQ($async$mA,t)}, +nT:function(a){var u +if(a!=null)u=typeof a==="number"||typeof a==="boolean"||typeof a==="string"||!!J.m(a).$il +else u=!1 +if(u)throw H.e(P.I("options: Value must be an object.")) +return H.oi(a,"$idy")}, +dK:function(a,b,c){var u=0,t=P.cT([P.f,P.d,P.c]),s,r,q,p,o,n,m +var $async$dK=P.cU(function(d,e){if(d===1)return P.cO(e,t) +while(true)switch(u){case 0:m=a==null +if(!m){r=J.an(a) +q=Q.tz(r.gb8(a)) +if(r.gbx(a)!=null&&!J.m(r.gbx(a)).$ibB)throw H.e(P.I("options.externalResourceFunction: Value must be a function.")) +else p=r.gbx(a) +if(r.gbQ(a)!=null){o=r.gbQ(a) +o=typeof o!=="boolean"}else o=!1 +if(o)throw H.e(P.I("options.validateAccessorData: Value must be a boolean.")) +if(r.gbS(a)!=null){r=r.gbS(a) +r=typeof r!=="boolean"}else r=!1 +if(r)throw H.e(P.I("options.writeTimestamp: Value must be a boolean."))}else{q=null +p=null}u=(c==null?null:c.b)!=null&&p!=null?3:4 +break +case 3:n=Q.ty(b,c,p) +r=J.qH(a) +u=5 +return P.c5(n.aJ(r==null?!0:r),$async$dK) +case 5:case 4:m=m?null:J.qI(a) +s=new A.jP(q,b,c,m==null?!0:m).b7() +u=1 +break +case 1:return P.cP(s,t)}}) +return P.cQ($async$dK,t)}, +tz:function(a){var u,t,s +if(a!=null)if(typeof a==="string")try{t=P.nD(a) +return t}catch(s){t=H.z(s) +if(t instanceof P.ak){u=t +throw H.e(P.I("options.uri: "+H.b(u)+"."))}else throw s}else throw H.e(P.I("options.uri: Value must be a string.")) +return}, +nV:function(a){var u,t,s,r,q,p,o,n,m +if(a!=null){u=J.an(a) +if(u.gb5(a)!=null){t=u.gb5(a) +t=typeof t!=="number"||Math.floor(t)!==t||u.gb5(a)<0}else t=!1 +if(t)throw H.e(P.I("options.maxIssues: Value must be a non-negative integer.")) +if(u.gb2(a)!=null){if(!J.m(u.gb2(a)).$il)throw H.e(P.I("options.ignoredIssues: Value must be an array.")) +s=H.a([],[P.d]) +for(r=0;r=0&&n<=3)p.l(0,o,C.cu[n]) +else throw H.e(P.I('options.severityOverrides["'+H.b(o)+'"]: Value must be one of [0, 1, 2, 3].'))}}else p=null +m=M.nF(s,u.gb5(a),p)}else m=null +return M.rb(m)}, +ty:function(a,b,c){var u=new Q.lh(c) +return new N.ie(b.b,a,new Q.lf(b,u),new Q.lg(u))}, +dh:function dh(){}, +m2:function m2(){}, +dy:function dy(){}, +lN:function lN(){}, +lJ:function lJ(a){this.a=a}, +lI:function lI(a,b,c){this.a=a +this.b=b +this.c=c}, +lF:function lF(a){this.a=a}, +lG:function lG(a,b){this.a=a +this.b=b}, +lK:function lK(a){this.a=a}, +lH:function lH(a,b,c){this.a=a +this.b=b +this.c=c}, +lD:function lD(a){this.a=a}, +lE:function lE(a,b){this.a=a +this.b=b}, +lL:function lL(){}, +lM:function lM(){}, +lh:function lh(a){this.a=a}, +li:function li(a){this.a=a}, +lj:function lj(a){this.a=a}, +lf:function lf(a,b){this.a=a +this.b=b}, +lg:function lg(a){this.a=a}, +i2:function i2(a){this.a=a}},V={ +r0:function(a,b){var u,t,s,r,q,p=null,o="byteStride" +F.u(a,C.bQ,b) +u=F.M(a,"byteLength",b,-1,p,-1,1,!0) +t=F.M(a,o,b,-1,p,252,4,!1) +s=F.M(a,"target",b,-1,C.bF,-1,0,!1) +if(t!==-1){if(u!==-1&&t>u)b.j($.pR(),H.a([t,u],[P.c]),o) +if(t%4!==0)b.j($.pK(),H.a([t,4],[P.c]),o) +if(s===34963)b.p($.lV(),o)}r=F.F(a,"buffer",b,!0) +q=F.M(a,"byteOffset",b,0,p,-1,0,!1) +F.C(a,"name",b,p,p,p,!1) +return new V.aH(r,q,u,t,s,F.q(a,C.aq,b,p,!1),F.r(a,b))}, +aH:function aH(a,b,c,d,e,f,g){var _=this +_.x=a +_.y=b +_.z=c +_.Q=d +_.ch=e +_.cy=_.cx=null +_.db=-1 +_.a=f +_.b=g +_.c=!1}, +nc:function(b7,b8){var u,t,s,r,q,p,o,n,m,l,k,j,i,h,g,f,e,d,c,b,a,a0,a1,a2,a3,a4,a5,a6,a7,a8,a9,b0,b1,b2,b3="extensionsRequired",b4="extensionsUsed",b5=null,b6=new V.fn(b8) +b6.$0() +F.u(b7,C.cF,b8) +if(b7.u(b3)&&!b7.u(b4))b8.j($.ce(),H.a(["extensionsUsed"],[P.c]),b3) +u=F.of(b7,b4,b8) +if(u==null)u=H.a([],[P.d]) +t=F.of(b7,b3,b8) +if(t==null)t=H.a([],[P.d]) +b8.e1(u,t) +s=new V.fo(b7,b6,b8) +r=new V.fp(b6,b7,b8).$3$req("asset",T.tS(),!0) +if((r==null?b5:r.f)==null)return +else if(r.gb4()!==2){q=$.qk() +p=r.gb4() +b8.j(q,H.a([p],[P.c]),"version") +return}else if(r.gbH()>0){q=$.ql() +p=r.gbH() +b8.j(q,H.a([p],[P.c]),"version")}o=s.$1$2("accessors",M.tP(),[M.Q,P.G]) +n=s.$1$2("animations",Z.tR(),Z.aZ) +m=s.$1$2("buffers",Q.tX(),Q.b_) +l=s.$1$2("bufferViews",V.tY(),V.aH) +k=s.$1$2("cameras",G.u0(),G.b1) +j=s.$1$2("images",T.uc(),T.b5) +i=s.$1$2("materials",Y.ur(),Y.ax) +h=s.$1$2("meshes",S.uv(),S.ba) +q=V.ad +g=s.$1$2("nodes",V.ux(),q) +f=s.$1$2("samplers",T.uy(),T.bc) +e=s.$1$2("scenes",B.uz(),B.aK) +b6.$0() +d=F.F(b7,"scene",b8,!1) +c=e.i(0,d) +p=d!==-1&&c==null +if(p)b8.j($.D(),H.a([d],[P.c]),"scene") +b=s.$1$2("skins",O.uA(),O.bd) +a=s.$1$2("textures",U.uC(),U.bf) +a0=F.q(b7,C.ar,b8,b5,!1) +b6.$0() +a1=new V.d4(u,t,o,n,r,m,l,k,j,i,h,g,f,c,b,a,a0,F.r(b7,b8)) +a2=new V.fl(b8,a1) +a2.$2(l,C.aq) +a2.$2(o,C.L) +a2.$2(j,C.as) +a2.$2(a,C.N) +a2.$2(i,C.l) +a2.$2(h,C.at) +a2.$2(g,C.M) +a2.$2(b,C.ax) +a2.$2(n,C.ap) +a2.$2(e,C.aw) +if(a0.a!==0){p=b8.c +p.push("extensions") +a0.H(0,new V.fj(b8,a1)) +p.pop()}p=b8.c +p.push("nodes") +g.aa(new V.fk(b8,P.at(q))) +p.pop() +a3=[o,m,l,k,j,i,h,g,f,b,a] +for(a4=0;a4<11;++a4){a5=a3[a4] +if(a5.gh(a5)===0)continue +p.push(a5.c) +for(q=a5.b,a6=a5.a,a7=a6.length,a8=0;a8=a7 +a9=a9?b5:a6[a8] +if((a9==null?b5:a9.c)===!1)b8.V($.dP(),a8)}p.pop()}q=b8.y +if(q.a!==0){for(a6=new H.b9(q,[H.i(q,0)]),a6=a6.gw(a6);a6.m();){a7=a6.d +if(a7.gh(a7)===0)continue +b0=q.i(0,a7) +C.d.sh(p,0) +C.d.J(p,b0) +for(a9=a7.b,a7=a7.a,b1=a7.length,a8=0;a8=b1 +b2=b2?b5:a7[a8] +if((b2==null?b5:b2.ge4())===!1)b8.V($.dP(),a8)}}C.d.sh(p,0)}return a1}, +d4:function d4(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r){var _=this +_.d=a +_.e=b +_.f=c +_.r=d +_.x=e +_.y=f +_.z=g +_.Q=h +_.ch=i +_.cx=j +_.cy=k +_.db=l +_.dx=m +_.dy=n +_.fx=o +_.fy=p +_.a=q +_.b=r +_.c=!1}, +fn:function fn(a){this.a=a}, +fo:function fo(a,b,c){this.a=a +this.b=b +this.c=c}, +fp:function fp(a,b,c){this.a=a +this.b=b +this.c=c}, +fl:function fl(a,b){this.a=a +this.b=b}, +fm:function fm(a,b){this.a=a +this.b=b}, +fj:function fj(a,b){this.a=a +this.b=b}, +fk:function fk(a,b){this.a=a +this.b=b}, +fh:function fh(){}, +fi:function fi(){}, +fq:function fq(a,b){this.a=a +this.b=b}, +fr:function fr(a,b){this.a=a +this.b=b}, +cB:function cB(){}, +fc:function fc(){}, +fa:function fa(){}, +b0:function b0(a){this.a=a}, +aY:function aY(a){this.a=a}, +k:function k(a,b,c){this.a=a +this.b=b +this.c=c}, +rF:function(b2,b3){var u,t,s,r,q,p,o,n,m,l,k,j,i,h,g,f,e,d,c,b,a,a0,a1,a2,a3,a4,a5,a6,a7,a8=null,a9="matrix",b0="translation",b1="rotation" +F.u(b2,C.bM,b3) +if(b2.u(a9)){u=F.a3(b2,a9,b3,a8,C.bA,1/0,-1/0,!1) +if(u!=null){t=new Float32Array(16) +s=new T.bO(t) +r=u[0] +q=u[1] +p=u[2] +o=u[3] +n=u[4] +m=u[5] +l=u[6] +k=u[7] +j=u[8] +i=u[9] +h=u[10] +g=u[11] +f=u[12] +e=u[13] +d=u[14] +t[15]=u[15] +t[14]=d +t[13]=e +t[12]=f +t[11]=g +t[10]=h +t[9]=i +t[8]=j +t[7]=k +t[6]=l +t[5]=m +t[4]=n +t[3]=o +t[2]=p +t[1]=q +t[0]=r}else s=a8}else s=a8 +if(b2.u(b0)){c=F.a3(b2,b0,b3,a8,C.o,1/0,-1/0,!1) +b=c!=null?T.nH(c):a8}else b=a8 +if(b2.u(b1)){a=F.a3(b2,b1,b3,a8,C.J,1,-1,!1) +if(a!=null){t=a[0] +r=a[1] +q=a[2] +p=a[3] +o=new Float32Array(4) +a0=new T.di(o) +o[0]=t +o[1]=r +o[2]=q +o[3]=p +t=Math.sqrt(a0.gaI()) +if(Math.abs(1-t)>0.00769)b3.p($.qh(),b1)}else a0=a8}else a0=a8 +if(b2.u("scale")){a1=F.a3(b2,"scale",b3,a8,C.o,1/0,-1/0,!1) +a2=a1!=null?T.nH(a1):a8}else a2=a8 +a3=F.F(b2,"camera",b3,!1) +a4=F.ms(b2,"children",b3,!1) +a5=F.F(b2,"mesh",b3,!1) +a6=F.F(b2,"skin",b3,!1) +a7=F.a3(b2,"weights",b3,a8,a8,1/0,-1/0,!1) +if(a5===-1){if(a6!==-1)b3.j($.ce(),H.a(["mesh"],[P.c]),"skin") +if(a7!=null)b3.j($.ce(),H.a(["mesh"],[P.c]),"weights")}if(s!=null){if(b!=null||a0!=null||a2!=null)b3.p($.q9(),a9) +if(s.cE())b3.p($.q7(),a9) +else if(!F.uh(s))b3.p($.qa(),a9)}F.C(b2,"name",b3,a8,a8,a8,!1) +return new V.ad(a3,a4,a6,s,a5,b,a0,a2,a7,P.at(B.aK),F.q(b2,C.M,b3,a8,!1),F.r(b2,b3))}, +ad:function ad(a,b,c,d,e,f,g,h,i,j,k,l){var _=this +_.x=a +_.y=b +_.z=c +_.Q=d +_.ch=e +_.cx=f +_.cy=g +_.db=h +_.dx=i +_.dy=j +_.id=_.go=_.fy=_.fx=_.fr=null +_.k1=!1 +_.a=k +_.b=l +_.c=!1}, +i3:function i3(){}, +i4:function i4(){}, +i5:function i5(a,b){this.a=a +this.b=b}},G={ +r4:function(a,b){var u,t=null,s="orthographic",r="perspective" +F.u(a,C.cC,b) +u=a.u(s)&&a.u(r) +if(u)b.B($.mR(),C.aj) +switch(F.C(a,"type",b,t,C.aj,t,!0)){case"orthographic":F.a4(a,s,b,G.tZ(),!0) +break +case"perspective":F.a4(a,r,b,G.u_(),!0) +break}F.C(a,"name",b,t,t,t,!1) +return new G.b1(F.q(a,C.d2,b,t,!1),F.r(a,b))}, +r2:function(a,b){var u,t,s,r +F.u(a,C.cE,b) +u=F.T(a,"xmag",b,0/0,1/0,-1/0,1/0,-1/0,!0) +t=F.T(a,"ymag",b,0/0,1/0,-1/0,1/0,-1/0,!0) +s=F.T(a,"zfar",b,0/0,1/0,0,1/0,-1/0,!0) +r=F.T(a,"znear",b,0/0,1/0,-1/0,1/0,0,!0) +if(!isNaN(s)&&!isNaN(r)&&s<=r)b.P($.mT()) +if(u===0||t===0)b.P($.pS()) +return new G.bx(F.q(a,C.d0,b,null,!1),F.r(a,b))}, +r3:function(a,b){var u,t,s +F.u(a,C.c_,b) +u=F.T(a,"zfar",b,0/0,1/0,0,1/0,-1/0,!1) +t=F.T(a,"znear",b,0/0,1/0,0,1/0,-1/0,!0) +s=!isNaN(u)&&!isNaN(t)&&u<=t +if(s)b.P($.mT()) +F.T(a,"aspectRatio",b,0/0,1/0,0,1/0,-1/0,!1) +F.T(a,"yfov",b,0/0,1/0,0,1/0,-1/0,!0) +return new G.by(F.q(a,C.d1,b,null,!1),F.r(a,b))}, +b1:function b1(a,b){this.a=a +this.b=b +this.c=!1}, +bx:function bx(a,b){this.a=a +this.b=b +this.c=!1}, +by:function by(a,b){this.a=a +this.b=b +this.c=!1}},Y={ +rz:function(a,b){var u,t,s,r,q,p,o,n,m,l=null,k="alphaCutoff" +F.u(a,C.bT,b) +u=F.a4(a,"pbrMetallicRoughness",b,Y.uu(),!1) +t=F.a4(a,"normalTexture",b,Y.us(),!1) +s=F.a4(a,"occlusionTexture",b,Y.ut(),!1) +r=F.a4(a,"emissiveTexture",b,Y.dL(),!1) +F.a3(a,"emissiveFactor",b,C.by,C.o,1,0,!1) +q=F.C(a,"alphaMode",b,"OPAQUE",C.bS,l,!1) +F.T(a,k,b,0.5,1/0,-1/0,1/0,0,!1) +p=q!=="MASK"&&a.u(k) +if(p)b.p($.pX(),k) +F.oc(a,"doubleSided",b) +o=F.q(a,C.l,b,l,!0) +F.C(a,"name",b,l,l,l,!1) +n=new Y.ax(u,t,s,r,P.V(P.d,P.h),o,F.r(a,b)) +p=H.a([],[P.c]) +p.push(u) +p.push(t) +p.push(s) +p.push(r) +for(m=o.gax(),m=new H.bN(J.U(m.a),m.b,[H.i(m,0),H.i(m,1)]);m.m();)p.push(m.a) +b.av(n,p) +return n}, +rI:function(a,b){var u,t,s,r,q,p +F.u(a,C.c4,b) +F.a3(a,"baseColorFactor",b,C.a9,C.J,1,0,!1) +u=F.a4(a,"baseColorTexture",b,Y.dL(),!1) +F.T(a,"metallicFactor",b,1,1/0,-1/0,1,0,!1) +F.T(a,"roughnessFactor",b,1,1/0,-1/0,1,0,!1) +t=F.a4(a,"metallicRoughnessTexture",b,Y.dL(),!1) +s=F.q(a,C.dc,b,null,!1) +r=new Y.bS(u,t,s,F.r(a,b)) +q=H.a([],[P.c]) +q.push(u) +q.push(t) +for(p=s.gax(),p=new H.bN(J.U(p.a),p.b,[H.i(p,0),H.i(p,1)]);p.m();)q.push(p.a) +b.av(r,q) +return r}, +rH:function(a,b){var u,t,s,r +F.u(a,C.cg,b) +u=F.q(a,C.av,b,C.l,!1) +t=F.F(a,"index",b,!0) +s=F.M(a,"texCoord",b,0,null,-1,0,!1) +F.T(a,"strength",b,1,1/0,-1/0,1,0,!1) +r=new Y.bR(t,s,u,F.r(a,b)) +b.av(r,u.gax()) +return r}, +rG:function(a,b){var u,t,s,r +F.u(a,C.cf,b) +u=F.q(a,C.au,b,C.l,!1) +t=F.F(a,"index",b,!0) +s=F.M(a,"texCoord",b,0,null,-1,0,!1) +F.T(a,"scale",b,1,1/0,-1/0,1/0,-1/0,!1) +r=new Y.bQ(t,s,u,F.r(a,b)) +b.av(r,u.gax()) +return r}, +rW:function(a,b){var u,t +F.u(a,C.ce,b) +u=F.q(a,C.ay,b,C.l,!1) +t=new Y.bg(F.F(a,"index",b,!0),F.M(a,"texCoord",b,0,null,-1,0,!1),u,F.r(a,b)) +b.av(t,u.gax()) +return t}, +ax:function ax(a,b,c,d,e,f,g){var _=this +_.x=a +_.y=b +_.z=c +_.Q=d +_.dx=e +_.a=f +_.b=g +_.c=!1}, +hF:function hF(a,b){this.a=a +this.b=b}, +bS:function bS(a,b,c,d){var _=this +_.e=a +_.x=b +_.a=c +_.b=d +_.c=!1}, +bR:function bR(a,b,c,d){var _=this +_.d=a +_.e=b +_.f=null +_.a=c +_.b=d +_.c=!1}, +bQ:function bQ(a,b,c,d){var _=this +_.d=a +_.e=b +_.f=null +_.a=c +_.b=d +_.c=!1}, +bg:function bg(a,b,c,d){var _=this +_.d=a +_.e=b +_.f=null +_.a=c +_.b=d +_.c=!1}, +rj:function(a,b,c,d,e,f,g,h,i){return new Y.bC(a,b,c,d,e,f,g,i,h)}, +rl:function(a){var u,t,s,r={} +r.a=r.b=null +u=Y.bC +t=new P.E($.p,[u]) +s=new P.aN(t,[u]) +r.c=!1 +r.a=a.bE(new Y.fv(r,s),new Y.fw(r),new Y.fx(r,s)) +return t}, +rk:function(a){var u=new Y.fu() +if(u.$2(a,C.bC))return C.az +if(u.$2(a,C.bE))return C.aA +if(u.$2(a,C.bI))return C.aB +return}, +cI:function cI(a){this.b=a}, +cG:function cG(a,b){this.a=a +this.b=b}, +bZ:function bZ(a,b){this.a=a +this.b=b}, +b4:function b4(a,b){this.a=a +this.b=b}, +bC:function bC(a,b,c,d,e,f,g,h,i){var _=this +_.a=a +_.b=b +_.c=c +_.d=d +_.e=e +_.f=f +_.r=g +_.x=h +_.y=i}, +fv:function fv(a,b){this.a=a +this.b=b}, +fx:function fx(a,b){this.a=a +this.b=b}, +fw:function fw(a){this.a=a}, +fu:function fu(){}, +ft:function ft(){}, +fK:function fK(a,b){var _=this +_.f=_.e=_.d=_.c=0 +_.r=null +_.a=a +_.b=b}, +fM:function fM(){}, +fL:function fL(){}, +i9:function i9(a,b,c,d,e,f){var _=this +_.y=_.x=_.r=_.f=_.e=_.d=_.c=0 +_.Q=_.z=!1 +_.ch=a +_.cx=b +_.cy=!1 +_.db=c +_.dx=d +_.a=e +_.b=f}, +ia:function ia(a){this.a=a}, +jS:function jS(a,b,c){var _=this +_.c=a +_.d=0 +_.a=b +_.b=c}, +dr:function dr(){}, +dp:function dp(){}, +as:function as(a){this.a=a}},S={ +rC:function(a,b){var u,t,s,r,q,p,o,n,m,l,k=null,j="primitives" +F.u(a,C.ct,b) +u=F.a3(a,"weights",b,k,k,1/0,-1/0,!1) +t=F.lv(a,j,b) +if(t!=null){s=t.gh(t) +r=S.cx +q=new Array(s) +q.fixed$length=Array +q=H.a(q,[r]) +p=new F.ae(q,s,j,[r]) +r=b.c +r.push(j) +for(o=k,n=-1,m=0;m=p +l=m?null:r[o] +if((l==null?null:l.x)==null)continue +m=l.x +if(m.b0(m,new O.lR()))continue +n.a=n.b=-1 +for(k=a.db,k=new H.aJ(k,k.gh(k),[H.i(k,0)]);k.m();){j=k.d +if(j.fy==l){i=j.id +i=(i==null?null:i.ch)!=null}else i=!1 +if(i){j=j.id +h=j.ch.length +i=n.b +if(i===-1||h>>11 +return 536870911&t+((16383&t)<<15)}, +lx:function lx(){}, +dJ:function(a,b){var u=536870911&a+b +u=536870911&u+((524287&u)<<10) +return u^u>>>6}, +nU:function(a){var u=536870911&a+((67108863&a)<<3) +u^=u>>>11 +return 536870911&u+((16383&u)<<15)}},L={ +rx:function(a,b){b.toString +F.u(a,C.cs,b) +F.a3(a,"offset",b,C.bx,C.aa,1/0,-1/0,!1) +F.T(a,"rotation",b,0,1/0,-1/0,1/0,-1/0,!1) +F.a3(a,"scale",b,C.bB,C.aa,1/0,-1/0,!1) +return new L.bM(F.M(a,"texCoord",b,-1,null,-1,0,!1),F.q(a,C.da,b,null,!1),F.r(a,b))}, +bM:function bM(a,b,c){var _=this +_.r=a +_.a=b +_.b=c +_.c=!1}},K={ +ri:function(a,b){var u,t={},s=K.cq,r=new P.E($.p,[s]) +t.a=!1 +t.b=null +u=P.nz(new K.fd(t),new K.fe(t),new K.ff(t),[P.l,P.h]) +t.b=a.e5(new K.fg(t,u,new P.aN(r,[s]),b),u.gdQ()) +return r}, +rg:function(a,b){var u=K.ac +u=new K.cp(a,new P.aN(new P.E($.p,[u]),[u])) +u.e=b +return u}, +rh:function(a,b){var u,t,s,r,q,p=null +try{p=C.a2.dT(a)}catch(s){r=H.z(s) +if(r instanceof P.ak){u=r +b.ar($.dR(),H.a([u],[P.c]),!0) +return}else throw s}r=p +q=P.c +if(H.a2(r,"$if",[P.d,q],"$af"))try{t=V.nc(p,b) +return new K.ac("model/gltf+json",t,null)}catch(s){if(H.z(s) instanceof M.bF)return +else throw s}else{b.ar($.P(),H.a([p,"object"],[q]),!0) +return}}, +ac:function ac(a,b,c){this.a=a +this.b=b +this.c=c}, +cq:function cq(){}, +fe:function fe(a){this.a=a}, +ff:function ff(a){this.a=a}, +fd:function fd(a){this.a=a}, +fg:function fg(a,b,c,d){var _=this +_.a=a +_.b=b +_.c=c +_.d=d}, +cp:function cp(a,b){var _=this +_.a=a +_.b=null +_.c=b +_.e=_.d=null +_.f=!0}, +fb:function fb(a){this.a=a}, +d5:function d5(){}},F={ +a9:function(a,b,c,d){var u=a.i(0,b) +if(u==null&&a.u(b))d.j($.P(),H.a([null,c],[P.c]),b) +return u}, +F:function(a,b,c,d){var u=F.a9(a,b,"integer",c) +if(typeof u==="number"&&Math.floor(u)===u){if(u>=0)return u +c.p($.dQ(),b)}else if(u==null){if(d)c.B($.aE(),H.a([b],[P.c]))}else c.j($.P(),H.a([u,"integer"],[P.c]),b) +return-1}, +oc:function(a,b,c){var u=F.a9(a,b,"boolean",c) +if(u==null)return!1 +if(typeof u==="boolean")return u +c.j($.P(),H.a([u,"boolean"],[P.c]),b) +return!1}, +M:function(a,b,c,d,e,f,g,h){var u,t=F.a9(a,b,"integer",c) +if(typeof t==="number"&&Math.floor(t)===t){if(e!=null){if(!F.mq(b,t,e,c,!1))return-1}else{if(!(tf +else u=!0 +if(u){c.j($.lU(),H.a([t],[P.c]),b) +return-1}}return t}else if(t==null){if(!h)return d +c.B($.aE(),H.a([b],[P.c]))}else c.j($.P(),H.a([t,"integer"],[P.c]),b) +return-1}, +T:function(a,b,c,d,e,f,g,h,i){var u=F.a9(a,b,"number",c) +if(typeof u==="number"){if(ug||u>=e){c.j($.lU(),H.a([u],[P.c]),b) +return 0/0}return u}else if(u==null){if(!i)return d +c.B($.aE(),H.a([b],[P.c]))}else c.j($.P(),H.a([u,"number"],[P.c]),b) +return 0/0}, +C:function(a,b,c,d,e,f,g){var u,t=F.a9(a,b,"string",c) +if(typeof t==="string"){if(e!=null)F.mq(b,t,e,c,!1) +else{if(f==null)u=null +else{u=f.b +u=u.test(t)}if(u===!1){c.j($.pI(),H.a([t,f.a],[P.c]),b) +return}}return t}else if(t==null){if(!g)return d +c.B($.aE(),H.a([b],[P.c]))}else c.j($.P(),H.a([t,"string"],[P.c]),b) +return}, +oh:function(a,b){var u,t,s,r +try{u=P.nD(a) +s=u +if(s.gcC()||s.gby()||s.gcB()||s.gbA()||s.gbz())b.j($.qf(),H.a([a],[P.c]),"uri") +return u}catch(r){s=H.z(r) +if(s instanceof P.ak){t=s +b.j($.pH(),H.a([a,t],[P.c]),"uri") +return}else throw r}}, +mt:function(a,b,c,d){var u=F.a9(a,b,"object",c),t=P.d,s=P.c +if(H.a2(u,"$if",[t,s],"$af"))return u +else if(u==null){if(d){c.B($.aE(),H.a([b],[s])) +return}}else{c.j($.P(),H.a([u,"object"],[s]),b) +if(d)return}return P.V(t,s)}, +a4:function(a,b,c,d,e){var u,t=F.a9(a,b,"object",c),s=P.c +if(H.a2(t,"$if",[P.d,s],"$af")){s=c.c +s.push(b) +u=d.$2(t,c) +s.pop() +return u}else if(t==null){if(e)c.B($.aE(),H.a([b],[s]))}else c.j($.P(),H.a([t,"object"],[s]),b) +return}, +ms:function(a,b,c,d){var u,t,s,r,q,p=F.a9(a,b,"array",c),o=J.m(p) +if(!!o.$il){if(o.gt(p)){c.p($.aX(),b) +return}u=c.c +u.push(b) +t=P.h +s=P.at(t) +for(r=0;r=0){if(!s.A(0,q))c.V($.mP(),r)}else{o.l(p,r,-1) +c.V($.dQ(),r)}}u.pop() +return o.a7(p,t)}else if(p==null){if(d)c.B($.aE(),H.a([b],[P.c]))}else c.j($.P(),H.a([p,"array"],[P.c]),b) +return}, +u8:function(a,b,c,d){var u,t=F.a9(a,b,"object",c),s=P.d,r=P.c +if(H.a2(t,"$if",[s,r],"$af")){r=J.K(t) +if(r.gt(t)){c.p($.aX(),b) +return}u=c.c +u.push(b) +r.H(t,new F.lr(d,t,c)) +u.pop() +return r.ae(t,s,P.h)}else{s=[r] +if(t==null)c.B($.aE(),H.a([b],s)) +else c.j($.P(),H.a([t,"object"],s),b)}return}, +u9:function(a,b,c,d){var u,t,s,r,q,p,o,n=F.a9(a,b,"array",c),m=J.m(n) +if(!!m.$il){if(m.gt(n)){c.p($.aX(),b) +return}else{u=c.c +u.push(b) +for(t=P.c,s=[t],t=[P.d,t],r=!1,q=0;qf +if(p){c.j($.lU(),H.a([q],u),b) +s=!0}if(h){p=$.mX() +p[0]=q +t[r]=p[0]}else t[r]=q}else{c.j($.cW(),H.a([q,"number"],u),b) +s=!0}}if(s)return +return t}else if(o==null){if(d==null)n=null +else n=J.cr(d.slice(0),H.i(d,0)) +return n}else c.j($.P(),H.a([o,"array"],[P.c]),b) +return}, +od:function(a,b,c,d,e){var u,t,s,r,q,p,o,n,m=F.a9(a,b,"array",c),l=J.m(m) +if(!!l.$il){if(l.gh(m)!==e){c.j($.mQ(),H.a([l.gh(m),H.a([e],[P.h])],[P.c]),b) +return}u=Z.uE(d) +t=Z.ov(d) +s=F.u1(d,e) +for(r=[P.c],q=!1,p=0;pt +if(n){c.j($.pV(),H.a([o,C.am.i(0,d)],r),b) +q=!0}s[p]=J.qS(o)}else{c.j($.cW(),H.a([o,"integer"],r),b) +q=!0}}if(q)return +return s}else if(m!=null)c.j($.P(),H.a([m,"array"],[P.c]),b) +return}, +of:function(a,b,c){var u,t,s,r,q,p,o,n=F.a9(a,b,"array",c),m=J.m(n) +if(!!m.$il){if(m.gt(n)){c.p($.aX(),b) +return}u=c.c +u.push(b) +t=P.d +s=P.at(t) +for(r=[P.c],q=!1,p=0;p1)c.B($.q6(),H.a([null,h.gI()],[j])) +for(j=h.gI(),j=j.gw(j),t=d==null,s=c.f,r=c.r;j.m();){q=j.gn() +p=F.mt(h,q,c,!1) +o=c.dx +if(!o.D(o,q)){i.l(0,q,null) +o=c.cy +o=o.D(o,q) +if(!o)c.p($.pE(),q) +continue}n=c.ch.a.i(0,new D.bA(b,q)) +if(n==null){c.p($.pF(),q) +continue}if(p!=null){u.push(q) +m=n.a.$2(p,c) +i.l(0,q,m) +q=J.m(m) +if(!!q.$ing){o=t?b:d +o=s.bL(o,new F.lq()) +l=H.a(u.slice(0),[H.i(u,0)]) +l.fixed$length=Array +J.lY(o,new D.cu(m,l))}if(!!q.$icB){q=H.a(u.slice(0),[H.i(u,0)]) +q.fixed$length=Array +r.push(new D.dk(m,q))}u.pop()}}u.pop() +return i}, +r:function(a,b){var u=a.i(0,"extras"),t=u!=null&&!J.m(u).$if +if(t)b.p($.qe(),"extras") +return u}, +mq:function(a,b,c,d,e){var u +if(!J.n_(c,b)){u=e?$.mQ():$.mS() +d.j(u,H.a([b,c],[P.c]),a) +return!1}return!0}, +u:function(a,b,c){var u,t,s +for(u=a.gI(),u=u.gw(u);u.m();){t=u.gn() +if(!C.d.D(b,t)){s=C.d.D(C.cb,t) +s=!s}else s=!1 +if(s)c.p($.pJ(),t)}}, +my:function(a,b,c,d,e,f){var u,t,s,r,q,p,o=e.c +o.push(d) +for(u=[P.c],t=c.a,s=t.length,r=0;r=s?null:t[q] +if(p!=null){p.c=!0 +b[r]=p +f.$3(p,q,r)}else e.aE($.D(),H.a([q],u),r)}o.pop()}, +uh:function(b4){var u,t,s,r,q,p,o,n,m,l,k,j,i,h,g,f,e,d,c,b,a,a0,a1,a2,a3,a4,a5,a6,a7,a8,a9,b0,b1,b2,b3=b4.a +if(b3[3]!==0||b3[7]!==0||b3[11]!==0||b3[15]!==1)return!1 +if(b4.cu()===0)return!1 +u=$.qD() +t=$.qA() +s=$.qB() +r=new T.bh(new Float32Array(3)) +r.be(b3[0],b3[1],b3[2]) +q=Math.sqrt(r.gaI()) +r.be(b3[4],b3[5],b3[6]) +p=Math.sqrt(r.gaI()) +r.be(b3[8],b3[9],b3[10]) +o=Math.sqrt(r.gaI()) +if(b4.cu()<0)q=-q +u=u.a +u[0]=b3[12] +u[1]=b3[13] +u[2]=b3[14] +n=1/q +m=1/p +l=1/o +b3=new Float32Array(16) +new T.bO(b3).cX(b4) +b3[0]=b3[0]*n +b3[1]=b3[1]*n +b3[2]=b3[2]*n +b3[4]=b3[4]*m +b3[5]=b3[5]*m +b3[6]=b3[6]*m +b3[8]=b3[8]*l +b3[9]=b3[9]*l +b3[10]=b3[10]*l +k=new Float32Array(9) +k[0]=b3[0] +k[1]=b3[1] +k[2]=b3[2] +k[3]=b3[4] +k[4]=b3[5] +k[5]=b3[6] +k[6]=b3[8] +k[7]=b3[9] +k[8]=b3[10] +t.toString +b3=k[0] +j=k[4] +i=k[8] +h=0+b3+j+i +if(h>0){g=Math.sqrt(h+1) +b3=t.a +b3[3]=g*0.5 +g=0.5/g +b3[0]=(k[5]-k[7])*g +b3[1]=(k[6]-k[2])*g +b3[2]=(k[1]-k[3])*g}else{if(b3a.length)throw H.e(P.S(b,0,a.length,"start",null)) +if(ca.length)throw H.e(P.S(c,b,a.length,"end",null)) +if(b===c)return H.a([],[H.i(a,0)]) +return H.a(a.slice(b,c),[H.i(a,0)])}, +gaH:function(a){var u=a.length +if(u>0)return a[u-1] +throw H.e(H.nd())}, +D:function(a,b){var u +for(u=0;u=a.length||b<0)throw H.e(H.cV(a,b)) +return a[b]}, +l:function(a,b,c){if(!!a.immutable$list)H.O(P.W("indexed set")) +if(b>=a.length||b<0)throw H.e(H.cV(a,b)) +a[b]=c}, +$iB:1, +$it:1, +$il:1} +J.m4.prototype={} +J.bu.prototype={ +gn:function(){return this.d}, +m:function(){var u,t=this,s=t.a,r=s.length +if(t.b!==r)throw H.e(H.cc(s)) +u=t.c +if(u>=r){t.d=null +return!1}t.d=s[u] +t.c=u+1 +return!0}, +$iZ:1} +J.cs.prototype={ +cR:function(a){var u +if(a>=-2147483648&&a<=2147483647)return a|0 +if(isFinite(a)){u=a<0?Math.ceil(a):Math.floor(a) +return u+0}throw H.e(P.W(""+a+".toInt()"))}, +X:function(a,b){var u,t,s,r +if(b<2||b>36)throw H.e(P.S(b,2,36,"radix",null)) +u=a.toString(b) +if(C.a.v(u,u.length-1)!==41)return u +t=/^([\da-z]+)(?:\.([\da-z]+))?\(e\+(\d+)\)$/.exec(u) +if(t==null)H.O(P.W("Unexpected toString result: "+u)) +u=t[1] +s=+t[3] +r=t[2] +if(r!=null){u+=r +s-=r.length}return u+C.a.bd("0",s)}, +k:function(a){if(a===0&&1/a<0)return"-0.0" +else return""+a}, +gC:function(a){var u,t,s,r,q=a|0 +if(a===q)return 536870911&q +u=Math.abs(a) +t=Math.log(u)/0.6931471805599453|0 +s=Math.pow(2,t) +r=u<1?u/s:s/u +return 536870911&((r*9007199254740992|0)+(r*3542243181176521|0))*599197+t*1259}, +bc:function(a,b){var u=a%b +if(u===0)return 0 +if(u>0)return u +if(b<0)return u-b +else return u+b}, +an:function(a,b){if((a|0)===a)if(b>=1||b<-1)return a/b|0 +return this.ck(a,b)}, +cj:function(a,b){return(a|0)===a?a/b|0:this.ck(a,b)}, +ck:function(a,b){var u=a/b +if(u>=-2147483648&&u<=2147483647)return u|0 +if(u>0){if(u!==1/0)return Math.floor(u)}else if(u>-1/0)return Math.ceil(u) +throw H.e(P.W("Result of truncating division is "+H.b(u)+": "+H.b(a)+" ~/ "+b))}, +ay:function(a,b){if(b<0)throw H.e(H.al(b)) +return b>31?0:a<>>0}, +ad:function(a,b){var u +if(a>0)u=this.ci(a,b) +else{u=b>31?31:b +u=a>>u>>>0}return u}, +dJ:function(a,b){if(b<0)throw H.e(H.al(b)) +return this.ci(a,b)}, +ci:function(a,b){return b>31?0:a>>>b}, +$iw:1, +$iG:1} +J.d9.prototype={$ih:1} +J.fG.prototype={} +J.bG.prototype={ +v:function(a,b){if(b<0)throw H.e(H.cV(a,b)) +if(b>=a.length)H.O(H.cV(a,b)) +return a.charCodeAt(b)}, +G:function(a,b){if(b>=a.length)throw H.e(H.cV(a,b)) +return a.charCodeAt(b)}, +cT:function(a,b){if(typeof b!=="string")throw H.e(P.n5(b,null,null)) +return a+b}, +aw:function(a,b,c,d){var u,t +c=P.az(b,c,a.length) +u=a.substring(0,b) +t=a.substring(c) +return u+d+t}, +R:function(a,b,c){var u +if(typeof c!=="number"||Math.floor(c)!==c)H.O(H.al(c)) +if(c<0||c>a.length)throw H.e(P.S(c,0,a.length,null,null)) +u=c+b.length +if(u>a.length)return!1 +return b===a.substring(c,u)}, +S:function(a,b){return this.R(a,b,0)}, +q:function(a,b,c){if(typeof b!=="number"||Math.floor(b)!==b)H.O(H.al(b)) +if(c==null)c=a.length +if(b<0)throw H.e(P.id(b,null)) +if(b>c)throw H.e(P.id(b,null)) +if(c>a.length)throw H.e(P.id(c,null)) +return a.substring(b,c)}, +aN:function(a,b){return this.q(a,b,null)}, +eq:function(a){var u,t,s +if(typeof a.trimRight!="undefined"){u=a.trimRight() +t=u.length +if(t===0)return u +s=t-1 +if(this.v(u,s)===133)t=J.nf(u,s)}else{t=J.nf(a,a.length) +u=a}if(t===u.length)return u +if(t===0)return"" +return u.substring(0,t)}, +bd:function(a,b){var u,t +if(0>=b)return"" +if(b===1||a.length===0)return a +if(b!==b>>>0)throw H.e(C.bc) +for(u=a,t="";!0;){if((b&1)===1)t=u+t +b=b>>>1 +if(b===0)break +u+=u}return t}, +ak:function(a,b,c){var u=b-a.length +if(u<=0)return a +return this.bd(c,u)+a}, +b3:function(a,b,c){var u +if(c<0||c>a.length)throw H.e(P.S(c,0,a.length,null,null)) +u=a.indexOf(b,c) +return u}, +bC:function(a,b){return this.b3(a,b,0)}, +k:function(a){return a}, +gC:function(a){var u,t,s +for(u=a.length,t=0,s=0;s>6}t=536870911&t+((67108863&t)<<3) +t^=t>>11 +return 536870911&t+((16383&t)<<15)}, +gh:function(a){return a.length}, +$id:1} +H.kd.prototype={ +gw:function(a){return new H.e1(J.U(this.ga5()),this.$ti)}, +gh:function(a){return J.H(this.ga5())}, +gt:function(a){return J.n0(this.ga5())}, +ga2:function(a){return J.qG(this.ga5())}, +a0:function(a,b){return H.m1(J.n1(this.ga5(),b),H.i(this,0),H.i(this,1))}, +N:function(a,b){return H.aC(J.cX(this.ga5(),b),H.i(this,1))}, +D:function(a,b){return J.n_(this.ga5(),b)}, +k:function(a){return J.aa(this.ga5())}, +$at:function(a,b){return[b]}} +H.e1.prototype={ +m:function(){return this.a.m()}, +gn:function(){return H.aC(this.a.gn(),H.i(this,1))}, +$iZ:1, +$aZ:function(a,b){return[b]}} +H.cY.prototype={ +ga5:function(){return this.a}} +H.kk.prototype={$iB:1, +$aB:function(a,b){return[b]}} +H.ke.prototype={ +i:function(a,b){return H.aC(J.mY(this.a,b),H.i(this,1))}, +l:function(a,b,c){J.qE(this.a,b,H.aC(c,H.i(this,0)))}, +sh:function(a,b){J.qK(this.a,b)}, +A:function(a,b){J.lY(this.a,H.aC(b,H.i(this,0)))}, +$iB:1, +$aB:function(a,b){return[b]}, +$aJ:function(a,b){return[b]}, +$il:1, +$al:function(a,b){return[b]}} +H.cj.prototype={ +a7:function(a,b){return new H.cj(this.a,[H.i(this,0),b])}, +ga5:function(){return this.a}} +H.cZ.prototype={ +ae:function(a,b,c){return new H.cZ(this.a,[H.i(this,0),H.i(this,1),b,c])}, +u:function(a){return this.a.u(a)}, +i:function(a,b){return H.aC(this.a.i(0,b),H.i(this,3))}, +l:function(a,b,c){this.a.l(0,H.aC(b,H.i(this,0)),H.aC(c,H.i(this,1)))}, +H:function(a,b){this.a.H(0,new H.e2(this,b))}, +gI:function(){return H.m1(this.a.gI(),H.i(this,0),H.i(this,2))}, +gh:function(a){var u=this.a +return u.gh(u)}, +gt:function(a){var u=this.a +return u.gt(u)}, +$aa7:function(a,b,c,d){return[c,d]}, +$af:function(a,b,c,d){return[c,d]}} +H.e2.prototype={ +$2:function(a,b){var u=this.a +this.b.$2(H.aC(a,H.i(u,2)),H.aC(b,H.i(u,3)))}, +$S:function(){var u=this.a +return{func:1,ret:P.A,args:[H.i(u,0),H.i(u,1)]}}} +H.cl.prototype={ +gh:function(a){return this.a.length}, +i:function(a,b){return C.a.v(this.a,b)}, +$aB:function(){return[P.h]}, +$aJ:function(){return[P.h]}, +$at:function(){return[P.h]}, +$al:function(){return[P.h]}} +H.B.prototype={} +H.av.prototype={ +gw:function(a){var u=this +return new H.aJ(u,u.gh(u),[H.L(u,"av",0)])}, +gt:function(a){return this.gh(this)===0}, +D:function(a,b){var u,t=this,s=t.gh(t) +for(u=0;uu)return u +return t}, +gh:function(a){var u=J.H(this.a),t=this.b +if(t>=u)return 0 +return u-t}, +N:function(a,b){var u=this,t=u.gdK()+b +if(b<0||t>=u.gdh())throw H.e(P.d6(b,u,"index",null,null)) +return J.cX(u.a,t)}, +a0:function(a,b){var u=this +P.ay(b,"count") +return H.jx(u.a,u.b+b,u.c,H.i(u,0))}, +a4:function(a,b){var u,t,s,r=this,q=r.b,p=r.a,o=J.K(p),n=o.gh(p),m=n-q +if(m<0)m=0 +u=new Array(m) +u.fixed$length=Array +t=H.a(u,r.$ti) +for(s=0;s=q){t.d=null +return!1}t.d=r.N(s,u);++t.c +return!0}, +$iZ:1} +H.cw.prototype={ +gw:function(a){return new H.bN(J.U(this.a),this.b,this.$ti)}, +gh:function(a){return J.H(this.a)}, +gt:function(a){return J.n0(this.a)}, +N:function(a,b){return this.b.$1(J.cX(this.a,b))}, +$at:function(a,b){return[b]}} +H.d_.prototype={$iB:1, +$aB:function(a,b){return[b]}} +H.bN.prototype={ +m:function(){var u=this,t=u.b +if(t.m()){u.a=u.c.$1(t.gn()) +return!0}u.a=null +return!1}, +gn:function(){return this.a}, +$aZ:function(a,b){return[b]}} +H.aw.prototype={ +gh:function(a){return J.H(this.a)}, +N:function(a,b){return this.b.$1(J.cX(this.a,b))}, +$aB:function(a,b){return[b]}, +$aav:function(a,b){return[b]}, +$at:function(a,b){return[b]}} +H.mh.prototype={ +gw:function(a){return new H.dt(J.U(this.a),this.b,this.$ti)}, +ab:function(a,b,c){return new H.cw(this,b,[H.i(this,0),c])}} +H.dt.prototype={ +m:function(){var u,t +for(u=this.a,t=this.b;u.m();)if(t.$1(u.gn()))return!0 +return!1}, +gn:function(){return this.a.gn()}} +H.cC.prototype={ +a0:function(a,b){P.ay(b,"count") +return new H.cC(this.a,this.b+b,this.$ti)}, +gw:function(a){return new H.jl(J.U(this.a),this.b,this.$ti)}} +H.d0.prototype={ +gh:function(a){var u=J.H(this.a)-this.b +if(u>=0)return u +return 0}, +a0:function(a,b){P.ay(b,"count") +return new H.d0(this.a,this.b+b,this.$ti)}, +$iB:1} +H.jl.prototype={ +m:function(){var u,t +for(u=this.a,t=0;t>>0}, +k:function(a){var u=this.c +if(u==null)u=this.a +return"Closure '"+H.b(this.d)+"' of "+("Instance of '"+H.b(H.dg(u))+"'")}} +H.e0.prototype={ +k:function(a){return this.a}} +H.ii.prototype={ +k:function(a){return"RuntimeError: "+H.b(this.a)}} +H.dn.prototype={ +gaZ:function(){var u=this.b +return u==null?this.b=H.mz(this.a):u}, +k:function(a){return this.gaZ()}, +gC:function(a){var u=this.d +return u==null?this.d=C.a.gC(this.gaZ()):u}, +K:function(a,b){if(b==null)return!1 +return b instanceof H.dn&&this.gaZ()===b.gaZ()}, +$iah:1} +H.bH.prototype={ +gh:function(a){return this.a}, +gt:function(a){return this.a===0}, +gI:function(){return new H.b9(this,[H.i(this,0)])}, +gax:function(){var u=this,t=H.i(u,0) +return H.hE(new H.b9(u,[t]),new H.fN(u),t,H.i(u,1))}, +u:function(a){var u,t,s=this +if(typeof a==="string"){u=s.b +if(u==null)return!1 +return s.c4(u,a)}else if(typeof a==="number"&&(a&0x3ffffff)===a){t=s.c +if(t==null)return!1 +return s.c4(t,a)}else return s.e2(a)}, +e2:function(a){var u=this.d +if(u==null)return!1 +return this.bD(this.bo(u,J.ai(a)&0x3ffffff),a)>=0}, +i:function(a,b){var u,t,s,r,q=this +if(typeof b==="string"){u=q.b +if(u==null)return +t=q.aR(u,b) +s=t==null?null:t.b +return s}else if(typeof b==="number"&&(b&0x3ffffff)===b){r=q.c +if(r==null)return +t=q.aR(r,b) +s=t==null?null:t.b +return s}else return q.e3(b)}, +e3:function(a){var u,t,s=this.d +if(s==null)return +u=this.bo(s,J.ai(a)&0x3ffffff) +t=this.bD(u,a) +if(t<0)return +return u[t].b}, +l:function(a,b,c){var u,t,s,r,q,p,o=this +if(typeof b==="string"){u=o.b +o.bW(u==null?o.b=o.br():u,b,c)}else if(typeof b==="number"&&(b&0x3ffffff)===b){t=o.c +o.bW(t==null?o.c=o.br():t,b,c)}else{s=o.d +if(s==null)s=o.d=o.br() +r=J.ai(b)&0x3ffffff +q=o.bo(s,r) +if(q==null)o.bt(s,r,[o.bs(b,c)]) +else{p=o.bD(q,b) +if(p>=0)q[p].b=c +else q.push(o.bs(b,c))}}}, +bL:function(a,b){var u +if(this.u(a))return this.i(0,a) +u=b.$0() +this.l(0,a,u) +return u}, +H:function(a,b){var u=this,t=u.e,s=u.r +for(;t!=null;){b.$2(t.a,t.b) +if(s!==u.r)throw H.e(P.X(u)) +t=t.c}}, +bW:function(a,b,c){var u=this.aR(a,b) +if(u==null)this.bt(a,b,this.bs(b,c)) +else u.b=c}, +bs:function(a,b){var u=this,t=new H.hw(a,b) +if(u.e==null)u.e=u.f=t +else u.f=u.f.c=t;++u.a +u.r=u.r+1&67108863 +return t}, +bD:function(a,b){var u,t +if(a==null)return-1 +u=a.length +for(t=0;t>>0!==b||b>c)this.dt(a,b,c,d)}} +H.dc.prototype={ +gh:function(a){return a.length}, +dH:function(a,b,c,d,e){var u,t,s=a.length +this.c_(a,b,s,"start") +this.c_(a,c,s,"end") +if(b>c)throw H.e(P.S(b,0,c,null,null)) +u=c-b +if(e<0)throw H.e(P.I(e)) +t=d.length +if(t-e=4){if(n.a===8){s=o.b +s.b=n.c +s.a=!0}return}p=o.a.a +s=o.b +s.b=J.qQ(n,new P.ky(p),null) +s.a=!1}}} +P.ky.prototype={ +$1:function(a){return this.a}, +$S:22} +P.kw.prototype={ +$0:function(){var u,t,s,r,q=this +try{s=q.b +q.a.b=s.b.b.bO(s.d,q.c)}catch(r){u=H.z(r) +t=H.ao(r) +s=q.a +s.b=new P.bw(u,t) +s.a=!0}}} +P.kv.prototype={ +$0:function(){var u,t,s,r,q,p,o,n,m=this +try{u=m.a.a.c +r=m.c +if(r.e7(u)&&r.e!=null){q=m.b +q.b=r.e_(u) +q.a=!1}}catch(p){t=H.z(p) +s=H.ao(p) +r=m.a.a.c +q=r.a +o=t +n=m.b +if(q==null?o==null:q===o)n.b=r +else n.b=new P.bw(t,s) +n.a=!0}}} +P.du.prototype={} +P.jn.prototype={ +gh:function(a){var u={},t=new P.E($.p,[P.h]) +u.a=0 +this.bF(new P.js(u,this),!0,new P.jt(u,t),t.gdc()) +return t}} +P.jp.prototype={ +$1:function(a){var u=this.a +u.aP(a) +u.bj()}, +$S:function(){return{func:1,ret:P.A,args:[this.b]}}} +P.jq.prototype={ +$2:function(a,b){var u=this.a,t=u.b +if((t&1)!==0)u.aq(a,b) +else if((t&3)===0)u.aQ().A(0,new P.dx(a,b)) +u.bj()}, +$C:"$2", +$R:2, +$S:7} +P.jr.prototype={ +$0:function(){var u=this.a +return new P.kF(new J.bu(u,1,[H.i(u,0)]))}} +P.js.prototype={ +$1:function(a){++this.a.a}, +$S:function(){return{func:1,ret:P.A,args:[H.i(this.b,0)]}}} +P.jt.prototype={ +$0:function(){this.b.c0(this.a.a)}} +P.jo.prototype={} +P.dB.prototype={ +gdC:function(){if((this.b&8)===0)return this.a +return this.a.gb9()}, +aQ:function(){var u,t,s=this +if((s.b&8)===0){u=s.a +return u==null?s.a=new P.dC():u}t=s.a +t.gb9() +return t.gb9()}, +gaD:function(){if((this.b&8)!==0)return this.a.gb9() +return this.a}, +bg:function(){if((this.b&4)!==0)return new P.be("Cannot add event after closing") +return new P.be("Cannot add event while adding a stream")}, +c5:function(){var u=this.c +if(u==null)u=this.c=(this.b&2)!==0?$.dO():new P.E($.p,[null]) +return u}, +A:function(a,b){if(this.b>=4)throw H.e(this.bg()) +this.aP(b)}, +a1:function(){var u=this,t=u.b +if((t&4)!==0)return u.c5() +if(t>=4)throw H.e(u.bg()) +u.bj() +return u.c5()}, +bj:function(){var u=this.b|=4 +if((u&1)!==0)this.ap() +else if((u&3)===0)this.aQ().A(0,C.F)}, +aP:function(a){var u=this.b +if((u&1)!==0)this.ai(a) +else if((u&3)===0)this.aQ().A(0,new P.c_(a))}, +dL:function(a,b,c,d){var u,t,s,r,q=this +if((q.b&3)!==0)throw H.e(P.aM("Stream has already been listened to.")) +u=$.p +t=new P.dw(q,u,d?1:0) +t.bV(a,b,c,d) +s=q.gdC() +u=q.b|=1 +if((u&8)!==0){r=q.a +r.sb9(t) +r.al()}else q.a=t +t.cg(s) +t.bp(new P.kW(q)) +return t}, +dE:function(a){var u,t,s,r,q,p=this,o=null +if((p.b&8)!==0)o=p.a.F() +p.a=null +p.b=p.b&4294967286|2 +s=p.r +if(s!=null)if(o==null)try{o=s.$0()}catch(r){u=H.z(r) +t=H.ao(r) +q=new P.E($.p,[null]) +q.bf(u,t) +o=q}else o=o.ba(s) +s=new P.kV(p) +if(o!=null)o=o.ba(s) +else s.$0() +return o}} +P.kW.prototype={ +$0:function(){P.mp(this.a.d)}} +P.kV.prototype={ +$0:function(){var u=this.a.c +if(u!=null&&u.a===0)u.ag(null)}} +P.l_.prototype={ +ai:function(a){this.gaD().aP(a)}, +aq:function(a,b){this.gaD().d5(a,b)}, +ap:function(){this.gaD().da()}} +P.k9.prototype={ +ai:function(a){this.gaD().az(new P.c_(a))}, +ap:function(){this.gaD().az(C.F)}} +P.dv.prototype={} +P.dE.prototype={} +P.bi.prototype={ +bl:function(a,b,c,d){return this.a.dL(a,b,c,d)}, +gC:function(a){return(H.bb(this.a)^892482866)>>>0}, +K:function(a,b){if(b==null)return!1 +if(this===b)return!0 +return b instanceof P.bi&&b.a===this.a}} +P.dw.prototype={ +cb:function(){return this.x.dE(this)}, +aV:function(){var u=this.x +if((u.b&8)!==0)u.a.aK() +P.mp(u.e)}, +aW:function(){var u=this.x +if((u.b&8)!==0)u.a.al() +P.mp(u.f)}} +P.cF.prototype={ +bV:function(a,b,c,d){var u,t=this +t.a=a +u=b==null?P.tW():b +if(H.ca(u,{func:1,ret:-1,args:[P.c,P.a1]}))t.b=t.d.bN(u) +else if(H.ca(u,{func:1,ret:-1,args:[P.c]}))t.b=u +else H.O(P.I("handleError callback must take either an Object (the error), or both an Object (the error) and a StackTrace.")) +t.c=c}, +cg:function(a){var u=this +if(a==null)return +u.r=a +if(!a.gt(a)){u.e=(u.e|64)>>>0 +u.r.aM(u)}}, +cK:function(a){var u,t,s=this,r=s.e +if((r&8)!==0)return +u=(r+128|4)>>>0 +s.e=u +if(r<128&&s.r!=null){t=s.r +if(t.a===1)t.a=3}if((r&4)===0&&(u&32)===0)s.bp(s.gcc())}, +aK:function(){return this.cK(null)}, +al:function(){var u=this,t=u.e +if((t&8)!==0)return +if(t>=128){t=u.e=t-128 +if(t<128){if((t&64)!==0){t=u.r +t=!t.gt(t)}else t=!1 +if(t)u.r.aM(u) +else{t=(u.e&4294967291)>>>0 +u.e=t +if((t&32)===0)u.bp(u.gcd())}}}}, +F:function(){var u=this,t=(u.e&4294967279)>>>0 +u.e=t +if((t&8)===0)u.bh() +t=u.f +return t==null?$.dO():t}, +bh:function(){var u,t=this,s=t.e=(t.e|8)>>>0 +if((s&64)!==0){u=t.r +if(u.a===1)u.a=3}if((s&32)===0)t.r=null +t.f=t.cb()}, +aP:function(a){var u=this.e +if((u&8)!==0)return +if(u<32)this.ai(a) +else this.az(new P.c_(a))}, +d5:function(a,b){var u=this.e +if((u&8)!==0)return +if(u<32)this.aq(a,b) +else this.az(new P.dx(a,b))}, +da:function(){var u=this,t=u.e +if((t&8)!==0)return +t=(t|2)>>>0 +u.e=t +if(t<32)u.ap() +else u.az(C.F)}, +aV:function(){}, +aW:function(){}, +cb:function(){return}, +az:function(a){var u,t=this,s=t.r;(s==null?t.r=new P.dC():s).A(0,a) +u=t.e +if((u&64)===0){u=(u|64)>>>0 +t.e=u +if(u<128)t.r.aM(t)}}, +ai:function(a){var u=this,t=u.e +u.e=(t|32)>>>0 +u.d.cP(u.a,a) +u.e=(u.e&4294967263)>>>0 +u.bi((t&4)!==0)}, +aq:function(a,b){var u=this,t=u.e,s=new P.kc(u,a,b) +if((t&1)!==0){u.e=(t|16)>>>0 +u.bh() +t=u.f +if(t!=null&&t!==$.dO())t.ba(s) +else s.$0()}else{s.$0() +u.bi((t&4)!==0)}}, +ap:function(){var u,t=this,s=new P.kb(t) +t.bh() +t.e=(t.e|16)>>>0 +u=t.f +if(u!=null&&u!==$.dO())u.ba(s) +else s.$0()}, +bp:function(a){var u=this,t=u.e +u.e=(t|32)>>>0 +a.$0() +u.e=(u.e&4294967263)>>>0 +u.bi((t&4)!==0)}, +bi:function(a){var u,t,s=this +if((s.e&64)!==0){u=s.r +u=u.gt(u)}else u=!1 +if(u){u=s.e=(s.e&4294967231)>>>0 +if((u&4)!==0)if(u<128){u=s.r +u=u==null||u.gt(u)}else u=!1 +else u=!1 +if(u)s.e=(s.e&4294967291)>>>0}for(;!0;a=t){u=s.e +if((u&8)!==0)return s.r=null +t=(u&4)!==0 +if(a===t)break +s.e=(u^32)>>>0 +if(t)s.aV() +else s.aW() +s.e=(s.e&4294967263)>>>0}u=s.e +if((u&64)!==0&&u<128)s.r.aM(s)}} +P.kc.prototype={ +$0:function(){var u,t,s=this.a,r=s.e +if((r&8)!==0&&(r&16)===0)return +s.e=(r|32)>>>0 +u=s.b +r=this.b +t=s.d +if(H.ca(u,{func:1,ret:-1,args:[P.c,P.a1]}))t.ej(u,r,this.c) +else t.cP(s.b,r) +s.e=(s.e&4294967263)>>>0}} +P.kb.prototype={ +$0:function(){var u=this.a,t=u.e +if((t&16)===0)return +u.e=(t|42)>>>0 +u.d.cO(u.c) +u.e=(u.e&4294967263)>>>0}} +P.kX.prototype={ +bF:function(a,b,c,d){return this.bl(a,d,c,!0===b)}, +bE:function(a,b,c){return this.bF(a,null,b,c)}, +e5:function(a,b){return this.bF(a,null,b,null)}, +bl:function(a,b,c,d){return P.nJ(a,b,c,d)}} +P.kz.prototype={ +bl:function(a,b,c,d){var u +if(this.b)throw H.e(P.aM("Stream has already been listened to.")) +this.b=!0 +u=P.nJ(a,b,c,d) +u.cg(this.a.$0()) +return u}} +P.kF.prototype={ +gt:function(a){return this.b==null}, +cA:function(a){var u,t,s,r,q=this,p=q.b +if(p==null)throw H.e(P.aM("No events pending.")) +u=null +try{u=p.m() +if(u)a.ai(q.b.gn()) +else{q.b=null +a.ap()}}catch(r){t=H.z(r) +s=H.ao(r) +if(u==null){q.b=C.Z +a.aq(t,s)}else a.aq(t,s)}}} +P.kj.prototype={ +gau:function(){return this.a}, +sau:function(a){return this.a=a}} +P.c_.prototype={ +bJ:function(a){a.ai(this.b)}} +P.dx.prototype={ +bJ:function(a){a.aq(this.b,this.c)}} +P.ki.prototype={ +bJ:function(a){a.ap()}, +gau:function(){return}, +sau:function(a){throw H.e(P.aM("No events after a done."))}} +P.kN.prototype={ +aM:function(a){var u=this,t=u.a +if(t===1)return +if(t>=1){u.a=1 +return}P.os(new P.kO(u,a)) +u.a=1}} +P.kO.prototype={ +$0:function(){var u=this.a,t=u.a +u.a=0 +if(t===3)return +u.cA(this.b)}} +P.dC.prototype={ +gt:function(a){return this.c==null}, +A:function(a,b){var u=this,t=u.c +if(t==null)u.b=u.c=b +else{t.sau(b) +u.c=b}}, +cA:function(a){var u=this.b,t=u.gau() +this.b=t +if(t==null)this.c=null +u.bJ(a)}} +P.kY.prototype={} +P.bw.prototype={ +k:function(a){return H.b(this.a)}, +$ib3:1} +P.l6.prototype={} +P.ll.prototype={ +$0:function(){var u,t=this.a,s=t.a +t=s==null?t.a=new P.cA():s +s=this.b +if(s==null)throw H.e(t) +u=H.e(t) +u.stack=s.k(0) +throw u}} +P.kP.prototype={ +cO:function(a){var u,t,s,r=null +try{if(C.f===$.p){a.$0() +return}P.nZ(r,r,this,a)}catch(s){u=H.z(s) +t=H.ao(s) +P.c7(r,r,this,u,t)}}, +el:function(a,b){var u,t,s,r=null +try{if(C.f===$.p){a.$1(b) +return}P.o0(r,r,this,a,b)}catch(s){u=H.z(s) +t=H.ao(s) +P.c7(r,r,this,u,t)}}, +cP:function(a,b){return this.el(a,b,null)}, +ei:function(a,b,c){var u,t,s,r=null +try{if(C.f===$.p){a.$2(b,c) +return}P.o_(r,r,this,a,b,c)}catch(s){u=H.z(s) +t=H.ao(s) +P.c7(r,r,this,u,t)}}, +ej:function(a,b,c){return this.ei(a,b,c,null,null)}, +dO:function(a){return new P.kR(this,a)}, +dN:function(a){return this.dO(a,null)}, +co:function(a){return new P.kQ(this,a)}, +ef:function(a){if($.p===C.f)return a.$0() +return P.nZ(null,null,this,a)}, +cN:function(a){return this.ef(a,null)}, +ek:function(a,b){if($.p===C.f)return a.$1(b) +return P.o0(null,null,this,a,b)}, +bO:function(a,b){return this.ek(a,b,null,null)}, +eh:function(a,b,c){if($.p===C.f)return a.$2(b,c) +return P.o_(null,null,this,a,b,c)}, +eg:function(a,b,c){return this.eh(a,b,c,null,null,null)}, +ec:function(a){return a}, +bN:function(a){return this.ec(a,null,null,null)}} +P.kR.prototype={ +$0:function(){return this.a.cN(this.b)}} +P.kQ.prototype={ +$0:function(){return this.a.cO(this.b)}} +P.kB.prototype={ +gh:function(a){return this.a}, +gt:function(a){return this.a===0}, +gI:function(){return new P.kC(this,[H.i(this,0)])}, +u:function(a){var u,t +if(typeof a==="string"&&a!=="__proto__"){u=this.b +return u==null?!1:u[a]!=null}else if(typeof a==="number"&&(a&1073741823)===a){t=this.c +return t==null?!1:t[a]!=null}else return this.df(a)}, +df:function(a){var u=this.d +if(u==null)return!1 +return this.ah(this.aB(u,a),a)>=0}, +i:function(a,b){var u,t,s +if(typeof b==="string"&&b!=="__proto__"){u=this.b +t=u==null?null:P.nL(u,b) +return t}else if(typeof b==="number"&&(b&1073741823)===b){s=this.c +t=s==null?null:P.nL(s,b) +return t}else return this.dj(b)}, +dj:function(a){var u,t,s=this.d +if(s==null)return +u=this.aB(s,a) +t=this.ah(u,a) +return t<0?null:u[t+1]}, +l:function(a,b,c){var u,t,s,r,q,p=this +if(typeof b==="string"&&b!=="__proto__"){u=p.b +p.d6(u==null?p.b=P.nM():u,b,c)}else{t=p.d +if(t==null)t=p.d=P.nM() +s=H.om(b)&1073741823 +r=t[s] +if(r==null){P.mi(t,s,[b,c]);++p.a +p.e=null}else{q=p.ah(r,b) +if(q>=0)r[q+1]=c +else{r.push(b,c);++p.a +p.e=null}}}}, +H:function(a,b){var u,t,s,r=this,q=r.c3() +for(u=q.length,t=0;t=t.length){u.d=null +return!1}else{u.d=t[s] +u.c=s+1 +return!0}}, +$iZ:1} +P.c2.prototype={ +gw:function(a){var u=this,t=new P.kL(u,u.r,u.$ti) +t.c=u.e +return t}, +gh:function(a){return this.a}, +gt:function(a){return this.a===0}, +ga2:function(a){return this.a!==0}, +D:function(a,b){var u,t +if(typeof b==="string"&&b!=="__proto__"){u=this.b +if(u==null)return!1 +return u[b]!=null}else if(typeof b==="number"&&(b&1073741823)===b){t=this.c +if(t==null)return!1 +return t[b]!=null}else return this.de(b)}, +de:function(a){var u=this.d +if(u==null)return!1 +return this.ah(this.aB(u,a),a)>=0}, +A:function(a,b){var u,t,s=this +if(typeof b==="string"&&b!=="__proto__"){u=s.b +return s.bY(u==null?s.b=P.mj():u,b)}else if(typeof b==="number"&&(b&1073741823)===b){t=s.c +return s.bY(t==null?s.c=P.mj():t,b)}else return s.d4(b)}, +d4:function(a){var u,t,s=this,r=s.d +if(r==null)r=s.d=P.mj() +u=s.c2(a) +t=r[u] +if(t==null)r[u]=[s.bk(a)] +else{if(s.ah(t,a)>=0)return!1 +t.push(s.bk(a))}return!0}, +ed:function(a,b){var u=this +if(typeof b==="string"&&b!=="__proto__")return u.cf(u.b,b) +else if(typeof b==="number"&&(b&1073741823)===b)return u.cf(u.c,b) +else return u.dF(b)}, +dF:function(a){var u,t,s=this,r=s.d +if(r==null)return!1 +u=s.aB(r,a) +t=s.ah(u,a) +if(t<0)return!1 +s.cm(u.splice(t,1)[0]) +return!0}, +di:function(a,b){var u,t,s,r,q=this,p=q.e +for(;p!=null;p=t){u=p.a +t=p.b +s=q.r +r=a.$1(u) +if(s!==q.r)throw H.e(P.X(q)) +if(!1===r)q.ed(0,u)}}, +cp:function(a){var u=this +if(u.a>0){u.b=u.c=u.d=u.e=u.f=null +u.a=0 +u.bq()}}, +bY:function(a,b){if(a[b]!=null)return!1 +a[b]=this.bk(b) +return!0}, +cf:function(a,b){var u +if(a==null)return!1 +u=a[b] +if(u==null)return!1 +this.cm(u) +delete a[b] +return!0}, +bq:function(){this.r=1073741823&this.r+1}, +bk:function(a){var u,t=this,s=new P.kK(a) +if(t.e==null)t.e=t.f=s +else{u=t.f +s.c=u +t.f=u.b=s}++t.a +t.bq() +return s}, +cm:function(a){var u=this,t=a.c,s=a.b +if(t==null)u.e=s +else t.b=s +if(s==null)u.f=t +else s.c=t;--u.a +u.bq()}, +c2:function(a){return J.ai(a)&1073741823}, +aB:function(a,b){return a[this.c2(b)]}, +ah:function(a,b){var u,t +if(a==null)return-1 +u=a.length +for(t=0;tr.gh(s))throw H.e(H.ro()) +if(t=0;--q)p.l(a,b+q,r.i(s,t+q)) +else for(q=0;q=0){k=C.a.v("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",j) +if(k===m)continue +m=k}else{if(j===-1){if(q<0){i=r==null?null:r.a.length +if(i==null)i=0 +q=i+(t-s) +p=t}++o +if(m===61)continue}m=k}if(j!==-2){if(r==null)r=new P.N("") +r.a+=C.a.q(a,s,t) +r.a+=H.mb(m) +s=n +continue}}throw H.e(P.y("Invalid base64 data",a,t))}if(r!=null){i=r.a+=C.a.q(a,s,c) +h=i.length +if(q>=0)P.n6(a,p,c,q,o,h) +else{g=C.c.bc(h-1,4)+1 +if(g===1)throw H.e(P.y(e,a,c)) +for(;g<4;){i+="=" +r.a=i;++g}}i=r.a +return C.a.aw(a,b,c,i.charCodeAt(0)==0?i:i)}f=c-b +if(q>=0)P.n6(a,p,c,q,o,f) +else{g=C.c.bc(f,4) +if(g===1)throw H.e(P.y(e,a,c)) +if(g>1)a=C.a.aw(a,c,c,g===2?"==":"=")}return a}} +P.dY.prototype={} +P.dX.prototype={ +dS:function(a,b){var u,t,s,r=P.az(b,null,a.length) +if(b===r)return new Uint8Array(0) +u=new P.ka() +t=u.dU(a,b,r) +s=u.a +if(s<-1)H.O(P.y("Missing padding character",a,r)) +if(s>0)H.O(P.y("Invalid length, must be multiple of four",a,r)) +u.a=-1 +return t}} +P.ka.prototype={ +dU:function(a,b,c){var u,t=this,s=t.a +if(s<0){t.a=P.nI(a,b,c,s) +return}if(b===c)return new Uint8Array(0) +u=P.t7(a,b,c,s) +t.a=P.t9(a,b,c,u,0,t.a) +return u}} +P.e_.prototype={} +P.e3.prototype={} +P.kT.prototype={} +P.e5.prototype={} +P.eh.prototype={} +P.eS.prototype={} +P.fP.prototype={ +dT:function(a){var u=P.nY(a,this.gct().a) +return u}, +gct:function(){return C.bw}} +P.fQ.prototype={} +P.ju.prototype={} +P.jv.prototype={} +P.dD.prototype={ +a1:function(){}} +P.l5.prototype={ +a1:function(){this.a.dX() +this.b.a1()}} +P.jM.prototype={} +P.jN.prototype={ +dR:function(a){var u,t,s,r,q,p,o,n,m=P.rZ(!1,a,0,null) +if(m!=null)return m +u=P.az(0,null,J.H(a)) +t=P.o2(a,0,u) +if(t>0){s=P.mf(a,0,t) +if(t===u)return s +r=new P.N(s) +q=t +p=!1}else{q=0 +r=null +p=!0}if(r==null)r=new P.N("") +o=new P.dH(!1,r) +o.c=p +o.cs(a,q,u) +o.cw(a,u) +n=r.a +return n.charCodeAt(0)==0?n:n}} +P.dH.prototype={ +cw:function(a,b){var u +if(this.e>0){u=P.y("Unfinished UTF-8 octet sequence",a,b) +throw H.e(u)}}, +dX:function(){return this.cw(null,null)}, +cs:function(a,b,c){var u,t,s,r,q,p,o,n,m,l=this,k="Bad UTF-8 encoding 0x",j=l.d,i=l.e,h=l.f +l.f=l.e=l.d=0 +$label0$0:for(u=J.K(a),t=l.b,s=b;!0;s=n){$label1$1:if(i>0){do{if(s===c)break $label0$0 +r=u.i(a,s) +if((r&192)!==128){q=P.y(k+C.c.X(r,16),a,s) +throw H.e(q)}else{j=(j<<6|r&63)>>>0;--i;++s}}while(i>0) +if(j<=C.bz[h-1]){q=P.y("Overlong encoding of 0x"+C.c.X(j,16),a,s-h-1) +throw H.e(q)}if(j>1114111){q=P.y("Character outside valid Unicode range: 0x"+C.c.X(j,16),a,s-h-1) +throw H.e(q)}if(!l.c||j!==65279)t.a+=H.mb(j) +l.c=!1}for(q=s0){l.c=!1 +o=s+p +t.a+=P.mf(a,s,o) +if(o===c)break}else o=s +n=o+1 +r=u.i(a,o) +if(r<0){m=P.y("Negative UTF-8 code unit: -0x"+C.c.X(-r,16),a,n-1) +throw H.e(m)}else{if((r&224)===192){j=r&31 +i=1 +h=1 +continue $label0$0}if((r&240)===224){j=r&15 +i=2 +h=2 +continue $label0$0}if((r&248)===240&&r<245){j=r&7 +i=3 +h=3 +continue $label0$0}m=P.y(k+C.c.X(r,16),a,n-1) +throw H.e(m)}}break $label0$0}if(i>0){l.d=j +l.e=i +l.f=h}}} +P.i1.prototype={ +$2:function(a,b){var u,t=this.b,s=this.a +t.a+=s.a +u=t.a+=H.b(a.a) +t.a=u+": " +t.a+=P.cn(b) +s.a=", "}} +P.aT.prototype={} +P.cm.prototype={ +K:function(a,b){if(b==null)return!1 +return b instanceof P.cm&&this.a===b.a&&this.b===b.b}, +gC:function(a){var u=this.a +return(u^C.c.ad(u,30))&1073741823}, +eo:function(){var u,t +if(this.b)return this +u=this.a +if(Math.abs(u)<=864e13)t=!1 +else t=!0 +if(t)H.O(P.I("DateTime is outside valid range: "+u)) +return new P.cm(u,!0)}, +k:function(a){var u=this,t=P.na(H.df(u)),s=P.aq(H.nu(u)),r=P.aq(H.nq(u)),q=P.aq(H.nr(u)),p=P.aq(H.nt(u)),o=P.aq(H.nv(u)),n=P.nb(H.ns(u)) +if(u.b)return t+"-"+s+"-"+r+" "+q+":"+p+":"+o+"."+n+"Z" +else return t+"-"+s+"-"+r+" "+q+":"+p+":"+o+"."+n}, +en:function(){var u=this,t=H.df(u)>=-9999&&H.df(u)<=9999?P.na(H.df(u)):P.rd(H.df(u)),s=P.aq(H.nu(u)),r=P.aq(H.nq(u)),q=P.aq(H.nr(u)),p=P.aq(H.nt(u)),o=P.aq(H.nv(u)),n=P.nb(H.ns(u)) +if(u.b)return t+"-"+s+"-"+r+"T"+q+":"+p+":"+o+"."+n+"Z" +else return t+"-"+s+"-"+r+"T"+q+":"+p+":"+o+"."+n}} +P.w.prototype={} +P.b3.prototype={} +P.cA.prototype={ +k:function(a){return"Throw of null."}} +P.ab.prototype={ +gbn:function(){return"Invalid argument"+(!this.a?"(s)":"")}, +gbm:function(){return""}, +k:function(a){var u,t,s,r,q=this,p=q.c,o=p!=null?" ("+p+")":"" +p=q.d +u=p==null?"":": "+H.b(p) +t=q.gbn()+o+u +if(!q.a)return t +s=q.gbm() +r=P.cn(q.b) +return t+s+": "+r}} +P.bU.prototype={ +gbn:function(){return"RangeError"}, +gbm:function(){var u,t,s=this.e +if(s==null){s=this.f +u=s!=null?": Not less than or equal to "+H.b(s):""}else{t=this.f +if(t==null)u=": Not greater than or equal to "+H.b(s) +else if(t>s)u=": Not in range "+H.b(s)+".."+H.b(t)+", inclusive" +else u=tf.length +else i=!1 +if(i)g=null +if(g==null){u=f.length>78?C.a.q(f,0,75)+"...":f +return h+"\n"+u}for(t=1,s=0,r=!1,q=0;q1?h+(" (at line "+t+", character "+(g-s+1)+")\n"):h+(" (at character "+(g+1)+")\n") +o=f.length +for(q=g;q78)if(g-s<75){n=s+75 +m=s +l="" +k="..."}else{if(o-g<75){m=o-75 +n=o +k=""}else{m=g-36 +n=g+36 +k="..."}l="..."}else{n=o +m=s +l="" +k=""}j=C.a.q(f,m,n) +return h+l+j+k+"\n"+C.a.bd(" ",g-m+l.length)+"^\n"}else return g!=null?h+(" (at offset "+H.b(g)+")"):h}, +$iar:1} +P.bB.prototype={} +P.h.prototype={} +P.t.prototype={ +a7:function(a,b){return H.m1(this,H.L(this,"t",0),b)}, +ab:function(a,b,c){return H.hE(this,b,H.L(this,"t",0),c)}, +D:function(a,b){var u +for(u=this.gw(this);u.m();)if(J.a5(u.gn(),b))return!0 +return!1}, +a4:function(a,b){return P.ni(this,!1,H.L(this,"t",0))}, +gh:function(a){var u,t=this.gw(this) +for(u=0;t.m();)++u +return u}, +gt:function(a){return!this.gw(this).m()}, +ga2:function(a){return!this.gt(this)}, +a0:function(a,b){return H.ny(this,b,H.L(this,"t",0))}, +N:function(a,b){var u,t,s +P.ay(b,"index") +for(u=this.gw(this),t=0;u.m();){s=u.gn() +if(b===t)return s;++t}throw H.e(P.d6(b,this,"index",null,t))}, +k:function(a){return P.rn(this,"(",")")}} +P.kA.prototype={ +N:function(a,b){var u=this.a +if(0>b||b>=u)H.O(P.d6(b,this,"index",null,u)) +return this.b.$1(b)}, +gh:function(a){return this.a}} +P.Z.prototype={} +P.l.prototype={$iB:1,$it:1} +P.f.prototype={} +P.cv.prototype={ +k:function(a){return"MapEntry("+H.b(this.a)+": "+H.b(this.b)+")"}} +P.A.prototype={ +gC:function(a){return P.c.prototype.gC.call(this,this)}, +k:function(a){return"null"}} +P.G.prototype={} +P.c.prototype={constructor:P.c,$ic:1, +K:function(a,b){return this===b}, +gC:function(a){return H.bb(this)}, +k:function(a){return"Instance of '"+H.b(H.dg(this))+"'"}, +b6:function(a,b){throw H.e(P.nn(this,b.gcH(),b.gcL(),b.gcI()))}, +toString:function(){return this.k(this)}} +P.dl.prototype={} +P.a1.prototype={} +P.d.prototype={} +P.N.prototype={ +gh:function(a){return this.a.length}, +k:function(a){var u=this.a +return u.charCodeAt(0)==0?u:u}} +P.me.prototype={} +P.bV.prototype={} +P.ah.prototype={} +P.bY.prototype={} +P.jJ.prototype={ +$2:function(a,b){throw H.e(P.y("Illegal IPv4 address, "+a,this.a,b))}} +P.jK.prototype={ +$2:function(a,b){throw H.e(P.y("Illegal IPv6 address, "+a,this.a,b))}, +$1:function(a){return this.$2(a,null)}} +P.jL.prototype={ +$2:function(a,b){var u +if(b-a>4)this.a.$2("an IPv6 part can only contain a maximum of 4 hex digits",a) +u=P.aV(C.a.q(this.b,a,b),null,16) +if(u<0||u>65535)this.a.$2("each part must be in the range of `0x0..0xFFFF`",a) +return u}} +P.dG.prototype={ +gcS:function(){return this.b}, +gbB:function(){var u=this.c +if(u==null)return"" +if(C.a.S(u,"["))return C.a.q(u,1,u.length-1) +return u}, +gbK:function(){var u=this.d +if(u==null)return P.nN(this.a) +return u}, +gcM:function(){var u=this.f +return u==null?"":u}, +gcz:function(){var u=this.r +return u==null?"":u}, +gcC:function(){return this.a.length!==0}, +gby:function(){return this.c!=null}, +gbA:function(){return this.f!=null}, +gbz:function(){return this.r!=null}, +gcB:function(){return C.a.S(this.e,"/")}, +k:function(a){var u,t,s,r=this,q=r.y +if(q==null){q=r.a +u=q.length!==0?q+":":"" +t=r.c +s=t==null +if(!s||q==="file"){q=u+"//" +u=r.b +if(u.length!==0)q=q+H.b(u)+"@" +if(!s)q+=t +u=r.d +if(u!=null)q=q+":"+H.b(u)}else q=u +q+=r.e +u=r.f +if(u!=null)q=q+"?"+u +u=r.r +if(u!=null)q=q+"#"+u +q=r.y=q.charCodeAt(0)==0?q:q}return q}, +K:function(a,b){var u,t,s=this +if(b==null)return!1 +if(s===b)return!0 +if(!!J.m(b).$ibY)if(s.a===b.gbU())if(s.c!=null===b.gby())if(s.b==b.gcS())if(s.gbB()==b.gbB())if(s.gbK()==b.gbK())if(s.e===b.gcJ()){u=s.f +t=u==null +if(!t===b.gbA()){if(t)u="" +if(u===b.gcM()){u=s.r +t=u==null +if(!t===b.gbz()){if(t)u="" +u=u===b.gcz()}else u=!1}else u=!1}else u=!1}else u=!1 +else u=!1 +else u=!1 +else u=!1 +else u=!1 +else u=!1 +else u=!1 +return u}, +gC:function(a){var u=this.z +return u==null?this.z=C.a.gC(this.k(0)):u}, +$ibY:1, +gbU:function(){return this.a}, +gcJ:function(){return this.e}} +P.l4.prototype={ +$1:function(a){throw H.e(P.y("Invalid port",this.a,this.b+1))}} +P.jH.prototype={ +gb8:function(a){var u,t,s,r,q=this,p=null,o=q.c +if(o!=null)return o +o=q.a +u=q.b[0]+1 +t=C.a.b3(o,"?",u) +s=o.length +if(t>=0){r=P.cN(o,t+1,s,C.x,!1) +s=t}else r=p +return q.c=new P.kh("data",p,p,p,P.cN(o,u,s,C.ak,!1),r,p)}, +gat:function(){var u=this.b,t=u[0]+1,s=u[1] +if(t===s)return"text/plain" +return P.tq(this.a,t,s,C.a4,!1)}, +cr:function(){var u,t,s,r,q,p,o,n,m=this.a,l=this.b,k=C.d.gaH(l)+1 +if((l.length&1)===1)return C.b4.dS(m,k) +l=m.length +u=l-k +for(t=k;t=0){p=r+1 +s[r]=n +t=o +r=p +continue}}throw H.e(P.y("Invalid percent escape",m,t))}r=p}return s}, +k:function(a){var u=this.a +return this.b[0]===-1?"data:"+u:u}} +P.lc.prototype={ +$1:function(a){return new Uint8Array(96)}, +$S:19} +P.lb.prototype={ +$2:function(a,b){var u=this.a[a] +J.qF(u,0,96,b) +return u}, +$S:18} +P.ld.prototype={ +$3:function(a,b,c){var u,t +for(u=b.length,t=0;t>>0]=c}} +P.kU.prototype={ +gcC:function(){return this.b>0}, +gby:function(){return this.c>0}, +gbA:function(){return this.ft?C.a.q(this.a,t,u-1):""}, +gbB:function(){var u=this.c +return u>0?C.a.q(this.a,u,this.d):""}, +gbK:function(){var u=this +if(u.c>0&&u.d+1u)b.j($.pO(),H.a([n,u],[P.c]),"count") +u=o.f +t=u.d +u.f=p.i(0,t) +m.push("indices") +s=o.e +o=s.d +if(o!==-1){p=s.r=p.i(0,o) +if(p==null)b.j($.D(),H.a([o],[P.c]),q) +else{p.O(C.v,q,b) +if(s.r.Q!==-1)b.p($.lV(),q) +p=s.f +if(p!==-1)M.aG(s.e,Z.am(p),Z.am(p)*n,s.r,o,b)}}m.pop() +m.push("values") +if(t!==-1){p=u.f +if(p==null)b.j($.D(),H.a([t],[P.c]),q) +else{p.O(C.v,q,b) +if(u.f.Q!==-1)b.p($.lV(),q) +p=r.dy +o=C.k.i(0,r.ch) +if(o==null)o=0 +M.aG(u.e,p,p*o*n,u.f,t,b)}}m.pop() +m.pop()}}, +O:function(a,b,c){var u +this.c=!0 +u=this.k2 +if(u==null)this.k2=a +else if(u!==a)c.j($.pd(),H.a([u,a],[P.c]),b)}, +es:function(a){var u=this.k1 +if(u==null)this.k1=a +else if(u!==a)return!1 +return!0}, +ea:function(a){var u,t,s=this +if(!s.cx||5126===s.z){a.toString +return a}u=s.dy*8 +t=s.z +if(t===5120||t===5122||t===5124)return Math.max(a/(C.c.ay(1,u-1)-1),-1) +else return a/(C.c.ay(1,u)-1)}} +M.jY.prototype={ +ac:function(){return this.cW()}, +cW:function(){var u=this +return P.aS(function(){var t=0,s=2,r,q,p,o,n,m,l,k,j,i,h,g,f,e,d,c,b +return function $async$ac(a,a0){if(a===1){r=a0 +t=s}while(true)switch(t){case 0:b=u.z +if(b===-1||u.Q===-1||u.ch==null){t=1 +break}q=u.ga8() +p=u.Q +o=u.fr +if(o!=null){o=o.cx +if((o==null?null:o.Q)==null){t=1 +break}if(u.gaj()p){t=1 +break}p=o.e +o=p.e +g=p.f +if(M.aG(o,Z.am(g),Z.am(g)*h,p.r,null,null)){f=u.dy +e=C.k.i(0,u.ch) +if(e==null)e=0 +e=!M.aG(m,f,f*e*h,n.f,null,null) +f=e}else f=!0 +if(f){t=1 +break}p=p.r +d=M.lZ(g,p.cx.Q.buffer,p.y+o,h) +n=n.f +c=M.n4(b,n.cx.Q.buffer,n.y+m,h*q) +if(d==null||c==null){t=1 +break}i=new M.k3(u,d,i,q,c).$0()}t=3 +return P.kG(i) +case 3:case 1:return P.aO() +case 2:return P.aP(r)}}},P.h)}, +bb:function(){var u=this +return P.aS(function(){var t=0,s=1,r,q,p,o,n +return function $async$bb(a,b){if(a===1){r=b +t=s}while(true)switch(t){case 0:o=u.dy*8 +n=u.z +n=n===5120||n===5122||n===5124 +q=P.w +t=n?2:4 +break +case 2:n=C.c.ay(1,o-1) +p=u.ac() +p.toString +t=5 +return P.kG(H.hE(p,new M.jZ(1/(n-1)),H.L(p,"t",0),q)) +case 5:t=3 +break +case 4:n=C.c.ay(1,o) +p=u.ac() +p.toString +t=6 +return P.kG(H.hE(p,new M.k_(1/(n-1)),H.L(p,"t",0),q)) +case 6:case 3:return P.aO() +case 1:return P.aP(r)}}},P.w)}, +$aQ:function(){return[P.h]}} +M.k0.prototype={ +$0:function(){var u=this +return P.aS(function(){var t=0,s=1,r,q,p,o,n,m,l,k,j +return function $async$$0(a,b){if(a===1){r=b +t=s}while(true)switch(t){case 0:q=u.a,p=u.c,o=u.b,n=u.d,m=u.e,l=0,k=0,j=0 +case 2:if(!(lp){t=1 +break}p=o.e +o=p.e +g=p.f +if(M.aG(o,Z.am(g),Z.am(g)*h,p.r,null,null)){f=u.dy +e=C.k.i(0,u.ch) +if(e==null)e=0 +e=!M.aG(m,f,f*e*h,n.f,null,null) +f=e}else f=!0 +if(f){t=1 +break}p=p.r +d=M.lZ(g,p.cx.Q.buffer,p.y+o,h) +n=n.f +c=M.n3(b,n.cx.Q.buffer,n.y+m,h*q) +if(d==null||c==null){t=1 +break}i=new M.jX(u,d,i,q,c).$0()}t=3 +return P.kG(i) +case 3:case 1:return P.aO() +case 2:return P.aP(r)}}},P.w)}, +bb:function(){return this.ac()}, +$aQ:function(){return[P.w]}} +M.jU.prototype={ +$0:function(){var u=this +return P.aS(function(){var t=0,s=1,r,q,p,o,n,m,l,k,j +return function $async$$0(a,b){if(a===1){r=b +t=s}while(true)switch(t){case 0:q=u.a,p=u.c,o=u.b,n=u.d,m=u.e,l=0,k=0,j=0 +case 2:if(!(ld)t.b[c]=d +if(d0){n=$.mD() +m=q+"/min/"+o +a.j(n,H.a([r[o],s[o]],p),m)}}return!0}, +$aY:function(){return[P.w]}} +M.hG.prototype={ +W:function(a,b,c,d){var u,t=this +if(b===c||t.b[c]t.c[c]){u=t.a +u[c]=u[c]+1}return!0}, +as:function(a){var u,t,s,r,q,p,o,n,m,l=this +for(u=l.b,t=u.length,s=l.c,r=l.a,q=l.d,p=[P.c],o=0;o0){n=$.mC() +m=q+"/max/"+o +a.j(n,H.a([r[o],s[o]],p),m)}}return!0}, +$aY:function(){return[P.w]}} +M.hT.prototype={ +W:function(a,b,c,d){var u,t=this +if(b===c||t.b[c]>d)t.b[c]=d +if(d0){n=$.mD() +m=q+"/min/"+o +a.j(n,H.a([r[o],s[o]],p),m)}}return!0}, +$aY:function(){return[P.h]}} +M.hH.prototype={ +W:function(a,b,c,d){var u,t=this +if(b===c||t.b[c]t.c[c]){u=t.a +u[c]=u[c]+1}return!0}, +as:function(a){var u,t,s,r,q,p,o,n,m,l=this +for(u=l.b,t=u.length,s=l.c,r=l.a,q=l.d,p=[P.c],o=0;o0){n=$.mC() +m=q+"/max/"+o +a.j(n,H.a([r[o],s[o]],p),m)}}return!0}, +$aY:function(){return[P.h]}} +Z.aZ.prototype={ +E:function(a,b){var u,t,s,r,q,p=this,o="samplers",n=p.y +if(n==null||p.x==null)return +u=b.c +u.push(o) +n.aa(new Z.dU(b,a)) +u.pop() +u.push("channels") +p.x.aa(new Z.dV(p,b,a)) +u.pop() +u.push(o) +for(t=n.b,n=n.a,s=n.length,r=0;r=s +if(!(q?null:n[r]).c)b.V($.dP(),r)}u.pop()}} +Z.dU.prototype={ +$2:function(a,b){var u,t,s,r,q="input",p="output",o=this.a,n=o.c +n.push(C.c.k(a)) +u=this.b.f +t=b.d +b.r=u.i(0,t) +s=b.f +b.x=u.i(0,s) +if(t!==-1){u=b.r +if(u==null)o.j($.D(),H.a([t],[P.c]),q) +else{u.O(C.aY,q,o) +u=b.r.fr +if(u!=null)u.O(C.v,q,o) +n.push(q) +u=b.r +r=new V.k(u.ch,u.z,u.cx) +if(!r.K(0,C.A))o.B($.ph(),H.a([r,H.a([C.A],[V.k])],[P.c])) +else o.U(b.r,new Z.dT(o.M())) +u=b.r +if(u.db==null||u.cy==null)o.P($.pj()) +if(b.e==="CUBICSPLINE"&&b.r.Q<2)o.B($.pi(),H.a(["CUBICSPLINE",2,b.r.Q],[P.c])) +n.pop()}}if(s!==-1){u=b.x +if(u==null)o.j($.D(),H.a([s],[P.c]),p) +else{u.O(C.aZ,p,o) +u=b.x.fr +if(u!=null)u.O(C.v,p,o) +b.x.es("CUBICSPLINE"===b.e)}}n.pop()}} +Z.dV.prototype={ +$2:function(a,b){var u,t,s,r,q,p,o,n,m,l,k,j,i,h=null,g="sampler",f=this.b,e=f.c +e.push(C.c.k(a)) +u=this.a +t=b.d +b.f=u.y.i(0,t) +s=b.e +r=s!=null +if(r){q=s.d +s.f=this.c.db.i(0,q) +if(q!==-1){e.push("target") +p=s.f +if(p==null)f.j($.D(),H.a([q],[P.c]),"node") +else{p.c=!0 +switch(s.e){case"translation":case"rotation":case"scale":if(p.Q!=null)f.P($.pe()) +if(s.f.id!=null)f.p($.pP(),"path") +break +case"weights":q=p.fy +q=q==null?h:q.x +q=q==null?h:q.gcv(q) +if((q==null?h:q.fx)==null)f.P($.pf()) +break}}e.pop()}}if(t!==-1){q=b.f +if(q==null)f.j($.D(),H.a([t],[P.c]),g) +else{q.c=!0 +if(r&&q.x!=null){t=s.e +if(t==="rotation"){o=q.x +if(o.ga8()===4){e.push(g) +q=f.M() +p=5126===o.z?h:o.gbI() +f.U(o,new Z.ic("CUBICSPLINE"===b.f.e,p,q,[P.G])) +e.pop()}q=b.f +q.x.toString}q=q.x +n=new V.k(q.ch,q.z,q.cx) +m=C.cH.i(0,t) +if((m==null?h:C.d.D(m,n))===!1)f.j($.pl(),H.a([n,m,t],[P.c]),g) +q=b.f +p=q.r +if(p!=null&&p.Q!==-1&&q.x.Q!==-1&&q.e!=null){l=p.Q +if(q.e==="CUBICSPLINE")l*=3 +if(t==="weights"){t=s.f +t=t==null?h:t.fy +t=t==null?h:t.x +t=t==null?h:t.gcv(t) +t=t==null?h:t.fx +k=t==null?h:t.length +l*=k==null?0:k}if(l!==0&&l!==b.f.x.Q)f.j($.pk(),H.a([l,b.f.x.Q],[P.c]),g)}}}for(j=a+1,u=u.x,t=u.b,q=[P.c];j=u.a.length +i=(p?h:u.a[j]).e +p=i!=null&&s.d===i.d&&s.e==i.e}else p=!1 +if(p)f.j($.pg(),H.a([j],q),"target")}e.pop()}}} +Z.cf.prototype={} +Z.bt.prototype={} +Z.cg.prototype={} +Z.dT.prototype={ +W:function(a,b,c,d){var u=this +if(d<0)a.j($.ox(),H.a([b,d],[P.c]),u.b) +else{if(b!==0&&d<=u.a)a.j($.oy(),H.a([b,d,u.a],[P.c]),u.b) +u.a=d}return!0}, +$aY:function(){return[P.w]}} +Z.ic.prototype={ +W:function(a,b,c,d){var u,t,s=this +if(!s.a||4===(4&s.d)){u=s.b +t=u!=null?u.$1(d):d +u=s.e+t*t +s.e=u +if(3===c){if(Math.abs(Math.sqrt(u)-1)>0.00769)a.j($.oz(),H.a([b-3,b,Math.sqrt(s.e)],[P.c]),s.c) +s.e=0}}if(++s.d===12)s.d=0 +return!0}} +T.bv.prototype={ +gb4:function(){var u,t=this.f +if(t!=null){u=$.aD().b +u=!u.test(t)}else u=!0 +if(u)return 0 +return P.aV($.aD().aG(t).b[1],null,null)}, +gbH:function(){var u,t=this.f +if(t!=null){u=$.aD().b +u=!u.test(t)}else u=!0 +if(u)return 0 +return P.aV($.aD().aG(t).b[2],null,null)}, +gcG:function(){var u,t=this.r +if(t!=null){u=$.aD().b +u=!u.test(t)}else u=!0 +if(u)return 2 +return P.aV($.aD().aG(t).b[1],null,null)}, +ge8:function(){var u,t=this.r +if(t!=null){u=$.aD().b +u=!u.test(t)}else u=!0 +if(u)return 0 +return P.aV($.aD().aG(t).b[2],null,null)}} +Q.b_.prototype={} +V.aH.prototype={ +O:function(a,b,c){var u +this.c=!0 +u=this.cy +if(u==null)this.cy=a +else if(u!==a)c.j($.pn(),H.a([u,a],[P.c]),b)}, +E:function(a,b){var u,t=this,s=t.x,r=t.cx=a.y.i(0,s) +t.db=t.Q +u=t.ch +if(u===34962)t.cy=C.Y +else if(u===34963)t.cy=C.X +if(s!==-1)if(r==null)b.j($.D(),H.a([s],[P.c]),"buffer") +else{r.c=!0 +r=r.y +if(r!==-1){u=t.y +if(u>=r)b.j($.mK(),H.a([s,r],[P.c]),"byteOffset") +else if(u+t.z>r)b.j($.mK(),H.a([s,r],[P.c]),"byteLength")}}}} +G.b1.prototype={} +G.bx.prototype={} +G.by.prototype={} +V.d4.prototype={ +ev:function(a){var u,t,s,r,q +new V.fq(this,a).$1(this.fy) +u=a.r +for(t=u.length,s=a.c,r=0;r2?u-2:0 +default:return 0}}, +E:function(a,b){var u,t,s,r,q,p,o,n,m,l,k,j=this,i="attributes",h="indices",g=j.d +if(g!=null){u=b.c +u.push(i) +g.H(0,new S.hM(j,a,b)) +u.pop()}g=j.e +if(g!==-1){u=j.fy=a.f.i(0,g) +if(u==null)b.j($.D(),H.a([g],[P.c]),h) +else{j.dy=u.Q +u.O(C.b0,h,b) +g=j.fy.fr +if(g!=null)g.O(C.X,h,b) +g=b.c +g.push(h) +u=j.fy.fr +if(u!=null&&u.Q!==-1)b.P($.ps()) +u=j.fy +t=new V.k(u.ch,u.z,u.cx) +if(!C.d.D(C.ae,t))b.B($.pr(),H.a([t,C.ae],[P.c])) +else{u=j.fr +s=u!==-1?u-1:-1 +u=j.r +r=u!==-1?C.c.ay(1,u):-1 +if(r!==0&&s>=-1){u=j.fy +q=b.M() +p=C.c.cj(j.dy,3) +o=j.fy.z +n=new Uint32Array(3) +b.U(u,new S.fy(s,p,Z.ov(o),16===(16&r),n,q))}}g.pop()}}g=j.dy +if(g!==-1){u=j.r +if(!(u===1&&g%2!==0))if(!((u===2||u===3)&&g<2))if(!(u===4&&g%3!==0))g=(u===5||u===6)&&g<3 +else g=!0 +else g=!0 +else g=!0}else g=!1 +if(g)b.B($.pq(),H.a([j.dy,C.bY[j.r]],[P.c])) +g=j.f +j.go=a.cx.i(0,g) +m=P.nj(j.db,new S.hN(),!1,P.h) +if(g!==-1){u=j.go +if(u==null)b.j($.D(),H.a([g],[P.c]),"material") +else{u.c=!0 +u.dx.H(0,new S.hO(j,b,m))}}for(g=C.d.gw(m),u=new H.dt(g,new S.hP(),[H.i(m,0)]),q=b.c;u.m();){p=g.gn() +q.push(i) +b.p($.dP(),"TEXCOORD_"+H.b(p)) +q.pop()}g=j.x +if(g!=null){u=b.c +u.push("targets") +q=new Array(g.length) +q.fixed$length=Array +j.fx=H.a(q,[[P.f,P.d,[M.Q,P.G]]]) +for(q=P.d,p=[M.Q,P.G],l=0;l1)c.p($.pp(),b)}}} +S.hI.prototype={ +$1:function(a){var u,t,s,r,q,p,o,n,m,l,k,j,i,h,g,f=this +if(a.length!==0&&J.lX(a,0)===95)return +switch(a){case"POSITION":f.a.c=!0 +break +case"NORMAL":f.a.b=!0 +break +case"TANGENT":f.a.a=!0 +break +default:u=H.a(a.split("_"),[P.d]) +t=u[0] +if(!C.d.D(C.bO,t)||u.length!==2){f.b.p($.lW(),a) +break}s=u[1] +s.toString +r=new H.cl(s) +if(r.gh(r)===0){q=0 +p=!1}else{o=s.length +if(o===1){q=J.lX(s,0)-48 +p=!(q<0||q>9)||!1}else{n=J.lu(s) +q=0 +m=0 +while(!0){if(!(m=0)k=m===0&&l===0 +else k=!0 +else k=!0 +if(k){p=!1 +break}q=10*q+l;++m}}}if(p)switch(t){case"COLOR":s=f.a;++s.d +j=s.e +s.e=q>j?q:j +break +case"JOINTS":s=f.a;++s.f +i=s.r +s.r=q>i?q:i +break +case"TEXCOORD":s=f.a;++s.z +h=s.Q +s.Q=q>h?q:h +break +case"WEIGHTS":s=f.a;++s.x +g=s.y +s.y=q>g?q:g +break}else f.b.p($.lW(),a)}}} +S.hJ.prototype={ +$3:function(a,b,c){var u=a+1 +if(u!==b){this.a.B($.pZ(),H.a([c,u,b],[P.c])) +return 0}return b}} +S.hK.prototype={ +$1:function(a){var u=this.a +if(!u.k3.u(a)&&!J.qP(a,"_"))u.p($.lW(),a)}} +S.hM.prototype={ +$2:function(a,b){var u,t,s,r,q,p,o,n,m=this +if(b===-1)return +u=m.b.f.i(0,b) +if(u==null){m.c.j($.D(),H.a([b],[P.c]),a) +return}t=m.a +t.dx.l(0,a,u) +s=m.c +u.O(C.W,a,s) +r=u.fr +if(r!=null)r.O(C.Y,a,s) +if(a==="POSITION")r=u.db==null||u.cy==null +else r=!1 +if(r)s.p($.mN(),"POSITION") +r=u.ch +q=u.z +p=new V.k(r,q,u.cx) +o=s.k2.i(0,H.a(a.split("_"),[P.d])[0]) +if(o!=null)if(!o.D(0,p))s.j($.mM(),H.a([p,o],[P.c]),a) +else if(a==="NORMAL"){r=s.c +r.push("NORMAL") +n=s.M() +s.U(u,new F.jC(n,5126===q?null:u.gbI())) +r.pop()}else if(a==="TANGENT"){r=s.c +r.push("TANGENT") +n=s.M() +s.U(u,new F.jD(n,5126===q?null:u.gbI())) +r.pop()}else if(C.a.S(a,"COLOR_")&&5126===q){r=s.c +r.push(a) +s.U(u,new F.e4(s.M())) +r.pop()}r=u.y +if(!(r!==-1&&r%4!==0))if(u.ga9()%4!==0){r=u.fr +r=r!=null&&r.Q===-1}else r=!1 +else r=!0 +if(r)s.p($.mL(),a) +r=t.fr +if(r===-1)t.dy=t.fr=u.Q +else if(r!==u.Q)s.p($.pw(),a) +r=u.fr +if(r!=null&&r.Q===-1){if(r.db===-1)r.db=u.ga9() +t.bZ(u,a,s)}}} +S.hN.prototype={ +$1:function(a){return a}, +$S:14} +S.hO.prototype={ +$2:function(a,b){if(b!==-1)if(b+1>this.a.db)this.b.j($.pv(),H.a([a,b],[P.c]),"material") +else this.c[b]=-1}} +S.hP.prototype={ +$1:function(a){return a!==-1}, +$S:3} +S.hQ.prototype={ +$2:function(a,b){var u,t,s,r,q,p,o,n=this +if(b===-1)return +u=n.b.f.i(0,b) +if(u==null)n.c.j($.D(),H.a([b],[P.c]),a) +else{t=n.c +u.O(C.W,a,t) +s=n.a +r=s.dx.i(0,a) +if(r==null)t.p($.pu(),a) +else if(r.Q!==u.Q)t.p($.pt(),a) +if(a==="POSITION")q=u.db==null||u.cy==null +else q=!1 +if(q)t.p($.mN(),"POSITION") +p=new V.k(u.ch,u.z,u.cx) +o=t.k3.i(0,a) +if(o!=null&&!o.D(0,p))t.j($.mM(),H.a([p,o],[P.c]),a) +q=u.y +if(!(q!==-1&&q%4!==0))if(u.ga9()%4!==0){q=u.fr +q=q!=null&&q.Q===-1}else q=!1 +else q=!0 +if(q)t.p($.mL(),a) +q=u.fr +if(q!=null&&q.Q===-1){if(q.db===-1)q.db=u.ga9() +s.bZ(u,a,t)}}n.a.fx[n.d].l(0,a,u)}} +S.hL.prototype={ +$0:function(){return P.at([M.Q,P.G])}} +S.fy.prototype={ +W:function(a,b,c,d){var u,t,s=this,r=s.a +if(d>r)a.j($.oA(),H.a([b,d,r],[P.c]),s.cy) +if(d===s.c)a.j($.oB(),H.a([d,b],[P.c]),s.cy) +if(s.x){r=s.cx +u=s.Q +r[u]=d;++u +s.Q=u +if(u===3){s.Q=0 +u=r[0] +t=r[1] +if(u!==t){r=r[2] +r=t===r||r===u}else r=!0 +if(r)++s.ch}}return!0}, +as:function(a){var u=this.ch +if(u>0)a.j($.oC(),H.a([u,this.b],[P.c]),this.cy) +return!0}, +$aY:function(){return[P.h]}} +V.ad.prototype={ +E:function(a,b){var u,t,s,r=this,q=r.x +r.fr=a.Q.i(0,q) +u=r.z +r.id=a.fx.i(0,u) +t=r.ch +r.fy=a.cy.i(0,t) +if(q!==-1){s=r.fr +if(s==null)b.j($.D(),H.a([q],[P.c]),"camera") +else s.c=!0}if(u!==-1){q=r.id +if(q==null)b.j($.D(),H.a([u],[P.c]),"skin") +else q.c=!0}if(t!==-1){q=r.fy +if(q==null)b.j($.D(),H.a([t],[P.c]),"mesh") +else{q.c=!0 +q=q.x +if(q!=null){u=r.dx +if(u!=null){q=q.i(0,0).fx +q=q==null?null:q.length +q=q!==u.length}else q=!1 +if(q){q=$.pB() +u=u.length +t=r.fy.x.i(0,0).fx +b.j(q,H.a([u,t==null?null:t.length],[P.c]),"weights")}if(r.id!=null){q=r.fy.x +if(q.b0(q,new V.i3()))b.P($.pz())}else{q=r.fy.x +if(q.bv(q,new V.i4()))b.P($.pA())}}}}q=r.y +if(q!=null){u=new Array(q.gh(q)) +u.fixed$length=Array +u=H.a(u,[V.ad]) +r.fx=u +F.my(q,u,a.db,"children",b,new V.i5(r,b))}}, +cn:function(a){var u,t,s,r +this.dy.A(0,a) +u=this.fx +if(u!=null)for(t=u.length,s=0;s0&&r.fy.length===u){r.z=!0 +throw H.e(C.b5)}q=q.c +t=q!=null?q.i(0,p):null +if(f!=null)r.fy.push(new E.bE(a,t,null,f,b)) +else{s=c!=null?C.c.k(c):d +q=e?"":r.bT(s) +r.fy.push(new E.bE(a,t,q,null,b))}}, +p:function(a,b){return this.a6(a,null,null,b,!1,null)}, +B:function(a,b){return this.a6(a,b,null,null,!1,null)}, +j:function(a,b,c){return this.a6(a,b,null,c,!1,null)}, +P:function(a){return this.a6(a,null,null,null,!1,null)}, +ar:function(a,b,c){return this.a6(a,b,null,null,c,null)}, +V:function(a,b){return this.a6(a,null,b,null,!1,null)}, +aE:function(a,b,c){return this.a6(a,b,c,null,!1,null)}, +bu:function(a,b){return this.a6(a,null,null,null,!1,b)}, +Y:function(a,b,c){return this.a6(a,b,null,null,!1,c)}} +M.ea.prototype={ +$1:function(a){return a.a}} +M.e9.prototype={ +$0:function(){return H.a([],[[F.Y,P.G]])}} +M.eb.prototype={ +$1:function(a){var u +a.toString +u=H.ot(a,"~","~0") +return H.ot(u,"/","~1")}} +M.ee.prototype={ +$1:function(a){return a.a===this.a}} +M.ef.prototype={ +$0:function(){return C.d.b1(C.I,new M.ec(this.a),new M.ed())}} +M.ec.prototype={ +$1:function(a){return a.a===this.a}} +M.ed.prototype={ +$0:function(){return}} +M.eg.prototype={ +$2:function(a,b){this.a.Q.l(0,new D.bA(a,this.b.a),b)}} +M.bF.prototype={$iar:1} +Y.cI.prototype={ +k:function(a){return this.b}} +Y.cG.prototype={ +k:function(a){return this.b}} +Y.bZ.prototype={ +k:function(a){return this.b}} +Y.b4.prototype={ +k:function(a){return this.b}} +Y.bC.prototype={} +Y.fv.prototype={ +$1:function(a){var u,t,s,r=this.a +if(!r.c)if(J.H(a)<9){r.a.F() +this.b.L(C.a3) +return}else{u=Y.rk(a) +t=r.a +s=this.b +switch(u){case C.az:r.b=new Y.fK(s,t) +break +case C.aA:u=new Uint8Array(13) +r.b=new Y.i9(C.r,C.p,u,new Uint8Array(32),s,t) +break +case C.aB:r.b=new Y.jS(new Uint8Array(30),s,t) +break +default:t.F() +s.L(C.bd) +return}r.c=!0}r.b.A(0,a)}} +Y.fx.prototype={ +$1:function(a){this.a.a.F() +this.b.L(a)}, +$S:6} +Y.fw.prototype={ +$0:function(){var u=this.a.b +u.b.F() +u=u.a +if(u.a.a===0)u.L(C.a3)}} +Y.fu.prototype={ +$2:function(a,b){var u,t,s +for(u=b.length,t=J.K(a),s=0;s>>0 +k.c=2 +break +case 2:q=k.e+r +k.e=q +if(q<2)throw H.e(C.br) +if(j.$1(k.d)){q=k.e +k.r=new Uint8Array(q-2)}k.c=3 +break +case 3:s=Math.min(u.gh(a)-t,k.e-k.f-2) +q=j.$1(k.d) +p=k.f +o=p+s +if(q){q=k.r +k.f=o;(q&&C.i).a_(q,p,o,a,t) +if(k.f===k.e-2){k.b.F() +a=k.r +n=a[0] +u=a[1] +q=a[2] +p=a[3] +o=a[4] +m=a[5] +if(m===3)l=C.m +else l=m===1?C.a5:C.H +m=k.a.a +if(m.a!==0)H.O(P.aM("Future already completed")) +m.ag(new Y.bC("image/jpeg",n,l,(p<<8|o)>>>0,(u<<8|q)>>>0,C.p,C.r,!1,!1)) +return}}else{k.f=o +if(o===k.e-2)k.c=255}t+=s +continue}++t}}} +Y.fM.prototype={ +$1:function(a){return(a&240)===192&&a!==196&&a!==200&&a!==204||a===222}, +$S:3} +Y.fL.prototype={ +$1:function(a){return!(a===1||(a&248)===208||a===216||a===217||a===255)}, +$S:3} +Y.i9.prototype={ +A:function(a,b){var u,t,s,r,q,p,o,n,m,l,k,j,i,h,g=this,f=new Y.ia(g) +for(u=J.K(b),t=g.dx,s=g.db,r=0,q=0;r!==u.gh(b);){p=u.i(b,r) +switch(g.y){case 0:r+=8 +g.y=1 +continue +case 1:g.c=(g.c<<8|p)>>>0 +if(++g.d===4)g.y=2 +break +case 2:o=(g.e<<8|p)>>>0 +g.e=o +if(++g.f===4){switch(o){case 1229472850:if(g.c!==13){g.b.F() +u=g.a +if(u.a.a===0)u.L(C.n) +return}g.z=!0 +break +case 1951551059:g.Q=!0 +break +case 1665684045:if(g.c!==32){g.b.F() +u=g.a +if(u.a.a===0)u.L(C.n) +return}break +case 1934772034:if(g.c!==1){g.b.F() +u=g.a +if(u.a.a===0)u.L(C.n) +return}break +case 1883789683:if(g.c!==9){g.b.F() +u=g.a +if(u.a.a===0)u.L(C.n) +return}break +case 1732332865:if(g.c!==4){g.b.F() +u=g.a +if(u.a.a===0)u.L(C.n) +return}break +case 1766015824:g.ch=C.z +g.cx=C.y +break +case 1229209940:g.b.F() +if(!g.z)g.a.L(C.bq) +u=s.buffer +u.toString +H.aR(u,0,null) +b=new DataView(u,0) +n=b.getUint32(0,!1) +m=b.getUint32(4,!1) +l=b.getUint8(8) +switch(b.getUint8(9)){case 0:k=g.Q?C.a6:C.a5 +break +case 2:case 3:k=g.Q?C.w:C.m +break +case 4:k=C.a6 +break +case 6:k=C.w +break +default:k=C.H}u=g.cx +if(u===C.p)u=g.cx=C.q +t=g.ch +if(t===C.r)t=g.ch=C.t +s=g.cy +o=g.a.a +if(o.a!==0)H.O(P.aM("Future already completed")) +o.ag(new Y.bC("image/png",l,k,n,m,u,t,s,!1)) +return}if(g.c===0)g.y=4 +else g.y=3}break +case 3:o=u.gh(b) +j=g.c +i=g.x +q=Math.min(o-r,j-i) +switch(g.e){case 1229472850:o=i+q +g.x=o +C.i.a_(s,i,o,b,r) +break +case 1665684045:case 1732332865:case 1883789683:o=i+q +g.x=o +C.i.a_(t,i,o,b,r) +break +case 1934772034:g.ch=C.t +g.cx=C.q +g.x=i+1 +break +default:g.x=i+q}if(g.x===g.c){switch(g.e){case 1665684045:if(g.cx===C.p)g.d8() +break +case 1732332865:if(g.ch===C.r)g.d9() +break +case 1883789683:o=t.buffer +o.toString +H.aR(o,0,null) +h=new DataView(o,0) +if(h.getUint32(0,!1)!==h.getUint32(4,!1))g.cy=!0 +break}g.y=4}r+=q +continue +case 4:if(++g.r===4){f.$0() +g.y=1}break}++r}}, +d9:function(){var u,t=this +if(t.ch===C.t)return +u=t.dx.buffer +u.toString +switch(H.hU(u,0,null).getUint32(0,!1)){case 45455:t.ch=C.t +break +case 1e5:t.ch=C.de +break +default:t.ch=C.z}}, +d8:function(){var u,t,s=this +if(s.cx===C.q)return +u=s.dx.buffer +u.toString +t=H.hU(u,0,null) +if(t.getUint32(0,!1)===31270&&t.getUint32(4,!1)===32900&&t.getUint32(8,!1)===64e3&&t.getUint32(12,!1)===33e3&&t.getUint32(16,!1)===3e4&&t.getUint32(20,!1)===6e4&&t.getUint32(24,!1)===15e3&&t.getUint32(28,!1)===6000)s.cx=C.q +else s.cx=C.y}} +Y.ia.prototype={ +$0:function(){var u=this.a +u.r=u.x=u.f=u.e=u.d=u.c=0}} +Y.jS.prototype={ +A:function(a,b){var u,t,s,r,q,p,o,n=this,m=J.H(b),l=n.d,k=n.c +m=l+Math.min(m,30-l) +n.d=m +C.i.cY(k,l,m,b) +m=n.d +if(m>=25)m=m<30&&k[15]!==76 +else m=!0 +if(m)return +n.b.F() +m=k.buffer +m.toString +u=H.hU(m,0,null) +if(u.getUint32(0,!1)!==1380533830||u.getUint32(8,!1)!==1464156752){n.bX(C.a7) +return}switch(u.getUint32(12,!1)){case 1448097824:t=u.getUint16(26,!0)&16383 +s=u.getUint16(28,!0)&16383 +r=C.m +q=!1 +p=!1 +break +case 1448097868:m=k[21] +l=k[22] +t=1+((m|(l&63)<<8)>>>0) +m=k[23] +k=k[24] +s=1+((l>>>6|m<<2|(k&15)<<10)>>>0) +r=(k&16)===16?C.w:C.m +q=!1 +p=!1 +break +case 1448097880:o=k[20] +p=(o&2)===2 +q=(o&32)===32 +r=(o&16)===16?C.w:C.m +t=((k[24]|k[25]<<8|k[26]<<16)>>>0)+1 +s=((k[27]|k[28]<<8|k[29]<<16)>>>0)+1 +break +default:n.bX(C.a7) +return}m=q?C.z:C.t +n.a.Z(Y.rj("image/webp",8,r,t,s,q?C.y:C.q,m,p,!1))}, +bX:function(a){var u +this.b.F() +u=this.a +if(u.a.a===0)u.L(a)}} +Y.dr.prototype={$iar:1} +Y.dp.prototype={$iar:1} +Y.as.prototype={ +k:function(a){return this.a}, +$iar:1} +N.c3.prototype={ +k:function(a){return this.b}} +N.dj.prototype={ +b7:function(){var u,t=this,s=P.d,r=P.c,q=P.V(s,r) +q.l(0,"pointer",t.a) +u=t.b +if(u!=null)q.l(0,"mimeType",u) +u=t.c +if(u!=null)q.l(0,"storage",C.bX[u.a]) +u=t.e +if(u!=null)q.l(0,"uri",u) +u=t.d +if(u!=null)q.l(0,"byteLength",u) +u=t.f +if(u==null)s=null +else{s=P.V(s,r) +s.l(0,"width",u.d) +s.l(0,"height",u.e) +r=u.c +if(r!==C.H)s.l(0,"format",C.cx[r.a]) +r=u.f +if(r!==C.p)s.l(0,"primaries",C.cq[r.a]) +r=u.r +if(r!==C.r)s.l(0,"transfer",C.cp[r.a]) +r=u.b +if(r>0)s.l(0,"bits",r)}if(s!=null)q.l(0,"image",s) +return q}} +N.ie.prototype={ +aJ:function(a){return this.e6(a)}, +e6:function(a){var u=0,t=P.cT(-1),s,r=2,q,p=[],o=this,n,m +var $async$aJ=P.cU(function(b,c){if(b===1){q=c +u=r}while(true)switch(u){case 0:r=4 +u=7 +return P.c5(o.aT(),$async$aJ) +case 7:u=8 +return P.c5(o.aU(),$async$aJ) +case 8:if(a)O.uG(o.a,o.b) +o.a.ev(o.b) +r=2 +u=6 +break +case 4:r=3 +m=q +if(H.z(m) instanceof M.bF){u=1 +break}else throw m +u=6 +break +case 3:u=2 +break +case 6:case 1:return P.cP(s,t) +case 2:return P.cO(q,t)}}) +return P.cQ($async$aJ,t)}, +aT:function(){var u=0,t=P.cT(-1),s=1,r,q=[],p=this,o,n,m,l,k,j,i,h,g,f,e,d,c,b,a,a0,a1,a2 +var $async$aT=P.cU(function(a3,a4){if(a3===1){r=a4 +u=s}while(true)switch(u){case 0:a=p.b +a0=a.c +C.d.sh(a0,0) +a0.push("buffers") +k=p.a.y,j=k.b,i=a.dy,h=[P.c],k=k.a,g=k.length,f=0 +case 2:if(!(f=g +o=e?null:k[f] +if(o==null){u=3 +break}a0.push(C.c.k(f)) +d=new N.dj(a.M()) +d.b="application/gltf-buffer" +n=new N.ig(p,d,f) +m=null +s=6 +a2=H +u=9 +return P.c5(n.$1(o),$async$aT) +case 9:m=a2.oi(a4,"$iaf") +s=1 +u=8 +break +case 6:s=5 +a1=r +e=H.z(a1) +if(!!J.m(e).$iar){l=e +a.j($.lT(),H.a([l],h),"uri")}else throw a1 +u=8 +break +case 5:u=1 +break +case 8:if(m!=null){d.d=J.H(m) +if(J.H(m)b)a.B($.oQ(),H.a([J.H(m)-b],h))}e=o +if(e.Q==null)e.Q=m}}i.push(d.b7()) +a0.pop() +case 3:++f +u=2 +break +case 4:return P.cP(null,t) +case 1:return P.cO(r,t)}}) +return P.cQ($async$aT,t)}, +aU:function(){var u=0,t=P.cT(-1),s=1,r,q=[],p=this,o,n,m,l,k,j,i,h,g,f,e,d,c,b,a,a0,a1,a2,a3,a4,a5 +var $async$aU=P.cU(function(a7,a8){if(a7===1){r=a8 +u=s}while(true)switch(u){case 0:a3=p.b +a4=a3.c +C.d.sh(a4,0) +a4.push("images") +h=p.a.ch,g=h.b,f=a3.dy,e=[P.c],d=a3.k1,h=h.a,c=h.length,b=0 +case 2:if(!(b=c +o=a?null:h[b] +if(o==null){u=3 +break}a4.push(C.c.k(b)) +a0=new N.dj(a3.M()) +n=new N.ih(p,a0) +m=null +try{m=n.$1(o)}catch(a6){a=H.z(a6) +if(!!J.m(a).$iar){l=a +a3.j($.lT(),H.a([l],e),"uri")}else throw a6}k=null +u=m!=null?5:6 +break +case 5:s=8 +u=11 +return P.c5(Y.rl(m),$async$aU) +case 11:k=a8 +a=C.d.D(d,k.a) +if(!a)a3.B($.oU(),H.a([k.a],e)) +s=1 +u=10 +break +case 8:s=7 +a5=r +a=H.z(a5) +a2=J.m(a) +if(!!a2.$idr)a3.P($.oX()) +else if(!!a2.$idp)a3.P($.oW()) +else if(!!a2.$ias){j=a +a3.B($.oR(),H.a([j],e))}else if(!!a2.$iar){i=a +a3.j($.lT(),H.a([i],e),"uri")}else throw a5 +u=10 +break +case 7:u=1 +break +case 10:if(k!=null){a0.b=k.a +if(o.y!=null&&o.y!==k.a)a3.B($.oT(),H.a([k.a,o.y],e)) +a=k.d +if(a!==0&&(a&a-1)>>>0===0){a=k.e +a=!(a!==0&&(a&a-1)>>>0===0)}else a=!0 +if(a)a3.B($.oV(),H.a([k.d,k.e],e)) +a=k +if(a.f===C.y||a.r===C.z||k.y||k.x)a3.P($.oS()) +o.cx=k +a0.f=k}case 6:f.push(a0.b7()) +a4.pop() +case 3:++b +u=2 +break +case 4:return P.cP(null,t) +case 1:return P.cO(r,t)}}) +return P.cQ($async$aU,t)}} +N.ig.prototype={ +$1:function(a){var u,t,s,r=this +if(a.a.a===0){u=a.x +if(u!=null){t=r.b +t.c=C.aD +t.e=u.k(0) +return r.a.c.$1(u)}else{u=a.Q +if(u!=null){r.b.c=C.aC +return u}else{u=r.a +t=u.b +if(t.id&&r.c===0&&!a.z){r.b.c=C.dh +s=u.c.$0() +if(s==null)t.P($.pm()) +return s}}}}return}} +N.ih.prototype={ +$1:function(a){var u,t,s=this +if(a.a.a===0){u=a.z +if(u!=null){t=s.b +t.c=C.aD +t.e=u.k(0) +return s.a.d.$1(u)}else{u=a.Q +if(u!=null&&a.y!=null){s.b.c=C.aC +t=[P.l,P.h] +return P.mc(H.a([u],[t]),t)}else if(a.ch!=null){s.b.c=C.dg +a.er() +u=a.Q +if(u!=null){t=[P.l,P.h] +return P.mc(H.a([u],[t]),t)}}}}return}} +O.lQ.prototype={ +$2:function(a,b){var u,t,s,r,q,p,o,n,m=O.lk(b) +if((m==null?null:m.dx)!=null){m=this.a +u=m.c +C.d.sh(u,0) +u.push("accessors") +u.push(C.c.k(a)) +t=b.dx.ge0() +if(t!=null)for(u=t.length,s=b.Q,r=[P.c],q=0,p=-1,o=0;o=s)m.j($.oK(),H.a([q,n,s],r),"sparse");++q}}}} +O.lR.prototype={ +$1:function(a){return a.cx===0}} +O.lS.prototype={ +$2:function(a,b){var u,t,s,r,q,p,o,n,m,l=this,k=b.fr,j=b.cx,i=new Array(j) +i.fixed$length=Array +u=H.a(i,[[P.Z,P.h]]) +i=new Array(j) +i.fixed$length=Array +t=H.a(i,[[P.Z,P.w]]) +i=P.h +r=[i] +q=b.dx +p=0 +while(!0){if(!(pr){k=$.oH() +j=q+"/JOINTS_"+m +a.j(k,H.a([g.f,g.r,l,r,n],p),j) +continue}i=s[m].gn() +if(i!==0){if(!o.A(0,l)){k=$.oG() +j=q+"/JOINTS_"+m +a.j(k,H.a([g.f,g.r,l],p),j) +h=!1}else h=!0 +if(i<0){k=$.oM() +j=q+"/WEIGHTS_"+m +a.j(k,H.a([g.f,g.r,i],p),j)}else if(h){k=g.y +j=$.mX() +j[0]=k+i +g.y=j[0] +g.z+=2e-7}}else if(l!==0){k=$.oI() +j=q+"/JOINTS_"+m +a.j(k,H.a([g.f,g.r,l],p),j)}}if(4===++g.r){if(Math.abs(g.y-1)>g.z)for(m=0;m= "+H.b(a[2])+"."}} +E.eK.prototype={ +$1:function(a){return"Matrix element at index "+H.b(a[0])+" (component index "+H.b(a[1])+") contains invalid value: "+H.b(a[2])+"."}} +E.eQ.prototype={ +$1:function(a){return"Image data is invalid. "+H.b(a[0])}} +E.eP.prototype={ +$1:function(a){return"Recognized image format "+("'"+H.b(a[0])+"'")+" does not match declared image format "+("'"+H.b(a[1])+"'")+"."}} +E.en.prototype={ +$1:function(a){return"Unexpected end of image stream."}} +E.eo.prototype={ +$1:function(a){return"Image format not recognized."}} +E.ep.prototype={ +$1:function(a){return"'"+H.b(a[0])+"' MIME type requires an extension."}} +E.eO.prototype={ +$1:function(a){return"Image has non-power-of-two dimensions: "+H.b(a[0])+"x"+H.b(a[1])+"."}} +E.eN.prototype={ +$1:function(a){return"Image contains unsupported features like non-default colorspace information, non-square pixels, or animation."}} +E.es.prototype={ +$1:function(a){return"Data URI is used in GLB container."}} +E.eI.prototype={ +$1:function(a){return"Joints accessor element at index "+H.b(a[0])+" (component index "+H.b(a[1])+") has value "+H.b(a[2])+" that is greater than the maximum joint index ("+H.b(a[3])+") set by skin "+H.b(a[4])+"."}} +E.ex.prototype={ +$1:function(a){return"Joints accessor element at index "+H.b(a[0])+" (component index "+H.b(a[1])+") has value "+H.b(a[2])+" that is already in use for the vertex."}} +E.em.prototype={ +$1:function(a){return"Weights accessor element at index "+H.b(a[0])+" (component index "+H.b(a[1])+") has negative value "+H.b(a[2])+"."}} +E.ek.prototype={ +$1:function(a){return"Weights accessor elements (at indices "+H.b(a[0])+".."+H.b(a[1])+") have non-normalized sum: "+H.b(a[2])+"."}} +E.el.prototype={ +$1:function(a){return"Joints accessor element at index "+H.b(a[0])+" (component index "+H.b(a[1])+") is used with zero weight but has non-zero value ("+H.b(a[2])+")."}} +E.fB.prototype={} +E.fC.prototype={ +$1:function(a){return J.aa(a[0])}} +E.ik.prototype={} +E.iv.prototype={ +$1:function(a){return"Invalid array length "+H.b(a[0])+". Valid lengths are: "+J.aF(H.aW(a[1],"$it"),E.o9(),P.d).k(0)+"."}} +E.iw.prototype={ +$1:function(a){var u=a[0] +return"Type mismatch. Array element "+H.b(typeof u==="string"?"'"+u+"'":J.aa(u))+" is not a "+("'"+H.b(a[1])+"'")+"."}} +E.iB.prototype={ +$1:function(a){return"Duplicate element."}} +E.iz.prototype={ +$1:function(a){return"Index must be a non-negative integer."}} +E.it.prototype={ +$1:function(a){return"Invalid JSON data. Parser output: "+H.b(a[0])}} +E.ip.prototype={ +$1:function(a){return"Invalid URI "+("'"+H.b(a[0])+"'")+". Parser output:\n"+H.b(a[1])}} +E.ix.prototype={ +$1:function(a){return"Entity cannot be empty."}} +E.iq.prototype={ +$1:function(a){a.toString +return"Exactly one of "+new H.aw(a,E.bn(),[H.i(a,0),P.d]).k(0)+" properties must be defined."}} +E.iA.prototype={ +$1:function(a){return"Value "+("'"+H.b(a[0])+"'")+" does not match regexp pattern "+("'"+H.b(a[1])+"'")+"."}} +E.il.prototype={ +$1:function(a){var u=a[0] +return"Type mismatch. Property value "+H.b(typeof u==="string"?"'"+u+"'":J.aa(u))+" is not a "+("'"+H.b(a[1])+"'")+"."}} +E.iu.prototype={ +$1:function(a){var u=a[0] +return"Invalid value "+H.b(typeof u==="string"?"'"+u+"'":J.aa(u))+". Valid values are "+J.aF(H.aW(a[1],"$it"),E.o9(),P.d).k(0)+"."}} +E.io.prototype={ +$1:function(a){return"Value "+H.b(a[0])+" is out of range."}} +E.ir.prototype={ +$1:function(a){return"Value "+H.b(a[0])+" is not a multiple of "+H.b(a[1])+"."}} +E.im.prototype={ +$1:function(a){return"Property "+("'"+H.b(a[0])+"'")+" must be defined."}} +E.iy.prototype={ +$1:function(a){return"Unexpected property."}} +E.is.prototype={ +$1:function(a){return"Dependency failed. "+("'"+H.b(a[0])+"'")+" must be defined."}} +E.iC.prototype={} +E.j9.prototype={ +$1:function(a){return"Unknown glTF major asset version: "+H.b(a[0])+"."}} +E.j8.prototype={ +$1:function(a){return"Unknown glTF minor asset version: "+H.b(a[0])+"."}} +E.iZ.prototype={ +$1:function(a){return"Asset minVersion "+("'"+H.b(a[0])+"'")+" is greater than version "+("'"+H.b(a[1])+"'")+"."}} +E.iX.prototype={ +$1:function(a){return"Invalid value "+H.b(a[0])+" for GL type "+("'"+H.b(a[1])+"'")+"."}} +E.iY.prototype={ +$1:function(a){return"Integer value is written with fractional part: "+H.b(a[0])+"."}} +E.iW.prototype={ +$1:function(a){return"Only (u)byte and (u)short accessors can be normalized."}} +E.iU.prototype={ +$1:function(a){return"Offset "+H.b(a[0])+" is not a multiple of componentType length "+H.b(a[1])+"."}} +E.iV.prototype={ +$1:function(a){return"Matrix accessors must be aligned to 4-byte boundaries."}} +E.j4.prototype={ +$1:function(a){return"Sparse accessor overrides more elements ("+H.b(a[0])+") than the base accessor contains ("+H.b(a[1])+")."}} +E.j5.prototype={ +$1:function(a){return"Animated TRS properties will not affect a skinned mesh."}} +E.iT.prototype={ +$1:function(a){return"Buffer's Data URI MIME-Type must be 'application/octet-stream' or 'application/gltf-buffer'. Found "+("'"+H.b(a[0])+"'")+" instead."}} +E.iS.prototype={ +$1:function(a){return"Buffer view's byteStride ("+H.b(a[0])+") is greater than byteLength ("+H.b(a[1])+")."}} +E.iR.prototype={ +$1:function(a){return"Only buffer views with raw vertex data can have byteStride."}} +E.iP.prototype={ +$1:function(a){return"xmag and ymag must not be zero."}} +E.iO.prototype={ +$1:function(a){return"zfar must be greater than znear."}} +E.iM.prototype={ +$1:function(a){return"Alpha cutoff is supported only for 'MASK' alpha mode."}} +E.iG.prototype={ +$1:function(a){return"Invalid attribute name."}} +E.jj.prototype={ +$1:function(a){return"All primitives must have the same number of morph targets."}} +E.ji.prototype={ +$1:function(a){return"All primitives should contain the same number of 'JOINTS' and 'WEIGHTS' attribute sets."}} +E.iL.prototype={ +$1:function(a){return"No POSITION attribute found."}} +E.iI.prototype={ +$1:function(a){return"Indices for indexed attribute semantic "+("'"+H.b(a[0])+"'")+" must start with 0 and be continuous. Total expected indices: "+H.b(a[1])+", total provided indices: "+H.b(a[2])+"."}} +E.iK.prototype={ +$1:function(a){return"TANGENT attribute without NORMAL found."}} +E.iH.prototype={ +$1:function(a){return"Number of JOINTS attribute semantics ("+H.b(a[0])+") does not match the number of WEIGHTS ("+H.b(a[1])+")."}} +E.iJ.prototype={ +$1:function(a){return"TANGENT attribute defined for POINTS rendering mode."}} +E.jh.prototype={ +$1:function(a){return"The length of weights array ("+H.b(a[0])+") does not match the number of morph targets ("+H.b(a[1])+")."}} +E.jf.prototype={ +$1:function(a){return"A node can have either a matrix or any combination of translation/rotation/scale (TRS) properties."}} +E.jb.prototype={ +$1:function(a){return"Do not specify default transform matrix."}} +E.j0.prototype={ +$1:function(a){return"Matrix must be decomposable to TRS."}} +E.jg.prototype={ +$1:function(a){return"Rotation quaternion must be normalized."}} +E.ja.prototype={ +$1:function(a){return"Unused extension "+("'"+H.b(a[0])+"'")+" cannot be required."}} +E.jc.prototype={ +$1:function(a){return"Extension "+("'"+H.b(a[0])+"'")+" cannot be optional."}} +E.jd.prototype={ +$1:function(a){return"Extension uses unreserved extension prefix "+("'"+H.b(a[0])+"'")+"."}} +E.je.prototype={ +$1:function(a){return"Extension name has invalid format."}} +E.j3.prototype={ +$1:function(a){return"Empty node encountered."}} +E.j2.prototype={ +$1:function(a){return"Node with a skinned mesh is not root. Parent transforms will not affect a skinned mesh."}} +E.j1.prototype={ +$1:function(a){return"Local transforms will not affect a skinned mesh."}} +E.j_.prototype={ +$1:function(a){return"A node with a skinned mesh is used in a scene that does not contain joint nodes."}} +E.j7.prototype={ +$1:function(a){return"Joints do not have a common root."}} +E.j6.prototype={ +$1:function(a){return"Skeleton node is not a common root."}} +E.iN.prototype={ +$1:function(a){return"Non-relative URI found: "+("'"+H.b(a[0])+"'")+"."}} +E.iE.prototype={ +$1:function(a){return"Multiple extensions are defined for this object: "+J.aF(H.aW(a[1],"$it"),E.bn(),P.d).k(0)+"."}} +E.iD.prototype={ +$1:function(a){return"Prefer JSON Objects for extras."}} +E.iQ.prototype={ +$1:function(a){return"This property should not be defined as it will not be used."}} +E.iF.prototype={ +$1:function(a){return"outerConeAngle ("+H.b(a[1])+") is less than or equal to innerConeAngle ("+H.b(a[0])+")."}} +E.fS.prototype={} +E.hq.prototype={ +$1:function(a){return"Accessor's total byteOffset "+H.b(a[0])+" isn't a multiple of componentType length "+H.b(a[1])+"."}} +E.hu.prototype={ +$1:function(a){return"Referenced bufferView's byteStride value "+H.b(a[0])+" is less than accessor element's length "+H.b(a[1])+"."}} +E.hg.prototype={ +$1:function(a){return"Accessor (offset: "+H.b(a[0])+", length: "+H.b(a[1])+") does not fit referenced bufferView ["+H.b(a[2])+"] length "+H.b(a[3])+"."}} +E.h2.prototype={ +$1:function(a){return"Override of previously set accessor usage. Initial: "+("'"+H.b(a[0])+"'")+", new: "+("'"+H.b(a[1])+"'")+"."}} +E.hv.prototype={ +$1:function(a){return"Animation channel has the same target as channel "+H.b(a[0])+"."}} +E.fZ.prototype={ +$1:function(a){return"Animation channel cannot target TRS properties of a node with defined matrix."}} +E.fY.prototype={ +$1:function(a){return"Animation channel cannot target WEIGHTS when mesh does not have morph targets."}} +E.h0.prototype={ +$1:function(a){return"accessor.min and accessor.max must be defined for animation input accessor."}} +E.h1.prototype={ +$1:function(a){return"Invalid Animation sampler input accessor format "+("'"+H.b(a[0])+"'")+". Must be one of "+J.aF(H.aW(a[1],"$it"),E.bn(),P.d).k(0)+"."}} +E.fX.prototype={ +$1:function(a){return"Invalid animation sampler output accessor format "+("'"+H.b(a[0])+"'")+" for path "+("'"+H.b(a[2])+"'")+". Must be one of "+J.aF(H.aW(a[1],"$it"),E.bn(),P.d).k(0)+"."}} +E.h_.prototype={ +$1:function(a){return"Animation sampler output accessor with "+("'"+H.b(a[0])+"'")+" interpolation must have at least "+H.b(a[1])+" elements. Got "+H.b(a[2])+"."}} +E.fW.prototype={ +$1:function(a){return"Animation sampler output accessor of count "+H.b(a[0])+" expected. Found "+H.b(a[1])+"."}} +E.h5.prototype={ +$1:function(a){return"Buffer refers to an unresolved GLB binary chunk."}} +E.h3.prototype={ +$1:function(a){return"BufferView does not fit buffer ("+H.b(a[0])+") byteLength ("+H.b(a[1])+")."}} +E.ht.prototype={ +$1:function(a){return"Override of previously set bufferView target or usage. Initial: "+("'"+H.b(a[0])+"'")+", new: "+("'"+H.b(a[1])+"'")+"."}} +E.hm.prototype={ +$1:function(a){return"Accessor of count "+H.b(a[0])+" expected. Found "+H.b(a[1])+"."}} +E.h7.prototype={ +$1:function(a){return"Invalid accessor format "+("'"+H.b(a[0])+"'")+" for this attribute semantic. Must be one of "+J.aF(H.aW(a[1],"$it"),E.bn(),P.d).k(0)+"."}} +E.h8.prototype={ +$1:function(a){return"accessor.min and accessor.max must be defined for POSITION attribute accessor."}} +E.h4.prototype={ +$1:function(a){return"bufferView.byteStride must be defined when two or more accessors use the same buffer view."}} +E.h6.prototype={ +$1:function(a){return"Vertex attribute data must be aligned to 4-byte boundaries."}} +E.he.prototype={ +$1:function(a){return"bufferView.byteStride must not be defined for indices accessor."}} +E.hd.prototype={ +$1:function(a){return"Invalid indices accessor format "+("'"+H.b(a[0])+"'")+". Must be one of "+J.aF(H.aW(a[1],"$it"),E.bn(),P.d).k(0)+". "}} +E.hc.prototype={ +$1:function(a){return"Number of vertices or indices ("+H.b(a[0])+") is not compatible with used drawing mode ("+("'"+H.b(a[1])+"'")+")."}} +E.hb.prototype={ +$1:function(a){return"Material is incompatible with mesh primitive: Texture binding "+("'"+H.b(a[0])+"'")+" needs 'TEXCOORD_"+H.b(a[1])+"' attribute."}} +E.hf.prototype={ +$1:function(a){return"All accessors of the same primitive must have the same count."}} +E.ha.prototype={ +$1:function(a){return"No base accessor for this attribute semantic."}} +E.h9.prototype={ +$1:function(a){return"Base accessor has different count."}} +E.hs.prototype={ +$1:function(a){return"Node is a part of a node loop."}} +E.hh.prototype={ +$1:function(a){return"Value overrides parent of node "+H.b(a[0])+"."}} +E.hk.prototype={ +$1:function(a){var u="The length of weights array ("+H.b(a[0])+") does not match the number of morph targets (",t=a[1] +return u+H.b(t==null?0:t)+")."}} +E.hj.prototype={ +$1:function(a){return"Node has skin defined, but mesh has no joints data."}} +E.hi.prototype={ +$1:function(a){return"Node uses skinned mesh, but has no skin defined."}} +E.hl.prototype={ +$1:function(a){return"Node "+H.b(a[0])+" is not a root node."}} +E.hn.prototype={ +$1:function(a){return"Invalid IBM accessor format "+("'"+H.b(a[0])+"'")+". Must be one of "+J.aF(H.aW(a[1],"$it"),E.bn(),P.d).k(0)+". "}} +E.fV.prototype={ +$1:function(a){return"Invalid MIME type "+("'"+H.b(a[0])+"'")+" for the texture source. Valid MIME types are "+J.aF(H.aW(a[1],"$it"),E.bn(),P.d).k(0)+"."}} +E.fU.prototype={ +$1:function(a){return"Extension is not declared in extensionsUsed."}} +E.fT.prototype={ +$1:function(a){return"Unexpected location for this extension."}} +E.ho.prototype={ +$1:function(a){return"Unresolved reference: "+H.b(a[0])+"."}} +E.hp.prototype={ +$1:function(a){return"Cannot validate an extension as it is not supported by the validator: "+("'"+H.b(a[0])+"'")+"."}} +E.hr.prototype={ +$1:function(a){return"This object may be unused."}} +E.eT.prototype={} +E.eZ.prototype={ +$1:function(a){return"Invalid GLB magic value ("+H.b(a[0])+")."}} +E.eY.prototype={ +$1:function(a){return"Invalid GLB version value "+H.b(a[0])+"."}} +E.eX.prototype={ +$1:function(a){return"Declared GLB length ("+H.b(a[0])+") is too small."}} +E.f6.prototype={ +$1:function(a){return"Length of "+H.b(a[0])+" chunk is not aligned to 4-byte boundaries."}} +E.eV.prototype={ +$1:function(a){return"Declared length ("+H.b(a[0])+") does not match GLB length ("+H.b(a[1])+")."}} +E.f5.prototype={ +$1:function(a){return"Chunk ("+H.b(a[0])+") length ("+H.b(a[1])+") does not fit total GLB length."}} +E.f1.prototype={ +$1:function(a){return"Chunk ("+H.b(a[0])+") cannot have zero length."}} +E.f2.prototype={ +$1:function(a){return"Chunk of type "+H.b(a[0])+" has already been used."}} +E.eW.prototype={ +$1:function(a){return"Unexpected end of chunk header."}} +E.eU.prototype={ +$1:function(a){return"Unexpected end of chunk data."}} +E.f_.prototype={ +$1:function(a){return"Unexpected end of header."}} +E.f4.prototype={ +$1:function(a){return"First chunk must be of JSON type. Found "+H.b(a[0])+" instead."}} +E.f3.prototype={ +$1:function(a){return"BIN chunk must be the second chunk."}} +E.f0.prototype={ +$1:function(a){return"Unknown GLB chunk type: "+H.b(a[0])+"."}} +E.bE.prototype={ +gbG:function(){var u=J.n2(this.a.c.$1(this.e)) +return u}, +gC:function(a){return C.a.gC(this.k(0))}, +K:function(a,b){if(b==null)return!1 +return b instanceof E.bE&&b.k(0)===this.k(0)}, +k:function(a){var u=this,t=u.c +if(t!=null&&t.length!==0)return H.b(t)+": "+u.gbG() +t=u.d +if(t!=null)return"@"+H.b(t)+": "+u.gbG() +return u.gbG()}} +D.bz.prototype={ +E:function(a,b){var u=this.d,t=this.e=a.ch.i(0,u) +if(u!==-1)if(t==null)b.j($.D(),H.a([u],[P.c]),"source") +else t.c=!0}, +bR:function(a,b){var u,t=this.e +t=t==null?null:t.cx +u=t==null?null:t.a +if(u!=null&&u!=="image/webp")b.j($.mO(),H.a([u,C.cr],[P.c]),"source")}, +$icB:1} +X.b8.prototype={ +E:function(a,b){var u,t,s=b.c +s.push("lights") +u=this.d +t=J.cr(s.slice(0),H.i(s,0)) +b.y.l(0,u,t) +u.aa(new X.fR(b,a)) +s.pop()}} +X.fR.prototype={ +$2:function(a,b){var u=this.a.c +u.push(C.c.k(a)) +u.pop()}} +X.ct.prototype={} +X.bI.prototype={} +X.bJ.prototype={ +E:function(a,b){var u,t,s=a.a.i(0,"KHR_lights_punctual") +if(s instanceof X.b8){u=this.d +t=this.e=s.d.i(0,u) +if(u!==-1)if(t==null)b.j($.D(),H.a([u],[P.c]),"light") +else t.c=!0}else b.B($.ce(),H.a(["/extensions/KHR_lights_punctual"],[P.c]))}} +A.bK.prototype={ +E:function(a,b){var u,t=this.e +if(t!=null){u=b.c +u.push("diffuseTexture") +t.E(a,b) +u.pop()}t=this.x +if(t!=null){u=b.c +u.push("specularGlossinessTexture") +t.E(a,b) +u.pop()}}} +S.bL.prototype={} +L.bM.prototype={ +E:function(a,b){var u,t +for(u=b.e,t=this;t!=null;){t=u.i(0,t) +if(t instanceof Y.ax){t.dx.l(0,b.M(),this.r) +break}}}} +D.aj.prototype={} +D.a_.prototype={} +D.bA.prototype={ +gC:function(a){var u=J.ai(this.a),t=J.ai(this.b) +return A.nU(A.dJ(A.dJ(0,C.c.gC(u)),C.c.gC(t)))}, +K:function(a,b){if(b==null)return!1 +return b instanceof D.bA&&this.b==b.b&&J.a5(this.a,b.a)}} +D.cu.prototype={} +D.dk.prototype={} +A.d3.prototype={ +bM:function(){var u=this,t=u.d=u.c.bE(u.gdl(),u.gdn(),u.gc7()),s=u.dy +s.e=t.geb() +s.f=t.gee() +s.r=new A.f9(u) +return u.e.a}, +aS:function(){this.d.F() +var u=this.e +if(u.a.a===0)u.Z(new K.ac("model/gltf-binary",null,this.fx))}, +dm:function(a){var u,t,s,r,q,p,o,n,m,l,k,j,i,h,g,f=this,e="model/gltf-binary",d="0" +f.d.aK() +for(u=J.K(a),t=K.ac,s=[t],t=[t],r=[P.c],q=f.a,p=0,o=0;p!==u.gh(a);)switch(f.r){case 0:n=u.gh(a) +m=f.x +o=Math.min(n-p,12-m) +n=m+o +f.x=n +C.i.a_(q,m,n,a,p) +p+=o +f.y=o +if(f.x!==12)break +l=f.b.getUint32(0,!0) +if(l!==1179937895){f.f.Y($.p1(),H.a([l],r),0) +f.d.F() +u=f.e.a +if(u.a===0){t=f.fx +u.ag(new K.ac(e,null,t))}return}k=f.b.getUint32(4,!0) +if(k!==2){f.f.Y($.p2(),H.a([k],r),4) +f.d.F() +u=f.e.a +if(u.a===0){t=f.fx +u.ag(new K.ac(e,null,t))}return}n=f.z=f.b.getUint32(8,!0) +if(n<=f.y)f.f.Y($.p4(),H.a([n],r),8) +f.r=1 +f.x=0 +break +case 1:n=u.gh(a) +m=f.x +o=Math.min(n-p,8-m) +n=m+o +f.x=n +C.i.a_(q,m,n,a,p) +p+=o +f.y+=o +if(f.x!==8)break +f.ch=f.b.getUint32(0,!0) +n=f.b.getUint32(4,!0) +f.cx=n +if((f.ch&3)!==0){m=f.f +j=$.oY() +i=f.y +m.Y(j,H.a(["0x"+C.a.ak(C.c.X(n,16),8,d)],r),i-8)}if(f.y+f.ch>f.z)f.f.Y($.oZ(),H.a(["0x"+C.a.ak(C.c.X(f.cx,16),8,d),f.ch],r),f.y-8) +if(f.Q===0&&f.cx!==1313821514)f.f.Y($.p9(),H.a(["0x"+C.a.ak(C.c.X(f.cx,16),8,d)],r),f.y-8) +n=f.cx +if(n===5130562&&f.Q>1&&!f.fr)f.f.Y($.p5(),H.a(["0x"+C.a.ak(C.c.X(n,16),8,d)],r),f.y-8) +h=new A.f7(f) +n=f.cx +switch(n){case 1313821514:if(f.ch===0){m=f.f +j=$.p0() +i=f.y +m.Y(j,H.a(["0x"+C.a.ak(C.c.X(n,16),8,d)],r),i-8)}h.$1$seen(f.cy) +f.cy=!0 +break +case 5130562:h.$1$seen(f.fr) +f.fr=!0 +break +default:f.f.Y($.pa(),H.a(["0x"+C.a.ak(C.c.X(n,16),8,d)],r),f.y-8) +f.r=4294967295}++f.Q +f.x=0 +break +case 1313821514:o=Math.min(u.gh(a)-p,f.ch-f.x) +if(f.db==null){n=f.dy +m=f.f +n=new K.cp(new P.bi(n,[H.i(n,0)]),new P.aN(new P.E($.p,s),t)) +n.e=m +f.db=n +f.dx=n.bM()}n=f.dy +g=p+o +m=u.T(a,p,g) +if(n.b>=4)H.O(n.bg()) +j=n.b +if((j&1)!==0)n.ai(m) +else if((j&3)===0){n=n.aQ() +m=new P.c_(m) +j=n.c +if(j==null)n.b=n.c=m +else{j.sau(m) +n.c=m}}n=f.x+=o +f.y+=o +if(n===f.ch){f.dy.a1() +f.r=1 +f.x=0}p=g +break +case 5130562:n=u.gh(a) +m=f.ch +o=Math.min(n-p,m-f.x) +n=f.fx +if(n==null)n=f.fx=new Uint8Array(m) +m=f.x +j=m+o +f.x=j +C.i.a_(n,m,j,a,p) +p+=o +f.y+=o +if(f.x===f.ch){f.r=1 +f.x=0}break +case 4294967295:n=u.gh(a) +m=f.ch +j=f.x +o=Math.min(n-p,m-j) +j+=o +f.x=j +p+=o +f.y+=o +if(j===m){f.r=1 +f.x=0}break}f.d.al()}, +dq:function(){var u,t,s=this +switch(s.r){case 0:s.f.bu($.p8(),s.y) +s.aS() +break +case 1:if(s.x!==0){s.f.bu($.p7(),s.y) +s.aS()}else{u=s.z +t=s.y +if(u!==t)s.f.Y($.p3(),H.a([u,t],[P.c]),s.y) +u=s.dx +if(u!=null)u.am(0,new A.f8(s),s.gc7(),P.A) +else s.e.Z(new K.ac("model/gltf-binary",null,s.fx))}break +default:if(s.ch>0)s.f.bu($.p6(),s.y) +s.aS()}}, +dr:function(a){var u +this.d.F() +u=this.e +if(u.a.a===0)u.L(a)}, +$icq:1} +A.f9.prototype={ +$0:function(){var u=this.a +if((u.dy.b&4)!==0)u.d.al() +else u.aS()}} +A.f7.prototype={ +$1$seen:function(a){var u=this.a +if(a){u.f.Y($.p_(),H.a(["0x"+C.a.ak(C.c.X(u.cx,16),8,"0")],[P.c]),u.y-8) +u.r=4294967295}else u.r=u.cx}, +$0:function(){return this.$1$seen(null)}} +A.f8.prototype={ +$1:function(a){var u=this.a,t=a==null?null:a.b +u.e.Z(new K.ac("model/gltf-binary",t,u.fx))}} +K.ac.prototype={} +K.cq.prototype={} +K.fe.prototype={ +$0:function(){return this.a.b.aK()}} +K.ff.prototype={ +$0:function(){return this.a.b.al()}} +K.fd.prototype={ +$0:function(){return this.a.b.F()}} +K.fg.prototype={ +$1:function(a){var u,t,s,r,q,p=this,o=null,n=p.a +if(!n.a){u=J.K(a) +if(u.gt(a)){n.b.F() +p.b.a1() +p.c.L(C.a_) +return}t=u.i(a,0) +if(103===t){u=p.b +s=p.d +r=new Uint8Array(12) +q=K.ac +q=new A.d3(r,new P.bi(u,[H.i(u,0)]),new P.aN(new P.E($.p,[q]),[q])) +s.id=!0 +q.f=s +u=r.buffer +u.toString +q.b=H.hU(u,0,o) +q.dy=P.nz(o,o,o,[P.l,P.h]) +p.c.Z(q) +n.a=!0}else{u=123===t||9===t||32===t||10===t||13===t||239===t +s=p.c +r=p.b +if(u){s.Z(K.rg(new P.bi(r,[H.i(r,0)]),p.d)) +n.a=!0}else{n.b.F() +r.a1() +s.L(C.a_) +return}}}p.b.A(0,a)}} +K.cp.prototype={ +bM:function(){var u=this,t=P.c,s=H.a([],[t]),r=new P.N("") +u.d=new P.l5(new P.dH(!1,r),new P.kH(C.a2.gct().a,new P.kT(new K.fb(u),s,[t]),r)) +u.b=u.a.bE(u.gdu(),u.gdw(),u.gdA()) +return u.c.a}, +dv:function(a){var u,t,s,r,q=this +q.b.aK() +if(q.f){t=J.K(a) +if(t.ga2(a)&&239===t.i(a,0))q.e.ar($.dR(),H.a(["BOM found at the beginning of UTF-8 stream."],[P.c]),!0) +q.f=!1}try{t=q.d +s=J.H(a) +t.a.cs(a,0,s) +q.b.al()}catch(r){t=H.z(r) +if(t instanceof P.ak){u=t +q.e.ar($.dR(),H.a([u],[P.c]),!0) +q.b.F() +q.c.b_()}else throw r}}, +dB:function(a){var u +this.b.F() +u=this.c +if(u.a.a===0)u.L(a)}, +dz:function(){var u,t,s,r=this +try{r.d.a1()}catch(t){s=H.z(t) +if(s instanceof P.ak){u=s +r.e.ar($.dR(),H.a([u],[P.c]),!0) +r.b.F() +r.c.b_()}else throw t}}, +$icq:1} +K.fb.prototype={ +$1:function(a){var u,t,s=a[0],r=s,q=P.c +if(H.a2(r,"$if",[P.d,q],"$af"))try{r=this.a +u=V.nc(s,r.e) +r.c.Z(new K.ac("model/gltf+json",u,null))}catch(t){if(H.z(t) instanceof M.bF){r=this.a +r.b.F() +r.c.b_()}else throw t}else{r=this.a +r.e.ar($.P(),H.a([s,"object"],[q]),!0) +r.b.F() +r.c.b_()}}} +K.d5.prototype={ +k:function(a){return"Invalid data: could not detect glTF format."}, +$iar:1} +F.lr.prototype={ +$2:function(a,b){this.a.$1(a) +if(!(typeof b==="number"&&Math.floor(b)===b&&b>=0)){this.b.l(0,a,-1) +this.c.p($.dQ(),a)}}} +F.ls.prototype={ +$2:function(a,b){this.a.$1(a) +if(!(typeof b==="number"&&Math.floor(b)===b&&b>=0)){this.b.l(0,a,-1) +this.c.p($.dQ(),a)}}} +F.lt.prototype={ +$1:function(a){return a.ae(0,P.d,P.h)}} +F.lq.prototype={ +$0:function(){return H.a([],[D.cu])}} +F.ae.prototype={ +i:function(a,b){return b==null||b<0||b>=this.a.length?null:this.a[b]}, +l:function(a,b,c){this.a[b]=c}, +gh:function(a){return this.b}, +sh:function(a,b){throw H.e(P.W("Changing length is not supported"))}, +k:function(a){return P.fF(this.a,"[","]")}, +aa:function(a){var u,t,s,r +for(u=this.b,t=this.a,s=0;s0.00674)a.j($.mG(),H.a([b-2,b,Math.sqrt(u.a)],[P.c]),u.b) +u.a=0}return!0}, +$aY:function(){return[P.G]}} +F.jD.prototype={ +W:function(a,b,c,d){var u=this,t=u.c,s=t!=null?t.$1(d):d +if(3===c){if(1!==s&&-1!==s)a.j($.oF(),H.a([b-3,b,s],[P.c]),u.b)}else{t=u.a+s*s +u.a=t +if(2===c){if(Math.abs(Math.sqrt(t)-1)>0.00674)a.j($.mG(),H.a([b-2,b,Math.sqrt(u.a)],[P.c]),u.b) +u.a=0}}return!0}, +$aY:function(){return[P.G]}} +F.e4.prototype={ +W:function(a,b,c,d){if(1d)a.j($.oJ(),H.a([b,d],[P.c]),this.a) +return!0}, +$aY:function(){return[P.w]}} +A.jP.prototype={ +b7:function(){var u,t,s,r,q,p,o,n,m,l,k,j,i=this,h=P.d,g=P.c,f=P.V(h,g),e=i.a +if(e!=null)f.l(0,"uri",e.k(0)) +e=i.c +u=e==null +if((u?null:e.a)!=null)f.l(0,"mimeType",u?null:e.a) +f.l(0,"validatorVersion","2.0.0-dev.3.2") +if(i.d)f.l(0,"validatedAt",new P.cm(Date.now(),!1).eo().en()) +e=i.b +t=e.fy +s=P.V(h,g) +r=H.a([0,0,0,0],[P.h]) +u=new Array(t.length) +u.fixed$length=Array +q=H.a(u,[[P.f,P.d,P.c]]) +for(u=q.length,p=0;p>>6}} +T.bO.prototype={ +cX:function(a){var u=a.a,t=this.a +t[15]=u[15] +t[14]=u[14] +t[13]=u[13] +t[12]=u[12] +t[11]=u[11] +t[10]=u[10] +t[9]=u[9] +t[8]=u[8] +t[7]=u[7] +t[6]=u[6] +t[5]=u[5] +t[4]=u[4] +t[3]=u[3] +t[2]=u[2] +t[1]=u[1] +t[0]=u[0]}, +k:function(a){var u=this +return"[0] "+u.aL(0).k(0)+"\n[1] "+u.aL(1).k(0)+"\n[2] "+u.aL(2).k(0)+"\n[3] "+u.aL(3).k(0)+"\n"}, +K:function(a,b){var u,t,s +if(b==null)return!1 +if(b instanceof T.bO){u=this.a +t=u[0] +s=b.a +u=t===s[0]&&u[1]===s[1]&&u[2]===s[2]&&u[3]===s[3]&&u[4]===s[4]&&u[5]===s[5]&&u[6]===s[6]&&u[7]===s[7]&&u[8]===s[8]&&u[9]===s[9]&&u[10]===s[10]&&u[11]===s[11]&&u[12]===s[12]&&u[13]===s[13]&&u[14]===s[14]&&u[15]===s[15]}else u=!1 +return u}, +gC:function(a){return A.mu(this.a)}, +aL:function(a){var u=new Float32Array(4),t=this.a +u[0]=t[a] +u[1]=t[4+a] +u[2]=t[8+a] +u[3]=t[12+a] +return new T.ds(u)}, +cu:function(){var u=this.a,t=u[0],s=u[5],r=u[1],q=u[4],p=t*s-r*q,o=u[6],n=u[2],m=t*o-n*q,l=u[7],k=u[3],j=t*l-k*q,i=r*o-n*s,h=r*l-k*s,g=n*l-k*o +o=u[8] +k=u[9] +l=u[10] +n=u[11] +return-(k*g-l*h+n*i)*u[12]+(o*g-l*j+n*m)*u[13]-(o*h-k*j+n*p)*u[14]+(o*i-k*m+l*p)*u[15]}, +cD:function(){var u=this.a,t=0+Math.abs(u[0])+Math.abs(u[1])+Math.abs(u[2])+Math.abs(u[3]),s=t>0?t:0 +t=0+Math.abs(u[4])+Math.abs(u[5])+Math.abs(u[6])+Math.abs(u[7]) +if(t>s)s=t +t=0+Math.abs(u[8])+Math.abs(u[9])+Math.abs(u[10])+Math.abs(u[11]) +if(t>s)s=t +t=0+Math.abs(u[12])+Math.abs(u[13])+Math.abs(u[14])+Math.abs(u[15]) +return t>s?t:s}, +cE:function(){var u=this.a +return u[0]===1&&u[1]===0&&u[2]===0&&u[3]===0&&u[4]===0&&u[5]===1&&u[6]===0&&u[7]===0&&u[8]===0&&u[9]===0&&u[10]===1&&u[11]===0&&u[12]===0&&u[13]===0&&u[14]===0&&u[15]===1}} +T.di.prototype={ +gaI:function(){var u=this.a,t=u[0],s=u[1],r=u[2],q=u[3] +return t*t+s*s+r*r+q*q}, +gh:function(a){var u=this.a,t=u[0],s=u[1],r=u[2],q=u[3] +return Math.sqrt(t*t+s*s+r*r+q*q)}, +k:function(a){var u=this.a +return H.b(u[0])+", "+H.b(u[1])+", "+H.b(u[2])+" @ "+H.b(u[3])}} +T.bh.prototype={ +be:function(a,b,c){var u=this.a +u[0]=a +u[1]=b +u[2]=c}, +k:function(a){var u=this.a +return"["+H.b(u[0])+","+H.b(u[1])+","+H.b(u[2])+"]"}, +K:function(a,b){var u,t,s +if(b==null)return!1 +if(b instanceof T.bh){u=this.a +t=u[0] +s=b.a +u=t===s[0]&&u[1]===s[1]&&u[2]===s[2]}else u=!1 +return u}, +gC:function(a){return A.mu(this.a)}, +gh:function(a){var u=this.a,t=u[0],s=u[1] +u=u[2] +return Math.sqrt(t*t+s*s+u*u)}, +gaI:function(){var u=this.a,t=u[0],s=u[1] +u=u[2] +return t*t+s*s+u*u}} +T.ds.prototype={ +k:function(a){var u=this.a +return H.b(u[0])+","+H.b(u[1])+","+H.b(u[2])+","+H.b(u[3])}, +K:function(a,b){var u,t,s +if(b==null)return!1 +if(b instanceof T.ds){u=this.a +t=u[0] +s=b.a +u=t===s[0]&&u[1]===s[1]&&u[2]===s[2]&&u[3]===s[3]}else u=!1 +return u}, +gC:function(a){return A.mu(this.a)}, +gh:function(a){var u=this.a,t=u[0],s=u[1],r=u[2] +u=u[3] +return Math.sqrt(t*t+s*s+r*r+u*u)}} +Q.dh.prototype={} +Q.m2.prototype={} +Q.dy.prototype={} +Q.lN.prototype={ +$3:function(a,b,c){var u=c.$1(J.aa(a)) +return u}} +Q.lJ.prototype={ +$2:function(a,b){var u=P.bm(new Q.lI(a,b,this.a)) +return new self.Promise(u)}, +$C:"$2", +$R:2} +Q.lI.prototype={ +$2:function(a,b){Q.dN(this.a,this.b).am(0,new Q.lF(a),new Q.lG(this.c,b),P.A)}, +$C:"$2", +$R:2} +Q.lF.prototype={ +$1:function(a){this.a.$1(P.mw(a))}} +Q.lG.prototype={ +$2:function(a,b){return this.a.$3(a,b,this.b)}, +$C:"$2", +$R:2, +$S:11} +Q.lK.prototype={ +$2:function(a,b){var u=P.bm(new Q.lH(a,b,this.a)) +return new self.Promise(u)}, +$C:"$2", +$R:2} +Q.lH.prototype={ +$2:function(a,b){Q.mA(this.a,this.b).am(0,new Q.lD(a),new Q.lE(this.c,b),P.A)}, +$C:"$2", +$R:2} +Q.lD.prototype={ +$1:function(a){this.a.$1(P.mw(a))}} +Q.lE.prototype={ +$2:function(a,b){return this.a.$3(a,b,this.b)}, +$C:"$2", +$R:2, +$S:11} +Q.lL.prototype={ +$0:function(){return"2.0.0-dev.3.2"}, +$C:"$0", +$R:0} +Q.lM.prototype={ +$0:function(){return P.mw(M.rc())}, +$C:"$0", +$R:0} +Q.lh.prototype={ +$1:function(a){var u=P.af,t=new P.E($.p,[u]),s=new P.aN(t,[u]) +J.qR(this.a.$1(J.aa(a)),P.bm(new Q.li(s)),P.bm(new Q.lj(s))) +return t}} +Q.li.prototype={ +$1:function(a){var u=this.a +if(!!J.m(a).$iaf)u.Z(a) +else u.L(new P.ab(!1,null,null,"options.externalResourceFunction: Promise must be fulfilled with Uint8Array."))}, +$S:6} +Q.lj.prototype={ +$1:function(a){return this.a.L(new Q.i2(J.aa(a)))}, +$S:5} +Q.lf.prototype={ +$1:function(a){if(a==null)return this.a.c +return this.b.$1(a)}, +$0:function(){return this.$1(null)}, +$C:"$1", +$R:0, +$D:function(){return[null]}} +Q.lg.prototype={ +$1:function(a){var u=this.a.$1(a) +return u==null?null:P.rU(u,H.i(u,0))}} +Q.i2.prototype={ +k:function(a){return"Node Exception: "+H.b(this.a)}, +$iar:1};(function aliases(){var u=J.bD.prototype +u.cZ=u.b6 +u=J.da.prototype +u.d_=u.k +u=P.J.prototype +u.d0=u.a_ +u=P.dD.prototype +u.d1=u.a1})();(function installTearOffs(){var u=hunkHelpers._static_1,t=hunkHelpers._static_0,s=hunkHelpers.installStaticTearOff,r=hunkHelpers.installInstanceTearOff,q=hunkHelpers._instance_0u,p=hunkHelpers._instance_1i,o=hunkHelpers._static_2,n=hunkHelpers._instance_1u +u(P,"tT","t4",1) +u(P,"tU","t5",1) +u(P,"tV","t6",1) +t(P,"o7","tJ",0) +s(P,"tW",1,null,["$2","$1"],["nX",function(a){return P.nX(a,null)}],13,0) +r(P.E.prototype,"gdc",0,1,function(){return[null]},["$2","$1"],["ao","dd"],13,0) +q(P.dB.prototype,"gdQ","a1",48) +var m +q(m=P.dw.prototype,"gcc","aV",0) +q(m,"gcd","aW",0) +r(m=P.cF.prototype,"geb",0,0,null,["$1","$0"],["cK","aK"],47,0) +q(m,"gee","al",0) +q(m,"gcc","aV",0) +q(m,"gcd","aW",0) +p(P.c2.prototype,"gcq","D",21) +o(M,"tP","qW",23) +o(M,"tO","qV",24) +o(M,"tM","qT",25) +o(M,"tN","qU",26) +n(M.Q.prototype,"gbI","ea",15) +o(Z,"tR","qY",27) +o(Z,"tQ","qX",28) +o(T,"tS","r_",29) +o(Q,"tX","r1",30) +o(V,"tY","r0",31) +o(G,"u0","r4",32) +o(G,"tZ","r2",33) +o(G,"u_","r3",34) +o(T,"uc","rm",35) +o(Y,"ur","rz",55) +o(Y,"uu","rI",37) +o(Y,"ut","rH",38) +o(Y,"us","rG",39) +o(Y,"dL","rW",40) +o(S,"uv","rC",41) +o(V,"ux","rF",42) +o(T,"uy","rR",43) +o(B,"uz","rS",44) +o(O,"uA","rT",45) +o(U,"uC","rX",46) +u(E,"bn","tG",10) +u(E,"o9","tD",10) +u(D,"u5","tA",9) +o(D,"u4","rf",49) +o(X,"ui","rs",50) +o(X,"uj","rt",51) +o(X,"uk","ru",52) +o(A,"ul","rv",53) +o(S,"um","rw",54) +o(L,"uo","rx",36) +n(m=A.d3.prototype,"gdl","dm",12) +q(m,"gdn","dq",0) +n(m,"gc7","dr",5) +n(m=K.cp.prototype,"gdu","dv",12) +n(m,"gdA","dB",5) +q(m,"gdw","dz",0) +u(U,"un","tB",9)})();(function inheritance(){var u=hunkHelpers.mixin,t=hunkHelpers.inherit,s=hunkHelpers.inheritMany +t(P.c,null) +s(P.c,[H.m5,J.bD,J.bu,P.t,H.e1,P.a7,H.ck,P.dz,H.aJ,P.Z,H.eR,H.d2,H.jF,H.cD,P.hD,H.e7,H.fH,H.jz,P.b3,H.co,H.dA,H.dn,H.hw,H.hx,H.fJ,H.kM,P.l0,P.k4,P.c1,P.bj,P.R,P.kf,P.cH,P.E,P.du,P.jn,P.jo,P.dB,P.l_,P.k9,P.cF,P.kN,P.kj,P.ki,P.kY,P.bw,P.l6,P.kD,P.kS,P.kK,P.kL,P.J,P.l2,P.jv,P.e5,P.ka,P.e3,P.dH,P.aT,P.cm,P.G,P.i7,P.dm,P.kl,P.ak,P.bB,P.l,P.f,P.cv,P.A,P.a1,P.d,P.N,P.me,P.bV,P.ah,P.bY,P.dG,P.jH,P.kU,P.af,V.fc,F.Y,V.cB,V.b0,V.aY,V.k,M.jO,M.j,M.bF,Y.cI,Y.cG,Y.bZ,Y.b4,Y.bC,Y.ft,Y.dr,Y.dp,Y.as,N.c3,N.dj,N.ie,O.d7,E.aL,E.fD,E.bE,D.aj,D.a_,D.bA,D.cu,D.dk,A.d3,K.ac,K.cq,K.cp,K.d5,A.jP,T.bO,T.di,T.bh,T.ds,Q.i2]) +s(J.bD,[J.d8,J.fI,J.da,J.b6,J.cs,J.bG,H.cz]) +s(J.da,[J.i8,J.bW,J.b7,Q.dh,Q.m2,Q.dy]) +t(J.m4,J.b6) +s(J.cs,[J.d9,J.fG]) +s(P.t,[H.kd,H.B,H.cw,H.mh,H.cC,H.kg,P.fE]) +s(H.kd,[H.cY,H.dI]) +t(H.kk,H.cY) +t(H.ke,H.dI) +t(H.cj,H.ke) +t(P.hA,P.a7) +s(P.hA,[H.cZ,H.bH,P.kB,P.kI]) +s(H.ck,[H.e2,H.ib,H.lP,H.jy,H.fN,H.lz,H.lA,H.lB,P.k6,P.k5,P.k7,P.k8,P.l1,P.l7,P.l8,P.ln,P.km,P.ku,P.kq,P.kr,P.ks,P.ko,P.kt,P.kn,P.kx,P.ky,P.kw,P.kv,P.jp,P.jq,P.jr,P.js,P.jt,P.kW,P.kV,P.kc,P.kb,P.kO,P.ll,P.kR,P.kQ,P.hB,P.hC,P.i1,P.jJ,P.jK,P.jL,P.l4,P.lc,P.lb,P.ld,P.le,P.l9,M.k0,M.k1,M.k2,M.k3,M.jZ,M.k_,M.jU,M.jV,M.jW,M.jX,Z.dU,Z.dV,V.fn,V.fo,V.fp,V.fl,V.fm,V.fj,V.fk,V.fh,V.fi,V.fq,V.fr,Y.hF,S.hR,S.hI,S.hJ,S.hK,S.hM,S.hN,S.hO,S.hP,S.hQ,S.hL,V.i3,V.i4,V.i5,B.ij,O.jk,M.ea,M.e9,M.eb,M.ee,M.ef,M.ec,M.ed,M.eg,Y.fv,Y.fx,Y.fw,Y.fu,Y.fM,Y.fL,Y.ia,N.ig,N.ih,O.lQ,O.lR,O.lS,O.lm,E.et,E.er,E.eq,E.ey,E.ev,E.ew,E.eu,E.eH,E.eJ,E.eA,E.eG,E.ez,E.eF,E.eD,E.eE,E.eC,E.eB,E.eM,E.eL,E.eK,E.eQ,E.eP,E.en,E.eo,E.ep,E.eO,E.eN,E.es,E.eI,E.ex,E.em,E.ek,E.el,E.fC,E.iv,E.iw,E.iB,E.iz,E.it,E.ip,E.ix,E.iq,E.iA,E.il,E.iu,E.io,E.ir,E.im,E.iy,E.is,E.j9,E.j8,E.iZ,E.iX,E.iY,E.iW,E.iU,E.iV,E.j4,E.j5,E.iT,E.iS,E.iR,E.iP,E.iO,E.iM,E.iG,E.jj,E.ji,E.iL,E.iI,E.iK,E.iH,E.iJ,E.jh,E.jf,E.jb,E.j0,E.jg,E.ja,E.jc,E.jd,E.je,E.j3,E.j2,E.j1,E.j_,E.j7,E.j6,E.iN,E.iE,E.iD,E.iQ,E.iF,E.hq,E.hu,E.hg,E.h2,E.hv,E.fZ,E.fY,E.h0,E.h1,E.fX,E.h_,E.fW,E.h5,E.h3,E.ht,E.hm,E.h7,E.h8,E.h4,E.h6,E.he,E.hd,E.hc,E.hb,E.hf,E.ha,E.h9,E.hs,E.hh,E.hk,E.hj,E.hi,E.hl,E.hn,E.fV,E.fU,E.fT,E.ho,E.hp,E.hr,E.eZ,E.eY,E.eX,E.f6,E.eV,E.f5,E.f1,E.f2,E.eW,E.eU,E.f_,E.f4,E.f3,E.f0,X.fR,A.f9,A.f7,A.f8,K.fe,K.ff,K.fd,K.fg,K.fb,F.lr,F.ls,F.lt,F.lq,A.jR,A.jQ,A.lx,Q.lN,Q.lJ,Q.lI,Q.lF,Q.lG,Q.lK,Q.lH,Q.lD,Q.lE,Q.lL,Q.lM,Q.lh,Q.li,Q.lj,Q.lf,Q.lg]) +t(P.hy,P.dz) +s(P.hy,[H.dq,F.ae]) +s(H.dq,[H.cl,P.bX]) +s(H.B,[H.av,H.d1,H.b9,P.kC,P.dl]) +s(H.av,[H.jw,H.aw,P.kJ,P.kA]) +t(H.d_,H.cw) +s(P.Z,[H.bN,H.dt,H.jl]) +t(H.d0,H.cC) +t(P.dF,P.hD) +t(P.cE,P.dF) +t(H.e8,P.cE) +s(H.e7,[H.b2,H.aI]) +s(P.b3,[H.i6,H.fO,H.jE,H.e0,H.ii,P.cA,P.ab,P.i0,P.jG,P.jB,P.be,P.e6,P.ei]) +s(H.jy,[H.jm,H.ch]) +t(H.dc,H.cz) +s(H.dc,[H.cJ,H.cL]) +t(H.cK,H.cJ) +t(H.dd,H.cK) +t(H.cM,H.cL) +t(H.cy,H.cM) +s(H.dd,[H.db,H.hV]) +s(H.cy,[H.hW,H.hX,H.hY,H.hZ,H.i_,H.de,H.bP]) +t(P.kZ,P.fE) +t(P.aN,P.kf) +s(P.dB,[P.dv,P.dE]) +t(P.kX,P.jn) +s(P.kX,[P.bi,P.kz]) +t(P.dw,P.cF) +s(P.kN,[P.kF,P.dC]) +s(P.kj,[P.c_,P.dx]) +t(P.kP,P.l6) +t(P.kE,P.kB) +s(P.kS,[P.c2,P.l3]) +t(P.ju,P.jv) +t(P.dD,P.ju) +t(P.kH,P.dD) +s(P.e5,[P.dW,P.eS,P.fP]) +t(P.eh,P.jo) +s(P.eh,[P.dY,P.dX,P.fQ,P.jN]) +s(P.e3,[P.e_,P.kT]) +t(P.l5,P.e_) +t(P.jM,P.eS) +s(P.G,[P.w,P.h]) +s(P.ab,[P.bU,P.fz]) +t(P.kh,P.dG) +s(V.fc,[V.fa,M.bq,M.br,M.bs,Z.cf,Z.bt,Z.cg,T.bv,G.bx,G.by,V.d4,Y.bS,Y.bg,S.cx,D.bz,X.b8,X.bI,X.bJ,A.bK,S.bL,L.bM]) +s(V.fa,[M.Q,Z.aZ,Q.b_,V.aH,G.b1,T.b5,Y.ax,S.ba,V.ad,T.bc,B.aK,O.bd,U.bf,X.ct]) +s(M.Q,[M.jY,M.jT]) +s(F.Y,[M.fA,M.hS,M.hG,M.hT,M.hH,Z.dT,Z.ic,S.fy,O.fs,F.jC,F.jD,F.e4]) +s(Y.bg,[Y.bR,Y.bQ]) +s(Y.ft,[Y.fK,Y.i9,Y.jS]) +s(E.fD,[E.ej,E.fB,E.ik,E.iC,E.fS,E.eT]) +u(H.dq,H.jF) +u(H.dI,P.J) +u(H.cJ,P.J) +u(H.cK,H.d2) +u(H.cL,P.J) +u(H.cM,H.d2) +u(P.dv,P.k9) +u(P.dE,P.l_) +u(P.dz,P.J) +u(P.dF,P.l2)})() +var v={mangledGlobalNames:{h:"int",w:"double",G:"num",d:"String",aT:"bool",A:"Null",l:"List"},mangledNames:{},getTypeFromName:getGlobalFromName,metadata:[],types:[{func:1,ret:-1},{func:1,ret:-1,args:[{func:1,ret:-1}]},{func:1,ret:P.w,args:[P.h]},{func:1,ret:P.aT,args:[P.h]},{func:1,args:[,]},{func:1,ret:-1,args:[P.c]},{func:1,ret:P.A,args:[P.c]},{func:1,ret:P.A,args:[,,]},{func:1,ret:P.A,args:[,]},{func:1,ret:-1,args:[M.j]},{func:1,ret:P.d,args:[P.c]},{func:1,ret:-1,args:[P.c,P.a1]},{func:1,ret:-1,args:[[P.l,P.h]]},{func:1,ret:-1,args:[P.c],opt:[P.a1]},{func:1,ret:P.h,args:[P.h]},{func:1,ret:P.w,args:[P.G]},{func:1,ret:-1,args:[,]},{func:1,ret:P.A,args:[,P.a1]},{func:1,ret:P.af,args:[,,]},{func:1,ret:P.af,args:[P.h]},{func:1,ret:P.A,args:[,],opt:[P.a1]},{func:1,ret:P.aT,args:[P.c]},{func:1,ret:[P.E,,],args:[,]},{func:1,ret:[M.Q,P.G],args:[[P.f,P.d,P.c],M.j]},{func:1,ret:M.bq,args:[[P.f,P.d,P.c],M.j]},{func:1,ret:M.br,args:[[P.f,P.d,P.c],M.j]},{func:1,ret:M.bs,args:[[P.f,P.d,P.c],M.j]},{func:1,ret:Z.aZ,args:[[P.f,P.d,P.c],M.j]},{func:1,ret:Z.bt,args:[[P.f,P.d,P.c],M.j]},{func:1,ret:T.bv,args:[[P.f,P.d,P.c],M.j]},{func:1,ret:Q.b_,args:[[P.f,P.d,P.c],M.j]},{func:1,ret:V.aH,args:[[P.f,P.d,P.c],M.j]},{func:1,ret:G.b1,args:[[P.f,P.d,P.c],M.j]},{func:1,ret:G.bx,args:[[P.f,P.d,P.c],M.j]},{func:1,ret:G.by,args:[[P.f,P.d,P.c],M.j]},{func:1,ret:T.b5,args:[[P.f,P.d,P.c],M.j]},{func:1,ret:L.bM,args:[[P.f,P.d,P.c],M.j]},{func:1,ret:Y.bS,args:[[P.f,P.d,P.c],M.j]},{func:1,ret:Y.bR,args:[[P.f,P.d,P.c],M.j]},{func:1,ret:Y.bQ,args:[[P.f,P.d,P.c],M.j]},{func:1,ret:Y.bg,args:[[P.f,P.d,P.c],M.j]},{func:1,ret:S.ba,args:[[P.f,P.d,P.c],M.j]},{func:1,ret:V.ad,args:[[P.f,P.d,P.c],M.j]},{func:1,ret:T.bc,args:[[P.f,P.d,P.c],M.j]},{func:1,ret:B.aK,args:[[P.f,P.d,P.c],M.j]},{func:1,ret:O.bd,args:[[P.f,P.d,P.c],M.j]},{func:1,ret:U.bf,args:[[P.f,P.d,P.c],M.j]},{func:1,ret:-1,opt:[[P.R,,]]},{func:1,ret:[P.R,,]},{func:1,ret:D.bz,args:[[P.f,P.d,P.c],M.j]},{func:1,ret:X.b8,args:[[P.f,P.d,P.c],M.j]},{func:1,ret:X.bI,args:[[P.f,P.d,P.c],M.j]},{func:1,ret:X.bJ,args:[[P.f,P.d,P.c],M.j]},{func:1,ret:A.bK,args:[[P.f,P.d,P.c],M.j]},{func:1,ret:S.bL,args:[[P.f,P.d,P.c],M.j]},{func:1,ret:Y.ax,args:[[P.f,P.d,P.c],M.j]}],interceptorsByTag:null,leafTags:null};(function constants(){var u=hunkHelpers.makeConstList +C.bp=J.bD.prototype +C.d=J.b6.prototype +C.bt=J.d8.prototype +C.c=J.d9.prototype +C.bu=J.cs.prototype +C.a=J.bG.prototype +C.bv=J.b7.prototype +C.cP=H.db.prototype +C.i=H.bP.prototype +C.ao=J.i8.prototype +C.O=J.bW.prototype +C.P=new V.k("MAT4",5126,!1) +C.A=new V.k("SCALAR",5126,!1) +C.aO=new V.k("VEC2",5121,!0) +C.aS=new V.k("VEC2",5123,!0) +C.aT=new V.k("VEC2",5126,!1) +C.R=new V.k("VEC3",5121,!0) +C.T=new V.k("VEC3",5123,!0) +C.j=new V.k("VEC3",5126,!1) +C.aW=new V.k("VEC4",5121,!1) +C.D=new V.k("VEC4",5121,!0) +C.aX=new V.k("VEC4",5123,!1) +C.E=new V.k("VEC4",5123,!0) +C.u=new V.k("VEC4",5126,!1) +C.aY=new V.aY("AnimationInput") +C.aZ=new V.aY("AnimationOutput") +C.b_=new V.aY("IBM") +C.b0=new V.aY("PrimitiveIndices") +C.W=new V.aY("VertexAttribute") +C.b1=new V.b0("IBM") +C.b2=new V.b0("Image") +C.X=new V.b0("IndexBuffer") +C.v=new V.b0("Other") +C.Y=new V.b0("VertexBuffer") +C.di=new P.dY() +C.b3=new P.dW() +C.b4=new P.dX() +C.Z=new H.eR([P.A]) +C.a_=new K.d5() +C.b5=new M.bF() +C.a0=function getTagFallback(o) { + var s = Object.prototype.toString.call(o); + return s.substring(8, s.length - 1); +} +C.b6=function() { + var toStringFunction = Object.prototype.toString; + function getTag(o) { + var s = toStringFunction.call(o); + return s.substring(8, s.length - 1); + } + function getUnknownTag(object, tag) { + if (/^HTML[A-Z].*Element$/.test(tag)) { + var name = toStringFunction.call(object); + if (name == "[object Object]") return null; + return "HTMLElement"; + } + } + function getUnknownTagGenericBrowser(object, tag) { + if (self.HTMLElement && object instanceof HTMLElement) return "HTMLElement"; + return getUnknownTag(object, tag); + } + function prototypeForTag(tag) { + if (typeof window == "undefined") return null; + if (typeof window[tag] == "undefined") return null; + var constructor = window[tag]; + if (typeof constructor != "function") return null; + return constructor.prototype; + } + function discriminator(tag) { return null; } + var isBrowser = typeof navigator == "object"; + return { + getTag: getTag, + getUnknownTag: isBrowser ? getUnknownTagGenericBrowser : getUnknownTag, + prototypeForTag: prototypeForTag, + discriminator: discriminator }; +} +C.bb=function(getTagFallback) { + return function(hooks) { + if (typeof navigator != "object") return hooks; + var ua = navigator.userAgent; + if (ua.indexOf("DumpRenderTree") >= 0) return hooks; + if (ua.indexOf("Chrome") >= 0) { + function confirm(p) { + return typeof window == "object" && window[p] && window[p].name == p; + } + if (confirm("Window") && confirm("HTMLElement")) return hooks; + } + hooks.getTag = getTagFallback; + }; +} +C.b7=function(hooks) { + if (typeof dartExperimentalFixupGetTag != "function") return hooks; + hooks.getTag = dartExperimentalFixupGetTag(hooks.getTag); +} +C.b8=function(hooks) { + var getTag = hooks.getTag; + var prototypeForTag = hooks.prototypeForTag; + function getTagFixed(o) { + var tag = getTag(o); + if (tag == "Document") { + if (!!o.xmlVersion) return "!Document"; + return "!HTMLDocument"; + } + return tag; + } + function prototypeForTagFixed(tag) { + if (tag == "Document") return null; + return prototypeForTag(tag); + } + hooks.getTag = getTagFixed; + hooks.prototypeForTag = prototypeForTagFixed; +} +C.ba=function(hooks) { + var userAgent = typeof navigator == "object" ? navigator.userAgent : ""; + if (userAgent.indexOf("Firefox") == -1) return hooks; + var getTag = hooks.getTag; + var quickMap = { + "BeforeUnloadEvent": "Event", + "DataTransfer": "Clipboard", + "GeoGeolocation": "Geolocation", + "Location": "!Location", + "WorkerMessageEvent": "MessageEvent", + "XMLDocument": "!Document"}; + function getTagFirefox(o) { + var tag = getTag(o); + return quickMap[tag] || tag; + } + hooks.getTag = getTagFirefox; +} +C.b9=function(hooks) { + var userAgent = typeof navigator == "object" ? navigator.userAgent : ""; + if (userAgent.indexOf("Trident/") == -1) return hooks; + var getTag = hooks.getTag; + var quickMap = { + "BeforeUnloadEvent": "Event", + "DataTransfer": "Clipboard", + "HTMLDDElement": "HTMLElement", + "HTMLDTElement": "HTMLElement", + "HTMLPhraseElement": "HTMLElement", + "Position": "Geoposition" + }; + function getTagIE(o) { + var tag = getTag(o); + var newTag = quickMap[tag]; + if (newTag) return newTag; + if (tag == "Object") { + if (window.DataView && (o instanceof window.DataView)) return "DataView"; + } + return tag; + } + function prototypeForTagIE(tag) { + var constructor = window[tag]; + if (constructor == null) return null; + return constructor.prototype; + } + hooks.getTag = getTagIE; + hooks.prototypeForTag = prototypeForTagIE; +} +C.a1=function(hooks) { return hooks; } + +C.a2=new P.fP() +C.bc=new P.i7() +C.a3=new Y.dp() +C.bd=new Y.dr() +C.a4=new P.jM() +C.F=new P.ki() +C.f=new P.kP() +C.H=new Y.b4(0,"Format.Unknown") +C.m=new Y.b4(1,"Format.RGB") +C.w=new Y.b4(2,"Format.RGBA") +C.a5=new Y.b4(3,"Format.Luminance") +C.a6=new Y.b4(4,"Format.LuminanceAlpha") +C.a7=new Y.as("Wrong WebP header.") +C.bq=new Y.as("PNG header not found.") +C.br=new Y.as("Invalid JPEG marker segment length.") +C.n=new Y.as("Wrong chunk length.") +C.bs=new Y.as("Invalid start of file.") +C.bw=new P.fQ(null) +C.bx=H.a(u([0,0]),[P.w]) +C.by=H.a(u([0,0,0]),[P.w]) +C.bz=H.a(u([127,2047,65535,1114111]),[P.h]) +C.bA=H.a(u([16]),[P.h]) +C.bB=H.a(u([1,1]),[P.w]) +C.a8=H.a(u([1,1,1]),[P.w]) +C.a9=H.a(u([1,1,1,1]),[P.w]) +C.aa=H.a(u([2]),[P.h]) +C.bC=H.a(u([255,216]),[P.h]) +C.ab=H.a(u([0,0,32776,33792,1,10240,0,0]),[P.h]) +C.bE=H.a(u([137,80,78,71,13,10,26,10]),[P.h]) +C.N=H.v(U.bf) +C.be=new D.a_(D.u4()) +C.cN=new H.aI([C.N,C.be],[P.ah,D.a_]) +C.bk=new D.aj("EXT_texture_webp",C.cN,D.u5(),!1) +C.ar=H.v(V.d4) +C.M=H.v(V.ad) +C.bf=new D.a_(X.ui()) +C.bg=new D.a_(X.uk()) +C.cL=new H.aI([C.ar,C.bf,C.M,C.bg],[P.ah,D.a_]) +C.bn=new D.aj("KHR_lights_punctual",C.cL,null,!1) +C.l=H.v(Y.ax) +C.bh=new D.a_(A.ul()) +C.cI=new H.aI([C.l,C.bh],[P.ah,D.a_]) +C.bm=new D.aj("KHR_materials_pbrSpecularGlossiness",C.cI,null,!1) +C.bi=new D.a_(S.um()) +C.cJ=new H.aI([C.l,C.bi],[P.ah,D.a_]) +C.bj=new D.aj("KHR_materials_unlit",C.cJ,null,!1) +C.c9=H.a(u([]),[P.ah]) +C.cO=new H.b2(0,{},C.c9,[P.ah,D.a_]) +C.bo=new D.aj("KHR_mesh_quantization",C.cO,U.un(),!0) +C.ay=H.v(Y.bg) +C.au=H.v(Y.bQ) +C.av=H.v(Y.bR) +C.G=new D.a_(L.uo()) +C.cM=new H.aI([C.ay,C.G,C.au,C.G,C.av,C.G],[P.ah,D.a_]) +C.bl=new D.aj("KHR_texture_transform",C.cM,null,!1) +C.I=H.a(u([C.bk,C.bn,C.bm,C.bj,C.bo,C.bl]),[D.aj]) +C.o=H.a(u([3]),[P.h]) +C.ac=H.a(u([33071,33648,10497]),[P.h]) +C.bF=H.a(u([34962,34963]),[P.h]) +C.J=H.a(u([4]),[P.h]) +C.aL=new V.k("VEC2",5120,!1) +C.aM=new V.k("VEC2",5120,!0) +C.aN=new V.k("VEC2",5121,!1) +C.aP=new V.k("VEC2",5122,!1) +C.aQ=new V.k("VEC2",5122,!0) +C.aR=new V.k("VEC2",5123,!1) +C.bG=H.a(u([C.aL,C.aM,C.aN,C.aP,C.aQ,C.aR]),[V.k]) +C.bH=H.a(u([5121,5123,5125]),[P.h]) +C.ad=H.a(u(["image/jpeg","image/png"]),[P.d]) +C.bI=H.a(u([82,73,70,70]),[P.h]) +C.bJ=H.a(u([9728,9729]),[P.h]) +C.aF=new V.k("SCALAR",5121,!1) +C.aI=new V.k("SCALAR",5123,!1) +C.aK=new V.k("SCALAR",5125,!1) +C.ae=H.a(u([C.aF,C.aI,C.aK]),[V.k]) +C.bM=H.a(u(["camera","children","skin","matrix","mesh","rotation","scale","translation","weights","name"]),[P.d]) +C.bN=H.a(u([9728,9729,9984,9985,9986,9987]),[P.h]) +C.bO=H.a(u(["COLOR","JOINTS","TEXCOORD","WEIGHTS"]),[P.d]) +C.x=H.a(u([0,0,65490,45055,65535,34815,65534,18431]),[P.h]) +C.bP=H.a(u(["color","intensity","spot","type","range","name"]),[P.d]) +C.bQ=H.a(u(["buffer","byteOffset","byteLength","byteStride","target","name"]),[P.d]) +C.ag=H.a(u([0,0,26624,1023,65534,2047,65534,2047]),[P.h]) +C.bR=H.a(u(["LINEAR","STEP","CUBICSPLINE"]),[P.d]) +C.bS=H.a(u(["OPAQUE","MASK","BLEND"]),[P.d]) +C.bT=H.a(u(["pbrMetallicRoughness","normalTexture","occlusionTexture","emissiveTexture","emissiveFactor","alphaMode","alphaCutoff","doubleSided","name"]),[P.d]) +C.bU=H.a(u([5120,5121,5122,5123,5125,5126]),[P.h]) +C.bV=H.a(u(["inverseBindMatrices","skeleton","joints","name"]),[P.d]) +C.Q=new V.k("VEC3",5120,!1) +C.B=new V.k("VEC3",5120,!0) +C.S=new V.k("VEC3",5122,!1) +C.C=new V.k("VEC3",5122,!0) +C.bW=H.a(u([C.Q,C.B,C.S,C.C]),[V.k]) +C.bX=H.a(u(["data-uri","buffer-view","glb","external"]),[P.d]) +C.bY=H.a(u(["POINTS","LINES","LINE_LOOP","LINE_STRIP","TRIANGLES","TRIANGLE_STRIP","TRIANGLE_FAN"]),[P.d]) +C.bZ=H.a(u(["bufferView","byteOffset","componentType"]),[P.d]) +C.K=H.a(u([C.B,C.C]),[V.k]) +C.c_=H.a(u(["aspectRatio","yfov","zfar","znear"]),[P.d]) +C.c0=H.a(u(["copyright","generator","version","minVersion"]),[P.d]) +C.c1=H.a(u(["bufferView","byteOffset"]),[P.d]) +C.c2=H.a(u(["bufferView","mimeType","uri","name"]),[P.d]) +C.c3=H.a(u(["channels","samplers","name"]),[P.d]) +C.c4=H.a(u(["baseColorFactor","baseColorTexture","metallicFactor","roughnessFactor","metallicRoughnessTexture"]),[P.d]) +C.c5=H.a(u(["count","indices","values"]),[P.d]) +C.c6=H.a(u(["diffuseFactor","diffuseTexture","specularFactor","glossinessFactor","specularGlossinessTexture"]),[P.d]) +C.c7=H.a(u(["directional","point","spot"]),[P.d]) +C.c8=H.a(u([]),[P.d]) +C.ah=u([]) +C.cb=H.a(u(["extensions","extras"]),[P.d]) +C.cc=H.a(u([0,0,32722,12287,65534,34815,65534,18431]),[P.h]) +C.ce=H.a(u(["index","texCoord"]),[P.d]) +C.cf=H.a(u(["index","texCoord","scale"]),[P.d]) +C.cg=H.a(u(["index","texCoord","strength"]),[P.d]) +C.ch=H.a(u(["innerConeAngle","outerConeAngle"]),[P.d]) +C.ci=H.a(u(["input","interpolation","output"]),[P.d]) +C.cj=H.a(u(["attributes","indices","material","mode","targets"]),[P.d]) +C.ck=H.a(u(["bufferView","byteOffset","componentType","count","type","normalized","max","min","sparse","name"]),[P.d]) +C.cl=H.a(u(["light"]),[P.d]) +C.cm=H.a(u(["lights"]),[P.d]) +C.cn=H.a(u(["node","path"]),[P.d]) +C.co=H.a(u(["nodes","name"]),[P.d]) +C.cp=H.a(u([null,"linear","srgb","custom"]),[P.d]) +C.cq=H.a(u([null,"srgb","custom"]),[P.d]) +C.ai=H.a(u([0,0,24576,1023,65534,34815,65534,18431]),[P.h]) +C.cr=H.a(u(["image/webp"]),[P.d]) +C.cs=H.a(u(["offset","rotation","scale","texCoord"]),[P.d]) +C.aj=H.a(u(["orthographic","perspective"]),[P.d]) +C.ct=H.a(u(["primitives","weights","name"]),[P.d]) +C.b=new E.aL(0,"Severity.Error") +C.e=new E.aL(1,"Severity.Warning") +C.h=new E.aL(2,"Severity.Information") +C.cR=new E.aL(3,"Severity.Hint") +C.cu=H.a(u([C.b,C.e,C.h,C.cR]),[E.aL]) +C.cv=H.a(u([0,0,32754,11263,65534,34815,65534,18431]),[P.h]) +C.cw=H.a(u(["magFilter","minFilter","wrapS","wrapT","name"]),[P.d]) +C.cx=H.a(u([null,"rgb","rgba","luminance","luminance-alpha"]),[P.d]) +C.ak=H.a(u([0,0,65490,12287,65535,34815,65534,18431]),[P.h]) +C.cy=H.a(u(["sampler","source","name"]),[P.d]) +C.cz=H.a(u(["source"]),[P.d]) +C.aU=new V.k("VEC3",5121,!1) +C.aV=new V.k("VEC3",5123,!1) +C.cA=H.a(u([C.Q,C.B,C.aU,C.R,C.S,C.C,C.aV,C.T]),[V.k]) +C.cB=H.a(u(["target","sampler"]),[P.d]) +C.al=H.a(u(["translation","rotation","scale","weights"]),[P.d]) +C.cC=H.a(u(["type","orthographic","perspective","name"]),[P.d]) +C.cD=H.a(u(["uri","byteLength","name"]),[P.d]) +C.cE=H.a(u(["xmag","ymag","zfar","znear"]),[P.d]) +C.cF=H.a(u(["extensionsUsed","extensionsRequired","accessors","animations","asset","buffers","bufferViews","cameras","images","materials","meshes","nodes","samplers","scene","scenes","skins","textures"]),[P.d]) +C.U=new V.k("VEC4",5120,!0) +C.V=new V.k("VEC4",5122,!0) +C.cG=H.a(u([C.U,C.V]),[V.k]) +C.af=H.a(u([C.j]),[V.k]) +C.bD=H.a(u([C.u,C.D,C.U,C.E,C.V]),[V.k]) +C.aG=new V.k("SCALAR",5121,!0) +C.aE=new V.k("SCALAR",5120,!0) +C.aJ=new V.k("SCALAR",5123,!0) +C.aH=new V.k("SCALAR",5122,!0) +C.cd=H.a(u([C.A,C.aG,C.aE,C.aJ,C.aH]),[V.k]) +C.cH=new H.b2(4,{translation:C.af,rotation:C.bD,scale:C.af,weights:C.cd},C.al,[P.d,[P.l,V.k]]) +C.bK=H.a(u(["SCALAR","VEC2","VEC3","VEC4","MAT2","MAT3","MAT4"]),[P.d]) +C.k=new H.b2(7,{SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},C.bK,[P.d,P.h]) +C.am=new H.aI([5120,"BYTE",5121,"UNSIGNED_BYTE",5122,"SHORT",5123,"UNSIGNED_SHORT",5124,"INT",5125,"UNSIGNED_INT",5126,"FLOAT",35664,"FLOAT_VEC2",35665,"FLOAT_VEC3",35666,"FLOAT_VEC4",35667,"INT_VEC2",35668,"INT_VEC3",35669,"INT_VEC4",35670,"BOOL",35671,"BOOL_VEC2",35672,"BOOL_VEC3",35673,"BOOL_VEC4",35674,"FLOAT_MAT2",35675,"FLOAT_MAT3",35676,"FLOAT_MAT4",35678,"SAMPLER_2D"],[P.h,P.d]) +C.ca=H.a(u([]),[P.bV]) +C.an=new H.b2(0,{},C.ca,[P.bV,null]) +C.bL=H.a(u(["KHR","EXT","ADOBE","AGI","AGT","ALCM","ALI","AMZN","AVR","BLENDER","CAPTURE","CESIUM","CVTOOLS","FB","FOXIT","GOOGLE","KDAB","LLQ","MESHOPT","MOZ","MSFT","NV","OWLII","POLUTROPON","S8S","SI","SKFB","SKYLINE","WEB3D"]),[P.d]) +C.cK=new H.b2(29,{KHR:null,EXT:null,ADOBE:null,AGI:null,AGT:null,ALCM:null,ALI:null,AMZN:null,AVR:null,BLENDER:null,CAPTURE:null,CESIUM:null,CVTOOLS:null,FB:null,FOXIT:null,GOOGLE:null,KDAB:null,LLQ:null,MESHOPT:null,MOZ:null,MSFT:null,NV:null,OWLII:null,POLUTROPON:null,S8S:null,SI:null,SKFB:null,SKYLINE:null,WEB3D:null},C.bL,[P.d,P.A]) +C.cQ=new P.l3(C.cK,[P.d]) +C.cS=new H.cD("call") +C.cT=H.v(M.br) +C.cU=H.v(M.bs) +C.cV=H.v(M.bq) +C.L=H.v([M.Q,P.G]) +C.cW=H.v(Z.bt) +C.cX=H.v(Z.cf) +C.cY=H.v(Z.cg) +C.ap=H.v(Z.aZ) +C.cZ=H.v(T.bv) +C.aq=H.v(V.aH) +C.d_=H.v(Q.b_) +C.d0=H.v(G.bx) +C.d1=H.v(G.by) +C.d2=H.v(G.b1) +C.d3=H.v(A.bK) +C.d4=H.v(D.bz) +C.as=H.v(T.b5) +C.d5=H.v(X.b8) +C.d6=H.v(X.bI) +C.d7=H.v(X.ct) +C.d8=H.v(X.bJ) +C.d9=H.v(S.bL) +C.da=H.v(L.bM) +C.db=H.v(S.cx) +C.at=H.v(S.ba) +C.dc=H.v(Y.bS) +C.dd=H.v(T.bc) +C.aw=H.v(B.aK) +C.ax=H.v(O.bd) +C.p=new Y.cG(0,"_ColorPrimaries.Unknown") +C.q=new Y.cG(1,"_ColorPrimaries.sRGB") +C.y=new Y.cG(2,"_ColorPrimaries.Custom") +C.r=new Y.bZ(0,"_ColorTransfer.Unknown") +C.de=new Y.bZ(1,"_ColorTransfer.Linear") +C.t=new Y.bZ(2,"_ColorTransfer.sRGB") +C.z=new Y.bZ(3,"_ColorTransfer.Custom") +C.az=new Y.cI("_ImageCodec.JPEG") +C.aA=new Y.cI("_ImageCodec.PNG") +C.aB=new Y.cI("_ImageCodec.WebP") +C.df=new P.c1(null,2) +C.aC=new N.c3(0,"_Storage.DataUri") +C.dg=new N.c3(1,"_Storage.BufferView") +C.dh=new N.c3(2,"_Storage.GLB") +C.aD=new N.c3(3,"_Storage.External")})();(function staticFields(){$.ap=0 +$.ci=null +$.n7=null +$.og=null +$.o5=null +$.oq=null +$.lp=null +$.lC=null +$.mv=null +$.c6=null +$.cR=null +$.cS=null +$.mm=!1 +$.p=C.f +$.bl=[]})();(function lazyInitializers(){var u=hunkHelpers.lazy +u($,"uK","mB",function(){return H.oe("_$dart_dartClosure")}) +u($,"vx","mI",function(){return H.oe("_$dart_js")}) +u($,"x9","qo",function(){return H.aA(H.jA({ +toString:function(){return"$receiver$"}}))}) +u($,"xa","qp",function(){return H.aA(H.jA({$method$:null, +toString:function(){return"$receiver$"}}))}) +u($,"xb","qq",function(){return H.aA(H.jA(null))}) +u($,"xc","qr",function(){return H.aA(function(){var $argumentsExpr$='$arguments$' +try{null.$method$($argumentsExpr$)}catch(t){return t.message}}())}) +u($,"xf","qu",function(){return H.aA(H.jA(void 0))}) +u($,"xg","qv",function(){return H.aA(function(){var $argumentsExpr$='$arguments$' +try{(void 0).$method$($argumentsExpr$)}catch(t){return t.message}}())}) +u($,"xe","qt",function(){return H.aA(H.nA(null))}) +u($,"xd","qs",function(){return H.aA(function(){try{null.$method$}catch(t){return t.message}}())}) +u($,"xi","qx",function(){return H.aA(H.nA(void 0))}) +u($,"xh","qw",function(){return H.aA(function(){try{(void 0).$method$}catch(t){return t.message}}())}) +u($,"xk","mV",function(){return P.t3()}) +u($,"vh","dO",function(){var t=new P.E(C.f,[P.A]) +t.dI(null) +return t}) +u($,"xj","qy",function(){return P.t0()}) +u($,"xl","mW",function(){return H.rE(H.tw(H.a([-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-1,-2,-2,-2,-2,-2,62,-2,62,-2,63,52,53,54,55,56,57,58,59,60,61,-2,-2,-2,-1,-2,-2,-2,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-2,-2,-2,-2,63,-2,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,-2,-2,-2,-2,-2],[P.h])))}) +u($,"xq","qC",function(){return P.tv()}) +u($,"uI","aD",function(){return P.nx("^([0-9]+)\\.([0-9]+)$")}) +u($,"uJ","ow",function(){return P.nx("^([A-Z0-9]+)_[A-Za-z0-9_]+$")}) +u($,"v6","oO",function(){return E.x("BUFFER_EMBEDDED_BYTELENGTH_MISMATCH",new E.et(),C.b)}) +u($,"v7","oP",function(){return E.x("BUFFER_EXTERNAL_BYTELENGTH_MISMATCH",new E.er(),C.b)}) +u($,"v8","oQ",function(){return E.x("BUFFER_GLB_CHUNK_TOO_BIG",new E.eq(),C.e)}) +u($,"v_","mF",function(){return E.x("ACCESSOR_MIN_MISMATCH",new E.ey(),C.b)}) +u($,"uZ","mE",function(){return E.x("ACCESSOR_MAX_MISMATCH",new E.ev(),C.b)}) +u($,"uP","mD",function(){return E.x("ACCESSOR_ELEMENT_OUT_OF_MIN_BOUND",new E.ew(),C.b)}) +u($,"uO","mC",function(){return E.x("ACCESSOR_ELEMENT_OUT_OF_MAX_BOUND",new E.eu(),C.b)}) +u($,"v3","mG",function(){return E.x("ACCESSOR_VECTOR3_NON_UNIT",new E.eH(),C.b)}) +u($,"uV","oF",function(){return E.x("ACCESSOR_INVALID_SIGN",new E.eJ(),C.b)}) +u($,"uN","oz",function(){return E.x("ACCESSOR_ANIMATION_SAMPLER_OUTPUT_NON_NORMALIZED_QUATERNION",new E.eA(),C.b)}) +u($,"v0","oJ",function(){return E.x("ACCESSOR_NON_CLAMPED",new E.eG(),C.b)}) +u($,"uT","oD",function(){return E.x("ACCESSOR_INVALID_FLOAT",new E.ez(),C.b)}) +u($,"uQ","oA",function(){return E.x("ACCESSOR_INDEX_OOB",new E.eF(),C.b)}) +u($,"uS","oC",function(){return E.x("ACCESSOR_INDEX_TRIANGLE_DEGENERATE",new E.eD(),C.h)}) +u($,"uR","oB",function(){return E.x("ACCESSOR_INDEX_PRIMITIVE_RESTART",new E.eE(),C.b)}) +u($,"uL","ox",function(){return E.x("ACCESSOR_ANIMATION_INPUT_NEGATIVE",new E.eC(),C.b)}) +u($,"uM","oy",function(){return E.x("ACCESSOR_ANIMATION_INPUT_NON_INCREASING",new E.eB(),C.b)}) +u($,"v2","oL",function(){return E.x("ACCESSOR_SPARSE_INDICES_NON_INCREASING",new E.eM(),C.b)}) +u($,"v1","oK",function(){return E.x("ACCESSOR_SPARSE_INDEX_OOB",new E.eL(),C.b)}) +u($,"uU","oE",function(){return E.x("ACCESSOR_INVALID_IBM",new E.eK(),C.b)}) +u($,"va","oR",function(){return E.x("IMAGE_DATA_INVALID",new E.eQ(),C.b)}) +u($,"vc","oT",function(){return E.x("IMAGE_MIME_TYPE_INVALID",new E.eP(),C.b)}) +u($,"vf","oW",function(){return E.x("IMAGE_UNEXPECTED_EOS",new E.en(),C.b)}) +u($,"vg","oX",function(){return E.x("IMAGE_UNRECOGNIZED_FORMAT",new E.eo(),C.e)}) +u($,"vd","oU",function(){return E.x("IMAGE_NON_ENABLED_MIME_TYPE",new E.ep(),C.b)}) +u($,"ve","oV",function(){return E.x("IMAGE_NPOT_DIMENSIONS",new E.eO(),C.h)}) +u($,"vb","oS",function(){return E.x("IMAGE_FEATURES_UNSUPPORTED",new E.eN(),C.e)}) +u($,"v9","mH",function(){return E.x("DATA_URI_GLB",new E.es(),C.h)}) +u($,"uX","oH",function(){return E.x("ACCESSOR_JOINTS_INDEX_OOB",new E.eI(),C.b)}) +u($,"uW","oG",function(){return E.x("ACCESSOR_JOINTS_INDEX_DUPLICATE",new E.ex(),C.b)}) +u($,"v4","oM",function(){return E.x("ACCESSOR_WEIGHTS_NEGATIVE",new E.em(),C.b)}) +u($,"v5","oN",function(){return E.x("ACCESSOR_WEIGHTS_NON_NORMALIZED",new E.ek(),C.b)}) +u($,"uY","oI",function(){return E.x("ACCESSOR_JOINTS_USED_ZERO_WEIGHT",new E.el(),C.e)}) +u($,"vw","lT",function(){return new E.fB(C.b,"IO_ERROR",new E.fC())}) +u($,"wc","mQ",function(){return E.a0("ARRAY_LENGTH_NOT_IN_LIST",new E.iv(),C.b)}) +u($,"wd","cW",function(){return E.a0("ARRAY_TYPE_MISMATCH",new E.iw(),C.b)}) +u($,"wb","mP",function(){return E.a0("DUPLICATE_ELEMENTS",new E.iB(),C.b)}) +u($,"wf","dQ",function(){return E.a0("INVALID_INDEX",new E.iz(),C.b)}) +u($,"wg","dR",function(){return E.a0("INVALID_JSON",new E.it(),C.b)}) +u($,"wh","pH",function(){return E.a0("INVALID_URI",new E.ip(),C.b)}) +u($,"we","aX",function(){return E.a0("EMPTY_ENTITY",new E.ix(),C.b)}) +u($,"wi","mR",function(){return E.a0("ONE_OF_MISMATCH",new E.iq(),C.b)}) +u($,"wj","pI",function(){return E.a0("PATTERN_MISMATCH",new E.iA(),C.b)}) +u($,"wk","P",function(){return E.a0("TYPE_MISMATCH",new E.il(),C.b)}) +u($,"wp","mS",function(){return E.a0("VALUE_NOT_IN_LIST",new E.iu(),C.e)}) +u($,"wq","lU",function(){return E.a0("VALUE_NOT_IN_RANGE",new E.io(),C.b)}) +u($,"wo","pK",function(){return E.a0("VALUE_MULTIPLE_OF",new E.ir(),C.b)}) +u($,"wl","aE",function(){return E.a0("UNDEFINED_PROPERTY",new E.im(),C.b)}) +u($,"wm","pJ",function(){return E.a0("UNEXPECTED_PROPERTY",new E.iy(),C.e)}) +u($,"wn","ce",function(){return E.a0("UNSATISFIED_DEPENDENCY",new E.is(),C.b)}) +u($,"x4","qk",function(){return E.n("UNKNOWN_ASSET_MAJOR_VERSION",new E.j9(),C.b)}) +u($,"x5","ql",function(){return E.n("UNKNOWN_ASSET_MINOR_VERSION",new E.j8(),C.e)}) +u($,"wQ","q5",function(){return E.n("ASSET_MIN_VERSION_GREATER_THAN_VERSION",new E.iZ(),C.e)}) +u($,"wE","pV",function(){return E.n("INVALID_GL_VALUE",new E.iX(),C.b)}) +u($,"wC","pT",function(){return E.n("INTEGER_WRITTEN_AS_FLOAT",new E.iY(),C.e)}) +u($,"ws","pM",function(){return E.n("ACCESSOR_NORMALIZED_INVALID",new E.iW(),C.b)}) +u($,"wt","pN",function(){return E.n("ACCESSOR_OFFSET_ALIGNMENT",new E.iU(),C.b)}) +u($,"wr","pL",function(){return E.n("ACCESSOR_MATRIX_ALIGNMENT",new E.iV(),C.b)}) +u($,"wu","pO",function(){return E.n("ACCESSOR_SPARSE_COUNT_OUT_OF_RANGE",new E.j4(),C.b)}) +u($,"wv","pP",function(){return E.n("ANIMATION_CHANNEL_TARGET_NODE_SKIN",new E.j5(),C.e)}) +u($,"ww","pQ",function(){return E.n("BUFFER_DATA_URI_MIME_TYPE_INVALID",new E.iT(),C.b)}) +u($,"wy","pR",function(){return E.n("BUFFER_VIEW_TOO_BIG_BYTE_STRIDE",new E.iS(),C.b)}) +u($,"wx","lV",function(){return E.n("BUFFER_VIEW_INVALID_BYTE_STRIDE",new E.iR(),C.b)}) +u($,"wz","pS",function(){return E.n("CAMERA_XMAG_YMAG_ZERO",new E.iP(),C.e)}) +u($,"wA","mT",function(){return E.n("CAMERA_ZFAR_LEQUAL_ZNEAR",new E.iO(),C.b)}) +u($,"wG","pX",function(){return E.n("MATERIAL_ALPHA_CUTOFF_INVALID_MODE",new E.iM(),C.e)}) +u($,"wJ","lW",function(){return E.n("MESH_PRIMITIVE_INVALID_ATTRIBUTE",new E.iG(),C.b)}) +u($,"wP","q4",function(){return E.n("MESH_PRIMITIVES_UNEQUAL_TARGETS_COUNT",new E.jj(),C.b)}) +u($,"wO","q3",function(){return E.n("MESH_PRIMITIVES_UNEQUAL_JOINTS_COUNT",new E.ji(),C.e)}) +u($,"wL","q0",function(){return E.n("MESH_PRIMITIVE_NO_POSITION",new E.iL(),C.e)}) +u($,"wI","pZ",function(){return E.n("MESH_PRIMITIVE_INDEXED_SEMANTIC_CONTINUITY",new E.iI(),C.b)}) +u($,"wN","q2",function(){return E.n("MESH_PRIMITIVE_TANGENT_WITHOUT_NORMAL",new E.iK(),C.e)}) +u($,"wK","q_",function(){return E.n("MESH_PRIMITIVE_JOINTS_WEIGHTS_MISMATCH",new E.iH(),C.b)}) +u($,"wM","q1",function(){return E.n("MESH_PRIMITIVE_TANGENT_POINTS",new E.iJ(),C.e)}) +u($,"wH","pY",function(){return E.n("MESH_INVALID_WEIGHTS_COUNT",new E.jh(),C.b)}) +u($,"wU","q9",function(){return E.n("NODE_MATRIX_TRS",new E.jf(),C.b)}) +u($,"wS","q7",function(){return E.n("NODE_MATRIX_DEFAULT",new E.jb(),C.h)}) +u($,"wV","qa",function(){return E.n("NODE_MATRIX_NON_TRS",new E.j0(),C.b)}) +u($,"x1","qh",function(){return E.n("ROTATION_NON_UNIT",new E.jg(),C.b)}) +u($,"x7","qn",function(){return E.n("UNUSED_EXTENSION_REQUIRED",new E.ja(),C.b)}) +u($,"x0","qg",function(){return E.n("NON_REQUIRED_EXTENSION",new E.jc(),C.b)}) +u($,"x6","qm",function(){return E.n("UNRESERVED_EXTENSION_PREFIX",new E.jd(),C.e)}) +u($,"wD","pU",function(){return E.n("INVALID_EXTENSION_NAME_FORMAT",new E.je(),C.e)}) +u($,"wT","q8",function(){return E.n("NODE_EMPTY",new E.j3(),C.h)}) +u($,"wY","qd",function(){return E.n("NODE_SKINNED_MESH_NON_ROOT",new E.j2(),C.e)}) +u($,"wX","qc",function(){return E.n("NODE_SKINNED_MESH_LOCAL_TRANSFORMS",new E.j1(),C.e)}) +u($,"wW","qb",function(){return E.n("NODE_SKIN_NO_SCENE",new E.j_(),C.b)}) +u($,"x2","qi",function(){return E.n("SKIN_NO_COMMON_ROOT",new E.j7(),C.b)}) +u($,"x3","qj",function(){return E.n("SKIN_SKELETON_INVALID",new E.j6(),C.b)}) +u($,"x_","qf",function(){return E.n("NON_RELATIVE_URI",new E.iN(),C.e)}) +u($,"wR","q6",function(){return E.n("MULTIPLE_EXTENSIONS",new E.iE(),C.e)}) +u($,"wZ","qe",function(){return E.n("NON_OBJECT_EXTRAS",new E.iD(),C.h)}) +u($,"wB","mU",function(){return E.n("EXTRA_PROPERTY",new E.iQ(),C.h)}) +u($,"wF","pW",function(){return E.n("KHR_LIGHTS_PUNCTUAL_LIGHT_SPOT_ANGLES",new E.iF(),C.b)}) +u($,"vA","pc",function(){return E.o("ACCESSOR_TOTAL_OFFSET_ALIGNMENT",new E.hq(),C.b)}) +u($,"vy","pb",function(){return E.o("ACCESSOR_SMALL_BYTESTRIDE",new E.hu(),C.b)}) +u($,"vz","mJ",function(){return E.o("ACCESSOR_TOO_LONG",new E.hg(),C.b)}) +u($,"vB","pd",function(){return E.o("ACCESSOR_USAGE_OVERRIDE",new E.h2(),C.b)}) +u($,"vE","pg",function(){return E.o("ANIMATION_DUPLICATE_TARGETS",new E.hv(),C.b)}) +u($,"vC","pe",function(){return E.o("ANIMATION_CHANNEL_TARGET_NODE_MATRIX",new E.fZ(),C.b)}) +u($,"vD","pf",function(){return E.o("ANIMATION_CHANNEL_TARGET_NODE_WEIGHTS_NO_MORPHS",new E.fY(),C.b)}) +u($,"vH","pj",function(){return E.o("ANIMATION_SAMPLER_INPUT_ACCESSOR_WITHOUT_BOUNDS",new E.h0(),C.b)}) +u($,"vF","ph",function(){return E.o("ANIMATION_SAMPLER_INPUT_ACCESSOR_INVALID_FORMAT",new E.h1(),C.b)}) +u($,"vJ","pl",function(){return E.o("ANIMATION_SAMPLER_OUTPUT_ACCESSOR_INVALID_FORMAT",new E.fX(),C.b)}) +u($,"vG","pi",function(){return E.o("ANIMATION_SAMPLER_INPUT_ACCESSOR_TOO_FEW_ELEMENTS",new E.h_(),C.b)}) +u($,"vI","pk",function(){return E.o("ANIMATION_SAMPLER_OUTPUT_ACCESSOR_INVALID_COUNT",new E.fW(),C.b)}) +u($,"vK","pm",function(){return E.o("BUFFER_MISSING_GLB_DATA",new E.h5(),C.b)}) +u($,"vM","mK",function(){return E.o("BUFFER_VIEW_TOO_LONG",new E.h3(),C.b)}) +u($,"vL","pn",function(){return E.o("BUFFER_VIEW_TARGET_OVERRIDE",new E.ht(),C.b)}) +u($,"vN","po",function(){return E.o("INVALID_IBM_ACCESSOR_COUNT",new E.hm(),C.b)}) +u($,"vQ","mM",function(){return E.o("MESH_PRIMITIVE_ATTRIBUTES_ACCESSOR_INVALID_FORMAT",new E.h7(),C.b)}) +u($,"vW","mN",function(){return E.o("MESH_PRIMITIVE_POSITION_ACCESSOR_WITHOUT_BOUNDS",new E.h8(),C.b)}) +u($,"vP","pp",function(){return E.o("MESH_PRIMITIVE_ACCESSOR_WITHOUT_BYTESTRIDE",new E.h4(),C.b)}) +u($,"vO","mL",function(){return E.o("MESH_PRIMITIVE_ACCESSOR_UNALIGNED",new E.h6(),C.b)}) +u($,"vT","ps",function(){return E.o("MESH_PRIMITIVE_INDICES_ACCESSOR_WITH_BYTESTRIDE",new E.he(),C.b)}) +u($,"vS","pr",function(){return E.o("MESH_PRIMITIVE_INDICES_ACCESSOR_INVALID_FORMAT",new E.hd(),C.b)}) +u($,"vR","pq",function(){return E.o("MESH_PRIMITIVE_INCOMPATIBLE_MODE",new E.hc(),C.e)}) +u($,"vX","pv",function(){return E.o("MESH_PRIMITIVE_TOO_FEW_TEXCOORDS",new E.hb(),C.b)}) +u($,"vY","pw",function(){return E.o("MESH_PRIMITIVE_UNEQUAL_ACCESSOR_COUNT",new E.hf(),C.b)}) +u($,"vV","pu",function(){return E.o("MESH_PRIMITIVE_MORPH_TARGET_NO_BASE_ACCESSOR",new E.ha(),C.b)}) +u($,"vU","pt",function(){return E.o("MESH_PRIMITIVE_MORPH_TARGET_INVALID_ATTRIBUTE_COUNT",new E.h9(),C.b)}) +u($,"vZ","px",function(){return E.o("NODE_LOOP",new E.hs(),C.b)}) +u($,"w_","py",function(){return E.o("NODE_PARENT_OVERRIDE",new E.hh(),C.b)}) +u($,"w2","pB",function(){return E.o("NODE_WEIGHTS_INVALID",new E.hk(),C.b)}) +u($,"w0","pz",function(){return E.o("NODE_SKIN_WITH_NON_SKINNED_MESH",new E.hj(),C.b)}) +u($,"w1","pA",function(){return E.o("NODE_SKINNED_MESH_WITHOUT_SKIN",new E.hi(),C.e)}) +u($,"w3","pC",function(){return E.o("SCENE_NON_ROOT_NODE",new E.hl(),C.b)}) +u($,"w4","pD",function(){return E.o("SKIN_IBM_INVALID_FORMAT",new E.hn(),C.b)}) +u($,"w5","mO",function(){return E.o("TEXTURE_INVALID_IMAGE_MIME_TYPE",new E.fV(),C.b)}) +u($,"w6","pE",function(){return E.o("UNDECLARED_EXTENSION",new E.fU(),C.b)}) +u($,"w7","pF",function(){return E.o("UNEXPECTED_EXTENSION_OBJECT",new E.fT(),C.b)}) +u($,"w8","D",function(){return E.o("UNRESOLVED_REFERENCE",new E.ho(),C.b)}) +u($,"w9","pG",function(){return E.o("UNSUPPORTED_EXTENSION",new E.hp(),C.e)}) +u($,"wa","dP",function(){return E.o("UNUSED_OBJECT",new E.hr(),C.h)}) +u($,"vm","p1",function(){return E.a6("GLB_INVALID_MAGIC",new E.eZ(),C.b)}) +u($,"vn","p2",function(){return E.a6("GLB_INVALID_VERSION",new E.eY(),C.b)}) +u($,"vp","p4",function(){return E.a6("GLB_LENGTH_TOO_SMALL",new E.eX(),C.b)}) +u($,"vi","oY",function(){return E.a6("GLB_CHUNK_LENGTH_UNALIGNED",new E.f6(),C.b)}) +u($,"vo","p3",function(){return E.a6("GLB_LENGTH_MISMATCH",new E.eV(),C.b)}) +u($,"vj","oZ",function(){return E.a6("GLB_CHUNK_TOO_BIG",new E.f5(),C.b)}) +u($,"vl","p0",function(){return E.a6("GLB_EMPTY_CHUNK",new E.f1(),C.b)}) +u($,"vk","p_",function(){return E.a6("GLB_DUPLICATE_CHUNK",new E.f2(),C.b)}) +u($,"vs","p7",function(){return E.a6("GLB_UNEXPECTED_END_OF_CHUNK_HEADER",new E.eW(),C.b)}) +u($,"vr","p6",function(){return E.a6("GLB_UNEXPECTED_END_OF_CHUNK_DATA",new E.eU(),C.b)}) +u($,"vt","p8",function(){return E.a6("GLB_UNEXPECTED_END_OF_HEADER",new E.f_(),C.b)}) +u($,"vu","p9",function(){return E.a6("GLB_UNEXPECTED_FIRST_CHUNK",new E.f4(),C.b)}) +u($,"vq","p5",function(){return E.a6("GLB_UNEXPECTED_BIN_CHUNK",new E.f3(),C.b)}) +u($,"vv","pa",function(){return E.a6("GLB_UNKNOWN_CHUNK_TYPE",new E.f0(),C.e)}) +u($,"xm","mX",function(){return H.rD(1)}) +u($,"xn","qz",function(){return T.rA()}) +u($,"xr","qD",function(){return T.nG()}) +u($,"xo","qA",function(){var t=T.rP() +t.a[3]=1 +return t}) +u($,"xp","qB",function(){return T.nG()})})();(function nativeSupport(){!function(){var u=function(a){var o={} +o[a]=1 +return Object.keys(hunkHelpers.convertToFastObject(o))[0]} +v.getIsolateTag=function(a){return u("___dart_"+a+v.isolateTag)} +var t="___dart_isolate_tags_" +var s=Object[t]||(Object[t]=Object.create(null)) +var r="_ZxYxX" +for(var q=0;;q++){var p=u(r+"_"+q+"_") +if(!(p in s)){s[p]=1 +v.isolateTag=p +break}}v.dispatchPropertyName=v.getIsolateTag("dispatch_record")}() +hunkHelpers.setOrUpdateInterceptorsByTag({ArrayBuffer:J.bD,DataView:H.cz,ArrayBufferView:H.cz,Float32Array:H.db,Float64Array:H.hV,Int16Array:H.hW,Int32Array:H.hX,Int8Array:H.hY,Uint16Array:H.hZ,Uint32Array:H.i_,Uint8ClampedArray:H.de,CanvasPixelArray:H.de,Uint8Array:H.bP}) +hunkHelpers.setOrUpdateLeafTags({ArrayBuffer:true,DataView:true,ArrayBufferView:false,Float32Array:true,Float64Array:true,Int16Array:true,Int32Array:true,Int8Array:true,Uint16Array:true,Uint32Array:true,Uint8ClampedArray:true,CanvasPixelArray:true,Uint8Array:false}) +H.dc.$nativeSuperclassTag="ArrayBufferView" +H.cJ.$nativeSuperclassTag="ArrayBufferView" +H.cK.$nativeSuperclassTag="ArrayBufferView" +H.dd.$nativeSuperclassTag="ArrayBufferView" +H.cL.$nativeSuperclassTag="ArrayBufferView" +H.cM.$nativeSuperclassTag="ArrayBufferView" +H.cy.$nativeSuperclassTag="ArrayBufferView"})() +Function.prototype.$1=function(a){return this(a)} +Function.prototype.$0=function(){return this()} +Function.prototype.$2=function(a,b){return this(a,b)} +Function.prototype.$3=function(a,b,c){return this(a,b,c)} +Function.prototype.$4=function(a,b,c,d){return this(a,b,c,d)} +Function.prototype.$1$1=function(a){return this(a)} +Function.prototype.$1$0=function(){return this()} +Function.prototype.$1$2=function(a,b){return this(a,b)} +Function.prototype.$2$0=function(){return this()} +convertAllToFastObject(w) +convertToFastObject($);(function(a){if(typeof document==="undefined"){a(null) +return}if(typeof document.currentScript!='undefined'){a(document.currentScript) +return}var u=document.scripts +function onLoad(b){for(var s=0;s validator.version(); + +/** + * Returns an array of supported extensions names. + * @returns {string[]} + */ +exports.supportedExtensions = () => validator.supportedExtensions(); + +/** + * Validates an asset from bytes. + * @param {Uint8Array} data - Byte array containing glTF or GLB data. + * @param {ValidationOptions} options - Object with validation options. + * @returns {Promise} Promise with validation result in object form. + */ +exports.validateBytes = (data, options) => validator.validateBytes(data, options); + +/** + * Validates an asset from JSON string. + * @param {string} json - String containing glTF JSON. + * @param {ValidationOptions} options - Object with validation options. + * @returns {Promise} Promise with validation result in object form. + */ +exports.validateString = (json, options) => validator.validateString(json, options); + +/** + @typedef {Object} ValidationOptions + @property {string} uri - Absolute or relative asset URI that will be copied to validation report. + @property {ExternalResourceFunction} externalResourceFunction - Function for loading external resources. If omitted, external resources are not validated. + @property {boolean} validateAccessorData - Set to `false` to skip reading of accessor data. Default is `true`. + @property {boolean} writeTimestamp - Set to `false` to omit timestamp from the validation report. Default is `true`. + @property {number} maxIssues - Max number of reported issues. Use `0` for unlimited output. + @property {string[]} ignoredIssues - Array of ignored issue codes. + @property {Object} severityOverrides - Object with overridden severities for issue codes. + */ + +/** + * @callback ExternalResourceFunction + * @param {string} uri - Relative URI of the external resource. + * @returns {Promise} - Promise with Uint8Array data. + */ + +},{"./gltf_validator.dart.js":3}]},{},[2]); diff --git a/src/assets/js/ktx2Transcoders/msc_basis_transcoder.js b/src/assets/js/ktx2Transcoders/msc_basis_transcoder.js new file mode 100644 index 0000000..b04e598 --- /dev/null +++ b/src/assets/js/ktx2Transcoders/msc_basis_transcoder.js @@ -0,0 +1,21 @@ + +var MSC_TRANSCODER = (function() { + var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined; + if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename; + return ( +function(MSC_TRANSCODER) { + MSC_TRANSCODER = MSC_TRANSCODER || {}; + +var Module=typeof MSC_TRANSCODER!=="undefined"?MSC_TRANSCODER:{};var readyPromiseResolve,readyPromiseReject;Module["ready"]=new Promise(function(resolve,reject){readyPromiseResolve=resolve;readyPromiseReject=reject});var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"}}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(_scriptDir){scriptDirectory=_scriptDir}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var tempRet0=0;var setTempRet0=function(value){tempRet0=value};var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}var UTF8Decoder=typeof TextDecoder!=="undefined"?new TextDecoder("utf8"):undefined;function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var endPtr=idx;while(heap[endPtr]&&!(endPtr>=endIdx))++endPtr;if(endPtr-idx>16&&heap.subarray&&UTF8Decoder){return UTF8Decoder.decode(heap.subarray(idx,endPtr))}else{var str="";while(idx>10,56320|ch&1023)}}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}var UTF16Decoder=typeof TextDecoder!=="undefined"?new TextDecoder("utf-16le"):undefined;function UTF16ToString(ptr,maxBytesToRead){var endPtr=ptr;var idx=endPtr>>1;var maxIdx=idx+maxBytesToRead/2;while(!(idx>=maxIdx)&&HEAPU16[idx])++idx;endPtr=idx<<1;if(endPtr-ptr>32&&UTF16Decoder){return UTF16Decoder.decode(HEAPU8.subarray(ptr,endPtr))}else{var str="";for(var i=0;!(i>=maxBytesToRead/2);++i){var codeUnit=HEAP16[ptr+i*2>>1];if(codeUnit==0)break;str+=String.fromCharCode(codeUnit)}return str}}function stringToUTF16(str,outPtr,maxBytesToWrite){if(maxBytesToWrite===undefined){maxBytesToWrite=2147483647}if(maxBytesToWrite<2)return 0;maxBytesToWrite-=2;var startPtr=outPtr;var numCharsToWrite=maxBytesToWrite>1]=codeUnit;outPtr+=2}HEAP16[outPtr>>1]=0;return outPtr-startPtr}function lengthBytesUTF16(str){return str.length*2}function UTF32ToString(ptr,maxBytesToRead){var i=0;var str="";while(!(i>=maxBytesToRead/4)){var utf32=HEAP32[ptr+i*4>>2];if(utf32==0)break;++i;if(utf32>=65536){var ch=utf32-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}else{str+=String.fromCharCode(utf32)}}return str}function stringToUTF32(str,outPtr,maxBytesToWrite){if(maxBytesToWrite===undefined){maxBytesToWrite=2147483647}if(maxBytesToWrite<4)return 0;var startPtr=outPtr;var endPtr=startPtr+maxBytesToWrite-4;for(var i=0;i=55296&&codeUnit<=57343){var trailSurrogate=str.charCodeAt(++i);codeUnit=65536+((codeUnit&1023)<<10)|trailSurrogate&1023}HEAP32[outPtr>>2]=codeUnit;outPtr+=4;if(outPtr+4>endPtr)break}HEAP32[outPtr>>2]=0;return outPtr-startPtr}function lengthBytesUTF32(str){var len=0;for(var i=0;i=55296&&codeUnit<=57343)++i;len+=4}return len}function alignUp(x,multiple){if(x%multiple>0){x+=multiple-x%multiple}return x}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;__ATINIT__.push({func:function(){___wasm_call_ctors()}});function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;callRuntimeCallbacks(__ATINIT__)}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function postRun(){if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function addRunDependency(id){runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);readyPromiseReject(e);throw e}function hasPrefix(str,prefix){return String.prototype.startsWith?str.startsWith(prefix):str.indexOf(prefix)===0}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return hasPrefix(filename,dataURIPrefix)}var fileURIPrefix="file://";function isFileURI(filename){return hasPrefix(filename,fileURIPrefix)}var wasmBinaryFile="msc_basis_transcoder.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmMemory=Module["asm"]["L"];updateGlobalBufferAndViews(wasmMemory.buffer);wasmTable=Module["asm"]["O"];removeRunDependency("wasm-instantiate")}addRunDependency("wasm-instantiate");function receiveInstantiatedSource(output){receiveInstance(output["instance"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){return WebAssembly.instantiate(binary,info)}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiatedSource,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiatedSource)})})}else{return instantiateArrayBuffer(receiveInstantiatedSource)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync().catch(readyPromiseReject);return{}}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function getShiftFromSize(size){switch(size){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+size)}}function embind_init_charCodes(){var codes=new Array(256);for(var i=0;i<256;++i){codes[i]=String.fromCharCode(i)}embind_charCodes=codes}var embind_charCodes=undefined;function readLatin1String(ptr){var ret="";var c=ptr;while(HEAPU8[c]){ret+=embind_charCodes[HEAPU8[c++]]}return ret}var awaitingDependencies={};var registeredTypes={};var typeDependencies={};var char_0=48;var char_9=57;function makeLegalFunctionName(name){if(undefined===name){return"_unknown"}name=name.replace(/[^a-zA-Z0-9_]/g,"$");var f=name.charCodeAt(0);if(f>=char_0&&f<=char_9){return"_"+name}else{return name}}function createNamedFunction(name,body){name=makeLegalFunctionName(name);return new Function("body","return function "+name+"() {\n"+' "use strict";'+" return body.apply(this, arguments);\n"+"};\n")(body)}function extendError(baseErrorType,errorName){var errorClass=createNamedFunction(errorName,function(message){this.name=errorName;this.message=message;var stack=new Error(message).stack;if(stack!==undefined){this.stack=this.toString()+"\n"+stack.replace(/^Error(:[^\n]*)?\n/,"")}});errorClass.prototype=Object.create(baseErrorType.prototype);errorClass.prototype.constructor=errorClass;errorClass.prototype.toString=function(){if(this.message===undefined){return this.name}else{return this.name+": "+this.message}};return errorClass}var BindingError=undefined;function throwBindingError(message){throw new BindingError(message)}var InternalError=undefined;function throwInternalError(message){throw new InternalError(message)}function whenDependentTypesAreResolved(myTypes,dependentTypes,getTypeConverters){myTypes.forEach(function(type){typeDependencies[type]=dependentTypes});function onComplete(typeConverters){var myTypeConverters=getTypeConverters(typeConverters);if(myTypeConverters.length!==myTypes.length){throwInternalError("Mismatched type converter count")}for(var i=0;i>shift])},destructorFunction:null})}function ClassHandle_isAliasOf(other){if(!(this instanceof ClassHandle)){return false}if(!(other instanceof ClassHandle)){return false}var leftClass=this.$$.ptrType.registeredClass;var left=this.$$.ptr;var rightClass=other.$$.ptrType.registeredClass;var right=other.$$.ptr;while(leftClass.baseClass){left=leftClass.upcast(left);leftClass=leftClass.baseClass}while(rightClass.baseClass){right=rightClass.upcast(right);rightClass=rightClass.baseClass}return leftClass===rightClass&&left===right}function shallowCopyInternalPointer(o){return{count:o.count,deleteScheduled:o.deleteScheduled,preservePointerOnDelete:o.preservePointerOnDelete,ptr:o.ptr,ptrType:o.ptrType,smartPtr:o.smartPtr,smartPtrType:o.smartPtrType}}function throwInstanceAlreadyDeleted(obj){function getInstanceTypeName(handle){return handle.$$.ptrType.registeredClass.name}throwBindingError(getInstanceTypeName(obj)+" instance already deleted")}var finalizationGroup=false;function detachFinalizer(handle){}function runDestructor($$){if($$.smartPtr){$$.smartPtrType.rawDestructor($$.smartPtr)}else{$$.ptrType.registeredClass.rawDestructor($$.ptr)}}function releaseClassHandle($$){$$.count.value-=1;var toDelete=0===$$.count.value;if(toDelete){runDestructor($$)}}function attachFinalizer(handle){if("undefined"===typeof FinalizationGroup){attachFinalizer=function(handle){return handle};return handle}finalizationGroup=new FinalizationGroup(function(iter){for(var result=iter.next();!result.done;result=iter.next()){var $$=result.value;if(!$$.ptr){console.warn("object already deleted: "+$$.ptr)}else{releaseClassHandle($$)}}});attachFinalizer=function(handle){finalizationGroup.register(handle,handle.$$,handle.$$);return handle};detachFinalizer=function(handle){finalizationGroup.unregister(handle.$$)};return attachFinalizer(handle)}function ClassHandle_clone(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.preservePointerOnDelete){this.$$.count.value+=1;return this}else{var clone=attachFinalizer(Object.create(Object.getPrototypeOf(this),{$$:{value:shallowCopyInternalPointer(this.$$)}}));clone.$$.count.value+=1;clone.$$.deleteScheduled=false;return clone}}function ClassHandle_delete(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete){throwBindingError("Object already scheduled for deletion")}detachFinalizer(this);releaseClassHandle(this.$$);if(!this.$$.preservePointerOnDelete){this.$$.smartPtr=undefined;this.$$.ptr=undefined}}function ClassHandle_isDeleted(){return!this.$$.ptr}var delayFunction=undefined;var deletionQueue=[];function flushPendingDeletes(){while(deletionQueue.length){var obj=deletionQueue.pop();obj.$$.deleteScheduled=false;obj["delete"]()}}function ClassHandle_deleteLater(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete){throwBindingError("Object already scheduled for deletion")}deletionQueue.push(this);if(deletionQueue.length===1&&delayFunction){delayFunction(flushPendingDeletes)}this.$$.deleteScheduled=true;return this}function init_ClassHandle(){ClassHandle.prototype["isAliasOf"]=ClassHandle_isAliasOf;ClassHandle.prototype["clone"]=ClassHandle_clone;ClassHandle.prototype["delete"]=ClassHandle_delete;ClassHandle.prototype["isDeleted"]=ClassHandle_isDeleted;ClassHandle.prototype["deleteLater"]=ClassHandle_deleteLater}function ClassHandle(){}var registeredPointers={};function ensureOverloadTable(proto,methodName,humanName){if(undefined===proto[methodName].overloadTable){var prevFunc=proto[methodName];proto[methodName]=function(){if(!proto[methodName].overloadTable.hasOwnProperty(arguments.length)){throwBindingError("Function '"+humanName+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+proto[methodName].overloadTable+")!")}return proto[methodName].overloadTable[arguments.length].apply(this,arguments)};proto[methodName].overloadTable=[];proto[methodName].overloadTable[prevFunc.argCount]=prevFunc}}function exposePublicSymbol(name,value,numArguments){if(Module.hasOwnProperty(name)){if(undefined===numArguments||undefined!==Module[name].overloadTable&&undefined!==Module[name].overloadTable[numArguments]){throwBindingError("Cannot register public name '"+name+"' twice")}ensureOverloadTable(Module,name,name);if(Module.hasOwnProperty(numArguments)){throwBindingError("Cannot register multiple overloads of a function with the same number of arguments ("+numArguments+")!")}Module[name].overloadTable[numArguments]=value}else{Module[name]=value;if(undefined!==numArguments){Module[name].numArguments=numArguments}}}function RegisteredClass(name,constructor,instancePrototype,rawDestructor,baseClass,getActualType,upcast,downcast){this.name=name;this.constructor=constructor;this.instancePrototype=instancePrototype;this.rawDestructor=rawDestructor;this.baseClass=baseClass;this.getActualType=getActualType;this.upcast=upcast;this.downcast=downcast;this.pureVirtualFunctions=[]}function upcastPointer(ptr,ptrClass,desiredClass){while(ptrClass!==desiredClass){if(!ptrClass.upcast){throwBindingError("Expected null or instance of "+desiredClass.name+", got an instance of "+ptrClass.name)}ptr=ptrClass.upcast(ptr);ptrClass=ptrClass.baseClass}return ptr}function constNoSmartPtrRawPointerToWireType(destructors,handle){if(handle===null){if(this.isReference){throwBindingError("null is not a valid "+this.name)}return 0}if(!handle.$$){throwBindingError('Cannot pass "'+_embind_repr(handle)+'" as a '+this.name)}if(!handle.$$.ptr){throwBindingError("Cannot pass deleted object as a pointer of type "+this.name)}var handleClass=handle.$$.ptrType.registeredClass;var ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);return ptr}function genericPointerToWireType(destructors,handle){var ptr;if(handle===null){if(this.isReference){throwBindingError("null is not a valid "+this.name)}if(this.isSmartPointer){ptr=this.rawConstructor();if(destructors!==null){destructors.push(this.rawDestructor,ptr)}return ptr}else{return 0}}if(!handle.$$){throwBindingError('Cannot pass "'+_embind_repr(handle)+'" as a '+this.name)}if(!handle.$$.ptr){throwBindingError("Cannot pass deleted object as a pointer of type "+this.name)}if(!this.isConst&&handle.$$.ptrType.isConst){throwBindingError("Cannot convert argument of type "+(handle.$$.smartPtrType?handle.$$.smartPtrType.name:handle.$$.ptrType.name)+" to parameter type "+this.name)}var handleClass=handle.$$.ptrType.registeredClass;ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);if(this.isSmartPointer){if(undefined===handle.$$.smartPtr){throwBindingError("Passing raw pointer to smart pointer is illegal")}switch(this.sharingPolicy){case 0:if(handle.$$.smartPtrType===this){ptr=handle.$$.smartPtr}else{throwBindingError("Cannot convert argument of type "+(handle.$$.smartPtrType?handle.$$.smartPtrType.name:handle.$$.ptrType.name)+" to parameter type "+this.name)}break;case 1:ptr=handle.$$.smartPtr;break;case 2:if(handle.$$.smartPtrType===this){ptr=handle.$$.smartPtr}else{var clonedHandle=handle["clone"]();ptr=this.rawShare(ptr,__emval_register(function(){clonedHandle["delete"]()}));if(destructors!==null){destructors.push(this.rawDestructor,ptr)}}break;default:throwBindingError("Unsupporting sharing policy")}}return ptr}function nonConstNoSmartPtrRawPointerToWireType(destructors,handle){if(handle===null){if(this.isReference){throwBindingError("null is not a valid "+this.name)}return 0}if(!handle.$$){throwBindingError('Cannot pass "'+_embind_repr(handle)+'" as a '+this.name)}if(!handle.$$.ptr){throwBindingError("Cannot pass deleted object as a pointer of type "+this.name)}if(handle.$$.ptrType.isConst){throwBindingError("Cannot convert argument of type "+handle.$$.ptrType.name+" to parameter type "+this.name)}var handleClass=handle.$$.ptrType.registeredClass;var ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);return ptr}function simpleReadValueFromPointer(pointer){return this["fromWireType"](HEAPU32[pointer>>2])}function RegisteredPointer_getPointee(ptr){if(this.rawGetPointee){ptr=this.rawGetPointee(ptr)}return ptr}function RegisteredPointer_destructor(ptr){if(this.rawDestructor){this.rawDestructor(ptr)}}function RegisteredPointer_deleteObject(handle){if(handle!==null){handle["delete"]()}}function downcastPointer(ptr,ptrClass,desiredClass){if(ptrClass===desiredClass){return ptr}if(undefined===desiredClass.baseClass){return null}var rv=downcastPointer(ptr,ptrClass,desiredClass.baseClass);if(rv===null){return null}return desiredClass.downcast(rv)}function getInheritedInstanceCount(){return Object.keys(registeredInstances).length}function getLiveInheritedInstances(){var rv=[];for(var k in registeredInstances){if(registeredInstances.hasOwnProperty(k)){rv.push(registeredInstances[k])}}return rv}function setDelayFunction(fn){delayFunction=fn;if(deletionQueue.length&&delayFunction){delayFunction(flushPendingDeletes)}}function init_embind(){Module["getInheritedInstanceCount"]=getInheritedInstanceCount;Module["getLiveInheritedInstances"]=getLiveInheritedInstances;Module["flushPendingDeletes"]=flushPendingDeletes;Module["setDelayFunction"]=setDelayFunction}var registeredInstances={};function getBasestPointer(class_,ptr){if(ptr===undefined){throwBindingError("ptr should not be undefined")}while(class_.baseClass){ptr=class_.upcast(ptr);class_=class_.baseClass}return ptr}function getInheritedInstance(class_,ptr){ptr=getBasestPointer(class_,ptr);return registeredInstances[ptr]}function makeClassHandle(prototype,record){if(!record.ptrType||!record.ptr){throwInternalError("makeClassHandle requires ptr and ptrType")}var hasSmartPtrType=!!record.smartPtrType;var hasSmartPtr=!!record.smartPtr;if(hasSmartPtrType!==hasSmartPtr){throwInternalError("Both smartPtrType and smartPtr must be specified")}record.count={value:1};return attachFinalizer(Object.create(prototype,{$$:{value:record}}))}function RegisteredPointer_fromWireType(ptr){var rawPointer=this.getPointee(ptr);if(!rawPointer){this.destructor(ptr);return null}var registeredInstance=getInheritedInstance(this.registeredClass,rawPointer);if(undefined!==registeredInstance){if(0===registeredInstance.$$.count.value){registeredInstance.$$.ptr=rawPointer;registeredInstance.$$.smartPtr=ptr;return registeredInstance["clone"]()}else{var rv=registeredInstance["clone"]();this.destructor(ptr);return rv}}function makeDefaultHandle(){if(this.isSmartPointer){return makeClassHandle(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:rawPointer,smartPtrType:this,smartPtr:ptr})}else{return makeClassHandle(this.registeredClass.instancePrototype,{ptrType:this,ptr:ptr})}}var actualType=this.registeredClass.getActualType(rawPointer);var registeredPointerRecord=registeredPointers[actualType];if(!registeredPointerRecord){return makeDefaultHandle.call(this)}var toType;if(this.isConst){toType=registeredPointerRecord.constPointerType}else{toType=registeredPointerRecord.pointerType}var dp=downcastPointer(rawPointer,this.registeredClass,toType.registeredClass);if(dp===null){return makeDefaultHandle.call(this)}if(this.isSmartPointer){return makeClassHandle(toType.registeredClass.instancePrototype,{ptrType:toType,ptr:dp,smartPtrType:this,smartPtr:ptr})}else{return makeClassHandle(toType.registeredClass.instancePrototype,{ptrType:toType,ptr:dp})}}function init_RegisteredPointer(){RegisteredPointer.prototype.getPointee=RegisteredPointer_getPointee;RegisteredPointer.prototype.destructor=RegisteredPointer_destructor;RegisteredPointer.prototype["argPackAdvance"]=8;RegisteredPointer.prototype["readValueFromPointer"]=simpleReadValueFromPointer;RegisteredPointer.prototype["deleteObject"]=RegisteredPointer_deleteObject;RegisteredPointer.prototype["fromWireType"]=RegisteredPointer_fromWireType}function RegisteredPointer(name,registeredClass,isReference,isConst,isSmartPointer,pointeeType,sharingPolicy,rawGetPointee,rawConstructor,rawShare,rawDestructor){this.name=name;this.registeredClass=registeredClass;this.isReference=isReference;this.isConst=isConst;this.isSmartPointer=isSmartPointer;this.pointeeType=pointeeType;this.sharingPolicy=sharingPolicy;this.rawGetPointee=rawGetPointee;this.rawConstructor=rawConstructor;this.rawShare=rawShare;this.rawDestructor=rawDestructor;if(!isSmartPointer&®isteredClass.baseClass===undefined){if(isConst){this["toWireType"]=constNoSmartPtrRawPointerToWireType;this.destructorFunction=null}else{this["toWireType"]=nonConstNoSmartPtrRawPointerToWireType;this.destructorFunction=null}}else{this["toWireType"]=genericPointerToWireType}}function replacePublicSymbol(name,value,numArguments){if(!Module.hasOwnProperty(name)){throwInternalError("Replacing nonexistant public symbol")}if(undefined!==Module[name].overloadTable&&undefined!==numArguments){Module[name].overloadTable[numArguments]=value}else{Module[name]=value;Module[name].argCount=numArguments}}function dynCallLegacy(sig,ptr,args){var f=Module["dynCall_"+sig];return args&&args.length?f.apply(null,[ptr].concat(args)):f.call(null,ptr)}function dynCall(sig,ptr,args){if(sig.indexOf("j")!=-1){return dynCallLegacy(sig,ptr,args)}return wasmTable.get(ptr).apply(null,args)}function getDynCaller(sig,ptr){var argCache=[];return function(){argCache.length=arguments.length;for(var i=0;i0?", ":"")+argsListWired}invokerFnBody+=(returns?"var rv = ":"")+"invoker(fn"+(argsListWired.length>0?", ":"")+argsListWired+");\n";if(needsDestructorStack){invokerFnBody+="runDestructors(destructors);\n"}else{for(var i=isClassMethodFunc?1:2;i>2)+i])}return array}function __embind_register_class_class_function(rawClassType,methodName,argCount,rawArgTypesAddr,invokerSignature,rawInvoker,fn){var rawArgTypes=heap32VectorToArray(argCount,rawArgTypesAddr);methodName=readLatin1String(methodName);rawInvoker=embind__requireFunction(invokerSignature,rawInvoker);whenDependentTypesAreResolved([],[rawClassType],function(classType){classType=classType[0];var humanName=classType.name+"."+methodName;function unboundTypesHandler(){throwUnboundTypeError("Cannot call "+humanName+" due to unbound types",rawArgTypes)}var proto=classType.registeredClass.constructor;if(undefined===proto[methodName]){unboundTypesHandler.argCount=argCount-1;proto[methodName]=unboundTypesHandler}else{ensureOverloadTable(proto,methodName,humanName);proto[methodName].overloadTable[argCount-1]=unboundTypesHandler}whenDependentTypesAreResolved([],rawArgTypes,function(argTypes){var invokerArgsArray=[argTypes[0],null].concat(argTypes.slice(1));var func=craftInvokerFunction(humanName,invokerArgsArray,null,rawInvoker,fn);if(undefined===proto[methodName].overloadTable){func.argCount=argCount-1;proto[methodName]=func}else{proto[methodName].overloadTable[argCount-1]=func}return[]});return[]})}function __embind_register_class_constructor(rawClassType,argCount,rawArgTypesAddr,invokerSignature,invoker,rawConstructor){assert(argCount>0);var rawArgTypes=heap32VectorToArray(argCount,rawArgTypesAddr);invoker=embind__requireFunction(invokerSignature,invoker);var args=[rawConstructor];var destructors=[];whenDependentTypesAreResolved([],[rawClassType],function(classType){classType=classType[0];var humanName="constructor "+classType.name;if(undefined===classType.registeredClass.constructor_body){classType.registeredClass.constructor_body=[]}if(undefined!==classType.registeredClass.constructor_body[argCount-1]){throw new BindingError("Cannot register multiple constructors with identical number of parameters ("+(argCount-1)+") for class '"+classType.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!")}classType.registeredClass.constructor_body[argCount-1]=function unboundTypeHandler(){throwUnboundTypeError("Cannot construct "+classType.name+" due to unbound types",rawArgTypes)};whenDependentTypesAreResolved([],rawArgTypes,function(argTypes){classType.registeredClass.constructor_body[argCount-1]=function constructor_body(){if(arguments.length!==argCount-1){throwBindingError(humanName+" called with "+arguments.length+" arguments, expected "+(argCount-1))}destructors.length=0;args.length=argCount;for(var i=1;i4&&0===--emval_handle_array[handle].refcount){emval_handle_array[handle]=undefined;emval_free_list.push(handle)}}function count_emval_handles(){var count=0;for(var i=5;i>1])};case 2:return function(pointer){var heap=signed?HEAP32:HEAPU32;return this["fromWireType"](heap[pointer>>2])};default:throw new TypeError("Unknown integer type: "+name)}}function __embind_register_enum(rawType,name,size,isSigned){var shift=getShiftFromSize(size);name=readLatin1String(name);function ctor(){}ctor.values={};registerType(rawType,{name:name,constructor:ctor,"fromWireType":function(c){return this.constructor.values[c]},"toWireType":function(destructors,c){return c.value},"argPackAdvance":8,"readValueFromPointer":enumReadValueFromPointer(name,shift,isSigned),destructorFunction:null});exposePublicSymbol(name,ctor)}function requireRegisteredType(rawType,humanName){var impl=registeredTypes[rawType];if(undefined===impl){throwBindingError(humanName+" has unknown type "+getTypeName(rawType))}return impl}function __embind_register_enum_value(rawEnumType,name,enumValue){var enumType=requireRegisteredType(rawEnumType,"enum");name=readLatin1String(name);var Enum=enumType.constructor;var Value=Object.create(enumType.constructor.prototype,{value:{value:enumValue},constructor:{value:createNamedFunction(enumType.name+"_"+name,function(){})}});Enum.values[enumValue]=Value;Enum[name]=Value}function _embind_repr(v){if(v===null){return"null"}var t=typeof v;if(t==="object"||t==="array"||t==="function"){return v.toString()}else{return""+v}}function floatReadValueFromPointer(name,shift){switch(shift){case 2:return function(pointer){return this["fromWireType"](HEAPF32[pointer>>2])};case 3:return function(pointer){return this["fromWireType"](HEAPF64[pointer>>3])};default:throw new TypeError("Unknown float type: "+name)}}function __embind_register_float(rawType,name,size){var shift=getShiftFromSize(size);name=readLatin1String(name);registerType(rawType,{name:name,"fromWireType":function(value){return value},"toWireType":function(destructors,value){if(typeof value!=="number"&&typeof value!=="boolean"){throw new TypeError('Cannot convert "'+_embind_repr(value)+'" to '+this.name)}return value},"argPackAdvance":8,"readValueFromPointer":floatReadValueFromPointer(name,shift),destructorFunction:null})}function __embind_register_function(name,argCount,rawArgTypesAddr,signature,rawInvoker,fn){var argTypes=heap32VectorToArray(argCount,rawArgTypesAddr);name=readLatin1String(name);rawInvoker=embind__requireFunction(signature,rawInvoker);exposePublicSymbol(name,function(){throwUnboundTypeError("Cannot call "+name+" due to unbound types",argTypes)},argCount-1);whenDependentTypesAreResolved([],argTypes,function(argTypes){var invokerArgsArray=[argTypes[0],null].concat(argTypes.slice(1));replacePublicSymbol(name,craftInvokerFunction(name,invokerArgsArray,null,rawInvoker,fn),argCount-1);return[]})}function integerReadValueFromPointer(name,shift,signed){switch(shift){case 0:return signed?function readS8FromPointer(pointer){return HEAP8[pointer]}:function readU8FromPointer(pointer){return HEAPU8[pointer]};case 1:return signed?function readS16FromPointer(pointer){return HEAP16[pointer>>1]}:function readU16FromPointer(pointer){return HEAPU16[pointer>>1]};case 2:return signed?function readS32FromPointer(pointer){return HEAP32[pointer>>2]}:function readU32FromPointer(pointer){return HEAPU32[pointer>>2]};default:throw new TypeError("Unknown integer type: "+name)}}function __embind_register_integer(primitiveType,name,size,minRange,maxRange){name=readLatin1String(name);if(maxRange===-1){maxRange=4294967295}var shift=getShiftFromSize(size);var fromWireType=function(value){return value};if(minRange===0){var bitshift=32-8*size;fromWireType=function(value){return value<>>bitshift}}var isUnsignedType=name.indexOf("unsigned")!=-1;registerType(primitiveType,{name:name,"fromWireType":fromWireType,"toWireType":function(destructors,value){if(typeof value!=="number"&&typeof value!=="boolean"){throw new TypeError('Cannot convert "'+_embind_repr(value)+'" to '+this.name)}if(valuemaxRange){throw new TypeError('Passing a number "'+_embind_repr(value)+'" from JS side to C/C++ side to an argument of type "'+name+'", which is outside the valid range ['+minRange+", "+maxRange+"]!")}return isUnsignedType?value>>>0:value|0},"argPackAdvance":8,"readValueFromPointer":integerReadValueFromPointer(name,shift,minRange!==0),destructorFunction:null})}function __embind_register_memory_view(rawType,dataTypeIndex,name){var typeMapping=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];var TA=typeMapping[dataTypeIndex];function decodeMemoryView(handle){handle=handle>>2;var heap=HEAPU32;var size=heap[handle];var data=heap[handle+1];return new TA(buffer,data,size)}name=readLatin1String(name);registerType(rawType,{name:name,"fromWireType":decodeMemoryView,"argPackAdvance":8,"readValueFromPointer":decodeMemoryView},{ignoreDuplicateRegistrations:true})}function __embind_register_std_string(rawType,name){name=readLatin1String(name);var stdStringIsUTF8=name==="std::string";registerType(rawType,{name:name,"fromWireType":function(value){var length=HEAPU32[value>>2];var str;if(stdStringIsUTF8){var decodeStartPtr=value+4;for(var i=0;i<=length;++i){var currentBytePtr=value+4+i;if(i==length||HEAPU8[currentBytePtr]==0){var maxRead=currentBytePtr-decodeStartPtr;var stringSegment=UTF8ToString(decodeStartPtr,maxRead);if(str===undefined){str=stringSegment}else{str+=String.fromCharCode(0);str+=stringSegment}decodeStartPtr=currentBytePtr+1}}}else{var a=new Array(length);for(var i=0;i>2]=length;if(stdStringIsUTF8&&valueIsOfTypeString){stringToUTF8(value,ptr+4,length+1)}else{if(valueIsOfTypeString){for(var i=0;i255){_free(ptr);throwBindingError("String has UTF-16 code units that do not fit in 8 bits")}HEAPU8[ptr+4+i]=charCode}}else{for(var i=0;i>2];var HEAP=getHeap();var str;var decodeStartPtr=value+4;for(var i=0;i<=length;++i){var currentBytePtr=value+4+i*charSize;if(i==length||HEAP[currentBytePtr>>shift]==0){var maxReadBytes=currentBytePtr-decodeStartPtr;var stringSegment=decodeString(decodeStartPtr,maxReadBytes);if(str===undefined){str=stringSegment}else{str+=String.fromCharCode(0);str+=stringSegment}decodeStartPtr=currentBytePtr+charSize}}_free(value);return str},"toWireType":function(destructors,value){if(!(typeof value==="string")){throwBindingError("Cannot pass non-string to C++ string type "+name)}var length=lengthBytesUTF(value);var ptr=_malloc(4+length+charSize);HEAPU32[ptr>>2]=length>>shift;encodeString(value,ptr+4,length+charSize);if(destructors!==null){destructors.push(_free,ptr)}return ptr},"argPackAdvance":8,"readValueFromPointer":simpleReadValueFromPointer,destructorFunction:function(ptr){_free(ptr)}})}function __embind_register_void(rawType,name){name=readLatin1String(name);registerType(rawType,{isVoid:true,name:name,"argPackAdvance":0,"fromWireType":function(){return undefined},"toWireType":function(destructors,o){return undefined}})}function requireHandle(handle){if(!handle){throwBindingError("Cannot use deleted val. handle = "+handle)}return emval_handle_array[handle].value}function __emval_as(handle,returnType,destructorsRef){handle=requireHandle(handle);returnType=requireRegisteredType(returnType,"emval::as");var destructors=[];var rd=__emval_register(destructors);HEAP32[destructorsRef>>2]=rd;return returnType["toWireType"](destructors,handle)}var emval_symbols={};function getStringOrSymbol(address){var symbol=emval_symbols[address];if(symbol===undefined){return readLatin1String(address)}else{return symbol}}var emval_methodCallers=[];function __emval_call_void_method(caller,handle,methodName,args){caller=emval_methodCallers[caller];handle=requireHandle(handle);methodName=getStringOrSymbol(methodName);caller(handle,methodName,null,args)}function __emval_addMethodCaller(caller){var id=emval_methodCallers.length;emval_methodCallers.push(caller);return id}function __emval_lookupTypes(argCount,argTypes){var a=new Array(argCount);for(var i=0;i>2)+i],"parameter "+i)}return a}function __emval_get_method_caller(argCount,argTypes){var types=__emval_lookupTypes(argCount,argTypes);var retType=types[0];var signatureName=retType.name+"_$"+types.slice(1).map(function(t){return t.name}).join("_")+"$";var params=["retType"];var args=[retType];var argsList="";for(var i=0;i4){emval_handle_array[handle].refcount+=1}}function craftEmvalAllocator(argCount){var argsList="";for(var i=0;i>> 2) + "+i+'], "parameter '+i+'");\n'+"var arg"+i+" = argType"+i+".readValueFromPointer(args);\n"+"args += argType"+i+"['argPackAdvance'];\n"}functionBody+="var obj = new constructor("+argsList+");\n"+"return __emval_register(obj);\n"+"}\n";return new Function("requireRegisteredType","Module","__emval_register",functionBody)(requireRegisteredType,Module,__emval_register)}var emval_newers={};function __emval_new(handle,argCount,argTypes,args){handle=requireHandle(handle);var newer=emval_newers[argCount];if(!newer){newer=craftEmvalAllocator(argCount);emval_newers[argCount]=newer}return newer(handle,argTypes,args)}function __emval_new_cstring(v){return __emval_register(getStringOrSymbol(v))}function __emval_new_object(){return __emval_register({})}function __emval_run_destructors(handle){var destructors=emval_handle_array[handle].value;runDestructors(destructors);__emval_decref(handle)}function __emval_set_property(handle,key,value){handle=requireHandle(handle);key=requireHandle(key);value=requireHandle(value);handle[key]=value}function __emval_take_value(type,argv){type=requireRegisteredType(type,"_emval_take_value");var v=type["readValueFromPointer"](argv);return __emval_register(v)}function _abort(){abort()}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_get_heap_size(){return HEAPU8.length}function emscripten_realloc_buffer(size){try{wasmMemory.grow(size-buffer.byteLength+65535>>>16);updateGlobalBufferAndViews(wasmMemory.buffer);return 1}catch(e){}}function _emscripten_resize_heap(requestedSize){var oldSize=_emscripten_get_heap_size();var maxHeapSize=2147483648;if(requestedSize>maxHeapSize){return false}for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize*(1+.2/cutDown);overGrownHeapSize=Math.min(overGrownHeapSize,requestedSize+100663296);var newSize=Math.min(maxHeapSize,alignUp(Math.max(requestedSize,overGrownHeapSize),65536));var replacement=emscripten_realloc_buffer(newSize);if(replacement){return true}}return false}var SYSCALLS={mappings:{},buffers:[null,[],[]],printChar:function(stream,curr){var buffer=SYSCALLS.buffers[stream];if(curr===0||curr===10){(stream===1?out:err)(UTF8ArrayToString(buffer,0));buffer.length=0}else{buffer.push(curr)}},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},get64:function(low,high){return low}};function _fd_close(fd){return 0}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){}function _fd_write(fd,iov,iovcnt,pnum){var num=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];for(var j=0;j>2]=num;return 0}function _setTempRet0($i){setTempRet0($i|0)}embind_init_charCodes();BindingError=Module["BindingError"]=extendError(Error,"BindingError");InternalError=Module["InternalError"]=extendError(Error,"InternalError");init_ClassHandle();init_RegisteredPointer();init_embind();UnboundTypeError=Module["UnboundTypeError"]=extendError(Error,"UnboundTypeError");init_emval();var asmLibraryArg={"a":___assert_fail,"J":__embind_register_bool,"m":__embind_register_class,"w":__embind_register_class_class_function,"r":__embind_register_class_constructor,"l":__embind_register_class_function,"h":__embind_register_class_property,"I":__embind_register_emval,"v":__embind_register_enum,"c":__embind_register_enum_value,"y":__embind_register_float,"B":__embind_register_function,"i":__embind_register_integer,"g":__embind_register_memory_view,"z":__embind_register_std_string,"t":__embind_register_std_wstring,"K":__embind_register_void,"k":__emval_as,"n":__emval_call_void_method,"b":__emval_decref,"o":__emval_get_method_caller,"q":__emval_get_module_property,"e":__emval_get_property,"f":__emval_incref,"p":__emval_new,"d":__emval_new_cstring,"C":__emval_new_object,"j":__emval_run_destructors,"A":__emval_set_property,"u":__emval_take_value,"s":_abort,"F":_emscripten_memcpy_big,"G":_emscripten_resize_heap,"H":_fd_close,"D":_fd_seek,"x":_fd_write,"E":_setTempRet0};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["M"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["N"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["P"]).apply(null,arguments)};var ___getTypeName=Module["___getTypeName"]=function(){return(___getTypeName=Module["___getTypeName"]=Module["asm"]["Q"]).apply(null,arguments)};var ___embind_register_native_and_builtin_types=Module["___embind_register_native_and_builtin_types"]=function(){return(___embind_register_native_and_builtin_types=Module["___embind_register_native_and_builtin_types"]=Module["asm"]["R"]).apply(null,arguments)};var dynCall_jiji=Module["dynCall_jiji"]=function(){return(dynCall_jiji=Module["dynCall_jiji"]=Module["asm"]["S"]).apply(null,arguments)};var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function run(args){args=args||arguments_;if(runDependencies>0){return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();readyPromiseResolve(Module);if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}run(); + + + return MSC_TRANSCODER.ready +} +); +})(); +if (typeof exports === 'object' && typeof module === 'object') + module.exports = MSC_TRANSCODER; +else if (typeof define === 'function' && define['amd']) + define([], function() { return MSC_TRANSCODER; }); +else if (typeof exports === 'object') + exports["MSC_TRANSCODER"] = MSC_TRANSCODER; \ No newline at end of file diff --git a/src/assets/js/ktx2Transcoders/msc_basis_transcoder.wasm b/src/assets/js/ktx2Transcoders/msc_basis_transcoder.wasm new file mode 100644 index 0000000..ca01a2c Binary files /dev/null and b/src/assets/js/ktx2Transcoders/msc_basis_transcoder.wasm differ diff --git a/src/assets/js/ktx2Transcoders/uastc_astc.wasm b/src/assets/js/ktx2Transcoders/uastc_astc.wasm new file mode 100644 index 0000000..1e39925 Binary files /dev/null and b/src/assets/js/ktx2Transcoders/uastc_astc.wasm differ diff --git a/src/assets/js/ktx2Transcoders/uastc_bc7.wasm b/src/assets/js/ktx2Transcoders/uastc_bc7.wasm new file mode 100644 index 0000000..6b1c00e Binary files /dev/null and b/src/assets/js/ktx2Transcoders/uastc_bc7.wasm differ diff --git a/src/assets/js/ktx2Transcoders/uastc_rgba32_srgb.wasm b/src/assets/js/ktx2Transcoders/uastc_rgba32_srgb.wasm new file mode 100644 index 0000000..8677b65 Binary files /dev/null and b/src/assets/js/ktx2Transcoders/uastc_rgba32_srgb.wasm differ diff --git a/src/assets/js/ktx2Transcoders/uastc_rgba32_unorm.wasm b/src/assets/js/ktx2Transcoders/uastc_rgba32_unorm.wasm new file mode 100644 index 0000000..42bc266 Binary files /dev/null and b/src/assets/js/ktx2Transcoders/uastc_rgba32_unorm.wasm differ diff --git a/src/assets/js/materialsLibrary/babylonjs.materials.js b/src/assets/js/materialsLibrary/babylonjs.materials.js new file mode 100644 index 0000000..a75187d --- /dev/null +++ b/src/assets/js/materialsLibrary/babylonjs.materials.js @@ -0,0 +1,7574 @@ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(require("babylonjs")); + else if(typeof define === 'function' && define.amd) + define("babylonjs-materials", ["babylonjs"], factory); + else if(typeof exports === 'object') + exports["babylonjs-materials"] = factory(require("babylonjs")); + else + root["MATERIALS"] = factory(root["BABYLON"]); +})((typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : this), function(__WEBPACK_EXTERNAL_MODULE_babylonjs_Misc_decorators__) { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./legacy/legacy.ts"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "../../node_modules/tslib/tslib.es6.js": +/*!***********************************************************!*\ + !*** C:/Repos/Babylon.js/node_modules/tslib/tslib.es6.js ***! + \***********************************************************/ +/*! exports provided: __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __createBinding, __exportStar, __values, __read, __spread, __spreadArrays, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__extends", function() { return __extends; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__assign", function() { return __assign; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__rest", function() { return __rest; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__decorate", function() { return __decorate; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__param", function() { return __param; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__metadata", function() { return __metadata; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__awaiter", function() { return __awaiter; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__generator", function() { return __generator; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__createBinding", function() { return __createBinding; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__exportStar", function() { return __exportStar; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__values", function() { return __values; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__read", function() { return __read; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spread", function() { return __spread; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spreadArrays", function() { return __spreadArrays; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__await", function() { return __await; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncGenerator", function() { return __asyncGenerator; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncDelegator", function() { return __asyncDelegator; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncValues", function() { return __asyncValues; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__makeTemplateObject", function() { return __makeTemplateObject; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__importStar", function() { return __importStar; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__importDefault", function() { return __importDefault; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__classPrivateFieldGet", function() { return __classPrivateFieldGet; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__classPrivateFieldSet", function() { return __classPrivateFieldSet; }); +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +/* global Reflect, Promise */ + +var extendStatics = function(d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); +}; + +function __extends(d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +} + +var __assign = function() { + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + } + return __assign.apply(this, arguments); +} + +function __rest(s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; +} + +function __decorate(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +} + +function __param(paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +} + +function __metadata(metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); +} + +function __awaiter(thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} + +function __generator(thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +} + +var __createBinding = Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +}); + +function __exportStar(m, o) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); +} + +function __values(o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); +} + +function __read(o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; +} + +function __spread() { + for (var ar = [], i = 0; i < arguments.length; i++) + ar = ar.concat(__read(arguments[i])); + return ar; +} + +function __spreadArrays() { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; +}; + +function __await(v) { + return this instanceof __await ? (this.v = v, this) : new __await(v); +} + +function __asyncGenerator(thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } +} + +function __asyncDelegator(o) { + var i, p; + return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } +} + +function __asyncValues(o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } +} + +function __makeTemplateObject(cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; +}; + +var __setModuleDefault = Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}; + +function __importStar(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +} + +function __importDefault(mod) { + return (mod && mod.__esModule) ? mod : { default: mod }; +} + +function __classPrivateFieldGet(receiver, privateMap) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to get private field on non-instance"); + } + return privateMap.get(receiver); +} + +function __classPrivateFieldSet(receiver, privateMap, value) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to set private field on non-instance"); + } + privateMap.set(receiver, value); + return value; +} + + +/***/ }), + +/***/ "../../node_modules/webpack/buildin/global.js": +/*!***********************************!*\ + !*** (webpack)/buildin/global.js ***! + \***********************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +var g; + +// This works in non-strict mode +g = (function() { + return this; +})(); + +try { + // This works if eval is allowed (see CSP) + g = g || new Function("return this")(); +} catch (e) { + // This works if the window reference is available + if (typeof window === "object") g = window; +} + +// g can still be undefined, but nothing to do about it... +// We return undefined, instead of nothing here, so it's +// easier to handle this case. if(!global) { ...} + +module.exports = g; + + +/***/ }), + +/***/ "./cell/cell.fragment.ts": +/*!*******************************!*\ + !*** ./cell/cell.fragment.ts ***! + \*******************************/ +/*! exports provided: cellPixelShader */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cellPixelShader", function() { return cellPixelShader; }); +/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators"); +/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__); + + + + + + + + + + + + + +var name = 'cellPixelShader'; +var shader = "precision highp float;\n\nuniform vec3 vEyePosition;\nuniform vec4 vDiffuseColor;\n\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n\n#include\n\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include\n#include\n\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;\nuniform sampler2D diffuseSampler;\nuniform vec2 vDiffuseInfos;\n#endif\n#include\n\n#include\n\nvec3 computeCustomDiffuseLighting(lightingInfo info,vec3 diffuseBase,float shadow)\n{\ndiffuseBase=info.diffuse*shadow;\n#ifdef CELLBASIC\nfloat level=1.0;\nif (info.ndl<0.5)\nlevel=0.5;\ndiffuseBase.rgb*vec3(level,level,level);\n#else\nfloat ToonThresholds[4];\nToonThresholds[0]=0.95;\nToonThresholds[1]=0.5;\nToonThresholds[2]=0.2;\nToonThresholds[3]=0.03;\nfloat ToonBrightnessLevels[5];\nToonBrightnessLevels[0]=1.0;\nToonBrightnessLevels[1]=0.8;\nToonBrightnessLevels[2]=0.6;\nToonBrightnessLevels[3]=0.35;\nToonBrightnessLevels[4]=0.2;\nif (info.ndl>ToonThresholds[0])\n{\ndiffuseBase.rgb*=ToonBrightnessLevels[0];\n}\nelse if (info.ndl>ToonThresholds[1])\n{\ndiffuseBase.rgb*=ToonBrightnessLevels[1];\n}\nelse if (info.ndl>ToonThresholds[2])\n{\ndiffuseBase.rgb*=ToonBrightnessLevels[2];\n}\nelse if (info.ndl>ToonThresholds[3])\n{\ndiffuseBase.rgb*=ToonBrightnessLevels[3];\n}\nelse\n{\ndiffuseBase.rgb*=ToonBrightnessLevels[4];\n}\n#endif\nreturn max(diffuseBase,vec3(0.2));\n}\nvoid main(void)\n{\n#include\nvec3 viewDirectionW=normalize(vEyePosition-vPositionW);\n\nvec4 baseColor=vec4(1.,1.,1.,1.);\nvec3 diffuseColor=vDiffuseColor.rgb;\n\nfloat alpha=vDiffuseColor.a;\n#ifdef DIFFUSE\nbaseColor=texture2D(diffuseSampler,vDiffuseUV);\n#ifdef ALPHATEST\nif (baseColor.a<0.4)\ndiscard;\n#endif\n#include\nbaseColor.rgb*=vDiffuseInfos.y;\n#endif\n#ifdef VERTEXCOLOR\nbaseColor.rgb*=vColor.rgb;\n#endif\n\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);\n#endif\n\nlightingInfo info;\nvec3 diffuseBase=vec3(0.,0.,0.);\nfloat shadow=1.;\nfloat glossiness=0.;\n#ifdef SPECULARTERM\nvec3 specularBase=vec3(0.,0.,0.);\n#endif\n#include[0..maxSimultaneousLights]\n#ifdef VERTEXALPHA\nalpha*=vColor.a;\n#endif\nvec3 finalDiffuse=clamp(diffuseBase*diffuseColor,0.0,1.0)*baseColor.rgb;\n\nvec4 color=vec4(finalDiffuse,alpha);\n#include\ngl_FragColor=color;\n#include\n}"; +babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__["Effect"].ShadersStore[name] = shader; +/** @hidden */ +var cellPixelShader = { name: name, shader: shader }; + + +/***/ }), + +/***/ "./cell/cell.vertex.ts": +/*!*****************************!*\ + !*** ./cell/cell.vertex.ts ***! + \*****************************/ +/*! exports provided: cellVertexShader */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cellVertexShader", function() { return cellVertexShader; }); +/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators"); +/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__); + + + + + + + + + + + + +var name = 'cellVertexShader'; +var shader = "precision highp float;\n\nattribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include\n\n#include\nuniform mat4 view;\nuniform mat4 viewProjection;\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;\nuniform mat4 diffuseMatrix;\nuniform vec2 vDiffuseInfos;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\n\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include\n#include\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\nvoid main(void) {\n#include\n#include\nvec4 worldPos=finalWorld*vec4(position,1.0);\ngl_Position=viewProjection*worldPos;\nvPositionW=vec3(worldPos);\n#ifdef NORMAL\nvNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));\n#endif\n\n#ifndef UV1\nvec2 uv=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\n#ifdef DIFFUSE\nif (vDiffuseInfos.x == 0.)\n{\nvDiffuseUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));\n}\nelse\n{\nvDiffuseUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n\n#include\n\n#include\n#include[0..maxSimultaneousLights]\n\n#ifdef VERTEXCOLOR\nvColor=color;\n#endif\n\n#ifdef POINTSIZE\ngl_PointSize=pointSize;\n#endif\n}\n"; +babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__["Effect"].ShadersStore[name] = shader; +/** @hidden */ +var cellVertexShader = { name: name, shader: shader }; + + +/***/ }), + +/***/ "./cell/cellMaterial.ts": +/*!******************************!*\ + !*** ./cell/cellMaterial.ts ***! + \******************************/ +/*! exports provided: CellMaterial */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CellMaterial", function() { return CellMaterial; }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js"); +/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators"); +/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _cell_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./cell.fragment */ "./cell/cell.fragment.ts"); +/* harmony import */ var _cell_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./cell.vertex */ "./cell/cell.vertex.ts"); + + + + + + + + + + + + + +var CellMaterialDefines = /** @class */ (function (_super) { + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(CellMaterialDefines, _super); + function CellMaterialDefines() { + var _this = _super.call(this) || this; + _this.DIFFUSE = false; + _this.CLIPPLANE = false; + _this.CLIPPLANE2 = false; + _this.CLIPPLANE3 = false; + _this.CLIPPLANE4 = false; + _this.CLIPPLANE5 = false; + _this.CLIPPLANE6 = false; + _this.ALPHATEST = false; + _this.POINTSIZE = false; + _this.FOG = false; + _this.NORMAL = false; + _this.UV1 = false; + _this.UV2 = false; + _this.VERTEXCOLOR = false; + _this.VERTEXALPHA = false; + _this.NUM_BONE_INFLUENCERS = 0; + _this.BonesPerMesh = 0; + _this.INSTANCES = false; + _this.NDOTL = true; + _this.CUSTOMUSERLIGHTING = true; + _this.CELLBASIC = true; + _this.DEPTHPREPASS = false; + _this.IMAGEPROCESSINGPOSTPROCESS = false; + _this.rebuild(); + return _this; + } + return CellMaterialDefines; +}(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialDefines"])); +var CellMaterial = /** @class */ (function (_super) { + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(CellMaterial, _super); + function CellMaterial(name, scene) { + var _this = _super.call(this, name, scene) || this; + _this.diffuseColor = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](1, 1, 1); + _this._computeHighLevel = false; + _this._disableLighting = false; + _this._maxSimultaneousLights = 4; + return _this; + } + CellMaterial.prototype.needAlphaBlending = function () { + return (this.alpha < 1.0); + }; + CellMaterial.prototype.needAlphaTesting = function () { + return false; + }; + CellMaterial.prototype.getAlphaTestTexture = function () { + return null; + }; + // Methods + CellMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) { + if (this.isFrozen) { + if (subMesh.effect && subMesh.effect._wasPreviouslyReady) { + return true; + } + } + if (!subMesh._materialDefines) { + subMesh._materialDefines = new CellMaterialDefines(); + } + var defines = subMesh._materialDefines; + var scene = this.getScene(); + if (this._isReadyForSubMesh(subMesh)) { + return true; + } + var engine = scene.getEngine(); + // Textures + if (defines._areTexturesDirty) { + defines._needUVs = false; + if (scene.texturesEnabled) { + if (this._diffuseTexture && babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialFlags"].DiffuseTextureEnabled) { + if (!this._diffuseTexture.isReady()) { + return false; + } + else { + defines._needUVs = true; + defines.DIFFUSE = true; + } + } + } + } + // High level + defines.CELLBASIC = !this.computeHighLevel; + // Misc. + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForMisc(mesh, scene, false, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(mesh), defines); + // Lights + defines._needNormals = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForLights(scene, mesh, defines, false, this._maxSimultaneousLights, this._disableLighting); + // Values that need to be evaluated on every frame + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForFrameBoundValues(scene, engine, defines, useInstances ? true : false); + // Attribs + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForAttributes(mesh, defines, true, true); + // Get correct effect + if (defines.isDirty) { + defines.markAsProcessed(); + scene.resetCachedMaterial(); + // Fallbacks + var fallbacks = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["EffectFallbacks"](); + if (defines.FOG) { + fallbacks.addFallback(1, "FOG"); + } + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].HandleFallbacksForShadows(defines, fallbacks, this.maxSimultaneousLights); + if (defines.NUM_BONE_INFLUENCERS > 0) { + fallbacks.addCPUSkinningFallback(0, mesh); + } + defines.IMAGEPROCESSINGPOSTPROCESS = scene.imageProcessingConfiguration.applyByPostProcess; + //Attributes + var attribs = [babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].PositionKind]; + if (defines.NORMAL) { + attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].NormalKind); + } + if (defines.UV1) { + attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].UVKind); + } + if (defines.UV2) { + attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].UV2Kind); + } + if (defines.VERTEXCOLOR) { + attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].ColorKind); + } + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareAttributesForBones(attribs, mesh, defines, fallbacks); + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareAttributesForInstances(attribs, defines); + var shaderName = "cell"; + var join = defines.toString(); + var uniforms = ["world", "view", "viewProjection", "vEyePosition", "vLightsType", "vDiffuseColor", + "vFogInfos", "vFogColor", "pointSize", + "vDiffuseInfos", + "mBones", + "vClipPlane", "vClipPlane2", "vClipPlane3", "vClipPlane4", "vClipPlane5", "vClipPlane6", "diffuseMatrix" + ]; + var samplers = ["diffuseSampler"]; + var uniformBuffers = new Array(); + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareUniformsAndSamplersList({ + uniformsNames: uniforms, + uniformBuffersNames: uniformBuffers, + samplers: samplers, + defines: defines, + maxSimultaneousLights: this.maxSimultaneousLights + }); + subMesh.setEffect(scene.getEngine().createEffect(shaderName, { + attributes: attribs, + uniformsNames: uniforms, + uniformBuffersNames: uniformBuffers, + samplers: samplers, + defines: join, + fallbacks: fallbacks, + onCompiled: this.onCompiled, + onError: this.onError, + indexParameters: { maxSimultaneousLights: this.maxSimultaneousLights - 1 } + }, engine), defines); + } + if (!subMesh.effect || !subMesh.effect.isReady()) { + return false; + } + defines._renderId = scene.getRenderId(); + subMesh.effect._wasPreviouslyReady = true; + return true; + }; + CellMaterial.prototype.bindForSubMesh = function (world, mesh, subMesh) { + var scene = this.getScene(); + var defines = subMesh._materialDefines; + if (!defines) { + return; + } + var effect = subMesh.effect; + if (!effect) { + return; + } + this._activeEffect = effect; + // Matrices + this.bindOnlyWorldMatrix(world); + this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix()); + // Bones + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindBonesParameters(mesh, this._activeEffect); + if (this._mustRebind(scene, effect)) { + // Textures + if (this._diffuseTexture && babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialFlags"].DiffuseTextureEnabled) { + this._activeEffect.setTexture("diffuseSampler", this._diffuseTexture); + this._activeEffect.setFloat2("vDiffuseInfos", this._diffuseTexture.coordinatesIndex, this._diffuseTexture.level); + this._activeEffect.setMatrix("diffuseMatrix", this._diffuseTexture.getTextureMatrix()); + } + // Clip plane + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindClipPlane(this._activeEffect, scene); + // Point size + if (this.pointsCloud) { + this._activeEffect.setFloat("pointSize", this.pointSize); + } + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindEyePosition(effect, scene); + } + this._activeEffect.setColor4("vDiffuseColor", this.diffuseColor, this.alpha * mesh.visibility); + // Lights + if (scene.lightsEnabled && !this.disableLighting) { + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindLights(scene, mesh, this._activeEffect, defines, this._maxSimultaneousLights); + } + // View + if (scene.fogEnabled && mesh.applyFog && scene.fogMode !== babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Scene"].FOGMODE_NONE) { + this._activeEffect.setMatrix("view", scene.getViewMatrix()); + } + // Fog + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindFogParameters(scene, mesh, this._activeEffect); + this._afterBind(mesh, this._activeEffect); + }; + CellMaterial.prototype.getAnimatables = function () { + var results = []; + if (this._diffuseTexture && this._diffuseTexture.animations && this._diffuseTexture.animations.length > 0) { + results.push(this._diffuseTexture); + } + return results; + }; + CellMaterial.prototype.getActiveTextures = function () { + var activeTextures = _super.prototype.getActiveTextures.call(this); + if (this._diffuseTexture) { + activeTextures.push(this._diffuseTexture); + } + return activeTextures; + }; + CellMaterial.prototype.hasTexture = function (texture) { + if (_super.prototype.hasTexture.call(this, texture)) { + return true; + } + return this._diffuseTexture === texture; + }; + CellMaterial.prototype.dispose = function (forceDisposeEffect) { + if (this._diffuseTexture) { + this._diffuseTexture.dispose(); + } + _super.prototype.dispose.call(this, forceDisposeEffect); + }; + CellMaterial.prototype.getClassName = function () { + return "CellMaterial"; + }; + CellMaterial.prototype.clone = function (name) { + var _this = this; + return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Clone(function () { return new CellMaterial(name, _this.getScene()); }, this); + }; + CellMaterial.prototype.serialize = function () { + var serializationObject = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Serialize(this); + serializationObject.customType = "BABYLON.CellMaterial"; + return serializationObject; + }; + // Statics + CellMaterial.Parse = function (source, scene, rootUrl) { + return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Parse(function () { return new CellMaterial(source.name, scene); }, source, scene, rootUrl); + }; + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("diffuseTexture") + ], CellMaterial.prototype, "_diffuseTexture", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty") + ], CellMaterial.prototype, "diffuseTexture", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsColor3"])("diffuse") + ], CellMaterial.prototype, "diffuseColor", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])("computeHighLevel") + ], CellMaterial.prototype, "_computeHighLevel", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty") + ], CellMaterial.prototype, "computeHighLevel", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])("disableLighting") + ], CellMaterial.prototype, "_disableLighting", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsLightsDirty") + ], CellMaterial.prototype, "disableLighting", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])("maxSimultaneousLights") + ], CellMaterial.prototype, "_maxSimultaneousLights", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsLightsDirty") + ], CellMaterial.prototype, "maxSimultaneousLights", void 0); + return CellMaterial; +}(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["PushMaterial"])); + +babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["_TypeStore"].RegisteredTypes["BABYLON.CellMaterial"] = CellMaterial; + + +/***/ }), + +/***/ "./cell/index.ts": +/*!***********************!*\ + !*** ./cell/index.ts ***! + \***********************/ +/*! exports provided: CellMaterial */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _cellMaterial__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./cellMaterial */ "./cell/cellMaterial.ts"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CellMaterial", function() { return _cellMaterial__WEBPACK_IMPORTED_MODULE_0__["CellMaterial"]; }); + + + + +/***/ }), + +/***/ "./custom/customMaterial.ts": +/*!**********************************!*\ + !*** ./custom/customMaterial.ts ***! + \**********************************/ +/*! exports provided: CustomShaderStructure, ShaderSpecialParts, CustomMaterial */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CustomShaderStructure", function() { return CustomShaderStructure; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ShaderSpecialParts", function() { return ShaderSpecialParts; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CustomMaterial", function() { return CustomMaterial; }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js"); +/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators"); +/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__); + + + + +var CustomShaderStructure = /** @class */ (function () { + function CustomShaderStructure() { + } + return CustomShaderStructure; +}()); + +var ShaderSpecialParts = /** @class */ (function () { + function ShaderSpecialParts() { + } + return ShaderSpecialParts; +}()); + +var CustomMaterial = /** @class */ (function (_super) { + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(CustomMaterial, _super); + function CustomMaterial(name, scene) { + var _this = _super.call(this, name, scene) || this; + _this.CustomParts = new ShaderSpecialParts(); + _this.customShaderNameResolve = _this.Builder; + _this.FragmentShader = babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__["Effect"].ShadersStore["defaultPixelShader"]; + _this.VertexShader = babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__["Effect"].ShadersStore["defaultVertexShader"]; + return _this; + } + CustomMaterial.prototype.AttachAfterBind = function (mesh, effect) { + if (this._newUniformInstances) { + for (var el in this._newUniformInstances) { + var ea = el.toString().split('-'); + if (ea[0] == 'vec2') { + effect.setVector2(ea[1], this._newUniformInstances[el]); + } + else if (ea[0] == 'vec3') { + effect.setVector3(ea[1], this._newUniformInstances[el]); + } + else if (ea[0] == 'vec4') { + effect.setVector4(ea[1], this._newUniformInstances[el]); + } + else if (ea[0] == 'mat4') { + effect.setMatrix(ea[1], this._newUniformInstances[el]); + } + else if (ea[0] == 'float') { + effect.setFloat(ea[1], this._newUniformInstances[el]); + } + } + } + if (this._newSamplerInstances) { + for (var el in this._newSamplerInstances) { + var ea = el.toString().split('-'); + if (ea[0] == 'sampler2D' && this._newSamplerInstances[el].isReady && this._newSamplerInstances[el].isReady()) { + effect.setTexture(ea[1], this._newSamplerInstances[el]); + } + } + } + }; + CustomMaterial.prototype.ReviewUniform = function (name, arr) { + if (name == "uniform" && this._newUniforms) { + for (var ind = 0; ind < this._newUniforms.length; ind++) { + if (this._customUniform[ind].indexOf('sampler') == -1) { + arr.push(this._newUniforms[ind]); + } + } + } + if (name == "sampler" && this._newUniforms) { + for (var ind = 0; ind < this._newUniforms.length; ind++) { + if (this._customUniform[ind].indexOf('sampler') != -1) { + arr.push(this._newUniforms[ind]); + } + } + } + return arr; + }; + CustomMaterial.prototype.Builder = function (shaderName, uniforms, uniformBuffers, samplers, defines, attributes) { + var _this = this; + if (attributes && this._customAttributes && this._customAttributes.length > 0) { + attributes.push.apply(attributes, this._customAttributes); + } + this.ReviewUniform("uniform", uniforms); + this.ReviewUniform("sampler", samplers); + if (this._isCreatedShader) { + return this._createdShaderName; + } + this._isCreatedShader = false; + CustomMaterial.ShaderIndexer++; + var name = "custom_" + CustomMaterial.ShaderIndexer; + var fn_afterBind = this._afterBind.bind(this); + this._afterBind = function (m, e) { + if (!e) { + return; + } + _this.AttachAfterBind(m, e); + try { + fn_afterBind(m, e); + } + catch (e) { } + }; + babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__["Effect"].ShadersStore[name + "VertexShader"] = this.VertexShader + .replace('#define CUSTOM_VERTEX_BEGIN', (this.CustomParts.Vertex_Begin ? this.CustomParts.Vertex_Begin : "")) + .replace('#define CUSTOM_VERTEX_DEFINITIONS', (this._customUniform ? this._customUniform.join("\n") : "") + (this.CustomParts.Vertex_Definitions ? this.CustomParts.Vertex_Definitions : "")) + .replace('#define CUSTOM_VERTEX_MAIN_BEGIN', (this.CustomParts.Vertex_MainBegin ? this.CustomParts.Vertex_MainBegin : "")) + .replace('#define CUSTOM_VERTEX_UPDATE_POSITION', (this.CustomParts.Vertex_Before_PositionUpdated ? this.CustomParts.Vertex_Before_PositionUpdated : "")) + .replace('#define CUSTOM_VERTEX_UPDATE_NORMAL', (this.CustomParts.Vertex_Before_NormalUpdated ? this.CustomParts.Vertex_Before_NormalUpdated : "")) + .replace('#define CUSTOM_VERTEX_MAIN_END', (this.CustomParts.Vertex_MainEnd ? this.CustomParts.Vertex_MainEnd : "")); + if (this.CustomParts.Vertex_After_WorldPosComputed) { + babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__["Effect"].ShadersStore[name + "VertexShader"] = babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__["Effect"].ShadersStore[name + "VertexShader"].replace('#define CUSTOM_VERTEX_UPDATE_WORLDPOS', this.CustomParts.Vertex_After_WorldPosComputed); + } + babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__["Effect"].ShadersStore[name + "PixelShader"] = this.FragmentShader + .replace('#define CUSTOM_FRAGMENT_BEGIN', (this.CustomParts.Fragment_Begin ? this.CustomParts.Fragment_Begin : "")) + .replace('#define CUSTOM_FRAGMENT_MAIN_BEGIN', (this.CustomParts.Fragment_MainBegin ? this.CustomParts.Fragment_MainBegin : "")) + .replace('#define CUSTOM_FRAGMENT_DEFINITIONS', (this._customUniform ? this._customUniform.join("\n") : "") + (this.CustomParts.Fragment_Definitions ? this.CustomParts.Fragment_Definitions : "")) + .replace('#define CUSTOM_FRAGMENT_UPDATE_DIFFUSE', (this.CustomParts.Fragment_Custom_Diffuse ? this.CustomParts.Fragment_Custom_Diffuse : "")) + .replace('#define CUSTOM_FRAGMENT_UPDATE_ALPHA', (this.CustomParts.Fragment_Custom_Alpha ? this.CustomParts.Fragment_Custom_Alpha : "")) + .replace('#define CUSTOM_FRAGMENT_BEFORE_LIGHTS', (this.CustomParts.Fragment_Before_Lights ? this.CustomParts.Fragment_Before_Lights : "")) + .replace('#define CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR', (this.CustomParts.Fragment_Before_FragColor ? this.CustomParts.Fragment_Before_FragColor : "")); + if (this.CustomParts.Fragment_Before_Fog) { + babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__["Effect"].ShadersStore[name + "PixelShader"] = babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__["Effect"].ShadersStore[name + "PixelShader"].replace('#define CUSTOM_FRAGMENT_BEFORE_FOG', this.CustomParts.Fragment_Before_Fog); + } + this._isCreatedShader = true; + this._createdShaderName = name; + return name; + }; + CustomMaterial.prototype.AddUniform = function (name, kind, param) { + if (!this._customUniform) { + this._customUniform = new Array(); + this._newUniforms = new Array(); + this._newSamplerInstances = {}; + this._newUniformInstances = {}; + } + if (param) { + if (kind.indexOf("sampler") != -1) { + this._newSamplerInstances[kind + "-" + name] = param; + } + else { + this._newUniformInstances[kind + "-" + name] = param; + } + } + this._customUniform.push("uniform " + kind + " " + name + ";"); + this._newUniforms.push(name); + return this; + }; + CustomMaterial.prototype.AddAttribute = function (name) { + if (!this._customAttributes) { + this._customAttributes = []; + } + this._customAttributes.push(name); + return this; + }; + CustomMaterial.prototype.Fragment_Begin = function (shaderPart) { + this.CustomParts.Fragment_Begin = shaderPart; + return this; + }; + CustomMaterial.prototype.Fragment_Definitions = function (shaderPart) { + this.CustomParts.Fragment_Definitions = shaderPart; + return this; + }; + CustomMaterial.prototype.Fragment_MainBegin = function (shaderPart) { + this.CustomParts.Fragment_MainBegin = shaderPart; + return this; + }; + CustomMaterial.prototype.Fragment_Custom_Diffuse = function (shaderPart) { + this.CustomParts.Fragment_Custom_Diffuse = shaderPart.replace("result", "diffuseColor"); + return this; + }; + CustomMaterial.prototype.Fragment_Custom_Alpha = function (shaderPart) { + this.CustomParts.Fragment_Custom_Alpha = shaderPart.replace("result", "alpha"); + return this; + }; + CustomMaterial.prototype.Fragment_Before_Lights = function (shaderPart) { + this.CustomParts.Fragment_Before_Lights = shaderPart; + return this; + }; + CustomMaterial.prototype.Fragment_Before_Fog = function (shaderPart) { + this.CustomParts.Fragment_Before_Fog = shaderPart; + return this; + }; + CustomMaterial.prototype.Fragment_Before_FragColor = function (shaderPart) { + this.CustomParts.Fragment_Before_FragColor = shaderPart.replace("result", "color"); + return this; + }; + CustomMaterial.prototype.Vertex_Begin = function (shaderPart) { + this.CustomParts.Vertex_Begin = shaderPart; + return this; + }; + CustomMaterial.prototype.Vertex_Definitions = function (shaderPart) { + this.CustomParts.Vertex_Definitions = shaderPart; + return this; + }; + CustomMaterial.prototype.Vertex_MainBegin = function (shaderPart) { + this.CustomParts.Vertex_MainBegin = shaderPart; + return this; + }; + CustomMaterial.prototype.Vertex_Before_PositionUpdated = function (shaderPart) { + this.CustomParts.Vertex_Before_PositionUpdated = shaderPart.replace("result", "positionUpdated"); + return this; + }; + CustomMaterial.prototype.Vertex_Before_NormalUpdated = function (shaderPart) { + this.CustomParts.Vertex_Before_NormalUpdated = shaderPart.replace("result", "normalUpdated"); + return this; + }; + CustomMaterial.prototype.Vertex_After_WorldPosComputed = function (shaderPart) { + this.CustomParts.Vertex_After_WorldPosComputed = shaderPart; + return this; + }; + CustomMaterial.prototype.Vertex_MainEnd = function (shaderPart) { + this.CustomParts.Vertex_MainEnd = shaderPart; + return this; + }; + CustomMaterial.ShaderIndexer = 1; + return CustomMaterial; +}(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__["StandardMaterial"])); + +babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__["_TypeStore"].RegisteredTypes["BABYLON.CustomMaterial"] = CustomMaterial; + + +/***/ }), + +/***/ "./custom/index.ts": +/*!*************************!*\ + !*** ./custom/index.ts ***! + \*************************/ +/*! exports provided: CustomShaderStructure, ShaderSpecialParts, CustomMaterial, ShaderAlebdoParts, PBRCustomMaterial */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _customMaterial__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./customMaterial */ "./custom/customMaterial.ts"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CustomShaderStructure", function() { return _customMaterial__WEBPACK_IMPORTED_MODULE_0__["CustomShaderStructure"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ShaderSpecialParts", function() { return _customMaterial__WEBPACK_IMPORTED_MODULE_0__["ShaderSpecialParts"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CustomMaterial", function() { return _customMaterial__WEBPACK_IMPORTED_MODULE_0__["CustomMaterial"]; }); + +/* harmony import */ var _pbrCustomMaterial__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./pbrCustomMaterial */ "./custom/pbrCustomMaterial.ts"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ShaderAlebdoParts", function() { return _pbrCustomMaterial__WEBPACK_IMPORTED_MODULE_1__["ShaderAlebdoParts"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PBRCustomMaterial", function() { return _pbrCustomMaterial__WEBPACK_IMPORTED_MODULE_1__["PBRCustomMaterial"]; }); + + + + + +/***/ }), + +/***/ "./custom/pbrCustomMaterial.ts": +/*!*************************************!*\ + !*** ./custom/pbrCustomMaterial.ts ***! + \*************************************/ +/*! exports provided: ShaderAlebdoParts, PBRCustomMaterial */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ShaderAlebdoParts", function() { return ShaderAlebdoParts; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PBRCustomMaterial", function() { return PBRCustomMaterial; }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js"); +/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators"); +/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__); + + + + +var ShaderAlebdoParts = /** @class */ (function () { + function ShaderAlebdoParts() { + } + return ShaderAlebdoParts; +}()); + +var PBRCustomMaterial = /** @class */ (function (_super) { + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(PBRCustomMaterial, _super); + function PBRCustomMaterial(name, scene) { + var _this = _super.call(this, name, scene) || this; + _this.CustomParts = new ShaderAlebdoParts(); + _this.customShaderNameResolve = _this.Builder; + _this.FragmentShader = babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__["Effect"].ShadersStore["pbrPixelShader"]; + _this.VertexShader = babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__["Effect"].ShadersStore["pbrVertexShader"]; + _this.FragmentShader = _this.FragmentShader.replace(/#include/g, babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__["Effect"].IncludesShadersStore["pbrBlockAlbedoOpacity"]); + _this.FragmentShader = _this.FragmentShader.replace(/#include/g, babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__["Effect"].IncludesShadersStore["pbrBlockReflectivity"]); + _this.FragmentShader = _this.FragmentShader.replace(/#include/g, babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__["Effect"].IncludesShadersStore["pbrBlockFinalColorComposition"]); + return _this; + } + PBRCustomMaterial.prototype.AttachAfterBind = function (mesh, effect) { + if (this._newUniformInstances) { + for (var el in this._newUniformInstances) { + var ea = el.toString().split('-'); + if (ea[0] == 'vec2') { + effect.setVector2(ea[1], this._newUniformInstances[el]); + } + else if (ea[0] == 'vec3') { + effect.setVector3(ea[1], this._newUniformInstances[el]); + } + else if (ea[0] == 'vec4') { + effect.setVector4(ea[1], this._newUniformInstances[el]); + } + else if (ea[0] == 'mat4') { + effect.setMatrix(ea[1], this._newUniformInstances[el]); + } + else if (ea[0] == 'float') { + effect.setFloat(ea[1], this._newUniformInstances[el]); + } + } + } + if (this._newSamplerInstances) { + for (var el in this._newSamplerInstances) { + var ea = el.toString().split('-'); + if (ea[0] == 'sampler2D' && this._newSamplerInstances[el].isReady && this._newSamplerInstances[el].isReady()) { + effect.setTexture(ea[1], this._newSamplerInstances[el]); + } + } + } + }; + PBRCustomMaterial.prototype.ReviewUniform = function (name, arr) { + if (name == "uniform" && this._newUniforms) { + for (var ind = 0; ind < this._newUniforms.length; ind++) { + if (this._customUniform[ind].indexOf('sampler') == -1) { + arr.push(this._newUniforms[ind]); + } + } + } + if (name == "sampler" && this._newUniforms) { + for (var ind = 0; ind < this._newUniforms.length; ind++) { + if (this._customUniform[ind].indexOf('sampler') != -1) { + arr.push(this._newUniforms[ind]); + } + } + } + return arr; + }; + PBRCustomMaterial.prototype.Builder = function (shaderName, uniforms, uniformBuffers, samplers, defines, attributes) { + var _this = this; + if (attributes && this._customAttributes && this._customAttributes.length > 0) { + attributes.push.apply(attributes, this._customAttributes); + } + this.ReviewUniform("uniform", uniforms); + this.ReviewUniform("sampler", samplers); + if (this._isCreatedShader) { + return this._createdShaderName; + } + this._isCreatedShader = false; + PBRCustomMaterial.ShaderIndexer++; + var name = "custom_" + PBRCustomMaterial.ShaderIndexer; + var fn_afterBind = this._afterBind.bind(this); + this._afterBind = function (m, e) { + if (!e) { + return; + } + _this.AttachAfterBind(m, e); + try { + fn_afterBind(m, e); + } + catch (e) { } + }; + babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__["Effect"].ShadersStore[name + "VertexShader"] = this.VertexShader + .replace('#define CUSTOM_VERTEX_BEGIN', (this.CustomParts.Vertex_Begin ? this.CustomParts.Vertex_Begin : "")) + .replace('#define CUSTOM_VERTEX_DEFINITIONS', (this._customUniform ? this._customUniform.join("\n") : "") + (this.CustomParts.Vertex_Definitions ? this.CustomParts.Vertex_Definitions : "")) + .replace('#define CUSTOM_VERTEX_MAIN_BEGIN', (this.CustomParts.Vertex_MainBegin ? this.CustomParts.Vertex_MainBegin : "")) + .replace('#define CUSTOM_VERTEX_UPDATE_POSITION', (this.CustomParts.Vertex_Before_PositionUpdated ? this.CustomParts.Vertex_Before_PositionUpdated : "")) + .replace('#define CUSTOM_VERTEX_UPDATE_NORMAL', (this.CustomParts.Vertex_Before_NormalUpdated ? this.CustomParts.Vertex_Before_NormalUpdated : "")) + .replace('#define CUSTOM_VERTEX_MAIN_END', (this.CustomParts.Vertex_MainEnd ? this.CustomParts.Vertex_MainEnd : "")); + if (this.CustomParts.Vertex_After_WorldPosComputed) { + babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__["Effect"].ShadersStore[name + "VertexShader"] = babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__["Effect"].ShadersStore[name + "VertexShader"].replace('#define CUSTOM_VERTEX_UPDATE_WORLDPOS', this.CustomParts.Vertex_After_WorldPosComputed); + } + babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__["Effect"].ShadersStore[name + "PixelShader"] = this.FragmentShader + .replace('#define CUSTOM_FRAGMENT_BEGIN', (this.CustomParts.Fragment_Begin ? this.CustomParts.Fragment_Begin : "")) + .replace('#define CUSTOM_FRAGMENT_MAIN_BEGIN', (this.CustomParts.Fragment_MainBegin ? this.CustomParts.Fragment_MainBegin : "")) + .replace('#define CUSTOM_FRAGMENT_DEFINITIONS', (this._customUniform ? this._customUniform.join("\n") : "") + (this.CustomParts.Fragment_Definitions ? this.CustomParts.Fragment_Definitions : "")) + .replace('#define CUSTOM_FRAGMENT_UPDATE_ALBEDO', (this.CustomParts.Fragment_Custom_Albedo ? this.CustomParts.Fragment_Custom_Albedo : "")) + .replace('#define CUSTOM_FRAGMENT_UPDATE_ALPHA', (this.CustomParts.Fragment_Custom_Alpha ? this.CustomParts.Fragment_Custom_Alpha : "")) + .replace('#define CUSTOM_FRAGMENT_BEFORE_LIGHTS', (this.CustomParts.Fragment_Before_Lights ? this.CustomParts.Fragment_Before_Lights : "")) + .replace('#define CUSTOM_FRAGMENT_UPDATE_METALLICROUGHNESS', (this.CustomParts.Fragment_Custom_MetallicRoughness ? this.CustomParts.Fragment_Custom_MetallicRoughness : "")) + .replace('#define CUSTOM_FRAGMENT_UPDATE_MICROSURFACE', (this.CustomParts.Fragment_Custom_MicroSurface ? this.CustomParts.Fragment_Custom_MicroSurface : "")) + .replace('#define CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR', (this.CustomParts.Fragment_Before_FragColor ? this.CustomParts.Fragment_Before_FragColor : "")); + if (this.CustomParts.Fragment_Before_Fog) { + babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__["Effect"].ShadersStore[name + "PixelShader"] = babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__["Effect"].ShadersStore[name + "PixelShader"].replace('#define CUSTOM_FRAGMENT_BEFORE_FOG', this.CustomParts.Fragment_Before_Fog); + } + this._isCreatedShader = true; + this._createdShaderName = name; + return name; + }; + PBRCustomMaterial.prototype.AddUniform = function (name, kind, param) { + if (!this._customUniform) { + this._customUniform = new Array(); + this._newUniforms = new Array(); + this._newSamplerInstances = {}; + this._newUniformInstances = {}; + } + if (param) { + if (kind.indexOf("sampler") != -1) { + this._newSamplerInstances[kind + "-" + name] = param; + } + else { + this._newUniformInstances[kind + "-" + name] = param; + } + } + this._customUniform.push("uniform " + kind + " " + name + ";"); + this._newUniforms.push(name); + return this; + }; + PBRCustomMaterial.prototype.AddAttribute = function (name) { + if (!this._customAttributes) { + this._customAttributes = []; + } + this._customAttributes.push(name); + return this; + }; + PBRCustomMaterial.prototype.Fragment_Begin = function (shaderPart) { + this.CustomParts.Fragment_Begin = shaderPart; + return this; + }; + PBRCustomMaterial.prototype.Fragment_Definitions = function (shaderPart) { + this.CustomParts.Fragment_Definitions = shaderPart; + return this; + }; + PBRCustomMaterial.prototype.Fragment_MainBegin = function (shaderPart) { + this.CustomParts.Fragment_MainBegin = shaderPart; + return this; + }; + PBRCustomMaterial.prototype.Fragment_Custom_Albedo = function (shaderPart) { + this.CustomParts.Fragment_Custom_Albedo = shaderPart.replace("result", "surfaceAlbedo"); + return this; + }; + PBRCustomMaterial.prototype.Fragment_Custom_Alpha = function (shaderPart) { + this.CustomParts.Fragment_Custom_Alpha = shaderPart.replace("result", "alpha"); + return this; + }; + PBRCustomMaterial.prototype.Fragment_Before_Lights = function (shaderPart) { + this.CustomParts.Fragment_Before_Lights = shaderPart; + return this; + }; + PBRCustomMaterial.prototype.Fragment_Custom_MetallicRoughness = function (shaderPart) { + this.CustomParts.Fragment_Custom_MetallicRoughness = shaderPart; + return this; + }; + PBRCustomMaterial.prototype.Fragment_Custom_MicroSurface = function (shaderPart) { + this.CustomParts.Fragment_Custom_MicroSurface = shaderPart; + return this; + }; + PBRCustomMaterial.prototype.Fragment_Before_Fog = function (shaderPart) { + this.CustomParts.Fragment_Before_Fog = shaderPart; + return this; + }; + PBRCustomMaterial.prototype.Fragment_Before_FragColor = function (shaderPart) { + this.CustomParts.Fragment_Before_FragColor = shaderPart.replace("result", "color"); + return this; + }; + PBRCustomMaterial.prototype.Vertex_Begin = function (shaderPart) { + this.CustomParts.Vertex_Begin = shaderPart; + return this; + }; + PBRCustomMaterial.prototype.Vertex_Definitions = function (shaderPart) { + this.CustomParts.Vertex_Definitions = shaderPart; + return this; + }; + PBRCustomMaterial.prototype.Vertex_MainBegin = function (shaderPart) { + this.CustomParts.Vertex_MainBegin = shaderPart; + return this; + }; + PBRCustomMaterial.prototype.Vertex_Before_PositionUpdated = function (shaderPart) { + this.CustomParts.Vertex_Before_PositionUpdated = shaderPart.replace("result", "positionUpdated"); + return this; + }; + PBRCustomMaterial.prototype.Vertex_Before_NormalUpdated = function (shaderPart) { + this.CustomParts.Vertex_Before_NormalUpdated = shaderPart.replace("result", "normalUpdated"); + return this; + }; + PBRCustomMaterial.prototype.Vertex_After_WorldPosComputed = function (shaderPart) { + this.CustomParts.Vertex_After_WorldPosComputed = shaderPart; + return this; + }; + PBRCustomMaterial.prototype.Vertex_MainEnd = function (shaderPart) { + this.CustomParts.Vertex_MainEnd = shaderPart; + return this; + }; + PBRCustomMaterial.ShaderIndexer = 1; + return PBRCustomMaterial; +}(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__["PBRMaterial"])); + +babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__["_TypeStore"].RegisteredTypes["BABYLON.PBRCustomMaterial"] = PBRCustomMaterial; + + +/***/ }), + +/***/ "./fire/fire.fragment.ts": +/*!*******************************!*\ + !*** ./fire/fire.fragment.ts ***! + \*******************************/ +/*! exports provided: firePixelShader */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "firePixelShader", function() { return firePixelShader; }); +/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators"); +/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__); + + + + + + + +var name = 'firePixelShader'; +var shader = "precision highp float;\n\nuniform vec3 vEyePosition;\n\nvarying vec3 vPositionW;\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;\nuniform sampler2D diffuseSampler;\nuniform vec2 vDiffuseInfos;\n#endif\n\nuniform sampler2D distortionSampler;\nuniform sampler2D opacitySampler;\n#ifdef DIFFUSE\nvarying vec2 vDistortionCoords1;\nvarying vec2 vDistortionCoords2;\nvarying vec2 vDistortionCoords3;\n#endif\n#include\n\n#include\nvec4 bx2(vec4 x)\n{\nreturn vec4(2.0)*x-vec4(1.0);\n}\nvoid main(void) {\n\n#include\nvec3 viewDirectionW=normalize(vEyePosition-vPositionW);\n\nvec4 baseColor=vec4(1.,1.,1.,1.);\n\nfloat alpha=1.0;\n#ifdef DIFFUSE\n\nconst float distortionAmount0=0.092;\nconst float distortionAmount1=0.092;\nconst float distortionAmount2=0.092;\nvec2 heightAttenuation=vec2(0.3,0.39);\nvec4 noise0=texture2D(distortionSampler,vDistortionCoords1);\nvec4 noise1=texture2D(distortionSampler,vDistortionCoords2);\nvec4 noise2=texture2D(distortionSampler,vDistortionCoords3);\nvec4 noiseSum=bx2(noise0)*distortionAmount0+bx2(noise1)*distortionAmount1+bx2(noise2)*distortionAmount2;\nvec4 perturbedBaseCoords=vec4(vDiffuseUV,0.0,1.0)+noiseSum*(vDiffuseUV.y*heightAttenuation.x+heightAttenuation.y);\nvec4 opacityColor=texture2D(opacitySampler,perturbedBaseCoords.xy);\n#ifdef ALPHATEST\nif (opacityColor.r<0.1)\ndiscard;\n#endif\n#include\nbaseColor=texture2D(diffuseSampler,perturbedBaseCoords.xy)*2.0;\nbaseColor*=opacityColor;\nbaseColor.rgb*=vDiffuseInfos.y;\n#endif\n#ifdef VERTEXCOLOR\nbaseColor.rgb*=vColor.rgb;\n#endif\n\nvec3 diffuseBase=vec3(1.0,1.0,1.0);\n#ifdef VERTEXALPHA\nalpha*=vColor.a;\n#endif\n\nvec4 color=vec4(baseColor.rgb,alpha);\n#include\ngl_FragColor=color;\n#include\n}"; +babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__["Effect"].ShadersStore[name] = shader; +/** @hidden */ +var firePixelShader = { name: name, shader: shader }; + + +/***/ }), + +/***/ "./fire/fire.vertex.ts": +/*!*****************************!*\ + !*** ./fire/fire.vertex.ts ***! + \*****************************/ +/*! exports provided: fireVertexShader */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fireVertexShader", function() { return fireVertexShader; }); +/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators"); +/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__); + + + + + + + + + +var name = 'fireVertexShader'; +var shader = "precision highp float;\n\nattribute vec3 position;\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include\n\n#include\nuniform mat4 view;\nuniform mat4 viewProjection;\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\n\nvarying vec3 vPositionW;\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include\n#include\n\nuniform float time;\nuniform float speed;\n#ifdef DIFFUSE\nvarying vec2 vDistortionCoords1;\nvarying vec2 vDistortionCoords2;\nvarying vec2 vDistortionCoords3;\n#endif\nvoid main(void) {\n#include\n#include\nvec4 worldPos=finalWorld*vec4(position,1.0);\ngl_Position=viewProjection*worldPos;\nvPositionW=vec3(worldPos);\n\n#ifdef DIFFUSE\nvDiffuseUV=uv;\nvDiffuseUV.y-=0.2;\n#endif\n\n#include\n\n#include\n\n#ifdef VERTEXCOLOR\nvColor=color;\n#endif\n\n#ifdef POINTSIZE\ngl_PointSize=pointSize;\n#endif\n#ifdef DIFFUSE\n\nvec3 layerSpeed=vec3(-0.2,-0.52,-0.1)*speed;\nvDistortionCoords1.x=uv.x;\nvDistortionCoords1.y=uv.y+layerSpeed.x*time/1000.0;\nvDistortionCoords2.x=uv.x;\nvDistortionCoords2.y=uv.y+layerSpeed.y*time/1000.0;\nvDistortionCoords3.x=uv.x;\nvDistortionCoords3.y=uv.y+layerSpeed.z*time/1000.0;\n#endif\n}\n"; +babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__["Effect"].ShadersStore[name] = shader; +/** @hidden */ +var fireVertexShader = { name: name, shader: shader }; + + +/***/ }), + +/***/ "./fire/fireMaterial.ts": +/*!******************************!*\ + !*** ./fire/fireMaterial.ts ***! + \******************************/ +/*! exports provided: FireMaterial */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FireMaterial", function() { return FireMaterial; }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js"); +/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators"); +/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _fire_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./fire.fragment */ "./fire/fire.fragment.ts"); +/* harmony import */ var _fire_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./fire.vertex */ "./fire/fire.vertex.ts"); + + + + + + + + + + + + + + + +var FireMaterialDefines = /** @class */ (function (_super) { + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(FireMaterialDefines, _super); + function FireMaterialDefines() { + var _this = _super.call(this) || this; + _this.DIFFUSE = false; + _this.CLIPPLANE = false; + _this.CLIPPLANE2 = false; + _this.CLIPPLANE3 = false; + _this.CLIPPLANE4 = false; + _this.CLIPPLANE5 = false; + _this.CLIPPLANE6 = false; + _this.ALPHATEST = false; + _this.DEPTHPREPASS = false; + _this.POINTSIZE = false; + _this.FOG = false; + _this.UV1 = false; + _this.VERTEXCOLOR = false; + _this.VERTEXALPHA = false; + _this.BonesPerMesh = 0; + _this.NUM_BONE_INFLUENCERS = 0; + _this.INSTANCES = false; + _this.IMAGEPROCESSINGPOSTPROCESS = false; + _this.rebuild(); + return _this; + } + return FireMaterialDefines; +}(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialDefines"])); +var FireMaterial = /** @class */ (function (_super) { + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(FireMaterial, _super); + function FireMaterial(name, scene) { + var _this = _super.call(this, name, scene) || this; + _this.diffuseColor = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](1, 1, 1); + _this.speed = 1.0; + _this._scaledDiffuse = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](); + _this._lastTime = 0; + return _this; + } + FireMaterial.prototype.needAlphaBlending = function () { + return false; + }; + FireMaterial.prototype.needAlphaTesting = function () { + return true; + }; + FireMaterial.prototype.getAlphaTestTexture = function () { + return null; + }; + // Methods + FireMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) { + if (this.isFrozen) { + if (subMesh.effect && subMesh.effect._wasPreviouslyReady) { + return true; + } + } + if (!subMesh._materialDefines) { + subMesh._materialDefines = new FireMaterialDefines(); + } + var defines = subMesh._materialDefines; + var scene = this.getScene(); + if (this._isReadyForSubMesh(subMesh)) { + return true; + } + var engine = scene.getEngine(); + // Textures + if (defines._areTexturesDirty) { + defines._needUVs = false; + if (this._diffuseTexture && babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialFlags"].DiffuseTextureEnabled) { + if (!this._diffuseTexture.isReady()) { + return false; + } + else { + defines._needUVs = true; + defines.DIFFUSE = true; + } + } + } + defines.ALPHATEST = this._opacityTexture ? true : false; + // Misc. + if (defines._areMiscDirty) { + defines.POINTSIZE = (this.pointsCloud || scene.forcePointsCloud); + defines.FOG = (scene.fogEnabled && mesh.applyFog && scene.fogMode !== babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Scene"].FOGMODE_NONE && this.fogEnabled); + } + // Values that need to be evaluated on every frame + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForFrameBoundValues(scene, engine, defines, useInstances ? true : false); + // Attribs + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForAttributes(mesh, defines, false, true); + // Get correct effect + if (defines.isDirty) { + defines.markAsProcessed(); + scene.resetCachedMaterial(); + // Fallbacks + var fallbacks = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["EffectFallbacks"](); + if (defines.FOG) { + fallbacks.addFallback(1, "FOG"); + } + if (defines.NUM_BONE_INFLUENCERS > 0) { + fallbacks.addCPUSkinningFallback(0, mesh); + } + defines.IMAGEPROCESSINGPOSTPROCESS = scene.imageProcessingConfiguration.applyByPostProcess; + //Attributes + var attribs = [babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].PositionKind]; + if (defines.UV1) { + attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].UVKind); + } + if (defines.VERTEXCOLOR) { + attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].ColorKind); + } + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareAttributesForBones(attribs, mesh, defines, fallbacks); + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareAttributesForInstances(attribs, defines); + // Legacy browser patch + var shaderName = "fire"; + var join = defines.toString(); + subMesh.setEffect(scene.getEngine().createEffect(shaderName, { + attributes: attribs, + uniformsNames: ["world", "view", "viewProjection", "vEyePosition", + "vFogInfos", "vFogColor", "pointSize", + "vDiffuseInfos", + "mBones", + "vClipPlane", "vClipPlane2", "vClipPlane3", "vClipPlane4", "vClipPlane5", "vClipPlane6", "diffuseMatrix", + // Fire + "time", "speed" + ], + uniformBuffersNames: [], + samplers: ["diffuseSampler", + // Fire + "distortionSampler", "opacitySampler" + ], + defines: join, + fallbacks: fallbacks, + onCompiled: this.onCompiled, + onError: this.onError, + indexParameters: null, + maxSimultaneousLights: 4, + transformFeedbackVaryings: null + }, engine), defines); + } + if (!subMesh.effect || !subMesh.effect.isReady()) { + return false; + } + defines._renderId = scene.getRenderId(); + subMesh.effect._wasPreviouslyReady = true; + return true; + }; + FireMaterial.prototype.bindForSubMesh = function (world, mesh, subMesh) { + var scene = this.getScene(); + var defines = subMesh._materialDefines; + if (!defines) { + return; + } + var effect = subMesh.effect; + if (!effect) { + return; + } + this._activeEffect = effect; + // Matrices + this.bindOnlyWorldMatrix(world); + this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix()); + // Bones + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindBonesParameters(mesh, this._activeEffect); + if (this._mustRebind(scene, effect)) { + // Textures + if (this._diffuseTexture && babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialFlags"].DiffuseTextureEnabled) { + this._activeEffect.setTexture("diffuseSampler", this._diffuseTexture); + this._activeEffect.setFloat2("vDiffuseInfos", this._diffuseTexture.coordinatesIndex, this._diffuseTexture.level); + this._activeEffect.setMatrix("diffuseMatrix", this._diffuseTexture.getTextureMatrix()); + this._activeEffect.setTexture("distortionSampler", this._distortionTexture); + this._activeEffect.setTexture("opacitySampler", this._opacityTexture); + } + // Clip plane + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindClipPlane(this._activeEffect, scene); + // Point size + if (this.pointsCloud) { + this._activeEffect.setFloat("pointSize", this.pointSize); + } + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindEyePosition(effect, scene); + } + this._activeEffect.setColor4("vDiffuseColor", this._scaledDiffuse, this.alpha * mesh.visibility); + // View + if (scene.fogEnabled && mesh.applyFog && scene.fogMode !== babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Scene"].FOGMODE_NONE) { + this._activeEffect.setMatrix("view", scene.getViewMatrix()); + } + // Fog + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindFogParameters(scene, mesh, this._activeEffect); + // Time + this._lastTime += scene.getEngine().getDeltaTime(); + this._activeEffect.setFloat("time", this._lastTime); + // Speed + this._activeEffect.setFloat("speed", this.speed); + this._afterBind(mesh, this._activeEffect); + }; + FireMaterial.prototype.getAnimatables = function () { + var results = []; + if (this._diffuseTexture && this._diffuseTexture.animations && this._diffuseTexture.animations.length > 0) { + results.push(this._diffuseTexture); + } + if (this._distortionTexture && this._distortionTexture.animations && this._distortionTexture.animations.length > 0) { + results.push(this._distortionTexture); + } + if (this._opacityTexture && this._opacityTexture.animations && this._opacityTexture.animations.length > 0) { + results.push(this._opacityTexture); + } + return results; + }; + FireMaterial.prototype.getActiveTextures = function () { + var activeTextures = _super.prototype.getActiveTextures.call(this); + if (this._diffuseTexture) { + activeTextures.push(this._diffuseTexture); + } + if (this._distortionTexture) { + activeTextures.push(this._distortionTexture); + } + if (this._opacityTexture) { + activeTextures.push(this._opacityTexture); + } + return activeTextures; + }; + FireMaterial.prototype.hasTexture = function (texture) { + if (_super.prototype.hasTexture.call(this, texture)) { + return true; + } + if (this._diffuseTexture === texture) { + return true; + } + if (this._distortionTexture === texture) { + return true; + } + if (this._opacityTexture === texture) { + return true; + } + return false; + }; + FireMaterial.prototype.getClassName = function () { + return "FireMaterial"; + }; + FireMaterial.prototype.dispose = function (forceDisposeEffect) { + if (this._diffuseTexture) { + this._diffuseTexture.dispose(); + } + if (this._distortionTexture) { + this._distortionTexture.dispose(); + } + _super.prototype.dispose.call(this, forceDisposeEffect); + }; + FireMaterial.prototype.clone = function (name) { + var _this = this; + return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Clone(function () { return new FireMaterial(name, _this.getScene()); }, this); + }; + FireMaterial.prototype.serialize = function () { + var serializationObject = _super.prototype.serialize.call(this); + serializationObject.customType = "BABYLON.FireMaterial"; + serializationObject.diffuseColor = this.diffuseColor.asArray(); + serializationObject.speed = this.speed; + if (this._diffuseTexture) { + serializationObject._diffuseTexture = this._diffuseTexture.serialize(); + } + if (this._distortionTexture) { + serializationObject._distortionTexture = this._distortionTexture.serialize(); + } + if (this._opacityTexture) { + serializationObject._opacityTexture = this._opacityTexture.serialize(); + } + return serializationObject; + }; + FireMaterial.Parse = function (source, scene, rootUrl) { + var material = new FireMaterial(source.name, scene); + material.diffuseColor = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"].FromArray(source.diffuseColor); + material.speed = source.speed; + material.alpha = source.alpha; + material.id = source.id; + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Tags"].AddTagsTo(material, source.tags); + material.backFaceCulling = source.backFaceCulling; + material.wireframe = source.wireframe; + if (source._diffuseTexture) { + material._diffuseTexture = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Texture"].Parse(source._diffuseTexture, scene, rootUrl); + } + if (source._distortionTexture) { + material._distortionTexture = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Texture"].Parse(source._distortionTexture, scene, rootUrl); + } + if (source._opacityTexture) { + material._opacityTexture = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Texture"].Parse(source._opacityTexture, scene, rootUrl); + } + return material; + }; + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("diffuseTexture") + ], FireMaterial.prototype, "_diffuseTexture", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty") + ], FireMaterial.prototype, "diffuseTexture", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("distortionTexture") + ], FireMaterial.prototype, "_distortionTexture", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty") + ], FireMaterial.prototype, "distortionTexture", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("opacityTexture") + ], FireMaterial.prototype, "_opacityTexture", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty") + ], FireMaterial.prototype, "opacityTexture", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsColor3"])("diffuse") + ], FireMaterial.prototype, "diffuseColor", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])() + ], FireMaterial.prototype, "speed", void 0); + return FireMaterial; +}(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["PushMaterial"])); + +babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["_TypeStore"].RegisteredTypes["BABYLON.FireMaterial"] = FireMaterial; + + +/***/ }), + +/***/ "./fire/index.ts": +/*!***********************!*\ + !*** ./fire/index.ts ***! + \***********************/ +/*! exports provided: FireMaterial */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _fireMaterial__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./fireMaterial */ "./fire/fireMaterial.ts"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FireMaterial", function() { return _fireMaterial__WEBPACK_IMPORTED_MODULE_0__["FireMaterial"]; }); + + + + +/***/ }), + +/***/ "./fur/fur.fragment.ts": +/*!*****************************!*\ + !*** ./fur/fur.fragment.ts ***! + \*****************************/ +/*! exports provided: furPixelShader */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "furPixelShader", function() { return furPixelShader; }); +/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators"); +/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__); + + + + + + + + + + + + + +var name = 'furPixelShader'; +var shader = "precision highp float;\n\nuniform vec3 vEyePosition;\nuniform vec4 vDiffuseColor;\n\nuniform vec4 furColor;\nuniform float furLength;\nvarying vec3 vPositionW;\nvarying float vfur_length;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n\n#include\n\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;\nuniform sampler2D diffuseSampler;\nuniform vec2 vDiffuseInfos;\n#endif\n\n#ifdef HIGHLEVEL\nuniform float furOffset;\nuniform float furOcclusion;\nuniform sampler2D furTexture;\nvarying vec2 vFurUV;\n#endif\n#include\n#include\n#include\n#include\nfloat Rand(vec3 rv) {\nfloat x=dot(rv,vec3(12.9898,78.233,24.65487));\nreturn fract(sin(x)*43758.5453);\n}\nvoid main(void) {\n\n#include\nvec3 viewDirectionW=normalize(vEyePosition-vPositionW);\n\nvec4 baseColor=furColor;\nvec3 diffuseColor=vDiffuseColor.rgb;\n\nfloat alpha=vDiffuseColor.a;\n#ifdef DIFFUSE\nbaseColor*=texture2D(diffuseSampler,vDiffuseUV);\n#ifdef ALPHATEST\nif (baseColor.a<0.4)\ndiscard;\n#endif\n#include\nbaseColor.rgb*=vDiffuseInfos.y;\n#endif\n#ifdef VERTEXCOLOR\nbaseColor.rgb*=vColor.rgb;\n#endif\n\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);\n#endif\n#ifdef HIGHLEVEL\n\nvec4 furTextureColor=texture2D(furTexture,vec2(vFurUV.x,vFurUV.y));\nif (furTextureColor.a<=0.0 || furTextureColor.g[0..maxSimultaneousLights]\n#ifdef VERTEXALPHA\nalpha*=vColor.a;\n#endif\nvec3 finalDiffuse=clamp(diffuseBase.rgb*baseColor.rgb,0.0,1.0);\n\n#ifdef HIGHLEVEL\nvec4 color=vec4(finalDiffuse,alpha);\n#else\nfloat r=vfur_length/furLength*0.5;\nvec4 color=vec4(finalDiffuse*(0.5+r),alpha);\n#endif\n#include\ngl_FragColor=color;\n#include\n}"; +babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__["Effect"].ShadersStore[name] = shader; +/** @hidden */ +var furPixelShader = { name: name, shader: shader }; + + +/***/ }), + +/***/ "./fur/fur.vertex.ts": +/*!***************************!*\ + !*** ./fur/fur.vertex.ts ***! + \***************************/ +/*! exports provided: furVertexShader */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "furVertexShader", function() { return furVertexShader; }); +/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators"); +/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__); + + + + + + + + + + + + +var name = 'furVertexShader'; +var shader = "precision highp float;\n\nattribute vec3 position;\nattribute vec3 normal;\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include\n\nuniform float furLength;\nuniform float furAngle;\n#ifdef HIGHLEVEL\nuniform float furOffset;\nuniform vec3 furGravity;\nuniform float furTime;\nuniform float furSpacing;\nuniform float furDensity;\n#endif\n#ifdef HEIGHTMAP\nuniform sampler2D heightTexture;\n#endif\n#ifdef HIGHLEVEL\nvarying vec2 vFurUV;\n#endif\n#include\nuniform mat4 view;\nuniform mat4 viewProjection;\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;\nuniform mat4 diffuseMatrix;\nuniform vec2 vDiffuseInfos;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\n\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\nvarying float vfur_length;\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include\n#include\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\nfloat Rand(vec3 rv) {\nfloat x=dot(rv,vec3(12.9898,78.233,24.65487));\nreturn fract(sin(x)*43758.5453);\n}\nvoid main(void) {\n#include\n#include\n\nfloat r=Rand(position);\n#ifdef HEIGHTMAP\n#if __VERSION__>100\nvfur_length=furLength*texture(heightTexture,uv).x;\n#else\nvfur_length=furLength*texture2D(heightTexture,uv).r;\n#endif\n#else\nvfur_length=(furLength*r);\n#endif\nvec3 tangent1=vec3(normal.y,-normal.x,0);\nvec3 tangent2=vec3(-normal.z,0,normal.x);\nr=Rand(tangent1*r);\nfloat J=(2.0+4.0*r);\nr=Rand(tangent2*r);\nfloat K=(2.0+2.0*r);\ntangent1=tangent1*J+tangent2*K;\ntangent1=normalize(tangent1);\nvec3 newPosition=position+normal*vfur_length*cos(furAngle)+tangent1*vfur_length*sin(furAngle);\n#ifdef HIGHLEVEL\n\nvec3 forceDirection=vec3(0.0,0.0,0.0);\nforceDirection.x=sin(furTime+position.x*0.05)*0.2;\nforceDirection.y=cos(furTime*0.7+position.y*0.04)*0.2;\nforceDirection.z=sin(furTime*0.7+position.z*0.04)*0.2;\nvec3 displacement=vec3(0.0,0.0,0.0);\ndisplacement=furGravity+forceDirection;\nfloat displacementFactor=pow(furOffset,3.0);\nvec3 aNormal=normal;\naNormal.xyz+=displacement*displacementFactor;\nnewPosition=vec3(newPosition.x,newPosition.y,newPosition.z)+(normalize(aNormal)*furOffset*furSpacing);\n#endif\n#ifdef NORMAL\nvNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));\n#endif\n\ngl_Position=viewProjection*finalWorld*vec4(newPosition,1.0);\nvec4 worldPos=finalWorld*vec4(newPosition,1.0);\nvPositionW=vec3(worldPos);\n\n#ifndef UV1\nvec2 uv=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\n#ifdef DIFFUSE\nif (vDiffuseInfos.x == 0.)\n{\nvDiffuseUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));\n}\nelse\n{\nvDiffuseUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n}\n#ifdef HIGHLEVEL\nvFurUV=vDiffuseUV*furDensity;\n#endif\n#else\n#ifdef HIGHLEVEL\nvFurUV=uv*furDensity;\n#endif\n#endif\n\n#include\n\n#include\n\n#include[0..maxSimultaneousLights]\n\n#ifdef VERTEXCOLOR\nvColor=color;\n#endif\n\n#ifdef POINTSIZE\ngl_PointSize=pointSize;\n#endif\n}\n"; +babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__["Effect"].ShadersStore[name] = shader; +/** @hidden */ +var furVertexShader = { name: name, shader: shader }; + + +/***/ }), + +/***/ "./fur/furMaterial.ts": +/*!****************************!*\ + !*** ./fur/furMaterial.ts ***! + \****************************/ +/*! exports provided: FurMaterial */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FurMaterial", function() { return FurMaterial; }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js"); +/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators"); +/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _fur_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./fur.fragment */ "./fur/fur.fragment.ts"); +/* harmony import */ var _fur_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./fur.vertex */ "./fur/fur.vertex.ts"); + + + + + + + + + + + + + + + + + +var FurMaterialDefines = /** @class */ (function (_super) { + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(FurMaterialDefines, _super); + function FurMaterialDefines() { + var _this = _super.call(this) || this; + _this.DIFFUSE = false; + _this.HEIGHTMAP = false; + _this.CLIPPLANE = false; + _this.CLIPPLANE2 = false; + _this.CLIPPLANE3 = false; + _this.CLIPPLANE4 = false; + _this.CLIPPLANE5 = false; + _this.CLIPPLANE6 = false; + _this.ALPHATEST = false; + _this.DEPTHPREPASS = false; + _this.POINTSIZE = false; + _this.FOG = false; + _this.NORMAL = false; + _this.UV1 = false; + _this.UV2 = false; + _this.VERTEXCOLOR = false; + _this.VERTEXALPHA = false; + _this.NUM_BONE_INFLUENCERS = 0; + _this.BonesPerMesh = 0; + _this.INSTANCES = false; + _this.HIGHLEVEL = false; + _this.IMAGEPROCESSINGPOSTPROCESS = false; + _this.rebuild(); + return _this; + } + return FurMaterialDefines; +}(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialDefines"])); +var FurMaterial = /** @class */ (function (_super) { + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(FurMaterial, _super); + function FurMaterial(name, scene) { + var _this = _super.call(this, name, scene) || this; + _this.diffuseColor = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](1, 1, 1); + _this.furLength = 1; + _this.furAngle = 0; + _this.furColor = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](0.44, 0.21, 0.02); + _this.furOffset = 0.0; + _this.furSpacing = 12; + _this.furGravity = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Vector3"](0, 0, 0); + _this.furSpeed = 100; + _this.furDensity = 20; + _this.furOcclusion = 0.0; + _this._disableLighting = false; + _this._maxSimultaneousLights = 4; + _this.highLevelFur = true; + _this._furTime = 0; + return _this; + } + Object.defineProperty(FurMaterial.prototype, "furTime", { + get: function () { + return this._furTime; + }, + set: function (furTime) { + this._furTime = furTime; + }, + enumerable: false, + configurable: true + }); + FurMaterial.prototype.needAlphaBlending = function () { + return (this.alpha < 1.0); + }; + FurMaterial.prototype.needAlphaTesting = function () { + return false; + }; + FurMaterial.prototype.getAlphaTestTexture = function () { + return null; + }; + FurMaterial.prototype.updateFur = function () { + for (var i = 1; i < this._meshes.length; i++) { + var offsetFur = this._meshes[i].material; + offsetFur.furLength = this.furLength; + offsetFur.furAngle = this.furAngle; + offsetFur.furGravity = this.furGravity; + offsetFur.furSpacing = this.furSpacing; + offsetFur.furSpeed = this.furSpeed; + offsetFur.furColor = this.furColor; + offsetFur.diffuseTexture = this.diffuseTexture; + offsetFur.furTexture = this.furTexture; + offsetFur.highLevelFur = this.highLevelFur; + offsetFur.furTime = this.furTime; + offsetFur.furDensity = this.furDensity; + } + }; + // Methods + FurMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) { + if (this.isFrozen) { + if (subMesh.effect && subMesh.effect._wasPreviouslyReady) { + return true; + } + } + if (!subMesh._materialDefines) { + subMesh._materialDefines = new FurMaterialDefines(); + } + var defines = subMesh._materialDefines; + var scene = this.getScene(); + if (this._isReadyForSubMesh(subMesh)) { + return true; + } + var engine = scene.getEngine(); + // Textures + if (defines._areTexturesDirty) { + if (scene.texturesEnabled) { + if (this.diffuseTexture && babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialFlags"].DiffuseTextureEnabled) { + if (!this.diffuseTexture.isReady()) { + return false; + } + else { + defines._needUVs = true; + defines.DIFFUSE = true; + } + } + if (this.heightTexture && engine.getCaps().maxVertexTextureImageUnits) { + if (!this.heightTexture.isReady()) { + return false; + } + else { + defines._needUVs = true; + defines.HEIGHTMAP = true; + } + } + } + } + // High level + if (this.highLevelFur !== defines.HIGHLEVEL) { + defines.HIGHLEVEL = true; + defines.markAsUnprocessed(); + } + // Misc. + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForMisc(mesh, scene, false, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(mesh), defines); + // Lights + defines._needNormals = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForLights(scene, mesh, defines, false, this._maxSimultaneousLights, this._disableLighting); + // Values that need to be evaluated on every frame + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForFrameBoundValues(scene, engine, defines, useInstances ? true : false); + // Attribs + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForAttributes(mesh, defines, true, true); + // Get correct effect + if (defines.isDirty) { + defines.markAsProcessed(); + scene.resetCachedMaterial(); + // Fallbacks + var fallbacks = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["EffectFallbacks"](); + if (defines.FOG) { + fallbacks.addFallback(1, "FOG"); + } + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].HandleFallbacksForShadows(defines, fallbacks, this.maxSimultaneousLights); + if (defines.NUM_BONE_INFLUENCERS > 0) { + fallbacks.addCPUSkinningFallback(0, mesh); + } + defines.IMAGEPROCESSINGPOSTPROCESS = scene.imageProcessingConfiguration.applyByPostProcess; + //Attributes + var attribs = [babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].PositionKind]; + if (defines.NORMAL) { + attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].NormalKind); + } + if (defines.UV1) { + attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].UVKind); + } + if (defines.UV2) { + attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].UV2Kind); + } + if (defines.VERTEXCOLOR) { + attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].ColorKind); + } + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareAttributesForBones(attribs, mesh, defines, fallbacks); + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareAttributesForInstances(attribs, defines); + // Legacy browser patch + var shaderName = "fur"; + var join = defines.toString(); + var uniforms = ["world", "view", "viewProjection", "vEyePosition", "vLightsType", "vDiffuseColor", + "vFogInfos", "vFogColor", "pointSize", + "vDiffuseInfos", + "mBones", + "vClipPlane", "vClipPlane2", "vClipPlane3", "vClipPlane4", "vClipPlane5", "vClipPlane6", "diffuseMatrix", + "furLength", "furAngle", "furColor", "furOffset", "furGravity", "furTime", "furSpacing", "furDensity", "furOcclusion" + ]; + var samplers = ["diffuseSampler", + "heightTexture", "furTexture" + ]; + var uniformBuffers = new Array(); + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareUniformsAndSamplersList({ + uniformsNames: uniforms, + uniformBuffersNames: uniformBuffers, + samplers: samplers, + defines: defines, + maxSimultaneousLights: this.maxSimultaneousLights + }); + subMesh.setEffect(scene.getEngine().createEffect(shaderName, { + attributes: attribs, + uniformsNames: uniforms, + uniformBuffersNames: uniformBuffers, + samplers: samplers, + defines: join, + fallbacks: fallbacks, + onCompiled: this.onCompiled, + onError: this.onError, + indexParameters: { maxSimultaneousLights: this.maxSimultaneousLights } + }, engine), defines); + } + if (!subMesh.effect || !subMesh.effect.isReady()) { + return false; + } + defines._renderId = scene.getRenderId(); + subMesh.effect._wasPreviouslyReady = true; + return true; + }; + FurMaterial.prototype.bindForSubMesh = function (world, mesh, subMesh) { + var scene = this.getScene(); + var defines = subMesh._materialDefines; + if (!defines) { + return; + } + var effect = subMesh.effect; + if (!effect) { + return; + } + this._activeEffect = effect; + // Matrices + this.bindOnlyWorldMatrix(world); + this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix()); + // Bones + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindBonesParameters(mesh, this._activeEffect); + if (scene.getCachedMaterial() !== this) { + // Textures + if (this._diffuseTexture && babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialFlags"].DiffuseTextureEnabled) { + this._activeEffect.setTexture("diffuseSampler", this._diffuseTexture); + this._activeEffect.setFloat2("vDiffuseInfos", this._diffuseTexture.coordinatesIndex, this._diffuseTexture.level); + this._activeEffect.setMatrix("diffuseMatrix", this._diffuseTexture.getTextureMatrix()); + } + if (this._heightTexture) { + this._activeEffect.setTexture("heightTexture", this._heightTexture); + } + // Clip plane + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindClipPlane(this._activeEffect, scene); + // Point size + if (this.pointsCloud) { + this._activeEffect.setFloat("pointSize", this.pointSize); + } + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindEyePosition(effect, scene); + } + this._activeEffect.setColor4("vDiffuseColor", this.diffuseColor, this.alpha * mesh.visibility); + if (scene.lightsEnabled && !this.disableLighting) { + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindLights(scene, mesh, this._activeEffect, defines, this.maxSimultaneousLights); + } + // View + if (scene.fogEnabled && mesh.applyFog && scene.fogMode !== babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Scene"].FOGMODE_NONE) { + this._activeEffect.setMatrix("view", scene.getViewMatrix()); + } + // Fog + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindFogParameters(scene, mesh, this._activeEffect); + this._activeEffect.setFloat("furLength", this.furLength); + this._activeEffect.setFloat("furAngle", this.furAngle); + this._activeEffect.setColor4("furColor", this.furColor, 1.0); + if (this.highLevelFur) { + this._activeEffect.setVector3("furGravity", this.furGravity); + this._activeEffect.setFloat("furOffset", this.furOffset); + this._activeEffect.setFloat("furSpacing", this.furSpacing); + this._activeEffect.setFloat("furDensity", this.furDensity); + this._activeEffect.setFloat("furOcclusion", this.furOcclusion); + this._furTime += this.getScene().getEngine().getDeltaTime() / this.furSpeed; + this._activeEffect.setFloat("furTime", this._furTime); + this._activeEffect.setTexture("furTexture", this.furTexture); + } + this._afterBind(mesh, this._activeEffect); + }; + FurMaterial.prototype.getAnimatables = function () { + var results = []; + if (this.diffuseTexture && this.diffuseTexture.animations && this.diffuseTexture.animations.length > 0) { + results.push(this.diffuseTexture); + } + if (this.heightTexture && this.heightTexture.animations && this.heightTexture.animations.length > 0) { + results.push(this.heightTexture); + } + return results; + }; + FurMaterial.prototype.getActiveTextures = function () { + var activeTextures = _super.prototype.getActiveTextures.call(this); + if (this._diffuseTexture) { + activeTextures.push(this._diffuseTexture); + } + if (this._heightTexture) { + activeTextures.push(this._heightTexture); + } + return activeTextures; + }; + FurMaterial.prototype.hasTexture = function (texture) { + if (_super.prototype.hasTexture.call(this, texture)) { + return true; + } + if (this.diffuseTexture === texture) { + return true; + } + if (this._heightTexture === texture) { + return true; + } + return false; + }; + FurMaterial.prototype.dispose = function (forceDisposeEffect) { + if (this.diffuseTexture) { + this.diffuseTexture.dispose(); + } + if (this._meshes) { + for (var i = 1; i < this._meshes.length; i++) { + var mat = this._meshes[i].material; + if (mat) { + mat.dispose(forceDisposeEffect); + } + this._meshes[i].dispose(); + } + } + _super.prototype.dispose.call(this, forceDisposeEffect); + }; + FurMaterial.prototype.clone = function (name) { + var _this = this; + return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Clone(function () { return new FurMaterial(name, _this.getScene()); }, this); + }; + FurMaterial.prototype.serialize = function () { + var serializationObject = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Serialize(this); + serializationObject.customType = "BABYLON.FurMaterial"; + if (this._meshes) { + serializationObject.sourceMeshName = this._meshes[0].name; + serializationObject.quality = this._meshes.length; + } + return serializationObject; + }; + FurMaterial.prototype.getClassName = function () { + return "FurMaterial"; + }; + // Statics + FurMaterial.Parse = function (source, scene, rootUrl) { + var material = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Parse(function () { return new FurMaterial(source.name, scene); }, source, scene, rootUrl); + if (source.sourceMeshName && material.highLevelFur) { + scene.executeWhenReady(function () { + var sourceMesh = scene.getMeshByName(source.sourceMeshName); + if (sourceMesh) { + var furTexture = FurMaterial.GenerateTexture("Fur Texture", scene); + material.furTexture = furTexture; + FurMaterial.FurifyMesh(sourceMesh, source.quality); + } + }); + } + return material; + }; + FurMaterial.GenerateTexture = function (name, scene) { + // Generate fur textures + var texture = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["DynamicTexture"]("FurTexture " + name, 256, scene, true); + var context = texture.getContext(); + for (var i = 0; i < 20000; ++i) { + context.fillStyle = "rgba(255, " + Math.floor(Math.random() * 255) + ", " + Math.floor(Math.random() * 255) + ", 1)"; + context.fillRect((Math.random() * texture.getSize().width), (Math.random() * texture.getSize().height), 2, 2); + } + texture.update(false); + texture.wrapU = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Texture"].WRAP_ADDRESSMODE; + texture.wrapV = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Texture"].WRAP_ADDRESSMODE; + return texture; + }; + // Creates and returns an array of meshes used as shells for the Fur Material + // that can be disposed later in your code + // The quality is in interval [0, 100] + FurMaterial.FurifyMesh = function (sourceMesh, quality) { + var meshes = [sourceMesh]; + var mat = sourceMesh.material; + var i; + if (!(mat instanceof FurMaterial)) { + throw "The material of the source mesh must be a Fur Material"; + } + for (i = 1; i < quality; i++) { + var offsetFur = new FurMaterial(mat.name + i, sourceMesh.getScene()); + sourceMesh.getScene().materials.pop(); + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Tags"].EnableFor(offsetFur); + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Tags"].AddTagsTo(offsetFur, "furShellMaterial"); + offsetFur.furLength = mat.furLength; + offsetFur.furAngle = mat.furAngle; + offsetFur.furGravity = mat.furGravity; + offsetFur.furSpacing = mat.furSpacing; + offsetFur.furSpeed = mat.furSpeed; + offsetFur.furColor = mat.furColor; + offsetFur.diffuseTexture = mat.diffuseTexture; + offsetFur.furOffset = i / quality; + offsetFur.furTexture = mat.furTexture; + offsetFur.highLevelFur = mat.highLevelFur; + offsetFur.furTime = mat.furTime; + offsetFur.furDensity = mat.furDensity; + var offsetMesh = sourceMesh.clone(sourceMesh.name + i); + offsetMesh.material = offsetFur; + offsetMesh.skeleton = sourceMesh.skeleton; + offsetMesh.position = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Vector3"].Zero(); + meshes.push(offsetMesh); + } + for (i = 1; i < meshes.length; i++) { + meshes[i].parent = sourceMesh; + } + sourceMesh.material._meshes = meshes; + return meshes; + }; + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("diffuseTexture") + ], FurMaterial.prototype, "_diffuseTexture", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty") + ], FurMaterial.prototype, "diffuseTexture", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("heightTexture") + ], FurMaterial.prototype, "_heightTexture", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty") + ], FurMaterial.prototype, "heightTexture", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsColor3"])() + ], FurMaterial.prototype, "diffuseColor", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])() + ], FurMaterial.prototype, "furLength", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])() + ], FurMaterial.prototype, "furAngle", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsColor3"])() + ], FurMaterial.prototype, "furColor", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])() + ], FurMaterial.prototype, "furOffset", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])() + ], FurMaterial.prototype, "furSpacing", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsVector3"])() + ], FurMaterial.prototype, "furGravity", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])() + ], FurMaterial.prototype, "furSpeed", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])() + ], FurMaterial.prototype, "furDensity", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])() + ], FurMaterial.prototype, "furOcclusion", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])("disableLighting") + ], FurMaterial.prototype, "_disableLighting", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsLightsDirty") + ], FurMaterial.prototype, "disableLighting", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])("maxSimultaneousLights") + ], FurMaterial.prototype, "_maxSimultaneousLights", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsLightsDirty") + ], FurMaterial.prototype, "maxSimultaneousLights", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])() + ], FurMaterial.prototype, "highLevelFur", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])() + ], FurMaterial.prototype, "furTime", null); + return FurMaterial; +}(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["PushMaterial"])); + +babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["_TypeStore"].RegisteredTypes["BABYLON.FurMaterial"] = FurMaterial; + + +/***/ }), + +/***/ "./fur/index.ts": +/*!**********************!*\ + !*** ./fur/index.ts ***! + \**********************/ +/*! exports provided: FurMaterial */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _furMaterial__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./furMaterial */ "./fur/furMaterial.ts"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FurMaterial", function() { return _furMaterial__WEBPACK_IMPORTED_MODULE_0__["FurMaterial"]; }); + + + + +/***/ }), + +/***/ "./gradient/gradient.fragment.ts": +/*!***************************************!*\ + !*** ./gradient/gradient.fragment.ts ***! + \***************************************/ +/*! exports provided: gradientPixelShader */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "gradientPixelShader", function() { return gradientPixelShader; }); +/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators"); +/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__); + + + + + + + + + + + + + +var name = 'gradientPixelShader'; +var shader = "precision highp float;\n\nuniform vec3 vEyePosition;\n\nuniform vec4 topColor;\nuniform vec4 bottomColor;\nuniform float offset;\nuniform float scale;\nuniform float smoothness;\n\nvarying vec3 vPositionW;\nvarying vec3 vPosition;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n\n#include\n\n#include<__decl__lightFragment>[0]\n#include<__decl__lightFragment>[1]\n#include<__decl__lightFragment>[2]\n#include<__decl__lightFragment>[3]\n#include\n#include\n#include\n\n#include\nvoid main(void) {\n#include\nvec3 viewDirectionW=normalize(vEyePosition-vPositionW);\nfloat h=vPosition.y*scale+offset;\nfloat mysmoothness=clamp(smoothness,0.01,max(smoothness,10.));\nvec4 baseColor=mix(bottomColor,topColor,max(pow(max(h,0.0),mysmoothness),0.0));\n\nvec3 diffuseColor=baseColor.rgb;\n\nfloat alpha=baseColor.a;\n#ifdef ALPHATEST\nif (baseColor.a<0.4)\ndiscard;\n#endif\n#include\n#ifdef VERTEXCOLOR\nbaseColor.rgb*=vColor.rgb;\n#endif\n\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);\n#endif\n\n#ifdef EMISSIVE\nvec3 diffuseBase=baseColor.rgb;\n#else\nvec3 diffuseBase=vec3(0.,0.,0.);\n#endif\nlightingInfo info;\nfloat shadow=1.;\nfloat glossiness=0.;\n#include[0..maxSimultaneousLights]\n#ifdef VERTEXALPHA\nalpha*=vColor.a;\n#endif\nvec3 finalDiffuse=clamp(diffuseBase*diffuseColor,0.0,1.0)*baseColor.rgb;\n\nvec4 color=vec4(finalDiffuse,alpha);\n#include\ngl_FragColor=color;\n#include\n}\n"; +babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__["Effect"].ShadersStore[name] = shader; +/** @hidden */ +var gradientPixelShader = { name: name, shader: shader }; + + +/***/ }), + +/***/ "./gradient/gradient.vertex.ts": +/*!*************************************!*\ + !*** ./gradient/gradient.vertex.ts ***! + \*************************************/ +/*! exports provided: gradientVertexShader */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "gradientVertexShader", function() { return gradientVertexShader; }); +/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators"); +/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__); + + + + + + + + + + + + +var name = 'gradientVertexShader'; +var shader = "precision highp float;\n\nattribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include\n\n#include\nuniform mat4 view;\nuniform mat4 viewProjection;\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\n\nvarying vec3 vPositionW;\nvarying vec3 vPosition;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include\n#include\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\nvoid main(void) {\n#include\n#include\nvec4 worldPos=finalWorld*vec4(position,1.0);\ngl_Position=viewProjection*worldPos;\nvPositionW=vec3(worldPos);\nvPosition=position;\n#ifdef NORMAL\nvNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));\n#endif\n\n#ifndef UV1\nvec2 uv=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\n\n#include\n\n#include\n#include[0..maxSimultaneousLights]\n\n#ifdef VERTEXCOLOR\nvColor=color;\n#endif\n\n#ifdef POINTSIZE\ngl_PointSize=pointSize;\n#endif\n}\n"; +babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__["Effect"].ShadersStore[name] = shader; +/** @hidden */ +var gradientVertexShader = { name: name, shader: shader }; + + +/***/ }), + +/***/ "./gradient/gradientMaterial.ts": +/*!**************************************!*\ + !*** ./gradient/gradientMaterial.ts ***! + \**************************************/ +/*! exports provided: GradientMaterial */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GradientMaterial", function() { return GradientMaterial; }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js"); +/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators"); +/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _gradient_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./gradient.fragment */ "./gradient/gradient.fragment.ts"); +/* harmony import */ var _gradient_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./gradient.vertex */ "./gradient/gradient.vertex.ts"); + + + + + + + + + + + + +var GradientMaterialDefines = /** @class */ (function (_super) { + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(GradientMaterialDefines, _super); + function GradientMaterialDefines() { + var _this = _super.call(this) || this; + _this.EMISSIVE = false; + _this.CLIPPLANE = false; + _this.CLIPPLANE2 = false; + _this.CLIPPLANE3 = false; + _this.CLIPPLANE4 = false; + _this.CLIPPLANE5 = false; + _this.CLIPPLANE6 = false; + _this.ALPHATEST = false; + _this.DEPTHPREPASS = false; + _this.POINTSIZE = false; + _this.FOG = false; + _this.NORMAL = false; + _this.UV1 = false; + _this.UV2 = false; + _this.VERTEXCOLOR = false; + _this.VERTEXALPHA = false; + _this.NUM_BONE_INFLUENCERS = 0; + _this.BonesPerMesh = 0; + _this.INSTANCES = false; + _this.IMAGEPROCESSINGPOSTPROCESS = false; + _this.rebuild(); + return _this; + } + return GradientMaterialDefines; +}(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialDefines"])); +var GradientMaterial = /** @class */ (function (_super) { + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(GradientMaterial, _super); + function GradientMaterial(name, scene) { + var _this = _super.call(this, name, scene) || this; + _this._maxSimultaneousLights = 4; + // The gradient top color, red by default + _this.topColor = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](1, 0, 0); + _this.topColorAlpha = 1.0; + // The gradient top color, blue by default + _this.bottomColor = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](0, 0, 1); + _this.bottomColorAlpha = 1.0; + // Gradient offset + _this.offset = 0; + _this.scale = 1.0; + _this.smoothness = 1.0; + _this._disableLighting = false; + return _this; + } + GradientMaterial.prototype.needAlphaBlending = function () { + return (this.alpha < 1.0 || this.topColorAlpha < 1.0 || this.bottomColorAlpha < 1.0); + }; + GradientMaterial.prototype.needAlphaTesting = function () { + return true; + }; + GradientMaterial.prototype.getAlphaTestTexture = function () { + return null; + }; + // Methods + GradientMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) { + if (this.isFrozen) { + if (subMesh.effect && subMesh.effect._wasPreviouslyReady) { + return true; + } + } + if (!subMesh._materialDefines) { + subMesh._materialDefines = new GradientMaterialDefines(); + } + var defines = subMesh._materialDefines; + var scene = this.getScene(); + if (this._isReadyForSubMesh(subMesh)) { + return true; + } + var engine = scene.getEngine(); + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForFrameBoundValues(scene, engine, defines, useInstances ? true : false); + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForMisc(mesh, scene, false, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(mesh), defines); + defines._needNormals = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForLights(scene, mesh, defines, false, this._maxSimultaneousLights, this._disableLighting); + defines.EMISSIVE = this._disableLighting; + // Attribs + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForAttributes(mesh, defines, false, true); + // Get correct effect + if (defines.isDirty) { + defines.markAsProcessed(); + scene.resetCachedMaterial(); + // Fallbacks + var fallbacks = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["EffectFallbacks"](); + if (defines.FOG) { + fallbacks.addFallback(1, "FOG"); + } + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].HandleFallbacksForShadows(defines, fallbacks); + if (defines.NUM_BONE_INFLUENCERS > 0) { + fallbacks.addCPUSkinningFallback(0, mesh); + } + defines.IMAGEPROCESSINGPOSTPROCESS = scene.imageProcessingConfiguration.applyByPostProcess; + //Attributes + var attribs = [babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].PositionKind]; + if (defines.NORMAL) { + attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].NormalKind); + } + if (defines.UV1) { + attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].UVKind); + } + if (defines.UV2) { + attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].UV2Kind); + } + if (defines.VERTEXCOLOR) { + attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].ColorKind); + } + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareAttributesForBones(attribs, mesh, defines, fallbacks); + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareAttributesForInstances(attribs, defines); + // Legacy browser patch + var shaderName = "gradient"; + var join = defines.toString(); + var uniforms = ["world", "view", "viewProjection", "vEyePosition", "vLightsType", + "vFogInfos", "vFogColor", "pointSize", + "mBones", + "vClipPlane", "vClipPlane2", "vClipPlane3", "vClipPlane4", "vClipPlane5", "vClipPlane6", + "topColor", "bottomColor", "offset", "smoothness", "scale" + ]; + var samplers = []; + var uniformBuffers = new Array(); + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareUniformsAndSamplersList({ + uniformsNames: uniforms, + uniformBuffersNames: uniformBuffers, + samplers: samplers, + defines: defines, + maxSimultaneousLights: 4 + }); + subMesh.setEffect(scene.getEngine().createEffect(shaderName, { + attributes: attribs, + uniformsNames: uniforms, + uniformBuffersNames: uniformBuffers, + samplers: samplers, + defines: join, + fallbacks: fallbacks, + onCompiled: this.onCompiled, + onError: this.onError, + indexParameters: { maxSimultaneousLights: 4 } + }, engine), defines); + } + if (!subMesh.effect || !subMesh.effect.isReady()) { + return false; + } + defines._renderId = scene.getRenderId(); + subMesh.effect._wasPreviouslyReady = true; + return true; + }; + GradientMaterial.prototype.bindForSubMesh = function (world, mesh, subMesh) { + var scene = this.getScene(); + var defines = subMesh._materialDefines; + if (!defines) { + return; + } + var effect = subMesh.effect; + if (!effect) { + return; + } + this._activeEffect = effect; + // Matrices + this.bindOnlyWorldMatrix(world); + this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix()); + // Bones + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindBonesParameters(mesh, effect); + if (this._mustRebind(scene, effect)) { + // Clip plane + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindClipPlane(effect, scene); + // Point size + if (this.pointsCloud) { + this._activeEffect.setFloat("pointSize", this.pointSize); + } + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindEyePosition(effect, scene); + } + if (scene.lightsEnabled && !this.disableLighting) { + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindLights(scene, mesh, this._activeEffect, defines, this.maxSimultaneousLights); + } + // View + if (scene.fogEnabled && mesh.applyFog && scene.fogMode !== babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Scene"].FOGMODE_NONE) { + this._activeEffect.setMatrix("view", scene.getViewMatrix()); + } + // Fog + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindFogParameters(scene, mesh, this._activeEffect); + this._activeEffect.setColor4("topColor", this.topColor, this.topColorAlpha); + this._activeEffect.setColor4("bottomColor", this.bottomColor, this.bottomColorAlpha); + this._activeEffect.setFloat("offset", this.offset); + this._activeEffect.setFloat("scale", this.scale); + this._activeEffect.setFloat("smoothness", this.smoothness); + this._afterBind(mesh, this._activeEffect); + }; + GradientMaterial.prototype.getAnimatables = function () { + return []; + }; + GradientMaterial.prototype.dispose = function (forceDisposeEffect) { + _super.prototype.dispose.call(this, forceDisposeEffect); + }; + GradientMaterial.prototype.clone = function (name) { + var _this = this; + return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Clone(function () { return new GradientMaterial(name, _this.getScene()); }, this); + }; + GradientMaterial.prototype.serialize = function () { + var serializationObject = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Serialize(this); + serializationObject.customType = "BABYLON.GradientMaterial"; + return serializationObject; + }; + GradientMaterial.prototype.getClassName = function () { + return "GradientMaterial"; + }; + // Statics + GradientMaterial.Parse = function (source, scene, rootUrl) { + return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Parse(function () { return new GradientMaterial(source.name, scene); }, source, scene, rootUrl); + }; + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])("maxSimultaneousLights") + ], GradientMaterial.prototype, "_maxSimultaneousLights", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsLightsDirty") + ], GradientMaterial.prototype, "maxSimultaneousLights", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsColor3"])() + ], GradientMaterial.prototype, "topColor", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])() + ], GradientMaterial.prototype, "topColorAlpha", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsColor3"])() + ], GradientMaterial.prototype, "bottomColor", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])() + ], GradientMaterial.prototype, "bottomColorAlpha", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])() + ], GradientMaterial.prototype, "offset", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])() + ], GradientMaterial.prototype, "scale", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])() + ], GradientMaterial.prototype, "smoothness", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])("disableLighting") + ], GradientMaterial.prototype, "_disableLighting", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsLightsDirty") + ], GradientMaterial.prototype, "disableLighting", void 0); + return GradientMaterial; +}(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["PushMaterial"])); + +babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["_TypeStore"].RegisteredTypes["BABYLON.GradientMaterial"] = GradientMaterial; + + +/***/ }), + +/***/ "./gradient/index.ts": +/*!***************************!*\ + !*** ./gradient/index.ts ***! + \***************************/ +/*! exports provided: GradientMaterial */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _gradientMaterial__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./gradientMaterial */ "./gradient/gradientMaterial.ts"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GradientMaterial", function() { return _gradientMaterial__WEBPACK_IMPORTED_MODULE_0__["GradientMaterial"]; }); + + + + +/***/ }), + +/***/ "./grid/grid.fragment.ts": +/*!*******************************!*\ + !*** ./grid/grid.fragment.ts ***! + \*******************************/ +/*! exports provided: gridPixelShader */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "gridPixelShader", function() { return gridPixelShader; }); +/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators"); +/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__); + + + + +var name = 'gridPixelShader'; +var shader = "#extension GL_OES_standard_derivatives : enable\n#define SQRT2 1.41421356\n#define PI 3.14159\nprecision highp float;\nuniform vec3 mainColor;\nuniform vec3 lineColor;\nuniform vec4 gridControl;\nuniform vec3 gridOffset;\n\nvarying vec3 vPosition;\nvarying vec3 vNormal;\n#include\n\n#ifdef OPACITY\nvarying vec2 vOpacityUV;\nuniform sampler2D opacitySampler;\nuniform vec2 vOpacityInfos;\n#endif\nfloat getVisibility(float position) {\n\nfloat majorGridFrequency=gridControl.y;\nif (floor(position+0.5) == floor(position/majorGridFrequency+0.5)*majorGridFrequency)\n{\nreturn 1.0;\n}\nreturn gridControl.z;\n}\nfloat getAnisotropicAttenuation(float differentialLength) {\nconst float maxNumberOfLines=10.0;\nreturn clamp(1.0/(differentialLength+1.0)-1.0/maxNumberOfLines,0.0,1.0);\n}\nfloat isPointOnLine(float position,float differentialLength) {\nfloat fractionPartOfPosition=position-floor(position+0.5);\nfractionPartOfPosition/=differentialLength;\nfractionPartOfPosition=clamp(fractionPartOfPosition,-1.,1.);\nfloat result=0.5+0.5*cos(fractionPartOfPosition*PI);\nreturn result;\n}\nfloat contributionOnAxis(float position) {\nfloat differentialLength=length(vec2(dFdx(position),dFdy(position)));\ndifferentialLength*=SQRT2;\n\nfloat result=isPointOnLine(position,differentialLength);\n\nfloat visibility=getVisibility(position);\nresult*=visibility;\n\nfloat anisotropicAttenuation=getAnisotropicAttenuation(differentialLength);\nresult*=anisotropicAttenuation;\nreturn result;\n}\nfloat normalImpactOnAxis(float x) {\nfloat normalImpact=clamp(1.0-3.0*abs(x*x*x),0.0,1.0);\nreturn normalImpact;\n}\nvoid main(void) {\n\nfloat gridRatio=gridControl.x;\nvec3 gridPos=(vPosition+gridOffset.xyz)/gridRatio;\n\nfloat x=contributionOnAxis(gridPos.x);\nfloat y=contributionOnAxis(gridPos.y);\nfloat z=contributionOnAxis(gridPos.z);\n\nvec3 normal=normalize(vNormal);\nx*=normalImpactOnAxis(normal.x);\ny*=normalImpactOnAxis(normal.y);\nz*=normalImpactOnAxis(normal.z);\n\nfloat grid=clamp(x+y+z,0.,1.);\n\nvec3 color=mix(mainColor,lineColor,grid);\n#ifdef FOG\n#include\n#endif\nfloat opacity=1.0;\n#ifdef TRANSPARENT\nopacity=clamp(grid,0.08,gridControl.w*grid);\n#endif\n#ifdef OPACITY\nopacity*=texture2D(opacitySampler,vOpacityUV).a;\n#endif\n\ngl_FragColor=vec4(color.rgb,opacity);\n#ifdef TRANSPARENT\n#ifdef PREMULTIPLYALPHA\ngl_FragColor.rgb*=opacity;\n#endif\n#else\n#endif\n#include\n}"; +babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__["Effect"].ShadersStore[name] = shader; +/** @hidden */ +var gridPixelShader = { name: name, shader: shader }; + + +/***/ }), + +/***/ "./grid/grid.vertex.ts": +/*!*****************************!*\ + !*** ./grid/grid.vertex.ts ***! + \*****************************/ +/*! exports provided: gridVertexShader */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "gridVertexShader", function() { return gridVertexShader; }); +/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators"); +/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__); + + + + + +var name = 'gridVertexShader'; +var shader = "precision highp float;\n\nattribute vec3 position;\nattribute vec3 normal;\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#include\n\nuniform mat4 projection;\nuniform mat4 view;\n\nvarying vec3 vPosition;\nvarying vec3 vNormal;\n#include\n#ifdef OPACITY\nvarying vec2 vOpacityUV;\nuniform mat4 opacityMatrix;\nuniform vec2 vOpacityInfos;\n#endif\nvoid main(void) {\n#include\nvec4 worldPos=finalWorld*vec4(position,1.0);\n#include\nvec4 cameraSpacePosition=view*worldPos;\ngl_Position=projection*cameraSpacePosition;\n#ifdef OPACITY\n#ifndef UV1\nvec2 uv=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\nif (vOpacityInfos.x == 0.)\n{\nvOpacityUV=vec2(opacityMatrix*vec4(uv,1.0,0.0));\n}\nelse\n{\nvOpacityUV=vec2(opacityMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\nvPosition=position;\nvNormal=normal;\n}"; +babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__["Effect"].ShadersStore[name] = shader; +/** @hidden */ +var gridVertexShader = { name: name, shader: shader }; + + +/***/ }), + +/***/ "./grid/gridMaterial.ts": +/*!******************************!*\ + !*** ./grid/gridMaterial.ts ***! + \******************************/ +/*! exports provided: GridMaterial */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GridMaterial", function() { return GridMaterial; }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js"); +/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators"); +/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _grid_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./grid.fragment */ "./grid/grid.fragment.ts"); +/* harmony import */ var _grid_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./grid.vertex */ "./grid/grid.vertex.ts"); + + + + + + + + + + + + +var GridMaterialDefines = /** @class */ (function (_super) { + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(GridMaterialDefines, _super); + function GridMaterialDefines() { + var _this = _super.call(this) || this; + _this.OPACITY = false; + _this.TRANSPARENT = false; + _this.FOG = false; + _this.PREMULTIPLYALPHA = false; + _this.UV1 = false; + _this.UV2 = false; + _this.INSTANCES = false; + _this.THIN_INSTANCES = false; + _this.IMAGEPROCESSINGPOSTPROCESS = false; + _this.rebuild(); + return _this; + } + return GridMaterialDefines; +}(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialDefines"])); +/** + * The grid materials allows you to wrap any shape with a grid. + * Colors are customizable. + */ +var GridMaterial = /** @class */ (function (_super) { + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(GridMaterial, _super); + /** + * constructor + * @param name The name given to the material in order to identify it afterwards. + * @param scene The scene the material is used in. + */ + function GridMaterial(name, scene) { + var _this = _super.call(this, name, scene) || this; + /** + * Main color of the grid (e.g. between lines) + */ + _this.mainColor = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"].Black(); + /** + * Color of the grid lines. + */ + _this.lineColor = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"].Teal(); + /** + * The scale of the grid compared to unit. + */ + _this.gridRatio = 1.0; + /** + * Allows setting an offset for the grid lines. + */ + _this.gridOffset = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Vector3"].Zero(); + /** + * The frequency of thicker lines. + */ + _this.majorUnitFrequency = 10; + /** + * The visibility of minor units in the grid. + */ + _this.minorUnitVisibility = 0.33; + /** + * The grid opacity outside of the lines. + */ + _this.opacity = 1.0; + /** + * Determine RBG output is premultiplied by alpha value. + */ + _this.preMultiplyAlpha = false; + _this._gridControl = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Vector4"](_this.gridRatio, _this.majorUnitFrequency, _this.minorUnitVisibility, _this.opacity); + return _this; + } + /** + * Returns wehter or not the grid requires alpha blending. + */ + GridMaterial.prototype.needAlphaBlending = function () { + return this.opacity < 1.0 || this._opacityTexture && this._opacityTexture.isReady(); + }; + GridMaterial.prototype.needAlphaBlendingForMesh = function (mesh) { + return this.needAlphaBlending(); + }; + GridMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) { + if (this.isFrozen) { + if (subMesh.effect && subMesh.effect._wasPreviouslyReady) { + return true; + } + } + if (!subMesh._materialDefines) { + subMesh._materialDefines = new GridMaterialDefines(); + } + var defines = subMesh._materialDefines; + var scene = this.getScene(); + if (this._isReadyForSubMesh(subMesh)) { + return true; + } + if (defines.TRANSPARENT !== (this.opacity < 1.0)) { + defines.TRANSPARENT = !defines.TRANSPARENT; + defines.markAsUnprocessed(); + } + if (defines.PREMULTIPLYALPHA != this.preMultiplyAlpha) { + defines.PREMULTIPLYALPHA = !defines.PREMULTIPLYALPHA; + defines.markAsUnprocessed(); + } + // Textures + if (defines._areTexturesDirty) { + defines._needUVs = false; + if (scene.texturesEnabled) { + if (this._opacityTexture && babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialFlags"].OpacityTextureEnabled) { + if (!this._opacityTexture.isReady()) { + return false; + } + else { + defines._needUVs = true; + defines.OPACITY = true; + } + } + } + } + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForMisc(mesh, scene, false, false, this.fogEnabled, false, defines); + // Values that need to be evaluated on every frame + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForFrameBoundValues(scene, scene.getEngine(), defines, !!useInstances); + // Get correct effect + if (defines.isDirty) { + defines.markAsProcessed(); + scene.resetCachedMaterial(); + // Attributes + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForAttributes(mesh, defines, false, false); + var attribs = [babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].PositionKind, babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].NormalKind]; + if (defines.UV1) { + attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].UVKind); + } + if (defines.UV2) { + attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].UV2Kind); + } + defines.IMAGEPROCESSINGPOSTPROCESS = scene.imageProcessingConfiguration.applyByPostProcess; + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareAttributesForInstances(attribs, defines); + // Defines + var join = defines.toString(); + subMesh.setEffect(scene.getEngine().createEffect("grid", attribs, ["projection", "mainColor", "lineColor", "gridControl", "gridOffset", "vFogInfos", "vFogColor", "world", "view", + "opacityMatrix", "vOpacityInfos"], ["opacitySampler"], join, undefined, this.onCompiled, this.onError), defines); + } + if (!subMesh.effect || !subMesh.effect.isReady()) { + return false; + } + defines._renderId = scene.getRenderId(); + subMesh.effect._wasPreviouslyReady = true; + return true; + }; + GridMaterial.prototype.bindForSubMesh = function (world, mesh, subMesh) { + var scene = this.getScene(); + var defines = subMesh._materialDefines; + if (!defines) { + return; + } + var effect = subMesh.effect; + if (!effect) { + return; + } + this._activeEffect = effect; + // Matrices + if (!defines.INSTANCES || defines.THIN_INSTANCE) { + this.bindOnlyWorldMatrix(world); + } + this._activeEffect.setMatrix("view", scene.getViewMatrix()); + this._activeEffect.setMatrix("projection", scene.getProjectionMatrix()); + // Uniforms + if (this._mustRebind(scene, effect)) { + this._activeEffect.setColor3("mainColor", this.mainColor); + this._activeEffect.setColor3("lineColor", this.lineColor); + this._activeEffect.setVector3("gridOffset", this.gridOffset); + this._gridControl.x = this.gridRatio; + this._gridControl.y = Math.round(this.majorUnitFrequency); + this._gridControl.z = this.minorUnitVisibility; + this._gridControl.w = this.opacity; + this._activeEffect.setVector4("gridControl", this._gridControl); + if (this._opacityTexture && babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialFlags"].OpacityTextureEnabled) { + this._activeEffect.setTexture("opacitySampler", this._opacityTexture); + this._activeEffect.setFloat2("vOpacityInfos", this._opacityTexture.coordinatesIndex, this._opacityTexture.level); + this._activeEffect.setMatrix("opacityMatrix", this._opacityTexture.getTextureMatrix()); + } + } + // Fog + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindFogParameters(scene, mesh, this._activeEffect); + this._afterBind(mesh, this._activeEffect); + }; + /** + * Dispose the material and its associated resources. + * @param forceDisposeEffect will also dispose the used effect when true + */ + GridMaterial.prototype.dispose = function (forceDisposeEffect) { + _super.prototype.dispose.call(this, forceDisposeEffect); + }; + GridMaterial.prototype.clone = function (name) { + var _this = this; + return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Clone(function () { return new GridMaterial(name, _this.getScene()); }, this); + }; + GridMaterial.prototype.serialize = function () { + var serializationObject = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Serialize(this); + serializationObject.customType = "BABYLON.GridMaterial"; + return serializationObject; + }; + GridMaterial.prototype.getClassName = function () { + return "GridMaterial"; + }; + GridMaterial.Parse = function (source, scene, rootUrl) { + return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Parse(function () { return new GridMaterial(source.name, scene); }, source, scene, rootUrl); + }; + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsColor3"])() + ], GridMaterial.prototype, "mainColor", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsColor3"])() + ], GridMaterial.prototype, "lineColor", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])() + ], GridMaterial.prototype, "gridRatio", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsColor3"])() + ], GridMaterial.prototype, "gridOffset", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])() + ], GridMaterial.prototype, "majorUnitFrequency", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])() + ], GridMaterial.prototype, "minorUnitVisibility", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])() + ], GridMaterial.prototype, "opacity", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])() + ], GridMaterial.prototype, "preMultiplyAlpha", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("opacityTexture") + ], GridMaterial.prototype, "_opacityTexture", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty") + ], GridMaterial.prototype, "opacityTexture", void 0); + return GridMaterial; +}(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["PushMaterial"])); + +babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["_TypeStore"].RegisteredTypes["BABYLON.GridMaterial"] = GridMaterial; + + +/***/ }), + +/***/ "./grid/index.ts": +/*!***********************!*\ + !*** ./grid/index.ts ***! + \***********************/ +/*! exports provided: GridMaterial */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _gridMaterial__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./gridMaterial */ "./grid/gridMaterial.ts"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GridMaterial", function() { return _gridMaterial__WEBPACK_IMPORTED_MODULE_0__["GridMaterial"]; }); + + + + +/***/ }), + +/***/ "./index.ts": +/*!******************!*\ + !*** ./index.ts ***! + \******************/ +/*! exports provided: CellMaterial, CustomShaderStructure, ShaderSpecialParts, CustomMaterial, ShaderAlebdoParts, PBRCustomMaterial, FireMaterial, FurMaterial, GradientMaterial, GridMaterial, LavaMaterial, MixMaterial, NormalMaterial, ShadowOnlyMaterial, SimpleMaterial, SkyMaterial, TerrainMaterial, TriPlanarMaterial, WaterMaterial */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _cell__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./cell */ "./cell/index.ts"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CellMaterial", function() { return _cell__WEBPACK_IMPORTED_MODULE_0__["CellMaterial"]; }); + +/* harmony import */ var _custom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./custom */ "./custom/index.ts"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CustomShaderStructure", function() { return _custom__WEBPACK_IMPORTED_MODULE_1__["CustomShaderStructure"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ShaderSpecialParts", function() { return _custom__WEBPACK_IMPORTED_MODULE_1__["ShaderSpecialParts"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CustomMaterial", function() { return _custom__WEBPACK_IMPORTED_MODULE_1__["CustomMaterial"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ShaderAlebdoParts", function() { return _custom__WEBPACK_IMPORTED_MODULE_1__["ShaderAlebdoParts"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PBRCustomMaterial", function() { return _custom__WEBPACK_IMPORTED_MODULE_1__["PBRCustomMaterial"]; }); + +/* harmony import */ var _fire__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./fire */ "./fire/index.ts"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FireMaterial", function() { return _fire__WEBPACK_IMPORTED_MODULE_2__["FireMaterial"]; }); + +/* harmony import */ var _fur__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./fur */ "./fur/index.ts"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FurMaterial", function() { return _fur__WEBPACK_IMPORTED_MODULE_3__["FurMaterial"]; }); + +/* harmony import */ var _gradient__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./gradient */ "./gradient/index.ts"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GradientMaterial", function() { return _gradient__WEBPACK_IMPORTED_MODULE_4__["GradientMaterial"]; }); + +/* harmony import */ var _grid__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./grid */ "./grid/index.ts"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GridMaterial", function() { return _grid__WEBPACK_IMPORTED_MODULE_5__["GridMaterial"]; }); + +/* harmony import */ var _lava__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./lava */ "./lava/index.ts"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LavaMaterial", function() { return _lava__WEBPACK_IMPORTED_MODULE_6__["LavaMaterial"]; }); + +/* harmony import */ var _mix__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./mix */ "./mix/index.ts"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MixMaterial", function() { return _mix__WEBPACK_IMPORTED_MODULE_7__["MixMaterial"]; }); + +/* harmony import */ var _normal__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./normal */ "./normal/index.ts"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NormalMaterial", function() { return _normal__WEBPACK_IMPORTED_MODULE_8__["NormalMaterial"]; }); + +/* harmony import */ var _shadowOnly__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./shadowOnly */ "./shadowOnly/index.ts"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ShadowOnlyMaterial", function() { return _shadowOnly__WEBPACK_IMPORTED_MODULE_9__["ShadowOnlyMaterial"]; }); + +/* harmony import */ var _simple__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./simple */ "./simple/index.ts"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SimpleMaterial", function() { return _simple__WEBPACK_IMPORTED_MODULE_10__["SimpleMaterial"]; }); + +/* harmony import */ var _sky__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./sky */ "./sky/index.ts"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SkyMaterial", function() { return _sky__WEBPACK_IMPORTED_MODULE_11__["SkyMaterial"]; }); + +/* harmony import */ var _terrain__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./terrain */ "./terrain/index.ts"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TerrainMaterial", function() { return _terrain__WEBPACK_IMPORTED_MODULE_12__["TerrainMaterial"]; }); + +/* harmony import */ var _triPlanar__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./triPlanar */ "./triPlanar/index.ts"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TriPlanarMaterial", function() { return _triPlanar__WEBPACK_IMPORTED_MODULE_13__["TriPlanarMaterial"]; }); + +/* harmony import */ var _water__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./water */ "./water/index.ts"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WaterMaterial", function() { return _water__WEBPACK_IMPORTED_MODULE_14__["WaterMaterial"]; }); + + + + + + + + + + + + + + + + + + +/***/ }), + +/***/ "./lava/index.ts": +/*!***********************!*\ + !*** ./lava/index.ts ***! + \***********************/ +/*! exports provided: LavaMaterial */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _lavaMaterial__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lavaMaterial */ "./lava/lavaMaterial.ts"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LavaMaterial", function() { return _lavaMaterial__WEBPACK_IMPORTED_MODULE_0__["LavaMaterial"]; }); + + + + +/***/ }), + +/***/ "./lava/lava.fragment.ts": +/*!*******************************!*\ + !*** ./lava/lava.fragment.ts ***! + \*******************************/ +/*! exports provided: lavaPixelShader */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lavaPixelShader", function() { return lavaPixelShader; }); +/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators"); +/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__); + + + + + + + + + + + + + +var name = 'lavaPixelShader'; +var shader = "precision highp float;\n\nuniform vec3 vEyePosition;\nuniform vec4 vDiffuseColor;\n\nvarying vec3 vPositionW;\n\nuniform float time;\nuniform float speed;\nuniform float movingSpeed;\nuniform vec3 fogColor;\nuniform sampler2D noiseTexture;\nuniform float fogDensity;\n\nvarying float noise;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n\n#include\n\n#include<__decl__lightFragment>[0]\n#include<__decl__lightFragment>[1]\n#include<__decl__lightFragment>[2]\n#include<__decl__lightFragment>[3]\n#include\n#include\n\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;\nuniform sampler2D diffuseSampler;\nuniform vec2 vDiffuseInfos;\n#endif\n#include\n\n#include\nfloat random( vec3 scale,float seed ){\nreturn fract( sin( dot( gl_FragCoord.xyz+seed,scale ) )*43758.5453+seed ) ;\n}\nvoid main(void) {\n#include\nvec3 viewDirectionW=normalize(vEyePosition-vPositionW);\n\nvec4 baseColor=vec4(1.,1.,1.,1.);\nvec3 diffuseColor=vDiffuseColor.rgb;\n\nfloat alpha=vDiffuseColor.a;\n#ifdef DIFFUSE\n\nvec4 noiseTex=texture2D( noiseTexture,vDiffuseUV );\nvec2 T1=vDiffuseUV+vec2( 1.5,-1.5 )*time*0.02;\nvec2 T2=vDiffuseUV+vec2( -0.5,2.0 )*time*0.01*speed;\nT1.x+=noiseTex.x*2.0;\nT1.y+=noiseTex.y*2.0;\nT2.x-=noiseTex.y*0.2+time*0.001*movingSpeed;\nT2.y+=noiseTex.z*0.2+time*0.002*movingSpeed;\nfloat p=texture2D( noiseTexture,T1*3.0 ).a;\nvec4 lavaColor=texture2D( diffuseSampler,T2*4.0);\nvec4 temp=lavaColor*( vec4( p,p,p,p )*2. )+( lavaColor*lavaColor-0.1 );\nbaseColor=temp;\nfloat depth=gl_FragCoord.z*4.0;\nconst float LOG2=1.442695;\nfloat fogFactor=exp2(-fogDensity*fogDensity*depth*depth*LOG2 );\nfogFactor=1.0-clamp( fogFactor,0.0,1.0 );\nbaseColor=mix( baseColor,vec4( fogColor,baseColor.w ),fogFactor );\ndiffuseColor=baseColor.rgb;\n\n\n#ifdef ALPHATEST\nif (baseColor.a<0.4)\ndiscard;\n#endif\n#include\nbaseColor.rgb*=vDiffuseInfos.y;\n#endif\n#ifdef VERTEXCOLOR\nbaseColor.rgb*=vColor.rgb;\n#endif\n\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);\n#endif\n#ifdef UNLIT\nvec3 diffuseBase=vec3(1.,1.,1.);\n#else\n\nvec3 diffuseBase=vec3(0.,0.,0.);\nlightingInfo info;\nfloat shadow=1.;\nfloat glossiness=0.;\n#include[0]\n#include[1]\n#include[2]\n#include[3]\n#endif\n#ifdef VERTEXALPHA\nalpha*=vColor.a;\n#endif\nvec3 finalDiffuse=clamp(diffuseBase*diffuseColor,0.0,1.0)*baseColor.rgb;\n\nvec4 color=vec4(finalDiffuse,alpha);\n#include\ngl_FragColor=color;\n#include\n}"; +babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__["Effect"].ShadersStore[name] = shader; +/** @hidden */ +var lavaPixelShader = { name: name, shader: shader }; + + +/***/ }), + +/***/ "./lava/lava.vertex.ts": +/*!*****************************!*\ + !*** ./lava/lava.vertex.ts ***! + \*****************************/ +/*! exports provided: lavaVertexShader */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lavaVertexShader", function() { return lavaVertexShader; }); +/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators"); +/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__); + + + + + + + + + + + + +var name = 'lavaVertexShader'; +var shader = "precision highp float;\n\nuniform float time;\nuniform float lowFrequencySpeed;\n\nvarying float noise;\n\nattribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include\n\n#include\nuniform mat4 view;\nuniform mat4 viewProjection;\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;\nuniform mat4 diffuseMatrix;\nuniform vec2 vDiffuseInfos;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\n\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include\n#include\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n\n\n\nvec3 mod289(vec3 x)\n{\nreturn x-floor(x*(1.0/289.0))*289.0;\n}\nvec4 mod289(vec4 x)\n{\nreturn x-floor(x*(1.0/289.0))*289.0;\n}\nvec4 permute(vec4 x)\n{\nreturn mod289(((x*34.0)+1.0)*x);\n}\nvec4 taylorInvSqrt(vec4 r)\n{\nreturn 1.79284291400159-0.85373472095314*r;\n}\nvec3 fade(vec3 t) {\nreturn t*t*t*(t*(t*6.0-15.0)+10.0);\n}\n\nfloat pnoise(vec3 P,vec3 rep)\n{\nvec3 Pi0=mod(floor(P),rep);\nvec3 Pi1=mod(Pi0+vec3(1.0),rep);\nPi0=mod289(Pi0);\nPi1=mod289(Pi1);\nvec3 Pf0=fract(P);\nvec3 Pf1=Pf0-vec3(1.0);\nvec4 ix=vec4(Pi0.x,Pi1.x,Pi0.x,Pi1.x);\nvec4 iy=vec4(Pi0.yy,Pi1.yy);\nvec4 iz0=Pi0.zzzz;\nvec4 iz1=Pi1.zzzz;\nvec4 ixy=permute(permute(ix)+iy);\nvec4 ixy0=permute(ixy+iz0);\nvec4 ixy1=permute(ixy+iz1);\nvec4 gx0=ixy0*(1.0/7.0);\nvec4 gy0=fract(floor(gx0)*(1.0/7.0))-0.5;\ngx0=fract(gx0);\nvec4 gz0=vec4(0.5)-abs(gx0)-abs(gy0);\nvec4 sz0=step(gz0,vec4(0.0));\ngx0-=sz0*(step(0.0,gx0)-0.5);\ngy0-=sz0*(step(0.0,gy0)-0.5);\nvec4 gx1=ixy1*(1.0/7.0);\nvec4 gy1=fract(floor(gx1)*(1.0/7.0))-0.5;\ngx1=fract(gx1);\nvec4 gz1=vec4(0.5)-abs(gx1)-abs(gy1);\nvec4 sz1=step(gz1,vec4(0.0));\ngx1-=sz1*(step(0.0,gx1)-0.5);\ngy1-=sz1*(step(0.0,gy1)-0.5);\nvec3 g000=vec3(gx0.x,gy0.x,gz0.x);\nvec3 g100=vec3(gx0.y,gy0.y,gz0.y);\nvec3 g010=vec3(gx0.z,gy0.z,gz0.z);\nvec3 g110=vec3(gx0.w,gy0.w,gz0.w);\nvec3 g001=vec3(gx1.x,gy1.x,gz1.x);\nvec3 g101=vec3(gx1.y,gy1.y,gz1.y);\nvec3 g011=vec3(gx1.z,gy1.z,gz1.z);\nvec3 g111=vec3(gx1.w,gy1.w,gz1.w);\nvec4 norm0=taylorInvSqrt(vec4(dot(g000,g000),dot(g010,g010),dot(g100,g100),dot(g110,g110)));\ng000*=norm0.x;\ng010*=norm0.y;\ng100*=norm0.z;\ng110*=norm0.w;\nvec4 norm1=taylorInvSqrt(vec4(dot(g001,g001),dot(g011,g011),dot(g101,g101),dot(g111,g111)));\ng001*=norm1.x;\ng011*=norm1.y;\ng101*=norm1.z;\ng111*=norm1.w;\nfloat n000=dot(g000,Pf0);\nfloat n100=dot(g100,vec3(Pf1.x,Pf0.yz));\nfloat n010=dot(g010,vec3(Pf0.x,Pf1.y,Pf0.z));\nfloat n110=dot(g110,vec3(Pf1.xy,Pf0.z));\nfloat n001=dot(g001,vec3(Pf0.xy,Pf1.z));\nfloat n101=dot(g101,vec3(Pf1.x,Pf0.y,Pf1.z));\nfloat n011=dot(g011,vec3(Pf0.x,Pf1.yz));\nfloat n111=dot(g111,Pf1);\nvec3 fade_xyz=fade(Pf0);\nvec4 n_z=mix(vec4(n000,n100,n010,n110),vec4(n001,n101,n011,n111),fade_xyz.z);\nvec2 n_yz=mix(n_z.xy,n_z.zw,fade_xyz.y);\nfloat n_xyz=mix(n_yz.x,n_yz.y,fade_xyz.x);\nreturn 2.2*n_xyz;\n}\n\nfloat turbulence( vec3 p ) {\nfloat w=100.0;\nfloat t=-.5;\nfor (float f=1.0 ; f<=10.0 ; f++ ){\nfloat power=pow( 2.0,f );\nt+=abs( pnoise( vec3( power*p ),vec3( 10.0,10.0,10.0 ) )/power );\n}\nreturn t;\n}\nvoid main(void) {\n#include\n#include\n#ifdef NORMAL\n\nnoise=10.0*-.10*turbulence( .5*normal+time*1.15 );\n\nfloat b=lowFrequencySpeed*5.0*pnoise( 0.05*position +vec3(time*1.025),vec3( 100.0 ) );\n\nfloat displacement =-1.5*noise+b;\n\nvec3 newPosition=position+normal*displacement;\ngl_Position=viewProjection*finalWorld*vec4( newPosition,1.0 );\nvec4 worldPos=finalWorld*vec4(newPosition,1.0);\nvPositionW=vec3(worldPos);\nvNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));\n#endif\n\n#ifndef UV1\nvec2 uv=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\n#ifdef DIFFUSE\nif (vDiffuseInfos.x == 0.)\n{\nvDiffuseUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));\n}\nelse\n{\nvDiffuseUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n\n#include\n\n#include\n#include[0..maxSimultaneousLights]\n\n#ifdef VERTEXCOLOR\nvColor=color;\n#endif\n\n#ifdef POINTSIZE\ngl_PointSize=pointSize;\n#endif\n}"; +babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__["Effect"].ShadersStore[name] = shader; +/** @hidden */ +var lavaVertexShader = { name: name, shader: shader }; + + +/***/ }), + +/***/ "./lava/lavaMaterial.ts": +/*!******************************!*\ + !*** ./lava/lavaMaterial.ts ***! + \******************************/ +/*! exports provided: LavaMaterial */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LavaMaterial", function() { return LavaMaterial; }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js"); +/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators"); +/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _lava_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./lava.fragment */ "./lava/lava.fragment.ts"); +/* harmony import */ var _lava_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./lava.vertex */ "./lava/lava.vertex.ts"); + + + + + + + + + + + + + +var LavaMaterialDefines = /** @class */ (function (_super) { + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(LavaMaterialDefines, _super); + function LavaMaterialDefines() { + var _this = _super.call(this) || this; + _this.DIFFUSE = false; + _this.CLIPPLANE = false; + _this.CLIPPLANE2 = false; + _this.CLIPPLANE3 = false; + _this.CLIPPLANE4 = false; + _this.CLIPPLANE5 = false; + _this.CLIPPLANE6 = false; + _this.ALPHATEST = false; + _this.DEPTHPREPASS = false; + _this.POINTSIZE = false; + _this.FOG = false; + _this.LIGHT0 = false; + _this.LIGHT1 = false; + _this.LIGHT2 = false; + _this.LIGHT3 = false; + _this.SPOTLIGHT0 = false; + _this.SPOTLIGHT1 = false; + _this.SPOTLIGHT2 = false; + _this.SPOTLIGHT3 = false; + _this.HEMILIGHT0 = false; + _this.HEMILIGHT1 = false; + _this.HEMILIGHT2 = false; + _this.HEMILIGHT3 = false; + _this.DIRLIGHT0 = false; + _this.DIRLIGHT1 = false; + _this.DIRLIGHT2 = false; + _this.DIRLIGHT3 = false; + _this.POINTLIGHT0 = false; + _this.POINTLIGHT1 = false; + _this.POINTLIGHT2 = false; + _this.POINTLIGHT3 = false; + _this.SHADOW0 = false; + _this.SHADOW1 = false; + _this.SHADOW2 = false; + _this.SHADOW3 = false; + _this.SHADOWS = false; + _this.SHADOWESM0 = false; + _this.SHADOWESM1 = false; + _this.SHADOWESM2 = false; + _this.SHADOWESM3 = false; + _this.SHADOWPOISSON0 = false; + _this.SHADOWPOISSON1 = false; + _this.SHADOWPOISSON2 = false; + _this.SHADOWPOISSON3 = false; + _this.SHADOWPCF0 = false; + _this.SHADOWPCF1 = false; + _this.SHADOWPCF2 = false; + _this.SHADOWPCF3 = false; + _this.SHADOWPCSS0 = false; + _this.SHADOWPCSS1 = false; + _this.SHADOWPCSS2 = false; + _this.SHADOWPCSS3 = false; + _this.NORMAL = false; + _this.UV1 = false; + _this.UV2 = false; + _this.VERTEXCOLOR = false; + _this.VERTEXALPHA = false; + _this.NUM_BONE_INFLUENCERS = 0; + _this.BonesPerMesh = 0; + _this.INSTANCES = false; + _this.UNLIT = false; + _this.IMAGEPROCESSINGPOSTPROCESS = false; + _this.rebuild(); + return _this; + } + return LavaMaterialDefines; +}(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialDefines"])); +var LavaMaterial = /** @class */ (function (_super) { + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(LavaMaterial, _super); + function LavaMaterial(name, scene) { + var _this = _super.call(this, name, scene) || this; + _this.speed = 1; + _this.movingSpeed = 1; + _this.lowFrequencySpeed = 1; + _this.fogDensity = 0.15; + _this._lastTime = 0; + _this.diffuseColor = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](1, 1, 1); + _this._disableLighting = false; + _this._unlit = false; + _this._maxSimultaneousLights = 4; + _this._scaledDiffuse = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](); + return _this; + } + LavaMaterial.prototype.needAlphaBlending = function () { + return (this.alpha < 1.0); + }; + LavaMaterial.prototype.needAlphaTesting = function () { + return false; + }; + LavaMaterial.prototype.getAlphaTestTexture = function () { + return null; + }; + // Methods + LavaMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) { + if (this.isFrozen) { + if (subMesh.effect && subMesh.effect._wasPreviouslyReady) { + return true; + } + } + if (!subMesh._materialDefines) { + subMesh._materialDefines = new LavaMaterialDefines(); + } + var defines = subMesh._materialDefines; + var scene = this.getScene(); + if (this._isReadyForSubMesh(subMesh)) { + return true; + } + var engine = scene.getEngine(); + // Textures + if (defines._areTexturesDirty) { + defines._needUVs = false; + if (scene.texturesEnabled) { + if (this._diffuseTexture && babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialFlags"].DiffuseTextureEnabled) { + if (!this._diffuseTexture.isReady()) { + return false; + } + else { + defines._needUVs = true; + defines.DIFFUSE = true; + } + } + } + } + // Misc. + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForMisc(mesh, scene, false, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(mesh), defines); + // Lights + defines._needNormals = true; + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForLights(scene, mesh, defines, false, this._maxSimultaneousLights, this._disableLighting); + // Values that need to be evaluated on every frame + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForFrameBoundValues(scene, engine, defines, useInstances ? true : false); + // Attribs + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForAttributes(mesh, defines, true, true); + // Get correct effect + if (defines.isDirty) { + defines.markAsProcessed(); + scene.resetCachedMaterial(); + // Fallbacks + var fallbacks = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["EffectFallbacks"](); + if (defines.FOG) { + fallbacks.addFallback(1, "FOG"); + } + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].HandleFallbacksForShadows(defines, fallbacks); + if (defines.NUM_BONE_INFLUENCERS > 0) { + fallbacks.addCPUSkinningFallback(0, mesh); + } + defines.IMAGEPROCESSINGPOSTPROCESS = scene.imageProcessingConfiguration.applyByPostProcess; + //Attributes + var attribs = [babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].PositionKind]; + if (defines.NORMAL) { + attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].NormalKind); + } + if (defines.UV1) { + attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].UVKind); + } + if (defines.UV2) { + attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].UV2Kind); + } + if (defines.VERTEXCOLOR) { + attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].ColorKind); + } + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareAttributesForBones(attribs, mesh, defines, fallbacks); + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareAttributesForInstances(attribs, defines); + // Legacy browser patch + var shaderName = "lava"; + var join = defines.toString(); + var uniforms = ["world", "view", "viewProjection", "vEyePosition", "vLightsType", "vDiffuseColor", + "vFogInfos", "vFogColor", "pointSize", + "vDiffuseInfos", + "mBones", + "vClipPlane", "vClipPlane2", "vClipPlane3", "vClipPlane4", "vClipPlane5", "vClipPlane6", "diffuseMatrix", + "time", "speed", "movingSpeed", + "fogColor", "fogDensity", "lowFrequencySpeed" + ]; + var samplers = ["diffuseSampler", + "noiseTexture" + ]; + var uniformBuffers = new Array(); + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareUniformsAndSamplersList({ + uniformsNames: uniforms, + uniformBuffersNames: uniformBuffers, + samplers: samplers, + defines: defines, + maxSimultaneousLights: this.maxSimultaneousLights + }); + subMesh.setEffect(scene.getEngine().createEffect(shaderName, { + attributes: attribs, + uniformsNames: uniforms, + uniformBuffersNames: uniformBuffers, + samplers: samplers, + defines: join, + fallbacks: fallbacks, + onCompiled: this.onCompiled, + onError: this.onError, + indexParameters: { maxSimultaneousLights: this.maxSimultaneousLights } + }, engine), defines); + } + if (!subMesh.effect || !subMesh.effect.isReady()) { + return false; + } + defines._renderId = scene.getRenderId(); + subMesh.effect._wasPreviouslyReady = true; + return true; + }; + LavaMaterial.prototype.bindForSubMesh = function (world, mesh, subMesh) { + var scene = this.getScene(); + var defines = subMesh._materialDefines; + if (!defines) { + return; + } + var effect = subMesh.effect; + if (!effect) { + return; + } + this._activeEffect = effect; + defines.UNLIT = this._unlit; + // Matrices + this.bindOnlyWorldMatrix(world); + this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix()); + // Bones + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindBonesParameters(mesh, this._activeEffect); + if (this._mustRebind(scene, effect)) { + // Textures + if (this.diffuseTexture && babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialFlags"].DiffuseTextureEnabled) { + this._activeEffect.setTexture("diffuseSampler", this.diffuseTexture); + this._activeEffect.setFloat2("vDiffuseInfos", this.diffuseTexture.coordinatesIndex, this.diffuseTexture.level); + this._activeEffect.setMatrix("diffuseMatrix", this.diffuseTexture.getTextureMatrix()); + } + if (this.noiseTexture) { + this._activeEffect.setTexture("noiseTexture", this.noiseTexture); + } + // Clip plane + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindClipPlane(this._activeEffect, scene); + // Point size + if (this.pointsCloud) { + this._activeEffect.setFloat("pointSize", this.pointSize); + } + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindEyePosition(effect, scene); + } + this._activeEffect.setColor4("vDiffuseColor", this._scaledDiffuse, this.alpha * mesh.visibility); + if (scene.lightsEnabled && !this.disableLighting) { + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindLights(scene, mesh, this._activeEffect, defines); + } + // View + if (scene.fogEnabled && mesh.applyFog && scene.fogMode !== babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Scene"].FOGMODE_NONE) { + this._activeEffect.setMatrix("view", scene.getViewMatrix()); + } + // Fog + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindFogParameters(scene, mesh, this._activeEffect); + this._lastTime += scene.getEngine().getDeltaTime(); + this._activeEffect.setFloat("time", this._lastTime * this.speed / 1000); + if (!this.fogColor) { + this.fogColor = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"].Black(); + } + this._activeEffect.setColor3("fogColor", this.fogColor); + this._activeEffect.setFloat("fogDensity", this.fogDensity); + this._activeEffect.setFloat("lowFrequencySpeed", this.lowFrequencySpeed); + this._activeEffect.setFloat("movingSpeed", this.movingSpeed); + this._afterBind(mesh, this._activeEffect); + }; + LavaMaterial.prototype.getAnimatables = function () { + var results = []; + if (this.diffuseTexture && this.diffuseTexture.animations && this.diffuseTexture.animations.length > 0) { + results.push(this.diffuseTexture); + } + if (this.noiseTexture && this.noiseTexture.animations && this.noiseTexture.animations.length > 0) { + results.push(this.noiseTexture); + } + return results; + }; + LavaMaterial.prototype.getActiveTextures = function () { + var activeTextures = _super.prototype.getActiveTextures.call(this); + if (this._diffuseTexture) { + activeTextures.push(this._diffuseTexture); + } + return activeTextures; + }; + LavaMaterial.prototype.hasTexture = function (texture) { + if (_super.prototype.hasTexture.call(this, texture)) { + return true; + } + if (this.diffuseTexture === texture) { + return true; + } + return false; + }; + LavaMaterial.prototype.dispose = function (forceDisposeEffect) { + if (this.diffuseTexture) { + this.diffuseTexture.dispose(); + } + if (this.noiseTexture) { + this.noiseTexture.dispose(); + } + _super.prototype.dispose.call(this, forceDisposeEffect); + }; + LavaMaterial.prototype.clone = function (name) { + var _this = this; + return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Clone(function () { return new LavaMaterial(name, _this.getScene()); }, this); + }; + LavaMaterial.prototype.serialize = function () { + var serializationObject = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Serialize(this); + serializationObject.customType = "BABYLON.LavaMaterial"; + return serializationObject; + }; + LavaMaterial.prototype.getClassName = function () { + return "LavaMaterial"; + }; + // Statics + LavaMaterial.Parse = function (source, scene, rootUrl) { + return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Parse(function () { return new LavaMaterial(source.name, scene); }, source, scene, rootUrl); + }; + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("diffuseTexture") + ], LavaMaterial.prototype, "_diffuseTexture", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty") + ], LavaMaterial.prototype, "diffuseTexture", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])() + ], LavaMaterial.prototype, "noiseTexture", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsColor3"])() + ], LavaMaterial.prototype, "fogColor", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])() + ], LavaMaterial.prototype, "speed", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])() + ], LavaMaterial.prototype, "movingSpeed", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])() + ], LavaMaterial.prototype, "lowFrequencySpeed", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])() + ], LavaMaterial.prototype, "fogDensity", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsColor3"])() + ], LavaMaterial.prototype, "diffuseColor", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])("disableLighting") + ], LavaMaterial.prototype, "_disableLighting", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsLightsDirty") + ], LavaMaterial.prototype, "disableLighting", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])("unlit") + ], LavaMaterial.prototype, "_unlit", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsLightsDirty") + ], LavaMaterial.prototype, "unlit", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])("maxSimultaneousLights") + ], LavaMaterial.prototype, "_maxSimultaneousLights", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsLightsDirty") + ], LavaMaterial.prototype, "maxSimultaneousLights", void 0); + return LavaMaterial; +}(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["PushMaterial"])); + +babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["_TypeStore"].RegisteredTypes["BABYLON.LavaMaterial"] = LavaMaterial; + + +/***/ }), + +/***/ "./legacy/legacy.ts": +/*!**************************!*\ + !*** ./legacy/legacy.ts ***! + \**************************/ +/*! exports provided: CellMaterial, CustomShaderStructure, ShaderSpecialParts, CustomMaterial, ShaderAlebdoParts, PBRCustomMaterial, FireMaterial, FurMaterial, GradientMaterial, GridMaterial, LavaMaterial, MixMaterial, NormalMaterial, ShadowOnlyMaterial, SimpleMaterial, SkyMaterial, TerrainMaterial, TriPlanarMaterial, WaterMaterial */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* WEBPACK VAR INJECTION */(function(global) {/* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../index */ "./index.ts"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CellMaterial", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["CellMaterial"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CustomShaderStructure", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["CustomShaderStructure"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ShaderSpecialParts", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["ShaderSpecialParts"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CustomMaterial", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["CustomMaterial"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ShaderAlebdoParts", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["ShaderAlebdoParts"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PBRCustomMaterial", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["PBRCustomMaterial"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FireMaterial", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["FireMaterial"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FurMaterial", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["FurMaterial"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GradientMaterial", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["GradientMaterial"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GridMaterial", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["GridMaterial"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LavaMaterial", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["LavaMaterial"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MixMaterial", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["MixMaterial"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NormalMaterial", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["NormalMaterial"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ShadowOnlyMaterial", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["ShadowOnlyMaterial"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SimpleMaterial", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["SimpleMaterial"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SkyMaterial", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["SkyMaterial"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TerrainMaterial", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["TerrainMaterial"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TriPlanarMaterial", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["TriPlanarMaterial"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WaterMaterial", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["WaterMaterial"]; }); + + +/** + * Legacy support, defining window.BABYLON.GridMaterial... (global variable). + * + * This is the entry point for the UMD module. + * The entry point for a future ESM package should be index.ts + */ +var globalObject = (typeof global !== 'undefined') ? global : ((typeof window !== 'undefined') ? window : undefined); +if (typeof globalObject !== "undefined") { + globalObject.BABYLON = globalObject.BABYLON || {}; + for (var mat in _index__WEBPACK_IMPORTED_MODULE_0__) { + globalObject.BABYLON[mat] = _index__WEBPACK_IMPORTED_MODULE_0__[mat]; + } +} + + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node_modules/webpack/buildin/global.js */ "../../node_modules/webpack/buildin/global.js"))) + +/***/ }), + +/***/ "./mix/index.ts": +/*!**********************!*\ + !*** ./mix/index.ts ***! + \**********************/ +/*! exports provided: MixMaterial */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _mixMaterial__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./mixMaterial */ "./mix/mixMaterial.ts"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MixMaterial", function() { return _mixMaterial__WEBPACK_IMPORTED_MODULE_0__["MixMaterial"]; }); + + + + +/***/ }), + +/***/ "./mix/mix.fragment.ts": +/*!*****************************!*\ + !*** ./mix/mix.fragment.ts ***! + \*****************************/ +/*! exports provided: mixPixelShader */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mixPixelShader", function() { return mixPixelShader; }); +/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators"); +/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__); + + + + + + + + + + + + + +var name = 'mixPixelShader'; +var shader = "precision highp float;\n\nuniform vec3 vEyePosition;\nuniform vec4 vDiffuseColor;\n#ifdef SPECULARTERM\nuniform vec4 vSpecularColor;\n#endif\n\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n\n#include\n\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n\n#ifdef DIFFUSE\nvarying vec2 vTextureUV;\nuniform sampler2D mixMap1Sampler;\nuniform vec2 vTextureInfos;\n#ifdef MIXMAP2\nuniform sampler2D mixMap2Sampler;\n#endif\nuniform sampler2D diffuse1Sampler;\nuniform sampler2D diffuse2Sampler;\nuniform sampler2D diffuse3Sampler;\nuniform sampler2D diffuse4Sampler;\nuniform vec2 diffuse1Infos;\nuniform vec2 diffuse2Infos;\nuniform vec2 diffuse3Infos;\nuniform vec2 diffuse4Infos;\n#ifdef MIXMAP2\nuniform sampler2D diffuse5Sampler;\nuniform sampler2D diffuse6Sampler;\nuniform sampler2D diffuse7Sampler;\nuniform sampler2D diffuse8Sampler;\nuniform vec2 diffuse5Infos;\nuniform vec2 diffuse6Infos;\nuniform vec2 diffuse7Infos;\nuniform vec2 diffuse8Infos;\n#endif\n#endif\n\n#include\n#include\n#include\n\n#include\nvoid main(void) {\n\n#include\nvec3 viewDirectionW=normalize(vEyePosition-vPositionW);\n\nvec4 finalMixColor=vec4(1.,1.,1.,1.);\nvec3 diffuseColor=vDiffuseColor.rgb;\n#ifdef MIXMAP2\nvec4 mixColor2=vec4(1.,1.,1.,1.);\n#endif\n#ifdef SPECULARTERM\nfloat glossiness=vSpecularColor.a;\nvec3 specularColor=vSpecularColor.rgb;\n#else\nfloat glossiness=0.;\n#endif\n\nfloat alpha=vDiffuseColor.a;\n\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);\n#endif\n#ifdef DIFFUSE\nvec4 mixColor=texture2D(mixMap1Sampler,vTextureUV);\n#include\nmixColor.rgb*=vTextureInfos.y;\nvec4 diffuse1Color=texture2D(diffuse1Sampler,vTextureUV*diffuse1Infos);\nvec4 diffuse2Color=texture2D(diffuse2Sampler,vTextureUV*diffuse2Infos);\nvec4 diffuse3Color=texture2D(diffuse3Sampler,vTextureUV*diffuse3Infos);\nvec4 diffuse4Color=texture2D(diffuse4Sampler,vTextureUV*diffuse4Infos);\ndiffuse1Color.rgb*=mixColor.r;\ndiffuse2Color.rgb=mix(diffuse1Color.rgb,diffuse2Color.rgb,mixColor.g);\ndiffuse3Color.rgb=mix(diffuse2Color.rgb,diffuse3Color.rgb,mixColor.b);\nfinalMixColor.rgb=mix(diffuse3Color.rgb,diffuse4Color.rgb,1.0-mixColor.a);\n#ifdef MIXMAP2\nmixColor=texture2D(mixMap2Sampler,vTextureUV);\nmixColor.rgb*=vTextureInfos.y;\nvec4 diffuse5Color=texture2D(diffuse5Sampler,vTextureUV*diffuse5Infos);\nvec4 diffuse6Color=texture2D(diffuse6Sampler,vTextureUV*diffuse6Infos);\nvec4 diffuse7Color=texture2D(diffuse7Sampler,vTextureUV*diffuse7Infos);\nvec4 diffuse8Color=texture2D(diffuse8Sampler,vTextureUV*diffuse8Infos);\ndiffuse5Color.rgb=mix(finalMixColor.rgb,diffuse5Color.rgb,mixColor.r);\ndiffuse6Color.rgb=mix(diffuse5Color.rgb,diffuse6Color.rgb,mixColor.g);\ndiffuse7Color.rgb=mix(diffuse6Color.rgb,diffuse7Color.rgb,mixColor.b);\nfinalMixColor.rgb=mix(diffuse7Color.rgb,diffuse8Color.rgb,1.0-mixColor.a);\n#endif\n#endif\n#ifdef VERTEXCOLOR\nfinalMixColor.rgb*=vColor.rgb;\n#endif\n\nvec3 diffuseBase=vec3(0.,0.,0.);\nlightingInfo info;\nfloat shadow=1.;\n#ifdef SPECULARTERM\nvec3 specularBase=vec3(0.,0.,0.);\n#endif\n#include[0..maxSimultaneousLights]\n#ifdef VERTEXALPHA\nalpha*=vColor.a;\n#endif\n#ifdef SPECULARTERM\nvec3 finalSpecular=specularBase*specularColor;\n#else\nvec3 finalSpecular=vec3(0.0);\n#endif\nvec3 finalDiffuse=clamp(diffuseBase*diffuseColor*finalMixColor.rgb,0.0,1.0);\n\nvec4 color=vec4(finalDiffuse+finalSpecular,alpha);\n#include\ngl_FragColor=color;\n#include\n}\n"; +babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__["Effect"].ShadersStore[name] = shader; +/** @hidden */ +var mixPixelShader = { name: name, shader: shader }; + + +/***/ }), + +/***/ "./mix/mix.vertex.ts": +/*!***************************!*\ + !*** ./mix/mix.vertex.ts ***! + \***************************/ +/*! exports provided: mixVertexShader */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mixVertexShader", function() { return mixVertexShader; }); +/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators"); +/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__); + + + + + + + + + + + + +var name = 'mixVertexShader'; +var shader = "precision highp float;\n\nattribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include\n\n#include\nuniform mat4 view;\nuniform mat4 viewProjection;\n#ifdef DIFFUSE\nvarying vec2 vTextureUV;\nuniform mat4 textureMatrix;\nuniform vec2 vTextureInfos;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\n\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include\n#include\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\nvoid main(void) {\n#include\n#include\nvec4 worldPos=finalWorld*vec4(position,1.0);\ngl_Position=viewProjection*worldPos;\nvPositionW=vec3(worldPos);\n#ifdef NORMAL\nvNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));\n#endif\n\n#ifndef UV1\nvec2 uv=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\n#ifdef DIFFUSE\nif (vTextureInfos.x == 0.)\n{\nvTextureUV=vec2(textureMatrix*vec4(uv,1.0,0.0));\n}\nelse\n{\nvTextureUV=vec2(textureMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n\n#include\n\n#include\n\n#include[0..maxSimultaneousLights]\n\n#ifdef VERTEXCOLOR\nvColor=color;\n#endif\n\n#ifdef POINTSIZE\ngl_PointSize=pointSize;\n#endif\n}\n"; +babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__["Effect"].ShadersStore[name] = shader; +/** @hidden */ +var mixVertexShader = { name: name, shader: shader }; + + +/***/ }), + +/***/ "./mix/mixMaterial.ts": +/*!****************************!*\ + !*** ./mix/mixMaterial.ts ***! + \****************************/ +/*! exports provided: MixMaterial */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MixMaterial", function() { return MixMaterial; }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js"); +/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators"); +/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _mix_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./mix.fragment */ "./mix/mix.fragment.ts"); +/* harmony import */ var _mix_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./mix.vertex */ "./mix/mix.vertex.ts"); + + + + + + + + + + + + + +var MixMaterialDefines = /** @class */ (function (_super) { + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(MixMaterialDefines, _super); + function MixMaterialDefines() { + var _this = _super.call(this) || this; + _this.DIFFUSE = false; + _this.CLIPPLANE = false; + _this.CLIPPLANE2 = false; + _this.CLIPPLANE3 = false; + _this.CLIPPLANE4 = false; + _this.CLIPPLANE5 = false; + _this.CLIPPLANE6 = false; + _this.ALPHATEST = false; + _this.DEPTHPREPASS = false; + _this.POINTSIZE = false; + _this.FOG = false; + _this.SPECULARTERM = false; + _this.NORMAL = false; + _this.UV1 = false; + _this.UV2 = false; + _this.VERTEXCOLOR = false; + _this.VERTEXALPHA = false; + _this.NUM_BONE_INFLUENCERS = 0; + _this.BonesPerMesh = 0; + _this.INSTANCES = false; + _this.MIXMAP2 = false; + _this.IMAGEPROCESSINGPOSTPROCESS = false; + _this.rebuild(); + return _this; + } + return MixMaterialDefines; +}(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialDefines"])); +var MixMaterial = /** @class */ (function (_super) { + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(MixMaterial, _super); + function MixMaterial(name, scene) { + var _this = _super.call(this, name, scene) || this; + /** + * Uniforms + */ + _this.diffuseColor = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](1, 1, 1); + _this.specularColor = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](0, 0, 0); + _this.specularPower = 64; + _this._disableLighting = false; + _this._maxSimultaneousLights = 4; + return _this; + } + MixMaterial.prototype.needAlphaBlending = function () { + return (this.alpha < 1.0); + }; + MixMaterial.prototype.needAlphaTesting = function () { + return false; + }; + MixMaterial.prototype.getAlphaTestTexture = function () { + return null; + }; + // Methods + MixMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) { + if (this.isFrozen) { + if (subMesh.effect && subMesh.effect._wasPreviouslyReady) { + return true; + } + } + if (!subMesh._materialDefines) { + subMesh._materialDefines = new MixMaterialDefines(); + } + var defines = subMesh._materialDefines; + var scene = this.getScene(); + if (this._isReadyForSubMesh(subMesh)) { + return true; + } + var engine = scene.getEngine(); + // Textures + if (scene.texturesEnabled) { + if (!this._mixTexture1 || !this._mixTexture1.isReady()) { + return false; + } + defines._needUVs = true; + if (babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialFlags"].DiffuseTextureEnabled) { + if (!this._diffuseTexture1 || !this._diffuseTexture1.isReady()) { + return false; + } + defines.DIFFUSE = true; + if (!this._diffuseTexture2 || !this._diffuseTexture2.isReady()) { + return false; + } + if (!this._diffuseTexture3 || !this._diffuseTexture3.isReady()) { + return false; + } + if (!this._diffuseTexture4 || !this._diffuseTexture4.isReady()) { + return false; + } + if (this._mixTexture2) { + if (!this._mixTexture2.isReady()) { + return false; + } + defines.MIXMAP2 = true; + if (!this._diffuseTexture5 || !this._diffuseTexture5.isReady()) { + return false; + } + if (!this._diffuseTexture6 || !this._diffuseTexture6.isReady()) { + return false; + } + if (!this._diffuseTexture7 || !this._diffuseTexture7.isReady()) { + return false; + } + if (!this._diffuseTexture8 || !this._diffuseTexture8.isReady()) { + return false; + } + } + } + } + // Misc. + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForMisc(mesh, scene, false, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(mesh), defines); + // Lights + defines._needNormals = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForLights(scene, mesh, defines, false, this._maxSimultaneousLights, this._disableLighting); + // Values that need to be evaluated on every frame + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForFrameBoundValues(scene, engine, defines, useInstances ? true : false); + // Attribs + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForAttributes(mesh, defines, true, true); + // Get correct effect + if (defines.isDirty) { + defines.markAsProcessed(); + scene.resetCachedMaterial(); + // Fallbacks + var fallbacks = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["EffectFallbacks"](); + if (defines.FOG) { + fallbacks.addFallback(1, "FOG"); + } + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].HandleFallbacksForShadows(defines, fallbacks, this.maxSimultaneousLights); + if (defines.NUM_BONE_INFLUENCERS > 0) { + fallbacks.addCPUSkinningFallback(0, mesh); + } + defines.IMAGEPROCESSINGPOSTPROCESS = scene.imageProcessingConfiguration.applyByPostProcess; + //Attributes + var attribs = [babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].PositionKind]; + if (defines.NORMAL) { + attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].NormalKind); + } + if (defines.UV1) { + attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].UVKind); + } + if (defines.UV2) { + attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].UV2Kind); + } + if (defines.VERTEXCOLOR) { + attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].ColorKind); + } + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareAttributesForBones(attribs, mesh, defines, fallbacks); + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareAttributesForInstances(attribs, defines); + // Legacy browser patch + var shaderName = "mix"; + var join = defines.toString(); + var uniforms = [ + "world", "view", "viewProjection", "vEyePosition", "vLightsType", "vDiffuseColor", "vSpecularColor", + "vFogInfos", "vFogColor", "pointSize", + "vTextureInfos", + "mBones", + "vClipPlane", "vClipPlane2", "vClipPlane3", "vClipPlane4", "vClipPlane5", "vClipPlane6", "textureMatrix", + "diffuse1Infos", "diffuse2Infos", "diffuse3Infos", "diffuse4Infos", + "diffuse5Infos", "diffuse6Infos", "diffuse7Infos", "diffuse8Infos" + ]; + var samplers = [ + "mixMap1Sampler", "mixMap2Sampler", + "diffuse1Sampler", "diffuse2Sampler", "diffuse3Sampler", "diffuse4Sampler", + "diffuse5Sampler", "diffuse6Sampler", "diffuse7Sampler", "diffuse8Sampler" + ]; + var uniformBuffers = new Array(); + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareUniformsAndSamplersList({ + uniformsNames: uniforms, + uniformBuffersNames: uniformBuffers, + samplers: samplers, + defines: defines, + maxSimultaneousLights: this.maxSimultaneousLights + }); + subMesh.setEffect(scene.getEngine().createEffect(shaderName, { + attributes: attribs, + uniformsNames: uniforms, + uniformBuffersNames: uniformBuffers, + samplers: samplers, + defines: join, + fallbacks: fallbacks, + onCompiled: this.onCompiled, + onError: this.onError, + indexParameters: { maxSimultaneousLights: this.maxSimultaneousLights } + }, engine), defines); + } + if (!subMesh.effect || !subMesh.effect.isReady()) { + return false; + } + defines._renderId = scene.getRenderId(); + subMesh.effect._wasPreviouslyReady = true; + return true; + }; + MixMaterial.prototype.bindForSubMesh = function (world, mesh, subMesh) { + var scene = this.getScene(); + var defines = subMesh._materialDefines; + if (!defines) { + return; + } + var effect = subMesh.effect; + if (!effect) { + return; + } + this._activeEffect = effect; + // Matrices + this.bindOnlyWorldMatrix(world); + this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix()); + // Bones + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindBonesParameters(mesh, this._activeEffect); + if (this._mustRebind(scene, effect)) { + // Textures + if (this._mixTexture1) { + this._activeEffect.setTexture("mixMap1Sampler", this._mixTexture1); + this._activeEffect.setFloat2("vTextureInfos", this._mixTexture1.coordinatesIndex, this._mixTexture1.level); + this._activeEffect.setMatrix("textureMatrix", this._mixTexture1.getTextureMatrix()); + if (babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialFlags"].DiffuseTextureEnabled) { + if (this._diffuseTexture1) { + this._activeEffect.setTexture("diffuse1Sampler", this._diffuseTexture1); + this._activeEffect.setFloat2("diffuse1Infos", this._diffuseTexture1.uScale, this._diffuseTexture1.vScale); + } + if (this._diffuseTexture2) { + this._activeEffect.setTexture("diffuse2Sampler", this._diffuseTexture2); + this._activeEffect.setFloat2("diffuse2Infos", this._diffuseTexture2.uScale, this._diffuseTexture2.vScale); + } + if (this._diffuseTexture3) { + this._activeEffect.setTexture("diffuse3Sampler", this._diffuseTexture3); + this._activeEffect.setFloat2("diffuse3Infos", this._diffuseTexture3.uScale, this._diffuseTexture3.vScale); + } + if (this._diffuseTexture4) { + this._activeEffect.setTexture("diffuse4Sampler", this._diffuseTexture4); + this._activeEffect.setFloat2("diffuse4Infos", this._diffuseTexture4.uScale, this._diffuseTexture4.vScale); + } + } + } + if (this._mixTexture2) { + this._activeEffect.setTexture("mixMap2Sampler", this._mixTexture2); + if (babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialFlags"].DiffuseTextureEnabled) { + if (this._diffuseTexture5) { + this._activeEffect.setTexture("diffuse5Sampler", this._diffuseTexture5); + this._activeEffect.setFloat2("diffuse5Infos", this._diffuseTexture5.uScale, this._diffuseTexture5.vScale); + } + if (this._diffuseTexture6) { + this._activeEffect.setTexture("diffuse6Sampler", this._diffuseTexture6); + this._activeEffect.setFloat2("diffuse6Infos", this._diffuseTexture6.uScale, this._diffuseTexture6.vScale); + } + if (this._diffuseTexture7) { + this._activeEffect.setTexture("diffuse7Sampler", this._diffuseTexture7); + this._activeEffect.setFloat2("diffuse7Infos", this._diffuseTexture7.uScale, this._diffuseTexture7.vScale); + } + if (this._diffuseTexture8) { + this._activeEffect.setTexture("diffuse8Sampler", this._diffuseTexture8); + this._activeEffect.setFloat2("diffuse8Infos", this._diffuseTexture8.uScale, this._diffuseTexture8.vScale); + } + } + } + // Clip plane + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindClipPlane(this._activeEffect, scene); + // Point size + if (this.pointsCloud) { + this._activeEffect.setFloat("pointSize", this.pointSize); + } + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindEyePosition(effect, scene); + } + this._activeEffect.setColor4("vDiffuseColor", this.diffuseColor, this.alpha * mesh.visibility); + if (defines.SPECULARTERM) { + this._activeEffect.setColor4("vSpecularColor", this.specularColor, this.specularPower); + } + if (scene.lightsEnabled && !this.disableLighting) { + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindLights(scene, mesh, this._activeEffect, defines, this.maxSimultaneousLights); + } + // View + if (scene.fogEnabled && mesh.applyFog && scene.fogMode !== babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Scene"].FOGMODE_NONE) { + this._activeEffect.setMatrix("view", scene.getViewMatrix()); + } + // Fog + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindFogParameters(scene, mesh, this._activeEffect); + this._afterBind(mesh, this._activeEffect); + }; + MixMaterial.prototype.getAnimatables = function () { + var results = []; + if (this._mixTexture1 && this._mixTexture1.animations && this._mixTexture1.animations.length > 0) { + results.push(this._mixTexture1); + } + if (this._mixTexture2 && this._mixTexture2.animations && this._mixTexture2.animations.length > 0) { + results.push(this._mixTexture2); + } + return results; + }; + MixMaterial.prototype.getActiveTextures = function () { + var activeTextures = _super.prototype.getActiveTextures.call(this); + // Mix map 1 + if (this._mixTexture1) { + activeTextures.push(this._mixTexture1); + } + if (this._diffuseTexture1) { + activeTextures.push(this._diffuseTexture1); + } + if (this._diffuseTexture2) { + activeTextures.push(this._diffuseTexture2); + } + if (this._diffuseTexture3) { + activeTextures.push(this._diffuseTexture3); + } + if (this._diffuseTexture4) { + activeTextures.push(this._diffuseTexture4); + } + // Mix map 2 + if (this._mixTexture2) { + activeTextures.push(this._mixTexture2); + } + if (this._diffuseTexture5) { + activeTextures.push(this._diffuseTexture5); + } + if (this._diffuseTexture6) { + activeTextures.push(this._diffuseTexture6); + } + if (this._diffuseTexture7) { + activeTextures.push(this._diffuseTexture7); + } + if (this._diffuseTexture8) { + activeTextures.push(this._diffuseTexture8); + } + return activeTextures; + }; + MixMaterial.prototype.hasTexture = function (texture) { + if (_super.prototype.hasTexture.call(this, texture)) { + return true; + } + // Mix map 1 + if (this._mixTexture1 === texture) { + return true; + } + if (this._diffuseTexture1 === texture) { + return true; + } + if (this._diffuseTexture2 === texture) { + return true; + } + if (this._diffuseTexture3 === texture) { + return true; + } + if (this._diffuseTexture4 === texture) { + return true; + } + // Mix map 2 + if (this._mixTexture2 === texture) { + return true; + } + if (this._diffuseTexture5 === texture) { + return true; + } + if (this._diffuseTexture6 === texture) { + return true; + } + if (this._diffuseTexture7 === texture) { + return true; + } + if (this._diffuseTexture8 === texture) { + return true; + } + return false; + }; + MixMaterial.prototype.dispose = function (forceDisposeEffect) { + if (this._mixTexture1) { + this._mixTexture1.dispose(); + } + _super.prototype.dispose.call(this, forceDisposeEffect); + }; + MixMaterial.prototype.clone = function (name) { + var _this = this; + return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Clone(function () { return new MixMaterial(name, _this.getScene()); }, this); + }; + MixMaterial.prototype.serialize = function () { + var serializationObject = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Serialize(this); + serializationObject.customType = "BABYLON.MixMaterial"; + return serializationObject; + }; + MixMaterial.prototype.getClassName = function () { + return "MixMaterial"; + }; + // Statics + MixMaterial.Parse = function (source, scene, rootUrl) { + return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Parse(function () { return new MixMaterial(source.name, scene); }, source, scene, rootUrl); + }; + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("mixTexture1") + ], MixMaterial.prototype, "_mixTexture1", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty") + ], MixMaterial.prototype, "mixTexture1", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("mixTexture2") + ], MixMaterial.prototype, "_mixTexture2", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty") + ], MixMaterial.prototype, "mixTexture2", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("diffuseTexture1") + ], MixMaterial.prototype, "_diffuseTexture1", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty") + ], MixMaterial.prototype, "diffuseTexture1", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("diffuseTexture2") + ], MixMaterial.prototype, "_diffuseTexture2", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty") + ], MixMaterial.prototype, "diffuseTexture2", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("diffuseTexture3") + ], MixMaterial.prototype, "_diffuseTexture3", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty") + ], MixMaterial.prototype, "diffuseTexture3", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("diffuseTexture4") + ], MixMaterial.prototype, "_diffuseTexture4", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty") + ], MixMaterial.prototype, "diffuseTexture4", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("diffuseTexture1") + ], MixMaterial.prototype, "_diffuseTexture5", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty") + ], MixMaterial.prototype, "diffuseTexture5", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("diffuseTexture2") + ], MixMaterial.prototype, "_diffuseTexture6", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty") + ], MixMaterial.prototype, "diffuseTexture6", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("diffuseTexture3") + ], MixMaterial.prototype, "_diffuseTexture7", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty") + ], MixMaterial.prototype, "diffuseTexture7", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("diffuseTexture4") + ], MixMaterial.prototype, "_diffuseTexture8", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty") + ], MixMaterial.prototype, "diffuseTexture8", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsColor3"])() + ], MixMaterial.prototype, "diffuseColor", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsColor3"])() + ], MixMaterial.prototype, "specularColor", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])() + ], MixMaterial.prototype, "specularPower", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])("disableLighting") + ], MixMaterial.prototype, "_disableLighting", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsLightsDirty") + ], MixMaterial.prototype, "disableLighting", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])("maxSimultaneousLights") + ], MixMaterial.prototype, "_maxSimultaneousLights", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsLightsDirty") + ], MixMaterial.prototype, "maxSimultaneousLights", void 0); + return MixMaterial; +}(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["PushMaterial"])); + +babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["_TypeStore"].RegisteredTypes["BABYLON.MixMaterial"] = MixMaterial; + + +/***/ }), + +/***/ "./normal/index.ts": +/*!*************************!*\ + !*** ./normal/index.ts ***! + \*************************/ +/*! exports provided: NormalMaterial */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _normalMaterial__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./normalMaterial */ "./normal/normalMaterial.ts"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NormalMaterial", function() { return _normalMaterial__WEBPACK_IMPORTED_MODULE_0__["NormalMaterial"]; }); + + + + +/***/ }), + +/***/ "./normal/normal.fragment.ts": +/*!***********************************!*\ + !*** ./normal/normal.fragment.ts ***! + \***********************************/ +/*! exports provided: normalPixelShader */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalPixelShader", function() { return normalPixelShader; }); +/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators"); +/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__); + + + + + + + + + + + + + +var name = 'normalPixelShader'; +var shader = "precision highp float;\n\nuniform vec3 vEyePosition;\nuniform vec4 vDiffuseColor;\n\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef LIGHTING\n\n#include\n\n#include<__decl__lightFragment>[0]\n#include<__decl__lightFragment>[1]\n#include<__decl__lightFragment>[2]\n#include<__decl__lightFragment>[3]\n#include\n#include\n#endif\n\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;\nuniform sampler2D diffuseSampler;\nuniform vec2 vDiffuseInfos;\n#endif\n#include\n\n#include\nvoid main(void) {\n#include\nvec3 viewDirectionW=normalize(vEyePosition-vPositionW);\n\nvec4 baseColor=vec4(1.,1.,1.,1.);\nvec3 diffuseColor=vDiffuseColor.rgb;\n\nfloat alpha=vDiffuseColor.a;\n#ifdef DIFFUSE\nbaseColor=texture2D(diffuseSampler,vDiffuseUV);\n#ifdef ALPHATEST\nif (baseColor.a<0.4)\ndiscard;\n#endif\n#include\nbaseColor.rgb*=vDiffuseInfos.y;\n#endif\n#ifdef NORMAL\nbaseColor=mix(baseColor,vec4(vNormalW,1.0),0.5);\n#endif\n\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);\n#endif\n\n#ifdef LIGHTING\nvec3 diffuseBase=vec3(0.,0.,0.);\nlightingInfo info;\nfloat shadow=1.;\nfloat glossiness=0.;\n#include[0]\n#include[1]\n#include[2]\n#include[3]\nvec3 finalDiffuse=clamp(diffuseBase*diffuseColor,0.0,1.0)*baseColor.rgb;\n#else\nvec3 finalDiffuse=baseColor.rgb;\n#endif\n\nvec4 color=vec4(finalDiffuse,alpha);\n#include\ngl_FragColor=color;\n#include\n}"; +babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__["Effect"].ShadersStore[name] = shader; +/** @hidden */ +var normalPixelShader = { name: name, shader: shader }; + + +/***/ }), + +/***/ "./normal/normal.vertex.ts": +/*!*********************************!*\ + !*** ./normal/normal.vertex.ts ***! + \*********************************/ +/*! exports provided: normalVertexShader */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalVertexShader", function() { return normalVertexShader; }); +/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators"); +/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__); + + + + + + + + + + + + +var name = 'normalVertexShader'; +var shader = "precision highp float;\n\nattribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include\n\n#include\nuniform mat4 view;\nuniform mat4 viewProjection;\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;\nuniform mat4 diffuseMatrix;\nuniform vec2 vDiffuseInfos;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\n\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#include\n#include\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\nvoid main(void) {\n#include\n#include\nvec4 worldPos=finalWorld*vec4(position,1.0);\ngl_Position=viewProjection*worldPos;\nvPositionW=vec3(worldPos);\n#ifdef NORMAL\nvNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));\n#endif\n\n#ifndef UV1\nvec2 uv=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\n#ifdef DIFFUSE\nif (vDiffuseInfos.x == 0.)\n{\nvDiffuseUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));\n}\nelse\n{\nvDiffuseUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n\n#include\n\n#include\n#include[0..maxSimultaneousLights]\n\n#ifdef POINTSIZE\ngl_PointSize=pointSize;\n#endif\n}\n"; +babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__["Effect"].ShadersStore[name] = shader; +/** @hidden */ +var normalVertexShader = { name: name, shader: shader }; + + +/***/ }), + +/***/ "./normal/normalMaterial.ts": +/*!**********************************!*\ + !*** ./normal/normalMaterial.ts ***! + \**********************************/ +/*! exports provided: NormalMaterial */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NormalMaterial", function() { return NormalMaterial; }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js"); +/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators"); +/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _normal_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./normal.fragment */ "./normal/normal.fragment.ts"); +/* harmony import */ var _normal_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./normal.vertex */ "./normal/normal.vertex.ts"); + + + + + + + + + + + + + +var NormalMaterialDefines = /** @class */ (function (_super) { + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(NormalMaterialDefines, _super); + function NormalMaterialDefines() { + var _this = _super.call(this) || this; + _this.DIFFUSE = false; + _this.CLIPPLANE = false; + _this.CLIPPLANE2 = false; + _this.CLIPPLANE3 = false; + _this.CLIPPLANE4 = false; + _this.CLIPPLANE5 = false; + _this.CLIPPLANE6 = false; + _this.ALPHATEST = false; + _this.DEPTHPREPASS = false; + _this.POINTSIZE = false; + _this.FOG = false; + _this.LIGHT0 = false; + _this.LIGHT1 = false; + _this.LIGHT2 = false; + _this.LIGHT3 = false; + _this.SPOTLIGHT0 = false; + _this.SPOTLIGHT1 = false; + _this.SPOTLIGHT2 = false; + _this.SPOTLIGHT3 = false; + _this.HEMILIGHT0 = false; + _this.HEMILIGHT1 = false; + _this.HEMILIGHT2 = false; + _this.HEMILIGHT3 = false; + _this.DIRLIGHT0 = false; + _this.DIRLIGHT1 = false; + _this.DIRLIGHT2 = false; + _this.DIRLIGHT3 = false; + _this.POINTLIGHT0 = false; + _this.POINTLIGHT1 = false; + _this.POINTLIGHT2 = false; + _this.POINTLIGHT3 = false; + _this.SHADOW0 = false; + _this.SHADOW1 = false; + _this.SHADOW2 = false; + _this.SHADOW3 = false; + _this.SHADOWS = false; + _this.SHADOWESM0 = false; + _this.SHADOWESM1 = false; + _this.SHADOWESM2 = false; + _this.SHADOWESM3 = false; + _this.SHADOWPOISSON0 = false; + _this.SHADOWPOISSON1 = false; + _this.SHADOWPOISSON2 = false; + _this.SHADOWPOISSON3 = false; + _this.SHADOWPCF0 = false; + _this.SHADOWPCF1 = false; + _this.SHADOWPCF2 = false; + _this.SHADOWPCF3 = false; + _this.SHADOWPCSS0 = false; + _this.SHADOWPCSS1 = false; + _this.SHADOWPCSS2 = false; + _this.SHADOWPCSS3 = false; + _this.NORMAL = false; + _this.UV1 = false; + _this.UV2 = false; + _this.NUM_BONE_INFLUENCERS = 0; + _this.BonesPerMesh = 0; + _this.INSTANCES = false; + _this.LIGHTING = false; + _this.IMAGEPROCESSINGPOSTPROCESS = false; + _this.rebuild(); + return _this; + } + return NormalMaterialDefines; +}(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialDefines"])); +var NormalMaterial = /** @class */ (function (_super) { + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(NormalMaterial, _super); + function NormalMaterial(name, scene) { + var _this = _super.call(this, name, scene) || this; + _this.diffuseColor = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](1, 1, 1); + _this._disableLighting = false; + _this._maxSimultaneousLights = 4; + return _this; + } + NormalMaterial.prototype.needAlphaBlending = function () { + return (this.alpha < 1.0); + }; + NormalMaterial.prototype.needAlphaBlendingForMesh = function (mesh) { + return this.needAlphaBlending() || (mesh.visibility < 1.0); + }; + NormalMaterial.prototype.needAlphaTesting = function () { + return false; + }; + NormalMaterial.prototype.getAlphaTestTexture = function () { + return null; + }; + // Methods + NormalMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) { + if (this.isFrozen) { + if (subMesh.effect && subMesh.effect._wasPreviouslyReady) { + return true; + } + } + if (!subMesh._materialDefines) { + subMesh._materialDefines = new NormalMaterialDefines(); + } + var defines = subMesh._materialDefines; + var scene = this.getScene(); + if (this._isReadyForSubMesh(subMesh)) { + return true; + } + var engine = scene.getEngine(); + // Textures + if (defines._areTexturesDirty) { + defines._needUVs = false; + if (scene.texturesEnabled) { + if (this._diffuseTexture && babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialFlags"].DiffuseTextureEnabled) { + if (!this._diffuseTexture.isReady()) { + return false; + } + else { + defines._needUVs = true; + defines.DIFFUSE = true; + } + } + } + } + // Misc. + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForMisc(mesh, scene, false, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(mesh), defines); + // Lights + defines._needNormals = true; + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForLights(scene, mesh, defines, false, this._maxSimultaneousLights, this._disableLighting); + // Values that need to be evaluated on every frame + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForFrameBoundValues(scene, engine, defines, useInstances ? true : false); + defines.LIGHTING = !this._disableLighting; + // Attribs + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForAttributes(mesh, defines, true, true); + // Get correct effect + if (defines.isDirty) { + defines.markAsProcessed(); + scene.resetCachedMaterial(); + // Fallbacks + var fallbacks = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["EffectFallbacks"](); + if (defines.FOG) { + fallbacks.addFallback(1, "FOG"); + } + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].HandleFallbacksForShadows(defines, fallbacks); + if (defines.NUM_BONE_INFLUENCERS > 0) { + fallbacks.addCPUSkinningFallback(0, mesh); + } + defines.IMAGEPROCESSINGPOSTPROCESS = scene.imageProcessingConfiguration.applyByPostProcess; + //Attributes + var attribs = [babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].PositionKind]; + if (defines.NORMAL) { + attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].NormalKind); + } + if (defines.UV1) { + attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].UVKind); + } + if (defines.UV2) { + attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].UV2Kind); + } + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareAttributesForBones(attribs, mesh, defines, fallbacks); + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareAttributesForInstances(attribs, defines); + var shaderName = "normal"; + var join = defines.toString(); + var uniforms = ["world", "view", "viewProjection", "vEyePosition", "vLightsType", "vDiffuseColor", + "vFogInfos", "vFogColor", "pointSize", + "vDiffuseInfos", + "mBones", + "vClipPlane", "vClipPlane2", "vClipPlane3", "vClipPlane4", "vClipPlane5", "vClipPlane6", "diffuseMatrix" + ]; + var samplers = ["diffuseSampler"]; + var uniformBuffers = new Array(); + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareUniformsAndSamplersList({ + uniformsNames: uniforms, + uniformBuffersNames: uniformBuffers, + samplers: samplers, + defines: defines, + maxSimultaneousLights: 4 + }); + subMesh.setEffect(scene.getEngine().createEffect(shaderName, { + attributes: attribs, + uniformsNames: uniforms, + uniformBuffersNames: uniformBuffers, + samplers: samplers, + defines: join, + fallbacks: fallbacks, + onCompiled: this.onCompiled, + onError: this.onError, + indexParameters: { maxSimultaneousLights: 4 } + }, engine), defines); + } + if (!subMesh.effect || !subMesh.effect.isReady()) { + return false; + } + defines._renderId = scene.getRenderId(); + subMesh.effect._wasPreviouslyReady = true; + return true; + }; + NormalMaterial.prototype.bindForSubMesh = function (world, mesh, subMesh) { + var scene = this.getScene(); + var defines = subMesh._materialDefines; + if (!defines) { + return; + } + var effect = subMesh.effect; + if (!effect) { + return; + } + this._activeEffect = effect; + // Matrices + this.bindOnlyWorldMatrix(world); + this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix()); + // Bones + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindBonesParameters(mesh, this._activeEffect); + if (this._mustRebind(scene, effect)) { + // Textures + if (this.diffuseTexture && babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialFlags"].DiffuseTextureEnabled) { + this._activeEffect.setTexture("diffuseSampler", this.diffuseTexture); + this._activeEffect.setFloat2("vDiffuseInfos", this.diffuseTexture.coordinatesIndex, this.diffuseTexture.level); + this._activeEffect.setMatrix("diffuseMatrix", this.diffuseTexture.getTextureMatrix()); + } + // Clip plane + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindClipPlane(this._activeEffect, scene); + // Point size + if (this.pointsCloud) { + this._activeEffect.setFloat("pointSize", this.pointSize); + } + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindEyePosition(effect, scene); + } + this._activeEffect.setColor4("vDiffuseColor", this.diffuseColor, this.alpha * mesh.visibility); + // Lights + if (scene.lightsEnabled && !this.disableLighting) { + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindLights(scene, mesh, this._activeEffect, defines); + } + // View + if (scene.fogEnabled && mesh.applyFog && scene.fogMode !== babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Scene"].FOGMODE_NONE) { + this._activeEffect.setMatrix("view", scene.getViewMatrix()); + } + // Fog + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindFogParameters(scene, mesh, this._activeEffect); + this._afterBind(mesh, this._activeEffect); + }; + NormalMaterial.prototype.getAnimatables = function () { + var results = []; + if (this.diffuseTexture && this.diffuseTexture.animations && this.diffuseTexture.animations.length > 0) { + results.push(this.diffuseTexture); + } + return results; + }; + NormalMaterial.prototype.getActiveTextures = function () { + var activeTextures = _super.prototype.getActiveTextures.call(this); + if (this._diffuseTexture) { + activeTextures.push(this._diffuseTexture); + } + return activeTextures; + }; + NormalMaterial.prototype.hasTexture = function (texture) { + if (_super.prototype.hasTexture.call(this, texture)) { + return true; + } + if (this.diffuseTexture === texture) { + return true; + } + return false; + }; + NormalMaterial.prototype.dispose = function (forceDisposeEffect) { + if (this.diffuseTexture) { + this.diffuseTexture.dispose(); + } + _super.prototype.dispose.call(this, forceDisposeEffect); + }; + NormalMaterial.prototype.clone = function (name) { + var _this = this; + return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Clone(function () { return new NormalMaterial(name, _this.getScene()); }, this); + }; + NormalMaterial.prototype.serialize = function () { + var serializationObject = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Serialize(this); + serializationObject.customType = "BABYLON.NormalMaterial"; + return serializationObject; + }; + NormalMaterial.prototype.getClassName = function () { + return "NormalMaterial"; + }; + // Statics + NormalMaterial.Parse = function (source, scene, rootUrl) { + return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Parse(function () { return new NormalMaterial(source.name, scene); }, source, scene, rootUrl); + }; + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("diffuseTexture") + ], NormalMaterial.prototype, "_diffuseTexture", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty") + ], NormalMaterial.prototype, "diffuseTexture", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsColor3"])() + ], NormalMaterial.prototype, "diffuseColor", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])("disableLighting") + ], NormalMaterial.prototype, "_disableLighting", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsLightsDirty") + ], NormalMaterial.prototype, "disableLighting", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])("maxSimultaneousLights") + ], NormalMaterial.prototype, "_maxSimultaneousLights", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsLightsDirty") + ], NormalMaterial.prototype, "maxSimultaneousLights", void 0); + return NormalMaterial; +}(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["PushMaterial"])); + +babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["_TypeStore"].RegisteredTypes["BABYLON.NormalMaterial"] = NormalMaterial; + + +/***/ }), + +/***/ "./shadowOnly/index.ts": +/*!*****************************!*\ + !*** ./shadowOnly/index.ts ***! + \*****************************/ +/*! exports provided: ShadowOnlyMaterial */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _shadowOnlyMaterial__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./shadowOnlyMaterial */ "./shadowOnly/shadowOnlyMaterial.ts"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ShadowOnlyMaterial", function() { return _shadowOnlyMaterial__WEBPACK_IMPORTED_MODULE_0__["ShadowOnlyMaterial"]; }); + + + + +/***/ }), + +/***/ "./shadowOnly/shadowOnly.fragment.ts": +/*!*******************************************!*\ + !*** ./shadowOnly/shadowOnly.fragment.ts ***! + \*******************************************/ +/*! exports provided: shadowOnlyPixelShader */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "shadowOnlyPixelShader", function() { return shadowOnlyPixelShader; }); +/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators"); +/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__); + + + + + + + + + + + + +var name = 'shadowOnlyPixelShader'; +var shader = "precision highp float;\n\nuniform vec3 vEyePosition;\nuniform float alpha;\nuniform vec3 shadowColor;\n\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n\n#include\n\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include\n#include\n#include\n\n#include\nvoid main(void) {\n#include\nvec3 viewDirectionW=normalize(vEyePosition-vPositionW);\n\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);\n#endif\n\nvec3 diffuseBase=vec3(0.,0.,0.);\nlightingInfo info;\nfloat shadow=1.;\nfloat glossiness=0.;\n#include[0..1]\n\nvec4 color=vec4(shadowColor,(1.0-clamp(shadow,0.,1.))*alpha);\n#include\ngl_FragColor=color;\n#include\n}"; +babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__["Effect"].ShadersStore[name] = shader; +/** @hidden */ +var shadowOnlyPixelShader = { name: name, shader: shader }; + + +/***/ }), + +/***/ "./shadowOnly/shadowOnly.vertex.ts": +/*!*****************************************!*\ + !*** ./shadowOnly/shadowOnly.vertex.ts ***! + \*****************************************/ +/*! exports provided: shadowOnlyVertexShader */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "shadowOnlyVertexShader", function() { return shadowOnlyVertexShader; }); +/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators"); +/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__); + + + + + + + + + + + + +var name = 'shadowOnlyVertexShader'; +var shader = "precision highp float;\n\nattribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#include\n\n#include\nuniform mat4 view;\nuniform mat4 viewProjection;\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\n\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include\n#include\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\nvoid main(void) {\n#include\n#include\nvec4 worldPos=finalWorld*vec4(position,1.0);\ngl_Position=viewProjection*worldPos;\nvPositionW=vec3(worldPos);\n#ifdef NORMAL\nvNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));\n#endif\n\n#include\n\n#include\n#include[0..maxSimultaneousLights]\n\n#ifdef POINTSIZE\ngl_PointSize=pointSize;\n#endif\n}\n"; +babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__["Effect"].ShadersStore[name] = shader; +/** @hidden */ +var shadowOnlyVertexShader = { name: name, shader: shader }; + + +/***/ }), + +/***/ "./shadowOnly/shadowOnlyMaterial.ts": +/*!******************************************!*\ + !*** ./shadowOnly/shadowOnlyMaterial.ts ***! + \******************************************/ +/*! exports provided: ShadowOnlyMaterial */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ShadowOnlyMaterial", function() { return ShadowOnlyMaterial; }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js"); +/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators"); +/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _shadowOnly_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./shadowOnly.fragment */ "./shadowOnly/shadowOnly.fragment.ts"); +/* harmony import */ var _shadowOnly_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./shadowOnly.vertex */ "./shadowOnly/shadowOnly.vertex.ts"); + + + + + + + + + + + + +var ShadowOnlyMaterialDefines = /** @class */ (function (_super) { + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(ShadowOnlyMaterialDefines, _super); + function ShadowOnlyMaterialDefines() { + var _this = _super.call(this) || this; + _this.CLIPPLANE = false; + _this.CLIPPLANE2 = false; + _this.CLIPPLANE3 = false; + _this.CLIPPLANE4 = false; + _this.CLIPPLANE5 = false; + _this.CLIPPLANE6 = false; + _this.POINTSIZE = false; + _this.FOG = false; + _this.NORMAL = false; + _this.NUM_BONE_INFLUENCERS = 0; + _this.BonesPerMesh = 0; + _this.INSTANCES = false; + _this.IMAGEPROCESSINGPOSTPROCESS = false; + _this.rebuild(); + return _this; + } + return ShadowOnlyMaterialDefines; +}(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialDefines"])); +var ShadowOnlyMaterial = /** @class */ (function (_super) { + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(ShadowOnlyMaterial, _super); + function ShadowOnlyMaterial(name, scene) { + var _this = _super.call(this, name, scene) || this; + _this._needAlphaBlending = true; + _this.shadowColor = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"].Black(); + return _this; + } + ShadowOnlyMaterial.prototype.needAlphaBlending = function () { + return this._needAlphaBlending; + }; + ShadowOnlyMaterial.prototype.needAlphaTesting = function () { + return false; + }; + ShadowOnlyMaterial.prototype.getAlphaTestTexture = function () { + return null; + }; + Object.defineProperty(ShadowOnlyMaterial.prototype, "activeLight", { + get: function () { + return this._activeLight; + }, + set: function (light) { + this._activeLight = light; + }, + enumerable: false, + configurable: true + }); + ShadowOnlyMaterial.prototype._getFirstShadowLightForMesh = function (mesh) { + for (var _i = 0, _a = mesh.lightSources; _i < _a.length; _i++) { + var light = _a[_i]; + if (light.shadowEnabled) { + return light; + } + } + return null; + }; + // Methods + ShadowOnlyMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) { + var _a; + if (this.isFrozen) { + if (subMesh.effect && subMesh.effect._wasPreviouslyReady) { + return true; + } + } + if (!subMesh._materialDefines) { + subMesh._materialDefines = new ShadowOnlyMaterialDefines(); + } + var defines = subMesh._materialDefines; + var scene = this.getScene(); + if (this._isReadyForSubMesh(subMesh)) { + return true; + } + var engine = scene.getEngine(); + // Ensure that active light is the first shadow light + if (this._activeLight) { + for (var _i = 0, _b = mesh.lightSources; _i < _b.length; _i++) { + var light = _b[_i]; + if (light.shadowEnabled) { + if (this._activeLight === light) { + break; // We are good + } + var lightPosition = mesh.lightSources.indexOf(this._activeLight); + if (lightPosition !== -1) { + mesh.lightSources.splice(lightPosition, 1); + mesh.lightSources.splice(0, 0, this._activeLight); + } + break; + } + } + } + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForFrameBoundValues(scene, engine, defines, useInstances ? true : false); + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForMisc(mesh, scene, false, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(mesh), defines); + defines._needNormals = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForLights(scene, mesh, defines, false, 1); + var shadowGenerator = (_a = this._getFirstShadowLightForMesh(mesh)) === null || _a === void 0 ? void 0 : _a.getShadowGenerator(); + this._needAlphaBlending = true; + if (shadowGenerator && shadowGenerator.getClassName && shadowGenerator.getClassName() === 'CascadedShadowGenerator') { + var csg = shadowGenerator; + this._needAlphaBlending = !csg.autoCalcDepthBounds; + } + // Attribs + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForAttributes(mesh, defines, false, true); + // Get correct effect + if (defines.isDirty) { + defines.markAsProcessed(); + scene.resetCachedMaterial(); + // Fallbacks + var fallbacks = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["EffectFallbacks"](); + if (defines.FOG) { + fallbacks.addFallback(1, "FOG"); + } + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].HandleFallbacksForShadows(defines, fallbacks, 1); + if (defines.NUM_BONE_INFLUENCERS > 0) { + fallbacks.addCPUSkinningFallback(0, mesh); + } + defines.IMAGEPROCESSINGPOSTPROCESS = scene.imageProcessingConfiguration.applyByPostProcess; + //Attributes + var attribs = [babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].PositionKind]; + if (defines.NORMAL) { + attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].NormalKind); + } + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareAttributesForBones(attribs, mesh, defines, fallbacks); + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareAttributesForInstances(attribs, defines); + var shaderName = "shadowOnly"; + var join = defines.toString(); + var uniforms = ["world", "view", "viewProjection", "vEyePosition", "vLightsType", + "vFogInfos", "vFogColor", "pointSize", "alpha", "shadowColor", + "mBones", + "vClipPlane", "vClipPlane2", "vClipPlane3", "vClipPlane4", "vClipPlane5", "vClipPlane6" + ]; + var samplers = new Array(); + var uniformBuffers = new Array(); + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareUniformsAndSamplersList({ + uniformsNames: uniforms, + uniformBuffersNames: uniformBuffers, + samplers: samplers, + defines: defines, + maxSimultaneousLights: 1 + }); + subMesh.setEffect(scene.getEngine().createEffect(shaderName, { + attributes: attribs, + uniformsNames: uniforms, + uniformBuffersNames: uniformBuffers, + samplers: samplers, + defines: join, + fallbacks: fallbacks, + onCompiled: this.onCompiled, + onError: this.onError, + indexParameters: { maxSimultaneousLights: 1 } + }, engine), defines); + } + if (!subMesh.effect || !subMesh.effect.isReady()) { + return false; + } + defines._renderId = scene.getRenderId(); + subMesh.effect._wasPreviouslyReady = true; + return true; + }; + ShadowOnlyMaterial.prototype.bindForSubMesh = function (world, mesh, subMesh) { + var scene = this.getScene(); + var defines = subMesh._materialDefines; + if (!defines) { + return; + } + var effect = subMesh.effect; + if (!effect) { + return; + } + this._activeEffect = effect; + // Matrices + this.bindOnlyWorldMatrix(world); + this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix()); + // Bones + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindBonesParameters(mesh, this._activeEffect); + if (this._mustRebind(scene, effect)) { + // Clip plane + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindClipPlane(this._activeEffect, scene); + // Point size + if (this.pointsCloud) { + this._activeEffect.setFloat("pointSize", this.pointSize); + } + this._activeEffect.setFloat("alpha", this.alpha); + this._activeEffect.setColor3("shadowColor", this.shadowColor); + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindEyePosition(effect, scene); + } + // Lights + if (scene.lightsEnabled) { + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindLights(scene, mesh, this._activeEffect, defines, 1); + var light = this._getFirstShadowLightForMesh(mesh); + if (light) { + // Make sure the uniforms for this light will be rebound for other materials using this light when rendering the current frame. + // Indeed, there is an optimization in Light that binds the light uniforms only once per frame for a given light (if using ubo). + // Doing this way assumes that all uses of this light are the same, meaning all parameters passed to Light._bindLlight + // are the same, notably useSpecular. However, isReadyForSubMesh (see above) is passing false for this parameter, which may not be + // the value the other materials may pass. + light._renderId = -1; + } + } + // View + if (scene.fogEnabled && mesh.applyFog && scene.fogMode !== babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Scene"].FOGMODE_NONE || defines["SHADOWCSM0"]) { + this._activeEffect.setMatrix("view", scene.getViewMatrix()); + } + // Fog + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindFogParameters(scene, mesh, this._activeEffect); + this._afterBind(mesh, this._activeEffect); + }; + ShadowOnlyMaterial.prototype.clone = function (name) { + var _this = this; + return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Clone(function () { return new ShadowOnlyMaterial(name, _this.getScene()); }, this); + }; + ShadowOnlyMaterial.prototype.serialize = function () { + var serializationObject = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Serialize(this); + serializationObject.customType = "BABYLON.ShadowOnlyMaterial"; + return serializationObject; + }; + ShadowOnlyMaterial.prototype.getClassName = function () { + return "ShadowOnlyMaterial"; + }; + // Statics + ShadowOnlyMaterial.Parse = function (source, scene, rootUrl) { + return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Parse(function () { return new ShadowOnlyMaterial(source.name, scene); }, source, scene, rootUrl); + }; + return ShadowOnlyMaterial; +}(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["PushMaterial"])); + +babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["_TypeStore"].RegisteredTypes["BABYLON.ShadowOnlyMaterial"] = ShadowOnlyMaterial; + + +/***/ }), + +/***/ "./simple/index.ts": +/*!*************************!*\ + !*** ./simple/index.ts ***! + \*************************/ +/*! exports provided: SimpleMaterial */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _simpleMaterial__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./simpleMaterial */ "./simple/simpleMaterial.ts"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SimpleMaterial", function() { return _simpleMaterial__WEBPACK_IMPORTED_MODULE_0__["SimpleMaterial"]; }); + + + + +/***/ }), + +/***/ "./simple/simple.fragment.ts": +/*!***********************************!*\ + !*** ./simple/simple.fragment.ts ***! + \***********************************/ +/*! exports provided: simplePixelShader */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "simplePixelShader", function() { return simplePixelShader; }); +/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators"); +/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__); + + + + + + + + + + + + + +var name = 'simplePixelShader'; +var shader = "precision highp float;\n\nuniform vec3 vEyePosition;\nuniform vec4 vDiffuseColor;\n\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n\n#include\n\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include\n#include\n\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;\nuniform sampler2D diffuseSampler;\nuniform vec2 vDiffuseInfos;\n#endif\n#include\n\n#include\nvoid main(void) {\n#include\nvec3 viewDirectionW=normalize(vEyePosition-vPositionW);\n\nvec4 baseColor=vec4(1.,1.,1.,1.);\nvec3 diffuseColor=vDiffuseColor.rgb;\n\nfloat alpha=vDiffuseColor.a;\n#ifdef DIFFUSE\nbaseColor=texture2D(diffuseSampler,vDiffuseUV);\n#ifdef ALPHATEST\nif (baseColor.a<0.4)\ndiscard;\n#endif\n#include\nbaseColor.rgb*=vDiffuseInfos.y;\n#endif\n#ifdef VERTEXCOLOR\nbaseColor.rgb*=vColor.rgb;\n#endif\n\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);\n#endif\n\nvec3 diffuseBase=vec3(0.,0.,0.);\nlightingInfo info;\nfloat shadow=1.;\nfloat glossiness=0.;\n#ifdef SPECULARTERM\nvec3 specularBase=vec3(0.,0.,0.);\n#endif\n#include[0..maxSimultaneousLights]\n#ifdef VERTEXALPHA\nalpha*=vColor.a;\n#endif\nvec3 finalDiffuse=clamp(diffuseBase*diffuseColor,0.0,1.0)*baseColor.rgb;\n\nvec4 color=vec4(finalDiffuse,alpha);\n#include\ngl_FragColor=color;\n#include\n}"; +babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__["Effect"].ShadersStore[name] = shader; +/** @hidden */ +var simplePixelShader = { name: name, shader: shader }; + + +/***/ }), + +/***/ "./simple/simple.vertex.ts": +/*!*********************************!*\ + !*** ./simple/simple.vertex.ts ***! + \*********************************/ +/*! exports provided: simpleVertexShader */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "simpleVertexShader", function() { return simpleVertexShader; }); +/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators"); +/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__); + + + + + + + + + + + + +var name = 'simpleVertexShader'; +var shader = "precision highp float;\n\nattribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include\n\n#include\nuniform mat4 view;\nuniform mat4 viewProjection;\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;\nuniform mat4 diffuseMatrix;\nuniform vec2 vDiffuseInfos;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\n\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include\n#include\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\nvoid main(void) {\n#include\n#include\nvec4 worldPos=finalWorld*vec4(position,1.0);\ngl_Position=viewProjection*worldPos;\nvPositionW=vec3(worldPos);\n#ifdef NORMAL\nvNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));\n#endif\n\n#ifndef UV1\nvec2 uv=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\n#ifdef DIFFUSE\nif (vDiffuseInfos.x == 0.)\n{\nvDiffuseUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));\n}\nelse\n{\nvDiffuseUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n\n#include\n\n#include\n#include[0..maxSimultaneousLights]\n\n#ifdef VERTEXCOLOR\nvColor=color;\n#endif\n\n#ifdef POINTSIZE\ngl_PointSize=pointSize;\n#endif\n}\n"; +babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__["Effect"].ShadersStore[name] = shader; +/** @hidden */ +var simpleVertexShader = { name: name, shader: shader }; + + +/***/ }), + +/***/ "./simple/simpleMaterial.ts": +/*!**********************************!*\ + !*** ./simple/simpleMaterial.ts ***! + \**********************************/ +/*! exports provided: SimpleMaterial */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SimpleMaterial", function() { return SimpleMaterial; }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js"); +/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators"); +/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _simple_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./simple.fragment */ "./simple/simple.fragment.ts"); +/* harmony import */ var _simple_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./simple.vertex */ "./simple/simple.vertex.ts"); + + + + + + + + + + + + + +var SimpleMaterialDefines = /** @class */ (function (_super) { + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(SimpleMaterialDefines, _super); + function SimpleMaterialDefines() { + var _this = _super.call(this) || this; + _this.DIFFUSE = false; + _this.CLIPPLANE = false; + _this.CLIPPLANE2 = false; + _this.CLIPPLANE3 = false; + _this.CLIPPLANE4 = false; + _this.CLIPPLANE5 = false; + _this.CLIPPLANE6 = false; + _this.ALPHATEST = false; + _this.DEPTHPREPASS = false; + _this.POINTSIZE = false; + _this.FOG = false; + _this.NORMAL = false; + _this.UV1 = false; + _this.UV2 = false; + _this.VERTEXCOLOR = false; + _this.VERTEXALPHA = false; + _this.NUM_BONE_INFLUENCERS = 0; + _this.BonesPerMesh = 0; + _this.INSTANCES = false; + _this.IMAGEPROCESSINGPOSTPROCESS = false; + _this.rebuild(); + return _this; + } + return SimpleMaterialDefines; +}(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialDefines"])); +var SimpleMaterial = /** @class */ (function (_super) { + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(SimpleMaterial, _super); + function SimpleMaterial(name, scene) { + var _this = _super.call(this, name, scene) || this; + _this.diffuseColor = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](1, 1, 1); + _this._disableLighting = false; + _this._maxSimultaneousLights = 4; + return _this; + } + SimpleMaterial.prototype.needAlphaBlending = function () { + return (this.alpha < 1.0); + }; + SimpleMaterial.prototype.needAlphaTesting = function () { + return false; + }; + SimpleMaterial.prototype.getAlphaTestTexture = function () { + return null; + }; + // Methods + SimpleMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) { + if (this.isFrozen) { + if (subMesh.effect && subMesh.effect._wasPreviouslyReady) { + return true; + } + } + if (!subMesh._materialDefines) { + subMesh._materialDefines = new SimpleMaterialDefines(); + } + var defines = subMesh._materialDefines; + var scene = this.getScene(); + if (this._isReadyForSubMesh(subMesh)) { + return true; + } + var engine = scene.getEngine(); + // Textures + if (defines._areTexturesDirty) { + defines._needUVs = false; + if (scene.texturesEnabled) { + if (this._diffuseTexture && babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialFlags"].DiffuseTextureEnabled) { + if (!this._diffuseTexture.isReady()) { + return false; + } + else { + defines._needUVs = true; + defines.DIFFUSE = true; + } + } + } + } + // Misc. + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForMisc(mesh, scene, false, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(mesh), defines); + // Lights + defines._needNormals = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForLights(scene, mesh, defines, false, this._maxSimultaneousLights, this._disableLighting); + // Values that need to be evaluated on every frame + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForFrameBoundValues(scene, engine, defines, useInstances ? true : false); + // Attribs + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForAttributes(mesh, defines, true, true); + // Get correct effect + if (defines.isDirty) { + defines.markAsProcessed(); + scene.resetCachedMaterial(); + // Fallbacks + var fallbacks = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["EffectFallbacks"](); + if (defines.FOG) { + fallbacks.addFallback(1, "FOG"); + } + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].HandleFallbacksForShadows(defines, fallbacks, this.maxSimultaneousLights); + if (defines.NUM_BONE_INFLUENCERS > 0) { + fallbacks.addCPUSkinningFallback(0, mesh); + } + defines.IMAGEPROCESSINGPOSTPROCESS = scene.imageProcessingConfiguration.applyByPostProcess; + //Attributes + var attribs = [babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].PositionKind]; + if (defines.NORMAL) { + attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].NormalKind); + } + if (defines.UV1) { + attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].UVKind); + } + if (defines.UV2) { + attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].UV2Kind); + } + if (defines.VERTEXCOLOR) { + attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].ColorKind); + } + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareAttributesForBones(attribs, mesh, defines, fallbacks); + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareAttributesForInstances(attribs, defines); + var shaderName = "simple"; + var join = defines.toString(); + var uniforms = ["world", "view", "viewProjection", "vEyePosition", "vLightsType", "vDiffuseColor", + "vFogInfos", "vFogColor", "pointSize", + "vDiffuseInfos", + "mBones", + "vClipPlane", "vClipPlane2", "vClipPlane3", "vClipPlane4", "vClipPlane5", "vClipPlane6", "diffuseMatrix" + ]; + var samplers = ["diffuseSampler"]; + var uniformBuffers = new Array(); + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareUniformsAndSamplersList({ + uniformsNames: uniforms, + uniformBuffersNames: uniformBuffers, + samplers: samplers, + defines: defines, + maxSimultaneousLights: this.maxSimultaneousLights + }); + subMesh.setEffect(scene.getEngine().createEffect(shaderName, { + attributes: attribs, + uniformsNames: uniforms, + uniformBuffersNames: uniformBuffers, + samplers: samplers, + defines: join, + fallbacks: fallbacks, + onCompiled: this.onCompiled, + onError: this.onError, + indexParameters: { maxSimultaneousLights: this._maxSimultaneousLights - 1 } + }, engine), defines); + } + if (!subMesh.effect || !subMesh.effect.isReady()) { + return false; + } + defines._renderId = scene.getRenderId(); + subMesh.effect._wasPreviouslyReady = true; + return true; + }; + SimpleMaterial.prototype.bindForSubMesh = function (world, mesh, subMesh) { + var scene = this.getScene(); + var defines = subMesh._materialDefines; + if (!defines) { + return; + } + var effect = subMesh.effect; + if (!effect) { + return; + } + this._activeEffect = effect; + // Matrices + this.bindOnlyWorldMatrix(world); + this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix()); + // Bones + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindBonesParameters(mesh, this._activeEffect); + if (this._mustRebind(scene, effect)) { + // Textures + if (this._diffuseTexture && babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialFlags"].DiffuseTextureEnabled) { + this._activeEffect.setTexture("diffuseSampler", this._diffuseTexture); + this._activeEffect.setFloat2("vDiffuseInfos", this._diffuseTexture.coordinatesIndex, this._diffuseTexture.level); + this._activeEffect.setMatrix("diffuseMatrix", this._diffuseTexture.getTextureMatrix()); + } + // Clip plane + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindClipPlane(this._activeEffect, scene); + // Point size + if (this.pointsCloud) { + this._activeEffect.setFloat("pointSize", this.pointSize); + } + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindEyePosition(effect, scene); + } + this._activeEffect.setColor4("vDiffuseColor", this.diffuseColor, this.alpha * mesh.visibility); + // Lights + if (scene.lightsEnabled && !this.disableLighting) { + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindLights(scene, mesh, this._activeEffect, defines, this.maxSimultaneousLights); + } + // View + if (scene.fogEnabled && mesh.applyFog && scene.fogMode !== babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Scene"].FOGMODE_NONE) { + this._activeEffect.setMatrix("view", scene.getViewMatrix()); + } + // Fog + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindFogParameters(scene, mesh, this._activeEffect); + this._afterBind(mesh, this._activeEffect); + }; + SimpleMaterial.prototype.getAnimatables = function () { + var results = []; + if (this._diffuseTexture && this._diffuseTexture.animations && this._diffuseTexture.animations.length > 0) { + results.push(this._diffuseTexture); + } + return results; + }; + SimpleMaterial.prototype.getActiveTextures = function () { + var activeTextures = _super.prototype.getActiveTextures.call(this); + if (this._diffuseTexture) { + activeTextures.push(this._diffuseTexture); + } + return activeTextures; + }; + SimpleMaterial.prototype.hasTexture = function (texture) { + if (_super.prototype.hasTexture.call(this, texture)) { + return true; + } + if (this.diffuseTexture === texture) { + return true; + } + return false; + }; + SimpleMaterial.prototype.dispose = function (forceDisposeEffect) { + if (this._diffuseTexture) { + this._diffuseTexture.dispose(); + } + _super.prototype.dispose.call(this, forceDisposeEffect); + }; + SimpleMaterial.prototype.clone = function (name) { + var _this = this; + return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Clone(function () { return new SimpleMaterial(name, _this.getScene()); }, this); + }; + SimpleMaterial.prototype.serialize = function () { + var serializationObject = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Serialize(this); + serializationObject.customType = "BABYLON.SimpleMaterial"; + return serializationObject; + }; + SimpleMaterial.prototype.getClassName = function () { + return "SimpleMaterial"; + }; + // Statics + SimpleMaterial.Parse = function (source, scene, rootUrl) { + return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Parse(function () { return new SimpleMaterial(source.name, scene); }, source, scene, rootUrl); + }; + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("diffuseTexture") + ], SimpleMaterial.prototype, "_diffuseTexture", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty") + ], SimpleMaterial.prototype, "diffuseTexture", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsColor3"])("diffuse") + ], SimpleMaterial.prototype, "diffuseColor", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])("disableLighting") + ], SimpleMaterial.prototype, "_disableLighting", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsLightsDirty") + ], SimpleMaterial.prototype, "disableLighting", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])("maxSimultaneousLights") + ], SimpleMaterial.prototype, "_maxSimultaneousLights", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsLightsDirty") + ], SimpleMaterial.prototype, "maxSimultaneousLights", void 0); + return SimpleMaterial; +}(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["PushMaterial"])); + +babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["_TypeStore"].RegisteredTypes["BABYLON.SimpleMaterial"] = SimpleMaterial; + + +/***/ }), + +/***/ "./sky/index.ts": +/*!**********************!*\ + !*** ./sky/index.ts ***! + \**********************/ +/*! exports provided: SkyMaterial */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _skyMaterial__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./skyMaterial */ "./sky/skyMaterial.ts"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SkyMaterial", function() { return _skyMaterial__WEBPACK_IMPORTED_MODULE_0__["SkyMaterial"]; }); + + + + +/***/ }), + +/***/ "./sky/sky.fragment.ts": +/*!*****************************!*\ + !*** ./sky/sky.fragment.ts ***! + \*****************************/ +/*! exports provided: skyPixelShader */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "skyPixelShader", function() { return skyPixelShader; }); +/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators"); +/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__); + + + + + + +var name = 'skyPixelShader'; +var shader = "precision highp float;\n\nvarying vec3 vPositionW;\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include\n\nuniform vec3 cameraPosition;\nuniform vec3 cameraOffset;\nuniform float luminance;\nuniform float turbidity;\nuniform float rayleigh;\nuniform float mieCoefficient;\nuniform float mieDirectionalG;\nuniform vec3 sunPosition;\n\n#include\n\nconst float e=2.71828182845904523536028747135266249775724709369995957;\nconst float pi=3.141592653589793238462643383279502884197169;\nconst float n=1.0003;\nconst float N=2.545E25;\nconst float pn=0.035;\nconst vec3 lambda=vec3(680E-9,550E-9,450E-9);\nconst vec3 K=vec3(0.686,0.678,0.666);\nconst float v=4.0;\nconst float rayleighZenithLength=8.4E3;\nconst float mieZenithLength=1.25E3;\nconst vec3 up=vec3(0.0,1.0,0.0);\nconst float EE=1000.0;\nconst float sunAngularDiameterCos=0.999956676946448443553574619906976478926848692873900859324;\nconst float cutoffAngle=pi/1.95;\nconst float steepness=1.5;\nvec3 totalRayleigh(vec3 lambda)\n{\nreturn (8.0*pow(pi,3.0)*pow(pow(n,2.0)-1.0,2.0)*(6.0+3.0*pn))/(3.0*N*pow(lambda,vec3(4.0))*(6.0-7.0*pn));\n}\nvec3 simplifiedRayleigh()\n{\nreturn 0.0005/vec3(94,40,18);\n}\nfloat rayleighPhase(float cosTheta)\n{\nreturn (3.0/(16.0*pi))*(1.0+pow(cosTheta,2.0));\n}\nvec3 totalMie(vec3 lambda,vec3 K,float T)\n{\nfloat c=(0.2*T )*10E-18;\nreturn 0.434*c*pi*pow((2.0*pi)/lambda,vec3(v-2.0))*K;\n}\nfloat hgPhase(float cosTheta,float g)\n{\nreturn (1.0/(4.0*pi))*((1.0-pow(g,2.0))/pow(1.0-2.0*g*cosTheta+pow(g,2.0),1.5));\n}\nfloat sunIntensity(float zenithAngleCos)\n{\nreturn EE*max(0.0,1.0-exp((-(cutoffAngle-acos(zenithAngleCos))/steepness)));\n}\nfloat A=0.15;\nfloat B=0.50;\nfloat C=0.10;\nfloat D=0.20;\nfloat EEE=0.02;\nfloat F=0.30;\nfloat W=1000.0;\nvec3 Uncharted2Tonemap(vec3 x)\n{\nreturn ((x*(A*x+C*B)+D*EEE)/(x*(A*x+B)+D*F))-EEE/F;\n}\nvoid main(void) {\n\n#include\n\nfloat sunfade=1.0-clamp(1.0-exp((sunPosition.y/450000.0)),0.0,1.0);\nfloat rayleighCoefficient=rayleigh-(1.0*(1.0-sunfade));\nvec3 sunDirection=normalize(sunPosition);\nfloat sunE=sunIntensity(dot(sunDirection,up));\nvec3 betaR=simplifiedRayleigh()*rayleighCoefficient;\nvec3 betaM=totalMie(lambda,K,turbidity)*mieCoefficient;\nfloat zenithAngle=acos(max(0.0,dot(up,normalize(vPositionW-cameraPosition+cameraOffset))));\nfloat sR=rayleighZenithLength/(cos(zenithAngle)+0.15*pow(93.885-((zenithAngle*180.0)/pi),-1.253));\nfloat sM=mieZenithLength/(cos(zenithAngle)+0.15*pow(93.885-((zenithAngle*180.0)/pi),-1.253));\nvec3 Fex=exp(-(betaR*sR+betaM*sM));\nfloat cosTheta=dot(normalize(vPositionW-cameraPosition),sunDirection);\nfloat rPhase=rayleighPhase(cosTheta*0.5+0.5);\nvec3 betaRTheta=betaR*rPhase;\nfloat mPhase=hgPhase(cosTheta,mieDirectionalG);\nvec3 betaMTheta=betaM*mPhase;\nvec3 Lin=pow(sunE*((betaRTheta+betaMTheta)/(betaR+betaM))*(1.0-Fex),vec3(1.5));\nLin*=mix(vec3(1.0),pow(sunE*((betaRTheta+betaMTheta)/(betaR+betaM))*Fex,vec3(1.0/2.0)),clamp(pow(1.0-dot(up,sunDirection),5.0),0.0,1.0));\nvec3 direction=normalize(vPositionW-cameraPosition);\nfloat theta=acos(direction.y);\nfloat phi=atan(direction.z,direction.x);\nvec2 uv=vec2(phi,theta)/vec2(2.0*pi,pi)+vec2(0.5,0.0);\nvec3 L0=vec3(0.1)*Fex;\nfloat sundisk=smoothstep(sunAngularDiameterCos,sunAngularDiameterCos+0.00002,cosTheta);\nL0+=(sunE*19000.0*Fex)*sundisk;\nvec3 whiteScale=1.0/Uncharted2Tonemap(vec3(W));\nvec3 texColor=(Lin+L0);\ntexColor*=0.04 ;\ntexColor+=vec3(0.0,0.001,0.0025)*0.3;\nfloat g_fMaxLuminance=1.0;\nfloat fLumScaled=0.1/luminance;\nfloat fLumCompressed=(fLumScaled*(1.0+(fLumScaled/(g_fMaxLuminance*g_fMaxLuminance))))/(1.0+fLumScaled);\nfloat ExposureBias=fLumCompressed;\nvec3 curr=Uncharted2Tonemap((log2(2.0/pow(luminance,4.0)))*texColor);\n\n\n\nvec3 retColor=curr*whiteScale;\n\n\nfloat alpha=1.0;\n#ifdef VERTEXCOLOR\nretColor.rgb*=vColor.rgb;\n#endif\n#ifdef VERTEXALPHA\nalpha*=vColor.a;\n#endif\n\nvec4 color=clamp(vec4(retColor.rgb,alpha),0.0,1.0);\n\n#include\ngl_FragColor=color;\n#include\n}\n"; +babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__["Effect"].ShadersStore[name] = shader; +/** @hidden */ +var skyPixelShader = { name: name, shader: shader }; + + +/***/ }), + +/***/ "./sky/sky.vertex.ts": +/*!***************************!*\ + !*** ./sky/sky.vertex.ts ***! + \***************************/ +/*! exports provided: skyVertexShader */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "skyVertexShader", function() { return skyVertexShader; }); +/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators"); +/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__); + + + + + +var name = 'skyVertexShader'; +var shader = "precision highp float;\n\nattribute vec3 position;\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n\nuniform mat4 world;\nuniform mat4 view;\nuniform mat4 viewProjection;\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\n\nvarying vec3 vPositionW;\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include\n#include\nvoid main(void) {\ngl_Position=viewProjection*world*vec4(position,1.0);\nvec4 worldPos=world*vec4(position,1.0);\nvPositionW=vec3(worldPos);\n\n#include\n\n#include\n\n#ifdef VERTEXCOLOR\nvColor=color;\n#endif\n\n#ifdef POINTSIZE\ngl_PointSize=pointSize;\n#endif\n}\n"; +babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__["Effect"].ShadersStore[name] = shader; +/** @hidden */ +var skyVertexShader = { name: name, shader: shader }; + + +/***/ }), + +/***/ "./sky/skyMaterial.ts": +/*!****************************!*\ + !*** ./sky/skyMaterial.ts ***! + \****************************/ +/*! exports provided: SkyMaterial */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SkyMaterial", function() { return SkyMaterial; }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js"); +/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators"); +/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _sky_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./sky.fragment */ "./sky/sky.fragment.ts"); +/* harmony import */ var _sky_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./sky.vertex */ "./sky/sky.vertex.ts"); + + + + + + + + + + + + +/** @hidden */ +var SkyMaterialDefines = /** @class */ (function (_super) { + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(SkyMaterialDefines, _super); + function SkyMaterialDefines() { + var _this = _super.call(this) || this; + _this.CLIPPLANE = false; + _this.CLIPPLANE2 = false; + _this.CLIPPLANE3 = false; + _this.CLIPPLANE4 = false; + _this.CLIPPLANE5 = false; + _this.CLIPPLANE6 = false; + _this.POINTSIZE = false; + _this.FOG = false; + _this.VERTEXCOLOR = false; + _this.VERTEXALPHA = false; + _this.IMAGEPROCESSINGPOSTPROCESS = false; + _this.rebuild(); + return _this; + } + return SkyMaterialDefines; +}(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialDefines"])); +/** + * This is the sky material which allows to create dynamic and texture free effects for skyboxes. + * @see https://doc.babylonjs.com/extensions/sky + */ +var SkyMaterial = /** @class */ (function (_super) { + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(SkyMaterial, _super); + /** + * Instantiates a new sky material. + * This material allows to create dynamic and texture free + * effects for skyboxes by taking care of the atmosphere state. + * @see https://doc.babylonjs.com/extensions/sky + * @param name Define the name of the material in the scene + * @param scene Define the scene the material belong to + */ + function SkyMaterial(name, scene) { + var _this = _super.call(this, name, scene) || this; + /** + * Defines the overall luminance of sky in interval ]0, 1[. + */ + _this.luminance = 1.0; + /** + * Defines the amount (scattering) of haze as opposed to molecules in atmosphere. + */ + _this.turbidity = 10.0; + /** + * Defines the sky appearance (light intensity). + */ + _this.rayleigh = 2.0; + /** + * Defines the mieCoefficient in interval [0, 0.1] which affects the property .mieDirectionalG. + */ + _this.mieCoefficient = 0.005; + /** + * Defines the amount of haze particles following the Mie scattering theory. + */ + _this.mieDirectionalG = 0.8; + /** + * Defines the distance of the sun according to the active scene camera. + */ + _this.distance = 500; + /** + * Defines the sun inclination, in interval [-0.5, 0.5]. When the inclination is not 0, the sun is said + * "inclined". + */ + _this.inclination = 0.49; + /** + * Defines the solar azimuth in interval [0, 1]. The azimuth is the angle in the horizontal plan between + * an object direction and a reference direction. + */ + _this.azimuth = 0.25; + /** + * Defines the sun position in the sky on (x,y,z). If the property .useSunPosition is set to false, then + * the property is overriden by the inclination and the azimuth and can be read at any moment. + */ + _this.sunPosition = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Vector3"](0, 100, 0); + /** + * Defines if the sun position should be computed (inclination and azimuth) according to the given + * .sunPosition property. + */ + _this.useSunPosition = false; + /** + * Defines an offset vector used to get a horizon offset. + * @example skyMaterial.cameraOffset.y = camera.globalPosition.y // Set horizon relative to 0 on the Y axis + */ + _this.cameraOffset = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Vector3"].Zero(); + // Private members + _this._cameraPosition = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Vector3"].Zero(); + return _this; + } + /** + * Specifies if the material will require alpha blending + * @returns a boolean specifying if alpha blending is needed + */ + SkyMaterial.prototype.needAlphaBlending = function () { + return (this.alpha < 1.0); + }; + /** + * Specifies if this material should be rendered in alpha test mode + * @returns false as the sky material doesn't need alpha testing. + */ + SkyMaterial.prototype.needAlphaTesting = function () { + return false; + }; + /** + * Get the texture used for alpha test purpose. + * @returns null as the sky material has no texture. + */ + SkyMaterial.prototype.getAlphaTestTexture = function () { + return null; + }; + /** + * Get if the submesh is ready to be used and all its information available. + * Child classes can use it to update shaders + * @param mesh defines the mesh to check + * @param subMesh defines which submesh to check + * @param useInstances specifies that instances should be used + * @returns a boolean indicating that the submesh is ready or not + */ + SkyMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) { + if (this.isFrozen) { + if (subMesh.effect && subMesh.effect._wasPreviouslyReady) { + return true; + } + } + if (!subMesh._materialDefines) { + subMesh._materialDefines = new SkyMaterialDefines(); + } + var defines = subMesh._materialDefines; + var scene = this.getScene(); + if (this._isReadyForSubMesh(subMesh)) { + return true; + } + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForMisc(mesh, scene, false, this.pointsCloud, this.fogEnabled, false, defines); + // Attribs + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForAttributes(mesh, defines, true, false); + // Get correct effect + if (defines.isDirty) { + defines.markAsProcessed(); + scene.resetCachedMaterial(); + // Fallbacks + var fallbacks = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["EffectFallbacks"](); + if (defines.FOG) { + fallbacks.addFallback(1, "FOG"); + } + defines.IMAGEPROCESSINGPOSTPROCESS = scene.imageProcessingConfiguration.applyByPostProcess; + //Attributes + var attribs = [babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].PositionKind]; + if (defines.VERTEXCOLOR) { + attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].ColorKind); + } + var shaderName = "sky"; + var join = defines.toString(); + subMesh.setEffect(scene.getEngine().createEffect(shaderName, attribs, ["world", "viewProjection", "view", + "vFogInfos", "vFogColor", "pointSize", "vClipPlane", "vClipPlane2", "vClipPlane3", "vClipPlane4", "vClipPlane5", "vClipPlane6", + "luminance", "turbidity", "rayleigh", "mieCoefficient", "mieDirectionalG", "sunPosition", + "cameraPosition", "cameraOffset" + ], [], join, fallbacks, this.onCompiled, this.onError), defines); + } + if (!subMesh.effect || !subMesh.effect.isReady()) { + return false; + } + defines._renderId = scene.getRenderId(); + subMesh.effect._wasPreviouslyReady = true; + return true; + }; + /** + * Binds the submesh to this material by preparing the effect and shader to draw + * @param world defines the world transformation matrix + * @param mesh defines the mesh containing the submesh + * @param subMesh defines the submesh to bind the material to + */ + SkyMaterial.prototype.bindForSubMesh = function (world, mesh, subMesh) { + var scene = this.getScene(); + var defines = subMesh._materialDefines; + if (!defines) { + return; + } + var effect = subMesh.effect; + if (!effect) { + return; + } + this._activeEffect = effect; + // Matrices + this.bindOnlyWorldMatrix(world); + this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix()); + if (this._mustRebind(scene, effect)) { + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindClipPlane(this._activeEffect, scene); + // Point size + if (this.pointsCloud) { + this._activeEffect.setFloat("pointSize", this.pointSize); + } + } + // View + if (scene.fogEnabled && mesh.applyFog && scene.fogMode !== babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Scene"].FOGMODE_NONE) { + this._activeEffect.setMatrix("view", scene.getViewMatrix()); + } + // Fog + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindFogParameters(scene, mesh, this._activeEffect); + // Sky + var camera = scene.activeCamera; + if (camera) { + var cameraWorldMatrix = camera.getWorldMatrix(); + this._cameraPosition.x = cameraWorldMatrix.m[12]; + this._cameraPosition.y = cameraWorldMatrix.m[13]; + this._cameraPosition.z = cameraWorldMatrix.m[14]; + this._activeEffect.setVector3("cameraPosition", this._cameraPosition); + } + this._activeEffect.setVector3("cameraOffset", this.cameraOffset); + if (this.luminance > 0) { + this._activeEffect.setFloat("luminance", this.luminance); + } + this._activeEffect.setFloat("turbidity", this.turbidity); + this._activeEffect.setFloat("rayleigh", this.rayleigh); + this._activeEffect.setFloat("mieCoefficient", this.mieCoefficient); + this._activeEffect.setFloat("mieDirectionalG", this.mieDirectionalG); + if (!this.useSunPosition) { + var theta = Math.PI * (this.inclination - 0.5); + var phi = 2 * Math.PI * (this.azimuth - 0.5); + this.sunPosition.x = this.distance * Math.cos(phi); + this.sunPosition.y = this.distance * Math.sin(phi) * Math.sin(theta); + this.sunPosition.z = this.distance * Math.sin(phi) * Math.cos(theta); + } + this._activeEffect.setVector3("sunPosition", this.sunPosition); + this._afterBind(mesh, this._activeEffect); + }; + /** + * Get the list of animatables in the material. + * @returns the list of animatables object used in the material + */ + SkyMaterial.prototype.getAnimatables = function () { + return []; + }; + /** + * Disposes the material + * @param forceDisposeEffect specifies if effects should be forcefully disposed + */ + SkyMaterial.prototype.dispose = function (forceDisposeEffect) { + _super.prototype.dispose.call(this, forceDisposeEffect); + }; + /** + * Makes a duplicate of the material, and gives it a new name + * @param name defines the new name for the duplicated material + * @returns the cloned material + */ + SkyMaterial.prototype.clone = function (name) { + var _this = this; + return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Clone(function () { return new SkyMaterial(name, _this.getScene()); }, this); + }; + /** + * Serializes this material in a JSON representation + * @returns the serialized material object + */ + SkyMaterial.prototype.serialize = function () { + var serializationObject = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Serialize(this); + serializationObject.customType = "BABYLON.SkyMaterial"; + return serializationObject; + }; + /** + * Gets the current class name of the material e.g. "SkyMaterial" + * Mainly use in serialization. + * @returns the class name + */ + SkyMaterial.prototype.getClassName = function () { + return "SkyMaterial"; + }; + /** + * Creates a sky material from parsed material data + * @param source defines the JSON representation of the material + * @param scene defines the hosting scene + * @param rootUrl defines the root URL to use to load textures and relative dependencies + * @returns a new sky material + */ + SkyMaterial.Parse = function (source, scene, rootUrl) { + return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Parse(function () { return new SkyMaterial(source.name, scene); }, source, scene, rootUrl); + }; + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])() + ], SkyMaterial.prototype, "luminance", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])() + ], SkyMaterial.prototype, "turbidity", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])() + ], SkyMaterial.prototype, "rayleigh", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])() + ], SkyMaterial.prototype, "mieCoefficient", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])() + ], SkyMaterial.prototype, "mieDirectionalG", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])() + ], SkyMaterial.prototype, "distance", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])() + ], SkyMaterial.prototype, "inclination", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])() + ], SkyMaterial.prototype, "azimuth", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsVector3"])() + ], SkyMaterial.prototype, "sunPosition", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])() + ], SkyMaterial.prototype, "useSunPosition", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])() + ], SkyMaterial.prototype, "cameraOffset", void 0); + return SkyMaterial; +}(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["PushMaterial"])); + +babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["_TypeStore"].RegisteredTypes["BABYLON.SkyMaterial"] = SkyMaterial; + + +/***/ }), + +/***/ "./terrain/index.ts": +/*!**************************!*\ + !*** ./terrain/index.ts ***! + \**************************/ +/*! exports provided: TerrainMaterial */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _terrainMaterial__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./terrainMaterial */ "./terrain/terrainMaterial.ts"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TerrainMaterial", function() { return _terrainMaterial__WEBPACK_IMPORTED_MODULE_0__["TerrainMaterial"]; }); + + + + +/***/ }), + +/***/ "./terrain/terrain.fragment.ts": +/*!*************************************!*\ + !*** ./terrain/terrain.fragment.ts ***! + \*************************************/ +/*! exports provided: terrainPixelShader */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "terrainPixelShader", function() { return terrainPixelShader; }); +/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators"); +/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__); + + + + + + + + + + + + + +var name = 'terrainPixelShader'; +var shader = "precision highp float;\n\nuniform vec3 vEyePosition;\nuniform vec4 vDiffuseColor;\n#ifdef SPECULARTERM\nuniform vec4 vSpecularColor;\n#endif\n\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n\n#include\n\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n\n#ifdef DIFFUSE\nvarying vec2 vTextureUV;\nuniform sampler2D textureSampler;\nuniform vec2 vTextureInfos;\nuniform sampler2D diffuse1Sampler;\nuniform sampler2D diffuse2Sampler;\nuniform sampler2D diffuse3Sampler;\nuniform vec2 diffuse1Infos;\nuniform vec2 diffuse2Infos;\nuniform vec2 diffuse3Infos;\n#endif\n#ifdef BUMP\nuniform sampler2D bump1Sampler;\nuniform sampler2D bump2Sampler;\nuniform sampler2D bump3Sampler;\n#endif\n\n#include\n#include\n#include\n\n#include\n\n#ifdef BUMP\n#extension GL_OES_standard_derivatives : enable\n\nmat3 cotangent_frame(vec3 normal,vec3 p,vec2 uv)\n{\n\nvec3 dp1=dFdx(p);\nvec3 dp2=dFdy(p);\nvec2 duv1=dFdx(uv);\nvec2 duv2=dFdy(uv);\n\nvec3 dp2perp=cross(dp2,normal);\nvec3 dp1perp=cross(normal,dp1);\nvec3 tangent=dp2perp*duv1.x+dp1perp*duv2.x;\nvec3 binormal=dp2perp*duv1.y+dp1perp*duv2.y;\n\nfloat invmax=inversesqrt(max(dot(tangent,tangent),dot(binormal,binormal)));\nreturn mat3(tangent*invmax,binormal*invmax,normal);\n}\nvec3 perturbNormal(vec3 viewDir,vec3 mixColor)\n{\nvec3 bump1Color=texture2D(bump1Sampler,vTextureUV*diffuse1Infos).xyz;\nvec3 bump2Color=texture2D(bump2Sampler,vTextureUV*diffuse2Infos).xyz;\nvec3 bump3Color=texture2D(bump3Sampler,vTextureUV*diffuse3Infos).xyz;\nbump1Color.rgb*=mixColor.r;\nbump2Color.rgb=mix(bump1Color.rgb,bump2Color.rgb,mixColor.g);\nvec3 map=mix(bump2Color.rgb,bump3Color.rgb,mixColor.b);\nmap=map*255./127.-128./127.;\nmat3 TBN=cotangent_frame(vNormalW*vTextureInfos.y,-viewDir,vTextureUV);\nreturn normalize(TBN*map);\n}\n#endif\nvoid main(void) {\n\n#include\nvec3 viewDirectionW=normalize(vEyePosition-vPositionW);\n\nvec4 baseColor=vec4(1.,1.,1.,1.);\nvec3 diffuseColor=vDiffuseColor.rgb;\n#ifdef SPECULARTERM\nfloat glossiness=vSpecularColor.a;\nvec3 specularColor=vSpecularColor.rgb;\n#else\nfloat glossiness=0.;\n#endif\n\nfloat alpha=vDiffuseColor.a;\n\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);\n#endif\n#ifdef DIFFUSE\nbaseColor=texture2D(textureSampler,vTextureUV);\n#if defined(BUMP) && defined(DIFFUSE)\nnormalW=perturbNormal(viewDirectionW,baseColor.rgb);\n#endif\n#ifdef ALPHATEST\nif (baseColor.a<0.4)\ndiscard;\n#endif\n#include\nbaseColor.rgb*=vTextureInfos.y;\nvec4 diffuse1Color=texture2D(diffuse1Sampler,vTextureUV*diffuse1Infos);\nvec4 diffuse2Color=texture2D(diffuse2Sampler,vTextureUV*diffuse2Infos);\nvec4 diffuse3Color=texture2D(diffuse3Sampler,vTextureUV*diffuse3Infos);\ndiffuse1Color.rgb*=baseColor.r;\ndiffuse2Color.rgb=mix(diffuse1Color.rgb,diffuse2Color.rgb,baseColor.g);\nbaseColor.rgb=mix(diffuse2Color.rgb,diffuse3Color.rgb,baseColor.b);\n#endif\n#ifdef VERTEXCOLOR\nbaseColor.rgb*=vColor.rgb;\n#endif\n\nvec3 diffuseBase=vec3(0.,0.,0.);\nlightingInfo info;\nfloat shadow=1.;\n#ifdef SPECULARTERM\nvec3 specularBase=vec3(0.,0.,0.);\n#endif\n#include[0..maxSimultaneousLights]\n#ifdef VERTEXALPHA\nalpha*=vColor.a;\n#endif\n#ifdef SPECULARTERM\nvec3 finalSpecular=specularBase*specularColor;\n#else\nvec3 finalSpecular=vec3(0.0);\n#endif\nvec3 finalDiffuse=clamp(diffuseBase*diffuseColor*baseColor.rgb,0.0,1.0);\n\nvec4 color=vec4(finalDiffuse+finalSpecular,alpha);\n#include\ngl_FragColor=color;\n#include\n}\n"; +babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__["Effect"].ShadersStore[name] = shader; +/** @hidden */ +var terrainPixelShader = { name: name, shader: shader }; + + +/***/ }), + +/***/ "./terrain/terrain.vertex.ts": +/*!***********************************!*\ + !*** ./terrain/terrain.vertex.ts ***! + \***********************************/ +/*! exports provided: terrainVertexShader */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "terrainVertexShader", function() { return terrainVertexShader; }); +/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators"); +/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__); + + + + + + + + + + + + +var name = 'terrainVertexShader'; +var shader = "precision highp float;\n\nattribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include\n\n#include\nuniform mat4 view;\nuniform mat4 viewProjection;\n#ifdef DIFFUSE\nvarying vec2 vTextureUV;\nuniform mat4 textureMatrix;\nuniform vec2 vTextureInfos;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\n\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include\n#include\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\nvoid main(void) {\n#include\n#include\nvec4 worldPos=finalWorld*vec4(position,1.0);\ngl_Position=viewProjection*worldPos;\nvPositionW=vec3(worldPos);\n#ifdef NORMAL\nvNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));\n#endif\n\n#ifndef UV1\nvec2 uv=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\n#ifdef DIFFUSE\nif (vTextureInfos.x == 0.)\n{\nvTextureUV=vec2(textureMatrix*vec4(uv,1.0,0.0));\n}\nelse\n{\nvTextureUV=vec2(textureMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n\n#include\n\n#include\n\n#include[0..maxSimultaneousLights]\n\n#ifdef VERTEXCOLOR\nvColor=color;\n#endif\n\n#ifdef POINTSIZE\ngl_PointSize=pointSize;\n#endif\n}\n"; +babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__["Effect"].ShadersStore[name] = shader; +/** @hidden */ +var terrainVertexShader = { name: name, shader: shader }; + + +/***/ }), + +/***/ "./terrain/terrainMaterial.ts": +/*!************************************!*\ + !*** ./terrain/terrainMaterial.ts ***! + \************************************/ +/*! exports provided: TerrainMaterial */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TerrainMaterial", function() { return TerrainMaterial; }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js"); +/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators"); +/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _terrain_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./terrain.fragment */ "./terrain/terrain.fragment.ts"); +/* harmony import */ var _terrain_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./terrain.vertex */ "./terrain/terrain.vertex.ts"); + + + + + + + + + + + + + +var TerrainMaterialDefines = /** @class */ (function (_super) { + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(TerrainMaterialDefines, _super); + function TerrainMaterialDefines() { + var _this = _super.call(this) || this; + _this.DIFFUSE = false; + _this.BUMP = false; + _this.CLIPPLANE = false; + _this.CLIPPLANE2 = false; + _this.CLIPPLANE3 = false; + _this.CLIPPLANE4 = false; + _this.CLIPPLANE5 = false; + _this.CLIPPLANE6 = false; + _this.ALPHATEST = false; + _this.DEPTHPREPASS = false; + _this.POINTSIZE = false; + _this.FOG = false; + _this.SPECULARTERM = false; + _this.NORMAL = false; + _this.UV1 = false; + _this.UV2 = false; + _this.VERTEXCOLOR = false; + _this.VERTEXALPHA = false; + _this.NUM_BONE_INFLUENCERS = 0; + _this.BonesPerMesh = 0; + _this.INSTANCES = false; + _this.IMAGEPROCESSINGPOSTPROCESS = false; + _this.rebuild(); + return _this; + } + return TerrainMaterialDefines; +}(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialDefines"])); +var TerrainMaterial = /** @class */ (function (_super) { + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(TerrainMaterial, _super); + function TerrainMaterial(name, scene) { + var _this = _super.call(this, name, scene) || this; + _this.diffuseColor = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](1, 1, 1); + _this.specularColor = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](0, 0, 0); + _this.specularPower = 64; + _this._disableLighting = false; + _this._maxSimultaneousLights = 4; + return _this; + } + TerrainMaterial.prototype.needAlphaBlending = function () { + return (this.alpha < 1.0); + }; + TerrainMaterial.prototype.needAlphaTesting = function () { + return false; + }; + TerrainMaterial.prototype.getAlphaTestTexture = function () { + return null; + }; + // Methods + TerrainMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) { + if (this.isFrozen) { + if (subMesh.effect && subMesh.effect._wasPreviouslyReady) { + return true; + } + } + if (!subMesh._materialDefines) { + subMesh._materialDefines = new TerrainMaterialDefines(); + } + var defines = subMesh._materialDefines; + var scene = this.getScene(); + if (this._isReadyForSubMesh(subMesh)) { + return true; + } + var engine = scene.getEngine(); + // Textures + if (scene.texturesEnabled) { + if (!this.mixTexture || !this.mixTexture.isReady()) { + return false; + } + defines._needUVs = true; + if (babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialFlags"].DiffuseTextureEnabled) { + if (!this.diffuseTexture1 || !this.diffuseTexture1.isReady()) { + return false; + } + if (!this.diffuseTexture2 || !this.diffuseTexture2.isReady()) { + return false; + } + if (!this.diffuseTexture3 || !this.diffuseTexture3.isReady()) { + return false; + } + defines.DIFFUSE = true; + } + if (this.bumpTexture1 && this.bumpTexture2 && this.bumpTexture3 && babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialFlags"].BumpTextureEnabled) { + if (!this.bumpTexture1.isReady()) { + return false; + } + if (!this.bumpTexture2.isReady()) { + return false; + } + if (!this.bumpTexture3.isReady()) { + return false; + } + defines._needNormals = true; + defines.BUMP = true; + } + } + // Misc. + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForMisc(mesh, scene, false, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(mesh), defines); + // Lights + defines._needNormals = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForLights(scene, mesh, defines, false, this._maxSimultaneousLights, this._disableLighting); + // Values that need to be evaluated on every frame + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForFrameBoundValues(scene, engine, defines, useInstances ? true : false); + // Attribs + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForAttributes(mesh, defines, true, true); + // Get correct effect + if (defines.isDirty) { + defines.markAsProcessed(); + scene.resetCachedMaterial(); + // Fallbacks + var fallbacks = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["EffectFallbacks"](); + if (defines.FOG) { + fallbacks.addFallback(1, "FOG"); + } + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].HandleFallbacksForShadows(defines, fallbacks, this.maxSimultaneousLights); + if (defines.NUM_BONE_INFLUENCERS > 0) { + fallbacks.addCPUSkinningFallback(0, mesh); + } + defines.IMAGEPROCESSINGPOSTPROCESS = scene.imageProcessingConfiguration.applyByPostProcess; + //Attributes + var attribs = [babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].PositionKind]; + if (defines.NORMAL) { + attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].NormalKind); + } + if (defines.UV1) { + attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].UVKind); + } + if (defines.UV2) { + attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].UV2Kind); + } + if (defines.VERTEXCOLOR) { + attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].ColorKind); + } + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareAttributesForBones(attribs, mesh, defines, fallbacks); + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareAttributesForInstances(attribs, defines); + // Legacy browser patch + var shaderName = "terrain"; + var join = defines.toString(); + var uniforms = ["world", "view", "viewProjection", "vEyePosition", "vLightsType", "vDiffuseColor", "vSpecularColor", + "vFogInfos", "vFogColor", "pointSize", + "vTextureInfos", + "mBones", + "vClipPlane", "vClipPlane2", "vClipPlane3", "vClipPlane4", "vClipPlane5", "vClipPlane6", "textureMatrix", + "diffuse1Infos", "diffuse2Infos", "diffuse3Infos" + ]; + var samplers = ["textureSampler", "diffuse1Sampler", "diffuse2Sampler", "diffuse3Sampler", + "bump1Sampler", "bump2Sampler", "bump3Sampler" + ]; + var uniformBuffers = new Array(); + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareUniformsAndSamplersList({ + uniformsNames: uniforms, + uniformBuffersNames: uniformBuffers, + samplers: samplers, + defines: defines, + maxSimultaneousLights: this.maxSimultaneousLights + }); + subMesh.setEffect(scene.getEngine().createEffect(shaderName, { + attributes: attribs, + uniformsNames: uniforms, + uniformBuffersNames: uniformBuffers, + samplers: samplers, + defines: join, + fallbacks: fallbacks, + onCompiled: this.onCompiled, + onError: this.onError, + indexParameters: { maxSimultaneousLights: this.maxSimultaneousLights } + }, engine), defines); + } + if (!subMesh.effect || !subMesh.effect.isReady()) { + return false; + } + defines._renderId = scene.getRenderId(); + subMesh.effect._wasPreviouslyReady = true; + return true; + }; + TerrainMaterial.prototype.bindForSubMesh = function (world, mesh, subMesh) { + var scene = this.getScene(); + var defines = subMesh._materialDefines; + if (!defines) { + return; + } + var effect = subMesh.effect; + if (!effect) { + return; + } + this._activeEffect = effect; + // Matrices + this.bindOnlyWorldMatrix(world); + this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix()); + // Bones + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindBonesParameters(mesh, this._activeEffect); + if (this._mustRebind(scene, effect)) { + // Textures + if (this.mixTexture) { + this._activeEffect.setTexture("textureSampler", this._mixTexture); + this._activeEffect.setFloat2("vTextureInfos", this._mixTexture.coordinatesIndex, this._mixTexture.level); + this._activeEffect.setMatrix("textureMatrix", this._mixTexture.getTextureMatrix()); + if (babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialFlags"].DiffuseTextureEnabled) { + if (this._diffuseTexture1) { + this._activeEffect.setTexture("diffuse1Sampler", this._diffuseTexture1); + this._activeEffect.setFloat2("diffuse1Infos", this._diffuseTexture1.uScale, this._diffuseTexture1.vScale); + } + if (this._diffuseTexture2) { + this._activeEffect.setTexture("diffuse2Sampler", this._diffuseTexture2); + this._activeEffect.setFloat2("diffuse2Infos", this._diffuseTexture2.uScale, this._diffuseTexture2.vScale); + } + if (this._diffuseTexture3) { + this._activeEffect.setTexture("diffuse3Sampler", this._diffuseTexture3); + this._activeEffect.setFloat2("diffuse3Infos", this._diffuseTexture3.uScale, this._diffuseTexture3.vScale); + } + } + if (babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialFlags"].BumpTextureEnabled && scene.getEngine().getCaps().standardDerivatives) { + if (this._bumpTexture1) { + this._activeEffect.setTexture("bump1Sampler", this._bumpTexture1); + } + if (this._bumpTexture2) { + this._activeEffect.setTexture("bump2Sampler", this._bumpTexture2); + } + if (this._bumpTexture3) { + this._activeEffect.setTexture("bump3Sampler", this._bumpTexture3); + } + } + } + // Clip plane + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindClipPlane(this._activeEffect, scene); + // Point size + if (this.pointsCloud) { + this._activeEffect.setFloat("pointSize", this.pointSize); + } + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindEyePosition(effect, scene); + } + this._activeEffect.setColor4("vDiffuseColor", this.diffuseColor, this.alpha * mesh.visibility); + if (defines.SPECULARTERM) { + this._activeEffect.setColor4("vSpecularColor", this.specularColor, this.specularPower); + } + if (scene.lightsEnabled && !this.disableLighting) { + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindLights(scene, mesh, this._activeEffect, defines, this.maxSimultaneousLights); + } + // View + if (scene.fogEnabled && mesh.applyFog && scene.fogMode !== babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Scene"].FOGMODE_NONE) { + this._activeEffect.setMatrix("view", scene.getViewMatrix()); + } + // Fog + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindFogParameters(scene, mesh, this._activeEffect); + this._afterBind(mesh, this._activeEffect); + }; + TerrainMaterial.prototype.getAnimatables = function () { + var results = []; + if (this.mixTexture && this.mixTexture.animations && this.mixTexture.animations.length > 0) { + results.push(this.mixTexture); + } + return results; + }; + TerrainMaterial.prototype.getActiveTextures = function () { + var activeTextures = _super.prototype.getActiveTextures.call(this); + if (this._mixTexture) { + activeTextures.push(this._mixTexture); + } + if (this._diffuseTexture1) { + activeTextures.push(this._diffuseTexture1); + } + if (this._diffuseTexture2) { + activeTextures.push(this._diffuseTexture2); + } + if (this._diffuseTexture3) { + activeTextures.push(this._diffuseTexture3); + } + if (this._bumpTexture1) { + activeTextures.push(this._bumpTexture1); + } + if (this._bumpTexture2) { + activeTextures.push(this._bumpTexture2); + } + if (this._bumpTexture3) { + activeTextures.push(this._bumpTexture3); + } + return activeTextures; + }; + TerrainMaterial.prototype.hasTexture = function (texture) { + if (_super.prototype.hasTexture.call(this, texture)) { + return true; + } + if (this._mixTexture === texture) { + return true; + } + if (this._diffuseTexture1 === texture) { + return true; + } + if (this._diffuseTexture2 === texture) { + return true; + } + if (this._diffuseTexture3 === texture) { + return true; + } + if (this._bumpTexture1 === texture) { + return true; + } + if (this._bumpTexture2 === texture) { + return true; + } + if (this._bumpTexture3 === texture) { + return true; + } + return false; + }; + TerrainMaterial.prototype.dispose = function (forceDisposeEffect) { + if (this.mixTexture) { + this.mixTexture.dispose(); + } + _super.prototype.dispose.call(this, forceDisposeEffect); + }; + TerrainMaterial.prototype.clone = function (name) { + var _this = this; + return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Clone(function () { return new TerrainMaterial(name, _this.getScene()); }, this); + }; + TerrainMaterial.prototype.serialize = function () { + var serializationObject = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Serialize(this); + serializationObject.customType = "BABYLON.TerrainMaterial"; + return serializationObject; + }; + TerrainMaterial.prototype.getClassName = function () { + return "TerrainMaterial"; + }; + // Statics + TerrainMaterial.Parse = function (source, scene, rootUrl) { + return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Parse(function () { return new TerrainMaterial(source.name, scene); }, source, scene, rootUrl); + }; + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("mixTexture") + ], TerrainMaterial.prototype, "_mixTexture", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty") + ], TerrainMaterial.prototype, "mixTexture", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("diffuseTexture1") + ], TerrainMaterial.prototype, "_diffuseTexture1", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty") + ], TerrainMaterial.prototype, "diffuseTexture1", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("diffuseTexture2") + ], TerrainMaterial.prototype, "_diffuseTexture2", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty") + ], TerrainMaterial.prototype, "diffuseTexture2", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("diffuseTexture3") + ], TerrainMaterial.prototype, "_diffuseTexture3", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty") + ], TerrainMaterial.prototype, "diffuseTexture3", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("bumpTexture1") + ], TerrainMaterial.prototype, "_bumpTexture1", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty") + ], TerrainMaterial.prototype, "bumpTexture1", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("bumpTexture2") + ], TerrainMaterial.prototype, "_bumpTexture2", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty") + ], TerrainMaterial.prototype, "bumpTexture2", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("bumpTexture3") + ], TerrainMaterial.prototype, "_bumpTexture3", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty") + ], TerrainMaterial.prototype, "bumpTexture3", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsColor3"])() + ], TerrainMaterial.prototype, "diffuseColor", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsColor3"])() + ], TerrainMaterial.prototype, "specularColor", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])() + ], TerrainMaterial.prototype, "specularPower", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])("disableLighting") + ], TerrainMaterial.prototype, "_disableLighting", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsLightsDirty") + ], TerrainMaterial.prototype, "disableLighting", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])("maxSimultaneousLights") + ], TerrainMaterial.prototype, "_maxSimultaneousLights", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsLightsDirty") + ], TerrainMaterial.prototype, "maxSimultaneousLights", void 0); + return TerrainMaterial; +}(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["PushMaterial"])); + +babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["_TypeStore"].RegisteredTypes["BABYLON.TerrainMaterial"] = TerrainMaterial; + + +/***/ }), + +/***/ "./triPlanar/index.ts": +/*!****************************!*\ + !*** ./triPlanar/index.ts ***! + \****************************/ +/*! exports provided: TriPlanarMaterial */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _triPlanarMaterial__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./triPlanarMaterial */ "./triPlanar/triPlanarMaterial.ts"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TriPlanarMaterial", function() { return _triPlanarMaterial__WEBPACK_IMPORTED_MODULE_0__["TriPlanarMaterial"]; }); + + + + +/***/ }), + +/***/ "./triPlanar/triPlanarMaterial.ts": +/*!****************************************!*\ + !*** ./triPlanar/triPlanarMaterial.ts ***! + \****************************************/ +/*! exports provided: TriPlanarMaterial */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TriPlanarMaterial", function() { return TriPlanarMaterial; }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js"); +/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators"); +/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _triplanar_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./triplanar.fragment */ "./triPlanar/triplanar.fragment.ts"); +/* harmony import */ var _triplanar_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./triplanar.vertex */ "./triPlanar/triplanar.vertex.ts"); + + + + + + + + + + + + + +var TriPlanarMaterialDefines = /** @class */ (function (_super) { + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(TriPlanarMaterialDefines, _super); + function TriPlanarMaterialDefines() { + var _this = _super.call(this) || this; + _this.DIFFUSEX = false; + _this.DIFFUSEY = false; + _this.DIFFUSEZ = false; + _this.BUMPX = false; + _this.BUMPY = false; + _this.BUMPZ = false; + _this.CLIPPLANE = false; + _this.CLIPPLANE2 = false; + _this.CLIPPLANE3 = false; + _this.CLIPPLANE4 = false; + _this.CLIPPLANE5 = false; + _this.CLIPPLANE6 = false; + _this.ALPHATEST = false; + _this.DEPTHPREPASS = false; + _this.POINTSIZE = false; + _this.FOG = false; + _this.SPECULARTERM = false; + _this.NORMAL = false; + _this.VERTEXCOLOR = false; + _this.VERTEXALPHA = false; + _this.NUM_BONE_INFLUENCERS = 0; + _this.BonesPerMesh = 0; + _this.INSTANCES = false; + _this.IMAGEPROCESSINGPOSTPROCESS = false; + _this.rebuild(); + return _this; + } + return TriPlanarMaterialDefines; +}(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialDefines"])); +var TriPlanarMaterial = /** @class */ (function (_super) { + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(TriPlanarMaterial, _super); + function TriPlanarMaterial(name, scene) { + var _this = _super.call(this, name, scene) || this; + _this.tileSize = 1; + _this.diffuseColor = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](1, 1, 1); + _this.specularColor = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](0.2, 0.2, 0.2); + _this.specularPower = 64; + _this._disableLighting = false; + _this._maxSimultaneousLights = 4; + return _this; + } + TriPlanarMaterial.prototype.needAlphaBlending = function () { + return (this.alpha < 1.0); + }; + TriPlanarMaterial.prototype.needAlphaTesting = function () { + return false; + }; + TriPlanarMaterial.prototype.getAlphaTestTexture = function () { + return null; + }; + // Methods + TriPlanarMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) { + if (this.isFrozen) { + if (subMesh.effect && subMesh.effect._wasPreviouslyReady) { + return true; + } + } + if (!subMesh._materialDefines) { + subMesh._materialDefines = new TriPlanarMaterialDefines(); + } + var defines = subMesh._materialDefines; + var scene = this.getScene(); + if (this._isReadyForSubMesh(subMesh)) { + return true; + } + var engine = scene.getEngine(); + // Textures + if (defines._areTexturesDirty) { + if (scene.texturesEnabled) { + if (babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialFlags"].DiffuseTextureEnabled) { + var textures = [this.diffuseTextureX, this.diffuseTextureY, this.diffuseTextureZ]; + var textureDefines = ["DIFFUSEX", "DIFFUSEY", "DIFFUSEZ"]; + for (var i = 0; i < textures.length; i++) { + if (textures[i]) { + if (!textures[i].isReady()) { + return false; + } + else { + defines[textureDefines[i]] = true; + } + } + } + } + if (babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialFlags"].BumpTextureEnabled) { + var textures = [this.normalTextureX, this.normalTextureY, this.normalTextureZ]; + var textureDefines = ["BUMPX", "BUMPY", "BUMPZ"]; + for (var i = 0; i < textures.length; i++) { + if (textures[i]) { + if (!textures[i].isReady()) { + return false; + } + else { + defines[textureDefines[i]] = true; + } + } + } + } + } + } + // Misc. + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForMisc(mesh, scene, false, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(mesh), defines); + // Lights + defines._needNormals = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForLights(scene, mesh, defines, false, this._maxSimultaneousLights, this._disableLighting); + // Values that need to be evaluated on every frame + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForFrameBoundValues(scene, engine, defines, useInstances ? true : false); + // Attribs + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForAttributes(mesh, defines, true, true); + // Get correct effect + if (defines.isDirty) { + defines.markAsProcessed(); + scene.resetCachedMaterial(); + // Fallbacks + var fallbacks = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["EffectFallbacks"](); + if (defines.FOG) { + fallbacks.addFallback(1, "FOG"); + } + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].HandleFallbacksForShadows(defines, fallbacks, this.maxSimultaneousLights); + if (defines.NUM_BONE_INFLUENCERS > 0) { + fallbacks.addCPUSkinningFallback(0, mesh); + } + defines.IMAGEPROCESSINGPOSTPROCESS = scene.imageProcessingConfiguration.applyByPostProcess; + //Attributes + var attribs = [babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].PositionKind]; + if (defines.NORMAL) { + attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].NormalKind); + } + if (defines.VERTEXCOLOR) { + attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].ColorKind); + } + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareAttributesForBones(attribs, mesh, defines, fallbacks); + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareAttributesForInstances(attribs, defines); + // Legacy browser patch + var shaderName = "triplanar"; + var join = defines.toString(); + var uniforms = ["world", "view", "viewProjection", "vEyePosition", "vLightsType", "vDiffuseColor", "vSpecularColor", + "vFogInfos", "vFogColor", "pointSize", + "mBones", + "vClipPlane", "vClipPlane2", "vClipPlane3", "vClipPlane4", "vClipPlane5", "vClipPlane6", + "tileSize" + ]; + var samplers = ["diffuseSamplerX", "diffuseSamplerY", "diffuseSamplerZ", + "normalSamplerX", "normalSamplerY", "normalSamplerZ" + ]; + var uniformBuffers = new Array(); + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareUniformsAndSamplersList({ + uniformsNames: uniforms, + uniformBuffersNames: uniformBuffers, + samplers: samplers, + defines: defines, + maxSimultaneousLights: this.maxSimultaneousLights + }); + subMesh.setEffect(scene.getEngine().createEffect(shaderName, { + attributes: attribs, + uniformsNames: uniforms, + uniformBuffersNames: uniformBuffers, + samplers: samplers, + defines: join, + fallbacks: fallbacks, + onCompiled: this.onCompiled, + onError: this.onError, + indexParameters: { maxSimultaneousLights: this.maxSimultaneousLights } + }, engine), defines); + } + if (!subMesh.effect || !subMesh.effect.isReady()) { + return false; + } + defines._renderId = scene.getRenderId(); + subMesh.effect._wasPreviouslyReady = true; + return true; + }; + TriPlanarMaterial.prototype.bindForSubMesh = function (world, mesh, subMesh) { + var scene = this.getScene(); + var defines = subMesh._materialDefines; + if (!defines) { + return; + } + var effect = subMesh.effect; + if (!effect) { + return; + } + this._activeEffect = effect; + // Matrices + this.bindOnlyWorldMatrix(world); + this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix()); + // Bones + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindBonesParameters(mesh, this._activeEffect); + this._activeEffect.setFloat("tileSize", this.tileSize); + if (scene.getCachedMaterial() !== this) { + // Textures + if (this.diffuseTextureX) { + this._activeEffect.setTexture("diffuseSamplerX", this.diffuseTextureX); + } + if (this.diffuseTextureY) { + this._activeEffect.setTexture("diffuseSamplerY", this.diffuseTextureY); + } + if (this.diffuseTextureZ) { + this._activeEffect.setTexture("diffuseSamplerZ", this.diffuseTextureZ); + } + if (this.normalTextureX) { + this._activeEffect.setTexture("normalSamplerX", this.normalTextureX); + } + if (this.normalTextureY) { + this._activeEffect.setTexture("normalSamplerY", this.normalTextureY); + } + if (this.normalTextureZ) { + this._activeEffect.setTexture("normalSamplerZ", this.normalTextureZ); + } + // Clip plane + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindClipPlane(this._activeEffect, scene); + // Point size + if (this.pointsCloud) { + this._activeEffect.setFloat("pointSize", this.pointSize); + } + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindEyePosition(effect, scene); + } + this._activeEffect.setColor4("vDiffuseColor", this.diffuseColor, this.alpha * mesh.visibility); + if (defines.SPECULARTERM) { + this._activeEffect.setColor4("vSpecularColor", this.specularColor, this.specularPower); + } + if (scene.lightsEnabled && !this.disableLighting) { + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindLights(scene, mesh, this._activeEffect, defines, this.maxSimultaneousLights); + } + // View + if (scene.fogEnabled && mesh.applyFog && scene.fogMode !== babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Scene"].FOGMODE_NONE) { + this._activeEffect.setMatrix("view", scene.getViewMatrix()); + } + // Fog + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindFogParameters(scene, mesh, this._activeEffect); + this._afterBind(mesh, this._activeEffect); + }; + TriPlanarMaterial.prototype.getAnimatables = function () { + var results = []; + if (this.mixTexture && this.mixTexture.animations && this.mixTexture.animations.length > 0) { + results.push(this.mixTexture); + } + return results; + }; + TriPlanarMaterial.prototype.getActiveTextures = function () { + var activeTextures = _super.prototype.getActiveTextures.call(this); + if (this._diffuseTextureX) { + activeTextures.push(this._diffuseTextureX); + } + if (this._diffuseTextureY) { + activeTextures.push(this._diffuseTextureY); + } + if (this._diffuseTextureZ) { + activeTextures.push(this._diffuseTextureZ); + } + if (this._normalTextureX) { + activeTextures.push(this._normalTextureX); + } + if (this._normalTextureY) { + activeTextures.push(this._normalTextureY); + } + if (this._normalTextureZ) { + activeTextures.push(this._normalTextureZ); + } + return activeTextures; + }; + TriPlanarMaterial.prototype.hasTexture = function (texture) { + if (_super.prototype.hasTexture.call(this, texture)) { + return true; + } + if (this._diffuseTextureX === texture) { + return true; + } + if (this._diffuseTextureY === texture) { + return true; + } + if (this._diffuseTextureZ === texture) { + return true; + } + if (this._normalTextureX === texture) { + return true; + } + if (this._normalTextureY === texture) { + return true; + } + if (this._normalTextureZ === texture) { + return true; + } + return false; + }; + TriPlanarMaterial.prototype.dispose = function (forceDisposeEffect) { + if (this.mixTexture) { + this.mixTexture.dispose(); + } + _super.prototype.dispose.call(this, forceDisposeEffect); + }; + TriPlanarMaterial.prototype.clone = function (name) { + var _this = this; + return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Clone(function () { return new TriPlanarMaterial(name, _this.getScene()); }, this); + }; + TriPlanarMaterial.prototype.serialize = function () { + var serializationObject = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Serialize(this); + serializationObject.customType = "BABYLON.TriPlanarMaterial"; + return serializationObject; + }; + TriPlanarMaterial.prototype.getClassName = function () { + return "TriPlanarMaterial"; + }; + // Statics + TriPlanarMaterial.Parse = function (source, scene, rootUrl) { + return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Parse(function () { return new TriPlanarMaterial(source.name, scene); }, source, scene, rootUrl); + }; + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])() + ], TriPlanarMaterial.prototype, "mixTexture", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("diffuseTextureX") + ], TriPlanarMaterial.prototype, "_diffuseTextureX", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty") + ], TriPlanarMaterial.prototype, "diffuseTextureX", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("diffuseTexturY") + ], TriPlanarMaterial.prototype, "_diffuseTextureY", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty") + ], TriPlanarMaterial.prototype, "diffuseTextureY", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("diffuseTextureZ") + ], TriPlanarMaterial.prototype, "_diffuseTextureZ", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty") + ], TriPlanarMaterial.prototype, "diffuseTextureZ", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("normalTextureX") + ], TriPlanarMaterial.prototype, "_normalTextureX", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty") + ], TriPlanarMaterial.prototype, "normalTextureX", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("normalTextureY") + ], TriPlanarMaterial.prototype, "_normalTextureY", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty") + ], TriPlanarMaterial.prototype, "normalTextureY", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("normalTextureZ") + ], TriPlanarMaterial.prototype, "_normalTextureZ", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty") + ], TriPlanarMaterial.prototype, "normalTextureZ", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])() + ], TriPlanarMaterial.prototype, "tileSize", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsColor3"])() + ], TriPlanarMaterial.prototype, "diffuseColor", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsColor3"])() + ], TriPlanarMaterial.prototype, "specularColor", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])() + ], TriPlanarMaterial.prototype, "specularPower", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])("disableLighting") + ], TriPlanarMaterial.prototype, "_disableLighting", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsLightsDirty") + ], TriPlanarMaterial.prototype, "disableLighting", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])("maxSimultaneousLights") + ], TriPlanarMaterial.prototype, "_maxSimultaneousLights", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsLightsDirty") + ], TriPlanarMaterial.prototype, "maxSimultaneousLights", void 0); + return TriPlanarMaterial; +}(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["PushMaterial"])); + +babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["_TypeStore"].RegisteredTypes["BABYLON.TriPlanarMaterial"] = TriPlanarMaterial; + + +/***/ }), + +/***/ "./triPlanar/triplanar.fragment.ts": +/*!*****************************************!*\ + !*** ./triPlanar/triplanar.fragment.ts ***! + \*****************************************/ +/*! exports provided: triplanarPixelShader */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "triplanarPixelShader", function() { return triplanarPixelShader; }); +/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators"); +/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__); + + + + + + + + + + + + + +var name = 'triplanarPixelShader'; +var shader = "precision highp float;\n\nuniform vec3 vEyePosition;\nuniform vec4 vDiffuseColor;\n#ifdef SPECULARTERM\nuniform vec4 vSpecularColor;\n#endif\n\nvarying vec3 vPositionW;\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n\n#include\n\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n\n#ifdef DIFFUSEX\nvarying vec2 vTextureUVX;\nuniform sampler2D diffuseSamplerX;\n#ifdef BUMPX\nuniform sampler2D normalSamplerX;\n#endif\n#endif\n#ifdef DIFFUSEY\nvarying vec2 vTextureUVY;\nuniform sampler2D diffuseSamplerY;\n#ifdef BUMPY\nuniform sampler2D normalSamplerY;\n#endif\n#endif\n#ifdef DIFFUSEZ\nvarying vec2 vTextureUVZ;\nuniform sampler2D diffuseSamplerZ;\n#ifdef BUMPZ\nuniform sampler2D normalSamplerZ;\n#endif\n#endif\n#ifdef NORMAL\nvarying mat3 tangentSpace;\n#endif\n#include\n#include\n#include\n#include\nvoid main(void) {\n\n#include\nvec3 viewDirectionW=normalize(vEyePosition-vPositionW);\n\nvec4 baseColor=vec4(0.,0.,0.,1.);\nvec3 diffuseColor=vDiffuseColor.rgb;\n\nfloat alpha=vDiffuseColor.a;\n\n#ifdef NORMAL\nvec3 normalW=tangentSpace[2];\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);\n#endif\nvec4 baseNormal=vec4(0.0,0.0,0.0,1.0);\nnormalW*=normalW;\n#ifdef DIFFUSEX\nbaseColor+=texture2D(diffuseSamplerX,vTextureUVX)*normalW.x;\n#ifdef BUMPX\nbaseNormal+=texture2D(normalSamplerX,vTextureUVX)*normalW.x;\n#endif\n#endif\n#ifdef DIFFUSEY\nbaseColor+=texture2D(diffuseSamplerY,vTextureUVY)*normalW.y;\n#ifdef BUMPY\nbaseNormal+=texture2D(normalSamplerY,vTextureUVY)*normalW.y;\n#endif\n#endif\n#ifdef DIFFUSEZ\nbaseColor+=texture2D(diffuseSamplerZ,vTextureUVZ)*normalW.z;\n#ifdef BUMPZ\nbaseNormal+=texture2D(normalSamplerZ,vTextureUVZ)*normalW.z;\n#endif\n#endif\n#ifdef NORMAL\nnormalW=normalize((2.0*baseNormal.xyz-1.0)*tangentSpace);\n#endif\n#ifdef ALPHATEST\nif (baseColor.a<0.4)\ndiscard;\n#endif\n#include\n#ifdef VERTEXCOLOR\nbaseColor.rgb*=vColor.rgb;\n#endif\n\nvec3 diffuseBase=vec3(0.,0.,0.);\nlightingInfo info;\nfloat shadow=1.;\n#ifdef SPECULARTERM\nfloat glossiness=vSpecularColor.a;\nvec3 specularBase=vec3(0.,0.,0.);\nvec3 specularColor=vSpecularColor.rgb;\n#else\nfloat glossiness=0.;\n#endif\n#include[0..maxSimultaneousLights]\n#ifdef VERTEXALPHA\nalpha*=vColor.a;\n#endif\n#ifdef SPECULARTERM\nvec3 finalSpecular=specularBase*specularColor;\n#else\nvec3 finalSpecular=vec3(0.0);\n#endif\nvec3 finalDiffuse=clamp(diffuseBase*diffuseColor,0.0,1.0)*baseColor.rgb;\n\nvec4 color=vec4(finalDiffuse+finalSpecular,alpha);\n#include\ngl_FragColor=color;\n#include\n}\n"; +babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__["Effect"].ShadersStore[name] = shader; +/** @hidden */ +var triplanarPixelShader = { name: name, shader: shader }; + + +/***/ }), + +/***/ "./triPlanar/triplanar.vertex.ts": +/*!***************************************!*\ + !*** ./triPlanar/triplanar.vertex.ts ***! + \***************************************/ +/*! exports provided: triplanarVertexShader */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "triplanarVertexShader", function() { return triplanarVertexShader; }); +/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators"); +/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__); + + + + + + + + + + + + +var name = 'triplanarVertexShader'; +var shader = "precision highp float;\n\nattribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include\n\n#include\nuniform mat4 view;\nuniform mat4 viewProjection;\n#ifdef DIFFUSEX\nvarying vec2 vTextureUVX;\n#endif\n#ifdef DIFFUSEY\nvarying vec2 vTextureUVY;\n#endif\n#ifdef DIFFUSEZ\nvarying vec2 vTextureUVZ;\n#endif\nuniform float tileSize;\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\n\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying mat3 tangentSpace;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include\n#include\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\nvoid main(void)\n{\n#include\n#include\nvec4 worldPos=finalWorld*vec4(position,1.0);\ngl_Position=viewProjection*worldPos;\nvPositionW=vec3(worldPos);\n#ifdef DIFFUSEX\nvTextureUVX=worldPos.zy/tileSize;\n#endif\n#ifdef DIFFUSEY\nvTextureUVY=worldPos.xz/tileSize;\n#endif\n#ifdef DIFFUSEZ\nvTextureUVZ=worldPos.xy/tileSize;\n#endif\n#ifdef NORMAL\n\nvec3 xtan=vec3(0,0,1);\nvec3 xbin=vec3(0,1,0);\nvec3 ytan=vec3(1,0,0);\nvec3 ybin=vec3(0,0,1);\nvec3 ztan=vec3(1,0,0);\nvec3 zbin=vec3(0,1,0);\nvec3 normalizedNormal=normalize(normal);\nnormalizedNormal*=normalizedNormal;\nvec3 worldBinormal=normalize(xbin*normalizedNormal.x+ybin*normalizedNormal.y+zbin*normalizedNormal.z);\nvec3 worldTangent=normalize(xtan*normalizedNormal.x+ytan*normalizedNormal.y+ztan*normalizedNormal.z);\nworldTangent=(world*vec4(worldTangent,1.0)).xyz;\nworldBinormal=(world*vec4(worldBinormal,1.0)).xyz;\nvec3 worldNormal=(world*vec4(normalize(normal),1.0)).xyz;\ntangentSpace[0]=worldTangent;\ntangentSpace[1]=worldBinormal;\ntangentSpace[2]=worldNormal;\n#endif\n\n#include\n\n#include\n\n#include[0..maxSimultaneousLights]\n\n#ifdef VERTEXCOLOR\nvColor=color;\n#endif\n\n#ifdef POINTSIZE\ngl_PointSize=pointSize;\n#endif\n}\n"; +babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__["Effect"].ShadersStore[name] = shader; +/** @hidden */ +var triplanarVertexShader = { name: name, shader: shader }; + + +/***/ }), + +/***/ "./water/index.ts": +/*!************************!*\ + !*** ./water/index.ts ***! + \************************/ +/*! exports provided: WaterMaterial */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _waterMaterial__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./waterMaterial */ "./water/waterMaterial.ts"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WaterMaterial", function() { return _waterMaterial__WEBPACK_IMPORTED_MODULE_0__["WaterMaterial"]; }); + + + + +/***/ }), + +/***/ "./water/water.fragment.ts": +/*!*********************************!*\ + !*** ./water/water.fragment.ts ***! + \*********************************/ +/*! exports provided: waterPixelShader */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "waterPixelShader", function() { return waterPixelShader; }); +/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators"); +/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__); + + + + + + + + + + + + + + + +var name = 'waterPixelShader'; +var shader = "#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\nprecision highp float;\n\nuniform vec3 vEyePosition;\nuniform vec4 vDiffuseColor;\n#ifdef SPECULARTERM\nuniform vec4 vSpecularColor;\n#endif\n\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n\n#include\n#include\n#include\n\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include\n#include\n\n#ifdef BUMP\nvarying vec2 vNormalUV;\nvarying vec2 vNormalUV2;\nuniform sampler2D normalSampler;\nuniform vec2 vNormalInfos;\n#endif\nuniform sampler2D refractionSampler;\nuniform sampler2D reflectionSampler;\n\nconst float LOG2=1.442695;\nuniform vec3 cameraPosition;\nuniform vec4 waterColor;\nuniform float colorBlendFactor;\nuniform vec4 waterColor2;\nuniform float colorBlendFactor2;\nuniform float bumpHeight;\nuniform float time;\n\nvarying vec3 vRefractionMapTexCoord;\nvarying vec3 vReflectionMapTexCoord;\nvarying vec3 vPosition;\n#include\n#include\n\n#include\nvoid main(void) {\n\n#include\nvec3 viewDirectionW=normalize(vEyePosition-vPositionW);\n\nvec4 baseColor=vec4(1.,1.,1.,1.);\nvec3 diffuseColor=vDiffuseColor.rgb;\n\nfloat alpha=vDiffuseColor.a;\n#ifdef BUMP\n#ifdef BUMPSUPERIMPOSE\nbaseColor=0.6*texture2D(normalSampler,vNormalUV)+0.4*texture2D(normalSampler,vec2(vNormalUV2.x,vNormalUV2.y));\n#else\nbaseColor=texture2D(normalSampler,vNormalUV);\n#endif\nvec3 bumpColor=baseColor.rgb;\n#ifdef ALPHATEST\nif (baseColor.a<0.4)\ndiscard;\n#endif\nbaseColor.rgb*=vNormalInfos.y;\n#else\nvec3 bumpColor=vec3(1.0);\n#endif\n#ifdef VERTEXCOLOR\nbaseColor.rgb*=vColor.rgb;\n#endif\n\n#ifdef NORMAL\nvec2 perturbation=bumpHeight*(baseColor.rg-0.5);\n#ifdef BUMPAFFECTSREFLECTION\nvec3 normalW=normalize(vNormalW+vec3(perturbation.x*8.0,0.0,perturbation.y*8.0));\nif (normalW.y<0.0) {\nnormalW.y=-normalW.y;\n}\n#else\nvec3 normalW=normalize(vNormalW);\n#endif\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);\nvec2 perturbation=bumpHeight*(vec2(1.0,1.0)-0.5);\n#endif\n#ifdef FRESNELSEPARATE\n#ifdef REFLECTION\n\nvec2 projectedRefractionTexCoords=clamp(vRefractionMapTexCoord.xy/vRefractionMapTexCoord.z+perturbation*0.5,0.0,1.0);\nvec4 refractiveColor=texture2D(refractionSampler,projectedRefractionTexCoords);\n#ifdef IS_REFRACTION_LINEAR\nrefractiveColor.rgb=toGammaSpace(refractiveColor.rgb);\n#endif\nvec2 projectedReflectionTexCoords=clamp(vec2(\nvReflectionMapTexCoord.x/vReflectionMapTexCoord.z+perturbation.x*0.3,\nvReflectionMapTexCoord.y/vReflectionMapTexCoord.z+perturbation.y\n),0.0,1.0);\nvec4 reflectiveColor=texture2D(reflectionSampler,projectedReflectionTexCoords);\n#ifdef IS_REFLECTION_LINEAR\nreflectiveColor.rgb=toGammaSpace(reflectiveColor.rgb);\n#endif\nvec3 upVector=vec3(0.0,1.0,0.0);\nfloat fresnelTerm=clamp(abs(pow(dot(viewDirectionW,upVector),3.0)),0.05,0.65);\nfloat IfresnelTerm=1.0-fresnelTerm;\nrefractiveColor=colorBlendFactor*waterColor+(1.0-colorBlendFactor)*refractiveColor;\nreflectiveColor=IfresnelTerm*colorBlendFactor2*waterColor+(1.0-colorBlendFactor2*IfresnelTerm)*reflectiveColor;\nvec4 combinedColor=refractiveColor*fresnelTerm+reflectiveColor*IfresnelTerm;\nbaseColor=combinedColor;\n#endif\n\nvec3 diffuseBase=vec3(0.,0.,0.);\nlightingInfo info;\nfloat shadow=1.;\n#ifdef SPECULARTERM\nfloat glossiness=vSpecularColor.a;\nvec3 specularBase=vec3(0.,0.,0.);\nvec3 specularColor=vSpecularColor.rgb;\n#else\nfloat glossiness=0.;\n#endif\n#include[0..maxSimultaneousLights]\nvec3 finalDiffuse=clamp(baseColor.rgb,0.0,1.0);\n#ifdef VERTEXALPHA\nalpha*=vColor.a;\n#endif\n#ifdef SPECULARTERM\nvec3 finalSpecular=specularBase*specularColor;\n#else\nvec3 finalSpecular=vec3(0.0);\n#endif\n#else\n#ifdef REFLECTION\n\nvec2 projectedRefractionTexCoords=clamp(vRefractionMapTexCoord.xy/vRefractionMapTexCoord.z+perturbation,0.0,1.0);\nvec4 refractiveColor=texture2D(refractionSampler,projectedRefractionTexCoords);\n#ifdef IS_REFRACTION_LINEAR\nrefractiveColor.rgb=toGammaSpace(refractiveColor.rgb);\n#endif\nvec2 projectedReflectionTexCoords=clamp(vReflectionMapTexCoord.xy/vReflectionMapTexCoord.z+perturbation,0.0,1.0);\nvec4 reflectiveColor=texture2D(reflectionSampler,projectedReflectionTexCoords);\n#ifdef IS_REFLECTION_LINEAR\nreflectiveColor.rgb=toGammaSpace(reflectiveColor.rgb);\n#endif\nvec3 upVector=vec3(0.0,1.0,0.0);\nfloat fresnelTerm=max(dot(viewDirectionW,upVector),0.0);\nvec4 combinedColor=refractiveColor*fresnelTerm+reflectiveColor*(1.0-fresnelTerm);\nbaseColor=colorBlendFactor*waterColor+(1.0-colorBlendFactor)*combinedColor;\n#endif\n\nvec3 diffuseBase=vec3(0.,0.,0.);\nlightingInfo info;\nfloat shadow=1.;\n#ifdef SPECULARTERM\nfloat glossiness=vSpecularColor.a;\nvec3 specularBase=vec3(0.,0.,0.);\nvec3 specularColor=vSpecularColor.rgb;\n#else\nfloat glossiness=0.;\n#endif\n#include[0..maxSimultaneousLights]\nvec3 finalDiffuse=clamp(baseColor.rgb,0.0,1.0);\n#ifdef VERTEXALPHA\nalpha*=vColor.a;\n#endif\n#ifdef SPECULARTERM\nvec3 finalSpecular=specularBase*specularColor;\n#else\nvec3 finalSpecular=vec3(0.0);\n#endif\n#endif\n\nvec4 color=vec4(finalDiffuse+finalSpecular,alpha);\n#include\n#include\n\n\n#ifdef IMAGEPROCESSINGPOSTPROCESS\ncolor.rgb=toLinearSpace(color.rgb);\n#elif defined(IMAGEPROCESSING)\ncolor.rgb=toLinearSpace(color.rgb);\ncolor=applyImageProcessing(color);\n#endif\ngl_FragColor=color;\n}\n"; +babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__["Effect"].ShadersStore[name] = shader; +/** @hidden */ +var waterPixelShader = { name: name, shader: shader }; + + +/***/ }), + +/***/ "./water/water.vertex.ts": +/*!*******************************!*\ + !*** ./water/water.vertex.ts ***! + \*******************************/ +/*! exports provided: waterVertexShader */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "waterVertexShader", function() { return waterVertexShader; }); +/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators"); +/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__); + + + + + + + + + + + + + + +var name = 'waterVertexShader'; +var shader = "precision highp float;\n\nattribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include\n\n#include\nuniform mat4 view;\nuniform mat4 viewProjection;\n#ifdef BUMP\nvarying vec2 vNormalUV;\n#ifdef BUMPSUPERIMPOSE\nvarying vec2 vNormalUV2;\n#endif\nuniform mat4 normalMatrix;\nuniform vec2 vNormalInfos;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\n\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include\n#include\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include\n\nuniform mat4 worldReflectionViewProjection;\nuniform vec2 windDirection;\nuniform float waveLength;\nuniform float time;\nuniform float windForce;\nuniform float waveHeight;\nuniform float waveSpeed;\nuniform float waveCount;\n\nvarying vec3 vPosition;\nvarying vec3 vRefractionMapTexCoord;\nvarying vec3 vReflectionMapTexCoord;\nvoid main(void) {\n#include\n#include\nvec4 worldPos=finalWorld*vec4(position,1.0);\nvPositionW=vec3(worldPos);\n#ifdef NORMAL\nvNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));\n#endif\n\n#ifndef UV1\nvec2 uv=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\n#ifdef BUMP\nif (vNormalInfos.x == 0.)\n{\nvNormalUV=vec2(normalMatrix*vec4((uv*1.0)/waveLength+time*windForce*windDirection,1.0,0.0));\n#ifdef BUMPSUPERIMPOSE\nvNormalUV2=vec2(normalMatrix*vec4((uv*0.721)/waveLength+time*1.2*windForce*windDirection,1.0,0.0));\n#endif\n}\nelse\n{\nvNormalUV=vec2(normalMatrix*vec4((uv2*1.0)/waveLength+time*windForce*windDirection ,1.0,0.0));\n#ifdef BUMPSUPERIMPOSE\nvNormalUV2=vec2(normalMatrix*vec4((uv2*0.721)/waveLength+time*1.2*windForce*windDirection ,1.0,0.0));\n#endif\n}\n#endif\n\n#include\n\n#include\n\n#include[0..maxSimultaneousLights]\n\n#ifdef VERTEXCOLOR\nvColor=color;\n#endif\n\n#ifdef POINTSIZE\ngl_PointSize=pointSize;\n#endif\nfloat finalWaveCount=1.0/(waveCount*0.5);\nvec3 p=position;\nfloat newY=(sin(((p.x/finalWaveCount)+time*waveSpeed))*waveHeight*windDirection.x*5.0)\n+(cos(((p.z/finalWaveCount)+time*waveSpeed))*waveHeight*windDirection.y*5.0);\np.y+=abs(newY);\ngl_Position=viewProjection*finalWorld*vec4(p,1.0);\n#ifdef REFLECTION\nworldPos=viewProjection*finalWorld*vec4(p,1.0);\n\nvPosition=position;\nvRefractionMapTexCoord.x=0.5*(worldPos.w+worldPos.x);\nvRefractionMapTexCoord.y=0.5*(worldPos.w+worldPos.y);\nvRefractionMapTexCoord.z=worldPos.w;\nworldPos=worldReflectionViewProjection*vec4(position,1.0);\nvReflectionMapTexCoord.x=0.5*(worldPos.w+worldPos.x);\nvReflectionMapTexCoord.y=0.5*(worldPos.w+worldPos.y);\nvReflectionMapTexCoord.z=worldPos.w;\n#endif\n#include\n}\n"; +babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__["Effect"].ShadersStore[name] = shader; +/** @hidden */ +var waterVertexShader = { name: name, shader: shader }; + + +/***/ }), + +/***/ "./water/waterMaterial.ts": +/*!********************************!*\ + !*** ./water/waterMaterial.ts ***! + \********************************/ +/*! exports provided: WaterMaterial */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WaterMaterial", function() { return WaterMaterial; }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js"); +/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators"); +/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _water_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./water.fragment */ "./water/water.fragment.ts"); +/* harmony import */ var _water_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./water.vertex */ "./water/water.vertex.ts"); + + + + + + + + + + + + + + + + + + + + +var WaterMaterialDefines = /** @class */ (function (_super) { + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(WaterMaterialDefines, _super); + function WaterMaterialDefines() { + var _this = _super.call(this) || this; + _this.BUMP = false; + _this.REFLECTION = false; + _this.CLIPPLANE = false; + _this.CLIPPLANE2 = false; + _this.CLIPPLANE3 = false; + _this.CLIPPLANE4 = false; + _this.CLIPPLANE5 = false; + _this.CLIPPLANE6 = false; + _this.ALPHATEST = false; + _this.DEPTHPREPASS = false; + _this.POINTSIZE = false; + _this.FOG = false; + _this.NORMAL = false; + _this.UV1 = false; + _this.UV2 = false; + _this.VERTEXCOLOR = false; + _this.VERTEXALPHA = false; + _this.NUM_BONE_INFLUENCERS = 0; + _this.BonesPerMesh = 0; + _this.INSTANCES = false; + _this.SPECULARTERM = false; + _this.LOGARITHMICDEPTH = false; + _this.FRESNELSEPARATE = false; + _this.BUMPSUPERIMPOSE = false; + _this.BUMPAFFECTSREFLECTION = false; + _this.IMAGEPROCESSING = false; + _this.VIGNETTE = false; + _this.VIGNETTEBLENDMODEMULTIPLY = false; + _this.VIGNETTEBLENDMODEOPAQUE = false; + _this.TONEMAPPING = false; + _this.TONEMAPPING_ACES = false; + _this.CONTRAST = false; + _this.EXPOSURE = false; + _this.COLORCURVES = false; + _this.COLORGRADING = false; + _this.COLORGRADING3D = false; + _this.SAMPLER3DGREENDEPTH = false; + _this.SAMPLER3DBGRMAP = false; + _this.IMAGEPROCESSINGPOSTPROCESS = false; + _this.rebuild(); + return _this; + } + return WaterMaterialDefines; +}(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialDefines"])); +var WaterMaterial = /** @class */ (function (_super) { + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(WaterMaterial, _super); + /** + * Constructor + */ + function WaterMaterial(name, scene, renderTargetSize) { + if (renderTargetSize === void 0) { renderTargetSize = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Vector2"](512, 512); } + var _this = _super.call(this, name, scene) || this; + _this.renderTargetSize = renderTargetSize; + _this.diffuseColor = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](1, 1, 1); + _this.specularColor = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](0, 0, 0); + _this.specularPower = 64; + _this._disableLighting = false; + _this._maxSimultaneousLights = 4; + /** + * Defines the wind force. + */ + _this.windForce = 6; + /** + * Defines the direction of the wind in the plane (X, Z). + */ + _this.windDirection = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Vector2"](0, 1); + /** + * Defines the height of the waves. + */ + _this.waveHeight = 0.4; + /** + * Defines the bump height related to the bump map. + */ + _this.bumpHeight = 0.4; + /** + * Defines wether or not: to add a smaller moving bump to less steady waves. + */ + _this._bumpSuperimpose = false; + /** + * Defines wether or not color refraction and reflection differently with .waterColor2 and .colorBlendFactor2. Non-linear (physically correct) fresnel. + */ + _this._fresnelSeparate = false; + /** + * Defines wether or not bump Wwves modify the reflection. + */ + _this._bumpAffectsReflection = false; + /** + * Defines the water color blended with the refraction (near). + */ + _this.waterColor = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](0.1, 0.1, 0.6); + /** + * Defines the blend factor related to the water color. + */ + _this.colorBlendFactor = 0.2; + /** + * Defines the water color blended with the reflection (far). + */ + _this.waterColor2 = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](0.1, 0.1, 0.6); + /** + * Defines the blend factor related to the water color (reflection, far). + */ + _this.colorBlendFactor2 = 0.2; + /** + * Defines the maximum length of a wave. + */ + _this.waveLength = 0.1; + /** + * Defines the waves speed. + */ + _this.waveSpeed = 1.0; + /** + * Defines the number of times waves are repeated. This is typically used to adjust waves count according to the ground's size where the material is applied on. + */ + _this.waveCount = 20; + /** + * Sets or gets whether or not automatic clipping should be enabled or not. Setting to true will save performances and + * will avoid calculating useless pixels in the pixel shader of the water material. + */ + _this.disableClipPlane = false; + _this._renderTargets = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SmartArray"](16); + /* + * Private members + */ + _this._mesh = null; + _this._reflectionTransform = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Matrix"].Zero(); + _this._lastTime = 0; + _this._lastDeltaTime = 0; + _this._createRenderTargets(scene, renderTargetSize); + // Create render targets + _this.getRenderTargetTextures = function () { + _this._renderTargets.reset(); + _this._renderTargets.push(_this._reflectionRTT); + _this._renderTargets.push(_this._refractionRTT); + return _this._renderTargets; + }; + _this._imageProcessingConfiguration = _this.getScene().imageProcessingConfiguration; + if (_this._imageProcessingConfiguration) { + _this._imageProcessingObserver = _this._imageProcessingConfiguration.onUpdateParameters.add(function () { + _this._markAllSubMeshesAsImageProcessingDirty(); + }); + } + return _this; + } + Object.defineProperty(WaterMaterial.prototype, "hasRenderTargetTextures", { + /** + * Gets a boolean indicating that current material needs to register RTT + */ + get: function () { + return true; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(WaterMaterial.prototype, "useLogarithmicDepth", { + get: function () { + return this._useLogarithmicDepth; + }, + set: function (value) { + this._useLogarithmicDepth = value && this.getScene().getEngine().getCaps().fragmentDepthSupported; + this._markAllSubMeshesAsMiscDirty(); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(WaterMaterial.prototype, "refractionTexture", { + // Get / Set + get: function () { + return this._refractionRTT; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(WaterMaterial.prototype, "reflectionTexture", { + get: function () { + return this._reflectionRTT; + }, + enumerable: false, + configurable: true + }); + // Methods + WaterMaterial.prototype.addToRenderList = function (node) { + if (this._refractionRTT && this._refractionRTT.renderList) { + this._refractionRTT.renderList.push(node); + } + if (this._reflectionRTT && this._reflectionRTT.renderList) { + this._reflectionRTT.renderList.push(node); + } + }; + WaterMaterial.prototype.enableRenderTargets = function (enable) { + var refreshRate = enable ? 1 : 0; + if (this._refractionRTT) { + this._refractionRTT.refreshRate = refreshRate; + } + if (this._reflectionRTT) { + this._reflectionRTT.refreshRate = refreshRate; + } + }; + WaterMaterial.prototype.getRenderList = function () { + return this._refractionRTT ? this._refractionRTT.renderList : []; + }; + Object.defineProperty(WaterMaterial.prototype, "renderTargetsEnabled", { + get: function () { + return !(this._refractionRTT && this._refractionRTT.refreshRate === 0); + }, + enumerable: false, + configurable: true + }); + WaterMaterial.prototype.needAlphaBlending = function () { + return (this.alpha < 1.0); + }; + WaterMaterial.prototype.needAlphaTesting = function () { + return false; + }; + WaterMaterial.prototype.getAlphaTestTexture = function () { + return null; + }; + WaterMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) { + if (this.isFrozen) { + if (subMesh.effect && subMesh.effect._wasPreviouslyReady) { + return true; + } + } + if (!subMesh._materialDefines) { + subMesh._materialDefines = new WaterMaterialDefines(); + } + var defines = subMesh._materialDefines; + var scene = this.getScene(); + if (this._isReadyForSubMesh(subMesh)) { + return true; + } + var engine = scene.getEngine(); + // Textures + if (defines._areTexturesDirty) { + defines._needUVs = false; + if (scene.texturesEnabled) { + if (this.bumpTexture && babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialFlags"].BumpTextureEnabled) { + if (!this.bumpTexture.isReady()) { + return false; + } + else { + defines._needUVs = true; + defines.BUMP = true; + } + } + if (babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialFlags"].ReflectionTextureEnabled) { + defines.REFLECTION = true; + } + } + } + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForFrameBoundValues(scene, engine, defines, useInstances ? true : false); + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForMisc(mesh, scene, this._useLogarithmicDepth, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(mesh), defines); + if (defines._areMiscDirty) { + if (this._fresnelSeparate) { + defines.FRESNELSEPARATE = true; + } + if (this._bumpSuperimpose) { + defines.BUMPSUPERIMPOSE = true; + } + if (this._bumpAffectsReflection) { + defines.BUMPAFFECTSREFLECTION = true; + } + } + // Lights + defines._needNormals = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForLights(scene, mesh, defines, true, this._maxSimultaneousLights, this._disableLighting); + // Image processing + if (defines._areImageProcessingDirty && this._imageProcessingConfiguration) { + if (!this._imageProcessingConfiguration.isReady()) { + return false; + } + this._imageProcessingConfiguration.prepareDefines(defines); + defines.IS_REFLECTION_LINEAR = (this.reflectionTexture != null && !this.reflectionTexture.gammaSpace); + defines.IS_REFRACTION_LINEAR = (this.refractionTexture != null && !this.refractionTexture.gammaSpace); + } + // Attribs + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForAttributes(mesh, defines, true, true); + // Configure this + this._mesh = mesh; + if (this._waitingRenderList) { + for (var i = 0; i < this._waitingRenderList.length; i++) { + this.addToRenderList(scene.getNodeByID(this._waitingRenderList[i])); + } + this._waitingRenderList = null; + } + // Get correct effect + if (defines.isDirty) { + defines.markAsProcessed(); + scene.resetCachedMaterial(); + // Fallbacks + var fallbacks = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["EffectFallbacks"](); + if (defines.FOG) { + fallbacks.addFallback(1, "FOG"); + } + if (defines.LOGARITHMICDEPTH) { + fallbacks.addFallback(0, "LOGARITHMICDEPTH"); + } + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].HandleFallbacksForShadows(defines, fallbacks, this.maxSimultaneousLights); + if (defines.NUM_BONE_INFLUENCERS > 0) { + fallbacks.addCPUSkinningFallback(0, mesh); + } + //Attributes + var attribs = [babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].PositionKind]; + if (defines.NORMAL) { + attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].NormalKind); + } + if (defines.UV1) { + attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].UVKind); + } + if (defines.UV2) { + attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].UV2Kind); + } + if (defines.VERTEXCOLOR) { + attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].ColorKind); + } + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareAttributesForBones(attribs, mesh, defines, fallbacks); + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareAttributesForInstances(attribs, defines); + // Legacy browser patch + var shaderName = "water"; + var join = defines.toString(); + var uniforms = ["world", "view", "viewProjection", "vEyePosition", "vLightsType", "vDiffuseColor", "vSpecularColor", + "vFogInfos", "vFogColor", "pointSize", + "vNormalInfos", + "mBones", + "vClipPlane", "vClipPlane2", "vClipPlane3", "vClipPlane4", "vClipPlane5", "vClipPlane6", "normalMatrix", + "logarithmicDepthConstant", + // Water + "worldReflectionViewProjection", "windDirection", "waveLength", "time", "windForce", + "cameraPosition", "bumpHeight", "waveHeight", "waterColor", "waterColor2", "colorBlendFactor", "colorBlendFactor2", "waveSpeed", + "waveCount" + ]; + var samplers = ["normalSampler", + // Water + "refractionSampler", "reflectionSampler" + ]; + var uniformBuffers = new Array(); + if (babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["ImageProcessingConfiguration"]) { + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["ImageProcessingConfiguration"].PrepareUniforms(uniforms, defines); + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["ImageProcessingConfiguration"].PrepareSamplers(samplers, defines); + } + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareUniformsAndSamplersList({ + uniformsNames: uniforms, + uniformBuffersNames: uniformBuffers, + samplers: samplers, + defines: defines, + maxSimultaneousLights: this.maxSimultaneousLights + }); + subMesh.setEffect(scene.getEngine().createEffect(shaderName, { + attributes: attribs, + uniformsNames: uniforms, + uniformBuffersNames: uniformBuffers, + samplers: samplers, + defines: join, + fallbacks: fallbacks, + onCompiled: this.onCompiled, + onError: this.onError, + indexParameters: { maxSimultaneousLights: this._maxSimultaneousLights } + }, engine), defines); + } + if (!subMesh.effect || !subMesh.effect.isReady()) { + return false; + } + defines._renderId = scene.getRenderId(); + subMesh.effect._wasPreviouslyReady = true; + return true; + }; + WaterMaterial.prototype.bindForSubMesh = function (world, mesh, subMesh) { + var scene = this.getScene(); + var defines = subMesh._materialDefines; + if (!defines) { + return; + } + var effect = subMesh.effect; + if (!effect || !this._mesh) { + return; + } + this._activeEffect = effect; + // Matrices + this.bindOnlyWorldMatrix(world); + this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix()); + // Bones + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindBonesParameters(mesh, this._activeEffect); + if (this._mustRebind(scene, effect)) { + // Textures + if (this.bumpTexture && babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialFlags"].BumpTextureEnabled) { + this._activeEffect.setTexture("normalSampler", this.bumpTexture); + this._activeEffect.setFloat2("vNormalInfos", this.bumpTexture.coordinatesIndex, this.bumpTexture.level); + this._activeEffect.setMatrix("normalMatrix", this.bumpTexture.getTextureMatrix()); + } + // Clip plane + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindClipPlane(this._activeEffect, scene); + // Point size + if (this.pointsCloud) { + this._activeEffect.setFloat("pointSize", this.pointSize); + } + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindEyePosition(effect, scene); + } + this._activeEffect.setColor4("vDiffuseColor", this.diffuseColor, this.alpha * mesh.visibility); + if (defines.SPECULARTERM) { + this._activeEffect.setColor4("vSpecularColor", this.specularColor, this.specularPower); + } + if (scene.lightsEnabled && !this.disableLighting) { + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindLights(scene, mesh, this._activeEffect, defines, this.maxSimultaneousLights); + } + // View + if (scene.fogEnabled && mesh.applyFog && scene.fogMode !== babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Scene"].FOGMODE_NONE) { + this._activeEffect.setMatrix("view", scene.getViewMatrix()); + } + // Fog + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindFogParameters(scene, mesh, this._activeEffect); + // Log. depth + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindLogDepth(defines, this._activeEffect, scene); + // Water + if (babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialFlags"].ReflectionTextureEnabled) { + this._activeEffect.setTexture("refractionSampler", this._refractionRTT); + this._activeEffect.setTexture("reflectionSampler", this._reflectionRTT); + } + var wrvp = this._mesh.getWorldMatrix().multiply(this._reflectionTransform).multiply(scene.getProjectionMatrix()); + // Add delta time. Prevent adding delta time if it hasn't changed. + var deltaTime = scene.getEngine().getDeltaTime(); + if (deltaTime !== this._lastDeltaTime) { + this._lastDeltaTime = deltaTime; + this._lastTime += this._lastDeltaTime; + } + this._activeEffect.setMatrix("worldReflectionViewProjection", wrvp); + this._activeEffect.setVector2("windDirection", this.windDirection); + this._activeEffect.setFloat("waveLength", this.waveLength); + this._activeEffect.setFloat("time", this._lastTime / 100000); + this._activeEffect.setFloat("windForce", this.windForce); + this._activeEffect.setFloat("waveHeight", this.waveHeight); + this._activeEffect.setFloat("bumpHeight", this.bumpHeight); + this._activeEffect.setColor4("waterColor", this.waterColor, 1.0); + this._activeEffect.setFloat("colorBlendFactor", this.colorBlendFactor); + this._activeEffect.setColor4("waterColor2", this.waterColor2, 1.0); + this._activeEffect.setFloat("colorBlendFactor2", this.colorBlendFactor2); + this._activeEffect.setFloat("waveSpeed", this.waveSpeed); + this._activeEffect.setFloat("waveCount", this.waveCount); + // image processing + if (this._imageProcessingConfiguration && !this._imageProcessingConfiguration.applyByPostProcess) { + this._imageProcessingConfiguration.bind(this._activeEffect); + } + this._afterBind(mesh, this._activeEffect); + }; + WaterMaterial.prototype._createRenderTargets = function (scene, renderTargetSize) { + var _this = this; + // Render targets + this._refractionRTT = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["RenderTargetTexture"](name + "_refraction", { width: renderTargetSize.x, height: renderTargetSize.y }, scene, false, true); + this._refractionRTT.wrapU = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Constants"].TEXTURE_MIRROR_ADDRESSMODE; + this._refractionRTT.wrapV = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Constants"].TEXTURE_MIRROR_ADDRESSMODE; + this._refractionRTT.ignoreCameraViewport = true; + this._reflectionRTT = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["RenderTargetTexture"](name + "_reflection", { width: renderTargetSize.x, height: renderTargetSize.y }, scene, false, true); + this._reflectionRTT.wrapU = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Constants"].TEXTURE_MIRROR_ADDRESSMODE; + this._reflectionRTT.wrapV = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Constants"].TEXTURE_MIRROR_ADDRESSMODE; + this._reflectionRTT.ignoreCameraViewport = true; + var isVisible; + var clipPlane = null; + var savedViewMatrix; + var mirrorMatrix = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Matrix"].Zero(); + this._refractionRTT.onBeforeRender = function () { + if (_this._mesh) { + isVisible = _this._mesh.isVisible; + _this._mesh.isVisible = false; + } + // Clip plane + if (!_this.disableClipPlane) { + clipPlane = scene.clipPlane; + var positiony = _this._mesh ? _this._mesh.position.y : 0.0; + scene.clipPlane = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Plane"].FromPositionAndNormal(new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Vector3"](0, positiony + 0.05, 0), new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Vector3"](0, 1, 0)); + } + }; + this._refractionRTT.onAfterRender = function () { + if (_this._mesh) { + _this._mesh.isVisible = isVisible; + } + // Clip plane + if (!_this.disableClipPlane) { + scene.clipPlane = clipPlane; + } + }; + this._reflectionRTT.onBeforeRender = function () { + if (_this._mesh) { + isVisible = _this._mesh.isVisible; + _this._mesh.isVisible = false; + } + // Clip plane + if (!_this.disableClipPlane) { + clipPlane = scene.clipPlane; + var positiony = _this._mesh ? _this._mesh.position.y : 0.0; + scene.clipPlane = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Plane"].FromPositionAndNormal(new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Vector3"](0, positiony - 0.05, 0), new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Vector3"](0, -1, 0)); + babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Matrix"].ReflectionToRef(scene.clipPlane, mirrorMatrix); + } + // Transform + savedViewMatrix = scene.getViewMatrix(); + mirrorMatrix.multiplyToRef(savedViewMatrix, _this._reflectionTransform); + scene.setTransformMatrix(_this._reflectionTransform, scene.getProjectionMatrix()); + scene.getEngine().cullBackFaces = false; + scene._mirroredCameraPosition = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Vector3"].TransformCoordinates(scene.activeCamera.position, mirrorMatrix); + }; + this._reflectionRTT.onAfterRender = function () { + if (_this._mesh) { + _this._mesh.isVisible = isVisible; + } + // Clip plane + scene.clipPlane = clipPlane; + // Transform + scene.setTransformMatrix(savedViewMatrix, scene.getProjectionMatrix()); + scene.getEngine().cullBackFaces = true; + scene._mirroredCameraPosition = null; + }; + }; + WaterMaterial.prototype.getAnimatables = function () { + var results = []; + if (this.bumpTexture && this.bumpTexture.animations && this.bumpTexture.animations.length > 0) { + results.push(this.bumpTexture); + } + if (this._reflectionRTT && this._reflectionRTT.animations && this._reflectionRTT.animations.length > 0) { + results.push(this._reflectionRTT); + } + if (this._refractionRTT && this._refractionRTT.animations && this._refractionRTT.animations.length > 0) { + results.push(this._refractionRTT); + } + return results; + }; + WaterMaterial.prototype.getActiveTextures = function () { + var activeTextures = _super.prototype.getActiveTextures.call(this); + if (this._bumpTexture) { + activeTextures.push(this._bumpTexture); + } + return activeTextures; + }; + WaterMaterial.prototype.hasTexture = function (texture) { + if (_super.prototype.hasTexture.call(this, texture)) { + return true; + } + if (this._bumpTexture === texture) { + return true; + } + return false; + }; + WaterMaterial.prototype.dispose = function (forceDisposeEffect) { + if (this.bumpTexture) { + this.bumpTexture.dispose(); + } + var index = this.getScene().customRenderTargets.indexOf(this._refractionRTT); + if (index != -1) { + this.getScene().customRenderTargets.splice(index, 1); + } + index = -1; + index = this.getScene().customRenderTargets.indexOf(this._reflectionRTT); + if (index != -1) { + this.getScene().customRenderTargets.splice(index, 1); + } + if (this._reflectionRTT) { + this._reflectionRTT.dispose(); + } + if (this._refractionRTT) { + this._refractionRTT.dispose(); + } + // Remove image-processing observer + if (this._imageProcessingConfiguration && this._imageProcessingObserver) { + this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver); + } + _super.prototype.dispose.call(this, forceDisposeEffect); + }; + WaterMaterial.prototype.clone = function (name) { + var _this = this; + return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Clone(function () { return new WaterMaterial(name, _this.getScene()); }, this); + }; + WaterMaterial.prototype.serialize = function () { + var serializationObject = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Serialize(this); + serializationObject.customType = "BABYLON.WaterMaterial"; + serializationObject.renderList = []; + if (this._refractionRTT && this._refractionRTT.renderList) { + for (var i = 0; i < this._refractionRTT.renderList.length; i++) { + serializationObject.renderList.push(this._refractionRTT.renderList[i].id); + } + } + return serializationObject; + }; + WaterMaterial.prototype.getClassName = function () { + return "WaterMaterial"; + }; + // Statics + WaterMaterial.Parse = function (source, scene, rootUrl) { + var mat = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Parse(function () { return new WaterMaterial(source.name, scene); }, source, scene, rootUrl); + mat._waitingRenderList = source.renderList; + return mat; + }; + WaterMaterial.CreateDefaultMesh = function (name, scene) { + var mesh = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Mesh"].CreateGround(name, 512, 512, 32, scene, false); + return mesh; + }; + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("bumpTexture") + ], WaterMaterial.prototype, "_bumpTexture", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty") + ], WaterMaterial.prototype, "bumpTexture", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsColor3"])() + ], WaterMaterial.prototype, "diffuseColor", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsColor3"])() + ], WaterMaterial.prototype, "specularColor", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])() + ], WaterMaterial.prototype, "specularPower", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])("disableLighting") + ], WaterMaterial.prototype, "_disableLighting", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsLightsDirty") + ], WaterMaterial.prototype, "disableLighting", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])("maxSimultaneousLights") + ], WaterMaterial.prototype, "_maxSimultaneousLights", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsLightsDirty") + ], WaterMaterial.prototype, "maxSimultaneousLights", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])() + ], WaterMaterial.prototype, "windForce", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsVector2"])() + ], WaterMaterial.prototype, "windDirection", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])() + ], WaterMaterial.prototype, "waveHeight", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])() + ], WaterMaterial.prototype, "bumpHeight", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])("bumpSuperimpose") + ], WaterMaterial.prototype, "_bumpSuperimpose", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsMiscDirty") + ], WaterMaterial.prototype, "bumpSuperimpose", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])("fresnelSeparate") + ], WaterMaterial.prototype, "_fresnelSeparate", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsMiscDirty") + ], WaterMaterial.prototype, "fresnelSeparate", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])("bumpAffectsReflection") + ], WaterMaterial.prototype, "_bumpAffectsReflection", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsMiscDirty") + ], WaterMaterial.prototype, "bumpAffectsReflection", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsColor3"])() + ], WaterMaterial.prototype, "waterColor", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])() + ], WaterMaterial.prototype, "colorBlendFactor", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsColor3"])() + ], WaterMaterial.prototype, "waterColor2", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])() + ], WaterMaterial.prototype, "colorBlendFactor2", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])() + ], WaterMaterial.prototype, "waveLength", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])() + ], WaterMaterial.prototype, "waveSpeed", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])() + ], WaterMaterial.prototype, "waveCount", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])() + ], WaterMaterial.prototype, "disableClipPlane", void 0); + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([ + Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])() + ], WaterMaterial.prototype, "useLogarithmicDepth", null); + return WaterMaterial; +}(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["PushMaterial"])); + +babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["_TypeStore"].RegisteredTypes["BABYLON.WaterMaterial"] = WaterMaterial; + + +/***/ }), + +/***/ "babylonjs/Misc/decorators": +/*!****************************************************************************************************!*\ + !*** external {"root":"BABYLON","commonjs":"babylonjs","commonjs2":"babylonjs","amd":"babylonjs"} ***! + \****************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = __WEBPACK_EXTERNAL_MODULE_babylonjs_Misc_decorators__; + +/***/ }) + +/******/ }); +}); +//# sourceMappingURL=babylonjs.materials.js.map \ No newline at end of file diff --git a/src/assets/js/serializers/babylonjs.serializers.min.js b/src/assets/js/serializers/babylonjs.serializers.min.js new file mode 100644 index 0000000..57b0f24 --- /dev/null +++ b/src/assets/js/serializers/babylonjs.serializers.min.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("babylonjs")):"function"==typeof define&&define.amd?define("babylonjs-serializers",["babylonjs"],t):"object"==typeof exports?exports["babylonjs-serializers"]=t(require("babylonjs")):e.SERIALIZERS=t(e.BABYLON)}("undefined"!=typeof self?self:"undefined"!=typeof global?global:this,(function(e){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.l=!0,a.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)r.d(n,a,function(t){return e[t]}.bind(null,a));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=16)}([function(t,r){t.exports=e},function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0),a=function(){function e(){}return e._CreateBufferView=function(e,t,r,n,a){var o={buffer:e,byteLength:r};return t&&(o.byteOffset=t),a&&(o.name=a),n&&(o.byteStride=n),o},e._CreateAccessor=function(e,t,r,n,a,o,i,s){var u={name:t,bufferView:e,componentType:n,count:a,type:r};return null!=i&&(u.min=i),null!=s&&(u.max=s),null!=o&&(u.byteOffset=o),u},e._CalculateMinMaxPositions=function(t,r,a,o){var i,s,u,l=[1/0,1/0,1/0],c=[-1/0,-1/0,-1/0];if(a)for(var f=r,h=r+a;fc[p]&&(c[p]=d),++i}}return{min:l,max:c}},e._GetRightHandedPositionVector3=function(e){return new n.Vector3(e.x,e.y,-e.z)},e._GetRightHandedPositionVector3FromRef=function(e){e.z*=-1},e._GetRightHandedPositionArray3FromRef=function(e){e[2]*=-1},e._GetRightHandedNormalVector3=function(e){return new n.Vector3(e.x,e.y,-e.z)},e._GetRightHandedNormalVector3FromRef=function(e){e.z*=-1},e._GetRightHandedNormalArray3FromRef=function(e){e[2]*=-1},e._GetRightHandedVector4FromRef=function(e){e.z*=-1,e.w*=-1},e._GetRightHandedArray4FromRef=function(e){e[2]*=-1,e[3]*=-1},e._GetRightHandedQuaternionFromRef=function(e){e.x*=-1,e.y*=-1},e._GetRightHandedQuaternionArrayFromRef=function(e){e[0]*=-1,e[1]*=-1},e._NormalizeTangentFromRef=function(e){var t=Math.sqrt(e.x*e.x+e.y*e.y+e.z*e.z);t>0&&(e.x/=t,e.y/=t,e.z/=t)},e._GetRightHandedMatrixFromRef=function(e){var t=e.m;n.Matrix.FromValuesToRef(t[0],t[1],-t[2],t[3],t[4],t[5],-t[6],t[7],-t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15],e)},e._GetDataAccessorElementCount=function(e){switch(e){case"MAT2":return 4;case"MAT3":return 9;case"MAT4":return 16;case"SCALAR":return 1;case"VEC2":return 2;case"VEC3":return 3;case"VEC4":return 4}},e}()},function(e,t,r){"use strict";r.d(t,"b",(function(){return u})),r.d(t,"a",(function(){return l}));Object.create;Object.create;var n=r(0),a=r(10),o=r(1),i=r(3),s=r(7),u=function(){function e(e,t){this._includeCoordinateSystemConversionNodes=!1,this._extensions={},this._glTF={asset:{generator:"BabylonJS",version:"2.0"}},this._babylonScene=e,this._bufferViews=[],this._accessors=[],this._meshes=[],this._scenes=[],this._nodes=[],this._images=[],this._materials=[],this._materialMap=[],this._textures=[],this._samplers=[],this._skins=[],this._animations=[],this._imageData={},this._orderedImageData=[],this._options=t||{},this._animationSampleRate=t&&t.animationSampleRate?t.animationSampleRate:1/60,this._includeCoordinateSystemConversionNodes=!(!t||!t.includeCoordinateSystemConversionNodes),this._glTFMaterialExporter=new a.a(this),this._loadExtensions()}return e.prototype._applyExtension=function(e,t,r,n){var a=this;if(r>=t.length)return Promise.resolve(e);var o=n(t[r],e);return o?o.then((function(e){return a._applyExtension(e,t,r+1,n)})):this._applyExtension(e,t,r+1,n)},e.prototype._applyExtensions=function(t,r){for(var n=[],a=0,o=e._ExtensionNames;a=f;--i)o.setUInt32(r[i],a),a+=4;break;case n.Material.TriangleStripDrawMode:e.indexCount>=3&&(o.setUInt32(r[e.indexStart+2],a+4),o.setUInt32(r[e.indexStart+1],a+8))}},e.prototype.reorderVertexAttributeDataBasedOnPrimitiveMode=function(e,t,r,a,o,i,s,u){if(u&&r===n.Material.ClockWiseSideOrientation)switch(t){case n.Material.TriangleFillMode:this.reorderTriangleFillMode(e,t,r,a,o,i,s,u);break;case n.Material.TriangleStripDrawMode:this.reorderTriangleStripDrawMode(e,t,r,a,o,i,s,u);break;case n.Material.TriangleFanDrawMode:this.reorderTriangleFanMode(e,t,r,a,o,i,s,u)}},e.prototype.reorderTriangleFillMode=function(e,t,r,a,o,i,s,u){var l=this.getVertexBufferFromMesh(a,e.getMesh());if(l){var c=l.byteStride/n.VertexBuffer.GetTypeByteLength(l.type);if(e.verticesCount%3!=0)n.Tools.Error("The submesh vertices for the triangle fill mode is not divisible by 3!");else{var f=[],h=0;switch(a){case n.VertexBuffer.PositionKind:case n.VertexBuffer.NormalKind:for(var p=e.verticesStart;p=e.verticesStart;--p)h=p*c,f.push(n.Vector4.FromArray(o,h));break;case n.VertexBuffer.ColorKind:for(p=e.verticesStart+e.verticesCount-1;p>=e.verticesStart;--p)h=p*c,4===l.getSize()?f.push(n.Vector4.FromArray(o,h)):f.push(n.Vector3.FromArray(o,h));break;case n.VertexBuffer.UVKind:case n.VertexBuffer.UV2Kind:for(p=e.verticesStart+e.verticesCount-1;p>=e.verticesStart;--p)h=p*c,f.push(n.Vector2.FromArray(o,h));break;default:n.Tools.Error("Unsupported Vertex Buffer type: "+a)}this.writeVertexAttributeData(f,i+12,a,o,s,u)}else n.Tools.Warn("reorderTriangleStripDrawMode: Vertex buffer kind "+a+" not present!")},e.prototype.reorderTriangleFanMode=function(e,t,r,a,o,i,s,u){var l=this.getVertexBufferFromMesh(a,e.getMesh());if(l){var c=l.byteStride/n.VertexBuffer.GetTypeByteLength(l.type),f=[],h=0;switch(a){case n.VertexBuffer.PositionKind:case n.VertexBuffer.NormalKind:for(var p=e.verticesStart+e.verticesCount-1;p>=e.verticesStart;--p)h=p*c,f.push(n.Vector3.FromArray(o,h));break;case n.VertexBuffer.TangentKind:for(p=e.verticesStart+e.verticesCount-1;p>=e.verticesStart;--p)h=p*c,f.push(n.Vector4.FromArray(o,h));break;case n.VertexBuffer.ColorKind:for(p=e.verticesStart+e.verticesCount-1;p>=e.verticesStart;--p)h=p*c,f.push(n.Vector4.FromArray(o,h)),4===l.getSize()?f.push(n.Vector4.FromArray(o,h)):f.push(n.Vector3.FromArray(o,h));break;case n.VertexBuffer.UVKind:case n.VertexBuffer.UV2Kind:for(p=e.verticesStart+e.verticesCount-1;p>=e.verticesStart;--p)h=p*c,f.push(n.Vector2.FromArray(o,h));break;default:n.Tools.Error("Unsupported Vertex Buffer type: "+a)}this.writeVertexAttributeData(f,i,a,o,s,u)}else n.Tools.Warn("reorderTriangleFanMode: Vertex buffer kind "+a+" not present!")},e.prototype.writeVertexAttributeData=function(e,t,r,a,i,s){for(var u=0,l=e;u0){var k=null!==c.overrideMaterialSideOrientation?c.overrideMaterialSideOrientation:V.sideOrientation;if(k==n.Material.ClockWiseSideOrientation&&this._babylonScene.useRightHandedSystem||k==n.Material.ClockWiseSideOrientation&&a&&c.overrideMaterialSideOrientation!==(null===(i=c.material)||void 0===i?void 0:i.sideOrientation)){var K=null!=h?this._bufferViews[h].byteOffset:null;null==K&&(K=0);var D=null;if(null!=h&&(D=c.getIndices()),D)this.reorderIndicesBasedOnPrimitiveMode(R,p,D,K,r);else for(var U=0,H=f;Un.Epsilon)return!1;return!(e instanceof n.Mesh&&null!==e.geometry||e instanceof n.InstancedMesh&&null!==e.sourceMesh.geometry)&&!this._includeCoordinateSystemConversionNodes}return!1},e.prototype.createSceneAsync=function(e,t){var r,a,o,i=this,s={nodes:[]},u=function(){for(var e=0,t=0,r=arguments.length;t0){i.weights=[];for(var u=0;u-1&&(c[h]=g),f=Math.max(f,h)}for(var m=0;m<=f;++m){var g,_=(g=c[m]).getTransformNode();if(_){var x=g.getInvertedAbsoluteTransform();s._convertToRightHandedSystem&&o.a._GetRightHandedMatrixFromRef(x),u.push(x),i.joints.push(t[_.uniqueId])}}var y=64*u.length,T=r.getByteOffset(),v=o.a._CreateBufferView(0,T,y,64,"InverseBindMatrices - "+n.name);s._bufferViews.push(v);var b=s._bufferViews.length-1,A=o.a._CreateAccessor(b,"InverseBindMatrices - "+n.name,"MAT4",5126,u.length,null,null,null),F=s._accessors.push(A)-1;i.inverseBindMatrices=F,s._skins.push(i),a[n.uniqueId]=s._skins.length-1,u.forEach((function(e){e.m.forEach((function(e){r.setFloat32(e)}))}))},s=this,u=0,l=e.skeletons;uthis._arrayBuffer.byteLength&&this.resizeBuffer(2*this._arrayBuffer.byteLength),this._dataView.setUint8(this._byteOffset,e),this._byteOffset+=1)},e.prototype.setUInt16=function(e,t){null!=t?tthis._arrayBuffer.byteLength&&this.resizeBuffer(2*this._arrayBuffer.byteLength),this._dataView.setUint16(this._byteOffset,e,!0),this._byteOffset+=2)},e.prototype.getUInt32=function(e){if(ethis._byteOffset?n.Tools.Error("BinaryWriter: byteoffset is greater than the current binary buffer length!"):(e.x=this._dataView.getFloat32(t,!0),e.y=this._dataView.getFloat32(t+4,!0),e.z=this._dataView.getFloat32(t+8,!0))},e.prototype.setVector3Float32FromRef=function(e,t){t+8>this._byteOffset?n.Tools.Error("BinaryWriter: byteoffset is greater than the current binary buffer length!"):(this._dataView.setFloat32(t,e.x,!0),this._dataView.setFloat32(t+4,e.y,!0),this._dataView.setFloat32(t+8,e.z,!0))},e.prototype.getVector4Float32FromRef=function(e,t){t+12>this._byteOffset?n.Tools.Error("BinaryWriter: byteoffset is greater than the current binary buffer length!"):(e.x=this._dataView.getFloat32(t,!0),e.y=this._dataView.getFloat32(t+4,!0),e.z=this._dataView.getFloat32(t+8,!0),e.w=this._dataView.getFloat32(t+12,!0))},e.prototype.setVector4Float32FromRef=function(e,t){t+12>this._byteOffset?n.Tools.Error("BinaryWriter: byteoffset is greater than the current binary buffer length!"):(this._dataView.setFloat32(t,e.x,!0),this._dataView.setFloat32(t+4,e.y,!0),this._dataView.setFloat32(t+8,e.z,!0),this._dataView.setFloat32(t+12,e.w,!0))},e.prototype.setFloat32=function(e,t){isNaN(e)&&n.Tools.Error("Invalid data being written!"),null!=t&&(tthis._arrayBuffer.byteLength&&this.resizeBuffer(2*this._arrayBuffer.byteLength),this._dataView.setFloat32(this._byteOffset,e,!0),this._byteOffset+=4},e.prototype.setUInt32=function(e,t){null!=t?tthis._arrayBuffer.byteLength&&this.resizeBuffer(2*this._arrayBuffer.byteLength),this._dataView.setUint32(this._byteOffset,e,!0),this._byteOffset+=4)},e}()},function(e,t,r){"use strict";r.r(t),r.d(t,"GLTFData",(function(){return n}));var n=function(){function e(){this.glTFFiles={}}return e.prototype.downloadFiles=function(){function e(e,t){return-1!==e.indexOf(t,e.length-t.length)}for(var t in this.glTFFiles){var r=document.createElement("a");document.body.appendChild(r),r.setAttribute("type","hidden"),r.download=t;var n=this.glTFFiles[t],a=void 0;e(t,".glb")?a={type:"model/gltf-binary"}:e(t,".bin")?a={type:"application/octet-stream"}:e(t,".gltf")?a={type:"model/gltf+json"}:e(t,".jpeg")?a={type:"image/jpeg"}:e(t,".png")&&(a={type:"image/png"}),r.href=window.URL.createObjectURL(new Blob([n],a)),r.click()}},e}()},function(e,t,r){"use strict";r.r(t),r.d(t,"__IGLTFExporterExtension",(function(){return n}));var n=0},function(e,t,r){"use strict";r.r(t),r.d(t,"OBJExport",(function(){return a}));var n=r(0),a=function(){function e(){}return e.OBJ=function(e,t,r,a){var o=[],i=1;t&&(r||(r="mat"),o.push("mtllib "+r+".mtl"));for(var s=0;s0;)E=A.inputs.shift(),F%m==0&&M.push(E),F++;A.inputs=M}var R=u[n.uniqueId],V=4*A.inputs.length;g=o.a._CreateBufferView(0,l.getByteOffset(),V,void 0,t+" keyframe data view"),c.push(g),A.inputs.forEach((function(e){l.setFloat32(e)})),_=o.a._CreateAccessor(c.length-1,t+" keyframes","SCALAR",5126,A.inputs.length,null,[A.inputsMin],[A.inputsMax]),f.push(_),x=f.length-1,T=A.outputs.length,V=4*o.a._GetDataAccessorElementCount(i)*A.outputs.length,g=o.a._CreateBufferView(0,l.getByteOffset(),V,void 0,t+" data view"),c.push(g),A.outputs.forEach((function(e){e.forEach((function(e){l.setFloat32(e)}))})),_=o.a._CreateAccessor(c.length-1,t+" data",i,5126,T,null,null,null),f.push(_),y=f.length-1,v={interpolation:A.samplerInterpolation,input:x,output:y},r.samplers.push(v),b={sampler:r.samplers.length-1,target:{node:R,path:s}},r.channels.push(b)}},e._CreateBakedAnimation=function(t,r,n,o,i,s,u,l,c,f,h,p){var d,m,g=a.Quaternion.Identity(),_=null,x=null,y=null,T=null,v=null,b=null;f.min=a.Tools.FloatRound(o/s);for(var A=r.getKeys(),F=0,E=A.length;F-1&&(this._textureInfos[n]=t)},e.prototype.postExportMaterialAdditionalTextures=function(e,t,r){return r instanceof n.PBRMaterial&&r.sheen.isEnabled&&r.sheen.texture?(this._exportedTextures.push(r.sheen.texture),[r.sheen.texture]):[]},e.prototype.postExportMaterialAsync=function(e,t,r){var a=this;return new Promise((function(e,o){var i;if(r instanceof n.PBRMaterial){if(!r.sheen.isEnabled)return void e(t);a._wasUsed=!0,null==t.extensions&&(t.extensions={});var s={sheenColorFactor:r.sheen.color.asArray(),sheenRoughnessFactor:null!==(i=r.sheen.roughness)&&void 0!==i?i:0};if(r.sheen.texture)(u=a._getTextureIndex(r.sheen.texture))>-1&&(s.sheenColorTexture=a._textureInfos[u]);if(r.sheen.textureRoughness&&!r.sheen.useRoughnessFromMainTexture)(u=a._getTextureIndex(r.sheen.textureRoughness))>-1&&(s.sheenRoughnessTexture=a._textureInfos[u]);else if(r.sheen.texture&&r.sheen.useRoughnessFromMainTexture){var u;(u=a._getTextureIndex(r.sheen.texture))>-1&&(s.sheenRoughnessTexture=a._textureInfos[u])}t.extensions.KHR_materials_sheen=s}e(t)}))},e}();a.b.RegisterExtension("KHR_materials_sheen",(function(e){return new c(e)}));var f=function(){function e(e){this.name="KHR_materials_unlit",this.enabled=!0,this.required=!1,this._wasUsed=!1}return Object.defineProperty(e.prototype,"wasUsed",{get:function(){return this._wasUsed},enumerable:!1,configurable:!0}),e.prototype.dispose=function(){},e.prototype.postExportMaterialAsync=function(e,t,r){var a=this;return new Promise((function(e,o){var i=!1;r instanceof n.PBRMaterial?i=r.unlit:r instanceof n.StandardMaterial&&(i=r.disableLighting),i&&(a._wasUsed=!0,null==t.extensions&&(t.extensions={}),t.extensions.KHR_materials_unlit={}),e(t)}))},e}();a.b.RegisterExtension("KHR_materials_unlit",(function(e){return new f(e)}))},function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0),a=function(){function e(e){this._textureMap={},this._textureMap={},this._exporter=e}return e.FuzzyEquals=function(e,t,r){return n.Scalar.WithinEpsilon(e.r,t.r,r)&&n.Scalar.WithinEpsilon(e.g,t.g,r)&&n.Scalar.WithinEpsilon(e.b,t.b,r)},e.prototype._convertMaterialsToGLTFAsync=function(e,t,r){for(var a=[],o=0,i=e;os.width?(o=t&&t instanceof n.Texture?n.TextureTools.CreateResizedCopy(t,i.width,i.height,!0):this._createWhiteTexture(i.width,i.height,r),a=e):(a=e,o=t),{texture1:a,texture2:o}},e.prototype._convertPixelArrayToFloat32=function(e){if(e instanceof Uint8Array){for(var t=e.length,r=new Float32Array(e.length),n=0;ne._Epsilon?R.baseColor.r:1,x[S+1]/=R.baseColor.g>e._Epsilon?R.baseColor.g:1,x[S+2]/=R.baseColor.b>e._Epsilon?R.baseColor.b:1;var C=n.Color3.FromInts(x[S],x[S+1],x[S+2]).toGammaSpace();x[S]=255*C.r,x[S+1]=255*C.g,x[S+2]=255*C.b,e.FuzzyEquals(C,n.Color3.White(),e._Epsilon)||(w=!0),_[S+1]/=R.roughness>e._Epsilon?R.roughness:1,_[S+2]/=R.metallic>e._Epsilon?R.metallic:1;var B=n.Color3.FromInts(255,_[S+1],_[S+2]);e.FuzzyEquals(B,n.Color3.White(),e._Epsilon)||(V=!0)}if(V){var I=this._createBase64FromCanvasAsync(_,h,p,o).then((function(e){R.metallicRoughnessTextureBase64=e}));i.push(I)}if(w){I=this._createBase64FromCanvasAsync(x,h,p,o).then((function(e){R.baseColorTextureBase64=e}));i.push(I)}return Promise.all(i).then((function(){return R}))}return Promise.reject("_ConvertSpecularGlossinessTexturesToMetallicRoughness: Scene from textures is missing!")},e.prototype._convertSpecularGlossinessToMetallicRoughness=function(t){var r=this._getPerceivedBrightness(t.diffuseColor),a=this._getPerceivedBrightness(t.specularColor),o=1-this._getMaxComponent(t.specularColor),i=e._SolveMetallic(r,a,o),s=t.diffuseColor.scale(o/(1-e._DielectricSpecular.r)/Math.max(1-i,e._Epsilon)),u=t.specularColor.subtract(e._DielectricSpecular.scale(1-i)).scale(1/Math.max(i,e._Epsilon)),l=n.Color3.Lerp(s,u,i*i);return{baseColor:l=l.clampToRef(0,1,l),metallic:i,roughness:1-t.glossiness}},e.prototype._getPerceivedBrightness=function(e){return e?Math.sqrt(.299*e.r*e.r+.587*e.g*e.g+.114*e.b*e.b):0},e.prototype._getMaxComponent=function(e){return e?Math.max(e.r,Math.max(e.g,e.b)):0},e.prototype._convertMetalRoughFactorsToMetallicRoughnessAsync=function(e,t,r,n){var a=[],o={baseColor:e.albedoColor,metallic:e.metallic,roughness:e.roughness};return n&&(e.albedoTexture&&a.push(this._exportTextureAsync(e.albedoTexture,t).then((function(e){e&&(r.baseColorTexture=e)}))),e.metallicTexture&&a.push(this._exportTextureAsync(e.metallicTexture,t).then((function(e){e&&(r.metallicRoughnessTexture=e)})))),Promise.all(a).then((function(){return o}))},e.prototype._getGLTFTextureSampler=function(e){var t=this._getGLTFTextureWrapModesSampler(e),r=e instanceof n.Texture?e.samplingMode:null;if(null!=r)switch(r){case n.Texture.LINEAR_LINEAR:t.magFilter=9729,t.minFilter=9729;break;case n.Texture.LINEAR_NEAREST:t.magFilter=9729,t.minFilter=9728;break;case n.Texture.NEAREST_LINEAR:t.magFilter=9728,t.minFilter=9729;break;case n.Texture.NEAREST_LINEAR_MIPLINEAR:t.magFilter=9728,t.minFilter=9987;break;case n.Texture.NEAREST_NEAREST:t.magFilter=9728,t.minFilter=9728;break;case n.Texture.NEAREST_LINEAR_MIPNEAREST:t.magFilter=9728,t.minFilter=9985;break;case n.Texture.LINEAR_NEAREST_MIPNEAREST:t.magFilter=9729,t.minFilter=9984;break;case n.Texture.LINEAR_NEAREST_MIPLINEAR:t.magFilter=9729,t.minFilter=9986;break;case n.Texture.NEAREST_NEAREST_MIPLINEAR:t.magFilter=9728,t.minFilter=9986;break;case n.Texture.LINEAR_LINEAR_MIPLINEAR:t.magFilter=9729,t.minFilter=9987;break;case n.Texture.LINEAR_LINEAR_MIPNEAREST:t.magFilter=9729,t.minFilter=9985;break;case n.Texture.NEAREST_NEAREST_MIPNEAREST:t.magFilter=9728,t.minFilter=9984}return t},e.prototype._getGLTFTextureWrapMode=function(e){switch(e){case n.Texture.WRAP_ADDRESSMODE:return 10497;case n.Texture.CLAMP_ADDRESSMODE:return 33071;case n.Texture.MIRROR_ADDRESSMODE:return 33648;default:return n.Tools.Error("Unsupported Texture Wrap Mode "+e+"!"),10497}},e.prototype._getGLTFTextureWrapModesSampler=function(e){var t=this._getGLTFTextureWrapMode(e instanceof n.Texture?e.wrapU:n.Texture.WRAP_ADDRESSMODE),r=this._getGLTFTextureWrapMode(e instanceof n.Texture?e.wrapV:n.Texture.WRAP_ADDRESSMODE);return 10497===t&&10497===r?{}:{wrapS:t,wrapT:r}},e.prototype._convertSpecGlossFactorsToMetallicRoughnessAsync=function(e,t,r,a){var o=this;return Promise.resolve().then((function(){var i=o._exporter._samplers,s=o._exporter._textures,u={diffuseColor:e.albedoColor||n.Color3.White(),specularColor:e.reflectivityColor||n.Color3.White(),glossiness:e.microSurface||1},l=null,c=o._getGLTFTextureSampler(e.albedoTexture);return null!=c.magFilter&&null!=c.minFilter&&null!=c.wrapS&&null!=c.wrapT&&(i.push(c),l=i.length-1),e.reflectivityTexture&&!e.useMicroSurfaceFromReflectivityMapAlpha?Promise.reject("_ConvertPBRMaterial: Glossiness values not included in the reflectivity texture are currently not supported"):(e.albedoTexture||e.reflectivityTexture)&&a?o._convertSpecularGlossinessTexturesToMetallicRoughnessAsync(e.albedoTexture,e.reflectivityTexture,u,t).then((function(n){if(n.baseColorTextureBase64){var a=o._getTextureInfoFromBase64(n.baseColorTextureBase64,"bjsBaseColorTexture_"+s.length+".png",t,e.albedoTexture?e.albedoTexture.coordinatesIndex:null,l);a&&(r.baseColorTexture=a)}if(n.metallicRoughnessTextureBase64){var i=o._getTextureInfoFromBase64(n.metallicRoughnessTextureBase64,"bjsMetallicRoughnessTexture_"+s.length+".png",t,e.reflectivityTexture?e.reflectivityTexture.coordinatesIndex:null,l);i&&(r.metallicRoughnessTexture=i)}return n})):o._convertSpecularGlossinessToMetallicRoughness(u)}))},e.prototype._convertPBRMaterialAsync=function(e,t,r){var n=this,a={},o={name:e.name};return e.isMetallicWorkflow()?(e.albedoColor&&(a.baseColorFactor=[e.albedoColor.r,e.albedoColor.g,e.albedoColor.b,e.alpha]),this._convertMetalRoughFactorsToMetallicRoughnessAsync(e,t,a,r).then((function(i){return n.setMetallicRoughnessPbrMaterial(i,e,o,a,t,r)}))):this._convertSpecGlossFactorsToMetallicRoughnessAsync(e,t,a,r).then((function(i){return n.setMetallicRoughnessPbrMaterial(i,e,o,a,t,r)}))},e.prototype.setMetallicRoughnessPbrMaterial=function(t,r,a,o,i,s){var u=this._exporter._materialMap,l=this._exporter._materials,c=[];if(t){if(e._SetAlphaMode(a,r),e.FuzzyEquals(t.baseColor,n.Color3.White(),e._Epsilon)&&r.alpha>=e._Epsilon||(o.baseColorFactor=[t.baseColor.r,t.baseColor.g,t.baseColor.b,r.alpha]),null!=t.metallic&&1!==t.metallic&&(o.metallicFactor=t.metallic),null!=t.roughness&&1!==t.roughness&&(o.roughnessFactor=t.roughness),null==r.backFaceCulling||r.backFaceCulling||(r.twoSidedLighting||n.Tools.Warn(r.name+": Back-face culling enabled and two-sided lighting disabled is not supported in glTF."),a.doubleSided=!0),s){if(r.bumpTexture){var f=this._exportTextureAsync(r.bumpTexture,i).then((function(e){e&&(a.normalTexture=e,1!==r.bumpTexture.level&&(a.normalTexture.scale=r.bumpTexture.level))}));c.push(f)}if(r.ambientTexture){f=this._exportTextureAsync(r.ambientTexture,i).then((function(e){if(e){var t={index:e.index,texCoord:e.texCoord};a.occlusionTexture=t,r.ambientTextureStrength&&(t.strength=r.ambientTextureStrength)}}));c.push(f)}if(r.emissiveTexture){f=this._exportTextureAsync(r.emissiveTexture,i).then((function(e){e&&(a.emissiveTexture=e)}));c.push(f)}}e.FuzzyEquals(r.emissiveColor,n.Color3.Black(),e._Epsilon)||(a.emissiveFactor=r.emissiveColor.asArray()),a.pbrMetallicRoughness=o,l.push(a),u[r.uniqueId]=l.length-1}return this._finishMaterial(c,a,r,i)},e.prototype.getPixelsFromTexture=function(e){return e.textureType,n.Constants.TEXTURETYPE_UNSIGNED_INT,e.readPixels()},e.prototype._exportTextureAsync=function(e,t){var r=this,n=this._exporter._extensionsPreExportTextureAsync("exporter",e,t);return n?n.then((function(n){return n?r._exportTextureInfoAsync(n,t):r._exportTextureInfoAsync(e,t)})):this._exportTextureInfoAsync(e,t)},e.prototype._exportTextureInfoAsync=function(e,t){var r=this;return Promise.resolve().then((function(){var n=e.uid;if(n in r._textureMap)return r._textureMap[n];var a=r.getPixelsFromTexture(e);if(!a)return null;for(var o=r._exporter._samplers,i=r._getGLTFTextureSampler(e),s=null,u=null,l=0;l-1||(l.GLTF2.Exporter[f]=s[f])}}.call(this,r(11))},function(e,t,r){"use strict";r.r(t),function(e){var n=r(5);r.d(t,"OBJExport",(function(){return n.OBJExport}));var a=void 0!==e?e:"undefined"!=typeof window?window:void 0;if(void 0!==a)for(var o in n)a.BABYLON[o]=n[o]}.call(this,r(11))},function(e,t,r){"use strict";(function(e){var n=r(12);r.d(t,"a",(function(){return n.STLExport}));var a=void 0!==e?e:"undefined"!=typeof window?window:void 0;if(void 0!==a)for(var o in n)a.BABYLON[o]=n[o]}).call(this,r(11))},function(e,t,r){"use strict";r.r(t),r.d(t,"__IGLTFExporterExtension",(function(){return n.__IGLTFExporterExtension})),r.d(t,"_GLTFAnimation",(function(){return n._GLTFAnimation})),r.d(t,"GLTFData",(function(){return n.GLTFData})),r.d(t,"_Exporter",(function(){return n._Exporter})),r.d(t,"_BinaryWriter",(function(){return n._BinaryWriter})),r.d(t,"__IGLTFExporterExtensionV2",(function(){return n.__IGLTFExporterExtensionV2})),r.d(t,"_GLTFMaterialExporter",(function(){return n._GLTFMaterialExporter})),r.d(t,"GLTF2Export",(function(){return n.GLTF2Export})),r.d(t,"_GLTFUtilities",(function(){return n._GLTFUtilities})),r.d(t,"KHR_texture_transform",(function(){return n.KHR_texture_transform})),r.d(t,"KHR_lights_punctual",(function(){return n.KHR_lights_punctual})),r.d(t,"KHR_materials_sheen",(function(){return n.KHR_materials_sheen})),r.d(t,"KHR_materials_unlit",(function(){return n.KHR_materials_unlit})),r.d(t,"OBJExport",(function(){return a.OBJExport})),r.d(t,"STLExport",(function(){return o.a}));r(5),r(4),r(6),r(12);var n=r(13),a=r(14),o=r(15)}])})); \ No newline at end of file diff --git a/src/assets/js/zstddec.wasm b/src/assets/js/zstddec.wasm new file mode 100644 index 0000000..181bd3d Binary files /dev/null and b/src/assets/js/zstddec.wasm differ