(window.webpackJsonpNVIV=window.webpackJsonpNVIV||[]).push([[10],{1670:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),r=(n(1928),n(1928)),i=n(125);o.enableProdMode(),t.bootstrapApp=function(){return i.platformBrowser().bootstrapModule(r.MainModule)}},1692:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),r=n(210),i=n(0),a=function(){function e(e,t){this.renderer=e,this.el=t}return e.prototype.ngAfterViewInit=function(){var e=this.el.nativeElement.attributes.getNamedItem("src").value,t=r.makeUrlAbsolute(e);this.renderer.setAttribute(this.el.nativeElement,"src",t)},e.ɵfac=function(t){return new(t||e)(i.ɵɵdirectiveInject(i.Renderer2),i.ɵɵdirectiveInject(i.ElementRef))},e.ɵdir=i.ɵɵdefineDirective({type:e,selectors:[["img"]]}),e}();t.AddBaseUrlDirective=a,i.ɵsetClassMetadata(a,[{type:o.Directive,args:[{selector:"img"}]}],function(){return[{type:i.Renderer2},{type:i.ElementRef}]},null)},1693:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(8),r=n(230),i=n(0),a=function(){function e(e,t,n){this.loader=e,this.injector=t,this.vcr=n}return e.prototype.ngOnInit=function(){this.loadComponent().catch(o.handleWarning)},e.prototype.loadComponent=function(){var e=this;return r.runWithBaseHref(function(){return e.loader.load(e.modulePath).then(function(t){var n=t.create(e.injector),o=n.injector.get(e.componentId),r=n.componentFactoryResolver.resolveComponentFactory(o);return e.vcr.createComponent(r)})})},e.ɵfac=function(t){return new(t||e)(i.ɵɵdirectiveInject(i.NgModuleFactoryLoader),i.ɵɵdirectiveInject(i.Injector),i.ɵɵdirectiveInject(i.ViewContainerRef))},e.ɵdir=i.ɵɵdefineDirective({type:e}),e}();t.AbstractLazyComponent=a},1696:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,r=n(0),i=n(168),a=n(440),s=n(3),c=n(625),l=n(1707),u=n(0),p=n(440),d=n(3),h=n(1689),f=n(625);function m(e,t){if(1&e&&(u.ɵɵelementStart(0,"p"),u.ɵɵtext(1),u.ɵɵelementEnd()),2&e){var n=u.ɵɵnextContext();u.ɵɵadvance(1),u.ɵɵtextInterpolate(n.bodyText)}}function g(e,t){1&e&&u.ɵɵelementContainer(0)}function v(e,t){if(1&e){var n=u.ɵɵgetCurrentView();u.ɵɵelementStart(0,"button",6),u.ɵɵlistener("click",function(){return u.ɵɵrestoreView(n),u.ɵɵnextContext().cancel()}),u.ɵɵtext(1),u.ɵɵelementEnd()}if(2&e){var o=u.ɵɵnextContext();u.ɵɵadvance(1),u.ɵɵtextInterpolate1(" ",o.cancelButtonText," ")}}function y(e,t){if(1&e){var n=u.ɵɵgetCurrentView();u.ɵɵelementStart(0,"button",6),u.ɵɵlistener("click",function(){return u.ɵɵrestoreView(n),u.ɵɵnextContext().decline()}),u.ɵɵtext(1),u.ɵɵelementEnd()}if(2&e){var o=u.ɵɵnextContext();u.ɵɵadvance(1),u.ɵɵtextInterpolate1(" ",o.declineButtonText," ")}}function M(e,t){if(1&e){var n=u.ɵɵgetCurrentView();u.ɵɵelementStart(0,"button",7),u.ɵɵlistener("click",function(){return u.ɵɵrestoreView(n),u.ɵɵnextContext().confirm()}),u.ɵɵtext(1),u.ɵɵelementEnd()}if(2&e){var o=u.ɵɵnextContext();u.ɵɵproperty("color",o.confirmButtonColor),u.ɵɵadvance(1),u.ɵɵtextInterpolate1(" ",o.confirmButtonText," ")}}!function(e){e[e.CONFIRMED=0]="CONFIRMED",e[e.DECLINED=1]="DECLINED",e[e.CANCELLED=2]="CANCELLED"}(o=t.AlertDialogResult||(t.AlertDialogResult={}));var C=function(){function e(e,t){var n;this.dialogRef=e,this.data=t,this.confirmButtonColor="primary",this.data&&(this.title=t.title,this.confirmButtonColor=null!==(n=t.confirmButtonColor)&&void 0!==n?n:"primary",t.body instanceof r.TemplateRef?this.bodyTemplate=t.body:"string"==typeof t.body&&(this.bodyText=t.body),!1!==t.cancelButton&&(this.cancelButtonText=t.cancelButton?""+t.cancelButton:i.translate("Cancel")),!1!==t.declineButton&&(this.declineButtonText=t.declineButton?""+t.declineButton:i.translate("Decline")),!1!==t.confirmButton&&(this.confirmButtonText=t.confirmButton?""+t.confirmButton:i.translate("Confirm")))}return e.prototype.beforeUnload=function(e){e.returnValue=i.translate("Do you want to navigate away from the current page?")},e.prototype.confirm=function(){this.dialogRef.close(o.CONFIRMED)},e.prototype.decline=function(){this.dialogRef.close(o.DECLINED)},e.prototype.cancel=function(){this.dialogRef.close(o.CANCELLED)},e.ɵfac=function(t){return new(t||e)(u.ɵɵdirectiveInject(p.MatDialogRef),u.ɵɵdirectiveInject(a.MAT_DIALOG_DATA))},e.ɵcmp=u.ɵɵdefineComponent({type:e,selectors:[["alert-dialog"]],hostBindings:function(e,t){1&e&&u.ɵɵlistener("beforeunload",function(e){return t.beforeUnload(e)},!1,u.ɵɵresolveWindow)},decls:10,vars:6,consts:[["mat-dialog-title",""],[4,"ngIf"],[4,"ngTemplateOutlet"],["mat-stroked-button","",3,"click",4,"ngIf"],["fxFlex","1 1 auto"],["mat-flat-button","",3,"color","click",4,"ngIf"],["mat-stroked-button","",3,"click"],["mat-flat-button","",3,"color","click"]],template:function(e,t){1&e&&(u.ɵɵelementStart(0,"h4",0),u.ɵɵtext(1),u.ɵɵelementEnd(),u.ɵɵelementStart(2,"mat-dialog-content"),u.ɵɵtemplate(3,m,2,1,"p",1),u.ɵɵtemplate(4,g,1,0,"ng-container",2),u.ɵɵelementEnd(),u.ɵɵelementStart(5,"mat-dialog-actions"),u.ɵɵtemplate(6,v,2,1,"button",3),u.ɵɵelement(7,"div",4),u.ɵɵtemplate(8,y,2,1,"button",3),u.ɵɵtemplate(9,M,2,2,"button",5),u.ɵɵelementEnd()),2&e&&(u.ɵɵadvance(1),u.ɵɵtextInterpolate(t.title),u.ɵɵadvance(2),u.ɵɵproperty("ngIf",t.bodyText),u.ɵɵadvance(1),u.ɵɵproperty("ngTemplateOutlet",t.bodyTemplate),u.ɵɵadvance(2),u.ɵɵproperty("ngIf",t.cancelButtonText),u.ɵɵadvance(2),u.ɵɵproperty("ngIf",t.declineButtonText),u.ɵɵadvance(1),u.ɵɵproperty("ngIf",t.confirmButtonText))},directives:[p.MatDialogTitle,p.MatDialogContent,d.NgIf,d.NgTemplateOutlet,p.MatDialogActions,h.DefaultFlexDirective,f.MatButton],encapsulation:2}),e}();t.AlertDialogComponent=C,u.ɵsetClassMetadata(C,[{type:r.Component,args:[{selector:"alert-dialog",templateUrl:"./AlertDialog.ng.html"}]}],function(){return[{type:p.MatDialogRef},{type:void 0,decorators:[{type:r.Inject,args:[a.MAT_DIALOG_DATA]}]}]},{beforeUnload:[{type:r.HostListener,args:["window:beforeunload",["$event"]]}]});var w=function(){function e(){}return e.ɵmod=u.ɵɵdefineNgModule({type:e}),e.ɵinj=u.ɵɵdefineInjector({factory:function(t){return new(t||e)},imports:[[s.CommonModule,l.FlexLayoutModule,a.MatDialogModule,c.MatButtonModule]]}),e}();t.AlertDialogModule=w,("undefined"==typeof ngJitMode||ngJitMode)&&u.ɵɵsetNgModuleScope(w,{declarations:[C],imports:[s.CommonModule,l.FlexLayoutModule,a.MatDialogModule,c.MatButtonModule],exports:[C]}),u.ɵsetClassMetadata(w,[{type:r.NgModule,args:[{imports:[s.CommonModule,l.FlexLayoutModule,a.MatDialogModule,c.MatButtonModule],declarations:[C],exports:[C]}]}],null,null)},1697:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),r=n(624),i=n(2),a=n(6),s=n(3),c=n(0),l=function(){function e(e){this.ElementRef=e,this.valueChange=new o.EventEmitter,this.disabled=!1,this.ident=void 0}return e.prototype.ngOnInit=function(){this.ident=this.ElementRef.nativeElement.getAttribute("id"),this.ElementRef.nativeElement.setAttribute("id",void 0)},e.prototype.registerOnChange=function(e){this.changeFn=e},e.prototype.registerOnTouched=function(e){this.touchFn=e},e.prototype.setDisabledState=function(e){this.disabled=e},e.prototype.writeValue=function(e){this.value=e,this.valueChange.emit(this.value),this.changeFn&&this.changeFn(this.value)},e.prototype.onInputTouched=function(){this.disabled||(this.touchFn&&this.touchFn(),this.writeValue(!this.value))},e.ɵfac=function(t){return new(t||e)(c.ɵɵdirectiveInject(c.ElementRef))},e.ɵcmp=c.ɵɵdefineComponent({type:e,selectors:[["toggle-switch"]],inputs:{title:"title",value:"value"},outputs:{valueChange:"valueChange"},features:[c.ɵɵProvidersFeature([{provide:r.NG_VALUE_ACCESSOR,useExisting:o.forwardRef(function(){return e}),multi:!0}])],decls:3,vars:3,consts:[[1,"toggle-switch",3,"title"],["type","checkbox",3,"id","checked","click"],[1,"slider"]],template:function(e,t){1&e&&(c.ɵɵelementStart(0,"label",0),c.ɵɵelementStart(1,"input",1),c.ɵɵlistener("click",function(){return t.onInputTouched()}),c.ɵɵelementEnd(),c.ɵɵelement(2,"span",2),c.ɵɵelementEnd()),2&e&&(c.ɵɵproperty("title",t.title),c.ɵɵadvance(1),c.ɵɵproperty("id",t.ident)("checked",t.value))},styles:['[_nghost-%COMP%]{display:flex;justify-content:center;align-items:center}.toggle-switch[_ngcontent-%COMP%], [_nghost-%COMP%]{width:30px;height:17px}.toggle-switch[_ngcontent-%COMP%]{position:relative;display:inline-block;margin:0}.toggle-switch[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{opacity:0;width:0;height:0}.toggle-switch[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:checked + .slider[_ngcontent-%COMP%]{background-color:#3398c7}.toggle-switch[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:focus + .slider[_ngcontent-%COMP%]{box-shadow:0 0 1px #3398c7}.toggle-switch[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:checked + .slider[_ngcontent-%COMP%]:before{-webkit-transform:translateX(13px);-ms-transform:translateX(13px);transform:translateX(13px)}.toggle-switch[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%]{cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#ccc;border-radius:17px}.toggle-switch[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%], .toggle-switch[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%]:before{position:absolute;-webkit-transition:.4s;transition:.4s}.toggle-switch[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%]:before{content:"";height:13px;width:13px;left:2px;bottom:2px;background-color:#fff;border-radius:50%}']}),e}();t.ToggleSwitchComponent=l,c.ɵsetClassMetadata(l,[{type:o.Component,args:[{selector:"toggle-switch",templateUrl:"./ToggleSwitch.ng.html",styleUrls:["./ToggleSwitch.ng.scss"],providers:[{provide:r.NG_VALUE_ACCESSOR,useExisting:o.forwardRef(function(){return l}),multi:!0}]}]}],function(){return[{type:c.ElementRef}]},{title:[{type:o.Input}],value:[{type:o.Input}],valueChange:[{type:o.Output}]}),i.module("IVWebApp").directive("toggleSwitch",a.downgradeComponent({component:l}));var u=function(){function e(){}return e.ɵmod=c.ɵɵdefineNgModule({type:e}),e.ɵinj=c.ɵɵdefineInjector({factory:function(t){return new(t||e)},imports:[[s.CommonModule]]}),e}();t.ToggleSwitchModule=u,("undefined"==typeof ngJitMode||ngJitMode)&&c.ɵɵsetNgModuleScope(u,{declarations:[l],imports:[s.CommonModule],exports:[l]}),c.ɵsetClassMetadata(u,[{type:o.NgModule,args:[{imports:[s.CommonModule],declarations:[l],exports:[l]}]}],null,null)},1700:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),r=(n(130),n(0)),i=n(130),a=function(){function e(e){this.UoMService=e}return e.prototype.transform=function(e,t,n,o,r){return void 0===n&&(n=2),void 0===o&&(o=0),void 0===r&&(r=!1),this.UoMService.convert(e,t,n,void 0,o,r)},e.ɵfac=function(t){return new(t||e)(r.ɵɵdirectiveInject(i.UoMService))},e.ɵpipe=r.ɵɵdefinePipe({name:"uom",type:e,pure:!0}),e}();t.UoMPipe=a,r.ɵsetClassMetadata(a,[{type:o.Pipe,args:[{name:"uom"}]}],function(){return[{type:i.UoMService}]},null)},1704:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),r=(n(17),n(0)),i=n(17),a=function(){function e(e){this.ViewService=e,this.focusWhitelist=["input","select","textarea"]}return e.prototype.ngDoCheck=function(){var e=document.activeElement,t=this.ViewService.mainView.divContainer.container;e!==t&&-1===this.focusWhitelist.indexOf(e.localName)&&t.focus()},e.ɵfac=function(t){return new(t||e)(r.ɵɵdirectiveInject(i.ViewService))},e.ɵdir=r.ɵɵdefineDirective({type:e,selectors:[["","redirectFocusToScene",""]]}),e}();t.RedirectFocusToMainViewDirective=a,r.ɵsetClassMetadata(a,[{type:o.Directive,args:[{selector:"[redirectFocusToScene]"}]}],function(){return[{type:i.ViewService}]},null)},1705:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),r=n(2),i=n(6),a=n(0),s=function(){function e(){this.zoomIn=new o.EventEmitter,this.zoomOut=new o.EventEmitter}return e.prototype.fireZoomIn=function(e){this.zoomIn.emit()},e.prototype.fireZoomOut=function(e){this.zoomOut.emit()},e.ɵfac=function(t){return new(t||e)},e.ɵcmp=a.ɵɵdefineComponent({type:e,selectors:[["zoom-control"]],outputs:{zoomIn:"zoomIn",zoomOut:"zoomOut"},decls:5,vars:0,consts:[[1,"btn-group-vertical",3,"dblclick"],["type","button",1,"btn","btn-default",3,"click"],[1,"fa","fa-plus"],[1,"fa","fa-minus"]],template:function(e,t){1&e&&(a.ɵɵelementStart(0,"div",0),a.ɵɵlistener("dblclick",function(e){return e.stopPropagation()}),a.ɵɵelementStart(1,"button",1),a.ɵɵlistener("click",function(e){return t.fireZoomIn(e)}),a.ɵɵelement(2,"i",2),a.ɵɵelementEnd(),a.ɵɵelementStart(3,"button",1),a.ɵɵlistener("click",function(e){return t.fireZoomOut(e)}),a.ɵɵelement(4,"i",3),a.ɵɵelementEnd(),a.ɵɵelementEnd())},styles:["div[_ngcontent-%COMP%]{width:100%}div[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{border:none}"]}),e}();t.ZoomControlComponent=s,a.ɵsetClassMetadata(s,[{type:o.Component,args:[{selector:"zoom-control",templateUrl:"ZoomControl.ng.html",styleUrls:["ZoomControl.ng.scss"]}]}],null,{zoomIn:[{type:o.Output}],zoomOut:[{type:o.Output}]}),r.module("IVWebApp").directive("zoomControl",i.downgradeComponent({component:s}))},1711:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),r=n(1692),i=n(3),a=n(1700),s=n(1704),c=n(1697),l=n(1696),u=n(1705),p=n(0),d=function(){function e(){}return e.ɵmod=p.ɵɵdefineNgModule({type:e}),e.ɵinj=p.ɵɵdefineInjector({factory:function(t){return new(t||e)},providers:[],imports:[[i.CommonModule,c.ToggleSwitchModule,l.AlertDialogModule]]}),e}();t.SharedModule=d,("undefined"==typeof ngJitMode||ngJitMode)&&p.ɵɵsetNgModuleScope(d,{declarations:[r.AddBaseUrlDirective,s.RedirectFocusToMainViewDirective,a.UoMPipe,u.ZoomControlComponent],imports:[i.CommonModule,c.ToggleSwitchModule,l.AlertDialogModule],exports:[r.AddBaseUrlDirective,s.RedirectFocusToMainViewDirective,a.UoMPipe,u.ZoomControlComponent]}),p.ɵsetClassMetadata(d,[{type:o.NgModule,args:[{imports:[i.CommonModule,c.ToggleSwitchModule,l.AlertDialogModule],declarations:[r.AddBaseUrlDirective,s.RedirectFocusToMainViewDirective,a.UoMPipe,u.ZoomControlComponent],entryComponents:[u.ZoomControlComponent],exports:[r.AddBaseUrlDirective,s.RedirectFocusToMainViewDirective,a.UoMPipe,u.ZoomControlComponent],providers:[]}]}],null,null)},1849:function(e,t,n){"use strict";var o;Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.LOADING=0]="LOADING",e[e.LOADED=1]="LOADED",e[e.PENDING=2]="PENDING"}(o=t.Status||(t.Status={}));t.DatasetState=function(e,t,n,r){this.name=e,this.active=t,this.available=n,this.path=r,this.status=o.PENDING}},1860:function(e,t,n){"use strict";function o(e){this.content=[],this.scoreFunction=e}n.r(t),n.d(t,"BinaryHeap",function(){return o}),o.prototype={push:function(e){this.content.push(e),this.bubbleUp(this.content.length-1)},empty:function(){return 0===this.size()},clean:function(){this.content=[]},peek:function(){return this.content[0]},pop:function(){var e=this.content[0],t=this.content.pop();return this.content.length>0&&(this.content[0]=t,this.sinkDown(0)),e},remove:function(e){for(var t=this.content.length,n=0;n0;){var o=Math.floor((e+1)/2)-1,r=this.content[o];if(n>=this.scoreFunction(r))break;this.content[o]=t,this.content[e]=r,e=o}},sinkDown:function(e){for(var t=this.content.length,n=this.content[e],o=this.scoreFunction(n);;){var r=2*(e+1),i=r-1,a=null;if(i0;)this.sceneGroup.remove(this.sceneGroup.children[0]);a.Cache.enabled=!0,this.maxGPULoads=e,this.showBBoxThree=t,this.showBBoxGLTF=n,this.updateDatasetState()},t.prototype.processClosestMeshes=function(){var e=this,t=this.view.getCamera(),n=this.getViewport();return this.updateFrustum(t),Promise.all(m.map(this.loaders,function(e){return e}).map(function(o){return o.getClosestMeshes(t,n,e.frustum)})).then(function(t){t.forEach(function(t){t.filter(function(e){return e}).forEach(function(t){return e.meshQueue.push(t)})})})},t.prototype.processMeshQueue=function(){for(var e,t=this,n=0,o=function(){var o=r.meshQueue.pop(),i=r.view.getCamera();r.updateFrustum(i),o.geometry.computeBoundingBox();var s=o.geometry.boundingBox,c=s.distanceToPoint(i.position),l=[];l.push(function(){return!t.frustum.intersectsBox(s)}),l.push(function(){return!t.isDatasetActive(o.datasetName)}),l.push(function(){return c>=t.loaderConfig.maxDistance}),l.some(function(e){return e()})?null===(e=r.loaders[o.datasetName])||void 0===e||e.remove(o):(r.showBBoxThree&&r.sceneGroup.add(new a.BoxHelper(o,new a.Color(1,0,0))),r.showBBoxGLTF&&r.sceneGroup.add(new a.Box3Helper(o.GLTFBox,new a.Color(1,0,0))),r.sceneGroup.add(o),n++),r.view.invalidateScene()},r=this;!this.meshQueue.empty()&&n=2.0 are supported."));else{if(v.extensionsUsed)for(var y=0;y=0&&console.warn('THREE.GLTFLoader: Unknown extension "'+M+'".')}}var w=new O(v,g,{path:r||this.resourcePath||"",crossOrigin:this.crossOrigin,manager:this.manager});w.fileLoader.setRequestHeader(this.requestHeader),this.parserOnly?c({parser:w}):w.parse(c,l)}}});var t={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",MSFT_TEXTURE_DDS:"MSFT_texture_dds"};function n(e){if(!e)throw new Error("THREE.GLTFLoader: Attempting to load .dds texture without importing DDSLoader");this.name=t.MSFT_TEXTURE_DDS,this.ddsLoader=e}function i(e){this.name=t.KHR_LIGHTS_PUNCTUAL;var n=e.extensions&&e.extensions[t.KHR_LIGHTS_PUNCTUAL]||{};this.lightDefs=n.lights||[]}function a(){this.name=t.KHR_MATERIALS_UNLIT}i.prototype.loadLight=function(e){var t,n=this.lightDefs[e],r=new o.Color(16777215);void 0!==n.color&&r.fromArray(n.color);var i=void 0!==n.range?n.range:0;switch(n.type){case"directional":(t=new o.DirectionalLight(r)).target.position.set(0,0,-1),t.add(t.target);break;case"point":(t=new o.PointLight(r)).distance=i;break;case"spot":(t=new o.SpotLight(r)).distance=i,n.spot=n.spot||{},n.spot.innerConeAngle=void 0!==n.spot.innerConeAngle?n.spot.innerConeAngle:0,n.spot.outerConeAngle=void 0!==n.spot.outerConeAngle?n.spot.outerConeAngle:Math.PI/4,t.angle=n.spot.outerConeAngle,t.penumbra=1-n.spot.innerConeAngle/n.spot.outerConeAngle,t.target.position.set(0,0,-1),t.add(t.target);break;default:throw new Error('THREE.GLTFLoader: Unexpected light type, "'+n.type+'".')}return t.position.set(0,0,0),t.decay=2,void 0!==n.intensity&&(t.intensity=n.intensity),t.name=n.name||"light_"+e,Promise.resolve(t)},a.prototype.getMaterialType=function(){return o.MeshBasicMaterial},a.prototype.extendParams=function(e,t,n){var r=[];e.color=new o.Color(1,1,1),e.opacity=1;var i=t.pbrMetallicRoughness;if(i){if(Array.isArray(i.baseColorFactor)){var a=i.baseColorFactor;e.color.fromArray(a),e.opacity=a[3]}void 0!==i.baseColorTexture&&r.push(n.assignTexture(e,"map",i.baseColorTexture))}return Promise.all(r)};var s="glTF",c=1313821514,l=5130562;function u(e){this.name=t.KHR_BINARY_GLTF,this.content=null,this.body=null;var n=new DataView(e,0,12);if(this.header={magic:o.LoaderUtils.decodeText(new Uint8Array(e.slice(0,4))),version:n.getUint32(4,!0),length:n.getUint32(8,!0)},this.header.magic!==s)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");for(var r=new DataView(e,12),i=0;i",t),e.fragmentShader=e.fragmentShader.replace("#include ",n),e.fragmentShader=e.fragmentShader.replace("#include ",r),e.fragmentShader=e.fragmentShader.replace("#include ",i),e.fragmentShader=e.fragmentShader.replace("#include ",a)},Object.defineProperties(this,{specular:{get:function(){return s.specular.value},set:function(e){s.specular.value=e}},specularMap:{get:function(){return s.specularMap.value},set:function(e){s.specularMap.value=e}},glossiness:{get:function(){return s.glossiness.value},set:function(e){s.glossiness.value=e}},glossinessMap:{get:function(){return s.glossinessMap.value},set:function(e){s.glossinessMap.value=e,e?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_ROUGHNESSMAP=""):(delete this.defines.USE_ROUGHNESSMAP,delete this.defines.USE_GLOSSINESSMAP)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(e)}function f(){return{name:t.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,specularGlossinessParams:["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"],getMaterialType:function(){return h},extendParams:function(e,t,n){var r=t.extensions[this.name];e.color=new o.Color(1,1,1),e.opacity=1;var i=[];if(Array.isArray(r.diffuseFactor)){var a=r.diffuseFactor;e.color.fromArray(a),e.opacity=a[3]}if(void 0!==r.diffuseTexture&&i.push(n.assignTexture(e,"map",r.diffuseTexture)),e.emissive=new o.Color(0,0,0),e.glossiness=void 0!==r.glossinessFactor?r.glossinessFactor:1,e.specular=new o.Color(1,1,1),Array.isArray(r.specularFactor)&&e.specular.fromArray(r.specularFactor),void 0!==r.specularGlossinessTexture){var s=r.specularGlossinessTexture;i.push(n.assignTexture(e,"glossinessMap",s)),i.push(n.assignTexture(e,"specularMap",s))}return Promise.all(i)},createMaterial:function(e){var t=new h(e);return t.fog=!0,t.color=e.color,t.map=void 0===e.map?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=void 0===e.aoMap?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=1,t.emissiveMap=void 0===e.emissiveMap?null:e.emissiveMap,t.bumpMap=void 0===e.bumpMap?null:e.bumpMap,t.bumpScale=1,t.normalMap=void 0===e.normalMap?null:e.normalMap,t.normalMapType=o.TangentSpaceNormalMap,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=void 0===e.specularMap?null:e.specularMap,t.specular=e.specular,t.glossinessMap=void 0===e.glossinessMap?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=void 0===e.envMap?null:e.envMap,t.envMapIntensity=1,t.refractionRatio=.98,t}}}function m(){this.name=t.KHR_MESH_QUANTIZATION}function g(e,t,n,r){o.Interpolant.call(this,e,t,n,r)}p.prototype.decodePrimitive=function(e,t){var n=this.json,o=this.dracoLoader,r=e.extensions[this.name].bufferView,i=e.extensions[this.name].attributes,a={},s={},c={};for(var l in i){var u=w[l]||l.toLowerCase();a[u]=i[l]}for(l in e.attributes)if(u=w[l]||l.toLowerCase(),void 0!==i[l]){var p=n.accessors[e.attributes[l]],d=v[p.componentType];c[u]=d,s[u]=!0===p.normalized}return t.getDependency("bufferView",r).then(function(e){return new Promise(function(t){o.decodeDracoFile(e,function(e){for(var n in e.attributes){var o=e.attributes[n],r=s[n];void 0!==r&&(o.normalized=r)}t(e)},a,c)})})},d.prototype.extendTexture=function(e,t){return e=e.clone(),void 0!==t.offset&&e.offset.fromArray(t.offset),void 0!==t.rotation&&(e.rotation=t.rotation),void 0!==t.scale&&e.repeat.fromArray(t.scale),void 0!==t.texCoord&&console.warn('THREE.GLTFLoader: Custom UV sets in "'+this.name+'" extension not yet supported.'),e.needsUpdate=!0,e},h.prototype=Object.create(o.MeshStandardMaterial.prototype),h.prototype.constructor=h,h.prototype.copy=function(e){return o.MeshStandardMaterial.prototype.copy.call(this,e),this.specularMap=e.specularMap,this.specular.copy(e.specular),this.glossinessMap=e.glossinessMap,this.glossiness=e.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this},g.prototype=Object.create(o.Interpolant.prototype),g.prototype.constructor=g,g.prototype.copySampleValue_=function(e){for(var t=this.resultBuffer,n=this.sampleValues,o=this.valueSize,r=e*o*3+o,i=0;i!==o;i++)t[i]=n[r+i];return t},g.prototype.beforeStart_=g.prototype.copySampleValue_,g.prototype.afterEnd_=g.prototype.copySampleValue_,g.prototype.interpolate_=function(e,t,n,o){for(var r=this.resultBuffer,i=this.sampleValues,a=this.valueSize,s=2*a,c=3*a,l=o-t,u=(n-t)/l,p=u*u,d=p*u,h=e*c,f=h-c,m=-2*d+3*p,g=d-p,v=1-m,y=g-p+u,M=0;M!==a;M++){var C=i[f+M+a],w=i[f+M+s]*l,S=i[h+M+a],b=i[h+M]*l;r[M]=v*C+y*w+m*S+g*b}return r};var v={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},y={9728:o.NearestFilter,9729:o.LinearFilter,9984:o.NearestMipmapNearestFilter,9985:o.LinearMipmapNearestFilter,9986:o.NearestMipmapLinearFilter,9987:o.LinearMipmapLinearFilter},M={33071:o.ClampToEdgeWrapping,33648:o.MirroredRepeatWrapping,10497:o.RepeatWrapping},C={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},w={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},S={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},b={CUBICSPLINE:void 0,LINEAR:o.InterpolateLinear,STEP:o.InterpolateDiscrete},T={"image/png":o.RGBAFormat,"image/jpeg":o.RGBFormat};function _(e,t){return"string"!=typeof e||""===e?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}function x(e,t,n){for(var o in n.extensions)void 0===e[o]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[o]=n.extensions[o])}function E(e,t){void 0!==t.extras&&("object"===r(t.extras)?Object.assign(e.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function L(e,t){if(e.updateMorphTargets(),void 0!==t.weights)for(var n=0,o=t.weights.length;n=2&&a.setY(L,_[x*c+1]),c>=3&&a.setZ(L,_[x*c+2]),c>=4&&a.setW(L,_[x*c+3]),c>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return a})},O.prototype.loadTexture=function(e){var n,r=this,i=this.json,a=this.options,s=this.textureLoader,c=window.URL||window.webkitURL,l=i.textures[e],u=l.extensions||{},p=(n=u[t.MSFT_TEXTURE_DDS]?i.images[u[t.MSFT_TEXTURE_DDS].source]:i.images[l.source]).uri,d=!1;return void 0!==n.bufferView&&(p=r.getDependency("bufferView",n.bufferView).then(function(e){d=!0;var t=new Blob([e],{type:n.mimeType});return p=c.createObjectURL(t)})),Promise.resolve(p).then(function(e){var n=a.manager.getHandler(e);return n||(n=u[t.MSFT_TEXTURE_DDS]?r.extensions[t.MSFT_TEXTURE_DDS].ddsLoader:s),new Promise(function(t,o){n.load(_(e,a.path),t,void 0,o)})}).then(function(e){!0===d&&c.revokeObjectURL(p),e.flipY=!1,l.name&&(e.name=l.name),n.mimeType in T&&(e.format=T[n.mimeType]);var t=(i.samplers||{})[l.sampler]||{};return e.magFilter=y[t.magFilter]||o.LinearFilter,e.minFilter=y[t.minFilter]||o.LinearMipmapLinearFilter,e.wrapS=M[t.wrapS]||o.RepeatWrapping,e.wrapT=M[t.wrapT]||o.RepeatWrapping,e})},O.prototype.assignTexture=function(e,n,r){var i=this;return this.getDependency("texture",r.index).then(function(a){if(!a.isCompressedTexture)switch(n){case"aoMap":case"emissiveMap":case"metalnessMap":case"normalMap":case"roughnessMap":a.format=o.RGBFormat}if(void 0===r.texCoord||0==r.texCoord||"aoMap"===n&&1==r.texCoord||console.warn("THREE.GLTFLoader: Custom UV set "+r.texCoord+" for texture "+n+" not yet supported."),i.extensions[t.KHR_TEXTURE_TRANSFORM]){var s=void 0!==r.extensions?r.extensions[t.KHR_TEXTURE_TRANSFORM]:void 0;s&&(a=i.extensions[t.KHR_TEXTURE_TRANSFORM].extendTexture(a,s))}e[n]=a})},O.prototype.assignFinalMaterial=function(e){var t=e.geometry,n=e.material,r=void 0!==t.attributes.tangent,i=void 0!==t.attributes.color,a=void 0===t.attributes.normal,s=!0===e.isSkinnedMesh,c=Object.keys(t.morphAttributes).length>0,l=c&&void 0!==t.morphAttributes.normal;if(e.isPoints){var u="PointsMaterial:"+n.uuid,p=this.cache.get(u);p||(p=new o.PointsMaterial,o.Material.prototype.copy.call(p,n),p.color.copy(n.color),p.map=n.map,p.sizeAttenuation=!1,this.cache.add(u,p)),n=p}else if(e.isLine){u="LineBasicMaterial:"+n.uuid;var d=this.cache.get(u);d||(d=new o.LineBasicMaterial,o.Material.prototype.copy.call(d,n),d.color.copy(n.color),this.cache.add(u,d)),n=d}if(r||i||a||s||c){u="ClonedMaterial:"+n.uuid+":",n.isGLTFSpecularGlossinessMaterial&&(u+="specular-glossiness:"),s&&(u+="skinning:"),r&&(u+="vertex-tangents:"),i&&(u+="vertex-colors:"),a&&(u+="flat-shading:"),c&&(u+="morph-targets:"),l&&(u+="morph-normals:");var h=this.cache.get(u);h||(h=n.clone(),s&&(h.skinning=!0),r&&(h.vertexTangents=!0),i&&(h.vertexColors=!0),a&&(h.flatShading=!0),c&&(h.morphTargets=!0),l&&(h.morphNormals=!0),this.cache.add(u,h)),n=h}n.aoMap&&void 0===t.attributes.uv2&&void 0!==t.attributes.uv&&t.setAttribute("uv2",new o.BufferAttribute(t.attributes.uv.array,2)),n.normalScale&&!r&&(n.normalScale.y=-n.normalScale.y),e.material=n},O.prototype.loadMaterial=function(e){var n,r=this.json,i=this.extensions,a=r.materials[e],s={},c=a.extensions||{},l=[];if(c[t.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){var u=i[t.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];n=u.getMaterialType(),l.push(u.extendParams(s,a,this))}else if(c[t.KHR_MATERIALS_UNLIT]){var p=i[t.KHR_MATERIALS_UNLIT];n=p.getMaterialType(),l.push(p.extendParams(s,a,this))}else{n=o.MeshStandardMaterial;var d=a.pbrMetallicRoughness||{};if(s.color=new o.Color(1,1,1),s.opacity=1,Array.isArray(d.baseColorFactor)){var f=d.baseColorFactor;s.color.fromArray(f),s.opacity=f[3]}void 0!==d.baseColorTexture&&l.push(this.assignTexture(s,"map",d.baseColorTexture)),s.metalness=void 0!==d.metallicFactor?d.metallicFactor:1,s.roughness=void 0!==d.roughnessFactor?d.roughnessFactor:1,void 0!==d.metallicRoughnessTexture&&(l.push(this.assignTexture(s,"metalnessMap",d.metallicRoughnessTexture)),l.push(this.assignTexture(s,"roughnessMap",d.metallicRoughnessTexture)))}!0===a.doubleSided&&(s.side=o.DoubleSide);var m=a.alphaMode||"OPAQUE";return"BLEND"===m?(s.transparent=!0,s.depthWrite=!1):(s.transparent=!1,"MASK"===m&&(s.alphaTest=void 0!==a.alphaCutoff?a.alphaCutoff:.5)),void 0!==a.normalTexture&&n!==o.MeshBasicMaterial&&(l.push(this.assignTexture(s,"normalMap",a.normalTexture)),s.normalScale=new o.Vector2(1,1),void 0!==a.normalTexture.scale&&s.normalScale.set(a.normalTexture.scale,a.normalTexture.scale)),void 0!==a.occlusionTexture&&n!==o.MeshBasicMaterial&&(l.push(this.assignTexture(s,"aoMap",a.occlusionTexture)),void 0!==a.occlusionTexture.strength&&(s.aoMapIntensity=a.occlusionTexture.strength)),void 0!==a.emissiveFactor&&n!==o.MeshBasicMaterial&&(s.emissive=(new o.Color).fromArray(a.emissiveFactor)),void 0!==a.emissiveTexture&&n!==o.MeshBasicMaterial&&l.push(this.assignTexture(s,"emissiveMap",a.emissiveTexture)),Promise.all(l).then(function(){var e;return e=n===h?i[t.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(s):new n(s),a.name&&(e.name=a.name),e.map&&(e.map.encoding=o.sRGBEncoding),e.emissiveMap&&(e.emissiveMap.encoding=o.sRGBEncoding),E(e,a),a.extensions&&x(i,e,a),e})},O.prototype.loadGeometries=function(e){var n=this,r=this.extensions,i=this.primitiveCache;function a(e){return r[t.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,n).then(function(t){return A(t,e,n)})}for(var s,c,l=[],u=0,p=e.length;u0&&L(p,r),p.name=r.name||"mesh_"+e,s.length>1&&(p.name+="_"+l),E(p,r),n.assignFinalMaterial(p),c.push(p)}if(1===c.length)return c[0];var m=new o.Group;for(l=0,u=c.length;l1){var n=c[l.mesh]++;(t=e.clone()).name+="_instance_"+n}else t=e;return void 0!==l.weights&&t.traverse(function(e){if(e.isMesh)for(var t=0,n=l.weights.length;t1?new o.Group:1===e.length?e[0]:new o.Object3D)!==e[0])for(var n=0,r=e.length;n=a.config.getCurrentVertexBudget()}),f.push(function(){return d>=a.config.maxDistance}),f.some(function(e){return e()}))return c.removeMesh(l),"continue";l.requested||(c.requestQueue.push(new i.RequestQueueItem(l.id,s,l.vertexCount,d,c.setLOD(l))),l.requested=!0)},c=this;for(var l in this.gltfMeshes)s(l)},e.prototype.setLOD=function(e){var t=this,n=e.materials.map(function(e){return t.parser.json.materials[e]}).filter(function(e){return e.extensions&&e.extensions.MSFT_lod}).map(function(e){return e.extensions.MSFT_lod.ids});return 0===n.length?[]:(this.parser.json.meshes[e.id].primitives.forEach(function(e,t){e.material=n[t].slice(-1).pop()}),n[0])},e.projectSphereDiameter=function(e,t,n,o){var r=t/2*Math.PI/180,i=e/Math.tan(r)/Math.sqrt(n*n-e*e);return 2*Math.floor(i*o*.5)||1/0},e.prototype.getDistance=function(e,t){var n=this.gltfMeshes[t],r=new o.Sphere,i=n.box.clone();return i.getBoundingSphere(r),i.distanceToPoint(e.position)},e.prototype.processRequestQueues=function(e,t){for(var n=this,o=0,r=[],i=function(){var i=a.requestQueue.pop();if(a.currentVertexCount+i.vertexCount>a.config.getCurrentVertexBudget())return a.requestQueue.push(i),"break";var s=[];if(s.push(function(){return t.intersectsBox(n.gltfMeshes[i.meshName].box)}),s.push(function(){return n.getDistance(e,i.meshName)<=i.weight}),s.every(function(e){return e()}))return r.push(a.requestMesh(i,e)),a.currentVertexCount+=i.vertexCount,o++,"continue";a.gltfMeshes[i.meshName].requested=!1},a=this;!this.requestQueue.empty()&&o<=this.config.maxLoadRequests&&"break"!==i(););return this.requestQueue.size()>this.MAX_REQUEST_QUEUE_SIZE&&this.requestQueue.clean(),r},e.prototype.requestMesh=function(e,t){var n=this;return this.parser.getDependency("mesh",e.id).then(function(o){if(n.active){var r=new a.GLTFMesh(o,e.weight,n.datasetName,n.config.showWireframe,n.gltfMeshes[e.meshName].box);return r.time=Date.now(),r.cameraPosition=t.position.clone(),r.onAfterRender=n.getOnAfterRender(e,r),r}})},e.prototype.requestMaterial=function(e,t){var n=this;return this.parser.getDependency("material",e).then(function(e){if(n.active){var o=t.material;o.name=e.name,o.uniforms.tDiffuse.value.dispose(),o.uniforms.tDiffuse={value:e.map},o.uniformsNeedUpdate=!0,t.textureLoading=c.Status.LOADED,n.view.invalidateScene()}})},e.prototype.getOnAfterRender=function(e,t){var n=this;return function(o,r,i,a){a.computeBoundingBox();var l=a.boundingBox.distanceToPoint(i.position),u=i.position.distanceTo(t.cameraPosition),p=Date.now()-t.time,d=u/p/1e3;if(l<=n.config.maxDistance/3&&p<50&&d0)){var h=0;n.config.lod>=0&&e.LOD.length>n.config.lod&&(h=n.config.lod),n.requestMaterial(e.LOD[h],t).catch(s.handleWarning)}t.cameraPosition=i.position.clone(),t.time=Date.now()}},e.prototype.removeMesh=function(e){e.requested=!1;for(var t=this.sceneGroup.getObjectByName(e.name);void 0!==t;)this.currentVertexCount-=e.vertexCount,this.sceneGroup.remove(t),this.disposeMesh(t,!0),t=this.sceneGroup.getObjectByName(e.name)},e.prototype.disposeMesh=function(e,t){var n,o;if(e){this.gltfMeshes[e.name].requested=!1,t&&e.geometry.dispose();var r=e.material,i=null===(o=null===(n=r.uniforms)||void 0===n?void 0:n.tDiffuse)||void 0===o?void 0:o.value;i&&i.dispose(),r.dispose()}},e}();t.MeshLoader=l},1902:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.GLTFMeshItem=function(e,t,n,o,r,i){this.id=e,this.box=t,this.vertexCount=n,this.name=o,this.materials=r,this.requested=i};t.RequestQueueItem=function(e,t,n,o,r){this.id=e,this.meshName=t,this.vertexCount=n,this.weight=o,this.LOD=r}},1903:function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),a=n(1849),s=function(e){function t(t,o,r,s,c){var l=e.call(this,t.geometry,t.material)||this;l.weight=o,l.datasetName=r,l.showWireframe=s,l.GLTFBox=c,l.textureLoading=a.Status.PENDING,l.name=t.name;var u=l.material,p=new i.ShaderMaterial;return p.wireframe=s,p.side=i.DoubleSide,p.name=u.name,p.fragmentShader=n(1904),p.vertexShader=n(1905),p.uniforms={tDiffuse:{value:u.map}},l.material=p,l}return r(t,e),t}(i.Mesh);t.GLTFMesh=s},1904:function(e,t){e.exports="varying vec2 vUv;\nuniform sampler2D tDiffuse;\n\nvoid main()\n{\n\tgl_FragColor = texture2D(tDiffuse, vUv);\n}"},1905:function(e,t){e.exports="varying vec2 vUv;\n\nvoid main()\n{\n\tvUv = uv;\n\tmat4 transformation = projectionMatrix * modelViewMatrix;\n\tgl_Position = transformation * vec4(position, 1.0);\n}"},1928:function(e,t,n){"use strict";var o=this&&this.__assign||function(){return(o=Object.assign||function(e){for(var t,n=1,o=arguments.length;n0&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]