UNPKG

@tindtechnologies/universalviewer

Version:

The Universal Viewer is a community-developed open source project on a mission to help you share your 📚📜📰📽️📻🗿 with the 🌎

1 lines 884 kB
import{a as Il}from"./chunk-ENN6EEDW.js";import{a as Ol}from"./chunk-MYFOSXPU.js";import{a as Pl}from"./chunk-TVVVZZ43.js";import{a as Er,b as tn,d as Jo}from"./chunk-Y2TXPXZV.js";import{a as Ll,b as Cl,d as Rl}from"./chunk-LE3CSG7S.js";import{b as Al,c as Ri,d as Na,e as zn,j as Ba}from"./chunk-4DAZ7WDM.js";import{a as Ye,b as Qo,c as Dl,e as T,f as ut,g as kl,i as ve,j as Nl,k as Bl,l as ht,m as za,n as Ln,o as dt}from"./chunk-VNJCZCB4.js";import"./chunk-L67DAW3A.js";var _h=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var a in r)r.hasOwnProperty(a)&&(i[a]=r[a])},e(t,n)};return function(t,n){e(t,n);function i(){this.constructor=t}t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),te=function(e,t,n,i){return new(n||(n=Promise))(function(r,a){function o(c){try{l(i.next(c))}catch(u){a(u)}}function s(c){try{l(i.throw(c))}catch(u){a(u)}}function l(c){c.done?r(c.value):new n(function(u){u(c.value)}).then(o,s)}l((i=i.apply(e,t||[])).next())})},ne=function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,r,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(c){return function(u){return l([c,u])}}function l(c){if(i)throw new TypeError("Generator is already executing.");for(;n;)try{if(i=1,r&&(a=c[0]&2?r.return:c[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,c[1])).done)return a;switch(r=0,a&&(c=[c[0]&2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,r=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){n.label=c[1];break}if(c[0]===6&&n.label<a[1]){n.label=a[1],a=c;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(c);break}a[2]&&n.ops.pop(),n.trys.pop();continue}c=t.call(e,n)}catch(u){c=[6,u],r=0}finally{i=a=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},qe=void 0,Gs="data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgNTEyIDUxMiIgY2xhc3M9InMtaW9uLWljb24iPjxwYXRoIGQ9Ik05NiAyMzVoMzIwdjQySDk2eiI+PC9wYXRoPjwvc3ZnPgo=",Vs="data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgNTEyIDUxMiIgY2xhc3M9InMtaW9uLWljb24iPjxwYXRoIGQ9Ik0xODYuMzAxIDMzOS44OTNMOTYgMjQ5LjQ2MWwtMzIgMzAuNTA3TDE4Ni4zMDEgNDAyIDQ0OCAxNDAuNTA2IDQxNiAxMTB6Ij48L3BhdGg+PC9zdmc+Cg==",wh="Description",Eh="Title",Mh="Update",Sh={delete:"Delete",description:wh,title:Eh,update:Mh},m0=function(){function e(t){Ye(this,t),this._contentStrings=Sh,this.deleteAngle=ve(this,"deleteAngle",7),this.saveAngle=ve(this,"saveAngle",7)}return e.prototype.render=function(){var t=this;if(this.angle){var n=this.angle,i=n[0],r=n[1];return T("form",{onSubmit:function(a){return a.preventDefault()}},T("ion-item",null,T("ion-input",{id:"title",value:r.title,placeholder:this._contentStrings.title,required:!0,onIonChange:function(a){return r.title=a.detail.value},maxlength:20})),T("ion-item",null,T("ion-textarea",{id:"description",value:r.description,placeholder:this._contentStrings.description,rows:5,onIonChange:function(a){return r.description=a.detail.value},maxlength:280})),T("ion-item",null,T("ion-button",{size:"small",onClick:function(){t.deleteAngle.emit(i),t.angle=null}},T("ion-icon",{src:Gs}),"\xA0",this._contentStrings.delete),T("ion-button",{size:"small",type:"submit",onClick:function(){r.title&&t.saveAngle.emit([i,r])}},T("ion-icon",{src:Vs}),"\xA0",this._contentStrings.update)))}return null},Object.defineProperty(e,"style",{get:function(){return"#title{--background:var(--al-input-background-color);--color:var(--al-input-color);--padding-bottom:var(--al-input-padding-bottom);--padding-end:var(--al-input-padding-end);--padding-start:var(--al-input-padding-start);--padding-top:var(--al-input-padding-top);font-size:var(--al-input-font-size)}#description{--background:var(--al-textarea-background-color);--color:var(--al-textarea-color);--padding-bottom:var(--al-textarea-padding-bottom);--padding-end:var(--al-textarea-padding-end);--padding-start:var(--al-textarea-padding-start);--padding-top:var(--al-textarea-padding-top);font-size:var(--al-textarea-font-size)}"},enumerable:!0,configurable:!0}),e}(),Th="data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgNTEyIDUxMiIgY2xhc3M9InMtaW9uLWljb24iPjxwYXRoIGQ9Ik0xOTIgMTI4bDEyOCAxMjgtMTI4IDEyOHoiPjwvcGF0aD48L3N2Zz4K",Ah="Update",Lh={update:Ah},v0=function(){function e(t){Ye(this,t),this._contentStrings=Lh,this.graph=null,this.tabSize=2,this.graphSubmitted=ve(this,"graphSubmitted",7)}return e.prototype._getGraphJson=function(){var t="";try{t=JSON.stringify(JSON.parse(this.graph),void 0,this.tabSize)}catch{}return t},e.prototype.render=function(){var t=this;return T("form",{onSubmit:function(n){return n.preventDefault()}},T("ion-item",null,T("ion-textarea",{id:"graph",value:this._getGraphJson(),rows:10,required:!0,onIonChange:function(n){return t.graph=n.detail.value},ref:function(n){return t._graph=n}})),T("ion-item",null,T("ion-button",{size:"small",type:"submit",onClick:function(){t.graph&&t.graphSubmitted.emit(t._graph.value)}},T("ion-icon",{src:Th}),"\xA0",this._contentStrings.update)))},Object.defineProperty(e,"style",{get:function(){return"#graph{--background:var(--al-textarea-background-color);--color:var(--al-textarea-color);--padding-bottom:var(--al-textarea-padding-bottom);--padding-end:var(--al-textarea-padding-end);--padding-start:var(--al-textarea-padding-start);--padding-top:var(--al-textarea-padding-top);font-size:var(--al-console-font-size)}"},enumerable:!0,configurable:!0}),e}(),Ch="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDIzLjAuNiwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCA1MTIgNTEyIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA1MTIgNTEyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxwYXRoIGQ9Ik00MjQsNjRIODhjLTI2LjYsMC00OCwyMS42LTQ4LDQ4djI4OGMwLDI2LjQsMjEuNCw0OCw0OCw0OGgzMzZjMjYuNCwwLDQ4LTIxLjYsNDgtNDhWMTEyQzQ3Miw4NS42LDQ1MC42LDY0LDQyNCw2NHoKCSBNNDI0LDQwMEg4OFYxNzZoMzM2VjQwMHoiLz4KPHBhdGggZD0iTTIwMi42LDI4Ni40bC01OC4zLDU4LjNjLTIuOCwyLjgtNy40LDIuOC0xMC4yLDBsLTYuOC02LjhjLTIuOC0yLjgtMi44LTcuNCwwLTEwLjJsNDYuMi00Ni40bC00Ni4yLTQ2LjQKCWMtMi44LTIuOC0yLjgtNy40LDAtMTAuMmw2LjgtNi44YzIuOC0yLjgsNy40L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yLTMyLjV2LTk1YzAtMTcuOTQ5IDE0LjMyNy0zMi41IDMyLTMyLjUgMTcuNjczIDAgMzIgMTQuNTUxIDMyIDMyLjV2OTV6Ii8+PC9nPjxnPjxwYXRoIGQ9Ik0zMiA5NmgyNzJ2MzJIMzJ6TTQwMCA5Nmg4MHYzMmgtODB6TTM4NCAxNTkuNWMwIDE3Ljk0OS0xNC4zMjcgMzIuNS0zMiAzMi41LTE3LjY3MyAwLTMyLTE0LjU1MS0zMi0zMi41di05NWMwLTE3Ljk0OSAxNC4zMjctMzIuNSAzMi0zMi41IDE3LjY3MyAwIDMyIDE0LjU1MSAzMiAzMi41djk1eiIvPjwvZz48L3N2Zz4=",Ph="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1MTIgNTEyIj48cGF0aCBkPSJNNDAzLjAwMiAyMTcuMDAxQzM4OC45OTggMTQ4LjAwMiAzMjguOTk4IDk2IDI1NiA5NmMtNTcuOTk4IDAtMTA3Ljk5OCAzMi45OTgtMTMyLjk5OCA4MS4wMDFDNjMuMDAyIDE4My4wMDIgMTYgMjMzLjk5OCAxNiAyOTZjMCA2NS45OTYgNTMuOTk5IDEyMCAxMjAgMTIwaDI2MGM1NSAwIDEwMC00NSAxMDAtMTAwIDAtNTIuOTk4LTQwLjk5Ni05Ni4wMDEtOTIuOTk4LTk4Ljk5OXpNMjg4IDI3NnY3NmgtNjR2LTc2aC02OGwxMDAtMTAwIDEwMCAxMDBoLTY4eiIvPjwvc3ZnPg==",$o=function(e,t){return T("div",{style:{"overflow-y":"auto",width:"100%","min-height":"0","max-height":"100%",height:e.height}},t)},Oh="Console",Dh="Nodes",kh="Settings",Nh="Source",Bh={console:Oh,graph:Dh,settings:kh,src:Nh},U=function(){function e(){}return e}();U.boundingBoxWidth=2;U.controllerName="-controller";U.edgeMinSize=75e-6;U.edgeSize=.0075;U.fov=45;U.fontSizeLarge=1;U.fontSizeMedium=.7;U.fontSizeSmall=.4;U.frustrumScaleFactor=.5;U.lightIntensity=.5;U.maxAnimationSteps=50;U.minLoadingMS=500;U.movedEventName="-moved";U.movingStepCount=2;U.nodeMinSize=2e-4;U.nodeSize=.02;U.stackSpaceMultiplier={x:10,y:10,z:10};U.stepPowerMinMax=[1,10];U.targetFrameTime=1e3/24;U.textUnitsDecimalPlaces=3;U.titleIdName="-title";U.topLayerRenderOrder=999;U.unitsDecimalPlaces=6;U.zoomFactor=3;U.volumeRaycastSensitivity=.05;U.volumeStepsDelay=800;U.textPadding={width:.03,height:.03};U.minFrameMS=15;U.minTimeForThrottle=U.minFrameMS*5;U.buttonColors={active:"#f50057",hover:"#f50057",up:"#00b0ff"};U.colors={red:"#f50057",blue:"#00b0ff",black:"#000000",grey:"#222222",white:"#ffffff",yellow:"#ffeb3b",green:"#76ff03",lightRed:"#f77777"};U.lights={ambientLightColor:13684944,ambientLightIntensity:.25,directionalLight1Color:16777215,directionalLight1Intensity:.75,directionalLight2Color:10584,directionalLight2Intensity:.5};U.camera={dampingFactor:.25,far:1e4,fov:U.fov,maxDistance:8e3,maxPolarAngle:175,minDistance:0,minPolarAngle:5,near:.05,nearFactor:.9,orbitPanSpeed:.3,orbitRotateSpeed:.5,orbitZoomSpeed:1,panSpeed:.9,trackballRotateSpeed:2.5,trackballZoomSpeed:5};var Jt;(function(e){e.NODE="node",e.EDGE="edge",e.ANGLE="angle"})(Jt||(Jt={}));var Ft;(function(e){e.ORBIT="orbit",e.TRACKBALL="trackball"})(Ft||(Ft={}));var Ve;(function(e){e.SLICES="slices",e.VOLUME="volume",e.MESH="mesh"})(Ve||(Ve={}));var ms;(function(e){e.DEFAULT="default",e.CLAY="clay",e.XRAY="xray",e.NORMALS="normals",e.WIREFRAME="wireframe"})(ms||(ms={}));var Ka;(function(e){e.GLTF="gltf",e.GLB="glb"})(Ka||(Ka={}));var yn;(function(e){e.CORONAL="coronal",e.SAGGITAL="saggital",e.AXIAL="axial"})(yn||(yn={}));var zl;(function(e){e.LOCK="LOCK",e.MESH="MESH"})(zl||(zl={}));var Wt;(function(e){e.MILLIMETERS="mm",e.METERS="m"})(Wt||(Wt={}));var eo;(function(e){e.DCM="dcm",e.DICOM="dicom"})(eo||(eo={}));var ge=function(){function e(){}return e.isWebGL2Available=function(){try{var t=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&t.getContext("webgl2"))}catch{return!1}},e.enableControls=function(t,n,i){i===Ft.TRACKBALL?t.setAttribute("al-trackball-control","enabled: "+n):t.setAttribute("al-orbit-control","enabled: "+n)},e.waitOneFrame=function(t){window.setTimeout(function(){t()},U.minFrameMS)},e.objectToVector3=function(t){var n=new THREE.Vector3;return n.x=t.x,n.y=t.y,n.z=t.z,n},e.worldToScreen=function(t,n,i){var r=t.clone();return r.project(n),r.x=Math.round((r.x+1)*i.offsetWidth/2),r.y=Math.round((-r.y+1)*i.offsetHeight/2),r.z=0,r},e.normaliseNumber=function(t){return Number(t.toFixed(U.unitsDecimalPlaces))},e.vector3ToString=function(t){return t.toArray().join(" ")},e.vector3ToNormalisedString=function(t){var n=e.normaliseNumber(t.x),i=e.normaliseNumber(t.y),r=e.normaliseNumber(t.z);return n+" "+i+" "+r},e.stringToVector3=function(t){var n=t.split(" "),i=new THREE.Vector3;return i.x=Number(n[0]),i.y=Number(n[1]),i.z=Number(n[2]),i},e.normaliseStringVector3=function(t){return e.vector3ToNormalisedString(e.stringToVector3(t))},e.slerp=function(t,n,i){var r=i,a=t,o=n,s=a.angleTo(o);if(s){s=THREE.Math.clamp(s,-.99,.99);var l=Math.sin(1-r)*s,c=Math.sin(r*s),u=Math.sin(s),h=l/u,d=c/u,f=a.clone().multiplyScalar(h),p=o.clone().multiplyScalar(d),v=f.add(p);return v}else return null},e.easeInOutCubic=function(t){return t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1},e.getSlerpCameraPath=function(t,n,i,r){for(var a=[],o=t.position.clone().addScalar(Number.EPSILON),s=t.target.clone().addScalar(Number.EPSILON),l=n.position.clone().addScalar(Number.EPSILON),c=n.target.clone().addScalar(Number.EPSILON),u=0;u<=U.maxAnimationSteps;u++){var h=this.easeInOutCubic(u/U.maxAnimationSteps);a.push({position:i?e.slerp(o.clone(),l.clone(),h):l,target:r?e.slerp(s.clone(),c.clone(),h):c})}return a},e.getSlerp3Path=function(t,n){for(var i=[],r=t.clone().addScalar(Number.EPSILON),a=n.clone().addScalar(Number.EPSILON),o=0;o<=U.maxAnimationSteps;o++){var s=this.easeInOutCubic(o/U.maxAnimationSteps);i.push(e.slerp(r.clone(),a.clone(),s))}return i},e.lookToFrustrumSpace=function(t,n,i,r){var a=new THREE.Vector3;n.getWorldDirection(a);var o=r.distanceTo(new THREE.Vector3(0,0,0)),s=new THREE.Plane(a,o),l=new THREE.Vector3;s.projectPoint(i,l),t.lookAt(l)},e.getFrustrumSpaceDistance=function(t,n,i){var r=new THREE.Vector3;t.getWorldDirection(r);var a=i.distanceTo(new THREE.Vector3(0,0,0)),o=new THREE.Plane(r,a),s=new THREE.Vector3;o.projectPoint(n,s);var l=new THREE.Ray(n);l.lookAt(s);var c=l.distanceToPlane(o);return c},e}(),zh=function(){function e(){}return e._traceDataRay=function(t,n,i,r,a,o,s,l,c,u){var h=0,d=Math.floor,f=d(n)|0,p=d(i)|0,v=d(r)|0,m=a>0?1:-1,g=o>0?1:-1,y=s>0?1:-1,b=Math.abs(1/a),_=Math.abs(1/o),w=Math.abs(1/s),L=m>0?f+1-n:n-f,R=g>0?p+1-i:i-p,k=y>0?v+1-r:r-v,O=b<1/0?b*L:1/0,z=_<1/0?_*R:1/0,C=w<1/0?w*k:1/0,I=t.windowCenter-t.windowWidth*.5;I-=I*U.volumeRaycastSensitivity;for(var N=-1;h<=l;){var H=void 0,G=new THREE.Vector3(f,p,v),X=AMI.CoreUtils.worldToData(t.stack.lps2IJK,G),Z=AMI.CoreUtils.getPixelData(t.stack,X);if(Z!==null&&Z>I?H=1:H=0,H)return c&&(c.x=n+h*a,c.y=i+h*o,c.z=r+h*s),u&&(u.x=u.y=u.z=0,N===0&&(u.x=-m),N===1&&(u.y=-g),N===2&&(u.z=-y)),H;O<z?O<C?(f+=m,h=O,O+=b,N=0):(v+=y,h=C,C+=w,N=2):z<C?(p+=g,h=z,z+=_,N=1):(v+=y,h=C,C+=w,N=2)}return c&&(c.x=n+h*a,c.y=i+h*o,c.z=r+h*s),u&&(u.x=u.y=u.z=0),0},e.volumeRay=function(t,n,i,r,a,o){var s=+n.x,l=+n.y,c=+n.z,u=+i.x,h=+i.y,d=+i.z,f=Math.sqrt(u*u+h*h+d*d);if(f===0)throw new Error("Can't raycast along a zero vector");return u/=f,h/=f,d/=f,typeof r>"u"?r=64:r=+r,this._traceDataRay(t,s,l,c,u,h,d,r,a,o)},e.toAframeSpace=function(t){return t.divide(ge.objectToVector3(U.stackSpaceMultiplier))},e}(),vc=function(){function e(){}return e.debounce=function(t,n){return n=n||100,function(){if(!t.debouncing){var i=Array.prototype.slice.apply(arguments);t.lastReturnVal=t.apply(this,i),t.debouncing=!0}return clearTimeout(t.debounceTimeout),t.debounceTimeout=setTimeout(function(){t.debouncing=!1},n),t.lastReturnVal}},e}(),ot=function(){function e(){}return e}();ot.SELECTED="al-graph-selected";ot.POINTER_OVER="al-graph-pointer-over";ot.POINTER_OUT="al-graph-pointer-out";ot.DRAGGED="al-graph-dragged";ot.POINTER_DOWN="al-graph-pointer-down";ot.POINTER_UP="al-graph-pointer-up";var Fa=function(){function e(){}return e.getEntryWithHighestId=function(t){return t.size?Math.max.apply(Math,Array.from(t).map(function(n){var i=n[0];return Number(i.split(" ")[1])})):0},e.getNextId=function(t,n){return t.charAt(0).toUpperCase()+t.slice(1)+" "+Number(this.getEntryWithHighestId(n)+1)},e}(),rt=function(){function e(){}return e.addCssUnits=function(t){return this.cssUnits.some(function(n){return t.includes(n)})||(t+="px"),t},e.getFileExtension=function(t){return t.substring(t.lastIndexOf(".")+1)},e.getFileEndCharacters=function(t,n){return t.slice(t.length-n)},e.getGeometryCenter=function(t){var n;return t instanceof THREE.BufferGeometry?n=new THREE.Geometry().fromBufferGeometry(t):n=t,n.computeBoundingSphere(),n.boundingSphere.center},e.getSceneDistanceFromMesh=function(t,n,i){if(t){var r=t.geometry.boundingSphere;return n*r.radius/Math.tan(i*Math.PI/180)}return null},e.getSceneDistanceFromModel=function(t,n,i){if(t){var r=e.getBoundingBox(t),a=new THREE.Sphere;return r.getBoundingSphere(a),n*a.radius/Math.tan(i*Math.PI/180)}return null},e.getCameraStateFromMesh=function(t,n){if(t){var i=t.geometry,r=this.getGeometryCenter(i),a=new THREE.Vector3;return a.copy(r),a.z+=n,{target:r,position:a}}return null},e.getCameraStateFromModel=function(t,n){if(t){var i=e.getBoundingBox(t),r=new THREE.Vector3;i.getCenter(r);var a=new THREE.Vector3;return a.y=r.y,a.z+=n,{target:r,position:a}}return null},e.getCameraPositionFromNode=function(t,n,i){if(!t)return null;var r=new THREE.Vector3;r.copy(AFRAME.utils.coordinates.parse(t.position));var a=r.clone().sub(i.clone()).normalize(),o=new THREE.Vector3;return o.copy(r),o.add(a.clone().multiplyScalar(n*U.zoomFactor)),o},e.getNearFromSceneDistance=function(t){return t?t*(1-U.camera.nearFactor):null},e.getFarFromSceneDistance=function(t){return t?t*100:null},e.getBoundingBox=function(t){return new THREE.Box3().setFromObject(t)},e.normalise=function(t,n,i){return(t-n)/(i-n)},e.reverseNumber=function(t,n,i){return i+n-t},e}();rt.cssUnits=["%","ch","cm","em","ex","in","mm","pc","pt","px","rem","vh","vmax","vmin","vw"];var g0=function(){function e(t){Ye(this,t),this._contentStrings=Bh,this.angles=null,this.consoleTabEnabled=!0,this.edges=null,this.graphTabEnabled=!0,this.nodes=null,this.selected=null,this.settingsTabEnabled=!0,this.srcTabEnabled=!0,this.tabContentHeight=null,this.url=null,this.urls=null}return e.prototype._getGraphJson=function(){if(this.nodes&&this.edges&&this.angles){var t=Array.from(this.nodes),n={nodes:t.map(function(i){var r=i[0],a=i[1];return[r,{normal:a.normal?ge.normaliseStringVector3(a.normal):new THREE.Vector3,position:ge.normaliseStringVector3(a.position),scale:ge.normaliseNumber(a.scale),targetId:a.targetId,title:a.title,description:a.description}]}),edges:Array.from(this.edges),angles:Array.from(this.angles)};return JSON.stringify(n)}return""},e.prototype.render=function(){var t=this.tabContentHeight||this.el.parentElement.clientHeight+"px",n=[this.consoleTabEnabled,this.graphTabEnabled,this.settingsTabEnabled,this.srcTabEnabled].filter(Boolean).length;return T("ion-app",null,T("al-tabs",null,n>1?T("ion-tab-bar",null,this.srcTabEnabled?T("ion-tab-button",{tab:"src"},T("ion-icon",{src:Ph}),T("ion-label",null,this._contentStrings.src)):null,this.settingsTabEnabled?T("ion-tab-button",{tab:"settings"},T("ion-icon",{src:Ih}),T("ion-label",null,this._contentStrings.settings)):null,this.graphTabEnabled?T("ion-tab-button",{tab:"graph"},T("ion-icon",{src:Rh}),T("ion-label",null,this._contentStrings.graph)):null,this.consoleTabEnabled?T("ion-tab-button",{tab:"console"},T("ion-icon",{src:Ch}),T("ion-label",null,this._contentStrings.console)):null):null,this.srcTabEnabled?T("ion-tab",{tab:"src"},T("al-view-controls",{"bounding-box-enabled":this.boundingBoxEnabled,"controls-type":this.controlsType}),T("al-url-picker",{urls:this.urls,url:this.url})):null,this.settingsTabEnabled?T("ion-tab",{tab:"settings"},T($o,{height:t},T("al-view-controls",{"bounding-box-enabled":this.boundingBoxEnabled,"controls-type":this.controlsType}),T("al-settings",{"display-mode":this.displayMode,orientation:this.orientation,"slices-index":this.slicesIndex,"slices-max-index":this.slicesMaxIndex,"slices-brightness":this.slicesBrightness,"slices-contrast":this.slicesContrast,"volume-brightness":this.volumeBrightness,"volume-contrast":this.volumeContrast,"volume-steps":this.volumeSteps,"volume-steps-high-enabled":this.volumeStepsHighEnabled}))):null,this.graphTabEnabled?T("ion-tab",{tab:"graph"},T($o,{height:t},T("al-view-controls",{"bounding-box-enabled":this.boundingBoxEnabled,"controls-type":this.controlsType}),T("al-graph-editor",{selected:this.selected,nodes:this.nodes,angles:this.angles,edges:this.edges,"graph-enabled":this.graphEnabled,"graph-visible":this.graphTabEnabled,units:this.units}))):null,this.consoleTabEnabled?T("ion-tab",{tab:"console"},T($o,{height:t},T("al-view-controls",{"bounding-box-enabled":this.boundingBoxEnabled,"controls-type":this.controlsType}),T("al-console",{graph:this._getGraphJson()}))):null))},Object.defineProperty(e.prototype,"el",{get:function(){return ht(this)},enumerable:!0,configurable:!0}),Object.defineProperty(e,"style",{get:function(){return"al-tabs{--ion-tab-bar-border-color:var(--al-item-border-color)}"},enumerable:!0,configurable:!0}),e}(),Fh="Description",Hh="Title",Uh="Update",Gh={delete:"Delete",description:Fh,title:Hh,update:Uh},y0=function(){function e(t){Ye(this,t),this._contentStrings=Gh,this.deleteEdge=ve(this,"deleteEdge",7),this.saveEdge=ve(this,"saveEdge",7)}return e.prototype.render=function(){var t=this;if(this.edge){var n=this.edge,i=n[0],r=n[1];return T("form",{onSubmit:function(a){return a.preventDefault()}},T("ion-item",null,T("ion-input",{id:"title",value:r.title,placeholder:this._contentStrings.title,required:!0,onIonChange:function(a){return r.title=a.detail.value},maxlength:20})),T("ion-item",null,T("ion-textarea",{id:"description",value:r.description,placeholder:this._contentStrings.description,rows:5,onIonChange:function(a){return r.description=a.detail.value},maxlength:280})),T("ion-item",null,T("ion-button",{size:"small",onClick:function(){t.deleteEdge.emit(i),t.edge=null}},T("ion-icon",{src:Gs}),"\xA0",this._contentStrings.delete),T("ion-button",{size:"small",type:"submit",onClick:function(){r.title&&t.saveEdge.emit([i,r])}},T("ion-icon",{src:Vs}),"\xA0",this._contentStrings.update)))}return null},Object.defineProperty(e,"style",{get:function(){return"#title{--background:var(--al-input-background-color);--color:var(--al-input-color);--padding-bottom:var(--al-input-padding-bottom);--padding-end:var(--al-input-padding-end);--padding-start:var(--al-input-padding-start);--padding-top:var(--al-input-padding-top);font-size:var(--al-input-font-size)}#description{--background:var(--al-textarea-background-color);--color:var(--al-textarea-color);--padding-bottom:var(--al-textarea-padding-bottom);--padding-end:var(--al-textarea-padding-end);--padding-start:var(--al-textarea-padding-start);--padding-top:var(--al-textarea-padding-top);font-size:var(--al-textarea-font-size)}"},enumerable:!0,configurable:!0}),e}(),b0=function(){function e(t){Ye(this,t),this.nodes=null,this.angles=null,this.edges=null,this.selected=null}return e.prototype._getSelectedNode=function(){if(this.selected&&this.nodes){var t=this.nodes.get(this.selected);if(t)return[this.selected,t]}return null},e.prototype._getSelectedEdge=function(){if(this.selected&&this.edges){var t=this.edges.get(this.selected);if(t)return[this.selected,t]}return null},e.prototype._getSelectedAngle=function(){if(this.selected&&this.angles){var t=this.angles.get(this.selected);if(t)return[this.selected,t]}return null},e.prototype.render=function(){return[T("al-graph-settings",{"graph-enabled":this.graphEnabled,"graph-visible":this.graphVisible,units:this.units}),T("al-node-list",{nodes:this.nodes,selected:this.selected}),T("ion-item-divider",null),T("al-node-editor",{node:this._getSelectedNode()}),T("al-edge-editor",{edge:this._getSelectedEdge()}),T("al-angle-editor",{angle:this._getSelectedAngle()})]},Object.defineProperty(e,"style",{get:function(){return""},enumerable:!0,configurable:!0}),e}(),Vh="Enable Nodes",Wh="Units",jh="Meters",Yh="Millimeters",Xh={graphEnabled:Vh,units:Wh,meters:jh,millimeters:Yh},x0=function(){function e(t){Ye(this,t),this._contentStrings=Xh,this.unitsChange=ve(this,"unitsChange",7),this.graphEnabledChange=ve(this,"graphEnabledChange",7)}return e.prototype._graphEnabled=function(t){this.graphEnabled=t,this.graphEnabledChange.emit(t)},e.prototype._units=function(t){this.units=t,this.unitsChange.emit(this.units)},e.prototype.renderGraphEnabled=function(){var t=this;return this.graphVisible?T("div",null,T("ion-item",{style:{display:"var(--graph-enabled-display, block)"}},T("span",{title:this._contentStrings.graphEnabled},this._contentStrings.graphEnabled),T("ion-toggle",{slot:"end",checked:this.graphEnabled,onIonChange:function(n){return t._graphEnabled(n.detail.checked)}})),T("ion-item",{style:{display:"var(--units-display, block)"}},T("span",{title:this._contentStrings.units},this._contentStrings.units),T("select",{slot:"end",onChange:function(n){return t._units(n.srcElement.value)}},T("option",{selected:this.units===Wt.MILLIMETERS,value:Wt.MILLIMETERS},this._contentStrings.millimeters),T("option",{selected:this.units===Wt.METERS,value:Wt.METERS},this._contentStrings.meters)))):T("span",null,"hello world")},e.prototype.render=function(){return T("div",{style:{"max-width":"100%","overflow-x":"hidden"}},this.renderGraphEnabled())},Object.defineProperty(e,"style",{get:function(){return"select{padding:5px;min-width:100px;background-color:var(--al-select-background-color);color:var(--al-item-color);border:none}@supports (-moz-appearance:none){select{background-color:#fff!important;color:#000!important}}ion-label{color:var(--al-item-color)}"},enumerable:!0,configurable:!0}),e}(),Zh="Description",qh="Title",Jh="Update",Qh={delete:"Delete",description:Zh,title:qh,update:Jh},_0=function(){function e(t){Ye(this,t),this._contentStrings=Qh,this.deleteNode=ve(this,"deleteNode",7),this.saveNode=ve(this,"saveNode",7)}return e.prototype.render=function(){var t=this;if(this.node){var n=this.node,i=n[0],r=n[1];return T("form",{onSubmit:function(a){return a.preventDefault()}},T("ion-item",null,T("ion-input",{id:"title",value:r.title,placeholder:this._contentStrings.title,required:!0,onIonChange:function(a){return r.title=a.detail.value},maxlength:128})),T("ion-item",null,T("ion-textarea",{id:"description",value:r.description,placeholder:this._contentStrings.description,rows:5,onIonChange:function(a){return r.description=a.detail.value},maxlength:1024})),T("ion-item",null,T("ion-button",{size:"small",onClick:function(){t.deleteNode.emit(i),t.node=null}},T("ion-icon",{src:Gs}),"\xA0",this._contentStrings.delete),T("ion-button",{size:"small",type:"submit",onClick:function(){r.title&&t.saveNode.emit([i,r])}},T("ion-icon",{src:Vs}),"\xA0",this._contentStrings.update)))}return null},Object.defineProperty(e,"style",{get:function(){return"#title{--background:var(--al-input-background-color);--color:var(--al-input-color);--padding-bottom:var(--al-input-padding-bottom);--padding-end:var(--al-input-padding-end);--padding-start:var(--al-input-padding-start);--padding-top:var(--al-input-padding-top);font-size:var(--al-input-font-size)}#description{--background:var(--al-textarea-background-color);--color:var(--al-textarea-color);--padding-bottom:var(--al-textarea-padding-bottom);--padding-end:var(--al-textarea-padding-end);--padding-start:var(--al-textarea-padding-start);--padding-top:var(--al-textarea-padding-top);font-size:var(--al-textarea-font-size)}"},enumerable:!0,configurable:!0}),e}(),$h="No nodes have been placed.",Kh={graphEmpty:$h},w0=function(){function e(t){Ye(this,t),this._contentStrings=Kh,this.nodes=null,this.selected=null,this.selectedChange=ve(this,"selectedChange",7)}return e.prototype.render=function(){var t=this;return this.nodes&&this.nodes.size?T("ion-list",{style:{color:"var(--al-item-color)","border-width":"1px 0 0 0","border-color":"var(--ion-list-header-border-color)","border-style":"solid","margin-top":"10px"}},Array.from(this.nodes).map(function(n){var i=n[0],r=n[1];return T("ion-item",{"data-selected":t.selected===i,onClick:function(){return t.selectedChange.emit(i)}},r.title)})):T("ion-item",{style:{color:"var(--al-item-color)","border-width":"1px 0 0 0","border-color":"var(--ion-list-header-border-color)","border-style":"solid","margin-top":"10px"}},T("p",null,this._contentStrings.graphEmpty))},Object.defineProperty(e,"style",{get:function(){return"ion-item{--color:var(--al-item-color);--border-color:var(--al-item-border-color);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}ion-item[data-selected]{--color:var(--al-item-selected-color)}"},enumerable:!0,configurable:!0}),e}(),ed="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1MTIgNTEyIj48cGF0aCBkPSJNMzIgNDY0aDQ0OEwyNTYgNDggMzIgNDY0em0yNDgtNjRoLTQ4di00OGg0OHY0OHptMC04MGgtNDh2LTk2aDQ4djk2eiIvPjwvc3ZnPg==",td="XY (Top)",nd="Bounds",id="Bounding Box",rd="Level",ad="Clay",od="Width",sd="Controls Type",ld="XZ (Front)",cd="Display Mode",ud="Enable Node Placement",hd="Material",dd="Normals",fd="Orbit",pd="Orientation",md="Origin",vd="Render Steps",gd="Rotate",yd="YZ (Side)",bd="Slice Index",xd="Slices",_d="Slice",wd="Trackball",Ed="Units",Md="Volume",Sd="Render Detail (only increase if you know your device is capable!)",Td="Enable High Res",Ad="Activate High Resolution Mode (Computationally Intensive!)",Ld="Windowing (Brightness/Contrast)",Cd="Wireframe",Rd="XRay",Id={axial:td,bounds:nd,boundingBoxEnabled:id,brightness:rd,clay:ad,contrast:od,controlsType:sd,coronal:ld,default:"Default",displayMode:cd,graphEnabled:ud,material:hd,normals:dd,orbit:fd,orientation:pd,recenter:md,renderSteps:vd,rotate:gd,saggital:yd,sliceIndex:bd,slices:xd,slice:_d,trackball:wd,units:Ed,volume:Md,volumeSteps:Sd,volumeStepsHighEnabled:Td,volumeStepsHighEnabledWarning:Ad,windowingTitle:Ld,wireframe:Cd,xray:Rd},E0=function(){function e(t){Ye(this,t),this._contentStrings=Id,this.displayModeChange=ve(this,"displayModeChange",7),this.orientationChange=ve(this,"orientationChange",7),this.slicesIndexChange=ve(this,"slicesIndexChange",7),this.slicesBrightnessChange=ve(this,"slicesBrightnessChange",7),this.slicesContrastChange=ve(this,"slicesContrastChange",7),this.volumeBrightnessChange=ve(this,"volumeBrightnessChange",7),this.volumeContrastChange=ve(this,"volumeContrastChange",7),this.volumeStepsChange=ve(this,"volumeStepsChange",7),this.volumeStepsHighEnabledChange=ve(this,"volumeStepsHighEnabledChange",7)}return e.prototype._displayMode=function(t){this.displayMode=t,this.displayModeChange.emit(t)},e.prototype._orientation=function(t){this.orientation=t,this.orientationChange.emit(t)},e.prototype._slicesIndex=function(t){this.slicesIndex=t,this.slicesIndexChange.emit(t)},e.prototype._slicesBrightness=function(t){this.slicesBrightness=t,this.slicesBrightnessChange.emit(t)},e.prototype._slicesContrast=function(t){this.slicesContrast=t,this.slicesContrastChange.emit(t)},e.prototype._volumeBrightness=function(t){this.volumeBrightness=t,this.volumeBrightnessChange.emit(t)},e.prototype._volumeContrast=function(t){this.volumeContrast=t,this.volumeContrastChange.emit(t)},e.prototype._volumeSteps=function(t){t=Math.round(t*10)/10,this.volumeSteps=t,this.volumeStepsChange.emit(t)},e.prototype._volumeStepsHighEnabled=function(t){t?this._volumeSteps(this.volumeSteps+.2):this._volumeSteps(this.volumeSteps-.2)},e.prototype.renderDisplayModeToggle=function(){var t=this;return this.displayMode!==Ve.MESH?T("ion-item",{style:{display:"var(--display-mode-display, block)","margin-top":"10px"}},T("span",{title:this._contentStrings.displayMode},"Mode"),T("select",{slot:"end",onChange:function(n){return t._displayMode(n.srcElement.value)}},T("option",{selected:this.displayMode===Ve.SLICES,value:Ve.SLICES},this._contentStrings.slices),T("option",{selected:this.displayMode===Ve.VOLUME,value:Ve.VOLUME},this._contentStrings.volume))):null},e.prototype.renderHiResEnabled=function(){var t=this;return T("ion-item",{style:{display:"var(--volume-steps-high-display, block)"}},T("span",{title:this._contentStrings.volumeStepsHighEnabledWarning},this._contentStrings.volumeStepsHighEnabled," ",T("ion-icon",{src:ed})),T("ion-toggle",{slot:"end",checked:this.volumeStepsHighEnabled,onIonChange:function(n){return t._volumeStepsHighEnabled(n.detail.checked)}}))},e.prototype.renderSlicesControls=function(){var t=this;return T("div",null,T("ion-item",{style:{display:"var(--slices-orientation-display, block)"}},T("span",{color:"primary"},"Plane"),T("select",{slot:"end",onChange:function(n){return t._orientation(n.srcElement.value)}},T("option",{selected:this.orientation===yn.CORONAL,value:yn.CORONAL},this._contentStrings.coronal),T("option",{selected:this.orientation===yn.SAGGITAL,value:yn.SAGGITAL},this._contentStrings.saggital),T("option",{selected:this.orientation===yn.AXIAL,value:yn.AXIAL},this._contentStrings.axial))),T("ion-item",{style:{display:"var(--slices-index-display, block)"}},T("span",null,this._contentStrings.slice),T("ion-range",{slot:"end",min:0,max:1,step:1/this.slicesMaxIndex,value:this.slicesIndex,onIonChange:function(n){return t._slicesIndex(n.detail.value)}})))},e.prototype.renderSlicesWindowingControls=function(){var t=this;return T("div",null,T("ion-list-header",{style:{color:"var(--al-item-color)","border-width":"1px 0 0 0","border-color":"var(--ion-list-header-border-color)","border-style":"solid","margin-top":"10px"}},T("span",null,this._contentStrings.windowingTitle)),T("ion-item",{style:{display:"var(--slices-brightness-display, block)"}},T("span",null,this._contentStrings.brightness),T("ion-range",{slot:"end",min:0,max:1,step:.05,snaps:!0,ticks:!1,value:this.slicesBrightness,onIonChange:function(n){t._slicesBrightness(n.detail.value)}})),T("ion-item",{style:{display:"var(--slices-contrast-display, block)"}},T("span",null,this._contentStrings.contrast),T("ion-range",{slot:"end",min:0,max:1,step:.05,snaps:!0,ticks:!1,value:this.slicesContrast,onIonChange:function(n){return t._slicesContrast(n.detail.value)}})))},e.prototype.renderVolumeWindowingControls=function(){var t=this;return T("div",null,T("ion-list-header",{style:{color:"var(--al-item-color)","border-width":"1px 0 0 0","border-color":"var(--ion-list-header-border-color)","border-style":"solid","margin-top":"10px"}},T("span",null,this._contentStrings.windowingTitle)),T("ion-item",{style:{display:"var(--volume-brightness-display, block)"}},T("span",null,this._contentStrings.brightness),T("ion-range",{slot:"end",min:0,max:1,step:.05,snaps:!0,ticks:!1,value:this.volumeBrightness,onIonChange:function(n){t._volumeBrightness(n.detail.value)}})),T("ion-item",{style:{display:"var(--volume-contrast-display, block)"}},T("span",null,this._contentStrings.contrast),T("ion-range",{slot:"end",min:0,max:1,step:.05,snaps:!0,ticks:!1,value:this.volumeContrast,onIonChange:function(n){return t._volumeContrast(n.detail.value)}})))},e.prototype.renderOptions=function(){switch(this.displayMode){case Ve.SLICES:return T("div",null,this.renderSlicesControls(),this.renderSlicesWindowingControls());case Ve.VOLUME:return T("div",null,this.renderHiResEnabled(),this.renderVolumeWindowingControls());default:return}},e.prototype.render=function(){return T("div",{style:{"max-width":"100%","overflow-x":"hidden"}},this.renderDisplayModeToggle(),this.renderOptions())},Object.defineProperty(e,"style",{get:function(){return"select{padding:5px;min-width:100px;background-color:var(--al-select-background-color);color:var(--al-item-color);border:none}@supports (-moz-appearance:none){select{background-color:#fff!important;color:#000!important}}ion-label{color:var(--al-item-color)}"},enumerable:!0,configurable:!0}),e}(),M0=function(){function e(t){var n=this;Ye(this,t),this.transitioning=!1,this.onTabClicked=function(i){var r=i.detail.tab;n.select(r)},this.ionNavWillLoad=ve(this,"ionNavWillLoad",7),this.ionTabsWillChange=ve(this,"ionTabsWillChange",3),this.ionTabsDidChange=ve(this,"ionTabsDidChange",3)}return e.prototype.componentWillLoad=function(){return te(this,void 0,void 0,function(){var t;return ne(this,function(n){switch(n.label){case 0:return t=this.tabs,[4,this.select(t[0])];case 1:return n.sent(),this.ionNavWillLoad.emit(),[2]}})})},e.prototype.componentWillRender=function(){var t=this.el.querySelector("ion-tab-bar");if(t){var n=this.selectedTab?this.selectedTab.tab:void 0;t.selectedTab=n}},e.prototype.select=function(t){return te(this,void 0,void 0,function(){var n;return ne(this,function(i){switch(i.label){case 0:return[4,this.getTab(t)];case 1:return n=i.sent(),n?this.shouldSwitch(n)?(this.setActive(n),this.tabSwitch(),[2,!0]):[2,!1]:[2,!1]}})})},e.prototype.getTab=function(t){return te(this,void 0,void 0,function(){var n;return ne(this,function(i){return n=typeof t=="string"?this.tabs.find(function(r){return r.tab===t}):t,[2,n]})})},e.prototype.getSelected=function(){return Promise.resolve(this.selectedTab?this.selectedTab.tab:void 0)},e.prototype.setActive=function(t){if(this.transitioning)return Promise.reject("transitioning already happening");this.transitioning=!0,this.leavingTab=this.selectedTab,this.selectedTab=t,this.ionTabsWillChange.emit({tab:t.tab});try{t.setActive()}catch{}return!0},e.prototype.tabSwitch=function(){var t=this.selectedTab,n=this.leavingTab;this.leavingTab=void 0,this.transitioning=!1,t&&n!==t&&(n&&(n.active=!1),this.ionTabsDidChange.emit({tab:t.tab}))},e.prototype.shouldSwitch=function(t){var n=this.selectedTab;return t!==void 0&&t!==n&&!this.transitioning},Object.defineProperty(e.prototype,"tabs",{get:function(){return Array.from(this.el.querySelectorAll("ion-tab"))},enumerable:!0,configurable:!0}),e.prototype.render=function(){return T(ut,{onIonTabButtonClick:this.onTabClicked},T("slot",{name:"top"}),T("div",{class:"tabs-inner"},T("slot",null)),T("slot",{name:"bottom"}))},Object.defineProperty(e.prototype,"el",{get:function(){return ht(this)},enumerable:!0,configurable:!0}),Object.defineProperty(e,"style",{get:function(){return":host{z-index:var(--z-index-page-container);--ion-tab-bar-color:var(--al-item-color)}.tabs-inner{position:relative}"},enumerable:!0,configurable:!0}),e}(),Pd="data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgNTEyIDUxMiIgY2xhc3M9InMtaW9uLWljb24iPjxwYXRoIGQ9Ik0yNTYgMzg4Yy03Mi41OTcgMC0xMzItNTkuNDA1LTEzMi0xMzIgMC03Mi42MDEgNTkuNDAzLTEzMiAxMzItMTMyIDM2LjMgMCA2OS4yOTkgMTUuNCA5Mi40MDYgMzkuNjAxTDI3OCAyMzRoMTU0VjgwbC01MS42OTggNTEuNzAyQzM0OC40MDYgOTkuNzk4IDMwNC40MDYgODAgMjU2IDgwYy05Ni43OTcgMC0xNzYgNzkuMjAzLTE3NiAxNzZzNzguMDk0IDE3NiAxNzYgMTc2YzgxLjA0NSAwIDE0OC4yODctNTQuMTM0IDE2OS40MDEtMTI4SDM3OC44NWMtMTguNzQ1IDQ5LjU2MS02Ny4xMzggODQtMTIyLjg1IDg0eiI+PC9wYXRoPjwvc3ZnPgo=",S0=function(){function e(t){Ye(this,t),this.urls=null,this.url=null,this.urlChange=ve(this,"urlChange",7)}return e.prototype.render=function(){var t=this;return this.urls?T("form",{onSubmit:function(n){return n.preventDefault()}},T("ion-item",null,T("ion-select",{id:"select",value:this.url,interface:"popover",placeholder:"",onIonChange:function(n){return t.urlChange.emit(n.detail.value)}},Array.from(this.urls).map(function(n){var i=n[0],r=n[1];return T("ion-select-option",{value:i},r)}))),T("ion-item",null,T("ion-input",{id:"input",type:"url",size:100,placeholder:"src",required:!0,value:this.url,ref:function(n){return t._input=n}})),T("ion-item",null,T("ion-button",{id:"submit",size:"small",type:"submit",onClick:function(){return t.urlChange.emit(t._input.value)}},T("ion-icon",{src:Pd}),"\xA0Load"))):null},Object.defineProperty(e,"style",{get:function(){return"#select{--padding-start:0px;width:100%;max-width:100%!important}#input{--background:var(--al-input-background-color);--color:var(--al-input-color);--padding-start:var(--al-input-padding-start)}"},enumerable:!0,configurable:!0}),e}(),Od="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDIzLjAuNiwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCAzNjAgMzYwIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCAzNjAgMzYwOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxwYXRoIGQ9Ik0xOTcuNSwzNTIuNGgtMzVWMTgwLjlMOC40LDEwM2MtOC42LTQuNC0xMi4xLTE0LjktNy43LTIzLjVjNC40LTguNiwxNC45LTEyLjEsMjMuNS03LjdMMTgwLDE1MC41bDE1Ni43LTc4LjhsMTUuNywzMS4zCglsLTE1NC45LDc3LjlWMzUyLjR6Ii8+CjxjaXJjbGUgY2xhc3M9InN0MCIgY3g9IjE4MCIgY3k9IjE4MCIgcj0iNzUuOSIvPgo8cGF0aCBkPSJNMTgwLDM2OS45Yy0yLjcsMC01LjQtMC42LTcuOS0xLjlMOC40LDI4NS4zYy01LjktMy05LjYtOS05LjYtMTUuNlY4Ny40YzAtNi43LDMuOC0xMi44LDkuOS0xNS43TDE3Mi40LTcuOQoJYzQuOC0yLjMsMTAuNC0yLjMsMTUuMywwbD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OC42djczLjlDMTQ2LjgsODkuMiw1OS43LDE3OCw1OS43LDI4Ni40Ii8+CjxjaXJjbGUgY3g9IjMwMyIgY3k9IjM1MS40IiByPSIxMDQiLz4KPC9zdmc+Cg==",zd="XY (Top)",Fd="Bounds",Hd="Bounding Box",Ud="Level",Gd="Clay",Vd="Width",Wd="Controls Type",jd="XZ (Front)",Yd="Display Mode",Xd="Enable Node Placement",Zd="Material",qd="Meters",Jd="Millimeters",Qd="Normals",$d="Orbit",Kd="Orientation",ef="Origin",tf="Render Steps",nf="Rotate",rf="YZ (Side)",af="Slice Index",of="Slices",sf="Slice",lf="Trackball",cf="Units",uf="Volume",hf="Render Detail (only increase if you know your device is capable!)",df="Enable High Res",ff="Activate High Resolution Mode (Computationally Intensive!)",pf="Windowing (Brightness/Contrast)",mf="Wireframe",vf="XRay",gf={axial:zd,bounds:Fd,boundingBoxEnabled:Hd,brightness:Ud,clay:Gd,contrast:Vd,controlsType:Wd,coronal:jd,default:"Default",displayMode:Yd,graphEnabled:Xd,material:Zd,meters:qd,millimeters:Jd,normals:Qd,orbit:$d,orientation:Kd,recenter:ef,renderSteps:tf,rotate:nf,saggital:rf,sliceIndex:af,slices:of,slice:sf,trackball:lf,units:cf,volume:uf,volumeSteps:hf,volumeStepsHighEnabled:df,volumeStepsHighEnabledWarning:ff,windowingTitle:pf,wireframe:mf,xray:vf},T0=function(){function e(t){Ye(this,t),this._contentStrings=gf,this.boundingBoxEnabledChange=ve(this,"boundingBoxEnabledChange",7),this.controlsTypeChange=ve(this,"controlsTypeChange",7),this.recenter=ve(this,"recenter",7)}return e.prototype._boundingBoxEnabled=function(t){this.boundingBoxEnabled=t,this.boundingBoxEnabledChange.emit(t)},e.prototype._controlsType=function(t){this.controlsType=t,this.controlsTypeChange.emit(t)},e.prototype._switchBoundingBoxEnabled=function(){this.boundingBoxEnabled?this._boundingBoxEnabled(!1):this._boundingBoxEnabled(!0)},e.prototype._switchControls=function(){this.controlsType===Ft.ORBIT?this._controlsType(Ft.TRACKBALL):this.controlsType===Ft.TRACKBALL&&this._controlsType(Ft.ORBIT)},e.prototype.renderControlsTypeSelect=function(){var t=this,n,i;this.controlsType===Ft.ORBIT?(n=kd,i=this._contentStrings.orbit):this.controlsType===Ft.TRACKBALL&&(n=Bd,i=this._contentStrings.rotate);var r;return this.boundingBoxEnabled?r=Od:r=Dd,T("div",{style:{"margin-top":"10px","text-align":"center"}},T("ion-button",{style:{width:"28%",height:"45px","margin-left":"5px","margin-right":"5px"},size:"small",onClick:function(){t._switchControls()}},T("div",{style:{"font-size":"10px",color:"white","margin-bottom":"2px"}},T("ion-icon",{style:{"min-width":"20px","min-height":"20px","margin-bottom":"2px"},src:n,title:i}),T("br",null),i)),T("ion-button",{style:{width:"28%",height:"45px","margin-left":"5px","margin-right":"5px"},size:"small",onClick:function(){t.recenter.emit()}},T("div",{style:{"font-size":"10px",color:"white","margin-bottom":"2px"}},T("ion-icon",{style:{"min-width":"20px","min-height":"20px","margin-bottom":"2px"},src:Nd,title:this._contentStrings.recenter}),T("br",null),this._contentStrings.recenter)),T("ion-button",{style:{width:"28%",height:"45px","margin-left":"5px","margin-right":"5px"},size:"small",onClick:function(){t._switchBoundingBoxEnabled()}},T("div",{style:{"font-size":"10px",color:"white","margin-bottom":"2px"}},T("ion-icon",{style:{"min-width":"20px","min-height":"20px","margin-bottom":"2px"},src:r,title:this._contentStrings.bounds}),T("br",null),this._contentStrings.bounds)))},e.prototype.render=function(){return T("div",{style:{"max-width":"100%","overflow-x":"hidden","border-width":"0 0 1px 0","border-color":"var(--ion-list-header-border-color)","border-style":"solid","padding-bottom":"10px","margin-bottom":"10px"}},this.renderControlsTypeSelect())},Object.defineProperty(e,"style",{get:function(){return"select{padding:5px;min-width:100px;background-color:var(--al-select-background-color);color:var(--al-item-color);border:none}@supports (-moz-appearance:none){select{background-color:#fff!important;color:#000!important}}ion-label{color:var(--al-item-color)}"},enumerable:!0,configurable:!0}),e}(),vs;(function(e){e[e.Backspace=8]="Backspace",e[e.Tab=9]="Tab",e[e.Enter=13]="Enter",e[e.Shift=16]="Shift",e[e.Ctrl=17]="Ctrl",e[e.Alt=18]="Alt",e[e.PauseBreak=19]="PauseBreak",e[e.CapsLock=20]="CapsLock",e[e.Escape=27]="Escape",e[e.Spacebar=32]="Spacebar",e[e.PageUp=33]="PageUp",e[e.PageDown=34]="PageDown",e[e.End=35]="End",e[e.Home=36]="Home",e[e.LeftArrow=37]="LeftArrow",e[e.UpArrow=38]="UpArrow",e[e.RightArrow=39]="RightArrow",e[e.DownArrow=40]="DownArrow",e[e.PrintScrn=44]="PrintScrn",e[e.Insert=45]="Insert",e[e.Delete=46]="Delete",e[e.Zero=48]="Zero",e[e.One=49]="One",e[e.Two=50]="Two",e[e.Three=51]="Three",e[e.Four=52]="Four",e[e.Five=53]="Five",e[e.Six=54]="Six",e[e.Seven=55]="Seven",e[e.Eight=56]="Eight",e[e.Nine=57]="Nine",e[e.a=65]="a",e[e.b=66]="b",e[e.c=67]="c",e[e.d=68]="d",e[e.e=69]="e",e[e.f=70]="f",e[e.g=71]="g",e[e.h=72]="h",e[e.i=73]="i",e[e.j=74]="j",e[e.k=75]="k",e[e.l=76]="l",e[e.m=77]="m",e[e.n=78]="n",e[e.o=79]="o",e[e.p=80]="p",e[e.q=81]="q",e[e.r=82]="r",e[e.s=83]="s",e[e.t=84]="t",e[e.u=85]="u",e[e.v=86]="v",e[e.w=87]="w",e[e.x=88]="x",e[e.y=89]="y",e[e.z=90]="z",e[e.LeftWindowKey=91]="LeftWindowKey",e[e.RightWindowKey=92]="RightWindowKey",e[e.SelectKey=93]="SelectKey",e[e.Numpad0=96]="Numpad0",e[e.Numpad1=97]="Numpad1",e[e.Numpad2=98]="Numpad2",e[e.Numpad3=99]="Numpad3",e[e.Numpad4=100]="Numpad4",e[e.Numpad5=101]="Numpad5",e[e.Numpad6=102]="Numpad6",e[e.Numpad7=103]="Numpad7",e[e.Numpad8=104]="Numpad8",e[e.Numpad9=105]="Numpad9",e[e.Multiply=106]="Multiply",e[e.NumpadPlus=107]="NumpadPlus",e[e.NumpadMinus=109]="NumpadMinus",e[e.DecimalPoint=110]="DecimalPoint",e[e.Divide=111]="Divide",e[e.F1=112]="F1",e[e.F2=113]="F2",e[e.F3=114]="F3",e[e.F4=115]="F4",e[e.F5=116]="F5",e[e.F6=117]="F6",e[e.F7=118]="F7",e[e.F8=119]="F8",e[e.F9=120]="F9",e[e.F10=121]="F10",e[e.F11=122]="F11",e[e.F12=123]="F12",e[e.NumLock=144]="NumLock",e[e.ScrollLock=145]="ScrollLock",e[e.Semicolon=186]="Semicolon",e[e.Equals=187]="Equals",e[e.Comma=188]="Comma",e[e.LessThan=188]="LessThan",e[e.Dash=189]="Dash",e[e.Period=190]="Period",e[e.GreaterThan=190]="GreaterThan",e[e.ForwardSlash=191]="ForwardSlash",e[e.QuestionMark=191]="QuestionMark",e[e.GraveAccent=192]="GraveAccent",e[e.Tilde=192]="Tilde",e[e.OpenCurlyBracket=219]="OpenCurlyBracket",e[e.OpenSquareBracket=219]="OpenSquareBracket",e[e.BackSlash=220]="BackSlash",e[e.VerticalPipe=220]="VerticalPipe",e[e.CloseCurlyBracket=221]="CloseCurlyBracket",e[e.CloseSquareBracket=221]="CloseSquareBracket",e[e.Quote=222]="Quote",e[e.CommandFF=224]="CommandFF"})(vs||(vs={}));var Fl;(function(e){e[e.Backspace=8]="Backspace",e[e.Ente