diff --git a/angular.json b/angular.json index c273426..2a0d154 100644 --- a/angular.json +++ b/angular.json @@ -3,48 +3,6 @@ "version": 1, "newProjectRoot": "projects", "projects": { - "ngx-structure-viewer": { - "projectType": "library", - "root": "projects/ngx-structure-viewer", - "sourceRoot": "projects/ngx-structure-viewer/src", - "prefix": "lib", - "architect": { - "build": { - "builder": "@angular-devkit/build-angular:ng-packagr", - "options": { - "project": "projects/ngx-structure-viewer/ng-package.json" - }, - "configurations": { - "production": { - "tsConfig": "projects/ngx-structure-viewer/tsconfig.lib.prod.json" - }, - "development": { - "tsConfig": "projects/ngx-structure-viewer/tsconfig.lib.json" - } - }, - "defaultConfiguration": "production" - }, - "test": { - "builder": "@angular-devkit/build-angular:karma", - "options": { - "tsConfig": "projects/ngx-structure-viewer/tsconfig.spec.json", - "polyfills": [ - "zone.js", - "zone.js/testing" - ] - } - }, - "lint": { - "builder": "@angular-eslint/builder:lint", - "options": { - "lintFilePatterns": [ - "projects/ngx-structure-viewer/**/*.ts", - "projects/ngx-structure-viewer/**/*.html" - ] - } - } - } - }, "demo-showcase": { "projectType": "application", "schematics": { @@ -148,6 +106,48 @@ } } }, + "ngx-structure-viewer": { + "projectType": "library", + "root": "projects/ngx-structure-viewer", + "sourceRoot": "projects/ngx-structure-viewer/src", + "prefix": "lib", + "architect": { + "build": { + "builder": "@angular-devkit/build-angular:ng-packagr", + "options": { + "project": "projects/ngx-structure-viewer/ng-package.json" + }, + "configurations": { + "production": { + "tsConfig": "projects/ngx-structure-viewer/tsconfig.lib.prod.json" + }, + "development": { + "tsConfig": "projects/ngx-structure-viewer/tsconfig.lib.json" + } + }, + "defaultConfiguration": "production" + }, + "test": { + "builder": "@angular-devkit/build-angular:karma", + "options": { + "tsConfig": "projects/ngx-structure-viewer/tsconfig.spec.json", + "polyfills": [ + "zone.js", + "zone.js/testing" + ] + } + }, + "lint": { + "builder": "@angular-eslint/builder:lint", + "options": { + "lintFilePatterns": [ + "projects/ngx-structure-viewer/**/*.ts", + "projects/ngx-structure-viewer/**/*.html" + ] + } + } + } + }, "ngx-features-viewer": { "projectType": "library", "root": "projects/ngx-features-viewer", diff --git a/docs/404.html b/docs/404.html deleted file mode 100644 index 82ff858..0000000 --- a/docs/404.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - DemoShowcase - - - - - - - - - - - - - - - diff --git a/docs/index.html b/docs/index.html index 82ff858..5f011f4 100644 --- a/docs/index.html +++ b/docs/index.html @@ -16,5 +16,5 @@ - + diff --git a/docs/main.1b66eaab77c1d65c.js b/docs/main.4c3c95c0f98aa07c.js similarity index 96% rename from docs/main.1b66eaab77c1d65c.js rename to docs/main.4c3c95c0f98aa07c.js index 60e540c..773bca4 100644 --- a/docs/main.1b66eaab77c1d65c.js +++ b/docs/main.4c3c95c0f98aa07c.js @@ -1 +1 @@ -(self.webpackChunkdemo_showcase=self.webpackChunkdemo_showcase||[]).push([[179],{872:(V1,nV,Nr)=>{"use strict";var z1={};Nr.r(z1),Nr.d(z1,{atomicHet:()=>W4e,atomicSequence:()=>j4e,bundleElementImpl:()=>AZ,bundleGenerator:()=>TZ,defaultBondTest:()=>nF,spheres:()=>Y4e,water:()=>q4e});var eP={};Nr.r(eP),Nr.d(eP,{all:()=>IZ,atoms:()=>oF,bondedAtomicPairs:()=>nke,chains:()=>Z4e,none:()=>iF,querySelection:()=>rke,residues:()=>K4e,rings:()=>tke});var tP={};Nr.r(tP),Nr.d(tP,{exceptBy:()=>YFe,expandProperty:()=>KFe,includeConnected:()=>ZFe,includeSurroundings:()=>jFe,intersectBy:()=>WFe,querySelection:()=>qFe,surroundingLigands:()=>$Fe,union:()=>XFe,wholeResidues:()=>zFe});var rP={};Nr.r(rP),Nr.d(rP,{areIntersectedBy:()=>lNe,first:()=>sNe,getCurrentStructureProperties:()=>$T,isConnectedTo:()=>vNe,pick:()=>oNe,withSameAtomProperties:()=>cNe,within:()=>fNe});var nP={};Nr.r(nP),Nr.d(nP,{intersect:()=>yNe,merge:()=>gNe});var aP={};Nr.r(aP),Nr.d(aP,{atomCount:()=>bNe,countQuery:()=>_Ne,propertySet:()=>SNe});var iP={};Nr.r(iP),Nr.d(iP,{Download:()=>ZJ,DownloadBlob:()=>QJ,ImportJson:()=>m8e,ImportString:()=>h8e,LazyVolume:()=>g8e,ParseBlob:()=>a8e,ParseCcp4:()=>f8e,ParseCif:()=>i8e,ParseCube:()=>o8e,ParseDsn6:()=>d8e,ParseDx:()=>p8e,ParseJson:()=>v8e,ParsePly:()=>l8e,ParsePrmtop:()=>u8e,ParsePsf:()=>s8e,ParseTop:()=>c8e,RawData:()=>$J,ReadFile:()=>JJ});var oP={};Nr.r(oP),Nr.d(oP,{CreateGroup:()=>y8e});var sP={};Nr.r(sP),Nr.d(sP,{CoordinatesFromDcd:()=>Zqe,CoordinatesFromNctraj:()=>Jqe,CoordinatesFromTrr:()=>$qe,CoordinatesFromXtc:()=>Qqe,CustomModelProperties:()=>Hre,CustomStructureProperties:()=>qre,ModelFromTrajectory:()=>Lre,MultiStructureSelectionFromExpression:()=>_We,ShapeFromPly:()=>TWe,StructureComplexElement:()=>wWe,StructureComplexElementTypes:()=>Gre,StructureComponent:()=>AWe,StructureFromModel:()=>gWe,StructureFromTrajectory:()=>vWe,StructureSelectionFromBundle:()=>CWe,StructureSelectionFromExpression:()=>bWe,StructureSelectionFromScript:()=>SWe,TopologyFromPrmtop:()=>tWe,TopologyFromPsf:()=>eWe,TopologyFromTop:()=>rWe,TrajectoryFromBlob:()=>aWe,TrajectoryFromCifCore:()=>pWe,TrajectoryFromCube:()=>dWe,TrajectoryFromGRO:()=>sWe,TrajectoryFromMOL:()=>cWe,TrajectoryFromMOL2:()=>fWe,TrajectoryFromMmCif:()=>iWe,TrajectoryFromModelAndCoordinates:()=>w5,TrajectoryFromPDB:()=>oWe,TrajectoryFromSDF:()=>lWe,TrajectoryFromXYZ:()=>uWe,TransformStructureConformation:()=>yWe});var uP={};Nr.r(uP),Nr.d(uP,{AssignColorVolume:()=>UWe,VolumeFromCcp4:()=>kWe,VolumeFromCube:()=>FWe,VolumeFromDensityServerCif:()=>BWe,VolumeFromDsn6:()=>OWe,VolumeFromDx:()=>NWe,VolumeFromSegmentationCif:()=>LWe});var cP={};Nr.r(cP),Nr.d(cP,{BoxShape3D:()=>lQe,getBoxMesh:()=>dL});var lP={};Nr.r(lP),Nr.d(lP,{ClippingStructureRepresentation3DFromBundle:()=>EQe,ClippingStructureRepresentation3DFromScript:()=>DQe,ExplodeStructureRepresentation3D:()=>bQe,ModelUnitcell3D:()=>RQe,OverpaintStructureRepresentation3DFromBundle:()=>CQe,OverpaintStructureRepresentation3DFromScript:()=>SQe,ShapeRepresentation3D:()=>MQe,SpinStructureRepresentation3D:()=>_Qe,StructureBoundingBox3D:()=>kQe,StructureRepresentation3D:()=>GE,StructureSelectionsAngle3D:()=>FQe,StructureSelectionsDihedral3D:()=>NQe,StructureSelectionsDistance3D:()=>OQe,StructureSelectionsLabel3D:()=>BQe,StructureSelectionsOrientation3D:()=>LQe,StructureSelectionsPlane3D:()=>UQe,SubstanceStructureRepresentation3DFromBundle:()=>TQe,SubstanceStructureRepresentation3DFromScript:()=>AQe,ThemeStrengthRepresentation3D:()=>IQe,TransparencyStructureRepresentation3DFromBundle:()=>wQe,TransparencyStructureRepresentation3DFromScript:()=>xQe,UnwindStructureAssemblyRepresentation3D:()=>yQe,VolumeRepresentation3D:()=>PQe,VolumeRepresentation3DHelpers:()=>gd});var fP={};Nr.r(fP),Nr.d(fP,{ApplyAction:()=>kie,ClearHighlights:()=>Lie,Highlight:()=>Bie,RemoveObject:()=>Oie,SetCurrentObject:()=>Mie,Snapshots:()=>Uie,SyncBehaviors:()=>Pie,ToggleExpanded:()=>Fie,ToggleVisibility:()=>Nie,Update:()=>Rie,registerDefault:()=>e$e,setSubtreeVisibility:()=>Bb});var dP={};Nr.r(dP),Nr.d(dP,{SyncRepresentationToCanvas:()=>Vie,SyncStructureRepresentation3DState:()=>zie,UpdateRepresentationVisibility:()=>Gie,registerDefault:()=>r$e});var pP={};Nr.r(pP),Nr.d(pP,{Focus:()=>qie,OrientAxes:()=>Wie,Reset:()=>Hie,ResetAxes:()=>Yie,SetSnapshot:()=>jie,registerDefault:()=>n$e});var hP={};Nr.r(hP),Nr.d(hP,{Canvas3DSetSettings:()=>Moe,registerDefault:()=>ket});var mP={};Nr.r(mP),Nr.d(mP,{DefaultFocusLociBindings:()=>koe,DefaultLociLabelProvider:()=>Uet,DefaultSelectLociBindings:()=>Roe,FocusLoci:()=>zet,HighlightLoci:()=>Net,SelectLoci:()=>Let});var vP={};Nr.r(vP),Nr.d(vP,{CameraAxisHelper:()=>jet,CameraControls:()=>Wet,DefaultClickResetCameraOnEmpty:()=>FL,DefaultClickResetCameraOnEmptySelectMode:()=>NL,DefaultFocusLociBindings:()=>Ooe,FocusLoci:()=>Het});var gP={};Nr.r(gP),Nr.d(gP,{AccessibleSurfaceArea:()=>rtt,BestDatabaseSequenceMapping:()=>hat,CrossLinkRestraint:()=>Pat,Interactions:()=>cat,SecondaryStructure:()=>lat,StructureInfo:()=>Yet,ValenceModel:()=>fat});var yP={};Nr.r(yP),Nr.d(yP,{AddTrajectory:()=>pit,DownloadStructure:()=>oit,EnableModelCustomProps:()=>fit,EnableStructureCustomProps:()=>dit,LoadTrajectory:()=>hit,PdbDownloadProvider:()=>uue,UpdateTrajectory:()=>lit});var bP={};Nr.r(bP),Nr.d(bP,{AssignColorVolume:()=>cue,DownloadDensity:()=>mit});var _P={};function aV(e,t,r,n,a,i,o){try{var s=e[i](o),u=s.value}catch(c){return void r(c)}s.done?t(u):Promise.resolve(u).then(n,a)}function Sx(e){return function(){var t=this,r=arguments;return new Promise(function(n,a){var i=e.apply(t,r);function o(u){aV(i,n,a,o,s,"next",u)}function s(u){aV(i,n,a,o,s,"throw",u)}o(void 0)})}}Nr.r(_P),Nr.d(_P,{DownloadFile:()=>vit,OpenFiles:()=>lue});let xo=null,Cx=1;const c0=Symbol("SIGNAL");function Si(e){const t=xo;return xo=e,t}function iV(e){if((!H1(e)||e.dirty)&&(e.dirty||e.lastCleanEpoch!==Cx)){if(!e.producerMustRecompute(e)&&!CP(e))return e.dirty=!1,void(e.lastCleanEpoch=Cx);e.producerRecomputeValue(e),e.dirty=!1,e.lastCleanEpoch=Cx}}function CP(e){l0(e);for(let t=0;t0}function l0(e){e.producerNode??=[],e.producerIndexOfThis??=[],e.producerLastReadVersion??=[]}let hV=null;function Ga(e){return"function"==typeof e}function wP(e){const r=e(n=>{Error.call(n),n.stack=(new Error).stack});return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}const AP=wP(e=>function(r){e(this),this.message=r?`${r.length} errors occurred during unsubscription:\n${r.map((n,a)=>`${a+1}) ${n.toString()}`).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=r});function wx(e,t){if(e){const r=e.indexOf(t);0<=r&&e.splice(r,1)}}class js{constructor(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}unsubscribe(){let t;if(!this.closed){this.closed=!0;const{_parentage:r}=this;if(r)if(this._parentage=null,Array.isArray(r))for(const i of r)i.remove(this);else r.remove(this);const{initialTeardown:n}=this;if(Ga(n))try{n()}catch(i){t=i instanceof AP?i.errors:[i]}const{_finalizers:a}=this;if(a){this._finalizers=null;for(const i of a)try{bV(i)}catch(o){t=t??[],o instanceof AP?t=[...t,...o.errors]:t.push(o)}}if(t)throw new AP(t)}}add(t){var r;if(t&&t!==this)if(this.closed)bV(t);else{if(t instanceof js){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(r=this._finalizers)&&void 0!==r?r:[]).push(t)}}_hasParent(t){const{_parentage:r}=this;return r===t||Array.isArray(r)&&r.includes(t)}_addParent(t){const{_parentage:r}=this;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t}_removeParent(t){const{_parentage:r}=this;r===t?this._parentage=null:Array.isArray(r)&&wx(r,t)}remove(t){const{_finalizers:r}=this;r&&wx(r,t),t instanceof js&&t._removeParent(this)}}js.EMPTY=(()=>{const e=new js;return e.closed=!0,e})();const gV=js.EMPTY;function yV(e){return e instanceof js||e&&"closed"in e&&Ga(e.remove)&&Ga(e.add)&&Ga(e.unsubscribe)}function bV(e){Ga(e)?e():e.unsubscribe()}const rv={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Ax={setTimeout(e,t,...r){const{delegate:n}=Ax;return n?.setTimeout?n.setTimeout(e,t,...r):setTimeout(e,t,...r)},clearTimeout(e){const{delegate:t}=Ax;return(t?.clearTimeout||clearTimeout)(e)},delegate:void 0};function _V(e){Ax.setTimeout(()=>{const{onUnhandledError:t}=rv;if(!t)throw e;t(e)})}function TP(){}const Bpe=DP("C",void 0,void 0);function DP(e,t,r){return{kind:e,value:t,error:r}}let nv=null;function Tx(e){if(rv.useDeprecatedSynchronousErrorHandling){const t=!nv;if(t&&(nv={errorThrown:!1,error:null}),e(),t){const{errorThrown:r,error:n}=nv;if(nv=null,r)throw n}}else e()}class EP extends js{constructor(t){super(),this.isStopped=!1,t?(this.destination=t,yV(t)&&t.add(this)):this.destination=jpe}static create(t,r,n){return new j1(t,r,n)}next(t){this.isStopped?PP(function Upe(e){return DP("N",e,void 0)}(t),this):this._next(t)}error(t){this.isStopped?PP(function Lpe(e){return DP("E",void 0,e)}(t),this):(this.isStopped=!0,this._error(t))}complete(){this.isStopped?PP(Bpe,this):(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe(),this.destination=null)}_next(t){this.destination.next(t)}_error(t){try{this.destination.error(t)}finally{this.unsubscribe()}}_complete(){try{this.destination.complete()}finally{this.unsubscribe()}}}const zpe=Function.prototype.bind;function IP(e,t){return zpe.call(e,t)}class Gpe{constructor(t){this.partialObserver=t}next(t){const{partialObserver:r}=this;if(r.next)try{r.next(t)}catch(n){Dx(n)}}error(t){const{partialObserver:r}=this;if(r.error)try{r.error(t)}catch(n){Dx(n)}else Dx(t)}complete(){const{partialObserver:t}=this;if(t.complete)try{t.complete()}catch(r){Dx(r)}}}class j1 extends EP{constructor(t,r,n){let a;if(super(),Ga(t)||!t)a={next:t??void 0,error:r??void 0,complete:n??void 0};else{let i;this&&rv.useDeprecatedNextContext?(i=Object.create(t),i.unsubscribe=()=>this.unsubscribe(),a={next:t.next&&IP(t.next,i),error:t.error&&IP(t.error,i),complete:t.complete&&IP(t.complete,i)}):a=t}this.destination=new Gpe(a)}}function Dx(e){rv.useDeprecatedSynchronousErrorHandling?function Vpe(e){rv.useDeprecatedSynchronousErrorHandling&&nv&&(nv.errorThrown=!0,nv.error=e)}(e):_V(e)}function PP(e,t){const{onStoppedNotification:r}=rv;r&&Ax.setTimeout(()=>r(e,t))}const jpe={closed:!0,next:TP,error:function Hpe(e){throw e},complete:TP},MP="function"==typeof Symbol&&Symbol.observable||"@@observable";function Ch(e){return e}function SV(...e){return CV(e)}function CV(e){return 0===e.length?Ch:1===e.length?e[0]:function(r){return e.reduce((n,a)=>a(n),r)}}let No=(()=>{class e{constructor(r){r&&(this._subscribe=r)}lift(r){const n=new e;return n.source=this,n.operator=r,n}subscribe(r,n,a){const i=function Wpe(e){return e&&e instanceof EP||function qpe(e){return e&&Ga(e.next)&&Ga(e.error)&&Ga(e.complete)}(e)&&yV(e)}(r)?r:new j1(r,n,a);return Tx(()=>{const{operator:o,source:s}=this;i.add(o?o.call(i,s):s?this._subscribe(i):this._trySubscribe(i))}),i}_trySubscribe(r){try{return this._subscribe(r)}catch(n){r.error(n)}}forEach(r,n){return new(n=xV(n))((a,i)=>{const o=new j1({next:s=>{try{r(s)}catch(u){i(u),o.unsubscribe()}},error:i,complete:a});this.subscribe(o)})}_subscribe(r){var n;return null===(n=this.source)||void 0===n?void 0:n.subscribe(r)}[MP](){return this}pipe(...r){return CV(r)(this)}toPromise(r){return new(r=xV(r))((n,a)=>{let i;this.subscribe(o=>i=o,o=>a(o),()=>n(i))})}}return e.create=t=>new e(t),e})();function xV(e){var t;return null!==(t=e??rv.Promise)&&void 0!==t?t:Promise}const Ype=wP(e=>function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"});let Cn=(()=>{class e extends No{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(r){const n=new wV(this,this);return n.operator=r,n}_throwIfClosed(){if(this.closed)throw new Ype}next(r){Tx(()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(const n of this.currentObservers)n.next(r)}})}error(r){Tx(()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=r;const{observers:n}=this;for(;n.length;)n.shift().error(r)}})}complete(){Tx(()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;const{observers:r}=this;for(;r.length;)r.shift().complete()}})}unsubscribe(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null}get observed(){var r;return(null===(r=this.observers)||void 0===r?void 0:r.length)>0}_trySubscribe(r){return this._throwIfClosed(),super._trySubscribe(r)}_subscribe(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)}_innerSubscribe(r){const{hasError:n,isStopped:a,observers:i}=this;return n||a?gV:(this.currentObservers=null,i.push(r),new js(()=>{this.currentObservers=null,wx(i,r)}))}_checkFinalizedStatuses(r){const{hasError:n,thrownError:a,isStopped:i}=this;n?r.error(a):i&&r.complete()}asObservable(){const r=new No;return r.source=this,r}}return e.create=(t,r)=>new wV(t,r),e})();class wV extends Cn{constructor(t,r){super(),this.destination=t,this.source=r}next(t){var r,n;null===(n=null===(r=this.destination)||void 0===r?void 0:r.next)||void 0===n||n.call(r,t)}error(t){var r,n;null===(n=null===(r=this.destination)||void 0===r?void 0:r.error)||void 0===n||n.call(r,t)}complete(){var t,r;null===(r=null===(t=this.destination)||void 0===t?void 0:t.complete)||void 0===r||r.call(t)}_subscribe(t){var r,n;return null!==(n=null===(r=this.source)||void 0===r?void 0:r.subscribe(t))&&void 0!==n?n:gV}}class Ui extends Cn{constructor(t){super(),this._value=t}get value(){return this.getValue()}_subscribe(t){const r=super._subscribe(t);return!r.closed&&t.next(this._value),r}getValue(){const{hasError:t,thrownError:r,_value:n}=this;if(t)throw r;return this._throwIfClosed(),n}next(t){super.next(this._value=t)}}function AV(e){return Ga(e?.lift)}function Ci(e){return t=>{if(AV(t))return t.lift(function(r){try{return e(r,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function xi(e,t,r,n,a){return new Xpe(e,t,r,n,a)}class Xpe extends EP{constructor(t,r,n,a,i,o){super(t),this.onFinalize=i,this.shouldUnsubscribe=o,this._next=r?function(s){try{r(s)}catch(u){t.error(u)}}:super._next,this._error=a?function(s){try{a(s)}catch(u){t.error(u)}finally{this.unsubscribe()}}:super._error,this._complete=n?function(){try{n()}catch(s){t.error(s)}finally{this.unsubscribe()}}:super._complete}unsubscribe(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){const{closed:r}=this;super.unsubscribe(),!r&&(null===(t=this.onFinalize)||void 0===t||t.call(this))}}}function yr(e,t){return Ci((r,n)=>{let a=0;r.subscribe(xi(n,i=>{n.next(e.call(t,i,a++))}))})}const TV="https://g.co/ng/security#xss";class St extends Error{constructor(t,r){super(function ls(e,t){return`NG0${Math.abs(e)}${t?": "+t:""}`}(t,r)),this.code=t}}function fa(e){for(let t in e)if(e[t]===fa)return t;throw Error("Could not find renamed property on target object.")}function wo(e){if("string"==typeof e)return e;if(Array.isArray(e))return"["+e.map(wo).join(", ")+"]";if(null==e)return""+e;if(e.overriddenName)return`${e.overriddenName}`;if(e.name)return`${e.name}`;const t=e.toString();if(null==t)return""+t;const r=t.indexOf("\n");return-1===r?t:t.substring(0,r)}function RP(e,t){return null==e||""===e?null===t?"":t:null==t||""===t?e:e+" "+t}const Qpe=fa({__forward_ref__:fa});function kP(e){return e.__forward_ref__=kP,e.toString=function(){return wo(this())},e}function Mr(e){return Ex(e)?e():e}function Ex(e){return"function"==typeof e&&e.hasOwnProperty(Qpe)&&e.__forward_ref__===kP}function OP(e){return e&&!!e.\u0275providers}const q1=fa({\u0275cmp:fa}),FP=fa({\u0275dir:fa}),NP=fa({\u0275pipe:fa}),IV=fa({\u0275mod:fa}),Ld=fa({\u0275fac:fa}),W1=fa({__NG_ELEMENT_ID__:fa}),PV=fa({__NG_ENV_ID__:fa});function Vr(e){return"string"==typeof e?e:null==e?"":String(e)}function BP(e,t){throw new St(-201,!1)}function bu(e,t){null==e&&function Rr(e,t,r,n){throw new Error(`ASSERTION ERROR: ${e}`+(null==n?"":` [Expected=> ${r} ${n} ${t} <=Actual]`))}(t,e,null,"!=")}function nr(e){return{token:e.token,providedIn:e.providedIn||null,factory:e.factory,value:void 0}}function Y1(e){return{providers:e.providers||[],imports:e.imports||[]}}function Ix(e){return MV(e,Mx)||MV(e,RV)}function MV(e,t){return e.hasOwnProperty(t)?e[t]:null}function Px(e){return e&&(e.hasOwnProperty(LP)||e.hasOwnProperty(ohe))?e[LP]:null}const Mx=fa({\u0275prov:fa}),LP=fa({\u0275inj:fa}),RV=fa({ngInjectableDef:fa}),ohe=fa({ngInjectorDef:fa});var vn=function(e){return e[e.Default=0]="Default",e[e.Host=1]="Host",e[e.Self=2]="Self",e[e.SkipSelf=4]="SkipSelf",e[e.Optional=8]="Optional",e}(vn||{});let UP;function kV(){return UP}function _u(e){const t=UP;return UP=e,t}function OV(e,t,r){const n=Ix(e);return n&&"root"==n.providedIn?void 0===n.value?n.value=n.factory():n.value:r&vn.Optional?null:void 0!==t?t:void BP()}const ia=globalThis;class cr{constructor(t,r){this._desc=t,this.ngMetadataName="InjectionToken",this.\u0275prov=void 0,"number"==typeof r?this.__NG_ELEMENT_ID__=r:void 0!==r&&(this.\u0275prov=nr({token:this,providedIn:r.providedIn||"root",factory:r.factory}))}get multi(){return this}toString(){return`InjectionToken ${this._desc}`}}const X1={},jP="__NG_DI_FLAG__",Rx="ngTempTokenPath",che=/\n/gm,NV="__source";let f0;function wh(e){const t=f0;return f0=e,t}function dhe(e,t=vn.Default){if(void 0===f0)throw new St(-203,!1);return null===f0?OV(e,void 0,t):f0.get(e,t&vn.Optional?null:void 0,t)}function Tr(e,t=vn.Default){return(kV()||dhe)(Mr(e),t)}function Pt(e,t=vn.Default){return Tr(e,kx(t))}function kx(e){return typeof e>"u"||"number"==typeof e?e:0|(e.optional&&8)|(e.host&&1)|(e.self&&2)|(e.skipSelf&&4)}function qP(e){const t=[];for(let r=0;rt){o=i-1;break}}}for(;ii?"":a[f+1].toLowerCase();const p=8&n?d:null;if(p&&-1!==LV(p,c,0)||2&n&&c!==d){if(kl(n))return!1;o=!0}}}}else{if(!o&&!kl(n)&&!kl(u))return!1;if(o&&kl(u))continue;o=!1,n=u|1&n}}return kl(n)||o}function kl(e){return 0==(1&e)}function bhe(e,t,r,n){if(null===t)return-1;let a=0;if(n||!r){let i=!1;for(;a-1)for(r++;r0?'="'+s+'"':"")+"]"}else 8&n?a+="."+o:4&n&&(a+=" "+o);else""!==a&&!kl(o)&&(t+=qV(i,a),a=""),n=o,i=i||!kl(n);r++}return""!==a&&(t+=qV(i,a)),t}function Ah(e){return Ud(()=>{const t=YV(e),r={...t,decls:e.decls,vars:e.vars,template:e.template,consts:e.consts||null,ngContentSelectors:e.ngContentSelectors,onPush:e.changeDetection===Ox.OnPush,directiveDefs:null,pipeDefs:null,dependencies:t.standalone&&e.dependencies||null,getStandaloneInjector:null,signals:e.signals??!1,data:e.data||{},encapsulation:e.encapsulation||Rl.Emulated,styles:e.styles||zn,_:null,schemas:e.schemas||null,tView:null,id:""};XV(r);const n=e.dependencies;return r.directiveDefs=Nx(n,!1),r.pipeDefs=Nx(n,!0),r.id=function Phe(e){let t=0;const r=[e.selectors,e.ngContentSelectors,e.hostVars,e.hostAttrs,e.consts,e.vars,e.decls,e.encapsulation,e.standalone,e.signals,e.exportAs,JSON.stringify(e.inputs),JSON.stringify(e.outputs),Object.getOwnPropertyNames(e.type.prototype),!!e.contentQueries,!!e.viewQuery].join("|");for(const a of r)t=Math.imul(31,t)+a.charCodeAt(0)<<0;return t+=2147483648,"c"+t}(r),r})}function Dhe(e){return dn(e)||Ao(e)}function Ehe(e){return null!==e}function Fx(e){return Ud(()=>({type:e.type,bootstrap:e.bootstrap||zn,declarations:e.declarations||zn,imports:e.imports||zn,exports:e.exports||zn,transitiveCompileScopes:null,schemas:e.schemas||null,id:e.id||null}))}function WV(e,t){if(null==e)return Cf;const r={};for(const n in e)if(e.hasOwnProperty(n)){const a=e[n];let i,o,s=es.None;Array.isArray(a)?(s=a[0],i=a[1],o=a[2]??i):(i=a,o=a),t?(r[i]=s!==es.None?[n,s]:n,t[i]=o):r[i]=n}return r}function fs(e){return Ud(()=>{const t=YV(e);return XV(t),t})}function Su(e){return{type:e.type,name:e.name,factory:null,pure:!1!==e.pure,standalone:!0===e.standalone,onDestroy:e.type.prototype.ngOnDestroy||null}}function dn(e){return e[q1]||null}function Ao(e){return e[FP]||null}function ts(e){return e[NP]||null}function ds(e,t){const r=e[IV]||null;if(!r&&!0===t)throw new Error(`Type ${wo(e)} does not have '\u0275mod' property.`);return r}function YV(e){const t={};return{type:e.type,providersResolver:null,factory:null,hostBindings:e.hostBindings||null,hostVars:e.hostVars||0,hostAttrs:e.hostAttrs||null,contentQueries:e.contentQueries||null,declaredInputs:t,inputTransforms:null,inputConfig:e.inputs||Cf,exportAs:e.exportAs||null,standalone:!0===e.standalone,signals:!0===e.signals,selectors:e.selectors||zn,viewQuery:e.viewQuery||null,features:e.features||null,setInput:null,findHostDirectiveDefs:null,hostDirectives:null,inputs:WV(e.inputs,t),outputs:WV(e.outputs),debugInfo:null}}function XV(e){e.features?.forEach(t=>t(e))}function Nx(e,t){if(!e)return null;const r=t?ts:Dhe;return()=>("function"==typeof e?e():e).map(n=>r(n)).filter(Ehe)}const Ja=0,Ft=1,br=2,Vi=3,Ol=4,ps=5,Fl=6,d0=7,Ma=8,qs=9,Vd=10,Wr=11,Q1=12,KV=13,p0=14,pi=15,$1=16,h0=17,xf=18,J1=19,ZV=20,Dh=21,Bx=22,av=23,zr=25,YP=1,wf=7,m0=9,zi=10;var XP=function(e){return e[e.None=0]="None",e[e.HasTransplantedViews=2]="HasTransplantedViews",e}(XP||{});function hs(e){return Array.isArray(e)&&"object"==typeof e[YP]}function ms(e){return Array.isArray(e)&&!0===e[YP]}function KP(e){return 0!=(4&e.flags)}function iv(e){return e.componentOffset>-1}function Ux(e){return 1==(1&e.flags)}function Nl(e){return!!e.template}function ZP(e){return 0!=(512&e[br])}function ov(e,t){return e.hasOwnProperty(Ld)?e[Ld]:null}class Ohe{constructor(t,r,n){this.previousValue=t,this.currentValue=r,this.firstChange=n}isFirstChange(){return this.firstChange}}function e7(e,t,r,n){null!==t?t.applyValueToInputSignal(t,n):e[r]=n}function zd(){return t7}function t7(e){return e.type.prototype.ngOnChanges&&(e.setInput=Nhe),Fhe}function Fhe(){const e=n7(this),t=e?.current;if(t){const r=e.previous;if(r===Cf)e.previous=t;else for(let n in t)r[n]=t[n];e.current=null,this.ngOnChanges(t)}}function Nhe(e,t,r,n,a){const i=this.declaredInputs[n],o=n7(e)||function Bhe(e,t){return e[r7]=t}(e,{previous:Cf,current:null}),s=o.current||(o.current={}),u=o.previous,c=u[i];s[i]=new Ohe(c&&c.currentValue,r,u===Cf),e7(e,t,a,r)}zd.ngInherit=!0;const r7="__ngSimpleChanges__";function n7(e){return e[r7]||null}const Af=function(e,t,r){};let o7=!1;function ba(e){for(;Array.isArray(e);)e=e[Ja];return e}function t2(e,t){return ba(t[e])}function Ws(e,t){return ba(t[e.index])}function r2(e,t){return e.data[t]}function Qu(e,t){const r=t[e];return hs(r)?r:r[Ja]}function tM(e){return 128==(128&e[br])}function Tf(e,t){return null==t?null:e[t]}function s7(e){e[h0]=0}function Hhe(e){1024&e[br]||(e[br]|=1024,tM(e)&&n2(e))}function c7(e){return 9216&e[br]||e[av]?.dirty}function rM(e){c7(e)?n2(e):64&e[br]&&(function Uhe(){return o7}()?(e[br]|=1024,n2(e)):e[Vd].changeDetectionScheduler?.notify())}function n2(e){e[Vd].changeDetectionScheduler?.notify();let t=sv(e);for(;null!==t&&!(8192&t[br])&&(t[br]|=8192,tM(t));)t=sv(t)}function Vx(e,t){if(256==(256&e[br]))throw new St(911,!1);null===e[Dh]&&(e[Dh]=[]),e[Dh].push(t)}function sv(e){const t=e[Vi];return ms(t)?t[Vi]:t}const kr={lFrame:b7(null),bindingsEnabled:!0,skipHydrationRootTNode:null};function f7(){return kr.bindingsEnabled}function ct(){return kr.lFrame.lView}function Dn(){return kr.lFrame.tView}function _a(){let e=d7();for(;null!==e&&64===e.type;)e=e.parent;return e}function d7(){return kr.lFrame.currentTNode}function Df(e,t){const r=kr.lFrame;r.currentTNode=e,r.isParent=t}function aM(){return kr.lFrame.isParent}function Ef(){return kr.lFrame.bindingIndex++}function rme(e,t){const r=kr.lFrame;r.bindingIndex=r.bindingRootIndex=e,oM(t)}function oM(e){kr.lFrame.currentDirectiveIndex=e}function v7(){return kr.lFrame.currentQueryIndex}function uM(e){kr.lFrame.currentQueryIndex=e}function ame(e){const t=e[Ft];return 2===t.type?t.declTNode:1===t.type?e[ps]:null}function g7(e,t,r){if(r&vn.SkipSelf){let a=t,i=e;for(;!(a=a.parent,null!==a||r&vn.Host||(a=ame(i),null===a||(i=i[p0],10&a.type))););if(null===a)return!1;t=a,e=i}const n=kr.lFrame=y7();return n.currentTNode=t,n.lView=e,!0}function cM(e){const t=y7(),r=e[Ft];kr.lFrame=t,t.currentTNode=r.firstChild,t.lView=e,t.tView=r,t.contextLView=e,t.bindingIndex=r.bindingStartIndex,t.inI18n=!1}function y7(){const e=kr.lFrame,t=null===e?null:e.child;return null===t?b7(e):t}function b7(e){const t={currentTNode:null,isParent:!0,lView:null,tView:null,selectedIndex:-1,contextLView:null,elementDepthCount:0,currentNamespace:null,currentDirectiveIndex:-1,bindingRootIndex:-1,bindingIndex:-1,currentQueryIndex:0,parent:e,child:null,inI18n:!1};return null!==e&&(e.child=t),t}function _7(){const e=kr.lFrame;return kr.lFrame=e.parent,e.currentTNode=null,e.lView=null,e}const S7=_7;function lM(){const e=_7();e.isParent=!0,e.tView=null,e.selectedIndex=-1,e.contextLView=null,e.elementDepthCount=0,e.currentDirectiveIndex=-1,e.currentNamespace=null,e.bindingRootIndex=-1,e.bindingIndex=-1,e.currentQueryIndex=0}function vs(){return kr.lFrame.selectedIndex}function uv(e){kr.lFrame.selectedIndex=e}function Ha(){const e=kr.lFrame;return r2(e.tView,e.selectedIndex)}let x7=!0;function zx(){return x7}function Eh(e){x7=e}function Gx(e,t){for(let r=t.directiveStart,n=t.directiveEnd;r=n)break}else t[u]<0&&(e[h0]+=65536),(s>14>16&&(3&e[br])===t&&(e[br]+=16384,A7(s,i)):A7(s,i)}const y0=-1;class i2{constructor(t,r,n){this.factory=t,this.resolving=!1,this.canSeeViewProviders=r,this.injectImpl=n}}function pM(e){return e!==y0}function o2(e){return 32767&e}function s2(e,t){let r=function vme(e){return e>>16}(e),n=t;for(;r>0;)n=n[p0],r--;return n}let hM=!0;function qx(e){const t=hM;return hM=e,t}const T7=255,D7=5;let gme=0;const If={};function Wx(e,t){const r=E7(e,t);if(-1!==r)return r;const n=t[Ft];n.firstCreatePass&&(e.injectorIndex=t.length,mM(n.data,e),mM(t,null),mM(n.blueprint,null));const a=Yx(e,t),i=e.injectorIndex;if(pM(a)){const o=o2(a),s=s2(a,t),u=s[Ft].data;for(let c=0;c<8;c++)t[i+c]=s[o+c]|u[o+c]}return t[i+8]=a,i}function mM(e,t){e.push(0,0,0,0,0,0,0,0,t)}function E7(e,t){return-1===e.injectorIndex||e.parent&&e.parent.injectorIndex===e.injectorIndex||null===t[e.injectorIndex+8]?-1:e.injectorIndex}function Yx(e,t){if(e.parent&&-1!==e.parent.injectorIndex)return e.parent.injectorIndex;let r=0,n=null,a=t;for(;null!==a;){if(n=F7(a),null===n)return y0;if(r++,a=a[p0],-1!==n.injectorIndex)return n.injectorIndex|r<<16}return y0}function vM(e,t,r){!function yme(e,t,r){let n;"string"==typeof r?n=r.charCodeAt(0)||0:r.hasOwnProperty(W1)&&(n=r[W1]),null==n&&(n=r[W1]=gme++);const a=n&T7;t.data[e+(a>>D7)]|=1<=0?t&T7:Cme:t}(r);if("function"==typeof i){if(!g7(t,e,n))return n&vn.Host?I7(a,0,n):P7(t,r,n,a);try{let o;if(o=i(n),null!=o||n&vn.Optional)return o;BP()}finally{S7()}}else if("number"==typeof i){let o=null,s=E7(e,t),u=y0,c=n&vn.Host?t[pi][ps]:null;for((-1===s||n&vn.SkipSelf)&&(u=-1===s?Yx(e,t):t[s+8],u!==y0&&O7(n,!1)?(o=t[Ft],s=o2(u),t=s2(u,t)):s=-1);-1!==s;){const l=t[Ft];if(k7(i,s,l.data)){const f=_me(s,t,r,o,n,c);if(f!==If)return f}u=t[s+8],u!==y0&&O7(n,t[Ft].data[s+8]===c)&&k7(i,s,t)?(o=l,s=o2(u),t=s2(u,t)):s=-1}}return a}function _me(e,t,r,n,a,i){const o=t[Ft],s=o.data[e+8],l=Xx(s,o,r,null==n?iv(s)&&hM:n!=o&&0!=(3&s.type),a&vn.Host&&i===s);return null!==l?cv(t,o,l,s):If}function Xx(e,t,r,n,a){const i=e.providerIndexes,o=t.data,s=1048575&i,u=e.directiveStart,l=i>>20,d=a?s+l:e.directiveEnd;for(let p=n?s:s+l;p=u&&h.type===r)return p}if(a){const p=o[u];if(p&&Nl(p)&&p.type===r)return u}return null}function cv(e,t,r,n){let a=e[r];const i=t.data;if(function dme(e){return e instanceof i2}(a)){const o=a;o.resolving&&function Jpe(e,t){const r=t?`. Dependency path: ${t.join(" > ")} > ${e}`:"";throw new St(-200,`Circular dependency in DI detected for ${e}${r}`)}(function Zn(e){return"function"==typeof e?e.name||e.toString():"object"==typeof e&&null!=e&&"function"==typeof e.type?e.type.name||e.type.toString():Vr(e)}(i[r]));const s=qx(o.canSeeViewProviders);o.resolving=!0;const c=o.injectImpl?_u(o.injectImpl):null;g7(e,n,vn.Default);try{a=e[r]=o.factory(void 0,i,e,n),t.firstCreatePass&&r>=n.directiveStart&&function lme(e,t,r){const{ngOnChanges:n,ngOnInit:a,ngDoCheck:i}=t.type.prototype;if(n){const o=t7(t);(r.preOrderHooks??=[]).push(e,o),(r.preOrderCheckHooks??=[]).push(e,o)}a&&(r.preOrderHooks??=[]).push(0-e,a),i&&((r.preOrderHooks??=[]).push(e,i),(r.preOrderCheckHooks??=[]).push(e,i))}(r,i[r],t)}finally{null!==c&&_u(c),qx(s),o.resolving=!1,S7()}}return a}function k7(e,t,r){return!!(r[t+(e>>D7)]&1<{const t=e.prototype.constructor,r=t[Ld]||yM(t),n=Object.prototype;let a=Object.getPrototypeOf(e.prototype).constructor;for(;a&&a!==n;){const i=a[Ld]||yM(a);if(i&&i!==r)return i;a=Object.getPrototypeOf(a)}return i=>new i})}function yM(e){return Ex(e)?()=>{const t=yM(Mr(e));return t&&t()}:ov(e)}function F7(e){const t=e[Ft],r=t.type;return 2===r?t.declTNode:1===r?e[ps]:null}const C0="__parameters__";function w0(e,t,r){return Ud(()=>{const n=function bM(e){return function(...r){if(e){const n=e(...r);for(const a in n)this[a]=n[a]}}}(t);function a(...i){if(this instanceof a)return n.apply(this,i),this;const o=new a(...i);return s.annotation=o,s;function s(u,c,l){const f=u.hasOwnProperty(C0)?u[C0]:Object.defineProperty(u,C0,{value:[]})[C0];for(;f.length<=l;)f.push(null);return(f[l]=f[l]||[]).push(o),u}}return r&&(a.prototype=Object.create(r.prototype)),a.prototype.ngMetadataName=e,a.annotationCls=a,a})}function T0(e,t){e.forEach(r=>Array.isArray(r)?T0(r,t):t(r))}function B7(e,t,r){t>=e.length?e.push(r):e.splice(t,0,r)}function Zx(e,t){return t>=e.length-1?e.pop():e.splice(t,1)[0]}function $u(e,t,r){let n=D0(e,t);return n>=0?e[1|n]=r:(n=~n,function L7(e,t,r,n){let a=e.length;if(a==t)e.push(r,n);else if(1===a)e.push(n,e[0]),e[0]=r;else{for(a--,e.push(e[a-1],e[a]);a>t;)e[a]=e[a-2],a--;e[t]=r,e[t+1]=n}}(e,n,t,r)),n}function SM(e,t){const r=D0(e,t);if(r>=0)return e[1|r]}function D0(e,t){return function U7(e,t,r){let n=0,a=e.length>>r;for(;a!==n;){const i=n+(a-n>>1),o=e[i<t?a=i:n=i+1}return~(a<{r.push(o)};return T0(t,o=>{const s=o;aw(s,i,[],n)&&(a||=[],a.push(s))}),void 0!==a&&q7(a,i),r}function q7(e,t){for(let r=0;r{t(i,n)})}}function aw(e,t,r,n){if(!(e=Mr(e)))return!1;let a=null,i=Px(e);const o=!i&&dn(e);if(i||o){if(o&&!o.standalone)return!1;a=e}else{const u=e.ngModule;if(i=Px(u),!i)return!1;a=u}const s=n.has(a);if(o){if(s)return!1;if(n.add(a),o.dependencies){const u="function"==typeof o.dependencies?o.dependencies():o.dependencies;for(const c of u)aw(c,t,r,n)}}else{if(!i)return!1;{if(null!=i.imports&&!s){let c;n.add(a);try{T0(i.imports,l=>{aw(l,t,r,n)&&(c||=[],c.push(l))})}finally{}void 0!==c&&q7(c,t)}if(!s){const c=ov(a)||(()=>new a);t({provide:a,useFactory:c,deps:zn},a),t({provide:wM,useValue:a,multi:!0},a),t({provide:lv,useValue:()=>Tr(a),multi:!0},a)}const u=i.providers;if(null!=u&&!s){const c=e;AM(u,l=>{t(l,c)})}}}return a!==e&&void 0!==e.providers}function AM(e,t){for(let r of e)OP(r)&&(r=r.\u0275providers),Array.isArray(r)?AM(r,t):t(r)}const Wme=fa({provide:String,useValue:fa});function TM(e){return null!==e&&"object"==typeof e&&Wme in e}function fv(e){return"function"==typeof e}const DM=new cr(""),iw={},Xme={};let EM;function ow(){return void 0===EM&&(EM=new rw),EM}class Pc{}class I0 extends Pc{get destroyed(){return this._destroyed}constructor(t,r,n,a){super(),this.parent=r,this.source=n,this.scopes=a,this.records=new Map,this._ngOnDestroyHooks=new Set,this._onDestroyHooks=[],this._destroyed=!1,PM(t,o=>this.processProvider(o)),this.records.set(H7,P0(void 0,this)),a.has("environment")&&this.records.set(Pc,P0(void 0,this));const i=this.records.get(DM);null!=i&&"string"==typeof i.value&&this.scopes.add(i.value),this.injectorDefTypes=new Set(this.get(wM,zn,vn.Self))}destroy(){this.assertNotDestroyed(),this._destroyed=!0;try{for(const r of this._ngOnDestroyHooks)r.ngOnDestroy();const t=this._onDestroyHooks;this._onDestroyHooks=[];for(const r of t)r()}finally{this.records.clear(),this._ngOnDestroyHooks.clear(),this.injectorDefTypes.clear()}}onDestroy(t){return this.assertNotDestroyed(),this._onDestroyHooks.push(t),()=>this.removeOnDestroy(t)}runInContext(t){this.assertNotDestroyed();const r=wh(this),n=_u(void 0);try{return t()}finally{wh(r),_u(n)}}get(t,r=X1,n=vn.Default){if(this.assertNotDestroyed(),t.hasOwnProperty(PV))return t[PV](this);n=kx(n);const i=wh(this),o=_u(void 0);try{if(!(n&vn.SkipSelf)){let u=this.records.get(t);if(void 0===u){const c=function Jme(e){return"function"==typeof e||"object"==typeof e&&e instanceof cr}(t)&&Ix(t);u=c&&this.injectableDefInScope(c)?P0(IM(t),iw):null,this.records.set(t,u)}if(null!=u)return this.hydrate(t,u)}return(n&vn.Self?ow():this.parent).get(t,r=n&vn.Optional&&r===X1?null:r)}catch(s){if("NullInjectorError"===s.name){if((s[Rx]=s[Rx]||[]).unshift(wo(t)),i)throw s;return function hhe(e,t,r,n){const a=e[Rx];throw t[NV]&&a.unshift(t[NV]),e.message=function mhe(e,t,r,n=null){e=e&&"\n"===e.charAt(0)&&"\u0275"==e.charAt(1)?e.slice(2):e;let a=wo(t);if(Array.isArray(t))a=t.map(wo).join(" -> ");else if("object"==typeof t){let i=[];for(let o in t)if(t.hasOwnProperty(o)){let s=t[o];i.push(o+":"+("string"==typeof s?JSON.stringify(s):wo(s)))}a=`{${i.join(", ")}}`}return`${r}${n?"("+n+")":""}[${a}]: ${e.replace(che,"\n ")}`}("\n"+e.message,a,r,n),e.ngTokenPath=a,e[Rx]=null,e}(s,t,"R3InjectorError",this.source)}throw s}finally{_u(o),wh(i)}}resolveInjectorInitializers(){const t=wh(this),r=_u(void 0);try{const a=this.get(lv,zn,vn.Self);for(const i of a)i()}finally{wh(t),_u(r)}}toString(){const t=[],r=this.records;for(const n of r.keys())t.push(wo(n));return`R3Injector[${t.join(", ")}]`}assertNotDestroyed(){if(this._destroyed)throw new St(205,!1)}processProvider(t){let r=fv(t=Mr(t))?t:Mr(t&&t.provide);const n=function Zme(e){return TM(e)?P0(void 0,e.useValue):P0(X7(e),iw)}(t);if(!fv(t)&&!0===t.multi){let a=this.records.get(r);a||(a=P0(void 0,iw,!0),a.factory=()=>qP(a.multi),this.records.set(r,a)),r=t,a.multi.push(t)}this.records.set(r,n)}hydrate(t,r){return r.value===iw&&(r.value=Xme,r.value=r.factory()),"object"==typeof r.value&&r.value&&function $me(e){return null!==e&&"object"==typeof e&&"function"==typeof e.ngOnDestroy}(r.value)&&this._ngOnDestroyHooks.add(r.value),r.value}injectableDefInScope(t){if(!t.providedIn)return!1;const r=Mr(t.providedIn);return"string"==typeof r?"any"===r||this.scopes.has(r):this.injectorDefTypes.has(r)}removeOnDestroy(t){const r=this._onDestroyHooks.indexOf(t);-1!==r&&this._onDestroyHooks.splice(r,1)}}function IM(e){const t=Ix(e),r=null!==t?t.factory:ov(e);if(null!==r)return r;if(e instanceof cr)throw new St(204,!1);if(e instanceof Function)return function Kme(e){if(e.length>0)throw new St(204,!1);const r=function ihe(e){return e&&(e[Mx]||e[RV])||null}(e);return null!==r?()=>r.factory(e):()=>new e}(e);throw new St(204,!1)}function X7(e,t,r){let n;if(fv(e)){const a=Mr(e);return ov(a)||IM(a)}if(TM(e))n=()=>Mr(e.useValue);else if(function Y7(e){return!(!e||!e.useFactory)}(e))n=()=>e.useFactory(...qP(e.deps||[]));else if(function W7(e){return!(!e||!e.useExisting)}(e))n=()=>Tr(Mr(e.useExisting));else{const a=Mr(e&&(e.useClass||e.provide));if(!function Qme(e){return!!e.deps}(e))return ov(a)||IM(a);n=()=>new a(...qP(e.deps))}return n}function P0(e,t,r=!1){return{factory:e,value:t,multi:r?[]:void 0}}function PM(e,t){for(const r of e)Array.isArray(r)?PM(r,t):r&&OP(r)?PM(r.\u0275providers,t):t(r)}function dv(e,t){e instanceof I0&&e.assertNotDestroyed();const n=wh(e),a=_u(void 0);try{return t()}finally{wh(n),_u(a)}}function $7(e,t=null,r=null,n){const a=J7(e,t,r,n);return a.resolveInjectorInitializers(),a}function J7(e,t=null,r=null,n,a=new Set){const i=[r||zn,qme(e)];return n=n||("object"==typeof e?void 0:wo(e)),new I0(i,t||ow(),n||null,a)}let kM,xu=(()=>{class e{static#e=this.THROW_IF_NOT_FOUND=X1;static#t=this.NULL=new rw;static create(r,n){if(Array.isArray(r))return $7({name:""},n,r,"");{const a=r.name??"";return $7({name:a},r.parent,r.providers,a)}}static#r=this.\u0275prov=nr({token:e,providedIn:"any",factory:()=>Tr(H7)});static#n=this.__NG_ELEMENT_ID__=-1}return e})();const OM=new cr("",{providedIn:"root",factory:()=>uve}),uve="ng",tz=new cr(""),Mh=new cr("",{providedIn:"platform",factory:()=>"unknown"}),rz=new cr("",{providedIn:"root",factory:()=>function Ph(){if(void 0!==kM)return kM;if(typeof document<"u")return document;throw new St(210,!1)}().body?.querySelector("[ngCspNonce]")?.getAttribute("ngCspNonce")||null}),nz={breakpoints:[16,32,48,64,96,128,256,384,640,750,828,1080,1200,1920,2048,3840],disableImageSizeWarning:!1,disableImageLazyLoadWarning:!1},az=new cr("",{providedIn:"root",factory:()=>nz});function iz(e){return e.ownerDocument.defaultView}function Ju(e){return e instanceof Function?e():e}function fw(e){return 128==(128&e.flags)}var Oh=function(e){return e[e.Important=1]="Important",e[e.DashCase=2]="DashCase",e}(Oh||{});const UM=new Map;let yve=0;const zM="__ngContext__";function gs(e,t){hs(t)?(e[zM]=t[J1],function _ve(e){UM.set(e[J1],e)}(t)):e[zM]=t}let GM;function HM(e,t){return GM(e,t)}function R0(e,t,r,n,a){if(null!=n){let i,o=!1;ms(n)?i=n:hs(n)&&(o=!0,n=n[Ja]);const s=ba(n);0===e&&null!==r?null==a?Dz(t,r,s):pv(t,r,s,a||null,!0):1===e&&null!==r?pv(t,r,s,a||null,!0):2===e?function yw(e,t,r){const n=vw(e,t);n&&function Nve(e,t,r,n){e.removeChild(t,r,n)}(e,n,t,r)}(t,s,o):3===e&&t.destroyNode(s),null!=i&&function Uve(e,t,r,n,a){const i=r[wf];i!==ba(r)&&R0(t,e,n,i,a);for(let s=zi;s0&&(e[r-1][Ol]=n[Ol]);const i=Zx(e,zi+t);!function Ive(e,t){wz(e,t),t[Ja]=null,t[ps]=null}(n[Ft],n);const o=i[xf];null!==o&&o.detachView(i[Ft]),n[Vi]=null,n[Ol]=null,n[br]&=-129}return n}function mw(e,t){if(!(256&t[br])){const r=t[Wr];r.destroyNode&&bw(e,t,r,3,null,null),function Mve(e){let t=e[Q1];if(!t)return qM(e[Ft],e);for(;t;){let r=null;if(hs(t))r=t[Q1];else{const n=t[zi];n&&(r=n)}if(!r){for(;t&&!t[Ol]&&t!==e;)hs(t)&&qM(t[Ft],t),t=t[Vi];null===t&&(t=e),hs(t)&&qM(t[Ft],t),r=t&&t[Ol]}t=r}}(t)}}function qM(e,t){if(!(256&t[br])){t[br]&=-129,t[br]|=256,t[av]&&function fV(e){if(l0(e),H1(e))for(let t=0;t=0?n[o]():n[-o].unsubscribe(),i+=2}else r[i].call(n[r[i+1]]);null!==n&&(t[d0]=null);const a=t[Dh];if(null!==a){t[Dh]=null;for(let i=0;i-1){const{encapsulation:i}=e.data[n.directiveStart+a];if(i===Rl.None||i===Rl.Emulated)return null}return Ws(n,r)}}(e,t.parent,r)}function pv(e,t,r,n,a){e.insertBefore(t,r,n,a)}function Dz(e,t,r){e.appendChild(t,r)}function Ez(e,t,r,n,a){null!==n?pv(e,t,r,n,a):Dz(e,t,r)}function vw(e,t){return e.parentNode(t)}let YM,Sw,Mz=function Pz(e,t,r){return 40&e.type?Ws(e,r):null};function gw(e,t,r,n){const a=WM(e,n,t),i=t[Wr],s=function Iz(e,t,r){return Mz(e,t,r)}(n.parent||t[ps],n,t);if(null!=a)if(Array.isArray(r))for(let u=0;ue,createScript:e=>e,createScriptURL:e=>e})}catch{}return Sw}()?.createScriptURL(e)||e}class zz{constructor(t){this.changingThisBreaksApplicationSecurity=t}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see ${TV})`}}function jd(e){return e instanceof zz?e.changingThisBreaksApplicationSecurity:e}function v2(e,t){const r=function Zve(e){return e instanceof zz&&e.getTypeName()||null}(e);if(null!=r&&r!==t){if("ResourceURL"===r&&"URL"===t)return!0;throw new Error(`Required a safe ${t}, got a ${r} (see ${TV})`)}return r===t}const ege=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:\/?#]*(?:[\/?#]|$))/i;var O0=function(e){return e[e.NONE=0]="NONE",e[e.HTML=1]="HTML",e[e.STYLE=2]="STYLE",e[e.SCRIPT=3]="SCRIPT",e[e.URL=4]="URL",e[e.RESOURCE_URL=5]="RESOURCE_URL",e}(O0||{});function Xz(e){const t=y2();return t?t.sanitize(O0.URL,e)||"":v2(e,"URL")?jd(e):function $M(e){return(e=String(e)).match(ege)?e:"unsafe:"+e}(Vr(e))}function Kz(e){const t=y2();if(t)return Vz(t.sanitize(O0.RESOURCE_URL,e)||"");if(v2(e,"ResourceURL"))return Vz(jd(e));throw new St(904,!1)}function y2(){const e=ct();return e&&e[Vd].sanitizer}class Qz{}let $z=()=>null;function cR(e,t,r=!1){return $z(e,t,r)}class Sge{}class nG{}class xge{resolveComponentFactory(t){throw function Cge(e){const t=Error(`No component factory found for ${wo(e)}.`);return t.ngComponent=e,t}(t)}}let Ew=(()=>{class e{static#e=this.NULL=new xge}return e})();function wge(){return L0(_a(),ct())}function L0(e,t){return new Wd(Ws(e,t))}let Wd=(()=>{class e{constructor(r){this.nativeElement=r}static#e=this.__NG_ELEMENT_ID__=wge}return e})();function Age(e){return e instanceof Wd?e.nativeElement:e}class iG{}let C2=(()=>{class e{constructor(){this.destroyNode=null}static#e=this.__NG_ELEMENT_ID__=()=>function Tge(){const e=ct(),r=Qu(_a().index,e);return(hs(r)?r:e)[Wr]}()}return e})(),Dge=(()=>{class e{static#e=this.\u0275prov=nr({token:e,providedIn:"root",factory:()=>null})}return e})();const pR={};function x2(e,t,r,n,a=!1){for(;null!==r;){const i=t[r.index];null!==i&&n.push(ba(i)),ms(i)&&pG(i,n);const o=r.type;if(8&o)x2(e,t,r.child,n);else if(32&o){const s=HM(r,t);let u;for(;u=s();)n.push(u)}else if(16&o){const s=kz(t,r);if(Array.isArray(s))n.push(...s);else{const u=sv(t[pi]);x2(u[Ft],u,s,n,!0)}}r=a?r.projectionNext:r.next}return n}function pG(e,t){for(let r=zi;r!1,producerRecomputeValue:()=>{},consumerMarkedDirty:()=>{},consumerOnSignalRead:()=>{},consumerIsAlwaysLive:!0,consumerMarkedDirty:e=>{n2(e.lView)},consumerOnSignalRead(){this.lView[av]=this}};function mG(e){return gG(e[Q1])}function vG(e){return gG(e[Ol])}function gG(e){for(;null!==e&&!ms(e);)e=e[Ol];return e}function vR(e){return e.ngOriginalError}class Yd{constructor(){this._console=console}handleError(t){const r=this._findOriginalError(t);this._console.error("ERROR",t),r&&this._console.error("ORIGINAL ERROR",r)}_findOriginalError(t){let r=t&&vR(t);for(;r&&vR(r);)r=vR(r);return r||null}}const bG=new cr("",{providedIn:"root",factory:()=>Pt(Yd).handleError.bind(void 0)}),SG=new cr("",{providedIn:"root",factory:()=>!1}),Yr={};function Pf(e=1){AG(Dn(),ct(),vs()+e,!1)}function AG(e,t,r,n){if(!n)if(3==(3&t[br])){const i=e.preOrderCheckHooks;null!==i&&Hx(t,i,r)}else{const i=e.preOrderHooks;null!==i&&jx(t,i,0,r)}uv(r)}function Dr(e,t=vn.Default){const r=ct();return null===r?Tr(e,t):M7(_a(),r,Mr(e),t)}function DG(e,t,r,n,a,i){const o=Si(null);try{let s=null;a&es.SignalBased&&(s=t[n][c0]),null!==s&&void 0!==s.transformFn&&(i=s.transformFn(i)),a&es.HasDecoratorInputTransform&&(i=e.inputTransforms[n].call(t,i)),null!==e.setInput?e.setInput(t,s,i,r,n):e7(t,s,n,i)}finally{Si(o)}}function Rw(e,t,r,n,a,i,o,s,u,c,l){const f=t.blueprint.slice();return f[Ja]=a,f[br]=204|n,(null!==c||e&&2048&e[br])&&(f[br]|=2048),s7(f),f[Vi]=f[p0]=e,f[Ma]=r,f[Vd]=o||e&&e[Vd],f[Wr]=s||e&&e[Wr],f[qs]=u||e&&e[qs]||null,f[ps]=i,f[J1]=function bve(){return yve++}(),f[Fl]=l,f[ZV]=c,f[pi]=2==t.type?e[pi]:f,f}function U0(e,t,r,n,a){let i=e.data[t];if(null===i)i=function gR(e,t,r,n,a){const i=d7(),o=aM(),u=e.data[t]=function n0e(e,t,r,n,a,i){let o=t?t.injectorIndex:-1,s=0;return function g0(){return null!==kr.skipHydrationRootTNode}()&&(s|=128),{type:r,index:n,insertBeforeIndex:null,injectorIndex:o,directiveStart:-1,directiveEnd:-1,directiveStylingLast:-1,componentOffset:-1,propertyBindings:null,flags:s,providerIndexes:0,value:a,attrs:i,mergedAttrs:null,localNames:null,initialInputs:void 0,inputs:null,outputs:null,tView:null,next:null,prev:null,projectionNext:null,child:null,parent:t,projection:null,styles:null,stylesWithoutHost:null,residualStyles:void 0,classes:null,classesWithoutHost:null,residualClasses:void 0,classBindings:0,styleBindings:0}}(0,o?i:i&&i.parent,r,t,n,a);return null===e.firstChild&&(e.firstChild=u),null!==i&&(o?null==i.child&&null!==u.parent&&(i.child=u):null===i.next&&(i.next=u,u.prev=i)),u}(e,t,r,n,a),function tme(){return kr.lFrame.inI18n}()&&(i.flags|=32);else if(64&i.type){i.type=r,i.value=n,i.attrs=a;const o=function a2(){const e=kr.lFrame,t=e.currentTNode;return e.isParent?t:t.parent}();i.injectorIndex=null===o?-1:o.injectorIndex}return Df(i,!0),i}function w2(e,t,r,n){if(0===r)return-1;const a=t.length;for(let i=0;izr&&AG(e,t,zr,!1),Af(o?2:0,a),r(n,a)}finally{uv(i),Af(o?3:1,a)}}function yR(e,t,r){if(KP(t)){const n=Si(null);try{const i=t.directiveEnd;for(let o=t.directiveStart;onull;function MG(e,t,r,n,a){for(let i in t){if(!t.hasOwnProperty(i))continue;const o=t[i];if(void 0===o)continue;n??={};let s,u=es.None;Array.isArray(o)?(s=o[0],u=o[1]):s=o;let c=i;if(null!==a){if(!a.hasOwnProperty(i))continue;c=a[i]}0===e?RG(n,r,c,s,u):RG(n,r,c,s)}return n}function RG(e,t,r,n,a){let i;e.hasOwnProperty(r)?(i=e[r]).push(t,n):i=e[r]=[t,n],void 0!==a&&i.push(a)}function CR(e,t,r,n){if(f7()){const a=null===n?null:{"":-1},i=function d0e(e,t){const r=e.directiveRegistry;let n=null,a=null;if(r)for(let i=0;i0;){const r=e[--t];if("number"==typeof r&&r<0)return r}return 0})(o)!=s&&o.push(s),o.push(r,n,i)}}(e,t,n,w2(e,r,a.hostVars,Yr),a)}function Mf(e,t,r,n,a,i){const o=Ws(e,t);!function wR(e,t,r,n,a,i,o){if(null==i)e.removeAttribute(t,a,r);else{const s=null==o?Vr(i):o(i,n||"",a);e.setAttribute(t,a,s,r)}}(t[Wr],o,i,e.value,r,n,a)}function y0e(e,t,r,n,a,i){const o=i[t];if(null!==o)for(let s=0;se.nextProducerIndex;)e.producerNode.pop(),e.producerLastReadVersion.pop(),e.producerIndexOfThis.pop()}}(s,o),function zge(e){e.lView[av]!==e&&(e.lView=null,hG.push(e))}(s)),lM()}}function VG(e,t){for(let r=mG(e);null!==r;r=vG(r))for(let n=zi;n-1&&(h2(t,n),Zx(r,n))}this._attachedToViewContainer=!1}mw(this._lView[Ft],this._lView)}onDestroy(t){Vx(this._lView,t)}markForCheck(){A2(this._cdRefInjectingView||this._lView)}detach(){this._lView[br]&=-129}reattach(){rM(this._lView),this._lView[br]|=128}detectChanges(){this._lView[br]|=1024,function DR(e,t=!0){const r=e[Vd],n=r.rendererFactory;n.begin?.();try{!function S0e(e){ER(e,0);let t=0;for(;c7(e);){if(100===t)throw new St(103,!1);t++,ER(e,1)}}(e)}catch(i){throw t&&Ow(e,i),i}finally{n.end?.(),r.inlineEffectRunner?.flush()}}(this._lView,this.notifyErrorHandler)}checkNoChanges(){}attachToViewContainerRef(){if(this._appRef)throw new St(902,!1);this._attachedToViewContainer=!0}detachFromAppRef(){this._appRef=null,wz(this._lView[Ft],this._lView)}attachToAppRef(t){if(this._attachedToViewContainer)throw new St(902,!1);this._appRef=t,rM(this._lView)}}let Fw=(()=>{class e{static#e=this.__NG_ELEMENT_ID__=T0e}return e})();function T0e(e){return function D0e(e,t,r){if(iv(e)&&!r){const n=Qu(e.index,t);return new T2(n,n)}return 47&e.type?new T2(t[pi],t):null}(_a(),ct(),16==(16&e))}let Nw=(()=>{class e{static#e=this.__NG_ELEMENT_ID__=M0e;static#t=this.__NG_ENV_ID__=r=>r}return e})();class P0e extends Nw{constructor(t){super(),this._lView=t}onDestroy(t){return Vx(this._lView,t),()=>function nM(e,t){if(null===e[Dh])return;const r=e[Dh].indexOf(t);-1!==r&&e[Dh].splice(r,1)}(this._lView,t)}}function M0e(){return new P0e(ct())}const HG=new Set;function Fh(e){HG.has(e)||(HG.add(e),performance?.mark?.("mark_feature_usage",{detail:{feature:e}}))}function IR(e){return t=>{setTimeout(e,void 0,t)}}const rs=class B0e extends Cn{constructor(t=!1){super(),this.__isAsync=t}emit(t){super.next(t)}subscribe(t,r,n){let a=t,i=r||(()=>null),o=n;if(t&&"object"==typeof t){const u=t;a=u.next?.bind(u),i=u.error?.bind(u),o=u.complete?.bind(u)}this.__isAsync&&(i=IR(i),a&&(a=IR(a)),o&&(o=IR(o)));const s=super.subscribe({next:a,error:i,complete:o});return t instanceof js&&t.add(s),s}};function jG(...e){}class Qn{constructor({enableLongStackTrace:t=!1,shouldCoalesceEventChangeDetection:r=!1,shouldCoalesceRunChangeDetection:n=!1}){if(this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new rs(!1),this.onMicrotaskEmpty=new rs(!1),this.onStable=new rs(!1),this.onError=new rs(!1),typeof Zone>"u")throw new St(908,!1);Zone.assertZonePatched();const a=this;a._nesting=0,a._outer=a._inner=Zone.current,Zone.TaskTrackingZoneSpec&&(a._inner=a._inner.fork(new Zone.TaskTrackingZoneSpec)),t&&Zone.longStackTraceZoneSpec&&(a._inner=a._inner.fork(Zone.longStackTraceZoneSpec)),a.shouldCoalesceEventChangeDetection=!n&&r,a.shouldCoalesceRunChangeDetection=n,a.lastRequestAnimationFrameId=-1,a.nativeRequestAnimationFrame=function L0e(){const e="function"==typeof ia.requestAnimationFrame;let t=ia[e?"requestAnimationFrame":"setTimeout"],r=ia[e?"cancelAnimationFrame":"clearTimeout"];if(typeof Zone<"u"&&t&&r){const n=t[Zone.__symbol__("OriginalDelegate")];n&&(t=n);const a=r[Zone.__symbol__("OriginalDelegate")];a&&(r=a)}return{nativeRequestAnimationFrame:t,nativeCancelAnimationFrame:r}}().nativeRequestAnimationFrame,function z0e(e){const t=()=>{!function V0e(e){e.isCheckStableRunning||-1!==e.lastRequestAnimationFrameId||(e.lastRequestAnimationFrameId=e.nativeRequestAnimationFrame.call(ia,()=>{e.fakeTopEventTask||(e.fakeTopEventTask=Zone.root.scheduleEventTask("fakeTopEventTask",()=>{e.lastRequestAnimationFrameId=-1,MR(e),e.isCheckStableRunning=!0,PR(e),e.isCheckStableRunning=!1},void 0,()=>{},()=>{})),e.fakeTopEventTask.invoke()}),MR(e))}(e)};e._inner=e._inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:(r,n,a,i,o,s)=>{if(function G0e(e){return!(!Array.isArray(e)||1!==e.length)&&!0===e[0].data?.__ignore_ng_zone__}(s))return r.invokeTask(a,i,o,s);try{return qG(e),r.invokeTask(a,i,o,s)}finally{(e.shouldCoalesceEventChangeDetection&&"eventTask"===i.type||e.shouldCoalesceRunChangeDetection)&&t(),WG(e)}},onInvoke:(r,n,a,i,o,s,u)=>{try{return qG(e),r.invoke(a,i,o,s,u)}finally{e.shouldCoalesceRunChangeDetection&&t(),WG(e)}},onHasTask:(r,n,a,i)=>{r.hasTask(a,i),n===a&&("microTask"==i.change?(e._hasPendingMicrotasks=i.microTask,MR(e),PR(e)):"macroTask"==i.change&&(e.hasPendingMacrotasks=i.macroTask))},onHandleError:(r,n,a,i)=>(r.handleError(a,i),e.runOutsideAngular(()=>e.onError.emit(i)),!1)})}(a)}static isInAngularZone(){return typeof Zone<"u"&&!0===Zone.current.get("isAngularZone")}static assertInAngularZone(){if(!Qn.isInAngularZone())throw new St(909,!1)}static assertNotInAngularZone(){if(Qn.isInAngularZone())throw new St(909,!1)}run(t,r,n){return this._inner.run(t,r,n)}runTask(t,r,n,a){const i=this._inner,o=i.scheduleEventTask("NgZoneEvent: "+a,t,U0e,jG,jG);try{return i.runTask(o,r,n)}finally{i.cancelTask(o)}}runGuarded(t,r,n){return this._inner.runGuarded(t,r,n)}runOutsideAngular(t){return this._outer.run(t)}}const U0e={};function PR(e){if(0==e._nesting&&!e.hasPendingMicrotasks&&!e.isStable)try{e._nesting++,e.onMicrotaskEmpty.emit(null)}finally{if(e._nesting--,!e.hasPendingMicrotasks)try{e.runOutsideAngular(()=>e.onStable.emit(null))}finally{e.isStable=!0}}}function MR(e){e.hasPendingMicrotasks=!!(e._hasPendingMicrotasks||(e.shouldCoalesceEventChangeDetection||e.shouldCoalesceRunChangeDetection)&&-1!==e.lastRequestAnimationFrameId)}function qG(e){e._nesting++,e.isStable&&(e.isStable=!1,e.onUnstable.emit(null))}function WG(e){e._nesting--,PR(e)}var hv=function(e){return e[e.EarlyRead=0]="EarlyRead",e[e.Write=1]="Write",e[e.MixedReadWrite=2]="MixedReadWrite",e[e.Read=3]="Read",e}(hv||{});const XG={destroy(){}};function ZG(e,t){!t&&function MM(e){if(!kV()&&!function fhe(){return f0}())throw new St(-203,!1)}();const r=t?.injector??Pt(xu);if(!function Rh(e){return"browser"===(e??Pt(xu)).get(Mh)}(r))return XG;Fh("NgAfterNextRender");const n=r.get(D2),a=n.handler??=new $G,i=t?.phase??hv.MixedReadWrite,o=()=>{a.unregister(u),s()},s=r.get(Nw).onDestroy(o),u=new QG(r,i,()=>{o(),e()});return a.register(u),{destroy:o}}class QG{constructor(t,r,n){this.phase=r,this.callbackFn=n,this.zone=t.get(Qn),this.errorHandler=t.get(Yd,null,{optional:!0})}invoke(){try{this.zone.runOutsideAngular(this.callbackFn)}catch(t){this.errorHandler?.handleError(t)}}}class $G{constructor(){this.executingCallbacks=!1,this.buckets={[hv.EarlyRead]:new Set,[hv.Write]:new Set,[hv.MixedReadWrite]:new Set,[hv.Read]:new Set},this.deferredCallbacks=new Set}register(t){(this.executingCallbacks?this.deferredCallbacks:this.buckets[t.phase]).add(t)}unregister(t){this.buckets[t.phase].delete(t),this.deferredCallbacks.delete(t)}execute(){let t=!1;this.executingCallbacks=!0;for(const r of Object.values(this.buckets))for(const n of r)t=!0,n.invoke();this.executingCallbacks=!1;for(const r of this.deferredCallbacks)this.buckets[r.phase].add(r);return this.deferredCallbacks.clear(),t}destroy(){for(const t of Object.values(this.buckets))t.clear();this.deferredCallbacks.clear()}}let D2=(()=>{class e{constructor(){this.handler=null,this.internalCallbacks=[]}execute(){const r=[...this.internalCallbacks];this.internalCallbacks.length=0;for(const a of r)a();return!!this.handler?.execute()||r.length>0}ngOnDestroy(){this.handler?.destroy(),this.handler=null,this.internalCallbacks.length=0}static#e=this.\u0275prov=nr({token:e,providedIn:"root",factory:()=>new e})}return e})();function q0e(e,t){const r=Qu(t,e),n=r[Ft];!function W0e(e,t){for(let r=t.length;r0&&Nz(e,r,i.join(" "))}}(d,C,h,n),void 0!==r&&function rye(e,t,r){const n=e.projection=[];for(let a=0;anull;function V0(e,t){return f9(e,t)}function k2(e,t,r,n){const a=t.tView,s=Rw(e,a,r,4096&e[br]?4096:16,null,t,null,null,null,n?.injector??null,n?.dehydratedView??null);s[$1]=e[t.index];const c=e[xf];return null!==c&&(s[xf]=c.createEmbeddedView(a)),RR(a,s,r),s}function d9(e,t){const r=zi+t;if(r0&&(r[a-1][Ol]=t),n{class e{static#e=this.__NG_ELEMENT_ID__=Fye}return e})();function Fye(){return m9(_a(),ct())}const Nye=Bl,p9=class extends Nye{constructor(t,r,n){super(),this._lContainer=t,this._hostTNode=r,this._hostLView=n}get element(){return L0(this._hostTNode,this._hostLView)}get injector(){return new To(this._hostTNode,this._hostLView)}get parentInjector(){const t=Yx(this._hostTNode,this._hostLView);if(pM(t)){const r=s2(t,this._hostLView),n=o2(t);return new To(r[Ft].data[n+8],r)}return new To(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(t){const r=h9(this._lContainer);return null!==r&&r[t]||null}get length(){return this._lContainer.length-zi}createEmbeddedView(t,r,n){let a,i;"number"==typeof n?a=n:null!=n&&(a=n.index,i=n.injector);const o=V0(this._lContainer,t.ssrId),s=t.createEmbeddedViewImpl(r||{},i,o);return this.insertImpl(s,a,z0(this._hostTNode,o)),s}createComponent(t,r,n,a,i){const o=t&&!function u2(e){return"function"==typeof e}(t);let s;if(o)s=r;else{const h=r||{};s=h.index,n=h.injector,a=h.projectableNodes,i=h.environmentInjector||h.ngModuleRef}const u=o?t:new E2(dn(t)),c=n||this.parentInjector;if(!i&&null==u.ngModule){const m=(o?c:this.parentInjector).get(Pc,null);m&&(i=m)}const l=dn(u.componentType??{}),f=V0(this._lContainer,l?.id??null),p=u.create(c,a,f?.firstChild??null,i);return this.insertImpl(p.hostView,s,z0(this._hostTNode,f)),p}insert(t,r){return this.insertImpl(t,r,!0)}insertImpl(t,r,n){const a=t._lView;if(function Ghe(e){return ms(e[Vi])}(a)){const s=this.indexOf(t);if(-1!==s)this.detach(s);else{const u=a[Vi],c=new p9(u,u[ps],u[Vi]);c.detach(c.indexOf(t))}}const i=this._adjustIndex(r),o=this._lContainer;return O2(o,a,i,n),t.attachToViewContainerRef(),B7(VR(o),i,t),t}move(t,r){return this.insert(t,r)}indexOf(t){const r=h9(this._lContainer);return null!==r?r.indexOf(t):-1}remove(t){const r=this._adjustIndex(t,-1),n=h2(this._lContainer,r);n&&(Zx(VR(this._lContainer),r),mw(n[Ft],n))}detach(t){const r=this._adjustIndex(t,-1),n=h2(this._lContainer,r);return n&&null!=Zx(VR(this._lContainer),r)?new T2(n):null}_adjustIndex(t,r=0){return t??this.length+r}};function h9(e){return e[8]}function VR(e){return e[8]||(e[8]=[])}function m9(e,t){let r;const n=t[e.index];return ms(n)?r=n:(r=FG(n,t,null,e),t[e.index]=r,kw(t,r)),v9(r,t,e,n),new p9(r,e,t)}let v9=function y9(e,t,r,n){if(e[wf])return;let a;a=8&r.type?ba(n):function Bye(e,t){const r=e[Wr],n=r.createComment(""),a=Ws(t,e);return pv(r,vw(r,a),n,function Bve(e,t){return e.nextSibling(t)}(r,a),!1),n}(t,r),e[wf]=a},zR=()=>!1;function to(e,t,r){return!Object.is(e[t],r)&&(e[t]=r,!0)}function G0(e,t,r,n,a,i,o,s){const u=ct(),c=Dn(),l=e+zr,f=c.firstCreatePass?function zye(e,t,r,n,a,i,o,s,u){const c=t.consts,l=U0(t,e,4,o||null,Tf(c,s));CR(t,r,l,Tf(c,u)),Gx(t,l);const f=l.tView=SR(2,l,n,a,i,t.directiveRegistry,t.pipeRegistry,null,t.schemas,c,null);return null!==t.queries&&(t.queries.template(t,l),f.queries=t.queries.embeddedTView(l)),l}(l,c,u,t,r,n,a,i,o):c.data[l];Df(f,!1);const d=b9(c,u,f,e);zx()&&gw(c,u,d,f),gs(d,u);const p=FG(d,u,d,f);return u[l]=p,kw(u,p),function g9(e,t,r){return zR(e,t,r)}(p,f,u),Ux(f)&&bR(c,u,f),null!=o&&_R(u,f,s),G0}let b9=function _9(e,t,r,n){return Eh(!0),t[Wr].createComment("")};function ZR(e,t,r,n){const a=ct();return to(a,Ef(),t)&&(Dn(),Mf(Ha(),a,e,t,r,n)),ZR}function Kw(e,t){return e<<17|t<<2}function Bh(e){return e>>17&32767}function QR(e){return 2|e}function gv(e){return(131068&e)>>2}function $R(e,t){return-131069&e|t<<2}function JR(e){return 1|e}function $9(e,t,r,n){const a=e[r+1],i=null===t;let o=n?Bh(a):gv(a),s=!1;for(;0!==o&&(!1===s||i);){const c=e[o+1];Abe(e[o],t)&&(s=!0,e[o+1]=n?JR(c):QR(c)),o=n?Bh(c):gv(c)}s&&(e[r+1]=n?QR(a):JR(a))}function Abe(e,t){return null===e||null==t||(Array.isArray(e)?e[1]:e)===t||!(!Array.isArray(e)||"string"!=typeof t)&&D0(e,t)>=0}function iy(e,t,r){const n=ct();return to(n,Ef(),t)&&function ec(e,t,r,n,a,i,o,s){const u=Ws(t,r);let l,c=t.inputs;!s&&null!=c&&(l=c[n])?(TR(e,r,l,n,a),iv(t)&&function o0e(e,t){const r=Qu(t,e);16&r[br]||(r[br]|=64)}(r,t.index)):3&t.type&&(n=function i0e(e){return"class"===e?"className":"for"===e?"htmlFor":"formaction"===e?"formAction":"innerHtml"===e?"innerHTML":"readonly"===e?"readOnly":"tabindex"===e?"tabIndex":e}(n),a=null!=o?o(a,t.value||"",n):a,i.setProperty(u,n,a))}(Dn(),Ha(),n,e,t,n[Wr],r,!1),iy}function e4(e,t,r,n,a){const o=a?"class":"style";TR(e,r,t.inputs[o],o,n)}function t4(e,t,r){return function Ll(e,t,r,n){const a=ct(),i=Dn(),o=function Hd(e){const t=kr.lFrame,r=t.bindingIndex;return t.bindingIndex=t.bindingIndex+e,r}(2);i.firstUpdatePass&&function sH(e,t,r,n){const a=e.data;if(null===a[r+1]){const i=a[vs()],o=function oH(e,t){return t>=e.expandoStartIndex}(e,r);(function fH(e,t){return 0!=(e.flags&(t?8:16))})(i,n)&&null===t&&!o&&(t=!1),t=function Obe(e,t,r,n){const a=function sM(e){const t=kr.lFrame.currentDirectiveIndex;return-1===t?null:e[t]}(e);let i=n?t.residualClasses:t.residualStyles;if(null===a)0===(n?t.classBindings:t.styleBindings)&&(r=U2(r=r4(null,e,t,r,n),t.attrs,n),i=null);else{const o=t.directiveStylingLast;if(-1===o||e[o]!==a)if(r=r4(a,e,t,r,n),null===i){let u=function Fbe(e,t,r){const n=r?t.classBindings:t.styleBindings;if(0!==gv(n))return e[Bh(n)]}(e,t,n);void 0!==u&&Array.isArray(u)&&(u=r4(null,e,t,u[1],n),u=U2(u,t.attrs,n),function Nbe(e,t,r,n){e[Bh(r?t.classBindings:t.styleBindings)]=n}(e,t,n,u))}else i=function Bbe(e,t,r){let n;const a=t.directiveEnd;for(let i=1+t.directiveStylingLast;i0)&&(c=!0)):l=r,a)if(0!==u){const d=Bh(e[s+1]);e[n+1]=Kw(d,s),0!==d&&(e[d+1]=$R(e[d+1],n)),e[s+1]=function Sbe(e,t){return 131071&e|t<<17}(e[s+1],n)}else e[n+1]=Kw(s,0),0!==s&&(e[s+1]=$R(e[s+1],n)),s=n;else e[n+1]=Kw(u,0),0===s?s=n:e[u+1]=$R(e[u+1],n),u=n;c&&(e[n+1]=QR(e[n+1])),$9(e,l,n,!0),$9(e,l,n,!1),function wbe(e,t,r,n,a){const i=a?e.residualClasses:e.residualStyles;null!=i&&"string"==typeof t&&D0(i,t)>=0&&(r[n+1]=JR(r[n+1]))}(t,l,e,n,i),o=Kw(s,u),i?t.classBindings=o:t.styleBindings=o}(a,i,t,r,o,n)}}(i,e,o,n),t!==Yr&&to(a,o,t)&&function cH(e,t,r,n,a,i,o,s){if(!(3&t.type))return;const u=e.data,c=u[s+1],l=function Cbe(e){return 1==(1&e)}(c)?lH(u,t,r,a,gv(c),o):void 0;Zw(l)||(Zw(i)||function _be(e){return 2==(2&e)}(c)&&(i=lH(u,null,r,a,s,o)),function Vve(e,t,r,n,a){if(t)a?e.addClass(r,n):e.removeClass(r,n);else{let i=-1===n.indexOf("-")?void 0:Oh.DashCase;null==a?e.removeStyle(r,n,i):("string"==typeof a&&a.endsWith("!important")&&(a=a.slice(0,-10),i|=Oh.Important),e.setStyle(r,n,a,i))}}(n,o,t2(vs(),r),a,i))}(i,i.data[vs()],a,a[Wr],e,a[o+1]=function zbe(e,t){return null==e||""===e||("string"==typeof t?e+=t:"object"==typeof e&&(e=wo(jd(e)))),e}(t,r),n,o)}(e,t,r,!1),t4}function r4(e,t,r,n,a){let i=null;const o=r.directiveEnd;let s=r.directiveStylingLast;for(-1===s?s=r.directiveStart:s++;s0;){const u=e[a],c=Array.isArray(u),l=c?u[1]:u,f=null===l;let d=r[a+1];d===Yr&&(d=f?zn:void 0);let p=f?SM(d,n):l===n?d:void 0;if(c&&!Zw(p)&&(p=SM(u,n)),Zw(p)&&(s=p,o))return s;const h=e[a+1];a=o?Bh(h):gv(h)}if(null!==t){let u=i?t.residualClasses:t.residualStyles;null!=u&&(s=SM(u,n))}return s}function Zw(e){return void 0!==e}class $be{destroy(t){}updateValue(t,r){}swap(t,r){const n=Math.min(t,r),a=Math.max(t,r),i=this.detach(a);if(a-n>1){const o=this.detach(n);this.attach(n,i),this.attach(a,o)}else this.attach(n,i)}move(t,r){this.attach(r,this.detach(t))}}function n4(e,t,r,n,a){return e===r&&Object.is(t,n)?1:Object.is(a(e,t),a(r,n))?-1:0}function a4(e,t,r,n){return!(void 0===t||!t.has(n)||(e.attach(r,t.get(n)),t.delete(n),0))}function dH(e,t,r,n,a){if(a4(e,t,n,r(n,a)))e.updateValue(n,a);else{const i=e.create(n,a);e.attach(n,i)}}function pH(e,t,r,n){const a=new Set;for(let i=t;i<=r;i++)a.add(n(i,e.at(i)));return a}class hH{constructor(){this.kvMap=new Map,this._vMap=void 0}has(t){return this.kvMap.has(t)}delete(t){if(!this.has(t))return!1;const r=this.kvMap.get(t);return void 0!==this._vMap&&this._vMap.has(r)?(this.kvMap.set(t,this._vMap.get(r)),this._vMap.delete(r)):this.kvMap.delete(t),!0}get(t){return this.kvMap.get(t)}set(t,r){if(this.kvMap.has(t)){let n=this.kvMap.get(t);void 0===this._vMap&&(this._vMap=new Map);const a=this._vMap;for(;a.has(n);)n=a.get(n);a.set(n,r)}else this.kvMap.set(t,r)}forEach(t){for(let[r,n]of this.kvMap)if(t(n,r),void 0!==this._vMap){const a=this._vMap;for(;a.has(n);)n=a.get(n),t(n,r)}}}class e1e{constructor(t,r,n){this.lContainer=t,this.$implicit=r,this.$index=n}get $count(){return this.lContainer.length-zi}}function vH(e){return e}class r1e{constructor(t,r,n){this.hasEmptyBlock=t,this.trackByFn=r,this.liveCollection=n}}class n1e extends $be{constructor(t,r,n){super(),this.lContainer=t,this.hostLView=r,this.templateTNode=n,this.needsIndexUpdate=!1}get length(){return this.lContainer.length-zi}at(t){return this.getLView(t)[Ma].$implicit}attach(t,r){const n=r[Fl];this.needsIndexUpdate||=t!==this.length,O2(this.lContainer,r,t,z0(this.templateTNode,n))}detach(t){return this.needsIndexUpdate||=t!==this.length-1,function a1e(e,t){return h2(e,t)}(this.lContainer,t)}create(t,r){const n=V0(this.lContainer,this.templateTNode.tView.ssrId);return k2(this.hostLView,this.templateTNode,new e1e(this.lContainer,r,t),{dehydratedView:n})}destroy(t){mw(t[Ft],t)}updateValue(t,r){this.getLView(t)[Ma].$implicit=r}reset(){this.needsIndexUpdate=!1}updateIndexes(){if(this.needsIndexUpdate)for(let t=0;t(Eh(!0),hw(n,a,function C7(){return kr.lFrame.currentNamespace}()));const sy="en-US";let TH=sy;function tA(e){return!!e&&"function"==typeof e.then}function QH(e){return!!e&&"function"==typeof e.subscribe}function rA(e,t,r,n){const a=ct(),i=Dn(),o=_a();return function JH(e,t,r,n,a,i,o){const s=Ux(n),c=e.firstCreatePass&&LG(e),l=t[Ma],f=BG(t);let d=!0;if(3&n.type||o){const m=Ws(n,t),v=o?o(m):m,g=f.length,y=o?_=>o(ba(_[n.index])):n.index;let b=null;if(!o&&s&&(b=function c2e(e,t,r,n){const a=e.cleanup;if(null!=a)for(let i=0;iu?s[u]:null}"string"==typeof o&&(i+=2)}return null}(e,t,a,n.index)),null!==b)(b.__ngLastListenerFn__||b).__ngNextListenerFn__=i,b.__ngLastListenerFn__=i,d=!1;else{i=tj(n,t,l,i,!1);const _=r.listen(v,a,i);f.push(i,_),c&&c.push(a,y,g,g+1)}}else i=tj(n,t,l,i,!1);const p=n.outputs;let h;if(d&&null!==p&&(h=p[a])){const m=h.length;if(m)for(let v=0;v-1?Qu(e.index,t):t);let u=ej(t,r,n,o),c=i.__ngNextListenerFn__;for(;c;)u=ej(t,r,c,o)&&u,c=c.__ngNextListenerFn__;return a&&!1===u&&o.preventDefault(),u}}function f4(e=1){return function ime(e){return(kr.lFrame.contextLView=function u7(e,t){for(;e>0;)t=t[p0],e--;return t}(e,kr.lFrame.contextLView))[Ma]}(e)}function p2e(){return this._results[Symbol.iterator]()}class p4{static#e=Symbol.iterator;get changes(){return this._changes??=new rs}constructor(t=!1){this._emitDistinctChangesOnly=t,this.dirty=!0,this._results=[],this._changesDetected=!1,this._changes=void 0,this.length=0,this.first=void 0,this.last=void 0;const r=p4.prototype;r[Symbol.iterator]||(r[Symbol.iterator]=p2e)}get(t){return this._results[t]}map(t){return this._results.map(t)}filter(t){return this._results.filter(t)}find(t){return this._results.find(t)}reduce(t,r){return this._results.reduce(t,r)}forEach(t){this._results.forEach(t)}some(t){return this._results.some(t)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(t,r){this.dirty=!1;const n=function Cu(e){return e.flat(Number.POSITIVE_INFINITY)}(t);(this._changesDetected=!function Eme(e,t,r){if(e.length!==t.length)return!1;for(let n=0;n{class e{static#e=this.__NG_ELEMENT_ID__=v2e}return e})();const h2e=Kd,m2e=class extends h2e{constructor(t,r,n){super(),this._declarationLView=t,this._declarationTContainer=r,this.elementRef=n}get ssrId(){return this._declarationTContainer.tView?.ssrId||null}createEmbeddedView(t,r){return this.createEmbeddedViewImpl(t,r)}createEmbeddedViewImpl(t,r,n){const a=k2(this._declarationLView,this._declarationTContainer,t,{injector:r,dehydratedView:n});return new T2(a)}};function v2e(){return nA(_a(),ct())}function nA(e,t){return 4&e.type?new m2e(t,e,L0(e,t)):null}class h4{constructor(t){this.queryList=t,this.matches=null}clone(){return new h4(this.queryList)}setDirty(){this.queryList.setDirty()}}class m4{constructor(t=[]){this.queries=t}createEmbeddedView(t){const r=t.queries;if(null!==r){const n=null!==t.contentQueries?t.contentQueries[0]:r.length,a=[];for(let i=0;i0)n.push(o[s/2]);else{const c=i[s+1],l=t[-u];for(let f=zi;f(Eh(!0),function pw(e,t){return e.createText(t)}(t[Wr],n));function Lh(e,t,r){const n=ct(),a=function Z0(e,t,r,n){return to(e,Ef(),r)?t+Vr(r)+n:Yr}(n,e,t,r);return a!==Yr&&function Xd(e,t,r){const n=t2(t,e);!function xz(e,t,r){e.setValue(t,r)}(e[Wr],n,r)}(n,vs(),a),Lh}function b4(e,t,r,n,a){if(e=Mr(e),Array.isArray(e))for(let i=0;i>20;if(fv(e)||!e.multi){const p=new i2(c,a,Dr),h=S4(u,t,a?l:l+d,f);-1===h?(vM(Wx(s,o),i,u),_4(i,e,t.length),t.push(u),s.directiveStart++,s.directiveEnd++,a&&(s.providerIndexes+=1048576),r.push(p),o.push(p)):(r[h]=p,o[h]=p)}else{const p=S4(u,t,l+d,f),h=S4(u,t,l,l+d),v=h>=0&&r[h];if(a&&!v||!a&&!(p>=0&&r[p])){vM(Wx(s,o),i,u);const g=function U2e(e,t,r,n,a){const i=new i2(e,r,Dr);return i.multi=[],i.index=t,i.componentProviders=0,Nj(i,a,n&&!r),i}(a?L2e:B2e,r.length,a,n,c);!a&&v&&(r[h].providerFactory=g),_4(i,e,t.length,0),t.push(u),s.directiveStart++,s.directiveEnd++,a&&(s.providerIndexes+=1048576),r.push(g),o.push(g)}else _4(i,e,p>-1?p:h,Nj(r[a?h:p],c,!a&&n));!a&&n&&v&&r[h].componentProviders++}}}function _4(e,t,r,n){const a=fv(t),i=function Yme(e){return!!e.useClass}(t);if(a||i){const u=(i?Mr(t.useClass):t).prototype.ngOnDestroy;if(u){const c=e.destroyHooks||(e.destroyHooks=[]);if(!a&&t.multi){const l=c.indexOf(r);-1===l?c.push(r,[n,u]):c[l+1].push(n,u)}else c.push(r,u)}}}function Nj(e,t,r){return r&&e.componentProviders++,e.multi.push(t)-1}function S4(e,t,r,n){for(let a=r;a{r.providersResolver=(n,a)=>function N2e(e,t,r){const n=Dn();if(n.firstCreatePass){const a=Nl(e);b4(r,n.data,n.blueprint,a,!0),b4(t,n.data,n.blueprint,a,!1)}}(n,a?a(e):e,t)}}class bv{}class Lj{}class x4 extends bv{constructor(t,r,n){super(),this._parent=r,this._bootstrapComponents=[],this.destroyCbs=[],this.componentFactoryResolver=new JG(this);const a=ds(t);this._bootstrapComponents=Ju(a.bootstrap),this._r3Injector=J7(t,r,[{provide:bv,useValue:this},{provide:Ew,useValue:this.componentFactoryResolver},...n],wo(t),new Set(["environment"])),this._r3Injector.resolveInjectorInitializers(),this.instance=this._r3Injector.get(t)}get injector(){return this._r3Injector}destroy(){const t=this._r3Injector;!t.destroyed&&t.destroy(),this.destroyCbs.forEach(r=>r()),this.destroyCbs=null}onDestroy(t){this.destroyCbs.push(t)}}class w4 extends Lj{constructor(t){super(),this.moduleType=t}create(t){return new x4(this.moduleType,t,[])}}class Uj extends bv{constructor(t){super(),this.componentFactoryResolver=new JG(this),this.instance=null;const r=new I0([...t.providers,{provide:bv,useValue:this},{provide:Ew,useValue:this.componentFactoryResolver}],t.parent||ow(),t.debugName,new Set(["environment"]));this.injector=r,t.runEnvironmentInitializers&&r.resolveInjectorInitializers()}destroy(){this.injector.destroy()}onDestroy(t){this.injector.onDestroy(t)}}function A4(e,t,r=null){return new Uj({providers:e,parent:t,debugName:r,runEnvironmentInitializers:!0}).injector}let G2e=(()=>{class e{constructor(r){this._injector=r,this.cachedInjectors=new Map}getOrCreateStandaloneInjector(r){if(!r.standalone)return null;if(!this.cachedInjectors.has(r)){const n=j7(0,r.type),a=n.length>0?A4([n],this._injector,`Standalone[${r.type.name}]`):null;this.cachedInjectors.set(r,a)}return this.cachedInjectors.get(r)}ngOnDestroy(){try{for(const r of this.cachedInjectors.values())null!==r&&r.destroy()}finally{this.cachedInjectors.clear()}}static#e=this.\u0275prov=nr({token:e,providedIn:"environment",factory:()=>new e(Tr(Pc))})}return e})();function Uh(e){Fh("NgStandalone"),e.getStandaloneInjector=t=>t.get(G2e).getOrCreateStandaloneInjector(e)}function Xj(e,t,r,n,a,i){const o=t+r;return to(e,o,a)?function Rf(e,t,r){return e[t]=r}(e,o+1,i?n.call(i,a):n(a)):function Y2(e,t){const r=e[t];return r===Yr?void 0:r}(e,o+1)}function X2(e,t){const r=Dn();let n;const a=e+zr;r.firstCreatePass?(n=function c_e(e,t){if(t)for(let r=t.length-1;r>=0;r--){const n=t[r];if(e===n.name)return n}}(t,r.pipeRegistry),r.data[a]=n,n.onDestroy&&(r.destroyHooks??=[]).push(a,n.onDestroy)):n=r.data[a];const i=n.factory||(n.factory=ov(n.type)),s=_u(Dr);try{const u=qx(!1),c=i();return qx(u),function x2e(e,t,r,n){r>=e.data.length&&(e.data[r]=null,e.blueprint[r]=null),t[r]=n}(r,ct(),a,c),c}finally{_u(s)}}function K2(e,t,r){const n=e+zr,a=ct(),i=function v0(e,t){return e[t]}(a,n);return function Z2(e,t){return e[Ft].data[t].pure}(a,n)?Xj(a,function Ys(){const e=kr.lFrame;let t=e.bindingRootIndex;return-1===t&&(t=e.bindingRootIndex=e.tView.bindingStartIndex),t}(),t,i.transform,r,i):i.transform(r)}let hq=(()=>{class e{log(r){console.log(r)}warn(r){console.warn(r)}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275prov=nr({token:e,factory:e.\u0275fac,providedIn:"platform"})}return e})();class N_e{constructor(t,r){this.ngModuleFactory=t,this.componentFactories=r}}let mq=(()=>{class e{compileModuleSync(r){return new w4(r)}compileModuleAsync(r){return Promise.resolve(this.compileModuleSync(r))}compileModuleAndAllComponentsSync(r){const n=this.compileModuleSync(r),i=Ju(ds(r).declarations).reduce((o,s)=>{const u=dn(s);return u&&o.push(new E2(u)),o},[]);return new N_e(n,i)}compileModuleAndAllComponentsAsync(r){return Promise.resolve(this.compileModuleAndAllComponentsSync(r))}clearCache(){}clearCacheFor(r){}getModuleId(r){}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275prov=nr({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),cA=(()=>{class e{constructor(){this.taskId=0,this.pendingTasks=new Set,this.hasPendingTasks=new Ui(!1)}get _hasPendingTasks(){return this.hasPendingTasks.value}add(){this._hasPendingTasks||this.hasPendingTasks.next(!0);const r=this.taskId++;return this.pendingTasks.add(r),r}remove(r){this.pendingTasks.delete(r),0===this.pendingTasks.size&&this._hasPendingTasks&&this.hasPendingTasks.next(!1)}ngOnDestroy(){this.pendingTasks.clear(),this._hasPendingTasks&&this.hasPendingTasks.next(!1)}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275prov=nr({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();const _q=new cr(""),F4=new cr("");let N4=(()=>{class e{constructor(){this.initialized=!1,this.done=!1,this.donePromise=new Promise((r,n)=>{this.resolve=r,this.reject=n}),this.appInits=Pt(F4,{optional:!0})??[]}runInitializers(){if(this.initialized)return;const r=[];for(const a of this.appInits){const i=a();if(tA(i))r.push(i);else if(QH(i)){const o=new Promise((s,u)=>{i.subscribe({complete:s,error:u})});r.push(o)}}const n=()=>{this.done=!0,this.resolve()};Promise.all(r).then(()=>{n()}).catch(a=>{this.reject(a)}),0===r.length&&n(),this.initialized=!0}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275prov=nr({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();const dA=new cr("");let _v=(()=>{class e{constructor(){this._bootstrapListeners=[],this._runningTick=!1,this._destroyed=!1,this._destroyListeners=[],this._views=[],this.internalErrorHandler=Pt(bG),this.afterRenderEffectManager=Pt(D2),this.componentTypes=[],this.components=[],this.isStable=Pt(cA).hasPendingTasks.pipe(yr(r=>!r)),this._injector=Pt(Pc)}get destroyed(){return this._destroyed}get injector(){return this._injector}bootstrap(r,n){const a=r instanceof nG;if(!this._injector.get(N4).done)throw!a&&function Th(e){const t=dn(e)||Ao(e)||ts(e);return null!==t&&t.standalone}(r),new St(405,!1);let o;o=a?r:this._injector.get(Ew).resolveComponentFactory(r),this.componentTypes.push(o.componentType);const s=function fSe(e){return e.isBoundToModule}(o)?void 0:this._injector.get(bv),c=o.create(xu.NULL,[],n||o.selector,s),l=c.location.nativeElement,f=c.injector.get(_q,null);return f?.registerApplication(l),c.onDestroy(()=>{this.detachView(c.hostView),pA(this.components,c),f?.unregisterApplication(l)}),this._loadComponent(c),c}tick(){if(this._runningTick)throw new St(101,!1);try{this._runningTick=!0;for(let r of this._views)r.detectChanges()}catch(r){this.internalErrorHandler(r)}finally{try{this.afterRenderEffectManager.execute()}catch(r){this.internalErrorHandler(r)}this._runningTick=!1}}attachView(r){const n=r;this._views.push(n),n.attachToAppRef(this)}detachView(r){const n=r;pA(this._views,n),n.detachFromAppRef()}_loadComponent(r){this.attachView(r.hostView),this.tick(),this.components.push(r);const n=this._injector.get(dA,[]);[...this._bootstrapListeners,...n].forEach(a=>a(r))}ngOnDestroy(){if(!this._destroyed)try{this._destroyListeners.forEach(r=>r()),this._views.slice().forEach(r=>r.destroy())}finally{this._destroyed=!0,this._views=[],this._bootstrapListeners=[],this._destroyListeners=[]}}onDestroy(r){return this._destroyListeners.push(r),()=>pA(this._destroyListeners,r)}destroy(){if(this._destroyed)throw new St(406,!1);const r=this._injector;r.destroy&&!r.destroyed&&r.destroy()}get viewCount(){return this._views.length}warnIfDestroyed(){}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275prov=nr({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();function pA(e,t){const r=e.indexOf(t);r>-1&&e.splice(r,1)}let pSe=(()=>{class e{constructor(){this.zone=Pt(Qn),this.applicationRef=Pt(_v)}initialize(){this._onMicrotaskEmptySubscription||(this._onMicrotaskEmptySubscription=this.zone.onMicrotaskEmpty.subscribe({next:()=>{this.zone.run(()=>{this.applicationRef.tick()})}}))}ngOnDestroy(){this._onMicrotaskEmptySubscription?.unsubscribe()}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275prov=nr({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();function Aq(e){return[{provide:Qn,useFactory:e},{provide:lv,multi:!0,useFactory:()=>{const t=Pt(pSe,{optional:!0});return()=>t.initialize()}},{provide:lv,multi:!0,useFactory:()=>{const t=Pt(vSe);return()=>{t.initialize()}}},{provide:bG,useFactory:hSe}]}function hSe(){const e=Pt(Qn),t=Pt(Yd);return r=>e.runOutsideAngular(()=>t.handleError(r))}function mSe(e){return nw([[],Aq(()=>new Qn(function Tq(e){return{enableLongStackTrace:!1,shouldCoalesceEventChangeDetection:e?.eventCoalescing??!1,shouldCoalesceRunChangeDetection:e?.runCoalescing??!1}}(e)))])}let vSe=(()=>{class e{constructor(){this.subscription=new js,this.initialized=!1,this.zone=Pt(Qn),this.pendingTasks=Pt(cA)}initialize(){if(this.initialized)return;this.initialized=!0;let r=null;!this.zone.isStable&&!this.zone.hasPendingMacrotasks&&!this.zone.hasPendingMicrotasks&&(r=this.pendingTasks.add()),this.zone.runOutsideAngular(()=>{this.subscription.add(this.zone.onStable.subscribe(()=>{Qn.assertNotInAngularZone(),queueMicrotask(()=>{null!==r&&!this.zone.hasPendingMacrotasks&&!this.zone.hasPendingMicrotasks&&(this.pendingTasks.remove(r),r=null)})}))}),this.subscription.add(this.zone.onUnstable.subscribe(()=>{Qn.assertInAngularZone(),r??=this.pendingTasks.add()}))}ngOnDestroy(){this.subscription.unsubscribe()}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275prov=nr({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();const Zd=new cr("",{providedIn:"root",factory:()=>Pt(Zd,vn.Optional|vn.SkipSelf)||function gSe(){return typeof $localize<"u"&&$localize.locale||sy}()}),B4=new cr("");let Vh=null;function zSe(e){try{const{rootComponent:t,appProviders:r,platformProviders:n}=e,a=function CSe(e=[]){if(Vh)return Vh;const t=function Iq(e=[],t){return xu.create({name:t,providers:[{provide:DM,useValue:"platform"},{provide:B4,useValue:new Set([()=>Vh=null])},...e]})}(e);return Vh=t,function Sq(){!function Rpe(e){hV=e}(()=>{throw new St(600,!1)})}(),function Pq(e){e.get(tz,null)?.forEach(r=>r())}(t),t}(n),i=[mSe(),...r||[]],s=new Uj({providers:i,parent:a,debugName:"",runEnvironmentInitializers:!1}).injector,u=s.get(Qn);return u.run(()=>{s.resolveInjectorInitializers();const c=s.get(Yd,null);let l;u.runOutsideAngular(()=>{l=u.onError.subscribe({next:p=>{c.handleError(p)}})});const f=()=>s.destroy(),d=a.get(B4);return d.add(f),s.onDestroy(()=>{l.unsubscribe(),d.delete(f)}),function Cq(e,t,r){try{const n=r();return tA(n)?n.catch(a=>{throw t.runOutsideAngular(()=>e.handleError(a)),a}):n}catch(n){throw t.runOutsideAngular(()=>e.handleError(n)),n}}(c,u,()=>{const p=s.get(N4);return p.runInitializers(),p.donePromise.then(()=>{!function DH(e){bu(e,"Expected localeId to be defined"),"string"==typeof e&&(TH=e.toLowerCase().replace(/_/g,"-"))}(s.get(Zd,sy)||sy);const m=s.get(_v);return void 0!==t&&m.bootstrap(t),m})})})}catch(t){return Promise.reject(t)}}function fy(e){return"boolean"==typeof e?e:null!=e&&"false"!==e}function eW(e,t=NaN){return isNaN(parseFloat(e))||isNaN(Number(e))?t:Number(e)}let tW=null;function dy(){return tW}class nCe{}const Zs=new cr("");let q4=(()=>{class e{historyGo(r){throw new Error("")}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275prov=nr({token:e,factory:()=>Pt(iCe),providedIn:"platform"})}return e})();const aCe=new cr("");let iCe=(()=>{class e extends q4{constructor(){super(),this._doc=Pt(Zs),this._location=window.location,this._history=window.history}getBaseHrefFromDOM(){return dy().getBaseHref(this._doc)}onPopState(r){const n=dy().getGlobalEventTarget(this._doc,"window");return n.addEventListener("popstate",r,!1),()=>n.removeEventListener("popstate",r)}onHashChange(r){const n=dy().getGlobalEventTarget(this._doc,"window");return n.addEventListener("hashchange",r,!1),()=>n.removeEventListener("hashchange",r)}get href(){return this._location.href}get protocol(){return this._location.protocol}get hostname(){return this._location.hostname}get port(){return this._location.port}get pathname(){return this._location.pathname}get search(){return this._location.search}get hash(){return this._location.hash}set pathname(r){this._location.pathname=r}pushState(r,n,a){this._history.pushState(r,n,a)}replaceState(r,n,a){this._history.replaceState(r,n,a)}forward(){this._history.forward()}back(){this._history.back()}historyGo(r=0){this._history.go(r)}getState(){return this._history.state}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275prov=nr({token:e,factory:()=>new e,providedIn:"platform"})}return e})();function W4(e,t){if(0==e.length)return t;if(0==t.length)return e;let r=0;return e.endsWith("/")&&r++,t.startsWith("/")&&r++,2==r?e+t.substring(1):1==r?e+t:e+"/"+t}function rW(e){const t=e.match(/#|\?|$/),r=t&&t.index||e.length;return e.slice(0,r-("/"===e[r-1]?1:0))+e.slice(r)}function Qd(e){return e&&"?"!==e[0]?"?"+e:e}let Cv=(()=>{class e{historyGo(r){throw new Error("")}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275prov=nr({token:e,factory:()=>Pt(aW),providedIn:"root"})}return e})();const nW=new cr("");let aW=(()=>{class e extends Cv{constructor(r,n){super(),this._platformLocation=r,this._removeListenerFns=[],this._baseHref=n??this._platformLocation.getBaseHrefFromDOM()??Pt(Zs).location?.origin??""}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(r){this._removeListenerFns.push(this._platformLocation.onPopState(r),this._platformLocation.onHashChange(r))}getBaseHref(){return this._baseHref}prepareExternalUrl(r){return W4(this._baseHref,r)}path(r=!1){const n=this._platformLocation.pathname+Qd(this._platformLocation.search),a=this._platformLocation.hash;return a&&r?`${n}${a}`:n}pushState(r,n,a,i){const o=this.prepareExternalUrl(a+Qd(i));this._platformLocation.pushState(r,n,o)}replaceState(r,n,a,i){const o=this.prepareExternalUrl(a+Qd(i));this._platformLocation.replaceState(r,n,o)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}getState(){return this._platformLocation.getState()}historyGo(r=0){this._platformLocation.historyGo?.(r)}static#e=this.\u0275fac=function(n){return new(n||e)(Tr(q4),Tr(nW,8))};static#t=this.\u0275prov=nr({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),oCe=(()=>{class e extends Cv{constructor(r,n){super(),this._platformLocation=r,this._baseHref="",this._removeListenerFns=[],null!=n&&(this._baseHref=n)}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(r){this._removeListenerFns.push(this._platformLocation.onPopState(r),this._platformLocation.onHashChange(r))}getBaseHref(){return this._baseHref}path(r=!1){const n=this._platformLocation.hash??"#";return n.length>0?n.substring(1):n}prepareExternalUrl(r){const n=W4(this._baseHref,r);return n.length>0?"#"+n:n}pushState(r,n,a,i){let o=this.prepareExternalUrl(a+Qd(i));0==o.length&&(o=this._platformLocation.pathname),this._platformLocation.pushState(r,n,o)}replaceState(r,n,a,i){let o=this.prepareExternalUrl(a+Qd(i));0==o.length&&(o=this._platformLocation.pathname),this._platformLocation.replaceState(r,n,o)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}getState(){return this._platformLocation.getState()}historyGo(r=0){this._platformLocation.historyGo?.(r)}static#e=this.\u0275fac=function(n){return new(n||e)(Tr(q4),Tr(nW,8))};static#t=this.\u0275prov=nr({token:e,factory:e.\u0275fac})}return e})(),t_=(()=>{class e{constructor(r){this._subject=new rs,this._urlChangeListeners=[],this._urlChangeSubscription=null,this._locationStrategy=r;const n=this._locationStrategy.getBaseHref();this._basePath=function cCe(e){if(new RegExp("^(https?:)?//").test(e)){const[,r]=e.split(/\/\/[^\/]+/);return r}return e}(rW(iW(n))),this._locationStrategy.onPopState(a=>{this._subject.emit({url:this.path(!0),pop:!0,state:a.state,type:a.type})})}ngOnDestroy(){this._urlChangeSubscription?.unsubscribe(),this._urlChangeListeners=[]}path(r=!1){return this.normalize(this._locationStrategy.path(r))}getState(){return this._locationStrategy.getState()}isCurrentPathEqualTo(r,n=""){return this.path()==this.normalize(r+Qd(n))}normalize(r){return e.stripTrailingSlash(function uCe(e,t){if(!e||!t.startsWith(e))return t;const r=t.substring(e.length);return""===r||["/",";","?","#"].includes(r[0])?r:t}(this._basePath,iW(r)))}prepareExternalUrl(r){return r&&"/"!==r[0]&&(r="/"+r),this._locationStrategy.prepareExternalUrl(r)}go(r,n="",a=null){this._locationStrategy.pushState(a,"",r,n),this._notifyUrlChangeListeners(this.prepareExternalUrl(r+Qd(n)),a)}replaceState(r,n="",a=null){this._locationStrategy.replaceState(a,"",r,n),this._notifyUrlChangeListeners(this.prepareExternalUrl(r+Qd(n)),a)}forward(){this._locationStrategy.forward()}back(){this._locationStrategy.back()}historyGo(r=0){this._locationStrategy.historyGo?.(r)}onUrlChange(r){return this._urlChangeListeners.push(r),this._urlChangeSubscription??=this.subscribe(n=>{this._notifyUrlChangeListeners(n.url,n.state)}),()=>{const n=this._urlChangeListeners.indexOf(r);this._urlChangeListeners.splice(n,1),0===this._urlChangeListeners.length&&(this._urlChangeSubscription?.unsubscribe(),this._urlChangeSubscription=null)}}_notifyUrlChangeListeners(r="",n){this._urlChangeListeners.forEach(a=>a(r,n))}subscribe(r,n,a){return this._subject.subscribe({next:r,error:n,complete:a})}static#e=this.normalizeQueryParams=Qd;static#t=this.joinWithSlash=W4;static#r=this.stripTrailingSlash=rW;static#n=this.\u0275fac=function(n){return new(n||e)(Tr(Cv))};static#a=this.\u0275prov=nr({token:e,factory:()=>function sCe(){return new t_(Tr(Cv))}(),providedIn:"root"})}return e})();function iW(e){return e.replace(/\/index.html$/,"")}let ik=(()=>{class e{transform(r){return JSON.stringify(r,null,2)}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275pipe=Su({name:"json",type:e,pure:!1,standalone:!0})}return e})(),kA=(()=>{class e{static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275mod=Fx({type:e});static#r=this.\u0275inj=Y1({})}return e})();const _W="browser";function uk(e){return"server"===e}let Exe=(()=>{class e{static#e=this.\u0275prov=nr({token:e,providedIn:"root",factory:()=>function Dxe(e){return e===_W}(Pt(Mh))?new Ixe(Pt(Zs),window):new Mxe})}return e})();class Ixe{constructor(t,r){this.document=t,this.window=r,this.offset=()=>[0,0]}setOffset(t){this.offset=Array.isArray(t)?()=>t:t}getScrollPosition(){return[this.window.scrollX,this.window.scrollY]}scrollToPosition(t){this.window.scrollTo(t[0],t[1])}scrollToAnchor(t){const r=function Pxe(e,t){const r=e.getElementById(t)||e.getElementsByName(t)[0];if(r)return r;if("function"==typeof e.createTreeWalker&&e.body&&"function"==typeof e.body.attachShadow){const n=e.createTreeWalker(e.body,NodeFilter.SHOW_ELEMENT);let a=n.currentNode;for(;a;){const i=a.shadowRoot;if(i){const o=i.getElementById(t)||i.querySelector(`[name="${t}"]`);if(o)return o}a=n.nextNode()}}return null}(this.document,t);r&&(this.scrollToElement(r),r.focus())}setHistoryScrollRestoration(t){this.window.history.scrollRestoration=t}scrollToElement(t){const r=t.getBoundingClientRect(),n=r.left+this.window.pageXOffset,a=r.top+this.window.pageYOffset,i=this.offset();this.window.scrollTo(n-i[0],a-i[1])}}class Mxe{setOffset(t){}getScrollPosition(){return[0,0]}scrollToPosition(t){}scrollToAnchor(t){}setHistoryScrollRestoration(t){}}const n_=e=>e.src,CW=new cr("",{providedIn:"root",factory:()=>n_}),Qxe=new cr("NG_OPTIMIZED_PRELOADED_IMAGES",{providedIn:"root",factory:()=>new Set});let $xe=(()=>{class e{constructor(){this.preloadedImages=Pt(Qxe),this.document=Pt(Zs)}createPreloadLinkTag(r,n,a,i){if(this.preloadedImages.has(n))return;this.preloadedImages.add(n);const o=r.createElement("link");r.setAttribute(o,"as","image"),r.setAttribute(o,"href",n),r.setAttribute(o,"rel","preload"),r.setAttribute(o,"fetchpriority","high"),i&&r.setAttribute(o,"imageSizes",i),a&&r.setAttribute(o,"imageSrcset",a),r.appendChild(this.document.head,o)}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275prov=nr({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();const TW=/^((\s*\d+w\s*(,|$)){1,})$/,ewe=[1,2];let iwe=(()=>{class e{constructor(){this.imageLoader=Pt(CW),this.config=function owe(e){let t={};return e.breakpoints&&(t.breakpoints=e.breakpoints.sort((r,n)=>r-n)),Object.assign({},nz,e,t)}(Pt(az)),this.renderer=Pt(C2),this.imgElement=Pt(Wd).nativeElement,this.injector=Pt(xu),this.isServer=uk(Pt(Mh)),this.preloadLinkCreator=Pt($xe),this.lcpObserver=null,this._renderedSrc=null,this.priority=!1,this.disableOptimizedSrcset=!1,this.fill=!1}ngOnInit(){Fh("NgOptimizedImage"),this.setHostAttributes()}setHostAttributes(){this.fill?this.sizes||="100vw":(this.setHostAttribute("width",this.width.toString()),this.setHostAttribute("height",this.height.toString())),this.setHostAttribute("loading",this.getLoadingBehavior()),this.setHostAttribute("fetchpriority",this.getFetchPriority()),this.setHostAttribute("ng-img","true");const r=this.updateSrcAndSrcset();this.sizes&&this.setHostAttribute("sizes",this.sizes),this.isServer&&this.priority&&this.preloadLinkCreator.createPreloadLinkTag(this.renderer,this.getRewrittenSrc(),r,this.sizes)}ngOnChanges(r){if(r.ngSrc&&!r.ngSrc.isFirstChange()){const n=this._renderedSrc;this.updateSrcAndSrcset(!0);const a=this._renderedSrc;null!==this.lcpObserver&&n&&a&&n!==a&&this.injector.get(Qn).runOutsideAngular(()=>{this.lcpObserver?.updateImage(n,a)})}}callImageLoader(r){let n=r;return this.loaderParams&&(n.loaderParams=this.loaderParams),this.imageLoader(n)}getLoadingBehavior(){return this.priority||void 0===this.loading?this.priority?"eager":"lazy":this.loading}getFetchPriority(){return this.priority?"high":"auto"}getRewrittenSrc(){return this._renderedSrc||(this._renderedSrc=this.callImageLoader({src:this.ngSrc})),this._renderedSrc}getRewrittenSrcset(){const r=TW.test(this.ngSrcset);return this.ngSrcset.split(",").filter(a=>""!==a).map(a=>{a=a.trim();const i=r?parseFloat(a):parseFloat(a)*this.width;return`${this.callImageLoader({src:this.ngSrc,width:i})} ${a}`}).join(", ")}getAutomaticSrcset(){return this.sizes?this.getResponsiveSrcset():this.getFixedSrcset()}getResponsiveSrcset(){const{breakpoints:r}=this.config;let n=r;return"100vw"===this.sizes?.trim()&&(n=r.filter(i=>i>=640)),n.map(i=>`${this.callImageLoader({src:this.ngSrc,width:i})} ${i}w`).join(", ")}updateSrcAndSrcset(r=!1){r&&(this._renderedSrc=null);const n=this.getRewrittenSrc();let a;return this.setHostAttribute("src",n),this.ngSrcset?a=this.getRewrittenSrcset():this.shouldGenerateAutomaticSrcset()&&(a=this.getAutomaticSrcset()),a&&this.setHostAttribute("srcset",a),a}getFixedSrcset(){return ewe.map(n=>`${this.callImageLoader({src:this.ngSrc,width:this.width*n})} ${n}x`).join(", ")}shouldGenerateAutomaticSrcset(){let r=!1;return this.sizes||(r=this.width>1920||this.height>1080),!this.disableOptimizedSrcset&&!this.srcset&&this.imageLoader!==n_&&!r}ngOnDestroy(){}setHostAttribute(r,n){this.renderer.setAttribute(this.imgElement,r,n)}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275dir=fs({type:e,selectors:[["img","ngSrc",""]],hostVars:8,hostBindings:function(n,a){2&n&&t4("position",a.fill?"absolute":null)("width",a.fill?"100%":null)("height",a.fill?"100%":null)("inset",a.fill?"0px":null)},inputs:{ngSrc:[es.HasDecoratorInputTransform,"ngSrc","ngSrc",lwe],ngSrcset:"ngSrcset",sizes:"sizes",width:[es.HasDecoratorInputTransform,"width","width",eW],height:[es.HasDecoratorInputTransform,"height","height",eW],loading:"loading",priority:[es.HasDecoratorInputTransform,"priority","priority",fy],loaderParams:"loaderParams",disableOptimizedSrcset:[es.HasDecoratorInputTransform,"disableOptimizedSrcset","disableOptimizedSrcset",fy],fill:[es.HasDecoratorInputTransform,"fill","fill",fy],src:"src",srcset:"srcset"},standalone:!0,features:[kR,zd]})}return e})();function lwe(e){return"string"==typeof e?e:jd(e)}class fwe extends nCe{constructor(){super(...arguments),this.supportsDOMEvents=!0}}class fk extends fwe{static makeCurrent(){!function rCe(e){tW??=e}(new fk)}onAndCancel(t,r,n){return t.addEventListener(r,n),()=>{t.removeEventListener(r,n)}}dispatchEvent(t,r){t.dispatchEvent(r)}remove(t){t.parentNode&&t.parentNode.removeChild(t)}createElement(t,r){return(r=r||this.getDefaultDocument()).createElement(t)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(t){return t.nodeType===Node.ELEMENT_NODE}isShadowRoot(t){return t instanceof DocumentFragment}getGlobalEventTarget(t,r){return"window"===r?window:"document"===r?t:"body"===r?t.body:null}getBaseHref(t){const r=function dwe(){return i_=i_||document.querySelector("base"),i_?i_.getAttribute("href"):null}();return null==r?null:function pwe(e){return new URL(e,document.baseURI).pathname}(r)}resetBaseElement(){i_=null}getUserAgent(){return window.navigator.userAgent}getCookie(t){return function YCe(e,t){t=encodeURIComponent(t);for(const r of e.split(";")){const n=r.indexOf("="),[a,i]=-1==n?[r,""]:[r.slice(0,n),r.slice(n+1)];if(a.trim()===t)return decodeURIComponent(i)}return null}(document.cookie,t)}}let i_=null,mwe=(()=>{class e{build(){return new XMLHttpRequest}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275prov=nr({token:e,factory:e.\u0275fac})}return e})();const dk=new cr("");let IW=(()=>{class e{constructor(r,n){this._zone=n,this._eventNameToPlugin=new Map,r.forEach(a=>{a.manager=this}),this._plugins=r.slice().reverse()}addEventListener(r,n,a){return this._findPluginFor(n).addEventListener(r,n,a)}getZone(){return this._zone}_findPluginFor(r){let n=this._eventNameToPlugin.get(r);if(n)return n;if(n=this._plugins.find(i=>i.supports(r)),!n)throw new St(5101,!1);return this._eventNameToPlugin.set(r,n),n}static#e=this.\u0275fac=function(n){return new(n||e)(Tr(dk),Tr(Qn))};static#t=this.\u0275prov=nr({token:e,factory:e.\u0275fac})}return e})();class PW{constructor(t){this._doc=t}}const pk="ng-app-id";let MW=(()=>{class e{constructor(r,n,a,i={}){this.doc=r,this.appId=n,this.nonce=a,this.platformId=i,this.styleRef=new Map,this.hostNodes=new Set,this.styleNodesInDOM=this.collectServerRenderedStyles(),this.platformIsServer=uk(i),this.resetHostNodes()}addStyles(r){for(const n of r)1===this.changeUsageCount(n,1)&&this.onStyleAdded(n)}removeStyles(r){for(const n of r)this.changeUsageCount(n,-1)<=0&&this.onStyleRemoved(n)}ngOnDestroy(){const r=this.styleNodesInDOM;r&&(r.forEach(n=>n.remove()),r.clear());for(const n of this.getAllStyles())this.onStyleRemoved(n);this.resetHostNodes()}addHost(r){this.hostNodes.add(r);for(const n of this.getAllStyles())this.addStyleToHost(r,n)}removeHost(r){this.hostNodes.delete(r)}getAllStyles(){return this.styleRef.keys()}onStyleAdded(r){for(const n of this.hostNodes)this.addStyleToHost(n,r)}onStyleRemoved(r){const n=this.styleRef;n.get(r)?.elements?.forEach(a=>a.remove()),n.delete(r)}collectServerRenderedStyles(){const r=this.doc.head?.querySelectorAll(`style[${pk}="${this.appId}"]`);if(r?.length){const n=new Map;return r.forEach(a=>{null!=a.textContent&&n.set(a.textContent,a)}),n}return null}changeUsageCount(r,n){const a=this.styleRef;if(a.has(r)){const i=a.get(r);return i.usage+=n,i.usage}return a.set(r,{usage:n,elements:[]}),n}getStyleElement(r,n){const a=this.styleNodesInDOM,i=a?.get(n);if(i?.parentNode===r)return a.delete(n),i.removeAttribute(pk),i;{const o=this.doc.createElement("style");return this.nonce&&o.setAttribute("nonce",this.nonce),o.textContent=n,this.platformIsServer&&o.setAttribute(pk,this.appId),r.appendChild(o),o}}addStyleToHost(r,n){const a=this.getStyleElement(r,n),i=this.styleRef,o=i.get(n)?.elements;o?o.push(a):i.set(n,{elements:[a],usage:1})}resetHostNodes(){const r=this.hostNodes;r.clear(),r.add(this.doc.head)}static#e=this.\u0275fac=function(n){return new(n||e)(Tr(Zs),Tr(OM),Tr(rz,8),Tr(Mh))};static#t=this.\u0275prov=nr({token:e,factory:e.\u0275fac})}return e})();const hk={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/",math:"http://www.w3.org/1998/MathML/"},mk=/%COMP%/g,bwe=new cr("",{providedIn:"root",factory:()=>!0});function kW(e,t){return t.map(r=>r.replace(mk,e))}let OW=(()=>{class e{constructor(r,n,a,i,o,s,u,c=null){this.eventManager=r,this.sharedStylesHost=n,this.appId=a,this.removeStylesOnCompDestroy=i,this.doc=o,this.platformId=s,this.ngZone=u,this.nonce=c,this.rendererByCompId=new Map,this.platformIsServer=uk(s),this.defaultRenderer=new vk(r,o,u,this.platformIsServer)}createRenderer(r,n){if(!r||!n)return this.defaultRenderer;this.platformIsServer&&n.encapsulation===Rl.ShadowDom&&(n={...n,encapsulation:Rl.Emulated});const a=this.getOrCreateRenderer(r,n);return a instanceof NW?a.applyToHost(r):a instanceof gk&&a.applyStyles(),a}getOrCreateRenderer(r,n){const a=this.rendererByCompId;let i=a.get(n.id);if(!i){const o=this.doc,s=this.ngZone,u=this.eventManager,c=this.sharedStylesHost,l=this.removeStylesOnCompDestroy,f=this.platformIsServer;switch(n.encapsulation){case Rl.Emulated:i=new NW(u,c,n,this.appId,l,o,s,f);break;case Rl.ShadowDom:return new xwe(u,c,r,n,o,s,this.nonce,f);default:i=new gk(u,c,n,l,o,s,f)}a.set(n.id,i)}return i}ngOnDestroy(){this.rendererByCompId.clear()}static#e=this.\u0275fac=function(n){return new(n||e)(Tr(IW),Tr(MW),Tr(OM),Tr(bwe),Tr(Zs),Tr(Mh),Tr(Qn),Tr(rz))};static#t=this.\u0275prov=nr({token:e,factory:e.\u0275fac})}return e})();class vk{constructor(t,r,n,a){this.eventManager=t,this.doc=r,this.ngZone=n,this.platformIsServer=a,this.data=Object.create(null),this.throwOnSyntheticProps=!0,this.destroyNode=null}destroy(){}createElement(t,r){return r?this.doc.createElementNS(hk[r]||r,t):this.doc.createElement(t)}createComment(t){return this.doc.createComment(t)}createText(t){return this.doc.createTextNode(t)}appendChild(t,r){(FW(t)?t.content:t).appendChild(r)}insertBefore(t,r,n){t&&(FW(t)?t.content:t).insertBefore(r,n)}removeChild(t,r){t&&t.removeChild(r)}selectRootElement(t,r){let n="string"==typeof t?this.doc.querySelector(t):t;if(!n)throw new St(-5104,!1);return r||(n.textContent=""),n}parentNode(t){return t.parentNode}nextSibling(t){return t.nextSibling}setAttribute(t,r,n,a){if(a){r=a+":"+r;const i=hk[a];i?t.setAttributeNS(i,r,n):t.setAttribute(r,n)}else t.setAttribute(r,n)}removeAttribute(t,r,n){if(n){const a=hk[n];a?t.removeAttributeNS(a,r):t.removeAttribute(`${n}:${r}`)}else t.removeAttribute(r)}addClass(t,r){t.classList.add(r)}removeClass(t,r){t.classList.remove(r)}setStyle(t,r,n,a){a&(Oh.DashCase|Oh.Important)?t.style.setProperty(r,n,a&Oh.Important?"important":""):t.style[r]=n}removeStyle(t,r,n){n&Oh.DashCase?t.style.removeProperty(r):t.style[r]=""}setProperty(t,r,n){null!=t&&(t[r]=n)}setValue(t,r){t.nodeValue=r}listen(t,r,n){if("string"==typeof t&&!(t=dy().getGlobalEventTarget(this.doc,t)))throw new Error(`Unsupported event target ${t} for event ${r}`);return this.eventManager.addEventListener(t,r,this.decoratePreventDefault(n))}decoratePreventDefault(t){return r=>{if("__ngUnwrap__"===r)return t;!1===(this.platformIsServer?this.ngZone.runGuarded(()=>t(r)):t(r))&&r.preventDefault()}}}function FW(e){return"TEMPLATE"===e.tagName&&void 0!==e.content}class xwe extends vk{constructor(t,r,n,a,i,o,s,u){super(t,i,o,u),this.sharedStylesHost=r,this.hostEl=n,this.shadowRoot=n.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);const c=kW(a.id,a.styles);for(const l of c){const f=document.createElement("style");s&&f.setAttribute("nonce",s),f.textContent=l,this.shadowRoot.appendChild(f)}}nodeOrShadowRoot(t){return t===this.hostEl?this.shadowRoot:t}appendChild(t,r){return super.appendChild(this.nodeOrShadowRoot(t),r)}insertBefore(t,r,n){return super.insertBefore(this.nodeOrShadowRoot(t),r,n)}removeChild(t,r){return super.removeChild(this.nodeOrShadowRoot(t),r)}parentNode(t){return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(t)))}destroy(){this.sharedStylesHost.removeHost(this.shadowRoot)}}class gk extends vk{constructor(t,r,n,a,i,o,s,u){super(t,i,o,s),this.sharedStylesHost=r,this.removeStylesOnCompDestroy=a,this.styles=u?kW(u,n.styles):n.styles}applyStyles(){this.sharedStylesHost.addStyles(this.styles)}destroy(){this.removeStylesOnCompDestroy&&this.sharedStylesHost.removeStyles(this.styles)}}class NW extends gk{constructor(t,r,n,a,i,o,s,u){const c=a+"-"+n.id;super(t,r,n,i,o,s,u,c),this.contentAttr=function _we(e){return"_ngcontent-%COMP%".replace(mk,e)}(c),this.hostAttr=function Swe(e){return"_nghost-%COMP%".replace(mk,e)}(c)}applyToHost(t){this.applyStyles(),this.setAttribute(t,this.hostAttr,"")}createElement(t,r){const n=super.createElement(t,r);return super.setAttribute(n,this.contentAttr,""),n}}let wwe=(()=>{class e extends PW{constructor(r){super(r)}supports(r){return!0}addEventListener(r,n,a){return r.addEventListener(n,a,!1),()=>this.removeEventListener(r,n,a)}removeEventListener(r,n,a){return r.removeEventListener(n,a)}static#e=this.\u0275fac=function(n){return new(n||e)(Tr(Zs))};static#t=this.\u0275prov=nr({token:e,factory:e.\u0275fac})}return e})();const BW=["alt","control","meta","shift"],Awe={"\b":"Backspace","\t":"Tab","\x7f":"Delete","\x1b":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},Twe={alt:e=>e.altKey,control:e=>e.ctrlKey,meta:e=>e.metaKey,shift:e=>e.shiftKey};let Dwe=(()=>{class e extends PW{constructor(r){super(r)}supports(r){return null!=e.parseEventName(r)}addEventListener(r,n,a){const i=e.parseEventName(n),o=e.eventCallback(i.fullKey,a,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>dy().onAndCancel(r,i.domEventName,o))}static parseEventName(r){const n=r.toLowerCase().split("."),a=n.shift();if(0===n.length||"keydown"!==a&&"keyup"!==a)return null;const i=e._normalizeKey(n.pop());let o="",s=n.indexOf("code");if(s>-1&&(n.splice(s,1),o="code."),BW.forEach(c=>{const l=n.indexOf(c);l>-1&&(n.splice(l,1),o+=c+".")}),o+=i,0!=n.length||0===i.length)return null;const u={};return u.domEventName=a,u.fullKey=o,u}static matchEventFullKeyCode(r,n){let a=Awe[r.key]||r.key,i="";return n.indexOf("code.")>-1&&(a=r.code,i="code."),!(null==a||!a)&&(a=a.toLowerCase()," "===a?a="space":"."===a&&(a="dot"),BW.forEach(o=>{o!==a&&(0,Twe[o])(r)&&(i+=o+".")}),i+=a,i===n)}static eventCallback(r,n,a){return i=>{e.matchEventFullKeyCode(i,r)&&a.runGuarded(()=>n(i))}}static _normalizeKey(r){return"esc"===r?"escape":r}static#e=this.\u0275fac=function(n){return new(n||e)(Tr(Zs))};static#t=this.\u0275prov=nr({token:e,factory:e.\u0275fac})}return e})();function LW(e){return{appProviders:[...Owe,...e?.providers??[]],platformProviders:Rwe}}const Rwe=[{provide:Mh,useValue:_W},{provide:tz,useValue:function Iwe(){fk.makeCurrent()},multi:!0},{provide:Zs,useFactory:function Mwe(){return function sve(e){kM=e}(document),document},deps:[]}],Owe=[{provide:DM,useValue:"root"},{provide:Yd,useFactory:function Pwe(){return new Yd},deps:[]},{provide:dk,useClass:wwe,multi:!0,deps:[Zs,Qn,Mh]},{provide:dk,useClass:Dwe,multi:!0,deps:[Zs]},OW,MW,IW,{provide:iG,useExisting:OW},{provide:class Rxe{},useClass:mwe,deps:[]},[]];let Fwe=(()=>{class e{constructor(r){this._doc=r}getTitle(){return this._doc.title}setTitle(r){this._doc.title=r||""}static#e=this.\u0275fac=function(n){return new(n||e)(Tr(Zs))};static#t=this.\u0275prov=nr({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();var yk=function(e,t){return(yk=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(r[a]=n[a])})(e,t)};function qt(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}yk(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var R=function(){return R=Object.assign||function(t){for(var r,n=1,a=arguments.length;n0&&i[i.length-1])&&(6===c[0]||2===c[0])){r=0;continue}if(3===c[0]&&(!i||c[1]>i[0]&&c[1]=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(e),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(i){r[i]=e[i]&&function(o){return new Promise(function(s,u){!function a(i,o,s,u){Promise.resolve(u).then(function(c){i({value:c,done:s})},o)}(s,u,(o=e[i](o)).done,o.value)})}}}"function"==typeof SuppressedError&&SuppressedError;const qW=e=>e&&"number"==typeof e.length&&"function"!=typeof e;function WW(e){return Ga(e?.then)}function YW(e){return Ga(e[MP])}function XW(e){return Symbol.asyncIterator&&Ga(e?.[Symbol.asyncIterator])}function KW(e){return new TypeError(`You provided ${null!==e&&"object"==typeof e?"an invalid object":`'${e}'`} where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}const ZW=function aAe(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}();function QW(e){return Ga(e?.[ZW])}function $W(e){return function HW(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var a,n=r.apply(e,t||[]),i=[];return a={},o("next"),o("throw"),o("return"),a[Symbol.asyncIterator]=function(){return this},a;function o(d){n[d]&&(a[d]=function(p){return new Promise(function(h,m){i.push([d,p,h,m])>1||s(d,p)})})}function s(d,p){try{!function u(d){d.value instanceof zh?Promise.resolve(d.value.v).then(c,l):f(i[0][2],d)}(n[d](p))}catch(h){f(i[0][3],h)}}function c(d){s("next",d)}function l(d){s("throw",d)}function f(d,p){d(p),i.shift(),i.length&&s(i[0][0],i[0][1])}}(this,arguments,function*(){const r=e.getReader();try{for(;;){const{value:n,done:a}=yield zh(r.read());if(a)return yield zh(void 0);yield yield zh(n)}}finally{r.releaseLock()}})}function JW(e){return Ga(e?.getReader)}function rc(e){if(e instanceof No)return e;if(null!=e){if(YW(e))return function iAe(e){return new No(t=>{const r=e[MP]();if(Ga(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}(e);if(qW(e))return function oAe(e){return new No(t=>{for(let r=0;r{e.then(r=>{t.closed||(t.next(r),t.complete())},r=>t.error(r)).then(null,_V)})}(e);if(XW(e))return eY(e);if(QW(e))return function uAe(e){return new No(t=>{for(const r of e)if(t.next(r),t.closed)return;t.complete()})}(e);if(JW(e))return function cAe(e){return eY($W(e))}(e)}throw KW(e)}function eY(e){return new No(t=>{(function lAe(e,t){var r,n,a,i;return ce(this,void 0,void 0,function*(){try{for(r=jW(e);!(n=yield r.next()).done;)if(t.next(n.value),t.closed)return}catch(o){a={error:o}}finally{try{n&&!n.done&&(i=r.return)&&(yield i.call(r))}finally{if(a)throw a.error}}t.complete()})})(e,t).catch(r=>t.error(r))})}function ep(e,t,r,n=0,a=!1){const i=t.schedule(function(){r(),a?e.add(this.schedule(null,n)):this.unsubscribe()},n);if(e.add(i),!a)return i}function tY(e,t=0){return Ci((r,n)=>{r.subscribe(xi(n,a=>ep(n,e,()=>n.next(a),t),()=>ep(n,e,()=>n.complete(),t),a=>ep(n,e,()=>n.error(a),t)))})}function rY(e,t=0){return Ci((r,n)=>{n.add(e.schedule(()=>r.subscribe(n),t))})}function nY(e,t){if(!e)throw new Error("Iterable cannot be null");return new No(r=>{ep(r,t,()=>{const n=e[Symbol.asyncIterator]();ep(r,t,()=>{n.next().then(a=>{a.done?r.complete():r.next(a.value)})},0,!0)})})}function wi(e,t){return t?function vAe(e,t){if(null!=e){if(YW(e))return function fAe(e,t){return rc(e).pipe(rY(t),tY(t))}(e,t);if(qW(e))return function pAe(e,t){return new No(r=>{let n=0;return t.schedule(function(){n===e.length?r.complete():(r.next(e[n++]),r.closed||this.schedule())})})}(e,t);if(WW(e))return function dAe(e,t){return rc(e).pipe(rY(t),tY(t))}(e,t);if(XW(e))return nY(e,t);if(QW(e))return function hAe(e,t){return new No(r=>{let n;return ep(r,t,()=>{n=e[ZW](),ep(r,t,()=>{let a,i;try{({value:a,done:i}=n.next())}catch(o){return void r.error(o)}i?r.complete():r.next(a)},0,!0)}),()=>Ga(n?.return)&&n.return()})}(e,t);if(JW(e))return function mAe(e,t){return nY($W(e),t)}(e,t)}throw KW(e)}(e,t):rc(e)}function aY(e){return e&&Ga(e.schedule)}function Sk(e){return e[e.length-1]}function iY(e){return Ga(Sk(e))?e.pop():void 0}function s_(e){return aY(Sk(e))?e.pop():void 0}function Fr(...e){return wi(e,s_(e))}const{isArray:yAe}=Array,{getPrototypeOf:bAe,prototype:_Ae,keys:SAe}=Object;const{isArray:wAe}=Array;function oY(e){return yr(t=>function AAe(e,t){return wAe(t)?e(...t):e(t)}(e,t))}function Ck(...e){const t=s_(e),r=iY(e),{args:n,keys:a}=function CAe(e){if(1===e.length){const t=e[0];if(yAe(t))return{args:t,keys:null};if(function xAe(e){return e&&"object"==typeof e&&bAe(e)===_Ae}(t)){const r=SAe(t);return{args:r.map(n=>t[n]),keys:r}}}return{args:e,keys:null}}(e);if(0===n.length)return wi([],t);const i=new No(sY(n,t,a?o=>function TAe(e,t){return e.reduce((r,n,a)=>(r[n]=t[a],r),{})}(a,o):Ch));return r?i.pipe(oY(r)):i}function sY(e,t,r=Ch){return n=>{uY(t,()=>{const{length:a}=e,i=new Array(a);let o=a,s=a;for(let u=0;u{const c=wi(e[u],t);let l=!1;c.subscribe(xi(n,f=>{i[u]=f,l||(l=!0,s--),s||n.next(r(i.slice()))},()=>{--o||n.complete()}))},n)},n)}}function uY(e,t,r){e?ep(r,e,t):t()}const FA=wP(e=>function(){e(this),this.name="EmptyError",this.message="no elements in sequence"});function bs(e,t,r=1/0){return Ga(t)?bs((n,a)=>yr((i,o)=>t(n,i,a,o))(rc(e(n,a))),r):("number"==typeof t&&(r=t),Ci((n,a)=>function DAe(e,t,r,n,a,i,o,s){const u=[];let c=0,l=0,f=!1;const d=()=>{f&&!u.length&&!c&&t.complete()},p=m=>c{i&&t.next(m),c++;let v=!1;rc(r(m,l++)).subscribe(xi(t,g=>{a?.(g),i?p(g):t.next(g)},()=>{v=!0},void 0,()=>{if(v)try{for(c--;u.length&&ch(g)):h(g)}d()}catch(g){t.error(g)}}))};return e.subscribe(xi(t,p,()=>{f=!0,d()})),()=>{s?.()}}(n,a,e,r)))}function my(e=1/0){return bs(Ch,e)}function xk(...e){return function EAe(){return my(1)}()(wi(e,s_(e)))}function cY(e){return new No(t=>{rc(e()).subscribe(t)})}function NA(e,t){const r=Ga(e)?e:()=>e,n=a=>a.error(r());return new No(t?a=>t.schedule(n,0,a):n)}const Ff=new No(e=>e.complete());function wk(){return Ci((e,t)=>{let r=null;e._refCount++;const n=xi(t,void 0,void 0,void 0,()=>{if(!e||e._refCount<=0||0<--e._refCount)return void(r=null);const a=e._connection,i=r;r=null,a&&(!i||a===i)&&a.unsubscribe(),t.unsubscribe()});e.subscribe(n),n.closed||(r=e.connect())})}class lY extends No{constructor(t,r){super(),this.source=t,this.subjectFactory=r,this._subject=null,this._refCount=0,this._connection=null,AV(t)&&(this.lift=t.lift)}_subscribe(t){return this.getSubject().subscribe(t)}getSubject(){const t=this._subject;return(!t||t.isStopped)&&(this._subject=this.subjectFactory()),this._subject}_teardown(){this._refCount=0;const{_connection:t}=this;this._subject=this._connection=null,t?.unsubscribe()}connect(){let t=this._connection;if(!t){t=this._connection=new js;const r=this.getSubject();t.add(this.source.subscribe(xi(r,void 0,()=>{this._teardown(),r.complete()},n=>{this._teardown(),r.error(n)},()=>this._teardown()))),t.closed&&(this._connection=null,t=js.EMPTY)}return t}refCount(){return wk()(this)}}function ao(e,t){return Ci((r,n)=>{let a=null,i=0,o=!1;const s=()=>o&&!a&&n.complete();r.subscribe(xi(n,u=>{a?.unsubscribe();let c=0;const l=i++;rc(e(u,l)).subscribe(a=xi(n,f=>n.next(t?t(u,f,l,c++):f),()=>{a=null,s()}))},()=>{o=!0,s()}))})}function xv(e){return e<=0?()=>Ff:Ci((t,r)=>{let n=0;t.subscribe(xi(r,a=>{++n<=e&&(r.next(a),e<=n&&r.complete())}))})}function Ak(...e){const t=s_(e);return Ci((r,n)=>{(t?xk(e,r,t):xk(e,r)).subscribe(n)})}function Nf(e,t){return Ci((r,n)=>{let a=0;r.subscribe(xi(n,i=>e.call(t,i,a++)&&n.next(i)))})}function BA(e){return Ci((t,r)=>{let n=!1;t.subscribe(xi(r,a=>{n=!0,r.next(a)},()=>{n||r.next(e),r.complete()}))})}function fY(e=PAe){return Ci((t,r)=>{let n=!1;t.subscribe(xi(r,a=>{n=!0,r.next(a)},()=>n?r.complete():r.error(e())))})}function PAe(){return new FA}function wv(e,t){const r=arguments.length>=2;return n=>n.pipe(e?Nf((a,i)=>e(a,i,n)):Ch,xv(1),r?BA(t):fY(()=>new FA))}function u_(e,t){return Ga(t)?bs(e,t,1):bs(e,1)}function Rn(e,t,r){const n=Ga(e)||t||r?{next:e,error:t,complete:r}:e;return n?Ci((a,i)=>{var o;null===(o=n.subscribe)||void 0===o||o.call(n);let s=!0;a.subscribe(xi(i,u=>{var c;null===(c=n.next)||void 0===c||c.call(n,u),i.next(u)},()=>{var u;s=!1,null===(u=n.complete)||void 0===u||u.call(n),i.complete()},u=>{var c;s=!1,null===(c=n.error)||void 0===c||c.call(n,u),i.error(u)},()=>{var u,c;s&&(null===(u=n.unsubscribe)||void 0===u||u.call(n)),null===(c=n.finalize)||void 0===c||c.call(n)}))}):Ch}function vy(e){return Ci((t,r)=>{let i,n=null,a=!1;n=t.subscribe(xi(r,void 0,void 0,o=>{i=rc(e(o,vy(e)(t))),n?(n.unsubscribe(),n=null,i.subscribe(r)):a=!0})),a&&(n.unsubscribe(),n=null,i.subscribe(r))})}function Tk(e){return e<=0?()=>Ff:Ci((t,r)=>{let n=[];t.subscribe(xi(r,a=>{n.push(a),e{for(const a of n)r.next(a);r.complete()},void 0,()=>{n=null}))})}function Dk(e){return Ci((t,r)=>{try{t.subscribe(r)}finally{r.add(e)}})}const on="primary",c_=Symbol("RouteTitle");class NAe{constructor(t){this.params=t||{}}has(t){return Object.prototype.hasOwnProperty.call(this.params,t)}get(t){if(this.has(t)){const r=this.params[t];return Array.isArray(r)?r[0]:r}return null}getAll(t){if(this.has(t)){const r=this.params[t];return Array.isArray(r)?r:[r]}return[]}get keys(){return Object.keys(this.params)}}function gy(e){return new NAe(e)}function BAe(e,t,r){const n=r.path.split("/");if(n.length>e.length||"full"===r.pathMatch&&(t.hasChildren()||n.lengthn[i]===a)}return e===t}function pY(e){return e.length>0?e[e.length-1]:null}function Gh(e){return function Uwe(e){return!!e&&(e instanceof No||Ga(e.lift)&&Ga(e.subscribe))}(e)?e:tA(e)?wi(Promise.resolve(e)):Fr(e)}const UAe={exact:function vY(e,t,r){if(!Av(e.segments,t.segments)||!LA(e.segments,t.segments,r)||e.numberOfChildren!==t.numberOfChildren)return!1;for(const n in t.children)if(!e.children[n]||!vY(e.children[n],t.children[n],r))return!1;return!0},subset:gY},hY={exact:function VAe(e,t){return Bf(e,t)},subset:function zAe(e,t){return Object.keys(t).length<=Object.keys(e).length&&Object.keys(t).every(r=>dY(e[r],t[r]))},ignored:()=>!0};function mY(e,t,r){return UAe[r.paths](e.root,t.root,r.matrixParams)&&hY[r.queryParams](e.queryParams,t.queryParams)&&!("exact"===r.fragment&&e.fragment!==t.fragment)}function gY(e,t,r){return yY(e,t,t.segments,r)}function yY(e,t,r,n){if(e.segments.length>r.length){const a=e.segments.slice(0,r.length);return!(!Av(a,r)||t.hasChildren()||!LA(a,r,n))}if(e.segments.length===r.length){if(!Av(e.segments,r)||!LA(e.segments,r,n))return!1;for(const a in t.children)if(!e.children[a]||!gY(e.children[a],t.children[a],n))return!1;return!0}{const a=r.slice(0,e.segments.length),i=r.slice(e.segments.length);return!!(Av(e.segments,a)&&LA(e.segments,a,n)&&e.children[on])&&yY(e.children[on],t,i,n)}}function LA(e,t,r){return t.every((n,a)=>hY[r](e[a].parameters,n.parameters))}class yy{constructor(t=new Ca([],{}),r={},n=null){this.root=t,this.queryParams=r,this.fragment=n}get queryParamMap(){return this._queryParamMap??=gy(this.queryParams),this._queryParamMap}toString(){return jAe.serialize(this)}}class Ca{constructor(t,r){this.segments=t,this.children=r,this.parent=null,Object.values(r).forEach(n=>n.parent=this)}hasChildren(){return this.numberOfChildren>0}get numberOfChildren(){return Object.keys(this.children).length}toString(){return UA(this)}}class l_{constructor(t,r){this.path=t,this.parameters=r}get parameterMap(){return this._parameterMap??=gy(this.parameters),this._parameterMap}toString(){return SY(this)}}function Av(e,t){return e.length===t.length&&e.every((r,n)=>r.path===t[n].path)}let by=(()=>{class e{static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275prov=nr({token:e,factory:()=>new Ik,providedIn:"root"})}return e})();class Ik{parse(t){const r=new tTe(t);return new yy(r.parseRootSegment(),r.parseQueryParams(),r.parseFragment())}serialize(t){const r=`/${f_(t.root,!0)}`,n=function YAe(e){const t=Object.entries(e).map(([r,n])=>Array.isArray(n)?n.map(a=>`${VA(r)}=${VA(a)}`).join("&"):`${VA(r)}=${VA(n)}`).filter(r=>r);return t.length?`?${t.join("&")}`:""}(t.queryParams);return`${r}${n}${"string"==typeof t.fragment?`#${function qAe(e){return encodeURI(e)}(t.fragment)}`:""}`}}const jAe=new Ik;function UA(e){return e.segments.map(t=>SY(t)).join("/")}function f_(e,t){if(!e.hasChildren())return UA(e);if(t){const r=e.children[on]?f_(e.children[on],!1):"",n=[];return Object.entries(e.children).forEach(([a,i])=>{a!==on&&n.push(`${a}:${f_(i,!1)}`)}),n.length>0?`${r}(${n.join("//")})`:r}{const r=function HAe(e,t){let r=[];return Object.entries(e.children).forEach(([n,a])=>{n===on&&(r=r.concat(t(a,n)))}),Object.entries(e.children).forEach(([n,a])=>{n!==on&&(r=r.concat(t(a,n)))}),r}(e,(n,a)=>a===on?[f_(e.children[on],!1)]:[`${a}:${f_(n,!1)}`]);return 1===Object.keys(e.children).length&&null!=e.children[on]?`${UA(e)}/${r[0]}`:`${UA(e)}/(${r.join("//")})`}}function bY(e){return encodeURIComponent(e).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",")}function VA(e){return bY(e).replace(/%3B/gi,";")}function Pk(e){return bY(e).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/%26/gi,"&")}function zA(e){return decodeURIComponent(e)}function _Y(e){return zA(e.replace(/\+/g,"%20"))}function SY(e){return`${Pk(e.path)}${function WAe(e){return Object.entries(e).map(([t,r])=>`;${Pk(t)}=${Pk(r)}`).join("")}(e.parameters)}`}const XAe=/^[^\/()?;#]+/;function Mk(e){const t=e.match(XAe);return t?t[0]:""}const KAe=/^[^\/()?;=#]+/,QAe=/^[^=?&#]+/,JAe=/^[^&#]+/;class tTe{constructor(t){this.url=t,this.remaining=t}parseRootSegment(){return this.consumeOptional("/"),""===this.remaining||this.peekStartsWith("?")||this.peekStartsWith("#")?new Ca([],{}):new Ca([],this.parseChildren())}parseQueryParams(){const t={};if(this.consumeOptional("?"))do{this.parseQueryParam(t)}while(this.consumeOptional("&"));return t}parseFragment(){return this.consumeOptional("#")?decodeURIComponent(this.remaining):null}parseChildren(){if(""===this.remaining)return{};this.consumeOptional("/");const t=[];for(this.peekStartsWith("(")||t.push(this.parseSegment());this.peekStartsWith("/")&&!this.peekStartsWith("//")&&!this.peekStartsWith("/(");)this.capture("/"),t.push(this.parseSegment());let r={};this.peekStartsWith("/(")&&(this.capture("/"),r=this.parseParens(!0));let n={};return this.peekStartsWith("(")&&(n=this.parseParens(!1)),(t.length>0||Object.keys(r).length>0)&&(n[on]=new Ca(t,r)),n}parseSegment(){const t=Mk(this.remaining);if(""===t&&this.peekStartsWith(";"))throw new St(4009,!1);return this.capture(t),new l_(zA(t),this.parseMatrixParams())}parseMatrixParams(){const t={};for(;this.consumeOptional(";");)this.parseParam(t);return t}parseParam(t){const r=function ZAe(e){const t=e.match(KAe);return t?t[0]:""}(this.remaining);if(!r)return;this.capture(r);let n="";if(this.consumeOptional("=")){const a=Mk(this.remaining);a&&(n=a,this.capture(n))}t[zA(r)]=zA(n)}parseQueryParam(t){const r=function $Ae(e){const t=e.match(QAe);return t?t[0]:""}(this.remaining);if(!r)return;this.capture(r);let n="";if(this.consumeOptional("=")){const o=function eTe(e){const t=e.match(JAe);return t?t[0]:""}(this.remaining);o&&(n=o,this.capture(n))}const a=_Y(r),i=_Y(n);if(t.hasOwnProperty(a)){let o=t[a];Array.isArray(o)||(o=[o],t[a]=o),o.push(i)}else t[a]=i}parseParens(t){const r={};for(this.capture("(");!this.consumeOptional(")")&&this.remaining.length>0;){const n=Mk(this.remaining),a=this.remaining[n.length];if("/"!==a&&")"!==a&&";"!==a)throw new St(4010,!1);let i;n.indexOf(":")>-1?(i=n.slice(0,n.indexOf(":")),this.capture(i),this.capture(":")):t&&(i=on);const o=this.parseChildren();r[i]=1===Object.keys(o).length?o[on]:new Ca([],o),this.consumeOptional("//")}return r}peekStartsWith(t){return this.remaining.startsWith(t)}consumeOptional(t){return!!this.peekStartsWith(t)&&(this.remaining=this.remaining.substring(t.length),!0)}capture(t){if(!this.consumeOptional(t))throw new St(4011,!1)}}function CY(e){return e.segments.length>0?new Ca([],{[on]:e}):e}function xY(e){const t={};for(const[n,a]of Object.entries(e.children)){const i=xY(a);if(n===on&&0===i.segments.length&&i.hasChildren())for(const[o,s]of Object.entries(i.children))t[o]=s;else(i.segments.length>0||i.hasChildren())&&(t[n]=i)}return function rTe(e){if(1===e.numberOfChildren&&e.children[on]){const t=e.children[on];return new Ca(e.segments.concat(t.segments),t.children)}return e}(new Ca(e.segments,t))}function _y(e){return e instanceof yy}function wY(e){let t;const n=function r(i){const o={};for(const u of i.children){const c=r(u);o[u.outlet]=c}const s=new Ca(i.url,o);return i===e&&(t=s),s}(e.root),a=CY(n);return t??a}function AY(e,t,r,n){let a=e;for(;a.parent;)a=a.parent;if(0===t.length)return Rk(a,a,a,r,n);const i=function aTe(e){if("string"==typeof e[0]&&1===e.length&&"/"===e[0])return new DY(!0,0,e);let t=0,r=!1;const n=e.reduce((a,i,o)=>{if("object"==typeof i&&null!=i){if(i.outlets){const s={};return Object.entries(i.outlets).forEach(([u,c])=>{s[u]="string"==typeof c?c.split("/"):c}),[...a,{outlets:s}]}if(i.segmentPath)return[...a,i.segmentPath]}return"string"!=typeof i?[...a,i]:0===o?(i.split("/").forEach((s,u)=>{0==u&&"."===s||(0==u&&""===s?r=!0:".."===s?t++:""!=s&&a.push(s))}),a):[...a,i]},[]);return new DY(r,t,n)}(t);if(i.toRoot())return Rk(a,a,new Ca([],{}),r,n);const o=function iTe(e,t,r){if(e.isAbsolute)return new HA(t,!0,0);if(!r)return new HA(t,!1,NaN);if(null===r.parent)return new HA(r,!0,0);const n=GA(e.commands[0])?0:1;return function oTe(e,t,r){let n=e,a=t,i=r;for(;i>a;){if(i-=a,n=n.parent,!n)throw new St(4005,!1);a=n.segments.length}return new HA(n,!1,a-i)}(r,r.segments.length-1+n,e.numberOfDoubleDots)}(i,a,e),s=o.processChildren?p_(o.segmentGroup,o.index,i.commands):EY(o.segmentGroup,o.index,i.commands);return Rk(a,o.segmentGroup,s,r,n)}function GA(e){return"object"==typeof e&&null!=e&&!e.outlets&&!e.segmentPath}function d_(e){return"object"==typeof e&&null!=e&&e.outlets}function Rk(e,t,r,n,a){let o,i={};n&&Object.entries(n).forEach(([u,c])=>{i[u]=Array.isArray(c)?c.map(l=>`${l}`):`${c}`}),o=e===t?r:TY(e,t,r);const s=CY(xY(o));return new yy(s,i,a)}function TY(e,t,r){const n={};return Object.entries(e.children).forEach(([a,i])=>{n[a]=i===t?r:TY(i,t,r)}),new Ca(e.segments,n)}class DY{constructor(t,r,n){if(this.isAbsolute=t,this.numberOfDoubleDots=r,this.commands=n,t&&n.length>0&&GA(n[0]))throw new St(4003,!1);const a=n.find(d_);if(a&&a!==pY(n))throw new St(4004,!1)}toRoot(){return this.isAbsolute&&1===this.commands.length&&"/"==this.commands[0]}}class HA{constructor(t,r,n){this.segmentGroup=t,this.processChildren=r,this.index=n}}function EY(e,t,r){if(e??=new Ca([],{}),0===e.segments.length&&e.hasChildren())return p_(e,t,r);const n=function uTe(e,t,r){let n=0,a=t;const i={match:!1,pathIndex:0,commandIndex:0};for(;a=r.length)return i;const o=e.segments[a],s=r[n];if(d_(s))break;const u=`${s}`,c=n0&&void 0===u)break;if(u&&c&&"object"==typeof c&&void 0===c.outlets){if(!PY(u,c,o))return i;n+=2}else{if(!PY(u,{},o))return i;n++}a++}return{match:!0,pathIndex:a,commandIndex:n}}(e,t,r),a=r.slice(n.commandIndex);if(n.match&&n.pathIndexi!==on)&&e.children[on]&&1===e.numberOfChildren&&0===e.children[on].segments.length){const i=p_(e.children[on],t,r);return new Ca(e.segments,i.children)}return Object.entries(n).forEach(([i,o])=>{"string"==typeof o&&(o=[o]),null!==o&&(a[i]=EY(e.children[i],t,o))}),Object.entries(e.children).forEach(([i,o])=>{void 0===n[i]&&(a[i]=o)}),new Ca(e.segments,a)}}function kk(e,t,r){const n=e.segments.slice(0,t);let a=0;for(;a{"string"==typeof n&&(n=[n]),null!==n&&(t[r]=kk(new Ca([],{}),0,n))}),t}function IY(e){const t={};return Object.entries(e).forEach(([r,n])=>t[r]=`${n}`),t}function PY(e,t,r){return e==r.path&&Bf(t,r.parameters)}const h_="imperative";var En=function(e){return e[e.NavigationStart=0]="NavigationStart",e[e.NavigationEnd=1]="NavigationEnd",e[e.NavigationCancel=2]="NavigationCancel",e[e.NavigationError=3]="NavigationError",e[e.RoutesRecognized=4]="RoutesRecognized",e[e.ResolveStart=5]="ResolveStart",e[e.ResolveEnd=6]="ResolveEnd",e[e.GuardsCheckStart=7]="GuardsCheckStart",e[e.GuardsCheckEnd=8]="GuardsCheckEnd",e[e.RouteConfigLoadStart=9]="RouteConfigLoadStart",e[e.RouteConfigLoadEnd=10]="RouteConfigLoadEnd",e[e.ChildActivationStart=11]="ChildActivationStart",e[e.ChildActivationEnd=12]="ChildActivationEnd",e[e.ActivationStart=13]="ActivationStart",e[e.ActivationEnd=14]="ActivationEnd",e[e.Scroll=15]="Scroll",e[e.NavigationSkipped=16]="NavigationSkipped",e}(En||{});class Lf{constructor(t,r){this.id=t,this.url=r}}class jA extends Lf{constructor(t,r,n="imperative",a=null){super(t,r),this.type=En.NavigationStart,this.navigationTrigger=n,this.restoredState=a}toString(){return`NavigationStart(id: ${this.id}, url: '${this.url}')`}}class tp extends Lf{constructor(t,r,n){super(t,r),this.urlAfterRedirects=n,this.type=En.NavigationEnd}toString(){return`NavigationEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}')`}}var Fc=function(e){return e[e.Redirect=0]="Redirect",e[e.SupersededByNewNavigation=1]="SupersededByNewNavigation",e[e.NoDataFromResolver=2]="NoDataFromResolver",e[e.GuardRejected=3]="GuardRejected",e}(Fc||{}),qA=function(e){return e[e.IgnoredSameUrlNavigation=0]="IgnoredSameUrlNavigation",e[e.IgnoredByUrlHandlingStrategy=1]="IgnoredByUrlHandlingStrategy",e}(qA||{});class Sy extends Lf{constructor(t,r,n,a){super(t,r),this.reason=n,this.code=a,this.type=En.NavigationCancel}toString(){return`NavigationCancel(id: ${this.id}, url: '${this.url}')`}}class Cy extends Lf{constructor(t,r,n,a){super(t,r),this.reason=n,this.code=a,this.type=En.NavigationSkipped}}class WA extends Lf{constructor(t,r,n,a){super(t,r),this.error=n,this.target=a,this.type=En.NavigationError}toString(){return`NavigationError(id: ${this.id}, url: '${this.url}', error: ${this.error})`}}class MY extends Lf{constructor(t,r,n,a){super(t,r),this.urlAfterRedirects=n,this.state=a,this.type=En.RoutesRecognized}toString(){return`RoutesRecognized(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class lTe extends Lf{constructor(t,r,n,a){super(t,r),this.urlAfterRedirects=n,this.state=a,this.type=En.GuardsCheckStart}toString(){return`GuardsCheckStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class fTe extends Lf{constructor(t,r,n,a,i){super(t,r),this.urlAfterRedirects=n,this.state=a,this.shouldActivate=i,this.type=En.GuardsCheckEnd}toString(){return`GuardsCheckEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state}, shouldActivate: ${this.shouldActivate})`}}class dTe extends Lf{constructor(t,r,n,a){super(t,r),this.urlAfterRedirects=n,this.state=a,this.type=En.ResolveStart}toString(){return`ResolveStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class pTe extends Lf{constructor(t,r,n,a){super(t,r),this.urlAfterRedirects=n,this.state=a,this.type=En.ResolveEnd}toString(){return`ResolveEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class hTe{constructor(t){this.route=t,this.type=En.RouteConfigLoadStart}toString(){return`RouteConfigLoadStart(path: ${this.route.path})`}}class mTe{constructor(t){this.route=t,this.type=En.RouteConfigLoadEnd}toString(){return`RouteConfigLoadEnd(path: ${this.route.path})`}}class vTe{constructor(t){this.snapshot=t,this.type=En.ChildActivationStart}toString(){return`ChildActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class gTe{constructor(t){this.snapshot=t,this.type=En.ChildActivationEnd}toString(){return`ChildActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class yTe{constructor(t){this.snapshot=t,this.type=En.ActivationStart}toString(){return`ActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class bTe{constructor(t){this.snapshot=t,this.type=En.ActivationEnd}toString(){return`ActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class RY{constructor(t,r,n){this.routerEvent=t,this.position=r,this.anchor=n,this.type=En.Scroll}toString(){return`Scroll(anchor: '${this.anchor}', position: '${this.position?`${this.position[0]}, ${this.position[1]}`:null}')`}}class Ok{}class Fk{constructor(t){this.url=t}}class _Te{constructor(){this.outlet=null,this.route=null,this.injector=null,this.children=new m_,this.attachRef=null}}let m_=(()=>{class e{constructor(){this.contexts=new Map}onChildOutletCreated(r,n){const a=this.getOrCreateContext(r);a.outlet=n,this.contexts.set(r,a)}onChildOutletDestroyed(r){const n=this.getContext(r);n&&(n.outlet=null,n.attachRef=null)}onOutletDeactivated(){const r=this.contexts;return this.contexts=new Map,r}onOutletReAttached(r){this.contexts=r}getOrCreateContext(r){let n=this.getContext(r);return n||(n=new _Te,this.contexts.set(r,n)),n}getContext(r){return this.contexts.get(r)||null}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275prov=nr({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();class kY{constructor(t){this._root=t}get root(){return this._root.value}parent(t){const r=this.pathFromRoot(t);return r.length>1?r[r.length-2]:null}children(t){const r=Nk(t,this._root);return r?r.children.map(n=>n.value):[]}firstChild(t){const r=Nk(t,this._root);return r&&r.children.length>0?r.children[0].value:null}siblings(t){const r=Bk(t,this._root);return r.length<2?[]:r[r.length-2].children.map(a=>a.value).filter(a=>a!==t)}pathFromRoot(t){return Bk(t,this._root).map(r=>r.value)}}function Nk(e,t){if(e===t.value)return t;for(const r of t.children){const n=Nk(e,r);if(n)return n}return null}function Bk(e,t){if(e===t.value)return[t];for(const r of t.children){const n=Bk(e,r);if(n.length)return n.unshift(t),n}return[]}class Gl{constructor(t,r){this.value=t,this.children=r}toString(){return`TreeNode(${this.value})`}}function xy(e){const t={};return e&&e.children.forEach(r=>t[r.value.outlet]=r),t}class OY extends kY{constructor(t,r){super(t),this.snapshot=r,Vk(this,t)}toString(){return this.snapshot.toString()}}function FY(e){const t=function STe(e){const i=new Uk([],{},{},"",{},on,e,null,{});return new NY("",new Gl(i,[]))}(e),r=new Ui([new l_("",{})]),n=new Ui({}),a=new Ui({}),i=new Ui({}),o=new Ui(""),s=new wy(r,n,i,o,a,on,e,t.root);return s.snapshot=t.root,new OY(new Gl(s,[]),t)}class wy{constructor(t,r,n,a,i,o,s,u){this.urlSubject=t,this.paramsSubject=r,this.queryParamsSubject=n,this.fragmentSubject=a,this.dataSubject=i,this.outlet=o,this.component=s,this._futureSnapshot=u,this.title=this.dataSubject?.pipe(yr(c=>c[c_]))??Fr(void 0),this.url=t,this.params=r,this.queryParams=n,this.fragment=a,this.data=i}get routeConfig(){return this._futureSnapshot.routeConfig}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap??=this.params.pipe(yr(t=>gy(t))),this._paramMap}get queryParamMap(){return this._queryParamMap??=this.queryParams.pipe(yr(t=>gy(t))),this._queryParamMap}toString(){return this.snapshot?this.snapshot.toString():`Future(${this._futureSnapshot})`}}function Lk(e,t,r="emptyOnly"){let n;const{routeConfig:a}=e;return n=null===t||"always"!==r&&""!==a?.path&&(t.component||t.routeConfig?.loadComponent)?{params:{...e.params},data:{...e.data},resolve:{...e.data,...e._resolvedData??{}}}:{params:{...t.params,...e.params},data:{...t.data,...e.data},resolve:{...e.data,...t.data,...a?.data,...e._resolvedData}},a&&LY(a)&&(n.resolve[c_]=a.title),n}class Uk{get title(){return this.data?.[c_]}constructor(t,r,n,a,i,o,s,u,c){this.url=t,this.params=r,this.queryParams=n,this.fragment=a,this.data=i,this.outlet=o,this.component=s,this.routeConfig=u,this._resolve=c}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap??=gy(this.params),this._paramMap}get queryParamMap(){return this._queryParamMap??=gy(this.queryParams),this._queryParamMap}toString(){return`Route(url:'${this.url.map(n=>n.toString()).join("/")}', path:'${this.routeConfig?this.routeConfig.path:""}')`}}class NY extends kY{constructor(t,r){super(r),this.url=t,Vk(this,r)}toString(){return BY(this._root)}}function Vk(e,t){t.value._routerState=e,t.children.forEach(r=>Vk(e,r))}function BY(e){const t=e.children.length>0?` { ${e.children.map(BY).join(", ")} } `:"";return`${e.value}${t}`}function zk(e){if(e.snapshot){const t=e.snapshot,r=e._futureSnapshot;e.snapshot=r,Bf(t.queryParams,r.queryParams)||e.queryParamsSubject.next(r.queryParams),t.fragment!==r.fragment&&e.fragmentSubject.next(r.fragment),Bf(t.params,r.params)||e.paramsSubject.next(r.params),function LAe(e,t){if(e.length!==t.length)return!1;for(let r=0;rBf(r.parameters,t[n].parameters))}(e.url,t.url);return r&&!(!e.parent!=!t.parent)&&(!e.parent||Gk(e.parent,t.parent))}function LY(e){return"string"==typeof e.title||null===e.title}let Hk=(()=>{class e{constructor(){this.activated=null,this._activatedRoute=null,this.name=on,this.activateEvents=new rs,this.deactivateEvents=new rs,this.attachEvents=new rs,this.detachEvents=new rs,this.parentContexts=Pt(m_),this.location=Pt(Bl),this.changeDetector=Pt(Fw),this.environmentInjector=Pt(Pc),this.inputBinder=Pt(YA,{optional:!0}),this.supportsBindingToComponentInputs=!0}get activatedComponentRef(){return this.activated}ngOnChanges(r){if(r.name){const{firstChange:n,previousValue:a}=r.name;if(n)return;this.isTrackedInParentContexts(a)&&(this.deactivate(),this.parentContexts.onChildOutletDestroyed(a)),this.initializeOutletWithName()}}ngOnDestroy(){this.isTrackedInParentContexts(this.name)&&this.parentContexts.onChildOutletDestroyed(this.name),this.inputBinder?.unsubscribeFromRouteData(this)}isTrackedInParentContexts(r){return this.parentContexts.getContext(r)?.outlet===this}ngOnInit(){this.initializeOutletWithName()}initializeOutletWithName(){if(this.parentContexts.onChildOutletCreated(this.name,this),this.activated)return;const r=this.parentContexts.getContext(this.name);r?.route&&(r.attachRef?this.attach(r.attachRef,r.route):this.activateWith(r.route,r.injector))}get isActivated(){return!!this.activated}get component(){if(!this.activated)throw new St(4012,!1);return this.activated.instance}get activatedRoute(){if(!this.activated)throw new St(4012,!1);return this._activatedRoute}get activatedRouteData(){return this._activatedRoute?this._activatedRoute.snapshot.data:{}}detach(){if(!this.activated)throw new St(4012,!1);this.location.detach();const r=this.activated;return this.activated=null,this._activatedRoute=null,this.detachEvents.emit(r.instance),r}attach(r,n){this.activated=r,this._activatedRoute=n,this.location.insert(r.hostView),this.inputBinder?.bindActivatedRouteToOutletComponent(this),this.attachEvents.emit(r.instance)}deactivate(){if(this.activated){const r=this.component;this.activated.destroy(),this.activated=null,this._activatedRoute=null,this.deactivateEvents.emit(r)}}activateWith(r,n){if(this.isActivated)throw new St(4013,!1);this._activatedRoute=r;const a=this.location,o=r.snapshot.component,s=this.parentContexts.getOrCreateContext(this.name).children,u=new CTe(r,s,a.injector);this.activated=a.createComponent(o,{index:a.length,injector:u,environmentInjector:n??this.environmentInjector}),this.changeDetector.markForCheck(),this.inputBinder?.bindActivatedRouteToOutletComponent(this),this.activateEvents.emit(this.activated.instance)}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275dir=fs({type:e,selectors:[["router-outlet"]],inputs:{name:"name"},outputs:{activateEvents:"activate",deactivateEvents:"deactivate",attachEvents:"attach",detachEvents:"detach"},exportAs:["outlet"],standalone:!0,features:[zd]})}return e})();class CTe{constructor(t,r,n){this.route=t,this.childContexts=r,this.parent=n}get(t,r){return t===wy?this.route:t===m_?this.childContexts:this.parent.get(t,r)}}const YA=new cr("");let UY=(()=>{class e{constructor(){this.outletDataSubscriptions=new Map}bindActivatedRouteToOutletComponent(r){this.unsubscribeFromRouteData(r),this.subscribeToRouteData(r)}unsubscribeFromRouteData(r){this.outletDataSubscriptions.get(r)?.unsubscribe(),this.outletDataSubscriptions.delete(r)}subscribeToRouteData(r){const{activatedRoute:n}=r,a=Ck([n.queryParams,n.params,n.data]).pipe(ao(([i,o,s],u)=>(s={...i,...o,...s},0===u?Fr(s):Promise.resolve(s)))).subscribe(i=>{if(!r.isActivated||!r.activatedComponentRef||r.activatedRoute!==n||null===n.component)return void this.unsubscribeFromRouteData(r);const o=function tCe(e){const t=dn(e);if(!t)return null;const r=new E2(t);return{get selector(){return r.selector},get type(){return r.componentType},get inputs(){return r.inputs},get outputs(){return r.outputs},get ngContentSelectors(){return r.ngContentSelectors},get isStandalone(){return t.standalone},get isSignal(){return t.signals}}}(n.component);if(o)for(const{templateName:s}of o.inputs)r.activatedComponentRef.setInput(s,i[s]);else this.unsubscribeFromRouteData(r)});this.outletDataSubscriptions.set(r,a)}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275prov=nr({token:e,factory:e.\u0275fac})}return e})();function v_(e,t,r){if(r&&e.shouldReuseRoute(t.value,r.value.snapshot)){const n=r.value;n._futureSnapshot=t.value;const a=function wTe(e,t,r){return t.children.map(n=>{for(const a of r.children)if(e.shouldReuseRoute(n.value,a.value.snapshot))return v_(e,n,a);return v_(e,n)})}(e,t,r);return new Gl(n,a)}{if(e.shouldAttach(t.value)){const i=e.retrieve(t.value);if(null!==i){const o=i.route;return o.value._futureSnapshot=t.value,o.children=t.children.map(s=>v_(e,s)),o}}const n=function ATe(e){return new wy(new Ui(e.url),new Ui(e.params),new Ui(e.queryParams),new Ui(e.fragment),new Ui(e.data),e.outlet,e.component,e)}(t.value),a=t.children.map(i=>v_(e,i));return new Gl(n,a)}}const VY="ngNavigationCancelingError";function zY(e,t){const{redirectTo:r,navigationBehaviorOptions:n}=_y(t)?{redirectTo:t,navigationBehaviorOptions:void 0}:t,a=GY(!1,Fc.Redirect);return a.url=r,a.navigationBehaviorOptions=n,a}function GY(e,t){const r=new Error(`NavigationCancelingError: ${e||""}`);return r[VY]=!0,r.cancellationCode=t,r}function HY(e){return!!e&&e[VY]}let jY=(()=>{class e{static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275cmp=Ah({type:e,selectors:[["ng-component"]],standalone:!0,features:[Uh],decls:1,vars:0,template:function(n,a){1&n&&ys(0,"router-outlet")},dependencies:[Hk],encapsulation:2})}return e})();function jk(e){const t=e.children&&e.children.map(jk),r=t?{...e,children:t}:{...e};return!r.component&&!r.loadComponent&&(t||r.loadChildren)&&r.outlet&&r.outlet!==on&&(r.component=jY),r}function Uf(e){return e.outlet||on}function g_(e){if(!e)return null;if(e.routeConfig?._injector)return e.routeConfig._injector;for(let t=e.parent;t;t=t.parent){const r=t.routeConfig;if(r?._loadedInjector)return r._loadedInjector;if(r?._injector)return r._injector}return null}class kTe{constructor(t,r,n,a,i){this.routeReuseStrategy=t,this.futureState=r,this.currState=n,this.forwardEvent=a,this.inputBindingEnabled=i}activate(t){const r=this.futureState._root,n=this.currState?this.currState._root:null;this.deactivateChildRoutes(r,n,t),zk(this.futureState.root),this.activateChildRoutes(r,n,t)}deactivateChildRoutes(t,r,n){const a=xy(r);t.children.forEach(i=>{const o=i.value.outlet;this.deactivateRoutes(i,a[o],n),delete a[o]}),Object.values(a).forEach(i=>{this.deactivateRouteAndItsChildren(i,n)})}deactivateRoutes(t,r,n){const a=t.value,i=r?r.value:null;if(a===i)if(a.component){const o=n.getContext(a.outlet);o&&this.deactivateChildRoutes(t,r,o.children)}else this.deactivateChildRoutes(t,r,n);else i&&this.deactivateRouteAndItsChildren(r,n)}deactivateRouteAndItsChildren(t,r){t.value.component&&this.routeReuseStrategy.shouldDetach(t.value.snapshot)?this.detachAndStoreRouteSubtree(t,r):this.deactivateRouteAndOutlet(t,r)}detachAndStoreRouteSubtree(t,r){const n=r.getContext(t.value.outlet),a=n&&t.value.component?n.children:r,i=xy(t);for(const o of Object.values(i))this.deactivateRouteAndItsChildren(o,a);if(n&&n.outlet){const o=n.outlet.detach(),s=n.children.onOutletDeactivated();this.routeReuseStrategy.store(t.value.snapshot,{componentRef:o,route:t,contexts:s})}}deactivateRouteAndOutlet(t,r){const n=r.getContext(t.value.outlet),a=n&&t.value.component?n.children:r,i=xy(t);for(const o of Object.values(i))this.deactivateRouteAndItsChildren(o,a);n&&(n.outlet&&(n.outlet.deactivate(),n.children.onOutletDeactivated()),n.attachRef=null,n.route=null)}activateChildRoutes(t,r,n){const a=xy(r);t.children.forEach(i=>{this.activateRoutes(i,a[i.value.outlet],n),this.forwardEvent(new bTe(i.value.snapshot))}),t.children.length&&this.forwardEvent(new gTe(t.value.snapshot))}activateRoutes(t,r,n){const a=t.value,i=r?r.value:null;if(zk(a),a===i)if(a.component){const o=n.getOrCreateContext(a.outlet);this.activateChildRoutes(t,r,o.children)}else this.activateChildRoutes(t,r,n);else if(a.component){const o=n.getOrCreateContext(a.outlet);if(this.routeReuseStrategy.shouldAttach(a.snapshot)){const s=this.routeReuseStrategy.retrieve(a.snapshot);this.routeReuseStrategy.store(a.snapshot,null),o.children.onOutletReAttached(s.contexts),o.attachRef=s.componentRef,o.route=s.route.value,o.outlet&&o.outlet.attach(s.componentRef,s.route.value),zk(s.route.value),this.activateChildRoutes(t,null,o.children)}else{const s=g_(a.snapshot);o.attachRef=null,o.route=a,o.injector=s,o.outlet&&o.outlet.activateWith(a,o.injector),this.activateChildRoutes(t,null,o.children)}}else this.activateChildRoutes(t,null,n)}}class qY{constructor(t){this.path=t,this.route=this.path[this.path.length-1]}}class XA{constructor(t,r){this.component=t,this.route=r}}function OTe(e,t,r){const n=e._root;return y_(n,t?t._root:null,r,[n.value])}function Ay(e,t){const r=Symbol(),n=t.get(e,r);return n===r?"function"!=typeof e||function ahe(e){return null!==Ix(e)}(e)?t.get(e):e:n}function y_(e,t,r,n,a={canDeactivateChecks:[],canActivateChecks:[]}){const i=xy(t);return e.children.forEach(o=>{(function NTe(e,t,r,n,a={canDeactivateChecks:[],canActivateChecks:[]}){const i=e.value,o=t?t.value:null,s=r?r.getContext(e.value.outlet):null;if(o&&i.routeConfig===o.routeConfig){const u=function BTe(e,t,r){if("function"==typeof r)return r(e,t);switch(r){case"pathParamsChange":return!Av(e.url,t.url);case"pathParamsOrQueryParamsChange":return!Av(e.url,t.url)||!Bf(e.queryParams,t.queryParams);case"always":return!0;case"paramsOrQueryParamsChange":return!Gk(e,t)||!Bf(e.queryParams,t.queryParams);default:return!Gk(e,t)}}(o,i,i.routeConfig.runGuardsAndResolvers);u?a.canActivateChecks.push(new qY(n)):(i.data=o.data,i._resolvedData=o._resolvedData),y_(e,t,i.component?s?s.children:null:r,n,a),u&&s&&s.outlet&&s.outlet.isActivated&&a.canDeactivateChecks.push(new XA(s.outlet.component,o))}else o&&b_(t,s,a),a.canActivateChecks.push(new qY(n)),y_(e,null,i.component?s?s.children:null:r,n,a)})(o,i[o.value.outlet],r,n.concat([o.value]),a),delete i[o.value.outlet]}),Object.entries(i).forEach(([o,s])=>b_(s,r.getContext(o),a)),a}function b_(e,t,r){const n=xy(e),a=e.value;Object.entries(n).forEach(([i,o])=>{b_(o,a.component?t?t.children.getContext(i):null:t,r)}),r.canDeactivateChecks.push(new XA(a.component&&t&&t.outlet&&t.outlet.isActivated?t.outlet.component:null,a))}function __(e){return"function"==typeof e}function WY(e){return e instanceof FA||"EmptyError"===e?.name}const KA=Symbol("INITIAL_VALUE");function Ty(){return ao(e=>Ck(e.map(t=>t.pipe(xv(1),Ak(KA)))).pipe(yr(t=>{for(const r of t)if(!0!==r){if(r===KA)return KA;if(!1===r||r instanceof yy)return r}return!0}),Nf(t=>t!==KA),xv(1)))}function YY(e){return SV(Rn(t=>{if(_y(t))throw zY(0,t)}),yr(t=>!0===t))}class qk{constructor(t){this.segmentGroup=t||null}}class Wk extends Error{constructor(t){super(),this.urlTree=t}}function Dy(e){return NA(new qk(e))}class rDe{constructor(t,r){this.urlSerializer=t,this.urlTree=r}lineralizeSegments(t,r){let n=[],a=r.root;for(;;){if(n=n.concat(a.segments),0===a.numberOfChildren)return Fr(n);if(a.numberOfChildren>1||!a.children[on])return NA(new St(4e3,!1));a=a.children[on]}}applyRedirectCommands(t,r,n){const a=this.applyRedirectCreateUrlTree(r,this.urlSerializer.parse(r),t,n);if(r.startsWith("/"))throw new Wk(a);return a}applyRedirectCreateUrlTree(t,r,n,a){const i=this.createSegmentGroup(t,r.root,n,a);return new yy(i,this.createQueryParams(r.queryParams,this.urlTree.queryParams),r.fragment)}createQueryParams(t,r){const n={};return Object.entries(t).forEach(([a,i])=>{if("string"==typeof i&&i.startsWith(":")){const s=i.substring(1);n[a]=r[s]}else n[a]=i}),n}createSegmentGroup(t,r,n,a){const i=this.createSegments(t,r.segments,n,a);let o={};return Object.entries(r.children).forEach(([s,u])=>{o[s]=this.createSegmentGroup(t,u,n,a)}),new Ca(i,o)}createSegments(t,r,n,a){return r.map(i=>i.path.startsWith(":")?this.findPosParam(t,i,a):this.findOrReturn(i,n))}findPosParam(t,r,n){const a=n[r.path.substring(1)];if(!a)throw new St(4001,!1);return a}findOrReturn(t,r){let n=0;for(const a of r){if(a.path===t.path)return r.splice(n),a;n++}return t}}const Yk={matched:!1,consumedSegments:[],remainingSegments:[],parameters:{},positionalParamSegments:{}};function nDe(e,t,r,n,a){const i=Xk(e,t,r);return i.matched?(n=function DTe(e,t){return e.providers&&!e._injector&&(e._injector=A4(e.providers,t,`Route: ${e.path}`)),e._injector??t}(t,n),function JTe(e,t,r,n){const a=t.canMatch;return a&&0!==a.length?Fr(a.map(o=>{const s=Ay(o,e);return Gh(function HTe(e){return e&&__(e.canMatch)}(s)?s.canMatch(t,r):dv(e,()=>s(t,r)))})).pipe(Ty(),YY()):Fr(!0)}(n,t,r).pipe(yr(o=>!0===o?i:{...Yk}))):Fr(i)}function Xk(e,t,r){if("**"===t.path)return function aDe(e){return{matched:!0,parameters:e.length>0?pY(e).parameters:{},consumedSegments:e,remainingSegments:[],positionalParamSegments:{}}}(r);if(""===t.path)return"full"===t.pathMatch&&(e.hasChildren()||r.length>0)?{...Yk}:{matched:!0,consumedSegments:[],remainingSegments:r,parameters:{},positionalParamSegments:{}};const a=(t.matcher||BAe)(r,e,t);if(!a)return{...Yk};const i={};Object.entries(a.posParams??{}).forEach(([s,u])=>{i[s]=u.path});const o=a.consumed.length>0?{...i,...a.consumed[a.consumed.length-1].parameters}:i;return{matched:!0,consumedSegments:a.consumed,remainingSegments:r.slice(a.consumed.length),parameters:o,positionalParamSegments:a.posParams??{}}}function XY(e,t,r,n){return r.length>0&&function sDe(e,t,r){return r.some(n=>ZA(e,t,n)&&Uf(n)!==on)}(e,r,n)?{segmentGroup:new Ca(t,oDe(n,new Ca(r,e.children))),slicedSegments:[]}:0===r.length&&function uDe(e,t,r){return r.some(n=>ZA(e,t,n))}(e,r,n)?{segmentGroup:new Ca(e.segments,iDe(e,r,n,e.children)),slicedSegments:r}:{segmentGroup:new Ca(e.segments,e.children),slicedSegments:r}}function iDe(e,t,r,n){const a={};for(const i of r)if(ZA(e,t,i)&&!n[Uf(i)]){const o=new Ca([],{});a[Uf(i)]=o}return{...n,...a}}function oDe(e,t){const r={};r[on]=t;for(const n of e)if(""===n.path&&Uf(n)!==on){const a=new Ca([],{});r[Uf(n)]=a}return r}function ZA(e,t,r){return(!(e.hasChildren()||t.length>0)||"full"!==r.pathMatch)&&""===r.path}class fDe{}class hDe{constructor(t,r,n,a,i,o,s){this.injector=t,this.configLoader=r,this.rootComponentType=n,this.config=a,this.urlTree=i,this.paramsInheritanceStrategy=o,this.urlSerializer=s,this.applyRedirects=new rDe(this.urlSerializer,this.urlTree),this.absoluteRedirectCount=0,this.allowRedirects=!0}noMatchError(t){return new St(4002,`'${t.segmentGroup}'`)}recognize(){const t=XY(this.urlTree.root,[],[],this.config).segmentGroup;return this.match(t).pipe(yr(r=>{const n=new Uk([],Object.freeze({}),Object.freeze({...this.urlTree.queryParams}),this.urlTree.fragment,{},on,this.rootComponentType,null,{}),a=new Gl(n,r),i=new NY("",a),o=function nTe(e,t,r=null,n=null){return AY(wY(e),t,r,n)}(n,[],this.urlTree.queryParams,this.urlTree.fragment);return o.queryParams=this.urlTree.queryParams,i.url=this.urlSerializer.serialize(o),this.inheritParamsAndData(i._root,null),{state:i,tree:o}}))}match(t){return this.processSegmentGroup(this.injector,this.config,t,on).pipe(vy(n=>{if(n instanceof Wk)return this.urlTree=n.urlTree,this.match(n.urlTree.root);throw n instanceof qk?this.noMatchError(n):n}))}inheritParamsAndData(t,r){const n=t.value,a=Lk(n,r,this.paramsInheritanceStrategy);n.params=Object.freeze(a.params),n.data=Object.freeze(a.data),t.children.forEach(i=>this.inheritParamsAndData(i,n))}processSegmentGroup(t,r,n,a){return 0===n.segments.length&&n.hasChildren()?this.processChildren(t,r,n):this.processSegment(t,r,n,n.segments,a,!0).pipe(yr(i=>i instanceof Gl?[i]:[]))}processChildren(t,r,n){const a=[];for(const i of Object.keys(n.children))"primary"===i?a.unshift(i):a.push(i);return wi(a).pipe(u_(i=>{const o=n.children[i],s=function MTe(e,t){const r=e.filter(n=>Uf(n)===t);return r.push(...e.filter(n=>Uf(n)!==t)),r}(r,i);return this.processSegmentGroup(t,s,o,i)}),function RAe(e,t){return Ci(function MAe(e,t,r,n,a){return(i,o)=>{let s=r,u=t,c=0;i.subscribe(xi(o,l=>{const f=c++;u=s?e(u,l,f):(s=!0,l),n&&o.next(u)},a&&(()=>{s&&o.next(u),o.complete()})))}}(e,t,arguments.length>=2,!0))}((i,o)=>(i.push(...o),i)),BA(null),function kAe(e,t){const r=arguments.length>=2;return n=>n.pipe(e?Nf((a,i)=>e(a,i,n)):Ch,Tk(1),r?BA(t):fY(()=>new FA))}(),bs(i=>{if(null===i)return Dy(n);const o=KY(i);return function mDe(e){e.sort((t,r)=>t.value.outlet===on?-1:r.value.outlet===on?1:t.value.outlet.localeCompare(r.value.outlet))}(o),Fr(o)}))}processSegment(t,r,n,a,i,o){return wi(r).pipe(u_(s=>this.processSegmentAgainstRoute(s._injector??t,r,s,n,a,i,o).pipe(vy(u=>{if(u instanceof qk)return Fr(null);throw u}))),wv(s=>!!s),vy(s=>{if(WY(s))return function lDe(e,t,r){return 0===t.length&&!e.children[r]}(n,a,i)?Fr(new fDe):Dy(n);throw s}))}processSegmentAgainstRoute(t,r,n,a,i,o,s){return function cDe(e,t,r,n){return!!(Uf(e)===n||n!==on&&ZA(t,r,e))&&Xk(t,e,r).matched}(n,a,i,o)?void 0===n.redirectTo?this.matchSegmentAgainstRoute(t,a,n,i,o):this.allowRedirects&&s?this.expandSegmentAgainstRouteUsingRedirect(t,a,r,n,i,o):Dy(a):Dy(a)}expandSegmentAgainstRouteUsingRedirect(t,r,n,a,i,o){const{matched:s,consumedSegments:u,positionalParamSegments:c,remainingSegments:l}=Xk(r,a,i);if(!s)return Dy(r);a.redirectTo.startsWith("/")&&(this.absoluteRedirectCount++,this.absoluteRedirectCount>31&&(this.allowRedirects=!1));const f=this.applyRedirects.applyRedirectCommands(u,a.redirectTo,c);return this.applyRedirects.lineralizeSegments(a,f).pipe(bs(d=>this.processSegment(t,n,r,d.concat(l),o,!1)))}matchSegmentAgainstRoute(t,r,n,a,i){const o=nDe(r,n,a,t);return"**"===n.path&&(r.children={}),o.pipe(ao(s=>s.matched?this.getChildConfig(t=n._injector??t,n,a).pipe(ao(({routes:u})=>{const c=n._loadedInjector??t,{consumedSegments:l,remainingSegments:f,parameters:d}=s,p=new Uk(l,d,Object.freeze({...this.urlTree.queryParams}),this.urlTree.fragment,function gDe(e){return e.data||{}}(n),Uf(n),n.component??n._loadedComponent??null,n,function yDe(e){return e.resolve||{}}(n)),{segmentGroup:h,slicedSegments:m}=XY(r,l,f,u);if(0===m.length&&h.hasChildren())return this.processChildren(c,u,h).pipe(yr(g=>null===g?null:new Gl(p,g)));if(0===u.length&&0===m.length)return Fr(new Gl(p,[]));const v=Uf(n)===i;return this.processSegment(c,u,h,m,v?on:i,!0).pipe(yr(g=>new Gl(p,g instanceof Gl?[g]:[])))})):Dy(r)))}getChildConfig(t,r,n){return r.children?Fr({routes:r.children,injector:t}):r.loadChildren?void 0!==r._loadedRoutes?Fr({routes:r._loadedRoutes,injector:r._loadedInjector}):function $Te(e,t,r,n){const a=t.canLoad;return void 0===a||0===a.length?Fr(!0):Fr(a.map(o=>{const s=Ay(o,e);return Gh(function UTe(e){return e&&__(e.canLoad)}(s)?s.canLoad(t,r):dv(e,()=>s(t,r)))})).pipe(Ty(),YY())}(t,r,n).pipe(bs(a=>a?this.configLoader.loadChildren(t,r).pipe(Rn(i=>{r._loadedRoutes=i.routes,r._loadedInjector=i.injector})):function tDe(e){return NA(GY(!1,Fc.GuardRejected))}())):Fr({routes:[],injector:t})}}function vDe(e){const t=e.value.routeConfig;return t&&""===t.path}function KY(e){const t=[],r=new Set;for(const n of e){if(!vDe(n)){t.push(n);continue}const a=t.find(i=>n.value.routeConfig===i.value.routeConfig);void 0!==a?(a.children.push(...n.children),r.add(a)):t.push(n)}for(const n of r){const a=KY(n.children);t.push(new Gl(n.value,a))}return t.filter(n=>!r.has(n))}function ZY(e){const t=e.children.map(r=>ZY(r)).flat();return[e,...t]}function Kk(e){return ao(t=>{const r=e(t);return r?wi(r).pipe(yr(()=>t)):Fr(t)})}let QY=(()=>{class e{buildTitle(r){let n,a=r.root;for(;void 0!==a;)n=this.getResolvedTitleForRoute(a)??n,a=a.children.find(i=>i.outlet===on);return n}getResolvedTitleForRoute(r){return r.data[c_]}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275prov=nr({token:e,factory:()=>Pt(wDe),providedIn:"root"})}return e})(),wDe=(()=>{class e extends QY{constructor(r){super(),this.title=r}updateTitle(r){const n=this.buildTitle(r);void 0!==n&&this.title.setTitle(n)}static#e=this.\u0275fac=function(n){return new(n||e)(Tr(Fwe))};static#t=this.\u0275prov=nr({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();const Ey=new cr("",{providedIn:"root",factory:()=>({})}),Iy=new cr("");let Zk=(()=>{class e{constructor(){this.componentLoaders=new WeakMap,this.childrenLoaders=new WeakMap,this.compiler=Pt(mq)}loadComponent(r){if(this.componentLoaders.get(r))return this.componentLoaders.get(r);if(r._loadedComponent)return Fr(r._loadedComponent);this.onLoadStartListener&&this.onLoadStartListener(r);const n=Gh(r.loadComponent()).pipe(yr($Y),Rn(i=>{this.onLoadEndListener&&this.onLoadEndListener(r),r._loadedComponent=i}),Dk(()=>{this.componentLoaders.delete(r)})),a=new lY(n,()=>new Cn).pipe(wk());return this.componentLoaders.set(r,a),a}loadChildren(r,n){if(this.childrenLoaders.get(n))return this.childrenLoaders.get(n);if(n._loadedRoutes)return Fr({routes:n._loadedRoutes,injector:n._loadedInjector});this.onLoadStartListener&&this.onLoadStartListener(n);const i=function ADe(e,t,r,n){return Gh(e.loadChildren()).pipe(yr($Y),bs(a=>a instanceof Lj||Array.isArray(a)?Fr(a):wi(t.compileModuleAsync(a))),yr(a=>{n&&n(e);let i,o,s=!1;return Array.isArray(a)?(o=a,!0):(i=a.create(r).injector,o=i.get(Iy,[],{optional:!0,self:!0}).flat()),{routes:o.map(jk),injector:i}}))}(n,this.compiler,r,this.onLoadEndListener).pipe(Dk(()=>{this.childrenLoaders.delete(n)})),o=new lY(i,()=>new Cn).pipe(wk());return this.childrenLoaders.set(n,o),o}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275prov=nr({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();function $Y(e){return function TDe(e){return e&&"object"==typeof e&&"default"in e}(e)?e.default:e}let Qk=(()=>{class e{static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275prov=nr({token:e,factory:()=>Pt(DDe),providedIn:"root"})}return e})(),DDe=(()=>{class e{shouldProcessUrl(r){return!0}extract(r){return r}merge(r,n){return r}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275prov=nr({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();const JY=new cr(""),eX=new cr("");function EDe(e,t,r){const n=e.get(eX),a=e.get(Zs);return e.get(Qn).runOutsideAngular(()=>{if(!a.startViewTransition||n.skipNextTransition)return n.skipNextTransition=!1,Promise.resolve();let i;const o=new Promise(c=>{i=c}),s=a.startViewTransition(()=>(i(),function IDe(e){return new Promise(t=>{ZG(t,{injector:e})})}(e))),{onViewTransitionCreated:u}=n;return u&&dv(e,()=>u({transition:s,from:t,to:r})),o})}let QA=(()=>{class e{get hasRequestedNavigation(){return 0!==this.navigationId}constructor(){this.currentNavigation=null,this.currentTransition=null,this.lastSuccessfulNavigation=null,this.events=new Cn,this.transitionAbortSubject=new Cn,this.configLoader=Pt(Zk),this.environmentInjector=Pt(Pc),this.urlSerializer=Pt(by),this.rootContexts=Pt(m_),this.location=Pt(t_),this.inputBindingEnabled=null!==Pt(YA,{optional:!0}),this.titleStrategy=Pt(QY),this.options=Pt(Ey,{optional:!0})||{},this.paramsInheritanceStrategy=this.options.paramsInheritanceStrategy||"emptyOnly",this.urlHandlingStrategy=Pt(Qk),this.createViewTransition=Pt(JY,{optional:!0}),this.navigationId=0,this.afterPreactivation=()=>Fr(void 0),this.rootComponentType=null,this.configLoader.onLoadEndListener=a=>this.events.next(new mTe(a)),this.configLoader.onLoadStartListener=a=>this.events.next(new hTe(a))}complete(){this.transitions?.complete()}handleNavigationRequest(r){const n=++this.navigationId;this.transitions?.next({...this.transitions.value,...r,id:n})}setupNavigations(r,n,a){return this.transitions=new Ui({id:0,currentUrlTree:n,currentRawUrl:n,extractedUrl:this.urlHandlingStrategy.extract(n),urlAfterRedirects:this.urlHandlingStrategy.extract(n),rawUrl:n,extras:{},resolve:null,reject:null,promise:Promise.resolve(!0),source:h_,restoredState:null,currentSnapshot:a.snapshot,targetSnapshot:null,currentRouterState:a,targetRouterState:null,guards:{canActivateChecks:[],canDeactivateChecks:[]},guardsResult:null}),this.transitions.pipe(Nf(i=>0!==i.id),yr(i=>({...i,extractedUrl:this.urlHandlingStrategy.extract(i.rawUrl)})),ao(i=>{this.currentTransition=i;let o=!1,s=!1;return Fr(i).pipe(Rn(u=>{this.currentNavigation={id:u.id,initialUrl:u.rawUrl,extractedUrl:u.extractedUrl,trigger:u.source,extras:u.extras,previousNavigation:this.lastSuccessfulNavigation?{...this.lastSuccessfulNavigation,previousNavigation:null}:null}}),ao(u=>{const c=!r.navigated||this.isUpdatingInternalState()||this.isUpdatedBrowserUrl();if(!c&&"reload"!==(u.extras.onSameUrlNavigation??r.onSameUrlNavigation)){const f="";return this.events.next(new Cy(u.id,this.urlSerializer.serialize(u.rawUrl),f,qA.IgnoredSameUrlNavigation)),u.resolve(null),Ff}if(this.urlHandlingStrategy.shouldProcessUrl(u.rawUrl))return Fr(u).pipe(ao(f=>{const d=this.transitions?.getValue();return this.events.next(new jA(f.id,this.urlSerializer.serialize(f.extractedUrl),f.source,f.restoredState)),d!==this.transitions?.getValue()?Ff:Promise.resolve(f)}),function bDe(e,t,r,n,a,i){return bs(o=>function dDe(e,t,r,n,a,i,o="emptyOnly"){return new hDe(e,t,r,n,a,o,i).recognize()}(e,t,r,n,o.extractedUrl,a,i).pipe(yr(({state:s,tree:u})=>({...o,targetSnapshot:s,urlAfterRedirects:u}))))}(this.environmentInjector,this.configLoader,this.rootComponentType,r.config,this.urlSerializer,this.paramsInheritanceStrategy),Rn(f=>{i.targetSnapshot=f.targetSnapshot,i.urlAfterRedirects=f.urlAfterRedirects,this.currentNavigation={...this.currentNavigation,finalUrl:f.urlAfterRedirects};const d=new MY(f.id,this.urlSerializer.serialize(f.extractedUrl),this.urlSerializer.serialize(f.urlAfterRedirects),f.targetSnapshot);this.events.next(d)}));if(c&&this.urlHandlingStrategy.shouldProcessUrl(u.currentRawUrl)){const{id:f,extractedUrl:d,source:p,restoredState:h,extras:m}=u,v=new jA(f,this.urlSerializer.serialize(d),p,h);this.events.next(v);const g=FY(this.rootComponentType).snapshot;return this.currentTransition=i={...u,targetSnapshot:g,urlAfterRedirects:d,extras:{...m,skipLocationChange:!1,replaceUrl:!1}},this.currentNavigation.finalUrl=d,Fr(i)}{const f="";return this.events.next(new Cy(u.id,this.urlSerializer.serialize(u.extractedUrl),f,qA.IgnoredByUrlHandlingStrategy)),u.resolve(null),Ff}}),Rn(u=>{const c=new lTe(u.id,this.urlSerializer.serialize(u.extractedUrl),this.urlSerializer.serialize(u.urlAfterRedirects),u.targetSnapshot);this.events.next(c)}),yr(u=>(this.currentTransition=i={...u,guards:OTe(u.targetSnapshot,u.currentSnapshot,this.rootContexts)},i)),function jTe(e,t){return bs(r=>{const{targetSnapshot:n,currentSnapshot:a,guards:{canActivateChecks:i,canDeactivateChecks:o}}=r;return 0===o.length&&0===i.length?Fr({...r,guardsResult:!0}):function qTe(e,t,r,n){return wi(e).pipe(bs(a=>function QTe(e,t,r,n,a){const i=t&&t.routeConfig?t.routeConfig.canDeactivate:null;return i&&0!==i.length?Fr(i.map(s=>{const u=g_(t)??a,c=Ay(s,u);return Gh(function GTe(e){return e&&__(e.canDeactivate)}(c)?c.canDeactivate(e,t,r,n):dv(u,()=>c(e,t,r,n))).pipe(wv())})).pipe(Ty()):Fr(!0)}(a.component,a.route,r,t,n)),wv(a=>!0!==a,!0))}(o,n,a,e).pipe(bs(s=>s&&function LTe(e){return"boolean"==typeof e}(s)?function WTe(e,t,r,n){return wi(t).pipe(u_(a=>xk(function XTe(e,t){return null!==e&&t&&t(new vTe(e)),Fr(!0)}(a.route.parent,n),function YTe(e,t){return null!==e&&t&&t(new yTe(e)),Fr(!0)}(a.route,n),function ZTe(e,t,r){const n=t[t.length-1],i=t.slice(0,t.length-1).reverse().map(o=>function FTe(e){const t=e.routeConfig?e.routeConfig.canActivateChild:null;return t&&0!==t.length?{node:e,guards:t}:null}(o)).filter(o=>null!==o).map(o=>cY(()=>Fr(o.guards.map(u=>{const c=g_(o.node)??r,l=Ay(u,c);return Gh(function zTe(e){return e&&__(e.canActivateChild)}(l)?l.canActivateChild(n,e):dv(c,()=>l(n,e))).pipe(wv())})).pipe(Ty())));return Fr(i).pipe(Ty())}(e,a.path,r),function KTe(e,t,r){const n=t.routeConfig?t.routeConfig.canActivate:null;if(!n||0===n.length)return Fr(!0);const a=n.map(i=>cY(()=>{const o=g_(t)??r,s=Ay(i,o);return Gh(function VTe(e){return e&&__(e.canActivate)}(s)?s.canActivate(t,e):dv(o,()=>s(t,e))).pipe(wv())}));return Fr(a).pipe(Ty())}(e,a.route,r))),wv(a=>!0!==a,!0))}(n,i,e,t):Fr(s)),yr(s=>({...r,guardsResult:s})))})}(this.environmentInjector,u=>this.events.next(u)),Rn(u=>{if(i.guardsResult=u.guardsResult,_y(u.guardsResult))throw zY(0,u.guardsResult);const c=new fTe(u.id,this.urlSerializer.serialize(u.extractedUrl),this.urlSerializer.serialize(u.urlAfterRedirects),u.targetSnapshot,!!u.guardsResult);this.events.next(c)}),Nf(u=>!!u.guardsResult||(this.cancelNavigationTransition(u,"",Fc.GuardRejected),!1)),Kk(u=>{if(u.guards.canActivateChecks.length)return Fr(u).pipe(Rn(c=>{const l=new dTe(c.id,this.urlSerializer.serialize(c.extractedUrl),this.urlSerializer.serialize(c.urlAfterRedirects),c.targetSnapshot);this.events.next(l)}),ao(c=>{let l=!1;return Fr(c).pipe(function _De(e,t){return bs(r=>{const{targetSnapshot:n,guards:{canActivateChecks:a}}=r;if(!a.length)return Fr(r);const i=new Set(a.map(u=>u.route)),o=new Set;for(const u of i)if(!o.has(u))for(const c of ZY(u))o.add(c);let s=0;return wi(o).pipe(u_(u=>i.has(u)?function SDe(e,t,r,n){const a=e.routeConfig,i=e._resolve;return void 0!==a?.title&&!LY(a)&&(i[c_]=a.title),function CDe(e,t,r,n){const a=Ek(e);if(0===a.length)return Fr({});const i={};return wi(a).pipe(bs(o=>function xDe(e,t,r,n){const a=g_(t)??n,i=Ay(e,a);return Gh(i.resolve?i.resolve(t,r):dv(a,()=>i(t,r)))}(e[o],t,r,n).pipe(wv(),Rn(s=>{i[o]=s}))),Tk(1),function OAe(e){return yr(()=>e)}(i),vy(o=>WY(o)?Ff:NA(o)))}(i,e,t,n).pipe(yr(o=>(e._resolvedData=o,e.data=Lk(e,e.parent,r).resolve,null)))}(u,n,e,t):(u.data=Lk(u,u.parent,e).resolve,Fr(void 0))),Rn(()=>s++),Tk(1),bs(u=>s===o.size?Fr(r):Ff))})}(this.paramsInheritanceStrategy,this.environmentInjector),Rn({next:()=>l=!0,complete:()=>{l||this.cancelNavigationTransition(c,"",Fc.NoDataFromResolver)}}))}),Rn(c=>{const l=new pTe(c.id,this.urlSerializer.serialize(c.extractedUrl),this.urlSerializer.serialize(c.urlAfterRedirects),c.targetSnapshot);this.events.next(l)}))}),Kk(u=>{const c=l=>{const f=[];l.routeConfig?.loadComponent&&!l.routeConfig._loadedComponent&&f.push(this.configLoader.loadComponent(l.routeConfig).pipe(Rn(d=>{l.component=d}),yr(()=>{})));for(const d of l.children)f.push(...c(d));return f};return Ck(c(u.targetSnapshot.root)).pipe(BA(null),xv(1))}),Kk(()=>this.afterPreactivation()),ao(()=>{const{currentSnapshot:u,targetSnapshot:c}=i,l=this.createViewTransition?.(this.environmentInjector,u.root,c.root);return l?wi(l).pipe(yr(()=>i)):Fr(i)}),yr(u=>{const c=function xTe(e,t,r){const n=v_(e,t._root,r?r._root:void 0);return new OY(n,t)}(r.routeReuseStrategy,u.targetSnapshot,u.currentRouterState);return this.currentTransition=i={...u,targetRouterState:c},this.currentNavigation.targetRouterState=c,i}),Rn(()=>{this.events.next(new Ok)}),((e,t,r,n)=>yr(a=>(new kTe(t,a.targetRouterState,a.currentRouterState,r,n).activate(e),a)))(this.rootContexts,r.routeReuseStrategy,u=>this.events.next(u),this.inputBindingEnabled),xv(1),Rn({next:u=>{o=!0,this.lastSuccessfulNavigation=this.currentNavigation,this.events.next(new tp(u.id,this.urlSerializer.serialize(u.extractedUrl),this.urlSerializer.serialize(u.urlAfterRedirects))),this.titleStrategy?.updateTitle(u.targetRouterState.snapshot),u.resolve(!0)},complete:()=>{o=!0}}),function FAe(e){return Ci((t,r)=>{rc(e).subscribe(xi(r,()=>r.complete(),TP)),!r.closed&&t.subscribe(r)})}(this.transitionAbortSubject.pipe(Rn(u=>{throw u}))),Dk(()=>{!o&&!s&&this.cancelNavigationTransition(i,"",Fc.SupersededByNewNavigation),this.currentNavigation?.id===i.id&&(this.currentNavigation=null)}),vy(u=>{if(s=!0,HY(u))this.events.next(new Sy(i.id,this.urlSerializer.serialize(i.extractedUrl),u.message,u.cancellationCode)),function TTe(e){return HY(e)&&_y(e.url)}(u)?this.events.next(new Fk(u.url)):i.resolve(!1);else{this.events.next(new WA(i.id,this.urlSerializer.serialize(i.extractedUrl),u,i.targetSnapshot??void 0));try{i.resolve(r.errorHandler(u))}catch(c){this.options.resolveNavigationPromiseOnError?i.resolve(!1):i.reject(c)}}return Ff}))}))}cancelNavigationTransition(r,n,a){const i=new Sy(r.id,this.urlSerializer.serialize(r.extractedUrl),n,a);this.events.next(i),r.resolve(!1)}isUpdatingInternalState(){return this.currentTransition?.extractedUrl.toString()!==this.currentTransition?.currentUrlTree.toString()}isUpdatedBrowserUrl(){return this.urlHandlingStrategy.extract(this.urlSerializer.parse(this.location.path(!0))).toString()!==this.currentTransition?.extractedUrl.toString()&&!this.currentTransition?.extras.skipLocationChange}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275prov=nr({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();function PDe(e){return e!==h_}let MDe=(()=>{class e{static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275prov=nr({token:e,factory:()=>Pt(kDe),providedIn:"root"})}return e})();class RDe{shouldDetach(t){return!1}store(t,r){}shouldAttach(t){return!1}retrieve(t){return null}shouldReuseRoute(t,r){return t.routeConfig===r.routeConfig}}let kDe=(()=>{class e extends RDe{static#e=this.\u0275fac=(()=>{let r;return function(a){return(r||(r=gM(e)))(a||e)}})();static#t=this.\u0275prov=nr({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),tX=(()=>{class e{static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275prov=nr({token:e,factory:()=>Pt(ODe),providedIn:"root"})}return e})(),ODe=(()=>{class e extends tX{constructor(){super(...arguments),this.location=Pt(t_),this.urlSerializer=Pt(by),this.options=Pt(Ey,{optional:!0})||{},this.canceledNavigationResolution=this.options.canceledNavigationResolution||"replace",this.urlHandlingStrategy=Pt(Qk),this.urlUpdateStrategy=this.options.urlUpdateStrategy||"deferred",this.currentUrlTree=new yy,this.rawUrlTree=this.currentUrlTree,this.currentPageId=0,this.lastSuccessfulId=-1,this.routerState=FY(null),this.stateMemento=this.createStateMemento()}getCurrentUrlTree(){return this.currentUrlTree}getRawUrlTree(){return this.rawUrlTree}restoredState(){return this.location.getState()}get browserPageId(){return"computed"!==this.canceledNavigationResolution?this.currentPageId:this.restoredState()?.\u0275routerPageId??this.currentPageId}getRouterState(){return this.routerState}createStateMemento(){return{rawUrlTree:this.rawUrlTree,currentUrlTree:this.currentUrlTree,routerState:this.routerState}}registerNonRouterCurrentEntryChangeListener(r){return this.location.subscribe(n=>{"popstate"===n.type&&r(n.url,n.state)})}handleRouterEvent(r,n){if(r instanceof jA)this.stateMemento=this.createStateMemento();else if(r instanceof Cy)this.rawUrlTree=n.initialUrl;else if(r instanceof MY){if("eager"===this.urlUpdateStrategy&&!n.extras.skipLocationChange){const a=this.urlHandlingStrategy.merge(n.finalUrl,n.initialUrl);this.setBrowserUrl(a,n)}}else r instanceof Ok?(this.currentUrlTree=n.finalUrl,this.rawUrlTree=this.urlHandlingStrategy.merge(n.finalUrl,n.initialUrl),this.routerState=n.targetRouterState,"deferred"===this.urlUpdateStrategy&&(n.extras.skipLocationChange||this.setBrowserUrl(this.rawUrlTree,n))):r instanceof Sy&&(r.code===Fc.GuardRejected||r.code===Fc.NoDataFromResolver)?this.restoreHistory(n):r instanceof WA?this.restoreHistory(n,!0):r instanceof tp&&(this.lastSuccessfulId=r.id,this.currentPageId=this.browserPageId)}setBrowserUrl(r,n){const a=this.urlSerializer.serialize(r);if(this.location.isCurrentPathEqualTo(a)||n.extras.replaceUrl){const o={...n.extras.state,...this.generateNgRouterState(n.id,this.browserPageId)};this.location.replaceState(a,"",o)}else{const i={...n.extras.state,...this.generateNgRouterState(n.id,this.browserPageId+1)};this.location.go(a,"",i)}}restoreHistory(r,n=!1){if("computed"===this.canceledNavigationResolution){const i=this.currentPageId-this.browserPageId;0!==i?this.location.historyGo(i):this.currentUrlTree===r.finalUrl&&0===i&&(this.resetState(r),this.resetUrlToCurrentUrlTree())}else"replace"===this.canceledNavigationResolution&&(n&&this.resetState(r),this.resetUrlToCurrentUrlTree())}resetState(r){this.routerState=this.stateMemento.routerState,this.currentUrlTree=this.stateMemento.currentUrlTree,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,r.finalUrl??this.rawUrlTree)}resetUrlToCurrentUrlTree(){this.location.replaceState(this.urlSerializer.serialize(this.rawUrlTree),"",this.generateNgRouterState(this.lastSuccessfulId,this.currentPageId))}generateNgRouterState(r,n){return"computed"===this.canceledNavigationResolution?{navigationId:r,\u0275routerPageId:n}:{navigationId:r}}static#e=this.\u0275fac=(()=>{let r;return function(a){return(r||(r=gM(e)))(a||e)}})();static#t=this.\u0275prov=nr({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();var S_=function(e){return e[e.COMPLETE=0]="COMPLETE",e[e.FAILED=1]="FAILED",e[e.REDIRECTING=2]="REDIRECTING",e}(S_||{});function rX(e,t){e.events.pipe(Nf(r=>r instanceof tp||r instanceof Sy||r instanceof WA||r instanceof Cy),yr(r=>r instanceof tp||r instanceof Cy?S_.COMPLETE:r instanceof Sy&&(r.code===Fc.Redirect||r.code===Fc.SupersededByNewNavigation)?S_.REDIRECTING:S_.FAILED),Nf(r=>r!==S_.REDIRECTING),xv(1)).subscribe(()=>{t()})}function FDe(e){throw e}const NDe={paths:"exact",fragment:"ignored",matrixParams:"ignored",queryParams:"exact"},BDe={paths:"subset",fragment:"ignored",matrixParams:"ignored",queryParams:"subset"};let Hl=(()=>{class e{get currentUrlTree(){return this.stateManager.getCurrentUrlTree()}get rawUrlTree(){return this.stateManager.getRawUrlTree()}get events(){return this._events}get routerState(){return this.stateManager.getRouterState()}constructor(){this.disposed=!1,this.isNgZoneEnabled=!1,this.console=Pt(hq),this.stateManager=Pt(tX),this.options=Pt(Ey,{optional:!0})||{},this.pendingTasks=Pt(cA),this.urlUpdateStrategy=this.options.urlUpdateStrategy||"deferred",this.navigationTransitions=Pt(QA),this.urlSerializer=Pt(by),this.location=Pt(t_),this.urlHandlingStrategy=Pt(Qk),this._events=new Cn,this.errorHandler=this.options.errorHandler||FDe,this.navigated=!1,this.routeReuseStrategy=Pt(MDe),this.onSameUrlNavigation=this.options.onSameUrlNavigation||"ignore",this.config=Pt(Iy,{optional:!0})?.flat()??[],this.componentInputBindingEnabled=!!Pt(YA,{optional:!0}),this.eventsSubscription=new js,this.isNgZoneEnabled=Pt(Qn)instanceof Qn&&Qn.isInAngularZone(),this.resetConfig(this.config),this.navigationTransitions.setupNavigations(this,this.currentUrlTree,this.routerState).subscribe({error:r=>{this.console.warn(r)}}),this.subscribeToNavigationEvents()}subscribeToNavigationEvents(){const r=this.navigationTransitions.events.subscribe(n=>{try{const a=this.navigationTransitions.currentTransition,i=this.navigationTransitions.currentNavigation;if(null!==a&&null!==i)if(this.stateManager.handleRouterEvent(n,i),n instanceof Sy&&n.code!==Fc.Redirect&&n.code!==Fc.SupersededByNewNavigation)this.navigated=!0;else if(n instanceof tp)this.navigated=!0;else if(n instanceof Fk){const o=this.urlHandlingStrategy.merge(n.url,a.currentRawUrl),s={info:a.extras.info,skipLocationChange:a.extras.skipLocationChange,replaceUrl:"eager"===this.urlUpdateStrategy||PDe(a.source)};this.scheduleNavigation(o,h_,null,s,{resolve:a.resolve,reject:a.reject,promise:a.promise})}(function UDe(e){return!(e instanceof Ok||e instanceof Fk)})(n)&&this._events.next(n)}catch(a){this.navigationTransitions.transitionAbortSubject.next(a)}});this.eventsSubscription.add(r)}resetRootComponentType(r){this.routerState.root.component=r,this.navigationTransitions.rootComponentType=r}initialNavigation(){this.setUpLocationChangeListener(),this.navigationTransitions.hasRequestedNavigation||this.navigateToSyncWithBrowser(this.location.path(!0),h_,this.stateManager.restoredState())}setUpLocationChangeListener(){this.nonRouterCurrentEntryChangeSubscription??=this.stateManager.registerNonRouterCurrentEntryChangeListener((r,n)=>{setTimeout(()=>{this.navigateToSyncWithBrowser(r,"popstate",n)},0)})}navigateToSyncWithBrowser(r,n,a){const i={replaceUrl:!0},o=a?.navigationId?a:null;if(a){const u={...a};delete u.navigationId,delete u.\u0275routerPageId,0!==Object.keys(u).length&&(i.state=u)}const s=this.parseUrl(r);this.scheduleNavigation(s,n,o,i)}get url(){return this.serializeUrl(this.currentUrlTree)}getCurrentNavigation(){return this.navigationTransitions.currentNavigation}get lastSuccessfulNavigation(){return this.navigationTransitions.lastSuccessfulNavigation}resetConfig(r){this.config=r.map(jk),this.navigated=!1}ngOnDestroy(){this.dispose()}dispose(){this.navigationTransitions.complete(),this.nonRouterCurrentEntryChangeSubscription&&(this.nonRouterCurrentEntryChangeSubscription.unsubscribe(),this.nonRouterCurrentEntryChangeSubscription=void 0),this.disposed=!0,this.eventsSubscription.unsubscribe()}createUrlTree(r,n={}){const{relativeTo:a,queryParams:i,fragment:o,queryParamsHandling:s,preserveFragment:u}=n,c=u?this.currentUrlTree.fragment:o;let f,l=null;switch(s){case"merge":l={...this.currentUrlTree.queryParams,...i};break;case"preserve":l=this.currentUrlTree.queryParams;break;default:l=i||null}null!==l&&(l=this.removeEmptyProps(l));try{f=wY(a?a.snapshot:this.routerState.snapshot.root)}catch{("string"!=typeof r[0]||!r[0].startsWith("/"))&&(r=[]),f=this.currentUrlTree.root}return AY(f,r,l,c??null)}navigateByUrl(r,n={skipLocationChange:!1}){const a=_y(r)?r:this.parseUrl(r),i=this.urlHandlingStrategy.merge(a,this.rawUrlTree);return this.scheduleNavigation(i,h_,null,n)}navigate(r,n={skipLocationChange:!1}){return function LDe(e){for(let t=0;t(null!=i&&(n[a]=i),n),{})}scheduleNavigation(r,n,a,i,o){if(this.disposed)return Promise.resolve(!1);let s,u,c;o?(s=o.resolve,u=o.reject,c=o.promise):c=new Promise((f,d)=>{s=f,u=d});const l=this.pendingTasks.add();return rX(this,()=>{queueMicrotask(()=>this.pendingTasks.remove(l))}),this.navigationTransitions.handleNavigationRequest({source:n,restoredState:a,currentUrlTree:this.currentUrlTree,currentRawUrl:this.currentUrlTree,rawUrl:r,extras:i,resolve:s,reject:u,promise:c,currentSnapshot:this.routerState.snapshot,currentRouterState:this.routerState}),c.catch(f=>Promise.reject(f))}static#e=this.\u0275fac=function(n){return new(n||e)};static#t=this.\u0275prov=nr({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),$A=(()=>{class e{constructor(r,n,a,i,o,s){this.router=r,this.route=n,this.tabIndexAttribute=a,this.renderer=i,this.el=o,this.locationStrategy=s,this.href=null,this.commands=null,this.onChanges=new Cn,this.preserveFragment=!1,this.skipLocationChange=!1,this.replaceUrl=!1;const u=o.nativeElement.tagName?.toLowerCase();this.isAnchorElement="a"===u||"area"===u,this.isAnchorElement?this.subscription=r.events.subscribe(c=>{c instanceof tp&&this.updateHref()}):this.setTabIndexIfNotOnNativeEl("0")}setTabIndexIfNotOnNativeEl(r){null!=this.tabIndexAttribute||this.isAnchorElement||this.applyAttributeValue("tabindex",r)}ngOnChanges(r){this.isAnchorElement&&this.updateHref(),this.onChanges.next(this)}set routerLink(r){null!=r?(this.commands=Array.isArray(r)?r:[r],this.setTabIndexIfNotOnNativeEl("0")):(this.commands=null,this.setTabIndexIfNotOnNativeEl(null))}onClick(r,n,a,i,o){const s=this.urlTree;return!!(null===s||this.isAnchorElement&&(0!==r||n||a||i||o||"string"==typeof this.target&&"_self"!=this.target))||(this.router.navigateByUrl(s,{skipLocationChange:this.skipLocationChange,replaceUrl:this.replaceUrl,state:this.state,info:this.info}),!this.isAnchorElement)}ngOnDestroy(){this.subscription?.unsubscribe()}updateHref(){const r=this.urlTree;this.href=null!==r&&this.locationStrategy?this.locationStrategy?.prepareExternalUrl(this.router.serializeUrl(r)):null;const n=null===this.href?null:function Zz(e,t,r){return function dge(e,t){return"src"===t&&("embed"===e||"frame"===e||"iframe"===e||"media"===e||"script"===e)||"href"===t&&("base"===e||"link"===e)?Kz:Xz}(t,r)(e)}(this.href,this.el.nativeElement.tagName.toLowerCase(),"href");this.applyAttributeValue("href",n)}applyAttributeValue(r,n){const a=this.renderer,i=this.el.nativeElement;null!==n?a.setAttribute(i,r,n):a.removeAttribute(i,r)}get urlTree(){return null===this.commands?null:this.router.createUrlTree(this.commands,{relativeTo:void 0!==this.relativeTo?this.relativeTo:this.route,queryParams:this.queryParams,fragment:this.fragment,queryParamsHandling:this.queryParamsHandling,preserveFragment:this.preserveFragment})}static#e=this.\u0275fac=function(n){return new(n||e)(Dr(Hl),Dr(wy),function Kx(e){return function bme(e,t){if("class"===t)return e.classes;if("style"===t)return e.styles;const r=e.attrs;if(r){const n=r.length;let a=0;for(;a{class e{constructor(r,n,a,i,o){this.router=r,this.injector=a,this.preloadingStrategy=i,this.loader=o}setUpPreloading(){this.subscription=this.router.events.pipe(Nf(r=>r instanceof tp),u_(()=>this.preload())).subscribe(()=>{})}preload(){return this.processRoutes(this.injector,this.router.config)}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe()}processRoutes(r,n){const a=[];for(const i of n){i.providers&&!i._injector&&(i._injector=A4(i.providers,r,`Route: ${i.path}`));const o=i._injector??r,s=i._loadedInjector??o;(i.loadChildren&&!i._loadedRoutes&&void 0===i.canLoad||i.loadComponent&&!i._loadedComponent)&&a.push(this.preloadConfig(o,i)),(i.children||i._loadedRoutes)&&a.push(this.processRoutes(s,i.children??i._loadedRoutes))}return wi(a).pipe(my())}preloadConfig(r,n){return this.preloadingStrategy.preload(n,()=>{let a;a=n.loadChildren&&void 0===n.canLoad?this.loader.loadChildren(r,n):Fr(null);const i=a.pipe(bs(o=>null===o?Fr(void 0):(n._loadedRoutes=o.routes,n._loadedInjector=o.injector,this.processRoutes(o.injector??r,o.routes))));return n.loadComponent&&!n._loadedComponent?wi([i,this.loader.loadComponent(n)]).pipe(my()):i})}static#e=this.\u0275fac=function(n){return new(n||e)(Tr(Hl),Tr(mq),Tr(Pc),Tr(nX),Tr(Zk))};static#t=this.\u0275prov=nr({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();const $k=new cr("");let aX=(()=>{class e{constructor(r,n,a,i,o={}){this.urlSerializer=r,this.transitions=n,this.viewportScroller=a,this.zone=i,this.options=o,this.lastId=0,this.lastSource="imperative",this.restoredId=0,this.store={},o.scrollPositionRestoration||="disabled",o.anchorScrolling||="disabled"}init(){"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.setHistoryScrollRestoration("manual"),this.routerEventsSubscription=this.createScrollEvents(),this.scrollEventsSubscription=this.consumeScrollEvents()}createScrollEvents(){return this.transitions.events.subscribe(r=>{r instanceof jA?(this.store[this.lastId]=this.viewportScroller.getScrollPosition(),this.lastSource=r.navigationTrigger,this.restoredId=r.restoredState?r.restoredState.navigationId:0):r instanceof tp?(this.lastId=r.id,this.scheduleScrollEvent(r,this.urlSerializer.parse(r.urlAfterRedirects).fragment)):r instanceof Cy&&r.code===qA.IgnoredSameUrlNavigation&&(this.lastSource=void 0,this.restoredId=0,this.scheduleScrollEvent(r,this.urlSerializer.parse(r.url).fragment))})}consumeScrollEvents(){return this.transitions.events.subscribe(r=>{r instanceof RY&&(r.position?"top"===this.options.scrollPositionRestoration?this.viewportScroller.scrollToPosition([0,0]):"enabled"===this.options.scrollPositionRestoration&&this.viewportScroller.scrollToPosition(r.position):r.anchor&&"enabled"===this.options.anchorScrolling?this.viewportScroller.scrollToAnchor(r.anchor):"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.scrollToPosition([0,0]))})}scheduleScrollEvent(r,n){this.zone.runOutsideAngular(()=>{setTimeout(()=>{this.zone.run(()=>{this.transitions.events.next(new RY(r,"popstate"===this.lastSource?this.store[this.restoredId]:null,n))})},0)})}ngOnDestroy(){this.routerEventsSubscription?.unsubscribe(),this.scrollEventsSubscription?.unsubscribe()}static#e=this.\u0275fac=function(n){!function TG(){throw new Error("invalid")}()};static#t=this.\u0275prov=nr({token:e,factory:e.\u0275fac})}return e})();function iX(e){return e.routerState.root}function Vf(e,t){return{\u0275kind:e,\u0275providers:t}}function oX(){const e=Pt(xu);return t=>{const r=e.get(_v);if(t!==r.components[0])return;const n=e.get(Hl),a=e.get(sX);1===e.get(Jk)&&n.initialNavigation(),e.get(uX,null,vn.Optional)?.setUpPreloading(),e.get($k,null,vn.Optional)?.init(),n.resetRootComponentType(r.componentTypes[0]),a.closed||(a.next(),a.complete(),a.unsubscribe())}}const sX=new cr("",{factory:()=>new Cn}),Jk=new cr("",{providedIn:"root",factory:()=>1}),uX=new cr("");function YDe(e){return Vf(0,[{provide:uX,useExisting:GDe},{provide:nX,useExisting:e}])}function KDe(e){return Vf(9,[{provide:JY,useValue:EDe},{provide:eX,useValue:{skipNextTransition:!!e?.skipInitialTransition,...e}}])}const cX=new cr("ROUTER_FORROOT_GUARD"),ZDe=[t_,{provide:by,useClass:Ik},Hl,m_,{provide:wy,useFactory:iX,deps:[Hl]},Zk,[]];let lX=(()=>{class e{constructor(r){}static forRoot(r,n){return{ngModule:e,providers:[ZDe,[],{provide:Iy,multi:!0,useValue:r},{provide:cX,useFactory:eEe,deps:[[Hl,new Jx,new ew]]},{provide:Ey,useValue:n||{}},n?.useHash?{provide:Cv,useClass:oCe}:{provide:Cv,useClass:aW},{provide:$k,useFactory:()=>{const e=Pt(Exe),t=Pt(Qn),r=Pt(Ey),n=Pt(QA),a=Pt(by);return r.scrollOffset&&e.setOffset(r.scrollOffset),new aX(a,n,e,t,r)}},n?.preloadingStrategy?YDe(n.preloadingStrategy).\u0275providers:[],n?.initialNavigation?tEe(n):[],n?.bindToComponentInputs?Vf(8,[UY,{provide:YA,useExisting:UY}]).\u0275providers:[],n?.enableViewTransitions?KDe().\u0275providers:[],[{provide:fX,useFactory:oX},{provide:dA,multi:!0,useExisting:fX}]]}}static forChild(r){return{ngModule:e,providers:[{provide:Iy,multi:!0,useValue:r}]}}static#e=this.\u0275fac=function(n){return new(n||e)(Tr(cX,8))};static#t=this.\u0275mod=Fx({type:e});static#r=this.\u0275inj=Y1({})}return e})();function eEe(e){return"guarded"}function tEe(e){return["disabled"===e.initialNavigation?Vf(3,[{provide:F4,multi:!0,useFactory:()=>{const t=Pt(Hl);return()=>{t.setUpLocationChangeListener()}}},{provide:Jk,useValue:2}]).\u0275providers:[],"enabledBlocking"===e.initialNavigation?Vf(2,[{provide:Jk,useValue:0},{provide:F4,multi:!0,deps:[xu],useFactory:t=>{const r=t.get(aCe,Promise.resolve());return()=>r.then(()=>new Promise(n=>{const a=t.get(Hl),i=t.get(sX);rX(a,()=>{n(!0)}),t.get(QA).afterPreactivation=()=>(n(!0),i.closed?Fr(void 0):i),a.initialNavigation()}))}}]).\u0275providers:[]]}const fX=new cr(""),eO={now:()=>(eO.delegate||Date).now(),delegate:void 0};class rp extends Cn{constructor(t=1/0,r=1/0,n=eO){super(),this._bufferSize=t,this._windowTime=r,this._timestampProvider=n,this._buffer=[],this._infiniteTimeWindow=!0,this._infiniteTimeWindow=r===1/0,this._bufferSize=Math.max(1,t),this._windowTime=Math.max(1,r)}next(t){const{isStopped:r,_buffer:n,_infiniteTimeWindow:a,_timestampProvider:i,_windowTime:o}=this;r||(n.push(t),!a&&n.push(i.now()+o)),this._trimBuffer(),super.next(t)}_subscribe(t){this._throwIfClosed(),this._trimBuffer();const r=this._innerSubscribe(t),{_infiniteTimeWindow:n,_buffer:a}=this,i=a.slice();for(let o=0;o{n.unsubscribe(),e()}});return rc(t(...r)).subscribe(n)}function Tv(e,t,r){let n,a=!1;return e&&"object"==typeof e?({bufferSize:n=1/0,windowTime:t=1/0,refCount:a=!1,scheduler:r}=e):n=e??1/0,function nEe(e={}){const{connector:t=(()=>new Cn),resetOnError:r=!0,resetOnComplete:n=!0,resetOnRefCountZero:a=!0}=e;return i=>{let o,s,u,c=0,l=!1,f=!1;const d=()=>{s?.unsubscribe(),s=void 0},p=()=>{d(),o=u=void 0,l=f=!1},h=()=>{const m=o;p(),m?.unsubscribe()};return Ci((m,v)=>{c++,!f&&!l&&d();const g=u=u??t();v.add(()=>{c--,0===c&&!f&&!l&&(s=tO(h,a))}),g.subscribe(v),!o&&c>0&&(o=new j1({next:y=>g.next(y),error:y=>{f=!0,d(),s=tO(p,r,y),g.error(y)},complete:()=>{l=!0,d(),s=tO(p,n),g.complete()}}),rc(m).subscribe(o))})(i)}}({connector:()=>new rp(n,t,r),resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:a})}const{isArray:aEe}=Array;function iEe(e){return 1===e.length&&aEe(e[0])?e[0]:e}function dX(...e){const t=iY(e);return t?SV(dX(...e),oY(t)):Ci((r,n)=>{sY([r,...iEe(e)])(n)})}function rO(...e){return dX(...e)}var ns,e,sn;(e=ns||(ns={})).create=function t(a){return a},e.has=function r(a,i){return 0!=(a&i)},e.hasAll=function n(a,i){return!!i&&(a&i)===i},function(e){e.create=function t(_){return void 0===_&&(_=512),{current:[],offset:0,capacity:_,chunks:[]}},e.getString=function r(_){return _.chunks.length?(_.offset>0&&(_.chunks[_.chunks.length]=_.current.length===_.offset?_.current.join(""):_.current.slice(0,_.offset).join("")),_.chunks.join("")):_.current.length===_.offset?_.current.join(""):_.current.splice(0,_.offset).join("")},e.getSize=function n(_){for(var C=0,x=0,A=_.chunks;x0&&(_.chunks[_.chunks.length]=_.current.length===_.offset?_.current.join(""):_.current.slice(0,_.offset).join(""),_.offset=0),_.chunks};var i=[];function s(_,C){C>0&&l(_,i[C])}function l(_,C){_.offset===_.capacity&&(_.chunks[_.chunks.length]=_.current.join(""),_.offset=0),_.current[_.offset++]=C}!function(){for(var _="",C=0;C<512;C++)i[C]=_,_+=" "}(),e.newline=function o(_){l(_,"\n")},e.whitespace=s,e.whitespace1=function u(_){l(_," ")},e.write=function c(_,C){C&&(_.offset===_.capacity&&(_.chunks[_.chunks.length]=_.current.join(""),_.offset=0),_.current[_.offset++]=C)},e.writeSafe=l,e.writePadLeft=function f(_,C,x){C?(s(_,x-C.length),l(_,C)):s(_,x)},e.writePadRight=function d(_,C,x){if(C){var A=x-C.length;l(_,C),s(_,A)}else s(_,x)},e.writeInteger=function p(_,C){l(_,""+C)},e.writeIntegerAndSpace=function h(_,C){l(_,C+" ")},e.writeIntegerPadLeft=function m(_,C,x){var A=""+C;s(_,x-A.length),l(_,A)},e.writeIntegerPadRight=function v(_,C,x){var A=""+C,T=x-A.length;l(_,A),s(_,T)},e.writeFloat=function g(_,C,x){l(_,""+Math.round(x*C)/x)},e.writeFloatPadLeft=function y(_,C,x,A){var T=""+Math.round(x*C)/x;s(_,A-T.length),l(_,T)},e.writeFloatPadRight=function b(_,C,x,A){var T=""+Math.round(x*C)/x,w=A-T.length;l(_,T),s(_,w)}}(sn||(sn={}));var Gn,pX,C_,da=function(){if(typeof window<"u"&&window.performance){var e=window.performance;return function(){return e.now()}}return typeof process<"u"&&"undefined"!==process.hrtime&&"function"==typeof process.hrtime?function(){var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:Date.now?function(){return Date.now()}:function(){return+new Date}}();function nO(e,t){if(void 0===t&&(t=!0),isNaN(e))return"n/a";for(var r=Math.floor(e/36e5),n=Math.floor(e/6e4%60),a=Math.floor(e/1e3%60),i=Math.floor(e%1e3).toString();i.length<3;)i="0"+i;for(;!t&&i.length>1&&"0"===i[i.length-1];)i=i.substr(0,i.length-1);return r>0?"".concat(r,"h").concat(n,"m").concat(a,".").concat(i,"s"):n>0?"".concat(n,"m").concat(a,".").concat(i,"s"):a>0?"".concat(a,".").concat(i,"s"):"".concat(e.toFixed(0),"ms")}function oEe(e,t){return e-t}function _s(e,t){void 0===e&&(e=0),void 0===t&&(t=Number.MAX_SAFE_INTEGER);var r=e;return function(){var n=r;return r=(r+1)%t,n}}!function(e){var t=typeof btoa<"u"?btoa:function(o){return Buffer.from(o).toString("base64")},r=[];e.create22=function n(){for(var o=+new Date+da(),s=0;s<16;s++)r[s]=String.fromCharCode((o+255*Math.random())%255|0),o=Math.floor(o/255);return t(r.join("")).replace(/\+/g,"-").replace(/\//g,"_").substr(0,22)},e.createv4=function a(){var o=+new Date+da();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(u){var c=(o+16*Math.random())%16|0;return o=Math.floor(o/16),("x"===u?c:3&c|8).toString(16)})},e.is=function i(o){return"string"==typeof o}}(Gn||(Gn={})),function(e){var t=function(){function p(){this.size=0}return p.prototype.has=function(h){return!1},p.prototype.forEach=function(h,m){return m},p}(),r=function(){function p(h){this.idx=h,this.size=1}return p.prototype.has=function(h){return h===this.idx},p.prototype.forEach=function(h,m){return h(this.idx,m),m},p}(),n=function(){function p(h,m){this.mask=h,this.size=m,this.length=h.length}return p.prototype.has=function(h){return hm&&(m=y);if(h===m)return new a(h);if(h/m<1/12){for(var _=new Set,C=0,x=p;Cv&&(v=b))}),m/v<1/12){var g=new Set;return h.forEach(function(b){p.has(b)||g.add(b)}),s(g)}var y=new Uint8Array(v+1);return h.forEach(function(b){p.has(b)||(y[b]=1)}),l(y,m)}}(pX||(pX={})),function(e){e.create=function t(n){return{ref:n}},e.set=function r(n,a){return n.ref=a,n}}(C_||(C_={}));var Hh,k,uEe=_s(0,2147483647);!function(e){e.create=function t(n,a){return{id:uEe(),version:0,value:n,metadata:a}},e.withValue=function r(n,a){return{id:n.id,version:n.version+1,value:a,metadata:n.metadata}}}(Hh||(Hh={})),function(e){function r(i,o){return C_.set(i,Hh.withValue(i.ref,o))}e.create=function t(i,o){return C_.create(Hh.create(i,o))},e.update=r,e.set=function n(i,o){return C_.set(i,o)},e.updateIfChanged=function a(i,o){return i.ref.value!==o?r(i,o):i}}(k||(k={}));var Py=function(){};function $s(e,t){var r=e.length;if(r!==t.length)return!1;for(var n=0;n0&&(Tt=1/Math.sqrt(Tt),oe[0]=be[0]*Tt,oe[1]=be[1]*Tt,oe[2]=be[2]*Tt),oe}function ne(oe,be){return oe[0]*be[0]+oe[1]*be[1]+oe[2]*be[2]}function X(oe,be,Se){var Qe=be[0],It=be[1],Tt=be[2],Zt=Se[0],Pr=Se[1],rr=Se[2];return oe[0]=It*rr-Tt*Pr,oe[1]=Tt*Zt-Qe*rr,oe[2]=Qe*Pr-It*Zt,oe}e.zero=t,e.clone=function r(oe){var be=t();return be[0]=oe[0],be[1]=oe[1],be[2]=oe[2],be},e.isFinite=function n(oe){return uO(oe[0])&&uO(oe[1])&&uO(oe[2])},e.hasNaN=function a(oe){return isNaN(oe[0])||isNaN(oe[1])||isNaN(oe[2])},e.setNaN=function i(oe){return oe[0]=NaN,oe[1]=NaN,oe[2]=NaN,oe},e.fromObj=function o(oe){return l(oe.x,oe.y,oe.z)},e.toObj=function s(oe){return{x:oe[0],y:oe[1],z:oe[2]}},e.fromArray=function u(oe,be,Se){return oe[0]=be[Se+0],oe[1]=be[Se+1],oe[2]=be[Se+2],oe},e.toArray=function c(oe,be,Se){return be[Se+0]=oe[0],be[Se+1]=oe[1],be[Se+2]=oe[2],be},e.create=l,e.ofArray=function f(oe){var be=t();return be[0]=oe[0],be[1]=oe[1],be[2]=oe[2],be},e.set=function d(oe,be,Se,Qe){return oe[0]=be,oe[1]=Se,oe[2]=Qe,oe},e.copy=p,e.add=h,e.sub=m,e.mul=function v(oe,be,Se){return oe[0]=be[0]*Se[0],oe[1]=be[1]*Se[1],oe[2]=be[2]*Se[2],oe},e.div=function g(oe,be,Se){return oe[0]=be[0]/Se[0],oe[1]=be[1]/Se[1],oe[2]=be[2]/Se[2],oe},e.scale=y,e.scaleAndAdd=b,e.scaleAndSub=function _(oe,be,Se,Qe){return oe[0]=be[0]-Se[0]*Qe,oe[1]=be[1]-Se[1]*Qe,oe[2]=be[2]-Se[2]*Qe,oe},e.addScalar=function C(oe,be,Se){return oe[0]=be[0]+Se,oe[1]=be[1]+Se,oe[2]=be[2]+Se,oe},e.subScalar=function x(oe,be,Se){return oe[0]=be[0]-Se,oe[1]=be[1]-Se,oe[2]=be[2]-Se,oe},e.round=function A(oe,be){return oe[0]=Math.round(be[0]),oe[1]=Math.round(be[1]),oe[2]=Math.round(be[2]),oe},e.ceil=function T(oe,be){return oe[0]=Math.ceil(be[0]),oe[1]=Math.ceil(be[1]),oe[2]=Math.ceil(be[2]),oe},e.floor=function w(oe,be){return oe[0]=Math.floor(be[0]),oe[1]=Math.floor(be[1]),oe[2]=Math.floor(be[2]),oe},e.trunc=function E(oe,be){return oe[0]=Math.trunc(be[0]),oe[1]=Math.trunc(be[1]),oe[2]=Math.trunc(be[2]),oe},e.abs=function I(oe,be){return oe[0]=Math.abs(be[0]),oe[1]=Math.abs(be[1]),oe[2]=Math.abs(be[2]),oe},e.min=function M(oe,be,Se){return oe[0]=Math.min(be[0],Se[0]),oe[1]=Math.min(be[1],Se[1]),oe[2]=Math.min(be[2],Se[2]),oe},e.max=function O(oe,be,Se){return oe[0]=Math.max(be[0],Se[0]),oe[1]=Math.max(be[1],Se[1]),oe[2]=Math.max(be[2],Se[2]),oe},e.clamp=function F(oe,be,Se,Qe){return oe[0]=Math.max(Se[0],Math.min(Qe[0],be[0])),oe[1]=Math.max(Se[1],Math.min(Qe[1],be[1])),oe[2]=Math.max(Se[2],Math.min(Qe[2],be[2])),oe},e.distance=function j(oe,be){var Se=be[0]-oe[0],Qe=be[1]-oe[1],It=be[2]-oe[2];return Math.sqrt(Se*Se+Qe*Qe+It*It)},e.squaredDistance=function N(oe,be){var Se=be[0]-oe[0],Qe=be[1]-oe[1],It=be[2]-oe[2];return Se*Se+Qe*Qe+It*It},e.magnitude=function H(oe){var be=oe[0],Se=oe[1],Qe=oe[2];return Math.sqrt(be*be+Se*Se+Qe*Qe)},e.squaredMagnitude=G,e.setMagnitude=function U(oe,be,Se){return y(oe,K(oe,be),Se)},e.negate=Q,e.inverse=function W(oe,be){return oe[0]=1/be[0],oe[1]=1/be[1],oe[2]=1/be[2],oe},e.normalize=K,e.dot=ne,e.cross=X,e.lerp=function L(oe,be,Se,Qe){var It=be[0],Tt=be[1],Zt=be[2];return oe[0]=It+Qe*(Se[0]-It),oe[1]=Tt+Qe*(Se[1]-Tt),oe[2]=Zt+Qe*(Se[2]-Zt),oe};var Y=t();function ue(oe,be){var Se=Math.sqrt(G(oe)*G(be));if(0===Se)return Math.PI/2;var Qe=ne(oe,be)/Se;return Math.acos(io(Qe,-1,1))}e.slerp=function $(oe,be,Se,Qe){var It=io(ne(be,Se),-1,1),Tt=Math.acos(It)*Qe;return b(Y,Se,be,-It),K(Y,Y),h(oe,y(oe,be,Math.cos(Tt)),y(Y,Y,Math.sin(Tt)))},e.hermite=function Z(oe,be,Se,Qe,It,Tt){var Zt=Tt*Tt,Pr=Zt*(2*Tt-3)+1,rr=Zt*(Tt-2)+Tt,mn=Zt*(Tt-1),aa=Zt*(3-2*Tt);return oe[0]=be[0]*Pr+Se[0]*rr+Qe[0]*mn+It[0]*aa,oe[1]=be[1]*Pr+Se[1]*rr+Qe[1]*mn+It[1]*aa,oe[2]=be[2]*Pr+Se[2]*rr+Qe[2]*mn+It[2]*aa,oe},e.bezier=function q(oe,be,Se,Qe,It,Tt){var Zt=1-Tt,Pr=Zt*Zt,rr=Tt*Tt,mn=Pr*Zt,aa=3*Tt*Pr,So=3*rr*Zt,$a=rr*Tt;return oe[0]=be[0]*mn+Se[0]*aa+Qe[0]*So+It[0]*$a,oe[1]=be[1]*mn+Se[1]*aa+Qe[1]*So+It[1]*$a,oe[2]=be[2]*mn+Se[2]*aa+Qe[2]*So+It[2]*$a,oe},e.quadraticBezier=function z(oe,be,Se,Qe,It){return oe[0]=sO(be[0],Se[0],Qe[0],It),oe[1]=sO(be[1],Se[1],Qe[1],It),oe[2]=sO(be[2],Se[2],Qe[2],It),oe},e.spline=function te(oe,be,Se,Qe,It,Tt,Zt){return oe[0]=rT(be[0],Se[0],Qe[0],It[0],Tt,Zt),oe[1]=rT(be[1],Se[1],Qe[1],It[1],Tt,Zt),oe[2]=rT(be[2],Se[2],Qe[2],It[2],Tt,Zt),oe},e.random=function ae(oe,be){var Se=2*Math.random()*Math.PI,Qe=2*Math.random()-1,It=Math.sqrt(1-Qe*Qe)*be;return oe[0]=Math.cos(Se)*It,oe[1]=Math.sin(Se)*It,oe[2]=Qe*be,oe},e.transformMat4=function de(oe,be,Se){var Qe=be[0],It=be[1],Tt=be[2],Zt=1/(Se[3]*Qe+Se[7]*It+Se[11]*Tt+Se[15]||1);return oe[0]=(Se[0]*Qe+Se[4]*It+Se[8]*Tt+Se[12])*Zt,oe[1]=(Se[1]*Qe+Se[5]*It+Se[9]*Tt+Se[13])*Zt,oe[2]=(Se[2]*Qe+Se[6]*It+Se[10]*Tt+Se[14])*Zt,oe},e.transformDirection=function he(oe,be,Se){var Qe=be[0],It=be[1],Tt=be[2];return oe[0]=Se[0]*Qe+Se[4]*It+Se[8]*Tt,oe[1]=Se[1]*Qe+Se[5]*It+Se[9]*Tt,oe[2]=Se[2]*Qe+Se[6]*It+Se[10]*Tt,K(oe,oe)},e.transformMat4Offset=function pe(oe,be,Se,Qe,It,Tt){var Zt=be[0+It],Pr=be[1+It],rr=be[2+It],mn=1/(Se[3+Tt]*Zt+Se[7+Tt]*Pr+Se[11+Tt]*rr+Se[15+Tt]||1);return oe[0+Qe]=(Se[0+Tt]*Zt+Se[4+Tt]*Pr+Se[8+Tt]*rr+Se[12+Tt])*mn,oe[1+Qe]=(Se[1+Tt]*Zt+Se[5+Tt]*Pr+Se[9+Tt]*rr+Se[13+Tt])*mn,oe[2+Qe]=(Se[2+Tt]*Zt+Se[6+Tt]*Pr+Se[10+Tt]*rr+Se[14+Tt])*mn,oe},e.transformMat3=function re(oe,be,Se){var Qe=be[0],It=be[1],Tt=be[2];return oe[0]=Qe*Se[0]+It*Se[3]+Tt*Se[6],oe[1]=Qe*Se[1]+It*Se[4]+Tt*Se[7],oe[2]=Qe*Se[2]+It*Se[5]+Tt*Se[8],oe},e.transformQuat=function ee(oe,be,Se){var Qe=be[0],It=be[1],Tt=be[2],Zt=Se[0],Pr=Se[1],rr=Se[2],mn=Se[3],aa=mn*Qe+Pr*Tt-rr*It,So=mn*It+rr*Qe-Zt*Tt,$a=mn*Tt+Zt*It-Pr*Qe,eo=-Zt*Qe-Pr*It-rr*Tt;return oe[0]=aa*mn+eo*-Zt+So*-rr-$a*-Pr,oe[1]=So*mn+eo*-Pr+$a*-Zt-aa*-rr,oe[2]=$a*mn+eo*-rr+aa*-Pr-So*-Zt,oe},e.angle=ue;var ge=t(),Ce=t(),ze=t(),je=t(),V=t(),J=t(),ye=t();e.dihedralAngle=function we(oe,be,Se,Qe){m(ge,oe,be),m(Ce,Se,be),m(ze,be,Se),m(je,Qe,Se),X(V,ge,Ce),X(J,ze,je);var It=ue(V,J);return X(ye,V,J),ne(Ce,ye)>0?It:-It},e.directionFromSpherical=function Ee(oe,be,Se,Qe){return e.set(oe,Qe*Math.cos(Se)*Math.sin(be),Qe*Math.sin(Se)*Math.sin(be),Qe*Math.cos(be))},e.exactEquals=function Oe(oe,be){return oe[0]===be[0]&&oe[1]===be[1]&&oe[2]===be[2]},e.equals=function Ne(oe,be){var Se=oe[0],Qe=oe[1],It=oe[2],Tt=be[0],Zt=be[1],Pr=be[2];return Math.abs(Se-Tt)<=gn*Math.max(1,Math.abs(Se),Math.abs(Tt))&&Math.abs(Qe-Zt)<=gn*Math.max(1,Math.abs(Qe),Math.abs(Zt))&&Math.abs(It-Pr)<=gn*Math.max(1,Math.abs(It),Math.abs(Pr))};var Ue=t();e.makeRotation=function $e(oe,be,Se){var Qe=ue(be,Se);if(Math.abs(Qe)<1e-4)return me.setIdentity(oe);if(Math.abs(Qe-Math.PI)0?p(oe,be):Q(oe,p(oe,be)),oe};var Ct=t(),bt=t();e.triangleNormal=function kt(oe,be,Se,Qe){return m(Ct,Se,be),m(bt,Qe,be),K(oe,X(oe,Ct,bt))},e.toString=function Ot(oe,be){return"[".concat(oe[0].toPrecision(be)," ").concat(oe[1].toPrecision(be)," ").concat(oe[2].toPrecision(be),"]")},e.origin=l(0,0,0),e.unit=l(1,1,1),e.negUnit=l(-1,-1,-1),e.unitX=l(1,0,0),e.unitY=l(0,1,0),e.unitZ=l(0,0,1),e.negUnitX=l(-1,0,0),e.negUnitY=l(0,-1,0),e.negUnitZ=l(0,0,-1)}(S||(S={}));var Cr,ie,Qr,lO,Iv,D_,A_=Math.PI/2,gX=Math.PI/180;function Zr(e){return e*gX}function nc(e){return e/gX}function T_(e){return 0!==e&&0==(e&e-1)}function yX(e,t){return e*t}function me(){return me.zero()}function Qt(){return Qt.zero()}function Fe(){return Fe.zero()}function pr(){return pr.zero()}function nT(e){return Object.keys(e)}function xn(e){throw new Error("unreachable")}function aT(e){return"function"==typeof e?.then}function yn(){return yn.zero()}function Dv(e,t,r){for(;t9||o<0)return i*a|0;a=10*a+o|0}return i*a}function bX(e,t,r,n){return 43===t.charCodeAt(r)&&r++,e*Math.pow(10,jh(t,r,n))}function np(e,t,r){var n=t,a=1,i=0,o=0,s=1;for(45===e.charCodeAt(n)?(a=-1,++n):43===e.charCodeAt(n)&&++n;n=0&&u<10)){if(-2===u){for(++n;n=0&&u<10))return 53===u||21===u?bX(a*(i+o/s),e,n+1,r):a*(i+o/s);o=10*o+u,s*=10,++n}return a*(i+o/s)}if(53===u||21===u)return bX(a*i,e,n+1,r);break}i=10*i+u,++n}return a*i}function SX(e,t,r,n){return{schema:r,__array:void 0,isDefined:0===n,rowCount:t,value:function(i){return e},valueKind:function(i){return n},toArray:function(i){for(var o=w_(t,i).array,s=0,u=o.length;s>1;return t(e,r,n)>0?t(e,r,a)>0?t(e,a,n)>0?a:n:r:t(e,n,a)>0?t(e,a,r)>0?a:r:n}function kEe(e,t,r){var n=e.cmp,a=e.swap,i=e.data,o=e.parts,s=t+1,u=r;for(a(i,t,CX(i,n,t,r));n(i,u,t)>0;)--u;for(var c=t+1;c<=u;c++){var l=n(i,c,t);if(l>0){for(a(i,c,u),--u;n(i,u,t)>0;)--u;c--}else 0===l&&(a(i,c,s),s++)}for(c=t;c=t&&a(n,s,s+1)>0;)i(n,s,s+1),s-=1}function sT(e,t,r){for(var n=e.parts;to;)--i;for(var s=r+1;s<=i;s++){var u=e[s];if(u>o){for(Ev(e,s,i),--i;e[i]>o;)--i;s--}else u===o&&(Ev(e,s,a),++a)}for(s=r;s=t&&e[i]>a;)e[i+1]=e[i],i-=1;e[i+1]=a}}function cO(e,t,r,n){for(;rye)return!1;return!0}function l(V,J,ye,we){V[4*ye+J]=we}function m(V,J){return V[0]=J[0],V[1]=J[1],V[2]=J[2],V[3]=J[3],V[4]=J[4],V[5]=J[5],V[6]=J[6],V[7]=J[7],V[8]=J[8],V[9]=J[9],V[10]=J[10],V[11]=J[11],V[12]=J[12],V[13]=J[13],V[14]=J[14],V[15]=J[15],V}function b(V,J){var ye=J[0]+J[5]+J[10],we=0;return ye>0?(we=2*Math.sqrt(ye+1),V[3]=.25*we,V[0]=(J[6]-J[9])/we,V[1]=(J[8]-J[2])/we,V[2]=(J[1]-J[4])/we):J[0]>J[5]&&J[0]>J[10]?(we=2*Math.sqrt(1+J[0]-J[5]-J[10]),V[3]=(J[6]-J[9])/we,V[0]=.25*we,V[1]=(J[1]+J[4])/we,V[2]=(J[8]+J[2])/we):J[5]>J[10]?(we=2*Math.sqrt(1+J[5]-J[0]-J[10]),V[3]=(J[8]-J[2])/we,V[0]=(J[1]+J[4])/we,V[1]=.25*we,V[2]=(J[6]+J[9])/we):(we=2*Math.sqrt(1+J[10]-J[0]-J[5]),V[3]=(J[1]-J[4])/we,V[0]=(J[8]+J[2])/we,V[1]=(J[6]+J[9])/we,V[2]=.25*we),V}function x(V,J){var ye=J[0],we=J[1],Ee=J[2],Oe=J[3],Ne=J[4],Ue=J[5],$e=J[6],Pe=J[7],He=J[8],Je=J[9],vt=J[10],ut=J[11],_t=J[12],At=J[13],Le=J[14],st=J[15],Ct=ye*Ue-we*Ne,bt=ye*$e-Ee*Ne,kt=ye*Pe-Oe*Ne,Ot=we*$e-Ee*Ue,oe=we*Pe-Oe*Ue,be=Ee*Pe-Oe*$e,Se=He*At-Je*_t,Qe=He*Le-vt*_t,It=He*st-ut*_t,Tt=Je*Le-vt*At,Zt=Je*st-ut*At,Pr=vt*st-ut*Le,rr=Ct*Pr-bt*Zt+kt*Tt+Ot*It-oe*Qe+be*Se;return!!rr&&(V[0]=(Ue*Pr-$e*Zt+Pe*Tt)*(rr=1/rr),V[1]=(Ee*Zt-we*Pr-Oe*Tt)*rr,V[2]=(At*be-Le*oe+st*Ot)*rr,V[3]=(vt*oe-Je*be-ut*Ot)*rr,V[4]=($e*It-Ne*Pr-Pe*Qe)*rr,V[5]=(ye*Pr-Ee*It+Oe*Qe)*rr,V[6]=(Le*kt-_t*be-st*bt)*rr,V[7]=(He*be-vt*kt+ut*bt)*rr,V[8]=(Ne*Zt-Ue*It+Pe*Se)*rr,V[9]=(we*It-ye*Zt-Oe*Se)*rr,V[10]=(_t*oe-At*kt+st*Ct)*rr,V[11]=(Je*kt-He*oe-ut*Ct)*rr,V[12]=(Ue*Qe-Ne*Tt-$e*Se)*rr,V[13]=(ye*Tt-we*Qe+Ee*Se)*rr,V[14]=(At*bt-_t*Ot-Le*Ct)*rr,V[15]=(He*Ot-Je*bt+vt*Ct)*rr,!0)}function T(V,J,ye){var we=J[0],Ee=J[1],Oe=J[2],Ne=J[3],Ue=J[4],$e=J[5],Pe=J[6],He=J[7],Je=J[8],vt=J[9],ut=J[10],_t=J[11],At=J[12],Le=J[13],st=J[14],Ct=J[15],bt=ye[0],kt=ye[1],Ot=ye[2],oe=ye[3];return V[0]=bt*we+kt*Ue+Ot*Je+oe*At,V[1]=bt*Ee+kt*$e+Ot*vt+oe*Le,V[2]=bt*Oe+kt*Pe+Ot*ut+oe*st,V[3]=bt*Ne+kt*He+Ot*_t+oe*Ct,V[4]=(bt=ye[4])*we+(kt=ye[5])*Ue+(Ot=ye[6])*Je+(oe=ye[7])*At,V[5]=bt*Ee+kt*$e+Ot*vt+oe*Le,V[6]=bt*Oe+kt*Pe+Ot*ut+oe*st,V[7]=bt*Ne+kt*He+Ot*_t+oe*Ct,V[8]=(bt=ye[8])*we+(kt=ye[9])*Ue+(Ot=ye[10])*Je+(oe=ye[11])*At,V[9]=bt*Ee+kt*$e+Ot*vt+oe*Le,V[10]=bt*Oe+kt*Pe+Ot*ut+oe*st,V[11]=bt*Ne+kt*He+Ot*_t+oe*Ct,V[12]=(bt=ye[12])*we+(kt=ye[13])*Ue+(Ot=ye[14])*Je+(oe=ye[15])*At,V[13]=bt*Ee+kt*$e+Ot*vt+oe*Le,V[14]=bt*Oe+kt*Pe+Ot*ut+oe*st,V[15]=bt*Ne+kt*He+Ot*_t+oe*Ct,V}function N(V,J,ye){var we=ye[0],Ee=ye[1],Oe=ye[2],Ne=Math.sqrt(we*we+Ee*Ee+Oe*Oe);if(Math.abs(Ne)"u"?gn:J)},e.hasNaN=function u(V){for(var J=0;J<16;J++)if(isNaN(V[J]))return!0;return!1},e.areEqual=c,e.setValue=l,e.getValue=function f(V,J,ye){return V[4*ye+J]},e.toArray=function d(V,J,ye){return J[ye+0]=V[0],J[ye+1]=V[1],J[ye+2]=V[2],J[ye+3]=V[3],J[ye+4]=V[4],J[ye+5]=V[5],J[ye+6]=V[6],J[ye+7]=V[7],J[ye+8]=V[8],J[ye+9]=V[9],J[ye+10]=V[10],J[ye+11]=V[11],J[ye+12]=V[12],J[ye+13]=V[13],J[ye+14]=V[14],J[ye+15]=V[15],J},e.fromArray=function p(V,J,ye){return V[0]=J[ye+0],V[1]=J[ye+1],V[2]=J[ye+2],V[3]=J[ye+3],V[4]=J[ye+4],V[5]=J[ye+5],V[6]=J[ye+6],V[7]=J[ye+7],V[8]=J[ye+8],V[9]=J[ye+9],V[10]=J[ye+10],V[11]=J[ye+11],V[12]=J[ye+12],V[13]=J[ye+13],V[14]=J[ye+14],V[15]=J[ye+15],V},e.fromBasis=function h(V,J,ye,we){return a(V),l(V,0,0,J[0]),l(V,1,0,J[1]),l(V,2,0,J[2]),l(V,0,1,ye[0]),l(V,1,1,ye[1]),l(V,2,1,ye[2]),l(V,0,2,we[0]),l(V,1,2,we[1]),l(V,2,2,we[2]),l(V,3,3,1),V},e.copy=m,e.clone=function v(V){return m(t(),V)},e.getTranslation=function g(V,J){return V[0]=J[12],V[1]=J[13],V[2]=J[14],V},e.getScaling=function y(V,J){var ye=J[0],we=J[1],Ee=J[2],Oe=J[4],Ne=J[5],Ue=J[6],$e=J[8],Pe=J[9],He=J[10];return V[0]=Math.sqrt(ye*ye+we*we+Ee*Ee),V[1]=Math.sqrt(Oe*Oe+Ne*Ne+Ue*Ue),V[2]=Math.sqrt($e*$e+Pe*Pe+He*He),V},e.getRotation=b,e.extractRotation=function _(V,J){var ye=1/Math.sqrt(J[0]*J[0]+J[1]*J[1]+J[2]*J[2]),we=1/Math.sqrt(J[4]*J[4]+J[5]*J[5]+J[6]*J[6]),Ee=1/Math.sqrt(J[8]*J[8]+J[9]*J[9]+J[10]*J[10]);return V[0]=J[0]*ye,V[1]=J[1]*ye,V[2]=J[2]*ye,V[3]=0,V[4]=J[4]*we,V[5]=J[5]*we,V[6]=J[6]*we,V[7]=0,V[8]=J[8]*Ee,V[9]=J[9]*Ee,V[10]=J[10]*Ee,V[11]=0,V[12]=0,V[13]=0,V[14]=0,V[15]=1,V},e.transpose=function C(V,J){if(V===J){var ye=J[1],we=J[2],Ee=J[3],Oe=J[6],Ne=J[7],Ue=J[11];V[1]=J[4],V[2]=J[8],V[3]=J[12],V[4]=ye,V[6]=J[9],V[7]=J[13],V[8]=we,V[9]=Oe,V[11]=J[14],V[12]=Ee,V[13]=Ne,V[14]=Ue}else V[0]=J[0],V[1]=J[4],V[2]=J[8],V[3]=J[12],V[4]=J[1],V[5]=J[5],V[6]=J[9],V[7]=J[13],V[8]=J[2],V[9]=J[6],V[10]=J[10],V[11]=J[14],V[12]=J[3],V[13]=J[7],V[14]=J[11],V[15]=J[15];return V},e.tryInvert=x,e.invert=function A(V,J){return x(V,J)||console.warn("non-invertible matrix.",J),V},e.mul=T,e.mulOffset=function w(V,J,ye,we,Ee,Oe){var Ne=J[0+Ee],Ue=J[1+Ee],$e=J[2+Ee],Pe=J[3+Ee],He=J[4+Ee],Je=J[5+Ee],vt=J[6+Ee],ut=J[7+Ee],_t=J[8+Ee],At=J[9+Ee],Le=J[10+Ee],st=J[11+Ee],Ct=J[12+Ee],bt=J[13+Ee],kt=J[14+Ee],Ot=J[15+Ee],oe=ye[0+Oe],be=ye[1+Oe],Se=ye[2+Oe],Qe=ye[3+Oe];return V[0+we]=oe*Ne+be*He+Se*_t+Qe*Ct,V[1+we]=oe*Ue+be*Je+Se*At+Qe*bt,V[2+we]=oe*$e+be*vt+Se*Le+Qe*kt,V[3+we]=oe*Pe+be*ut+Se*st+Qe*Ot,V[4+we]=(oe=ye[4+Oe])*Ne+(be=ye[5+Oe])*He+(Se=ye[6+Oe])*_t+(Qe=ye[7+Oe])*Ct,V[5+we]=oe*Ue+be*Je+Se*At+Qe*bt,V[6+we]=oe*$e+be*vt+Se*Le+Qe*kt,V[7+we]=oe*Pe+be*ut+Se*st+Qe*Ot,V[8+we]=(oe=ye[8+Oe])*Ne+(be=ye[9+Oe])*He+(Se=ye[10+Oe])*_t+(Qe=ye[11+Oe])*Ct,V[9+we]=oe*Ue+be*Je+Se*At+Qe*bt,V[10+we]=oe*$e+be*vt+Se*Le+Qe*kt,V[11+we]=oe*Pe+be*ut+Se*st+Qe*Ot,V[12+we]=(oe=ye[12+Oe])*Ne+(be=ye[13+Oe])*He+(Se=ye[14+Oe])*_t+(Qe=ye[15+Oe])*Ct,V[13+we]=oe*Ue+be*Je+Se*At+Qe*bt,V[14+we]=oe*$e+be*vt+Se*Le+Qe*kt,V[15+we]=oe*Pe+be*ut+Se*st+Qe*Ot,V},e.mul3=function E(V,J,ye,we){return T(V,T(V,J,ye),we)},e.translate=function I(V,J,ye){var Ne,Ue,$e,Pe,He,Je,vt,ut,_t,At,Le,st,we=ye[0],Ee=ye[1],Oe=ye[2];return J===V?(V[12]=J[0]*we+J[4]*Ee+J[8]*Oe+J[12],V[13]=J[1]*we+J[5]*Ee+J[9]*Oe+J[13],V[14]=J[2]*we+J[6]*Ee+J[10]*Oe+J[14],V[15]=J[3]*we+J[7]*Ee+J[11]*Oe+J[15]):(Ue=J[1],$e=J[2],Pe=J[3],He=J[4],Je=J[5],vt=J[6],ut=J[7],_t=J[8],At=J[9],Le=J[10],st=J[11],V[0]=Ne=J[0],V[1]=Ue,V[2]=$e,V[3]=Pe,V[4]=He,V[5]=Je,V[6]=vt,V[7]=ut,V[8]=_t,V[9]=At,V[10]=Le,V[11]=st,V[12]=Ne*we+He*Ee+_t*Oe+J[12],V[13]=Ue*we+Je*Ee+At*Oe+J[13],V[14]=$e*we+vt*Ee+Le*Oe+J[14],V[15]=Pe*we+ut*Ee+st*Oe+J[15]),V},e.fromTranslation=function M(V,J){return V[0]=1,V[1]=0,V[2]=0,V[3]=0,V[4]=0,V[5]=1,V[6]=0,V[7]=0,V[8]=0,V[9]=0,V[10]=1,V[11]=0,V[12]=J[0],V[13]=J[1],V[14]=J[2],V[15]=1,V},e.setTranslation=function O(V,J){return V[12]=J[0],V[13]=J[1],V[14]=J[2],V},e.setAxes=function F(V,J,ye,we){return V[0]=ye[0],V[4]=ye[1],V[8]=ye[2],V[1]=we[0],V[5]=we[1],V[9]=we[2],V[2]=J[0],V[6]=J[1],V[10]=J[2],V},e.rotate=function j(V,J,ye,we){var Ee=we[0],Oe=we[1],Ne=we[2],Ue=Math.sqrt(Ee*Ee+Oe*Oe+Ne*Ne);if(Math.abs(Ue)0&&(He*=ut=1/Math.sqrt(ut),Je*=ut,vt*=ut);var _t=$e*vt-Pe*Je,At=Pe*He-Ue*vt,Le=Ue*Je-$e*He;return(ut=_t*_t+At*At+Le*Le)>0&&(_t*=ut=1/Math.sqrt(ut),At*=ut,Le*=ut),V[0]=_t,V[1]=At,V[2]=Le,V[3]=0,V[4]=Je*Le-vt*At,V[5]=vt*_t-He*Le,V[6]=He*At-Je*_t,V[7]=0,V[8]=He,V[9]=Je,V[10]=vt,V[11]=0,V[12]=Ee,V[13]=Oe,V[14]=Ne,V[15]=1,V},e.fromPermutation=function ue(V,J){a(V);for(var ye=0;ye<4;ye++)l(V,ye,J[ye],1);return V},e.getMaxScaleOnAxis=function ge(V){return Math.sqrt(Math.max(V[0]*V[0]+V[1]*V[1]+V[2]*V[2],V[4]*V[4]+V[5]*V[5]+V[6]*V[6],V[8]*V[8]+V[9]*V[9]+V[10]*V[10]))};var Ce=[1,0,0],ze=[0,1,0],je=[0,0,1];e.rotX90=N(t(),Zr(90),Ce),e.rotX180=N(t(),Zr(180),Ce),e.rotY90=N(t(),Zr(90),ze),e.rotY180=N(t(),Zr(180),ze),e.rotY270=N(t(),Zr(270),ze),e.rotZ90=N(t(),Zr(90),je),e.rotZ180=N(t(),Zr(180),je),e.rotXY90=T(t(),e.rotX90,e.rotY90),e.rotZY90=T(t(),e.rotZ90,e.rotY90),e.rotZYZ90=T(t(),e.rotZY90,e.rotZ90),e.rotZ90X180=T(t(),e.rotZ90,e.rotX180),e.rotY90Z180=T(t(),e.rotY90,e.rotZ180),e.id=r()}(me||(me={})),function(e){function t(){var L=[.1,0,0,0,0,0,0,0,0];return L[0]=0,L}function r(){var L=t();return L[0]=1,L[1]=0,L[2]=0,L[3]=0,L[4]=1,L[5]=0,L[6]=0,L[7]=0,L[8]=1,L}function s(L,Y){return L[0]=Y[0],L[1]=Y[1],L[2]=Y[2],L[3]=Y[4],L[4]=Y[5],L[5]=Y[6],L[6]=Y[8],L[7]=Y[9],L[8]=Y[10],L}e.zero=t,e.identity=r,e.setIdentity=function n(L){return L[0]=1,L[1]=0,L[2]=0,L[3]=0,L[4]=1,L[5]=0,L[6]=0,L[7]=0,L[8]=1,L},e.toArray=function a(L,Y,$){return Y[$+0]=L[0],Y[$+1]=L[1],Y[$+2]=L[2],Y[$+3]=L[3],Y[$+4]=L[4],Y[$+5]=L[5],Y[$+6]=L[6],Y[$+7]=L[7],Y[$+8]=L[8],Y},e.fromArray=function i(L,Y,$){return L[0]=Y[$+0],L[1]=Y[$+1],L[2]=Y[$+2],L[3]=Y[$+3],L[4]=Y[$+4],L[5]=Y[$+5],L[6]=Y[$+6],L[7]=Y[$+7],L[8]=Y[$+8],L},e.fromColumns=function o(L,Y,$,Z){return L[0]=Y[0],L[1]=Y[1],L[2]=Y[2],L[3]=$[0],L[4]=$[1],L[5]=$[2],L[6]=Z[0],L[7]=Z[1],L[8]=Z[2],L},e.fromMat4=s,e.create=function u(L,Y,$,Z,q,z,te,ae,de){var he=t();return he[0]=L,he[1]=Y,he[2]=$,he[3]=Z,he[4]=q,he[5]=z,he[6]=te,he[7]=ae,he[8]=de,he};var c=r();function p(L,Y,$){for(var Z=0;Z<9;Z++)if(Math.abs(L[Z]-Y[Z])>$)return!1;return!0}function v(L,Y){return L[0]=Y[0],L[1]=Y[1],L[2]=Y[2],L[3]=Y[3],L[4]=Y[4],L[5]=Y[5],L[6]=Y[6],L[7]=Y[7],L[8]=Y[8],L}function g(L,Y){if(L===Y){var $=Y[1],Z=Y[2],q=Y[5];L[1]=Y[3],L[2]=Y[6],L[3]=$,L[5]=Y[7],L[6]=Z,L[7]=q}else L[0]=Y[0],L[1]=Y[3],L[2]=Y[6],L[3]=Y[1],L[4]=Y[4],L[5]=Y[7],L[6]=Y[2],L[7]=Y[5],L[8]=Y[8];return L}function y(L,Y){var $=Y[0],Z=Y[1],q=Y[2],z=Y[3],te=Y[4],ae=Y[5],de=Y[6],he=Y[7],pe=Y[8],re=pe*te-ae*he,ee=-pe*z+ae*de,ue=he*z-te*de,ge=$*re+Z*ee+q*ue;return ge?(L[0]=re*(ge=1/ge),L[1]=(-pe*Z+q*he)*ge,L[2]=(ae*Z-q*te)*ge,L[3]=ee*ge,L[4]=(pe*$-q*de)*ge,L[5]=(-ae*$+q*z)*ge,L[6]=ue*ge,L[7]=(-he*$+Z*de)*ge,L[8]=(te*$-Z*z)*ge,L):(console.warn("non-invertible matrix.",Y),L)}function C(L){var q=L[3],z=L[4],te=L[5],ae=L[6],de=L[7],he=L[8];return L[0]*(he*z-te*de)+L[1]*(-he*q+te*ae)+L[2]*(de*q-z*ae)}function x(L){return L[0]+L[4]+L[8]}function A(L,Y,$){return L[0]=Y[0]-$[0],L[1]=Y[1]-$[1],L[2]=Y[2]-$[2],L[3]=Y[3]-$[3],L[4]=Y[4]-$[4],L[5]=Y[5]-$[5],L[6]=Y[6]-$[6],L[7]=Y[7]-$[7],L[8]=Y[8]-$[8],L}function M(L,Y,$){return L[0]=Y[0]*$,L[1]=Y[1]*$,L[2]=Y[2]*$,L[3]=Y[3]*$,L[4]=Y[4]*$,L[5]=Y[5]*$,L[6]=Y[6]*$,L[7]=Y[7]*$,L[8]=Y[8]*$,L}e.isIdentity=function l(L,Y){return p(L,c,typeof Y>"u"?gn:Y)},e.hasNaN=function f(L){for(var Y=0;Y<9;Y++)if(isNaN(L[Y]))return!0;return!1},e.clone=function d(L){return v(t(),L)},e.areEqual=p,e.setValue=function h(L,Y,$,Z){L[3*$+Y]=Z},e.getValue=function m(L,Y,$){return L[3*$+Y]},e.copy=v,e.transpose=g,e.invert=y,e.symmtricFromUpper=function b(L,Y){return L===Y?(L[3]=Y[1],L[6]=Y[2],L[7]=Y[5]):(L[0]=Y[0],L[1]=Y[1],L[2]=Y[2],L[3]=Y[1],L[4]=Y[4],L[5]=Y[5],L[6]=Y[2],L[7]=Y[5],L[8]=Y[8]),L},e.symmtricFromLower=function _(L,Y){return L===Y?(L[1]=Y[3],L[2]=Y[6],L[5]=Y[7]):(L[0]=Y[0],L[1]=Y[3],L[2]=Y[6],L[3]=Y[3],L[4]=Y[4],L[5]=Y[7],L[6]=Y[6],L[7]=Y[7],L[8]=Y[8]),L},e.determinant=C,e.trace=x,e.sub=A,e.add=function T(L,Y,$){return L[0]=Y[0]+$[0],L[1]=Y[1]+$[1],L[2]=Y[2]+$[2],L[3]=Y[3]+$[3],L[4]=Y[4]+$[4],L[5]=Y[5]+$[5],L[6]=Y[6]+$[6],L[7]=Y[7]+$[7],L[8]=Y[8]+$[8],L},e.mul=function w(L,Y,$){var Z=Y[0],q=Y[1],z=Y[2],te=Y[3],ae=Y[4],de=Y[5],he=Y[6],pe=Y[7],re=Y[8],ee=$[0],ue=$[1],ge=$[2],Ce=$[3],ze=$[4],je=$[5],V=$[6],J=$[7],ye=$[8];return L[0]=ee*Z+ue*te+ge*he,L[1]=ee*q+ue*ae+ge*pe,L[2]=ee*z+ue*de+ge*re,L[3]=Ce*Z+ze*te+je*he,L[4]=Ce*q+ze*ae+je*pe,L[5]=Ce*z+ze*de+je*re,L[6]=V*Z+J*te+ye*he,L[7]=V*q+J*ae+ye*pe,L[8]=V*z+J*de+ye*re,L},e.subScalar=function E(L,Y,$){return L[0]=Y[0]-$,L[1]=Y[1]-$,L[2]=Y[2]-$,L[3]=Y[3]-$,L[4]=Y[4]-$,L[5]=Y[5]-$,L[6]=Y[6]-$,L[7]=Y[7]-$,L[8]=Y[8]-$,L},e.addScalar=function I(L,Y,$){return L[0]=Y[0]+$,L[1]=Y[1]+$,L[2]=Y[2]+$,L[3]=Y[3]+$,L[4]=Y[4]+$,L[5]=Y[5]+$,L[6]=Y[6]+$,L[7]=Y[7]+$,L[8]=Y[8]+$,L},e.mulScalar=M;var O=Math.PI/3,F=t();e.symmetricEigenvalues=function j(L,Y){var $=Y[1]*Y[1]+Y[2]*Y[2]+Y[5]*Y[5];if(0===$)L[0]=Y[0],L[1]=Y[4],L[2]=Y[8];else{var Z=x(Y)/3,q=Y[0]-Z,z=Y[4]-Z,te=Y[8]-Z,de=Math.sqrt((q*q+z*z+te*te+2*$)/6);M(F,e.Identity,Z),A(F,Y,F),M(F,F,1/de);var he=C(F)/2,pe=he<=-1?O:he>=1?0:Math.acos(he)/3;L[0]=Z+2*de*Math.cos(pe),L[2]=Z+2*de*Math.cos(pe+2*O),L[1]=3*Z-L[0]-L[2]}return L};var N=[.1,0,0],H=[.1,0,0],G=[.1,0,0],U=[.1,0,0],Q=[.1,0,0],W=[.1,0,0];e.eigenvector=function K(L,Y,$){S.set(N,Y[0]-$,Y[1],Y[2]),S.set(H,Y[1],Y[4]-$,Y[5]),S.set(G,Y[2],Y[5],Y[8]-$),S.cross(U,N,H),S.cross(Q,N,G),S.cross(W,H,G);var Z=S.dot(U,U),q=S.dot(Q,Q),z=S.dot(W,W),te=Z,ae=0;return q>te&&(te=q,ae=1),z>te&&(ae=2),0===ae?S.scale(L,U,1/Math.sqrt(Z)):1===ae?S.scale(L,Q,1/Math.sqrt(q)):S.scale(L,W,1/Math.sqrt(z)),L},e.directionTransform=function ne(L,Y){return s(L,Y),y(L,L),g(L,L),L},e.Identity=r(),e.innerProduct=function X(L,Y){return L[0]*Y[0]+L[1]*Y[1]+L[2]*Y[2]+L[3]*Y[3]+L[4]*Y[4]+L[5]*Y[5]+L[6]*Y[6]+L[7]*Y[7]+L[8]*Y[8]}}(Qt||(Qt={})),function(e){function t(){var T=[.1,0];return T[0]=0,T}e.zero=t,e.clone=function r(T){var w=t();return w[0]=T[0],w[1]=T[1],w},e.create=function n(T,w){var E=t();return E[0]=T,E[1]=w,E},e.hasNaN=function a(T){return isNaN(T[0])||isNaN(T[1])},e.toArray=function i(T,w,E){return w[E+0]=T[0],w[E+1]=T[1],w},e.fromArray=function o(T,w,E){return T[0]=w[E+0],T[1]=w[E+1],T},e.copy=function s(T,w){return T[0]=w[0],T[1]=w[1],T},e.set=function u(T,w,E){return T[0]=w,T[1]=E,T},e.add=function c(T,w,E){return T[0]=w[0]+E[0],T[1]=w[1]+E[1],T},e.sub=function l(T,w,E){return T[0]=w[0]-E[0],T[1]=w[1]-E[1],T},e.mul=function f(T,w,E){return T[0]=w[0]*E[0],T[1]=w[1]*E[1],T},e.div=function d(T,w,E){return T[0]=w[0]/E[0],T[1]=w[1]/E[1],T},e.scale=function p(T,w,E){return T[0]=w[0]*E,T[1]=w[1]*E,T},e.round=function h(T,w){return T[0]=Math.round(w[0]),T[1]=Math.round(w[1]),T},e.ceil=function m(T,w){return T[0]=Math.ceil(w[0]),T[1]=Math.ceil(w[1]),T},e.floor=function v(T,w){return T[0]=Math.floor(w[0]),T[1]=Math.floor(w[1]),T},e.distance=function g(T,w){var E=w[0]-T[0],I=w[1]-T[1];return Math.sqrt(E*E+I*I)},e.squaredDistance=function y(T,w){var E=w[0]-T[0],I=w[1]-T[1];return E*E+I*I},e.magnitude=function b(T){var w=T[0],E=T[1];return Math.sqrt(w*w+E*E)},e.squaredMagnitude=function _(T){var w=T[0],E=T[1];return w*w+E*E},e.inverse=function C(T,w){return T[0]=1/w[0],T[1]=1/w[1],T},e.areEqual=function x(T,w){return T[0]===w[0]&&T[1]===w[1]},e.toString=function A(T,w){return"[".concat(T[0].toPrecision(w)," ").concat(T[1].toPrecision(w),"}]")}}(Fe||(Fe={})),function(e){function t(){var M=[.1,0,0,0];return M[0]=0,M}function a(M,O){return M[0]=O.center[0],M[1]=O.center[1],M[2]=O.center[2],M[3]=O.radius,M}e.zero=t,e.clone=function r(M){var O=t();return O[0]=M[0],O[1]=M[1],O[2]=M[2],O[3]=M[3],O},e.create=function n(M,O,F,j){var N=t();return N[0]=M,N[1]=O,N[2]=F,N[3]=j,N},e.fromSphere=a,e.ofSphere=function i(M){return a(t(),M)},e.hasNaN=function o(M){return isNaN(M[0])||isNaN(M[1])||isNaN(M[2])||isNaN(M[3])},e.toArray=function s(M,O,F){return O[F+0]=M[0],O[F+1]=M[1],O[F+2]=M[2],O[F+3]=M[3],O},e.fromArray=function u(M,O,F){return M[0]=O[F+0],M[1]=O[F+1],M[2]=O[F+2],M[3]=O[F+3],M},e.toVec3Array=function c(M,O,F){O[F+0]=M[0],O[F+1]=M[1],O[F+2]=M[2]},e.fromVec3Array=function l(M,O,F){return M[0]=O[F+0],M[1]=O[F+1],M[2]=O[F+2],M[3]=0,M},e.copy=function f(M,O){return M[0]=O[0],M[1]=O[1],M[2]=O[2],M[3]=O[3],M},e.set=function d(M,O,F,j,N){return M[0]=O,M[1]=F,M[2]=j,M[3]=N,M},e.add=function p(M,O,F){return M[0]=O[0]+F[0],M[1]=O[1]+F[1],M[2]=O[2]+F[2],M[3]=O[3]+F[3],M},e.distance=function h(M,O){var F=O[0]-M[0],j=O[1]-M[1],N=O[2]-M[2],H=O[3]-M[3];return Math.sqrt(F*F+j*j+N*N+H*H)},e.scale=function m(M,O,F){return M[0]=O[0]*F,M[1]=O[1]*F,M[2]=O[2]*F,M[4]=O[4]*F,M},e.round=function v(M,O){return M[0]=Math.round(O[0]),M[1]=Math.round(O[1]),M[2]=Math.round(O[2]),M[3]=Math.round(O[3]),M},e.ceil=function g(M,O){return M[0]=Math.ceil(O[0]),M[1]=Math.ceil(O[1]),M[2]=Math.ceil(O[2]),M[3]=Math.ceil(O[3]),M},e.floor=function y(M,O){return M[0]=Math.floor(O[0]),M[1]=Math.floor(O[1]),M[2]=Math.floor(O[2]),M[3]=Math.floor(O[3]),M},e.squaredDistance=function b(M,O){var F=O[0]-M[0],j=O[1]-M[1],N=O[2]-M[2],H=O[3]-M[3];return F*F+j*j+N*N+H*H},e.norm=function _(M){var O=M[0],F=M[1],j=M[2],N=M[3];return Math.sqrt(O*O+F*F+j*j+N*N)},e.squaredNorm=function C(M){var O=M[0],F=M[1],j=M[2],N=M[3];return O*O+F*F+j*j+N*N},e.transformMat4=function x(M,O,F){var j=O[0],N=O[1],H=O[2],G=O[3];return M[0]=F[0]*j+F[4]*N+F[8]*H+F[12]*G,M[1]=F[1]*j+F[5]*N+F[9]*H+F[13]*G,M[2]=F[2]*j+F[6]*N+F[10]*H+F[14]*G,M[3]=F[3]*j+F[7]*N+F[11]*H+F[15]*G,M},e.dot=function A(M,O){return M[0]*O[0]+M[1]*O[1]+M[2]*O[2]+M[3]*O[3]},e.inverse=function T(M,O){return M[0]=1/O[0],M[1]=1/O[1],M[2]=1/O[2],M[3]=1/O[3],M},e.exactEquals=function w(M,O){return M[0]===O[0]&&M[1]===O[1]&&M[2]===O[2]&&M[3]===O[3]},e.equals=function E(M,O){var F=M[0],j=M[1],N=M[2],H=M[3],G=O[0],U=O[1],Q=O[2],W=O[3];return Math.abs(F-G)<=gn*Math.max(1,Math.abs(F),Math.abs(G))&&Math.abs(j-U)<=gn*Math.max(1,Math.abs(j),Math.abs(U))&&Math.abs(N-Q)<=gn*Math.max(1,Math.abs(N),Math.abs(Q))&&Math.abs(H-W)<=gn*Math.max(1,Math.abs(H),Math.abs(W))},e.toString=function I(M,O){return"[".concat(M[0].toPrecision(O)," ").concat(M[1].toPrecision(O)," ").concat(M[2].toPrecision(O)," ").concat(M[3].toPrecision(O),"]")}}(pr||(pr={})),function(e){function t(){var X=[.1,0,0,0];return X[0]=0,X}function r(){var X=t();return X[3]=1,X}function o(X,L,Y){Y*=.5;var $=Math.sin(Y);return X[0]=$*L[0],X[1]=$*L[1],X[2]=$*L[2],X[3]=Math.cos(Y),X}function p(X,L,Y,$){var re,ee,ue,ge,Ce,Z=L[0],q=L[1],z=L[2],te=L[3],ae=Y[0],de=Y[1],he=Y[2],pe=Y[3];return(ee=Z*ae+q*de+z*he+te*pe)<0&&(ee=-ee,ae=-ae,de=-de,he=-he,pe=-pe),1-ee>1e-6?(re=Math.acos(ee),ue=Math.sin(re),ge=Math.sin((1-$)*re)/ue,Ce=Math.sin($*re)/ue):(ge=1-$,Ce=$),X[0]=ge*Z+Ce*ae,X[1]=ge*q+Ce*de,X[2]=ge*z+Ce*he,X[3]=ge*te+Ce*pe,X}function g(X,L){var $,Y=L[0]+L[4]+L[8];if(Y>0)$=Math.sqrt(Y+1),X[3]=.5*$,X[0]=(L[5]-L[7])*($=.5/$),X[1]=(L[6]-L[2])*$,X[2]=(L[1]-L[3])*$;else{var Z=0;L[4]>L[0]&&(Z=1),L[8]>L[3*Z+Z]&&(Z=2);var q=(Z+1)%3,z=(Z+2)%3;$=Math.sqrt(L[3*Z+Z]-L[3*q+q]-L[3*z+z]+1),X[Z]=.5*$,X[3]=(L[3*q+z]-L[3*z+q])*($=.5/$),X[q]=(L[3*q+Z]+L[3*Z+q])*$,X[z]=(L[3*z+Z]+L[3*Z+z])*$}return X}e.zero=t,e.identity=r,e.setIdentity=function n(X){X[0]=0,X[1]=0,X[2]=0,X[3]=1},e.hasNaN=function a(X){return isNaN(X[0])||isNaN(X[1])||isNaN(X[2])||isNaN(X[3])},e.create=function i(X,L,Y,$){var Z=r();return Z[0]=X,Z[1]=L,Z[2]=Y,Z[3]=$,Z},e.setAxisAngle=o,e.getAxisAngle=function s(X,L){var Y=2*Math.acos(L[3]),$=Math.sin(Y/2);return 0!==$?(X[0]=L[0]/$,X[1]=L[1]/$,X[2]=L[2]/$):(X[0]=1,X[1]=0,X[2]=0),Y},e.multiply=function u(X,L,Y){var $=L[0],Z=L[1],q=L[2],z=L[3],te=Y[0],ae=Y[1],de=Y[2],he=Y[3];return X[0]=$*he+z*te+Z*de-q*ae,X[1]=Z*he+z*ae+q*te-$*de,X[2]=q*he+z*de+$*ae-Z*te,X[3]=z*he-$*te-Z*ae-q*de,X},e.rotateX=function c(X,L,Y){Y*=.5;var $=L[0],Z=L[1],q=L[2],z=L[3],te=Math.sin(Y),ae=Math.cos(Y);return X[0]=$*ae+z*te,X[1]=Z*ae+q*te,X[2]=q*ae-Z*te,X[3]=z*ae-$*te,X},e.rotateY=function l(X,L,Y){Y*=.5;var $=L[0],Z=L[1],q=L[2],z=L[3],te=Math.sin(Y),ae=Math.cos(Y);return X[0]=$*ae-q*te,X[1]=Z*ae+z*te,X[2]=q*ae+$*te,X[3]=z*ae-Z*te,X},e.rotateZ=function f(X,L,Y){Y*=.5;var $=L[0],Z=L[1],q=L[2],z=L[3],te=Math.sin(Y),ae=Math.cos(Y);return X[0]=$*ae+Z*te,X[1]=Z*ae-$*te,X[2]=q*ae+z*te,X[3]=z*ae-q*te,X},e.calculateW=function d(X,L){var Y=L[0],$=L[1],Z=L[2];return X[0]=Y,X[1]=$,X[2]=Z,X[3]=Math.sqrt(Math.abs(1-Y*Y-$*$-Z*Z)),X},e.slerp=p,e.invert=function h(X,L){var Y=L[0],$=L[1],Z=L[2],q=L[3],z=Y*Y+$*$+Z*Z+q*q,te=z?1/z:0;return X[0]=-Y*te,X[1]=-$*te,X[2]=-Z*te,X[3]=q*te,X},e.conjugate=function m(X,L){return X[0]=-L[0],X[1]=-L[1],X[2]=-L[2],X[3]=L[3],X},e.dot=function v(X,L){return X[0]*L[0]+X[1]*L[1]+X[2]*L[2]+X[3]*L[3]},e.fromMat3=g,e.fromEuler=function y(X,L,Y){var $=L[0],Z=L[1],q=L[2],z=Math.cos($/2),te=Math.cos(Z/2),ae=Math.cos(q/2),de=Math.sin($/2),he=Math.sin(Z/2),pe=Math.sin(q/2);switch(Y){case"XYZ":X[0]=de*te*ae+z*he*pe,X[1]=z*he*ae-de*te*pe,X[2]=z*te*pe+de*he*ae,X[3]=z*te*ae-de*he*pe;break;case"YXZ":X[0]=de*te*ae+z*he*pe,X[1]=z*he*ae-de*te*pe,X[2]=z*te*pe-de*he*ae,X[3]=z*te*ae+de*he*pe;break;case"ZXY":X[0]=de*te*ae-z*he*pe,X[1]=z*he*ae+de*te*pe,X[2]=z*te*pe+de*he*ae,X[3]=z*te*ae-de*he*pe;break;case"ZYX":X[0]=de*te*ae-z*he*pe,X[1]=z*he*ae+de*te*pe,X[2]=z*te*pe-de*he*ae,X[3]=z*te*ae+de*he*pe;break;case"YZX":X[0]=de*te*ae+z*he*pe,X[1]=z*he*ae+de*te*pe,X[2]=z*te*pe-de*he*ae,X[3]=z*te*ae-de*he*pe;break;case"XZY":X[0]=de*te*ae-z*he*pe,X[1]=z*he*ae-de*te*pe,X[2]=z*te*pe+de*he*ae,X[3]=z*te*ae+de*he*pe;break;default:xn()}return X};var b=[0,0,0];function O(X,L){var Y=L[0],$=L[1],Z=L[2],q=L[3],z=Y*Y+$*$+Z*Z+q*q;return z>0&&(z=1/Math.sqrt(z),X[0]=Y*z,X[1]=$*z,X[2]=Z*z,X[3]=q*z),X}e.fromUnitVec3=function _(X,L,Y){var $=S.dot(L,Y)+1;return $Math.abs(L[2])?S.set(b,-L[1],L[0],0):S.set(b,0,-L[2],L[1])):S.cross(b,L,Y),X[0]=b[0],X[1]=b[1],X[2]=b[2],X[3]=$,O(X,X),X},e.clone=function C(X){var L=t();return L[0]=X[0],L[1]=X[1],L[2]=X[2],L[3]=X[3],L},e.toArray=function x(X,L,Y){return L[Y+0]=X[0],L[Y+1]=X[1],L[Y+2]=X[2],L[Y+3]=X[3],L},e.fromArray=function A(X,L,Y){return X[0]=L[Y+0],X[1]=L[Y+1],X[2]=L[Y+2],X[3]=L[Y+3],X},e.copy=function T(X,L){return X[0]=L[0],X[1]=L[1],X[2]=L[2],X[3]=L[3],X},e.set=function w(X,L,Y,$,Z){return X[0]=L,X[1]=Y,X[2]=$,X[3]=Z,X},e.exactEquals=function E(X,L){return X[0]===L[0]&&X[1]===L[1]&&X[2]===L[2]&&X[3]===L[3]},e.equals=function I(X,L){var Y=X[0],$=X[1],Z=X[2],q=X[3],z=L[0],te=L[1],ae=L[2],de=L[3];return Math.abs(Y-z)<=gn*Math.max(1,Math.abs(Y),Math.abs(z))&&Math.abs($-te)<=gn*Math.max(1,Math.abs($),Math.abs(te))&&Math.abs(Z-ae)<=gn*Math.max(1,Math.abs(Z),Math.abs(ae))&&Math.abs(q-de)<=gn*Math.max(1,Math.abs(q),Math.abs(de))},e.add=function M(X,L,Y){return X[0]=L[0]+Y[0],X[1]=L[1]+Y[1],X[2]=L[2]+Y[2],X[3]=L[3]+Y[3],X},e.normalize=O;var F=[0,0,0],j=[1,0,0],N=[0,1,0];e.rotationTo=function H(X,L,Y){var $=S.dot(L,Y);return $<-.999999?(S.cross(F,j,L),S.magnitude(F)<1e-6&&S.cross(F,N,L),S.normalize(F,F),o(X,F,Math.PI),X):$>.999999?(X[0]=0,X[1]=0,X[2]=0,X[3]=1,X):(S.cross(F,L,Y),X[0]=F[0],X[1]=F[1],X[2]=F[2],X[3]=1+$,O(X,X))};var G=t(),U=t();e.sqlerp=function Q(X,L,Y,$,Z,q){return p(G,L,Z,q),p(U,Y,$,q),p(X,G,U,2*q*(1-q)),X};var W=[0,0,0,0,0,0,0,0,0];e.setAxes=function K(X,L,Y,$){return W[0]=Y[0],W[3]=Y[1],W[6]=Y[2],W[1]=$[0],W[4]=$[1],W[7]=$[2],W[2]=-L[0],W[5]=-L[1],W[8]=-L[2],O(X,g(X,W))},e.toString=function ne(X,L){return"[".concat(X[0].toPrecision(L)," ").concat(X[1].toPrecision(L)," ").concat(X[2].toPrecision(L)," ").concat(X[3].toPrecision(L),"]")},e.Identity=r()}(yn||(yn={})),function(e){function n(C,x,A){var T=function t(C,x,A){for(var T=[],w=0;w=0;I--)E=(E+x[T[I]])*A[I];return E}function y(C,x){for(var A=[],T=0;T"u"?1:0}})},E=0,I=T;E0},e.prototype.has=function(t){return this._set.has(t)},e.prototype.assets=function(t,r){var n=this._assets.get(t);if(n)for(var a=0,i=n;at&&(t=e[r]);return t}function cT(e){for(var t=1/0,r=0,n=e.length;rr&&(r=e[n]);return[t,r]}function AX(e,t,r){void 0===t&&(t=1),void 0===r&&(r=0);for(var n=e.length,a=0,i=r;i=0||(e.push(t),0))}function Pv(e,t){var r=e.indexOf(t);if(r<0)return!1;for(var n=r,a=e.length-1;n0?[4,new Promise(function(i){t.onChildrenFinished=i})]:[3,5]):[3,6];case 4:a.sent(),a.label=5;case 5:e.onAbort&&e.onAbort(),a.label=6;case 6:throw n;case 7:return[2]}})})}function RX(e){throw e.abortToken.treeAborted||(e.abortToken.treeAborted=!0,kX(e.root),OX(e,da())),Ve.Aborted(e.abortToken.reason)}function kX(e){var t=e.progress;t.isIndeterminate=!0,t.canAbort=!1,t.message="Aborting...";for(var r=0,n=e.children;rthis.info.updateRateMs},enumerable:!1,configurable:!0}),e.prototype.updateProgress=function(t){if(this.checkAborted(),t){var r=this.node.progress;"string"==typeof t?(r.message=t,r.isIndeterminate=!0):(typeof t.canAbort<"u"&&(r.canAbort=t.canAbort),typeof t.message<"u"&&(r.message=t.message),typeof t.current<"u"&&(r.current=t.current),typeof t.max<"u"&&(r.max=t.max),r.isIndeterminate=typeof r.current>"u"||typeof r.max>"u",typeof t.isIndeterminate<"u"&&(r.isIndeterminate=t.isIndeterminate))}},e.prototype.update=function(t,r){if(this.lastUpdatedTime=da(),this.updateProgress(t),!r)return OX(this.info,this.lastUpdatedTime),this.checkAborted(),P_.immediatePromise()},e.prototype.runChild=function(t,r){return ce(this,void 0,void 0,function(){var n,a,i,o,s,u,c;return le(this,function(l){switch(l.label){case 0:this.updateProgress(r),n={progress:EX(t),children:[]},(a=this.node.children).push(n),i=new e(this.info,n),l.label=1;case 1:return l.trys.push([1,3,4,5]),[4,hO(t,i)];case 2:return[2,l.sent()];case 3:if(o=l.sent(),Ve.isAbort(o)&&this.isAborted)return[2,void 0];throw o;case 4:if((s=a.indexOf(n))>=0){for(u=s,c=a.length-1;u0?(o+=c,f=da()-u,l+=f,s+=f,e.shouldUpdate?[4,a(e,r,o)]:[3,3]):[3,4];case 2:d.sent(),i=Math.round(l*o/s)+1,u=da(),l=0,d.label=3;case 3:return[3,1];case 4:return e.shouldUpdate?[4,a(e,r,o)]:[3,6];case 5:d.sent(),d.label=6;case 6:return[2,r]}})})}function a3e(e,t,r){return e[t].keyo[c].key){p=!1;break}}if(u&&p){for(c=0;c=d.currentSize)_.set(w,C);else for(A=0,T=w.length;A=d.currentSize&&r(d);var g=d.currentChunk,y=d.currentIndex;return g[y]=p,g[y+1]=h,g[y+2]=m,g[y+3]=v,d.currentIndex+=4,d.elementCount++},e.add3=function a(d,p,h,m){d.currentIndex>=d.currentSize&&r(d);var v=d.currentChunk,g=d.currentIndex;return v[g]=p,v[g+1]=h,v[g+2]=m,d.currentIndex+=3,d.elementCount++},e.add2=function i(d,p,h){d.currentIndex>=d.currentSize&&r(d);var m=d.currentChunk,v=d.currentIndex;return m[v]=p,m[v+1]=h,d.currentIndex+=2,d.elementCount++},e.add=function o(d,p){return d.currentIndex>=d.currentSize&&r(d),d.currentChunk[d.currentIndex]=p,d.currentIndex+=1,d.elementCount++},e.addRepeat=function s(d,p,h){for(var m=0;m=d.currentSize&&r(d),d.currentChunk[d.currentIndex++]=h,d.elementCount++;return d.elementCount},e.addMany=function u(d,p){for(var h=d.elementSize,m=0,v=p.length;m=d.currentSize&&r(d);for(var g=d.currentChunk,y=0;y"u")return v;if("number"==typeof m)return v.currentChunk=new d(m*p),v.allocatedSize=m*p,v.currentSize=v.currentChunk.length,v.chunks[0]=v.currentChunk,v;var g=m;if(g.length%p!=0)throw new Error("initialChunk length must be a multiple of the element size.");return v.currentChunk=g,v.allocatedSize=g.length,v.currentSize=g.length,v.chunks[0]=g,v}}(qe||(qe={}));var Ai,o3e=function(){function e(t,r){this.getHash=t,this.areEqual=r,this.id=0,this.byHash=new Map,this.groups=[]}return e.prototype.createGroup=function(t,r){var n=this.id++,a=[t];return this.groups[n]=a,{id:n,keys:a,value:r}},e.prototype.add=function(t,r){var n=this.getHash(r);if(this.byHash.has(n)){for(var a=this.byHash.get(n),i=0,o=a.length;i>4;return(t=(3735928559^t)+(t<<5))^t>>11}function Mv(e,t){var r=23;return r=31*(r=31*r+e|0)+t|0,(r=(3735928559^(r^=r>>4))+(r<<5))^r>>11}function vO(e){for(var t=0,r=0,n=e.length;r>>0}function gO(e,t){for(var r=0,n=e.length;r=r&&t0&&n>0&&gT(e)>=vT(t)&&vT(e)<=gT(t)}function C3e(e,t){return Rv(e)?!Rv(t)||op(e)<=op(t)&&qh(e)>=qh(t):0===Rv(t)}function _O(e,t){var r=op(e);if(t<=r)return 0;var n=qh(e);return t>=n?n-r:t-r}function x3e(e,t,r){var n=op(r),a=op(e);if(t<=n+a)return n;var i=qh(r);return t>=i+a?i:t-a}function GX(e,t,r){return bO(_O(e,t),_O(e,r+1))}function w3e(e,t){return zX(e,t)?bO(Math.max(op(e),op(t)),Math.min(qh(e),qh(t))):UX}function A3e(e,t){return Rv(GX(e,vT(t),gT(t)))}!function(e){e.Empty=UX,e.ofSingleton=function(t){return VX(t,t)},e.ofRange=VX,e.ofBounds=bO,e.ofLength=h3e,e.is=m3e,e.has=y3e,e.indexOf=b3e,e.getAt=_3e,e.start=op,e.end=qh,e.min=vT,e.max=gT,e.size=Rv,e.hashCode=v3e,e.toString=g3e,e.areEqual=S3e,e.areIntersecting=zX,e.isSubInterval=C3e,e.findPredecessorIndex=_O,e.findPredecessorIndexInInterval=x3e,e.findRange=GX,e.intersectionSize=A3e,e.intersect=w3e}(xe||(xe={}));var F_=[];function T3e(e){return[e]}function D3e(e){return e}function E3e(e){return Nc(e),e}function HX(e,t){if(t2?function c3e(e,t,r,n){var a=23;return a=31*(a=31*(a=31*(a=31*a+e|0)+t|0)+r|0)+n|0,(a=(3735928559^(a^=a>>4))+(a<<5))^a>>11}(t,e[0],e[t-1],e[t>>1]):function u3e(e,t,r){var n=23;return n=31*(n=31*(n=31*n+e|0)+t|0)+r|0,(n=(3735928559^(n^=n>>4))+(n<<5))^n>>11}(t,e[0],e[t-1]):0}function k3e(e){var t=e.length;return t>5?"[".concat(e[0],", ").concat(e[1],", ..., ").concat(e[t-1],"], length ").concat(t):"[".concat(e.join(", "),"]")}function WX(e,t){var r=e.length;return 0===r?-1:e[0]<=t&&t<=e[r-1]?KX(e,t,0,r):-1}function O3e(e,t,r){return YX(e,t,xe.start(r),xe.end(r))}function YX(e,t,r,n){return 0===e.length||n<=r?-1:e[r]<=t&&t<=e[n-1]?KX(e,t,r,n):-1}function F3e(e,t){return WX(e,t)>=0}function XX(e,t){if(e===t)return!0;var r=e.length;if(r!==t.length||e[0]!==t[0]||e[r-1]!==t[r-1])return!1;if(jX(e))return!0;r--;for(var n=1;ne[r-1]?r:ZX(e,t,0,r)}function N3e(e,t,r){var n=xe.start(r),a=xe.end(r),i=e[n];return t<=i?n:a>n&&t>e[a-1]?a:t-i<=11?function L3e(e,t,r,n){for(var a=r;ai){for(var o=a;o<=i;o++)if(t===e[o])return o;return-1}var s=a+i>>1,u=e[s];if(tu))return s;a=s+1}}return-1}function ZX(e,t,r,n){for(var a=r,i=n-1;ai){for(var o=a;o<=i;o++)if(t<=e[o])return o;return i+1}var s=a+i>>1,u=e[s];if(tu))return s;a=s+1}}return a>i?i+1:e[a]>=t?a:a+1}function U3e(e,t){if(e===t)return!0;for(var r=Ov(e,t),n=r.startI,a=r.startJ,i=r.endI,o=r.endJ;nu))return!0;a++}}return!1}function V3e(e,t){if(e===t)return!0;var r=t.length,n=Ov(e,t),a=n.startI,i=n.startJ,o=n.endI,s=n.endJ;if(s-il?i++:(a++,i++,u++)}return u===r}function QX(e,t){if(e===t)return e;var r=e.length,n=t.length;if(0===r)return t;if(0===n)return e;if(e[0]>t[0])return QX(t,e);var a=Ov(e,t),i=a.startI,s=a.endI,u=a.endJ,c=xO(e,t,i,a.startJ,s,u);if(c===r&&c===n||c===n)return e;if(c===r)return t;var l=new Int32Array(r+n-c),f=0,d=0,p=0;for(f=0;ft[d];)l[p++]=t[d++];for(;fm?(l[p++]=m,d++):(l[p++]=h,f++,d++)}for(;fl?s++:(o++,s++,u++)}return u}function G3e(e,t){if(e===t)return e;var r=Ov(e,t),n=r.startI,a=r.startJ,i=r.endI,o=r.endJ,s=xO(e,t,n,a,i,o),u=e.length,c=t.length;if(!s)return F_;if(s===u&&s===c||s===c)return t;if(s===u)return e;for(var l=new Int32Array(s),f=0,d=n,p=a;dm||(l[f++]=h,d++),p++)}return l}function H3e(e,t){if(e===t)return F_;for(var r=e.length,n=Ov(e,t),a=n.startI,i=n.startJ,o=n.endI,s=n.endJ,u=a,c=i,l=0;ud?c++:(u++,c++,l++);if(!l)return e;if(l>=r)return F_;for(var p=new Int32Array(r-l),h=0,m=0;md||u++,c++)}for(;uf?u++:(s++,u++,c++);if(!c)return F_;if(c===e.length)return yO(0,e.length-1);var p=new Int32Array(c),h=0;for(s=n,u=a;sf||(p[h++]=s,s++),u++)}return p}var Xe,sp={startI:0,startJ:0,endI:0,endJ:0};function Ov(e,t){var r=e.length,n=t.length,a=r/n;return r>=128||n>=128||a<=.34||a>=2.99?(sp.startI=kv(e,SO(t)),sp.startJ=kv(t,SO(e)),sp.endI=kv(e,CO(t)),sp.endJ=kv(t,CO(e))):(sp.startI=0,sp.startJ=0,sp.endI=r,sp.endJ=n),sp}!function(e){e.Empty=F_,e.ofUnsortedArray=E3e,e.ofSingleton=T3e,e.ofSortedArray=D3e,e.ofRange=HX,e.ofBounds=function(t,r){return HX(t,r-1)},e.is=I3e,e.isRange=jX,e.has=F3e,e.indexOf=WX,e.indexOfInInterval=O3e,e.indexOfInRange=YX,e.start=SO,e.end=CO,e.min=P3e,e.max=M3e,e.size=qX,e.hashCode=R3e,e.toString=k3e,e.areEqual=XX,e.areIntersecting=U3e,e.isSubset=V3e,e.union=QX,e.intersect=G3e,e.subtract=H3e,e.findPredecessorIndex=kv,e.findPredecessorIndexInInterval=N3e,e.findRange=B3e,e.intersectionSize=z3e,e.deduplicate=j3e,e.indicesOf=q3e}(Xe||(Xe={}));var Be,Hf=xe.Empty,W3e=xe.ofSingleton,Y3e=xe.ofRange,X3e=xe.ofBounds;function Wl(e){return e.length?Xe.isRange(e)?xe.ofRange(e[0],e[e.length-1]):e:Hf}function Fv(e){return xe.is(e)?xe.size(e):Xe.size(e)}function K3e(e,t){return xe.is(e)?xe.has(e,t):Xe.has(e,t)}function Z3e(e,t){return xe.is(e)?xe.indexOf(e,t):Xe.indexOf(e,t)}function wO(e,t){return xe.is(e)?xe.getAt(e,t):e[t]}function Ry(e){return xe.is(e)?xe.min(e):Xe.min(e)}function ky(e){return xe.is(e)?xe.max(e):Xe.max(e)}function Q3e(e){return xe.is(e)?xe.start(e):Xe.start(e)}function $3e(e){return xe.is(e)?xe.end(e):Xe.end(e)}function J3e(e){return xe.is(e)?xe.hashCode(e):Xe.hashCode(e)}function tIe(e,t){return xe.is(e)?xe.is(t)?xe.areEqual(e,t):$X(e,t):xe.is(t)?$X(t,e):Xe.areEqual(e,t)}function rIe(e,t){return xe.is(e)?xe.is(t)?xe.areIntersecting(e,t):JX(t,e):xe.is(t)?JX(e,t):Xe.areIntersecting(e,t)}function nIe(e,t){return xe.is(e)?xe.is(t)?xe.isSubInterval(e,t):function dIe(e,t){var r=xe.min(e),n=xe.max(e);if(n-r+1==0)return!1;var a=Xe.min(t),i=Xe.max(t);return a>=r&&i<=n}(e,t):xe.is(t)?function fIe(e,t){var r=xe.min(t),n=xe.max(t);if(n-r+1==0)return!0;var a=Xe.min(e),i=Xe.max(e);if(ri)return!1;var o=Xe.findRange(e,r,n);return xe.size(o)===xe.size(t)}(e,t):Xe.isSubset(e,t)}function aIe(e,t){return xe.is(e)?xe.findPredecessorIndex(e,t):Xe.findPredecessorIndex(e,t)}function iIe(e,t,r){return xe.is(e)?xe.findPredecessorIndexInInterval(e,t,r):Xe.findPredecessorIndexInInterval(e,t,r)}function oIe(e,t,r){return xe.is(e)?xe.findRange(e,t,r):Xe.findRange(e,t,r)}function sIe(e,t){return xe.is(e)?xe.is(t)?xe.intersectionSize(e,t):tK(t,e):xe.is(t)?tK(e,t):Xe.intersectionSize(e,t)}function uIe(e,t){return xe.is(e)?xe.is(t)?function mIe(e,t){if(xe.areEqual(e,t))return e;var r=xe.size(e),n=xe.size(t);if(!n)return e;if(!r)return t;var o,s,u,c,a=xe.min(e),i=xe.min(t);if(function pIe(e,t){var r=Fv(e),n=Fv(t);return 0===r&&0===n||r>0&&n>0&&ky(e)>=Ry(t)&&Ry(e)<=ky(t)}(e,t))return xe.ofRange(Math.min(a,i),Math.max(xe.max(e),xe.max(t)));a=ky(t):0===Fv(t)}(t,e))return t;for(var n=xe.min(t),a=xe.max(t),i=Xe.findRange(e,n,a),o=xe.start(i),s=xe.end(i),u=new Int32Array(o+(e.length-s)+r),c=0,l=0;lp||(u++,l++),f++);if(0===u)return Hf;if(u===a&&u===i)return e;var h=new Int32Array(u);for(c=0,l=0,f=o;lp||(h[c++]=f,l++),f++)}return Wl(h)}function nK(e){for(var t=Xe.ofSortedArray(e),r=Xe.max(t),n=new Int32Array(r),a=0,i=e.length-1;a=Be.max(n)?-1:Be.findPredecessorIndex(n,r-1);return Be.findRange(t,Be.getAt(n,i),Be.getAt(n,i+1)-1)}!function(e){e.Empty=Hf,e.ofSingleton=W3e,e.ofRange=Y3e,e.ofBounds=X3e,e.ofSortedArray=Wl,e.has=K3e,e.indexOf=Z3e,e.getAt=wO,e.min=Ry,e.max=ky,e.start=Q3e,e.end=$3e,e.size=Fv,e.hashCode=J3e,e.areEqual=tIe,e.areIntersecting=rIe,e.isSubset=nIe,e.union=uIe,e.intersect=cIe,e.indexedIntersect=SIe,e.subtract=lIe,e.findPredecessorIndex=aIe,e.findPredecessorIndexInInterval=iIe,e.findRange=oIe,e.intersectionSize=sIe,e.forEach=function t(s,u,c){return function bIe(e,t,r){if(xe.is(e))for(var n=xe.min(e),a=n,i=xe.max(e);a<=i;a++)t(a,a-n,r);else for(a=0,i=e.length;a=this.segmentMin&&xe.size(this.setRange)>0;break}this.updateSegmentRange()}return this.value},e.prototype.updateValue=function(){var r=Be.findPredecessorIndexInInterval(this.set,this.segments[this.segmentMin+1],this.setRange);return this.value.start=xe.start(this.setRange),this.value.end=r,this.setRange=xe.ofBounds(r,xe.end(this.setRange)),r>this.value.start},e.prototype.updateSegmentRange=function(){var t=xe.min(this.setRange),r=xe.max(this.setRange);r=this.segmentMin)},e.prototype.setSegment=function(t){this.setRange=xe.ofBounds(t.start,t.end),this.updateSegmentRange()},e}();function DIe(e,t,r){var n=typeof r<"u"?xe.ofBounds(r.start,r.end):xe.ofBounds(0,Be.size(t));return new TIe(e.offsets,e.index,t,n)}!function(e){e.create=nK,e.ofOffsets=CIe,e.count=xIe,e.getSegment=wIe,e.projectValue=AIe,e.transientSegments=DIe}(tr||(tr={}));var Bc,IIe=function(){function e(t){this.head=t>0?0:-1,this.prev=new Int32Array(t),this.next=new Int32Array(t);for(var r=0;r=0&&(a[i]=o,n[t]=-1),o>=0&&(n[o]=i,a[t]=-1),t===this.head&&(this.head=i<0?o:i)},e.prototype.has=function(t){return this.prev[t]>=0||this.next[t]>=0||this.head===t},e}();!function(e){function r(){return new Map}e.Empty=new Map,e.keyArray=function t(o){return mT(o.keys())},e.Mutable=r,e.asImmutable=function n(o){return o},e.copy=function a(o){for(var s=r(),u=o.keys();;){var c=u.next(),f=c.value;if(c.done)break;s.set(f,o.get(f))}return s},e.addFrom=function i(o,s){for(var u=s.keys();;){var c=u.next(),f=c.value;if(c.done)break;o.set(f,s.get(f))}return o}}(Bc||(Bc={}));var yT,Du,PIe=function(){function e(t){this.xs=[],this.index=-1,this.length=0,this.hasNext=!1,this.length=t.length,this.hasNext=t.length>0,this.xs=t,this.index=-1,this.lastValue=t.length>0?t[0]:void 0}return e.prototype.move=function(){return++this.index,this.lastValue=this.xs[this.index],this.hasNext=this.index=t}return e.prototype.move=function(){return++this.value,this.hasNext=this.value1&&iK(e,s,r,n-1,a)}!function(e){e.Empty=new aK(0,-1),e.Array=function t(s){return new PIe(s)},e.Value=function r(s){return new MIe(s)},e.Range=function n(s,u){return new aK(s,u)},e.map=function a(s,u){return new RIe(s,u)},e.filter=function i(s,u){return new kIe(s,u)},e.forEach=function o(s,u,c){for(;s.hasNext;)if(u(s.move(),c))return c;return c}}(yT||(yT={})),function(e){e.areEqual=function t(f,d){if(f===d)return!0;if(f.vertexCount!==d.vertexCount||f.edgeCount!==d.edgeCount)return!1;for(var p=f.a,h=f.b,m=f.offset,v=d.a,g=d.b,y=d.offset,b=0,_=f.a.length;b<_;b++)if(p[b]!==v[b])return!1;for(b=0,_=f.b.length;b<_;b++)if(h[b]!==g[b])return!1;for(b=0,_=f.offset.length;b<_;b++)if(m[b]!==y[b])return!1;for(var C=0,x=Object.keys(f.edgeProps);Cp&&(h=p,m=d);var v=sc(h,m);return!this.included.has(v)&&(this.included.add(v),this.xs[this.xs.length]=h,this.ys[this.ys.length]=m,!0)},f.prototype.getGraph=function(){return s(this.vertexCount,this.xs,this.ys)},f.prototype.getEdgeBuiler=function(){return new a(this.vertexCount,this.xs,this.ys)},f}();function s(f,d,p){var h=new e.EdgeBuilder(f,d,p);return h.addAllEdges(),h.createGraph({})}e.UniqueEdgeBuilder=o,e.fromVertexPairs=s,e.induceByVertices=function u(f,d,p){for(var h=f.b,m=f.offset,v=f.vertexCount,g=f.edgeProps,y=new Int32Array(v),b=0,_=d.length;b<_;b++)y[d[b]]=b+1;var C=0;for(b=0;bb&&0!==y[h[x]]&&C++;var T=new Int32Array(d.length+1),w=new Int32Array(2*C),E=new Int32Array(2*C),I=new Int32Array(2*C),M=0,O=0;for(b=0;b0;){for(var x=_.pop(),A=v[x],T=y[x],w=y[x+1];T=0&&(_.push(C.head),v[C.head]=++g,C.remove(C.head))}return{componentCount:d,componentIndex:v}},e.areVertexSetsConnected=function l(f,d,p,h){if(Xe.areIntersecting(d,p))return!0;if(h<1)return!1;for(var m=new Set,v=0,g=d.length;v0?i[o[0]].rowCount:0,name:a,fieldNames:o,getField:function(s){return i[s]}}}e.empty=function t(a){return{rowCount:0,name:a,fieldNames:[],getField:function(i){}}},e.ofFields=r,e.ofTable=function n(a,i){for(var o={},s=0,u=i._columns;s1)return 0;if(0===m)return 1;var v=h.charCodeAt(0);return 46===v?1:63===v?2:0},areValuesEqual:function(p,h){return s[p]===s[h]},toStringArray:function(p){return p?Bo(u,c,p):s},toIntArray:function(p){return Bo(u,l,p)},toFloatArray:function(p){return Bo(u,f,p)}}}function i(s){var d,p,h,u=s.rowCount,c=s.valueKind,l=s.areValuesEqual,f=s.isDefined;switch(s.schema.valueType){case"float":case"int":d=function(v){return""+s.value(v)},p=s.value,h=s.value;break;case"str":d=s.value,p=function(v){var g=s.value(v);return jh(g,0,g.length)||0},h=function(v){var g=s.value(v);return np(g,0,g.length)||0};break;case"list":var m=s.schema.separator;d=function(v){return s.value(v).join(m)},p=function(v){return NaN},h=function(v){return NaN};break;default:throw new Error("unsupported valueType '".concat(s.schema.valueType,"'"))}return{__array:void 0,binaryEncoding:void 0,isDefined:f,rowCount:u,str:d,int:p,float:h,valueKind:c,areValuesEqual:l,toStringArray:function(v){return Bo(u,d,v)},toIntArray:function(v){return Bo(u,p,v)},toFloatArray:function(v){return Bo(u,h,v)}}}e.ofString=function t(s){return r([s])},e.ofStrings=r,e.ofNumbers=function n(s){var u=s.length,c=function(p){return""+s[p]},l=function(p){return s[p]},d=function(p){return!p||p.array&&s instanceof p.array?s:Bo(u,l,p)};return{__array:void 0,binaryEncoding:void 0,isDefined:!0,rowCount:u,str:c,int:l,float:l,valueKind:function(p){return 0},areValuesEqual:function(p,h){return s[p]===s[h]},toStringArray:function(p){return Bo(u,c,p)},toIntArray:d,toFloatArray:d}},e.ofTokens=function a(s){var u=s.data,c=s.indices,l=s.count,f=function(m){var v=u.substring(c[2*m],c[2*m+1]);return"."===v||"?"===v?"":v},d=function(m){return jh(u,c[2*m],c[2*m+1])||0},p=function(m){return np(u,c[2*m],c[2*m+1])||0};return{__array:void 0,binaryEncoding:void 0,isDefined:!0,rowCount:l,str:f,int:d,float:p,valueKind:function(m){var v=c[2*m],g=c[2*m+1]-v;if(g>1)return 0;if(0===g)return 1;var y=u.charCodeAt(v);return 46===y?1:63===y?2:0},areValuesEqual:oK(s),toStringArray:function(m){return Bo(l,f,m)},toIntArray:function(m){return Bo(l,d,m)},toFloatArray:function(m){return Bo(l,p,m)}}},e.ofColumn=i,e.ofUndefined=function o(s,u){return i(ie.Undefined(s,u))}}(ht||(ht={})),function(e){function t(a){return a.replace(".","_").replace(/\[/,"_").replace(/(\[|\])/g,"")}e.canonical=t,e.equal=function r(a,i){return t(a)===t(i)},e.create=function n(a,i,o){void 0===o&&(o=!1);var s="".concat(a).concat(i?".".concat(i):"");return o?t(s):s}}(Oy||(Oy={}));var ua,cK=function(){return function e(t,r,n){this._isDefined=n;var a=Object.keys(r);this._rowCount=t.rowCount,this._columns=a,this._schema=r;for(var i=Object.create(null),o=function(f){Object.defineProperty(s,f,{get:function(){if(i[f])return i[f];var d=r[f];if("list"===d.valueType)i[f]=function jIe(e,t,r){var n=e.separator,a=e.itemParse,i=t.getField(r),o=i?function(u){return i.str(u).split(n).map(function(c){return a(c.trim())}).filter(function(c){return!!c})}:function(u){return[]};return{schema:e,__array:void 0,isDefined:!!i,rowCount:t.rowCount,value:o,valueKind:i?i.valueKind:function(){return 1},areValuesEqual:function(u,c){return $s(o(u),o(c))},toArray:function(u){return Bo(t.rowCount,o,u)}}}(d,t,f);else if("tensor"===d.valueType)i[f]=function qIe(e,t,r){var n=e.space,a=t.fieldNames.includes("".concat(r,"[0]"))||t.fieldNames.includes("".concat(r,"[0][0]"))||t.fieldNames.includes("".concat(r,"[0][0][0]")),i=a?0:1,o=t.fieldNames.includes("".concat(r,"_1"))||t.fieldNames.includes("".concat(r,"_11"))||t.fieldNames.includes("".concat(r,"_111"))?"underscore":"brackets",s=function LIe(e,t,r,n){var a=r?0:1;switch(t){case 1:return"brackets"===n?function(i){return"".concat(e,"[").concat(i+a,"]")}:function(i){return"".concat(e,"_").concat(i+a)};case 2:return"brackets"===n?function(i,o){return"".concat(e,"[").concat(i+a,"][").concat(o+a,"]")}:function(i,o){return"".concat(e,"_").concat(i+a).concat(o+a)};case 3:return"brackets"===n?function(i,o,s){return"".concat(e,"[").concat(i+a,"][").concat(o+a,"][").concat(s+a,"]")}:function(i,o,s){return"".concat(e,"_").concat(i+a).concat(o+a).concat(s+a)};default:throw new Error("Tensors with rank > 3 or rank 0 are currently not supported.")}}(r,n.rank,a,o),u=t.getField(s(i,i,i))||ie.Undefined(t.rowCount,e),c=function(f){return function UIe(e,t,r,n){var a=t.create();if(1===t.rank)for(var i=t.dimensions[0],o=0;o 3 or rank 0 are currently not supported.");var l=t.dimensions[0],f=t.dimensions[1],d=t.dimensions[2];for(o=0;o(t=Math.abs(t))?(t/=e,e*Math.sqrt(1+t*t)):t>0?(e/=t,t*Math.sqrt(1+e*e)):0}!function(e){function r(n,a,i){var o=function uPe(e){var t="number"==typeof e?function iPe(e){switch(e){case 1146:return 146;case 1148:return 149;case 1155:return 157;case 1160:return 163;case 1161:return 165;case 1166:return 171;case 1167:return 173;case 1003:return 237;case 1004:return 238;case 1005:return 239;case 2005:return 240;case 3005:return 241;case 4005:return 242;case 5005:return 243;case 1006:return 244;case 1007:return 245;case 1008:return 246;case 1009:return 247;case 1010:return 248;case 1011:return 249;case 1012:return 250;case 1013:return 251;case 1014:return 252;case 2014:return 253;case 3014:return 254;case 1015:return 255;case 1017:return 256;case 2017:return 257;case 1018:return 258;case 2018:return 259;case 3018:return 260;case 1020:return 261;case 1021:return 262;case 1022:return 263;case 1023:return 264;case 1059:return 265;case 1094:return 266;case 1197:return 267}var t=0;return e>146&&++t,e>148&&++t,e>155&&++t,e>160&&++t,e>161&&++t,e>166&&++t,e>167&&++t,e-1+t}(e):N_[e];return typeof t>"u"||typeof lK[t]>"u"?-1:t}(n);if(o<0)return console.warn("Unknown spacegroup '".concat(n,"', returning a 'P 1' with cellsize [1, 1, 1]")),e.Zero;var s=a[0]*a[1]*a[2],u=i[0],c=i[1],l=i[2],f=a[0],d=a[1],p=a[2],h=Math.cos(c),m=(Math.cos(u)-Math.cos(c)*Math.cos(l))/Math.sin(l),v=Math.sqrt(1-h*h-m*m),g=[f,0,0],y=[Math.cos(l)*d,Math.sin(l)*d,0],b=[h*p,m*p,v*p],_=me.ofRows([[g[0],y[0],b[0],0],[0,y[1],b[1],0],[0,0,b[2],0],[0,0,0,1]]);return{index:o,size:a,volume:s,anglesInRadians:i,toFractional:me.invert(me.zero(),_),fromFractional:_}}e.Zero=r("P 1",S.create(1,1,1),S.create(Math.PI/2,Math.PI/2,Math.PI/2)),e.isZero=function t(n){return!n||0===n.index&&1===n.size[0]&&1===n.size[1]&&1===n.size[1]},e.create=r}(Cs||(Cs={})),function(e){function t(v){var g=aPe[v.index].map(function(_){return function f(v){return me.ofRows([EO[v[0]],EO[v[1]],EO[v[2]],[0,0,0,1]])}(nPe[_])});return{name:lK[v.index],num:sPe[v.index],cell:v,operators:g}}e.ZeroP1=t(Cs.Zero),e.create=t;var r=S(),n=me();function a(v,g,y,b,_,C){return S.set(r,y,b,_),me.fromTranslation(n,r),me.mul(C,me.mul(C,me.mul(C,v.cell.fromFractional,n),v.operators[g]),v.cell.toFractional)}e.setOperatorMatrix=a,e.getSymmetryOperator=function i(v,g,y,b,_){var C=a(v,g,y,b,_,me.zero());return ua.create("".concat(g+1,"_").concat(5+y).concat(5+b).concat(5+_),C,{hkl:S.create(y,b,_),spgrOp:g})};var o=S(),s=S(),u=S(),c=S();function p(v,g,y){var b=[];if(v>0?b.push("+X"):v<0&&b.push("-X"),g>0?b.push("+Y"):g<0&&b.push("-Y"),y>0?b.push("+Z"):y<0&&b.push("-Z"),1===b.length)return"+"===b[0].charAt(0)?b[0].substr(1):b[0];if(2===b.length){var _=b[0].charAt(0),C=b[1].charAt(0);if("+"===_)return"".concat(b[0].substr(1)).concat(b[1]);if("+"===C)return"".concat(b[1].substr(1)).concat(b[0])}throw new Error("unknown rotation '".concat(b,"', ").concat(v," ").concat(g," ").concat(y))}function h(v){switch(v){case.5:return"1/2";case 1/4:return"1/4";case 3/4:return"3/4";case 1/3:return"1/3";case 2/3:return"2/3";case 1/6:return"1/6";case 5/6:return"5/6"}return""}function m(v,g){return""===g?v:v.length>2?"".concat(v,"+").concat(g):"-"===v.charAt(0)?"".concat(g).concat(v):"".concat(g,"+").concat(v)}e.getSymmetryOperatorRef=function l(v,g,y,b,_,C){var x=me.zero();S.set(r,y,b,_),S.floor(o,C),me.copy(x,v.operators[g]),S.floor(s,S.transformMat4(s,C,x)),me.getTranslation(c,x),S.sub(c,c,s),S.add(c,c,o),S.add(c,c,r),me.setTranslation(x,c),me.mul(x,v.cell.fromFractional,x),me.mul(x,x,v.cell.toFractional),S.sub(u,s,o);var A=y-u[0],T=b-u[1],w=_-u[2];return ua.create("".concat(g+1,"_").concat(5+A).concat(5+T).concat(5+w),x,{hkl:S.create(A,T,w),spgrOp:g})},e.getOperatorXyz=function d(v){return[m(p(v[0],v[4],v[8]),h(v[12])),m(p(v[1],v[5],v[9]),h(v[13])),m(p(v[2],v[6],v[10]),h(v[14]))].join(",")}}(Eu||(Eu={})),function(e){e.add=function t(i,o,s){i.squaredDistances[i.count]=s,i.indices[i.count++]=o},e.reset=function r(i){i.count=0},e.create=function n(){return{count:0,indices:[],squaredDistances:[]}},e.copy=function a(i,o){for(var s=0;s>16?G:-G;for(p=0;p<2;p++)for(f=0;f0?C>u&&(u=C):C>c&&(c=C),S.projectPointOnVector(h,S.fromArray(h,o,y),g.dirB,v);var x=S.dot(g.dirB,S.normalize(m,S.sub(m,h,v))),A=S.distance(h,v);x>0?A>l&&(l=A):A>f&&(f=A),S.projectPointOnVector(h,S.fromArray(h,o,y),g.dirC,v);var T=S.dot(g.dirC,S.normalize(m,S.sub(m,h,v))),w=S.distance(h,v);T>0?w>d&&(d=w):w>p&&(p=w)}var E=S.setMagnitude(S(),g.dirA,(u+c)/2),I=S.setMagnitude(S(),g.dirB,(l+f)/2),M=S.setMagnitude(S(),g.dirC,(d+p)/2),O=S.isFinite(E),F=S.isFinite(I),j=S.isFinite(M),N=S(),H=function(G,U,Q){S.copy(a,v),O&&S.scaleAndAdd(a,a,g.dirA,G),F&&S.scaleAndAdd(a,a,g.dirB,U),j&&S.scaleAndAdd(a,a,g.dirC,Q),S.add(N,N,a)};return H(u,l,d),H(u,l,-p),H(u,-f,-p),H(u,-f,d),H(-c,-f,-p),H(-c,-f,d),H(-c,l,d),H(-c,l,-p),S.scale(N,N,1/8),Uo.create(N,E,I,M)}e.calculateBoxAxes=i}(Xl||(Xl={})),function(e){function t(M){return void 0!==M.extrema}function r(M,O){return{center:M,radius:O}}function s(M,O){var F;return void 0!==M.extrema?(M.extrema.length=0,(F=M.extrema).push.apply(F,O)):M.extrema=O,M}e.hasExtrema=t,e.create=r,e.zero=function n(){return{center:S(),radius:0}},e.clone=function a(M){var O=r(S.clone(M.center),M.radius);return t(M)&&(O.extrema=M.extrema.map(function(F){return S.clone(F)})),O},e.set=function i(M,O,F){return S.copy(M.center,O),M.radius=F,M},e.copy=function o(M,O){return S.copy(M.center,O.center),M.radius=O.radius,t(O)&&s(M,O.extrema.map(function(F){return S.clone(F)})),M},e.setExtrema=s,e.computeBounding=function u(M){for(var O=M.x,F=M.y,j=M.z,N=M.indices,H=0,G=0,U=0,Q=0,W=Be.size(N),K=0;K0&&(H/=W,G/=W,U/=W),K=0;KQ&&(Q=$)}return{center:S.create(H,G,U),radius:Math.sqrt(Q)}},e.transform=function c(M,O,F){return S.transformMat4(M.center,O.center,F),M.radius=O.radius*me.getMaxScaleOnAxis(F),t(O)&&s(M,O.extrema.map(function(j){return S.transformMat4(S(),j,F)})),M},e.translate=function l(M,O,F){return S.add(M.center,O.center,F),t(O)&&s(M,O.extrema.map(function(j){return S.add(S(),j,F)})),M},e.toArray=function f(M,O,F){return S.toArray(M.center,O,F),O[F+3]=M.radius,O},e.fromArray=function d(M,O,F){return S.fromArray(M.center,O,F),M.radius=O[F+3],M},e.fromBox3D=function p(M,O){return S.scale(M.center,S.add(M.center,O.max,O.min),.5),M.radius=S.distance(M.center,O.max),e.setExtrema(M,[S.create(O.min[0],O.min[1],O.min[2]),S.create(O.max[0],O.max[1],O.max[2]),S.create(O.max[0],O.min[1],O.min[2]),S.create(O.min[0],O.max[1],O.max[2]),S.create(O.min[0],O.min[1],O.max[2]),S.create(O.max[0],O.min[1],O.max[2]),S.create(O.max[0],O.max[1],O.min[2]),S.create(O.min[0],O.max[1],O.min[2])]),M},e.fromAxes3D=function h(M,O){return S.copy(M.center,O.origin),M.radius=Math.max(S.magnitude(O.dirA),S.magnitude(O.dirB),S.magnitude(O.dirC)),M};var m=S();e.fromDimensionsAndTransform=function v(M,O,F){var j=O[0],N=O[1],H=O[2],G=S.create(0,0,0);S.transformMat4(G,G,F);var U=S.create(j,N,H);S.transformMat4(U,U,F);var Q=S.create(j,0,0);S.transformMat4(Q,Q,F);var W=S.create(0,N,H);S.transformMat4(W,W,F);var K=S.create(0,0,H);S.transformMat4(K,K,F);var ne=S.create(j,0,H);S.transformMat4(ne,ne,F);var X=S.create(j,N,0);S.transformMat4(X,X,F);var L=S.create(0,N,0);S.transformMat4(L,L,F),S.add(m,G,U),S.scale(m,m,.5);var Y=Math.max(S.distance(G,U),S.distance(Q,W));return e.set(M,m,Y/2),e.setExtrema(M,[G,U,Q,W,K,ne,X,L]),M};var g=S();e.addVec3=function y(M,O,F){return S.distance(O.center,F)M.radius&&(O.extrema.length>=14&&S.normalize(_,S.sub(_,W,O.center)),S.scaleAndAdd(W,M.center,_,M.radius)),W}))}return M},e.exactEquals=function x(M,O){return M.radius===O.radius&&S.exactEquals(M.center,O.center)},e.equals=function A(M,O){var F=M.radius,j=O.radius;return Math.abs(F-j)<=gn*Math.max(1,Math.abs(F),Math.abs(j))&&S.equals(M.center,O.center)},e.includes=function T(M,O){if(t(O)){for(var F=0,j=O.extrema;FM.radius)return!1;return!0}return S.distance(M.center,O.center)+O.radius<=M.radius},e.overlaps=function w(M,O){return S.distance(M.center,O.center)<=M.radius+O.radius},e.distance=function E(M,O){return S.distance(M.center,O.center)-M.radius+O.radius},e.distanceToVec=function I(M,O){var j=M.radius;return S.distance(O,M.center)-j}}(De||(De={})),function(e){function r(){return{min:S(),max:S()}}function n(w,E){return S.copy(w.min,E.min),S.copy(w.max,E.max),w}e.create=function t(w,E){return{min:w,max:E}},e.zero=r,e.copy=n,e.clone=function a(w){return n(r(),w)};var i=S();function s(w,E){for(var I=0,M=E.length;I=14?u(w,E.extrema):(S.set(i,E.radius,E.radius,E.radius),S.sub(w.min,E.center,i),S.add(w.max,E.center,i),w)},e.addVec3Array=s,e.fromVec3Array=u,e.addSphere3D=function c(w,E){return De.hasExtrema(E)&&E.extrema.length>=14?s(w,E.extrema):(v(w,S.subScalar(i,E.center,E.radius)),v(w,S.addScalar(i,E.center,E.radius)),w)},e.intersectsSphere3D=function l(w,E){return S.clamp(i,E.center,w.min,w.max),S.squaredDistance(i,E.center)<=E.radius*E.radius},e.computeBounding=function f(w){for(var E=S.create(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),I=S.create(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),M=w.x,O=w.y,F=w.z,j=w.indices,N=0,H=Be.size(j);Nw.max[0]||E[1]w.max[1]||E[2]w.max[2])},e.overlaps=function x(w,E){return!(w.max[0]E.max[0]||w.max[1]E.max[1]||w.max[2]E.max[2])},e.containsSphere3D=function A(w,E){var I=E.center,M=E.radius;return!(I[0]-Mw.max[0]||I[1]-Mw.max[1]||I[2]-Mw.max[2])},e.nearestIntersectionWithRay=function T(w,E,I,M){var $,Z,q,z,te,ae,O=E.min,F=O[0],j=O[1],N=O[2],H=E.max,G=H[0],U=H[1],Q=H[2],W=I[0],K=I[1],ne=I[2],X=1/M[0],L=1/M[1],Y=1/M[2];return X>=0?($=(F-W)*X,Z=(G-W)*X):($=(G-W)*X,Z=(F-W)*X),L>=0?(q=(j-K)*L,z=(U-K)*L):(q=(U-K)*L,z=(j-K)*L),Y>=0?(te=(N-ne)*Y,ae=(Q-ne)*Y):(te=(Q-ne)*Y,ae=(N-ne)*Y),q>$&&($=q),z$&&($=te),ae0)throw new Error("New key is larger than old key");t.key=r;var n=t.parent;n&&this._compare(t,n)<0&&(this._cut(t,n,this._minNode),this._cascadingCut(n,this._minNode)),this._compare(t,this._minNode)<0&&(this._minNode=t)},e.prototype.delete=function(t){var r=t.parent;r&&(this._cut(t,r,this._minNode),this._cascadingCut(r,this._minNode)),this._minNode=t,this.extractMinimum()},e.prototype.extractMinimum=function(){var t=this._minNode;if(t){if(t.child){var r=t.child;do{r.parent=null,r=r.next}while(r!==t.child)}var n=null;t.next!==t&&(n=t.next),this._removeNodeFromList(t),this._nodeCount--,this._minNode=this._mergeLists(n,t.child),this._minNode&&(this._minNode=this._consolidate(this._minNode))}return t},e.prototype.findMinimum=function(){return this._minNode},e.prototype.insert=function(t,r){var n=new hPe(t,r);return this._minNode=this._mergeLists(this._minNode,n),this._nodeCount++,n},e.prototype.isEmpty=function(){return null===this._minNode},e.prototype.size=function(){return null===this._minNode?0:this._getNodeListSize(this._minNode)},e.prototype.union=function(t){this._minNode=this._mergeLists(this._minNode,t._minNode),this._nodeCount+=t._nodeCount},e.prototype._defaultCompare=function(t,r){return t.key>r.key?1:t.key0){var i=n;n=a,a=i}this._linkHeaps(a,n),r[n.degree]=null,n.degree++,a=r[n.degree]}r[n.degree]=n}for(var o=null,s=0;s0){var f=Math.ceil(u/c),d=Math.pow(f/(i[0]*i[1]*i[2]),1/3);s=[Math.ceil(i[0]*d),Math.ceil(i[1]*d),Math.ceil(i[2]*d)],o=[i[0]/s[0],i[1]/s[1],i[2]/s[2]]}else o=i,s=[1,1,1];return function gPe(e){for(var r=e.size,a=r[1],i=r[2],o=e.data,s=o.x,u=o.y,c=o.z,l=o.radius,f=o.indices,d=e.elementCount,p=e.delta,h=r[0]*a*i,m=e.expandedBox.min,v=m[0],g=m[1],y=m[2],b=0,_=0,C=new Uint32Array(h),x=new Int32Array(d),A=0;Ab&&(b=l[T]);for(var O=new Int32Array(_),F=(T=0,0);T0&&(C[T]=F+1,O[F]=j,F+=1)}var N=new Uint32Array(_);for(T=1;T<_;++T)N[T]+=N[T-1]+O[T-1];var H=new Int32Array(_),G=new Int32Array(d);for(T=0;T0){var Q=U-1;G[N[Q]+H[Q]]=T,H[Q]+=1}}return{size:e.size,bucketArray:G,bucketCounts:O,bucketOffset:N,grid:C,delta:p,min:e.expandedBox.min,data:e.data,maxRadius:b,expandedBox:e.expandedBox,boundingBox:e.boundingBox,boundingSphere:e.boundingSphere}}({size:s,data:{x:e.x,y:e.y,z:e.z,indices:a,radius:e.radius},expandedBox:n,boundingBox:t.box,boundingSphere:t.sphere,elementCount:u,delta:o})}(t,r,n);this.ctx=function bPe(e){return{grid:e,x:.1,y:.1,z:.1,k:1,stopIf:void 0,radius:.1,isCheck:!1}}(a),this.boundary={box:a.boundingBox,sphere:a.boundingSphere},this.buckets={offset:a.bucketOffset,count:a.bucketCounts,array:a.bucketArray},this.result=Lc.create()}return e.prototype.find=function(t,r,n,a,i){this.ctx.x=t,this.ctx.y=r,this.ctx.z=n,this.ctx.radius=a,this.ctx.isCheck=!1;var o=i??this.result;return dK(this.ctx,o),o},e.prototype.nearest=function(t,r,n,a,i,o){void 0===a&&(a=1),this.ctx.x=t,this.ctx.y=r,this.ctx.z=n,this.ctx.k=a,this.ctx.stopIf=i;var s=o??this.result;return function xPe(e,t){var r=e.grid,n=r.min,a=r.expandedBox,i=r.boundingSphere.center,o=r.size,s=o[0],u=o[1],c=o[2],l=r.bucketOffset,f=r.bucketCounts,d=r.bucketArray,p=r.grid,h=r.data,m=h.x,v=h.y,g=h.z,y=h.indices,b=h.radius,_=r.delta,C=r.maxRadius,x=e.x,A=e.y,T=e.z,w=e.k,E=e.stopIf,I=Be.size(y);if(Lc.reset(t),0===I||w<=0)return!1;var M,O,F,ne,j=!1,N=1,H=!0,G=0,U=_Pe,Q=SPe,W=0,K=!0,X=!1,L=CPe,Y=C*C;U.length=0,L.length=0,B_.clear(),Ny.clear(),S.set(Wh,x,A,T),Nt.containsVec3(a,Wh)?(M=Math.floor((x-n[0])/_[0]),O=Math.floor((A-n[1])/_[1]),F=Math.floor((T-n[2])/_[2])):(Nt.nearestIntersectionWithRay(Wh,a,Wh,S.normalize(pK,S.sub(pK,i,Wh))),M=Math.max(0,Math.min(s-1,Math.floor((Wh[0]-n[0])/_[0]))),O=Math.max(0,Math.min(u-1,Math.floor((Wh[1]-n[1])/_[1]))),F=Math.max(0,Math.min(c-1,Math.floor((Wh[2]-n[2])/_[2]))));var $=0!==C?Math.max(1,Math.min(s-1,Math.ceil(C/_[0]))):1,Z=0!==C?Math.max(1,Math.min(u-1,Math.ceil(C/_[1]))):1,q=0!==C?Math.max(1,Math.min(c-1,Math.ceil(C/_[2]))):1;for(U.push(M,O,F,(M*u+O)*c+F);t.count=p.length;var ae=p[ne];if(0!==ae){for(var de=W,he=ae-1,pe=l[he],ee=pe+f[he],ue=pe;ueW&&(W=J),Ny.insert(J,ge)}de=s))for(var Oe=-Z;Oe<=Z;Oe++){var Ne=O+Oe;if(!(Ne<0||Ne>=u))for(var Ue=-q;Ue<=q;Ue++){var $e=F+Ue;if(!($e<0||$e>=c||(ne=(Ee*u+Ne)*c+$e,MO.has(ne)||(MO.add(ne),B_.has(ne))))){if(!H){var Pe=n[0]+Ee*_[0]-x,He=n[1]+Ne*_[1]-A,Je=n[2]+$e*_[2]-T;if(Pe*Pe+He*He+Je*Je-Y>W){L.push(Ee,Ne,$e,ne);continue}}Q.push(Ee,Ne,$e,ne),G++}}}}}if(H=!1,0===G){if(1===w){if(ut=Ny.findMinimum())return Lc.add(t,Le=ut.value,At=ut.key),!0}else for(;!Ny.isEmpty()&&(X||Ny.findMinimum().key<=W)&&t.count=w||j||t.count>=I)return t.count>0;if(H=!0,K=!0,L.length>0){ue=0;for(var st=L.length;ueF||M>j||O>N)return!1;for(var H=I;H<=F;H++)for(var G=M;G<=j;G++)for(var U=O;U<=N;U++){var Q=f[(H*o+G)*s+U];if(0!==Q)for(var W=Q-1,K=u[W],X=K+c[W],L=K;L0&&Math.sqrt(z)-g[Y]>_)continue;if(C)return!0;Lc.add(t,l[L],z)}}}return t.count>0}var at,pK=S(),Wh=S(),B_=new Set,MO=new Set,_Pe=[.1],SPe=[.1],CPe=[.1],Ny=new fK;!function(e){function t(p,h,m){return{kind:"element-location",structure:p,unit:h,element:m||0}}e.create=t,e.clone=function r(p){return t(p.structure,p.unit,p.element)},e.set=function n(p,h,m,v){return h&&(p.structure=h),m&&(p.unit=m),void 0!==v&&(p.element=v),p},e.copy=function a(p,h){return p.unit=h.unit,p.element=h.element,p},e.is=function i(p){return!!p&&"element-location"===p.kind},e.areEqual=function o(p,h){return p.unit===h.unit&&p.element===h.element};var s=S(),u=S();e.distance=function c(p,h){return p.unit.conformation.position(p.element,s),h.unit.conformation.position(h.element,u),S.distance(s,u)},e.position=function l(p,h){return h.unit.conformation.position(h.element,p)},e.residueIndex=function f(p){return p.unit.model.atomicHierarchy.residueAtomSegments.index[p.element]},e.chainIndex=function d(p){return p.unit.model.atomicHierarchy.chainAtomSegments.index[p.element]}}(at||(at={}));var wPe=function(){function e(t,r){this.getHash=t,this.areEqual=r,this.size=0,this.byHash=new Map}return e.prototype.add=function(t){var r=this.getHash(t);if(this.byHash.has(r)){for(var n=this.byHash.get(r),a=0,i=n.length;a= 2nd and <= 3rd.")},math:{"@header":"Math",add:Yh(Ae.Num),sub:Yh(Ae.Num),mult:Yh(Ae.Num),div:Uc(Ae.Num,Ae.Num),pow:Uc(Ae.Num,Ae.Num),mod:Uc(Ae.Num,Ae.Num),min:Yh(Ae.Num),max:Yh(Ae.Num),cantorPairing:Uc(Ae.Num,Ae.Num),sortedCantorPairing:Uc(Ae.Num,Ae.Num),invertCantorPairing:Kt(Gt.Dictionary({0:pt(Ae.Num)}),Gr.List(Ae.Num)),floor:qi(Ae.Num),ceil:qi(Ae.Num),roundInt:qi(Ae.Num),trunc:qi(Ae.Num),abs:qi(Ae.Num),sign:qi(Ae.Num),sqrt:qi(Ae.Num),cbrt:qi(Ae.Num),sin:qi(Ae.Num),cos:qi(Ae.Num),tan:qi(Ae.Num),asin:qi(Ae.Num),acos:qi(Ae.Num),atan:qi(Ae.Num),sinh:qi(Ae.Num),cosh:qi(Ae.Num),tanh:qi(Ae.Num),exp:qi(Ae.Num),log:qi(Ae.Num),log10:qi(Ae.Num),atan2:Uc(Ae.Num,Ae.Num)},str:{"@header":"Strings",concat:Yh(Ae.Str),match:Kt(Gt.Dictionary({0:pt(Gr.Regex),1:pt(Ae.Str)}),Ae.Bool)},list:{"@header":"Lists",getAt:Kt(Gt.Dictionary({0:pt(Gr.List()),1:pt(Ae.Num)}),Gr.AnyVar),equal:Kt(Gt.Dictionary({0:pt(Gr.List()),1:pt(Gr.List())}),Ae.Bool)},set:{"@header":"Sets",has:Kt(Gt.Dictionary({0:pt(Gr.Set(Gr.ConstrainedVar)),1:pt(Gr.ConstrainedVar)}),Ae.Bool,"Check if the the 1st argument includes the value of the 2nd."),isSubset:Kt(Gt.Dictionary({0:pt(Gr.Set(Gr.ConstrainedVar)),1:pt(Gr.Set(Gr.ConstrainedVar))}),Ae.Bool,"Check if the the 1st argument is a subset of the 2nd.")},flags:{"@header":"Flags",hasAny:Kt(Gt.Dictionary({0:pt(Gr.Flags(Gr.ConstrainedVar)),1:pt(Gr.Flags(Gr.ConstrainedVar))}),Ae.Bool,"Check if the the 1st argument has at least one of the 2nd one's flags."),hasAll:Kt(Gt.Dictionary({0:pt(Gr.Flags(Gr.ConstrainedVar)),1:pt(Gr.Flags(Gr.ConstrainedVar))}),Ae.Bool,"Check if the the 1st argument has all 2nd one's flags.")}};vK(OO);var Dt,FPe=gK(OO);function Br(e,t){return Kt(Gt.Dictionary({0:pt(Dt.ElementReference,{isOptional:!0,defaultValue:"slot.current-atom"})}),e,t)}function By(e,t){return Kt(Gt.None,e,t)}!function(){for(var e=Object.create(null),t=0,r=FPe;t_?M*M*M:C*(M-b)}function w(M){return(M/=255)<=.04045?M/12.92:Math.pow((M+.055)/1.055,2.4)}function E(M){return M>x?Math.pow(M,1/3):M/C+b}}(Wi||(Wi={})),function(e){function t(){var y=[.1,0,0];return y[0]=0,y}e.zero=t,e.create=function r(y,b,_){var C=t();return C[0]=y,C[1]=b,C[2]=_,C},e.set=function n(y,b,_,C){return y[0]=b,y[1]=_,y[2]=C,y},e.hasHue=function a(y){return!isNaN(y[0])};var i=[0,0,0];e.fromColor=function o(y,b){return Wi.toHcl(y,Wi.fromColor(i,b))},e.fromLab=function s(y,b){return Wi.toHcl(y,b)};var u=[0,0,0];function l(y,b){var _=b[0],C=b[1],x=b[2];return isNaN(_)&&(_=0),_=Zr(_),y[0]=x,y[1]=Math.cos(_)*C,y[2]=Math.sin(_)*C,y}function d(y,b,_){return y[0]=b[0],y[1]=Math.max(0,b[1]+g*_),y[2]=b[2],y}e.toColor=function c(y){return Wi.toColor(l(u,y))},e.toLab=l,e.copy=function f(y,b){return y[0]=b[0],y[1]=b[1],y[2]=b[2],y},e.saturate=d,e.desaturate=function p(y,b,_){return d(y,b,-_)};var h=[0,0,0];function m(y,b,_){return l(h,b),Wi.toHcl(y,Wi.darken(h,h,_))}e.darken=m,e.lighten=function v(y,b,_){return m(y,b,-_)};var g=18}(Kl||(Kl={})),function(e){function c(N,H,G){return N<<16|H<<8|G}function l(N,H,G){return 255*N<<16|255*H<<8|255*G}function y(N){var H=N>>16&255;return H!==(N>>8&255)||H!==(255&N)}e.toStyle=function t(N){return"rgb(".concat(N>>16&255,", ").concat(N>>8&255,", ").concat(255&N,")")},e.toHexStyle=function r(N){return"#"+("000000"+N.toString(16)).slice(-6)},e.toHexString=function n(N){return"0x"+("000000"+N.toString(16)).slice(-6)},e.toRgbString=function a(N){return"RGB: ".concat(e.toRgb(N).join(", "))},e.toRgb=function i(N){return[N>>16&255,N>>8&255,255&N]},e.toRgbNormalized=function o(N){return[(N>>16&255)/255,(N>>8&255)/255,(255&N)/255]},e.fromHexStyle=function s(N){return parseInt(N.replace("#","0x"))},e.fromHexString=function u(N){return parseInt(N)},e.fromRgb=c,e.fromNormalizedRgb=l,e.fromArray=function f(N,H){return c(N[H],N[H+1],N[H+2])},e.fromNormalizedArray=function d(N,H){return l(N[H],N[H+1],N[H+2])},e.toArray=function p(N,H,G){return H[G]=N>>16&255,H[G+1]=N>>8&255,H[G+2]=255&N,H},e.toArrayNormalized=function h(N,H,G){return H[G]=(N>>16&255)/255,H[G+1]=(N>>8&255)/255,H[G+2]=(255&N)/255,H},e.toVec3=function m(N,H){return N[0]=H>>16&255,N[1]=H>>8&255,N[2]=255&H,N},e.toVec3Normalized=function v(N,H){return N[0]=(H>>16&255)/255,N[1]=(H>>8&255)/255,N[2]=(255&H)/255,N},e.interpolate=function g(N,H,G){var U=N>>16&255,Q=N>>8&255,W=255&N;return U+((H>>16&255)-U)*G<<16|Q+((H>>8&255)-Q)*G<<8|W+((255&H)-W)*G},e.hasHue=y;var b=[0,0,0];function _(N,H){return y(N)?(Kl.fromColor(b,N),Kl.toColor(Kl.saturate(b,b,H))):N}e.saturate=_,e.desaturate=function C(N,H){return _(N,-H)};var x=[0,0,0];function A(N,H){return Wi.fromColor(x,N),Wi.toColor(Wi.darken(x,x,H))}function w(N){return N<=.03928?N/12.92:Math.pow((N+.055)/1.055,2.4)}function E(N){return.2126*w((N>>16&255)/255)+.7152*w((N>>8&255)/255)+.0722*w((255&N)/255)}function M(N){return N<.04045?.0773993808*N:Math.pow(.9478672986*N+.0521327014,2.4)}function F(N){return N<.0031308?12.92*N:1.055*Math.pow(N,.41666)-.055}e.darken=A,e.lighten=function T(N,H){return A(N,-H)},e.luminance=E,e.contrast=function I(N,H){var G=E(N),U=E(H);return G>U?(G+.05)/(U+.05):(U+.05)/(G+.05)},e.sRGBToLinear=function O(N){return l(M((N>>16&255)/255),M((N>>8&255)/255),M((255&N)/255))},e.linearToSRGB=function j(N){return l(F((N>>16&255)/255),F((N>>8&255)/255),F((255&N)/255))}}(ft||(ft={}));var QPe=function(e){return e.toUpperCase()};function Nv(e){return e.toLowerCase().replace(/^\w|\s\w/g,QPe)}function Vc(e){return Nv(SK(function CK(e){return e.replace(/_/g," ")}(function xK(e){return e.replace(/-/g," ")}(e))))}function ti(e,t,r,n){var a=n.length;if(a>r-t)return!1;for(var i=0;i]+>/g,"")}function U_(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var Iu={"orange-red":Hr("Orange-Red","sequential","Orange-Red, sequential color scheme from ColorBrewer 2.0",[16775148,16705736,16635038,16628612,16551257,15689032,14102559,11730944,8323072]),"purple-blue":Hr("Purple-Blue","sequential","Purple-Blue, sequential color scheme from ColorBrewer 2.0",[16775163,15525874,13685222,10927579,7645647,3576e3,356528,285325,145496]),"blue-purple":Hr("Blue-Purple","sequential","Blue-Purple, sequential color scheme from ColorBrewer 2.0",[16252157,14740724,12571622,10403034,9213638,9202609,8929693,8458108,5046347]),oranges:Hr("Oranges","sequential","",[16774635,16705230,16634018,16625259,16616764,15821075,14239745,10892803,8333060]),"blue-green":Hr("Blue-Green","sequential","",[16252157,15070713,13429990,10082505,6734500,4304502,2329413,27948,17435]),"yellow-orange-brown":Hr("Yellow-Orange-Brown","sequential","",[16777189,16775100,16704401,16696399,16685353,15495188,13388802,10040324,6694150]),"yellow-green":Hr("Yellow-Green","sequential","",[16777189,16252089,14282915,11394446,7915129,4303709,2327619,26679,17705]),reds:Hr("Reds","sequential","",[16774640,16703698,16563105,16552562,16476746,15678252,13309981,10817301,6750221]),"red-purple":Hr("Red-Purple","sequential","",[16775155,16638173,16565696,16424885,16214177,14496919,11403646,7995767,4784234]),greens:Hr("Greens","sequential","",[16252149,15070688,13101504,10607003,7652470,4303709,2329413,27948,17435]),"yellow-green-blue":Hr("Yellow-Green-Blue","sequential","",[16777177,15595697,13101492,8375739,4306628,1937856,2252456,2438292,531800]),purples:Hr("Purples","sequential","",[16579581,15724021,14342891,12369372,10394312,8420794,6967715,5515151,4128893]),"green-blue":Hr("Green-Blue","sequential","",[16252144,14742491,13429701,11066805,8113348,5157843,2854078,551084,540801]),greys:Hr("Greys","sequential","",[16777215,15790320,14277081,12434877,9868950,7566195,5395026,2434341,0]),"yellow-orange-red":Hr("Yellow-Orange-Red","sequential","",[16777164,16772512,16701814,16691788,16616764,16535082,14883356,12386342,8388646]),"purple-red":Hr("Purple-Red","sequential","",[16250105,15196655,13941210,13210823,14640560,15149450,13505110,9961539,6750239]),blues:Hr("Blues","sequential","",[16251903,14609399,13032431,10406625,7057110,4362950,2191797,545180,536683]),"purple-blue-green":Hr("Purple-Blue-Green","sequential","",[16775163,15524592,13685222,10927579,6793679,3576e3,164234,93273,83510]),spectral:Hr("Spectral","diverging","",[10355010,13975119,16018755,16625249,16703627,16777151,15136152,11263396,6734501,3311805,6180770]),"red-yellow-green":Hr("Red-Yellow-Green","diverging","",[10813478,14102567,16018755,16625249,16703627,16777151,14282635,10934634,6733155,1742928,26679]),"red-blue":Hr("Red-Blue","diverging","",[6750239,11671595,14049357,16033154,16636871,16250871,13755888,9618910,4428739,2188972,340065]),"pink-yellow-green":Hr("Pink-Yellow-Green","diverging","",[9306450,12917629,14579630,15840986,16638191,16250871,15136208,12116358,8371265,5083681,2581529]),"purple-green":Hr("Purple-Green","diverging","",[4194379,7744131,10055851,12756431,15193320,16250871,14282963,10935200,5942881,1800247,17435]),"red-yellow-blue":Hr("Red-Yellow-Blue","diverging","Red-Yellow-Blue, diverging color scheme from ColorBrewer 2.0",[10813478,14102567,16018755,16625249,16703632,16777151,14742520,11262441,7646673,4552116,3225237]),"brown-white-green":Hr("Brown-White-Green","diverging","",[5517317,9195786,12550445,14664317,16181443,16119285,13101797,8441281,3512207,91742,15408]),"red-grey":Hr("Red-Grey","diverging","",[6750239,11671595,14049357,16033154,16636871,16777215,14737632,12237498,8882055,5066061,1710618]),"orange-purple":Hr("Orange-Purple","diverging","",[8338184,11753478,14713364,16627811,16703670,16250871,14211819,11709394,8418220,5515144,2949195]),"set-2":Hr("Set-2","qualitative","",[6734501,16551266,9281739,15174339,10934356,16767279,15058068,11776947]),accent:Hr("Accent","qualitative","",[8374655,12496596,16629894,16777113,3697840,15729279,12540695,6710886]),"set-1":Hr("Set-1","qualitative","",[14948892,3636920,5091146,9981603,16744192,16777011,10901032,16220607,10066329]),"set-3":Hr("Set-3","qualitative","",[9294791,16777139,12499674,16482418,8434131,16626786,11787881,16567781,14277081,12353725,13429701,16772463]),"dark-2":Hr("Dark-2","qualitative","",[1810039,14245634,7696563,15149450,6727198,15117058,10909213,6710886]),paired:Hr("Paired","qualitative","",[10931939,2062516,11722634,3383340,16489113,14883356,16629615,16744192,13284054,6962586,16777113,11622696]),"pastel-2":Hr("Pastel-2","qualitative","",[11789005,16633260,13358568,16042724,15136201,16773806,15852236,13421772]),"pastel-1":Hr("Pastel-1","qualitative","",[16495790,11783651,13429701,14601188,16701862,16777164,15063229,16636652,15921906]),"many-distinct":Hr("Many-Distinct","qualitative","",[1810039,14245634,7696563,15149450,6727198,15117058,10909213,6710886,14948892,3636920,5091146,9981603,16744192,16777011,10901032,16220607,10066329,6734501,16551266,9281739,15174339,10934356,16767279,15058068,11776947]),magma:Hr("Magma","sequential","Perceptually uniform shades of black-red-white",[4329332,4853881,5378684,5903742,6363263,6888576,7413633,7938689,8463745,8988801,9513600,10038655,10563454,11088508,11613562,12138360,12728949,13254258,13714030,14239338,14699366,15094114,15489119,15753309,16017499,16216411,16350045,16483424,16551523,16619368,16621934,16689780,16692091,16694402,16696969,16633746,16636058,16638371,16575148,16577461,16514239]),inferno:Hr("Inferno","sequential","Perceptually uniform shades of black-red-yellow",[4721514,5246316,5771373,6296430,6821486,7346542,7871597,8396651,8921450,9446504,9971557,10496610,10956127,11481435,12006486,12466258,12926285,13386056,13780802,14241085,14570295,14965297,15229227,15558693,15757342,15956248,16154897,16288267,16421638,16489734,16492043,16494612,16496926,16368426,16305463,16111429,15982678,15853928,15856253,16119953,16580260]),plasma:Hr("Plasma","sequential","Perceptually uniform shades of blue-red-yellow",[1771148,2426257,3081365,3671193,4195228,4784799,5308834,5833124,6357158,6815911,7340200,7864744,8324007,8783782,9309348,9769377,10164126,10624154,11018902,11413393,11808141,12137352,12466307,12795519,13124730,13453685,13717361,14046573,14309992,14573668,14837344,15035483,15299159,15497299,15695438,15893834,16091974,16224833,16357693,16425017,16557877,16625457,16627245,16629289,16631334,16567845,16438820,16310052,16115494,15921190,15726625]),viridis:Hr("Viridis","sequential","Perceptually uniform shades of blue-green-yellow",[4524123,4656994,4658793,4726127,4727668,4663929,4599933,4535937,4406404,4276870,4081800,3952010,3822475,3627148,3497356,3302029,3172237,3042446,2912654,2782862,2652814,2523022,2393229,2328973,2198924,2069132,2004874,2005897,2007175,2139525,2337154,2666111,3060348,3520376,4045684,4570991,5227369,5883748,6605661,7392854,8180303,8967495,9819967,10672695,11525166,12443174,13295646,14148121,15000344,15852828,16639780]),cividis:Hr("Cividis","sequential","Perceptually uniform shades of blue-green-yellow, should look effectively identical to colorblind and non-colorblind users",[11367,12400,537456,1455727,2046574,2571629,3031404,3425388,3754092,4148075,4476779,4805227,5133932,5396844,5725549,5988462,6317166,6580079,6843249,7171698,7434867,7697781,7960951,8289656,8618104,8881272,9209976,9538679,9867127,10195830,10524533,10853235,11181938,11510640,11839343,12168045,12497002,12891240,13219941,13548642,13943134,14271834,14666326,14995025,15389516,15718470,16112703,16507190,16639799]),twilight:Hr("Twilight","sequential","Perceptually uniform shades of white-blue-black-red-white, cyclic",[14670305,14211037,13554648,12766675,11847630,10993866,10139847,9351365,8628419,8036290,7509952,7048895,6718653,6519739,6386105,6252470,6184114,6181293,6112935,6044831,5976470,5777291,5447293,5052270,4592479,4067665,3674181,3281211,3150646,3543352,4067644,4657728,5379141,6166345,6953549,7741007,8463184,9120336,9777743,10304079,10830671,11291984,11687762,12083541,12348505,12613471,12878439,13077872,13211771,13411209,13545111,13809830,14074293,14338756,14537169,14735067,14801121]),turbo:Hr("Turbo","sequential","Improved (smooth) rainbow colormap for visualization",[4866485,4872413,4354034,3770361,3120629,2667241,2475736,2611140,3073454,3928216,5109892,6487408,8126047,9829201,11531332,13167162,14605618,15780908,16693543,16753699,16748063,16741916,16146200,15026195,13644558,12198408,10818563,9833728]),rainbow:Hr("Rainbow","sequential","",[3367393,3516485,16383744,15501073,12526114]),"red-white-blue":Hr("Red-White-Blue","diverging","",[12526114,16777215,3367393])},wK=Object.keys(Iu).map(function(e){return[e,Iu[e].label,Nv(Iu[e].type)]});function cp(e){return e in Iu?Iu[e]:(console.warn("unknown color list named '".concat(e,"'")),Iu["red-yellow-blue"])}function Xh(e){return{kind:"table-legend",table:e}}wK.filter(function(e){return"diverging"===Iu[e[0]].type||"sequential"===Iu[e[0]].type}),wK.filter(function(e){return"qualitative"===Iu[e[0]].type});var zc,rMe={domain:[0,1],reverse:!1,listOrName:"red-yellow-blue",minLabel:"",maxLabel:""};!function(e){e.create=function t(r){var n=R(R({},rMe),r),a=n.domain,i=n.reverse,o=n.listOrName,s="string"==typeof o?cp(o).list:o,u=i?s.slice().reverse():s,c=u.length-1,l=0,f=0,d=0;function p(x,A){l=(d=A)-(f=x)||1}p(a[0],a[1]);var v,h=Po(r.minLabel,f.toString()),m=Po(r.maxLabel,d.toString());if(u.every(function(x){return Array.isArray(x)})){var y=ur([],u,!0);y.sort(function(x,A){return x[1]-A[1]});var b=y.map(function(x){return x[0]}),_=Xe.ofSortedArray(y.map(function(x){return x[1]})),C=b.length-1;v=function(x){var A=io((x-f)/l,0,1),T=Xe.findPredecessorIndex(_,A);if(0===T)return b[f];if(T>C)return b[C];var w=_[T-1],I=io((A-w)/(_[T]-w),0,1);return ft.interpolate(b[T-1],b[T],I)}}else v=function(x){var A=Math.min(u.length-1,Math.max(0,(x-f)/l*c)),T=Math.floor(A),w=u[T],E=u[Math.ceil(A)];return ft.interpolate(w,E,A-T)};return{color:v,colorToArray:function(x,A,T){ft.toArray(v(x),A,T)},normalizedColorToArray:function(x,A,T){ft.toArrayNormalized(v(x),A,T)},setDomain:p,get legend(){return function tMe(e,t,r){return{kind:"scale-legend",minLabel:e,maxLabel:t,colors:r}}(h,m,u)}}}}(zc||(zc={}));var Pu,Mu,AK=new Set(["145","147","149","289","291","293","445","475","491","510","604","045","05L","07E","07Y","08U","09X","0AT","0BD","0H0","0HX","0LP","0MK","0NZ","0TS","0UB","0V4","0WK","0XY","0YT","10M","12E","14T","15L","16F","16G","16O","17T","18D","18O","18T","1AR","1BW","1CF","1FT","1GL","1GN","1JB","1LL","1NA","1S3","1S4","1SD","1X4","20S","20X","22O","22S","23V","24S","25E","26M","26O","26Q","26R","26V","26W","26Y","27C","2DG","2DR","2F8","2FG","2FL","2FP","2GL","2GS","2H5","2HA","2M4","2M5","2M8","2OS","2SI","2WP","2WS","32O","34V","38J","3BU","3CM","3DO","3DY","3FM","3GR","3HD","3J3","3J4","3LJ","3LR","3MF","3MG","3MK","3R3","3S6","3SA","3YW","40J","42D","44S","46D","46M","46Z","48Z","49A","49S","49T","49V","4AM","4CQ","4GC","4GL","4GP","4JA","4N2","4NN","4QY","4R1","4RS","4SG","4U0","4U1","4U2","4UZ","4V5","50A","51N","56N","57S","5DI","5GF","5GO","5II","5KQ","5KS","5KT","5KV","5L2","5L3","5LS","5LT","5MM","5N6","5QP","5RP","5SA","5SP","5TH","5TJ","5TK","5TM","61J","62I","64K","66O","6BG","6C2","6DM","6GB","6GP","6GR","6K3","6KH","6KL","6KS","6KU","6KW","6LA","6LS","6LW","6MJ","6MN","6PG","6PY","6PZ","6S2","6SA","6UD","6Y6","6YR","6ZC","73E","79J","7CV","7D1","7GP","7JZ","7K2","7K3","7NU","7SA","83Y","89Y","8B7","8B9","8EX","8GA","8GG","8GP","8I4","8LM","8LR","8OQ","8PK","8S0","8YV","95Z","96O","98U","9AM","9C1","9CD","9GP","9KJ","9MR","9OK","9PG","9QG","9QZ","9S7","9SG","9SJ","9SM","9SP","9T1","9T7","9VP","9WJ","9WN","9WZ","9YW","A0K","A1Q","A2G","A5C","A6P","AAL","AAO","ABC","ABD","ABE","ABF","ABL","AC1","ACG","ACR","ACX","ADA","ADG","ADR","AF1","AFD","AFL","AFO","AFP","AFR","AGC","AGH","AGL","AGR","AH2","AH8","AHG","AHM","AHR","AIG","ALL","ALX","AMG","AMN","AMU","AMV","ANA","AOG","AOS","AQA","ARA","ARB","ARE","ARI","ARW","ASC","ASG","ASO","AXP","AXR","AY9","AZC","B0D","B16","B1H","B1N","B2G","B4G","B6D","B7G","B8D","B9D","BBK","BBV","BCD","BCW","BDF","BDG","BDP","BDR","BDZ","BEM","BFN","BFP","BG6","BG8","BGC","BGL","BGN","BGP","BGS","BHG","BM3","BM7","BMA","BMX","BND","BNG","BNX","BO1","BOG","BQY","BRI","BS7","BTG","BTU","BW3","BWG","BXF","BXP","BXX","BXY","BZD","C3B","C3G","C3X","C4B","C4W","C4X","C5X","CAP","CBF","CBI","CBK","CDR","CE5","CE6","CE8","CEG","CEX","CEY","CEZ","CGF","CJB","CKB","CKP","CNP","CR1","CR6","CRA","CT3","CTO","CTR","CTT","D0N","D1M","D5E","D6G","DAF","DAG","DAN","DDA","DDB","DDL","DEG","DEL","DFR","DFX","DG0","DGC","DGD","DGM","DGO","DGS","DGU","DIG","DJB","DJE","DK4","DKX","DKZ","DL6","DLD","DLF","DLG","DMU","DNO","DO8","DOM","DP5","DPC","DQQ","DQR","DR2","DR3","DR4","DR5","DRI","DSR","DT6","DVC","DYM","E3M","E4P","E5G","EAG","EBG","EBQ","EEN","EEQ","EGA","EJT","EMP","EMZ","EPG","EQP","EQV","ERE","ERI","ETT","EUS","F1P","F1X","F55","F58","F6P","F8X","FBP","FCA","FCB","FCT","FDP","FDQ","FFC","FFX","FIF","FIX","FK9","FKD","FMF","FMO","FNG","FNY","FRU","FSA","FSI","FSM","FSR","FSW","FU4","FUB","FUC","FUD","FUF","FUL","FUY","FVQ","FX1","FYJ","G0S","G16","G1P","G20","G28","G2F","G3F","G3I","G4D","G4S","G6D","G6P","G6S","G7P","G8Z","GAA","GAC","GAD","GAF","GAL","GAT","GBH","GC1","GC4","GC9","GCB","GCD","GCN","GCO","GCS","GCT","GCU","GCV","GCW","GDA","GDL","GE1","GE3","GFP","GIV","GL0","GL1","GL2","GL4","GL5","GL6","GL7","GL9","GLA","GLB","GLC","GLD","GLF","GLG","GLO","GLP","GLS","GLT","GLW","GM0","GMB","GMH","GMT","GMZ","GN1","GN4","GNS","GNX","GP0","GP1","GP4","GPH","GPK","GPM","GPO","GPQ","GPU","GPV","GPW","GQ1","GRF","GRX","GS1","GS4","GS9","GSA","GSD","GTE","GTH","GTK","GTM","GTR","GU0","GU1","GU2","GU3","GU4","GU5","GU6","GU8","GU9","GUF","GUL","GUP","GUZ","GXL","GXV","GYE","GYG","GYP","GYU","GYV","GZL","H1M","H1S","H2P","H3S","H53","H6Q","H6Z","HBZ","HD4","HDL","HMS","HNV","HNW","HSG","HSH","HSJ","HSQ","HSR","HSU","HSX","HSY","HSZ","HTG","HTM","HVC","I57","IAB","IDC","IDF","IDG","IDR","IDS","IDT","IDU","IDX","IDY","IEM","IN1","IPT","ISD","ISL","ISX","IVG","IXD","J5B","JFZ","JHM","JLT","JRV","JS2","JSV","JV4","JVA","JVS","JZR","K5B","K99","KBA","KBG","KD5","KDA","KDB","KDD","KDE","KDF","KDM","KDN","KDO","KDR","KFN","KG1","KGM","KHP","KME","KO1","KO2","KOT","KQC","KTU","L1L","L6N","L6S","L6T","LAG","LAH","LAI","LAK","LAO","LAT","LB2","LBS","LBT","LCN","LDY","LEC","LER","LFC","LFR","LGC","LGU","LKA","LKS","LM2","LMO","LMT","LMU","LNV","LOG","LOX","LPK","LRH","LSM","LTG","LTM","LVO","LVZ","LXB","LXC","LXZ","LZ0","M1F","M1P","M2F","M3M","M3N","M55","M6D","M6P","M7B","M7P","M8C","MA1","MA2","MA3","MA8","MAB","MAF","MAG","MAL","MAN","MAT","MAV","MAW","MBE","MBF","MBG","MCU","MDA","MDP","MFA","MFB","MFU","MG5","MGA","MGC","MGL","MGS","MJJ","MLB","MLR","MMA","MMN","MN0","MNA","MQG","MQT","MRH","MRP","MSX","MTT","MUB","MUG","MUR","MVP","MXY","MXZ","MYG","N1L","N3U","N9S","NA1","NAA","NAG","NBG","NBX","NBY","NDG","NED","NFG","NG1","NG6","NGA","NGB","NGC","NGE","NGF","NGK","NGL","NGR","NGS","NGY","NGZ","NHF","NLC","NM6","NM9","NNG","NPF","NSQ","NT1","NTF","NTO","NTP","NXD","NYT","O1G","OAK","OEL","OI7","OPM","ORP","OSU","OTG","OTN","OTU","OX2","P53","P6P","P8E","PA1","PA5","PAV","PDX","PH5","PKM","PNA","PNG","PNJ","PNW","PPC","PRP","PSG","PSJ","PSV","PTQ","PUF","PZU","QDK","QIF","QKH","QPS","QV4","R1P","R1X","R2B","R2G","R5P","RAA","RAE","RAF","RAM","RAO","RAT","RB5","RBL","RCD","RDP","REL","RER","RF5","RG1","RGG","RHA","RHC","RI2","RIB","RIP","RM4","RNS","RNT","ROB","ROR","RP3","RP5","RP6","RPA","RR7","RRJ","RRY","RST","RTG","RTV","RUB","RUG","RUU","RV7","RVG","RVM","RWI","RY7","RZM","S6P","S7P","S81","SA0","SCG","SCR","SDD","SDY","SEJ","SF6","SF9","SFJ","SFU","SG4","SG5","SG6","SG7","SGA","SGC","SGD","SGN","SGS","SHB","SHD","SHG","SI3","SIA","SID","SIO","SIZ","SLB","SLM","SLT","SMD","SN5","SNG","SOE","SOG","SOL","SOR","SR1","SSG","SSH","STW","STZ","SUC","SUP","SUS","SWE","SZZ","T68","T6D","T6P","T6T","TA6","TAG","TCB","TCG","TDG","TEU","TF0","TFU","TGA","TGK","TGR","TGY","TH1","TM5","TM6","TM9","TMR","TMX","TNX","TOA","TOC","TQY","TRE","TRV","TS8","TT7","TTV","TTZ","TU4","TUG","TUJ","TUP","TUR","TVD","TVG","TVM","TVS","TVV","TVY","TW7","TWA","TWD","TWG","TWJ","TWY","TXB","TY6","TYV","U1Y","U2A","U2D","U63","U8V","U97","U9A","U9D","U9G","U9J","U9M","UAP","UBH","UBO","UCD","UDC","UEA","V3M","V3P","V71","VG1","VJ1","VJ4","VKN","VTB","W9T","WIA","WOO","WUN","WZ1","WZ2","WZ4","X0X","X1P","X1X","X2F","X2Y","X34","X4S","X5S","X6X","X6Y","XBP","XDP","XDX","XGP","XIL","XKJ","XLF","XLS","XMM","XS2","XUL","XXM","XXR","XXX","XY6","XY9","XYB","XYF","XYL","XYP","XYS","XYT","XYZ","YDR","YIO","YJM","YKR","YO5","YX0","YX1","YYB","YYD","YYH","YYJ","YYK","YYM","YYQ","YYR","YZ0","YZT","Z0F","Z15","Z16","Z2D","Z2T","Z3K","Z3L","Z3Q","Z3U","Z4K","Z4R","Z4S","Z4U","Z4V","Z4W","Z4Y","Z57","Z5J","Z5L","Z61","Z6G","Z6H","Z6J","Z6W","Z8H","Z8T","Z9D","Z9E","Z9H","Z9K","Z9L","Z9M","Z9N","Z9W","ZB0","ZB1","ZB2","ZB3","ZCD","ZCZ","ZD0","ZDC","ZDM","ZDO","ZEE","ZEL","ZGE","ZMR","UMQ","SQD"]),On=function(e){return e[e.FilledSphere=0]="FilledSphere",e[e.FilledCube=1]="FilledCube",e[e.CrossedCube=2]="CrossedCube",e[e.DividedDiamond=3]="DividedDiamond",e[e.FilledCone=4]="FilledCone",e[e.DevidedCone=5]="DevidedCone",e[e.FlatBox=6]="FlatBox",e[e.FilledStar=7]="FilledStar",e[e.FilledDiamond=8]="FilledDiamond",e[e.FlatDiamond=9]="FlatDiamond",e[e.FlatHexagon=10]="FlatHexagon",e[e.Pentagon=11]="Pentagon",e[e.DiamondPrism=12]="DiamondPrism",e[e.PentagonalPrism=13]="PentagonalPrism",e[e.HexagonalPrism=14]="HexagonalPrism",e[e.HeptagonalPrism=15]="HeptagonalPrism",e}(On||{}),wt=function(e){return e[e.Hexose=0]="Hexose",e[e.HexNAc=1]="HexNAc",e[e.Hexosamine=2]="Hexosamine",e[e.Hexuronate=3]="Hexuronate",e[e.Deoxyhexose=4]="Deoxyhexose",e[e.DeoxyhexNAc=5]="DeoxyhexNAc",e[e.DiDeoxyhexose=6]="DiDeoxyhexose",e[e.Pentose=7]="Pentose",e[e.Deoxynonulosonate=8]="Deoxynonulosonate",e[e.DiDeoxynonulosonate=9]="DiDeoxynonulosonate",e[e.Unknown=10]="Unknown",e[e.Assigned=11]="Assigned",e}(wt||{});(Pu={})[wt.Hexose]="Hexose",Pu[wt.HexNAc]="HexNAc",Pu[wt.Hexosamine]="Hexosamine",Pu[wt.Hexuronate]="Hexuronate",Pu[wt.Deoxyhexose]="Deoxyhexose",Pu[wt.DeoxyhexNAc]="DeoxyhexNAc",Pu[wt.DiDeoxyhexose]="Di-deoxyhexose",Pu[wt.Pentose]="Pentose",Pu[wt.Deoxynonulosonate]="Deoxynonulosonate",Pu[wt.DiDeoxynonulosonate]="Di-deoxynonulosonate",Pu[wt.Unknown]="Unknown",Pu[wt.Assigned]="Assigned";var aMe=((Mu={})[wt.Hexose]=On.FilledSphere,Mu[wt.HexNAc]=On.FilledCube,Mu[wt.Hexosamine]=On.CrossedCube,Mu[wt.Hexuronate]=On.DividedDiamond,Mu[wt.Deoxyhexose]=On.FilledCone,Mu[wt.DeoxyhexNAc]=On.DevidedCone,Mu[wt.DiDeoxyhexose]=On.FlatBox,Mu[wt.Pentose]=On.FilledStar,Mu[wt.Deoxynonulosonate]=On.FilledDiamond,Mu[wt.DiDeoxynonulosonate]=On.FlatDiamond,Mu[wt.Unknown]=On.FlatHexagon,Mu[wt.Assigned]=On.Pentagon,Mu);function iMe(e,t){return e===wt.Unknown?4===t?On.DiamondPrism:5===t?On.PentagonalPrism:6===t?On.HexagonalPrism:7===t?On.HeptagonalPrism:On.FlatHexagon:aMe[e]}var pa,NO={abbr:"Unk",name:"Unknown",color:15854817,type:wt.Unknown},Ly=[{abbr:"Glc",name:"Glucose",color:37052,type:wt.Hexose},{abbr:"Man",name:"Mannose",color:42577,type:wt.Hexose},{abbr:"Gal",name:"Galactose",color:16765952,type:wt.Hexose},{abbr:"Gul",name:"Gulose",color:16021792,type:wt.Hexose},{abbr:"Alt",name:"Altrose",color:16162465,type:wt.Hexose},{abbr:"All",name:"Allose",color:10830745,type:wt.Hexose},{abbr:"Tal",name:"Talose",color:9424105,type:wt.Hexose},{abbr:"Ido",name:"Idose",color:10582605,type:wt.Hexose},{abbr:"GlcNAc",name:"N-Acetyl Glucosamine",color:37052,type:wt.HexNAc},{abbr:"ManNAc",name:"N-Acetyl Mannosamine",color:42577,type:wt.HexNAc},{abbr:"GalNAc",name:"N-Acetyl Galactosamine",color:16765952,type:wt.HexNAc},{abbr:"GulNAc",name:"N-Acetyl Gulosamine",color:16021792,type:wt.HexNAc},{abbr:"AltNAc",name:"N-Acetyl Altrosamine",color:16162465,type:wt.HexNAc},{abbr:"AllNAc",name:"N-Acetyl Allosamine",color:10830745,type:wt.HexNAc},{abbr:"TalNAc",name:"N-Acetyl Talosamine",color:9424105,type:wt.HexNAc},{abbr:"IdoNAc",name:"N-Acetyl Idosamine",color:10582605,type:wt.HexNAc},{abbr:"GlcN",name:"Glucosamine",color:37052,type:wt.Hexosamine},{abbr:"ManN",name:"Mannosamine",color:42577,type:wt.Hexosamine},{abbr:"GalN",name:"Galactosamine",color:16765952,type:wt.Hexosamine},{abbr:"GulN",name:"Gulosamine",color:16021792,type:wt.Hexosamine},{abbr:"AltN",name:"Altrosamine",color:16162465,type:wt.Hexosamine},{abbr:"AllN",name:"Allosamine",color:10830745,type:wt.Hexosamine},{abbr:"TalN",name:"Talosamine",color:9424105,type:wt.Hexosamine},{abbr:"IdoN",name:"Idosamine",color:10582605,type:wt.Hexosamine},{abbr:"GlcA",name:"Glucuronic Acid",color:37052,type:wt.Hexuronate},{abbr:"ManA",name:"Mannuronic Acid",color:42577,type:wt.Hexuronate},{abbr:"GalA",name:"Galacturonic Acid",color:16765952,type:wt.Hexuronate},{abbr:"GulA",name:"Guluronic Acid",color:16021792,type:wt.Hexuronate},{abbr:"AltA",name:"Altruronic Acid",color:16162465,type:wt.Hexuronate},{abbr:"AllA",name:"Alluronic Acid",color:10830745,type:wt.Hexuronate},{abbr:"TalA",name:"Taluronic Acid",color:9424105,type:wt.Hexuronate},{abbr:"IdoA",name:"Iduronic Acid",color:10582605,type:wt.Hexuronate},{abbr:"Qui",name:"Quinovose",color:37052,type:wt.Deoxyhexose},{abbr:"Rha",name:"Rhamnose",color:42577,type:wt.Deoxyhexose},{abbr:"6dGul",name:"6-Deoxy Gulose",color:16021792,type:wt.Deoxyhexose},{abbr:"6dAlt",name:"6-Deoxy Altrose",color:16162465,type:wt.Deoxyhexose},{abbr:"6dTal",name:"6-Deoxy Talose",color:9424105,type:wt.Deoxyhexose},{abbr:"Fuc",name:"Fucose",color:15539236,type:wt.Deoxyhexose},{abbr:"QuiNAc",name:"N-Acetyl Quinovosamine",color:37052,type:wt.DeoxyhexNAc},{abbr:"RhaNAc",name:"N-Acetyl Rhamnosamine",color:42577,type:wt.DeoxyhexNAc},{abbr:"6dAltNAc",name:"N-Acetyl 6-Deoxy Altrosamine",color:16162465,type:wt.DeoxyhexNAc},{abbr:"6dTalNAc",name:"N-Acetyl 6-Deoxy Talosamine",color:9424105,type:wt.DeoxyhexNAc},{abbr:"FucNAc",name:"N-Acetyl Fucosamine",color:15539236,type:wt.DeoxyhexNAc},{abbr:"Oli",name:"Olivose",color:37052,type:wt.DiDeoxyhexose},{abbr:"Tyv",name:"Tyvelose",color:42577,type:wt.DiDeoxyhexose},{abbr:"Abe",name:"Abequose",color:16021792,type:wt.DiDeoxyhexose},{abbr:"Par",name:"Paratose",color:16162465,type:wt.DiDeoxyhexose},{abbr:"Dig",name:"Digitoxose",color:10830745,type:wt.DiDeoxyhexose},{abbr:"Col",name:"Colitose",color:9424105,type:wt.DiDeoxyhexose},{abbr:"Ara",name:"Arabinose",color:42577,type:wt.Pentose},{abbr:"Lyx",name:"Lyxose",color:16765952,type:wt.Pentose},{abbr:"Xyl",name:"Xylose",color:16021792,type:wt.Pentose},{abbr:"Rib",name:"Ribose",color:16162465,type:wt.Pentose},{abbr:"Kdn",name:"Keto-Deoxy Nonulonic Acid",color:42577,type:wt.Deoxynonulosonate},{abbr:"Neu5Ac",name:"N-Acetyl Neuraminic Acid",color:10830745,type:wt.Deoxynonulosonate},{abbr:"Neu5Gc",name:"N-Glycolyl Neuraminic Acid",color:9424105,type:wt.Deoxynonulosonate},{abbr:"Neu",name:"Neuraminic Acid",color:10582605,type:wt.Deoxynonulosonate},{abbr:"Sia",name:"Sialic acid",color:15539236,type:wt.Deoxynonulosonate},{abbr:"Pse",name:"Pseudaminic Acid",color:42577,type:wt.DiDeoxynonulosonate},{abbr:"Leg",name:"Legionaminic Acid",color:16765952,type:wt.DiDeoxynonulosonate},{abbr:"Aci",name:"Acinetaminic Acid",color:16162465,type:wt.DiDeoxynonulosonate},{abbr:"4eLeg",name:"4-Epilegionaminic Acid",color:9424105,type:wt.DiDeoxynonulosonate},{abbr:"Bac",name:"Bacillosamine",color:37052,type:wt.Unknown},{abbr:"LDmanHep",name:"L-Glycero-D-Manno Heptose",color:42577,type:wt.Unknown},{abbr:"Kdo",name:"Keto-Deoxy Octulonic Acid",color:16765952,type:wt.Unknown},{abbr:"Dha",name:"3-Deoxy Lyxo-Heptulosaric Acid",color:16021792,type:wt.Unknown},{abbr:"DDmanHep",name:"D-Glycero-D-Manno-Heptose",color:16162465,type:wt.Unknown},{abbr:"MurNAc",name:"N-Acetyl Muramic Acid",color:10830745,type:wt.Unknown},{abbr:"MurNGc",name:"N-Glycolyl Muramic Acid",color:9424105,type:wt.Unknown},{abbr:"Mur",name:"Muramic Acid",color:10582605,type:wt.Unknown},{abbr:"Api",name:"Apicose",color:42577,type:wt.Assigned},{abbr:"Fru",name:"Fructose",color:42577,type:wt.Assigned},{abbr:"Tag",name:"Tagatose",color:16765952,type:wt.Assigned},{abbr:"Sor",name:"Sorbose",color:16021792,type:wt.Assigned},{abbr:"Psi",name:"Psicose",color:16162465,type:wt.Assigned}],oMe=function(){for(var e=new Map,t=0,r=Ly.length;tthis.radiusSq&&(this.radiusSq=r)},e.prototype.radiusSphereStep=function(t,r){var n=kMe(t,this.center)+r,a=n*n;a>this.radiusSq&&(this.radiusSq=a)},e.prototype.getSphere=function(t){return t||(t=De()),S.copy(t.center,this.center),t.radius=Math.sqrt(this.radiusSq),t},e.prototype.getCount=function(){return this.count},e}();!function(e){var t=new e,r=S(),n=S();e.fromArrays=function a(s,u){var c=s.x,l=s.y,f=s.z;t.reset();for(var d=c.length,p=0;p0?a:t<0?r:(r+n)/1.95}var UMe=zO.H;function pp(e){return e===UMe}var VMe=new Map([["HIS|CD2|CG",2],["HIS|CE1|ND1",2],["ARG|CZ|NH2",2],["PHE|CE1|CZ",2],["PHE|CD2|CE2",2],["PHE|CD1|CG",2],["TRP|CD1|CG",2],["TRP|CD2|CE2",2],["TRP|CE3|CZ3",2],["TRP|CH2|CZ2",2],["ASN|CG|OD1",2],["GLN|CD|OE1",2],["TYR|CD1|CG",2],["TYR|CD2|CE2",2],["TYR|CE1|CZ",2],["ASP|CG|OD1",2],["GLU|CD|OE1",2],["G|C8|N7",2],["G|C4|C5",2],["G|C2|N3",2],["G|C6|O6",2],["C|C4|N3",2],["C|C5|C6",2],["C|C2|O2",2],["A|C2|N3",2],["A|C6|N1",2],["A|C4|C5",2],["A|C8|N7",2],["U|C5|C6",2],["U|C2|O2",2],["U|C4|O4",2],["DG|C8|N7",2],["DG|C4|C5",2],["DG|C2|N3",2],["DG|C6|O6",2],["DC|C4|N3",2],["DC|C5|C6",2],["DC|C2|O2",2],["DA|C2|N3",2],["DA|C6|N1",2],["DA|C4|C5",2],["DA|C8|N7",2],["DT|C5|C6",2],["DT|C2|O2",2],["DT|C4|O4",2]]);function zMe(e,t,r){var n;return t=(n=tr&&(e=(a=[r,e])[0],r=a[1],t=(i=[n,t])[0],n=i[1]),GMe.get("".concat(e,"|").concat(t,"|").concat(r,"|").concat(n))||1}var Jr,hp=ie.Schema,se=hp.str,Ie=hp.int,vr=hp.float,GO=hp.coord,Mt=hp.Aliased,Qh=hp.Matrix,DT=hp.Vector,bn=hp.lstr,Vv=hp.List,Lr={atom_site:{auth_asym_id:se,auth_atom_id:se,auth_comp_id:se,auth_seq_id:Ie,B_iso_or_equiv:vr,Cartn_x:GO,Cartn_y:GO,Cartn_z:GO,group_PDB:Mt(se),id:Ie,label_alt_id:se,label_asym_id:se,label_atom_id:se,label_comp_id:se,label_entity_id:se,label_seq_id:Ie,occupancy:vr,type_symbol:se,pdbx_PDB_ins_code:se,pdbx_PDB_model_num:Ie,pdbx_formal_charge:Ie,pdbx_label_index:Ie,pdbx_sifts_xref_db_name:se,pdbx_sifts_xref_db_acc:se,pdbx_sifts_xref_db_num:se,pdbx_sifts_xref_db_res:se,ihm_model_id:Ie},atom_site_anisotrop:{id:Ie,type_symbol:se,U:Qh(3,3),U_esd:Qh(3,3),pdbx_auth_seq_id:se,pdbx_auth_asym_id:se,pdbx_auth_atom_id:se,pdbx_auth_comp_id:se,pdbx_label_seq_id:Ie,pdbx_label_alt_id:se,pdbx_label_asym_id:se,pdbx_label_atom_id:se,pdbx_label_comp_id:se,pdbx_PDB_ins_code:se},atom_sites:{entry_id:se,fract_transf_matrix:Qh(3,3),fract_transf_vector:DT(3)},audit_author:{name:se,pdbx_ordinal:Ie,identifier_ORCID:se},audit_conform:{dict_location:se,dict_name:se,dict_version:se},cell:{angle_alpha:vr,angle_beta:vr,angle_gamma:vr,entry_id:se,length_a:vr,length_b:vr,length_c:vr,Z_PDB:Ie,pdbx_unique_axis:se},chem_comp:{formula:se,formula_weight:vr,id:se,mon_nstd_flag:Mt(bn),name:se,type:Mt(bn),pdbx_synonyms:Vv(";",function(e){return e})},chem_comp_bond:{atom_id_1:se,atom_id_2:se,comp_id:se,value_order:Mt(bn),pdbx_ordinal:Ie,pdbx_stereo_config:Mt(bn),pdbx_aromatic_flag:Mt(bn)},citation:{book_publisher:se,country:se,id:se,journal_abbrev:se,journal_id_ASTM:se,journal_id_CSD:se,journal_id_ISSN:se,journal_volume:se,page_first:se,page_last:se,title:se,year:Ie,pdbx_database_id_DOI:se,pdbx_database_id_PubMed:Ie},citation_author:{citation_id:se,name:se,ordinal:Ie},database_2:{database_id:Mt(bn),database_code:se},entity:{details:se,formula_weight:vr,id:se,src_method:Mt(bn),type:Mt(bn),pdbx_description:Vv(",",function(e){return e}),pdbx_number_of_molecules:Ie,pdbx_mutation:se,pdbx_fragment:se,pdbx_ec:Vv(",",function(e){return e})},entity_poly:{entity_id:se,nstd_linkage:Mt(bn),nstd_monomer:Mt(bn),type:Mt(se),pdbx_strand_id:Vv(",",function(e){return e}),pdbx_seq_one_letter_code:se,pdbx_seq_one_letter_code_can:se,pdbx_target_identifier:se},entity_poly_seq:{entity_id:se,hetero:Mt(bn),mon_id:se,num:Ie},entry:{id:se},exptl:{entry_id:se,method:Mt(se)},software:{classification:se,date:se,description:se,name:se,type:Mt(bn),version:se,pdbx_ordinal:Ie},struct:{entry_id:se,title:se,pdbx_descriptor:se},struct_asym:{details:se,entity_id:se,id:se,pdbx_modified:se,pdbx_blank_PDB_chainid_flag:Mt(se)},struct_conf:{beg_label_asym_id:se,beg_label_comp_id:se,beg_label_seq_id:Ie,beg_auth_asym_id:se,beg_auth_comp_id:se,beg_auth_seq_id:Ie,conf_type_id:Mt(bn),details:se,end_label_asym_id:se,end_label_comp_id:se,end_label_seq_id:Ie,end_auth_asym_id:se,end_auth_comp_id:se,end_auth_seq_id:Ie,id:se,pdbx_beg_PDB_ins_code:se,pdbx_end_PDB_ins_code:se,pdbx_PDB_helix_class:se,pdbx_PDB_helix_length:Ie,pdbx_PDB_helix_id:se},struct_conn:{conn_type_id:Mt(bn),details:se,id:se,ptnr1_label_asym_id:se,ptnr1_label_atom_id:se,ptnr1_label_comp_id:se,ptnr1_label_seq_id:Ie,ptnr1_auth_asym_id:se,ptnr1_auth_comp_id:se,ptnr1_auth_seq_id:Ie,ptnr1_symmetry:se,ptnr2_label_asym_id:se,ptnr2_label_atom_id:se,ptnr2_label_comp_id:se,ptnr2_label_seq_id:Ie,ptnr2_auth_asym_id:se,ptnr2_auth_comp_id:se,ptnr2_auth_seq_id:Ie,ptnr2_symmetry:se,pdbx_ptnr1_PDB_ins_code:se,pdbx_ptnr1_label_alt_id:se,pdbx_ptnr1_standard_comp_id:se,pdbx_ptnr2_PDB_ins_code:se,pdbx_ptnr2_label_alt_id:se,pdbx_ptnr3_PDB_ins_code:se,pdbx_ptnr3_label_alt_id:se,pdbx_ptnr3_label_asym_id:se,pdbx_ptnr3_label_atom_id:se,pdbx_ptnr3_label_comp_id:se,pdbx_ptnr3_label_seq_id:Ie,pdbx_PDB_id:se,pdbx_dist_value:vr,pdbx_value_order:Mt(bn)},struct_conn_type:{criteria:se,id:Mt(bn),reference:se},struct_keywords:{entry_id:se,text:Vv(",",function(e){return e}),pdbx_keywords:se},struct_ncs_oper:{code:Mt(se),details:se,id:Ie,matrix:Qh(3,3),vector:DT(3)},struct_sheet_range:{beg_label_asym_id:se,beg_label_comp_id:se,beg_label_seq_id:Ie,end_label_asym_id:se,end_label_comp_id:se,end_label_seq_id:Ie,beg_auth_asym_id:se,beg_auth_comp_id:se,beg_auth_seq_id:Ie,end_auth_asym_id:se,end_auth_comp_id:se,end_auth_seq_id:Ie,id:se,sheet_id:se,pdbx_beg_PDB_ins_code:se,pdbx_end_PDB_ins_code:se},struct_site:{details:se,id:se,pdbx_num_residues:Ie,pdbx_evidence_code:se,pdbx_auth_asym_id:se,pdbx_auth_comp_id:se,pdbx_auth_seq_id:se,pdbx_auth_ins_code:se},struct_site_gen:{details:se,id:se,label_alt_id:se,label_asym_id:se,label_atom_id:se,label_comp_id:se,label_seq_id:Ie,auth_asym_id:se,auth_comp_id:se,auth_seq_id:se,site_id:se,symmetry:se,pdbx_auth_ins_code:se,pdbx_num_res:Ie},symmetry:{entry_id:se,cell_setting:Mt(bn),Int_Tables_number:Ie,space_group_name_Hall:se,"space_group_name_H-M":se},pdbx_database_status:{status_code:Mt(se),status_code_sf:Mt(se),status_code_mr:Mt(se),entry_id:se,recvd_initial_deposition_date:se,SG_entry:Mt(bn),deposit_site:Mt(se),process_site:Mt(se),status_code_cs:Mt(se),methods_development_category:Mt(se),pdb_format_compatible:Mt(bn)},pdbx_nonpoly_scheme:{asym_id:se,entity_id:se,mon_id:se,pdb_strand_id:se,ndb_seq_num:se,pdb_seq_num:se,auth_seq_num:se,pdb_mon_id:se,auth_mon_id:se,pdb_ins_code:se},pdbx_database_related:{db_name:se,details:se,db_id:se,content_type:Mt(se)},pdbx_entity_nonpoly:{entity_id:se,comp_id:se,name:se},pdbx_chem_comp_synonyms:{name:se,comp_id:se,provenance:Mt(se)},pdbx_chem_comp_identifier:{comp_id:se,identifier:se,type:Mt(se),program:se,program_version:se},pdbx_unobs_or_zero_occ_residues:{id:Ie,polymer_flag:Mt(bn),occupancy_flag:Mt(Ie),PDB_model_num:Ie,auth_asym_id:se,auth_comp_id:se,auth_seq_id:se,PDB_ins_code:se,label_asym_id:se,label_comp_id:se,label_seq_id:Ie},pdbx_struct_mod_residue:{id:Ie,auth_asym_id:se,auth_comp_id:se,auth_seq_id:Ie,PDB_ins_code:se,label_asym_id:se,label_comp_id:se,label_seq_id:Ie,parent_comp_id:se,details:se},pdbx_struct_oper_list:{id:se,type:Mt(se),name:se,symmetry_operation:se,matrix:Qh(3,3),vector:DT(3)},pdbx_struct_assembly:{method_details:se,oligomeric_details:se,oligomeric_count:Ie,details:se,id:se},pdbx_struct_assembly_gen:{asym_id_list:Vv(",",function(e){return e}),assembly_id:se,oper_expression:se},pdbx_reference_entity_list:{prd_id:se,ref_entity_id:se,type:Mt(bn),details:se,component_id:Ie},pdbx_reference_entity_link:{link_id:Ie,prd_id:se,details:se,ref_entity_id_1:se,ref_entity_id_2:se,entity_seq_num_1:Ie,entity_seq_num_2:Ie,comp_id_1:se,comp_id_2:se,atom_id_1:se,atom_id_2:se,value_order:Mt(bn),component_1:Ie,component_2:Ie,link_class:Mt(se)},pdbx_reference_entity_poly_link:{link_id:Ie,prd_id:se,ref_entity_id:se,component_id:Ie,entity_seq_num_1:Ie,entity_seq_num_2:Ie,comp_id_1:se,comp_id_2:se,atom_id_1:se,atom_id_2:se,value_order:Mt(bn)},pdbx_molecule:{prd_id:se,instance_id:Ie,asym_id:se},pdbx_molecule_features:{prd_id:se,class:Mt(bn),type:Mt(bn),name:se,details:se},entity_src_nat:{entity_id:se,pdbx_organism_scientific:se,pdbx_plasmid_name:se,pdbx_src_id:Ie,pdbx_beg_seq_num:Ie,pdbx_end_seq_num:Ie},entity_src_gen:{entity_id:se,pdbx_gene_src_gene:Vv(",",function(e){return e}),pdbx_gene_src_scientific_name:se,plasmid_name:se,pdbx_src_id:Ie,pdbx_beg_seq_num:Ie,pdbx_end_seq_num:Ie},pdbx_entity_src_syn:{organism_scientific:se,entity_id:se,pdbx_src_id:Ie,pdbx_beg_seq_num:Ie,pdbx_end_seq_num:Ie},pdbx_entity_branch_descriptor:{entity_id:se,descriptor:se,type:Mt(bn),program:se,program_version:se,ordinal:Ie},pdbx_entity_instance_feature:{details:se,feature_type:Mt(se),auth_asym_id:se,asym_id:se,auth_seq_num:se,seq_num:Ie,comp_id:se,auth_comp_id:se,ordinal:Ie},pdbx_entity_branch_list:{entity_id:se,hetero:Mt(bn),comp_id:se,num:Ie},pdbx_entity_branch_link:{link_id:Ie,details:se,entity_id:se,entity_branch_list_num_1:Ie,entity_branch_list_num_2:Ie,comp_id_1:se,comp_id_2:se,atom_id_1:se,leaving_atom_id_1:se,atom_stereo_config_1:Mt(bn),atom_id_2:se,leaving_atom_id_2:se,atom_stereo_config_2:Mt(bn),value_order:Mt(bn)},pdbx_entity_branch:{entity_id:se,type:Mt(se)},pdbx_branch_scheme:{entity_id:se,hetero:Mt(bn),asym_id:se,mon_id:se,num:Ie,pdb_asym_id:se,pdb_seq_num:se,pdb_mon_id:se,auth_asym_id:se,auth_seq_num:se,auth_mon_id:se},pdbx_chem_comp_related:{comp_id:se,related_comp_id:se,relationship_type:Mt(se),details:se},ihm_starting_model_details:{starting_model_id:se,entity_id:se,entity_description:se,asym_id:se,entity_poly_segment_id:Ie,starting_model_source:Mt(se),starting_model_auth_asym_id:se,starting_model_sequence_offset:Ie,dataset_list_id:Ie},ihm_starting_comparative_models:{id:Ie,starting_model_id:se,starting_model_auth_asym_id:se,starting_model_seq_id_begin:Ie,starting_model_seq_id_end:Ie,template_auth_asym_id:se,template_seq_id_begin:Ie,template_seq_id_end:Ie,template_sequence_identity:vr,template_sequence_identity_denominator:Mt(Ie),template_dataset_list_id:Ie,alignment_file_id:Ie},ihm_starting_model_seq_dif:{id:Ie,entity_id:se,asym_id:se,seq_id:Ie,comp_id:se,starting_model_id:se,db_asym_id:se,db_seq_id:Ie,db_comp_id:se,details:se},ihm_model_representation:{id:Ie,name:se,details:se},ihm_model_representation_details:{id:Ie,representation_id:Ie,entity_poly_segment_id:Ie,entity_id:se,entity_description:se,entity_asym_id:se,model_object_primitive:Mt(se),starting_model_id:se,model_mode:Mt(se),model_granularity:Mt(se),model_object_count:Ie},ihm_struct_assembly_details:{id:Ie,assembly_id:Ie,parent_assembly_id:Ie,entity_description:se,entity_id:se,asym_id:se,entity_poly_segment_id:Ie},ihm_struct_assembly:{id:Ie,name:se,description:se},ihm_modeling_protocol:{id:Ie,num_steps:Ie,protocol_name:se},ihm_modeling_protocol_details:{id:Ie,protocol_id:Ie,step_id:Ie,struct_assembly_id:Ie,dataset_group_id:Ie,struct_assembly_description:se,step_name:se,step_method:se,num_models_begin:Ie,num_models_end:Ie,multi_scale_flag:Mt(bn),multi_state_flag:Mt(bn),ordered_flag:Mt(bn),script_file_id:Ie,software_id:Ie},ihm_multi_state_modeling:{state_id:Ie,state_group_id:Ie,population_fraction:vr,population_fraction_sd:vr,state_type:se,state_name:se,experiment_type:Mt(se),details:se},ihm_modeling_post_process:{id:Ie,protocol_id:Ie,analysis_id:Ie,step_id:Ie,type:Mt(se),feature:Mt(se),num_models_begin:Ie,num_models_end:Ie},ihm_ensemble_info:{ensemble_id:Ie,ensemble_name:se,post_process_id:Ie,model_group_id:Ie,ensemble_clustering_method:Mt(se),ensemble_clustering_feature:Mt(se),num_ensemble_models:Ie,num_ensemble_models_deposited:Ie,ensemble_precision_value:vr,ensemble_file_id:Ie},ihm_model_list:{model_id:Ie,model_name:se,assembly_id:Ie,protocol_id:Ie,representation_id:Ie},ihm_model_group:{id:Ie,name:se,details:se},ihm_model_group_link:{model_id:Ie,group_id:Ie},ihm_model_representative:{id:Ie,model_group_id:Ie,model_id:Ie,selection_criteria:Mt(se)},ihm_dataset_list:{id:Ie,data_type:Mt(se),database_hosted:Mt(bn)},ihm_dataset_group:{id:Ie,name:se,application:Mt(se),details:se},ihm_dataset_group_link:{dataset_list_id:Ie,group_id:Ie},ihm_related_datasets:{dataset_list_id_derived:Ie,dataset_list_id_primary:Ie},ihm_dataset_related_db_reference:{id:Ie,dataset_list_id:Ie,db_name:Mt(se),accession_code:se,version:se,details:se},ihm_external_reference_info:{reference_id:Ie,reference_provider:se,reference_type:Mt(se),reference:se,refers_to:Mt(se),associated_url:se},ihm_external_files:{id:Ie,reference_id:Ie,file_path:se,content_type:Mt(se),file_size_bytes:vr,details:se},ihm_dataset_external_reference:{id:Ie,dataset_list_id:Ie,file_id:Ie},ihm_localization_density_files:{id:Ie,file_id:Ie,ensemble_id:Ie,entity_id:se,entity_poly_segment_id:Ie,asym_id:se},ihm_predicted_contact_restraint:{id:Ie,group_id:Ie,entity_id_1:se,entity_id_2:se,asym_id_1:se,asym_id_2:se,comp_id_1:se,comp_id_2:se,seq_id_1:Ie,seq_id_2:Ie,rep_atom_1:Mt(se),rep_atom_2:Mt(se),distance_lower_limit:vr,distance_upper_limit:vr,probability:vr,restraint_type:Mt(se),model_granularity:Mt(se),dataset_list_id:Ie,software_id:Ie},ihm_cross_link_list:{id:Ie,group_id:Ie,entity_description_1:se,entity_description_2:se,entity_id_1:se,entity_id_2:se,comp_id_1:se,comp_id_2:se,seq_id_1:Ie,seq_id_2:Ie,linker_type:Mt(se),dataset_list_id:Ie},ihm_cross_link_restraint:{id:Ie,group_id:Ie,entity_id_1:se,entity_id_2:se,asym_id_1:se,asym_id_2:se,comp_id_1:se,comp_id_2:se,seq_id_1:Ie,seq_id_2:Ie,atom_id_1:se,atom_id_2:se,restraint_type:Mt(se),conditional_crosslink_flag:Mt(se),model_granularity:Mt(se),distance_threshold:vr,psi:vr,sigma_1:vr,sigma_2:vr},ihm_cross_link_result_parameters:{id:Ie,restraint_id:Ie,model_id:Ie,psi:vr,sigma_1:vr,sigma_2:vr},ihm_2dem_class_average_restraint:{id:Ie,dataset_list_id:Ie,number_raw_micrographs:Ie,pixel_size_width:vr,pixel_size_height:vr,image_resolution:vr,image_segment_flag:Mt(bn),number_of_projections:Ie,struct_assembly_id:Ie,details:se},ihm_2dem_class_average_fitting:{id:Ie,restraint_id:Ie,model_id:Ie,cross_correlation_coefficient:vr,rot_matrix:Qh(3,3),tr_vector:DT(3)},ihm_3dem_restraint:{id:Ie,dataset_list_id:Ie,model_id:Ie,struct_assembly_id:Ie,fitting_method:se,number_of_gaussians:Ie,cross_correlation_coefficient:vr},ihm_sas_restraint:{id:Ie,dataset_list_id:Ie,model_id:Ie,struct_assembly_id:Ie,profile_segment_flag:Mt(bn),fitting_atom_type:se,fitting_method:se,fitting_state:Mt(se),radius_of_gyration:vr,chi_value:vr,details:se},ihm_starting_model_coord:{ordinal_id:Ie,starting_model_id:se,group_PDB:Mt(se),id:Ie,type_symbol:se,entity_id:se,atom_id:se,comp_id:se,seq_id:Ie,asym_id:se,Cartn_x:vr,Cartn_y:vr,Cartn_z:vr,B_iso_or_equiv:vr},ihm_sphere_obj_site:{id:Ie,entity_id:se,seq_id_begin:Ie,seq_id_end:Ie,asym_id:se,Cartn_x:vr,Cartn_y:vr,Cartn_z:vr,object_radius:vr,rmsf:vr,model_id:Ie},ihm_gaussian_obj_site:{id:Ie,entity_id:se,seq_id_begin:Ie,seq_id_end:Ie,asym_id:se,mean_Cartn_x:vr,mean_Cartn_y:vr,mean_Cartn_z:vr,weight:vr,covariance_matrix:Qh(3,3),model_id:Ie},ihm_gaussian_obj_ensemble:{id:Ie,entity_id:se,seq_id_begin:Ie,seq_id_end:Ie,asym_id:se,mean_Cartn_x:vr,mean_Cartn_y:vr,mean_Cartn_z:vr,weight:vr,covariance_matrix:Qh(3,3),ensemble_id:Ie},ihm_feature_list:{feature_id:Ie,feature_type:Mt(se),entity_type:Mt(se)},ihm_poly_residue_feature:{ordinal_id:Ie,feature_id:Ie,entity_id:se,asym_id:se,comp_id_begin:se,comp_id_end:se,seq_id_begin:Ie,seq_id_end:Ie},ihm_derived_distance_restraint:{id:Ie,group_id:Ie,feature_id_1:Ie,feature_id_2:Ie,group_conditionality:Mt(se),random_exclusion_fraction:vr,distance_upper_limit:vr,restraint_type:Mt(se),dataset_list_id:Ie},ma_model_list:{ordinal_id:Ie,model_id:Ie,model_group_id:Ie,model_name:se,model_group_name:se,model_type:Mt(se),data_id:Ie},ma_target_entity:{entity_id:se,data_id:Ie,origin:Mt(se)},ma_target_entity_instance:{asym_id:se,entity_id:se,details:se},ma_target_ref_db_details:{target_entity_id:se,db_name:Mt(se),db_code:se,db_accession:se,seq_db_isoform:se,seq_db_align_begin:se,seq_db_align_end:se,ncbi_taxonomy_id:se,organism_scientific:se},ma_data:{id:Ie,content_type:Mt(se),content_type_other_details:se,name:se},ma_software_group:{ordinal_id:Ie,group_id:Ie,software_id:Ie},ma_qa_metric:{id:Ie,name:se,type:Mt(se),mode:Mt(se),software_group_id:Ie},ma_qa_metric_global:{ordinal_id:Ie,model_id:Ie,metric_id:Ie,metric_value:vr},ma_qa_metric_local:{ordinal_id:Ie,model_id:Ie,label_asym_id:se,label_seq_id:Ie,label_comp_id:se,metric_id:Ie,metric_value:vr}};!function(e){var i;(i=e.IntDataType||(e.IntDataType={}))[i.Int8=1]="Int8",i[i.Int16=2]="Int16",i[i.Int32=3]="Int32",i[i.Uint8=4]="Uint8",i[i.Uint16=5]="Uint16",i[i.Uint32=6]="Uint32",function(i){i[i.Float32=32]="Float32",i[i.Float64=33]="Float64"}(e.FloatDataType||(e.FloatDataType={})),e.getDataType=function n(i){return i instanceof Int8Array?e.IntDataType.Int8:i instanceof Int16Array?e.IntDataType.Int16:i instanceof Int32Array?e.IntDataType.Int32:i instanceof Uint8Array?e.IntDataType.Uint8:i instanceof Uint16Array?e.IntDataType.Uint16:i instanceof Uint32Array?e.IntDataType.Uint32:i instanceof Float32Array?e.FloatDataType.Float32:i instanceof Float64Array?e.FloatDataType.Float64:e.IntDataType.Int32},e.isSignedIntegerDataType=function a(i){if(i instanceof Int8Array||i instanceof Int16Array||i instanceof Int32Array)return!0;for(var o=0,s=i.length;o=0;r--)t=YMe(t,e.encoding[r]);return t}function YMe(e,t){switch(t.kind){case"ByteArray":switch(t.type){case Jr.IntDataType.Uint8:return e;case Jr.IntDataType.Int8:return function XMe(e){return new Int8Array(e.buffer,e.byteOffset)}(e);case Jr.IntDataType.Int16:return function KMe(e){return Vy(e,2,Int16Array)}(e);case Jr.IntDataType.Uint16:return function ZMe(e){return Vy(e,2,Uint16Array)}(e);case Jr.IntDataType.Int32:return function QMe(e){return Vy(e,4,Int32Array)}(e);case Jr.IntDataType.Uint32:return function $Me(e){return Vy(e,4,Uint32Array)}(e);case Jr.FloatDataType.Float32:return function JMe(e){return Vy(e,4,Float32Array)}(e);case Jr.FloatDataType.Float64:return function eRe(e){return Vy(e,8,Float64Array)}(e);default:xn()}case"FixedPoint":return function tRe(e,t){for(var r=e.length,n=WK(t.srcType,r),a=1/t.factor,i=0;i=0?Math.ceil((p+1)/h):Math.ceil((p+1)/(-h-1))}function a(p,h,m){var g=p.limit16;h.pack8+=t(m,p.limit8),h.pack16+=t(m,g),h.count+=1}function i(p,h){p.pack8+=t(h,127),p.pack16+=t(h,32767),p.count+=1}function o(p){return 4*p.count<2*p.pack16?{length:4*p.count,elem:4}:2*p.pack16=0){var s=cRe(e[i],t,r);s<0?n=-1:s>n&&(n=s)}var u=Math.abs(e[i]);if(u>r){var c=Math.floor(Math.log10(Math.abs(u)))+1;c>a&&(a=c)}}return{mantissaDigits:n,integerDigits:a}}(a,4,1e-6),s=o.mantissaDigits;if(s<0||s+o.integerDigits>10)return Ur.by(Ur.byteArray);if(0===s)return q_.classify(a);for(var c=function n(a){for(var i=1,o=0;o 3 or rank 0 are currently not supported.");var f=t.dimensions[0],d=t.dimensions[1],p=t.dimensions[2];for(o=0;o0});return n.length?{instance:r,rowCount:n.reduce(function(o,s){return o+s.rowCount},0),source:n.map(function(o){return{data:o.data,keys:function(){return o.keys?o.keys():yT.Range(0,o.rowCount-1)},rowCount:o.rowCount}})}:{instance:r,rowCount:0,source:[]}}!function(e){function t(a){return new XK([a])}function n(a){switch(a.kind){case"ByteArray":return Ur.byteArray;case"FixedPoint":return Ur.fixedPoint(a.factor);case"IntervalQuantization":return Ur.intervalQuantizaiton(a.min,a.max,a.numSteps);case"RunLength":return Ur.runLength;case"Delta":return Ur.delta;case"IntegerPacking":return Ur.integerPacking;case"StringArray":return Ur.stringArray}}e.by=t,e.fromEncoding=function r(a){for(var i=t(n(a[0])),o=1;o=0?M/A|0:M/T|0}return w+x.length}e.byteArray=u,e.fixedPoint=function l(x){return function(A){return function c(x,A){for(var T=Jr.getDataType(x),w=new Int32Array(x.length),E=0,I=x.length;E=T?w-1:0|Math.round((H-A)/O)}return{encodings:[{kind:"IntervalQuantization",min:A,max:T,numSteps:w,srcType:I}],data:F}}(E,x,A,T,w)}},e.runLength=function p(x){var A=Jr.getDataType(x);if(void 0===A&&(x=new Int32Array(x),A=Jr.IntDataType.Int32),!x.length)return{encodings:[{kind:"RunLength",srcType:A,srcSize:0}],data:new Int32Array(0)};for(var T=2,w=1,E=x.length;w=0)for(;F>=T;)I[M]=T,++M,F-=T;else for(;F<=w;)I[M]=w,++M,F-=w;I[M]=F,++M}var j=u(I);return{encodings:[{kind:"IntegerPacking",byteCount:A.bytesPerElement,isUnsigned:!A.isSigned,srcSize:E},j.encodings[0]],data:j.data}}(x,A)},e.stringArray=function C(x){var A=Object.create(null),T=[],w=new Int32Array(x.length),E=qe.create(Int32Array,1,Math.min(1024,x.length<32?x.length+1:Math.round(x.length/8)+1));qe.add(E,0);for(var I=0,M=0,O=0,F=x;O=0}(u)?(IT(e,u),!0):function ARe(e,t){if(!t)return sn.writeSafe(e,". "),!1;for(var r=t.charCodeAt(0),n=!1,a=0,i=!1,o=!1,s=0,u=t.length-1;s<=u;s++)switch(t.charCodeAt(s)){case 9:case 32:n=!0;break;case 10:return IT(e,t),!0;case 34:if(s&&s===u)break;if(i)return IT(e,t),!0;o=!0,n=!0,a=0;break;case 39:if(s&&s===u)break;if(o)return IT(e,t),!0;i=!0,n=!0,a=1}return!n&&(35===r||36===r||59===r||91===r||93===r||95===r)&&(n=!0),n?(sn.writeSafe(e,a?'"':"'"),sn.writeSafe(e,t),sn.writeSafe(e,a?'" ':"' ")):(sn.writeSafe(e,t),sn.writeSafe(e," ")),!1}(e,u);1===c?function SRe(e,t){sn.writeInteger(e,t),sn.whitespace1(e)}(e,u):function CRe(e,t,r){sn.writeFloat(e,t,r),sn.whitespace1(e)}(e,u,a)}return!1}function $K(e,t,r){for(var n=[],a=0,i=t;a>>0&127|0;else if(i<2048)e[t++]=i>>>6&31|192,e[t++]=i>>>0&63|128;else if(i<65536)e[t++]=i>>>12&15|224,e[t++]=i>>>6&63|128,e[t++]=i>>>0&63|128;else{if(!(i<1114112))throw new Error("bad codepoint "+i);e[t++]=i>>>18&7|240,e[t++]=i>>>12&63|128,e[t++]=i>>>6&63|128,e[t++]=i>>>0&63|128}}}var TRe=function(){for(var e=[],t=0;t<1024;t++)e[t]=String.fromCharCode(t);return e}();function eZ(e){throw new Error(e)}var tZ=typeof TextDecoder<"u"?new TextDecoder:void 0;function QO(e,t,r){if(tZ){var n=t||r!==e.length?e.subarray(t,t+r):e;return tZ.decode(n)}return function DRe(e,t,r){for(var n=TRe,a=void 0,i=0,o=[],u=t,c=t+r;u0&&(a[a.length]=o.slice(0,i).join("")),a.join("")):o.slice(0,i).join("")}(e,t,r)}function PT(e){for(var t=0,r=0,n=e.length;r=0){if(e<128)return 1;if(e<256)return 2;if(e<65536)return 3;if(e<4294967296)return 5;throw new Error("Number too big 0x"+e.toString(16))}if(e>=-32)return 1;if(e>=-128)return 2;if(e>=-32768)return 3;if(e>=-2147483648)return 5;throw new Error("Number too small -0x"+e.toString(16).substr(1))}if("boolean"===t||null==e)return 1;if("object"===t){var a,i=0;if(Array.isArray(e)){a=e.length;for(var o=0;o=0){if(e<128)return t.setUint8(n,e),1;if(e<256)return t.setUint8(n,204),t.setUint8(n+1,e),2;if(e<65536)return t.setUint8(n,205),t.setUint16(n+1,e),3;if(e<4294967296)return t.setUint8(n,206),t.setUint32(n+1,e),5;throw new Error("Number too big 0x"+e.toString(16))}if(e>=-32)return t.setInt8(n,e),1;if(e>=-128)return t.setUint8(n,208),t.setInt8(n+1,e),2;if(e>=-32768)return t.setUint8(n,209),t.setInt16(n+1,e),3;if(e>=-2147483648)return t.setUint8(n,210),t.setInt32(n+1,e),5;throw new Error("Number too small -0x"+(-e).toString(16).substr(1))}if(null==e)return t.setUint8(n,192),1;if("boolean"===a)return t.setUint8(n,e?195:194),1;if("object"===a){var u,c=0,l=Array.isArray(e),f=void 0;if((u=l?e.length:(f=Object.keys(e)).length)<16?(t.setUint8(n,u|(l?144:128)),c=1):u<65536?(t.setUint8(n,l?220:222),t.setUint16(n+1,u),c=3):u<4294967296&&(t.setUint8(n,l?221:223),t.setUint32(n+1,u),c=5),l)for(var d=0;d=0)return!0;return!1}e.Descriptor={name:"struct_conn",cifExport:{prefix:"",categories:[{name:"struct_conn",instance:function(i){var o=e.Provider.get(i.firstModel);if(!o||0===o.entries.length)return Na.Category.Empty;for(var s=i.structures[0],u=[],c=0,l=o.entries;c.95},e.getAtomIndexFromEntries=function n(i){for(var o=new Map,s=0,u=i;sne)){if(!r.forceCompute&&F){for(var Z=F.maxDistance,q=F.bonds,z=q.offset,te=q.b,ae=q.edgeProps,de=ae.order,he=ae.distance,pe=ae.flag,re=ae.key,ee=ae.operatorA,ue=ae.operatorB,ge=j.value($),Ce=qf(m.value($)),ze=z[ge],je=z[ge+1];ze=0&&ye!==X&&ye!==L||we>=0&&we!==L&&we!==X)){var Ee=qf(m.value(V)),Oe=he[ze],Ne=sZ(e,$,t,V),Ue=!1;Oe>=0?Ue=oa(Ne,Oe,.3):Z>=0?Ue=Nea||(n.add(Y,J,{order:ut.order,flag:ut.flags,key:ut.rowIndex}),He=!0)}if(He)continue}if(!H){var st=E.value($),bt=t.lookup3d.find(Gv[0],Gv[1],Gv[2],a),kt=bt.indices,Ot=bt.count,oe=bt.squaredDistances;if(0!==Ot)for(var be=qf(m.value($)),Se=pp(be),Qe=Zh(be),It=v.value($),Tt=j_.has(be),Zt=g.value($),Pr=y.value(o[$]),rr=0;rr=t.elements.length?e:t).elements,s=Xe.indexOf,u=0,c=i.length;u=0)return!0}}return!1}(a,i)}}))}function uZ(e){e.count=e.endVertex-e.startVertex;for(var t=e.isRingAtom,r=e.pred,n=e.color,a=e.depth,i=e.marked,o=0;o=0;l--)v[g++]=e.startVertex+s[l],n[s[l]]=1;Nc(v);for(var y=0,b=e.currentRings.length;y_.length&&Xe.isSubset(v,_))return!1}return e.currentRings.push(Xe.ofSortedArray(v)),!0}function fZ(e,t,r){var n=e.bonds,a=e.startVertex,i=e.endVertex,o=e.isRingAtom,s=e.marked,u=e.queue,c=e.pred,l=e.depth,f=e.unit.elements,d=n.b,p=n.edgeProps.flags,h=n.offset;s[t]=r,l[t]=0,u[0]=t;for(var m=0,v=1;m=i)&&jr.isCovalent(p[x])){if(e.hasAltLoc){var T=e.altLoc.value(f[A]);if(T&&e.currentAltLoc!==T)continue}var w=A-a;if(s[w]===r){if(c[w]!==g&&c[g]!==w&&r4e(e,g,w,o))return r+1;continue}var E=Math.min(l[w],y+1);E>5||(l[w]=E,s[w]=r,u[v++]=w,c[w]=g)}}return r+1}function dZ(e){for(var t=e.length,r=new Int32Array(2*t),n=0;n=v||d.addEdge(a,v)}}}var g=Du.connectedComponents(d.getGraph()),y=g.componentIndex,b=[];for(s=0;s=0&&(r.has(s)?r.get(s).push(o):r.set(s,[o]))}}(function(e){function r(s){return function n4e(e){for(var t=e.length,r=new Array(t),n=0;n0)return!1;var T=Xl.calculateMomentsAxes(mZ(s,u));return S.magnitude(T.dirC)<.05},e.getAltId=function o(s,u){for(var c=s.model.atomicHierarchy.atoms.label_alt_id,l=s.elements,f=0,d=u.length;fBe.max(C)||i(_)this.maxDist[t]&&(this.maxDist[t]=n,bZ(this.extrema[2*t+1],r))},e.prototype.computeSphereExtrema=function(t,r,n){var a=this.dir[t],i=yZ(a,r);i-nthis.maxDist[t]&&(this.maxDist[t]=i+n,b4e(this.extrema[2*t+1],r,a,n))},e.prototype.includeSphere=function(t){if(De.hasExtrema(t)&&t.extrema.length>1)for(var r=0,n=t.extrema;r1)for(var r=0,n=t.extrema;r25e4)return eF(e);var s=function T4e(e){return e>1e4?w4e:A4e}(o);s.reset();for(var u=0;u0)for(var c=parseInt(s.substring(0,u)),l=parseInt(s.substr(u+1)),f=c;f<=l;f++)o[o.length]=f.toString();else o[o.length]=s.trim()}),n[n.length]=o}),n}function L4e(e){if(0!==e._rowCount){for(var t=e.id,r=e.matrix,n=e.vector,a=Lr.struct_ncs_oper.matrix.space,i=Lr.struct_ncs_oper.vector.space,o=[],s=0;s=2){f(d,h[0],h[1]);for(var y=1,b=h.length;y".concat(o," #").concat(s)),v.push("".concat(l,"\xd7").concat(f,"\xd7").concat(d," \u212b")),v.push("\u03b1=".concat(p,"\xb0 \u03b2=").concat(h,"\xb0 \u03b3=").concat(m,"\xb0")),v.join(" | ")}}(Y_||(Y_={})),function(e){e.Descriptor={name:"model_symmetry"},e.Provider=Yl.create(e.Descriptor),e.fromData=function t(n){var a=function E4e(e,t,r){if(!e._rowCount)return[];for(var n=function M4e(e){for(var t=e.id,r=e.matrix,n=e.vector,a=e._schema,i=new Map,o=S(),s=0,u=e._rowCount;s=j)){var N=Xe.indexOf(e.elements,j);if(!(N<0)){var H=h[O],G=m[O];if(!(H>=0&&H!==A||G>=0&&G!==A)){var U=qf(n.value(j)),Q=f[O],W=BRe(e,w,j),K=!1;Q>=0?K=oa(W,Q,.3):i>=0?K=W1&&(N=!1)}}}}}}}}return rZ(A,T,E,w,I,s,F||j&&N)}(e,r)}(this),U.set(this.elements,Q)),this.props.bonds=Q,this.props.bonds},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"rings",{get:function(){return this.props.rings||(this.props.rings=kT.create(this)),this.props.rings},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"resonance",{get:function(){return this.props.resonance||(this.props.resonance=function U4e(e){return{delocalizedTriplets:V4e(e)}}(this)),this.props.resonance},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"polymerElements",{get:function(){return this.props.polymerElements||(this.props.polymerElements=function f4e(e){for(var t=[],r=e.elements,a=e.model.atomicHierarchy.residueAtomSegments,i=e.model.atomicHierarchy.derived.residue.traceElementIndex,o=wn.transientSegments(e.model.atomicRanges.polymerRanges,r),s=tr.transientSegments(a,r);o.hasNext;){var u=o.move();for(s.setSegment(u);s.hasNext;){var c=s.move(),d=c.index;if(Be.areIntersecting(xe.ofRange(r[c.start],r[c.end-1]),r)){var p=i[d];t.push(-1===p?a.offsets[d]:p)}}}return Xe.ofSortedArray(t)}(this)),this.props.polymerElements},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"gapElements",{get:function(){return this.props.gapElements||(this.props.gapElements=function p4e(e){for(var t=[],r=e.elements,a=e.residueIndex,i=e.model.atomicHierarchy.residueAtomSegments,o=e.model.atomicHierarchy.derived.residue.traceElementIndex,s=wn.transientSegments(e.model.atomicRanges.gapRanges,e.elements);s.hasNext;){var u=s.move(),c=a[r[u.start]],l=a[r[u.end-1]],f=o[c],d=o[l];t.push(-1===f?i.offsets[c]:f),t.push(-1===d?i.offsets[l]:d)}return Xe.ofSortedArray(t)}(this)),this.props.gapElements},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"nucleotideElements",{get:function(){return this.props.nucleotideElements||(this.props.nucleotideElements=function m4e(e){for(var t=[],r=e.elements,n=e.model,a=n.atomicHierarchy,o=a.residueAtomSegments,s=n.atomicHierarchy.derived.residue,u=s.moleculeType,c=s.traceElementIndex,l=tr.transientSegments(a.chainAtomSegments,r),f=tr.transientSegments(o,r);l.hasNext;)for(f.setSegment(l.move());f.hasNext;){var d=f.move().index;if(eu(u[d])){var p=c[d];t.push(-1===p?o.offsets[d]:p)}}return Xe.ofSortedArray(t)}(this)),this.props.nucleotideElements},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"proteinElements",{get:function(){return this.props.proteinElements||(this.props.proteinElements=function v4e(e){for(var t=[],r=e.elements,n=e.model,a=n.atomicHierarchy,o=a.residueAtomSegments,s=n.atomicHierarchy.derived.residue,u=s.moleculeType,c=s.traceElementIndex,l=tr.transientSegments(a.chainAtomSegments,r),f=tr.transientSegments(o,r);l.hasNext;)for(f.setSegment(l.move());f.hasNext;){var d=f.move().index;if(VK(u[d])){var p=c[d];t.push(-1===p?o.offsets[d]:p)}}return Xe.ofSortedArray(t)}(this)),this.props.proteinElements},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"residueCount",{get:function(){if(void 0!==this.props.residueCount)return this.props.residueCount;for(var U=0,Q=tr.transientSegments(this.model.atomicHierarchy.residueAtomSegments,this.elements);Q.hasNext;)Q.move(),U+=1;return this.props.residueCount=U,this.props.residueCount},enumerable:!1,configurable:!0}),G.prototype.getResidueIndex=function(U){return this.residueIndex[this.elements[U]]},G}();e.Atomic=g;var b=function(){function G(U,Q,W,K,ne,X,L,Y,$){this.kind=X,this.objectPrimitive=1===X?"sphere":"gaussian",this.id=U,this.invariantId=Q,this.chainGroupId=W,this.traits=K,this.model=ne,this.elements=L,this.conformation=Y,this.coarseElements=1===X?ne.coarseHierarchy.spheres:ne.coarseHierarchy.gaussians,this.coarseConformation=1===X?ne.coarseConformation.spheres:ne.coarseConformation.gaussians,this.props=$}return G.prototype.getChild=function(U){return U.length===this.elements.length?this:T(this.id,this.invariantId,this.chainGroupId,this.traits,this.model,this.kind,U,this.conformation,{})},G.prototype.applyOperator=function(U,Q,W){void 0===W&&(W=!1);var K=W?Q:ua.compose(this.conformation.operator,Q);return T(U,this.invariantId,this.chainGroupId,this.traits,this.model,this.kind,this.elements,ua.createMapping(K,this.getCoarseConformation(),this.conformation.r),this.props)},G.prototype.remapModel=function(U,Q,W){var K=this.getCoarseConformation(),ne=_(this.kind,U);W||(W=R({},this.props),e.isSameConformation(this,U)||(W.boundary=void 0,W.lookup3d=void 0,W.principalAxes=void 0));var X=K!==ne?ua.createMapping(this.conformation.operator,ne):this.conformation;return new G(this.id,this.invariantId,this.chainGroupId,this.traits,U,this.kind,this.elements,X,W)},Object.defineProperty(G.prototype,"boundary",{get:function(){if(this.props.boundary)return this.props.boundary;var U=this.getCoarseConformation(),Q=U.x,W=U.y,K=U.z;return this.props.boundary=p.is(this.traits,d.FastBoundary)?eF({x:Q,y:W,z:K,indices:this.elements}):mp({x:Q,y:W,z:K,indices:this.elements}),this.props.boundary},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"lookup3d",{get:function(){if(this.props.lookup3d)return this.props.lookup3d;var U=this.getCoarseConformation();return this.props.lookup3d=up({x:U.x,y:U.y,z:U.z,indices:this.elements},this.boundary),this.props.lookup3d},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"principalAxes",{get:function(){return this.props.principalAxes||(this.props.principalAxes=gZ(this)),this.props.principalAxes},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"polymerElements",{get:function(){return this.props.polymerElements||(this.props.polymerElements=function d4e(e){for(var t=[],r=e.elements,a=e.model.coarseHierarchy,i=a.spheres,o=a.gaussians,s=ke.isSpheres(e)?i.polymerRanges:o.polymerRanges,u=wn.transientSegments(s,r);u.hasNext;)for(var c=u.move(),f=c.end,d=c.start;d=a},i.closeUnitsResult);if(0===l.count)return o;for(var f=0,d=-Number.MAX_VALUE,p=0,h=l.count;p=a&&do||u.addElement(y[g.indices[b]])}u.commitUnit()}}},e.prototype.check=function(t,r,n,a){var i=this.structure.units,o=this.unitLookup.find(t,r,n,a);if(0===o.count)return!1;for(var s=0,u=o.count;s0&&(a[a.length]=s.getChild(c))}else a[a.length]=s}return Ye.create(a,{parent:e.parent||t.parent})}function nF(e){return jr.isCovalent(e.atomicBond.type)}function j4e(){return function(t){for(var r=t.inputStructure,n=at.create(r),a=[],i=0,o=r.units;i=8)continue}a.push(s)}}}return mt.Singletons(r,Ye.create(a,{parent:r}))}}function Y4e(){return function(t){for(var r=t.inputStructure,n=[],a=0,i=r.units;a2)g.push(v[C],v[x-1]);else for(var A=C;Awn.max(m.ranges)){for(wn.forEach(m.ranges,function(N,H){return w[H]=x[N]}),I=0,M=T;IXe.max(m.set)){for(I=0,M=T;I0?this.currentAtomicBondStack.pop():void 0},e.prototype.pushCurrentStructure=function(){this.currentStructure&&this.currentStructureStack.push(this.currentStructure)},e.prototype.popCurrentStructure=function(){this.currentStructure=this.currentStructureStack.length?this.currentStructureStack.pop():void 0},e.prototype.pushInputStructure=function(t){this.inputStructureStack.push(this.inputStructure),this.inputStructure=t},e.prototype.popInputStructure=function(){if(0===this.inputStructureStack.length)throw new Error("Must push before pop.");this.inputStructure=this.inputStructureStack.pop()},e.prototype.throwIfTimedOut=function(){if(0!==this.timeoutMs&&da()-this.timeCreated>this.timeoutMs)throw new Error("The query took too long to execute (> ".concat(this.timeoutMs/1e3,"s)."))},e.prototype.tryGetCurrentSelection=function(){if(!this.currentSelection)throw new Error("The current selection is not assigned.");return this.currentSelection},e}(),DZ=function(){function e(){this.a=at.create(void 0),this.aIndex=0,this.b=at.create(void 0),this.bIndex=0,this.type=0,this.order=0,this.key=-1,this.testFn=nF}return e.prototype.setStructure=function(t){this.a.structure=t,this.b.structure=t},e.prototype.setTestFn=function(t){this.testFn=t||nF},e.prototype.test=function(t,r){return!!this.testFn(t)||!!r&&(this.swap(),this.testFn(t))},e.prototype.swap=function(){var t=this.aIndex;this.aIndex=this.bIndex,this.bIndex=t;var r=this.a.unit;this.a.unit=this.b.unit,this.b.unit=r;var n=this.a.element;this.a.element=this.b.element,this.b.element=n},Object.defineProperty(e.prototype,"length",{get:function(){return at.distance(this.a,this.b)},enumerable:!1,configurable:!0}),e}();!function(e){e.run=function t(r,n,a){return r(new Hc(n,a))}}(EZ||(EZ={}));var aF=function(){function e(t){this.source=t,this.set=RO(Ye.hashCode,Ye.areUnitIdsAndIndicesEqual),this.structures=[],this.allSingletons=!0}return e.prototype.add=function(t){t.elementCount&&(1!==t.elementCount&&(this.allSingletons=!1),this.set.add(t)&&(this.structures[this.structures.length]=t))},e.prototype.getSelection=function(){return this.allSingletons?mt.Singletons(this.source,X_(this.source,this.structures)):mt.Sequence(this.source,this.structures)},e}(),X4e=function(){function e(t){this.source=t,this.builders=[],this.builderMap=new Map}return e.prototype.add=function(t,r,n){var a=this.builderMap.get(t);a||(a=this.source.subsetBuilder(!0),this.builders[this.builders.length]=a,this.builderMap.set(t,a)),a.addToUnit(r,n)},e.prototype.allSingletons=function(){for(var t=0,r=this.builders.length;t1)return!1;return!0},e.prototype.singletonSelection=function(){for(var t=this.source.subsetBuilder(!0),r=at.create(this.source),n=0,a=this.builders.length;n0?kn.create():this.currentUnit},e.prototype.addElement=function(t){kn.add(this.currentUnit,t,t)&&this.elementCount++},e.prototype.commitUnit=function(){0===this.currentUnit.array.length||this.unitMap.has(this.parentId)||(this.ids[this.ids.length]=this.parentId,this.unitMap.set(this.parentId,this.currentUnit),this.parentId=-1)},e.prototype.getStructure=function(){if(this.isEmpty)return Ye.Empty;var t=[];Nc(this.ids);for(var r=Kf.UnitEquivalenceBuilder(),n=0,a=this.ids.length;n1&&Nc(s);var c=o.getChild(Xe.ofSortedArray(s)),l=r.add(c.id,c);c!==l&&(c=l.applyOperator(c.id,c.conformation.operator,!0)),t[t.length]=c}else t[t.length]=o,r.add(o.id,o)}return Ye.create(t,{parent:this.parent})},Object.defineProperty(e.prototype,"isEmpty",{get:function(){return 0===this.elementCount},enumerable:!1,configurable:!0}),e}();function lt(e){return{data:e,position:0,length:e.length,lineNumber:1,tokenStart:0,tokenEnd:0}}function PZ(e){for(;e.position=e.length)e.tokenType=6;else{e.tokenStart=e.position,e.tokenEnd=e.position,e.isEscaped=!1;var r=e.data.charCodeAt(e.position);switch(r){case 35:(function cke(e){for(;e.position=5&&95===e.data.charCodeAt(e.tokenStart+4)?function fke(e){var t=e.data.charCodeAt(e.tokenStart);return!(68!==t&&100!==t||(t=e.data.charCodeAt(e.tokenStart+1),65!==t&&97!==t)||(t=e.data.charCodeAt(e.tokenStart+2),84!==t&&116!==t)||(t=e.data.charCodeAt(e.tokenStart+3),65!==t&&97!==t))}(e)?0:function dke(e){var t=e.data.charCodeAt(e.tokenStart);return!(83!==t&&115!==t||(t=e.data.charCodeAt(e.tokenStart+1),65!==t&&97!==t)||(t=e.data.charCodeAt(e.tokenStart+2),86!==t&&118!==t)||(t=e.data.charCodeAt(e.tokenStart+3),69!==t&&101!==t))}(e)?1:function pke(e){if(e.tokenEnd-e.tokenStart!=5)return!1;var t=e.data.charCodeAt(e.tokenStart);return!(76!==t&&108!==t||(t=e.data.charCodeAt(e.tokenStart+1),79!==t&&111!==t)||(t=e.data.charCodeAt(e.tokenStart+2),79!==t&&111!==t)||(t=e.data.charCodeAt(e.tokenStart+3),80!==t&&112!==t))}(e)?2:3:3}}}function tm(e){for(OZ(e);5===e.tokenType;)OZ(e)}function LT(){return{categoryNames:[],categoryData:Object.create(null)}}function cF(e,t){for(var r=Object.create(null),n=0,a=e;n0&&r.push(FZ(i,a,o)),a=e.substring(n.tokenStart+5,n.tokenEnd),i=LT(),o=[],tm(n),[3,6]);case 2:if(1!==l)return[3,3];if(n.tokenEnd-n.tokenStart==5)s.categoryNames.length>0&&(o[o.length]=function yke(e,t){return TO(e.categoryNames,cF(e.categoryNames,e.categoryData),t)}(s,c)),n.inSaveFrame=!1;else{if(n.inSaveFrame)return[2,Hy(n.lineNumber,"Save frames cannot be nested.")];n.inSaveFrame=!0,c=e.substring(n.tokenStart+5,n.tokenEnd),s=LT()}return tm(n),[3,6];case 3:return 2!==l?[3,5]:[4,Cke(n,n.inSaveFrame?s:i)];case 4:return(f=d.sent()).hasError?[2,Hy(f.errorLine,f.errorMessage)]:[3,6];case 5:if(4!==l)return console.log(n.tokenType,lt.getTokenString(n)),[2,Hy(n.lineNumber,"Unexpected token. Expected data_, loop_, or data name.")];if(f=function bke(e,t){for(var r=e.tokenStart,n=RZ(e),a=kZ(e,n),i=Object.create(null),o=[],s=!0;s;){if(4!==e.tokenType||!mke(e,r,n)){s=!1;break}var u=uF(e).substring(a.length+1);if(tm(e),3!==e.tokenType)return{hasError:!0,errorLine:e.lineNumber,errorMessage:"Expected value."};i[u]=ht.ofTokens({data:e.data,indices:[e.tokenStart,e.tokenEnd],count:1}),o[o.length]=u,tm(e)}return lF(t,a.substr(1),1,o,i),{hasError:!1,errorLine:0,errorMessage:""}}(n,n.inSaveFrame?s:i),f.hasError)return[2,Hy(f.errorLine,f.errorMessage)];d.label=6;case 6:return[3,1];case 7:return n.inSaveFrame?[2,Hy(n.lineNumber,"Unfinished save frame (".concat(u.header,")."))]:((i.categoryNames.length>0||o.length>0)&&r.push(FZ(i,a,o)),[2,xke(sK(r))])}})})}function NZ(e){var t=this;return Ve.create("Parse CIF",function(r){return ce(t,void 0,void 0,function(){return le(this,function(n){switch(n.label){case 0:return[4,wke(e,r)];case 1:return[2,n.sent()]}})})})}function BZ(e){return VT({buffer:e,offset:0,dataView:new DataView(e.buffer)})}function fF(e,t){for(var r={},n=0;nt[r])return!1;return!0}(n,a.version.match(/(\d)\.(\d)\.\d/).slice(1).map(function(s){return+s}))?(i=sK(a.dataBlocks.map(function(s){for(var u=Object.create(null),c=0,l=s.categories;c=x;)T=C.charCodeAt(--A);return y.tokenStart=x,y.tokenEnd=A+1,y.position=_,y}e.getTokenString=t,e.reset=function r(y){y.position=0,y.lineNumber=1,y.tokenStart=0,y.tokenEnd=0},e.eatLine=n,e.markStart=function a(y){y.tokenStart=y.position},e.markLine=i,e.readLine=function o(y){return i(y),t(y)},e.readLineTrim=function s(y){i(y);var b=y.position;return g(y,y.tokenStart,y.tokenEnd),y.position=b,t(y)},e.markLines=function c(y,b){var _=Ke.create(y.data,2*b);return u(y,b,_),_},e.readLines=function l(y,b){for(var _=[],C=0;Cc.indicesLenMinus2&&function t(o){var s=new Uint32Array(1.61*o.indices.length|0);s.set(o.indices),o.indices=s,o.indicesLenMinus2=s.length-2|0}(c),c.indices[c.offset++]=s,c.indices[c.offset++]=u,o.count++}e.add=r,e.addToken=function n(o,s){r(o,s.tokenStart,s.tokenEnd)},e.addUnchecked=function a(o,s,u){o.indices[o.offset++]=s,o.indices[o.offset++]=u,o.count++},e.create=function i(o,s){return{data:o,indicesLenMinus2:(s=Math.max(10,s))-2|0,count:0,offset:0,indices:new Uint32Array(s)}}}(Ke||(Ke={})),function(e){e.error=function t(i,o){return void 0===o&&(o=-1),new n(i,o)},e.success=function r(i,o){return void 0===o&&(o=[]),new a(i,o)};var n=function(){function i(o,s){this.message=o,this.line=s,this.isError=!0}return i.prototype.toString=function(){return this.line>=0?"[Line ".concat(this.line,"] ").concat(this.message):this.message},i}();e.Error=n;var a=function(){return function i(o,s){this.result=o,this.warnings=s,this.isError=!1}}();e.Success=a}(Fn||(Fn={}));var vF,jv,Hv=ie.Schema,Hn=Hv.str,UZ=Hv.List,Wf=Hv.lstr,fc=Hv.Aliased,K_=Hv.int,jy=Hv.coord,Ike={chem_comp:{formula:Hn,formula_weight:Hv.float,id:Hn,mon_nstd_parent_comp_id:UZ(",",function(e){return e}),name:Hn,one_letter_code:Hn,three_letter_code:Hn,type:fc(Wf),pdbx_synonyms:UZ(";",function(e){return e}),pdbx_type:Hn,pdbx_ambiguous_flag:Hn,pdbx_replaced_by:Hn,pdbx_replaces:Hn,pdbx_formal_charge:K_,pdbx_model_coordinates_details:Hn,pdbx_model_coordinates_db_code:Hn,pdbx_ideal_coordinates_details:Hn,pdbx_ideal_coordinates_missing_flag:fc(Wf),pdbx_model_coordinates_missing_flag:fc(Wf),pdbx_initial_date:Hn,pdbx_modified_date:Hn,pdbx_release_status:fc(Hn),pdbx_processing_site:fc(Hn)},chem_comp_atom:{alt_atom_id:Hn,atom_id:Hn,charge:K_,model_Cartn_x:jy,model_Cartn_y:jy,model_Cartn_z:jy,comp_id:Hn,type_symbol:Hn,pdbx_align:K_,pdbx_ordinal:K_,pdbx_model_Cartn_x_ideal:jy,pdbx_model_Cartn_y_ideal:jy,pdbx_model_Cartn_z_ideal:jy,pdbx_stereo_config:fc(Wf),pdbx_aromatic_flag:fc(Wf),pdbx_leaving_atom_flag:fc(Wf)},chem_comp_bond:{atom_id_1:Hn,atom_id_2:Hn,comp_id:Hn,value_order:fc(Wf),pdbx_ordinal:K_,pdbx_stereo_config:fc(Wf),pdbx_aromatic_flag:fc(Wf)},pdbx_chem_comp_descriptor:{comp_id:Hn,descriptor:Hn,type:fc(Wf),program:Hn,program_version:Hn},pdbx_chem_comp_identifier:{comp_id:Hn,identifier:Hn,type:fc(Hn),program:Hn,program_version:Hn}},Z_=ie.Schema,lr=Z_.str,vp=Z_.lstr,tu=Z_.Aliased,jc=Z_.int,Mke={pdbx_reference_molecule:{prd_id:lr,formula_weight:Z_.float,formula:lr,type:tu(vp),type_evidence_code:lr,class:tu(vp),class_evidence_code:lr,name:lr,represent_as:tu(vp),chem_comp_id:lr,compound_details:lr,description:lr,representative_PDB_id_code:lr,release_status:tu(vp),replaces:lr,replaced_by:lr},pdbx_reference_entity_list:{prd_id:lr,ref_entity_id:lr,type:tu(vp),details:lr,component_id:jc},pdbx_reference_entity_nonpoly:{prd_id:lr,ref_entity_id:lr,name:lr,chem_comp_id:lr},pdbx_reference_entity_link:{link_id:jc,prd_id:lr,details:lr,ref_entity_id_1:lr,ref_entity_id_2:lr,entity_seq_num_1:jc,entity_seq_num_2:jc,comp_id_1:lr,comp_id_2:lr,atom_id_1:lr,atom_id_2:lr,value_order:tu(vp),component_1:jc,component_2:jc,link_class:tu(lr)},pdbx_reference_entity_poly_link:{link_id:jc,prd_id:lr,ref_entity_id:lr,component_id:jc,entity_seq_num_1:jc,entity_seq_num_2:jc,comp_id_1:lr,comp_id_2:lr,atom_id_1:lr,atom_id_2:lr,value_order:tu(vp)},pdbx_reference_entity_poly:{prd_id:lr,ref_entity_id:lr,type:tu(lr),db_code:lr,db_name:lr},pdbx_reference_entity_poly_seq:{prd_id:lr,ref_entity_id:lr,mon_id:lr,parent_mon_id:lr,num:jc,observed:tu(vp),hetero:tu(vp)},pdbx_reference_entity_sequence:{prd_id:lr,ref_entity_id:lr,type:tu(lr),NRP_flag:tu(lr),one_letter_codes:lr},pdbx_reference_entity_src_nat:{prd_id:lr,ref_entity_id:lr,ordinal:jc,organism_scientific:lr,taxid:lr,db_code:lr,db_name:lr},pdbx_prd_audit:{prd_id:lr,date:lr,processing_site:tu(lr),action_type:tu(lr)}},VZ=ie.Schema,Ti=VZ.str,zke={datablock:{id:Ti,description:Ti},dictionary:{title:Ti,datablock_id:Ti,version:Ti},dictionary_history:{version:Ti,update:Ti,revision:Ti},sub_category:{id:Ti,description:Ti},category_group_list:{id:Ti,parent_id:Ti,description:Ti},item_type_list:{code:Ti,primitive_code:Ti,construct:Ti,detail:Ti},item_units_list:{code:Ti,detail:Ti},item_units_conversion:{from_code:Ti,to_code:Ti,operator:Ti,factor:VZ.float}},Q_=ie.Schema,Yf=Q_.str,zT=Q_.int,gp=Q_.float,GT=Q_.Aliased,rm=Q_.Vector,zZ=(GT(Yf),GT(Yf),GT(Yf),GT(Yf),rm(3),rm(3),{volume_data_3d_info:{name:Yf,axis_order:rm(3,zT),origin:rm(3),dimensions:rm(3),sample_rate:zT,sample_count:rm(3,zT),spacegroup_number:zT,spacegroup_cell_size:rm(3),spacegroup_cell_angles:rm(3),mean_source:gp,mean_sampled:gp,sigma_source:gp,sigma_sampled:gp,min_source:gp,min_sampled:gp,max_source:gp,max_sampled:gp},volume_data_3d:{values:gp}}),HT=ie.Schema,ni=HT.float,hF=HT.int,ea=HT.str,Hke={cell:{angle_alpha:ni,angle_beta:ni,angle_gamma:ni,formula_units_z:hF,length_a:ni,length_b:ni,length_c:ni,volume:ni},chemical:{melting_point:ni,name_common:ea,name_systematic:ea},chemical_formula:{moiety:ea,sum:ea,weight:ni},space_group:{crystal_system:ea,it_number:hF,"name_h-m_full":ea},space_group_symop:{operation_xyz:ea},geom_bond:{atom_site_label_1:ea,atom_site_label_2:ea,distance:ni,publ_flag:ea,site_symmetry_1:ea,site_symmetry_2:ea,valence:ni},audit:{block_doi:ea},database_code:{cod:ea,csd:ea,depnum_ccdc_archive:ea,depnum_ccdc_fiz:ea,icsd:ea,mdf:ea,nbs:ea},atom_site:{adp_type:ea,calc_flag:ea,disorder_assembly:ea,disorder_group:ea,fract_x:ni,fract_y:ni,fract_z:ni,label:ea,occupancy:ni,refinement_flags:ea,site_symmetry_multiplicity:hF,type_symbol:ea,u_iso_or_equiv:ni},atom_site_aniso:{label:ea,u_11:ni,u:(0,HT.Matrix)(3,3),u_12:ni,u_13:ni,u_22:ni,u_23:ni,u_33:ni},atom_type:{description:ea,symbol:ea},atom_type_scat:{dispersion_imag:ni,dispersion_real:ni,source:ea}},jke={"cell.formula_units_z":["cell_formula_units_Z"],"space_group.it_number":["space_group_IT_number","symmetry_Int_Tables_number"],"space_group.name_h-m_full":["symmetry_space_group_name_H-M"],"space_group_symop.operation_xyz":["symmetry_equiv_pos_as_xyz"],"geom_bond.atom_site_label_1":["geom_bond_atom_site_id_1"],"geom_bond.atom_site_label_2":["geom_bond_atom_site_id_2"],"geom_bond.distance":["geom_bond_dist"],"audit.block_doi":["audit_block_DOI"],"database_code.cod":["database_code_COD"],"database_code.csd":["database_code_CSD"],"database_code.depnum_ccdc_archive":["database_code_depnum_CCDC_archive"],"database_code.depnum_ccdc_fiz":["database_code_depnum_CCDC_fiz"],"database_code.icsd":["database_code_ICSD"],"database_code.mdf":["database_code_MDF"],"database_code.nbs":["database_code_NBS"],"atom_site.adp_type":["atom_site_ADP_type","atom_site_thermal_displace_type"],"atom_site.label":["atom_site_id"],"atom_site.site_symmetry_multiplicity":["atom_site_symmetry_multiplicity"],"atom_site.u_iso_or_equiv":["atom_site_U_iso_or_equiv"],"atom_site_aniso.label":["atom_site_anisotrop_id"],"atom_site_aniso.u_11":["atom_site_aniso_U_11","atom_site_anisotrop_U_11"],"atom_site_aniso.u_12":["atom_site_aniso_U_12","atom_site_anisotrop_U_12"],"atom_site_aniso.u_13":["atom_site_aniso_U_13","atom_site_anisotrop_U_13"],"atom_site_aniso.u_22":["atom_site_aniso_U_22","atom_site_anisotrop_U_22"],"atom_site_aniso.u_23":["atom_site_aniso_U_23","atom_site_anisotrop_U_23"],"atom_site_aniso.u_33":["atom_site_aniso_U_33","atom_site_anisotrop_U_33"]},mF=ie.Schema.int,Wke={volume_data_3d_info:zZ.volume_data_3d_info,segmentation_data_table:{set_id:mF,segment_id:mF},segmentation_data_3d:{values:mF}},Zl={parse:function(e){return"string"==typeof e?NZ(e):LZ(e)},parseText:NZ,parseBinary:LZ,toDatabaseCollection:function VIe(e,t,r){for(var n={},a=0,i=t.blocks;al||v===l&&c.value(m)===f)break;m++}}!function(e){e.Descriptor={name:"model_secondary_structure"},e.Provider=Yl.create(e.Descriptor),e.fromStruct=function t(r,n,a){var i=new Map,o=[{kind:"none"}],s=function rOe(e,t){if(e._rowCount>0){if(0!==e.beg_label_seq_id.valueKind(0)||0!==e.end_label_seq_id.valueKind(0))return"auth"}else if(t&&(0!==t.beg_label_seq_id.valueKind(0)||0!==t.end_label_seq_id.valueKind(0)))return"auth";return"label"}(r,n);(function nOe(e,t,r,n){if(e._rowCount)for(var a=e.beg_label_asym_id,s=e.pdbx_beg_PDB_ins_code,l=e.pdbx_end_PDB_ins_code,f=e.pdbx_PDB_helix_class,d=e.conf_type_id,p=e.details,h="label"===t?e.beg_label_seq_id:e.beg_auth_seq_id,m="label"===t?e.end_label_seq_id:e.end_auth_seq_id,v=0,g=e._rowCount;v0&&function oOe(e,t,r,n){for(var a=e.chainAtomSegments.count,i=e.chains.label_asym_id,o=e.residues,c=o.pdbx_PDB_ins_code,l="label"===t?o.label_seq_id:o.auth_seq_id,f=0;f0},e.writeMmCif=function s(u,c){u.writeCategory({name:r,instance:function(){var l=Qr.ofRows(e.Schema.molstar_global_model_transform_info,[{matrix:c}]);return Na.Category.ofTable(l)}})}}(Wv||(Wv={})),R(R({},Lr.chem_comp_bond),{molstar_protonation_variant:ie.Schema.Str()});var uOe=R(R({},Lr.chem_comp),{type:ie.Schema.Aliased(ie.Schema.str)});function cOe(e,t){var r=t.ihm_model_group,n=t.ihm_model_group_link,a=Qr.pickRow(n,function(o){return n.model_id.value(o)===e});if(a){var i=Qr.pickRow(r,function(o){return r.id.value(o)===a.group_id});if(i)return i.name}return""}function HZ(e){for(var t=0,r=e.rowCount;t0||(b[b.length]=_);return x=ie.ofConst("A",C=b.length,ie.Schema.str),A=ie.ofConst(1,C,ie.Schema.int),T=ie.ofConst("1",C,ie.Schema.str),w=ie.ofConst(1,C,ie.Schema.float),E=ie.ofConst(1,C,ie.Schema.int),I=ie.view(p,b),M=ie.view(m,b),O=ie.view(i[u],b),F=ie.view(i[c],b),j=ie.view(i[l],b),N=ie.view(v,b),H=ie.view(g,b),G=ie.view(h,b),U=Qr.ofPartialColumns(Vo.atom_site,{auth_asym_id:x,auth_atom_id:I,auth_comp_id:M,auth_seq_id:A,Cartn_x:O,Cartn_y:F,Cartn_z:j,id:N,label_asym_id:x,label_atom_id:I,label_comp_id:M,label_seq_id:A,label_entity_id:T,occupancy:w,type_symbol:H,pdbx_PDB_model_num:E,pdbx_formal_charge:G},C),(Q=new Ql).setNames([[d,"".concat(f," (").concat(s,")")]]),Q.getEntityId(d,0,"A"),(W=new $l(A,g)).setNames([[d,"".concat(f," (").concat(s,")")]]),W.add(d,0),[4,$f(qc({entity:Q.getEntityTable(),chem_comp:W.getChemCompTable(),atom_site:U}),t,n)];case 1:return(ne=Y.sent()).representative?(X=ne.representative,L=zv.getEntriesFromChemCompBond(o),zv.Provider.set(X,{data:o,entries:L}),eS.CoordinateType.set(X,s),[2,ne.representative]):[2]}})})}ri.Provider.formatRegistry.add("mmCIF",function mOe(e){if(In.is(e.sourceData))return ri.fromData(e.sourceData.data.db)}),qv.Provider.formatRegistry.add("mmCIF",function vOe(e){if(In.is(e.sourceData)){var t=e.sourceData.data.db;return qv.fromStruct(t.struct_conf,t.struct_sheet_range,e.atomicHierarchy)}}),Xf.Provider.formatRegistry.add("mmCIF",function gOe(e){if(In.is(e.sourceData)){var t=e.sourceData.data.db.atom_site_anisotrop;return{data:Qr.ofColumns(Xf.Schema,t),elementToAnsiotrop:Xf.getElementToAnsiotrop(e.atomicConformation.atomId,t.id)}}},function yOe(e){return!!In.is(e.sourceData)&&e.sourceData.data.db.atom_site_anisotrop.U.isDefined}),zv.Provider.formatRegistry.add("mmCIF",function bOe(e){if(In.is(e.sourceData)){var t=e.sourceData.data.db.chem_comp_bond;if(0!==t._rowCount)return{data:t,entries:zv.getEntriesFromChemCompBond(t)}}}),cc.Provider.formatRegistry.add("mmCIF",function _Oe(e){if(In.is(e.sourceData)){var t=e.sourceData.data.db.struct_conn;if(0!==t._rowCount){var r=cc.getEntriesFromStructConn(t,e);return{data:t,byAtomIndex:cc.getAtomIndexFromEntries(r),entries:r}}}}),Wv.Provider.formatRegistry.add("mmCIF",Wv.fromMmCif,Wv.hasData),function(e){e.is=function t(n){return"mmCIF"===n?.kind},e.fromFrame=function r(n,a,i,o){return a||(a=Zl.schema.mmCIF(n)),{kind:"mmCIF",name:a._name,data:{db:a,file:o,frame:n,source:i}}}}(In||(In={})),function(e){var t="__CcdCoordinateType__";e.CoordinateType={get:function(a){return a._staticPropertyData[t]},set:function(a,i){return a._staticPropertyData[t]=i}},e.is=function r(a){return"CCD"===a?.kind},e.fromFrame=function n(a,i){return i||(i=Zl.schema.CCD(a)),{kind:"CCD",name:i._name,data:{db:i,frame:a}}}}(eS||(eS={}));var Yv=typeof process<"u"&&null!=process.versions&&null!=process.versions.node,tS=function xOe(){return typeof XMLHttpRequest>"u"||Yv?Nr(744):XMLHttpRequest}(),yF=function wOe(){return typeof File>"u"||Yv?function(){function t(r,n,a){var i;this.blob=new Blob(r,a),this.size=this.blob.size,this.type=this.blob.type,this.name=n,this.lastModified=null!==(i=a?.lastModified)&&void 0!==i?i:0,this.webkitRelativePath=""}return t.prototype.arrayBuffer=function(){return this.blob.arrayBuffer()},t.prototype.slice=function(r,n,a){return this.blob.slice(r,n,a)},t.prototype.stream=function(){return this.blob.stream()},t.prototype.text=function(){return this.blob.text()},t}():File}();function nm(e,t){return e[t]|e[t+1]<<8}function Xv(e,t,r){e[t]=255&r,e[t+1]=r>>8&255}function Kv(e,t){return 16777216*e[t+3]+(e[t+2]<<16|e[t+1]<<8|e[t])}function yp(e,t,r){e[t]=255&r,e[t+1]=r>>8&255,e[t+2]=r>>16&255,e[t+3]=r>>24&255}function DOe(e){return e.length<2?"0"+e:e}function YZ(e){for(var t=e.length,r=0,n=0;n>>1:r>>>=1;e[t]=r}return e}();function XZ(e,t,r){return 4294967295^function MOe(e,t,r,n){for(var a=0;a>>8;return e}(4294967295,e,t,r)}var gt=function(){var e=Uint16Array,t=Uint32Array;return{next_code:new e(16),bl_count:new e(16),ordr:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],of0:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],exb:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],ldef:new e(32),df0:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],dxb:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],ddef:new t(32),flmap:new e(512),fltree:[],fdmap:new e(32),fdtree:[],lmap:new e(32768),ltree:[],ttree:[],dmap:new e(32768),dtree:[],imap:new e(512),itree:[],rev15:new e(32768),lhst:new t(286),dhst:new t(30),ihst:new t(19),lits:new t(15e3),strt:new e(65536),prev:new e(32768)}}();function rS(e,t,r){for(var n=e.length,a=gt.rev15,i=0;i>1<<4|s,c=t-s,l=e[i]<>>15-t]=u,l++}function am(e,t){for(var r=e.length,n=gt.bl_count,a=0;a<=t;a++)n[a]=0;for(a=1;a>>n}function OOe(e,t,r){return ce(this,void 0,void 0,function(){var n;return le(this,function(a){switch(a.label){case 0:if(3===t[0]&&0===t[1])return[2,r||new Uint8Array(0)];n=function ROe(e,t){var r=void 0===t;return void 0===t&&(t=new Uint8Array(e.length>>>2<<3)),{data:e,buf:t,noBuf:r,BFINAL:0,off:0,pos:0}}(t,r),a.label=1;case 1:return 0!==n.BFINAL?[3,4]:e.shouldUpdate?[4,e.update({message:"Inflating blocks...",current:n.pos,max:t.length})]:[3,3];case 2:a.sent(),a.label=3;case 3:return function kOe(e,t){for(var r=e.data,n=e.noBuf,a=e.buf,i=e.BFINAL,o=e.off,s=e.pos,u=0;0===i&&u_&&(_=C)}s+=3*y,am(gt.itree,_),rS(gt.itree,_,gt.imap),c=gt.lmap,l=gt.dmap,s=FOe(gt.imap,(1<<_)-1,v+g,r,s,gt.ttree);var x=KZ(gt.ttree,0,v,gt.ltree);f=(1<>>4;if(w>>>8){if(256===w)break;var E=o+w-254;if(w>264){var I=gt.ldef[w-257];E=o+(I>>>3)+im(r,s,7&I),s+=7&I}var M=l[SF(r,s)&d],F=gt.ddef[M>>>4],j=(F>>>4)+_F(r,s+=15&M,15&F);for(s+=15&F,n&&(a=bF(a,o+(1<<17)));o>>3),m=r[h-4]|r[h-3]<<8;n&&(a=bF(a,o+m)),a.set(new Uint8Array(r.buffer,r.byteOffset+h,m),o),s=h+m<<3,o+=m}}e.buf=a,e.BFINAL=i,e.off=o,e.pos=s}(n,100),[3,1];case 4:return[2,n.buf.length===n.off?n.buf:n.buf.slice(0,n.off)]}})})}function bF(e,t){var r=e.length;if(t<=r)return e;var n=new Uint8Array(Math.max(r<<1,t));return n.set(e,0),n}function FOe(e,t,r,n,a,i){for(var o=0;o>>4;if(u<=15)i[o]=u,o++;else{var c=0,l=0;16===u?(l=3+im(n,a,2),a+=2,c=i[o-1]):17===u?(l=3+im(n,a,3),a+=3):18===u&&(l=11+im(n,a,7),a+=7);for(var f=o+l;o>>1;ia&&(a=s),i++}for(;i>>3]|e[1+(t>>>3)]<<8)>>>(7&t)&(1<>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)&(1<>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)}function CF(e,t,r){for(var n=[],a=e.length,i=t.length,o=0;or&&(function NOe(e,t,r){var n=0,a=0,i=1<t;n++){var o=e[n].d;e[n].d=t,a+=i-(1<>>=r-t;a>0;)(o=e[n].d)=0;n--)e[n].d===t&&a<0&&(e[n].d--,a++);0!==a&&console.log("debt left")}(u,r,v),v=r),o=0;o>>1|(1431655765&r)<<1))>>>2|(858993459&r)<<2))>>>4|(252645135&r)<<4))>>>8|(16711935&r)<<8)>>>16|r<<16)>>>17}function n(a,i,o){for(;0!=i--;)a.push(0,o)}for(t=0;t<32;t++)gt.ldef[t]=gt.of0[t]<<3|gt.exb[t],gt.ddef[t]=gt.df0[t]<<4|gt.dxb[t];n(gt.fltree,144,8),n(gt.fltree,112,9),n(gt.fltree,24,7),n(gt.fltree,8,8),am(gt.fltree,9),rS(gt.fltree,9,gt.flmap),nS(gt.fltree,9),n(gt.fdtree,32,5),am(gt.fdtree,5),rS(gt.fdtree,5,gt.fdmap),nS(gt.fdtree,5),n(gt.itree,19,0),n(gt.ltree,286,0),n(gt.dtree,30,0),n(gt.ttree,320,0)}();var UOe=[[0,0,0,0,0],[4,4,8,4,0],[4,5,16,8,0],[4,6,16,16,0],[4,10,16,32,0],[8,16,32,32,0],[8,16,128,128,0],[8,32,128,256,0],[32,128,258,1024,1],[32,258,258,4096,1]];function VOe(e,t,r,n,a){return ce(this,void 0,void 0,function(){var i,o,s,u,c,l,f,d,p,h,m,v;return le(this,function(g){switch(g.label){case 0:if(i=function BOe(e,t,r,n){return{data:e,out:t,opt:UOe[n],i:0,pos:r<<3,cvrd:0,dlen:e.length,li:0,lc:0,bs:0,ebits:0,c:0,nc:0,lits:gt.lits,strt:gt.strt,prev:gt.prev}}(t,r,n,a),o=i.dlen,0===a){for(s=i.i,u=i.pos;s>>3]}o>2&&(i.nc=wF(t,0),i.strt[i.nc]=0),g.label=1;case 1:return i.i14e3||l>26697)&&n-o>100&&(u>>16,x=65535&_,A=eQ(C,gt.of0);gt.lhst[257+A]++;var T=eQ(x,gt.df0);gt.dhst[T]++,d+=gt.exb[A]+gt.dxb[T],m[c]=C<<23|o-u,m[c+1]=x<<16|A<<8|T,c+=2,u=o+C}else gt.lhst[r[o]]++;l++}}e.i=o,e.pos=s,e.cvrd=u,e.li=c,e.lc=l,e.bs=f,e.ebits=d,e.c=p,e.nc=h}(i,1048576),[3,1];case 4:for(l=i.li,f=i.cvrd,d=i.pos,h=i.lits,v=i.ebits,((m=i.bs)!==(p=i.i)||0===t.length)&&(f>>3]}})})}function zOe(e,t,r,n,a,i){var o=32767&t,s=r[o],u=o-s+32768&32767;if(s===o||n!==wF(e,t-u))return 0;for(var c=0,l=0,f=Math.min(32767,t);u<=f&&0!=--i&&s!==o;){if(0===c||e[t+c]===e[t+c-u]){var d=GOe(e,t,u);if(d>c){if(l=u,(c=d)>=a)break;u+2p&&(p=g,s=m)}}}u+=(o=s)-(s=r[o])+32768&32767}return c<<16|l}function GOe(e,t,r){if(e[t]!==e[t-r]||e[t+1]!==e[t+1-r]||e[t+2]!==e[t+2-r])return 0;var n=t,a=Math.min(e.length,t+258);for(t+=3;t4&&0===gt.itree[1+(gt.ordr[u-1]<<1)];)u--;return[e,t,s,n,i,u,r,a]}(),l=c[0],f=c[1],d=c[2],p=c[3],h=c[4],m=c[5],v=c[6],g=c[7],y=32+(u+3&7?8-(u+3&7):0)+(o<<3),b=n+aS(gt.fltree,gt.lhst)+aS(gt.fdtree,gt.dhst),_=n+aS(gt.ltree,gt.lhst)+aS(gt.dtree,gt.dhst);_+=14+3*m+aS(gt.itree,gt.ihst)+(2*gt.ihst[16]+3*gt.ihst[17]+7*gt.ihst[18]);for(var C=0;C<286;C++)gt.lhst[C]=0;for(C=0;C<30;C++)gt.dhst[C]=0;for(C=0;C<19;C++)gt.ihst[C]=0;var x=y>>23,F=E+(8388607&M);E>16,H=j>>8&255,G=255&j;Zv(s,u=iS(257+H,A,s,u),O-gt.of0[H]),WT(s,u=iS(G,T,s,u+=gt.exb[H]),N-gt.df0[G]),u+=gt.dxb[G],E+=O}}u=iS(256,A,s,u)}return u}function QZ(e,t,r,n,a){var i=a>>>3;return n[i]=r,n[i+1]=r>>>8,n[i+2]=255-n[i],n[i+3]=255-n[i+1],i+=4,n.set(new Uint8Array(e.buffer,t,r),i),a+(r+4<<3)}function aS(e,t){for(var r=0,n=0;n15&&(Zv(r,n,o),n+=s)}return n}function JZ(e,t){for(var r=e.length;2!==r&&0===e[r-1];)r-=2;for(var n=0;n>>1,138))<11?t.push(17,c-3):t.push(18,c-11),n+=2*c-2}else if(a===s&&i===a&&o===a){for(u=n+5;u+2>>1,6);t.push(16,c-3),n+=2*c-2}else t.push(a,0)}return r>>>1}function eQ(e,t){var r=0;return t[16|r]<=e&&(r|=16),t[8|r]<=e&&(r|=8),t[4|r]<=e&&(r|=4),t[2|r]<=e&&(r|=2),t[1|r]<=e&&(r|=1),r}function iS(e,t,r,n){return WT(r,n,t[e<<1]),n+t[1+(e<<1)]}function Zv(e,t,r){var n=t>>>3;e[n]|=r<<=7&t,e[n+1]|=r>>>8}function WT(e,t,r){var n=t>>>3;e[n]|=r<<=7&t,e[n+1]|=r>>>8,e[n+2]|=r>>>16}function oS(e,t,r){return void 0===r&&(r=!1),ce(this,void 0,void 0,function(){var n,a,i,o,s,u,c,l,f,d,p,h,m;return le(this,function(v){switch(v.label){case 0:for(n=Object.create(null),a=new Uint8Array(t),i=a.length-4;101010256!==Kv(a,i);)i--;o=i,o+=4,s=nm(a,o+=4),o+=2,o+=2,u=Kv(a,o+=4),o+=4,o=u,c=0,v.label=1;case 1:return c>0}(Kv(t,t.length-8)),u=Kv(t,t.length-4),void 0===r&&(r=new Uint8Array(u)),c=new Uint8Array(t.buffer,t.byteOffset+a,t.length-a-8),[4,AF(e,c,r)];case 1:return l=d.sent(),f=XZ(l,0,l.length),s!==f&&console.error("ungzip: checksums don't match"),[2,l]}})})}function WOe(e,t,r){return ce(this,void 0,void 0,function(){var n,a;return le(this,function(i){switch(i.label){case 0:return void 0===r&&(r={level:6}),n=new Uint8Array(50+Math.floor(1.1*t.length)),[4,VOe(e,t,n,0,r.level)];case 1:return a=i.sent(),[2,new Uint8Array(n.buffer,0,a)]}})})}function YOe(e,t){return void 0===t&&(t=!1),Ve.create("Zip",function(r){return function XOe(e,t,r){return void 0===r&&(r=!1),ce(this,void 0,void 0,function(){var n,a,i,o,s,u,c,l,f,d,p,h,m,v,g,y,b,_,C,x,A;return le(this,function(T){switch(T.label){case 0:for(s in n=0,a={},o=[],i=t)o.push(s);u=0,T.label=1;case 1:return u>18,e[t+a+1]=128|o>>12&63,e[t+a+2]=128|o>>6&63,e[t+a+3]=128|o>>0&63,a+=4}else e[t+a]=224|o>>12,e[t+a+1]=128|o>>6&63,e[t+a+2]=128|o>>0&63,a+=3;else e[t+a]=192|o>>6,e[t+a+1]=128|o>>0&63,a+=2;else e[t+a]=o,a++}return a}(e,t,r);return t+=s,0===a&&(e.set(o,t),t+=o.length),t}var Wc=function(e){return e[e.None=0]="None",e[e.Gzip=1]="Gzip",e[e.Zip=2]="Zip",e}(Wc||{});function bp(e,t){return function DF(e,t){var r=this;if(Yv)return function JOe(e,t){var r=this;return Ve.create("Read File",function(n){return ce(r,void 0,void 0,function(){var a,i;return le(this,function(o){switch(o.label){case 0:return a="zip"===t?Wc.None:aQ(e.name),[4,n.update({message:"Opening file...",canAbort:!1})];case 1:return o.sent(),"binary"===t||"zip"===t||a!==Wc.None?[4,e.arrayBuffer()]:[3,3];case 2:return i=o.sent(),[3,5];case 3:return[4,e.text()];case 4:i=o.sent(),o.label=5;case 5:return[4,n.update({message:"Processing file...",canAbort:!1})];case 6:return o.sent(),[4,iQ(n,i,t,a)];case 7:return[2,o.sent()]}})})})}(e,t);var n=void 0;return Ve.create("Read File",function(a){return ce(r,void 0,void 0,function(){var i,o;return le(this,function(s){switch(s.label){case 0:return s.trys.push([0,,5,6]),n=new FileReader,i="zip"===t?Wc.None:aQ(e.name),"binary"===t||"zip"===t||i!==Wc.None?n.readAsArrayBuffer(e):n.readAsText(e),[4,a.update({message:"Opening file...",canAbort:!0})];case 1:return s.sent(),[4,nQ(a,"Reading...",n)];case 2:return o=s.sent(),[4,a.update({message:"Processing file...",canAbort:!1})];case 3:return s.sent(),[4,iQ(a,o.result,t,i)];case 4:return[2,s.sent()];case 5:return n=void 0,[7];case 6:return[2]}})})},function(){n&&n.abort()})}(e,t)}function TF(e){return"string"==typeof e?oQ(e,e,"string"):oQ(e.title,e.url,e.type||"string",e.body,e.headers)}function rQ(e){return e?"Failed to download data. Possible reasons: Resource is not available, or CORS is not allowed on the server.":"Failed to open file."}function nQ(e,t,r){return new Promise(function(n,a){if(function ZOe(e){if(!Yv&&e instanceof FileReader)return e.readyState===FileReader.DONE;if(e instanceof tS)return e.readyState===tS.DONE;throw new Error("unknown data type")}(r)){var i=r.error;null!=i?a(i??rQ(r instanceof tS)):n(r)}else{var o=!1;r.onerror=function(s){o||a(s.target.error??rQ(r instanceof tS))},r.onprogress=function(s){if(e.shouldUpdate&&!o)try{e.update(s.lengthComputable?{message:t,isIndeterminate:!1,current:s.loaded,max:s.total}:{message:"".concat(t," ").concat((s.loaded/1024/1024).toFixed(2)," MB"),isIndeterminate:!0})}catch(u){o=!0,a(u)}},r.onload=function(s){n(r)}}})}function aQ(e){return/\.gz$/i.test(e)?Wc.Gzip:/\.zip$/i.test(e)?Wc.Zip:Wc.None}var QOe=/^(__MACOSX|.DS_Store)/;function $Oe(e,t,r){return ce(this,void 0,void 0,function(){var a,i;return le(this,function(o){switch(o.label){case 0:switch(r){case Wc.None:return[3,1];case Wc.Gzip:return[3,2];case Wc.Zip:return[3,3]}return[3,5];case 1:return[2,t];case 2:return[2,qOe(e,t)];case 3:return[4,oS(e,t.buffer)];case 4:if(a=o.sent(),1!==(i=Object.keys(a).filter(function(s){return!QOe.test(s)})).length)throw new Error("can only decompress zip files with a single entry");return[2,a[i[0]]];case 5:return[2]}})})}function iQ(e,t,r,n){return ce(this,void 0,void 0,function(){var a,i;return le(this,function(s){switch(s.label){case 0:if(null===(a=t instanceof ArrayBuffer?new Uint8Array(t):t))throw new Error("no data given");if(n===Wc.None)return[3,4];if(!(a instanceof Uint8Array))throw new Error("need Uint8Array for decompression");return[4,$Oe(e,a,n)];case 1:return i=s.sent(),"string"!==r?[3,3]:[4,e.update({message:"Decoding text..."})];case 2:return s.sent(),a=QO(i,0,i.length),[3,4];case 3:a=i,s.label=4;case 4:return"binary"===r&&a instanceof Uint8Array?[2,a]:[3,5];case 5:return"zip"===r&&a instanceof Uint8Array?[4,oS(e,a.buffer)]:[3,7];case 6:return[2,s.sent()];case 7:if("string"===r&&"string"==typeof a)return[2,a];if("xml"===r&&"string"==typeof a)return[2,(new DOMParser).parseFromString(a,"application/xml")];if("json"===r&&"string"==typeof a)return[2,JSON.parse(a)];s.label=8;case 8:throw new Error("could not get requested response data '".concat(r,"'"))}})})}var EF=function(){function e(){}return e.get=function(){return this.pool.length?this.pool.pop():new tS},e.emptyFunc=function(){},e.deposit=function(t){this.pool.length=200&&e.status<400){var r=e.response;if(EF.deposit(e),("binary"===t||"zip"===t)&&r instanceof ArrayBuffer)return new Uint8Array(r);if("string"===t&&"string"==typeof r)return r;if("xml"===t&&r instanceof XMLDocument)return r;if("json"===t&&"object"==typeof r)return r;throw new Error("could not get requested response data '".concat(t,"'"))}throw EF.deposit(e),new Error("Download failed with status code ".concat(e.status))}(p,r),[2,h]}})})},function(){o&&(o.abort(),o=void 0)})}var pn,IF=void 0;function aFe(e,t,r,n){return ce(this,void 0,void 0,function(){var a,i,o,s,u,c,l,f,d,p,h,m;return le(this,function(v){switch(v.label){case 0:return a=r.length,i=new Array(r.length),[4,e.update({message:"Downloading...",current:0,max:a})];case 1:for(v.sent(),o=[],s=[],u=0,c=Math.min(a,n);u0?[4,Promise.race(o)]:[3,6];case 3:if(f=v.sent(),d=r[f.index],p=s.indexOf(f.index),l++,"error"===f.kind&&!d.canFail)throw new Error("".concat(d.url,": ").concat(f.error));return e.shouldUpdate?[4,e.update({message:"Downloading...",current:l,max:a})]:[3,5];case 4:v.sent(),v.label=5;case 5:return i[f.index]=f,o=o.filter(sQ,p),s=s.filter(sQ,p),u"u"?ue?re.defaultValue:void 0:q(re.select,J.name)?(V=re.map(J.name),{name:J.name,params:z(V,J.params,ue)}):re.defaultValue}return"select"===re.type?q(re,ee)?ee:re.defaultValue:"multi-select"===re.type?Array.isArray(ee)?(ge=ee.filter(function(we){return q(this,we)},re),ee.length>0&&0===ge.length?re.defaultValue:ge):re.defaultValue:"object-list"===re.type?Array.isArray(ee)?ee.map(function(ye){return te(re.element,ye,ue?"all":"skip")}):re.defaultValue:ee}function te(re,ee,ue){if("object"!=typeof ee||null===ee)return ue?N(re):ee;for(var ge=Object.create(null),Ce=0,ze=Object.keys(re);Ce0?ee[0][0]:void 0}e.Essential={isEssential:!0},e.Optional=function r(re){var ee=R({},re);return ee.isOptional=!0,ee},e.Value=function n(re,ee){return t({type:"value",defaultValue:re},ee)},e.Select=a,e.MultiSelect=function i(re,ee,ue){var ge=t({type:"multi-select",defaultValue:re,options:ee},ue);return ue?.emptyValue&&(ge.emptyValue=ue.emptyValue),ge},e.Boolean=function o(re,ee){return t({type:"boolean",defaultValue:re},ee)},e.Text=function s(re,ee){return void 0===re&&(re=""),t({type:"text",defaultValue:re},ee)},e.Color=function u(re,ee){var ue=t({type:"color",defaultValue:re},ee);return ee?.isExpanded&&(ue.isExpanded=ee.isExpanded),ue},e.ColorList=function c(re,ee){var ue;if("string"==typeof re){var ge=cp(re);ue={kind:"qualitative"!==ge.type?"interpolate":"set",colors:ge.list}}else ue=re;return t({type:"color-list",presetKind:ee?.presetKind||"all",defaultValue:ue,offsets:!!ee?.offsets},ee)},e.Vec3=function l(re,ee,ue){return t(m({type:"vec3",defaultValue:re},ee),ue)},e.Mat4=function f(re,ee){return t({type:"mat4",defaultValue:re},ee)},e.Url=function d(re,ee){return t({type:"url",defaultValue:"string"==typeof re?pn.Url(re):pn.Url(re.url,{body:re.body})},ee)},e.File=function p(re){var ee=t({type:"file",defaultValue:null},re);return re?.accept&&(ee.accept=re.accept),ee},e.FileList=function h(re){var ee=t({type:"file-list",defaultValue:null},re);return re?.accept&&(ee.accept=re.accept),ee},e.Numeric=function v(re,ee,ue){var ge=t(m({type:"number",defaultValue:re},ee),ue);return ue?.immediateUpdate&&(ge.immediateUpdate=!0),ge},e.Interval=function g(re,ee,ue){return t(m({type:"interval",defaultValue:re},ee),ue)},e.LineGraph=function y(re,ee){var ue=t({type:"line-graph",defaultValue:re},ee);return ee?.getVolume&&(ue.getVolume=ee.getVolume),ue},e.Group=b,e.EmptyGroup=function _(re){return b({},re)},e.Mapped=function C(re,ee,ue,ge){var Ce=pe(re,ee);return t({type:"mapped",defaultValue:{name:Ce,params:ue(Ce).defaultValue},select:a(Ce,ee,ge),map:ue},ge)},e.MappedStatic=function x(re,ee,ue){var ge=ue?.options?ue.options:Object.keys(ee).map(function(ze){return[ze,ee[ze].label||Vc(ze)]}),Ce=pe(re,ge);return t({type:"mapped",defaultValue:{name:Ce,params:ee[Ce].defaultValue},select:a(Ce,ge,ue),map:function(ze){return ee[ze]}},ue)},e.ObjectList=function A(re,ee,ue){return t({type:"object-list",element:re,getLabel:ee,ctor:T,defaultValue:ue?.defaultValue||[]},ue)},e.ValueRef=function E(re,ee,ue){var ge;return t({type:"value-ref",defaultValue:{ref:null!==(ge=ue?.defaultRef)&&void 0!==ge?ge:"",getValue:w},getOptions:re,resolveRef:ee},ue)},e.DataRef=function I(re){var ee;return t({type:"data-ref",defaultValue:{ref:null!==(ee=re?.defaultRef)&&void 0!==ee?ee:"",getValue:w}},re)},e.Converted=function M(re,ee,ue){return t({type:"converted",defaultValue:ee(ue.defaultValue),converted:ue,fromValue:re,toValue:ee},ue)},e.Conditioned=function O(re,ee,ue,ge,Ce){var ze=Object.keys(ee).map(function(je){return[je,je]});return t({type:"conditioned",select:a(ue(re),ze,Ce),defaultValue:re,conditionParams:ee,conditionForValue:ue,conditionedValue:ge},Ce)},e.Script=function F(re,ee){return t({type:"script",defaultValue:re},ee)},e.For=function j(re){return 0},e.getDefaultValues=N,e.resolveRefs=W,e.setDefaultValues=function K(re,ee){for(var ue=0,ge=Object.keys(re);ue0&&(t.secondStart-e.secondEnd<6&&t.firstStart-e.firstEnd<3||t.secondStart-e.secondEnd<3)}function fQ(e){return mr.is(e,8)||mr.is(e,1)||mr.is(e,16)}var _p,CFe={oldDefinition:D.Boolean(!0,{description:"Whether to use the old DSSP convention for the annotation of turns and helices, causes them to be two residues shorter"}),oldOrdering:D.Boolean(!0,{description:"Alpha-helices are preferred over 3-10 helices"})};function xFe(e,t){return ce(this,void 0,void 0,function(){var r,n,a,i,o,s,u,f,p,h,m,v,g,y,b,_,C,x;return le(this,function(A){for(r=function SFe(e){for(var t=e.model.atomicHierarchy.index,r=e.proteinElements,n=e.residueIndex,a=r.length,i=new Uint32Array(a),o=new Int32Array(a),s=new Int32Array(a),u=new Int32Array(a),c=new Int32Array(a),l=0;luFe||(d[d.length]=T,p[p.length]=H,h[h.length]=X)}}}}}return function fFe(e,t,r,n){for(var a=new Du.DirectedEdgeBuilder(e,t,r),i=new Float32Array(a.slotCount),o=0,s=a.edgeCount;o6.25)continue e}var T=i[o[g]],w=i[o[g+2]];c(i[o[g-2]],l),c(T,f),c(w,d),S.sub(m,l,f),S.sub(v,f,d);var E=nc(S.angle(m,v));E&&E>70&&(r[g]|=32)}}(p),function gFe(e){for(var s,u,r=e.hbonds,n=e.flags,a=e.bridges,i=r.offset,o=r.b,c=0,l=e.proteinInfo.residueIndices.length;cp||((s=c+1)!==(u=p)&&-1!==r.getDirectedEdgeIndex(u,s+1)&&(n[s]|=2,n[u]|=2,a[a.length]=new XT(s,u,0)),(s=c)!==(u=p-1)&&-1!==r.getDirectedEdgeIndex(u-1,s)&&(n[s]|=2,n[u]|=2,a[a.length]=new XT(u,s,0)),(s=c)!==(u=p)&&-1!==r.getDirectedEdgeIndex(u,s)&&(n[s]|=2,n[u]|=2,a[a.length]=new XT(u,s,1)),(s=c+1)!==(u=p-1)&&-1!==r.getDirectedEdgeIndex(u-1,s+1)&&(n[s]|=2,n[u]|=2,a[a.length]=new XT(u,s,1)))}a.sort(function(h,m){return h.partner1>m.partner1?1:h.partner1r&&(r=l)}}return e.throwIfTimedOut(),r}function jFe(e,t){return function(n){var a=e(n);if(t.elementRadius){var i=R(R({},t),{elementRadius:t.elementRadius,elementRadiusClosure:GFe(n,t.elementRadius),sourceMaxRadius:HFe(n,t.elementRadius)});if(mt.isSingleton(a)){var o=SQ(n,n.inputStructure,a.structure,i);return mt.Singletons(n.inputStructure,o)}for(var u=new aF(n.inputStructure),c=0,l=a.structures;c=0)T.addElementRange(v,b.start,b.end);else if(d.hasLabelAsymId(_))for(y.setSegment(b);y.hasNext;)A=y.move(),l.element=v[A.start],d.has(l)&&T.addElementRange(v,A.start,A.end);T.commitUnit(),i.throwIfTimedOut()}var I=X_(i.inputStructure,[T.getStructure(),o]);if(n){for(var M=new BT(i.inputStructure),O=i.inputStructure.lookup3d,F=0,j=I.units;F0;){var s=o.pop();a.add(s);for(var u=this.vertices.get(s),c=0,l=this.edges.get(s);c0){var a=r.structure.units[0],i=Ye.create([a.getChild(Xe.ofSingleton(a.elements[0]))],{parent:t.inputStructure});n.add(i)}}else r.structures.length>0&&n.add(r.structures[0]);return n.getSelection()}}function $T(e,t,r){var n=e.currentStructure.units,a=e.pushCurrentElement();a.structure=e.currentStructure;for(var i=0,o=n;i"u"?function dNe(e){var t=e.queryCtx,r=e.selection,a=e.maxRadius,i=e.invert,o=mt.unionStructure(e.target).lookup3d,s=mt.LinearBuilder(t.inputStructure),u=S.zero();return mt.forEach(r,function(c,l){for(var f=c.units,d=!1,p=0,h=f.length;pp}},e.gte=function o(d,p){return function(h){return d(h)>=p}},e.inSet=function c(d,p){if(function t(d){return!!d&&!!d.has}(p))return function(v){return p.has(d(v))};if(0===p.length)return u;for(var h=new Set,m=0;m=0&&t[1]<=0&&r[1]>=0&&t[2]<=0&&r[2]>=0&&(s[0]=Eu.getSymmetryOperator(a,0,0,0,0));for(var u=0;u0?[]:this.currentUnit},e.prototype.addElement=function(t){this.currentUnit[this.currentUnit.length]=t,this.elementCount++},e.prototype.addElementRange=function(t,r,n){for(var a=r;a1&&Nc(u);var f=s.getChild(Xe.ofSortedArray(u)),d=n.add(f.id,f);f!==d&&(f=d.applyOperator(f.id,f.conformation.operator,!0)),r[r.length]=f}else r[r.length]=s,n.add(s.id,s)}return Ye.create(r,{parent:this.parent})},e.prototype.getStructure=function(){return this._getStructure(!1)},e.prototype.getStructureDeduplicate=function(){return this._getStructure(!0)},e.prototype.setSingletonLocation=function(t){var r=this.ids[0];t.unit=this.parent.unitMap.get(r),t.element=this.unitMap.get(r)[0]},Object.defineProperty(e.prototype,"isEmpty",{get:function(){return 0===this.elementCount},enumerable:!1,configurable:!0}),e}();function TQ(e,t){for(var r=1;t--;)r*=e--;return r}var PNe=function(){function e(t,r){this.array=t,this.hasNext=!1,this.index=(1<e?0:TQ(e,t)/TQ(t,t)}(t.length,r),this.maxIndex=1<0&&r<=t.length}return e.prototype.move=function(){if(this.hasNext){for(var t=0,r=0,n=this.index;n;n>>>=1,t++)1&n&&(this.value[r++]=this.array[t]);this.index=function INe(e){var t=e&-e,r=e+t;return r|((r&-r)/t>>1)-1}(this.index),this.hasNext=this.index0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"customPropertyDescriptors",{get:function(){return this.state.customProps||(this.state.customProps=new jl),this.state.customProps},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentPropertyData",{get:function(){return this.state.propertyData||(this.state.propertyData=Object.create(null)),this.state.propertyData},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"inheritedPropertyData",{get:function(){return this.parent?this.parent.currentPropertyData:this.currentPropertyData},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"polymerResidueCount",{get:function(){return-1===this.state.polymerResidueCount&&(this.state.polymerResidueCount=function QNe(e){for(var t=e.units,r=0,n=0,a=t.length;n0&&(r+=1);return r}(this)),this.state.polymerUnitCount},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"uniqueElementCount",{get:function(){return-1===this.state.uniqueElementCount&&(this.state.uniqueElementCount=function ZNe(e){for(var t=e.unitSymmetryGroups,r=0,n=0,a=t.length;n500?VNe:zNe}(t.length);r.reset();for(var n=0,a=t.length;n0&&ye.length>0)for(var we=J.length,Ee=ye.length,Oe=0,Ne=Math.max(we,Ee);Oe1)throw new Error("The structure is based on multiple models and has neither a master- nor a representative-model.");return this.state.model=t[0],this.state.model},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"masterModel",{get:function(){return this.state.masterModel},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"representativeModel",{get:function(){return this.state.representativeModel},enumerable:!1,configurable:!0}),e.prototype.hasElement=function(t){return!!this.unitMap.has(t.unit.id)&&Xe.has(this.unitMap.get(t.unit.id).elements,t.element)},e.prototype.getModelIndex=function(t){return this.models.indexOf(t)},e.prototype.remapModel=function(t){for(var r=this.state,n=r.dynamicBonds,a=r.interUnitBonds,i=r.parent,o=[],s=0,u=this.unitSymmetryGroups;s0?q[0].id:0,re=0,ee=q.length;re2e5||d(q,re)?m(q,Ee,pe,Ce,ee):pe.addUnit(0,q,ee,Ee,Ce?ke.Trait.MultiChain:ke.Trait.None):pe.addUnit(0,q,ee,Ee,Ce?ke.Trait.MultiChain:ke.Trait.None)}var Oe=q.coarseHierarchy;return Oe.isDefined&&(Oe.spheres.count>0&&v(pe,q,q.coarseHierarchy.spheres,1),Oe.gaussians.count>0&&v(pe,q,q.coarseHierarchy.gaussians,2)),pe.getStructure()}function d(q,z){var te=q.atomicHierarchy.index.getEntityFromChain(z);return"water"===q.entities.data.type.value(te)}function p(q,z){var te=q.atomicHierarchy.index.getEntityFromChain(z);return"polymer"===q.entities.data.type.value(te)}function h(q,z,te,ae,de){var he=q.atomicConformation,ue={x:he.x,y:he.y,z:he.z,indices:z},Ce=up(ue,mp(ue),8192).buckets,ze=Ce.offset,je=Ce.count,V=Ce.array,J=(ae?ke.Trait.MultiChain:ke.Trait.None)|(ze.length>1?ke.Trait.Partitioned:ke.Trait.None);te.beginChainGroup();for(var ye=0,we=ze.length;ye1?ke.Trait.Partitioned:ke.Trait.None);te.beginChainGroup();for(var Pe=0,He=Oe.length;Pe0,this.hasNext&&(this.elements=z.units[0].elements,this.maxIdx=this.elements.length-1,this.current.unit=z.units[0])}return q.prototype.move=function(){return this.advance(),this.current.element=this.elements[this.idx],this.current},q.prototype.advance=function(){if(this.idx=this.structure.units.length?this.hasNext=!1:(this.current.unit=this.structure.units[this.unitIndex],this.elements=this.current.unit.elements,this.maxIdx=this.elements.length-1,0===this.maxIdx&&(this.hasNext=this.unitIndex+10})}e.distance=function H(q,z){if(0===q.elementCount||0===z.elementCount)return 0;for(var te=q.units,ae=Number.MAX_VALUE,de=0,he=te.length;de=V.id||!de(V)||!he(ge,V)||(V.elements.length>=ge.elements.length?z(ge,V):z(V,ge))}}}},e.eachAtomicHierarchyElement=function W(q,z){for(var te=z.chain,ae=z.residue,de=z.atom,he=at.create(q),pe=0,re=q.units;pe=ae.largeResidueCount*te?function X(q,z){var te=K(q);return te.length>=1&&te[0].units.length>z.highSymmetryUnitCount}(q,ae)?L.Huge:L.Gigantic:function ne(q,z){var te=K(q);return 1===te.length&&te[0].units.length>2&&te[0].units[0].polymerElements.length0)return!1;return!0}function i(Z){for(var q=0,z=0,te=Z.elements;z3&&Xe.isRange(Z)?xe.ofRange(Z[0],Z[Z.length-1]):Xe.ofSortedArray(Z)}function C(Z,q){for(var z=[],te=new Set,ae=0,de=Z.elements;ae=0){var Pe=ee.value(Ne);(!q||Oe||!Pe||te.has(Pe))&&(ze[ze.length]=$e)}}}z[z.length]={unit:he.unit,indices:_(ze)}}else z[z.length]=he}return e(Z.structure,z)}function x(Z){switch(Z.kind){case 0:return Z.model.atomicHierarchy.chainAtomSegments;case 1:return Z.model.coarseHierarchy.spheres.chainElementSegments;case 2:return Z.model.coarseHierarchy.gaussians.chainElementSegments}}function A(Z){return Z.unit.elements.length===Be.size(Z.indices)}function T(Z,q,z){for(var te=x(Z).index,ae=Z.elements,de=0,he=0,pe=ae.length;he0&&(z[z.length]={unit:Z,indices:_(ue)})}else z[z.length]={unit:Z,indices:xe.ofBounds(0,de)}}function w(Z,q,z,te,ae){for(var de=x(Z.elements[0].unit).index,he=new Set,pe=q;pe0&&z.push({unit:ae,indices:de})}}),e(q,z)},e.union=function m(Z,q){if(Z.elements.length>q.elements.length)return m(q,Z);if(e.isEmpty(Z))return q;for(var z=new Map,te=0,ae=Z.elements;teq.elements.length)return y(q,Z);if(e.isEmpty(Z))return e.isEmpty(q);for(var z=new Map,te=0,ae=Z.elements;te12)de[de.length]=q[ee],de[de.length]=q[ue-1];else for(var ge=ee;ge1,he.modelLabel,he.modelIndex))}for(var ye=new Map,we=(ge=0,je.length);ge0&&(_t[_t.length]=fe.core.set.has([fe.core.type.set(He),ut]));for(var At=0,Le=Pe.length/2;At1?fe.core.logic.or(_t):_t[0],"chain-test":Je.length>1?fe.core.set.has([fe.core.type.set(Je),vt]):fe.core.rel.eq([vt,Je[0]]),"entity-test":fe.core.logic.and([fe.core.rel.eq([fe.struct.atomProperty.core.modelLabel(),Ct]),fe.core.rel.eq([fe.struct.atomProperty.core.modelIndex(),bt])])}))}else Ne.push(fe.struct.generator.atomGroups({"atom-test":_t.length>1?fe.core.logic.or(_t):_t[0],"chain-test":Je.length>1?fe.core.set.has([fe.core.type.set(Je),vt]):fe.core.rel.eq([vt,Je[0]])}))}),fe.struct.modifier.union([1===Ne.length?Ne[0]:fe.struct.combinator.merge(Ne.map(function(Ue){return fe.struct.modifier.union([Ue])}))])}}(Re||(Re={})),function(e){function t(){return{elementCount:0,conformationCount:0,residueCount:0,chainCount:0,unitCount:0,structureCount:0,firstElementLoc:at.create(void 0),firstConformationLoc:at.create(void 0),firstResidueLoc:at.create(void 0),firstChainLoc:at.create(void 0),firstUnitLoc:at.create(void 0),firstStructureLoc:at.create(void 0)}}function r(u,c,l){var f=u.get(c)||0;u.set(c,f+l)}function n(u,c,l){var f=l.indices,d=l.unit,p=d.elements,h=Be.size(f),m=new Map,v=new Map;if(h>0&&at.set(u.firstElementLoc,c,d,p[Be.start(f)]),h===p.length)u.unitCount+=1,1===u.unitCount&&at.set(u.firstUnitLoc,c,d,p[Be.start(f)]);else if(1===h){if(ke.Traits.is(d.traits,ke.Trait.MultiChain))return;u.elementCount+=1,1===u.elementCount&&at.set(u.firstElementLoc,c,d,p[Be.start(f)])}else if(ke.isAtomic(d))for(var g=d.model.atomicHierarchy.residueAtomSegments,y=g.index,b=g.offsets,_=d.model.atomicHierarchy.atoms.label_alt_id,C=0,x=function(){m.clear();var A=0,T=p[Be.getAt(f,C)],w=y[T];for(r(m,_.value(T),1),++C,++A;C"u"?1:0},UF=function(e,t){return-1===t[e].operator.spgrOp?1:0};function Yy(e,t){return t?1===t.length?sc(t.charCodeAt(0),e):2===t.length?sc(t.charCodeAt(0),sc(t.charCodeAt(1),e)):"".concat(e," ").concat(t):e}function FBe(e,t,r,n){var a;e.has(t)?(a=e.get(t)).has(r)||a.set(r,n):(e.set(t,a=new Map),a.set(r,n))}function NBe(e){throw new Error("Missing entity entry for entity id '".concat(e,"'."))}Na.fields().str("label_asym_id",function(e,t){return t[e].label_asym_id}).str("auth_asym_id",function(e,t){return t[e].auth_asym_id}).str("operator_name",function(e,t){return t[e].operator.name}).str("suffix",function(e,t){return t[e].operator.suffix}).str("assembly_id",function(e,t){var r;return(null===(r=t[e].operator.assembly)||void 0===r?void 0:r.id)||""},{valueKind:BQ}).int("assembly_operator_id",function(e,t){var r;return(null===(r=t[e].operator.assembly)||void 0===r?void 0:r.operId)||0},{valueKind:BQ}).int("symmetry_operator_index",function(e,t){return t[e].operator.spgrOp},{valueKind:UF}).vec("symmetry_hkl",[function(e,t){return t[e].operator.hkl[0]},function(e,t){return t[e].operator.hkl[1]},function(e,t){return t[e].operator.hkl[2]}],{valueKind:UF}).int("ncs_id",function(e,t){return t[e].operator.ncsId},{valueKind:UF}).getFields();var fS=vF.EmptyResidueKey(),LBe=function(){function e(t){this.map=t,this.entityIndex=t.entities.getEntityIndex,this.residueOffsets=this.map.segments.residueAtomSegments.offsets}return e.prototype.getEntityFromChain=function(t){return this.map.chain_index_entity_index[t]},e.prototype.findEntity=function(t){var r=this.map.label_asym_id.get(t);return void 0!==r?r:-1},e.prototype.findChainLabel=function(t){var r=this.entityIndex(t.label_entity_id);if(r<0||!this.map.entity_index_label_asym_id.has(r))return-1;var n=this.map.entity_index_label_asym_id.get(r);return n&&n.has(t.label_asym_id)?n.get(t.label_asym_id):-1},e.prototype.findChainAuth=function(t){if(!this.map.auth_asym_id_auth_seq_id.has(t.auth_asym_id))return-1;var r=this.map.auth_asym_id_auth_seq_id.get(t.auth_asym_id);return r.has(t.auth_seq_id)?r.get(t.auth_seq_id):-1},e.prototype.findResidue=function(t,r,n,a){var i;1===arguments.length?i=t:(fS.label_entity_id=t,fS.label_asym_id=r,fS.auth_seq_id=n,fS.pdbx_PDB_ins_code=a,i=fS);var o=this.findChainLabel(i);if(o<0)return-1;var s=this.map.chain_index_auth_seq_id.get(o),u=Yy(i.auth_seq_id,i.pdbx_PDB_ins_code||"");return s.has(u)?s.get(u):-1},e.prototype.findResidueLabel=function(t){var r=this.findChainLabel(t);if(r<0)return-1;var n=this.map.chain_index_label_seq_id.get(r),a=Yy(t.label_seq_id,t.pdbx_PDB_ins_code||"");return n.has(a)?n.get(a):-1},e.prototype.findResidueAuth=function(t){var r=this.findChainAuth(t);if(r<0)return-1;var n=this.map.chain_index_auth_seq_id.get(r),a=Yy(t.auth_seq_id,t.pdbx_PDB_ins_code||"");return n.has(a)?n.get(a):-1},e.prototype.findResidueInsertion=function(t){var r=this.findChainLabel(t);if(r<0)return-1;var n=this.map.chain_index_label_seq_id.get(r),a=Yy(t.label_seq_id,t.pdbx_PDB_ins_code||"");if(n.has(a))return n.get(a);var i=Xe.findPredecessorIndex(this.map.label_seq_id,t.label_seq_id),o=jv.chainStartResidueIndex(this.map.segments,r);if(i=s?s:i},e.prototype.findAtom=function(t){var r=this.findResidue(t);return r<0?-1:typeof t.label_alt_id>"u"?VF(this.residueOffsets[r],this.residueOffsets[r+1],this.map.label_atom_id,t.label_atom_id):zF(this.residueOffsets[r],this.residueOffsets[r+1],this.map.label_atom_id,this.map.label_alt_id,t.label_atom_id,t.label_alt_id)},e.prototype.findAtomAuth=function(t){var r=this.findResidueAuth(t);return r<0?-1:typeof t.label_alt_id>"u"?VF(this.residueOffsets[r],this.residueOffsets[r+1],this.map.auth_atom_id,t.auth_atom_id):zF(this.residueOffsets[r],this.residueOffsets[r+1],this.map.auth_atom_id,this.map.label_alt_id,t.auth_atom_id,t.label_alt_id)},e.prototype.findAtomOnResidue=function(t,r,n){return typeof n>"u"?VF(this.residueOffsets[t],this.residueOffsets[t+1],this.map.label_atom_id,r):zF(this.residueOffsets[t],this.residueOffsets[t+1],this.map.label_atom_id,this.map.label_alt_id,r,n)},e.prototype.findAtomsOnResidue=function(t,r){return function UBe(e,t,r,n){for(var a=e;a=u[c+1]&&(c+=1,l=0),o[f]=++l;a.label_seq_id=ie.ofIntArray(o)}return Qr.columnToArray(a,"label_seq_id",Int32Array),Qr.columnToArray(a,"auth_seq_id",Int32Array),{atoms:n,residues:a,chains:i,atomSourceIndex:t}}(e,t,o),u=function WBe(e,t){var r=new Map;if(!In.is(t))return r;var n=jf(PBe,t.data.frame).molstar_atom_site_operator_mapping;if(0===n._rowCount)return r;for(var a=new Map,i=new Map,o=0;o1&&(r.push(l,d-1),n.push(d-1,d),l=d),d===c-1&&r.push(l,d),f=p}return{polymerRanges:wn.ofSortedRanges(r),gapRanges:wn.ofSortedRanges(n)}}var HQ={hierarchy:VQ.Empty,conformation:void 0};function jQ(e){var t=e.entity_id,a=e.asym_id;return R({count:t.rowCount,entity_id:t,asym_id:a,seq_id_begin:e.seq_id_begin,seq_id_end:e.seq_id_end},function t5e(e,t,r){for(var n=[0],a=1,i=e.rowCount;a0)for(var r=e.chem_comp.id,n=0,a=r.rowCount;n0)for(var r=e.pdbx_chem_comp_identifier,n=r.comp_id,a=r.type,i=r.identifier,o=0,s=n.rowCount;o0){var l=e.chem_comp,f=l.id;for(a=l.type,o=0,s=f.rowCount;o0?function(d){var p=f(d);return"X"===p&&l.has(d)?f(l.get(d)):p}:f}(l),h=[],m=[],v=[],g=new Map,y=0,b=new Map,_=0,C=d.rowCount;_0?[4,p5e(r,e,n,t)]:[3,2];case 1:return i=s.sent(),[3,4];case 2:return[4,d5e(r,e,n,t)];case 3:i=s.sent(),s.label=4;case 4:for(a=i,o=0;o0?a[a.length-1]:void 0),a.push(d),s=u,[3,1];case 3:return[2,a]}})})}function HF(e,t){for(var r=new Map,n=e._rowCount,a=0;a0},e.hasProtein=function g(N){for(var H=N.entities.subtype,G=0,U=H.rowCount;G=0)return!0;return!1}function E(N){if(!In.is(N.sourceData))return!1;for(var H=N.sourceData.data.db,G=0;G=0)return!0;return!1}function M(N){if(!In.is(N.sourceData)||!w(N))return!1;var G=N.sourceData.data.db.pdbx_database_status.status_code_sf;return G.isDefined&&"REL"===G.value(0)}function O(N){if(!In.is(N.sourceData))return!1;for(var H=N.sourceData.data.db,G=H.pdbx_database_related,U=G.db_name,Q=G.content_type,W=0,K=H.pdbx_database_related._rowCount;W=0)return!0;return!1},e.hasXrayMap=M,e.hasEmMap=O,e.hasDensityMap=F,e.probablyHasDensityMap=function j(N){if(!In.is(N.sourceData))return!1;var H=N.sourceData.data.db;return F(N)||_(N)&&(!H.exptl.method.isDefined||w(N)&&(!H.pdbx_database_status.status_code_sf.isDefined||2===H.pdbx_database_status.status_code_sf.valueKind(0))||E(N)&&!H.pdbx_database_related.db_name.isDefined)}}(or||(or={})),function(e){e.getCifDataSource=function t(f,d,p){if(!d)return{rowCount:0};if(p&&p[d.id])return p[d.id];var h=d.getElements(f),m={data:h,rowCount:h.elements.length};return p&&(p[d.id]=m),m},e.fromAtomMap=function r(f){return new i$(f)},e.fromAtomArray=function n(f){return new i$(jF(f))};var a=function(f){return f.atomicHierarchy.residueAtomSegments};e.fromResidueMap=function i(f){return new rD("residue",f,a,0)},e.fromResidueArray=function o(f){return new rD("residue",jF(f),a,0)};var s=function(f){return f.atomicHierarchy.chainAtomSegments};e.fromChainMap=function u(f){return new rD("chain",f,s,0)},e.fromChainArray=function c(f){return new rD("chain",jF(f),s,0)},e.fromEntityMap=function l(f){return new h5e(f)}}(a$||(a$={}));var xp,ca,pS,rD=function(){function e(t,r,n,a){this.level=t,this.map=r,this.segmentGetter=n,this.id=Gn.create22(),this.kind=a}return e.prototype.has=function(t){return this.map.has(t)},e.prototype.get=function(t){return this.map.get(t)},e.prototype.getStructureElements=function(t){var r=t.models;if(1!==r.length)throw new Error("Only works on structures with a single model.");for(var n=new Set,a=t.unitSymmetryGroups,i=[],o=this.segmentGetter(r[0]),s=0,u=a;s>>0;if(""+r!==t||4294967295===r)return NaN;t=r}return t<0?Xy(e)+t:t}function s$(){return!0}function mS(e,t,r){return(0===e&&!c$(e)||void 0!==r&&e<=-r)&&(void 0===t||void 0!==r&&t>=r)}function Ky(e,t){return u$(e,t,0)}function vS(e,t){return u$(e,t,t)}function u$(e,t,r){return void 0===e?r:c$(e)?t===1/0?t:0|Math.max(0,t+e):void 0===t||t===e?e:0|Math.min(t,e)}function c$(e){return e<0||0===e&&1/e==-1/0}var l$="@@__IMMUTABLE_ITERABLE__@@";function au(e){return!(!e||!e[l$])}var f$="@@__IMMUTABLE_KEYED__@@";function La(e){return!(!e||!e[f$])}var d$="@@__IMMUTABLE_INDEXED__@@";function xs(e){return!(!e||!e[d$])}function gS(e){return La(e)||xs(e)}var mi=function(t){return au(t)?t:ou(t)},$c=function(e){function t(r){return La(r)?r:cm(r)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t}(mi),Jv=function(e){function t(r){return xs(r)?r:rl(r)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t}(mi),Zy=function(e){function t(r){return au(r)&&!gS(r)?r:Jy(r)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t}(mi);mi.Keyed=$c,mi.Indexed=Jv,mi.Set=Zy;var p$="@@__IMMUTABLE_SEQ__@@";function nD(e){return!(!e||!e[p$])}var h$="@@__IMMUTABLE_RECORD__@@";function eg(e){return!(!e||!e[h$])}function Jc(e){return au(e)||eg(e)}var Qy="@@__IMMUTABLE_ORDERED__@@";function el(e){return!(!e||!e[Qy])}var yS=0,Jl=1,tl=2,YF="function"==typeof Symbol&&Symbol.iterator,m$="@@iterator",aD=YF||m$,jn=function(t){this.next=t};function qa(e,t,r,n){var a=0===e?t:1===e?r:[t,r];return n?n.value=a:n={value:a,done:!1},n}function iu(){return{value:void 0,done:!0}}function XF(e){return!!Array.isArray(e)||!!iD(e)}function v$(e){return e&&"function"==typeof e.next}function KF(e){var t=iD(e);return t&&t.call(e)}function iD(e){var t=e&&(YF&&e[YF]||e[m$]);if("function"==typeof t)return t}jn.prototype.toString=function(){return"[Iterator]"},jn.KEYS=yS,jn.VALUES=Jl,jn.ENTRIES=tl,jn.prototype.inspect=jn.prototype.toSource=function(){return this.toString()},jn.prototype[aD]=function(){return this};var $y=Object.prototype.hasOwnProperty;function ZF(e){return!(!Array.isArray(e)&&"string"!=typeof e)||e&&"object"==typeof e&&Number.isInteger(e.length)&&e.length>=0&&(0===e.length?1===Object.keys(e).length:e.hasOwnProperty(e.length-1))}var ou=function(e){function t(r){return null==r?$F():Jc(r)?r.toSeq():function y5e(e){var t=eN(e);if(t)return function m5e(e){var t=iD(e);return t&&t===e.entries}(e)?t.fromEntrySeq():function v5e(e){var t=iD(e);return t&&t===e.keys}(e)?t.toSetSeq():t;if("object"==typeof e)return new QF(e);throw new TypeError("Expected Array or collection object of values, or keyed object: "+e)}(r)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.toSeq=function(){return this},t.prototype.toString=function(){return this.__toString("Seq {","}")},t.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},t.prototype.__iterate=function(n,a){var i=this._cache;if(i){for(var o=i.length,s=0;s!==o;){var u=i[a?o-++s:s++];if(!1===n(u[1],u[0],this))break}return s}return this.__iterateUncached(n,a)},t.prototype.__iterator=function(n,a){var i=this._cache;if(i){var o=i.length,s=0;return new jn(function(){if(s===o)return{value:void 0,done:!0};var u=i[a?o-++s:s++];return qa(n,u[0],u[1])})}return this.__iteratorUncached(n,a)},t}(mi),cm=function(e){function t(r){return null==r?$F().toKeyedSeq():au(r)?La(r)?r.toSeq():r.fromEntrySeq():eg(r)?r.toSeq():JF(r)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.toKeyedSeq=function(){return this},t}(ou),rl=function(e){function t(r){return null==r?$F():au(r)?La(r)?r.entrySeq():r.toIndexedSeq():eg(r)?r.toSeq().entrySeq():y$(r)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.of=function(){return t(arguments)},t.prototype.toIndexedSeq=function(){return this},t.prototype.toString=function(){return this.__toString("Seq [","]")},t}(ou),Jy=function(e){function t(r){return(au(r)&&!gS(r)?r:rl(r)).toSetSeq()}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.of=function(){return t(arguments)},t.prototype.toSetSeq=function(){return this},t}(ou);ou.isSeq=nD,ou.Keyed=cm,ou.Set=Jy,ou.Indexed=rl,ou.prototype[p$]=!0;var tg=function(e){function t(r){this._array=r,this.size=r.length}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.get=function(n,a){return this.has(n)?this._array[um(this,n)]:a},t.prototype.__iterate=function(n,a){for(var i=this._array,o=i.length,s=0;s!==o;){var u=a?o-++s:s++;if(!1===n(i[u],u,this))break}return s},t.prototype.__iterator=function(n,a){var i=this._array,o=i.length,s=0;return new jn(function(){if(s===o)return{value:void 0,done:!0};var u=a?o-++s:s++;return qa(n,u,i[u])})},t}(rl),QF=function(e){function t(r){var n=Object.keys(r).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(r):[]);this._object=r,this._keys=n,this.size=n.length}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.get=function(n,a){return void 0===a||this.has(n)?this._object[n]:a},t.prototype.has=function(n){return $y.call(this._object,n)},t.prototype.__iterate=function(n,a){for(var i=this._object,o=this._keys,s=o.length,u=0;u!==s;){var c=o[a?s-++u:u++];if(!1===n(i[c],c,this))break}return u},t.prototype.__iterator=function(n,a){var i=this._object,o=this._keys,s=o.length,u=0;return new jn(function(){if(u===s)return{value:void 0,done:!0};var c=o[a?s-++u:u++];return qa(n,c,i[c])})},t}(cm);QF.prototype[Qy]=!0;var g$,g5e=function(e){function t(r){this._collection=r,this.size=r.length||r.size}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.__iterateUncached=function(n,a){if(a)return this.cacheResult().__iterate(n,a);var o=KF(this._collection),s=0;if(v$(o))for(var u;!(u=o.next()).done&&!1!==n(u.value,s++,this););return s},t.prototype.__iteratorUncached=function(n,a){if(a)return this.cacheResult().__iterator(n,a);var o=KF(this._collection);if(!v$(o))return new jn(iu);var s=0;return new jn(function(){var u=o.next();return u.done?u:qa(n,s++,u.value)})},t}(rl);function $F(){return g$||(g$=new tg([]))}function JF(e){var t=eN(e);if(t)return t.fromEntrySeq();if("object"==typeof e)return new QF(e);throw new TypeError("Expected Array or collection object of [k, v] entries, or keyed object: "+e)}function y$(e){var t=eN(e);if(t)return t;throw new TypeError("Expected Array or collection object of values: "+e)}function eN(e){return ZF(e)?new tg(e):XF(e)?new g5e(e):void 0}var b$="@@__IMMUTABLE_MAP__@@";function oD(e){return!(!e||!e[b$])}function tN(e){return oD(e)&&el(e)}function rN(e){return!(!e||"function"!=typeof e.equals||"function"!=typeof e.hashCode)}function zo(e,t){if(e===t||e!=e&&t!=t)return!0;if(!e||!t)return!1;if("function"==typeof e.valueOf&&"function"==typeof t.valueOf){if((e=e.valueOf())===(t=t.valueOf())||e!=e&&t!=t)return!0;if(!e||!t)return!1}return!!(rN(e)&&rN(t)&&e.equals(t))}var bS="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(t,r){var n=65535&(t|=0),a=65535&(r|=0);return n*a+((t>>>16)*a+n*(r>>>16)<<16>>>0)|0};function sD(e){return e>>>1&1073741824|3221225471&e}var b5e=Object.prototype.valueOf;function Ru(e){if(null==e)return _$(e);if("function"==typeof e.hashCode)return sD(e.hashCode(e));var t=function A5e(e){return e.valueOf!==b5e&&"function"==typeof e.valueOf?e.valueOf(e):e}(e);if(null==t)return _$(t);switch(typeof t){case"boolean":return t?1108378657:1108378656;case"number":return function _5e(e){if(e!=e||e===1/0)return 0;var t=0|e;for(t!==e&&(t^=4294967295*e);e>4294967295;)t^=e/=4294967295;return sD(t)}(t);case"string":return t.length>T5e?function S5e(e){var t=uN[e];return void 0===t&&(t=nN(e),sN===D5e&&(sN=0,uN={}),sN++,uN[e]=t),t}(t):nN(t);case"object":case"function":return function x5e(e){var t;if(aN&&void 0!==(t=iN.get(e))||void 0!==(t=e[rg])||!C$&&(void 0!==(t=e.propertyIsEnumerable&&e.propertyIsEnumerable[rg])||(t=function w5e(e){if(e&&e.nodeType>0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}(e),void 0!==t)))return t;if(t=x$(),aN)iN.set(e,t);else{if(void 0!==S$&&!1===S$(e))throw new Error("Non-extensible objects are not allowed as keys.");if(C$)Object.defineProperty(e,rg,{enumerable:!1,configurable:!1,writable:!1,value:t});else if(void 0!==e.propertyIsEnumerable&&e.propertyIsEnumerable===e.constructor.prototype.propertyIsEnumerable)e.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},e.propertyIsEnumerable[rg]=t;else{if(void 0===e.nodeType)throw new Error("Unable to set a non-enumerable property on object.");e[rg]=t}}return t}(t);case"symbol":return function C5e(e){var t=w$[e];return void 0!==t||(t=x$(),w$[e]=t),t}(t);default:if("function"==typeof t.toString)return nN(t.toString());throw new Error("Value type "+typeof t+" cannot be hashed.")}}function _$(e){return null===e?1108378658:1108378659}function nN(e){for(var t=0,r=0;r=0&&(c.get=function(l,f){return(l=um(this,l))>=0&&lu)return{value:void 0,done:!0};var m=d.next();return n||l===Jl||m.done?m:qa(l,h-1,l===yS?void 0:m.value[1],m)})},c}function M$(e,t,r,n){var a=Jf(e);return a.__iterateUncached=function(i,o){var s=this;if(o)return this.cacheResult().__iterate(i,o);var u=!0,c=0;return e.__iterate(function(l,f,d){if(!u||!(u=t.call(r,l,f,d)))return c++,i(l,n?f:c-1,s)}),c},a.__iteratorUncached=function(i,o){var s=this;if(o)return this.cacheResult().__iterator(i,o);var u=e.__iterator(tl,o),c=!0,l=0;return new jn(function(){var f,d,p;do{if((f=u.next()).done)return n||i===Jl?f:qa(i,l++,i===yS?void 0:f.value[1],f);var h=f.value;d=h[0],p=h[1],c&&(c=t.call(r,p,d,s))}while(c);return i===tl?f:qa(i,d,p,f)})},a}function R$(e,t,r){var n=Jf(e);return n.__iterateUncached=function(a,i){if(i)return this.cacheResult().__iterate(a,i);var o=0,s=!1;return function u(c,l){c.__iterate(function(f,d){return(!t||l0}function lD(e,t,r,n){var a=Jf(e),i=new tg(r).map(function(o){return o.size});return a.size=n?i.max():i.min(),a.__iterate=function(o,s){for(var c,u=this.__iterator(Jl,s),l=0;!(c=u.next()).done&&!1!==o(c.value,l++,this););return l},a.__iteratorUncached=function(o,s){var u=r.map(function(f){return f=mi(f),KF(s?f.reverse():f)}),c=0,l=!1;return new jn(function(){var f;return l||(f=u.map(function(d){return d.next()}),l=n?f.every(function(d){return d.done}):f.some(function(d){return d.done})),l?{value:void 0,done:!0}:qa(o,c++,t.apply(null,f.map(function(d){return d.value})))})},a}function Da(e,t){return e===t?e:nD(e)?t:e.constructor(t)}function O$(e){if(e!==Object(e))throw new TypeError("Expected [K, V] tuple: "+e)}function fN(e){return La(e)?$c:xs(e)?Jv:Zy}function Jf(e){return Object.create((La(e)?cm:xs(e)?rl:Jy).prototype)}function dN(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):ou.prototype.cacheResult.call(this)}function F$(e,t){return void 0===e&&void 0===t?0:void 0===e?1:void 0===t?-1:e>t?1:e0;)t[r]=arguments[r+1];if("function"!=typeof e)throw new TypeError("Invalid merger function: "+e);return q$(this,t,e)}function q$(e,t,r){for(var n=[],a=0;a0;)t[r]=arguments[r+1];return SS(this,t,e)}function SN(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return ng(this,e,ef(),function(n){return CS(n,t)})}function CN(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return ng(this,e,ef(),function(n){return SS(n,t)})}function xS(e){var t=this.asMutable();return e(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this}function wS(){return this.__ownerID?this:this.__ensureOwner(new WF)}function AS(){return this.__ensureOwner()}function xN(){return this.__altered}var hc=function(e){function t(r){return null==r?ef():oD(r)&&!el(r)?r:ef().withMutations(function(n){var a=e(r);pc(a.size),a.forEach(function(i,o){return n.set(o,i)})})}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.of=function(){for(var n=[],a=arguments.length;a--;)n[a]=arguments[a];return ef().withMutations(function(i){for(var o=0;o=n.length)throw new Error("Missing value for key: "+n[o]);i.set(n[o],n[o+1])}})},t.prototype.toString=function(){return this.__toString("Map {","}")},t.prototype.get=function(n,a){return this._root?this._root.get(0,void 0,n,a):a},t.prototype.set=function(n,a){return Z$(this,n,a)},t.prototype.remove=function(n){return Z$(this,n,Pn)},t.prototype.deleteAll=function(n){var a=mi(n);return 0===a.size?this:this.withMutations(function(i){a.forEach(function(o){return i.remove(o)})})},t.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):ef()},t.prototype.sort=function(n){return nl(eb(this,n))},t.prototype.sortBy=function(n,a){return nl(eb(this,a,n))},t.prototype.map=function(n,a){var i=this;return this.withMutations(function(o){o.forEach(function(s,u){o.set(u,n.call(a,s,u,i))})})},t.prototype.__iterator=function(n,a){return new G5e(this,n,a)},t.prototype.__iterate=function(n,a){var i=this,o=0;return this._root&&this._root.iterate(function(s){return o++,n(s[1],s[0],i)},a),o},t.prototype.__ensureOwner=function(n){return n===this.__ownerID?this:n?AN(this.size,this._root,n,this.__hash):0===this.size?ef():(this.__ownerID=n,this.__altered=!1,this)},t}($c);hc.isMap=oD;var Wa=hc.prototype;Wa[b$]=!0,Wa[hS]=Wa.remove,Wa.removeAll=Wa.deleteAll,Wa.setIn=vN,Wa.removeIn=Wa.deleteIn=gN,Wa.update=bN,Wa.updateIn=_N,Wa.merge=Wa.concat=H$,Wa.mergeWith=j$,Wa.mergeDeep=W$,Wa.mergeDeepWith=Y$,Wa.mergeIn=SN,Wa.mergeDeepIn=CN,Wa.withMutations=xS,Wa.wasAltered=xN,Wa.asImmutable=AS,Wa["@@transducer/init"]=Wa.asMutable=wS,Wa["@@transducer/step"]=function(e,t){return e.set(t[0],t[1])},Wa["@@transducer/result"]=function(e){return e.asImmutable()};var TS=function(t,r){this.ownerID=t,this.entries=r};TS.prototype.get=function(t,r,n,a){for(var i=this.entries,o=0,s=i.length;o=X5e)return function H5e(e,t,r,n){e||(e=new WF);for(var a=new wp(e,Ru(r),[r,n]),i=0;i>>t)&nu),o=this.bitmap;return o&i?this.nodes[$$(o&i-1)].get(t+ja,r,n,a):a},tb.prototype.update=function(t,r,n,a,i,o,s){void 0===n&&(n=Ru(a));var u=(0===r?n:n>>>r)&nu,c=1<=K5e)return function q5e(e,t,r,n,a){for(var i=0,o=new Array(Zc),s=0;0!==r;s++,r>>>=1)o[s]=1&r?t[i++]:void 0;return o[n]=a,new DS(e,i+1,o)}(t,p,l,u,m);if(f&&!m&&2===p.length&&Q$(p[1^d]))return p[1^d];if(f&&m&&1===p.length&&Q$(m))return m;var v=t&&t===this.ownerID,g=f?m?l:l^c:l|c,y=f?m?J$(p,d,m,v):function Y5e(e,t,r){var n=e.length-1;if(r&&t===n)return e.pop(),e;for(var a=new Array(n),i=0,o=0;o>>t)&nu];return o?o.get(t+ja,r,n,a):a},DS.prototype.update=function(t,r,n,a,i,o,s){void 0===n&&(n=Ru(a));var u=(0===r?n:n>>>r)&nu,l=this.nodes,f=l[u];if(i===Pn&&!f)return this;var d=TN(f,t,r+ja,n,a,i,o,s);if(d===f)return this;var p=this.count;if(f){if(!d&&--p>>r)&nu,o=(0===r?n:n>>>r)&nu,u=i===o?[DN(e,t,r+ja,n,a)]:(s=new wp(t,n,a),i>1&1431655765))+(e>>2&858993459))+(e>>4)&252645135,127&(e+=e>>8)+(e>>16)}function J$(e,t,r,n){var a=n?e:ed(e);return a[t]=r,a}var X5e=Zc/4,K5e=Zc/2,Z5e=Zc/4,eJ="@@__IMMUTABLE_LIST__@@";function EN(e){return!(!e||!e[eJ])}var Ap=function(e){function t(r){var n=dD();if(null==r)return n;if(EN(r))return r;var a=e(r),i=a.size;return 0===i?n:(pc(i),i>0&&i=0&&n=e.size||t<0)return e.withMutations(function(o){t<0?dm(o,t).set(0,r):dm(o,0,t+1).set(t,r)});var n=e._tail,a=e._root,i={value:!1};return(t+=e._origin)>=PS(e._capacity)?n=IN(n,e.__ownerID,0,t,r,i):a=IN(a,e.__ownerID,e._level,t,r,i),i.value?e.__ownerID?(e._root=a,e._tail=n,e.__hash=void 0,e.__altered=!0,e):IS(e._origin,e._capacity,e._level,a,n):e}(this,n,a)},t.prototype.remove=function(n){return this.has(n)?0===n?this.shift():n===this.size-1?this.pop():this.splice(n,1):this},t.prototype.insert=function(n,a){return this.splice(n,0,a)},t.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=ja,this._root=this._tail=this.__hash=void 0,this.__altered=!0,this):dD()},t.prototype.push=function(){var n=arguments,a=this.size;return this.withMutations(function(i){dm(i,0,a+n.length);for(var o=0;o>>rνif(a>=this.array.length)return new fm([],t);var o,i=0===a;if(r>0){var s=this.array[a];if((o=s&&s.removeBefore(t,r-ja,n))===s&&i)return this}if(i&&!o)return this;var u=nb(this,t);if(!i)for(var c=0;c>>rνif(a>=this.array.length)return this;if(r>0){var o=this.array[a];if((i=o&&o.removeAfter(t,r-ja,n))===o&&a===this.array.length-1)return this}var s=nb(this,t);return s.array.splice(a+1),i&&(s.array[a]=i),s};var rJ,ES={};function tJ(e,t){var r=e._origin,n=e._capacity,a=PS(n),i=e._tail;return function o(c,l,f){return 0===l?function s(c,l){var f=l===a?i&&i.array:c&&c.array,d=l>r?0:r-l,p=n-l;return p>Zc&&(p=Zc),function(){if(d===p)return ES;var h=t?--p:d++;return f&&f[h]}}(c,f):function u(c,l,f){var d,p=c&&c.array,h=f>r?0:r-f>>l,m=1+(n-f>>l);return m>Zc&&(m=Zc),function(){for(;;){if(d){var v=d();if(v!==ES)return v;d=null}if(h===m)return ES;var g=t?--m:h++;d=o(p&&p[g],l-ja,f+(g<>>r&nu,s=e&&o0){var c=e&&e.array[o],l=IN(c,t,r-ja,n,a,i);return l===c?e:((u=nb(e,t)).array[o]=l,u)}return s&&e.array[o]===a?e:(i&&Qc(i),u=nb(e,t),void 0===a&&o===u.array.length-1?u.array.pop():u.array[o]=a,u)}function nb(e,t){return t&&e&&t===e.ownerID?e:new fm(e?e.array.slice():[],t)}function nJ(e,t){if(t>=PS(e._capacity))return e._tail;if(t<1<0;)r=r.array[t>>>n&nu],n-=ja;return r}}function dm(e,t,r){void 0!==t&&(t|=0),void 0!==r&&(r|=0);var n=e.__ownerID||new WF,a=e._origin,i=e._capacity,o=a+t,s=void 0===r?i:r<0?i+r:a+r;if(o===a&&s===i)return e;if(o>=s)return e.clear();for(var u=e._level,c=e._root,l=0;o+l<0;)c=new fm(c&&c.array.length?[void 0,c]:[],n),l+=1<<(u+=ja);l&&(o+=l,a+=l,s+=l,i+=l);for(var f=PS(i),d=PS(s);d>=1<f?new fm([],n):p;if(p&&d>f&&oja;v-=ja){var g=f>>>vνm=m.array[g]=nb(m.array[g],n)}m.array[f>>>ja&nu]=p}if(s=d)o-=d,s-=d,u=ja,c=null,h=h&&h.removeBefore(n,0,o);else if(o>a||d>>uνif(y!==d>>>u&nu)break;y&&(l+=(1<a&&(c=c.removeBefore(n,u,o-l)),c&&d>>ja<=Zc&&a.size>=2*n.size?(s=(u=a.filter(function(c,l){return void 0!==c&&i!==l})).toKeyedSeq().map(function(c){return c[0]}).flip().toMap(),e.__ownerID&&(s.__ownerID=u.__ownerID=e.__ownerID)):(s=n.remove(t),u=i===a.size-1?a.pop():a.set(i,void 0))}else if(o){if(r===a.get(i)[1])return e;s=n,u=a.set(i,[t,r])}else s=n.set(t,a.size),u=a.set(a.size,[t,r]);return e.__ownerID?(e.size=s.size,e._map=s,e._list=u,e.__hash=void 0,e.__altered=!0,e):PN(s,u)}nl.isOrderedMap=tN,nl.prototype[Qy]=!0,nl.prototype[hS]=nl.prototype.remove;var oJ="@@__IMMUTABLE_STACK__@@";function pD(e){return!(!e||!e[oJ])}var hD=function(e){function t(r){return null==r?mD():pD(r)?r:mD().pushAll(r)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("Stack [","]")},t.prototype.get=function(n,a){var i=this._head;for(n=um(this,n);i&&n--;)i=i.next;return i?i.value:a},t.prototype.peek=function(){return this._head&&this._head.value},t.prototype.push=function(){var n=arguments;if(0===arguments.length)return this;for(var a=this.size+arguments.length,i=this._head,o=arguments.length-1;o>=0;o--)i={value:n[o],next:i};return this.__ownerID?(this.size=a,this._head=i,this.__hash=void 0,this.__altered=!0,this):kS(a,i)},t.prototype.pushAll=function(n){if(0===(n=e(n)).size)return this;if(0===this.size&&pD(n))return n;pc(n.size);var a=this.size,i=this._head;return n.__iterate(function(o){a++,i={value:o,next:i}},!0),this.__ownerID?(this.size=a,this._head=i,this.__hash=void 0,this.__altered=!0,this):kS(a,i)},t.prototype.pop=function(){return this.slice(1)},t.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):mD()},t.prototype.slice=function(n,a){if(mS(n,a,this.size))return this;var i=Ky(n,this.size);if(vS(a,this.size)!==this.size)return e.prototype.slice.call(this,n,a);for(var s=this.size-i,u=this._head;i--;)u=u.next;return this.__ownerID?(this.size=s,this._head=u,this.__hash=void 0,this.__altered=!0,this):kS(s,u)},t.prototype.__ensureOwner=function(n){return n===this.__ownerID?this:n?kS(this.size,this._head,n,this.__hash):0===this.size?mD():(this.__ownerID=n,this.__altered=!1,this)},t.prototype.__iterate=function(n,a){var i=this;if(a)return new tg(this.toArray()).__iterate(function(u,c){return n(u,c,i)},a);for(var o=0,s=this._head;s&&!1!==n(s.value,o++,this);)s=s.next;return o},t.prototype.__iterator=function(n,a){if(a)return new tg(this.toArray()).__iterator(n,a);var i=0,o=this._head;return new jn(function(){if(o){var s=o.value;return o=o.next,qa(n,i++,s)}return{value:void 0,done:!0}})},t}(Jv);hD.isStack=pD;var sJ,su=hD.prototype;function kS(e,t,r,n){var a=Object.create(su);return a.size=e,a._head=t,a.__ownerID=r,a.__hash=n,a.__altered=!1,a}function mD(){return sJ||(sJ=kS(0))}su[oJ]=!0,su.shift=su.pop,su.unshift=su.push,su.unshiftAll=su.pushAll,su.withMutations=xS,su.wasAltered=xN,su.asImmutable=AS,su["@@transducer/init"]=su.asMutable=wS,su["@@transducer/step"]=function(e,t){return e.unshift(t)},su["@@transducer/result"]=function(e){return e.asImmutable()};var uJ="@@__IMMUTABLE_SET__@@";function vD(e){return!(!e||!e[uJ])}function MN(e){return vD(e)&&el(e)}function RN(e,t){if(e===t)return!0;if(!au(t)||void 0!==e.size&&void 0!==t.size&&e.size!==t.size||void 0!==e.__hash&&void 0!==t.__hash&&e.__hash!==t.__hash||La(e)!==La(t)||xs(e)!==xs(t)||el(e)!==el(t))return!1;if(0===e.size&&0===t.size)return!0;var r=!gS(e);if(el(e)){var n=e.entries();return t.every(function(u,c){var l=n.next().value;return l&&zo(l[1],u)&&(r||zo(l[0],c))})&&n.next().done}var a=!1;if(void 0===e.size)if(void 0===t.size)"function"==typeof e.cacheResult&&e.cacheResult();else{a=!0;var i=e;e=t,t=i}var o=!0,s=t.__iterate(function(u,c){if(r?!e.has(u):a?!zo(u,e.get(c,Pn)):!zo(e.get(c,Pn),u))return o=!1,!1});return o&&e.size===s}function ag(e,t){var r=function(n){e.prototype[n]=t[n]};return Object.keys(t).forEach(r),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach(r),e}function gD(e){if(!e||"object"!=typeof e)return e;if(!au(e)){if(!lm(e))return e;e=ou(e)}if(La(e)){var t={};return e.__iterate(function(n,a){t[a]=gD(n)}),t}var r=[];return e.__iterate(function(n){r.push(gD(n))}),r}var OS=function(e){function t(r){return null==r?FS():vD(r)&&!el(r)?r:FS().withMutations(function(n){var a=e(r);pc(a.size),a.forEach(function(i){return n.add(i)})})}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.of=function(){return this(arguments)},t.fromKeys=function(n){return this($c(n).keySeq())},t.intersect=function(n){return(n=mi(n).toArray()).length?as.intersect.apply(t(n.pop()),n):FS()},t.union=function(n){return(n=mi(n).toArray()).length?as.union.apply(t(n.pop()),n):FS()},t.prototype.toString=function(){return this.__toString("Set {","}")},t.prototype.has=function(n){return this._map.has(n)},t.prototype.add=function(n){return yD(this,this._map.set(n,n))},t.prototype.remove=function(n){return yD(this,this._map.remove(n))},t.prototype.clear=function(){return yD(this,this._map.clear())},t.prototype.map=function(n,a){var i=this,o=!1,s=yD(this,this._map.mapEntries(function(u){var c=u[1],l=n.call(a,c,c,i);return l!==c&&(o=!0),[l,l]},a));return o?s:this},t.prototype.union=function(){for(var n=[],a=arguments.length;a--;)n[a]=arguments[a];return 0===(n=n.filter(function(i){return 0!==i.size})).length?this:0!==this.size||this.__ownerID||1!==n.length?this.withMutations(function(i){for(var o=0;o=0&&a=0&&i>>-15,461845907),t=bS(t<<13|t>>>-13,5),t=bS((t=(t+3864292196|0)^e)^t>>>16,2246822507),t=sD((t=bS(t^t>>>13,3266489909))^t>>>16)}(e.__iterate(r?t?function(i,o){n=31*n+bJ(Ru(i),Ru(o))|0}:function(i,o){n=n+bJ(Ru(i),Ru(o))|0}:t?function(i){n=31*n+Ru(i)|0}:function(i){n=n+Ru(i)|0}),n)}(this))}});var ws=mi.prototype;ws[l$]=!0,ws[aD]=ws.values,ws.toJSON=ws.toArray,ws.__toStringMapper=_S,ws.inspect=ws.toSource=function(){return this.toString()},ws.chain=ws.flatMap,ws.contains=ws.includes,ag($c,{flip:function(){return Da(this,E$(this))},mapEntries:function(t,r){var n=this,a=0;return Da(this,this.toSeq().map(function(i,o){return t.call(r,[o,i],a++,n)}).fromEntrySeq())},mapKeys:function(t,r){var n=this;return Da(this,this.toSeq().flip().map(function(a,i){return t.call(r,a,i,n)}).flip())}});var NS=$c.prototype;NS[f$]=!0,NS[aD]=ws.entries,NS.toJSON=hJ,NS.__toStringMapper=function(e,t){return _S(t)+": "+_S(e)},ag(Jv,{toKeyedSeq:function(){return new uD(this,!1)},filter:function(t,r){return Da(this,P$(this,t,r,!1))},findIndex:function(t,r){var n=this.findEntry(t,r);return n?n[0]:-1},indexOf:function(t){var r=this.keyOf(t);return void 0===r?-1:r},lastIndexOf:function(t){var r=this.lastKeyOf(t);return void 0===r?-1:r},reverse:function(){return Da(this,cN(this,!1))},slice:function(t,r){return Da(this,lN(this,t,r,!1))},splice:function(t,r){var n=arguments.length;if(r=Math.max(r||0,0),0===n||2===n&&!r)return this;t=Ky(t,t<0?this.count():this.size);var a=this.slice(0,t);return Da(this,1===n?a:a.concat(ed(arguments,2),this.slice(t+r)))},findLastIndex:function(t,r){var n=this.findLastEntry(t,r);return n?n[0]:-1},first:function(t){return this.get(0,t)},flatten:function(t){return Da(this,R$(this,t,!1))},get:function(t,r){return(t=um(this,t))<0||this.size===1/0||void 0!==this.size&&t>this.size?r:this.find(function(n,a){return a===t},void 0,r)},has:function(t){return(t=um(this,t))>=0&&(void 0!==this.size?this.size===1/0||tt?-1:0}function bJ(e,t){return e^t+2654435769+(e<<6)+(e>>2)|0}ib.has=ws.includes,ib.contains=ib.includes,ib.keys=ib.values,ag(cm,NS),ag(rl,ab),ag(Jy,ib);var al=function(e){function t(r){return null==r?NN():MN(r)?r:NN().withMutations(function(n){var a=Zy(r);pc(a.size),a.forEach(function(i){return n.add(i)})})}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.of=function(){return this(arguments)},t.fromKeys=function(n){return this($c(n).keySeq())},t.prototype.toString=function(){return this.__toString("OrderedSet {","}")},t}(OS);al.isOrderedSet=MN;var SJ,ig=al.prototype;function _J(e,t){var r=Object.create(ig);return r.size=e?e.size:0,r._map=e,r.__ownerID=t,r}function NN(){return SJ||(SJ=_J(RS()))}ig[Qy]=!0,ig.zip=ab.zip,ig.zipWith=ab.zipWith,ig.zipAll=ab.zipAll,ig.__empty=NN,ig.__make=_J;var Ro=function(t,r){var n;!function aLe(e){if(eg(e))throw new Error("Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.");if(Jc(e))throw new Error("Can not call `Record` with an immutable Collection as default values. Use a plain javascript object instead.");if(null===e||"object"!=typeof e)throw new Error("Can not call `Record` with a non-object as default values. Use a plain javascript object instead.")}(t);var a=function(s){var u=this;if(s instanceof a)return s;if(!(this instanceof a))return new a(s);if(!n){n=!0;var c=Object.keys(t),l=i._indices={};i._name=r,i._keys=c,i._defaultValues=t;for(var f=0;f=0}function p(v){return v}e.RootRef="-=root=-",e.areStatesEqual=function t(v,g){return!!v.isHidden!=!!g.isHidden||!!v.isCollapsed!=!!g.isCollapsed||!!v.isGhost!=!!g.isGhost||!!v.isLocked!=!!g.isLocked},e.isStateChange=function r(v,g){return!!g&&(typeof g.isCollapsed<"u"&&v.isCollapsed!==g.isCollapsed||typeof g.isHidden<"u"&&v.isHidden!==g.isHidden||typeof g.isGhost<"u"&&v.isGhost!==g.isGhost||typeof g.isLocked<"u"&&v.isLocked!==g.isLocked)},e.assignState=function n(v,g){if(!g)return!1;for(var y=!1,b=0,_=Object.keys(g);b<_.length;b++){var C=_[b],x=g[C];!!x!=!!v[C]&&(y=!0,v[C]=x)}return y},e.syncState=function a(v,g){if(!g)return!1;for(var y=!1,b=0,_=Object.keys(g);b<_.length;b++)!!(x=g[C=_[b]])!=!!v[C]&&(y=!0,void 0!==x?v[C]=x:delete v[C]);for(var T=0,w=Object.keys(v);T=0})}function g(L){return l(L,function(Y,$){var Z=[];return vi.doPreOrder($.tree,$.tree.transforms.get(Y.transform.ref),Z,function(q,z,te){te.push(q.ref)}),Z.map(function(q){return $.cells.get(q)})})}function y(L){return l(L,function(Y,$){var Z=[];return $.tree.children.get(Y.transform.ref).forEach(function(q){return Z.push($.cells.get(q))}),Z})}function b(L,Y){return h(L,function($){return!!$.obj&&$.obj.type===Y.type})}function _(L,Y){return d(f(L,function($,Z){return M(Z.tree,Z.cells,$.transform.ref,Y)}))}function C(L,Y){return d(f(L,function($,Z){return j(Z.tree,Z.cells,$.transform.ref,Y)}))}function x(L,Y){return d(f(L,function($,Z){return F(Z.tree,Z.cells,$.transform.ref,Y)}))}function A(L,Y){return h(L,function($){return $.transform.transformer===Y})}function T(L,Y){return d(f(L,function($,Z){return O(Z.tree,Z.cells,$.transform.ref,Y)}))}function w(L,Y){return d(f(L,function($,Z){return N(Z.tree,Z.cells,$.transform.ref,Y)}))}function E(L){return d(f(L,function(Y,$){return $.cells.get($.tree.transforms.get(Y.transform.ref).parent)}))}function I(L,Y,$,Z,q){for(var z=L.transforms.get($),te=void 0;;){z=L.transforms.get(z.parent);var ae=Y.get(z.ref);if(ae.obj&&Z(ae)&&(te=ae,q)||z.ref===ln.RootRef)return te}}function M(L,Y,$,Z){return I(L,Y,$,Z,!0)}function O(L,Y,$,Z){return I(L,Y,$,Z,!1)}function F(L,Y,$,Z){return M(L,Y,$,Array.isArray(Z)?function(q){return Z.indexOf(q.transform.transformer)>=0}:function(q){return q.transform.transformer===Z})}function j(L,Y,$,Z){return M(L,Y,$,H(Z))}function N(L,Y,$,Z){return O(L,Y,$,H(Z))}function H(L){return Array.isArray(L)?function(Y){for(var $=0,Z=L;$=0&&($.ref=L.ref,1))}function ne(L,Y,$){if(L.tags){for(var Z=$.tags.size,q=0,z=0,te=L.tags;z1?t-1:0),n=1;n3?t.i-4:t.i:Array.isArray(e)?1:SD(e)?2:CD(e)?3:0}function hm(e,t){return 2===pm(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function xJ(e,t,r){var n=pm(e);2===n?e.set(t,r):3===n?e.add(r):e[t]=r}function SD(e){return CLe&&e instanceof Map}function CD(e){return xLe&&e instanceof Set}function Oo(e){return e.o||e.t}function VN(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=MJ(e);delete t[tn];for(var r=sb(t),n=0;n1&&(e.set=e.add=e.clear=e.delete=vLe),Object.freeze(e),t&&Ep(e,function(r,n){return zN(n,!0)},!0)),e}function vLe(){ko(2)}function GN(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function rd(e){var t=QN[e];return t||ko(18,e),t}function BS(){return US}function jN(e,t){t&&(rd("Patches"),e.u=[],e.s=[],e.v=t)}function xD(e){qN(e),e.p.forEach(gLe),e.p=null}function qN(e){e===US&&(US=e.l)}function AJ(e){return US={p:[],l:US,h:e,m:!0,_:0}}function gLe(e){var t=e[tn];0===t.i||1===t.i?t.j():t.g=!0}function WN(e,t){t._=t.p.length;var r=t.p[0],n=void 0!==e&&e!==r;return t.h.O||rd("ES5").S(t,e,n),n?(r[tn].P&&(xD(t),ko(4)),td(e)&&(e=wD(t,e),t.l||AD(t,e)),t.u&&rd("Patches").M(r[tn].t,e,t.u,t.s)):e=wD(t,r,[]),xD(t),t.u&&t.v(t.u,t.s),e!==ZN?e:void 0}function wD(e,t,r){if(GN(t))return t;var n=t[tn];if(!n)return Ep(t,function(s,u){return TJ(e,n,t,s,u,r)},!0),t;if(n.A!==e)return t;if(!n.P)return AD(e,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var a=4===n.i||5===n.i?n.o=VN(n.k):n.o,i=a,o=!1;3===n.i&&(i=new Set(a),a.clear(),o=!0),Ep(i,function(s,u){return TJ(e,n,a,s,u,r,o)}),AD(e,a,!1),r&&e.u&&rd("Patches").N(n,r,e.u,e.s)}return n.o}function TJ(e,t,r,n,a,i,o){if(Dp(a)){var s=wD(e,a,i&&t&&3!==t.i&&!hm(t.R,n)?i.concat(n):void 0);if(xJ(r,n,s),!Dp(s))return;e.m=!1}else o&&r.add(a);if(td(a)&&!GN(a)){if(!e.h.D&&e._<1)return;wD(e,a),t&&t.A.l||AD(e,a)}}function AD(e,t,r){void 0===r&&(r=!1),!e.l&&e.h.D&&e.m&&zN(t,r)}function YN(e,t){var r=e[tn];return(r?Oo(r):e)[t]}function DJ(e,t){if(t in e)for(var r=Object.getPrototypeOf(e);r;){var n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Object.getPrototypeOf(r)}}function ku(e){e.P||(e.P=!0,e.l&&ku(e.l))}function XN(e){e.o||(e.o=VN(e.t))}function LS(e,t,r){var n=SD(t)?rd("MapSet").F(t,r):CD(t)?rd("MapSet").T(t,r):e.O?function(a,i){var o=Array.isArray(a),s={i:o?1:0,A:i?i.A:BS(),P:!1,I:!1,R:{},l:i,t:a,k:null,o:null,j:null,C:!1},u=s,c=zS;o&&(u=[s],c=GS);var l=Proxy.revocable(u,c),f=l.revoke,d=l.proxy;return s.k=d,s.j=f,d}(t,r):rd("ES5").J(t,r);return(r?r.A:BS()).p.push(n),n}function EJ(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return VN(e)}var IJ,US,KN=typeof Symbol<"u"&&"symbol"==typeof Symbol("x"),CLe=typeof Map<"u",xLe=typeof Set<"u",PJ=typeof Proxy<"u"&&void 0!==Proxy.revocable&&typeof Reflect<"u",ZN=KN?Symbol.for("immer-nothing"):((IJ={})["immer-nothing"]=!0,IJ),VS=KN?Symbol.for("immer-draftable"):"__$immer_draftable",tn=KN?Symbol.for("immer-state"):"__$immer_state",wLe=(typeof Symbol<"u"&&Symbol,""+Object.prototype.constructor),sb=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,MJ=Object.getOwnPropertyDescriptors||function(e){var t={};return sb(e).forEach(function(r){t[r]=Object.getOwnPropertyDescriptor(e,r)}),t},QN={},zS={get:function(e,t){if(t===tn)return e;var a,s,u,r=Oo(e);if(!hm(r,t))return a=e,(u=DJ(r,t))?"value"in u?u.value:null===(s=u.get)||void 0===s?void 0:s.call(a.k):void 0;var n=r[t];return e.I||!td(n)?n:n===YN(e.t,t)?(XN(e),e.o[t]=LS(e.A.h,n,e)):n},has:function(e,t){return t in Oo(e)},ownKeys:function(e){return Reflect.ownKeys(Oo(e))},set:function(e,t,r){var n=DJ(Oo(e),t);if(n?.set)return n.set.call(e.k,r),!0;if(!e.P){var a=YN(Oo(e),t),i=a?.[tn];if(i&&i.t===r)return e.o[t]=r,e.R[t]=!1,!0;if(function wJ(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}(r,a)&&(void 0!==r||hm(e.t,t)))return!0;XN(e),ku(e)}return e.o[t]===r&&(void 0!==r||t in e.o)||Number.isNaN(r)&&Number.isNaN(e.o[t])||(e.o[t]=r,e.R[t]=!0),!0},deleteProperty:function(e,t){return void 0!==YN(e.t,t)||t in e.t?(e.R[t]=!1,XN(e),ku(e)):delete e.R[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var r=Oo(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:1!==e.i||"length"!==t,enumerable:n.enumerable,value:r[t]}},defineProperty:function(){ko(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){ko(12)}},GS={};Ep(zS,function(e,t){GS[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),GS.deleteProperty=function(e,t){return GS.set.call(this,e,t,void 0)},GS.set=function(e,t,r){return zS.set.call(this,e[0],t,r,e[0])};var ALe=function(){function e(r){var n=this;this.O=PJ,this.D=!0,this.produce=function(a,i,o){if("function"==typeof a&&"function"!=typeof i){var s=i;i=a;var u=n;return function(m){var v=this;void 0===m&&(m=s);for(var g=arguments.length,y=Array(g>1?g-1:0),b=1;b1?l-1:0),d=1;d=0;a--){var i=n[a];if(0===i.path.length&&"replace"===i.op){r=i.value;break}}a>-1&&(n=n.slice(a+1));var o=rd("Patches").$;return Dp(r)?o(r,n):this.produce(r,function(s){return o(s,n)})},e}(),mc=new ALe,HS=mc.produce,TLe=(mc.produceWithPatches.bind(mc),mc.setAutoFreeze.bind(mc));mc.setUseProxies.bind(mc),mc.applyPatches.bind(mc),mc.createDraft.bind(mc),mc.finishDraft.bind(mc);const $N=HS;var og;function RJ(){for(var e=[],t=0;t0&&this.signal.next({v:this.queue[0],stillPresent:!0})},e.prototype.remove=function(t){var r=E_(this.queue,t);return r&&this.signal.next({v:t,stillPresent:!1}),r},e.prototype.waitFor=function(t){var r=this;return new Promise(function(n){var a=r.signal.subscribe(function(i){var s=i.stillPresent;i.v===t&&(a.unsubscribe(),n(s))})})},e}(),ED=function(){function e(t,r){var n=this;this.errorFree=!0,this.ev=Tp.create(),this.globalContext=void 0,this.events={cell:{stateUpdated:this.ev(),created:this.ev(),removed:this.ev()},object:{updated:this.ev(),created:this.ev(),removed:this.ev()},log:this.ev(),changed:this.ev(),historyUpdated:this.ev()},this.behaviors={currentObject:this.ev.behavior({state:this,ref:ln.RootRef}),isUpdating:this.ev.behavior(!1)},this.actions=new DLe,this.cells=new Map,this.spine=new DD.Impl(this.cells),this.tryGetCellData=function(o){var s,u,c=null===(u=null===(s=n.cells.get(o))||void 0===s?void 0:s.obj)||void 0===u?void 0:u.data;if(void 0===c)throw new Error("Cell '".concat(o,"' data undefined."));return c},this.historyCapacity=5,this.history=[],this.undoingHistory=!1,this.inTransaction=!1,this.inTransactionError=!1,this._inUpdate=!1,this.reverted=!1,this.updateQueue=new ELe,this._tree=vi.createEmpty(ln.createRoot(r&&r.rootState)).asTransient();var i=this._tree.root;this.runTask=r.runTask,void 0!==r?.historyCapacity&&(this.historyCapacity=r.historyCapacity),this.cells.set(i.ref,{parent:this,transform:i,sourceRef:void 0,obj:t,status:"ok",state:R({},i.state),errorText:void 0,params:{definition:{},values:{}},paramsNormalizedVersion:i.version,dependencies:{dependentBy:[],dependsOn:[]},cache:{}}),this.globalContext=r&&r.globalContext}return Object.defineProperty(e.prototype,"tree",{get:function(){return this._tree},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transforms",{get:function(){return this._tree.transforms},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"current",{get:function(){return this.behaviors.currentObject.value.ref},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"root",{get:function(){return this.cells.get(this._tree.root.ref)},enumerable:!1,configurable:!0}),e.prototype.build=function(){return new og.Root(this.tree,this)},e.prototype.addHistory=function(t,r){0!==this.historyCapacity&&(this.history.unshift([t,r||"Update"]),this.history.length>this.historyCapacity&&this.history.pop(),this.events.historyUpdated.next({state:this}))},e.prototype.clearHistory=function(){0!==this.history.length&&(this.history=[],this.events.historyUpdated.next({state:this}))},Object.defineProperty(e.prototype,"latestUndoLabel",{get:function(){return this.history.length>0?this.history[0][1]:void 0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"canUndo",{get:function(){return this.history.length>0},enumerable:!1,configurable:!0}),e.prototype.undo=function(){var t=this;return Ve.create("Undo",function(r){return ce(t,void 0,void 0,function(){var n;return le(this,function(a){switch(a.label){case 0:if(!(n=this.history.shift()))return[2];this.events.historyUpdated.next({state:this}),this.undoingHistory=!0,a.label=1;case 1:return a.trys.push([1,,3,4]),[4,this.updateTree(n[0],{canUndo:!1}).runInContext(r)];case 2:return a.sent(),[3,4];case 3:return this.undoingHistory=!1,[7];case 4:return[2]}})})})},e.prototype.getSnapshot=function(){return{tree:vi.toJSON(this._tree)}},e.prototype.setSnapshot=function(t){var r=vi.fromJSON(t.tree);return this.updateTree(r)},e.prototype.setCurrent=function(t){this.behaviors.currentObject.next({state:this,ref:t})},e.prototype.updateCellState=function(t,r){var n=this.cells.get(t);if(n){var a="function"==typeof r?r(n.state):r;ln.assignState(n.state,a)&&(n.transform=this._tree.assignState(n.transform.ref,a),this.events.cell.stateUpdated.next({state:this,ref:t,cell:n}))}},e.prototype.dispose=function(){this.ev.dispose(),this.actions.dispose()},e.prototype.select=function(t){return wr.select(t,this)},e.prototype.selectQ=function(t){return wr.select("string"==typeof t?t:t(wr.Generators),this)},e.prototype.applyAction=function(t,r,n){var a=this;return void 0===n&&(n=ln.RootRef),Ve.create("Apply Action",function(i){var o=a.cells.get(n);if(!o)throw new Error("'".concat(n,"' does not exist."));if("ok"!==o.status)throw new Error("Action cannot be applied to a cell with status '".concat(o.status,"'"));return tB(t.definition.run({ref:n,cell:o,a:o.obj,params:r,state:a},a.globalContext),i)})},e.prototype.transaction=function(t,r){var n=this;return Ve.create("State Transaction",function(a){return ce(n,void 0,void 0,function(){var i,o,s,u;return le(this,function(c){switch(c.label){case 0:i=this.inTransaction,o=this._tree.asImmutable(),s=!1,c.label=1;case 1:return c.trys.push([1,5,8,9]),i||this.behaviors.isUpdating.next(!0),this.inTransaction=!0,this.inTransactionError=!1,[4,t(a)];case 2:return c.sent(),this.inTransactionError?(s=!0,[4,this.updateTree(o).runInContext(a)]):[3,4];case 3:c.sent(),c.label=4;case 4:return[3,9];case 5:return u=c.sent(),s?[3,7]:(s=!0,[4,this.updateTree(o).runInContext(a)]);case 6:c.sent(),this.events.log.next(nd.error("Error during state transaction, reverting")),c.label=7;case 7:if(i)throw this.inTransactionError=!0,u;if(r?.rethrowErrors)throw u;return console.error(u),[3,9];case 8:return i||(this.inTransaction=!1,this.events.changed.next({state:this,inTransaction:!1}),this.behaviors.isUpdating.next(!1),s||(r?.canUndo?this.addHistory(o,"string"==typeof r.canUndo?r.canUndo:void 0):this.clearHistory())),[7];case 9:return[2]}})})})},Object.defineProperty(e.prototype,"inUpdate",{get:function(){return this._inUpdate},enumerable:!1,configurable:!0}),e.prototype.updateTree=function(t,r){var n=this,a={tree:t,options:r};return Ve.create("Update Tree",function(i){return ce(n,void 0,void 0,function(){var s,u,c,l;return le(this,function(f){switch(f.label){case 0:return[4,this.updateQueue.enqueue(a)];case 1:if(!f.sent())return[2];this._inUpdate=!0,s=r?.canUndo?this._tree.asImmutable():void 0,u=!1,this.inTransaction||this.behaviors.isUpdating.next(!0),f.label=2;case 2:if(f.trys.push([2,,7,8]),og.is(t)){if(t.editInfo.applied)throw new Error("This builder has already been applied. Create a new builder for further state updates");t.editInfo.applied=!0}return this.reverted=!1,r&&(r.revertIfAborted||r.revertOnError)?[4,this._revertibleTreeUpdate(i,a,r)]:[3,4];case 3:return l=f.sent(),[3,6];case 4:return[4,this._updateTree(i,a)];case 5:l=f.sent(),f.label=6;case 6:return u=this.reverted,(c=l).ctx.hadError&&(this.inTransactionError=!0),c.cell?[2,new o$(c.cell.transform.ref,this)]:[2];case 7:return this._inUpdate=!1,this.updateQueue.handled(a),this.inTransaction||(this.behaviors.isUpdating.next(!1),r?.canUndo?u||this.addHistory(s,"string"==typeof r.canUndo?r.canUndo:void 0):this.undoingHistory||this.clearHistory()),[7];case 8:return[2]}})})},function(){n.updateQueue.remove(a)})},e.prototype._revertibleTreeUpdate=function(t,r,n){return ce(this,void 0,void 0,function(){var a,i;return le(this,function(s){switch(s.label){case 0:return a=this.tree,[4,this._updateTree(t,r)];case 1:return((i=s.sent()).ctx.hadError||i.ctx.wasAborted)&&n.revertOnError||i.ctx.wasAborted&&n.revertIfAborted?(this.reverted=!0,[4,this._updateTree(t,{tree:a,options:r.options})]):[3,3];case 2:return[2,s.sent()];case 3:return[2,i]}})})},e.prototype._updateTree=function(t,r){return ce(this,void 0,void 0,function(){var n,a,i;return le(this,function(o){switch(o.label){case 0:n=!1,a=this.updateTreeAndCreateCtx(r.tree,t,r.options),o.label=1;case 1:return o.trys.push([1,,3,4]),[4,PLe(a)];case 2:return n=o.sent(),og.isTo(r.tree)?(i=this.select(r.tree.ref)[0],[2,{ctx:a,cell:i}]):[2,{ctx:a}];case 3:return this.spine.current=void 0,n&&this.events.changed.next({state:this,inTransaction:this.inTransaction}),[7];case 4:return[2]}})})},e.prototype.updateTreeAndCreateCtx=function(t,r,n){var a=(og.is(t)?t.getTree():t).asTransient(),i=this._tree;this._tree=a;var o=this.cells,s={parent:this,editInfo:og.is(t)?t.editInfo:void 0,errorFree:this.errorFree,taskCtx:r,oldTree:i,tree:a,cells:this.cells,spine:this.spine,results:[],options:R(R({},ILe),n),changed:!1,hadError:!1,wasAborted:!1,newCurrent:void 0,getCellData:function(u){var c;return null===(c=o.get(u).obj)||void 0===c?void 0:c.data}};return this.errorFree=!0,s},e}();!function(e){e.create=function t(n,a){return new e(n,a)},(e.ObjectEvent||(e.ObjectEvent={})).isCell=function a(i,o){return!!o&&i.ref===o.transform.ref&&i.state===o.parent}}(ED||(ED={}));var ILe={doNotLogTiming:!1,doNotUpdateCurrent:!0,revertIfAborted:!1,revertOnError:!1,canUndo:!1};function PLe(e){return ce(this,void 0,void 0,function(){var r,n,a,i,o,s,u,c,l,f,d,p,h,m,v,g,y,b,_,C,x,T,w,E,I,O,F;return le(this,function(j){switch(j.label){case 0:if(n=[],e.editInfo&&1===e.editInfo.count&&e.editInfo.lastUpdate&&e.editInfo.sourceTree===e.oldTree)r=[],a=[e.editInfo.lastUpdate];else{for(r=function OLe(e){var t={newTree:e.tree,cells:e.cells,deletes:[]};return vi.doPostOrder(e.oldTree,e.oldTree.root,t,kLe),t.deletes}(e),O=e.parent.current,i=!1,o=0,s=r;o=0;m--)(_=e.cells.get(r[m]))&&MD(_.transform,_.obj,_?.transform.params,_.cache,e.parent.globalContext);for(c=0,l=r;c0||a.length>0||e.changed]}})})}function RLe(e,t,r){var n=r.cells.get(e.ref);return n&&n.transform.version===e.version?!("error"===n.status||n&&n.obj===ca.Null):(r.roots.push(e.ref),!1)}function kLe(e,t,r){!r.newTree.transforms.has(e.ref)&&r.cells.has(e.ref)&&r.deletes.push(e.ref)}function FLe(e,t,r){var n=r.cells.get(e.ref);!n||!ln.syncState(n.state,e.state)||r.parent.events.cell.stateUpdated.next({state:r.parent,ref:e.ref,cell:n})}function ID(e,t,r,n){var a=e.cells.get(t),i=a.status!==r;a.status=r,a.errorText=n,i&&e.parent.events.cell.stateUpdated.next({state:e.parent,ref:t,cell:a})}function BLe(e,t,r){r.cells.get(e.ref).transform=e,ID(r,e.ref,"pending")}function ULe(e){for(var t=0,r=e.dependencies.dependsOn;t"u"&&(e[a]=t[a])}return e}(t.params,o):o}return D.resolveRefs(i,t.params,e.getCellData),{definition:i,values:t.params}}(e,o,l,i),n.transforms.has(t)&&i.params?[3,2]:(i.params=f,[4,BJ(e,i,o.transformer,l,f.values)]);case 1:return eB(d=x.sent(),o),i.obj=d,[2,{ref:t,action:"created",obj:d}];case 2:return p=i.params.values,h=i.cache,m=null===(r=i.obj)||void 0===r?void 0:r.data,v=f.values,i.params=f,i.obj&&i.obj!==ca.Null?[4,WLe(e,i,o.transformer,l,i.obj,p,v)]:[3,4];case 3:return y=x.sent(),[3,5];case 4:y=rt.UpdateResult.Recreate,x.label=5;case 5:switch(y){case rt.UpdateResult.Recreate:return[3,6];case rt.UpdateResult.Updated:return[3,8];case rt.UpdateResult.Null:return[3,9]}return[3,10];case 6:return MD(o,_=i.obj,p,h,e.parent.globalContext),[4,BJ(e,i,o.transformer,l,v)];case 7:return eB(C=x.sent(),o),i.obj=C,[2,{ref:t,action:"replaced",oldObj:_,obj:C}];case 8:return eB(i.obj,o),[2,{ref:t,action:"updated",oldData:m,obj:i.obj}];case 9:return MD(o,i.obj,p,h,e.parent.globalContext),i.obj=ca.Null,[2,{ref:t,action:"updated",obj:i.obj}];case 10:return[2,{action:"none"}]}})})}function MD(e,t,r,n,a){var i,o;null===(o=(i=e.transformer.definition).dispose)||void 0===o||o.call(i,{b:t!==ca.Null?t:void 0,params:r,cache:n},a)}function eB(e,t){!e||e===ca.Null||(e.tags=t.tags)}function tB(e,t){return"function"==typeof e.runInContext?e.runInContext(t):e}function NJ(e){if(0!==e.dependencies.dependsOn.length){for(var t=Object.create(null),r=0,n=e.dependencies.dependsOn;r>8&255}},e.ensureLittleEndian=function o(s,u,c,l,f){e.IsNativeEndianLittle||!c||l<=1||a(s,u,c,l,f)}}(tf||(tf={})),function(e){e.fromBuffer=function t(r,n){return{name:n,readBuffer:function(a,i,o,s){var u,c;if("number"==typeof i){o=Po(o,i);var l=a;u=(f=Math.min(r.length,l+o))-l,c=tf.fromUint8Array(new Uint8Array(r.buffer,l,f-l))}else{o=Po(o,i.length),l=a;var f=Math.min(r.length,l+o);i.set(r.subarray(l,f),s),u=f-l,c=i}return o!==u&&console.warn("byteCount ".concat(o," and bytesRead ").concat(u," differ")),Promise.resolve({bytesRead:u,buffer:c})},writeBuffer:function(a,i,o){return o=Po(o,i.length),console.error(".writeBuffer not implemented for FileHandle.fromBuffer"),Promise.resolve(0)},writeBufferSync:function(a,i,o){return o=Po(o,i.length),console.error(".writeSync not implemented for FileHandle.fromBuffer"),0},close:Py}}}(RD||(RD={}));var lo=function(e){return e.Float32="float32",e.Int8="int8",e.Int16="int16",e.Uint16="uint16",e}(lo||{});function LJ(e){return e===lo.Float32?4:e===lo.Int16||e===lo.Uint16?2:1}function YLe(e,t,r,n){return void 0===r&&(r=0),e===lo.Float32?new Float32Array(t,r,n):e===lo.Int16?new Int16Array(t,r,n):e===lo.Uint16?new Uint16Array(t,r,n):new Int8Array(t,r,n)}function KLe(e,t,r,n,a,i){return ce(this,void 0,void 0,function(){return le(this,function(o){switch(o.label){case 0:return[4,t.readBuffer(r,e.readBuffer,n,a)];case 1:return o.sent(),e.elementByteSize>1&&(void 0!==i&&i!==tf.IsNativeEndianLittle||!tf.IsNativeEndianLittle)&&tf.flipByteOrder(e.readBuffer,e.valuesBuffer,n,e.elementByteSize,a),[2,e.values]}})})}function ZLe(e){return ce(this,void 0,void 0,function(){var r,n,a,i,s,u;return le(this,function(l){switch(l.label){case 0:return[4,e.readBuffer(0,1024)];case 1:if(r=l.sent().buffer,"MAP "!==(n=String.fromCharCode(r.readUInt8(208),r.readUInt8(209),r.readUInt8(210),r.readUInt8(211))))throw new Error('ccp4 format error, missing "MAP " string');return a=[r.readUInt8(212),r.readUInt8(213)],i=!1,68===a[0]&&65===a[1]?i=!0:17===a[0]&&17===a[1]?i=!1:r.readInt32LE(12)<=16&&(i=!0),u=i?function(f){return r.readFloatLE(4*f)}:function(f){return r.readFloatBE(4*f)},[2,{header:{NC:(s=i?function(f){return r.readInt32LE(4*f)}:function(f){return r.readInt32BE(4*f)})(0),NR:s(1),NS:s(2),MODE:s(3),NCSTART:s(4),NRSTART:s(5),NSSTART:s(6),NX:s(7),NY:s(8),NZ:s(9),xLength:u(10),yLength:u(11),zLength:u(12),alpha:u(13),beta:u(14),gamma:u(15),MAPC:s(16),MAPR:s(17),MAPS:s(18),AMIN:u(19),AMAX:u(20),AMEAN:u(21),ISPG:s(22),NSYMBT:s(23),LSKFLG:s(24),SKWMAT:[],SKWTRN:[],userFlag1:s(39),userFlag2:s(40),originX:u(49),originY:u(50),originZ:u(51),MAP:n,MACHST:a,ARMS:u(54)},littleEndian:i}]}})})}function UJ(e){switch(e){case 0:return lo.Int8;case 1:return lo.Int16;case 2:return lo.Float32;case 3:throw new Error("mode 3 unsupported, complex 16-bit integers");case 4:throw new Error("mode 4 unsupported, complex 32-bit reals");case 6:case 16:throw new Error("mode 16 unsupported, unsigned char * 3 (for rgb data, non-standard)")}throw new Error("unknown mode '".concat(e,"'"))}function VJ(e){return-128===e.userFlag1&&127===e.userFlag2}function zJ(e){return VJ(e)?lo.Float32:UJ(e.MODE)}function JLe(e,t,r){return ce(this,void 0,void 0,function(){var n,a,i,o,s,u,c,l,f,d;return le(this,function(h){switch(h.label){case 0:return[4,r.update({message:"Parsing CCP4/MRC/MAP file..."})];case 1:return h.sent(),[4,ZLe(e)];case 2:return n=h.sent(),i=n.littleEndian,o=function $Le(e){return 1024+e.NSYMBT}(a=n.header),s=UJ(a.MODE),u=zJ(a),c=a.NC*a.NR*a.NS,l=LJ(s),f=c*l,d=function XLe(e,t){var r=LJ(t),n=new ArrayBuffer(r*e),a=tf.fromArrayBuffer(n),i=tf.IsNativeEndianLittle?n:new ArrayBuffer(r*e);return{type:t,elementByteSize:r,readBuffer:a,valuesBuffer:new Uint8Array(i),values:YLe(t,i)}}(c,u),function QLe(e,t,r,n,a,i){ce(this,void 0,void 0,function(){var o,s,u,c,l,f;return le(this,function(d){switch(d.label){case 0:return VJ(e)?[4,r.readBuffer(n,t.readBuffer,a,o=3*a)]:[3,2];case 1:for(d.sent(),s=new Int8Array(t.valuesBuffer.buffer,o),c=.5*(e.AMIN+e.AMAX+(u=(e.AMAX-e.AMIN)/255)),l=0,f=a;l=0){var C=r(2,4);0===C&&(C=1);for(var x=0;x1e5&&t.shouldUpdate?(i=r.position,[4,t.update({current:r.position,max:r.length})]):[3,3]:[3,4];case 2:l.sent(),l.label=3;case 3:if((o=FD(n.tokenizer).trim()).startsWith("%VERSION"))a.version=o.substring(8).trim();else if(o.startsWith("%FLAG")){if(s=o.substring(5).trim(),!FD(n.tokenizer).trim().startsWith("%FORMAT"))throw new Error("expected %FORMAT");if("TITLE"===s)a.title=function V6e(e){for(var t=e.tokenizer,r=[];t.tokenEnd1e5&&t.shouldUpdate?(o=n.position,[4,t.update({current:n.position,max:n.length})]):[3,3]:[3,4];case 2:d.sent(),d.label=3;case 3:if(!(c=iB(a.tokenizer).trim())||"*"===c[0]||";"===c[0])return[3,1];if(c.startsWith("#include"))throw new Error("#include statements not allowed");if(c.startsWith("[")){if(null===(l=c.match(K6e)))throw new Error("expected field name");if("moleculetype"===(f=l[1]))r(),u=function Q6e(e){for(var t=e.tokenizer,r=void 0;t.tokenEnd=t.length));){var a=t.data[t.position];if("["===a)break;if(";"!==a&&"*"!==a){for(var i=0;i<2;++i)switch(gm(t),ND(t),oB(t),i){case 0:Ke.add(r,t.tokenStart,t.tokenEnd);break;case 1:Ke.add(n,t.tokenStart,t.tokenEnd)}Y6e(t),ND(t)}else vm(t)}return Qr.ofColumns(W6e,{compound:er(r)(ie.Schema.str),molCount:er(n)(ie.Schema.int)})}(a);else for(;n.tokenEndHO){for(var t=[],r=0;r0)throw new Error("dcd format with fixed atoms unsupported, aborting");var m=r.NATOM,v=4*m;for(u=0,s=r.NSET;u=f)return"";var d=l+r;return d>f&&(d=f),function ake(e,t,r){for(var n=t,a=r-1,i=e.charCodeAt(n);(9===i||32===i)&&n<=a;)i=e.charCodeAt(++n);for(i=e.charCodeAt(a);(9===i||32===i)&&a>=n;)i=e.charCodeAt(--a);return e.substring(n,a+1)}(a,l,d)}:"int"===s?function(c){var l=i[2*c]+t;return l>i[2*c+1]?0:Dv(a,l,l+r)}:function(c){var l=i[2*c]+t;return l>i[2*c+1]?0:function gEe(e,t,r){for(;t=0?(r.timeInPs=parseFloat(n.substring(a+2)),r.title=n.substring(0,a).trim(),r.title&&","===r.title[r.title.length-1]&&(r.title=r.title.substring(0,r.title.length-1))):r.title=n}(a),function T8e(e){var t=e.tokenizer;lt.markLine(t);var r=lt.getTokenString(t);e.numberOfAtoms=parseInt(r)}(a),[4,D8e(a)]):[3,4];case 3:return i=s.sent(),function E8e(e){var r=lt.readLine(e.tokenizer).trim().split(/\s+/g);e.header.box=[+r[0],+r[1],+r[2]]}(a),n.push({header:a.header,atoms:i}),[3,2];case 4:return[2,Fn.success({structures:n})]}})})}function P8e(e){var t=this;return Ve.create("Parse GRO",function(r){return ce(t,void 0,void 0,function(){return le(this,function(n){switch(n.label){case 0:return[4,I8e(e,r)];case 1:return[2,n.sent()]}})})})}function M8e(e,t,r){var n=this;return void 0===r&&(r=!1),Ve.create("Parse PDB",function(a){return ce(n,void 0,void 0,function(){var i,o,s;return le(this,function(u){switch(u.label){case 0:return o=(i=Fn).success,s={},[4,lt.readAllLinesAsync(e,a)];case 1:return[2,o.apply(i,[(s.lines=u.sent(),s.id=t,s.isPdbqt=r,s)])]}})})})}var Ou=S();function sg(e,t,r,n){for(var a=0,i=3*n;a0?Math.ceil(e/n):0;return{width:n,height:a,length:n*a*t}}(e,t),i=a.length,o=a.width,s=a.height;return{array:n=n&&n.length>=i?n:new r(i),width:o,height:s}}var il=S(),B8e=new lc("14"),L8e=new lc("98");function aee(e){return e>1e5?B8e:L8e}function Ip(e,t,r){var n=3*r,a=aee(t);a.reset();for(var i=0,o=3*t;i>2),n=t-4>>2,a=4*n,i=0;if(n<0)for(var o=0;o>16]}for(o=a;o=85}return!1}(e);return{instancedArrays:t,standardDerivatives:n,elementIndexUint:r,textureFloat:a,textureFloatLinear:i,textureHalfFloat:o,textureHalfFloatLinear:s,depthTexture:u,blendMinMax:c,vertexArrayObject:l,fragDepth:f,colorBufferFloat:d,colorBufferHalfFloat:p,drawBuffers:h,drawBuffersIndexed:m,shaderTextureLod:v,sRGB:g,disjointTimerQuery:y,parallelShaderCompile:b,fboRenderMipmap:_,provokingVertex:C,clipCullDistance:x,conservativeDepth:A,stencilTexturing:T,clipControl:w,noNonInstancedActiveAttribs:E}}!function(e){e.create=function t(a,i,o){return{array:a,width:i,height:o}},e.flipY=function r(a){for(var i=a.array,o=a.width,s=a.height,c=o*(i.length/(o*s)),l=0,f=s/2;l 0.0 && uBumpAmplitude > 0.0 && bumpiness > 0.0) {\n material.rgb += fbm(vModelPosition * uBumpFrequency) * uBumpAmplitude * bumpiness;\n material.rgb -= 0.5 * uBumpAmplitude * bumpiness;\n }\n #endif\n\n gl_FragColor = material;\n#else\n #ifdef bumpEnabled\n if (uBumpFrequency > 0.0 && uBumpAmplitude > 0.0 && bumpiness > 0.0) {\n normal = perturbNormal(-vViewPosition, normal, fbm(vModelPosition * uBumpFrequency), (uBumpAmplitude * bumpiness) / uBumpFrequency);\n }\n #endif\n\n vec4 color = material;\n\n ReflectedLight reflectedLight = ReflectedLight(vec3(0.0), vec3(0.0), vec3(0.0), vec3(0.0));\n\n PhysicalMaterial physicalMaterial;\n physicalMaterial.diffuseColor = color.rgb * (1.0 - metalness);\n #ifdef enabledFragDepth\n physicalMaterial.roughness = min(max(roughness, 0.0525), 1.0);\n #else\n vec3 dxy = max(abs(dFdx(normal)), abs(dFdy(normal)));\n float geometryRoughness = max(max(dxy.x, dxy.y), dxy.z);\n physicalMaterial.roughness = min(max(roughness, 0.0525) + geometryRoughness, 1.0);\n #endif\n physicalMaterial.specularColor = mix(vec3(0.04), color.rgb, metalness);\n physicalMaterial.specularF90 = 1.0;\n\n GeometricContext geometry;\n geometry.position = -vViewPosition;\n geometry.normal = normal;\n geometry.viewDir = normalize(vViewPosition);\n\n IncidentLight directLight;\n #pragma unroll_loop_start\n for (int i = 0; i < dLightCount; ++i) {\n directLight.direction = uLightDirection[i];\n directLight.color = uLightColor[i] * PI; // * PI for punctual light\n RE_Direct_Physical(directLight, geometry, physicalMaterial, reflectedLight);\n }\n #pragma unroll_loop_end\n\n vec3 irradiance = uAmbientColor * PI; // * PI for punctual light\n RE_IndirectDiffuse_Physical(irradiance, geometry, physicalMaterial, reflectedLight);\n\n // indirect specular only metals\n vec3 radiance = uAmbientColor * metalness;\n vec3 iblIrradiance = uAmbientColor * metalness;\n vec3 clearcoatRadiance = vec3(0.0);\n RE_IndirectSpecular_Physical(radiance, iblIrradiance, clearcoatRadiance, geometry, physicalMaterial, reflectedLight);\n\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n outgoingLight = clamp(outgoingLight, 0.01, 0.99); // prevents black artifacts on specular highlight with transparent background\n\n gl_FragColor = vec4(outgoingLight, color.a);\n#endif\n\n#if defined(dXrayShaded_on)\n gl_FragColor.a *= 1.0 - pow(abs(dot(normal, vec3(0.0, 0.0, 1.0))), uXrayEdgeFalloff);\n#elif defined(dXrayShaded_inverted)\n gl_FragColor.a *= pow(abs(dot(normal, vec3(0.0, 0.0, 1.0))), uXrayEdgeFalloff);\n#endif\n\ngl_FragColor.rgb *= uExposure;\n",apply_marker_color:"\n\n#if defined(dColorMarker)\n if (marker > 0.0) {\n if ((uMarkerPriority == 1 && marker != 2.0) || (uMarkerPriority != 1 && marker == 1.0)) {\n gl_FragColor.rgb = mix(gl_FragColor.rgb, uHighlightColor, uHighlightStrength);\n gl_FragColor.a = max(gl_FragColor.a, uHighlightStrength * 0.002); // for direct-volume rendering\n } else {\n gl_FragColor.rgb = mix(gl_FragColor.rgb, uSelectColor, uSelectStrength);\n gl_FragColor.a = max(gl_FragColor.a, uSelectStrength * 0.002); // for direct-volume rendering\n }\n } else if (uMarkerAverage > 0.0) {\n gl_FragColor.rgb = mix(gl_FragColor.rgb, uDimColor, uDimStrength);\n gl_FragColor.a = max(gl_FragColor.a, uDimStrength * 0.002); // for direct-volume rendering\n }\n#endif\n",assign_clipping_varying:"\n#if dClipObjectCount != 0 && defined(dClipping)\n #if defined(dClippingType_instance)\n vClipping = readFromTexture(tClipping, aInstance, uClippingTexDim).a;\n #elif defined(dMarkerType_groupInstance)\n vClipping = readFromTexture(tClipping, aInstance * float(uGroupCount) + group, uClippingTexDim).a;\n #endif\n#endif\n",assign_color_varying:"\n#if defined(dRenderVariant_color)\n #if defined(dColorType_attribute)\n vColor.rgb = aColor;\n #elif defined(dColorType_instance)\n vColor.rgb = readFromTexture(tColor, aInstance, uColorTexDim).rgb;\n #elif defined(dColorType_group)\n vColor.rgb = readFromTexture(tColor, group, uColorTexDim).rgb;\n #elif defined(dColorType_groupInstance)\n vColor.rgb = readFromTexture(tColor, aInstance * float(uGroupCount) + group, uColorTexDim).rgb;\n #elif defined(dColorType_vertex)\n vColor.rgb = readFromTexture(tColor, VertexID, uColorTexDim).rgb;\n #elif defined(dColorType_vertexInstance)\n vColor.rgb = readFromTexture(tColor, int(aInstance) * uVertexCount + VertexID, uColorTexDim).rgb;\n #elif defined(dColorType_volume)\n vec3 cgridPos = (uColorGridTransform.w * (position - uColorGridTransform.xyz)) / uColorGridDim;\n vColor.rgb = texture3dFrom2dLinear(tColorGrid, cgridPos, uColorGridDim, uColorTexDim).rgb;\n #elif defined(dColorType_volumeInstance)\n vec3 cgridPos = (uColorGridTransform.w * (vModelPosition - uColorGridTransform.xyz)) / uColorGridDim;\n vColor.rgb = texture3dFrom2dLinear(tColorGrid, cgridPos, uColorGridDim, uColorTexDim).rgb;\n #endif\n\n #ifdef dUsePalette\n vPaletteV = ((vColor.r * 256.0 * 256.0 * 255.0 + vColor.g * 256.0 * 255.0 + vColor.b * 255.0) - 1.0) / 16777215.0;\n #endif\n\n #ifdef dOverpaint\n #if defined(dOverpaintType_instance)\n vOverpaint = readFromTexture(tOverpaint, aInstance, uOverpaintTexDim);\n #elif defined(dOverpaintType_groupInstance)\n vOverpaint = readFromTexture(tOverpaint, aInstance * float(uGroupCount) + group, uOverpaintTexDim);\n #elif defined(dOverpaintType_vertexInstance)\n vOverpaint = readFromTexture(tOverpaint, int(aInstance) * uVertexCount + VertexID, uOverpaintTexDim);\n #elif defined(dOverpaintType_volumeInstance)\n vec3 ogridPos = (uOverpaintGridTransform.w * (vModelPosition - uOverpaintGridTransform.xyz)) / uOverpaintGridDim;\n vOverpaint = texture3dFrom2dLinear(tOverpaintGrid, ogridPos, uOverpaintGridDim, uOverpaintTexDim);\n #endif\n\n // pre-mix to avoid darkening due to empty overpaint\n #ifdef dColorType_uniform\n vOverpaint.rgb = mix(uColor.rgb, vOverpaint.rgb, vOverpaint.a);\n #else\n vOverpaint.rgb = mix(vColor.rgb, vOverpaint.rgb, vOverpaint.a);\n #endif\n vOverpaint *= uOverpaintStrength;\n #endif\n\n #ifdef dSubstance\n #if defined(dSubstanceType_instance)\n vSubstance = readFromTexture(tSubstance, aInstance, uSubstanceTexDim);\n #elif defined(dSubstanceType_groupInstance)\n vSubstance = readFromTexture(tSubstance, aInstance * float(uGroupCount) + group, uSubstanceTexDim);\n #elif defined(dSubstanceType_vertexInstance)\n vSubstance = readFromTexture(tSubstance, int(aInstance) * uVertexCount + VertexID, uSubstanceTexDim);\n #elif defined(dSubstanceType_volumeInstance)\n vec3 sgridPos = (uSubstanceGridTransform.w * (vModelPosition - uSubstanceGridTransform.xyz)) / uSubstanceGridDim;\n vSubstance = texture3dFrom2dLinear(tSubstanceGrid, sgridPos, uSubstanceGridDim, uSubstanceTexDim);\n #endif\n\n // pre-mix to avoid artifacts due to empty substance\n vSubstance.rgb = mix(vec3(uMetalness, uRoughness, uBumpiness), vSubstance.rgb, vSubstance.a);\n vSubstance *= uSubstanceStrength;\n #endif\n#elif defined(dRenderVariant_pick)\n #ifdef requiredDrawBuffers\n vObject = vec4(packIntToRGB(float(uObjectId)), 1.0);\n vInstance = vec4(packIntToRGB(aInstance), 1.0);\n vGroup = vec4(packIntToRGB(group), 1.0);\n #else\n if (uPickType == 1) {\n vColor = vec4(packIntToRGB(float(uObjectId)), 1.0);\n } else if (uPickType == 2) {\n vColor = vec4(packIntToRGB(aInstance), 1.0);\n } else {\n vColor = vec4(packIntToRGB(group), 1.0);\n }\n #endif\n#endif\n\n#ifdef dTransparency\n #if defined(dTransparencyType_instance)\n vTransparency = readFromTexture(tTransparency, aInstance, uTransparencyTexDim).a;\n #elif defined(dTransparencyType_groupInstance)\n vTransparency = readFromTexture(tTransparency, aInstance * float(uGroupCount) + group, uTransparencyTexDim).a;\n #elif defined(dTransparencyType_vertexInstance)\n vTransparency = readFromTexture(tTransparency, int(aInstance) * uVertexCount + VertexID, uTransparencyTexDim).a;\n #elif defined(dTransparencyType_volumeInstance)\n vec3 tgridPos = (uTransparencyGridTransform.w * (vModelPosition - uTransparencyGridTransform.xyz)) / uTransparencyGridDim;\n vTransparency = texture3dFrom2dLinear(tTransparencyGrid, tgridPos, uTransparencyGridDim, uTransparencyTexDim).a;\n #endif\n vTransparency *= uTransparencyStrength;\n#endif\n",assign_group:"\n#ifdef dGeometryType_textureMesh\n float group = unpackRGBToInt(readFromTexture(tGroup, VertexID, uGeoTexDim).rgb);\n#else\n float group = aGroup;\n#endif\n",assign_marker_varying:"\n#if defined(dNeedsMarker)\n #if defined(dMarkerType_instance)\n vMarker = readFromTexture(tMarker, aInstance, uMarkerTexDim).a;\n #elif defined(dMarkerType_groupInstance)\n vMarker = readFromTexture(tMarker, aInstance * float(uGroupCount) + group, uMarkerTexDim).a;\n #endif\n#endif\n",assign_material_color:"\n#if defined(dNeedsMarker)\n float marker = uMarker;\n if (uMarker == -1.0) {\n marker = floor(vMarker * 255.0 + 0.5); // rounding required to work on some cards on win\n }\n#endif\n\n#if defined(dRenderVariant_color)\n #if defined(dUsePalette)\n vec4 material = vec4(texture2D(tPalette, vec2(vPaletteV, 0.5)).rgb, uAlpha);\n #elif defined(dColorType_uniform)\n vec4 material = vec4(uColor, uAlpha);\n #elif defined(dColorType_varying)\n vec4 material = vec4(vColor.rgb, uAlpha);\n #endif\n\n // mix material with overpaint\n #if defined(dOverpaint)\n material.rgb = mix(material.rgb, vOverpaint.rgb, vOverpaint.a);\n #endif\n\n float metalness = uMetalness;\n float roughness = uRoughness;\n float bumpiness = uBumpiness;\n #ifdef dSubstance\n metalness = mix(metalness, vSubstance.r, vSubstance.a);\n roughness = mix(roughness, vSubstance.g, vSubstance.a);\n bumpiness = mix(bumpiness, vSubstance.b, vSubstance.a);\n #endif\n#elif defined(dRenderVariant_depth)\n if (fragmentDepth > getDepth(gl_FragCoord.xy / uDrawingBufferSize)) {\n discard;\n }\n\n #ifndef dXrayShaded\n #if defined(dTransparency)\n float dta = 1.0 - vTransparency;\n if (vTransparency < 0.2) dta = 1.0; // hard cutoff looks better\n\n if (uRenderMask == MaskTransparent && uAlpha * dta == 1.0) {\n discard;\n } else if (uRenderMask == MaskOpaque && uAlpha * dta < 1.0) {\n discard;\n }\n #else\n if (uRenderMask == MaskTransparent && uAlpha == 1.0) {\n discard;\n } else if (uRenderMask == MaskOpaque && uAlpha < 1.0) {\n discard;\n }\n #endif\n #else\n if (uRenderMask == MaskOpaque) {\n discard;\n }\n #endif\n\n vec4 material = packDepthToRGBA(fragmentDepth);\n#elif defined(dRenderVariant_marking)\n vec4 material;\n if(uMarkingType == 1) {\n if (marker > 0.0)\n discard;\n #ifdef enabledFragDepth\n material = packDepthToRGBA(gl_FragDepthEXT);\n #else\n material = packDepthToRGBA(gl_FragCoord.z);\n #endif\n } else {\n if (marker == 0.0)\n discard;\n float depthTest = 1.0;\n if (uMarkingDepthTest) {\n depthTest = (fragmentDepth >= getDepthPacked(gl_FragCoord.xy / uDrawingBufferSize)) ? 1.0 : 0.0;\n }\n bool isHighlight = intMod(marker, 2.0) > 0.1;\n float viewZ = depthToViewZ(uIsOrtho, fragmentDepth, uNear, uFar);\n float fogFactor = smoothstep(uFogNear, uFogFar, abs(viewZ));\n if (fogFactor == 1.0)\n discard;\n material = vec4(0.0, depthTest, isHighlight ? 1.0 : 0.0, 1.0 - fogFactor);\n }\n#endif\n\n// apply per-group transparency\n#if defined(dTransparency) && (defined(dRenderVariant_pick) || defined(dRenderVariant_color))\n float ta = 1.0 - vTransparency;\n if (vTransparency < 0.09) ta = 1.0; // hard cutoff looks better\n\n #if defined(dRenderVariant_pick)\n if (ta < uPickingAlphaThreshold)\n discard; // ignore so the element below can be picked\n #elif defined(dRenderVariant_color)\n material.a *= ta;\n\n #if defined(dRenderVariant_colorBlended)\n #if defined(dTransparentBackfaces_off)\n if ((uRenderMask == MaskOpaque && material.a < 1.0) ||\n (uRenderMask == MaskTransparent && material.a == 1.0) ||\n (interior && material.a < 1.0)\n ) {\n discard;\n }\n #elif defined(dTransparentBackfaces_on)\n if ((uRenderMask == MaskOpaque && material.a < 1.0) ||\n (uRenderMask == MaskTransparent && material.a == 1.0)\n ) {\n discard;\n }\n #elif defined(dTransparentBackfaces_opaque)\n if (interior) {\n material.a = 1.0;\n } else if (\n (uRenderMask == MaskOpaque && material.a < 1.0) ||\n (uRenderMask == MaskTransparent && material.a == 1.0)\n ) {\n discard;\n }\n #endif\n #endif\n #endif\n#endif\n",assign_position:"\nmat4 model = uModel * aTransform;\nmat4 modelView = uView * model;\n#ifdef dGeometryType_textureMesh\n vec3 position = readFromTexture(tPosition, VertexID, uGeoTexDim).xyz;\n#else\n vec3 position = aPosition;\n#endif\nvec4 position4 = vec4(position, 1.0);\n// for accessing tColorGrid in vert shader and for clipping in frag shader\nvModelPosition = (model * position4).xyz;\nvec4 mvPosition = modelView * position4;\nvViewPosition = mvPosition.xyz;\ngl_Position = uProjection * mvPosition;\n",assign_size:"\n#if defined(dSizeType_uniform)\n float size = uSize;\n#elif defined(dSizeType_attribute)\n float size = aSize;\n#elif defined(dSizeType_instance)\n float size = unpackRGBToInt(readFromTexture(tSize, aInstance, uSizeTexDim).rgb);\n#elif defined(dSizeType_group)\n float size = unpackRGBToInt(readFromTexture(tSize, group, uSizeTexDim).rgb);\n#elif defined(dSizeType_groupInstance)\n float size = unpackRGBToInt(readFromTexture(tSize, aInstance * float(uGroupCount) + group, uSizeTexDim).rgb);\n#endif\n\n#if defined(dSizeType_instance) || defined(dSizeType_group) || defined(dSizeType_groupInstance)\n size /= 100.0; // NOTE factor also set in TypeScript\n#endif\n\nsize *= uSizeFactor;\n",check_picking_alpha:"\nfloat viewZ = depthToViewZ(uIsOrtho, fragmentDepth, uNear, uFar);\nfloat fogFactor = smoothstep(uFogNear, uFogFar, abs(viewZ));\nfloat alpha = (1.0 - fogFactor) * uAlpha;\n// if not opaque enough ignore so the element below can be picked\nif (uAlpha < uPickingAlphaThreshold || alpha < 0.1) {\n #ifdef dTransparentBackfaces_opaque\n if (!interior) discard;\n #else\n discard;\n #endif\n}\n",clip_instance:"\n#if defined(dClipVariant_instance) && dClipObjectCount != 0\n vec4 mCenter = uModel * aTransform * vec4(uInvariantBoundingSphere.xyz, 1.0);\n if (clipTest(vec4(mCenter.xyz, uInvariantBoundingSphere.w)))\n // move out of [ -w, +w ] to 'discard' in vert shader\n gl_Position.z = 2.0 * gl_Position.w;\n#endif\n",clip_pixel:"\n#if defined(dClipVariant_pixel) && dClipObjectCount != 0\n if (clipTest(vec4(vModelPosition, 0.0)))\n discard;\n#endif\n",color_frag_params:"\nuniform float uMetalness;\nuniform float uRoughness;\nuniform float uBumpiness;\n#ifdef bumpEnabled\n uniform float uBumpFrequency;\n uniform float uBumpAmplitude;\n#endif\n\n#if defined(dRenderVariant_color)\n #if defined(dColorType_uniform)\n uniform vec3 uColor;\n #elif defined(dColorType_varying)\n varying vec4 vColor;\n #endif\n\n #ifdef dUsePalette\n uniform sampler2D tPalette;\n varying float vPaletteV;\n #endif\n\n #ifdef dOverpaint\n varying vec4 vOverpaint;\n #endif\n\n #ifdef dSubstance\n varying vec4 vSubstance;\n #endif\n#elif defined(dRenderVariant_pick)\n #if __VERSION__ == 100 || !defined(dVaryingGroup)\n #ifdef requiredDrawBuffers\n varying vec4 vObject;\n varying vec4 vInstance;\n varying vec4 vGroup;\n #else\n varying vec4 vColor;\n #endif\n #else\n #ifdef requiredDrawBuffers\n flat in vec4 vObject;\n flat in vec4 vInstance;\n flat in vec4 vGroup;\n #else\n flat in vec4 vColor;\n #endif\n #endif\n#endif\n\n#ifdef dTransparency\n varying float vTransparency;\n#endif\n",color_vert_params:"\nuniform float uMetalness;\nuniform float uRoughness;\nuniform float uBumpiness;\n\n#if defined(dRenderVariant_color)\n #if defined(dColorType_uniform)\n uniform vec3 uColor;\n #elif defined(dColorType_attribute)\n varying vec4 vColor;\n attribute vec3 aColor;\n #elif defined(dColorType_texture)\n varying vec4 vColor;\n uniform vec2 uColorTexDim;\n uniform sampler2D tColor;\n #elif defined(dColorType_grid)\n varying vec4 vColor;\n uniform vec2 uColorTexDim;\n uniform vec3 uColorGridDim;\n uniform vec4 uColorGridTransform;\n uniform sampler2D tColorGrid;\n #elif defined(dColorType_direct)\n varying vec4 vColor;\n #endif\n\n #ifdef dUsePalette\n varying float vPaletteV;\n #endif\n\n #ifdef dOverpaint\n #if defined(dOverpaintType_instance) || defined(dOverpaintType_groupInstance) || defined(dOverpaintType_vertexInstance)\n varying vec4 vOverpaint;\n uniform vec2 uOverpaintTexDim;\n uniform sampler2D tOverpaint;\n #elif defined(dOverpaintType_volumeInstance)\n varying vec4 vOverpaint;\n uniform vec2 uOverpaintTexDim;\n uniform vec3 uOverpaintGridDim;\n uniform vec4 uOverpaintGridTransform;\n uniform sampler2D tOverpaintGrid;\n #endif\n uniform float uOverpaintStrength;\n #endif\n\n #ifdef dSubstance\n #if defined(dSubstanceType_instance) || defined(dSubstanceType_groupInstance) || defined(dSubstanceType_vertexInstance)\n varying vec4 vSubstance;\n uniform vec2 uSubstanceTexDim;\n uniform sampler2D tSubstance;\n #elif defined(dSubstanceType_volumeInstance)\n varying vec4 vSubstance;\n uniform vec2 uSubstanceTexDim;\n uniform vec3 uSubstanceGridDim;\n uniform vec4 uSubstanceGridTransform;\n uniform sampler2D tSubstanceGrid;\n #endif\n uniform float uSubstanceStrength;\n #endif\n#elif defined(dRenderVariant_pick)\n #if __VERSION__ == 100 || !defined(dVaryingGroup)\n #ifdef requiredDrawBuffers\n varying vec4 vObject;\n varying vec4 vInstance;\n varying vec4 vGroup;\n #else\n varying vec4 vColor;\n #endif\n #else\n #ifdef requiredDrawBuffers\n flat out vec4 vObject;\n flat out vec4 vInstance;\n flat out vec4 vGroup;\n #else\n flat out vec4 vColor;\n #endif\n #endif\n#endif\n\n#ifdef dTransparency\n #if defined(dTransparencyType_instance) || defined(dTransparencyType_groupInstance) || defined(dTransparencyType_vertexInstance)\n varying float vTransparency;\n uniform vec2 uTransparencyTexDim;\n uniform sampler2D tTransparency;\n #elif defined(dTransparencyType_volumeInstance)\n varying float vTransparency;\n uniform vec2 uTransparencyTexDim;\n uniform vec3 uTransparencyGridDim;\n uniform vec4 uTransparencyGridTransform;\n uniform sampler2D tTransparencyGrid;\n #endif\n uniform float uTransparencyStrength;\n#endif\n",common_clip:"\n#if dClipObjectCount != 0\n vec3 quaternionTransform(const in vec4 q, const in vec3 v) {\n vec3 t = 2.0 * cross(q.xyz, v);\n return v + q.w * t + cross(q.xyz, t);\n }\n\n vec4 computePlane(const in vec3 normal, const in vec3 inPoint) {\n return vec4(normalize(normal), -dot(normal, inPoint));\n }\n\n float planeSD(const in vec4 plane, const in vec3 center) {\n return -dot(plane.xyz, center - plane.xyz * -plane.w);\n }\n\n float sphereSD(const in vec3 position, const in vec4 rotation, const in vec3 size, const in vec3 center) {\n return (\n length(quaternionTransform(vec4(-rotation.x, -rotation.y, -rotation.z, rotation.w), center - position) / size) - 1.0\n ) * min(min(size.x, size.y), size.z);\n }\n\n float cubeSD(const in vec3 position, const in vec4 rotation, const in vec3 size, const in vec3 center) {\n vec3 d = abs(quaternionTransform(vec4(-rotation.x, -rotation.y, -rotation.z, rotation.w), center - position)) - size;\n return min(max(d.x, max(d.y, d.z)), 0.0) + length(max(d, 0.0));\n }\n\n float cylinderSD(const in vec3 position, const in vec4 rotation, const in vec3 size, const in vec3 center) {\n vec3 t = quaternionTransform(vec4(-rotation.x, -rotation.y, -rotation.z, rotation.w), center - position);\n\n vec2 d = abs(vec2(length(t.xz), t.y)) - size.xy;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n\n float infiniteConeSD(const in vec3 position, const in vec4 rotation, const in vec3 size, const in vec3 center) {\n vec3 t = quaternionTransform(vec4(-rotation.x, -rotation.y, -rotation.z, rotation.w), center - position);\n\n float q = length(t.xy);\n return dot(size.xy, vec2(q, t.z));\n }\n\n float getSignedDistance(const in vec3 center, const in int type, const in vec3 position, const in vec4 rotation, const in vec3 scale) {\n if (type == 1) {\n vec3 normal = quaternionTransform(rotation, vec3(0.0, 1.0, 0.0));\n vec4 plane = computePlane(normal, position);\n return planeSD(plane, center);\n } else if (type == 2) {\n return sphereSD(position, rotation, scale * 0.5, center);\n } else if (type == 3) {\n return cubeSD(position, rotation, scale * 0.5, center);\n } else if (type == 4) {\n return cylinderSD(position, rotation, scale * 0.5, center);\n } else if (type == 5) {\n return infiniteConeSD(position, rotation, scale * 0.5, center);\n } else {\n return 0.1;\n }\n }\n\n #if __VERSION__ == 100\n // 8-bit\n int bitwiseAnd(in int a, in int b) {\n int d = 128;\n int result = 0;\n for (int i = 0; i < 8; ++i) {\n if (d <= 0) break;\n if (a >= d && b >= d) result += d;\n if (a >= d) a -= d;\n if (b >= d) b -= d;\n d /= 2;\n }\n return result;\n }\n\n bool hasBit(const in int mask, const in int bit) {\n return bitwiseAnd(mask, bit) == 0;\n }\n #else\n bool hasBit(const in int mask, const in int bit) {\n return (mask & bit) == 0;\n }\n #endif\n\n bool clipTest(const in vec4 sphere) {\n // flag is a bit-flag for clip-objects to ignore (note, object ids start at 1 not 0)\n #if defined(dClipping)\n int flag = int(floor(vClipping * 255.0 + 0.5));\n #else\n int flag = 0;\n #endif\n\n #pragma unroll_loop_start\n for (int i = 0; i < dClipObjectCount; ++i) {\n if (flag == 0 || hasBit(flag, UNROLLED_LOOP_INDEX + 1)) {\n // TODO take sphere radius into account?\n bool test = getSignedDistance(sphere.xyz, uClipObjectType[i], uClipObjectPosition[i], uClipObjectRotation[i], uClipObjectScale[i]) <= 0.0;\n if ((!uClipObjectInvert[i] && test) || (uClipObjectInvert[i] && !test)) {\n return true;\n }\n }\n }\n #pragma unroll_loop_end\n return false;\n }\n#endif\n",common_frag_params:'\nuniform int uObjectId;\nuniform int uInstanceCount;\nuniform int uGroupCount;\n\nuniform int uPickType;\nuniform int uMarkingType;\n\n#if dClipObjectCount != 0\n uniform int uClipObjectType[dClipObjectCount];\n uniform bool uClipObjectInvert[dClipObjectCount];\n uniform vec3 uClipObjectPosition[dClipObjectCount];\n uniform vec4 uClipObjectRotation[dClipObjectCount];\n uniform vec3 uClipObjectScale[dClipObjectCount];\n\n #if defined(dClipping)\n #if __VERSION__ == 100 || defined(dClippingType_instance) || !defined(dVaryingGroup)\n varying float vClipping;\n #else\n flat in float vClipping;\n #endif\n #endif\n#endif\n\n#if defined(dColorMarker)\n uniform vec3 uHighlightColor;\n uniform vec3 uSelectColor;\n uniform vec3 uDimColor;\n uniform float uHighlightStrength;\n uniform float uSelectStrength;\n uniform float uDimStrength;\n uniform int uMarkerPriority;\n uniform float uMarkerAverage;\n#endif\n\n#if defined(dNeedsMarker)\n uniform float uMarker;\n #if __VERSION__ == 100 || defined(dMarkerType_instance) || !defined(dVaryingGroup)\n varying float vMarker;\n #else\n flat in float vMarker;\n #endif\n#endif\n\n#if defined(dRenderVariant_colorDpoit)\n #define MAX_DPOIT_DEPTH 99999.0 // NOTE constant also set in TypeScript\n uniform sampler2D tDpoitDepth;\n uniform sampler2D tDpoitFrontColor;\n#endif\n\nvarying vec3 vModelPosition;\nvarying vec3 vViewPosition;\n\nuniform vec2 uViewOffset;\n\nuniform float uNear;\nuniform float uFar;\nuniform float uIsOrtho;\n\nuniform bool uFog;\nuniform float uFogNear;\nuniform float uFogFar;\nuniform vec3 uFogColor;\n\nuniform float uAlpha;\nuniform float uPickingAlphaThreshold;\nuniform bool uTransparentBackground;\n\nuniform bool uDoubleSided;\nuniform float uInteriorDarkening;\nuniform bool uInteriorColorFlag;\nuniform vec3 uInteriorColor;\nbool interior;\n\nuniform float uXrayEdgeFalloff;\nuniform float uExposure;\n\nuniform mat4 uProjection;\n\nuniform int uRenderMask;\nuniform bool uMarkingDepthTest;\n\nuniform sampler2D tDepth;\nuniform vec2 uDrawingBufferSize;\n\nfloat getDepthPacked(const in vec2 coords) {\n return unpackRGBAToDepth(texture2D(tDepth, coords));\n}\n\nfloat getDepth(const in vec2 coords) {\n #ifdef depthTextureSupport\n return texture2D(tDepth, coords).r;\n #else\n return unpackRGBAToDepth(texture2D(tDepth, coords));\n #endif\n}\n\nfloat calcDepth(const in vec3 pos) {\n vec2 clipZW = pos.z * uProjection[2].zw + uProjection[3].zw;\n return 0.5 + 0.5 * clipZW.x / clipZW.y;\n}\n\n// "Bump Mapping Unparametrized Surfaces on the GPU" Morten S. Mikkelsen\n// https://mmikk.github.io/papers3d/mm_sfgrad_bump.pdf\nvec3 perturbNormal(in vec3 position, in vec3 normal, in float height, in float scale) {\n vec3 sigmaS = dFdx(position);\n vec3 sigmaT = dFdy(position);\n\n vec3 r1 = cross(sigmaT, normal);\n vec3 r2 = cross(normal, sigmaS);\n float det = dot(sigmaS, r1);\n\n float bs = dFdx(height);\n float bt = dFdy(height);\n\n vec3 surfGrad = sign(det) * (bs * r1 + bt * r2);\n return normalize(abs(det) * normal - scale * surfGrad);\n}\n\nfloat hash(in float h) {\n return fract(sin(h) * 43758.5453123);\n}\n\nfloat noise(in vec3 x) {\n vec3 p = floor(x);\n vec3 f = fract(x);\n f = f * f * (3.0 - 2.0 * f);\n\n float n = p.x + p.y * 157.0 + 113.0 * p.z;\n return mix(\n mix(mix(hash(n + 0.0), hash(n + 1.0), f.x),\n mix(hash(n + 157.0), hash(n + 158.0), f.x), f.y),\n mix(mix(hash(n + 113.0), hash(n + 114.0), f.x),\n mix(hash(n + 270.0), hash(n + 271.0), f.x), f.y), f.z);\n}\n\nfloat fbm(in vec3 p) {\n float f = 0.0;\n f += 0.5 * noise(p);\n p *= 2.01;\n f += 0.25 * noise(p);\n p *= 2.02;\n f += 0.125 * noise(p);\n\n return f;\n}\n',common_vert_params:"\nuniform mat4 uProjection, uModel, uView;\nuniform vec3 uCameraPosition;\n\nuniform int uObjectId;\nuniform int uVertexCount;\nuniform int uInstanceCount;\nuniform int uGroupCount;\nuniform vec4 uInvariantBoundingSphere;\n\nuniform bool uDoubleSided;\nuniform int uPickType;\n\n#if dClipObjectCount != 0\n uniform int uClipObjectType[dClipObjectCount];\n uniform bool uClipObjectInvert[dClipObjectCount];\n uniform vec3 uClipObjectPosition[dClipObjectCount];\n uniform vec4 uClipObjectRotation[dClipObjectCount];\n uniform vec3 uClipObjectScale[dClipObjectCount];\n\n #if defined(dClipping)\n uniform vec2 uClippingTexDim;\n uniform sampler2D tClipping;\n #if __VERSION__ == 100 || defined(dClippingType_instance) || !defined(dVaryingGroup)\n varying float vClipping;\n #else\n flat out float vClipping;\n #endif\n #endif\n#endif\n\n#if defined(dNeedsMarker)\n uniform float uMarker;\n uniform vec2 uMarkerTexDim;\n uniform sampler2D tMarker;\n #if __VERSION__ == 100 || defined(dMarkerType_instance) || !defined(dVaryingGroup)\n varying float vMarker;\n #else\n flat out float vMarker;\n #endif\n#endif\n\nvarying vec3 vModelPosition;\nvarying vec3 vViewPosition;\n\n#if defined(noNonInstancedActiveAttribs)\n // int() is needed for some Safari versions\n // see https://bugs.webkit.org/show_bug.cgi?id=244152\n #define VertexID int(gl_VertexID)\n#else\n attribute float aVertex;\n #define VertexID int(aVertex)\n#endif\n",common:"\n// TODO find a better place for these convenience defines\n\n#if defined(dRenderVariant_colorBlended) || defined(dRenderVariant_colorWboit) || defined(dRenderVariant_colorDpoit)\n #define dRenderVariant_color\n#endif\n\n#if defined(dColorType_instance) || defined(dColorType_group) || defined(dColorType_groupInstance) || defined(dColorType_vertex) || defined(dColorType_vertexInstance)\n #define dColorType_texture\n#endif\n\n#if defined(dColorType_volume) || defined(dColorType_volumeInstance)\n #define dColorType_grid\n#endif\n\n#if defined(dColorType_attribute) || defined(dColorType_texture) || defined(dColorType_grid)\n #define dColorType_varying\n#endif\n\n#if (defined(dRenderVariant_color) && defined(dColorMarker)) || defined(dRenderVariant_marking)\n #define dNeedsMarker\n#endif\n\n#if defined(dXrayShaded_on) || defined(dXrayShaded_inverted)\n #define dXrayShaded\n#endif\n\n#define MaskAll 0\n#define MaskOpaque 1\n#define MaskTransparent 2\n\n//\n\n#define PI 3.14159265\n#define RECIPROCAL_PI 0.31830988618\n#define EPSILON 1e-6\n\n#define saturate(a) clamp(a, 0.0, 1.0)\n\n#if __VERSION__ == 100\n #define round(x) floor((x) + 0.5)\n#endif\n\nfloat intDiv(const in float a, const in float b) { return float(int(a) / int(b)); }\nvec2 ivec2Div(const in vec2 a, const in vec2 b) { return vec2(ivec2(a) / ivec2(b)); }\nfloat intMod(const in float a, const in float b) { return a - b * float(int(a) / int(b)); }\nint imod(const in int a, const in int b) { return a - b * (a / b); }\n\nfloat pow2(const in float x) { return x * x; }\n\nvec3 packIntToRGB(in float value) {\n value = clamp(round(value), 0.0, 16777216.0 - 1.0) + 1.0;\n vec3 c = vec3(0.0);\n c.b = mod(value, 256.0);\n value = floor(value / 256.0);\n c.g = mod(value, 256.0);\n value = floor(value / 256.0);\n c.r = mod(value, 256.0);\n return c / 255.0;\n}\nfloat unpackRGBToInt(const in vec3 rgb) {\n return (floor(rgb.r * 255.0 + 0.5) * 256.0 * 256.0 + floor(rgb.g * 255.0 + 0.5) * 256.0 + floor(rgb.b * 255.0 + 0.5)) - 1.0;\n}\n\nvec2 packUnitIntervalToRG(const in float v) {\n vec2 enc;\n enc.xy = vec2(fract(v * 256.0), v);\n enc.y -= enc.x * (1.0 / 256.0);\n enc.xy *= 256.0 / 255.0;\n\n return enc;\n}\n\nfloat unpackRGToUnitInterval(const in vec2 enc) {\n return dot(enc, vec2(255.0 / (256.0 * 256.0), 255.0 / 256.0));\n}\n\nvec3 screenSpaceToViewSpace(const in vec3 ssPos, const in mat4 invProjection) {\n vec4 p = vec4(ssPos * 2.0 - 1.0, 1.0);\n p = invProjection * p;\n return p.xyz / p.w;\n}\n\nconst float PackUpscale = 256.0 / 255.0; // fraction -> 0..1 (including 1)\nconst float UnpackDownscale = 255.0 / 256.0; // 0..1 -> fraction (excluding 1)\nconst vec3 PackFactors = vec3(256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0);\nconst vec4 UnpackFactors = UnpackDownscale / vec4(PackFactors, 1.0);\nconst float ShiftRight8 = 1.0 / 256.0;\n\nvec4 packDepthToRGBA(const in float v) {\n vec4 r = vec4(fract(v * PackFactors), v);\n r.yzw -= r.xyz * ShiftRight8; // tidy overflow\n return r * PackUpscale;\n}\nfloat unpackRGBAToDepth(const in vec4 v) {\n return dot(v, UnpackFactors);\n}\n\nvec4 sRGBToLinear(const in vec4 c) {\n return vec4(mix(pow(c.rgb * 0.9478672986 + vec3(0.0521327014), vec3(2.4)), c.rgb * 0.0773993808, vec3(lessThanEqual(c.rgb, vec3(0.04045)))), c.a);\n}\nvec4 linearTosRGB(const in vec4 c) {\n return vec4(mix(pow(c.rgb, vec3(0.41666)) * 1.055 - vec3(0.055), c.rgb * 12.92, vec3(lessThanEqual(c.rgb, vec3(0.0031308)))), c.a);\n}\n\nfloat linearizeDepth(const in float depth, const in float near, const in float far) {\n return (2.0 * near) / (far + near - depth * (far - near));\n}\n\nfloat perspectiveDepthToViewZ(const in float invClipZ, const in float near, const in float far) {\n return (near * far) / ((far - near) * invClipZ - far);\n}\n\nfloat orthographicDepthToViewZ(const in float linearClipZ, const in float near, const in float far) {\n return linearClipZ * (near - far) - near;\n}\n\nfloat depthToViewZ(const in float isOrtho, const in float linearClipZ, const in float near, const in float far) {\n return isOrtho == 1.0 ? orthographicDepthToViewZ(linearClipZ, near, far) : perspectiveDepthToViewZ(linearClipZ, near, far);\n}\n\n#if __VERSION__ == 100\n // transpose\n\n float transpose(const in float m) {\n return m;\n }\n\n mat2 transpose2(const in mat2 m) {\n return mat2(\n m[0][0], m[1][0],\n m[0][1], m[1][1]\n );\n }\n\n mat3 transpose3(const in mat3 m) {\n return mat3(\n m[0][0], m[1][0], m[2][0],\n m[0][1], m[1][1], m[2][1],\n m[0][2], m[1][2], m[2][2]\n );\n }\n\n mat4 transpose4(const in mat4 m) {\n return mat4(\n m[0][0], m[1][0], m[2][0], m[3][0],\n m[0][1], m[1][1], m[2][1], m[3][1],\n m[0][2], m[1][2], m[2][2], m[3][2],\n m[0][3], m[1][3], m[2][3], m[3][3]\n );\n }\n\n // inverse\n\n float inverse(const in float m) {\n return 1.0 / m;\n }\n\n mat2 inverse2(const in mat2 m) {\n return mat2(m[1][1],-m[0][1],\n -m[1][0], m[0][0]) / (m[0][0]*m[1][1] - m[0][1]*m[1][0]);\n }\n\n mat3 inverse3(const in mat3 m) {\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2];\n float a10 = m[1][0], a11 = m[1][1], a12 = m[1][2];\n float a20 = m[2][0], a21 = m[2][1], a22 = m[2][2];\n\n float b01 = a22 * a11 - a12 * a21;\n float b11 = -a22 * a10 + a12 * a20;\n float b21 = a21 * a10 - a11 * a20;\n\n float det = a00 * b01 + a01 * b11 + a02 * b21;\n\n return mat3(b01, (-a22 * a01 + a02 * a21), (a12 * a01 - a02 * a11),\n b11, (a22 * a00 - a02 * a20), (-a12 * a00 + a02 * a10),\n b21, (-a21 * a00 + a01 * a20), (a11 * a00 - a01 * a10)) / det;\n }\n\n mat4 inverse4(const in mat4 m) {\n float\n a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3],\n\n b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32,\n\n det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat4(\n a11 * b11 - a12 * b10 + a13 * b09,\n a02 * b10 - a01 * b11 - a03 * b09,\n a31 * b05 - a32 * b04 + a33 * b03,\n a22 * b04 - a21 * b05 - a23 * b03,\n a12 * b08 - a10 * b11 - a13 * b07,\n a00 * b11 - a02 * b08 + a03 * b07,\n a32 * b02 - a30 * b05 - a33 * b01,\n a20 * b05 - a22 * b02 + a23 * b01,\n a10 * b10 - a11 * b08 + a13 * b06,\n a01 * b08 - a00 * b10 - a03 * b06,\n a30 * b04 - a31 * b02 + a33 * b00,\n a21 * b02 - a20 * b04 - a23 * b00,\n a11 * b07 - a10 * b09 - a12 * b06,\n a00 * b09 - a01 * b07 + a02 * b06,\n a31 * b01 - a30 * b03 - a32 * b00,\n a20 * b03 - a21 * b01 + a22 * b00) / det;\n }\n\n #define isNaN(x) ((x) != (x))\n #define isInf(x) ((x) == (x) + 1.0)\n#else\n #define transpose2(m) transpose(m)\n #define transpose3(m) transpose(m)\n #define transpose4(m) transpose(m)\n\n #define inverse2(m) inverse(m)\n #define inverse3(m) inverse(m)\n #define inverse4(m) inverse(m)\n\n #define isNaN isnan\n #define isInf isinf\n#endif\n",float_to_rgba:"\n // floatToRgba adapted from https://github.com/equinor/glsl-float-to-rgba\n // MIT License, Copyright (c) 2020 Equinor\n\n float shiftRight (float v, float amt) {\n v = floor(v) + 0.5;\n return floor(v / exp2(amt));\n }\n float shiftLeft (float v, float amt) {\n return floor(v * exp2(amt) + 0.5);\n }\n float maskLast (float v, float bits) {\n return mod(v, shiftLeft(1.0, bits));\n }\n float extractBits (float num, float from, float to) {\n from = floor(from + 0.5); to = floor(to + 0.5);\n return maskLast(shiftRight(num, from), to - from);\n }\n\n vec4 floatToRgba(float texelFloat, bool littleEndian) {\n if (texelFloat == 0.0) return vec4(0.0, 0.0, 0.0, 0.0);\n float sign = texelFloat > 0.0 ? 0.0 : 1.0;\n texelFloat = abs(texelFloat);\n float exponent = floor(log2(texelFloat));\n float biased_exponent = exponent + 127.0;\n float fraction = ((texelFloat / exp2(exponent)) - 1.0) * 8388608.0;\n float t = biased_exponent / 2.0;\n float last_bit_of_biased_exponent = fract(t) * 2.0;\n float remaining_bits_of_biased_exponent = floor(t);\n float byte4 = extractBits(fraction, 0.0, 8.0) / 255.0;\n float byte3 = extractBits(fraction, 8.0, 16.0) / 255.0;\n float byte2 = (last_bit_of_biased_exponent * 128.0 + extractBits(fraction, 16.0, 23.0)) / 255.0;\n float byte1 = (sign * 128.0 + remaining_bits_of_biased_exponent) / 255.0;\n return (\n littleEndian\n ? vec4(byte4, byte3, byte2, byte1)\n : vec4(byte1, byte2, byte3, byte4)\n );\n }\n",light_frag_params:"\n#if dLightCount != 0\n uniform vec3 uLightDirection[dLightCount];\n uniform vec3 uLightColor[dLightCount];\n#endif\nuniform vec3 uAmbientColor;\n\nstruct PhysicalMaterial {\n vec3 diffuseColor;\n float roughness;\n vec3 specularColor;\n float specularF90;\n};\n\nstruct IncidentLight {\n vec3 color;\n vec3 direction;\n};\n\nstruct ReflectedLight {\n vec3 directDiffuse;\n vec3 directSpecular;\n vec3 indirectDiffuse;\n vec3 indirectSpecular;\n};\n\nstruct GeometricContext {\n vec3 position;\n vec3 normal;\n vec3 viewDir;\n};\n\nvec3 BRDF_Lambert(const in vec3 diffuseColor) {\n return RECIPROCAL_PI * diffuseColor;\n}\n\nvec3 F_Schlick(const in vec3 f0, const in float f90, const in float dotVH) {\n // Original approximation by Christophe Schlick '94\n // float fresnel = pow( 1.0 - dotVH, 5.0 );\n // Optimized variant (presented by Epic at SIGGRAPH '13)\n // https://cdn2.unrealengine.com/Resources/files/2013SiggraphPresentationsNotes-26915738.pdf\n float fresnel = exp2((-5.55473 * dotVH - 6.98316) * dotVH);\n return f0 * (1.0 - fresnel) + (f90 * fresnel);\n}\n\n// Moving Frostbite to Physically Based Rendering 3.0 - page 12, listing 2\n// https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf\nfloat V_GGX_SmithCorrelated(const in float alpha, const in float dotNL, const in float dotNV) {\n float a2 = pow2(alpha);\n float gv = dotNL * sqrt(a2 + (1.0 - a2) * pow2(dotNV));\n float gl = dotNV * sqrt(a2 + (1.0 - a2) * pow2(dotNL));\n return 0.5 / max(gv + gl, EPSILON);\n}\n\n// Microfacet Models for Refraction through Rough Surfaces - equation (33)\n// http://graphicrants.blogspot.com/2013/08/specular-brdf-reference.html\n// alpha is \"roughness squared\" in Disney\u2019s reparameterization\nfloat D_GGX(const in float alpha, const in float dotNH) {\n float a2 = pow2(alpha);\n float denom = pow2(dotNH) * (a2 - 1.0) + 1.0; // avoid alpha = 0 with dotNH = 1\n return RECIPROCAL_PI * a2 / pow2(denom);\n}\n\n// GGX Distribution, Schlick Fresnel, GGX_SmithCorrelated Visibility\nvec3 BRDF_GGX(const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float roughness) {\n float alpha = pow2(roughness); // UE4's roughness\n vec3 halfDir = normalize( lightDir + viewDir);\n float dotNL = saturate(dot(normal, lightDir));\n float dotNV = saturate(dot(normal, viewDir));\n float dotNH = saturate(dot(normal, halfDir));\n float dotVH = saturate(dot(viewDir, halfDir));\n vec3 F = F_Schlick(f0, f90, dotVH);\n float V = V_GGX_SmithCorrelated(alpha, dotNL, dotNV);\n float D = D_GGX(alpha, dotNH);\n return F * (V * D);\n}\n\n// Analytical approximation of the DFG LUT, one half of the\n// split-sum approximation used in indirect specular lighting.\n// via 'environmentBRDF' from \"Physically Based Shading on Mobile\"\n// https://www.unrealengine.com/blog/physically-based-shading-on-mobile\nvec2 DFGApprox(const in vec3 normal, const in vec3 viewDir, const in float roughness) {\n float dotNV = saturate(dot(normal, viewDir));\n const vec4 c0 = vec4(-1, -0.0275, -0.572, 0.022);\n const vec4 c1 = vec4(1, 0.0425, 1.04, -0.04);\n vec4 r = roughness * c0 + c1;\n float a004 = min(r.x * r.x, exp2(-9.28 * dotNV)) * r.x + r.y;\n vec2 fab = vec2(-1.04, 1.04) * a004 + r.zw;\n return fab;\n}\n\n// Fdez-Ag\xfcera's \"Multiple-Scattering Microfacet Model for Real-Time Image Based Lighting\"\n// Approximates multiscattering in order to preserve energy.\n// http://www.jcgt.org/published/0008/01/03/\nvoid computeMultiscattering(const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter) {\n vec2 fab = DFGApprox(normal, viewDir, roughness);\n vec3 FssEss = specularColor * fab.x + specularF90 * fab.y;\n float Ess = fab.x + fab.y;\n float Ems = 1.0 - Ess;\n vec3 Favg = specularColor + (1.0 - specularColor) * 0.047619; // 1/21\n vec3 Fms = FssEss * Favg / (1.0 - Ems * Favg);\n singleScatter += FssEss;\n multiScatter += Fms * Ems;\n}\n\nvoid RE_Direct_Physical(const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n float dotNL = saturate(dot(geometry.normal, directLight.direction));\n vec3 irradiance = dotNL * directLight.color;\n reflectedLight.directSpecular += irradiance * BRDF_GGX(directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.roughness);\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert(material.diffuseColor);\n}\n\nvoid RE_IndirectDiffuse_Physical(const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert(material.diffuseColor);\n}\n\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n // Both indirect specular and indirect diffuse light accumulate here\n vec3 singleScattering = vec3(0.0);\n vec3 multiScattering = vec3(0.0);\n vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n computeMultiscattering(geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering);\n vec3 diffuse = material.diffuseColor * (1.0 - ( singleScattering + multiScattering));\n reflectedLight.indirectSpecular += radiance * singleScattering;\n reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n",matrix_scale:"\nfloat matrixScale(in mat4 m){\n vec4 r = m[0];\n return sqrt(r[0] * r[0] + r[1] * r[1] + r[2] * r[2]);\n}\n",normal_frag_params:"\nvarying vec3 vNormal;\n",read_from_texture:"\nvec4 readFromTexture(const in sampler2D tex, const in float i, const in vec2 dim) {\n float x = intMod(i, dim.x);\n float y = floor(intDiv(i, dim.x));\n vec2 uv = (vec2(x, y) + 0.5) / dim;\n return texture2D(tex, uv);\n}\n\nvec4 readFromTexture(const in sampler2D tex, const in int i, const in vec2 dim) {\n int x = imod(i, int(dim.x));\n int y = i / int(dim.x);\n vec2 uv = (vec2(x, y) + 0.5) / dim;\n return texture2D(tex, uv);\n}\n",rgba_to_float:'\n // rgbaToFloat adapted from https://github.com/ihmeuw/glsl-rgba-to-float\n // BSD 3-Clause License\n //\n // Copyright (c) 2019, Institute for Health Metrics and Evaluation All rights reserved.\n // Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n // - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n // - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n // - Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\n //\n // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n // INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,\n // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n // OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n // OF THE POSSIBILITY OF SUCH DAMAGE.\n\n ivec4 floatsToBytes(vec4 inputFloats, bool littleEndian) {\n ivec4 bytes = ivec4(inputFloats * 255.0);\n return (\n littleEndian\n ? bytes.abgr\n : bytes\n );\n }\n\n // Break the four bytes down into an array of 32 bits.\n void bytesToBits(const in ivec4 bytes, out bool bits[32]) {\n for (int channelIndex = 0; channelIndex < 4; ++channelIndex) {\n float acc = float(bytes[channelIndex]);\n for (int indexInByte = 7; indexInByte >= 0; --indexInByte) {\n float powerOfTwo = exp2(float(indexInByte));\n bool bit = acc >= powerOfTwo;\n bits[channelIndex * 8 + (7 - indexInByte)] = bit;\n acc = mod(acc, powerOfTwo);\n }\n }\n }\n\n // Compute the exponent of the 32-bit float.\n float getExponent(bool bits[32]) {\n const int startIndex = 1;\n const int bitStringLength = 8;\n const int endBeforeIndex = startIndex + bitStringLength;\n float acc = 0.0;\n int pow2 = bitStringLength - 1;\n for (int bitIndex = startIndex; bitIndex < endBeforeIndex; ++bitIndex) {\n acc += float(bits[bitIndex]) * exp2(float(pow2--));\n }\n return acc;\n }\n\n // Compute the mantissa of the 32-bit float.\n float getMantissa(bool bits[32], bool subnormal) {\n const int startIndex = 9;\n const int bitStringLength = 23;\n const int endBeforeIndex = startIndex + bitStringLength;\n // Leading/implicit/hidden bit convention:\n // If the number is not subnormal (with exponent 0), we add a leading 1 digit.\n float acc = float(!subnormal) * exp2(float(bitStringLength));\n int pow2 = bitStringLength - 1;\n for (int bitIndex = startIndex; bitIndex < endBeforeIndex; ++bitIndex) {\n acc += float(bits[bitIndex]) * exp2(float(pow2--));\n }\n return acc;\n }\n\n // Parse the float from its 32 bits.\n float bitsToFloat(bool bits[32]) {\n float signBit = float(bits[0]) * -2.0 + 1.0;\n float exponent = getExponent(bits);\n bool subnormal = abs(exponent - 0.0) < 0.01;\n float mantissa = getMantissa(bits, subnormal);\n float exponentBias = 127.0;\n return signBit * mantissa * exp2(exponent - exponentBias - 23.0);\n }\n\n float rgbaToFloat(vec4 texelRGBA, bool littleEndian) {\n ivec4 rgbaBytes = floatsToBytes(texelRGBA, littleEndian);\n bool bits[32];\n bytesToBits(rgbaBytes, bits);\n return bitsToFloat(bits);\n }\n',size_vert_params:"\n#if defined(dSizeType_uniform)\n uniform float uSize;\n#elif defined(dSizeType_attribute)\n attribute float aSize;\n#elif defined(dSizeType_instance) || defined(dSizeType_group) || defined(dSizeType_groupInstance)\n uniform vec2 uSizeTexDim;\n uniform sampler2D tSize;\n#endif\n\nuniform float uSizeFactor;\n",texture3d_from_1d_trilinear:"\nvec4 texture3dFrom1dTrilinear(const in sampler2D tex, const in vec3 pos, const in vec3 gridDim, const in vec2 texDim, const in float offset) {\n float gdYZ = gridDim.z * gridDim.y;\n float gdZ = gridDim.z;\n vec3 p0 = floor(pos * gridDim);\n vec3 p1 = ceil(pos * gridDim);\n vec3 pd = (pos * gridDim - p0) / (p1 - p0);\n vec4 s000 = readFromTexture(tex, offset + p0.z + p0.y * gdZ + p0.x * gdYZ, texDim);\n vec4 s100 = readFromTexture(tex, offset + p0.z + p0.y * gdZ + p1.x * gdYZ, texDim);\n vec4 s001 = readFromTexture(tex, offset + p1.z + p0.y * gdZ + p0.x * gdYZ, texDim);\n vec4 s101 = readFromTexture(tex, offset + p1.z + p0.y * gdZ + p1.x * gdYZ, texDim);\n vec4 s010 = readFromTexture(tex, offset + p0.z + p1.y * gdZ + p0.x * gdYZ, texDim);\n vec4 s110 = readFromTexture(tex, offset + p0.z + p1.y * gdZ + p1.x * gdYZ, texDim);\n vec4 s011 = readFromTexture(tex, offset + p1.z + p1.y * gdZ + p0.x * gdYZ, texDim);\n vec4 s111 = readFromTexture(tex, offset + p1.z + p1.y * gdZ + p1.x * gdYZ, texDim);\n vec4 s00 = mix(s000, s100, pd.x);\n vec4 s01 = mix(s001, s101, pd.x);\n vec4 s10 = mix(s010, s110, pd.x);\n vec4 s11 = mix(s011, s111, pd.x);\n vec4 s0 = mix(s00, s10, pd.y);\n vec4 s1 = mix(s01, s11, pd.y);\n return mix(s0, s1, pd.z);\n}\n",texture3d_from_2d_linear:"\nvec4 texture3dFrom2dLinear(sampler2D tex, vec3 pos, vec3 gridDim, vec2 texDim) {\n float zSlice0 = floor(pos.z * gridDim.z);\n float column0 = intMod(zSlice0 * gridDim.x, texDim.x) / gridDim.x;\n float row0 = floor(intDiv(zSlice0 * gridDim.x, texDim.x));\n vec2 coord0 = (vec2(column0 * gridDim.x, row0 * gridDim.y) + (pos.xy * gridDim.xy)) / texDim;\n vec4 color0 = texture2D(tex, coord0);\n\n float zSlice1 = zSlice0 + 1.0;\n float column1 = intMod(zSlice1 * gridDim.x, texDim.x) / gridDim.x;\n float row1 = floor(intDiv(zSlice1 * gridDim.x, texDim.x));\n vec2 coord1 = (vec2(column1 * gridDim.x, row1 * gridDim.y) + (pos.xy * gridDim.xy)) / texDim;\n vec4 color1 = texture2D(tex, coord1);\n\n float delta0 = abs((pos.z * gridDim.z) - zSlice0);\n return mix(color0, color1, delta0);\n}\n",texture3d_from_2d_nearest:"\nvec4 texture3dFrom2dNearest(sampler2D tex, vec3 pos, vec3 gridDim, vec2 texDim) {\n float zSlice = floor(pos.z * gridDim.z + 0.5); // round to nearest z-slice\n float column = intMod(zSlice * gridDim.x, texDim.x) / gridDim.x;\n float row = floor(intDiv(zSlice * gridDim.x, texDim.x));\n vec2 coord = (vec2(column * gridDim.x, row * gridDim.y) + (pos.xy * gridDim.xy)) / texDim;\n return texture2D(tex, coord);\n}\n",wboit_write:"\n#if defined(dRenderVariant_colorWboit)\n if (uRenderMask == MaskOpaque) {\n if (preFogAlpha < 1.0) {\n discard;\n }\n } else if (uRenderMask == MaskTransparent) {\n if (preFogAlpha != 1.0 && fragmentDepth < getDepth(gl_FragCoord.xy / uDrawingBufferSize)) {\n #ifdef dTransparentBackfaces_off\n if (interior) discard;\n #endif\n float alpha = gl_FragColor.a;\n float wboitWeight = alpha * clamp(pow(1.0 - fragmentDepth, 2.0), 0.01, 1.0);\n gl_FragColor = vec4(gl_FragColor.rgb * alpha * wboitWeight, alpha);\n // extra alpha is to handle pre-multiplied alpha\n #ifndef dGeometryType_directVolume\n gl_FragData[1] = vec4((uTransparentBackground ? alpha : 1.0) * alpha * wboitWeight);\n #else\n gl_FragData[1] = vec4(alpha * alpha * wboitWeight);\n #endif\n } else {\n discard;\n }\n }\n#endif\n",dpoit_write:"\n#if defined(dRenderVariant_colorDpoit)\n if (uRenderMask == MaskOpaque) {\n if (preFogAlpha < 1.0) {\n discard;\n }\n } else if (uRenderMask == MaskTransparent) {\n vec2 coords = gl_FragCoord.xy / uDrawingBufferSize;\n if (preFogAlpha != 1.0 && fragmentDepth < getDepth(coords)) {\n #ifdef dTransparentBackfaces_off\n if (interior) discard;\n #endif\n\n // adapted from https://github.com/tsherif/webgl2examples\n // The MIT License, Copyright 2017 Tarek Sherif, Shuai Shao\n\n vec2 lastDepth = texture2D(tDpoitDepth, coords).rg;\n vec4 lastFrontColor = texture2D(tDpoitFrontColor, coords);\n\n vec4 fragColor = gl_FragColor;\n\n // depth value always increases\n // so we can use MAX blend equation\n gl_FragData[2].rg = vec2(-MAX_DPOIT_DEPTH);\n\n // front color always increases\n // so we can use MAX blend equation\n gl_FragColor = lastFrontColor;\n\n // back color is separately blend afterwards each pass\n gl_FragData[1] = vec4(0.0);\n\n float nearestDepth = -lastDepth.x;\n float furthestDepth = lastDepth.y;\n float alphaMultiplier = 1.0 - lastFrontColor.a;\n\n if (fragmentDepth < nearestDepth || fragmentDepth > furthestDepth) {\n // Skip this depth since it's been peeled.\n return;\n }\n\n if (fragmentDepth > nearestDepth && fragmentDepth < furthestDepth) {\n // This needs to be peeled.\n // The ones remaining after MAX blended for\n // all need-to-peel will be peeled next pass.\n gl_FragData[2].rg = vec2(-fragmentDepth, fragmentDepth);\n return;\n }\n\n // write to back and front color buffer\n if (fragmentDepth == nearestDepth) {\n gl_FragColor.rgb += fragColor.rgb * fragColor.a * alphaMultiplier;\n gl_FragColor.a = 1.0 - alphaMultiplier * (1.0 - fragColor.a);\n } else {\n gl_FragData[1] += fragColor;\n }\n\n } else {\n discard;\n }\n }\n#endif\n"},UUe=/^(?!\/\/)\s*#include\s+(\S+)/gm,VUe=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*\+\+i\s*\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g,zUe=/[ \t]*\/\/.*\n/g,GUe=/[ \t]*\/\*[\s\S]*?\*\//g,HUe=/\n{2,}/g;function dee(e){return e.replace(UUe,function(t,r){var n=LUe[r];if(!n)throw new Error("empty chunk, '".concat(r,"'"));return n}).trim().replace(zUe,"\n").replace(GUe,"\n").replace(HUe,"\n")}function qUe(e,t,r,n){for(var a="",i=parseInt(t);i radius) discard;\n #elif defined(dPointStyle_fuzzy)\n float dist = distance(gl_PointCoord, center);\n float fuzzyAlpha = 1.0 - smoothstep(0.0, radius, dist);\n if (fuzzyAlpha < 0.0001) discard;\n #endif\n\n #if defined(dRenderVariant_pick)\n #include check_picking_alpha\n #ifdef requiredDrawBuffers\n gl_FragColor = vObject;\n gl_FragData[1] = vInstance;\n gl_FragData[2] = vGroup;\n gl_FragData[3] = packDepthToRGBA(fragmentDepth);\n #else\n gl_FragColor = vColor;\n #endif\n #elif defined(dRenderVariant_depth)\n gl_FragColor = material;\n #elif defined(dRenderVariant_marking)\n gl_FragColor = material;\n #elif defined(dRenderVariant_color)\n gl_FragColor = material;\n\n #if defined(dPointStyle_fuzzy)\n gl_FragColor.a *= fuzzyAlpha;\n #endif\n\n #include apply_marker_color\n #include apply_fog\n #include wboit_write\n #include dpoit_write\n #endif\n}\n",{drawBuffers:"optional"},{},GD),XUe=Un("spheres","\nprecision highp float;\nprecision highp int;\n\n#include common\n#include read_from_texture\n#include common_vert_params\n#include color_vert_params\n#include size_vert_params\n#include common_clip\n\nuniform mat4 uModelView;\nuniform mat4 uInvProjection;\nuniform float uIsOrtho;\n\nuniform vec2 uTexDim;\nuniform sampler2D tPositionGroup;\n\nattribute mat4 aTransform;\nattribute float aInstance;\n\nvarying float vRadius;\nvarying vec3 vPoint;\nvarying vec3 vPointViewPosition;\n\n#include matrix_scale\n\n/**\n * Bounding rectangle of a clipped, perspective-projected 3D Sphere.\n * Michael Mara, Morgan McGuire. 2013\n *\n * Specialization by Arseny Kapoulkine, MIT License Copyright (c) 2018\n * https://github.com/zeux/niagara\n */\nvoid sphereProjection(const in vec3 p, const in float r, const in vec2 mapping) {\n vec3 pr = p * r;\n float pzr2 = p.z * p.z - r * r;\n\n float vx = sqrt(p.x * p.x + pzr2);\n float minx = ((vx * p.x - pr.z) / (vx * p.z + pr.x)) * uProjection[0][0];\n float maxx = ((vx * p.x + pr.z) / (vx * p.z - pr.x)) * uProjection[0][0];\n\n float vy = sqrt(p.y * p.y + pzr2);\n float miny = ((vy * p.y - pr.z) / (vy * p.z + pr.y)) * uProjection[1][1];\n float maxy = ((vy * p.y + pr.z) / (vy * p.z - pr.y)) * uProjection[1][1];\n\n gl_Position.xy = vec2(maxx + minx, maxy + miny) * -0.5;\n gl_Position.xy -= mapping * vec2(maxx - minx, maxy - miny) * 0.5;\n gl_Position.xy *= gl_Position.w;\n}\n\nvoid main(void){\n vec2 mapping = vec2(1.0, 1.0); // vertices 2 and 5\n #if __VERSION__ == 100\n int m = imod(VertexID, 6);\n #else\n int m = VertexID % 6;\n #endif\n if (m == 0) {\n mapping = vec2(-1.0, 1.0);\n } else if (m == 1 || m == 3) {\n mapping = vec2(-1.0, -1.0);\n } else if (m == 4) {\n mapping = vec2(1.0, -1.0);\n }\n\n vec4 positionGroup = readFromTexture(tPositionGroup, VertexID / 6, uTexDim);\n vec3 position = positionGroup.rgb;\n float group = positionGroup.a;\n\n #include assign_color_varying\n #include assign_marker_varying\n #include assign_clipping_varying\n #include assign_size\n\n vRadius = size * matrixScale(uModelView);\n\n vec4 position4 = vec4(position, 1.0);\n vec4 mvPosition = uModelView * aTransform * position4;\n\n #ifdef dApproximate\n vec4 mvCorner = vec4(mvPosition.xyz, 1.0);\n mvCorner.xy += mapping * vRadius;\n gl_Position = uProjection * mvCorner;\n #else\n if (uIsOrtho == 1.0) {\n vec4 mvCorner = vec4(mvPosition.xyz, 1.0);\n mvCorner.xy += mapping * vRadius;\n gl_Position = uProjection * mvCorner;\n } else {\n gl_Position = uProjection * vec4(mvPosition.xyz, 1.0);\n sphereProjection(mvPosition.xyz, vRadius, mapping);\n }\n #endif\n\n vec4 vPoint4 = uInvProjection * gl_Position;\n vPoint = vPoint4.xyz / vPoint4.w;\n vPointViewPosition = -mvPosition.xyz / mvPosition.w;\n\n vModelPosition = (uModel * aTransform * position4).xyz; // for clipping in frag shader\n\n if (gl_Position.z < -gl_Position.w) {\n mvPosition.z -= 2.0 * vRadius; // avoid clipping\n gl_Position.z = (uProjection * vec4(mvPosition.xyz, 1.0)).z;\n }\n\n #if defined(dClipPrimitive) && !defined(dClipVariant_instance) && dClipObjectCount != 0\n if (clipTest(vec4(vModelPosition.xyz, 0.0))) {\n // move out of [ -w, +w ] to 'discard' in vert shader\n gl_Position.z = 2.0 * gl_Position.w;\n }\n #else\n #include clip_instance\n #endif\n}\n","\nprecision highp float;\nprecision highp int;\n\n#define bumpEnabled\n\n#include common\n#include common_frag_params\n#include color_frag_params\n#include light_frag_params\n#include common_clip\n\nuniform mat4 uInvView;\nuniform float uAlphaThickness;\n\nvarying float vRadius;\nvarying vec3 vPoint;\nvarying vec3 vPointViewPosition;\n\n#ifdef dSolidInterior\n const bool solidInterior = true;\n#else\n const bool solidInterior = false;\n#endif\n\nbool SphereImpostor(out vec3 modelPos, out vec3 cameraPos, out vec3 cameraNormal, out bool interior, out float fragmentDepth){\n vec3 cameraSpherePos = -vPointViewPosition;\n\n vec3 rayOrigin = mix(vec3(0.0, 0.0, 0.0), vPoint, uIsOrtho);\n vec3 rayDirection = mix(normalize(vPoint), vec3(0.0, 0.0, 1.0), uIsOrtho);\n vec3 cameraSphereDir = mix(cameraSpherePos, rayOrigin - cameraSpherePos, uIsOrtho);\n\n float B = dot(rayDirection, cameraSphereDir);\n float det = B * B + vRadius * vRadius - dot(cameraSphereDir, cameraSphereDir);\n\n if (det < 0.0) return false;\n\n float sqrtDet = sqrt(det);\n float posT = mix(B + sqrtDet, B - sqrtDet, uIsOrtho);\n float negT = mix(B - sqrtDet, B + sqrtDet, uIsOrtho);\n\n cameraPos = rayDirection * negT + rayOrigin;\n modelPos = (uInvView * vec4(cameraPos, 1.0)).xyz;\n fragmentDepth = calcDepth(cameraPos);\n\n bool objectClipped = false;\n\n #if !defined(dClipPrimitive) && defined(dClipVariant_pixel) && dClipObjectCount != 0\n if (clipTest(vec4(modelPos, 0.0))) {\n objectClipped = true;\n fragmentDepth = -1.0;\n }\n #endif\n\n if (fragmentDepth > 0.0) {\n cameraNormal = normalize(cameraPos - cameraSpherePos);\n interior = false;\n return true;\n } else if (uDoubleSided || solidInterior) {\n cameraPos = rayDirection * posT + rayOrigin;\n modelPos = (uInvView * vec4(cameraPos, 1.0)).xyz;\n fragmentDepth = calcDepth(cameraPos);\n cameraNormal = -normalize(cameraPos - cameraSpherePos);\n interior = true;\n if (fragmentDepth > 0.0) {\n #ifdef dSolidInterior\n if (!objectClipped) {\n fragmentDepth = 0.0 + (0.0000001 / vRadius);\n cameraNormal = -mix(normalize(vPoint), vec3(0.0, 0.0, 1.0), uIsOrtho);\n }\n #endif\n return true;\n }\n }\n\n return false;\n}\n\nvoid main(void){\n vec3 cameraNormal;\n float fragmentDepth;\n\n #ifdef dApproximate\n vec3 pointDir = -vPointViewPosition - vPoint;\n if (dot(pointDir, pointDir) > vRadius * vRadius) discard;\n vec3 vViewPosition = -vPointViewPosition;\n fragmentDepth = gl_FragCoord.z;\n #if !defined(dIgnoreLight) || defined(dXrayShaded)\n pointDir.z -= cos(length(pointDir) / vRadius);\n cameraNormal = -normalize(pointDir / vRadius);\n #endif\n interior = false;\n #else\n vec3 modelPos;\n vec3 cameraPos;\n bool hit = SphereImpostor(modelPos, cameraPos, cameraNormal, interior, fragmentDepth);\n if (!hit) discard;\n\n if (fragmentDepth < 0.0) discard;\n if (fragmentDepth > 1.0) discard;\n\n gl_FragDepthEXT = fragmentDepth;\n\n vec3 vModelPosition = modelPos;\n vec3 vViewPosition = cameraPos;\n #endif\n\n #if !defined(dClipPrimitive) && defined(dClipVariant_pixel) && dClipObjectCount != 0\n #include clip_pixel\n #endif\n #include assign_material_color\n\n #if defined(dRenderVariant_pick)\n #include check_picking_alpha\n #ifdef requiredDrawBuffers\n gl_FragColor = vObject;\n gl_FragData[1] = vInstance;\n gl_FragData[2] = vGroup;\n gl_FragData[3] = packDepthToRGBA(fragmentDepth);\n #else\n gl_FragColor = vColor;\n #endif\n #elif defined(dRenderVariant_depth)\n gl_FragColor = material;\n #elif defined(dRenderVariant_marking)\n gl_FragColor = material;\n #elif defined(dRenderVariant_color)\n vec3 normal = -cameraNormal;\n #include apply_light_color\n\n if (uRenderMask == MaskTransparent && uAlphaThickness > 0.0) {\n gl_FragColor.a *= min(1.0, vRadius / uAlphaThickness);\n }\n\n #include apply_interior_color\n #include apply_marker_color\n #include apply_fog\n #include wboit_write\n #include dpoit_write\n #endif\n}\n",{fragDepth:"required",drawBuffers:"optional"},{},jS),KUe=Un("cylinders","\nprecision highp float;\nprecision highp int;\n\n#include common\n#include read_from_texture\n#include common_vert_params\n#include color_vert_params\n#include size_vert_params\n#include common_clip\n\nuniform mat4 uModelView;\n\nattribute mat4 aTransform;\nattribute float aInstance;\nattribute float aGroup;\n\nattribute vec3 aMapping;\nattribute vec3 aStart;\nattribute vec3 aEnd;\nattribute float aScale;\nattribute float aCap;\n\nvarying mat4 vTransform;\nvarying vec3 vStart;\nvarying vec3 vEnd;\nvarying float vSize;\nvarying float vCap;\n\nuniform float uIsOrtho;\nuniform vec3 uCameraDir;\n\nvoid main() {\n #include assign_group\n #include assign_color_varying\n #include assign_marker_varying\n #include assign_clipping_varying\n #include assign_size\n\n mat4 modelTransform = uModel * aTransform;\n\n vTransform = aTransform;\n vStart = (modelTransform * vec4(aStart, 1.0)).xyz;\n vEnd = (modelTransform * vec4(aEnd, 1.0)).xyz;\n vSize = size * aScale;\n vCap = aCap;\n\n vModelPosition = (vStart + vEnd) * 0.5;\n vec3 camDir = -mix(normalize(vModelPosition - uCameraPosition), uCameraDir, uIsOrtho);\n vec3 dir = vEnd - vStart;\n // ensure cylinder 'dir' is pointing towards the camera\n if(dot(camDir, dir) < 0.0) {\n dir = -dir;\n }\n\n vec3 left = cross(camDir, dir);\n vec3 up = cross(left, dir);\n left = vSize * normalize(left);\n up = vSize * normalize(up);\n\n // move vertex in object-space from center to corner\n vModelPosition += aMapping.x * dir + aMapping.y * left + aMapping.z * up;\n\n vec4 mvPosition = uView * vec4(vModelPosition, 1.0);\n vViewPosition = mvPosition.xyz;\n gl_Position = uProjection * mvPosition;\n\n if (gl_Position.z < -gl_Position.w) {\n mvPosition.z -= 2.0 * (length(vEnd - vStart) + vSize); // avoid clipping\n gl_Position.z = (uProjection * mvPosition).z;\n }\n\n #include clip_instance\n}\n","\nprecision highp float;\nprecision highp int;\n\n#define bumpEnabled\n\nuniform mat4 uView;\n\nvarying mat4 vTransform;\nvarying vec3 vStart;\nvarying vec3 vEnd;\nvarying float vSize;\nvarying float vCap;\n\nuniform vec3 uCameraDir;\nuniform vec3 uCameraPosition;\nuniform mat4 uInvView;\n\n#include common\n#include common_frag_params\n#include color_frag_params\n#include light_frag_params\n#include common_clip\n\n#ifdef dSolidInterior\n const bool solidInterior = true;\n#else\n const bool solidInterior = false;\n#endif\n\n// adapted from https://www.shadertoy.com/view/4lcSRn\n// The MIT License, Copyright 2016 Inigo Quilez\nbool CylinderImpostor(\n in vec3 rayOrigin, in vec3 rayDir,\n in vec3 start, in vec3 end, in float radius,\n out vec3 cameraNormal, out bool interior,\n out vec3 modelPosition, out vec3 viewPosition, out float fragmentDepth\n){\n vec3 ba = end - start;\n vec3 oc = rayOrigin - start;\n\n float baba = dot(ba, ba);\n float bard = dot(ba, rayDir);\n float baoc = dot(ba, oc);\n\n float k2 = baba - bard * bard;\n float k1 = baba * dot(oc, rayDir) - baoc * bard;\n float k0 = baba * dot(oc, oc) - baoc * baoc - radius * radius * baba;\n\n float h = k1 * k1 - k2 * k0;\n if (h < 0.0) return false;\n\n bool topCap = (vCap > 0.9 && vCap < 1.1) || vCap >= 2.9;\n bool bottomCap = (vCap > 1.9 && vCap < 2.1) || vCap >= 2.9;\n\n #ifdef dSolidInterior\n bool topInterior = !topCap;\n bool bottomInterior = !bottomCap;\n topCap = true;\n bottomCap = true;\n #else\n bool topInterior = false;\n bool bottomInterior = false;\n #endif\n\n bool clipped = false;\n bool objectClipped = false;\n\n // body outside\n h = sqrt(h);\n float t = (-k1 - h) / k2;\n float y = baoc + t * bard;\n if (y > 0.0 && y < baba) {\n interior = false;\n cameraNormal = (oc + t * rayDir - ba * y / baba) / radius;\n modelPosition = rayOrigin + t * rayDir;\n viewPosition = (uView * vec4(modelPosition, 1.0)).xyz;\n fragmentDepth = calcDepth(viewPosition);\n #if defined(dClipVariant_pixel) && dClipObjectCount != 0\n if (clipTest(vec4(modelPosition, 0.0))) {\n objectClipped = true;\n fragmentDepth = -1.0;\n #ifdef dSolidInterior\n topCap = !topInterior;\n bottomCap = !bottomInterior;\n #endif\n }\n #endif\n if (fragmentDepth > 0.0) return true;\n clipped = true;\n }\n\n if (!clipped) {\n if (topCap && y < 0.0) {\n // top cap\n t = -baoc / bard;\n if (abs(k1 + k2 * t) < h) {\n interior = topInterior;\n cameraNormal = -ba / baba;\n modelPosition = rayOrigin + t * rayDir;\n viewPosition = (uView * vec4(modelPosition, 1.0)).xyz;\n fragmentDepth = calcDepth(viewPosition);\n #if defined(dClipVariant_pixel) && dClipObjectCount != 0\n if (clipTest(vec4(modelPosition, 0.0))) {\n objectClipped = true;\n fragmentDepth = -1.0;\n #ifdef dSolidInterior\n topCap = !topInterior;\n bottomCap = !bottomInterior;\n #endif\n }\n #endif\n if (fragmentDepth > 0.0) {\n #ifdef dSolidInterior\n if (interior) cameraNormal = -rayDir;\n #endif\n return true;\n }\n }\n } else if (bottomCap && y >= 0.0) {\n // bottom cap\n t = (baba - baoc) / bard;\n if (abs(k1 + k2 * t) < h) {\n interior = bottomInterior;\n cameraNormal = ba / baba;\n modelPosition = rayOrigin + t * rayDir;\n viewPosition = (uView * vec4(modelPosition, 1.0)).xyz;\n fragmentDepth = calcDepth(viewPosition);\n #if defined(dClipVariant_pixel) && dClipObjectCount != 0\n if (clipTest(vec4(modelPosition, 0.0))) {\n objectClipped = true;\n fragmentDepth = -1.0;\n #ifdef dSolidInterior\n topCap = !topInterior;\n bottomCap = !bottomInterior;\n #endif\n }\n #endif\n if (fragmentDepth > 0.0) {\n #ifdef dSolidInterior\n if (interior) cameraNormal = -rayDir;\n #endif\n return true;\n }\n }\n }\n }\n\n if (uDoubleSided || solidInterior) {\n // body inside\n h = -h;\n t = (-k1 - h) / k2;\n y = baoc + t * bard;\n if (y > 0.0 && y < baba) {\n interior = true;\n cameraNormal = -(oc + t * rayDir - ba * y / baba) / radius;\n modelPosition = rayOrigin + t * rayDir;\n viewPosition = (uView * vec4(modelPosition, 1.0)).xyz;\n fragmentDepth = calcDepth(viewPosition);\n if (fragmentDepth > 0.0) {\n #ifdef dSolidInterior\n if (!objectClipped) {\n fragmentDepth = 0.0 + (0.0000002 / vSize);\n cameraNormal = -rayDir;\n }\n #endif\n return true;\n }\n }\n\n if (topCap && y < 0.0) {\n // top cap\n t = -baoc / bard;\n if (abs(k1 + k2 * t) < -h) {\n interior = true;\n cameraNormal = ba / baba;\n modelPosition = rayOrigin + t * rayDir;\n viewPosition = (uView * vec4(modelPosition, 1.0)).xyz;\n fragmentDepth = calcDepth(viewPosition);\n if (fragmentDepth > 0.0) {\n #ifdef dSolidInterior\n if (!objectClipped) {\n fragmentDepth = 0.0 + (0.0000002 / vSize);\n cameraNormal = -rayDir;\n }\n #endif\n return true;\n }\n }\n } else if (bottomCap && y >= 0.0) {\n // bottom cap\n t = (baba - baoc) / bard;\n if (abs(k1 + k2 * t) < -h) {\n interior = true;\n cameraNormal = -ba / baba;\n modelPosition = rayOrigin + t * rayDir;\n viewPosition = (uView * vec4(modelPosition, 1.0)).xyz;\n fragmentDepth = calcDepth(viewPosition);\n if (fragmentDepth > 0.0) {\n #ifdef dSolidInterior\n if (!objectClipped) {\n fragmentDepth = 0.0 + (0.0000002 / vSize);\n cameraNormal = -rayDir;\n }\n #endif\n return true;\n }\n }\n }\n }\n\n return false;\n}\n\nvoid main() {\n vec3 rayOrigin = vModelPosition;\n vec3 rayDir = mix(normalize(vModelPosition - uCameraPosition), uCameraDir, uIsOrtho);\n\n vec3 cameraNormal;\n vec3 modelPosition;\n vec3 viewPosition;\n float fragmentDepth;\n bool hit = CylinderImpostor(rayOrigin, rayDir, vStart, vEnd, vSize, cameraNormal, interior, modelPosition, viewPosition, fragmentDepth);\n if (!hit) discard;\n\n if (fragmentDepth < 0.0) discard;\n if (fragmentDepth > 1.0) discard;\n\n gl_FragDepthEXT = fragmentDepth;\n\n vec3 vViewPosition = viewPosition;\n vec3 vModelPosition = modelPosition;\n\n #include clip_pixel\n #include assign_material_color\n\n #if defined(dRenderVariant_pick)\n #include check_picking_alpha\n #ifdef requiredDrawBuffers\n gl_FragColor = vObject;\n gl_FragData[1] = vInstance;\n gl_FragData[2] = vGroup;\n gl_FragData[3] = packDepthToRGBA(fragmentDepth);\n #else\n gl_FragColor = vColor;\n #endif\n #elif defined(dRenderVariant_depth)\n gl_FragColor = material;\n #elif defined(dRenderVariant_marking)\n gl_FragColor = material;\n #elif defined(dRenderVariant_color)\n mat3 normalMatrix = transpose3(inverse3(mat3(uView)));\n vec3 normal = normalize(normalMatrix * -normalize(cameraNormal));\n #include apply_light_color\n\n #include apply_interior_color\n #include apply_marker_color\n #include apply_fog\n #include wboit_write\n #include dpoit_write\n #endif\n}\n",{fragDepth:"required",drawBuffers:"optional"},{},jS),ZUe=Un("text","\nprecision highp float;\nprecision highp int;\n\n#include common\n#include read_from_texture\n#include common_vert_params\n#include color_vert_params\n#include size_vert_params\n#include common_clip\n\nuniform mat4 uModelView;\n\nattribute vec3 aPosition;\nattribute vec2 aMapping;\nattribute float aDepth;\nattribute vec2 aTexCoord;\nattribute mat4 aTransform;\nattribute float aInstance;\nattribute float aGroup;\n\nuniform float uOffsetX;\nuniform float uOffsetY;\nuniform float uOffsetZ;\n\nuniform float uIsOrtho;\nuniform float uPixelRatio;\nuniform vec4 uViewport;\n\nvarying vec2 vTexCoord;\n\n#include matrix_scale\n\nvoid main(void){\n #include assign_group\n #include assign_color_varying\n #include assign_marker_varying\n #include assign_clipping_varying\n #include assign_size\n\n vTexCoord = aTexCoord;\n\n float scale = matrixScale(uModelView);\n\n float offsetX = uOffsetX * scale;\n float offsetY = uOffsetY * scale;\n float offsetZ = (uOffsetZ + aDepth * 0.95) * scale;\n\n vec4 position4 = vec4(aPosition, 1.0);\n vec4 mvPosition = uModelView * aTransform * position4;\n\n vModelPosition = (uModel * aTransform * position4).xyz; // for clipping in frag shader\n\n // TODO\n // #ifdef FIXED_SIZE\n // if (ortho) {\n // scale /= pixelRatio * ((uViewport.w / 2.0) / -uCameraPosition.z) * 0.1;\n // } else {\n // scale /= pixelRatio * ((uViewport.w / 2.0) / -mvPosition.z) * 0.1;\n // }\n // #endif\n\n vec4 mvCorner = vec4(mvPosition.xyz, 1.0);\n\n if (vTexCoord.x == 10.0) { // indicates background plane\n // move a bit to the back, taking distance to camera into account to avoid z-fighting\n offsetZ -= 0.001 * distance(uCameraPosition, (uProjection * mvCorner).xyz);\n }\n\n mvCorner.xy += aMapping * size * scale;\n mvCorner.x += offsetX;\n mvCorner.y += offsetY;\n\n if (uIsOrtho == 1.0) {\n mvCorner.z += offsetZ;\n } else {\n mvCorner.xyz += normalize(-mvCorner.xyz) * offsetZ;\n }\n\n gl_Position = uProjection * mvCorner;\n\n vViewPosition = -mvCorner.xyz;\n\n #include clip_instance\n}\n","\nprecision highp float;\nprecision highp int;\n\n#include common\n#include common_frag_params\n#include color_frag_params\n#include common_clip\n\nuniform sampler2D tFont;\n\nuniform vec3 uBorderColor;\nuniform float uBorderWidth;\nuniform vec3 uBackgroundColor;\nuniform float uBackgroundOpacity;\n\nvarying vec2 vTexCoord;\n\nconst float smoothness = 32.0;\nconst float gamma = 2.2;\n\nvoid main2(){\n gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);\n}\n\nvoid main(){\n #include clip_pixel\n\n float fragmentDepth = gl_FragCoord.z;\n #include assign_material_color\n\n if (vTexCoord.x > 1.0) {\n #if defined(dRenderVariant_color)\n material = vec4(uBackgroundColor, uBackgroundOpacity * material.a);\n #endif\n } else {\n // retrieve signed distance\n float sdf = texture2D(tFont, vTexCoord).a + uBorderWidth;\n\n // perform adaptive anti-aliasing of the edges\n float w = clamp(smoothness * (abs(dFdx(vTexCoord.x)) + abs(dFdy(vTexCoord.y))), 0.0, 0.5);\n float a = smoothstep(0.5 - w, 0.5 + w, sdf);\n\n // gamma correction for linear attenuation\n a = pow(a, 1.0 / gamma);\n\n if (a < 0.5) discard;\n\n #if defined(dRenderVariant_color)\n material.a *= a;\n\n // add border\n float t = 0.5 + uBorderWidth;\n if (uBorderWidth > 0.0 && sdf < t) {\n material.xyz = mix(uBorderColor, material.xyz, smoothstep(t - w, t, sdf));\n }\n #endif\n }\n\n #if defined(dRenderVariant_pick)\n #include check_picking_alpha\n #ifdef requiredDrawBuffers\n gl_FragColor = vObject;\n gl_FragData[1] = vInstance;\n gl_FragData[2] = vGroup;\n gl_FragData[3] = packDepthToRGBA(fragmentDepth);\n #else\n gl_FragColor = vColor;\n #endif\n #elif defined(dRenderVariant_depth)\n gl_FragColor = material;\n #elif defined(dRenderVariant_marking)\n gl_FragColor = material;\n #elif defined(dRenderVariant_color)\n gl_FragColor = material;\n\n #include apply_marker_color\n #include apply_fog\n #include wboit_write\n #include dpoit_write\n #endif\n}\n",{drawBuffers:"optional"},{},GD),QUe=Un("lines","\nprecision highp float;\nprecision highp int;\n\n#include common\n#include read_from_texture\n#include common_vert_params\n#include color_vert_params\n#include size_vert_params\n#include common_clip\n\nuniform float uPixelRatio;\nuniform vec4 uViewport;\n\nattribute mat4 aTransform;\nattribute float aInstance;\nattribute float aGroup;\n\nattribute vec2 aMapping;\nattribute vec3 aStart;\nattribute vec3 aEnd;\n\nvoid trimSegment(const in vec4 start, inout vec4 end) {\n // trim end segment so it terminates between the camera plane and the near plane\n // conservative estimate of the near plane\n float a = uProjection[2][2]; // 3rd entry in 3rd column\n float b = uProjection[3][2]; // 3rd entry in 4th column\n float nearEstimate = -0.5 * b / a;\n float alpha = (nearEstimate - start.z) / (end.z - start.z);\n end.xyz = mix(start.xyz, end.xyz, alpha);\n}\n\nvoid main(){\n float aspect = uViewport.z / uViewport.w;\n\n #include assign_group\n #include assign_color_varying\n #include assign_marker_varying\n #include assign_clipping_varying\n #include assign_size\n\n mat4 modelView = uView * uModel * aTransform;\n\n // camera space\n vec4 start = modelView * vec4(aStart, 1.0);\n vec4 end = modelView * vec4(aEnd, 1.0);\n\n // assign position\n vec4 position4 = vec4((aMapping.y < 0.5) ? aStart : aEnd, 1.0);\n vec4 mvPosition = modelView * position4;\n vViewPosition = mvPosition.xyz;\n\n vModelPosition = (uModel * aTransform * position4).xyz; // for clipping in frag shader\n\n // special case for perspective projection, and segments that terminate either in, or behind, the camera plane\n // clearly the gpu firmware has a way of addressing this issue when projecting into ndc space\n // but we need to perform ndc-space calculations in the shader, so we must address this issue directly\n // perhaps there is a more elegant solution -- WestLangley\n bool perspective = (uProjection[2][3] == -1.0); // 4th entry in the 3rd column\n if (perspective) {\n if (start.z < 0.0 && end.z >= 0.0) {\n trimSegment(start, end);\n } else if (end.z < 0.0 && start.z >= 0.0) {\n trimSegment(end, start);\n }\n }\n\n // clip space\n vec4 clipStart = uProjection * start;\n vec4 clipEnd = uProjection * end;\n\n // ndc space\n vec2 ndcStart = clipStart.xy / clipStart.w;\n vec2 ndcEnd = clipEnd.xy / clipEnd.w;\n\n // direction\n vec2 dir = ndcEnd - ndcStart;\n\n // account for clip-space aspect ratio\n dir.x *= aspect;\n dir = normalize(dir);\n\n // perpendicular to dir\n vec2 offset = vec2(dir.y, - dir.x);\n\n // undo aspect ratio adjustment\n dir.x /= aspect;\n offset.x /= aspect;\n\n // sign flip\n if (aMapping.x < 0.0) offset *= -1.0;\n\n // calculate linewidth\n float linewidth;\n #ifdef dLineSizeAttenuation\n linewidth = size * uPixelRatio * ((uViewport.w / 2.0) / -start.z) * 5.0;\n #else\n linewidth = size * uPixelRatio;\n #endif\n linewidth = max(1.0, linewidth);\n\n // adjust for linewidth\n offset *= linewidth;\n\n // adjust for clip-space to screen-space conversion\n offset /= uViewport.w;\n\n // select end\n vec4 clip = (aMapping.y < 0.5) ? clipStart : clipEnd;\n\n // back to clip space\n offset *= clip.w;\n clip.xy += offset;\n gl_Position = clip;\n\n #include clip_instance\n}\n","\nprecision highp float;\nprecision highp int;\n\n#include common\n#include common_frag_params\n#include color_frag_params\n#include common_clip\n\nvoid main(){\n #include clip_pixel\n\n float fragmentDepth = gl_FragCoord.z;\n #include assign_material_color\n\n #if defined(dRenderVariant_pick)\n #include check_picking_alpha\n #ifdef requiredDrawBuffers\n gl_FragColor = vObject;\n gl_FragData[1] = vInstance;\n gl_FragData[2] = vGroup;\n gl_FragData[3] = packDepthToRGBA(fragmentDepth);\n #else\n gl_FragColor = vColor;\n #endif\n #elif defined(dRenderVariant_depth)\n gl_FragColor = material;\n #elif defined(dRenderVariant_marking)\n gl_FragColor = material;\n #elif defined(dRenderVariant_color)\n gl_FragColor = material;\n\n #include apply_marker_color\n #include apply_fog\n #include wboit_write\n #include dpoit_write\n #endif\n}\n",{drawBuffers:"optional"},{},GD),hee=Un("mesh","\nprecision highp float;\nprecision highp int;\nprecision highp sampler2D;\n\n#include common\n#include read_from_texture\n#include common_vert_params\n#include color_vert_params\n#include common_clip\n#include texture3d_from_2d_linear\n\n#ifdef dGeometryType_textureMesh\n uniform vec2 uGeoTexDim;\n uniform sampler2D tPosition;\n uniform sampler2D tGroup;\n uniform sampler2D tNormal;\n#else\n attribute vec3 aPosition;\n attribute float aGroup;\n attribute vec3 aNormal;\n#endif\nattribute mat4 aTransform;\nattribute float aInstance;\n\nvarying vec3 vNormal;\n\nvoid main(){\n #include assign_group\n #include assign_marker_varying\n #include assign_clipping_varying\n #include assign_position\n #include assign_color_varying\n #include clip_instance\n\n #ifdef dGeometryType_textureMesh\n vec3 normal = readFromTexture(tNormal, VertexID, uGeoTexDim).xyz;\n #else\n vec3 normal = aNormal;\n #endif\n mat3 normalMatrix = transpose3(inverse3(mat3(modelView)));\n vec3 transformedNormal = normalize(normalMatrix * normalize(normal));\n #if defined(dFlipSided)\n if (!uDoubleSided) { // TODO checking uDoubleSided should not be required, ASR\n transformedNormal = -transformedNormal;\n }\n #endif\n vNormal = transformedNormal;\n}\n","\nprecision highp float;\nprecision highp int;\n\n#define bumpEnabled\n\n#include common\n#include common_frag_params\n#include color_frag_params\n#include light_frag_params\n#include normal_frag_params\n#include common_clip\n\nvoid main() {\n #include clip_pixel\n\n // Workaround for buggy gl_FrontFacing (e.g. on some integrated Intel GPUs)\n vec3 fdx = dFdx(vViewPosition);\n vec3 fdy = dFdy(vViewPosition);\n vec3 faceNormal = normalize(cross(fdx,fdy));\n bool frontFacing = dot(vNormal, faceNormal) > 0.0;\n\n #if defined(dFlipSided)\n interior = frontFacing;\n #else\n interior = !frontFacing;\n #endif\n\n float fragmentDepth = gl_FragCoord.z;\n #include assign_material_color\n\n #if defined(dRenderVariant_pick)\n #include check_picking_alpha\n #ifdef requiredDrawBuffers\n gl_FragColor = vObject;\n gl_FragData[1] = vInstance;\n gl_FragData[2] = vGroup;\n gl_FragData[3] = packDepthToRGBA(fragmentDepth);\n #else\n gl_FragColor = vColor;\n #endif\n #elif defined(dRenderVariant_depth)\n gl_FragColor = material;\n #elif defined(dRenderVariant_marking)\n gl_FragColor = material;\n #elif defined(dRenderVariant_color)\n #if defined(dFlatShaded)\n vec3 normal = -faceNormal;\n #else\n vec3 normal = -normalize(vNormal);\n if (uDoubleSided) normal *= float(frontFacing) * 2.0 - 1.0;\n #endif\n #include apply_light_color\n\n #include apply_interior_color\n #include apply_marker_color\n #include apply_fog\n #include wboit_write\n #include dpoit_write\n #endif\n}\n",{drawBuffers:"optional"},{},jS),$Ue=Un("direct-volume","\nprecision highp float;\n\nattribute vec3 aPosition;\nattribute mat4 aTransform;\nattribute float aInstance;\n\nuniform mat4 uModelView;\nuniform mat4 uProjection;\nuniform vec4 uInvariantBoundingSphere;\n\nvarying vec3 vOrigPos;\nvarying float vInstance;\nvarying vec4 vBoundingSphere;\nvarying mat4 vTransform;\n\nuniform vec3 uBboxSize;\nuniform vec3 uBboxMin;\nuniform vec3 uBboxMax;\nuniform vec3 uGridDim;\nuniform mat4 uTransform;\n\nuniform mat4 uUnitToCartn;\n\nvoid main() {\n vec4 unitCoord = vec4(aPosition + vec3(0.5), 1.0);\n vec4 mvPosition = uModelView * aTransform * uUnitToCartn * unitCoord;\n\n vOrigPos = (aTransform * uUnitToCartn * unitCoord).xyz;\n vInstance = aInstance;\n vBoundingSphere = vec4(\n (aTransform * vec4(uInvariantBoundingSphere.xyz, 1.0)).xyz,\n uInvariantBoundingSphere.w\n );\n vTransform = aTransform;\n\n gl_Position = uProjection * mvPosition;\n\n // move z position to near clip plane (but not too close to get precision issues)\n gl_Position.z = gl_Position.w - 0.01;\n}\n","\nprecision highp float;\nprecision highp int;\n\n#include common\n#include light_frag_params\n\n#if dClipObjectCount != 0\n uniform int uClipObjectType[dClipObjectCount];\n uniform bool uClipObjectInvert[dClipObjectCount];\n uniform vec3 uClipObjectPosition[dClipObjectCount];\n uniform vec4 uClipObjectRotation[dClipObjectCount];\n uniform vec3 uClipObjectScale[dClipObjectCount];\n#endif\n#include common_clip\n\n#include read_from_texture\n#include texture3d_from_1d_trilinear\n#include texture3d_from_2d_nearest\n#include texture3d_from_2d_linear\n\nuniform mat4 uProjection, uTransform, uModelView, uModel, uView;\nuniform vec3 uCameraDir;\n\nuniform sampler2D tDepth;\nuniform vec2 uDrawingBufferSize;\n\nvarying vec3 vOrigPos;\nvarying float vInstance;\nvarying vec4 vBoundingSphere;\nvarying mat4 vTransform;\n\nuniform mat4 uInvView;\nuniform vec3 uGridDim;\nuniform vec3 uBboxSize;\nuniform sampler2D tTransferTex;\nuniform float uTransferScale;\nuniform float uStepScale;\nuniform float uJumpLength;\n\nuniform int uObjectId;\nuniform int uVertexCount;\nuniform int uInstanceCount;\nuniform int uGroupCount;\n\n#if defined(dColorMarker)\n uniform vec3 uHighlightColor;\n uniform vec3 uSelectColor;\n uniform vec3 uDimColor;\n uniform float uHighlightStrength;\n uniform float uSelectStrength;\n uniform float uDimStrength;\n uniform int uMarkerPriority;\n uniform float uMarkerAverage;\n\n uniform float uMarker;\n uniform vec2 uMarkerTexDim;\n uniform sampler2D tMarker;\n#endif\n\nuniform float uMetalness;\nuniform float uRoughness;\n\nuniform bool uFog;\nuniform float uFogNear;\nuniform float uFogFar;\nuniform vec3 uFogColor;\n\nuniform float uAlpha;\nuniform bool uTransparentBackground;\nuniform float uXrayEdgeFalloff;\nuniform float uExposure;\n\nuniform int uRenderMask;\n\nuniform float uNear;\nuniform float uFar;\nuniform float uIsOrtho;\n\nuniform vec3 uCellDim;\nuniform vec3 uCameraPosition;\nuniform mat4 uCartnToUnit;\n\n#if __VERSION__ != 100\n // for webgl1 this is given as a 'define'\n uniform int uMaxSteps;\n#endif\n\n#if defined(dGridTexType_2d)\n precision highp sampler2D;\n uniform sampler2D tGridTex;\n uniform vec3 uGridTexDim;\n#elif defined(dGridTexType_3d)\n precision highp sampler3D;\n uniform sampler3D tGridTex;\n#endif\n\n#if defined(dColorType_uniform)\n uniform vec3 uColor;\n#elif defined(dColorType_texture)\n uniform vec2 uColorTexDim;\n uniform sampler2D tColor;\n#endif\n\n#ifdef dOverpaint\n #if defined(dOverpaintType_groupInstance) || defined(dOverpaintType_vertexInstance)\n uniform vec2 uOverpaintTexDim;\n uniform sampler2D tOverpaint;\n #endif\n#endif\n\n#ifdef dUsePalette\n uniform sampler2D tPalette;\n#endif\n\n#if defined(dGridTexType_2d)\n vec4 textureVal(vec3 pos) {\n return texture3dFrom2dLinear(tGridTex, pos + (vec3(0.5, 0.5, 0.0) / uGridDim), uGridDim, uGridTexDim.xy);\n }\n vec4 textureGroup(vec3 pos) {\n return texture3dFrom2dNearest(tGridTex, pos + (vec3(0.5, 0.5, 0.0) / uGridDim), uGridDim, uGridTexDim.xy);\n }\n#elif defined(dGridTexType_3d)\n vec4 textureVal(vec3 pos) {\n return texture(tGridTex, pos + (vec3(0.5) / uGridDim));\n }\n vec4 textureGroup(vec3 pos) {\n return texelFetch(tGridTex, ivec3(pos * uGridDim), 0);\n }\n#endif\n\nfloat calcDepth(const in vec3 pos) {\n vec2 clipZW = pos.z * uProjection[2].zw + uProjection[3].zw;\n return 0.5 + 0.5 * clipZW.x / clipZW.y;\n}\n\nfloat transferFunction(float value) {\n return texture2D(tTransferTex, vec2(value, 0.0)).a;\n}\n\nfloat getDepth(const in vec2 coords) {\n #ifdef depthTextureSupport\n return texture2D(tDepth, coords).r;\n #else\n return unpackRGBAToDepth(texture2D(tDepth, coords));\n #endif\n}\n\nconst float gradOffset = 0.5;\n\nvec3 v3m4(vec3 p, mat4 m) {\n return (m * vec4(p, 1.0)).xyz;\n}\n\nfloat preFogAlphaBlended = 0.0;\n\nvec4 raymarch(vec3 startLoc, vec3 step, vec3 rayDir) {\n mat3 normalMatrix = transpose3(inverse3(mat3(uModelView * vTransform)));\n mat4 cartnToUnit = uCartnToUnit * inverse4(vTransform);\n #if defined(dClipVariant_pixel) && dClipObjectCount != 0\n mat4 modelTransform = uModel * vTransform * uTransform;\n #endif\n mat4 modelViewTransform = uModelView * vTransform * uTransform;\n\n vec3 scaleVol = vec3(1.0) / uGridDim;\n vec3 pos = startLoc;\n vec4 cell;\n float prevValue = -1.0;\n float value = 0.0;\n vec4 src = vec4(0.0);\n vec4 dst = vec4(0.0);\n float fragmentDepth;\n\n vec3 posMin = vec3(0.0);\n vec3 posMax = vec3(1.0) - vec3(1.0) / uGridDim;\n\n vec3 unitPos;\n\n vec3 nextPos;\n float nextValue;\n\n vec4 material;\n vec4 overpaint;\n float metalness = uMetalness;\n float roughness = uRoughness;\n\n vec3 gradient = vec3(1.0);\n vec3 dx = vec3(gradOffset * scaleVol.x, 0.0, 0.0);\n vec3 dy = vec3(0.0, gradOffset * scaleVol.y, 0.0);\n vec3 dz = vec3(0.0, 0.0, gradOffset * scaleVol.z);\n\n float maxDist = min(vBoundingSphere.w * 2.0, uFar - uNear);\n float maxDistSq = maxDist * maxDist;\n\n for (int i = 0; i < uMaxSteps; ++i) {\n // break when beyond bounding-sphere or far-plane\n vec3 distVec = startLoc - pos;\n if (dot(distVec, distVec) > maxDistSq) break;\n\n unitPos = v3m4(pos, cartnToUnit);\n\n // continue when outside of grid\n if (unitPos.x > posMax.x || unitPos.y > posMax.y || unitPos.z > posMax.z ||\n unitPos.x < posMin.x || unitPos.y < posMin.y || unitPos.z < posMin.z\n ) {\n prevValue = value;\n pos += step;\n continue;\n }\n\n cell = textureVal(unitPos);\n value = cell.a; // current voxel value\n\n if (uJumpLength > 0.0 && value < 0.01) {\n nextPos = pos + rayDir * uJumpLength;\n nextValue = textureVal(v3m4(nextPos, cartnToUnit)).a;\n if (nextValue < 0.01) {\n prevValue = nextValue;\n pos = nextPos;\n continue;\n }\n }\n\n vec4 mvPosition = modelViewTransform * vec4(unitPos * uGridDim, 1.0);\n if (calcDepth(mvPosition.xyz) > getDepth(gl_FragCoord.xy / uDrawingBufferSize))\n break;\n\n #if defined(dClipVariant_pixel) && dClipObjectCount != 0\n vec3 vModelPosition = v3m4(unitPos * uGridDim, modelTransform);\n if (clipTest(vec4(vModelPosition, 0.0))) {\n prevValue = value;\n pos += step;\n continue;\n }\n #endif\n\n vec3 vViewPosition = mvPosition.xyz;\n material.a = transferFunction(value);\n\n #ifdef dPackedGroup\n float group = unpackRGBToInt(textureGroup(floor(unitPos * uGridDim + 0.5) / uGridDim).rgb);\n #else\n vec3 g = floor(unitPos * uGridDim + 0.5);\n // note that we swap x and z because the texture is flipped around y\n #if defined(dAxisOrder_012)\n float group = g.z + g.y * uGridDim.z + g.x * uGridDim.z * uGridDim.y; // 210\n #elif defined(dAxisOrder_021)\n float group = g.y + g.z * uGridDim.y + g.x * uGridDim.y * uGridDim.z; // 120\n #elif defined(dAxisOrder_102)\n float group = g.z + g.x * uGridDim.z + g.y * uGridDim.z * uGridDim.x; // 201\n #elif defined(dAxisOrder_120)\n float group = g.x + g.z * uGridDim.x + g.y * uGridDim.x * uGridDim.z; // 021\n #elif defined(dAxisOrder_201)\n float group = g.y + g.x * uGridDim.y + g.z * uGridDim.y * uGridDim.x; // 102\n #elif defined(dAxisOrder_210)\n float group = g.x + g.y * uGridDim.x + g.z * uGridDim.x * uGridDim.y; // 012\n #endif\n #endif\n\n #if defined(dColorType_direct) && defined(dUsePalette)\n material.rgb = texture2D(tPalette, vec2(value, 0.0)).rgb;\n #elif defined(dColorType_uniform)\n material.rgb = uColor;\n #elif defined(dColorType_instance)\n material.rgb = readFromTexture(tColor, vInstance, uColorTexDim).rgb;\n #elif defined(dColorType_group)\n material.rgb = readFromTexture(tColor, group, uColorTexDim).rgb;\n #elif defined(dColorType_groupInstance)\n material.rgb = readFromTexture(tColor, vInstance * float(uGroupCount) + group, uColorTexDim).rgb;\n #elif defined(dColorType_vertex)\n material.rgb = texture3dFrom1dTrilinear(tColor, unitPos, uGridDim, uColorTexDim, 0.0).rgb;\n #elif defined(dColorType_vertexInstance)\n material.rgb = texture3dFrom1dTrilinear(tColor, unitPos, uGridDim, uColorTexDim, vInstance * float(uVertexCount)).rgb;\n #endif\n\n #ifdef dOverpaint\n #if defined(dOverpaintType_groupInstance)\n overpaint = readFromTexture(tOverpaint, vInstance * float(uGroupCount) + group, uOverpaintTexDim);\n #elif defined(dOverpaintType_vertexInstance)\n overpaint = texture3dFrom1dTrilinear(tOverpaint, unitPos, uGridDim, uOverpaintTexDim, vInstance * float(uVertexCount));\n #endif\n\n material.rgb = mix(material.rgb, overpaint.rgb, overpaint.a);\n #endif\n\n #ifdef dIgnoreLight\n gl_FragColor.rgb = material.rgb;\n #else\n if (material.a >= 0.01) {\n #ifdef dPackedGroup\n // compute gradient by central differences\n gradient.x = textureVal(unitPos - dx).a - textureVal(unitPos + dx).a;\n gradient.y = textureVal(unitPos - dy).a - textureVal(unitPos + dy).a;\n gradient.z = textureVal(unitPos - dz).a - textureVal(unitPos + dz).a;\n #else\n gradient = cell.xyz * 2.0 - 1.0;\n #endif\n vec3 normal = -normalize(normalMatrix * normalize(gradient));\n #include apply_light_color\n } else {\n gl_FragColor.rgb = material.rgb;\n }\n #endif\n\n gl_FragColor.a = material.a * uAlpha * uTransferScale;\n\n #if defined(dColorMarker)\n float marker = uMarker;\n if (uMarker == -1.0) {\n marker = readFromTexture(tMarker, vInstance * float(uGroupCount) + group, uMarkerTexDim).a;\n marker = floor(marker * 255.0 + 0.5); // rounding required to work on some cards on win\n }\n #endif\n #include apply_marker_color\n\n preFogAlphaBlended = (1.0 - preFogAlphaBlended) * gl_FragColor.a + preFogAlphaBlended;\n fragmentDepth = calcDepth(mvPosition.xyz);\n #include apply_fog\n\n src = gl_FragColor;\n\n if (!uTransparentBackground) {\n // done in 'apply_fog' otherwise\n src.rgb *= src.a;\n }\n dst = (1.0 - dst.a) * src + dst; // standard blending\n\n // break if the color is opaque enough\n if (dst.a > 0.95)\n break;\n\n pos += step;\n }\n\n return dst;\n}\n\n// TODO: support float texture for higher precision values???\n// TODO: support clipping exclusion texture support\n\nvoid main() {\n if (gl_FrontFacing)\n discard;\n\n vec3 rayDir = mix(normalize(vOrigPos - uCameraPosition), uCameraDir, uIsOrtho);\n vec3 step = rayDir * uStepScale;\n\n float boundingSphereNear = distance(vBoundingSphere.xyz, uCameraPosition) - vBoundingSphere.w;\n float d = max(uNear, boundingSphereNear) - mix(0.0, distance(vOrigPos, uCameraPosition), uIsOrtho);\n vec3 start = mix(uCameraPosition, vOrigPos, uIsOrtho) + (d * rayDir);\n gl_FragColor = raymarch(start, step, rayDir);\n\n float fragmentDepth = calcDepth((uModelView * vec4(start, 1.0)).xyz);\n float preFogAlpha = clamp(preFogAlphaBlended, 0.0, 1.0);\n #include wboit_write\n}\n",{fragDepth:"optional",drawBuffers:"optional"},{},jS),JUe=Un("image","\nprecision highp float;\nprecision highp int;\n\n#include common\n#include common_vert_params\n\nattribute vec3 aPosition;\nattribute vec2 aUv;\nattribute mat4 aTransform;\nattribute float aInstance;\n\nvarying vec2 vUv;\nvarying float vInstance;\n\nvoid main() {\n #include assign_position\n\n vUv = aUv;\n vInstance = aInstance;\n}\n","\nprecision highp float;\nprecision highp int;\n\n#include common\n#include read_from_texture\n#include common_frag_params\n#include common_clip\n\nuniform vec2 uImageTexDim;\nuniform sampler2D tImageTex;\nuniform sampler2D tGroupTex;\n\nuniform vec2 uMarkerTexDim;\nuniform sampler2D tMarker;\n\nvarying vec2 vUv;\nvarying float vInstance;\n\n#if defined(dInterpolation_catmulrom) || defined(dInterpolation_mitchell) || defined(dInterpolation_bspline)\n #define dInterpolation_cubic\n#endif\n\n#if defined(dInterpolation_cubic)\n #if defined(dInterpolation_catmulrom) || defined(dInterpolation_mitchell)\n #if defined(dInterpolation_catmulrom)\n const float B = 0.0;\n const float C = 0.5;\n #elif defined(dInterpolation_mitchell)\n const float B = 0.333;\n const float C = 0.333;\n #endif\n\n float cubicFilter(float x){\n float f = x;\n if (f < 0.0) {\n f = -f;\n }\n if (f < 1.0) {\n return ((12.0 - 9.0 * B - 6.0 * C) * (f * f * f) +\n (-18.0 + 12.0 * B + 6.0 * C) * (f * f) +\n (6.0 - 2.0 * B)) / 6.0;\n }else if (f >= 1.0 && f < 2.0){\n return ((-B - 6.0 * C) * ( f * f * f)\n + (6.0 * B + 30.0 * C) * (f * f) +\n (-(12.0 * B) - 48.0 * C) * f +\n 8.0 * B + 24.0 * C) / 6.0;\n }else{\n return 0.0;\n }\n }\n #elif defined(dInterpolation_bspline)\n float cubicFilter(float x) {\n float f = x;\n if (f < 0.0) {\n f = -f;\n }\n if (f >= 0.0 && f <= 1.0){\n return (2.0 / 3.0) + (0.5) * (f * f * f) - (f * f);\n } else if (f > 1.0 && f <= 2.0) {\n return 1.0 / 6.0 * pow((2.0 - f), 3.0);\n }\n return 1.0;\n }\n #endif\n\n vec4 biCubic(sampler2D tex, vec2 texCoord) {\n vec2 texelSize = 1.0 / uImageTexDim;\n texCoord -= texelSize / 2.0;\n vec4 nSum = vec4(0.0);\n float nDenom = 0.0;\n vec2 cell = fract(texCoord * uImageTexDim);\n for (float m = -1.0; m <= 2.0; ++m) {\n for (float n = -1.0; n <= 2.0; ++n) {\n vec4 vecData = texture2D(tex, texCoord + texelSize * vec2(m, n));\n float c = cubicFilter(m - cell.x) * cubicFilter(-n + cell.y);\n nSum += vecData * c;\n nDenom += c;\n }\n }\n return nSum / nDenom;\n }\n#endif\n\nvoid main() {\n #include clip_pixel\n\n #if defined(dInterpolation_cubic)\n vec4 imageData = biCubic(tImageTex, vUv);\n #else\n vec4 imageData = texture2D(tImageTex, vUv);\n #endif\n imageData.a = clamp(imageData.a, 0.0, 1.0);\n if (imageData.a > 0.9) imageData.a = 1.0;\n\n float fragmentDepth = gl_FragCoord.z;\n\n #if defined(dRenderVariant_pick)\n if (imageData.a < 0.3)\n discard;\n #ifdef requiredDrawBuffers\n gl_FragColor = vec4(packIntToRGB(float(uObjectId)), 1.0);\n gl_FragData[1] = vec4(packIntToRGB(vInstance), 1.0);\n gl_FragData[2] = vec4(texture2D(tGroupTex, vUv).rgb, 1.0);\n gl_FragData[3] = packDepthToRGBA(gl_FragCoord.z);\n #else\n gl_FragColor = vColor;\n if (uPickType == 1) {\n gl_FragColor = vec4(packIntToRGB(float(uObjectId)), 1.0);\n } else if (uPickType == 2) {\n gl_FragColor = vec4(packIntToRGB(vInstance), 1.0);\n } else {\n gl_FragColor = vec4(texture2D(tGroupTex, vUv).rgb, 1.0);\n }\n #endif\n #elif defined(dRenderVariant_depth)\n if (imageData.a < 0.05)\n discard;\n gl_FragColor = packDepthToRGBA(gl_FragCoord.z);\n #elif defined(dRenderVariant_marking)\n float marker = uMarker;\n if (uMarker == -1.0) {\n float group = unpackRGBToInt(texture2D(tGroupTex, vUv).rgb);\n marker = readFromTexture(tMarker, vInstance * float(uGroupCount) + group, uMarkerTexDim).a;\n marker = floor(marker * 255.0 + 0.5); // rounding required to work on some cards on win\n }\n if (uMarkingType == 1) {\n if (marker > 0.0 || imageData.a < 0.05)\n discard;\n gl_FragColor = packDepthToRGBA(gl_FragCoord.z);\n } else {\n if (marker == 0.0 || imageData.a < 0.05)\n discard;\n float depthTest = 1.0;\n if (uMarkingDepthTest) {\n depthTest = (fragmentDepth >= getDepthPacked(gl_FragCoord.xy / uDrawingBufferSize)) ? 1.0 : 0.0;\n }\n bool isHighlight = intMod(marker, 2.0) > 0.1;\n gl_FragColor = vec4(0.0, depthTest, isHighlight ? 1.0 : 0.0, 1.0);\n }\n #elif defined(dRenderVariant_color)\n if (imageData.a < 0.05)\n discard;\n gl_FragColor = imageData;\n gl_FragColor.a *= uAlpha;\n\n float marker = uMarker;\n if (uMarker == -1.0) {\n float group = unpackRGBToInt(texture2D(tGroupTex, vUv).rgb);\n marker = readFromTexture(tMarker, vInstance * float(uGroupCount) + group, uMarkerTexDim).a;\n marker = floor(marker * 255.0 + 0.5); // rounding required to work on some cards on win\n }\n\n #include apply_marker_color\n #include apply_fog\n #include wboit_write\n #include dpoit_write\n #endif\n}\n",{drawBuffers:"optional"},{},GD);function mee(e,t){var r;if(void 0===e)return"";var n=(null===(r=e.dRenderVariant)||void 0===r?void 0:r.ref.value)||"",a=[];for(var i in e)if(!t?.(i,n,e)){var s=e[i].ref.value;void 0!==s&&("string"==typeof s?a.push("#define ".concat(i,"_").concat(s)):"number"==typeof s?a.push("#define ".concat(i," ").concat(s)):"boolean"==typeof s?s&&a.push("#define ".concat(i)):xn())}return a.join("\n")+"\n"}var rVe="\n#define attribute in\n#define varying out\n#define texture2D texture\n",nVe="\n#define varying in\n#define texture2D texture\n#define textureCube texture\n#define texture2DLodEXT textureLod\n#define textureCubeLodEXT textureLod\n\n#define gl_FragColor out_FragData0\n#define gl_FragDepthEXT gl_FragDepth\n\n#define depthTextureSupport\n";function uVe(e,t){switch(t){case"b":case"b[]":return e.BOOL;case"f":case"f[]":return e.FLOAT;case"i":case"i[]":return e.INT;case"v2":case"v2[]":return e.FLOAT_VEC2;case"v3":case"v3[]":return e.FLOAT_VEC3;case"v4":case"v4[]":return e.FLOAT_VEC4;case"iv2":case"iv2[]":return e.INT_VEC2;case"iv3":case"iv3[]":return e.INT_VEC3;case"iv4":case"iv4[]":return e.INT_VEC4;case"m3":case"m3[]":return e.FLOAT_MAT3;case"m4":case"m4[]":return e.FLOAT_MAT4;default:console.error("unknown uniform kind '".concat(t,"'"))}}function lVe(e,t,r){e.uniform1f(t,r)}function fVe(e,t,r){e.uniform1fv(t,r)}function dVe(e,t,r){e.uniform1i(t,r)}function pVe(e,t,r){e.uniform1iv(t,r)}function hVe(e,t,r){e.uniform2fv(t,r)}function mVe(e,t,r){e.uniform3fv(t,r)}function vVe(e,t,r){e.uniform4fv(t,r)}function gVe(e,t,r){e.uniform2iv(t,r)}function yVe(e,t,r){e.uniform3iv(t,r)}function bVe(e,t,r){e.uniform4iv(t,r)}function _Ve(e,t,r){e.uniformMatrix3fv(t,!1,r)}function SVe(e,t,r){e.uniformMatrix4fv(t,!1,r)}function vee(e){switch(e){case"f":return lVe;case"f[]":return fVe;case"i":case"t":case"b":return dVe;case"i[]":case"t[]":case"b[]":return pVe;case"v2":case"v2[]":return hVe;case"v3":case"v3[]":return mVe;case"v4":case"v4[]":return vVe;case"iv2":case"iv2[]":return gVe;case"iv3":case"iv3[]":return yVe;case"iv4":case"iv4[]":return bVe;case"m3":case"m3[]":return _Ve;case"m4":case"m4[]":return SVe}}var wVe=_s();function gee(e){var t=e.createBuffer();if(null===t)throw new Error("Could not create WebGL buffer");return t}function yee(e,t,r,n){var a=gee(e),i=function AVe(e,t){switch(t){case"static":return e.STATIC_DRAW;case"dynamic":return e.DYNAMIC_DRAW;case"stream":return e.STREAM_DRAW}}(e,r),o=function DVe(e,t){switch(t){case"attribute":return e.ARRAY_BUFFER;case"elements":return e.ELEMENT_ARRAY_BUFFER;case"uniform":if($t(e))return e.UNIFORM_BUFFER;throw new Error("WebGL2 is required for uniform buffers")}}(e,n),s=function TVe(e,t){return t instanceof Uint8Array?e.UNSIGNED_BYTE:t instanceof Int8Array?e.BYTE:t instanceof Uint16Array?e.UNSIGNED_SHORT:t instanceof Int16Array?e.SHORT:t instanceof Uint32Array?e.UNSIGNED_INT:t instanceof Int32Array?e.INT:t instanceof Float32Array?e.FLOAT:void xn()}(e,t),u=t.BYTES_PER_ELEMENT,c=t.length;function l(d){e.bindBuffer(o,a),e.bufferData(o,d,i)}l(t);var f=!1;return{id:wVe(),_usageHint:i,_bufferType:o,_dataType:s,_bpe:u,length:c,getBuffer:function(){return a},updateData:l,updateSubData:function(d,p,h){e.bindBuffer(o,a),h-p===d.length?e.bufferSubData(o,0,d):e.bufferSubData(o,p*u,d.subarray(p,p+h))},reset:function(){a=gee(e),l(t)},destroy:function(){f||(e.deleteBuffer(a),f=!0)}}}function EVe(e,t,r){if("float32"===t)switch(r){case 1:return e.FLOAT;case 2:return e.FLOAT_VEC2;case 3:return e.FLOAT_VEC3;case 4:return e.FLOAT_VEC4;case 16:return e.FLOAT_MAT4}xn()}var RVe=_s();function cB(e){var t=e.createProgram();if(null===t)throw new Error("Could not create WebGL program");return t}function BVe(e,t,r,n,a){var p,h,i=a.defineValues,o=a.shaderCode,s=a.schema,u=cB(e),c=RVe(),l=function sVe(e,t,r,n){var a=mee(r,n.ignoreDefine),i=mee(r,n.ignoreDefine),o=$t(e)?function aVe(e,t){var r=["#version 300 es"];if(t.drawBuffers&&e.drawBuffers&&r.push("#define requiredDrawBuffers"),t.clipCullDistance)if(e.clipCullDistance)r.push("#extension GL_ANGLE_clip_cull_distance : enable"),r.push("#define enabledClipCullDistance");else if("required"===t.clipCullDistance)throw new Error("required 'GL_ANGLE_clip_cull_distance' extension not available");if(t.conservativeDepth)if(e.conservativeDepth)r.push("#extension GL_EXT_conservative_depth : enable"),r.push("#define enabledConservativeDepth");else if("required"===t.conservativeDepth)throw new Error("required 'GL_EXT_conservative_depth' extension not available");return e.noNonInstancedActiveAttribs&&r.push("#define noNonInstancedActiveAttribs"),r.push(rVe),r.join("\n")+"\n"}(t,n.extensions):function eVe(e,t){var r=[];if(t.drawBuffers)if(e.drawBuffers)r.push("#define requiredDrawBuffers");else if("required"===t.drawBuffers)throw new Error("required 'GL_EXT_draw_buffers' extension not available");return r.join("\n")+"\n"}(t,n.extensions),s=$t(e)?function iVe(e,t,r,n){var a=["#version 300 es","layout(location = 0) out highp ".concat(n[0]||"vec4"," out_FragData0;")];if(r.fragDepth&&t.fragDepth&&a.push("#define enabledFragDepth"),r.drawBuffers&&t.drawBuffers){a.push("#define requiredDrawBuffers");for(var o=1,s=e.getParameter(e.MAX_DRAW_BUFFERS);o=16*t?r.transform.ref.value:new Float32Array(16*t);a.set(e),k.update(r.transform,a),k.updateIfChanged(r.uInstanceCount,t),k.updateIfChanged(r.instanceCount,t);var i=r.aTransform.ref.value.length>=16*t?r.aTransform.ref.value:new Float32Array(16*t);k.update(r.aTransform,i);var o=r.extraTransform.ref.value.length>=16*t?r.extraTransform.ref.value:new Float32Array(16*t);k.update(r.extraTransform,WD(o,t));var s=r.aInstance.ref.value.length>=t?r.aInstance.ref.value:new Float32Array(t);k.update(r.aInstance,oc(s,t)),k.update(r.hasReflection,n)}else r={aTransform:k.create(new Float32Array(16*t)),matrix:k.create(me.identity()),transform:k.create(new Float32Array(e)),extraTransform:k.create(WD(new Float32Array(16*t),t)),uInstanceCount:k.create(t),instanceCount:k.create(t),aInstance:k.create(oc(new Float32Array(t))),hasReflection:k.create(n)};return Yee(r),r}var pB=new Float32Array(16);function hB(e){return dB(new Float32Array(pB),1,e)}function WD(e,t){for(var r=0;r1.2&&(n=2)),{resolution:r,stride:n}}}function Qee(e,t,r){return e.fill(0,4*t,4*r),!0}!function(e){e.MaterialCategory={category:"Material"},e.ShadingCategory={category:"Shading"},e.CustomQualityParamInfo={category:"Custom Quality",hideIf:function(o){return typeof o.quality<"u"&&"custom"!==o.quality}},e.Params={alpha:D.Numeric(1,{min:0,max:1,step:.01},{label:"Opacity",isEssential:!0,description:"How opaque/transparent the representation is rendered."}),quality:D.Select("auto",vB,{isEssential:!0,description:"Visual/rendering quality of the representation."}),material:As.getParam(),clip:D.Group(bm.Params),instanceGranularity:D.Boolean(!1,{description:"Use instance granularity for marker, transparency, clipping, overpaint, substance data to save memory."})},e.createSimple=function t(o,s,u){return void 0===o&&(o=gr.grey),void 0===s&&(s=1),u||(u=hB()),{transform:u,locationIterator:Ln(1,u.instanceCount.ref.value,1,function(){return vc},!1,function(){return!1}),theme:{color:cg(0,{value:o,lightness:0,saturation:0}),size:mB(0,{value:s})}}},e.createValues=function r(o,s){var u=bm.getClip(o.clip);return{alpha:k.create(o.alpha),uAlpha:k.create(o.alpha),uVertexCount:k.create(s.vertexCount),uGroupCount:k.create(s.groupCount),drawCount:k.create(s.drawCount),uMetalness:k.create(o.material.metalness),uRoughness:k.create(o.material.roughness),uBumpiness:k.create(o.material.bumpiness),dLightCount:k.create(1),dColorMarker:k.create(!0),dClipObjectCount:k.create(u.objects.count),dClipVariant:k.create(u.variant),uClipObjectType:k.create(u.objects.type),uClipObjectInvert:k.create(u.objects.invert),uClipObjectPosition:k.create(u.objects.position),uClipObjectRotation:k.create(u.objects.rotation),uClipObjectScale:k.create(u.objects.scale),instanceGranularity:k.create(o.instanceGranularity)}},e.updateValues=function n(o,s){k.updateIfChanged(o.alpha,s.alpha),k.updateIfChanged(o.uMetalness,s.material.metalness),k.updateIfChanged(o.uRoughness,s.material.roughness),k.updateIfChanged(o.uBumpiness,s.material.bumpiness);var u=bm.getClip(s.clip);k.updateIfChanged(o.dClipObjectCount,u.objects.count),k.updateIfChanged(o.dClipVariant,u.variant),k.update(o.uClipObjectType,u.objects.type),k.update(o.uClipObjectInvert,u.objects.invert),k.update(o.uClipObjectPosition,u.objects.position),k.update(o.uClipObjectRotation,u.objects.rotation),k.update(o.uClipObjectScale,u.objects.scale),k.updateIfChanged(o.instanceGranularity,s.instanceGranularity)},e.createRenderableState=function a(o){void 0===o&&(o={});var s=void 0===o.alpha||1===o.alpha;return{disposed:!1,visible:!0,alphaFactor:1,pickable:!0,colorOnly:!1,opaque:s,writeDepth:s}},e.updateRenderableState=function i(o,s){o.opaque=s.alpha*o.alphaFactor>=1,o.writeDepth=o.opaque}}(ot||(ot={}));var $ee={array:new Uint8Array(4),width:1,height:1};function Mp(e){return e?(k.update(e.tOverpaint,$ee),k.update(e.uOverpaintTexDim,Fe.create(1,1)),e):{tOverpaint:k.create($ee),uOverpaintTexDim:k.create(Fe.create(1,1)),dOverpaint:k.create(!1),tOverpaintGrid:k.create(Go()),uOverpaintGridDim:k.create(S.create(1,1,1)),uOverpaintGridTransform:k.create(pr.create(0,0,0,1)),dOverpaintType:k.create("groupInstance"),uOverpaintStrength:k.create(1)}}function Jee(e,t){if(0===t||e.length=3*M?I.normalBuffer.ref.value:new Float32Array(3*M);N===I.normalBuffer.ref.value&&N.fill(0,0,3*M),tee(F,j,N,M,O),k.update(I.normalBuffer,N)},e.checkForDuplicateVertices=function s(I,M){void 0===M&&(M=3);for(var O=I.vertexBuffer.ref.value,F=new Map,N=0,H=S(),G=0,U=I.vertexCount;Gre)){var J=O.get(je);if((!M[J[0]].includes(J[1])||null!==(j=O.get(J[0]))&&void 0!==j&&j.includes(J[1]))&&(S.fromArray(Y,Q,3*je),S.fromArray($,Q,3*J[0]),S.fromArray(Z,Q,3*J[1]),S.sub(z,$,Y),S.sub(te,Z,Y),S.add(de,z,te),!(S.squaredDistance(Y,$)>=F))){for(var ye=!1,we=0,Ee=M[je];we0?qe.add3(ne,je,J[0],J[1]):qe.add3(ne,J[1],J[0],je),ee.add(je),ee.add(J[0]),ee.add(J[1]),X+=1)}}}var Ne=qe.compact(ne);return I.triangleCount=X,k.update(H,Ne),I}function _(I,M){var O=I.vertexCount,F=M.instanceCount.ref.value,j=ym(),N=j.position,H=I.vertexBuffer.ref.value,G=M.aTransform.ref.value;return Ln(O,F,1,function(Q,W){return W<0?S.fromArray(N,H,3*Q):S.transformMat4Offset(N,H,G,0,3*Q,16*W),j})}function C(I,M,O,F,j){var N=O.instanceCount,H=O.groupCount,U=gc(O,_(I,M),F.color),Q=j.instanceGranularity?Va(N,"instance"):Va(N*H,"groupInstance"),W=Mp(),K=Rp(),ne=Op(),X=kp(),L={drawCount:3*I.triangleCount,vertexCount:I.vertexCount,groupCount:H,instanceCount:N},Y=De.clone(I.boundingSphere),$=fo(Y,M.aTransform.ref.value,N,0);return R(R(R(R(R(R(R(R(R({dGeometryType:k.create("mesh"),aPosition:I.vertexBuffer,aNormal:I.normalBuffer,aGroup:I.groupBuffer,elements:I.indexBuffer,dVaryingGroup:I.varyingGroup,boundingSphere:k.create($),invariantBoundingSphere:k.create(Y),uInvariantBoundingSphere:k.create(pr.ofSphere(Y))},U),Q),W),K),ne),X),M),ot.createValues(j,L)),{uDoubleSided:k.create(j.doubleSided),dFlatShaded:k.create(j.flatShaded),dFlipSided:k.create(j.flipSided),dIgnoreLight:k.create(j.ignoreLight),dXrayShaded:k.create("inverted"===j.xrayShaded?"inverted":!0===j.xrayShaded?"on":"off"),dTransparentBackfaces:k.create(j.transparentBackfaces),uBumpFrequency:k.create(j.bumpFrequency),uBumpAmplitude:k.create(j.bumpAmplitude),meta:k.create(I.meta)})}function E(I,M){ot.updateRenderableState(I,M),I.opaque=I.opaque&&!M.xrayShaded,I.writeDepth=I.opaque}e.transform=function c(I,M){var O=I.vertexBuffer.ref.value;sg(M,O,0,I.vertexCount),me.isTranslationAndUniformScaling(M)||function R8e(e,t,r,n){for(var a=0,i=3*n;a0&&y(!0),u&&n>0&&y(!1),{vertices:new Float32Array(d),normals:new Float32Array(p),indices:new Uint32Array(f)};function y(b){for(var _=!0===b?r:n,C=!0===b?1:-1,x=h,A=1;A<=i;++A)d.push(0,v*C,0),p.push(0,C,0),++h;var T=h;for(A=0;A<=i;++A){var E=A/i*l+c,I=Math.cos(E),M=Math.sin(E);d.push(_*M,v*C,_*I),p.push(0,C,0),++h}for(A=0;Aa&&(this.currentX=0,this.currentY+=this.scratchH),this.currentY+this.scratchH>i)return console.warn("canvas to small"),this.placeholder;this.mapped[t]={x:this.currentX,y:this.currentY,w:this.scratchW,h:this.scratchH,nw:this.scratchW/this.lineHeight,nh:this.scratchH/this.lineHeight};for(var s=0;sa&&(a=c);var l=Math.abs(e[u+1]);l>a&&(a=l);var f=Math.abs(t[o]);f>i&&(i=f)}return Math.max(i,n+n*a)}!function(e){function t(p,h,m,v,g,y,b,_,C){return C?function i(p,h,m,v,g,y,b,_,C){return C.charCount=_,k.update(C.fontTexture,p),k.update(C.centerBuffer,h),k.update(C.mappingBuffer,m),k.update(C.depthBuffer,v),k.update(C.indexBuffer,g),k.update(C.groupBuffer,y),k.update(C.tcoordBuffer,b),C}(p,h,m,v,g,y,b,_,C):function a(p,h,m,v,g,y,b,_){var x,C=De(),A=-1,T=-1,w={kind:"text",charCount:_,fontTexture:k.create(p),centerBuffer:k.create(h),mappingBuffer:k.create(m),depthBuffer:k.create(v),indexBuffer:k.create(g),groupBuffer:k.create(y),tcoordBuffer:k.create(b),get boundingSphere(){var E=n(w);if(E!==A){var I=Ip(w.centerBuffer.ref.value,4*w.charCount,4);De.copy(C,I),A=E}return C},get groupMapping(){return w.groupBuffer.ref.version!==T&&(x=cb(w.groupBuffer.ref.value,w.charCount,4),T=w.groupBuffer.ref.version),x},setBoundingSphere:function(E){De.copy(C,E),A=n(w)}};return w}(p,h,m,v,g,y,b,_)}function r(p){return t(p?p.fontTexture.ref.value:Di(0,1,Uint8Array),p?p.centerBuffer.ref.value:new Float32Array(0),p?p.mappingBuffer.ref.value:new Float32Array(0),p?p.depthBuffer.ref.value:new Float32Array(0),p?p.indexBuffer.ref.value:new Uint32Array(0),p?p.groupBuffer.ref.value:new Float32Array(0),p?p.tcoordBuffer.ref.value:new Float32Array(0),0,p)}function n(p){return Ss([p.charCount,p.fontTexture.ref.version,p.centerBuffer.ref.version,p.mappingBuffer.ref.version,p.depthBuffer.ref.version,p.indexBuffer.ref.version,p.groupBuffer.ref.version,p.tcoordBuffer.ref.version])}function o(p,h){var m=4*p.charCount,v=h.instanceCount.ref.value,g=ym(),y=g.position,b=p.centerBuffer.ref.value,_=h.aTransform.ref.value;return Ln(m,v,4,function(x,A){return A<0?S.fromArray(y,b,3*x):S.transformMat4Offset(y,b,_,0,3*x,16*A),g})}function s(p,h,m,v,g){var y=m.instanceCount,b=m.groupCount,C=gc(m,o(p,h),v.color),x=Np(m,v.size),A=g.instanceGranularity?Va(y,"instance"):Va(y*b,"groupInstance"),T=Mp(),w=Rp(),E=Op(),I=kp(),M={drawCount:2*p.charCount*3,vertexCount:4*p.charCount,groupCount:b,instanceCount:y},O=Ete(p.mappingBuffer.ref.value,p.depthBuffer.ref.value,p.charCount,QS(x)),F=De.expand(De(),p.boundingSphere,O),j=fo(F,h.aTransform.ref.value,y,0);return R(R(R(R(R(R(R(R(R(R(R({dGeometryType:k.create("text"),aPosition:p.centerBuffer,aMapping:p.mappingBuffer,aDepth:p.depthBuffer,aGroup:p.groupBuffer,elements:p.indexBuffer,boundingSphere:k.create(j),invariantBoundingSphere:k.create(F),uInvariantBoundingSphere:k.create(pr.ofSphere(F))},C),x),A),T),w),E),I),h),{aTexCoord:p.tcoordBuffer,tFont:p.fontTexture,padding:k.create(O)}),ot.createValues(g,M)),{uSizeFactor:k.create(g.sizeFactor),uBorderWidth:k.create(io(g.borderWidth,0,.5)),uBorderColor:k.create(ft.toArrayNormalized(g.borderColor,S.zero(),0)),uOffsetX:k.create(g.offsetX),uOffsetY:k.create(g.offsetY),uOffsetZ:k.create(g.offsetZ),uBackgroundColor:k.create(ft.toArrayNormalized(g.backgroundColor,S.zero(),0)),uBackgroundOpacity:k.create(g.backgroundOpacity)})}function d(p,h){ot.updateRenderableState(p,h),p.pickable=!1,p.opaque=!1,p.writeDepth=!0}e.create=t,e.createEmpty=r,e.Params=R(R(R({},ot.Params),Dte),{sizeFactor:D.Numeric(1,{min:0,max:10,step:.1}),borderWidth:D.Numeric(0,{min:0,max:.5,step:.01}),borderColor:D.Color(gr.grey),offsetX:D.Numeric(0,{min:0,max:10,step:.1}),offsetY:D.Numeric(0,{min:0,max:10,step:.1}),offsetZ:D.Numeric(0,{min:0,max:10,step:.1}),background:D.Boolean(!1),backgroundMargin:D.Numeric(.2,{min:0,max:1,step:.01}),backgroundColor:D.Color(gr.grey),backgroundOpacity:D.Numeric(1,{min:0,max:1,step:.01}),tether:D.Boolean(!1),tetherLength:D.Numeric(1,{min:0,max:5,step:.1}),tetherBaseWidth:D.Numeric(.3,{min:0,max:1,step:.01}),attachment:D.Select("middle-center",[["bottom-left","bottom-left"],["bottom-center","bottom-center"],["bottom-right","bottom-right"],["middle-left","middle-left"],["middle-center","middle-center"],["middle-right","middle-right"],["top-left","top-left"],["top-center","top-center"],["top-right","top-right"]])}),e.Utils={Params:e.Params,createEmpty:r,createValues:s,createValuesSimple:function u(p,h,m,v,g){var y=ot.createSimple(m,v,g),b=R(R({},D.getDefaultValues(e.Params)),h);return s(p,y.transform,y.locationIterator,y.theme,b)},updateValues:function c(p,h){ot.updateValues(p,h),k.updateIfChanged(p.uSizeFactor,h.sizeFactor),k.updateIfChanged(p.uBorderWidth,h.borderWidth),ft.fromNormalizedArray(p.uBorderColor.ref.value,0)!==h.borderColor&&(ft.toArrayNormalized(h.borderColor,p.uBorderColor.ref.value,0),k.update(p.uBorderColor,p.uBorderColor.ref.value)),k.updateIfChanged(p.uOffsetX,h.offsetX),k.updateIfChanged(p.uOffsetY,h.offsetY),k.updateIfChanged(p.uOffsetZ,h.offsetZ),ft.fromNormalizedArray(p.uBackgroundColor.ref.value,0)!==h.backgroundColor&&(ft.toArrayNormalized(h.backgroundColor,p.uBackgroundColor.ref.value,0),k.update(p.uBackgroundColor,p.uBackgroundColor.ref.value)),k.updateIfChanged(p.uBackgroundOpacity,h.backgroundOpacity)},updateBoundingSphere:function l(p,h){var m=Ete(p.aMapping.ref.value,p.aDepth.ref.value,h.charCount,QS(p)),v=De.expand(De(),h.boundingSphere,m),g=fo(v,p.aTransform.ref.value,p.instanceCount.ref.value,0);De.equals(g,p.boundingSphere.ref.value)||k.update(p.boundingSphere,g),De.equals(v,p.invariantBoundingSphere.ref.value)||(k.update(p.invariantBoundingSphere,v),k.update(p.uInvariantBoundingSphere,pr.fromSphere(p.uInvariantBoundingSphere.ref.value,v))),k.update(p.padding,m)},createRenderableState:function f(p){var h=ot.createRenderableState(p);return d(h,p),h},updateRenderableState:d,createPositionIterator:o}}(yc||(yc={}));var Bu,la,cu=S(),nf=S(),$S=S(),Ite=qe.add,tE=qe.add3;!function(e){e.create=function t(r,n,a){void 0===r&&(r=2048),void 0===n&&(n=1024);var i=qe.create(Float32Array,1,n,a?a.groupBuffer.ref.value:r),o=qe.create(Float32Array,3,n,a?a.startBuffer.ref.value:r),s=qe.create(Float32Array,3,n,a?a.endBuffer.ref.value:r),u=function(f,d,p,h,m,v,g){for(var y=0;y<4;++y)tE(o,f,d,p),tE(s,h,m,v),Ite(i,g)},l=function(f,d,p,h){var m=S.distance(f,d),v=p%2!=0,g=Math.floor((p+1)/2),y=m/(p+.5);S.setMagnitude($S,S.sub($S,d,f),y),S.copy(cu,f);for(var b=0;ba.lineCount)&&function oGe(e,t,r){for(var n=0;nb.lineCount&&(k.update(b.mappingBuffer,p),k.update(b.indexBuffer,h)),b.lineCount=y,k.update(b.groupBuffer,m),k.update(b.startBuffer,v),k.update(b.endBuffer,g),b}(p,h,m,v,g,y,b):function i(p,h,m,v,g,y){var _,b=De(),C=-1,x=-1,A={kind:"lines",lineCount:y,mappingBuffer:k.create(p),indexBuffer:k.create(h),groupBuffer:k.create(m),startBuffer:k.create(v),endBuffer:k.create(g),get boundingSphere(){var T=a(A);if(T!==C){var w=Ip(A.startBuffer.ref.value,4*A.lineCount,4),E=Ip(A.endBuffer.ref.value,4*A.lineCount,4);De.expandBySphere(b,w,E),C=T}return b},get groupMapping(){return A.groupBuffer.ref.version!==x&&(_=cb(A.groupBuffer.ref.value,A.lineCount,4),x=A.groupBuffer.ref.version),_},setBoundingSphere:function(T){De.copy(b,T),C=a(A)}};return A}(p,h,m,v,g,y)}function r(p){return t(p?p.mappingBuffer.ref.value:new Float32Array(0),p?p.indexBuffer.ref.value:new Uint32Array(0),p?p.groupBuffer.ref.value:new Float32Array(0),p?p.startBuffer.ref.value:new Float32Array(0),p?p.endBuffer.ref.value:new Float32Array(0),0,p)}function a(p){return Ss([p.lineCount,p.mappingBuffer.ref.version,p.indexBuffer.ref.version,p.groupBuffer.ref.version,p.startBuffer.ref.version,p.endBuffer.ref.version])}function u(p,h){var m=4*p.lineCount,v=h.instanceCount.ref.value,g=ym(),y=g.position,b=p.startBuffer.ref.value,_=p.endBuffer.ref.value,C=h.aTransform.ref.value;return Ln(m,v,2,function(A,T){var w=A%4==0?b:_;return T<0?S.fromArray(y,w,3*A):S.transformMat4Offset(y,w,C,0,3*A,16*T),g})}function c(p,h,m,v,g){var y=m.instanceCount,b=m.groupCount,C=gc(m,u(p,h),v.color),x=Np(m,v.size),A=g.instanceGranularity?Va(y,"instance"):Va(y*b,"groupInstance"),T=Mp(),w=Rp(),E=Op(),I=kp(),M={drawCount:2*p.lineCount*3,vertexCount:4*p.lineCount,groupCount:b,instanceCount:y},O=De.clone(p.boundingSphere),F=fo(O,h.aTransform.ref.value,y,0);return R(R(R(R(R(R(R(R(R(R({dGeometryType:k.create("lines"),aMapping:p.mappingBuffer,aGroup:p.groupBuffer,aStart:p.startBuffer,aEnd:p.endBuffer,elements:p.indexBuffer,boundingSphere:k.create(F),invariantBoundingSphere:k.create(O),uInvariantBoundingSphere:k.create(pr.ofSphere(O))},C),x),A),T),w),E),I),h),ot.createValues(g,M)),{uSizeFactor:k.create(g.sizeFactor),dLineSizeAttenuation:k.create(g.lineSizeAttenuation),uDoubleSided:k.create(!0),dFlipSided:k.create(!1)})}e.create=t,e.createEmpty=r,e.fromMesh=function n(p,h){for(var m=p.vertexBuffer.ref.value,v=p.indexBuffer.ref.value,g=p.groupBuffer.ref.value,y=Bu.create(3*p.triangleCount,p.triangleCount/10,h),b=0,_=3*p.triangleCount;b<_;b+=3){var C=v[b],x=v[b+1],A=v[b+2],T=m[3*C],w=m[3*C+1],E=m[3*C+2],I=m[3*x],M=m[3*x+1],O=m[3*x+2],F=m[3*A],j=m[3*A+1],N=m[3*A+2];y.add(T,w,E,I,M,O,g[C]),y.add(T,w,E,F,j,N,g[C]),y.add(I,M,O,F,j,N,g[x])}return y.getLines()},e.transform=function s(p,h){var m=p.startBuffer.ref.value;sg(h,m,0,4*p.lineCount),k.update(p.startBuffer,m);var v=p.endBuffer.ref.value;sg(h,v,0,4*p.lineCount),k.update(p.endBuffer,v)},e.Params=R(R({},ot.Params),{sizeFactor:D.Numeric(2,{min:0,max:10,step:.1}),lineSizeAttenuation:D.Boolean(!1)}),e.Utils={Params:e.Params,createEmpty:r,createValues:c,createValuesSimple:function l(p,h,m,v,g){var y=ot.createSimple(m,v,g),b=R(R({},D.getDefaultValues(e.Params)),h);return c(p,y.transform,y.locationIterator,y.theme,b)},updateValues:function f(p,h){ot.updateValues(p,h),k.updateIfChanged(p.uSizeFactor,h.sizeFactor),k.updateIfChanged(p.dLineSizeAttenuation,h.lineSizeAttenuation)},updateBoundingSphere:function d(p,h){var m=De.clone(h.boundingSphere),v=fo(m,p.aTransform.ref.value,p.instanceCount.ref.value,0);De.equals(v,p.boundingSphere.ref.value)||k.update(p.boundingSphere,v),De.equals(m,p.invariantBoundingSphere.ref.value)||(k.update(p.invariantBoundingSphere,m),k.update(p.uInvariantBoundingSphere,pr.fromSphere(p.uInvariantBoundingSphere.ref.value,m)))},createRenderableState:ot.createRenderableState,updateRenderableState:ot.updateRenderableState,createPositionIterator:u}}(la||(la={}));var FB,BB,LB,Xi,rE,nE,nt,Bp=S(),Lp=S(),Up=S(),vb=S(),si=od(4,!0);function Pte(e){for(var n=fb(12,e?36:24),a=0;a<4;++a){var i=(a+1)%4;S.set(Bp,si[3*a],si[3*a+1],-.5),S.set(Lp,si[3*i],si[3*i+1],-.5),S.set(Up,si[3*i],si[3*i+1],.5),S.set(vb,si[3*a],si[3*a+1],.5),e?n.add(Bp,Lp,Up):n.addQuad(Bp,Lp,Up,vb)}return S.set(Bp,si[0],si[1],-.5),S.set(Lp,si[3],si[4],-.5),S.set(Up,si[6],si[7],-.5),S.set(vb,si[9],si[10],-.5),e?n.add(Up,Lp,Bp):n.addQuad(vb,Up,Lp,Bp),S.set(Bp,si[0],si[1],.5),S.set(Lp,si[3],si[4],.5),S.set(Up,si[6],si[7],.5),S.set(vb,si[9],si[10],.5),e?n.add(Bp,Lp,Up):n.addQuad(Bp,Lp,Up,vb),n.getPrimitive()}function NB(){return FB||(FB=Pte(!1)),FB}function Mte(){return LB||(LB=WS([.5,.5,-.5,-.5,.5,-.5,-.5,-.5,-.5,.5,-.5,-.5,.5,.5,.5,-.5,.5,.5,-.5,-.5,.5,.5,-.5,.5],[0,4,1,5,2,6,3,7,0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4])),LB}function Rte(e){return e.map(function(t){return{x:t[0],alpha:t[1]}})}function kte(e,t){for(var u,c,l,f,r=ur(ur([{x:0,alpha:0},{x:0,alpha:0}],e,!0),[{x:1,alpha:0},{x:1,alpha:0}],!1),a=t?t.ref.value.array:new Uint8Array(256),i=0,d=e.length+1,p=0;p=t?u=t-1:u<0&&(u=0),i[u]++}return{min:r,max:n,binWidth:a,counts:i}}function cGe(e,t){var r=this;return Ve.create("Create Volume",function(){return ce(r,void 0,void 0,function(){var n,a,i,o,s,u,c,l,f,d,p,h,m,v,g,y,b;return le(this,function(_){if(a=e.values,i=Cr.Space((n=e.header).dim,[0,1,2],Float64Array),0===n.dataSetIds.length)o=a;else for(u=(s=n.dim)[0],c=s[1],l=s[2],f=(t?.dataIndex||0)+1,d=0,p=0,o=new Float64Array(u*c*l),h=0;hC&&(E=e.IsoValue.absolute(C)):g.relativeValuew&&(E=e.IsoValue.relative(w)),D.Conditioned(E,{absolute:D.Converted(function(I){return e.IsoValue.toAbsolute(I,Xi.One.stats).absoluteValue},function(I){return e.IsoValue.absolute(I)},D.Numeric(x,{min:_,max:C,step:YK(A/100,2)},{immediateUpdate:!0})),relative:D.Converted(function(I){return e.IsoValue.toRelative(I,Xi.One.stats).relativeValue},function(I){return e.IsoValue.relative(I)},D.Numeric(Math.min(1,w),{min:T,max:w,step:YK(Math.round((C-_)/A)/100,2)},{immediateUpdate:!0}))},function(I){return"absolute"===I.kind?"absolute":"relative"},function(I,M){return"absolute"===M?e.IsoValue.toAbsolute(I,b):e.IsoValue.toRelative(I,b)},{isEssential:!0})}e.createIsoValueParam=i,e.IsoValueParam=i(e.IsoValue.relative(2)),e.One={label:"",grid:Xi.One,sourceData:{kind:"",name:"",data:{}},customProperties:new jl,_propertyData:Object.create(null)},e.areEquivalent=function o(g,y){return Xi.areEquivalent(g.grid,y.grid)},e.isEmpty=function s(g){return Xi.isEmpty(g.grid)},e.isOrbitals=function u(g){return!!rE.is(g.sourceData)&&g.sourceData.data.header.orbitals},e.Loci=function c(g){return{kind:"volume-loci",volume:g}},e.isLoci=function l(g){return!!g&&"volume-loci"===g.kind},e.areLociEqual=function f(g,y){return g.volume===y.volume},e.isLociEmpty=function d(g){return Xi.isEmpty(g.volume.grid)},e.getBoundingSphere=function p(g,y){return Xi.getBoundingSphere(g.grid,y)},function(g){g.Loci=function y(T,w){return{kind:"isosurface-loci",volume:T,isoValue:w}},g.isLoci=function b(T){return!!T&&"isosurface-loci"===T.kind},g.areLociEqual=function _(T,w){return T.volume===w.volume&&e.IsoValue.areSame(T.isoValue,w.isoValue,T.volume.grid.stats)},g.isLociEmpty=function C(T){return 0===T.volume.grid.cells.data.length};var x=Nt();g.getBoundingSphere=function A(T,w,E){for(var I=e.IsoValue.toAbsolute(w,T.grid.stats).absoluteValue,M=I<0,O=[0,0,0],F=T.grid.cells.space.getCoords,j=T.grid.cells.data,N=T.grid.cells.space.dimensions,Q=N[0]-1,W=N[1]-1,K=N[2]-1,ne=0,X=0,L=0,Y=0,$=j.length;Y<$;++Y)(M&&j[Y]<=I||!M&&j[Y]>=I)&&(F(Y,O),O[0]ne&&(ne=O[0]),O[1]>X&&(X=O[1]),O[2]>L&&(L=O[2]));S.set(x.min,Q-1,W-1,K-1),S.set(x.max,ne+1,X+1,L+1);var Z=Xi.getGridToCartesianTransform(T.grid);return Nt.transform(x,x,Z),De.fromBox3D(E||De(),x)}}(e.Isosurface||(e.Isosurface={})),function(g){g.Loci=function y(w,E){return{kind:"cell-loci",volume:w,indices:E}},g.isLoci=function b(w){return!!w&&"cell-loci"===w.kind},g.areLociEqual=function _(w,E){return w.volume===E.volume&&Be.areEqual(w.indices,E.indices)},g.isLociEmpty=function C(w){return 0===Be.size(w.indices)};var x=new lc("98"),A=S();g.getBoundingSphere=function T(w,E,I){x.reset();for(var M=Xi.getGridToCartesianTransform(w.grid),O=w.grid.cells.space.getCoords,F=0,j=Be.size(E);F0?"3d":"2d"),uGridTexDim:x,tGridTex:C,uGridStats:A,uCellDim:v.cellDim,uCartnToUnit:v.cartnToUnit,uUnitToCartn:v.unitToCartn,dPackedGroup:v.packedGroup,dAxisOrder:k.create(v.axisOrder.ref.value.join("")),dIgnoreLight:k.create(_.ignoreLight),dXrayShaded:k.create("inverted"===_.xrayShaded?"inverted":!0===_.xrayShaded?"on":"off")})}e.create=t,e.createEmpty=i,e.Params=R(R({},ot.Params),{ignoreLight:D.Boolean(!1,ot.ShadingCategory),xrayShaded:D.Select(!1,[[!1,"Off"],[!0,"On"],["inverted","Inverted"]],ot.ShadingCategory),controlPoints:D.LineGraph([Fe.create(.19,0),Fe.create(.2,.05),Fe.create(.25,.05),Fe.create(.26,0),Fe.create(.79,0),Fe.create(.8,.05),Fe.create(.85,.05),Fe.create(.86,0)],{isEssential:!0}),stepsPerCell:D.Numeric(3,{min:1,max:10,step:1}),jumpLength:D.Numeric(0,{min:0,max:20,step:.1})}),e.Utils={Params:e.Params,createEmpty:i,createValues:l,createValuesSimple:function f(v,g,y,b,_){var C=ot.createSimple(y,b,_),x=R(R({},D.getDefaultValues(e.Params)),g);return l(v,C.transform,C.locationIterator,C.theme,x)},updateValues:function d(v,g){ot.updateValues(v,g),k.updateIfChanged(v.dIgnoreLight,g.ignoreLight),k.updateIfChanged(v.dXrayShaded,"inverted"===g.xrayShaded?"inverted":!0===g.xrayShaded?"on":"off"),kte(Rte(g.controlPoints),v.tTransferTex),k.updateIfChanged(v.uMaxSteps,s(v.uGridDim.ref.value,g.stepsPerCell)),k.updateIfChanged(v.uStepScale,u(v.uCellDim.ref.value,g.stepsPerCell)),k.updateIfChanged(v.uTransferScale,c(g.stepsPerCell)),k.updateIfChanged(v.uJumpLength,g.jumpLength)},updateBoundingSphere:function p(v,g){var y=De.clone(g.boundingSphere),b=fo(y,v.aTransform.ref.value,v.instanceCount.ref.value,0);De.equals(b,v.boundingSphere.ref.value)||k.update(v.boundingSphere,b),De.equals(y,v.invariantBoundingSphere.ref.value)||(k.update(v.invariantBoundingSphere,y),k.update(v.uInvariantBoundingSphere,pr.fromSphere(v.uInvariantBoundingSphere.ref.value,y)))},createRenderableState:function h(v){var g=ot.createRenderableState(v);return g.opaque=!1,g.writeDepth=!1,g},updateRenderableState:function m(v,g){ot.updateRenderableState(v,g),v.opaque=!1,v.writeDepth=!1},createPositionIterator:function o(v,g){var y=v.transform.ref.value,b=v.gridDimension.ref.value,C=b[1],x=b[2],A=b[0]*C*x,T=g.instanceCount.ref.value,w=ym(),E=w.position,I=g.aTransform.ref.value;return Ln(A,T,1,function(O,F){var j=Math.floor(O/x);return E[0]=Math.floor(j/C),E[1]=j%C,E[2]=O%x,S.transformMat4(E,E,y),F>=0&&S.transformMat4Offset(E,E,I,0,0,16*F),w})}}}(bc||(bc={})),function(e){function t(h,m,v,g){return g?function i(h,m,v,g){return g.sphereCount=v,k.update(g.centerBuffer,h),k.update(g.groupBuffer,m),g.shaderData.update(),g}(h,m,v,g):function a(h,m,v){var y,g=De(),b=-1,_=-1,C=k.create(Di(1,4,Float32Array)),x=k.create(Fe.create(0,0)),A={kind:"spheres",sphereCount:v,centerBuffer:k.create(h),groupBuffer:k.create(m),get boundingSphere(){var T=n(A);if(T!==b){var w=Ip(A.centerBuffer.ref.value,4*A.sphereCount,4);De.copy(g,w),b=T}return g},get groupMapping(){return A.groupBuffer.ref.version!==_&&(y=cb(A.groupBuffer.ref.value,A.sphereCount,4),_=A.groupBuffer.ref.version),y},setBoundingSphere:function(T){De.copy(g,T),b=n(A)},shaderData:{positionGroup:C,texDim:x,update:function(){var T=Di(A.sphereCount,4,Float32Array,C.ref.value.array);(function o(h,m,v,g){for(var y=h.array,b=0;b=re.ref.value.length)Ce.updateSubData(re.ref.value,0,Ce.length);else{Ce.destroy();var ze=n[pe];Q[ae][1]=l.attribute(re.ref.value,ze.itemSize,ze.divisor),Z.attributes=!0}M[pe]=re.ref.version}}if(W&&a.elements.ref.version!==M.elements&&(W.length>=a.elements.ref.value.length?W.updateSubData(a.elements.ref.value,0,W.length):(W.destroy(),W=l.elements(a.elements.ref.value),Z.elements=!0),M.elements=a.elements.ref.version),Z.attributes||Z.defines||Z.elements)for(var J=0,ye=o;Jo&&(o=c)}var l=De.create(t,o);return De.setExtrema(l,r),l}(b.cornerBuffer.ref.value);De.copy(m,C),v=_}return m}};return b}(d,p,h)}function i(d){return t(Di(0,4,Uint8Array),d?d.cornerBuffer.ref.value:new Float32Array(24),Di(0,4,Uint8Array),d)}function o(d,p,h,m,v){var g=h.instanceCount,y=h.groupCount,_=gc(h,e.Utils.createPositionIterator(d,p),m.color),C=v.instanceGranularity?Va(g,"instance"):Va(g*y,"groupInstance"),x=Mp(),A=Rp(),T=Op(),w=kp(),E={drawCount:Ute.length,vertexCount:VB.length/3,groupCount:y,instanceCount:g},I=De.clone(d.boundingSphere),M=fo(I,p.aTransform.ref.value,g,0);return R(R(R(R(R(R(R(R(R({dGeometryType:k.create("image")},_),C),x),A),T),w),p),ot.createValues(v,E)),{aPosition:d.cornerBuffer,aUv:k.create(RGe),elements:k.create(Ute),aGroup:k.create(oc(new Float32Array(4))),boundingSphere:k.create(M),invariantBoundingSphere:k.create(I),uInvariantBoundingSphere:k.create(pr.ofSphere(I)),dInterpolation:k.create(v.interpolation),uImageTexDim:d.imageTextureDim,tImageTex:d.imageTexture,tGroupTex:d.groupTexture})}e.create=t,e.createEmpty=i,e.Params=R(R({},ot.Params),{interpolation:D.Select("bspline",D.objectToOptions(Vte))}),e.Utils={Params:e.Params,createEmpty:i,createValues:o,createValuesSimple:function s(d,p,h,m,v){var g=ot.createSimple(h,m,v),y=R(R({},D.getDefaultValues(e.Params)),p);return o(d,g.transform,g.locationIterator,g.theme,y)},updateValues:function u(d,p){ot.updateValues(d,p),k.updateIfChanged(d.dInterpolation,p.interpolation)},updateBoundingSphere:function c(d,p){var h=De.clone(p.boundingSphere),m=fo(h,d.aTransform.ref.value,d.instanceCount.ref.value,0);De.equals(m,d.boundingSphere.ref.value)||k.update(d.boundingSphere,m),De.equals(h,d.invariantBoundingSphere.ref.value)||(k.update(d.invariantBoundingSphere,h),k.update(d.uInvariantBoundingSphere,pr.fromSphere(d.uInvariantBoundingSphere.ref.value,h)))},createRenderableState:function l(d){var p=ot.createRenderableState(d);return p.opaque=!1,p},updateRenderableState:function f(d,p){ot.updateRenderableState(d,p),d.opaque=!1},createPositionIterator:function(){return Ln(1,1,1,function(){return vc})}}}(Wp||(Wp={})),function(e){function t(h,m,v,g,y,b,_,C,x){return x?function i(h,m,v,g,y,b,_,C,x){return C>x.cylinderCount&&(k.update(x.mappingBuffer,h),k.update(x.indexBuffer,m)),x.cylinderCount=C,k.update(x.groupBuffer,v),k.update(x.startBuffer,g),k.update(x.endBuffer,y),k.update(x.scaleBuffer,b),k.update(x.capBuffer,_),x}(h,m,v,g,y,b,_,C,x):function a(h,m,v,g,y,b,_,C){var A,x=De(),T=-1,w=-1,E={kind:"cylinders",cylinderCount:C,mappingBuffer:k.create(h),indexBuffer:k.create(m),groupBuffer:k.create(v),startBuffer:k.create(g),endBuffer:k.create(y),scaleBuffer:k.create(b),capBuffer:k.create(_),get boundingSphere(){var I=n(E);if(I!==T){var M=Ip(E.startBuffer.ref.value,6*E.cylinderCount,6),O=Ip(E.endBuffer.ref.value,6*E.cylinderCount,6);De.expandBySphere(x,M,O),T=I}return x},get groupMapping(){return E.groupBuffer.ref.version!==w&&(A=cb(E.groupBuffer.ref.value,E.cylinderCount,6),w=E.groupBuffer.ref.version),A},setBoundingSphere:function(I){De.copy(x,I),T=n(E)}};return E}(h,m,v,g,y,b,_,C)}function r(h){return t(h?h.mappingBuffer.ref.value:new Float32Array(0),h?h.indexBuffer.ref.value:new Uint32Array(0),h?h.groupBuffer.ref.value:new Float32Array(0),h?h.startBuffer.ref.value:new Float32Array(0),h?h.endBuffer.ref.value:new Float32Array(0),h?h.scaleBuffer.ref.value:new Float32Array(0),h?h.capBuffer.ref.value:new Float32Array(0),0,h)}function n(h){return Ss([h.cylinderCount,h.mappingBuffer.ref.version,h.indexBuffer.ref.version,h.groupBuffer.ref.version,h.startBuffer.ref.version,h.endBuffer.ref.version,h.scaleBuffer.ref.version,h.capBuffer.ref.version])}function s(h,m){var v=6*h.cylinderCount,g=m.instanceCount.ref.value,y=ym(),b=y.position,_=h.startBuffer.ref.value,C=h.endBuffer.ref.value,x=m.aTransform.ref.value;return Ln(v,g,2,function(T,w){var E=T%6==0?_:C;return w<0?S.fromArray(b,E,3*T):S.transformMat4Offset(b,E,x,0,3*T,16*w),y})}function u(h,m,v,g,y){var b=v.instanceCount,_=v.groupCount,x=gc(v,s(h,m),g.color),A=Np(v,g.size),T=y.instanceGranularity?Va(b,"instance"):Va(b*_,"groupInstance"),w=Mp(),E=Rp(),I=Op(),M=kp(),O={drawCount:4*h.cylinderCount*3,vertexCount:6*h.cylinderCount,groupCount:_,instanceCount:b},F=QS(A)*y.sizeFactor,j=De.clone(h.boundingSphere),N=fo(j,m.aTransform.ref.value,b,0);return R(R(R(R(R(R(R(R(R(R(R({dGeometryType:k.create("cylinders"),aMapping:h.mappingBuffer,aGroup:h.groupBuffer,aStart:h.startBuffer,aEnd:h.endBuffer,aScale:h.scaleBuffer,aCap:h.capBuffer,elements:h.indexBuffer,boundingSphere:k.create(N),invariantBoundingSphere:k.create(j),uInvariantBoundingSphere:k.create(pr.ofSphere(j))},x),A),T),w),E),I),M),m),{padding:k.create(F)}),ot.createValues(y,O)),{uSizeFactor:k.create(y.sizeFactor*y.sizeAspectRatio),uDoubleSided:k.create(y.doubleSided),dIgnoreLight:k.create(y.ignoreLight),dXrayShaded:k.create("inverted"===y.xrayShaded?"inverted":!0===y.xrayShaded?"on":"off"),dTransparentBackfaces:k.create(y.transparentBackfaces),dSolidInterior:k.create(y.solidInterior),uBumpFrequency:k.create(y.bumpFrequency),uBumpAmplitude:k.create(y.bumpAmplitude)})}function p(h,m){ot.updateRenderableState(h,m),h.opaque=h.opaque&&!m.xrayShaded,h.writeDepth=h.opaque}e.create=t,e.createEmpty=r,e.transform=function o(h,m){var v=h.startBuffer.ref.value;sg(m,v,0,6*h.cylinderCount),k.update(h.startBuffer,v);var g=h.endBuffer.ref.value;sg(m,g,0,6*h.cylinderCount),k.update(h.endBuffer,g)},e.Params=R(R({},ot.Params),{sizeFactor:D.Numeric(1,{min:0,max:10,step:.1}),sizeAspectRatio:D.Numeric(1,{min:0,max:3,step:.01}),doubleSided:D.Boolean(!1,ot.CustomQualityParamInfo),ignoreLight:D.Boolean(!1,ot.ShadingCategory),xrayShaded:D.Select(!1,[[!1,"Off"],[!0,"On"],["inverted","Inverted"]],ot.ShadingCategory),transparentBackfaces:D.Select("off",D.arrayToOptions(["off","on","opaque"]),ot.ShadingCategory),solidInterior:D.Boolean(!0,ot.ShadingCategory),bumpFrequency:D.Numeric(0,{min:0,max:10,step:.1},ot.ShadingCategory),bumpAmplitude:D.Numeric(1,{min:0,max:5,step:.1},ot.ShadingCategory)}),e.Utils={Params:e.Params,createEmpty:r,createValues:u,createValuesSimple:function c(h,m,v,g,y){var b=ot.createSimple(v,g,y),_=R(R({},D.getDefaultValues(e.Params)),m);return u(h,b.transform,b.locationIterator,b.theme,_)},updateValues:function l(h,m){ot.updateValues(h,m),k.updateIfChanged(h.uSizeFactor,m.sizeFactor*m.sizeAspectRatio),k.updateIfChanged(h.uDoubleSided,m.doubleSided),k.updateIfChanged(h.dIgnoreLight,m.ignoreLight),k.updateIfChanged(h.dXrayShaded,"inverted"===m.xrayShaded?"inverted":!0===m.xrayShaded?"on":"off"),k.updateIfChanged(h.dTransparentBackfaces,m.transparentBackfaces),k.updateIfChanged(h.dSolidInterior,m.solidInterior),k.updateIfChanged(h.uBumpFrequency,m.bumpFrequency),k.updateIfChanged(h.uBumpAmplitude,m.bumpAmplitude)},updateBoundingSphere:function f(h,m){var v=De.clone(m.boundingSphere),g=fo(v,h.aTransform.ref.value,h.instanceCount.ref.value,0);De.equals(g,h.boundingSphere.ref.value)||k.update(h.boundingSphere,g),De.equals(v,h.invariantBoundingSphere.ref.value)||(k.update(h.invariantBoundingSphere,v),k.update(h.uInvariantBoundingSphere,pr.fromSphere(h.uInvariantBoundingSphere.ref.value,v)))},createRenderableState:function d(h){var m=ot.createRenderableState(h);return p(m,h),m},updateRenderableState:p,createPositionIterator:s}}(lu||(lu={})),function(e){function t(o){switch(o.kind){case"mesh":return 3*o.triangleCount;case"points":return o.pointCount;case"spheres":return 2*o.sphereCount*3;case"cylinders":return 4*o.cylinderCount*3;case"text":return 2*o.charCount*3;case"lines":return 2*o.lineCount*3;case"direct-volume":return 36;case"image":return 6;case"texture-mesh":return o.vertexCount}}e.getDrawCount=t,e.getVertexCount=function r(o){switch(o.kind){case"mesh":case"texture-mesh":return o.vertexCount;case"points":return o.pointCount;case"spheres":return 6*o.sphereCount;case"cylinders":return 6*o.cylinderCount;case"text":return 4*o.charCount;case"lines":return 4*o.lineCount;case"direct-volume":var s=o.gridDimension.ref.value;return s[0]*s[1]*s[2];case"image":return 4}},e.getGroupCount=function n(o){switch(o.kind){case"mesh":case"points":case"spheres":case"cylinders":case"text":case"lines":return 0===t(o)?0:Gf(o.groupBuffer.ref.value)+1;case"direct-volume":return 1;case"image":return Gf(o.groupTexture.ref.value.array)+1;case"texture-mesh":return o.groupCount}},e.getUtils=function a(o){switch(o.kind){case"mesh":return Ut.Utils;case"points":return _m.Utils;case"spheres":return ll.Utils;case"cylinders":return lu.Utils;case"text":return yc.Utils;case"lines":return la.Utils;case"direct-volume":return bc.Utils;case"image":return Wp.Utils;case"texture-mesh":return Es.Utils}},e.getGranularity=function i(o,s){return"instance"===s&&o.nonInstanceable?"group":s}}(Ki||(Ki={}));var zte={};function HB(e,t){return{factory:HB,granularity:"groupInstance",size:function(r){return os.isLocation(r)?r.shape.getSize(r.group,r.instance):1},props:t,description:"Assigns sizes as defined by the shape object."}}var LGe={name:"shape-group",label:"Shape Group",category:"",factory:HB,getParams:function BGe(e){return zte},defaultValues:D.getDefaultValues(zte),isApplicable:function(e){return!!e.shape}},UGe=ft(13421772),Gte={};function jB(e,t){return{factory:jB,granularity:"groupInstance",color:function(r){return os.isLocation(r)?r.shape.getColor(r.group,r.instance):UGe},props:t,description:"Assigns colors as defined by the shape object."}}var Xr,os,GGe={name:"shape-group",label:"Shape Group",category:ta.Misc,factory:jB,getParams:function zGe(e){return Gte},defaultValues:D.getDefaultValues(Gte),isApplicable:function(e){return!!e.shape}},HGe=R(R({},Hp),{aPosition:Mn("float32",3,0),elements:gb("uint32"),uBboxMin:Te("v3"),uBboxMax:Te("v3"),uBboxSize:Te("v3"),uMaxSteps:Te("i"),uStepScale:Te("f"),uJumpLength:Te("f"),uTransform:Te("m4"),uGridDim:Te("v3"),tTransferTex:Xt("image-uint8","alpha","ubyte","linear"),uTransferScale:Te("f","material"),dGridTexType:Vt("string",["2d","3d"]),uGridTexDim:Te("v3"),tGridTex:Xt("texture","rgba","ubyte","linear"),uGridStats:Te("v4"),uCellDim:Te("v3"),uCartnToUnit:Te("m4"),uUnitToCartn:Te("m4"),dPackedGroup:Vt("boolean"),dAxisOrder:Vt("string",["012","021","102","120","201","210"]),dIgnoreLight:Vt("boolean"),dXrayShaded:Vt("string",["off","on","inverted"])}),qGe=R(R({},Hp),{aGroup:Mn("float32",1,0),aPosition:Mn("float32",3,0),aNormal:Mn("float32",3,0),elements:gb("uint32"),dVaryingGroup:Vt("boolean"),dFlatShaded:Vt("boolean"),uDoubleSided:Te("b","material"),dFlipSided:Vt("boolean"),dIgnoreLight:Vt("boolean"),dXrayShaded:Vt("string",["off","on","inverted"]),dTransparentBackfaces:Vt("string",["off","on","opaque"]),uBumpFrequency:Te("f","material"),uBumpAmplitude:Te("f","material"),meta:ha("unknown")}),YGe=R(R(R({},Hp),JS),{aGroup:Mn("float32",1,0),aPosition:Mn("float32",3,0),dPointSizeAttenuation:Vt("boolean"),dPointStyle:Vt("string",["square","circle","fuzzy"])}),KGe=R(R(R({},Hp),JS),{aGroup:Mn("float32",1,0),aMapping:Mn("float32",2,0),aStart:Mn("float32",3,0),aEnd:Mn("float32",3,0),elements:gb("uint32"),dLineSizeAttenuation:Vt("boolean"),uDoubleSided:Te("b","material"),dFlipSided:Vt("boolean")}),QGe=R(R(R({},Hp),JS),{uTexDim:Te("v2"),tPositionGroup:Xt("image-float32","rgba","float","nearest"),padding:ha("number"),uDoubleSided:Te("b","material"),dIgnoreLight:Vt("boolean"),dXrayShaded:Vt("string",["off","on","inverted"]),dTransparentBackfaces:Vt("string",["off","on","opaque"]),dSolidInterior:Vt("boolean"),dClipPrimitive:Vt("boolean"),dApproximate:Vt("boolean"),uAlphaThickness:Te("f"),uBumpFrequency:Te("f","material"),uBumpAmplitude:Te("f","material"),centerBuffer:ha("float32"),groupBuffer:ha("float32")}),JGe=R(R(R({},Hp),JS),{aGroup:Mn("float32",1,0),aPosition:Mn("float32",3,0),aMapping:Mn("float32",2,0),aDepth:Mn("float32",1,0),elements:gb("uint32"),aTexCoord:Mn("float32",2,0),tFont:Xt("image-uint8","alpha","ubyte","linear"),padding:ha("number"),uBorderWidth:Te("f","material"),uBorderColor:Te("v3","material"),uOffsetX:Te("f","material"),uOffsetY:Te("f","material"),uOffsetZ:Te("f","material"),uBackgroundColor:Te("v3","material"),uBackgroundOpacity:Te("f","material")}),t9e=R(R({},Hp),{uGeoTexDim:Te("v2","buffered"),tPosition:Xt("texture","rgb","float","nearest"),tGroup:Xt("texture","alpha","float","nearest"),tNormal:Xt("texture","rgb","float","nearest"),dVaryingGroup:Vt("boolean"),dFlatShaded:Vt("boolean"),uDoubleSided:Te("b","material"),dFlipSided:Vt("boolean"),dIgnoreLight:Vt("boolean"),dXrayShaded:Vt("string",["off","on","inverted"]),dTransparentBackfaces:Vt("string",["off","on","opaque"]),uBumpFrequency:Te("f","material"),uBumpAmplitude:Te("f","material"),meta:ha("unknown")}),n9e=R(R({},Hp),{aGroup:Mn("float32",1,0),aPosition:Mn("float32",3,0),aUv:Mn("float32",2,0),elements:gb("uint32"),uImageTexDim:Te("v2"),tImageTex:Xt("image-uint8","rgba","ubyte","nearest"),tGroupTex:Xt("image-uint8","rgba","ubyte","nearest"),dInterpolation:Vt("string",kGe)}),i9e=R(R(R({},Hp),JS),{aGroup:Mn("float32",1,0),aStart:Mn("float32",3,0),aEnd:Mn("float32",3,0),aMapping:Mn("float32",3,0),aScale:Mn("float32",1,0),aCap:Mn("float32",1,0),elements:gb("uint32"),padding:ha("number"),uDoubleSided:Te("b","material"),dIgnoreLight:Vt("boolean"),dXrayShaded:Vt("string",["off","on","inverted"]),dTransparentBackfaces:Vt("string",["off","on","opaque"]),dSolidInterior:Vt("boolean"),uBumpFrequency:Te("f","material"),uBumpAmplitude:Te("f","material")}),s9e=_s(0,2147483647),Yp=_s(0,2147483647);function _b(e,t,r,n){return{id:s9e(),type:e,values:t,state:r,materialId:n}}function Hte(e){var t=e&&e.getElement("vertex"),r=e&&e.getElement("material"),n={group:"",vRed:"",vGreen:"",vBlue:"",mRed:"",mGreen:"",mBlue:""},a=[["",""]],i=[["",""]];if(t){for(var o=0,s=t.propertyNames.length;o=16*l.length?f.aTransform.ref.value:new Float32Array(16*l.length),p=0,h=l.length;p=1?(n.ISTART-1)*a.value:0,a.unit),o=[],s=0,u=e.frames.length;s=-1&&f[1]<=1&&f[3]>=-1&&f[3]<=1&&f[4]>=-1&&f[4]<=1?Kp.create(S.create(f[0],f[2],f[5]),S.create(Zr(90-90*Math.asin(f[1])/A_),Zr(90-90*Math.asin(f[3])/A_),Zr(90-90*Math.asin(f[4])/A_))):f[0]<0||f[1]<0||f[2]<0||f[3]<0||f[4]<0||f[5]<0||f[3]>180||f[4]>180||f[5]>180?Kp.fromBasis(S.create(f[0],f[1],f[3]),S.create(f[1],f[2],f[4]),S.create(f[3],f[4],f[5])):Kp.create(S.create(f[0],f[2],f[5]),S.create(Zr(oa(f[1],0,gn)?90:f[1]),Zr(oa(f[3],0,gn)?90:f[3]),Zr(oa(f[4],0,gn)?90:f[4])))),o.push(l);return[2,Iv.create(o,a,i)]}})})})}function oE(e,t,r,n){for(var a=r,i=n-1,o=t.charCodeAt(a);(32===o||o>=48&&o<=57)&&a<=i;)o=t.charCodeAt(++a);for(o=t.charCodeAt(i);(32===o||o>=48&&o<=57)&&i>=a;)o=t.charCodeAt(--i);if(a===++i||a+1===i)return Ke.add(e,a,i);if(o=t.charCodeAt(a),a+2===i){var s=t.charCodeAt(a+1);if(!((78!==o&&110!==o||65!==s&&97!==s)&&(67!==o&&99!==o||76!==s&&108!==s)&&(70!==o&&102!==o||69!==s&&101!==s)&&(83!==o&&115!==o||73!==s&&105!==s)&&(66!==o&&98!==o||82!==s&&114!==s)&&(65!==o&&97!==o||83!==s&&115!==s)))return Ke.add(e,a,a+2)}if(67===o||99===o||72===o||104===o||78===o||110===o||79===o||111===o||80===o||112===o||83===o||115===o)return Ke.add(e,a,a+1);Ke.add(e,a,a)}!function(e){function t(a,i){return{size:a,anglesInRadians:i}}function r(){return t(S(),S())}e.create=t,e.empty=r,e.fromBasis=function n(a,i,o){var s=S.magnitude(a),u=S.magnitude(i),c=S.magnitude(o),l=Math.acos(S.dot(i,o)/(u*c)),f=Math.acos(S.dot(a,o)/(s*c)),d=Math.acos(S.dot(a,i)/(s*u));return s<=0||u<=0||c<=0||l>=Math.PI||f>=Math.PI||d>=Math.PI?r():t(S.create(s,u,c),S.create(l,f,d))}}(Kp||(Kp={}));var g9e=new Set(["NA","CL","FE","SI","BR","AS","LI"]),y9e=new Set(["C","H","N","O","P","S","F","B"]),b9e=/^[\s\d]+|[\s\d]+$/g;function Sb(e,t){var r=(e=e.replace(b9e,"").toUpperCase()).length;if(0===r||1===r||g9e.has(e))return e;if(3===r&&t===e){if("SOD"===e)return"NA";if("POT"===e)return"K";if("CES"===e)return"CS";if("CAL"===e)return"CA";if("CLA"===e)return"CL"}return y9e.has(e[0])?e[0]:""}var WB,qB="ABCDEFGHIJKLMNOPQRSTUVWXYZ",eC=$Q(function _9e(e){for(var r=e,n=0,a=qB[r%26];r>=26;)r=Math.floor(r/26),a+=qB[r%26],n+=1;return n>=5&&console.warn("getChainId overflow"),a});function C9e(e){var t=this;return Ve.create("Parse GRO",function(r){return ce(t,void 0,void 0,function(){var n,a,i,o,s,u;return le(this,function(c){switch(c.label){case 0:n=WB.fromGro(e),a=[],i=0,o=e.structures.length,c.label=1;case 1:return i=66?Ke.addToken(e.B_iso_or_equiv,lt.trim(r,n+60,n+66)):Ke.add(e.B_iso_or_equiv,0,0),i&&Ke.addToken(e.partial_charge,lt.trim(r,n+70,n+76)),s>=78&&!i?(lt.trim(r,n+76,n+78),r.tokenStart=78?(lt.trim(r,n+76,n+78),r.tokenStartO||void 0===E[O]&&(u.push("covale".concat(A)),c.push("covale"),l.push(n.label_asym_id.str(w)),f.push(n.label_seq_id.int(w)),d.push(n.auth_seq_id.int(w)),p.push(n.label_atom_id.str(w)),h.push(n.label_alt_id.str(w)),m.push(n.pdbx_PDB_ins_code.str(w)),v.push(n.label_asym_id.str(O)),g.push(n.label_seq_id.int(O)),y.push(n.auth_seq_id.int(O)),b.push(n.label_atom_id.str(O)),_.push(n.label_alt_id.str(O)),C.push(n.pdbx_PDB_ins_code.str(O)),A+=1))}}}var j,F={id:ht.ofStrings(u),conn_type_id:ht.ofStrings(c),ptnr1_label_asym_id:ht.ofStrings(l),ptnr1_label_seq_id:ht.ofNumbers(f),ptnr1_auth_seq_id:ht.ofNumbers(d),ptnr1_label_atom_id:ht.ofStrings(p),pdbx_ptnr1_label_alt_id:ht.ofStrings(h),pdbx_ptnr1_PDB_ins_code:ht.ofStrings(m),ptnr2_label_asym_id:ht.ofStrings(v),ptnr2_label_seq_id:ht.ofNumbers(g),ptnr2_auth_seq_id:ht.ofNumbers(y),ptnr2_label_atom_id:ht.ofStrings(b),pdbx_ptnr2_label_alt_id:ht.ofStrings(_),pdbx_ptnr2_PDB_ins_code:ht.ofStrings(C)};return oo.ofFields("struct_conn",F)}(t,v[0],v[1],U)),Q={entity:oo.ofTable("entity",f.getEntityTable()),chem_comp:oo.ofTable("chem_comp",F.getChemCompTable()),atom_site:oo.ofFields("atom_site",U),atom_site_anisotrop:oo.ofFields("atom_site_anisotrop",N9e(l))},W=0,K=d;W"),tt(_e.core.rel.gre,"gre",">="),tt(_e.core.rel.inRange,"in-range"),tt(_e.core.str.concat,"concat"),tt(_e.core.str.match,"regex.match"),tt(_e.core.list.getAt,"list.get"),tt(_e.core.set.has,"set.has"),tt(_e.core.set.isSubset,"set.subset")],["Structure",["Types",tt(_e.structureQuery.type.entityType,"ent-type"),tt(_e.structureQuery.type.authResidueId,"auth-resid"),tt(_e.structureQuery.type.labelResidueId,"label-resid"),tt(_e.structureQuery.type.ringFingerprint,"ringfp"),tt(_e.structureQuery.type.bondFlags,"bond-flags")],["Slots",tt(_e.structureQuery.slot.elementSetReduce,"atom.set.reduce.value")],["Generators",tt(_e.structureQuery.generator.atomGroups,"sel.atom.atom-groups"),tt(_e.structureQuery.generator.queryInSelection,"sel.atom.query-in-selection"),tt(_e.structureQuery.generator.rings,"sel.atom.rings"),tt(_e.structureQuery.generator.empty,"sel.atom.empty"),tt(_e.structureQuery.generator.all,"sel.atom.all"),tt(_e.structureQuery.generator.bondedAtomicPairs,"sel.atom.bonded-pairs"),sE(L_("sel.atom.atoms",Gt.Dictionary({0:pt(Ae.Bool,{isOptional:!0,defaultValue:!0,description:"Test applied to each atom."})}),Dt.ElementSelection,"A selection of singleton atom sets."),function(e){return fe.struct.generator.atomGroups({"atom-test":KB(e,0,!0)})}),sE(L_("sel.atom.res",Gt.Dictionary({0:pt(Ae.Bool,{isOptional:!0,defaultValue:!0,description:"Test applied to the 1st atom of each residue."})}),Dt.ElementSelection,"A selection of atom sets grouped by residue."),function(e){return fe.struct.generator.atomGroups({"residue-test":KB(e,0,!0),"group-by":fe.ammp("residueKey")})}),sE(L_("sel.atom.chains",Gt.Dictionary({0:pt(Ae.Bool,{isOptional:!0,defaultValue:!0,description:"Test applied to the 1st atom of each chain."})}),Dt.ElementSelection,"A selection of atom sets grouped by chain."),function(e){return fe.struct.generator.atomGroups({"chain-test":KB(e,0,!0),"group-by":fe.ammp("chainKey")})})],["Modifiers",tt(_e.structureQuery.modifier.queryEach,"sel.atom.query-each"),tt(_e.structureQuery.modifier.intersectBy,"sel.atom.intersect-by"),tt(_e.structureQuery.modifier.exceptBy,"sel.atom.except-by"),tt(_e.structureQuery.modifier.unionBy,"sel.atom.union-by"),tt(_e.structureQuery.modifier.union,"sel.atom.union"),tt(_e.structureQuery.modifier.cluster,"sel.atom.cluster"),tt(_e.structureQuery.modifier.includeSurroundings,"sel.atom.include-surroundings"),tt(_e.structureQuery.modifier.surroundingLigands,"sel.atom.surrounding-ligands"),tt(_e.structureQuery.modifier.includeConnected,"sel.atom.include-connected"),tt(_e.structureQuery.modifier.expandProperty,"sel.atom.expand-property")],["Filters",tt(_e.structureQuery.filter.pick,"sel.atom.pick"),tt(_e.structureQuery.filter.first,"sel.atom.first"),tt(_e.structureQuery.filter.withSameAtomProperties,"sel.atom.with-same-atom-properties"),tt(_e.structureQuery.filter.intersectedBy,"sel.atom.intersected-by"),tt(_e.structureQuery.filter.within,"sel.atom.within"),tt(_e.structureQuery.filter.isConnectedTo,"sel.atom.is-connected-to")],["Combinators",tt(_e.structureQuery.combinator.intersect,"sel.atom.intersect"),tt(_e.structureQuery.combinator.merge,"sel.atom.merge"),tt(_e.structureQuery.combinator.distanceCluster,"sel.atom.dist-cluster")],["Atom Set Properties",tt(_e.structureQuery.atomSet.atomCount,"atom.set.atom-count"),tt(_e.structureQuery.atomSet.countQuery,"atom.set.count-query"),tt(_e.structureQuery.atomSet.reduce,"atom.set.reduce"),tt(_e.structureQuery.atomSet.propertySet,"atom.set.property")],["Atom Properties",tt(_e.structureQuery.atomProperty.core.elementSymbol,"atom.el"),tt(_e.structureQuery.atomProperty.core.vdw,"atom.vdw"),tt(_e.structureQuery.atomProperty.core.mass,"atom.mass"),tt(_e.structureQuery.atomProperty.core.atomicNumber,"atom.atomic-number"),tt(_e.structureQuery.atomProperty.core.x,"atom.x"),tt(_e.structureQuery.atomProperty.core.y,"atom.y"),tt(_e.structureQuery.atomProperty.core.z,"atom.z"),tt(_e.structureQuery.atomProperty.core.sourceIndex,"atom.src-index"),tt(_e.structureQuery.atomProperty.core.operatorName,"atom.op-name"),tt(_e.structureQuery.atomProperty.core.operatorKey,"atom.op-key"),tt(_e.structureQuery.atomProperty.core.modelIndex,"atom.model-index"),tt(_e.structureQuery.atomProperty.core.modelLabel,"atom.model-label"),tt(_e.structureQuery.atomProperty.core.atomKey,"atom.key"),tt(_e.structureQuery.atomProperty.core.bondCount,"atom.bond-count"),tt(_e.structureQuery.atomProperty.topology.connectedComponentKey,"atom.key.molecule"),tt(_e.structureQuery.atomProperty.macromolecular.authResidueId,"atom.auth-resid"),tt(_e.structureQuery.atomProperty.macromolecular.labelResidueId,"atom.label-resid"),tt(_e.structureQuery.atomProperty.macromolecular.residueKey,"atom.key.res"),tt(_e.structureQuery.atomProperty.macromolecular.chainKey,"atom.key.chain"),tt(_e.structureQuery.atomProperty.macromolecular.entityKey,"atom.key.entity"),tt(_e.structureQuery.atomProperty.macromolecular.isHet,"atom.is-het"),tt(_e.structureQuery.atomProperty.macromolecular.id,"atom.id"),tt(_e.structureQuery.atomProperty.macromolecular.label_atom_id,"atom.label_atom_id"),tt(_e.structureQuery.atomProperty.macromolecular.label_alt_id,"atom.label_alt_id","atom.altloc"),tt(_e.structureQuery.atomProperty.macromolecular.label_comp_id,"atom.label_comp_id"),tt(_e.structureQuery.atomProperty.macromolecular.label_asym_id,"atom.label_asym_id"),tt(_e.structureQuery.atomProperty.macromolecular.label_entity_id,"atom.label_entity_id"),tt(_e.structureQuery.atomProperty.macromolecular.label_seq_id,"atom.label_seq_id"),tt(_e.structureQuery.atomProperty.macromolecular.auth_atom_id,"atom.auth_atom_id","atom.name"),tt(_e.structureQuery.atomProperty.macromolecular.auth_comp_id,"atom.auth_comp_id","atom.resname"),tt(_e.structureQuery.atomProperty.macromolecular.auth_asym_id,"atom.auth_asym_id","atom.chain"),tt(_e.structureQuery.atomProperty.macromolecular.auth_seq_id,"atom.auth_seq_id","atom.resno"),tt(_e.structureQuery.atomProperty.macromolecular.pdbx_PDB_ins_code,"atom.pdbx_PDB_ins_code","atom.inscode"),tt(_e.structureQuery.atomProperty.macromolecular.pdbx_formal_charge,"atom.pdbx_formal_charge"),tt(_e.structureQuery.atomProperty.macromolecular.occupancy,"atom.occupancy"),tt(_e.structureQuery.atomProperty.macromolecular.B_iso_or_equiv,"atom.B_iso_or_equiv","atom.bfactor"),tt(_e.structureQuery.atomProperty.macromolecular.entityType,"atom.entity-type"),tt(_e.structureQuery.atomProperty.macromolecular.entitySubtype,"atom.entity-subtype"),tt(_e.structureQuery.atomProperty.macromolecular.entityPrdId,"atom.entity-prd-id"),tt(_e.structureQuery.atomProperty.macromolecular.entityDescription,"atom.entity-description"),tt(_e.structureQuery.atomProperty.macromolecular.objectPrimitive,"atom.object-primitive"),tt(_e.structureQuery.atomProperty.macromolecular.chemCompType,"atom.chem-comp-type"),tt(_e.structureQuery.atomProperty.macromolecular.secondaryStructureKey,"atom.key.sec-struct"),tt(_e.structureQuery.atomProperty.macromolecular.isModified,"atom.is-modified"),tt(_e.structureQuery.atomProperty.macromolecular.modifiedParentName,"atom.modified-parent")],["Bond Properties",tt(_e.structureQuery.bondProperty.order,"bond.order"),tt(_e.structureQuery.bondProperty.length,"bond.length"),tt(_e.structureQuery.bondProperty.key,"bond.key"),tt(_e.structureQuery.bondProperty.atomA,"bond.atom-a"),tt(_e.structureQuery.bondProperty.atomB,"bond.atom-b"),sE(L_("bond.is",Gt.List(Dt.BondFlag),Ae.Bool,"Test if the current bond has at least one (or all if partial = false) of the specified flags: ".concat(Ae.oneOfValues(Dt.BondFlag).join(", "))),function(e){return fe.core.flags.hasAny([fe.struct.bondProperty.flags(),fe.struct.type.bondFlags(j9e(e))])})]]],Kte=[];!function Zte(e){for(var t=0,r=e;t0?"'...":"'",i=e.length-n>12?"...'":"'";return" at line ".concat(r.line," column ").concat(r.column,", got ").concat(a).concat(e.slice(n,n+12)).concat(i)}(e,t))}(t,r);throw new Error(n)},e.prototype.or=function(t){return e.alt(this,t)},e.prototype.trim=function(t){return this.wrap(t,t)},e.prototype.wrap=function(t,r){return ZB(1,"string"==typeof t?e.string(t):t,this,"string"==typeof r?e.string(r):r)},e.prototype.thru=function(t){return t(this)},e.prototype.then=function(t){return ZB(1,this,t)},e.prototype.many=function(){var t=this;return new e(function(r,n){for(var a=[],i=void 0;;){if(!(i=fl(t._(r,n),i)).status)return fl(Is(n,a),i);if(n===i.index)throw new Error("infinite loop detected in .many() parser --- calling .many() on a parser which can accept zero characters is usually the cause");n=i.index,a.push(i.value)}})},e.prototype.times=function(t,r){var n=this,a=typeof r>"u"?t:r;return new e(function(i,o){var l,s=[],u=void 0,c=void 0;for(l=0;lt.furthest)return e;var r=e.furthest===t.furthest?function Q9e(e,t){var r=e.length,n=t.length;if(0===r)return t;if(0===n)return e;for(var a=new Set,i=[],o=0;o=0})},e.noneOf=function g(T){return m(function(w){return T.indexOf(w)<0})},e.range=function y(T,w){return m(function(E){return T<=E&&E<=w}).desc(T+"-"+w)},e.takeWhile=function b(T){return new e(function(w,E){for(var I=E;I=T.length?Zp(w,"any character"):Is(w+1,T.charAt(w))}),e.all=new e(function(T,w){return Is(T.length,T.slice(w))}),e.eof=new e(function(T,w){return w1)switch(C.charAt(0)){case".":return fe.atomName(C.substr(1));case"_":return fe.struct.type.elementSymbol([C.substr(1)])}return"true"===C||"false"!==C&&(function y(_){return/-?(0|[1-9][0-9]*)([.][0-9]+)?([eE][+-]?[0-9]+)?/.test(_)&&!isNaN(+_)}(C)?+C:so.Symbol(C));case"list":switch(_.bracket){case"[":return fe.core.type.list(g(_.nodes).map(h));case"{":return fe.core.type.set(g(_.nodes).map(h));case"(":if("comment"===_.nodes[0].kind)throw new Error("Invalid expression");var A=h(_.nodes[0]);return so.Apply(A,function m(_){if(!(_.length<=1)){if(!function v(_){for(var C=1,x=_.length;C1&&":"===A.value.charAt(0))return!0}return!1}(_)){for(var C=[],x=1,A=_.length;x1&&":"===T.value.charAt(0)){var M=T.value.substr(1);for(++x;x=A)throw new Error("There must be a value foolowed a named arg ':".concat(M,"'."));if("comment"===_[x].kind)throw new Error("Invalid expression");w[M]=h(_[x]),isNaN(+M)&&(E=!1)}else w[I++]=h(T)}if(E){var O=Object.keys(w).map(function(N){return+N}).sort(function(N,H){return N-H}),F=!0;for(x=0,A=O.length;x1?qn.core.logic.and(e):void 0}function e5(e,t){if(!t||void 0===t.op||void 0===t.val)return t&&void 0!==t.flags?qn.core.flags.hasAny([e,t.flags]):t&&void 0!==t.min&&void 0!==t.max?qn.core.rel.inRange([e,t.min,t.max]):Array.isArray(t)?t.length>1?qn.core.set.has([qn.core.type.set(t),e]):qn.core.rel.eq([e,t[0]]):qn.core.rel.eq([e,t]);var r=[e,t.val];switch(t.op){case"=":return qn.core.rel.eq(r);case"!=":return qn.core.rel.neq(r);case">":return qn.core.rel.gr(r);case"<":return qn.core.rel.lt(r);case">=":return qn.core.rel.gre(r);case"<=":return qn.core.rel.lte(r);default:throw new Error("operator '".concat(t.op,"' not supported"))}}function Sc(e){return qn.struct.generator.queryInSelection({0:e,query:qn.struct.generator.all(),"in-complement":!0})}function fd(e,t){return e.length=|<=|=|!=|>| 10"],abbr:["Z"],isNumeric:!0,regex:dl,map:function(e){return parseFloat(e)},level:"atom-test",property:gi.acp("z")},bondcount:{"@desc":"covalent bond count","@examples":["bondcount = 0"],isNumeric:!0,regex:aC,map:function(e){return parseInt(e)},level:"atom-test",property:gi.acp("bondCount")},bondingRadius:{"@desc":"radius used for auto bonding; synonymous with ionic and ionicRadius","@examples":[""],abbr:["ionic","ionicRadius"],isUnsupported:!0,regex:dl,map:function(e){return parseFloat(e)},level:"atom-test"},cell:{"@desc":'crystallographic unit cell, expressed either in lattice integer notation (111-999) or as a coordinate in ijk space, where {1 1 1} is the same as 555. ANDing two cells, for example select cell=555 and cell=556, selects the atoms on the common face. (Note: in the specifc case of CELL, only "=" is allowed as a comparator.)',"@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},configuration:{"@desc":'Only in the context {configuration=n}, this option selects the set of atoms with either no ALTLOC specified or those atoms having this index into the array of altlocs within its model. So, for example, if the model has altloc "A" and "B", select configuration=1 is equivalent to select altloc="" or altloc="A", and print {configuration=2} is equivalent to print {altloc="" or altloc="B"}. Configuration 0 is "all atoms in a model having configurations", and an invalid configuration number gives no atoms. (Note: in the specifc case of CONFIGURATION, only "=" is allowed as a comparator.)',"@examples":[""],isUnsupported:!0,regex:aC,map:function(e){return parseInt(e)},level:"atom-test"},chain:{"@desc":'protein chain. For newer CIF files allowing multicharacter chain specifications, use quotations marks: select chain="AA". For these multicharacter desigations, case is not checked unless the CIF file has lower-case chain designations.',"@examples":["chain = A",'chain = "AA"'],regex:/[a-zA-Z0-9]+/,map:Jt,level:"chain-test",property:gi.ammp("auth_asym_id")},chainNo:{"@desc":'chain number; sequentially counted from 1 for each model; chainNo == 0 means"no chain" or PDB chain identifier indicated as a blank (Jmol 14.0).',"@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},color:{"@desc":"the atom color","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},covalentRadius:{"@desc":"covalent bonding radius, synonymous with covalent. Not used by Jmol, but could be used, for example, in {*}.spacefill={*}.covalentRadius.all.","@examples":[""],abbr:["covalent"],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},cs:{"@desc":"chemical shift calculated using computational results that include magnetic shielding tensors.","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},element:{"@desc":'element symbol. The value of this parameter depends upon the context. Used with select structure=x, x can be either the quoted element symbol, "H", "He", "Li", etc. or atomic number. In all other contexts, the value is the element symbol. When the atom is a specific isotope, the string will contain the isotope number -- "13C", for example.',"@examples":["element=Fe"],regex:/[a-zA-Z]+/,map:function(e){return gi.es(e)},level:"atom-test",property:gi.acp("elementSymbol")},elemno:{"@desc":"atomic element number","@examples":["elemno=8"],regex:/[0-9\s{}-]+/,map:function(e){return parseInt(e)},level:"atom-test",property:gi.acp("atomicNumber")},eta:{"@desc":"Based on Carlos M. Duarte, Leven M. Wadley, and Anna Marie Pyle, RNA structure comparison, motif search and discovery using a reduced representation of RNA conformational space, Nucleic Acids Research, 2003, Vol. 31, No. 16 4755-4761. The parameter eta is the C4'[i-1]-P[i]-C4'[i]-P[i+1] dihedral angle; theta is the P[i]-C4'[i]-P[i+1]-C4'[i+1] dihedral angle. Both are measured on a 0-360 degree scale because they are commonly near 180 degrees. Using the commands plot PROPERTIES eta theta resno; select visible;wireframe only one can create these authors' \"RNA worm\" graph.","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},theta:{"@desc":"Based on Carlos M. Duarte, Leven M. Wadley, and Anna Marie Pyle, RNA structure comparison, motif search and discovery using a reduced representation of RNA conformational space, Nucleic Acids Research, 2003, Vol. 31, No. 16 4755-4761. The parameter eta is the C4'[i-1]-P[i]-C4'[i]-P[i+1] dihedral angle; theta is the P[i]-C4'[i]-P[i+1]-C4'[i+1] dihedral angle. Both are measured on a 0-360 degree scale because they are commonly near 180 degrees. Using the commands plot PROPERTIES eta theta resno; select visible;wireframe only one can create these authors' \"RNA worm\" graph.","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},file:{"@desc":"file number containing this atom","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},formalCharge:{"@desc":"formal charge","@examples":["formalCharge=1"],regex:dl,map:function(e){return parseFloat(e)},level:"atom-test",property:gi.ammp("pdbx_formal_charge")},format:{"@desc":"format (label) of the atom.","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},fXyz:{"@desc":"fractional XYZ coordinates","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},fX:{"@desc":"fractional X coordinate","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},fY:{"@desc":"fractional Y coordinate","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},fZ:{"@desc":"fractional Z coordinate","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},fuxyz:{"@desc":"fractional XYZ coordinates in the unitcell coordinate system","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},fux:{"@desc":"fractional X coordinate in the unitcell coordinate system","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},fuy:{"@desc":"fractional Y coordinate in the unitcell coordinate system","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},fuz:{"@desc":"fractional Z coordinate in the unit cell coordinate system","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},group:{"@desc":"3-letter residue code","@examples":["group = ALA"],regex:/[a-zA-Z0-9]{1,3}/,map:Jt,level:"residue-test",property:gi.ammp("label_comp_id")},group1:{"@desc":"single-letter residue code (amino acids only)","@examples":["group1 = G"],regex:/[a-zA-Z]/,map:Jt,level:"residue-test",property:gi.ammp("label_comp_id")},groupID:{"@desc":"group ID number: A unique ID for each amino acid or nucleic acid residue in a PDB file. 0 noGroup 1-5 ALA, ARG, ASN, ASP, CYS 6-10 GLN, GLU, GLY, HIS, ILE 11-15 LEU, LYS, MET, PHE, PRO 16-20 SER, THR, TRP, TYR, VAL 21-23 ASX, GLX, UNK 24-29 A, +A, G, +G, I, +I 30-35 C, +C, T, +T, U, +U Additional unique numbers are assigned arbitrarily by Jmol and cannot be used reproducibly.","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},groupindex:{"@desc":"overall group index","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},hydrophobicity:{"@desc":"Aminoacid residue scale of hydrophobicity based on Rose, G. D., Geselowitz, A. R., Lesser, G. J., Lee, R. H., and Zehfus, M. H. (1985). Hydrophobicity of amino acid residues in globular proteins, Science, 229(4716):834-838.","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},identify:{"@desc":"for a PDB/mmCIF file, a label such as [ILE]7^1:A.CD1%A/3 #47, which includes the group ([ILE]), residue number with optional insertion code (7^1), chain (:A), atom name (CD1), alternate location if present (%A), PDB model number (/3, for NMR models when one file is loaded; /file.model such as /2.3 if more than one file is loaded), and atom number (#47). For non-PDB data, the information is shorter -- for example, H15/2.1 #6, indicating atom name (H15), full file.model number (/2.1), and atom number (#6). If only a single model is loaded, %[identify] does not include the model number.","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},insertion:{"@desc":"protein residue insertion code","@examples":["insertion=A"],regex:/[a-zA-Z0-9]/,map:Jt,level:"atom-test",property:gi.ammp("pdbx_PDB_ins_code")},label:{"@desc":"current atom label (same as format)","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},mass:{"@desc":"atomic mass -- especially useful with appended .max or .sum","@examples":["mass > 13"],regex:dl,map:function(e){return parseFloat(e)},level:"atom-test",property:gi.acp("mass")},model:{"@desc":"model number","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},modelindex:{"@desc":"a unique number for each model, starting with 0 and spanning all models in all files","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},modO:{"@desc":"currently calculated occupancy from modulation (0 to 100; NaN if atom has no occupancy modulation)","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},modXYZ:{"@desc":"currently calculated displacement modulation (for incommensurately modulated structures). Also modX, modY, modZ for individual components. For atoms without modultion, {xx}.modXYZ is -1 and {xx}.modX is NaN, and in a label %[modXYZ] and %[modX] are blank.","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},molecule:{"@desc":"molecule number","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},monomer:{"@desc":"monomer number (group number) in a polymer (usually a chain), starting with 1, or 0 if not part of a biopolymer -- that is, not a connected carbohydrate, amino acid, or nucleic acid (Jmol 14.3.15)","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},ms:{"@desc":"magnetic shielding calculated from file-loaded tensors.","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},occupancy:{"@desc":'CIF file site occupancy. In SELECT command comparisons ("select occupancy < 90"), an integer n implies measurement on a 0-100 scale; also, in the context %[occupancy] or %q for a label, the reported number is a percentage. In all other cases, such as when %Q is used in a label or when a decimal number is used in a comparison, the scale is 0.0 - 1.0.',"@examples":["occupancy < 1"],regex:dl,map:function(e){return parseFloat(e)},level:"atom-test",property:gi.ammp("occupancy")},partialCharge:{"@desc":"partial charge","@examples":[""],isUnsupported:!0,regex:dl,map:function(e){return parseFloat(e)},level:"atom-test"},phi:{"@desc":"protein group PHI angle for atom's residue","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},polymer:{"@desc":"sequential polymer number in a model, starting with 1.","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},polymerLength:{"@desc":"polymer length","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},property_xx:{"@desc":"a property created using the DATA command","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},psi:{"@desc":"protein group PSI angle for the atom's residue","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},radius:{"@desc":'currently displayed radius -- In SELECT command comparisons ("select radius=n"), integer n implies Rasmol units 1/250 Angstroms; in all other cases or when a decimal number is used, the units are Angstroms.',"@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},resno:{"@desc":"PDB residue number, not including insertion code (see also seqcode, below)","@examples":["resno = 100"],regex:/-?[0-9]+/,map:function(e){return parseInt(e)},level:"residue-test",property:gi.ammp("auth_seq_id")},selected:{"@desc":"1.0 if atom is selected; 0.0 if not","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},sequence:{"@desc":'PDB one-character sequence code, as a string of characters, with "?" indicated where single-character codes are not available',"@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},seqcode:{"@desc":'PDB residue number, including insertion code (for example, 234^2; "seqcode" option added in Jmol 14.3.16)',"@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},seqid:{"@desc":"(mmCIF only) the value from _atom_site.label_seq_id; a pointer to _entity_poly_seq.num in the ENTITY_POLY_SEQ category specifying the sequence of monomers in a polymer. Allowance is made for the possibility of microheterogeneity in a sample by allowing a given sequence number to be correlated with more than one monomer id. (Jmol 14.2.3)","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},shape:{"@desc":'hybridization geometry such as "tetrahedral"',"@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},site:{"@desc":"crystallographic site number","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},spacefill:{"@desc":"currently displayed radius","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},straightness:{"@desc":'quaternion-derived straightness (second derivative of the quaternion describing the orientation of the residue. This quantity will have different values depending upon the setting of quaternionFrame as "A" (alpha-carbon/phosphorus atom only), "C" (alpha-carbon/pyrimidine or purine base based), "P" (carbonyl-carbon peptide plane/phosphorus tetrahedron based), or "N" (amide-nitrogen based). The default is alpha-carbon based, which corresponds closely to the following combination of Ramachandran angles involving three consecutive residues i-1, i, and i+1: -psii-1 - phii + psii + phii+1.',"@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},strucno:{"@desc":"a unique number for each helix, sheet, or turn in a model, starting with 1.","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},structure:{"@desc":'The value of this parameter depends upon the context. Used with select structure=x, x can be either the quoted keyword "none", "turn", "sheet", "helix", "dna", "rna", or "carbohydrate" or a respective number 0-6. In the context {*}.structure, the return value is a number; in the context label %[structure], the return is one of the six keywords.',"@examples":['structure="helix"',"structure=3"],regex:/none|turn|sheet|helix|dna|rna|carbohydrate|[0-6]/i,map:Jt,level:"residue-test",property:"structure"},substructure:{"@desc":'like structure, the value of this parameter depends upon the context. Used with select substructure=x, x can be either the quoted keyword "none", "turn", "sheet", "helix", "dna", "rna", "carbohydrate", "helix310", "helixalpha", or "helixpi", or the respective number 0-9. In the context {*}.substructure, the return value is a number; in the context label %[substructure], the return is one of the nine keywords.',"@examples":['substructure = "alphahelix"',"substructure =9"],regex:/none|turn|sheet|helix|dna|rna|carbohydrate|helix310|helixalpha|helixpi|[0-9]/i,map:Jt,level:"residue-test",property:"structure"},surfacedistance:{"@desc":"A value related to the distance of an atom to a nominal molecular surface. 0 indicates at the surface. Positive numbers are minimum distances in Angstroms from the given atom to the surface.","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},symop:{"@desc":'the first symmetry operation code that generated this atom by Jmol; an integer starting with 1. See also symmetry, below. This operator is only present if the file contains space group information and the file was loaded using the {i, j, k} option so as to generate symmetry-based atoms. To select only the original atoms prior to application of symmetry, you can either use "SYMOP=n", where n is the symmetry operator corresponding to "x,y,z", or you can specify instead simply "NOT symmetry" the way you might specify "NOT hydrogen". Note that atoms in special positions will have multiple operator matches. These atoms can be selected using the keyword SPECIALPOSITION. The special form select SYMOP=nijk selects a specific translation of atoms from the given crystallographic symmetry operation. Comparators <, <=, >, >=, and != can be used and only apply to the ijk part of the designation. The ijk are relative, not absolute. Thus, symop=2555 selects for atoms that have been transformed by symop=2 but not subjected to any further translation. select symop=1555 is identical to select not symmetry. All other ijk are relative to these selections for 555. If the model was loaded using load "filename.cif" {444 666 1}, where the 1 indicates that all symmetry-generated atoms are to be packed within cell 555 and then translated to fill the other 26 specified cells, then select symop=3555 is nearly the same as select symop=3 and cell=555. (The difference being that cell=555 selects for all atoms that are on any edge of the cell, while symop=3555 does not.) However, the situation is different if instead the model was loaded using load "filename.cif" {444 666 0}, where the 0 indicates that symmetry-generated atoms are to be placed exactly where their symmetry operator would put them (x,-y,z being different then from x, 1-y, z). In that case, select symop=3555 is for all atoms that have been generated using symmetry operation 3 but have not had any additional translations applied to the x,y,z expression found in the CIF file. If, for example, symmetry operation 3 is -x,-y,-z, then load "filename.cif" {444 666 0} will place an atom originally at {1/2, 1/2, 1/2} at positions {-1/2, -1/2, -1/2} (symop=3555) and {-3/2, -3/2, -3/2} (symop=3444) and 24 other sites.',"@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},symmetry:{"@desc":'as "symmetry" or in a label as lower-case "o" gives list of crystallographic symmetry operators generating this atom with lattice designations,such as 3555; upper-case "%O" in a label gives a list without the lattice designations. See also symop, above.',"@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},temperature:{"@desc":"yes yes temperature factor (B-factor)","@examples":["temperature >= 20"],regex:dl,map:function(e){return parseFloat(e)},level:"atom-test",property:gi.ammp("B_iso_or_equiv")},unitXyz:{"@desc":"unit cell XYZ coordinates","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},uX:{"@desc":"unit cell X coordinate normalized to [0,1)","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},uY:{"@desc":"unit cell Y coordinate normalized to [0,1)","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},uZ:{"@desc":"unit cell Z coordinate normalized to [0,1)","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},valence:{"@desc":"the valence of an atom (sum of bonds, where double bond counts as 2 and triple bond counts as 3","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},vanderwaals:{"@desc":"van der Waals radius","@examples":["vanderwaals >2"],regex:dl,map:function(e){return parseFloat(e)},level:"atom-test",property:gi.acp("vdw")},vectorScale:{"@desc":"vibration vector scale","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},volume:{"@desc":"approximate van der Waals volume for this atom. Note, {*}.volume gives an average; use {*}.volume.sum to get total volume.","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},vXyz:{"@desc":"vibration vector, or individual components as %vx %vy %vz. For atoms without vibration vectors, {xx}.vXyz is -1; in a label, %[vxyz] is blank.","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},vX:{"@desc":"vibration vector X coordinate; for atoms without vibration vector, {xx}.vX is NaN (same for vY and vZ)","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},vY:{"@desc":"vibration vector Y coordinate","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},vZ:{"@desc":"vibration vector Z coordinate","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"},xyz:{"@desc":"Cartesian XYZ coordinates; select xyz > 1.0 selects atoms more than one Angstrom from the origin.","@examples":[""],isUnsupported:!0,regex:/[0-9\s{}-]+/,map:Jt,level:"atom-test"}},rre=fe,nre=[{"@desc":"Selects atoms that are not included in s1.","@examples":["not ARG"],name:"not",type:Ps,rule:We.alt(We.regex(/NOT/i).skip(We.whitespace),We.string("!").skip(We.optWhitespace)),map:function(e,t){return Sc(t)}},{"@desc":"Selects atoms included in both s1 and s2.","@examples":["ASP and .CA"],name:"and",type:fu,rule:Qp(/AND|&/i),map:function(e,t,r){return rre.struct.modifier.intersectBy({0:t,by:r})}},{"@desc":"Selects atoms included in either s1 or s2.","@examples":["ASP or GLU"],name:"or",type:fu,rule:Qp(/OR|\||,/i),map:function(e,t,r){return rre.struct.combinator.merge([t,r])}}],Me=fe,xa={acidic:["ASP","GLU"],aliphatic:["ALA","GLY","ILE","LEU","VAL"],amino:["ALA","ARG","ASN","ASP","CYS","GLN","GLU","GLY","HIS","ILE","LEU","LYS","MET","PHE","PRO","SER","THR","TRP","TYR","VAL","ASX","GLX","UNK"],aromatic:["HIS","PHE","TRP","TYR"],basic:["ARG","HIS","LYS"],buried:["ALA","CYS","ILE","LEU","MET","PHE","TRP","VAL"],cg:["CYT","C","GUA","G"],cyclic:["HIS","PHE","PRO","TRP","TYR"],hydrophobic:["ALA","GLY","ILE","LEU","MET","PHE","PRO","TRP","TYR","VAL"],large:["ARG","GLU","GLN","HIS","ILE","LEU","LYS","MET","PHE","TRP","TYR"],medium:["ASN","ASP","CYS","PRO","THR","VAL"],small:["ALA","GLY","SER"],nucleic:["G","C","A","T","U","I","DG","DC","DA","DT","DU","DI","+G","+C","+A","+T","+U","+I"]},are_nucleic=["P","O3'","O5'","C5'","C4'","C3'","OP1","OP2","O3*","O5*","C5*","C4*","C3*","C2'","C1'","O4'","O2'"],are_protein=["C","N","CA"];function iC(){return Me.struct.combinator.merge([Me.struct.generator.atomGroups({"residue-test":Me.core.set.has([Me.set.apply(Me,xa.nucleic),Me.ammp("label_comp_id")])}),Me.struct.filter.pick({0:Me.struct.generator.atomGroups({"group-by":Me.ammp("residueKey")}),test:Me.core.logic.and([Me.core.rel.eq([Me.struct.atomSet.atomCount(),1]),Me.core.rel.eq([Me.ammp("label_atom_id"),Me.atomName("P")])])}),Me.struct.filter.pick({0:Me.struct.generator.atomGroups({"group-by":Me.ammp("residueKey")}),test:Me.core.logic.or([Me.core.set.isSubset([dd(["C1'","C2'","O3'","C3'","C4'","C5'","O5'"]),Me.ammpSet("label_atom_id")]),Me.core.set.isSubset([dd(["C1*","C2*","O3*","C3*","C4*","C5*","O5*"]),Me.ammpSet("label_atom_id")])])})])}var ire={all:{"@desc":"all atoms; same as *",abbr:["*"],map:function(){return Me.struct.generator.all()}},bonded:{"@desc":"covalently bonded",map:function(){return Me.struct.generator.atomGroups({"atom-test":Me.core.rel.gr([Me.struct.atomProperty.core.bondCount({flags:Me.struct.type.bondFlags(["covalent","metallic","sulfide"])}),0])})}},clickable:{"@desc":"actually visible -- having some visible aspect such as wireframe, spacefill, or a label showing, or the alpha-carbon or phosphorus atom in a biomolecule that is rendered with only cartoon, rocket, or other biomolecule-specific shape."},connected:{"@desc":"bonded in any way, including hydrogen bonds",map:function(){return Me.struct.generator.atomGroups({"atom-test":Me.core.rel.gr([Me.struct.atomProperty.core.bondCount({flags:Me.struct.type.bondFlags()}),0])})}},displayed:{"@desc":"displayed using the display or hide command; not necessarily visible"},hidden:{"@desc":"hidden using the display or hide command"},none:{"@desc":"no atoms",map:function(){return Me.struct.generator.empty()}},selected:{"@desc":"atoms that have been selected; defaults to all when a file is first loaded"},thisModel:{"@desc":'atoms in the current frame set, as defined by frame, model, or animation commands. If more than one model is in this set, "thisModel" refers to all of them, regardless of atom displayed/hidden status.'},visible:{"@desc":"visible in any way, including PDB residue atoms for which a cartoon or other such rendering makes their group visible, even if they themselves are not visible."},subset:{"@desc":"the currently defined subset. Note that if a subset is currently defined, then select/display all is the same as select/display subset, restrict none is the same as restrict not subset. In addition, select not subset selects nothing."},specialPosition:{"@desc":"atoms in crystal structures that are at special positions - that is, for which there is more than one operator that leads to them."},unitcell:{"@desc":"atoms within the current unitcell, which may be offset. This includes atoms on the faces and at the vertices of the unitcell."},polyhedra:{"@desc":"all central atoms for which polyhedra have been created. See also polyhera(n), below. (Jmol 14.4)"},nonmetal:{"@desc":"_H,_He,_B,_C,_N,_O,_F,_Ne,_Si,_P,_S,_Cl,_Ar,_As,_Se,_Br,_Kr,_Te,_I,_Xe,_At,_Rn",map:function(){return Me.struct.generator.atomGroups({"atom-test":Me.core.set.has([Me.set.apply(Me,["H","He","B","C","N","O","F","Ne","Si","P","S","Cl","Ar","As","Se","Br","Kr","Te","I","Xe","At","Rn"].map(Me.es)),Me.acp("elementSymbol")])})}},metal:{"@desc":"!nonmetal",map:function(){return Me.struct.generator.atomGroups({"atom-test":Me.core.logic.not([Me.core.set.has([Me.set.apply(Me,["H","He","B","C","N","O","F","Ne","Si","P","S","Cl","Ar","As","Se","Br","Kr","Te","I","Xe","At","Rn"].map(Me.es)),Me.acp("elementSymbol")])])})}},alkaliMetal:{"@desc":"_Li,_Na,_K,_Rb,_Cs,_Fr",map:function(){return Me.struct.generator.atomGroups({"atom-test":Me.core.set.has([Me.set.apply(Me,["Li","Na","K","Rb","Cs","Fr"].map(Me.es)),Me.acp("elementSymbol")])})}},alkalineEarth:{"@desc":"_Be,_Mg,_Ca,_Sr,_Ba,_Ra",map:function(){return Me.struct.generator.atomGroups({"atom-test":Me.core.set.has([Me.set.apply(Me,["Be","Mg","Ca","Sr","Ba","Ra"].map(Me.es)),Me.acp("elementSymbol")])})}},nobleGas:{"@desc":"_He,_Ne,_Ar,_Kr,_Xe,_Rn",map:function(){return Me.struct.generator.atomGroups({"atom-test":Me.core.set.has([Me.set.apply(Me,["He","Ne","Ar","Kr","Xe","Rn"].map(Me.es)),Me.acp("elementSymbol")])})}},metalloid:{"@desc":"_B,_Si,_Ge,_As,_Sb,_Te",map:function(){return Me.struct.generator.atomGroups({"atom-test":Me.core.set.has([Me.set.apply(Me,["B","Si","Ge","As","Sb","Te"].map(Me.es)),Me.acp("elementSymbol")])})}},transitionMetal:{"@desc":"(includes La and Ac) elemno>=21 and elemno<=30, elemno=57, elemno=89, elemno>=39 and elemno<=48, elemno>=72 and elemno<=80, elemno>=104 and elemno<=112",map:function(){return Me.struct.generator.atomGroups({"atom-test":Me.core.logic.or([Me.core.rel.inRange([Me.acp("atomicNumber"),21,30]),Me.core.rel.inRange([Me.acp("atomicNumber"),39,48]),Me.core.rel.inRange([Me.acp("atomicNumber"),72,80]),Me.core.rel.inRange([Me.acp("atomicNumber"),104,112]),Me.core.set.has([Me.set(57,89),Me.acp("atomicNumber")])])})}},lanthanide:{"@desc":"(does not include La) elemno>57 and elemno<=71",map:function(){return Me.struct.generator.atomGroups({"atom-test":Me.core.rel.inRange([Me.acp("atomicNumber"),57,71])})}},actinide:{"@desc":"(does not include Ac) elemno>89 and elemno<=103",map:function(){return Me.struct.generator.atomGroups({"atom-test":Me.core.rel.inRange([Me.acp("atomicNumber"),89,103])})}},isaromatic:{"@desc":"atoms connected with the AROMATIC, AROMATICSINGLE, or AROMATICDOUBLE bond types",map:function(){return Me.struct.generator.atomGroups({"atom-test":Me.core.rel.gr([Me.struct.atomProperty.core.bondCount({flags:Me.struct.type.bondFlags(["aromatic"])}),0])})}},carbohydrate:{"@desc":""},ions:{"@desc":'(specifically the PDB designations "PO4" and "SO4")'},ligand:{"@desc":'(originally "hetero and not solvent"; changed to "!(protein,nucleic,water,UREA)" for Jmol 12.2)'},nucleic:{"@desc":'any group that (a) has one of the following group names: G, C, A, T, U, I, DG, DC, DA, DT, DU, DI, +G, +C, +A, +T, +U, +I; or (b) can be identified as a group that is only one atom, with name "P"; or (c) has all of the following atoms (prime, \', can replace * here): C1*, C2*, C3*, O3*, C4*, C5*, and O5*.',map:function(){return iC()}},purine:{"@desc":"any nucleic group that (a) has one of the following group names: A, G, I, DA, DG, DI, +A, +G, or +I; or (b) also has atoms N7, C8, and N9.",map:function(){return Me.struct.modifier.intersectBy({0:iC(),by:Me.struct.combinator.merge([Me.struct.generator.atomGroups({"residue-test":Me.core.set.has([Me.set.apply(Me,["A","G","I","DA","DG","DI","+A","+G","+I"]),Me.ammp("label_comp_id")])}),Me.struct.filter.pick({0:Me.struct.generator.atomGroups({"group-by":Me.ammp("residueKey")}),test:Me.core.set.isSubset([dd(["N7","C8","N9"]),Me.ammpSet("label_atom_id")])})])})}},pyrimidine:{"@desc":"any nucleic group that (a) has one of the following group names: C, T, U, DC, DT, DU, +C, +T, +U; or (b) also has atom O2.",map:function(){return Me.struct.modifier.intersectBy({0:iC(),by:Me.struct.combinator.merge([Me.struct.generator.atomGroups({"residue-test":Me.core.set.has([Me.set.apply(Me,["C","T","U","DC","DT","DU","+C","+T","+U"]),Me.ammp("label_comp_id")])}),Me.struct.filter.pick({0:Me.struct.generator.atomGroups({"group-by":Me.ammp("residueKey")}),test:Me.core.logic.or([Me.core.set.has([Me.ammpSet("label_atom_id"),Me.atomName("O2*")]),Me.core.set.has([Me.ammpSet("label_atom_id"),Me.atomName("O2'")])])})])})}},dna:{"@desc":"any nucleic group that (a) has one of the following group names: DG, DC, DA, DT, DU, DI, T, +G, +C, +A, +T; or (b) has neither atom O2* or O2'.",map:function(){return Me.struct.modifier.intersectBy({0:iC(),by:Me.struct.combinator.merge([Me.struct.generator.atomGroups({"residue-test":Me.core.set.has([Me.set.apply(Me,["DG","DC","DA","DT","DU","DI","T","+G","+C","+A","+T"]),Me.ammp("label_comp_id")])}),Me.struct.filter.pick({0:Me.struct.generator.atomGroups({"group-by":Me.ammp("residueKey")}),test:Me.core.logic.not([Me.core.logic.or([Me.core.set.has([Me.ammpSet("label_atom_id"),Me.atomName("O2*")]),Me.core.set.has([Me.ammpSet("label_atom_id"),Me.atomName("O2'")])])])})])})}},rna:{"@desc":"any nucleic group that (a) has one of the following group names: G, C, A, U, I, +U, +I; or (b) has atom O2* or O2'.",map:function(){return Me.struct.modifier.intersectBy({0:iC(),by:Me.struct.combinator.merge([Me.struct.generator.atomGroups({"residue-test":Me.core.set.has([Me.set.apply(Me,["G","C","A","U","I","+U","+I"]),Me.ammp("label_comp_id")])}),Me.struct.filter.pick({0:Me.struct.generator.atomGroups({"group-by":Me.ammp("residueKey")}),test:Me.core.logic.or([Me.core.set.has([Me.ammpSet("label_atom_id"),Me.atomName("O2*")]),Me.core.set.has([Me.ammpSet("label_atom_id"),Me.atomName("O2'")])])})])})}},protein:{"@desc":'defined as a group that (a) has one of the following group names: ALA, ARG, ASN, ASP, CYS, GLN, GLU, GLY, HIS, ILE, LEU, LYS, MET, PHE, PRO, SER, THR, TRP, TYR, VAL, ASX, GLX, or UNK; or (b) contains PDB atom designations [C, O, CA, and N] bonded correctly; or (c) does not contain "O" but contains [C, CA, and N] bonded correctly; or (d) has only one atom, which has name CA and does not have the group name CA (indicating a calcium atom).',map:function(){return function fHe(){return Me.struct.generator.atomGroups({"residue-test":Me.core.set.has([Me.set.apply(Me,xa.amino),Me.ammp("label_comp_id")])})}()}},acidic:{"@desc":"ASP GLU",map:function(){return rn(xa.acidic)}},acyclic:{"@desc":"amino and not cyclic",map:function(){return Me.struct.modifier.intersectBy({0:rn(xa.amino),by:Sc(rn(xa.cyclic))})}},aliphatic:{"@desc":"ALA GLY ILE LEU VAL",map:function(){return rn(xa.aliphatic)}},amino:{"@desc":"all twenty standard amino acids, plus ASX, GLX, UNK",map:function(){return rn(xa.amino)}},aromatic:{"@desc":'HIS PHE TRP TYR (see also "isaromatic" for aromatic bonds)',map:function(){return rn(xa.aromatic)}},basic:{"@desc":"ARG HIS LYS",map:function(){return rn(xa.basic)}},buried:{"@desc":"ALA CYS ILE LEU MET PHE TRP VAL",map:function(){return rn(xa.buried)}},charged:{"@desc":"same as acidic or basic -- ASP GLU, ARG HIS LYS",map:function(){return rn(xa.acidic.concat(xa.basic))}},cyclic:{"@desc":"HIS PHE PRO TRP TYR",map:function(){return rn(xa.cyclic)}},helix:{"@desc":"secondary structure-related.",map:function(){return Me.struct.generator.atomGroups({"residue-test":Me.core.flags.hasAny([Me.struct.type.secondaryStructureFlags(["helix"]),Me.ammp("secondaryStructureFlags")])})}},helixalpha:{"@desc":"secondary structure-related.",map:function(){return Me.struct.generator.atomGroups({"residue-test":Me.core.flags.hasAny([Me.struct.type.secondaryStructureFlags(["alpha"]),Me.ammp("secondaryStructureFlags")])})}},helix310:{"@desc":"secondary structure-related.",map:function(){return Me.struct.generator.atomGroups({"residue-test":Me.core.flags.hasAny([Me.struct.type.secondaryStructureFlags(["3-10"]),Me.ammp("secondaryStructureFlags")])})}},helixpi:{"@desc":"secondary structure-related.",map:function(){return Me.struct.generator.atomGroups({"residue-test":Me.core.flags.hasAny([Me.struct.type.secondaryStructureFlags(["pi"]),Me.ammp("secondaryStructureFlags")])})}},hetero:{"@desc":"PDB atoms designated as HETATM",map:function(){return Me.struct.generator.atomGroups({"atom-test":Me.ammp("isHet")})}},hydrophobic:{"@desc":"ALA GLY ILE LEU MET PHE PRO TRP TYR VAL",map:function(){return rn(xa.hydrophobic)}},large:{"@desc":"ARG GLU GLN HIS ILE LEU LYS MET PHE TRP TYR",map:function(){return rn(xa.large)}},medium:{"@desc":"ASN ASP CYS PRO THR VAL",map:function(){return rn(xa.medium)}},negative:{"@desc":"same as acidic -- ASP GLU",map:function(){return rn(xa.acidic)}},neutral:{"@desc":"amino and not (acidic or basic)",map:function(){return Me.struct.modifier.intersectBy({0:rn(xa.amino),by:Sc(rn(xa.acidic.concat(xa.basic)))})}},polar:{"@desc":"amino and not hydrophobic",map:function(){return Me.struct.modifier.intersectBy({0:rn(xa.amino),by:Sc(rn(xa.hydrophobic))})}},positive:{"@desc":"same as basic -- ARG HIS LYS",map:function(){return rn(xa.basic)}},sheet:{"@desc":"secondary structure-related",map:function(){return Me.struct.generator.atomGroups({"residue-test":Me.core.flags.hasAny([Me.struct.type.secondaryStructureFlags(["sheet"]),Me.ammp("secondaryStructureFlags")])})}},small:{"@desc":"ALA GLY SER",map:function(){return rn(xa.small)}},surface:{"@desc":"amino and not buried",map:function(){return Me.struct.modifier.intersectBy({0:rn(xa.amino),by:Sc(rn(xa.buried))})}},turn:{"@desc":"secondary structure-related",map:function(){return Me.struct.generator.atomGroups({"residue-test":Me.core.flags.hasAny([Me.struct.type.secondaryStructureFlags(["turn"]),Me.ammp("secondaryStructureFlags")])})}},alpha:{"@desc":"(*.CA)",map:function(){return Me.struct.generator.atomGroups({"atom-test":Me.core.rel.eq([Me.atomName("CA"),Me.ammp("label_atom_id")])})}},base:{"@desc":"(nucleic bases)"},backbone:{"@desc":"(*.C, *.CA, *.N, and all nucleic other than the bases themselves)",abbr:["mainchain"],map:function(){return function dHe(){return Me.struct.combinator.merge([Me.struct.modifier.intersectBy({0:Me.struct.generator.atomGroups({"residue-test":Me.core.set.has([Me.core.type.set(xa.amino),Me.ammp("label_comp_id")])}),by:Me.struct.generator.atomGroups({"atom-test":Me.core.set.has([Me.core.type.set(are_protein),Me.ammp("label_atom_id")])})}),Me.struct.modifier.intersectBy({0:Me.struct.generator.atomGroups({"residue-test":Me.core.set.has([Me.core.type.set(xa.nucleic),Me.ammp("label_comp_id")])}),by:Me.struct.generator.atomGroups({"atom-test":Me.core.set.has([Me.core.type.set(are_nucleic),Me.ammp("label_atom_id")])})})])}()}},sidechain:{"@desc":"((protein or nucleic) and not backbone)"},spine:{"@desc":"(*.CA, *.N, *.C for proteins; *.P, *.O3', *.O5', *.C3', *.C4', *.C5 for nucleic acids)"},leadatom:{"@desc":"(*.CA, *.P, and terminal *.O5')"},solvent:{"@desc":'PDB "HOH", water, also the connected set of H-O-H in any model'}},Ar=fe,pHe=[{"@desc":"value comparisons","@examples":[],name:"=",abbr:["=="],type:fu,rule:We.regexp(/\s*(LIKE|>=|<=|=|!=|>|<)\s*/i,1),map:function(e,t,r){var n;if("structure"===t?n=Ar.core.flags.hasAny([Ar.ammp("secondaryStructureFlags"),ere(r)]):"structure"===r?n=Ar.core.flags.hasAny([Ar.ammp("secondaryStructureFlags"),ere(t)]):void 0!==t.head?"core.type.regex"===t.head.name&&(n=Ar.core.str.match([t,Ar.core.type.str([r])])):void 0!==r.head?"core.type.regex"===r.head.name&&(n=Ar.core.str.match([r,Ar.core.type.str([t])])):"LIKE"===e.toUpperCase()&&(n=Ar.core.str.match(t.head?[Ar.core.type.regex(["^".concat(r,"$"),"i"]),Ar.core.type.str([t])]:[Ar.core.type.regex(["^".concat(t,"$"),"i"]),Ar.core.type.str([r])])),!n)switch(t.head&&(r=nC(t,r)),r.head&&(t=nC(r,t)),e){case"=":n=Ar.core.rel.eq([t,r]);break;case"!=":n=Ar.core.rel.neq([t,r]);break;case">":n=Ar.core.rel.gr([t,r]);break;case"<":n=Ar.core.rel.lt([t,r]);break;case">=":n=Ar.core.rel.gre([t,r]);break;case"<=":n=Ar.core.rel.lte([t,r]);break;default:throw new Error("value operator '".concat(e,"' not supported"))}return Ar.struct.generator.atomGroups({"atom-test":n})}}];function hHe(e){var t=e[1],r=t[0],n=t[1],a=t[2],i=t[3],o=t[4],s=t[5],u=t[6],c={};o&&(c["chain-test"]=Ar.core.rel.eq([Ar.ammp("auth_asym_id"),o]));var l=[];r&&l.push(Ar.core.rel.eq([Ar.ammp("label_comp_id"),r])),n&&l.push(Ar.core.logic.and([Ar.core.rel.gre([Ar.ammp("auth_seq_id"),n[0]]),Ar.core.rel.lte([Ar.ammp("auth_seq_id"),n[1]])])),a&&l.push(Ar.core.rel.eq([Ar.ammp("auth_seq_id"),a])),i&&l.push(Ar.core.rel.eq([Ar.ammp("pdbx_PDB_ins_code"),i])),l.length&&(c["residue-test"]=JB(l));var f=[];return s&&f.push(Ar.core.rel.eq([Ar.ammp("auth_atom_id"),s])),u&&f.push(Ar.core.rel.eq([Ar.ammp("label_alt_id"),u])),f.length&&(c["atom-test"]=JB(f)),Ar.struct.generator.atomGroups(c)}var mHe=We.createLanguage({Integer:function(){return We.regexp(/-?[0-9]+/).map(Number).desc("integer")},Parens:function(e){return We.alt(e.Parens,e.Operator,e.Expression).wrap(We.regexp(/\(\s*/),We.regexp(/\s*\)/))},Expression:function(e){return We.alt(e.Keywords,e.AtomExpression.map(hHe),e.Within.map(function(t){return Ar.struct.modifier.includeSurroundings({0:t[1],radius:t[0]})}),e.ValueQuery,e.Element.map(function(t){return Ar.struct.generator.atomGroups({"atom-test":Ar.core.rel.eq([Ar.acp("elementSymbol"),Ar.struct.type.elementSymbol(t)])})}),e.Resname.map(function(t){return Ar.struct.generator.atomGroups({"residue-test":Ar.core.rel.eq([Ar.ammp("label_comp_id"),t])})}))},Operator:function(e){return rC(nre,We.alt(e.Parens,e.Expression))},AtomExpression:function(e){return We.seq(We.lookahead(e.AtomPrefix),We.seq(e.BracketedResname.or(We.of(null)),e.ResnoRange.or(We.of(null)),e.Resno.or(We.of(null)),e.Inscode.or(We.of(null)),e.Chainname.or(We.of(null)),e.Atomname.or(We.of(null)),e.Altloc.or(We.of(null)),e.Model.or(We.of(null)))).desc("expression")},AtomPrefix:function(){return We.regexp(/[\[0-9:^%/.-]/).desc("atom-prefix")},Chainname:function(){return We.regexp(/:([A-Za-z]{1,3})/,1).desc("chainname")},Model:function(){return We.regexp(/\/([0-9]+)/,1).map(Number).desc("model")},Element:function(){return We.regexp(/_([A-Za-z]{1,3})/,1).desc("element")},Atomname:function(){return We.regexp(/\.([a-zA-Z0-9]{1,4})/,1).map(Ar.atomName).desc("atomname")},Resname:function(){return We.regexp(/[a-zA-Z0-9]{1,4}/).desc("resname")},Resno:function(e){return e.Integer.desc("resno")},Altloc:function(){return We.regexp(/%([a-zA-Z0-9])/,1).desc("altloc")},Inscode:function(){return We.regexp(/\^([a-zA-Z0-9])/,1).desc("inscode")},BracketedResname:function(){return We.regexp(/\[([a-zA-Z0-9]{1,4})\]/,1).desc("bracketed-resname")},ResnoRange:function(e){return We.seq(e.Integer.skip(We.seq(We.optWhitespace,We.string("-"),We.optWhitespace)),e.Integer).desc("resno-range")},Within:function(e){return We.regexp(/within/i).skip(We.regexp(/\s*\(\s*/)).then(We.seq(e.Integer.skip(We.regexp(/\s*,\s*/)),e.Query)).skip(We.regexp(/\)/))},Keywords:function(){var e;return(e=We).alt.apply(e,r5(ire)).desc("keyword")},Query:function(e){return We.alt(e.Operator,e.Parens,e.Expression).trim(We.optWhitespace)},Number:function(){return We.regexp(/-?(0|[1-9][0-9]*)([.][0-9]+)?([eE][+-]?[0-9]+)?/).map(Number).desc("number")},String:function(){var e=a5(tre,ire,nre).sort(fd).map(U_).join("|");return We.alt(We.regexp(new RegExp("(?!(".concat(e,"))[A-Z0-9_]+"),"i")),We.regexp(/'((?:[^"\\]|\\.)*)'/,1),We.regexp(/"((?:[^"\\]|\\.)*)"/,1).map(function(t){return Ar.core.type.regex(["^".concat(t,"$"),"i"])})).desc("string")},Value:function(e){return We.alt(e.Number,e.String)},ValueParens:function(e){return We.alt(e.ValueParens,e.ValueOperator,e.ValueExpressions).wrap(We.string("("),We.string(")"))},ValuePropertyNames:function(){var e;return(e=We).alt.apply(e,n5(tre,/LIKE|>=|<=|=|!=|>|<|\)|\s/i))},ValueOperator:function(e){return rC(pHe,We.alt(e.ValueParens,e.ValueExpressions))},ValueExpressions:function(e){return We.alt(e.Value,e.ValuePropertyNames)},ValueQuery:function(e){return We.alt(e.ValueOperator.map(function(t){if(t.head){if(t.head.name.startsWith("structure-query.generator"))return t}else if("string"==typeof t&&t.length<=4)return Ar.struct.generator.atomGroups({"residue-test":Ar.core.rel.eq([Ar.ammp("label_comp_id"),t])});throw new Error("values must be part of an comparison, value '".concat(t,"'"))}))}}),Ho=fe,fE=/[-+]?[0-9]*\.?[0-9]+/;function wb(e){return e.split("+").map(function(t){return t.replace(/^["']|["']$/g,"")})}function i5(e){if(e.includes("-")&&e.includes("+")){var t=e.split("+").map(function(u){return u.replace(/^["']|["']$/g,"")}),r=[];return t.forEach(function(u){if(u.includes("-")&&!u.startsWith("-"))for(var c=u.split("-").map(function(p){return parseInt(p)}),f=c[1],d=l=c[0];d<=f;d++)r.push(d);else if(u.includes("-")&&u.startsWith("-")&&u.match(/[0-9]+-[-0-9]+/)){var l=-parseInt(u.split("-")[1]);for(f=void 0,f=u.includes("--")?-parseInt(u.split("-")[3]):parseInt(u.split("-")[2]),d=l;d<=f;d++)r.push(d)}else u.includes("-")&&u.startsWith("-")&&u.match(/[0-9]+-[-0-9]+/),r.push(parseInt(u))}),r}if(e.includes("-")&&!e.includes("+")){var n=[];if(e.startsWith("-"))if(e.startsWith("-")&&e.match(/[0-9]+-[-0-9]+/)){var i=-parseInt(e.split("-")[1]),o=void 0;o=e.includes("--")?-parseInt(e.split("-")[3]):parseInt(e.split("-")[2]);for(var s=i;s<=o;s++)n.push(s)}else e.startsWith("-")&&e.match(/[0-9]+-[-0-9]+/),n.push(parseInt(e));else{var a=e.split("-").map(function(u){return parseInt(u)});for(o=a[1],s=i=a[0];s<=o;s++)n.push(s)}return n}return!e.includes("-")&&e.includes("+")?wb(e).map(function(u){return parseInt(u)}):[parseInt(e)]}var bHe={H:"helix",S:"beta",L:"none"},dE={symbol:{"@desc":"chemical-symbol-list: list of 1- or 2-letter chemical symbols from the periodic table","@examples":["symbol O+N"],abbr:["e."],regex:/[a-zA-Z'"+]+/,map:function yHe(e){return e.split("+").map(Ho.struct.type.elementSymbol)},level:"atom-test",property:Ho.acp("elementSymbol")},name:{"@desc":"atom-name-list: list of up to 4-letter codes for atoms in proteins or nucleic acids","@examples":["name CA+CB+CG+CD"],abbr:["n."],regex:/[a-zA-Z0-9'"+]+/,map:function gHe(e){return e.split("+").map(Ho.atomName)},level:"atom-test",property:Ho.ammp("label_atom_id")},resn:{"@desc":"residue-name-list: list of 3-letter codes for amino acids or list of up to 2-letter codes for nucleic acids","@examples":["resn ASP+GLU+ASN+GLN","resn A+G"],abbr:["resname","r."],regex:/[a-zA-Z0-9'"+]+/,map:wb,level:"residue-test",property:Ho.ammp("label_comp_id")},resi:{"@desc":"residue-identifier-list list of up to 4-digit residue numbers or residue-identifier-range","@examples":["resi 1+10+100+1000","resi 1-10"],abbr:["resident","residue","resid","i."],regex:/[0-9+-]+/,map:i5,level:"residue-test",property:Ho.ammp("auth_seq_id")},alt:{"@desc":"alternate-conformation-identifier-list list of single letters","@examples":["alt A+B",'alt ""','alt ""+A'],abbr:[],regex:/[a-zA-Z0-9'"+]+/,map:wb,level:"atom-test",property:Ho.ammp("label_alt_id")},chain:{"@desc":"chain-identifier-list list of single letters or sometimes numbers","@examples":["chain A"],abbr:["c."],regex:/[a-zA-Z0-9'"+]+/,map:wb,level:"chain-test",property:Ho.ammp("auth_asym_id")},segi:{"@desc":"segment-identifier-list list of up to 4 letter identifiers","@examples":["segi lig"],abbr:["segid","s."],regex:/[a-zA-Z0-9'"+]+/,map:wb,level:"chain-test",property:Ho.ammp("label_asym_id")},flag:{"@desc":"flag-number a single integer from 0 to 31","@examples":["flag 0"],isUnsupported:!0,abbr:["f."],regex:/[0-9]+/,map:function(e){return parseInt(e)},level:"atom-test"},numeric_type:{"@desc":"type-number a single integer","@examples":["nt. 5"],isUnsupported:!0,abbr:["nt."],regex:/[0-9]+/,map:function(e){return parseInt(e)},level:"atom-test"},text_type:{"@desc":"type-string a list of up to 4 letter codes","@examples":["text_type HA+HC"],isUnsupported:!0,abbr:["tt."],regex:/[a-zA-Z0-9'"+]+/,map:wb,level:"atom-test"},id:{"@desc":"external-index-number a single integer","@examples":["id 23"],regex:/[0-9+-]+/,map:i5,level:"atom-test",property:Ho.ammp("id")},index:{"@desc":"internal-index-number a single integer","@examples":["index 11"],regex:/[0-9+-]+/,map:i5,level:"atom-test",property:Ho.ammp("id")},ss:{"@desc":"secondary-structure-type list of single letters. Helical regions should be assigned H and sheet regions S. Loop regions can either be assigned L or be blank.","@examples":["ss H+S+L",'ss S+""'],abbr:[],regex:/[a-zA-Z'"+]+/,map:function _He(e){return{flags:Ho.struct.type.secondaryStructureFlags(e.toUpperCase().split("+").map(function(t){return bHe[t]||"none"}))}},level:"residue-test",property:Ho.ammp("secondaryStructureFlags")},b:{"@desc":"comparison-operator b-factor-value a real number","@examples":["b > 10"],isNumeric:!0,abbr:[],regex:fE,map:function(e){return parseFloat(e)},level:"atom-test",property:Ho.ammp("B_iso_or_equiv")},q:{"@desc":"comparison-operator occupancy-value a real number","@examples":["q <0.50"],isNumeric:!0,abbr:[],regex:fE,map:function(e){return parseFloat(e)},level:"atom-test",property:Ho.ammp("occupancy")},formal_charge:{"@desc":"comparison-operator formal charge-value an integer","@examples":["fc. = -1"],isNumeric:!0,abbr:["fc."],regex:fE,map:function(e){return parseFloat(e)},level:"atom-test",property:Ho.ammp("pdbx_formal_charge")},partial_charge:{"@desc":"comparison-operator partial charge-value a real number","@examples":["pc. > 1"],isUnsupported:!0,isNumeric:!0,abbr:["pc."],regex:fE,map:function(e){return parseFloat(e)},level:"atom-test"},elem:{"@desc":'str atomic element symbol string ("X" if undefined)',"@examples":["elem N"],regex:/[a-zA-Z0-9]{1,3}/,map:function(e){return Ho.es(e)},level:"atom-test",property:Ho.acp("elementSymbol")}},fr=fe,ore=[{"@desc":"Selects atoms that are not included in s1.","@examples":["NOT resn ALA","not (resi 42 or chain A)","!resi 42 or chain A"],name:"not",type:Ps,rule:We.alt(We.regexp(/NOT/i).skip(We.whitespace),We.string("!").skip(We.optWhitespace)),map:function(e,t){return Sc(t)}},{"@desc":"Selects atoms included in both s1 and s2.","@examples":["chain A AND name CA"],name:"and",type:fu,rule:Qp(/AND|&/i),map:function(e,t,r){return fr.struct.modifier.intersectBy({0:t,by:r})}},{"@desc":"Selects atoms included in either s1 or s2.","@examples":["chain A OR chain B"],name:"or",type:fu,rule:Qp(/OR|\|/i),map:function(e,t,r){return fr.struct.combinator.merge([t,r])}},{"@desc":"Selects atoms in s1 whose identifiers name, resi, resn, chain and segi all match atoms in s2.","@examples":["chain A IN chain B"],name:"in",type:fu,rule:Qp(/IN/i),map:function(e,t,r){return fr.struct.filter.withSameAtomProperties({0:t,source:r,property:fr.core.type.compositeKey([fr.ammp("label_atom_id"),fr.ammp("label_seq_id"),fr.ammp("label_comp_id"),fr.ammp("auth_asym_id"),fr.ammp("label_asym_id")])})}},{"@desc":"Selects atoms in s1 whose identifiers name and resi match atoms in s2.","@examples":["chain A LIKE chain B"],name:"like",type:fu,rule:Qp(/LIKE|l\./i),map:function(e,t,r){return fr.struct.filter.withSameAtomProperties({0:t,source:r,property:fr.core.type.compositeKey([fr.ammp("label_atom_id"),fr.ammp("label_seq_id")])})}},{"@desc":"Selects all atoms whose van der Waals radii are separated from the van der Waals radii of s1 by a minimum of X Angstroms.","@examples":["solvent GAP 2"],name:"gap",type:cE,rule:lE(/GAP\s+([-+]?[0-9]*\.?[0-9]+)/i,1).map(function(e){return parseFloat(e)}),map:function(e,t){return fr.struct.filter.within({0:fr.struct.generator.all(),target:t,"atom-radius":fr.acp("vdw"),"max-radius":e,invert:!0})}},{"@desc":"Selects atoms with centers within X Angstroms of the center of any atom in s1.","@examples":["resname LIG AROUND 1"],name:"around",abbr:["a."],type:cE,rule:lE(/(AROUND|a\.)\s+([-+]?[0-9]*\.?[0-9]+)/i,2).map(function(e){return parseFloat(e)}),map:function(e,t){return fr.struct.modifier.exceptBy({0:fr.struct.filter.within({0:fr.struct.generator.all(),target:t,"max-radius":e}),by:t})}},{"@desc":"Expands s1 by all atoms within X Angstroms of the center of any atom in s1.","@examples":["chain A EXPAND 3"],name:"expand",abbr:["x."],type:cE,rule:lE(/(EXPAND|x\.)\s+([-+]?[0-9]*\.?[0-9]+)/i,2).map(function(e){return parseFloat(e)}),map:function(e,t){return fr.struct.modifier.includeSurroundings({0:t,radius:e})}},{"@desc":"Selects atoms in s1 that are within X Angstroms of any atom in s2.","@examples":["chain A WITHIN 3 OF chain B"],name:"within",abbr:["w."],type:fu,rule:$B("WITHIN","w."),map:function(e,t,r){return fr.struct.filter.within({0:t,target:r,"max-radius":e})}},{"@desc":"Same as within, but excludes s2 from the selection (and thus is identical to s1 and s2 around X).","@examples":["chain A NEAR_TO 3 OF chain B"],name:"near_to",abbr:["nto."],type:fu,rule:$B("NEAR_TO","nto."),map:function(e,t,r){return fr.struct.modifier.exceptBy({0:fr.struct.filter.within({0:t,target:r,"max-radius":e}),by:r})}},{"@desc":"Selects atoms in s1 that are at least X Anstroms away from s2.","@examples":["solvent BEYOND 2 OF chain A"],name:"beyond",abbr:["be."],type:fu,rule:$B("BEYOND","be."),map:function(e,t,r){return fr.struct.modifier.exceptBy({0:fr.struct.filter.within({0:t,target:r,"max-radius":e,invert:!0}),by:r})}},{"@desc":"Expands selection to complete residues.","@examples":["BYRESIDUE name N"],name:"byresidue",abbr:["byresi","byres","br."],type:Ps,rule:_c(/BYRESIDUE|byresi|byres|br\./i),map:function(e,t){return pd(fr.struct.modifier.expandProperty({0:fr.struct.modifier.union({0:t}),property:fr.ammp("residueKey")}))}},{"@desc":"Completely selects all alpha carbons in all residues covered by a selection.","@examples":["BYCALPHA chain A"],name:"bycalpha",abbr:["bca."],type:Ps,rule:_c(/BYCALPHA|bca\./i),map:function(e,t){return fr.struct.generator.queryInSelection({0:fr.struct.modifier.expandProperty({0:fr.struct.modifier.union({0:t}),property:fr.ammp("residueKey")}),query:fr.struct.generator.atomGroups({"atom-test":fr.core.rel.eq([fr.atomName("CA"),fr.ammp("label_atom_id")])})})}},{"@desc":"Expands selection to complete molecules.","@examples":["BYMOLECULE resi 20-30"],name:"bymolecule",isUnsupported:!0,abbr:["bymol","bm."],type:Ps,rule:_c(/BYMOLECULE|bymol|bm\./i),map:function(e,t){return pd(fr.struct.modifier.expandProperty({0:fr.struct.modifier.union({0:t}),property:fr.atp("connectedComponentKey")}))}},{"@desc":"Expands selection to complete fragments.","@examples":["BYFRAGMENT resi 10"],name:"byfragment",abbr:["byfrag","bf."],isUnsupported:!0,type:Ps,rule:_c(/BYFRAGMENT|byfrag|bf\./i),map:function(e,t){return[e,t]}},{"@desc":"Expands selection to complete segments.","@examples":["BYSEGMENT resn CYS"],name:"bysegment",abbr:["bysegi","byseg","bs."],type:Ps,rule:_c(/BYSEGMENT|bysegi|byseg|bs\./i),map:function(e,t){return pd(fr.struct.modifier.expandProperty({0:fr.struct.modifier.union({0:t}),property:fr.ammp("chainKey")}))}},{"@desc":"Expands selection to complete objects.","@examples":["BYOBJECT chain A"],name:"byobject",abbr:["byobj","bo."],isUnsupported:!0,type:Ps,rule:_c(/BYOBJECT|byobj|bo\./i),map:function(e,t){return[e,t]}},{"@desc":"Expands selection to unit cell.","@examples":["BYCELL chain A"],name:"bycell",isUnsupported:!0,type:Ps,rule:_c(/BYCELL/i),map:function(e,t){return[e,t]}},{"@desc":"All rings of size \u2264 7 which have at least one atom in s1.","@examples":["BYRING resn HEM"],name:"byring",type:Ps,rule:_c(/BYRING/i),map:function(e,t){return pd(fr.struct.modifier.intersectBy({0:fr.struct.filter.pick({0:fr.struct.generator.rings(),test:fr.core.logic.and([fr.core.rel.lte([fr.struct.atomSet.atomCount(),7]),fr.core.rel.gr([fr.struct.atomSet.countQuery([t]),1])])}),by:t}))}},{"@desc":"Selects atoms directly bonded to s1, excludes s1.","@examples":["NEIGHBOR resn CYS"],name:"neighbor",type:Ps,abbr:["nbr."],rule:_c(/NEIGHBOR|nbr\./i),map:function(e,t){return fr.struct.modifier.exceptBy({0:pd(fr.struct.modifier.includeConnected({0:fr.struct.modifier.union({0:t}),"bond-test":!0})),by:t})}},{"@desc":"Selects atoms directly bonded to s1, may include s1.","@examples":["BOUND_TO name CA"],name:"bound_to",abbr:["bto."],type:Ps,rule:_c(/BOUND_TO|bto\./i),map:function(e,t){return pd(fr.struct.modifier.includeConnected({0:fr.struct.modifier.union({0:t})}))}},{"@desc":"Extends s1 by X bonds connected to atoms in s1.","@examples":["resname LIG EXTEND 3"],name:"extend",abbr:["xt."],type:cE,rule:lE(/(EXTEND|xt\.)\s+([0-9]+)/i,2).map(function(e){return parseInt(e)}),map:function(e,t){return pd(fr.struct.modifier.includeConnected({0:fr.struct.modifier.union({0:t}),"bond-test":!0,"layer-count":e}))}}],Rt=fe,Ms={nucleic:["A","C","T","G","U","DA","DC","DT","DG","DU"],protein:["ALA","ARG","ASN","ASP","CYS","CYX","GLN","GLU","GLY","HIS","HID","HIE","HIP","ILE","LEU","LYS","MET","MSE","PHE","PRO","SER","THR","TRP","TYR","VAL"],solvent:["HOH","WAT","H20","TIP","SOL"]},sre_nucleic=["P","O3'","O5'","C5'","C4'","C3'","OP1","OP2","O3*","O5*","C5*","C4*","C3*","C2'","C1'","O4'","O2'"],sre_protein=["C","N","CA","O"];function ure(){return Rt.struct.combinator.merge([Rt.struct.modifier.intersectBy({0:Rt.struct.generator.atomGroups({"residue-test":Rt.core.set.has([Rt.core.type.set(Ms.protein),Rt.ammp("label_comp_id")])}),by:Rt.struct.generator.atomGroups({"atom-test":Rt.core.set.has([Rt.core.type.set(sre_protein),Rt.ammp("label_atom_id")])})}),Rt.struct.modifier.intersectBy({0:Rt.struct.generator.atomGroups({"residue-test":Rt.core.set.has([Rt.core.type.set(Ms.nucleic),Rt.ammp("label_comp_id")])}),by:Rt.struct.generator.atomGroups({"atom-test":Rt.core.set.has([Rt.core.type.set(sre_nucleic),Rt.ammp("label_atom_id")])})})])}var cre={all:{"@desc":"All atoms currently loaded into PyMOL",abbr:["*"],map:function(){return Rt.struct.generator.all()}},none:{"@desc":"No atoms (empty selection)",map:function(){return Rt.struct.generator.empty()}},hydrogens:{"@desc":"All hydrogen atoms currently loaded into PyMOL",abbr:["hydro","h."],map:function(){return Rt.struct.generator.atomGroups({"atom-test":Rt.core.rel.eq([Rt.acp("elementSymbol"),Rt.es("H")])})}},hetatm:{"@desc":"All atoms loaded from Protein Data Bank HETATM records",abbr:["het"],map:function(){return Rt.struct.generator.atomGroups({"atom-test":Rt.core.rel.eq([Rt.ammp("isHet"),!0])})}},visible:{"@desc":"All atoms in enabled objects with at least one visible representation",abbr:["v."]},polymer:{"@desc":"All atoms on the polymer (not het). Finds atoms with residue identifiers matching a known polymer, such a peptide and DNA.",abbr:["pol."],map:function(){return Rt.struct.generator.atomGroups({"residue-test":Rt.core.set.has([Rt.core.type.set(Ms.nucleic.concat(Ms.protein)),Rt.ammp("label_comp_id")])})}},sidechain:{"@desc":"Polymer non-backbone atoms (new in PyMOL 1.6.1)",abbr:["sc."],map:function(){return Rt.struct.modifier.exceptBy({0:Rt.struct.generator.atomGroups({"residue-test":Rt.core.set.has([Rt.core.type.set(Ms.nucleic.concat(Ms.protein)),Rt.ammp("label_comp_id")])}),by:ure()})}},present:{"@desc":"All atoms with defined coordinates in the current state (used in creating movies)",abbr:["pr."]},center:{"@desc":"Pseudo-atom at the center of the scene"},origin:{"@desc":"Pseudo-atom at the origin of rotation"},enabled:{"@desc":"All enabled objects or selections from the object list."},masked:{"@desc":"All masked atoms.",abbr:["msk."]},protected:{"@desc":"All protected atoms.",abbr:["pr."]},bonded:{"@desc":"All bonded atoms",map:function(){return Rt.struct.generator.atomGroups({"atom-test":Rt.core.rel.gr([Rt.struct.atomProperty.core.bondCount({flags:Rt.struct.type.bondFlags(["covalent","metallic","sulfide"])}),0])})}},donors:{"@desc":"All hydrogen bond donor atoms.",abbr:["don."]},acceptors:{"@desc":"All hydrogen bond acceptor atoms.",abbr:["acc."]},fixed:{"@desc":"All fixed atoms.",abbr:["fxd."]},restrained:{"@desc":"All restrained atoms.",abbr:["rst."]},organic:{"@desc":"All atoms in non-polymer organic compounds (e.g. ligands, buffers). Finds carbon-containing molecules that do not match known polymers.",abbr:["org."],map:function(){return pd(Rt.struct.modifier.expandProperty({0:Rt.struct.modifier.union([Rt.struct.generator.queryInSelection({0:Rt.struct.generator.atomGroups({"residue-test":Rt.core.logic.not([Rt.core.set.has([Rt.core.type.set(Ms.nucleic.concat(Ms.protein)),Rt.ammp("label_comp_id")])])}),query:Rt.struct.generator.atomGroups({"atom-test":Rt.core.rel.eq([Rt.es("C"),Rt.acp("elementSymbol")])})})]),property:Rt.ammp("residueKey")}))}},inorganic:{"@desc":"All non-polymer inorganic atoms/ions. Finds atoms in molecules that do not contain carbon and do not match any known solvent residues.",abbr:["ino."],map:function(){return pd(Rt.struct.modifier.expandProperty({0:Rt.struct.modifier.union([Rt.struct.filter.pick({0:Rt.struct.generator.atomGroups({"residue-test":Rt.core.logic.not([Rt.core.set.has([Rt.core.type.set(Ms.nucleic.concat(Ms.protein).concat(Ms.solvent)),Rt.ammp("label_comp_id")])]),"group-by":Rt.ammp("residueKey")}),test:Rt.core.logic.not([Rt.core.set.has([Rt.struct.atomSet.propertySet([Rt.acp("elementSymbol")]),Rt.es("C")])])})]),property:Rt.ammp("residueKey")}))}},solvent:{"@desc":"All water molecules. The hardcoded solvent residue identifiers are currently: HOH, WAT, H20, TIP, SOL.",abbr:["sol."],map:function(){return Rt.struct.generator.atomGroups({"residue-test":Rt.core.set.has([Rt.core.type.set(Ms.solvent),Rt.ammp("label_comp_id")])})}},guide:{"@desc":"All protein CA and nucleic acid C4*/C4",map:function(){return Rt.struct.combinator.merge([Rt.struct.generator.atomGroups({"atom-test":Rt.core.rel.eq([Rt.atomName("CA"),Rt.ammp("label_atom_id")]),"residue-test":Rt.core.set.has([Rt.core.type.set(Ms.protein),Rt.ammp("label_comp_id")])}),Rt.struct.generator.atomGroups({"atom-test":Rt.core.set.has([dd(["C4*","C4'"]),Rt.ammp("label_atom_id")]),"residue-test":Rt.core.set.has([Rt.core.type.set(Ms.nucleic),Rt.ammp("label_comp_id")])})])}},metals:{"@desc":"All metal atoms (new in PyMOL 1.6.1)"},backbone:{"@desc":"Polymer backbone atoms (new in PyMOL 1.6.1)",abbr:["bb."],map:function(){return ure()}},"polymer.protein":{"@desc":"Protein (New in PyMOL 2.1)",abbr:["polymer.protein"],map:function(){return Rt.struct.generator.atomGroups({"residue-test":Rt.core.set.has([Rt.core.type.set(Ms.protein),Rt.ammp("label_comp_id")])})}},"polymer.nucleic":{"@desc":"Nucleic Acid (New in PyMOL 2.1)",abbr:["polymer.nucleic"],map:function(){return Rt.struct.generator.atomGroups({"residue-test":Rt.core.set.has([Rt.core.type.set(Ms.nucleic),Rt.ammp("label_comp_id")])})}}},SHe=fe,yi=function rHe(e){var t={};return Object.keys(e).sort(fd).forEach(function(r){var n=e[r],a=Sm("property '".concat(r,"' not supported")),i=We.regexp(n.regex).map(function(o){return n.isUnsupported&&a(),e5(n.property,n.map(o))});n.isNumeric||(t[r]=i)}),t}(dE),Pi=We.string("/");function ma(e){return e.or(We.of(null))}function CHe(e){var t={},r={};for(var n in e){var a=dE[n];if(!a)throw new Error("property '".concat(n,"' not supported, value '").concat(e[n],"'"));null!==e[n]&&(r[a.level]||(r[a.level]=[]),r[a.level].push(e[n]))}for(var i in r)t[i]=JB(r[i]);return SHe.struct.generator.atomGroups(t)}var xHe=We.createLanguage({Parens:function(e){return We.alt(e.Parens,e.Operator,e.Expression).wrap(We.string("("),We.string(")"))},Expression:function(e){return We.alt(e.Keywords,e.AtomSelectionMacro.map(CHe),e.NamedAtomProperties,e.Pepseq,e.Rep,e.Object)},AtomSelectionMacro:function(e){return We.alt(Pi.then(We.alt(We.seq(ma(e.ObjectProperty).skip(Pi),ma(yi.segi).skip(Pi),ma(yi.chain).skip(Pi),ma(yi.resi).skip(Pi),ma(yi.name)).map(function(t){return{object:t[0],segi:t[1],chain:t[2],resi:t[3],name:t[4]}}),We.seq(ma(e.ObjectProperty).skip(Pi),ma(yi.segi).skip(Pi),ma(yi.chain).skip(Pi),ma(yi.resi)).map(function(t){return{object:t[0],segi:t[1],chain:t[2],resi:t[3]}}),We.seq(ma(e.ObjectProperty).skip(Pi),ma(yi.segi).skip(Pi),ma(yi.chain)).map(function(t){return{object:t[0],segi:t[1],chain:t[2]}}),We.seq(ma(e.ObjectProperty).skip(Pi),ma(yi.segi)).map(function(t){return{object:t[0],segi:t[1]}}),We.seq(ma(e.ObjectProperty)).map(function(t){return{object:t[0]}}))),We.alt(We.seq(ma(e.ObjectProperty).skip(Pi),ma(yi.segi).skip(Pi),ma(yi.chain).skip(Pi),ma(yi.resi).skip(Pi),ma(yi.name)).map(function(t){return{object:t[0],segi:t[1],chain:t[2],resi:t[3],name:t[4]}}),We.seq(ma(yi.segi).skip(Pi),ma(yi.chain).skip(Pi),ma(yi.resi).skip(Pi),ma(yi.name)).map(function(t){return{segi:t[0],chain:t[1],resi:t[2],name:t[3]}}),We.seq(ma(yi.chain).skip(Pi),ma(yi.resi).skip(Pi),ma(yi.name)).map(function(t){return{chain:t[0],resi:t[1],name:t[2]}}),We.seq(ma(yi.resi).skip(Pi),ma(yi.name)).map(function(t){return{resi:t[0],name:t[1]}})))},NamedAtomProperties:function(){var e;return(e=We).alt.apply(e,$te(dE))},Keywords:function(){var e;return(e=We).alt.apply(e,r5(cre))},ObjectProperty:function(){var e=a5(dE,cre,ore).sort(fd).map(U_).join("|");return We.regexp(new RegExp("(?!(".concat(e,"))[A-Z0-9_]+"),"i"))},Object:function(e){return e.ObjectProperty.notFollowedBy(Pi).map(function(t){throw new Error("property 'object' not supported, value '".concat(t,"'"))})},Pepseq:function(){return We.regexp(/(PEPSEQ|ps\.)\s+([a-z]+)/i,2).map(Sm("operator 'pepseq' not supported"))},Rep:function(){return We.regexp(/REP\s+(lines|spheres|mesh|ribbon|cartoon|sticks|dots|surface|labels|extent|nonbonded|nb_spheres|slice|extent|slice|dashes|angles|dihedrals|cgo|cell|callback|everything)/i,1).map(Sm("operator 'rep' not supported"))},Operator:function(e){return rC(ore,We.alt(e.Parens,e.Expression,e.Operator))},Query:function(e){return We.alt(e.Operator,e.Parens,e.Expression).trim(We.optWhitespace)}}),ui=fe,Lu=/[-+]?[0-9]*\.?[0-9]+/,pE=/[+]?[0-9]+/,oC=/[-+]?[0-9]+/;function lg(e){return e}var lre={T:"turn",E:"sheet",B:"strand",H:"alpha",G:"3-10",I:"pi",C:"none"};function o5(e){return ui.struct.type.secondaryStructureFlags([lre[e.toUpperCase()]||"none"])}var fg={name:{"@desc":"str atom name","@examples":["name CA"],regex:/[a-zA-Z0-9]+/,map:ui.atomName,level:"atom-test",property:ui.ammp("label_atom_id")},type:{"@desc":"str atom type","@examples":["type C3"],isUnsupported:!0,regex:/[a-zA-Z0-9]+/,map:lg,level:"atom-test"},index:{"@desc":"num the atom number, starting at 0","@examples":["index 10"],isNumeric:!0,regex:pE,map:function(e){return parseInt(e)-1},level:"atom-test",property:ui.ammp("id")},serial:{"@desc":"num the atom number, starting at 1","@examples":["serial 11"],isNumeric:!0,regex:pE,map:function(e){return parseInt(e)},level:"atom-test",property:ui.ammp("id")},atomicnumber:{"@desc":"num atomic number (0 if undefined)","@examples":["atomicnumber 13"],isNumeric:!0,regex:pE,map:function(e){return parseInt(e)},level:"atom-test",property:ui.acp("atomicNumber")},element:{"@desc":'str atomic element symbol string ("X" if undefined)',"@examples":["element N"],regex:/[a-zA-Z0-9]{1,3}/,map:function(e){return ui.es(e)},level:"atom-test",property:ui.acp("elementSymbol")},altloc:{"@desc":"str alternate location/conformation identifier","@examples":["altloc C"],regex:/[a-zA-Z0-9]+/,map:lg,level:"atom-test",property:ui.ammp("label_alt_id")},chain:{"@desc":"str the one-character chain identifier","@examples":["chain A"],regex:/[a-zA-Z0-9]+/,map:lg,level:"residue-test",property:ui.ammp("auth_asym_id")},residue:{"@desc":"num a set of connected atoms with the same residue number","@examples":["residue < 11","residue 11"],isNumeric:!0,regex:oC,map:function(e){return parseInt(e)},level:"residue-test",property:ui.ammp("auth_seq_id")},fragment:{"@desc":"num a set of connected residues","@examples":["fragment 42"],isUnsupported:!0,isNumeric:!0,regex:oC,map:function(e){return parseInt(e)},level:"residue-test"},pfrag:{"@desc":"num a set of connected protein residues","@examples":["pfrag 42"],isUnsupported:!0,isNumeric:!0,regex:oC,map:function(e){return parseInt(e)},level:"residue-test"},nfrag:{"@desc":"num a set of connected nucleic residues","@examples":["nfrag 42"],isUnsupported:!0,isNumeric:!0,regex:oC,map:function(e){return parseInt(e)},level:"residue-test"},sequence:{"@desc":"str a sequence given by one letter names","@examples":["sequence PGATTACA"],isUnsupported:!0,regex:/[a-zA-Z0-9]+/,map:lg,level:"residue-test"},numbonds:{"@desc":"num number of bonds","@examples":["numbonds = 2","numbonds >= 3"],isNumeric:!0,regex:pE,map:function(e){return parseInt(e)},level:"atom-test",property:ui.acp("bondCount")},resname:{"@desc":"str residue name","@examples":["resname ALA"],regex:/[a-zA-Z0-9]+/,map:lg,level:"residue-test",property:ui.ammp("auth_comp_id")},resid:{"@desc":"num residue id","@examples":["resid 42"],isNumeric:!0,regex:oC,map:function(e){return parseInt(e)},level:"residue-test",property:ui.ammp("auth_seq_id")},segname:{"@desc":"str segment name","@examples":["segname B"],regex:/[a-zA-Z0-9]+/,map:lg,level:"residue-test",property:ui.ammp("label_asym_id")},x:{"@desc":"float x coordinate","@examples":["x 42"],isNumeric:!0,regex:Lu,map:function(e){return parseFloat(e)},level:"atom-test",property:ui.acp("x")},y:{"@desc":"float y coordinate","@examples":["y > 1.7"],isNumeric:!0,regex:Lu,map:function(e){return parseFloat(e)},level:"atom-test",property:ui.acp("y")},z:{"@desc":"float z coordinate","@examples":["z < 11","z > -21"],isNumeric:!0,regex:Lu,map:function(e){return parseFloat(e)},level:"atom-test",property:ui.acp("z")},radius:{"@desc":"float atomic radius","@examples":["radius > 1.3"],isNumeric:!0,regex:Lu,map:function(e){return parseFloat(e)},level:"atom-test",property:ui.acp("vdw")},mass:{"@desc":"float atomic mass","@examples":["mass > 2"],isNumeric:!0,regex:Lu,map:function(e){return parseFloat(e)},level:"atom-test",property:ui.acp("mass")},charge:{"@desc":"float atomic charge","@examples":["charge > 0","charge 1"],isNumeric:!0,regex:Lu,map:function(e){return parseFloat(e)},level:"atom-test",property:ui.ammp("pdbx_formal_charge")},beta:{"@desc":"float temperature factor","@examples":["beta < 20","beta > 35"],isNumeric:!0,regex:Lu,map:function(e){return parseFloat(e)},level:"atom-test",property:ui.ammp("B_iso_or_equiv")},occupancy:{"@desc":"float occupancy","@examples":["occupancy 1","occupancy < 1"],isNumeric:!0,regex:Lu,map:function(e){return parseFloat(e)},level:"atom-test",property:ui.ammp("occupancy")},user:{"@desc":"float time-varying user-specified value","@examples":["user < 0.1"],isUnsupported:!0,isNumeric:!0,regex:Lu,map:function(e){return parseFloat(e)},level:"atom-test"},rasmol:{"@desc":"str translates Rasmol selection string to VMD","@examples":["rasmol 'all'"],isUnsupported:!0,regex:/[^']*/,map:lg,level:"atom-test"},structure:{"@desc":"str single letter name for the secondary structure","@examples":["structure H","structure H E"],regex:/T|E|B|H|G|I|C/i,map:o5,level:"atom-test",property:ui.ammp("secondaryStructureFlags")},phi:{"@desc":"float phi backbone conformational angles","@examples":["phi < 160"],isUnsupported:!0,isNumeric:!0,regex:Lu,map:function(e){return parseFloat(e)},level:"residue-test"},psi:{"@desc":"float psi backbone conformational angles","@examples":["psi < 160"],isUnsupported:!0,isNumeric:!0,regex:Lu,map:function(e){return parseFloat(e)},level:"residue-test"},ufx:{"@desc":"num force to apply in the x coordinate","@examples":["ufx 1"],isUnsupported:!0,isNumeric:!0,regex:Lu,map:function(e){return parseInt(e)},level:"atom-test"},ufy:{"@desc":"num force to apply in the y coordinate","@examples":["ufy 1"],isUnsupported:!0,isNumeric:!0,regex:Lu,map:function(e){return parseInt(e)},level:"atom-test"},ufz:{"@desc":"num force to apply in the z coordinate","@examples":["ufz 1"],isUnsupported:!0,isNumeric:!0,regex:Lu,map:function(e){return parseInt(e)},level:"atom-test"}},dg=fe,AHe=Object.keys(fg).sort(fd).filter(function(e){return!fg[e].isUnsupported}).join("|"),fre=[{"@desc":"Selects atoms that are not included in s1.","@examples":["not protein"],name:"not",type:Ps,rule:We.regexp(/NOT/i).skip(We.whitespace),map:function(e,t){return Sc(t)}},{"@desc":"Selects atoms within a specified distance of a selection","@examples":["within 5 of name FE"],name:"within",type:Ps,rule:_c(/WITHIN\s+([-+]?[0-9]*\.?[0-9]+)\s+OF/i,1).map(function(e){return parseFloat(e)}),map:function(e,t){return dg.struct.modifier.includeSurroundings({0:t,radius:e})}},{"@desc":"Exclusive within, equivalent to (within 3 of X) and not X","@examples":["exwithin 10 of resname HEM"],name:"exwithin",type:Ps,rule:_c(/EXWITHIN\s+([-+]?[0-9]*\.?[0-9]+)\s+OF/i,1).map(function(e){return parseFloat(e)}),map:function(e,t){return dg.struct.modifier.exceptBy({0:dg.struct.modifier.includeSurroundings({0:t,radius:e}),by:t})}},{"@desc":"Selects atoms which have the same keyword as the atoms in a given selection","@examples":["same resid as name FE"],name:"same",type:Ps,rule:_c(new RegExp("SAME\\s+(".concat(AHe,")\\s+AS"),"i"),1).map(function(e){return fg[e].property}),map:function(e,t){return dg.struct.filter.withSameAtomProperties({0:dg.struct.generator.all(),source:t,property:e})}},{"@desc":"Selects atoms included in both s1 and s2.","@examples":["backbone and protein"],name:"and",type:fu,rule:We.alt(Qp(/AND/i),We.whitespace),map:function(e,t,r){return dg.struct.modifier.intersectBy({0:t,by:r})}},{"@desc":"Selects atoms included in either s1 or s2.","@examples":["water or protein"],name:"or",type:fu,rule:Qp(/OR/i),map:function(e,t,r){return dg.struct.combinator.merge([t,r])}}],Ir=fe;function $p(){return Ir.struct.filter.pick({0:Ir.struct.generator.atomGroups({"group-by":Ir.ammp("residueKey")}),test:Ir.core.set.isSubset([dd(["C","N","CA","O"]),Ir.ammpSet("label_atom_id")])})}function s5(){return Ir.struct.filter.pick({0:Ir.struct.generator.atomGroups({"group-by":Ir.ammp("residueKey")}),test:Ir.core.logic.and([Ir.core.set.isSubset([dd(["P"]),Ir.ammpSet("label_atom_id")]),Ir.core.logic.or([Ir.core.set.isSubset([dd(["O3'","C3'","C4'","C5'","O5'"]),Ir.ammpSet("label_atom_id")]),Ir.core.set.isSubset([dd(["O3*","C3*","C4*","C5*","O5*"]),Ir.ammpSet("label_atom_id")])])])})}function dre(){return Ir.struct.combinator.merge([Ir.struct.generator.queryInSelection({0:$p(),query:Ir.struct.generator.atomGroups({"atom-test":Ir.core.set.has([dd(pre.protein),Ir.ammp("label_atom_id")])})}),Ir.struct.generator.queryInSelection({0:s5(),query:Ir.struct.generator.atomGroups({"atom-test":Ir.core.set.has([dd(pre.nucleic),Ir.ammp("label_atom_id")])})})])}function hd(e){return Ir.struct.generator.atomGroups({"residue-test":Ir.core.flags.hasAll([Ir.ammp("secondaryStructureFlags"),Ir.struct.type.secondaryStructureFlags(e)])})}var mre,pg,sC,Ab,pre={nucleic:["P","O3'","O5'","C5'","C4'","C3'","OP1","OP2","O3*","O5*","C5*","C4*","C3*"],protein:["C","N","CA","O"]},Mi={acidic:["ASP","GLU"],aliphatic:["ALA","GLY","ILE","LEU","VAL"],aromatic:["HIS","PHE","TRP","TYR"],at:["ADA","A","THY","T"],basic:["ARG","HIS","LYS"],buried:["ALA","LEU","VAL","ILE","PHE","CYS","MET","TRP"],cg:["CYT","C","GUA","G"],cyclic:["HIS","PHE","PRO","TRP","TYR"],hydrophobic:["ALA","LEU","VAL","ILE","PRO","PHE","MET","TRP"],medium:["VAL","THR","ASP","ASN","PRO","CYS","ASX","PCA","HYP"],neutral:["VAL","PHE","GLN","TYR","HIS","CYS","MET","TRP","ASX","GLX","PCA","HYP"],purine:["ADE","A","GUA","G"],pyrimidine:["CYT","C","THY","T","URI","U"],small:["ALA","GLY","SER"],water:["H2O","HH0","OHH","HOH","OH2","SOL","WAT","TIP","TIP2","TIP3","TIP4"]},hre={all:{"@desc":"everything",map:function(){return Ir.struct.generator.all()}},none:{"@desc":"nothing",map:function(){return Ir.struct.generator.empty()}},protein:{"@desc":"a residue with atoms named C, N, CA, and O",map:function(){return $p()}},nucleic:{"@desc":"a residue with atoms named P, O1P, O2P and either O3', C3', C4', C5', O5' or O3*, C3*, C4*, C5*, O5*. This definition assumes that the base is phosphorylated, an assumption which will be corrected in the future.",map:function(){return s5()}},backbone:{"@desc":"the C, N, CA, and O atoms of a protein and the equivalent atoms in a nucleic acid.",map:function(){return dre()}},sidechain:{"@desc":"non-backbone atoms and bonds",map:function(){return Sc(dre())}},water:{"@desc":"all atoms with the resname H2O, HH0, OHH, HOH, OH2, SOL, WAT, TIP, TIP2, TIP3 or TIP4",abbr:["waters"],map:function(){return rn(Mi.water)}},at:{"@desc":"residues named ADA A THY T",map:function(){return rn(Mi.at)}},acidic:{"@desc":"residues named ASP GLU",map:function(){return rn(Mi.acidic)}},acyclic:{"@desc":'"protein and not cyclic"',map:function(){return Ir.struct.modifier.intersectBy({0:$p(),by:Sc(rn(Mi.cyclic))})}},aliphatic:{"@desc":"residues named ALA GLY ILE LEU VAL",map:function(){return rn(Mi.aliphatic)}},alpha:{"@desc":"atom's residue is an alpha helix",map:function(){return hd(["alpha"])}},amino:{"@desc":"a residue with atoms named C, N, CA, and O",map:function(){return $p()}},aromatic:{"@desc":"residues named HIS PHE TRP TYR",map:function(){return rn(Mi.aromatic)}},basic:{"@desc":"residues named ARG HIS LYS",map:function(){return rn(Mi.basic)}},bonded:{"@desc":"atoms for which numbonds > 0",map:function(){return pd(Ir.struct.filter.pick({0:Ir.struct.modifier.includeConnected({0:Ir.struct.generator.all(),"bond-test":Ir.core.flags.hasAny([Ir.struct.bondProperty.flags(),Ir.struct.type.bondFlags(["covalent","metallic","sulfide"])])}),test:Ir.core.rel.gr([Ir.struct.atomSet.atomCount(),1])}))}},buried:{"@desc":"residues named ALA LEU VAL ILE PHE CYS MET TRP",map:function(){return rn(Mi.buried)}},cg:{"@desc":"residues named CYT C GUA G",map:function(){return rn(Mi.cg)}},charged:{"@desc":'"basic or acidic"',map:function(){return rn(Mi.basic.concat(Mi.acidic))}},cyclic:{"@desc":"residues named HIS PHE PRO TRP TYR",map:function(){return rn(Mi.cyclic)}},hetero:{"@desc":'"not (protein or nucleic)"',map:function(){return Sc(Ir.struct.combinator.merge([$p(),s5()]))}},hydrogen:{"@desc":'name "[0-9]?H.*"',map:function(){return Ir.struct.generator.atomGroups({"atom-test":Ir.core.str.match([Ir.core.type.regex(["^[0-9]?[H].*$","i"]),Ir.core.type.str([Ir.ammp("label_atom_id")])])})}},large:{"@desc":'"protein and not (small or medium)"',map:function(){return Ir.struct.modifier.intersectBy({0:$p(),by:Sc(rn(Mi.small.concat(Mi.medium)))})}},medium:{"@desc":"residues named VAL THR ASP ASN PRO CYS ASX PCA HYP",map:function(){return rn(Mi.medium)}},neutral:{"@desc":"residues named VAL PHE GLN TYR HIS CYS MET TRP ASX GLX PCA HYP",map:function(){return rn(Mi.neutral)}},hydrophobic:{"@desc":"hydrophobic resname ALA LEU VAL ILE PRO PHE MET TRP",map:function(){return rn(Mi.hydrophobic)}},polar:{"@desc":'"protein and not hydrophobic"',map:function(){return Ir.struct.modifier.intersectBy({0:$p(),by:Sc(rn(Mi.hydrophobic))})}},purine:{"@desc":"residues named ADE A GUA G",map:function(){return rn(Mi.purine)}},pyrimidine:{"@desc":"residues named CYT C THY T URI U",map:function(){return rn(Mi.pyrimidine)}},small:{"@desc":"residues named ALA GLY SER",map:function(){return rn(Mi.small)}},surface:{"@desc":'"protein and not buried"',map:function(){return Ir.struct.modifier.intersectBy({0:$p(),by:Sc(rn(Mi.buried))})}},alpha_helix:{"@desc":"atom's residue is in an alpha helix",map:function(){return hd(["alpha"])}},pi_helix:{"@desc":"atom's residue is in a pi helix",map:function(){return hd(["pi"])}},helix_3_10:{"@desc":"atom's residue is in a 3-10 helix",map:function(){return hd(["3-10"])}},helix:{"@desc":"atom's residue is in an alpha or pi or 3-10 helix",map:function(){return hd(["helix"])}},extended_beta:{"@desc":"atom's residue is a beta sheet",map:function(){return hd(["sheet"])}},bridge_beta:{"@desc":"atom's residue is a beta sheet",map:function(){return hd(["strand"])}},sheet:{"@desc":"atom's residue is a beta sheet",map:function(){return hd(["beta"])}},turn:{"@desc":"atom's residue is in a turn conformation",map:function(){return hd(["turn"])}},coil:{"@desc":"atom's residue is in a coil conformation",map:function(){return Ir.struct.modifier.intersectBy({0:$p(),by:hd(["none"])})}}},ss=fe,THe={sqr:{"@desc":"square of x","@examples":["sqr(2)"],map:function(e){return ss.core.math.pow([e,2])}},sqrt:{"@desc":"square root of x","@examples":["sqrt(2)"],map:function(e){return ss.core.math.sqrt([e])}},abs:{"@desc":"absolute value of x","@examples":["abs(2)"],map:function(e){return ss.core.math.abs([e])}},floor:{"@desc":"largest integer not greater than x","@examples":["floor(2)"],map:function(e){return ss.core.math.floor([e])}},ceil:{"@desc":"smallest integer not less than x","@examples":["ceil(2)"],map:function(e){return ss.core.math.ceil([e])}},sin:{"@desc":"sine of x","@examples":["sin(2)"],map:function(e){return ss.core.math.sin([e])}},cos:{"@desc":"cosine of x","@examples":["cos(2)"],map:function(e){return ss.core.math.cos([e])}},tan:{"@desc":"tangent of x","@examples":["tan(2)"],map:function(e){return ss.core.math.tan([e])}},atan:{"@desc":"arctangent of x","@examples":["atan(2)"],map:function(e){return ss.core.math.atan([e])}},asin:{"@desc":"arcsin of x","@examples":["asin(2)"],map:function(e){return ss.core.math.asin([e])}},acos:{"@desc":"arccos of x","@examples":["acos(2)"],map:function(e){return ss.core.math.acos([e])}},sinh:{"@desc":"hyperbolic sine of x","@examples":["sinh(2)"],map:function(e){return ss.core.math.sinh([e])}},cosh:{"@desc":"hyperbolic cosine of x","@examples":["cosh(2)"],map:function(e){return ss.core.math.cosh([e])}},tanh:{"@desc":"hyperbolic tangent of x","@examples":["tanh(2)"],map:function(e){return ss.core.math.tanh([e])}},exp:{"@desc":"e to the power x","@examples":["exp(2)"],map:function(e){return ss.core.math.exp([e])}},log:{"@desc":"natural log of x","@examples":["log(2)"],map:function(e){return ss.core.math.log([e])}},log10:{"@desc":"log base 10 of x","@examples":["log10(2)"],map:function(e){return ss.core.math.log10([e])}}},Ea=fe,DHe=[{"@desc":"multiplication, division","@examples":[],name:"mul-div",type:fu,rule:We.regexp(/\s*(\*|\/)\s*/,1),map:function(e,t,r){switch(e){case"*":return Ea.core.math.mult([t,r]);case"/":return Ea.core.math.div([t,r]);default:throw new Error("value operator '".concat(e,"' not supported"))}}},{"@desc":"addition, substraction","@examples":[],name:"add-sub",type:fu,rule:We.regexp(/\s*(-|\+)\s*/,1),map:function(e,t,r){switch(e){case"-":return Ea.core.math.sub([t,r]);case"+":return Ea.core.math.add([t,r]);default:throw new Error("value operator '".concat(e,"' not supported"))}}},{"@desc":"value comparisons","@examples":[],name:"comparison",type:fu,rule:We.alt(We.regexp(/\s*(=~|==|>=|<=|=|!=|>|<)\s*/,1),We.whitespace.result("=")),map:function(e,t,r){var n;if(void 0!==t.head?("structure-query.atom-property.macromolecular.secondary-structure-flags"===t.head.name&&(n=Ea.core.flags.hasAny([t,o5(r)])),"core.type.regex"===t.head.name&&(n=Ea.core.str.match([t,Ea.core.type.str([r])]))):void 0!==r.head?("structure-query.atom-property.macromolecular.secondary-structure-flags"===r.head.name&&(n=Ea.core.flags.hasAny([r,o5(t)])),"core.type.regex"===r.head.name&&(n=Ea.core.str.match([r,Ea.core.type.str([t])]))):"=~"===e&&(n=Ea.core.str.match(t.head?[Ea.core.type.regex(["^".concat(r,"$"),"i"]),Ea.core.type.str([t])]:[Ea.core.type.regex(["^".concat(t,"$"),"i"]),Ea.core.type.str([r])])),!n)switch(t.head&&(r=nC(t,r)),r.head&&(t=nC(r,t)),e){case"=":case"==":n=Ea.core.rel.eq([t,r]);break;case"!=":n=Ea.core.rel.neq([t,r]);break;case">":n=Ea.core.rel.gr([t,r]);break;case"<":n=Ea.core.rel.lt([t,r]);break;case">=":n=Ea.core.rel.gre([t,r]);break;case"<=":n=Ea.core.rel.lte([t,r]);break;default:throw new Error("value operator '".concat(e,"' not supported"))}return Ea.struct.generator.atomGroups({"atom-test":n})}}],EHe=We.createLanguage({Parens:function(e){return We.alt(e.Parens,e.Operator,e.Expression).wrap(We.string("("),We.string(")"))},Expression:function(e){return We.alt(e.RangeListProperty,e.ValueQuery,e.Keywords)},NamedAtomProperties:function(){var e;return(e=We).alt.apply(e,$te(fg))},Keywords:function(){var e;return(e=We).alt.apply(e,r5(hre))},ValueRange:function(e){return We.seq(e.Value.skip(We.regexp(/\s+TO\s+/i)),e.Value).map(function(t){return{range:t}})},RangeListProperty:function(e){var t;return We.seq((t=We).alt.apply(t,n5(fg,/\s/)).skip(We.whitespace),We.alt(e.ValueRange,e.Value).sepBy1(We.whitespace)).map(function(r){var n,a=r[0],o=[],s=[];r[1].forEach(function(f){f.range?s.push(Ea.core.rel.inRange([a,f.range[0],f.range[1]])):o.push(nC(a,f,lre))});var l,u=function tHe(e){return 1===e.length?e[0]:e.length>1?qn.core.logic.or(e):void 0}(s),c=function cHe(e,t){if(uHe.includes(e.head.name)){var r=t[0].head,n=[];return t.forEach(function(a){return n.push.apply(n,a.args[0])}),qn.core.flags.hasAny([e,{head:r,args:n}])}return 1===t.length?qn.core.rel.eq([e,t[0]]):t.length>1?qn.core.set.has([qn.core.type.set(t),e]):void 0}(a,o);return l=u&&c?Ea.core.logic.or([u,c]):u||c,Ea.struct.generator.atomGroups(((n={})[function sHe(e){if(e.head.name.startsWith("structure-query.atom-property.macromolecular.")){var t=e.head.name.substr(45);if(aHe.includes(t))return"entity-test";if(iHe.includes(t))return"chain-test";if(oHe.includes(t))return"residue-test"}return"atom-test"}(a)]=l,n))})},Operator:function(e){return rC(fre,We.alt(e.Parens,e.Expression,e.ValueQuery))},Query:function(e){return We.alt(e.Operator,e.Parens,e.Expression).trim(We.optWhitespace)},Number:function(){return We.regexp(/-?(0|[1-9][0-9]*)([.][0-9]+)?([eE][+-]?[0-9]+)?/).map(Number).desc("number")},String:function(){var e=a5(fg,hre,fre).sort(fd).map(U_).join("|");return We.alt(We.regexp(new RegExp("(?!(".concat(e,"))[A-Z0-9_]+"),"i")),We.regexp(/'((?:[^"\\]|\\.)*)'/,1),We.regexp(/"((?:[^"\\]|\\.)*)"/,1).map(function(t){return Ea.core.type.regex(["^".concat(t,"$"),"i"])})).desc("string")},Value:function(e){return We.alt(e.Number,e.String)},ValueParens:function(e){return We.alt(e.ValueParens,e.ValueOperator,e.ValueExpressions).wrap(We.string("("),We.string(")"))},ValuePropertyNames:function(){var e;return(e=We).alt.apply(e,n5(fg,/=~|==|>=|<=|=|!=|>|<|\)|\s|\+|-|\*|\//i))},ValueOperator:function(e){return rC(DHe,We.alt(e.ValueParens,e.ValueExpressions))},ValueExpressions:function(e){return We.alt(e.ValueFunctions,e.Value,e.ValuePropertyNames)},ValueFunctions:function(e){var t;return(t=We).alt.apply(t,function nHe(e,t){var r=[],n=We.regexp(/\(\s*/),a=We.regexp(/\s*\)/);return Object.keys(e).sort(fd).forEach(function(i){var o=e[i],s=o.map?o.map:Sm("function '".concat(i,"' not supported")),u=We.regexp(new RegExp(i,"i")).skip(n).then(t).skip(a).map(s);r.push(u)}),r}(THe,e.ValueOperator))},ValueQuery:function(e){return We.alt(e.ValueOperator.map(function(t){if(!t.head.name||!t.head.name.startsWith("structure-query.generator"))throw new Error("values must be part of an comparison, value '".concat(t,"'"));return t}))}}),PHe={pymol:function(e){return xHe.Query.tryParse(e)},vmd:function(e){return EHe.Query.tryParse(e)},jmol:function(e){return mHe.Query.tryParse(e)}},MHe=PHe,kHe=function(){function e(){this.map=new Map}return e.prototype.removeSymbol=function(t){this.map.delete(t.symbol.id)},e.prototype.addSymbol=function(t){this.map.has(t.symbol.id)&&console.warn("Symbol '".concat(t.symbol.id,"' already added. Call removeSymbol/removeCustomProps re-adding the symbol.")),this.map.set(t.symbol.id,t)},e.prototype.addCustomProp=function(t){if(t.symbols)for(var r=0,n=Object.keys(t.symbols);rt[1](e)}),ar(_e.core.rel.gre,function(e,t){return t[0](e)>=t[1](e)}),ar(_e.core.rel.inRange,function(e,t){var r=t[0](e);return r>=t[1](e)&&r<=t[2](e)}),ar(_e.core.math.add,function(e,t){var r=0;if("number"==typeof t.length)for(var n=0,a=t.length;n0&&b.push(["assembly","Assembly"]),d&&(b.push(["symmetry-mates","Symmetry Mates"]),b.push(["symmetry","Symmetry (indices)"]),b.push(["symmetry-assembly","Symmetry (assembly)"])),{type:D.MappedStatic(c||"model",y,{options:b})}},e.canAutoUpdate=function r(u,c){return!("symmetry-assembly"===c.name||"symmetry"===c.name&&"symmetry"===u.name)},e.create=function s(u,c,l,f){return ce(this,void 0,void 0,function(){var d,p,h;return le(this,function(m){return d=f?.params,(p=ri.Provider.get(l))&&f&&"model"!==f.name?"auto"===f.name?0===p.assemblies.length?(h=Ye.ofModel(l,d),[2,new ve.Molecule.Structure(h,{label:"Model",description:Ye.elementDescription(h)})]):[2,n(u,c,l,void 0,d)]:"assembly"===f.name?[2,n(u,c,l,f.params.id,d)]:"symmetry"===f.name?[2,a(c,l,f.params.ijkMin,f.params.ijkMax,d)]:"symmetry-mates"===f.name?[2,i(c,l,f.params.radius,d)]:"symmetry-assembly"===f.name?[2,o(c,l,f.params.generators,p,d)]:(xn(),[2]):(h=Ye.ofModel(l,d),[2,new ve.Molecule.Structure(h,{label:"Model",description:Ye.elementDescription(h)})])})})}}(hg||(hg={})),function(e){function r(s,u){var c=Ri.is(u)?u:void 0,l=Ri.is(u)?Ri.toExpression(u):u;return{script:c,expression:l,compiled:uC(l),originalStructure:s,currentStructure:s}}function n(s,u){return s.compiled(new Hc(u))}e.isUnchanged=function t(s,u,c){return s.currentStructure===c&&(Ri.is(u)?!!s.script&&Ri.areEqual(s.script,u):s.expression===u)},e.create=r,e.run=n,e.createAndRun=function a(s,u){var c=r(s,u);return{entry:c,selection:n(c,s)}},e.updateStructure=function i(s,u){return s.currentStructure=u,s.compiled(new Hc(u))},e.updateStructureObject=function o(s,u,c){var l=mt.unionStructure(u);s.label="".concat(c||"Selection"),s.description=Ye.elementDescription(l),s.data=l}}(Rs||(Rs={}));var BHe=new Set(["LI","NA","K","RB","CS","FR"]),UHe=new Set(["BE","MG","CA","SR","BA","RA"]),YHe=new Set(["ZN","GA","CD","IN","SN","HG","TI","PB","BI","PO","CN"]),ZHe=new Set(["F","CL","BR","I","AT"]);function QHe(e){return ZHe.has(e)}function _re(e){var t=J_(e);return t>=21&&t<=29||t>=39&&t<=47||t>=72&&t<=79||t>=104&&t<=108}function eje(e){return function LHe(e){return BHe.has(e)}(e)||function VHe(e){return UHe.has(e)}(e)||function $He(e){var t=J_(e);return t>=57&&t<=71}(e)||function JHe(e){var t=J_(e);return t>=89&&t<=103}(e)||_re(e)||function XHe(e){return YHe.has(e)}(e)}var hn=function(e){return e.Type="Type",e.Structure="Structure Property",e.Atom="Atom Property",e.Bond="Bond Property",e.Residue="Residue Property",e.AminoAcid="Amino Acid",e.NucleicBase="Nucleic Base",e.Manipulate="Manipulate Selection",e.Validation="Validation",e.Misc="Miscellaneous",e.Internal="Internal",e}(hn||{});function fn(e,t,r){var n,a;return void 0===r&&(r={}),{label:e,expression:t,description:r.description||"",category:null!==(n=r.category)&&void 0!==n?n:hn.Misc,isHidden:!!r.isHidden,priority:r.priority||0,referencesCurrent:!!r.referencesCurrent,get query(){return a||(a=uC(t)),a},ensureCustomProperties:r.ensureCustomProperties,getSelection:function(i,o,s){return ce(this,void 0,void 0,function(){var u,c;return le(this,function(l){switch(l.label){case 0:return u=i.managers.structure.selection.getStructure(s),c=u?mt.Sequence(s,[u]):mt.Empty(s),r.ensureCustomProperties?[4,r.ensureCustomProperties({runtime:o,assetManager:i.managers.asset},s)]:[3,2];case 1:l.sent(),l.label=2;case 2:return a||(a=uC(t)),[2,a(new Hc(s,{currentSelection:c}))]}})})}}}var tje=fn("All",fe.struct.generator.all(),{category:"",priority:1e3}),rje=fn("Current Selection",fe.internal.generator.current(),{category:"",referencesCurrent:!0}),nje=fn("Polymer",fe.struct.modifier.union([fe.struct.generator.atomGroups({"entity-test":fe.core.logic.and([fe.core.rel.eq([fe.ammp("entityType"),"polymer"]),fe.core.str.match([fe.re("(polypeptide|cyclic-pseudo-peptide|peptide-like|nucleotide|peptide nucleic acid)","i"),fe.ammp("entitySubtype")])])})]),{category:hn.Type}),aje=fn("Trace",fe.struct.modifier.union([fe.struct.combinator.merge([fe.struct.modifier.union([fe.struct.generator.atomGroups({"entity-test":fe.core.rel.eq([fe.ammp("entityType"),"polymer"]),"chain-test":fe.core.set.has([fe.set("sphere","gaussian"),fe.ammp("objectPrimitive")])})]),fe.struct.modifier.union([fe.struct.generator.atomGroups({"entity-test":fe.core.rel.eq([fe.ammp("entityType"),"polymer"]),"chain-test":fe.core.rel.eq([fe.ammp("objectPrimitive"),"atomistic"]),"atom-test":fe.core.set.has([fe.set("CA","P"),fe.ammp("label_atom_id")])})])])]),{category:hn.Structure}),Db=fe.core.logic.and([fe.core.rel.eq([fe.ammp("entityType"),"polymer"]),fe.core.str.match([fe.re("(polypeptide|cyclic-pseudo-peptide|peptide-like)","i"),fe.ammp("entitySubtype")])]),mE=fe.core.logic.and([fe.core.rel.eq([fe.ammp("entityType"),"polymer"]),fe.core.str.match([fe.re("(nucleotide|peptide nucleic acid)","i"),fe.ammp("entitySubtype")])]),mg=fe.core.str.match([fe.re("non-polymer|(amino|carboxy) terminus|peptide-like","i"),fe.ammp("chemCompType")]),ije=fn("Backbone",fe.struct.modifier.union([fe.struct.combinator.merge([fe.struct.modifier.union([fe.struct.generator.atomGroups({"entity-test":Db,"chain-test":fe.core.rel.eq([fe.ammp("objectPrimitive"),"atomistic"]),"residue-test":fe.core.logic.not([mg]),"atom-test":fe.core.set.has([fe.set.apply(fe,pa.toArray(dp)),fe.ammp("label_atom_id")])})]),fe.struct.modifier.union([fe.struct.generator.atomGroups({"entity-test":mE,"chain-test":fe.core.rel.eq([fe.ammp("objectPrimitive"),"atomistic"]),"residue-test":fe.core.logic.not([mg]),"atom-test":fe.core.set.has([fe.set.apply(fe,pa.toArray(CT)),fe.ammp("label_atom_id")])})])])]),{category:hn.Structure}),oje=fn("Sidechain",fe.struct.modifier.union([fe.struct.combinator.merge([fe.struct.modifier.union([fe.struct.generator.atomGroups({"entity-test":Db,"chain-test":fe.core.rel.eq([fe.ammp("objectPrimitive"),"atomistic"]),"residue-test":fe.core.logic.not([mg]),"atom-test":fe.core.logic.or([fe.core.logic.not([fe.core.set.has([fe.set.apply(fe,pa.toArray(dp)),fe.ammp("label_atom_id")])])])})]),fe.struct.modifier.union([fe.struct.generator.atomGroups({"entity-test":mE,"chain-test":fe.core.rel.eq([fe.ammp("objectPrimitive"),"atomistic"]),"residue-test":fe.core.logic.not([mg]),"atom-test":fe.core.logic.or([fe.core.logic.not([fe.core.set.has([fe.set.apply(fe,pa.toArray(CT)),fe.ammp("label_atom_id")])])])})])])]),{category:hn.Structure}),sje=fn("Sidechain with Trace",fe.struct.modifier.union([fe.struct.combinator.merge([fe.struct.modifier.union([fe.struct.generator.atomGroups({"entity-test":Db,"chain-test":fe.core.rel.eq([fe.ammp("objectPrimitive"),"atomistic"]),"residue-test":fe.core.logic.not([mg]),"atom-test":fe.core.logic.or([fe.core.logic.not([fe.core.set.has([fe.set.apply(fe,pa.toArray(dp)),fe.ammp("label_atom_id")])]),fe.core.rel.eq([fe.ammp("label_atom_id"),"CA"]),fe.core.logic.and([fe.core.rel.eq([fe.ammp("auth_comp_id"),"PRO"]),fe.core.rel.eq([fe.ammp("label_atom_id"),"N"])])])})]),fe.struct.modifier.union([fe.struct.generator.atomGroups({"entity-test":mE,"chain-test":fe.core.rel.eq([fe.ammp("objectPrimitive"),"atomistic"]),"residue-test":fe.core.logic.not([mg]),"atom-test":fe.core.logic.or([fe.core.logic.not([fe.core.set.has([fe.set.apply(fe,pa.toArray(CT)),fe.ammp("label_atom_id")])]),fe.core.rel.eq([fe.ammp("label_atom_id"),"P"])])})])])]),{category:hn.Structure}),uje=fn("Protein",fe.struct.modifier.union([fe.struct.generator.atomGroups({"entity-test":Db})]),{category:hn.Type}),cje=fn("Nucleic",fe.struct.modifier.union([fe.struct.generator.atomGroups({"entity-test":mE})]),{category:hn.Type}),lje=fn("Helix",fe.struct.modifier.union([fe.struct.generator.atomGroups({"entity-test":Db,"residue-test":fe.core.flags.hasAny([fe.ammp("secondaryStructureFlags"),fe.core.type.bitflags([2])])})]),{category:hn.Structure,ensureCustomProperties:function(e,t){return Yc.attach(e,t)}}),fje=fn("Beta Strand/Sheet",fe.struct.modifier.union([fe.struct.generator.atomGroups({"entity-test":Db,"residue-test":fe.core.flags.hasAny([fe.ammp("secondaryStructureFlags"),fe.core.type.bitflags([4])])})]),{category:hn.Structure,ensureCustomProperties:function(e,t){return Yc.attach(e,t)}}),dje=fn("Water",fe.struct.modifier.union([fe.struct.generator.atomGroups({"entity-test":fe.core.rel.eq([fe.ammp("entityType"),"water"])})]),{category:hn.Type}),pje=fn("Ion",fe.struct.modifier.union([fe.struct.generator.atomGroups({"entity-test":fe.core.rel.eq([fe.ammp("entitySubtype"),"ion"])})]),{category:hn.Type}),hje=fn("Lipid",fe.struct.modifier.union([fe.struct.generator.atomGroups({"entity-test":fe.core.rel.eq([fe.ammp("entitySubtype"),"lipid"])})]),{category:hn.Type}),vE=fn("Carbohydrate",fe.struct.modifier.union([fe.struct.generator.atomGroups({"entity-test":fe.core.logic.or([fe.core.rel.eq([fe.ammp("entityType"),"branched"]),fe.core.logic.and([fe.core.rel.eq([fe.ammp("entityType"),"non-polymer"]),fe.core.str.match([fe.re("oligosaccharide","i"),fe.ammp("entitySubtype")])])])})]),{category:hn.Type}),Sre=fn("Carbohydrate with Connected",fe.struct.modifier.union([fe.struct.modifier.includeConnected({0:vE.expression,"layer-count":1,"as-whole-residues":!0})]),{category:hn.Internal,isHidden:!0}),Cre=fn("Connected to Carbohydrate",fe.struct.modifier.union([fe.struct.modifier.exceptBy({0:Sre.expression,by:vE.expression})]),{category:hn.Internal,isHidden:!0}),c5=fn("Ligand",fe.struct.modifier.union([fe.struct.modifier.exceptBy({0:fe.struct.modifier.union([fe.struct.combinator.merge([fe.struct.modifier.union([fe.struct.generator.atomGroups({"entity-test":fe.core.logic.and([fe.core.logic.or([fe.core.rel.eq([fe.ammp("entityType"),"non-polymer"]),fe.core.rel.neq([fe.ammp("entityPrdId"),""])]),fe.core.logic.not([fe.core.str.match([fe.re("(oligosaccharide|lipid|ion)","i"),fe.ammp("entitySubtype")])])]),"chain-test":fe.core.rel.eq([fe.ammp("objectPrimitive"),"atomistic"]),"residue-test":fe.core.logic.not([fe.core.str.match([fe.re("saccharide","i"),fe.ammp("chemCompType")])])})]),fe.struct.modifier.union([fe.struct.generator.atomGroups({"entity-test":fe.core.rel.eq([fe.ammp("entityType"),"polymer"]),"chain-test":fe.core.rel.eq([fe.ammp("objectPrimitive"),"atomistic"]),"residue-test":mg})])])]),by:fe.struct.combinator.merge([fe.struct.modifier.union([fe.struct.generator.atomGroups({"entity-test":fe.core.rel.eq([fe.ammp("entityType"),"polymer"]),"chain-test":fe.core.rel.eq([fe.ammp("objectPrimitive"),"atomistic"]),"residue-test":fe.core.set.has([fe.set.apply(fe,pa.toArray(Uy)),fe.ammp("label_comp_id")])})]),fe.struct.generator.atomGroups({"chain-test":fe.core.rel.eq([fe.ammp("objectPrimitive"),"atomistic"]),"residue-test":fe.core.set.has([fe.set.apply(fe,pa.toArray(CMe)),fe.ammp("label_comp_id")])})])})]),{category:hn.Type}),xre=fn("Ligand with Connected",fe.struct.modifier.union([fe.struct.modifier.exceptBy({0:fe.struct.modifier.union([fe.struct.modifier.includeConnected({0:c5.expression,"layer-count":1,"as-whole-residues":!0,"bond-test":fe.core.flags.hasAny([fe.struct.bondProperty.flags(),fe.core.type.bitflags([3])])})]),by:vE.expression})]),{category:hn.Internal,isHidden:!0}),wre=fn("Connected to Ligand",fe.struct.modifier.union([fe.struct.modifier.exceptBy({0:xre.expression,by:c5.expression})]),{category:hn.Internal,isHidden:!0}),mje=fn("Connected to Ligand or Carbohydrate",fe.struct.modifier.union([fe.struct.combinator.merge([Cre.expression,wre.expression])]),{category:hn.Internal,isHidden:!0}),vje=fn("Disulfide Bridges",fe.struct.modifier.union([fe.struct.combinator.merge([fe.struct.modifier.union([fe.struct.modifier.wholeResidues([fe.struct.filter.isConnectedTo({0:fe.struct.generator.atomGroups({"residue-test":fe.core.set.has([fe.set("CYS"),fe.ammp("auth_comp_id")]),"atom-test":fe.core.set.has([fe.set("SG"),fe.ammp("label_atom_id")])}),target:fe.struct.generator.atomGroups({"residue-test":fe.core.set.has([fe.set("CYS"),fe.ammp("auth_comp_id")]),"atom-test":fe.core.set.has([fe.set("SG"),fe.ammp("label_atom_id")])}),"bond-test":!0})])]),fe.struct.modifier.union([fe.struct.modifier.wholeResidues([fe.struct.modifier.union([fe.struct.generator.bondedAtomicPairs({0:fe.core.flags.hasAny([fe.struct.bondProperty.flags(),fe.core.type.bitflags([8])])})])])])])]),{category:hn.Bond}),gje=fn("NOS Bridges",fe.struct.modifier.union([fe.struct.modifier.wholeResidues([fe.struct.filter.isConnectedTo({0:fe.struct.generator.atomGroups({"residue-test":fe.core.set.has([fe.set("CSO","LYS"),fe.ammp("auth_comp_id")]),"atom-test":fe.core.set.has([fe.set("OD","NZ"),fe.ammp("label_atom_id")])}),target:fe.struct.generator.atomGroups({"residue-test":fe.core.set.has([fe.set("CSO","LYS"),fe.ammp("auth_comp_id")]),"atom-test":fe.core.set.has([fe.set("OD","NZ"),fe.ammp("label_atom_id")])}),"bond-test":!0})])]),{category:hn.Bond}),yje=fn("Non-standard Residues in Polymers",fe.struct.modifier.union([fe.struct.generator.atomGroups({"entity-test":fe.core.rel.eq([fe.ammp("entityType"),"polymer"]),"chain-test":fe.core.rel.eq([fe.ammp("objectPrimitive"),"atomistic"]),"residue-test":fe.ammp("isNonStandard")})]),{category:hn.Residue}),bje=fn("Coarse Elements",fe.struct.modifier.union([fe.struct.generator.atomGroups({"chain-test":fe.core.set.has([fe.set("sphere","gaussian"),fe.ammp("objectPrimitive")])})]),{category:hn.Type}),_je=fn("Rings in Residues",fe.struct.modifier.union([fe.struct.generator.rings()]),{category:hn.Residue}),Sje=fn("Aromatic Rings in Residues",fe.struct.modifier.union([fe.struct.generator.rings({"only-aromatic":!0})]),{category:hn.Residue}),Cje=fn("Surrounding Residues (5 \u212b) of Selection",fe.struct.modifier.union([fe.struct.modifier.exceptBy({0:fe.struct.modifier.includeSurroundings({0:fe.internal.generator.current(),radius:5,"as-whole-residues":!0}),by:fe.internal.generator.current()})]),{description:"Select residues within 5 \u212b of the current selection.",category:hn.Manipulate,referencesCurrent:!0}),xje=fn("Surrounding Ligands (5 \u212b) of Selection",fe.struct.modifier.union([fe.struct.modifier.surroundingLigands({0:fe.internal.generator.current(),radius:5,"include-water":!0})]),{description:"Select ligand components within 5 \u212b of the current selection.",category:hn.Manipulate,referencesCurrent:!0}),wje=fn("Surrounding Atoms (5 \u212b) of Selection",fe.struct.modifier.union([fe.struct.modifier.exceptBy({0:fe.struct.modifier.includeSurroundings({0:fe.internal.generator.current(),radius:5,"as-whole-residues":!1}),by:fe.internal.generator.current()})]),{description:"Select atoms within 5 \u212b of the current selection.",category:hn.Manipulate,referencesCurrent:!0}),Aje=fn("Inverse / Complement of Selection",fe.struct.modifier.union([fe.struct.modifier.exceptBy({0:fe.struct.generator.all(),by:fe.internal.generator.current()})]),{description:"Select everything not in the current selection.",category:hn.Manipulate,referencesCurrent:!0}),Tje=fn("Residues Covalently Bonded to Selection",fe.struct.modifier.union([fe.struct.modifier.includeConnected({0:fe.internal.generator.current(),"layer-count":1,"as-whole-residues":!0})]),{description:"Select residues covalently bonded to current selection.",category:hn.Manipulate,referencesCurrent:!0}),Dje=fn("Covalently Bonded Component",fe.struct.modifier.union([fe.struct.modifier.includeConnected({0:fe.internal.generator.current(),"fixed-point":!0})]),{description:"Select covalently bonded component based on current selection.",category:hn.Manipulate,referencesCurrent:!0}),Eje=fn("Residues with Cov. or Metallic Bond to Selection",fe.struct.modifier.union([fe.struct.modifier.includeConnected({0:fe.internal.generator.current(),"layer-count":1,"as-whole-residues":!0,"bond-test":fe.core.flags.hasAny([fe.struct.bondProperty.flags(),fe.core.type.bitflags([3])])})]),{description:"Select residues with covalent or metallic bond to current selection.",category:hn.Manipulate,referencesCurrent:!0}),Ije=fn("Whole Residues of Selection",fe.struct.modifier.union([fe.struct.modifier.wholeResidues({0:fe.internal.generator.current()})]),{description:"Expand current selection to whole residues.",category:hn.Manipulate,referencesCurrent:!0}),Pje=[[["HIS"],"Histidine"],[["ARG"],"Arginine"],[["LYS"],"Lysine"],[["ILE"],"Isoleucine"],[["PHE"],"Phenylalanine"],[["LEU"],"Leucine"],[["TRP"],"Tryptophan"],[["ALA"],"Alanine"],[["MET"],"Methionine"],[["PRO"],"Proline"],[["CYS"],"Cysteine"],[["ASN"],"Asparagine"],[["VAL"],"Valine"],[["GLY"],"Glycine"],[["SER"],"Serine"],[["GLN"],"Glutamine"],[["TYR"],"Tyrosine"],[["ASP"],"Aspartic Acid"],[["GLU"],"Glutamic Acid"],[["THR"],"Threonine"],[["SEC"],"Selenocysteine"],[["PYL"],"Pyrrolysine"],[["UNK"],"Unknown"]].sort(function(e,t){return e[1]t[1]?1:0}),Mje=[[["A","DA"],"Adenosine"],[["C","DC"],"Cytidine"],[["T","DT"],"Thymidine"],[["G","DG"],"Guanosine"],[["I","DI"],"Inosine"],[["U","DU"],"Uridine"],[["N","DN"],"Unknown"]].sort(function(e,t){return e[1]t[1]?1:0});function l5(e,t,r){var n=e[0],a=e[1];void 0===r&&(r=0);var i=1!==n.length||Are.has(n[0])?"".concat(a," (").concat(n.join(", "),")"):"[".concat(n[0],"] ").concat(a);return fn(i,fe.struct.modifier.union([fe.struct.generator.atomGroups({"residue-test":fe.core.set.has([fe.set.apply(fe,n),fe.ammp("auth_comp_id")])})]),{category:t,priority:r,description:i})}var f5,cC,d5,Are=pa.unionMany(BO,z_,G_,xT),ki={all:tje,current:rje,polymer:nje,trace:aje,backbone:ije,sidechain:oje,sidechainWithTrace:sje,protein:uje,nucleic:cje,helix:lje,beta:fje,water:dje,ion:pje,lipid:hje,branched:vE,branchedPlusConnected:Sre,branchedConnectedOnly:Cre,ligand:c5,ligandPlusConnected:xre,ligandConnectedOnly:wre,connectedOnly:mje,disulfideBridges:vje,nosBridges:gje,nonStandardPolymer:yje,coarse:bje,ring:_je,aromaticRing:Sje,surroundings:Cje,surroundingLigands:xje,surroundingAtoms:wje,complement:Aje,covalentlyBonded:Tje,covalentlyOrMetallicBonded:Eje,covalentlyBondedComponent:Dje,wholeResidues:Ije},Oje=function(){function e(){var t,r;this.list=[],this.options=[],this.version=1,(t=this.list).push.apply(t,ur(ur(ur([],Object.values(ki),!1),Pje.map(function(n){return l5(n,hn.AminoAcid)}),!1),Mje.map(function(n){return l5(n,hn.NucleicBase)}),!1)),(r=this.options).push.apply(r,this.list.map(function(n){return[n,n.label,n.category]}))}return e.prototype.add=function(t){this.list.push(t),this.options.push([t,t.label,t.category]),this.version+=1},e.prototype.remove=function(t){var r=this.list.indexOf(t);-1!==r&&(this.list.splice(r,1),this.options.splice(r,1),this.version+=1)},e}();function Lje(e){switch(e){case 7:return-3;case 6:return-2;case 5:return-1;case 0:case 4:return 0;case 3:return 1;case 2:return 2;case 1:return 3;default:return console.error("Value ".concat(e," is outside the 0-7 range, defaulting to 0.")),0}}function Tre(e,t){for(var r=Ke.create(e.data,2*t),n=Ke.create(e.data,2*t),a=Ke.create(e.data,2*t),i=Ke.create(e.data,2*t),o=Ke.create(e.data,2*t),s=0;s0)for(f=0;f0&&(g=ie.ofIntArray(ie.mapToArray(a.atomIdxA,function(x){return x-1},Int32Array)),y=ie.ofIntArray(ie.mapToArray(a.atomIdxB,function(x){return x-1},Int32Array)),b=ie.asArrayColumn(a.order,Int32Array),_=Lo.fromData({pairs:{indexA:g,indexB:y,order:b},count:n.count},{maxDistance:1/0}),Lo.Provider.set(v.representative,_)),[2,v]}})})}function Gje(e){return Ve.create("Parse MOL",function(t){return Ire(e,void 0,t)})}function Xje(e){var t=cC.fromFrame(e);return Ve.create("Parse CIF Core",function(r){return function qje(e,t,r){var n;return ce(this,void 0,void 0,function(){var a,i,o,s,u,c,l,f,d,p,h,m,v,g,y,b,_,C,x,A,T,w,E,I,M,O,F,N,H,G,U,Q,W,K,ne,X,L,Y,$,Z,q,z,te,ae,de,he,pe,re,ee,ue,ge;return le(this,function(Ce){switch(Ce.label){case 0:for(i=ie.ofConst("MOL",a=e.atom_site._rowCount,ie.Schema.str),o=ie.ofConst("A",a,ie.Schema.str),s=ie.ofConst(1,a,ie.Schema.int),u=function jje(e){var t=e.cell,n=function Hje(e){var t=e.it_number.value(0),r=e["name_h-m_full"].value(0).replace("-"," ");return e.it_number.isDefined?t:r}(e.space_group),a=Cs.create(n,S.create(t.length_a.value(0),t.length_b.value(0),t.length_c.value(0)),S.scale(S(),S.create(t.angle_alpha.value(0),t.angle_beta.value(0),t.angle_gamma.value(0)),Math.PI/180));return{spacegroup:Eu.create(a),assemblies:[],isNonStandardCrystalFrame:!1,ncsOperators:[]}}(e),c=u.spacegroup.cell.fromFractional,f=(l=e.atom_site).fract_x,d=l.fract_y,p=l.fract_z,h=new Float32Array(a),m=new Float32Array(a),v=new Float32Array(a),g=S(),pe=0;pe0&&(ri.Provider.set(H=N.representative,u),(G=e.geom_bond._rowCount)>0)){for(U={},pe=0,W=(Q=e.atom_site.label).rowCount;peATOM"!==hl(t)&&t.position5?er(p)(ie.Schema.str):_,subst_id:s>6?er(h)(ie.Schema.int):b,subst_name:s>7?er(m)(ie.Schema.str):_,charge:s>8?er(v)(ie.Schema.float):y,status_bit:s>9?er(g)(ie.Schema.str):_}]}})})}function tqe(e){return ce(this,void 0,void 0,function(){var t,r,n,a,i,o,s,u,c,l,f,d,p,h;return le(this,function(v){switch(v.label){case 0:for(t=e.tokenizer,r=e.molecule;"@BOND"!==hl(t)&&t.position4?er(d)(ie.Schema.str):ie.Undefined(r.num_bonds,ie.Schema.str)}]}})})}function nqe(e,t,r){return ce(this,void 0,void 0,function(){var n,a,i,o,s,u;return le(this,function(l){switch(l.label){case 0:n=lt(t),e.update({message:"Parsing...",current:0,max:t.length}),a=[],l.label=1;case 1:return n.positionMOLECULE"!==hl(t)&&t.position")){r.mol_type=a,pl(t);var i=hl(t);if(!i.startsWith("@")){r.charge_type=i,pl(t);var o=hl(t);if(!o.startsWith("@")){r.status_bits=o,pl(t);var s=hl(t);s.startsWith("@")||(r.mol_comment=s)}}}}(i),[4,eqe(i)]):[3,4];case 2:return o=l.sent(),[4,tqe(i)];case 3:for(s=l.sent(),u=function rqe(e){for(var t=e.tokenizer;t.positionMOLECULE"===r)return;if("@CRYSIN"===r)break;pl(t)}if(!(t.position>=t.data.length)){pl(t);var n=hl(t).trim().split(Rre);return{a:parseFloat(n[0]),b:parseFloat(n[1]),c:parseFloat(n[2]),alpha:parseFloat(n[3]),beta:parseFloat(n[4]),gamma:parseFloat(n[5]),spaceGroup:parseInt(n[6],10),setting:parseInt(n[7],10)}}}(i),a.push({molecule:i.molecule,atoms:o,bonds:s,crysin:u}),p5(n);"@MOLECULE"!==hl(n)&&n.position0&&(x=ie.ofIntArray(ie.mapToArray(u.origin_atom_id,function(j){return j-1},Int32Array)),A=ie.ofIntArray(ie.mapToArray(u.target_atom_id,function(j){return j-1},Int32Array)),T=u.bond_id,w=ie.ofIntArray(ie.mapToArray(u.bond_type,function(j){switch(j){case"ar":case"am":case"un":return 1;case"du":case"nc":return 0;default:return parseInt(j)}},Int8Array)),E=ie.ofIntArray(ie.mapToArray(u.bond_type,function(j){switch(j){case"ar":case"am":return 17;case"du":case"nc":return 0;default:return 1}},Int8Array)),I=Lo.fromData({pairs:{key:T,indexA:x,indexB:A,order:w,flag:E},count:s.count},{maxDistance:c?-1:1/0}),Lo.Provider.set(M=C.representative,I),Cb.Provider.set(M,{data:s.charge,type:o.charge_type}),c&&(O=function oqe(e){if(1===e.setting){var t=Cs.create(e.spaceGroup,S.create(e.a,e.b,e.c),S.scale(S(),S.create(e.alpha,e.beta,e.gamma),Math.PI/180));return{spacegroup:Eu.create(t),assemblies:[],isNonStandardCrystalFrame:!1,ncsOperators:[]}}}(c),O&&ri.Provider.set(M,O)),r.push(M)),F.label=3;case 3:return++n,[3,1];case 4:return[2,new Cp(r)]}})})}(e,t)})}!function(e){e.is=function t(n){return"mol2"===n?.kind},e.create=function r(n){return{kind:"mol2",name:n.name,data:n}}}(h5||(h5={}));var Uu,v5,Eb=new Uint32Array([0,0,0,0,0,0,0,0,0,8,10,12,16,20,25,32,40,50,64,80,101,128,161,203,256,322,406,512,645,812,1024,1290,1625,2048,2580,3250,4096,5060,6501,8192,10321,13003,16384,20642,26007,32768,41285,52015,65536,82570,104031,131072,165140,208063,262144,330280,416127,524287,660561,832255,1048576,1321122,1664510,2097152,2642245,3329021,4194304,5284491,6658042,8388607,10568983,13316085,16777216]),m5=9;function uqe(){throw new Error("(xdrfile error) Undefined error.")}function cqe(e,t){return ce(this,void 0,void 0,function(){var r,n,a,i,o,s,u,c,l,f,d,p,h,m,v,g,y,b,_,C,x,A,T,w,E,I,M,O,F,j,N,H,G;return le(this,function(U){switch(U.label){case 0:r=new DataView(t.buffer,t.byteOffset),a=(n={frames:[],boxes:[],times:[],timeOffset:0,deltaTime:0}).frames,i=n.boxes,o=n.times,s=[0,0,0,0,0,0],u=[0,0,0],c=[0,0,0],l=[0,0,0],f=[.1,.1,.1],d=[.1,.1,.1],p=0,h=Uu.buf,U.label=1;case 1:for(m=void 0,v=r.getInt32(p+4),o.push(r.getFloat32(p+=12)),p+=4,g=new Float32Array(9),O=0;O<9;++O)g[O]=10*r.getFloat32(p),p+=4;if(i.push(g),v<=9)for(m={count:v/3,x:new Float32Array(v/3),y:new Float32Array(v/3),z:new Float32Array(v/3)},O=0;O16777215?(c[0]=Uu.sizeOfInt(u[0]),c[1]=Uu.sizeOfInt(u[1]),c[2]=Uu.sizeOfInt(u[2]),C=0):C=Uu.sizeOfInts(3,u),x=r.getInt32(p),p+=4,T=Eb[A=m5>(A=x-1)?m5:A]/2|0,w=Eb[x]/2|0,l[0]=l[1]=l[2]=Eb[x],E=4*Math.ceil(r.getInt32(p)/4),p+=4,I=1/_,M=0,O=0,f[0]=f[1]=f[2]=0;O0)for(f[0]=f[1]=f[2]=0,N=0;Nm5?Eb[x-1]/2|0:0):j>0&&(T=w,w=Eb[x]/2|0),l[0]=l[1]=l[2]=Eb[x],(0===l[0]||0===l[1]||0===l[2])&&uqe()}p+=E}for(G=0;G=t.length?[3,4]:[3,1];case 4:return o.length>=1&&(n.timeOffset=o[0]),o.length>=2&&(n.deltaTime=o[1]-o[0]),[2,n]}})})}function lqe(e){var t=this;return Ve.create("Parse XTC",function(r){return ce(t,void 0,void 0,function(){var n,a;return le(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),r.update({canAbort:!0,message:"Parsing trajectory..."}),[4,cqe(r,e)];case 1:return n=i.sent(),[2,Fn.success(n)];case 2:return a=i.sent(),[2,Fn.error(""+a)];case 3:return[2]}})})})}function fqe(e){var t=this;return Ve.create("Parse XTC",function(r){return ce(t,void 0,void 0,function(){var n,a,i,o,s,u,c,l,f;return le(this,function(d){switch(d.label){case 0:return[4,r.update("Converting to coordinates")];case 1:for(d.sent(),n=Tu(e.deltaTime,"step"),a=Tu(e.timeOffset,n.unit),i=[],o=0,s=e.frames.length;o=e.data.length-1?0:+lt.readLine(e);isNaN(t)&&(t=0);for(var r=lt.readLine(e),n=new Float64Array(t),a=new Float64Array(t),i=new Float64Array(t),o=new Array(t),s=0;s=f&&d<32;)d++,f<<=1;return d};var r=new Uint8Array(32);e.sizeOfInts=function n(l,f){var d=1,p=0;r[0]=1;for(var h=0;h>=8;for(;0!==v;)r[m++]=255&v,v>>=8;d=m}var g=1;for(d--;r[d]>=g;)p++,g*=2;return p+8*d};var a=new ArrayBuffer(24);e.buf=new Int32Array(a);var i=new Uint32Array(a);function o(l,f,d){for(var p=d,h=(1<=8;)y|=(v=v<<8|l[f+g++])>>m<0&&(m>(m-=p)&(1<>i[1]&255}e.decodeBits=o;var u=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];e.decodeInts=function c(l,f,d,p,h){var m=d,v=0;for(u[0]=0,u[1]=0,u[2]=0,u[3]=0;m>8;)u[v++]=s(l,f),m-=8;m>0&&(u[v++]=o(l,f,m));for(var g=2;g>0;g--){for(var y=0,b=p[g],_=v-1;_>=0;_--){var C=(y=y<<8|u[_])/b|0;u[_]=C,y-=C*b}h[g]=y}h[0]=u[0]|u[1]<<8|u[2]<<16|u[3]<<24}}(Uu||(Uu={})),function(e){e.is=function t(n){return"xyz"===n?.kind},e.create=function r(n){return{kind:"xyz",name:"xyz",data:n}}}(v5||(v5={}));var y5,g5="$$$$";function xqe(e){var t=lt.readLine(e).trim(),r=lt.readLine(e).trim(),n=lt.readLine(e).trim(),a=lt.readLine(e),i=function gqe(e){return e.trim().endsWith("V3000")}(a),o=i?function yqe(e){var t=Ke.create(e.data,1),r=Ke.create(e.data,1);return lt.eatLine(e),Jp(e),Jp(e),Jp(e),eh(e,t),eh(e,r),lt.eatLine(e),{atomCount:er(t)(ie.Schema.int).value(0),bondCount:er(r)(ie.Schema.int).value(0)}}(e):function Cqe(e){return{atomCount:+e.substr(0,3),bondCount:+e.substr(3,3)}}(a),s=o.atomCount,u=o.bondCount;if(!Number.isNaN(s)&&!Number.isNaN(u)){var l={atomIdx:ie.ofConst(0,s,ie.Schema.int),charge:ie.ofConst(0,s,ie.Schema.int)},f=i?function bqe(e,t){for(var r=Ke.create(e.data,2*t),n=Ke.create(e.data,2*t),a=Ke.create(e.data,2*t),i=Ke.create(e.data,2*t),o=0;o ")){Ke.add(t,e.tokenStart+2,e.tokenEnd),lt.markLine(e);for(var a=e.tokenStart,i=e.tokenEnd,o=!1;e.position ")){Ke.add(r,a,i),o=!0;break}i=e.tokenEnd}o||Ke.add(r,a,i)}}return{dataHeader:er(t)(ie.Schema.str),data:er(r)(ie.Schema.str)}}(e);return{molFile:{title:t,program:r,comment:n,atoms:f,bonds:d,formalCharges:p},dataItems:h}}for(;e.position>8&65280|x>>24&255;for(A=new Float32Array(e.buffer,o,v),T=0;T=e.byteLength)break}return i.length>=1&&(r.timeOffset=i[0]),i.length>=2&&(r.deltaTime=i[1]-i[0]),[2,r]})})}function Eqe(e){var t=this;return Ve.create("Parse TRR",function(r){return ce(t,void 0,void 0,function(){var n,a;return le(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),r.update({canAbort:!0,message:"Parsing trajectory..."}),[4,Dqe(e)];case 1:return n=i.sent(),[2,Fn.success(n)];case 2:return a=i.sent(),[2,Fn.error(""+a)];case 3:return[2]}})})})}function Iqe(e){var t=this;return Ve.create("Parse TRR",function(r){return ce(t,void 0,void 0,function(){var n,a,i,o,s,u,c,l,f;return le(this,function(d){switch(d.label){case 0:return[4,r.update("Converting to coordinates")];case 1:for(d.sent(),n=Tu(e.deltaTime,"step"),a=Tu(e.timeOffset,n.unit),i=[],o=0,s=e.frames.length;o>>0:0,i=t.byteLength-a,o=a;t instanceof ArrayBuffer||(t.byteLength!==t.buffer.byteLength&&(o=t.byteOffset+a),t=t.buffer),this._lastWrittenByte=n?i:0,this.buffer=t,this.length=i,this.byteLength=i,this.byteOffset=o,this._data=new DataView(this.buffer,o,i)}return e.prototype.available=function(t){return void 0===t&&(t=1),this.offset+t<=this.length},e.prototype.isLittleEndian=function(){return this.littleEndian},e.prototype.setLittleEndian=function(){return this.littleEndian=!0,this},e.prototype.isBigEndian=function(){return!this.littleEndian},e.prototype.setBigEndian=function(){return this.littleEndian=!1,this},e.prototype.skip=function(t){return void 0===t&&(t=1),this.offset+=t,this},e.prototype.seek=function(t){return this.offset=t,this},e.prototype.mark=function(){return this._mark=this.offset,this},e.prototype.reset=function(){return this.offset=this._mark,this},e.prototype.pushMark=function(){return this._marks.push(this.offset),this},e.prototype.popMark=function(){var t=this._marks.pop();if(void 0===t)throw new Error("Mark stack empty");return this.seek(t),this},e.prototype.rewind=function(){return this.offset=0,this},e.prototype.ensureAvailable=function(t){if(void 0===t&&(t=1),!this.available(t)){var n=2*(this.offset+t),a=new Uint8Array(n);a.set(new Uint8Array(this.buffer)),this.buffer=a.buffer,this.length=this.byteLength=n,this._data=new DataView(this.buffer)}return this},e.prototype.readBoolean=function(){return 0!==this.readUint8()},e.prototype.readInt8=function(){return this._data.getInt8(this.offset++)},e.prototype.readUint8=function(){return this._data.getUint8(this.offset++)},e.prototype.readByte=function(){return this.readUint8()},e.prototype.readBytes=function(t){void 0===t&&(t=1);for(var r=new Uint8Array(t),n=0;nthis._lastWrittenByte&&(this._lastWrittenByte=this.offset)},e}();function ml(e,t){if(e)throw new TypeError("Not a valid NetCDF v3.x file: "+t)}function kre(e){e.offset%4!=0&&e.skip(4-e.offset%4)}function _5(e){var t=e.readUint32(),r=e.readChars(t);return kre(e),r}var ci={BYTE:1,CHAR:2,SHORT:3,INT:4,FLOAT:5,DOUBLE:6};function Ore(e){switch(Number(e)){case ci.BYTE:return"byte";case ci.CHAR:return"char";case ci.SHORT:return"short";case ci.INT:return"int";case ci.FLOAT:return"float";case ci.DOUBLE:return"double";default:return"undefined"}}function Fre(e){switch(Number(e)){case ci.BYTE:case ci.CHAR:return 1;case ci.SHORT:return 2;case ci.INT:case ci.FLOAT:return 4;case ci.DOUBLE:return 8;default:return-1}}function Nre(e){switch(String(e)){case"byte":return ci.BYTE;case"char":return ci.CHAR;case"short":return ci.SHORT;case"int":return ci.INT;case"float":return ci.FLOAT;case"double":return ci.DOUBLE;default:return-1}}function gE(e,t){if(1!==e){for(var r=new Array(e),n=0;n6,"non valid type "+o);var s=e.readUint32(),u=S5(e,o,s);kre(e),t[a]={name:i,type:Ore(o),value:u}}return t}var C5,x5,zqe=function(){function e(t){var r=new Mqe(t);r.setBigEndian(),ml("CDF"!==r.readChars(3),"should start with CDF");var n=r.readByte();ml(n>2,"unknown version"),this.header=function Lqe(e,t){var r={recordDimension:{length:e.readUint32()}};r.version=t;var n=function Uqe(e){var t,r,n,a=e.readUint32();if(a===Ib)return ml(e.readUint32()!==Ib,"wrong empty tag for list of dimensions"),[];ml(10!==a,"wrong tag for list of dimensions");var i=e.readUint32();t=new Array(i);for(var o=0;o6,"non valid type "+p);var h=e.readUint32(),m=e.readUint32();2===r&&(ml(m>0,"offsets larger than 4GB not supported"),m=e.readUint32()),l[0]===t&&(a+=h),i[s]={name:u,dimensions:l,attributes:d,type:Ore(p),size:h,offset:m,record:l[0]===t}}return{variables:i,recordStep:a}}(e,n.recordId,t);return r.variables=a.variables,r.recordDimension.recordStep=a.recordStep,r}(r,n),this.buffer=r}return Object.defineProperty(e.prototype,"version",{get:function(){return 1===this.header.version?"classic format":"64-bit offset format"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"recordDimension",{get:function(){return this.header.recordDimension},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dimensions",{get:function(){return this.header.dimensions},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"globalAttributes",{get:function(){return this.header.globalAttributes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"variables",{get:function(){return this.header.variables},enumerable:!1,configurable:!0}),e.prototype.hasDataVariable=function(t){return this.header.variables&&-1!==this.header.variables.findIndex(function(r){return r.name===t})},e.prototype.getDataVariable=function(t){var r,n;if(void 0===(n="string"==typeof t?null===(r=this.header.variables)||void 0===r?void 0:r.find(function(a){return a.name===t}):t))throw new Error("variable not found");return this.buffer.seek(n.offset),n.record?function Oqe(e,t,r){for(var n=Nre(t.type),a=t.size?t.size/Fre(n):1,i=r.length,o=new Array(i),s=r.recordStep,u=0;u=1&&(r.timeOffset=r.time[0]),r.time.length>=2&&(r.deltaTime=r.time[1]-r.time[0])),[2,r]})})}function Hqe(e){var t=this;return Ve.create("Parse NCTRAJ",function(r){return ce(t,void 0,void 0,function(){var n,a;return le(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),r.update({canAbort:!0,message:"Parsing trajectory..."}),[4,Gqe(e)];case 1:return n=i.sent(),[2,Fn.success(n)];case 2:return a=i.sent(),[2,Fn.error(""+a)];case 3:return[2]}})})})}function jqe(e){var t=this;return Ve.create("Parse NCTRAJ",function(r){return ce(t,void 0,void 0,function(){var n,a,i,o,s,u,c,l,f,d,p,h,m,v,g,y,b;return le(this,function(_){switch(_.label){case 0:return[4,r.update("Converting to coordinates")];case 1:for(_.sent(),n=Tu(e.deltaTime,"step"),a=Tu(e.timeOffset,n.unit),i=[],o=0,s=e.coordinates.length;o0},apply:function(e){var t=this,r=e.a,n=e.params;return Ve.create("Parse mmCIF",function(a){return ce(t,void 0,void 0,function(){var i,o,s,u,c,l,f,d,p,h,v,g,y;return le(this,function(b){switch(b.label){case 0:if(!n.loadAllBlocks)return[3,10];o=[],s=0,u=r.data.blocks,b.label=1;case 1:return s0},apply:function(e){var t=this,r=e.a,n=e.params;return Ve.create("Model from Trajectory",function(a){return ce(t,void 0,void 0,function(){var i,o,s,u;return le(this,function(c){switch(c.label){case 0:return(i=n.modelIndex%r.data.frameCount)<0&&(i+=r.data.frameCount),[4,Ve.resolveInContext(r.data.getFrameAtIndex(i),a)];case 1:return o=c.sent(),s="Model ".concat(i+1),u=1===r.data.frameCount?void 0:"of ".concat(r.data.frameCount),[2,new ve.Molecule.Model(o,{label:s,description:u})]}})})})},interpolate:function(e,t,r){return{modelIndex:r>=1?t.modelIndex:e.modelIndex+Math.floor((t.modelIndex-e.modelIndex+1)*r)}},dispose:function(e){var t=e.b;t?.data.customProperties.dispose()}}),vWe=Bt.BuiltIn({name:"structure-from-trajectory",display:{name:"Structure from Trajectory",description:"Create a molecular structure from a trajectory."},from:ve.Molecule.Trajectory,to:ve.Molecule.Structure})({apply:function(e){var t=this,r=e.a;return Ve.create("Build Structure",function(n){return ce(t,void 0,void 0,function(){var a,i;return le(this,function(o){switch(o.label){case 0:return[4,Ye.ofTrajectory(r.data,n)];case 1:return a=o.sent(),i={label:"Ensemble",description:Ye.elementDescription(a)},[2,new ve.Molecule.Structure(a,i)]}})})})},dispose:function(e){var t=e.b;t?.data.customPropertyDescriptors.dispose()}}),gWe=Bt.BuiltIn({name:"structure-from-model",display:{name:"Structure",description:"Create a molecular structure (model, assembly, or symmetry) from the specified model."},from:ve.Molecule.Model,to:ve.Molecule.Structure,params:function(e){return hg.getParams(e&&e.data)}})({canAutoUpdate:function(e){return hg.canAutoUpdate(e.oldParams.type,e.newParams.type)},apply:function(e,t){var r=this,n=e.a,a=e.params;return Ve.create("Build Structure",function(i){return ce(r,void 0,void 0,function(){return le(this,function(o){return[2,hg.create(t,i,n.data,a&&a.type)]})})})},update:function(e){var t=e.a,r=e.b;return zf(e.oldParams,e.newParams)?r.data.model===t.data?rt.UpdateResult.Unchanged:or.areHierarchiesEqual(t.data,r.data.model)?(r.data=r.data.remapModel(t.data),rt.UpdateResult.Updated):rt.UpdateResult.Recreate:rt.UpdateResult.Recreate},dispose:function(e){var t=e.b;t?.data.customPropertyDescriptors.dispose()}}),Ure=S(),Vre=me(),zre=me(),yWe=Bt.BuiltIn({name:"transform-structure-conformation",display:{name:"Transform Conformation"},isDecorator:!0,from:ve.Molecule.Structure,to:ve.Molecule.Structure,params:{transform:D.MappedStatic("components",{components:D.Group({axis:D.Vec3(S.create(1,0,0)),angle:D.Numeric(0,{min:-180,max:180,step:.1}),translation:D.Vec3(S.create(0,0,0))},{isFlat:!0}),matrix:D.Group({data:D.Mat4(me.identity()),transpose:D.Boolean(!1)},{isFlat:!0})},{label:"Kind"})}})({canAutoUpdate:function(e){return"matrix"!==e.newParams.transform.name},apply:function(e){var t=e.a,r=e.params,n=me();if("components"===r.transform.name){var a=r.transform.params,i=a.axis,o=a.angle,s=a.translation,u=t.data.boundary.sphere.center;me.fromTranslation(Vre,S.negate(Ure,u)),me.fromTranslation(zre,S.add(Ure,u,s));var c=me.fromRotation(me(),Math.PI/180*o,S.normalize(S(),i));me.mul3(n,zre,c,Vre)}else"matrix"===r.transform.name&&(me.copy(n,r.transform.params.data),r.transform.params.transpose&&me.transpose(n,n));var l=Ye.transform(t.data,n);return new ve.Molecule.Structure(l,{label:t.label,description:"".concat(t.description," [Transformed]")})},dispose:function(e){var t=e.b;t?.data.customPropertyDescriptors.dispose()}}),bWe=Bt.BuiltIn({name:"structure-selection-from-expression",display:{name:"Selection",description:"Create a molecular structure from the specified expression."},from:ve.Molecule.Structure,to:ve.Molecule.Structure,params:function(){return{expression:D.Value(fe.struct.generator.all,{isHidden:!0}),label:D.Optional(D.Text("",{isHidden:!0}))}}})({apply:function(e){var r=e.params,n=e.cache,a=Rs.createAndRun(e.a.data,r.expression),i=a.selection;if(n.entry=a.entry,mt.isEmpty(i))return ca.Null;var s=mt.unionStructure(i),u={label:"".concat(r.label||"Selection"),description:Ye.elementDescription(s)};return new ve.Molecule.Structure(s,u)},update:function(e){var t=e.a,r=e.b,a=e.newParams;if(e.oldParams.expression!==a.expression)return rt.UpdateResult.Recreate;var o=e.cache.entry;if(o.currentStructure===t.data)return rt.UpdateResult.Unchanged;var s=Rs.updateStructure(o,t.data);return mt.isEmpty(s)?rt.UpdateResult.Null:(Rs.updateStructureObject(r,s,a.label),rt.UpdateResult.Updated)},dispose:function(e){var t=e.b;t?.data.customPropertyDescriptors.dispose()}}),_We=Bt.BuiltIn({name:"structure-multi-selection-from-expression",display:{name:"Multi-structure Measurement Selection",description:"Create selection object from multiple structures."},from:ve.Root,to:ve.Molecule.Structure.Selections,params:function(){return{selections:D.ObjectList({key:D.Text(void 0,{description:"A unique key."}),ref:D.Text(),groupId:D.Optional(D.Text()),expression:D.Value(fe.struct.generator.empty)},function(e){return e.ref},{isHidden:!0}),isTransitive:D.Optional(D.Boolean(!1,{isHidden:!0,description:"Remap the selections from the original structure if structurally equivalent."})),label:D.Optional(D.Text("",{isHidden:!0}))}}})({apply:function(e){for(var t=e.params,r=e.cache,n=e.dependencies,a=new Map,i=[],o=0,s=0,u=t.selections;s65536?0:a.ISPG)||"P 1",o,s),l=S.create(a.MAPC-1,a.MAPR-1,a.MAPS-1),f=Cr.convertToCanonicalAxisIndicesFastToSlow(l),d=[a.NX,a.NY,a.NZ],p=f([a.NC,a.NR,a.NS]),h=function DWe(e){return 0===e.originX&&0===e.originY&&0===e.originZ?S.create(e.NCSTART,e.NRSTART,e.NSSTART):S.create(e.originX/(e.xLength/e.NX),e.originY/(e.yLength/e.NY),e.originZ/(e.zLength/e.NZ))}(a),t?.offset&&S.add(h,h,t.offset),m=f(h),v=S.create(m[0]/d[0],m[1]/d[1],m[2]/d[2]),g=S.create(p[0]/d[0],p[1]/d[1],p[2]/d[2]),y=Cr.Space(p,Cr.invertAxisOrder(l),function EWe(e){var t=zJ(e);switch(t){case lo.Float32:return Float32Array;case lo.Int8:return Int8Array;case lo.Int16:return Int16Array;case lo.Uint16:return Uint16Array}throw Error("".concat(t," is not a supported value format."))}(a)),b=Cr.create(y,Cr.Data1(i)),_=0===a.AMIN&&0===a.AMAX&&0===a.AMEAN&&0===a.ARMS,[2,{label:t?.label,entryId:t?.entryId,grid:{transform:{kind:"spacegroup",cell:c,fractionalBox:Nt.create(v,S.add(S.zero(),v,g))},cells:b,stats:{min:isNaN(a.AMIN)||_?cT(i):a.AMIN,max:isNaN(a.AMAX)||_?Gf(i):a.AMAX,mean:isNaN(a.AMEAN)||_?lT(i):a.AMEAN,sigma:isNaN(a.ARMS)||0===a.ARMS?fT(i):a.ARMS}},sourceData:A5.create(e),customProperties:new jl,_propertyData:Object.create(null)}]})})})}function PWe(e,t){var r=this;return Ve.create("Create Volume",function(n){return ce(r,void 0,void 0,function(){var a,i,o,s,u,c,l,f,d,p,h,m;return le(this,function(v){return i=e.values,o=S.create((a=e.header).xlen,a.ylen,a.zlen),t&&t.voxelSize&&S.mul(o,o,t.voxelSize),s=S.create(Zr(a.alpha),Zr(a.beta),Zr(a.gamma)),u=Cs.create("P 1",o,s),l=[a.xExtent,a.yExtent,a.zExtent],d=S.create((f=[a.xStart,a.yStart,a.zStart])[0]/(c=[a.xRate,a.yRate,a.zRate])[0],f[1]/c[1],f[2]/c[2]),p=S.create(l[0]/c[0],l[1]/c[1],l[2]/c[2]),h=Cr.Space(l,[0,1,2],Float32Array),m=Cr.create(h,Cr.Data1(i)),[2,{label:t?.label,entryId:t?.entryId,grid:{transform:{kind:"spacegroup",cell:u,fractionalBox:Nt.create(d,S.add(S.zero(),d,p))},cells:m,stats:{min:cT(i),max:Gf(i),mean:lT(i),sigma:void 0!==a.sigma?a.sigma:fT(i)}},sourceData:T5.create(e),customProperties:new jl,_propertyData:Object.create(null)}]})})})}function MWe(e,t){var r=this;return Ve.create("Create Volume",function(){return ce(r,void 0,void 0,function(){var n,a,i,o,s,u;return le(this,function(c){return a=e.values,i=Cr.Space((n=e.header).dim,[0,1,2],Float64Array),o=Cr.create(i,Cr.Data1(a)),s=me.fromTranslation(me(),n.min),u=me.fromScaling(me(),n.h),me.mul(s,s,u),[2,{label:t?.label,entryId:t?.entryId,grid:{transform:{kind:"matrix",matrix:s},cells:o,stats:{min:cT(a),max:Gf(a),mean:lT(a),sigma:fT(a)}},sourceData:D5.create(e),customProperties:new jl,_propertyData:Object.create(null)}]})})})}function RWe(e,t){var r=this;return Ve.create("Create Segmentation Volume",function(n){return ce(r,void 0,void 0,function(){var a,i,o,s,u,c,l,f,d,p,h,m,v,g,y,b,_,C,x,A,T,w,O,F,j,N,H,G,U,Q,W,K;return le(this,function(ne){for(i=e.segmentation_data_3d,o=Cs.create((a=e.volume_data_3d_info).spacegroup_number.value(0),S.ofArray(a.spacegroup_cell_size.value(0)),S.scale(S(),S.ofArray(a.spacegroup_cell_angles.value(0)),Math.PI/180)),s=a.axis_order.value(0),u=Cr.convertToCanonicalAxisIndicesFastToSlow(s),c=u(a.sample_count.value(0)),l=Cr.Space(c,Cr.invertAxisOrder(s),Float32Array),f=Cr.create(l,Cr.Data1(i.values.toArray({array:Float32Array}))),d=S.ofArray(u(a.origin.value(0))),p=S.ofArray(u(a.dimensions.value(0))),h={label:t?.label,entryId:void 0,grid:{transform:{kind:"spacegroup",cell:o,fractionalBox:Nt.create(d,S.add(S(),d,p))},cells:f,stats:{min:0,max:1,mean:0,sigma:1}},sourceData:E5.create(e),customProperties:new jl,_propertyData:{ownerId:t?.ownerId}},nt.PickingGranularity.set(h,"object"),m=new Map,v=new Map,b=(g=e.segmentation_data_table).set_id,H=0,G=(y=g.segment_id).rowCount;HQ[3]&&(Q[3]=x[0]),x[1]>Q[4]&&(Q[4]=x[1]),x[2]>Q[5]&&(Q[5]=x[2]));return W={},m.forEach(function(X,L){W[L]=Nt.create(S.create(O,F,j),S.create(-1,-1,-1))}),Js(N,function(X,L){v.get(parseInt(L)).forEach(function(Y){var $=W[Y];X[0]<$.min[0]&&($.min[0]=X[0]),X[1]<$.min[1]&&($.min[1]=X[1]),X[2]<$.min[2]&&($.min[2]=X[2]),X[3]>$.max[0]&&($.max[0]=X[3]),X[4]>$.max[1]&&($.max[1]=X[4]),X[5]>$.max[2]&&($.max[2]=X[5])})}),nt.Segmentation.set(h,{segments:m,sets:v,bounds:W,labels:null!==(K=t?.segmentLabels)&&void 0!==K?K:{}}),[2,h]})})})}!function(e){e.is=function t(n){return"ccp4"===n?.kind},e.create=function r(n){return{kind:"ccp4",name:n.name,data:n}}}(A5||(A5={})),function(e){e.is=function t(n){return"dsn6"===n?.kind},e.create=function r(n){return{kind:"dsn6",name:n.name,data:n}}}(T5||(T5={})),function(e){e.is=function t(n){return"dx"===n?.kind},e.create=function r(n){return{kind:"dx",name:n.name,data:n}}}(D5||(D5={})),function(e){e.is=function t(n){return"segcif"===n?.kind},e.create=function r(n){return{kind:"segcif",name:n._name,data:n}}}(E5||(E5={}));var kWe=Bt.BuiltIn({name:"volume-from-ccp4",display:{name:"Volume from CCP4/MRC/MAP",description:"Create Volume from CCP4/MRC/MAP data"},from:ve.Format.Ccp4,to:ve.Volume.Data,params:function(e){return{voxelSize:D.Vec3(S.create(1,1,1)),offset:D.Vec3(S.create(0,0,0)),entryId:D.Text("")}}})({apply:function(e){var t=this,r=e.a,n=e.params;return Ve.create("Create volume from CCP4/MRC/MAP",function(a){return ce(t,void 0,void 0,function(){var i,o;return le(this,function(s){switch(s.label){case 0:return[4,IWe(r.data,R(R({},n),{label:r.data.name||r.label})).runInContext(a)];case 1:return i=s.sent(),o={label:i.label||"Volume",description:"Volume ".concat(r.data.header.NX,"\xd7").concat(r.data.header.NX,"\xd7").concat(r.data.header.NX)},[2,new ve.Volume.Data(i,o)]}})})})},dispose:function(e){var t=e.b;t?.data.customProperties.dispose()}}),OWe=Bt.BuiltIn({name:"volume-from-dsn6",display:{name:"Volume from DSN6/BRIX",description:"Create Volume from DSN6/BRIX data"},from:ve.Format.Dsn6,to:ve.Volume.Data,params:function(e){return{voxelSize:D.Vec3(S.create(1,1,1)),entryId:D.Text("")}}})({apply:function(e){var t=this,r=e.a,n=e.params;return Ve.create("Create volume from DSN6/BRIX",function(a){return ce(t,void 0,void 0,function(){var i,o;return le(this,function(s){switch(s.label){case 0:return[4,PWe(r.data,R(R({},n),{label:r.data.name||r.label})).runInContext(a)];case 1:return i=s.sent(),o={label:i.label||"Volume",description:"Volume ".concat(r.data.header.xExtent,"\xd7").concat(r.data.header.yExtent,"\xd7").concat(r.data.header.zExtent)},[2,new ve.Volume.Data(i,o)]}})})})},dispose:function(e){var t=e.b;t?.data.customProperties.dispose()}}),FWe=Bt.BuiltIn({name:"volume-from-cube",display:{name:"Volume from Cube",description:"Create Volume from Cube data"},from:ve.Format.Cube,to:ve.Volume.Data,params:function(e){return{dataIndex:e?D.Select(0,e.data.header.dataSetIds.map(function(r,n){return[n,"".concat(r)]})):D.Numeric(0),entryId:D.Text("")}}})({apply:function(e){var t=this,r=e.a,n=e.params;return Ve.create("Create volume from Cube",function(a){return ce(t,void 0,void 0,function(){var i,o;return le(this,function(s){switch(s.label){case 0:return[4,cGe(r.data,R(R({},n),{label:r.data.name||r.label})).runInContext(a)];case 1:return i=s.sent(),o={label:i.label||"Volume",description:"Volume ".concat(r.data.header.dim[0],"\xd7").concat(r.data.header.dim[1],"\xd7").concat(r.data.header.dim[2])},[2,new ve.Volume.Data(i,o)]}})})})},dispose:function(e){var t=e.b;t?.data.customProperties.dispose()}}),NWe=Bt.BuiltIn({name:"volume-from-dx",display:{name:"Parse DX",description:"Create volume from DX data."},from:ve.Format.Dx,to:ve.Volume.Data})({apply:function(e){var t=this,r=e.a;return Ve.create("Parse DX",function(n){return ce(t,void 0,void 0,function(){var a,i;return le(this,function(o){switch(o.label){case 0:return[4,MWe(r.data,{label:r.data.name||r.label}).runInContext(n)];case 1:return a=o.sent(),i={label:a.label||"Volume",description:"Volume ".concat(r.data.header.dim[0],"\xd7").concat(r.data.header.dim[1],"\xd7").concat(r.data.header.dim[2])},[2,new ve.Volume.Data(a,i)]}})})})},dispose:function(e){var t=e.b;t?.data.customProperties.dispose()}}),BWe=Bt.BuiltIn({name:"volume-from-density-server-cif",display:{name:"Volume from density-server CIF",description:"Identify and create all separate models in the specified CIF data block"},from:ve.Format.Cif,to:ve.Volume.Data,params:function(e){if(!e)return{blockHeader:D.Optional(D.Text(void 0,{description:"Header of the block to parse. If none is specifed, the 1st data block in the file is used."})),entryId:D.Text("")};var t=e.data.blocks.slice(1);return{blockHeader:D.Optional(D.Select(t[0]&&t[0].header,t.map(function(r){return[r.header,r.header]}),{description:"Header of the block to parse"})),entryId:D.Text("")}}})({isApplicable:function(e){return e.data.blocks.length>0},apply:function(e){var t=this,r=e.a,n=e.params;return Ve.create("Parse density-server CIF",function(a){return ce(t,void 0,void 0,function(){var i,o,s,u,c,l,f,d,p,h;return le(this,function(m){switch(m.label){case 0:if(i=n.blockHeader||r.data.blocks[1].header,!(o=r.data.blocks.find(function(v){return v.header===i})))throw new Error("Data block '".concat([i],"' not found."));return[4,Fte(s=Zl.schema.densityServer(o),{entryId:n.entryId}).runInContext(a)];case 1:return u=m.sent(),l=(c=u.grid.cells.space.dimensions)[0],f=c[1],d=c[2],p={label:null!==(h=n.entryId)&&void 0!==h?h:s.volume_data_3d_info.name.value(0),description:"Volume ".concat(l,"\xd7").concat(f,"\xd7").concat(d)},[2,new ve.Volume.Data(u,p)]}})})})},dispose:function(e){var t=e.b;t?.data.customProperties.dispose()}}),LWe=Bt.BuiltIn({name:"volume-from-segmentation-cif",display:{name:"Volume from Segmentation CIF"},from:ve.Format.Cif,to:ve.Volume.Data,params:function(e){var t=e?.data.blocks.slice(1);return{blockHeader:D.Optional(t?D.Select(t[0]&&t[0].header,t.map(function(n){return[n.header,n.header]}),{description:"Header of the block to parse"}):D.Text(void 0,{description:"Header of the block to parse. If none is specifed, the 1st data block in the file is used."})),segmentLabels:D.ObjectList({id:D.Numeric(-1),label:D.Text("")},function(n){return"".concat(n.id," = ").concat(n.label)},{description:"Mapping of segment IDs to segment labels"}),ownerId:D.Text("",{isHidden:!0,description:"Reference to the object which manages this volume"})}}})({isApplicable:function(e){return e.data.blocks.length>0},apply:function(e){var t=this,r=e.a,n=e.params;return Ve.create("Parse segmentation CIF",function(a){return ce(t,void 0,void 0,function(){var i,o,s,u,c,l,f,d,p,h,m,v,g;return le(this,function(y){switch(y.label){case 0:if(i=n.blockHeader||r.data.blocks[1].header,!(o=r.data.blocks.find(function(b){return b.header===i})))throw new Error("Data block '".concat([i],"' not found."));for(s=Zl.schema.segmentation(o),u={},c=0,l=n.segmentLabels;c0?a[c[0]].component.color:yE};r=function(s,u){return u?15854817:at.is(s)?o(s.unit,s.element):Ht.isLocation(s)?o(s.aUnit,s.aUnit.elements[s.aIndex]):yE}}else r=function(){return yE};return{factory:Xre,granularity:"group",color:r,props:t,description:"Assigns colors according to the Symbol Nomenclature for Glycans (SNFG).",legend:Xh(sMe)}},getParams:function zWe(e){return Yre},defaultValues:D.getDefaultValues(Yre),isApplicable:function(e){return!!e.structure&&e.structure.models.some(function(t){return or.hasCarbohydrate(t)})}},Kre={hue:D.Interval([1,360],{min:0,max:360,step:1}),chroma:D.Interval([40,70],{min:0,max:100,step:1}),luminance:D.Interval([15,85],{min:0,max:100,step:1}),sort:D.Select("contrast",D.arrayToOptions(["none","contrast"]),{description:"no sorting leaves colors approximately ordered by hue"}),clusteringStepCount:D.Numeric(50,{min:10,max:200,step:1},{isHidden:!0}),minSampleCount:D.Numeric(800,{min:100,max:5e3,step:100},{isHidden:!0}),sampleCountFactor:D.Numeric(5,{min:1,max:100,step:1},{isHidden:!0})},Pb=2,vg=[0,0,0],gg=[0,0,0];function HWe(e,t){return Wi.toHcl(vg,e),Wi.fromColor(gg,Wi.toColor(e)),vg[0]>=t.hue[0]&&vg[0]<=t.hue[1]&&vg[1]>=t.chroma[0]&&vg[1]<=t.chroma[1]&&vg[2]>=t.luminance[0]&&vg[2]<=t.luminance[1]&&gg[0]>=e[0]-Pb&&gg[0]<=e[0]+Pb&&gg[1]>=e[1]-Pb&&gg[1]<=e[1]+Pb&&gg[2]>=e[2]-Pb&&gg[2]<=e[2]+Pb}function Zre(e,t){for(var r=1/0,n=0,a=0;a=e));s+=o);for(var u=1;u<=r.clusteringStepCount;++u){var c=ql(i),l=ql(n);for(s=0;s0;){for(var n=r[r.length-1],a=0,i=Number.NEGATIVE_INFINITY,o=0;oi&&(i=s,a=o)}r.push(t.splice(a,1)[0])}return r}(a):a;return w.map(function(E){return Wi.toColor(E)})}(e,t.palette.params));for(var h=null!==(n=r.valueLabel)&&void 0!==n?n:$re.valueLabel,m=p.length,v=[],g=0;g1?tne(e.unit.model,r):r}function tne(e,t){return"".concat(t,"|").concat((or.Index.get(e).value||0)+1)}function fC(e,t){var r,n;if(e.structure){var a=at.create(e.structure.root),i=function QWe(e,t){for(var r=new Map,n=function(s){var u=or.AsymIdOffset.get(s).value,c=("auth"===t?u?.auth:u?.label)||0,l=0;s.properties.structAsymMap.forEach(function(f,d){var h="auth"===t?f.auth_id:d,m=e.models.length>1?tne(s,h):h;r.has(m)||(r.set(m,l+c),++l)})},a=0,i=e.models;aIu[R5].list.length&&(t.palette.defaultValue.name="colors",t.palette.defaultValue.params=R(R({},t.palette.defaultValue.params),{list:{kind:"interpolate",colors:cp(R5).list}})),t},defaultValues:D.getDefaultValues(mC),isApplicable:function(e){return!!e.structure}},fne=ft(13421772),mYe="Gives every model a unique color based on its index.",gC=R({},ks({type:"colors",colorList:"many-distinct"}));function yC(e,t){var r,n,a;if(e.structure){var o=du((null!==(r=or.MaxIndex.get(e.structure.models[0]).value)&&void 0!==r?r:-1)+1,t);a=o.legend,n=function(s){return at.is(s)?o.color(or.Index.get(s.unit.model).value||0):Ht.isLocation(s)?o.color(or.Index.get(s.aUnit.model).value||0):fne}}else n=function(){return fne};return{factory:yC,granularity:"instance",color:n,props:t,description:mYe,legend:a}}var gYe={name:"model-index",label:"Model Index",category:ta.Chain,factory:yC,getParams:function vYe(e){return D.clone(gC)},defaultValues:D.getDefaultValues(gC),isApplicable:function(e){return!!e.structure&&e.structure.elementCount>0}},dne=ft(13421772),yYe="Gives every structure a unique color based on its index.",bC=R({},ks({type:"colors",colorList:"many-distinct"}));function _C(e,t){var r,n,a;if(e.structure){var o=du((null!==(r=Ye.MaxIndex.get(e.structure).value)&&void 0!==r?r:-1)+1,t);a=o.legend,n=function(s){return at.is(s)?o.color(Ye.Index.get(s.structure).value||0):Ht.isLocation(s)?o.color(Ye.Index.get(s.aStructure).value||0):dne}}else n=function(){return dne};return{factory:_C,granularity:"instance",color:n,props:t,description:yYe,legend:a}}var _Ye={name:"structure-index",label:"Structure Index",category:ta.Chain,factory:_C,getParams:function bYe(e){return D.clone(bC)},defaultValues:D.getDefaultValues(bC),isApplicable:function(e){return!!e.structure&&e.structure.elementCount>0}},O5="dark-2",pne=ft(13421772),SYe="Gives every chain instance (single chain or collection of single elements) a unique color based on the position (index) of the chain in the list of chains in the structure.",F5=R({},ks({type:"colors",colorList:O5}));function N5(e,t){var r,n;if(e.structure){var a=e.structure.root.units,i=du(a.length,t);n=i.legend;for(var o=new Map,s=0,u=a.length;sIu[O5].list.length&&(t.palette.defaultValue.name="colors",t.palette.defaultValue.params=R(R({},t.palette.defaultValue.params),{list:{kind:"interpolate",colors:cp(O5).list}})),t},defaultValues:D.getDefaultValues(F5),isApplicable:function(e){return!!e.structure}},hne={H:16777215,D:16777152,T:16777120,HE:14286847,LI:13402367,BE:12779264,B:16758197,C:9474192,N:3166456,O:16715021,F:9494608,NE:11789301,NA:11230450,MG:9109248,AL:12560038,SI:1578e4,P:16744448,S:16777008,CL:2093087,AR:8442339,K:9388244,CA:4062976,SC:15132390,TI:12567239,V:10921643,CR:9083335,MN:10255047,FE:14706227,CO:15765664,NI:5296208,CU:13140019,ZN:8224944,GA:12750735,GE:6721423,AS:12419299,SE:16752896,BR:10889513,KR:6076625,RB:7351984,SR:65280,Y:9764863,ZR:9756896,NB:7586505,MO:5551541,TC:3907230,RU:2396047,RH:687500,PD:27013,AG:12632256,CD:16767375,IN:10909043,SN:6717568,SB:10380213,TE:13924864,I:9699476,XE:9699476,CS:5707663,BA:51456,LA:7394559,CE:16777159,PR:14286791,ND:13107143,PM:10747847,SM:9437127,EU:6422471,GD:4587463,TB:3211207,DY:2097095,HO:65436,ER:58997,TM:54354,YB:48952,LU:43812,HF:5096191,TA:5089023,W:2200790,RE:2522539,OS:2516630,IR:1528967,PT:13684960,AU:16765219,HG:12105936,TL:10900557,PB:5724513,BI:10375093,PO:11230208,AT:7688005,RN:4358806,FR:4325478,RA:32e3,AC:7384058,TH:47871,PA:41471,U:36863,NP:33023,PU:27647,AM:5528818,CM:7888099,BK:9064419,CF:10565332,ES:11739092,FM:11739066,MD:11734438,NO:12389767,LR:13041766,RF:13369433,DB:13697103,SG:14221381,BH:14680120,HS:15073326,MT:15400998,DS:16777215,RG:16777215,CN:16777215,UUT:16777215,FL:16777215,UUP:16777215,LV:16777215,UUH:16777215},mne=ft(16777215),B5={carbonColor:D.MappedStatic("chain-id",{"chain-id":D.Group(lC),"unit-index":D.Group(F5,{label:"Chain Instance"}),"entity-id":D.Group(dC),"entity-source":D.Group(mC),"operator-name":D.Group(I5),"model-index":D.Group(gC),"structure-index":D.Group(bC),uniform:D.Group(lb),"element-symbol":D.EmptyGroup()},{description:"Use chain-id coloring for carbon atoms."}),saturation:D.Numeric(0,{min:-6,max:6,step:.1}),lightness:D.Numeric(.2,{min:-6,max:6,step:.1}),colors:D.MappedStatic("default",{default:D.EmptyGroup(),custom:D.Group(bE(hne))})};function L5(e,t){var r,n=ST("default"===t.colors.name?hne:t.colors.params,t.saturation,t.lightness),a=null===(r=function DYe(e,t){switch(t.name){case"chain-id":return fC(e,t.params);case"unit-index":return N5(e,t.params);case"entity-id":return hC(e,t.params);case"entity-source":return vC(e,t.params);case"operator-name":return P5(e,t.params);case"model-index":return yC(e,t.params);case"structure-index":return _C(e,t.params);case"uniform":return cg(0,t.params);case"element-symbol":return;default:xn()}}(e,t.carbonColor))||void 0===r?void 0:r.color;function i(u,c){return a&&"C"===u?a(c,!1):function TYe(e,t){var r=e[t];return void 0===r?mne:r}(n,u)}return{factory:L5,granularity:"operator-name"===t.carbonColor.name||"unit-index"===t.carbonColor.name?"groupInstance":"group",preferSmoothing:!0,color:function o(u){if(at.is(u)){if(ke.isAtomic(u.unit))return i(u.unit.model.atomicHierarchy.atoms.type_symbol.value(u.element),u)}else if(Ht.isLocation(u)&&ke.isAtomic(u.aUnit))return i(u.aUnit.model.atomicHierarchy.atoms.type_symbol.value(u.aUnit.elements[u.aIndex]),u);return mne},props:t,description:"Assigns a color to every atom according to its chemical element.",legend:Xh(Object.keys(n).map(function(u){return[u,n[u]]}))}}var EYe={name:"element-symbol",label:"Element Symbol",category:ta.Atom,factory:L5,getParams:function AYe(e){return D.clone(B5)},defaultValues:D.getDefaultValues(B5),isApplicable:function(e){return!!e.structure}},vne={water:3697840,ion:15729279,protein:12496596,RNA:16629894,DNA:12540695,PNA:4367514,saccharide:8374655},U5=ft(16777113),SE={saturation:D.Numeric(0,{min:-6,max:6,step:.1}),lightness:D.Numeric(0,{min:-6,max:6,step:.1}),colors:D.MappedStatic("default",{default:D.EmptyGroup(),custom:D.Group(bE(vne))})};function gne(e,t,r){switch($O(t,r)){case 2:return e.water;case 3:return e.ion;case 5:return e.protein;case 6:return e.RNA;case 7:return e.DNA;case 8:return e.PNA;case 9:return e.saccharide}return U5}function CE(e,t){var r=ST("default"===t.colors.name?vne:t.colors.params,t.saturation,t.lightness);return{factory:CE,granularity:"group",color:function n(a){return at.is(a)?gne(r,a.unit,a.element):Ht.isLocation(a)?gne(r,a.aUnit,a.aUnit.elements[a.aIndex]):U5},props:t,description:"Assigns a color based on the molecule type of a residue.",legend:Xh(Object.keys(r).map(function(a){return[a,r[a]]}).concat([["Other/unknown",U5]]))}}var MYe={name:"molecule-type",label:"Molecule Type",category:ta.Residue,factory:CE,getParams:function PYe(e){return SE},defaultValues:D.getDefaultValues(SE),isApplicable:function(e){return!!e.structure}},V5="dark-2",yne=ft(16448250),bne=R({},ks({type:"colors",colorList:V5}));function _ne(e){switch(e.kind){case 0:return it.chain.label_asym_id;case 1:case 2:return it.coarse.asym_id}}function Sne(e){for(var t=new Map,r=0,n=e.unitSymmetryGroups.length;rIu[V5].list.length&&(t.palette.defaultValue.name="colors",t.palette.defaultValue.params=R(R({},t.palette.defaultValue.params),{list:{kind:"interpolate",colors:cp(V5).list}})),t},defaultValues:D.getDefaultValues(bne),isApplicable:function(e){return!!e.structure}},z5="dark-2",xne=ft(13421772),wne=R({},ks({type:"colors",colorList:z5}));function Ane(e){for(var t=0,r=e.units,n=0,a=r.length;n0&&++t;return t}var BYe={name:"polymer-index",label:"Polymer Chain Instance",category:ta.Chain,factory:function Tne(e,t){var r,n;if(e.structure){var a=du(Ane(e.structure.root),t);n=a.legend;for(var i=e.structure.root.units,o=new Map,s=0,u=0,c=i.length;s0&&(o.set(i[s].id,a.color(u)),++u);r=function(l){var f;return at.is(l)?f=o.get(l.unit.id):Ht.isLocation(l)&&(f=o.get(l.aUnit.id)),void 0!==f?f:xne}}else r=function(){return xne};return{factory:Tne,granularity:"instance",color:r,props:t,description:"Gives every polymer chain instance a unique color based on the position (index) of the polymer in the list of polymers in the structure.",legend:n}},getParams:function NYe(e){var t=D.clone(wne);return e.structure&&Ane(e.structure.root)>Iu[z5].list.length&&(t.palette.defaultValue.name="colors",t.palette.defaultValue.params=R(R({},t.palette.defaultValue.params),{list:{kind:"interpolate",colors:cp(z5).list}})),t},defaultValues:D.getDefaultValues(wne),isApplicable:function(e){return!!e.structure}},Dne={ALA:9240460,ARG:124,ASN:16743536,ASP:10485826,CYS:16777072,GLN:16731212,GLU:6684672,GLY:15658734,HIS:7368959,ILE:19456,LEU:4546117,LYS:4671416,MET:12099650,PHE:5459026,PRO:5395026,SER:16740418,THR:12078080,TRP:5195264,TYR:9203788,VAL:16747775,A:14423100,G:3329330,I:10145074,C:16766720,T:4286945,U:4251856,DA:14423100,DG:3329330,DI:10145074,DC:16766720,DT:4286945,DU:4251856,APN:14423100,GPN:3329330,CPN:16766720,TPN:4286945},G5=ft(16711935),H5={saturation:D.Numeric(0,{min:-6,max:6,step:.1}),lightness:D.Numeric(1,{min:-6,max:6,step:.1}),colors:D.MappedStatic("default",{default:D.EmptyGroup(),custom:D.Group(bE(Dne))})};function Ene(e,t){return e.model.atomicHierarchy.atoms.label_comp_id.value(t)}function Ine(e,t){var r=e.coarseElements.seq_id_begin.value(t);if(r===e.coarseElements.seq_id_end.value(t))return e.model.sequence.byEntityKey[e.coarseElements.entityKey[t]].sequence.compId.value(r-1)}function xE(e,t){var r=e[t];return void 0===r?G5:r}function j5(e,t){var r=ST("default"===t.colors.name?Dne:t.colors.params,t.saturation,t.lightness);return{factory:j5,granularity:"group",preferSmoothing:!0,color:function n(a){if(at.is(a)){if(ke.isAtomic(a.unit)){var i=Ene(a.unit,a.element);return xE(r,i)}if(i=Ine(a.unit,a.element))return xE(r,i)}else if(Ht.isLocation(a)){if(ke.isAtomic(a.aUnit))return i=Ene(a.aUnit,a.aUnit.elements[a.aIndex]),xE(r,i);if(i=Ine(a.aUnit,a.aUnit.elements[a.aIndex]))return xE(r,i)}return G5},props:t,description:"Assigns a color to every residue according to its name.",legend:Xh(Object.keys(r).map(function(a){return[a,r[a]]}).concat([["Unknown",G5]]))}}var VYe={name:"residue-name",label:"Residue Name",category:ta.Residue,factory:j5,getParams:function UYe(e){return H5},defaultValues:D.getDefaultValues(H5),isApplicable:function(e){return!!e.structure}},Pne={alphaHelix:16711808,threeTenHelix:10485888,piHelix:6291584,betaTurn:6324479,betaStrand:16762880,coil:16777215,bend:6740169,turn:45670,dna:11403518,rna:16580962,carbohydrate:10921722},q5=ft(8421504),W5={saturation:D.Numeric(-1,{min:-6,max:6,step:.1}),lightness:D.Numeric(0,{min:-6,max:6,step:.1}),colors:D.MappedStatic("default",{default:D.EmptyGroup(),custom:D.Group(bE(Pne))})};function Mne(e,t,r,n){var a=cn.create(0);if(n&&ke.isAtomic(t)){var i=n.get(t.invariantId);i&&(a=i.type[i.getIndex(t.residueIndex[r])])}if(cn.is(a,2))return cn.is(a,2048)?e.threeTenHelix:cn.is(a,32768)?e.piHelix:e.alphaHelix;if(cn.is(a,4))return e.betaStrand;if(cn.is(a,8))return e.bend;if(cn.is(a,16))return e.turn;var o=$O(t,r);return 7===o?e.dna:6===o?e.rna:9===o?e.carbohydrate:5===o?e.coil:q5}function Y5(e,t){var r=e.structure&&Yc.get(e.structure),n=r?Mv(r.id,r.version):-1,a=ST("default"===t.colors.name?Pne:t.colors.params,t.saturation,t.lightness);return{factory:Y5,granularity:"group",preferSmoothing:!0,color:function i(o){return at.is(o)?Mne(a,o.unit,o.element,r?.value):Ht.isLocation(o)?Mne(a,o.aUnit,o.aUnit.elements[o.aIndex],r?.value):q5},props:t,contextHash:n,description:"Assigns a color based on the type of secondary structure and basic molecule type.",legend:Xh(Object.keys(a).map(function(o){return[o,a[o]]}).concat([["Other",q5]]))}}var HYe={name:"secondary-structure",label:"Secondary Structure",category:ta.Residue,factory:Y5,getParams:function GYe(e){return W5},defaultValues:D.getDefaultValues(W5),isApplicable:function(e){return!!e.structure},ensureCustomProperties:{attach:function(e,t){return t.structure?Yc.attach(e,t.structure,void 0,!0):Promise.resolve()},detach:function(e){return e.structure&&Yc.ref(e.structure,!1)}}},jYe=ft(13421772),Rne={list:D.ColorList("turbo",{presetKind:"scale"})};function kne(e,t){var r=e.model;switch(e.kind){case 0:return r.atomicHierarchy.residues.label_seq_id.value(r.atomicHierarchy.residueAtomSegments.index[t]);case 1:return Math.round((r.coarseHierarchy.spheres.seq_id_begin.value(t)+r.coarseHierarchy.spheres.seq_id_end.value(t))/2);case 2:return Math.round((r.coarseHierarchy.gaussians.seq_id_begin.value(t)+r.coarseHierarchy.gaussians.seq_id_end.value(t))/2)}}function One(e,t){var r=e.model,n="";switch(e.kind){case 0:n=r.atomicHierarchy.chains.label_entity_id.value(r.atomicHierarchy.chainAtomSegments.index[t]);break;case 1:n=r.coarseHierarchy.spheres.entity_id.value(t);break;case 2:n=r.coarseHierarchy.gaussians.entity_id.value(t)}if(""===n)return 0;var i=r.entities.getEntityIndex(n);if(-1===i)return 0;var o=r.sequence.byEntityKey[i];return void 0===o?0:o.sequence.length}var YYe={name:"sequence-id",label:"Sequence Id",category:ta.Residue,factory:function Fne(e,t){var r=zc.create({listOrName:t.list.colors,minLabel:"Start",maxLabel:"End"});return{factory:Fne,granularity:"group",preferSmoothing:!0,color:function(a){if(at.is(a)){var i=a.unit,o=a.element;if((s=kne(i,o))>0&&(u=One(i,o)))return r.setDomain(0,u-1),r.color(s)}else if(Ht.isLocation(a)){var s,u,c=a.aUnit,l=a.aIndex;if((s=kne(c,c.elements[l]))>0&&(u=One(c,c.elements[l])))return r.setDomain(0,u-1),r.color(s)}return jYe},props:t,description:"Gives every polymer residue a color based on its `seq_id` value.",legend:r?r.legend:void 0}},getParams:function WYe(e){return Rne},defaultValues:D.getDefaultValues(Rne),isApplicable:function(e){return!!e.structure}},XYe=ft(16777113),Nne={domain:D.Interval([0,100]),list:D.ColorList("red-white-blue",{presetKind:"scale"})};function Bne(e,t){return ke.isAtomic(e)?e.model.atomicConformation.B_iso_or_equiv.value(t):ke.isSpheres(e)?e.model.coarseConformation.spheres.rmsf[t]:0}var QYe={name:"uncertainty",label:"Uncertainty/Disorder",category:ta.Atom,factory:function Lne(e,t){var r=zc.create({reverse:!0,domain:t.domain,listOrName:t.list.colors});return{factory:Lne,granularity:"group",preferSmoothing:!0,color:function n(a){return at.is(a)?r.color(Bne(a.unit,a.element)):Ht.isLocation(a)?r.color(Bne(a.aUnit,a.aUnit.elements[a.aIndex])):XYe},props:t,description:"Assigns a color based on the uncertainty or disorder of an element's position, e.g. B-factor or RMSF, depending on the data availability and experimental technique.",legend:r?r.legend:void 0}},getParams:function ZYe(e){return Nne},defaultValues:D.getDefaultValues(Nne),isApplicable:function(e){return!!e.structure&&e.structure.models.some(function(t){return t.atomicConformation.B_iso_or_equiv.isDefined||t.coarseHierarchy.isDefined})}},$Ye=ft(15658734),Une={style:D.MappedStatic("entity-id",{uniform:D.Group(lb),"chain-id":D.Group(lC),"entity-id":D.Group(dC),"entity-source":D.Group(mC),"molecule-type":D.Group(SE),"model-index":D.Group(gC),"structure-index":D.Group(bC)}),carbonLightness:D.Numeric(.8,{min:-6,max:6,step:.1})},rXe={name:"illustrative",label:"Illustrative",category:ta.Misc,factory:function Vne(e,t){var r=function tXe(e,t){switch(t.name){case"uniform":return cg(0,t.params);case"chain-id":return fC(e,t.params);case"entity-id":return hC(e,t.params);case"entity-source":return vC(e,t.params);case"molecule-type":return CE(0,t.params);case"model-index":return yC(e,t.params);case"structure-index":return _C(e,t.params);default:xn()}}(e,t.style),n=r.color;function i(s,u){var c=n(s,!1);return"C"===u?ft.lighten(c,t.carbonLightness):c}return{factory:Vne,granularity:"group",preferSmoothing:!0,color:function o(s){if(at.is(s)&&ke.isAtomic(s.unit)){var u=s.unit.model.atomicHierarchy.atoms.type_symbol.value(s.element);return i(s,u)}return Ht.isLocation(s)&&ke.isAtomic(s.aUnit)?(u=s.aUnit.model.atomicHierarchy.atoms.type_symbol.value(s.aUnit.elements[s.aIndex]),i(s,u)):$Ye},props:t,description:"Assigns an illustrative color that gives every chain a color based on the chosen style but with lighter carbons (inspired by David Goodsell's Molecule of the Month style).",legend:r.legend}},getParams:function eXe(e){return D.clone(Une)},defaultValues:D.getDefaultValues(Une),isApplicable:function(e){return!!e.structure}},zne={list:D.ColorList("red-yellow-green",{presetKind:"scale"}),scale:D.Select("DGwif",[["DGwif","DG water-membrane"],["DGwoct","DG water-octanol"],["Oct-IF","DG difference"]])},iXe={DGwif:0,DGwoct:1,"Oct-IF":2};function Gne(e,t){return e.model.atomicHierarchy.atoms.label_comp_id.value(t)}function Hne(e,t){var r=e.coarseElements.seq_id_begin.value(t);if(r===e.coarseElements.seq_id_end.value(t))return e.model.sequence.byEntityKey[e.coarseElements.entityKey[t]].sequence.compId.value(r-1)}var sXe={name:"hydrophobicity",label:"Hydrophobicity",category:ta.Residue,factory:function jne(e,t){var r=iXe[t.scale],n=1/0,a=-1/0;for(var i in UO){var o=UO[i][r];n=Math.min(n,o),a=Math.max(a,o)}var s=zc.create({listOrName:t.list.colors,domain:[a,n],minLabel:"Hydrophilic",maxLabel:"Hydrophobic"});return{factory:jne,granularity:"group",preferSmoothing:!0,color:function u(c){var l;return at.is(c)?l=ke.isAtomic(c.unit)?Gne(c.unit,c.element):Hne(c.unit,c.element):Ht.isLocation(c)&&(l=ke.isAtomic(c.aUnit)?Gne(c.aUnit,c.aUnit.elements[c.aIndex]):Hne(c.aUnit,c.aUnit.elements[c.aIndex])),s.color(l?function oXe(e,t){var r=UO[e];return void 0===r?0:r[t]}(l,r):0)},props:t,description:'Assigns a color to every amino acid according to the "Experimentally determined hydrophobicity scale for proteins at membrane interfaces" by Wimely and White (doi:10.1038/nsb1096-842).',legend:s?s.legend:void 0}},getParams:function aXe(e){return zne},defaultValues:D.getDefaultValues(zne),isApplicable:function(e){return!!e.structure}},qne=ft(13421772),Wne=R({},ks({type:"colors",colorList:"purples"})),lXe={name:"trajectory-index",label:"Trajectory Index",category:ta.Chain,factory:function Yne(e,t){var r,n,a,i;if(e.structure){for(var o=e.structure.root.models,s=0,u=0,c=o;u0&&or.TrajectoryInfo.get(e.structure.models[0]).size>1}},fXe=ft(13421772),Xne={domain:D.Interval([0,1]),list:D.ColorList("purples",{presetKind:"scale"})};function Kne(e,t){return ke.isAtomic(e)?e.model.atomicConformation.occupancy.value(t):0}var hXe={name:"occupancy",label:"Occupancy",category:ta.Atom,factory:function Zne(e,t){var r=zc.create({reverse:!1,domain:t.domain,listOrName:t.list.colors});return{factory:Zne,granularity:"group",preferSmoothing:!0,color:function n(a){return at.is(a)?r.color(Kne(a.unit,a.element)):Ht.isLocation(a)?r.color(Kne(a.aUnit,a.aUnit.elements[a.aIndex])):fXe},props:t,description:"Assigns a color based on the occupancy of an atom.",legend:r?r.legend:void 0}},getParams:function pXe(e){return Xne},defaultValues:D.getDefaultValues(Xne),isApplicable:function(e){return!!e.structure&&e.structure.models.some(function(t){return t.atomicConformation.occupancy.isDefined})}},X5="dark-2",Qne=ft(13421772),$ne=R({},ks({type:"colors",colorList:X5})),SC=1e4;function K5(e){return e.map(function(t){return"".concat(t+SC).padStart(5,"0")}).join("")}function Z5(e){var t=function lRe(e,t){return Math.abs(e)Iu[X5].list.length&&(t.palette.defaultValue.name="colors",t.palette.defaultValue.params=R(R({},t.palette.defaultValue.params),{list:{kind:"interpolate",colors:cp(X5).list}})),t},defaultValues:D.getDefaultValues($ne),isApplicable:function(e){return!!e.structure}},$5=ft(16777113),tae={domain:D.Interval([-1,1]),list:D.ColorList("red-white-blue",{presetKind:"scale"})};function rae(e,t){var r;return null===(r=Cb.Provider.get(e.model))||void 0===r?void 0:r.data.value(t)}var Vu,_Xe={name:"partial-charge",label:"Partial Charge",category:ta.Atom,factory:function nae(e,t){var r=zc.create({domain:t.domain,listOrName:t.list.colors});return{factory:nae,granularity:"group",preferSmoothing:!0,color:function n(a){var i;return at.is(a)?void 0!==(i=rae(a.unit,a.element))?r.color(i):$5:Ht.isLocation(a)&&void 0!==(i=rae(a.aUnit,a.aUnit.elements[a.aIndex]))?r.color(i):$5},props:t,description:"Assigns a color based on the partial charge of an atom.",legend:r?r.legend:void 0}},getParams:function bXe(e){return tae},defaultValues:D.getDefaultValues(tae),isApplicable:function(e){return!!e.structure&&e.structure.models.some(function(t){return void 0!==Cb.Provider.get(t)})}},aae=ft(16448250),iae=R({},ks({type:"colors",colorList:"many-distinct"})),AXe={name:"atom-id",label:"Atom Id",category:ta.Atom,factory:function oae(e,t){var r,n;if(e.structure){var a=at.create(e.structure.root),i=function wXe(e){for(var t=new Map,r=0,n=e.models;r"]})},function(e,t){return t(e)}),coloring:D.MappedStatic("absolute-value",{"absolute-value":D.Group({domain:D.MappedStatic("auto",{custom:D.Interval([-1,1]),auto:D.Group({symmetric:D.Boolean(!1,{description:"If true the automatic range is determined as [-|max|, |max|]."})})}),list:D.ColorList("red-white-blue",{presetKind:"scale"})}),"relative-value":D.Group({domain:D.MappedStatic("auto",{custom:D.Interval([-1,1]),auto:D.Group({symmetric:D.Boolean(!1,{description:"If true the automatic range is determined as [-|max|, |max|]."})})}),list:D.ColorList("red-white-blue",{presetKind:"scale"})})}),defaultColor:D.Color(ft(13421772))},kXe={name:"external-volume",label:"External Volume",category:ta.Misc,factory:function pae(e,t){var r,n;try{r=t.volume.getValue()}catch{}if(r){var a=t.coloring.params,i=r.grid.stats,o="custom"===a.domain.name?a.domain.params:[i.min,i.max],s="relative-value"===t.coloring.name;if("auto"===a.domain.name&&s&&(o[0]=(o[0]-i.mean)/i.sigma,o[1]=(o[1]-i.mean)/i.sigma),"auto"===t.coloring.params.domain.name&&t.coloring.params.domain.params.symmetric){var u=Math.max(Math.abs(o[0]),Math.abs(o[1]));o[0]=-u,o[1]=u}var c=zc.create({domain:o,listOrName:a.list.colors}),l=Xi.getGridToCartesianTransform(r.grid);me.invert(l,l);var f=S(),d=r.grid.cells.space,p=d.dimensions,h=d.get,m=r.grid.cells.data,v=p[0],g=p[1],y=p[2];n=function(b){if(!function U8e(e){return!!e&&"position-location"===e.kind}(b))return t.defaultColor;S.copy(f,b.position),S.transformMat4(f,f,l);var _=Math.floor(f[0]),C=Math.floor(f[1]),x=Math.floor(f[2]);if(_<0||_>=v||C<0||C>=g||x<0||x>=y)return t.defaultColor;var A=f[0]-_,T=f[1]-C,w=f[2]-x,E=Math.min(_+1,v-1),I=Math.min(C+1,g-1),M=Math.min(x+1,y-1),O=h(m,_,C,x),F=h(m,E,C,x),j=h(m,_,I,x),N=h(m,E,I,x),H=sa(sa(O,F,A),sa(j,N,A),T);O=h(m,_,C,M),F=h(m,E,C,M),j=h(m,_,I,M),N=h(m,E,I,M);var G=sa(sa(O,F,A),sa(j,N,A),T),U=sa(H,G,w);return s&&(U=(U-i.mean)/i.sigma),c.color(U)}}else n=function(){return t.defaultColor};return{factory:pae,granularity:"vertex",preferSmoothing:!0,color:n,props:t,description:"Assigns a color based volume value at a given vertex."}},getParams:function(){return dae},defaultValues:D.getDefaultValues(dae),isApplicable:function(e){return!0}},hae={mainchain:D.MappedStatic("molecule-type",{uniform:D.Group(lb),"chain-id":D.Group(lC),"entity-id":D.Group(dC),"entity-source":D.Group(mC),"molecule-type":D.Group(SE),"model-index":D.Group(gC),"structure-index":D.Group(bC),"secondary-structure":D.Group(W5)}),sidechain:D.MappedStatic("residue-name",{uniform:D.Group(lb),"residue-name":D.Group(H5),"element-symbol":D.Group(B5)})},LXe={name:"cartoon",label:"Cartoon",category:ta.Misc,factory:function mae(e,t){var r,n,a=function NXe(e,t){switch(t.name){case"uniform":return cg(0,t.params);case"chain-id":return fC(e,t.params);case"entity-id":return hC(e,t.params);case"entity-source":return vC(e,t.params);case"molecule-type":return CE(0,t.params);case"model-index":return yC(e,t.params);case"structure-index":return _C(e,t.params);case"secondary-structure":return Y5(e,t.params);default:xn()}}(e,t.mainchain),i=function BXe(e,t){switch(t.name){case"uniform":return cg(0,t.params);case"residue-name":return j5(0,t.params);case"element-symbol":return L5(e,t.params);default:xn()}}(e,t.sidechain),s=a.legend;return"table-legend"===(null===(r=a.legend)||void 0===r?void 0:r.kind)&&"table-legend"===(null===(n=i.legend)||void 0===n?void 0:n.kind)&&(s={kind:"table-legend",table:ur(ur([],a.legend.table,!0),i.legend.table,!0)}),{factory:mae,granularity:"group",preferSmoothing:!1,color:function o(u,c){return c?a.color(u,!1):i.color(u,!1)},props:t,description:"Uses separate themes for coloring mainchain and sidechain visuals.",legend:s}},getParams:function FXe(e){return D.clone(hae)},defaultValues:D.getDefaultValues(hae),isApplicable:function(e){return!!e.structure}};!function(e){e.Category=ta,e.PaletteScale=16777215,e.EmptyFactory=function(){return e.Empty};var t=ft(13421772);e.Empty={factory:e.EmptyFactory,granularity:"uniform",color:function(){return t},props:{}},e.areEqual=function r(a,i){return a.contextHash===i.contextHash&&a.factory===i.factory&&zf(a.props,i.props)},e.EmptyProvider={name:"",label:"",category:"",factory:e.EmptyFactory,getParams:function(){return{}},defaultValues:{},isApplicable:function(){return!0}},e.createRegistry=function n(){return new Cae(e.BuiltIn,e.EmptyProvider)},e.BuiltIn={"atom-id":AXe,"carbohydrate-symbol":GWe,cartoon:LXe,"chain-id":rne,"element-index":eYe,"element-symbol":EYe,"entity-id":cYe,"entity-source":hYe,hydrophobicity:sXe,illustrative:rXe,"model-index":gYe,"molecule-type":MYe,occupancy:hXe,"operator-hkl":gXe,"operator-name":M5,"partial-charge":_Xe,"polymer-id":OYe,"polymer-index":BYe,"residue-name":VYe,"secondary-structure":HYe,"sequence-id":YYe,"shape-group":GGe,"structure-index":_Ye,"trajectory-index":lXe,uncertainty:QYe,"unit-index":xYe,uniform:uze,"volume-segment":MXe,"volume-value":EXe,"external-volume":kXe}}(Vu||(Vu={}));var vae={scale:D.Numeric(1,{min:.1,max:5,step:.1})};function J5(e,t){return ke.isAtomic(e)?$_(e.model.atomicHierarchy.atoms.type_symbol.value(t)):ke.isSpheres(e)?e.model.coarseConformation.spheres.radius[t]:0}var GXe={name:"physical",label:"Physical",category:"",factory:function gae(e,t){var r=void 0===t.scale?1:t.scale;return{factory:gae,granularity:"group",size:function n(a){return at.is(a)?r*J5(a.unit,a.element):Ht.isLocation(a)?r*Math.min(J5(a.aUnit,a.aUnit.elements[a.aIndex]),J5(a.bUnit,a.bUnit.elements[a.bIndex])):1*r},props:t,description:"Assigns a physical size, i.e. vdW radius for atoms or given radius for coarse spheres."}},getParams:function zXe(e){return vae},defaultValues:D.getDefaultValues(vae),isApplicable:function(e){return!!e.structure}},yae={bfactorFactor:D.Numeric(.1,{min:0,max:1,step:.01}),rmsfFactor:D.Numeric(.05,{min:0,max:1,step:.01}),baseSize:D.Numeric(.2,{min:0,max:2,step:.1})};function bae(e,t,r){return ke.isAtomic(e)?e.model.atomicConformation.B_iso_or_equiv.value(t)*r.bfactorFactor:ke.isSpheres(e)?e.model.coarseConformation.spheres.rmsf[t]*r.rmsfFactor:0}var Zi,Oi,qXe={name:"uncertainty",label:"Uncertainty/Disorder",category:"",factory:function _ae(e,t){return{factory:_ae,granularity:"group",size:function r(n){var a=t.baseSize;return at.is(n)?a+=bae(n.unit,n.element,t):Ht.isLocation(n)&&(a+=bae(n.aUnit,n.aUnit.elements[n.aIndex],t)),a},props:t,description:"Assigns a size reflecting the uncertainty or disorder of an element's position, e.g. B-factor or RMSF, depending on the data availability and experimental technique."}},getParams:function jXe(e){return yae},defaultValues:D.getDefaultValues(yae),isApplicable:function(e){return!!e.structure&&e.structure.models.some(function(t){return t.atomicConformation.B_iso_or_equiv.isDefined||t.coarseHierarchy.isDefined})}};function Sae(e){return e.map(function(t){return[t.name,t.provider.label,t.provider.category]})}!function(e){e.EmptyFactory=function(){return e.Empty},e.Empty={factory:e.EmptyFactory,granularity:"uniform",size:function(){return 1},props:{}},e.areEqual=function t(n,a){return n.contextHash===a.contextHash&&n.factory===a.factory&&zf(n.props,a.props)},e.EmptyProvider={name:"",label:"",category:"",factory:e.EmptyFactory,getParams:function(){return{}},defaultValues:{},isApplicable:function(){return!0}},e.createRegistry=function r(){return new Cae(e.BuiltIn,e.EmptyProvider)},e.BuiltIn={physical:GXe,"shape-group":LGe,uncertainty:qXe,uniform:fze}}(Zi||(Zi={})),function(e){function r(){return{color:Vu.Empty,size:Zi.Empty}}e.create=function t(i,o,s,u){u=u||r();var c=s.colorTheme,l=s.sizeTheme;return u.color=i.colorThemeRegistry.create(c.name,o,c.params),u.size=i.sizeThemeRegistry.create(l.name,o,l.params),u},e.createEmpty=r,e.ensureDependencies=function n(i,o,s,u){var c,l;return ce(this,void 0,void 0,function(){return le(this,function(f){switch(f.label){case 0:return[4,null===(c=o.colorThemeRegistry.get(u.colorTheme.name).ensureCustomProperties)||void 0===c?void 0:c.attach(i,s)];case 1:return f.sent(),[4,null===(l=o.sizeThemeRegistry.get(u.sizeTheme.name).ensureCustomProperties)||void 0===l?void 0:l.attach(i,s)];case 2:return f.sent(),[2]}})})},e.releaseDependencies=function a(i,o,s){var u,c;null===(u=i.colorThemeRegistry.get(s.colorTheme.name).ensureCustomProperties)||void 0===u||u.detach(o),null===(c=i.sizeThemeRegistry.get(s.sizeTheme.name).ensureCustomProperties)||void 0===c||c.detach(o)}}(Oi||(Oi={}));var Os,Cae=function(){function e(t,r){var n=this;this.emptyProvider=r,this._list=[],this._map=new Map,this._name=new Map,Js(t,function(a,i){if(a.name!==i)throw new Error("Fix build in themes to have matching names. ".concat(a.name," ").concat(i));n.add(a)})}return Object.defineProperty(e.prototype,"default",{get:function(){return this._list[0]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"list",{get:function(){return this._list},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"types",{get:function(){return Sae(this._list)},enumerable:!1,configurable:!0}),e.prototype.sort=function(){this._list.sort(function(t,r){return t.provider.category===r.provider.category?t.provider.labelr.provider.label?1:0:t.provider.category>2,o=i+(a-4*i>>2);if(o<=i){for(var s=n;s>2),c=n,l=Math.min(4*i,a),f=Math.max(n,4*o),d=a;switch(r){case zt.Highlight:for(s=i;sr.lowestElementCount?"lowest":n>r.lowerElementCount?"lower":n>r.lowElementCount?"low":n>r.mediumElementCount?"medium":n>r.highElementCount?"high":"higher"}function rL(e,t){var r=Po(e.quality,"auto"),n=Po(e.detail,1),a=Po(e.radialSegments,12),i=Po(e.linearSegments,8),o=Po(e.resolution,2),s=Po(e.probePositions,12),u=Po(e.doubleSided,!0),c=0;if("auto"===r)if(t instanceof Ye)r=xae(t.root),c=function $Xe(e){if(1===e.root.models.length){var t=ri.Provider.get(e.root.model);if(t&&"P 1"===t.spacegroup.name&&!Cs.isZero(t.spacegroup.cell))return t.spacegroup.cell.volume}return Nt.volume(e.root.boundary.box)}(t);else if(nt.is(t)){var l=t.grid.cells.space.dimensions;r=(c=l[0]*l[1]*l[2])<1e7?"medium":"low"}switch(r){case"highest":n=3,a=36,i=18,o=.1,s=72,u=!0;break;case"higher":n=3,a=28,i=14,o=.3,s=48,u=!0;break;case"high":n=2,a=20,i=10,o=.5,s=36,u=!0;break;case"medium":n=1,a=12,i=8,o=.8,s=24,u=!0;break;case"low":n=0,a=8,i=3,o=1.3,s=24,u=!1;break;case"lower":n=0,a=4,i=2,o=3,s=12,u=!1;break;case"lowest":n=0,a=2,i=1,o=8,s=12,u=!1}return o=Math.max(o,c/5e8),o=Math.min(o,20),"off"===e.transparentBackfaces&&(void 0!==e.alpha&&e.alpha<1||e.xrayShaded)&&(u=!1),{detail:n,radialSegments:a,linearSegments:i,resolution:o,probePositions:s,doubleSided:u}}var TE=S.set,wae=S.normalize,Aae=S.sub,Tae=S.addScalar,DE=S.scale,Dae=S.toArray;function EE(e,t,r,n){var a=!1;if(nt.isLoci(e)){if(!nt.areEquivalent(e.volume,t))return!1;n(xe.ofLength(t.grid.cells.data.length))&&(a=!0)}else if(nt.Isosurface.isLoci(e)){if(!nt.areEquivalent(e.volume,t))return!1;if(r?.isoValue){if(!nt.IsoValue.areSame(e.isoValue,r.isoValue,t.grid.stats))return!1;n(xe.ofLength(t.grid.cells.data.length))&&(a=!0)}else for(var i=t.grid,o=i.stats,s=i.cells.data,u=o.sigma,c=nt.IsoValue.toAbsolute(e.isoValue,o).absoluteValue,l=0,f=s.length;l2)){for(var V=2-je,J=(Je=re,vt=ue,ut=Ce,void 0,void 0,_t=Math.floor(ut*_%A/_),f*(Math.floor(ut*_/A)*C*A+vt*A+(_t*_+Je))),ye=0;yec)throw new Error("outputStride + itemOffset must NOT be larger than colorStride");var d=e.colorType.endsWith("Instance"),p=d?e.instanceCount:1,h=Di(Math.max(1,p*t),f,Uint8Array),m=h.array,v=i[0],g=i[1],y=o[0],b=S.fromArray(S(),s,0),_=s[3];function C(ye,we,Ee){var Oe=Math.floor(Ee*v%y/v),Ne=Math.floor(Ee*v/y);return c*(Ne*g*y+we*y+(Oe*v+ye))}for(var x=S(),A=S(),T=S(),w=S(),E=0;Eo.drawCount.ref.value||a!==o.stride.ref.value)&&k.update(o.aSample,Iae(s,a)),k.updateIfChanged(o.drawCount,s),k.updateIfChanged(o.instanceCount,t.instanceCount),k.updateIfChanged(o.stride,a),k.updateIfChanged(o.uGroupCount,t.groupCount),k.update(o.aTransform,t.transformBuffer),k.update(o.aInstance,t.instanceBuffer),k.update(o.uGeoTexDim,Fe.set(o.uGeoTexDim.ref.value,t.positionTexture.getWidth(),t.positionTexture.getHeight())),k.update(o.tPosition,t.positionTexture),k.update(o.tGroup,t.groupTexture),k.update(o.uColorTexDim,Fe.set(o.uColorTexDim.ref.value,t.colorData.getWidth(),t.colorData.getHeight())),k.update(o.tColor,t.colorData),k.updateIfChanged(o.dColorType,t.colorType),k.updateIfChanged(o.uCurrentSlice,0),k.updateIfChanged(o.uCurrentX,0),k.updateIfChanged(o.uCurrentY,0),k.update(o.uBboxMin,r.min),k.update(o.uBboxSize,i),k.updateIfChanged(o.uResolution,n),e.namedComputeRenderables[Cc].update()}else e.namedComputeRenderables[Cc]=function hKe(e,t,r,n,a){var i=S.sub(S(),r.max,r.min),o=Math.round(t.vertexCount/a),s={drawCount:k.create(o),instanceCount:k.create(t.instanceCount),stride:k.create(a),uGroupCount:k.create(t.groupCount),aTransform:k.create(t.transformBuffer),aInstance:k.create(t.instanceBuffer),aSample:k.create(Iae(o,a)),uGeoTexDim:k.create(Fe.create(t.positionTexture.getWidth(),t.positionTexture.getHeight())),tPosition:k.create(t.positionTexture),tGroup:k.create(t.groupTexture),uColorTexDim:k.create(Fe.create(t.colorData.getWidth(),t.colorData.getHeight())),tColor:k.create(t.colorData),dColorType:k.create(t.colorType),uCurrentSlice:k.create(0),uCurrentX:k.create(0),uCurrentY:k.create(0),uBboxMin:k.create(r.min),uBboxSize:k.create(i),uResolution:k.create(n)},u=R({},dKe);return Xa(Ya(e,"points",Un("accumulate",fKe,lKe,{drawBuffers:"required"}),u,s),s)}(e,t,r,n,a);return e.namedComputeRenderables[Cc]}(n,e,m,t,r);u.currentRenderItemId=-1,I.bind(),i.drawBuffers([i.COLOR_ATTACHMENT0,i.COLOR_ATTACHMENT1]);var j=F.values,N=j.uCurrentSlice,H=j.uCurrentX,G=j.uCurrentY;xt&&n.timer.mark("ColorAccumulate.render"),function mKe(e){var t=e.gl,r=e.state;r.disable(t.CULL_FACE),r.enable(t.BLEND),r.disable(t.DEPTH_TEST),r.enable(t.SCISSOR_TEST),r.depthMask(!1),r.clearColor(0,0,0,0),r.blendFunc(t.ONE,t.ONE),r.blendEquation(t.FUNC_ADD)}(n),u.viewport(0,0,T,w),u.scissor(0,0,T,w),o.clear(o.COLOR_BUFFER_BIT),k.update(G,0);for(var U=0,Q=0,W=0,K=0;K=E&&(U-=E,W=0,k.update(G,Q+=C)),k.update(H,W),k.update(N,K),u.viewport(W,Q,_,C),u.scissor(W,Q,_,C),F.render(),++U,W+=_;M.detachFramebuffer(I,0),O.detachFramebuffer(I,1),i.drawBuffers([o.COLOR_ATTACHMENT0,o.NONE]),xt&&n.timer.markEnd("ColorAccumulate.render"),xt&&n.timer.mark("ColorNormalize.render"),(!a||function X7e(e){return e.format===Hee}(a))&&(a=s.texture("image-uint8","rgba","ubyte","linear")),a.define(T,w);var ne=function gKe(e,t,r){if(e.namedComputeRenderables[wC]){var n=e.namedComputeRenderables[wC].values;k.update(n.tColor,t),k.update(n.tCount,r),k.update(n.uTexSize,Fe.set(n.uTexSize.ref.value,t.getWidth(),t.getHeight())),e.namedComputeRenderables[wC].update()}else e.namedComputeRenderables[wC]=function yKe(e,t,r){var n=R(R({},Ii),{tColor:k.create(t),tCount:k.create(r),uTexSize:k.create(Fe.create(t.getWidth(),t.getHeight()))}),a=R({},vKe);return Xa(Ya(e,"triangles",Un("normalize",Fo,cKe),a,n),n)}(e,t,r);return e.namedComputeRenderables[wC]}(n,M,O);u.currentRenderItemId=-1,function bKe(e){var t=e.gl,r=e.state;r.disable(t.CULL_FACE),r.enable(t.BLEND),r.disable(t.DEPTH_TEST),r.enable(t.SCISSOR_TEST),r.depthMask(!1),r.clearColor(0,0,0,0),r.blendFunc(t.ONE,t.ONE),r.blendEquation(t.FUNC_ADD)}(n),a.attachFramebuffer(I,0),u.viewport(0,0,T,w),u.scissor(0,0,T,w),o.clear(o.COLOR_BUFFER_BIT),ne.render(),xt&&n.timer.markEnd("ColorNormalize.render");var X=pr.create(b[0],b[1],b[2],v),L=d?"volumeInstance":"volume";return xt&&n.timer.markEnd("calcTextureMeshColorSmoothing"),{texture:a,gridDim:y,gridTexDim:Fe.create(T,w),gridTransform:X,type:L}}var _r,Mae,nL="color-smoothing-rgb",Mb="color-smoothing-rgba",aL="color-smoothing-alpha";function Pae(e,t,r,n,a){if(function SKe(e){return"group"===e||"groupInstance"===e}(e.dColorType.ref.value)){r*=3,n.namedTextures[nL]||(n.namedTextures[nL]=n.resources.texture("image-uint8","rgb","ubyte","nearest"));var i=n.namedTextures[nL];i.load(e.tColor.ref.value);var o=ME({vertexCount:e.uVertexCount.ref.value,instanceCount:e.uInstanceCount.ref.value,groupCount:e.uGroupCount.ref.value,transformBuffer:e.aTransform.ref.value,instanceBuffer:e.aInstance.ref.value,positionTexture:e.tPosition.ref.value,groupTexture:e.tGroup.ref.value,colorData:i,colorType:e.dColorType.ref.value,boundingSphere:e.boundingSphere.ref.value,invariantBoundingSphere:e.invariantBoundingSphere.ref.value},t,r,n,a);k.updateIfChanged(e.dColorType,o.type),k.update(e.tColorGrid,o.texture),k.update(e.uColorTexDim,o.gridTexDim),k.update(e.uColorGridDim,o.gridDim),k.update(e.uColorGridTransform,o.gridTransform)}}function Wn(e,t){return{kind:e,layers:t}}function qo(e,t){return{kind:e,layers:t}}!function(e){e.setVisibility=function t(d,p){d&&(d.state.visible=p)},e.setAlphaFactor=function r(d,p){d&&(d.state.alphaFactor=p)},e.setPickable=function n(d,p){d&&(d.state.pickable=p)},e.setColorOnly=function a(d,p){d&&(d.state.colorOnly=p)},e.mark=function i(d,p,h,m,v){if(!d||Fs(p))return!1;var g=d.values,y=g.tMarker,b=g.uMarker,_=g.markerAverage,C=g.markerStatus,A=g.instanceCount,w=g.instanceGranularity.ref.value?A.ref.value:g.uGroupCount.ref.value*A.ref.value,E=y.ref.value.array,I=C.ref.value;if(!zu(p)){var M=0;if(m(p,function(H){return M+=xe.size(H),!0},!0),0===M)return!1;M===w&&(p=wE)}var O=!1,F=-1,j=-1;if(zu(p)){var N=function YXe(e,t){var r=-1,n=-1;switch(e){case zt.Highlight:0===t||1===t?(r=1,n=1):2===t||3===t?(r=1,n=3):r=1;break;case zt.RemoveHighlight:0===t||1===t?(r=0,n=0):(2===t||3===t)&&(r=1,n=2);break;case zt.Select:1===t||3===t?(r=1,n=3):0===t||2===t?(r=1,n=2):r=1;break;case zt.Deselect:1===t||3===t?(r=1,n=1):(0===t||2===t)&&(r=0,n=0);break;case zt.Toggle:1===t?(r=1,n=3):2===t?(r=0,n=0):3===t?(r=1,n=1):0===t&&(r=1,n=2);break;case zt.Clear:r=0,n=0}return{average:r,status:n}}(h,I);-1!==N.status?(O=I!==N.status)&&function WXe(e,t,r){e.fill(t,0,r)}(E,N.status,w):O=tL(E,xe.ofLength(w),h),F=N.average,j=N.status}else(O=m(p,function(H){return tL(E,H,h)},!0))&&(F=function XXe(e,t){switch(e){case zt.Highlight:return.5;case zt.RemoveHighlight:return 0===t?0:2===t||3===t?.5:-1;case zt.Select:return.5;case zt.Deselect:return 1===t||3===t?.5:0===t?0:-1;case zt.Toggle:return-1===t?-1:.5;case zt.Clear:return-1===t?-1:0===t?0:.5;case zt.None:return-1;default:xn()}}(h,I),v&&-1!==v.status&&-1===F&&Os.isReverse(v.action,h)&&hr.areEqual(p,v.loci)&&(F=0===(j=v.status)?0:.5));return O&&(-1===F&&0===(F=iee(E,w))&&(j=0),v&&(v.action=h,v.loci=p,v.status=I),k.updateIfChanged(b,j),-1===j&&k.update(y,y.ref.value),k.updateIfChanged(_,F),k.updateIfChanged(C,j)),O},e.setOverpaint=function o(d,p,h,m,v){if(d){var g=d.values,y=g.tOverpaint,b=g.dOverpaintType,_=g.dOverpaint,x=g.instanceCount,A=g.instanceGranularity,T=A.ref.value?x.ref.value:g.uGroupCount.ref.value*x.ref.value,w=A.ref.value?"instance":"groupInstance";!function mze(e,t,r){var n=Di(Math.max(1,e),4,Uint8Array,r&&r.tOverpaint.ref.value.array);r?(k.update(r.tOverpaint,n),k.update(r.uOverpaintTexDim,Fe.create(n.width,n.height)),k.updateIfChanged(r.dOverpaint,e>0),k.updateIfChanged(r.dOverpaintType,t)):(k.create(n),k.create(Fe.create(n.width,n.height)),k.create(e>0),k.create(Go()),k.create(S.create(1,1,1)),k.create(pr.create(0,0,0,1)),k.create(t),k.create(1))}(p.layers.length?T:0,w,d.values);var E=y.ref.value.array;m&&Qee(E,0,T);for(var I=function(K,ne){var X=p.layers[K],Y=X.color,$=X.clear;h(X.loci,function(q){var z=xe.start(q),te=xe.end(q);return $?Qee(E,z,te):function hze(e,t,r,n){for(var a=t;a0),0!==p.layers.length&&"instance"!==w&&v&&Pp(v.props)){var F=v.geometry,j=v.props,N=v.webgl;if("mesh"===F.kind){var H=F.meta,U=H.overpaintTexture;(Q=ol(j.smoothColors,!0,H.resolution))&&(function aKe(e,t,r,n,a){if(function nKe(e){return"groupInstance"===e}(e.dOverpaintType.ref.value)){var i=IE({vertexCount:e.uVertexCount.ref.value,instanceCount:e.uInstanceCount.ref.value,groupCount:e.uGroupCount.ref.value,transformBuffer:e.aTransform.ref.value,instanceBuffer:e.aInstance.ref.value,positionBuffer:e.aPosition.ref.value,groupBuffer:e.aGroup.ref.value,colorData:e.tOverpaint.ref.value,colorType:e.dOverpaintType.ref.value,boundingSphere:e.boundingSphere.ref.value,invariantBoundingSphere:e.invariantBoundingSphere.ref.value,itemSize:4},t,r,n,a);"volume"===i.kind?(k.updateIfChanged(e.dOverpaintType,i.type),k.update(e.tOverpaintGrid,i.texture),k.update(e.uOverpaintTexDim,i.gridTexDim),k.update(e.uOverpaintGridDim,i.gridDim),k.update(e.uOverpaintGridTransform,i.gridTransform)):"vertex"===i.kind&&(k.updateIfChanged(e.dOverpaintType,i.type),k.update(e.tOverpaint,i.texture),k.update(e.uOverpaintTexDim,i.texDim))}}(d.values,Q.resolution,Q.stride,N,U),F.meta.overpaintTexture=d.values.tOverpaintGrid.ref.value)}else if(N&&"texture-mesh"===F.kind){var Q,W=F.meta;U=W.overpaintTexture,(Q=ol(j.smoothColors,!0,W.resolution))&&(function xKe(e,t,r,n,a){if(function CKe(e){return"groupInstance"===e}(e.dOverpaintType.ref.value)){r*=3,n.namedTextures[Mb]||(n.namedTextures[Mb]=n.resources.texture("image-uint8","rgba","ubyte","nearest"));var i=n.namedTextures[Mb];i.load(e.tOverpaint.ref.value);var o=ME({vertexCount:e.uVertexCount.ref.value,instanceCount:e.uInstanceCount.ref.value,groupCount:e.uGroupCount.ref.value,transformBuffer:e.aTransform.ref.value,instanceBuffer:e.aInstance.ref.value,positionTexture:e.tPosition.ref.value,groupTexture:e.tGroup.ref.value,colorData:i,colorType:e.dOverpaintType.ref.value,boundingSphere:e.boundingSphere.ref.value,invariantBoundingSphere:e.invariantBoundingSphere.ref.value},t,r,n,a);k.updateIfChanged(e.dOverpaintType,o.type),k.update(e.tOverpaintGrid,o.texture),k.update(e.uOverpaintTexDim,o.gridTexDim),k.update(e.uOverpaintGridDim,o.gridDim),k.update(e.uOverpaintGridTransform,o.gridTransform)}}(d.values,Q.resolution,Q.stride,N,U),F.meta.overpaintTexture=d.values.tOverpaintGrid.ref.value)}}}},e.setTransparency=function s(d,p,h,m,v){if(d){var g=d.values,y=g.tTransparency,b=g.dTransparencyType,_=g.transparencyAverage,C=g.dTransparency,A=g.instanceCount,T=g.instanceGranularity,w=T.ref.value?A.ref.value:g.uGroupCount.ref.value*A.ref.value,E=T.ref.value?"instance":"groupInstance";!function yze(e,t,r){var n=Di(Math.max(1,e),1,Uint8Array,r&&r.tTransparency.ref.value.array);r?(k.update(r.tTransparency,n),k.update(r.uTransparencyTexDim,Fe.create(n.width,n.height)),k.updateIfChanged(r.dTransparency,e>0),k.updateIfChanged(r.transparencyAverage,Jee(n.array,e)),k.updateIfChanged(r.dTransparencyType,t)):(k.create(n),k.create(Fe.create(n.width,n.height)),k.create(e>0),k.create(0),k.create(Go()),k.create(S.create(1,1,1)),k.create(pr.create(0,0,0,1)),k.create(t),k.create(1))}(p.layers.length?w:0,E,d.values);var I=y.ref.value.array;m&&function gze(e,t,r){e.fill(0,t,r)}(I,0,w);for(var M=function(ne,X){var L=p.layers[ne],$=L.value;h(L.loci,function(q){var z=xe.start(q),te=xe.end(q);return function vze(e,t,r,n){for(var a=t;a0),0!==p.layers.length&&"instance"!==E&&v&&Pp(v.props)){var j=v.geometry,N=v.props,H=v.webgl;if("mesh"===j.kind){var G=j.meta,Q=G.transparencyTexture;(W=ol(N.smoothColors,!0,G.resolution))&&(function oKe(e,t,r,n,a){if(function iKe(e){return"groupInstance"===e}(e.dTransparencyType.ref.value)){var i=IE({vertexCount:e.uVertexCount.ref.value,instanceCount:e.uInstanceCount.ref.value,groupCount:e.uGroupCount.ref.value,transformBuffer:e.aTransform.ref.value,instanceBuffer:e.aInstance.ref.value,positionBuffer:e.aPosition.ref.value,groupBuffer:e.aGroup.ref.value,colorData:e.tTransparency.ref.value,colorType:e.dTransparencyType.ref.value,boundingSphere:e.boundingSphere.ref.value,invariantBoundingSphere:e.invariantBoundingSphere.ref.value,itemSize:1},t,r,n,a);"volume"===i.kind?(k.updateIfChanged(e.dTransparencyType,i.type),k.update(e.tTransparencyGrid,i.texture),k.update(e.uTransparencyTexDim,i.gridTexDim),k.update(e.uTransparencyGridDim,i.gridDim),k.update(e.uTransparencyGridTransform,i.gridTransform)):"vertex"===i.kind&&(k.updateIfChanged(e.dTransparencyType,i.type),k.update(e.tTransparency,i.texture),k.update(e.uTransparencyTexDim,i.texDim))}}(d.values,W.resolution,W.stride,H,Q),j.meta.transparencyTexture=d.values.tTransparencyGrid.ref.value)}else if(H&&"texture-mesh"===j.kind){var W,K=j.meta;Q=K.transparencyTexture,(W=ol(N.smoothColors,!0,K.resolution))&&(function AKe(e,t,r,n,a){if(function wKe(e){return"groupInstance"===e}(e.dTransparencyType.ref.value)){r*=3,n.namedTextures[aL]||(n.namedTextures[aL]=n.resources.texture("image-uint8","alpha","ubyte","nearest"));var i=n.namedTextures[aL];i.load(e.tTransparency.ref.value);var o=ME({vertexCount:e.uVertexCount.ref.value,instanceCount:e.uInstanceCount.ref.value,groupCount:e.uGroupCount.ref.value,transformBuffer:e.aTransform.ref.value,instanceBuffer:e.aInstance.ref.value,positionTexture:e.tPosition.ref.value,groupTexture:e.tGroup.ref.value,colorData:i,colorType:e.dTransparencyType.ref.value,boundingSphere:e.boundingSphere.ref.value,invariantBoundingSphere:e.invariantBoundingSphere.ref.value},t,r,n,a);k.updateIfChanged(e.dTransparencyType,o.type),k.update(e.tTransparencyGrid,o.texture),k.update(e.uTransparencyTexDim,o.gridTexDim),k.update(e.uTransparencyGridDim,o.gridDim),k.update(e.uTransparencyGridTransform,o.gridTransform)}}(d.values,W.resolution,W.stride,H,Q),j.meta.transparencyTexture=d.values.tTransparencyGrid.ref.value)}}}},e.setSubstance=function u(d,p,h,m,v){if(d){var g=d.values,y=g.tSubstance,b=g.dSubstanceType,_=g.dSubstance,x=g.instanceCount,A=g.instanceGranularity,T=A.ref.value?x.ref.value:g.uGroupCount.ref.value*x.ref.value,w=A.ref.value?"instance":"groupInstance";!function xze(e,t,r){var n=Di(Math.max(1,e),4,Uint8Array,r&&r.tSubstance.ref.value.array);r?(k.update(r.tSubstance,n),k.update(r.uSubstanceTexDim,Fe.create(n.width,n.height)),k.updateIfChanged(r.dSubstance,e>0),k.updateIfChanged(r.dSubstanceType,t)):(k.create(n),k.create(Fe.create(n.width,n.height)),k.create(e>0),k.create(Go()),k.create(S.create(1,1,1)),k.create(pr.create(0,0,0,1)),k.create(t),k.create(1))}(p.layers.length?T:0,w,d.values);var E=y.ref.value.array;m&&rte(E,0,T);for(var I=function(K,ne){var X=p.layers[K],Y=X.material,$=X.clear;h(X.loci,function(q){var z=xe.start(q),te=xe.end(q);return $?rte(E,z,te):function Cze(e,t,r,n){for(var a=t;a0),0!==p.layers.length&&"instance"!==w&&v&&Pp(v.props)){var F=v.geometry,j=v.props,N=v.webgl;if("mesh"===F.kind){var H=F.meta,U=H.substanceTexture;(Q=ol(j.smoothColors,!0,H.resolution))&&(function uKe(e,t,r,n,a){if(function sKe(e){return"groupInstance"===e}(e.dSubstanceType.ref.value)){var i=IE({vertexCount:e.uVertexCount.ref.value,instanceCount:e.uInstanceCount.ref.value,groupCount:e.uGroupCount.ref.value,transformBuffer:e.aTransform.ref.value,instanceBuffer:e.aInstance.ref.value,positionBuffer:e.aPosition.ref.value,groupBuffer:e.aGroup.ref.value,colorData:e.tSubstance.ref.value,colorType:e.dSubstanceType.ref.value,boundingSphere:e.boundingSphere.ref.value,invariantBoundingSphere:e.invariantBoundingSphere.ref.value,itemSize:4},t,r,n,a);"volume"===i.kind?(k.updateIfChanged(e.dSubstanceType,i.type),k.update(e.tSubstanceGrid,i.texture),k.update(e.uSubstanceTexDim,i.gridTexDim),k.update(e.uSubstanceGridDim,i.gridDim),k.update(e.uSubstanceGridTransform,i.gridTransform)):"vertex"===i.kind&&(k.updateIfChanged(e.dSubstanceType,i.type),k.update(e.tSubstance,i.texture),k.update(e.uSubstanceTexDim,i.texDim))}}(d.values,Q.resolution,Q.stride,N,U),F.meta.substanceTexture=d.values.tSubstanceGrid.ref.value)}else if(N&&"texture-mesh"===F.kind){var Q,W=F.meta;U=W.substanceTexture,(Q=ol(j.smoothColors,!0,W.resolution))&&(function DKe(e,t,r,n,a){if(function TKe(e){return"groupInstance"===e}(e.dSubstanceType.ref.value)){r*=3,n.namedTextures[Mb]||(n.namedTextures[Mb]=n.resources.texture("image-uint8","rgba","ubyte","nearest"));var i=n.namedTextures[Mb];i.load(e.tSubstance.ref.value);var o=ME({vertexCount:e.uVertexCount.ref.value,instanceCount:e.uInstanceCount.ref.value,groupCount:e.uGroupCount.ref.value,transformBuffer:e.aTransform.ref.value,instanceBuffer:e.aInstance.ref.value,positionTexture:e.tPosition.ref.value,groupTexture:e.tGroup.ref.value,colorData:i,colorType:e.dSubstanceType.ref.value,boundingSphere:e.boundingSphere.ref.value,invariantBoundingSphere:e.invariantBoundingSphere.ref.value},t,r,n,a);k.updateIfChanged(e.dSubstanceType,o.type),k.update(e.tSubstanceGrid,o.texture),k.update(e.uSubstanceTexDim,o.gridTexDim),k.update(e.uSubstanceGridDim,o.gridDim),k.update(e.uSubstanceGridTransform,o.gridTransform)}}(d.values,Q.resolution,Q.stride,N,U),F.meta.substanceTexture=d.values.tSubstanceGrid.ref.value)}}}},e.setClipping=function c(d,p,h,m){if(d){var v=d.values,g=v.tClipping,y=v.dClippingType,b=v.dClipping,C=v.instanceCount,x=v.instanceGranularity,A=x.ref.value?C.ref.value:v.uGroupCount.ref.value*C.ref.value,w=x.ref.value?"instance":"groupInstance";!function Sze(e,t,r){var n=Di(Math.max(1,e),1,Uint8Array,r&&r.tClipping.ref.value.array);r?(k.update(r.tClipping,n),k.update(r.uClippingTexDim,Fe.create(n.width,n.height)),k.updateIfChanged(r.dClipping,e>0),k.updateIfChanged(r.dClippingType,t)):(k.create(n),k.create(Fe.create(n.width,n.height)),k.create(e>0),k.create(t))}(p.layers.length?A:0,w,d.values);var E=g.ref.value.array;m&&function _ze(e,t,r){e.fill(0,t,r)}(E,0,A);for(var I=function(F,j){var N=p.layers[F],G=N.groups;h(N.loci,function(Q){var W=xe.start(Q),K=xe.end(Q);return function bze(e,t,r,n){return e.fill(n,t,r),!0}(E,W,K,G)},!1)},M=0,O=p.layers.length;M0)}},e.setThemeStrength=function l(d,p){d&&(k.updateIfChanged(d.values.uOverpaintStrength,p.overpaint),k.updateIfChanged(d.values.uTransparencyStrength,p.transparency),k.updateIfChanged(d.values.uSubstanceStrength,p.substance))},e.setTransform=function f(d,p,h){if(d&&(p||h)){var m=d.values;p&&(me.copy(m.matrix.ref.value,p),k.update(m.matrix,m.matrix.ref.value)),h?(m.extraTransform.ref.value.set(h),k.update(m.extraTransform,m.extraTransform.ref.value)):null===h&&(WD(m.extraTransform.ref.value,m.instanceCount.ref.value),k.update(m.extraTransform,m.extraTransform.ref.value)),Yee(m);var v=fo(m.invariantBoundingSphere.ref.value,m.aTransform.ref.value,m.instanceCount.ref.value,0);k.update(m.boundingSphere,v)}}}(_r||(_r={})),function(e){function n(l){return 0===l.layers.length}e.Empty={kind:"empty-loci",layers:[]},function(l){var f,g;function h(g){switch(g){case"one":return f.One;case"two":return f.Two;case"three":return f.Three;case"four":return f.Four;case"five":return f.Five;case"six":return f.Six}}l.is=ns.has,(g=f=l.Flag||(l.Flag={}))[g.None=0]="None",g[g.One=1]="One",g[g.Two=2]="Two",g[g.Three=4]="Three",g[g.Four=8]="Four",g[g.Five=16]="Five",g[g.Six=32]="Six",l.create=function d(g){return ns.create(g)},l.Names={one:f.One,two:f.Two,three:f.Three,four:f.Four,five:f.Five,six:f.Six},l.isName=function p(g){return g in l.Names},l.fromName=h,l.fromNames=function m(g){for(var y=f.None,b=0,_=g.length;b<_;++b)y|=h(g[b]);return y},l.toNames=function v(g){var y=[];return l.is(g,f.One)&&y.push("one"),l.is(g,f.Two)&&y.push("two"),l.is(g,f.Three)&&y.push("three"),l.is(g,f.Four)&&y.push("four"),l.is(g,f.Five)&&y.push("five"),l.is(g,f.Six)&&y.push("six"),y}}(e.Groups||(e.Groups={})),e.areEqual=function r(l,f){if(l.layers.length!==f.layers.length)return!1;for(var d=0,p=l.layers.length;d[+ ").concat(Fb(e-1,"other ".concat(Nv(r))),"]")}function FE(e,t){void 0===t&&(t={});var r=R(R({},Ob),t),n=function zKe(e,t,r,n,a){void 0===t&&(t=!1),void 0===r&&(r=!1),void 0===n&&(n=!1),void 0===a&&(a=!1);var i=e.structureCount,o=e.chainCount,s=e.residueCount,u=e.conformationCount,c=e.elementCount;if(!t&&1===c&&0===s&&0===o)return rh(e.firstElementLoc,{hidePrefix:r,condensed:n,granularity:"element",reverse:a});if(!t&&0===c&&1===s&&0===o)return rh(e.firstResidueLoc,{hidePrefix:r,condensed:n,granularity:"residue",reverse:a});if(t||0!==c||0!==s||1!==o){if(t){var d=[];return i>0&&d.push(Fb(i,"Structure")),o>0&&d.push(Fb(o,"Chain")),s>0&&d.push(Fb(s,"Residue")),u>0&&d.push(Fb(u,"Conformation")),c>0&&d.push(Fb(c,"Element")),d.join(" + ")}return d=[],i>0&&d.push(1===i?rh(e.firstStructureLoc,{hidePrefix:r,condensed:n,granularity:"structure",reverse:a}):AC(i,e.firstStructureLoc,"structure",r,a,n)),o>0&&(d.push(1===o?rh(e.firstChainLoc,{condensed:n,granularity:"chain",hidePrefix:r,reverse:a}):AC(o,e.firstChainLoc,"chain",r,a,n)),r=!0),s>0&&(d.push(1===s?rh(e.firstResidueLoc,{condensed:n,granularity:"residue",hidePrefix:r,reverse:a}):AC(s,e.firstResidueLoc,"residue",r,a,n)),r=!0),u>0&&(d.push(1===u?rh(e.firstConformationLoc,{condensed:n,granularity:"conformation",hidePrefix:r,reverse:a}):AC(u,e.firstConformationLoc,"conformation",r,a,n)),r=!0),c>0&&d.push(1===c?rh(e.firstElementLoc,{condensed:n,granularity:"element",hidePrefix:r,reverse:a}):AC(c,e.firstElementLoc,"element",r,a,n)),d.join(" + ")}var l=e.firstChainLoc.unit,f=ke.isAtomic(l)&&1===function VKe(e){var t=e.elements,n=e.model.atomicHierarchy,a=n.chainAtomSegments,i=n.residueAtomSegments;return i.index[a.offsets[a.index[t[t.length-1]]+1]-1]-i.index[a.offsets[a.index[t[0]]]]+1}(l)||ke.Traits.is(l.traits,ke.Trait.MultiChain)?"residue":"chain";return rh(e.firstChainLoc,{hidePrefix:r,condensed:n,granularity:f,reverse:a})}(e,r.countsOnly,r.hidePrefix,r.condensed,r.reverse);return r.htmlStyling?n:FO(n)}function NE(e,t){void 0===t&&(t={});for(var r=Zf.create(),n=0,a=e;n0){var y=[f[0].join(" | ")];for(v=1,g=f.length;v")}return(f=e.loci.map(function(_){return OE(_,t)})).filter(function(_){return!!_}).join(i?" \u2014 ":"
")}(e,r);return r.htmlStyling?n:FO(n)}function rh(e,t){var r,n;void 0===t&&(t={});var a=R(R({},Ob),t),i=Yae(e,a.granularity,a.hidePrefix,a.reverse||a.condensed),o=a.condensed?null!==(n=null===(r=i[0])||void 0===r?void 0:r.replace(/\[.*\]/g,"").trim())&&void 0!==n?n:"":i.filter(function(s){return!!s}).join(" | ");return a.htmlStyling?o:FO(o)}function Yae(e,t,r,n){void 0===t&&(t="element"),void 0===r&&(r=!1),void 0===n&&(n=!1);var a=[];if(!r){var i=e.unit.model.entry;i.length>30&&(i=i.substr(0,27)+"\u2026"),a.push("".concat(i,"")),"structure"!==t&&(a.push("Model ".concat(e.unit.model.modelNum,"")),a.push("Instance ".concat(e.unit.conformation.operator.name,"")))}return ke.isAtomic(e.unit)?a.push.apply(a,function HKe(e,t,r){void 0===r&&(r=!1);var n=at.residueIndex(e),a=it.chain.label_asym_id(e),i=it.chain.auth_asym_id(e),o=0===e.unit.model.atomicHierarchy.residues.label_seq_id.valueKind(n),s=it.residue.label_seq_id(e),u=it.residue.auth_seq_id(e),c=it.residue.pdbx_PDB_ins_code(e),l=it.atom.label_comp_id(e),f=it.atom.label_atom_id(e),d=it.atom.label_alt_id(e),p=it.atom.occupancy(e),h=it.residue.microheterogeneityCompIds(e),m="residue"===t&&h.length>1?"(".concat(h.join("|"),")"):l,v=[];switch(t){case"element":v.push("".concat(f,"").concat(d?"%".concat(d):""));case"conformation":"conformation"===t&&d&&v.push("Conformation ".concat(d,""));case"residue":var g=s!==u&&o?s:u;v.push("".concat(m," ").concat(g,"").concat(g!==u?" [auth ".concat(u,"]"):"","").concat(c||"",""));case"chain":a===i?v.push("".concat(a,"")):"chain"===t&&ke.Traits.is(e.unit.traits,ke.Trait.MultiChain)?v.push("[auth ".concat(i,"]")):v.push("".concat(a," [auth ").concat(i,"]"))}return v.length>0&&1!==p&&!r&&(v[0]="".concat(v[0]," [occupancy ").concat(Math.round(100*p)/100,"]")),v.reverse()}(e,t,n)):ke.isCoarse(e.unit)?a.push.apply(a,function jKe(e,t){var r=it.coarse.asym_id(e),n=it.coarse.seq_id_begin(e),a=it.coarse.seq_id_end(e),i=[];switch(t){case"element":case"conformation":case"residue":if(n===a){var o=it.coarse.entityKey(e),u=e.unit.model.sequence.byEntityKey[o].sequence.compId.value(n-1);i.push("".concat(u," ").concat(n,""))}else i.push("".concat(n,"-").concat(a,""));case"chain":i.push("".concat(r,""))}return i.reverse()}(e,t)):a.push("Unknown"),n?a.reverse():a}function oL(e,t){void 0===t&&(t={});var r=R(R(R({},Ob),{measureOnly:!1,unitLabel:"\u212b"}),t),n=e.loci.map(function(u){return hr.getCenter(u)}),o="".concat(S.distance(n[0],n[1]).toFixed(2)," ").concat(r.unitLabel);if(r.measureOnly)return o;var s=BE(e,r);return r.condensed?"".concat(o," | ").concat(s):"Distance ".concat(o,"
").concat(s)}function sL(e,t){void 0===t&&(t={});var r=R(R(R({},Ob),{measureOnly:!1}),t),n=e.loci.map(function(f){return hr.getCenter(f)}),a=n[0],i=n[1],o=n[2],s=S.sub(S(),a,i),u=S.sub(S(),o,i),c="".concat(nc(S.angle(s,u)).toFixed(2),"\xb0");if(r.measureOnly)return c;var l=BE(e,r);return r.condensed?"".concat(c," | ").concat(l):"Angle ".concat(c,"
").concat(l)}function uL(e,t){void 0===t&&(t={});var r=R(R(R({},Ob),{measureOnly:!1}),t),n=e.loci.map(function(l){return hr.getCenter(l)}),u="".concat(nc(S.dihedralAngle(n[0],n[1],n[2],n[3])).toFixed(2),"\xb0");if(r.measureOnly)return u;var c=BE(e,r);return r.condensed?"".concat(u," | ").concat(c):"Dihedral ".concat(u,"
").concat(c)}var Xae={customText:D.Text("",{label:"Text",description:"Override the label with custom value.",isEssential:!0}),textColor:D.Color(gr.black,{isEssential:!0}),textSize:D.Numeric(.5,{min:.1,max:10,step:.1},{isEssential:!0})},LE=R(R(R({},yc.Params),Xae),{borderWidth:D.Numeric(.2,{min:0,max:.5,step:.01})}),Kae={unitLabel:D.Text("\u212b",{isEssential:!0})},qKe=R(R(R({},la.Params),Kae),{lineSizeAttenuation:D.Boolean(!0),linesColor:D.Color(gr.lightgreen,{isEssential:!0}),linesSize:D.Numeric(.075,{min:.01,max:5,step:.01}),dashLength:D.Numeric(.2,{min:.01,max:.2,step:.01})}),WKe=R(R({},LE),Kae),Zae={lines:function(e,t){return Qi(KKe,la.Utils,{modifyState:function(r){return R(R({},r),{markerActions:Os.Highlighting})}})},text:function(e,t){return Qi(QKe,yc.Utils,{modifyState:function(r){return R(R({},r),{markerActions:zt.None})}})}},Qae=R(R(R({},qKe),WKe),{visuals:D.MultiSelect(["lines","text"],D.objectToOptions(Zae))});function $ae(e,t){var r=t.sphereA,n=t.sphereB,a=t.center,i=e.loci,s=i[1];return hr.getBoundingSphere(i[0],r),hr.getBoundingSphere(s,n),S.add(a,r.center,n.center),S.scale(a,a,.5),t.distance=S.distance(r.center,n.center),t}var xm=function YKe(){return{sphereA:De(),sphereB:De(),center:S(),distance:0}}();function Jae(e,t){return 1===e.pairs.length?"Distance ".concat(oL(e.pairs[0],{unitLabel:t,measureOnly:!0})):"".concat(e.pairs.length," Distances")}function KKe(e,t,r,n){var a=function XKe(e,t,r){for(var n=Bu.create(128,64,r),a=0,i=e.pairs.length;a0}},getDuration:function(e){return{kind:"fixed",durationMs:e.durationInMs}},initialState:function(){return{t:0}},setup:function(e,t,r){for(var n=r.state.data,i=n.select(wr.Generators.ofType(ve.Molecule.Structure.Representation3D,e.target&&"all"!==e.target?e.target:ln.RootRef)),o=n.build(),s=!1,u=0,c=i;u0||(s=!0,o.to(l).apply(et.Representation.UnwindStructureAssemblyRepresentation3D,{t:0},{tags:"animate-assembly-unwind"}))}if(s)return o.commit({doNotUpdateCurrent:!0})},teardown:function(e,t,r){var n=r.state.data,a=n.select(wr.Generators.ofType(ve.Molecule.Structure.Representation3DState).withTag("animate-assembly-unwind"));if(0!==a.length){for(var i=n.build(),o=0,s=a;o=1?(c=!0,u=1):u%=1,l=0,f=i;l=.99999?[2,{kind:"finished"}]:[2,{kind:"next",state:e}])})})}}),HQe=xp.create({name:"built-in.animate-model-index",display:{name:"Animate Trajectory"},isExportable:!0,params:function(){return{mode:D.MappedStatic("loop",{palindrome:D.Group({}),loop:D.Group({direction:D.Select("forward",[["forward","Forward"],["backward","Backward"]])}),once:D.Group({direction:D.Select("forward",[["forward","Forward"],["backward","Backward"]])},{isFlat:!0})},{options:[["palindrome","Palindrome"],["loop","Loop"],["once","Once"]]}),duration:D.MappedStatic("fixed",{fixed:D.Group({durationInS:D.Numeric(5,{min:1,max:120,step:.1},{description:"Duration in seconds"})},{isFlat:!0}),computed:D.Group({targetFps:D.Numeric(30,{min:5,max:250,step:1},{label:"Target FPS"})},{isFlat:!0}),sequential:D.Group({maxFps:D.Numeric(30,{min:5,max:60,step:1})},{isFlat:!0})})}},canApply:function(e){for(var t=e.state.data,n=0,a=t.select(wr.Generators.ofTransformer(et.Model.ModelFromTrajectory));n1)return{canApply:!0}}return{canApply:!1,reason:"No trajectory to animate"}},getDuration:function(e,t){var r;if("fixed"===(null===(r=e.duration)||void 0===r?void 0:r.name))return{kind:"fixed",durationMs:1e3*e.duration.params.durationInS};if("computed"===e.duration.name){for(var n=t.state.data,i=0,o=0,s=n.select(wr.Generators.ofTransformer(et.Model.ModelFromTrajectory));o0&&t.current-t.lastApplied<1e3/r.params.duration.params.maxFps)return[2,{kind:"skip"}];if(0===(a=(n=r.plugin.state.data).select(wr.Generators.ofTransformer(et.Model.ModelFromTrajectory))).length)return[2,{kind:"finished"}];for(i=n.build(),o=r.params,s=e.palindromeDirections||{},u=!1,c=!0,l=function(m){var v=wr.findAncestorOfType(n.tree,n.cells,m.transform.ref,ve.Molecule.Trajectory);if(!v||!v.obj)return"continue";var g=v.obj;if(g.data.frameCount<=1)return"continue";i.to(m).update(function(y){var b=g.data.frameCount;if(1===b)return y;if(c=!1,"sequential"===o.duration.name){var _=1;if("once"===o.mode.name){if(-1==(_="backward"===o.mode.params.direction?-1:1)&&0===y.modelIndex||1===_&&y.modelIndex===b-1)return u=!0,y}else"palindrome"===o.mode.name&&(_=0===y.modelIndex?1:y.modelIndex===b-1?-1:s[m.transform.ref]||1);return s[m.transform.ref]=_,(C=(y.modelIndex+_)%b)<0&&(C+=b),u=u||-1===_&&0===C||1===_&&C===b-1,{modelIndex:C}}var x="fixed"===o.duration.name?1e3*o.duration.params.durationInS:Math.ceil(1e3*g.data.frameCount/o.duration.params.targetFps);if("once"===o.mode.name&&t.current>=x)return u=!0,{modelIndex:g.data.frameCount-1};var C,A=t.current%x/x;return"loop"===o.mode.name&&"backward"===o.mode.params.direction&&(A=1-A),"palindrome"===o.mode.name&&(A*=2)>1&&(A=2-A),{modelIndex:C=Math.min(Math.floor(g.data.frameCount*A),g.data.frameCount-1)}})},f=0,d=a;f1}},setup:function(e,t,r){var n=r.managers.snapshot.state.entries.get(0);Die(r,n,!0)},getDuration:function(e,t){return{kind:"fixed",durationMs:t.managers.snapshot.state.entries.toArray().reduce(function(r,n){var a;return r+(null!==(a=n.snapshot.durationInMs)&&void 0!==a?a:0)},0)}},initialState:function(e,t){var r=t.managers.snapshot.state.entries.toArray();return{totalDuration:r.reduce(function(n,a){var i;return n+(null!==(i=a.snapshot.durationInMs)&&void 0!==i?i:0)},0),snapshots:r,currentIndex:0}},apply:function(e,t,r){var n;return ce(this,void 0,void 0,function(){var a,i,o,s;return le(this,function(c){if(t.current>=e.totalDuration)return[2,{kind:"finished"}];for(a=0,i=0,o=0,s=e.snapshots;o=e.snapshots.length?[2,{kind:"finished"}]:i===e.currentIndex?[2,{kind:"skip"}]:(Die(r.plugin,e.snapshots[i]),[2,{kind:"next",state:R(R({},e),{currentIndex:i})}])})})}});!function(e){var t=function(l){function f(){return null!==l&&l.apply(this,arguments)||this}return qt(f,l),f}(ve.Create({name:"Root",typeClass:"Root"}));e.Root=t;var r=function(l){function f(){return null!==l&&l.apply(this,arguments)||this}return qt(f,l),f}(ve.Create({name:"Category",typeClass:"Object"}));e.Category=r;var n=function(l){function f(){return null!==l&&l.apply(this,arguments)||this}return qt(f,l),f}(ve.CreateBehavior({name:"Behavior"}));e.Behavior=n,e.Categories={common:"Common",representation:"Representation",interaction:"Interaction","custom-props":"Custom Properties",misc:"Miscellaneous"},e.CreateCategory=Bt.BuiltIn({name:"create-behavior-category",display:{name:"Behavior Category"},from:t,to:r,params:{label:D.Text("",{isHidden:!0})}})({apply:function(l){return new r({},{label:l.params.label})}});var a=new Map;e.getCategoryId=function i(l){return a.get(l.id)},e.create=function o(l){var f=Bt.CreateBuiltIn({name:l.name,display:l.display,from:[t],to:[n],params:l.params,apply:function(d,p){var h=d.params,m=l.label?l.label(h):{label:l.display.name,description:l.display.description};return new n(new l.ctor(p,h),m)},update:function(d){var p=this,h=d.b,m=d.newParams;return Ve.create("Update Behavior",function(){return ce(p,void 0,void 0,function(){return le(this,function(g){switch(g.label){case 0:return h.data.update?[4,h.data.update(m)]:[2,rt.UpdateResult.Unchanged];case 1:return[2,g.sent()?rt.UpdateResult.Updated:rt.UpdateResult.Unchanged]}})})})},canAutoUpdate:l.canAutoUpdate});return a.set(f.id,l.category),f},e.simpleCommandHandler=function s(l,f){return function(){function d(p){this.ctx=p,this.sub=void 0}return d.prototype.register=function(){var p=this;this.sub=l.subscribe(this.ctx,function(h){return f(h,p.ctx)})},d.prototype.dispose=function(){this.sub&&this.sub.unsubscribe(),this.sub=void 0},d}()};var u=function(){function l(f,d){this.ctx=f,this.params=d,this.subs=[]}return l.prototype.subscribeCommand=function(f,d){this.subs.push(f.subscribe(this.ctx,d))},l.prototype.subscribeObservable=function(f,d){this.subs.push(f.subscribe(d))},l.prototype.track=function(f){this.subs.push(f)},l.prototype.dispose=function(){for(var f=0,d=this.subs;f=0&&(p.subs.splice(m,1),h.unsubscribe())}}},l.prototype.dispose=function(){for(var f=0,d=this.subs;f"u"&&(this.subs=[]);var a=t.subscribe(r);return this.subs.push(a),{unsubscribe:function(){a&&n.subs&&Pv(n.subs,a)&&(a.unsubscribe(),a=void 0)}}},Object.defineProperty(e.prototype,"ev",{get:function(){return this._ev||(this._ev=Tp.create())},enumerable:!1,configurable:!0}),e.prototype.dispose=function(){if(this._ev&&this._ev.dispose(),this.subs){for(var t=0,r=this.subs;t>2,s=new Uint8Array(i),u=new Uint32Array(s.buffer,0,o),c=0,l=0;l0?r.entries[0].snapshot.id:void 0,entries:n.asImmutable(),isPlaying:!1,nextSnapshotDelayInMs:r.playback?r.playback.nextSnapshotDelayInMs:t.DefaultNextSnapshotDelayInMs}),this.events.changed.next(void 0),s?(u=this.getEntry(s),(c=u&&u.snapshot)?[4,this.plugin.state.setSnapshot(c)]:[2]):[2];case 1:return l.sent(),r.playback&&r.playback.isPlaying&&this.play(!0),[2,c]}})})},t.prototype.syncCurrent=function(r){var n,a;return ce(this,void 0,void 0,function(){var i,o,s,u,c,l;return le(this,function(f){switch(f.label){case 0:return o=1===this.state.entries.size&&this.state.current&&this.state.current===this.defaultSnapshotId,(i=0===this.state.entries.size)||o?(s=this.plugin.state.getSnapshot(r?.params),(null!==(a=null===(n=r?.params)||void 0===n?void 0:n.image)&&void 0!==a?a:this.plugin.state.snapshotParams.value.image)?[4,t.getCanvasImageAsset(this.plugin,"".concat(s.id,"-image.png"))]:[3,2]):[2];case 1:return c=f.sent(),[3,3];case 2:c=void 0,f.label=3;case 3:return u=c,i?this.add(t.Entry(s,{name:r?.name,description:r?.description,image:u})):o&&(l=this.getEntry(this.state.current),l?.image&&this.plugin.managers.asset.delete(l.image),this.replace(this.state.current,s,{image:u})),this.defaultSnapshotId=s.id,[2]}})})},t.prototype.getStateSnapshot=function(r){return ce(this,void 0,void 0,function(){return le(this,function(n){switch(n.label){case 0:return[4,this.syncCurrent(r)];case 1:return n.sent(),[2,{timestamp:+new Date,version:"3.44.0",name:r&&r.name,description:r&&r.description,current:this.state.current,playback:{isPlaying:!(!r||!r.playOnLoad),nextSnapshotDelayInMs:this.state.nextSnapshotDelayInMs},entries:this.state.entries.valueSeq().toArray()}]}})})},t.prototype.serialize=function(r){return ce(this,void 0,void 0,function(){var n,a,i,o,s,u,c,l,f,d,p,h,m,v,g,y,b;return le(this,function(_){switch(_.label){case 0:return i=(a=JSON).stringify,[4,this.getStateSnapshot({params:r?.params})];case 1:return n=i.apply(a,[_.sent(),null,2]),r?.type&&"json"!==r.type&&"molj"!==r.type?[3,2]:[2,new Blob([n],{type:"application/json;charset=utf-8"})];case 2:zy(o=new Uint8Array(PT(n)),0,n),s={"state.json":o},u=[],c=0,l=this.plugin.managers.asset.assets,_.label=3;case 3:return c0&&(g=JSON.stringify(u,null,2),zy(y=new Uint8Array(PT(g)),0,g),s["assets.json"]=y),[4,this.plugin.runTask(YOe(s))];case 7:return b=_.sent(),[2,new Blob([b],{type:"application/zip"})]}})})},t.prototype.open=function(r){return ce(this,void 0,void 0,function(){var n,a,i,o,s,u,c,l,f,d,p,h,v,g,y;return le(this,function(b){switch(b.label){case 0:return b.trys.push([0,15,,16]),(n=r.name.toLowerCase()).endsWith("json")||n.endsWith("molj")?[4,this.plugin.runTask(bp(r,"string"))]:[3,8];case 1:return a=b.sent(),g=JSON.parse(a),t.isStateSnapshot(g)?[4,this.setStateSnapshot(g)]:[3,3];case 2:return b.sent(),[3,7];case 3:return t.isStateSnapshot(g.data)?[4,this.setStateSnapshot(g.data)]:[3,5];case 4:return b.sent(),[3,7];case 5:return[4,this.plugin.state.setSnapshot(g)];case 6:b.sent(),b.label=7;case 7:return[3,14];case 8:return[4,this.plugin.runTask(bp(r,"zip"))];case 9:return a=b.sent(),i=Object.create(null),Js(a,function(_,C){if("state.json"!==C&&"assets.json"!==C){var x=C.substring(C.indexOf("/")+1);i[x]=_}}),o=new File([a["state.json"]],"state.json"),[4,this.plugin.runTask(bp(o,"string"))];case 10:return s=b.sent(),a["assets.json"]?(u=new File([a["assets.json"]],"assets.json"),f=(l=JSON).parse,[4,this.plugin.runTask(bp(u,"string"))]):[3,12];case 11:for(c=f.apply(l,[b.sent()]),d=0,p=c;d"u"||typeof window>"u")return!1;if(["Version/15.1 Safari","Version/15.2 Safari","Version/15.3 Safari"].some(function(a){return navigator.userAgent.indexOf(a)>0}))return!0;var t=/iPad|iPhone|iPod/.test(navigator.userAgent),r=navigator.userAgent.includes("Macintosh"),n=navigator.maxTouchPoints>=4;return!window.MSStream&&(t||r&&n)}},$Qe=function(){function e(t,r){this.key=t,this.defaultValue=r}return e.prototype.toString=function(){return this.key},e.prototype.valueOf=function(){return this.key},e}();function Xn(e,t){return new $Qe(e,t)}var va={item:Xn,General:{IsBusyTimeoutMs:Xn("plugin-config.is-busy-timeout",750),DisableAntialiasing:Xn("plugin-config.disable-antialiasing",!1),DisablePreserveDrawingBuffer:Xn("plugin-config.disable-preserve-drawing-buffer",!1),PixelScale:Xn("plugin-config.pixel-scale",1),PickScale:Xn("plugin-config.pick-scale",.25),PickPadding:Xn("plugin-config.pick-padding",3),EnableWboit:Xn("plugin-config.enable-wboit",!0),EnableDpoit:Xn("plugin-config.enable-dpoit",!1),PreferWebGl1:Xn("plugin-config.prefer-webgl1",QQe.preferWebGl1),AllowMajorPerformanceCaveat:Xn("plugin-config.allow-major-performance-caveat",!1),PowerPreference:Xn("plugin-config.power-preference","high-performance")},State:{DefaultServer:Xn("plugin-state.server","https://webchem.ncbr.muni.cz/molstar-state"),CurrentServer:Xn("plugin-state.server","https://webchem.ncbr.muni.cz/molstar-state"),HistoryCapacity:Xn("history-capacity.server",5)},VolumeStreaming:{Enabled:Xn("volume-streaming.enabled",!0),DefaultServer:Xn("volume-streaming.server","https://ds.litemol.org"),CanStream:Xn("volume-streaming.can-stream",function(e,t){return 1===e.models.length&&or.probablyHasDensityMap(e.models[0])}),EmdbHeaderServer:Xn("volume-streaming.emdb-header-server","https://files.wwpdb.org/pub/emdb/structures")},Viewport:{ShowExpand:Xn("viewer.show-expand-button",!0),ShowControls:Xn("viewer.show-controls-button",!0),ShowSettings:Xn("viewer.show-settings-button",!0),ShowSelectionMode:Xn("viewer.show-selection-model-button",!0),ShowAnimation:Xn("viewer.show-animation-button",!0),ShowTrajectoryControls:Xn("viewer.show-trajectory-controls",!0)},Download:{DefaultPdbProvider:Xn("download.default-pdb-provider","pdbe"),DefaultEmdbProvider:Xn("download.default-emdb-provider","pdbe")},Structure:{SizeThresholds:Xn("structure.size-thresholds",Ye.DefaultSizeThresholds),DefaultRepresentationPreset:Xn("structure.default-representation-preset","auto"),DefaultRepresentationPresetParams:Xn("structure.default-representation-preset-params",{}),SaccharideCompIdMapType:Xn("structure.saccharide-comp-id-map-type","default")},Background:{Styles:Xn("background.styles",[])}},JQe=function(){function e(t){var r=this;this._config=new Map,t&&t.forEach(function(n){return r._config.set(n[0],n[1])})}return e.prototype.get=function(t){return this._config.has(t)?this._config.get(t):t.defaultValue},e.prototype.set=function(t,r){this._config.set(t,r)},e.prototype.delete=function(t){this._config.delete(t)},e}();function e$e(e){Pie(e),Mie(e),Rie(e),kie(e),Oie(e),Fie(e),Nie(e),Bie(e),Lie(e),Uie(e)}function Pie(e){e.state.events.object.created.subscribe(function(t){ve.isBehavior(t.obj)&&t.obj.data.register(t.ref)}),e.state.events.object.removed.subscribe(function(t){var r,n,a,i;ve.isBehavior(t.obj)&&(null===(n=(r=t.obj.data).unregister)||void 0===n||n.call(r),null===(i=(a=t.obj.data).dispose)||void 0===i||i.call(a))}),e.state.events.object.updated.subscribe(function(t){var r,n,a,i;"recreate"===t.action&&(t.oldObj&&ve.isBehavior(t.oldObj)&&(null===(n=(r=t.oldObj.data).unregister)||void 0===n||n.call(r),null===(i=(a=t.oldObj.data).dispose)||void 0===i||i.call(a)),t.obj&&ve.isBehavior(t.obj)&&t.obj.data.register(t.ref))})}function Mie(e){Sr.State.SetCurrentObject.subscribe(e,function(t){return t.state.setCurrent(t.ref)})}function Rie(e){Sr.State.Update.subscribe(e,function(t){return e.runTask(t.state.updateTree(t.tree,t.options))})}function kie(e){Sr.State.ApplyAction.subscribe(e,function(t){var n=t.action;return e.runTask(t.state.applyAction(n.action,n.params,t.ref))})}function Oie(e){function t(r,n){var a=r.build().delete(n);return e.runTask(r.updateTree(a))}Sr.State.RemoveObject.subscribe(e,function(r){var n=r.state,a=r.ref;if(!r.removeParentGhosts)return t(n,a);var o=n.tree,s=o.transforms.get(a);if(s.parent===a)return t(n,a);for(;;){var u=o.children.get(s.parent);if(s.parent===s.ref||u.size>1)return t(n,s.ref);var c=o.transforms.get(s.parent);if(!c.state.isGhost)return t(n,s.ref);s=c}})}function Fie(e){Sr.State.ToggleExpanded.subscribe(e,function(t){return t.state.updateCellState(t.ref,function(a){return{isCollapsed:!a.isCollapsed}})})}function Nie(e){Sr.State.ToggleVisibility.subscribe(e,function(t){var r=t.state,n=t.ref;return Bb(r,n,!r.cells.get(n).state.isHidden)})}function Bb(e,t,r){vi.doPreOrder(e.tree,e.transforms.get(t),{state:e,value:r},t$e)}function t$e(e,t,r){r.state.updateCellState(e.ref,{isHidden:r.value})}function Bie(e){Sr.Interactivity.Object.Highlight.subscribe(e,function(t){var r=t.state,n=t.ref;if(e.canvas3d&&!e.isBusy){e.managers.interactivity.lociHighlights.clearHighlights();for(var i=0,o="string"==typeof n?[n]:n;i0)return 1<=0)return 1<=4&&(U=!0),K.next({x:ya,y:Pa,dx:A[0],dy:A[1],pageX:Yt,pageY:Er,buttons:N,button:H,modifiers:M(),isStart:Sh}),Fe.copy(C,x),F=xg.Moving)}}function Ot(Ge){if(f(Ge.clientX,Ge.clientY)){aa(x,Ge);var Ze=So(Ge),yt=Ze.pageX,Yt=Ze.pageY,Er=x[0],ya=x[1];o&&Ge.preventDefault();var Pa=function o$e(e){var a=0,i=0,o=0,s=0,u=0;return"detail"in e&&(i=e.detail),"wheelDelta"in e&&(i=-e.wheelDelta/120),"wheelDeltaY"in e&&(i=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(a=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(a=i,i=0),o=10*a,s=10*i,"deltaY"in e&&(s=e.deltaY),"deltaX"in e&&(o=e.deltaX),"deltaZ"in e&&(u=e.deltaZ),(o||s||u)&&e.deltaMode&&(1===e.deltaMode?(o*=40,s*=40,u*=40):(o*=800,s*=800,u*=800)),o&&!a&&(a=o<1?-1:1),s&&!i&&(i=s<1?-1:1),{spinX:a,spinY:i,dx:o,dy:s,dz:u}}(Ge);N=H=Ka.Flag.Auxilary,(Pa.dx||Pa.dy||Pa.dz)&&X.next(R(R({x:Er,y:ya,pageX:yt,pageY:Yt},Pa),{buttons:N,button:H,modifiers:M()}))}}function oe(Ge){var Ze,yt;p&&(Ge.preventDefault(),null===(Ze=Ge.stopImmediatePropagation)||void 0===Ze||Ze.call(Ge),null===(yt=Ge.stopPropagation)||void 0===yt||yt.call(Ge))}var be=0,Se=0;function Qe(Ge){oe(Ge),be=Ge.scale,Se=Ge.rotation,Y.next({scale:Ge.scale,rotation:Ge.rotation,deltaRotation:0,deltaScale:0,isStart:!0})}function It(Ge,Ze){Y.next({scale:Ge.scale,rotation:Ge.rotation,deltaRotation:Se-Ge.rotation,deltaScale:be-Ge.scale,isEnd:Ze}),Se=Ge.rotation,be=Ge.scale}function Tt(Ge){oe(Ge),It(Ge)}function Zt(Ge){oe(Ge),It(Ge,!0)}function Pr(){te.next({})}function rr(Ge){if(n instanceof Window||n instanceof Document||n===document.body)return!0;var Ze=n.getBoundingClientRect();return Ge[0]>=0&&Ge[1]>=0&&Ge[0]0)&&(null!==(de=ue.values.uDoubleSided)&&void 0!==de&&de.ref.value?("opaque"!==(null===(he=ue.values.dTransparentBackfaces)||void 0===he?void 0:he.ref.value)&&M(ue,"colorBlended",2),M(ue,"colorBlended",1)):M(ue,"colorBlended",0))}xt&&r.timer.markEnd("Renderer.renderBlendedTransparent")};return{clear:function(z,te){i.enable(a.SCISSOR_TEST),i.enable(a.DEPTH_TEST),i.colorMask(!0,!0,!0,!0),i.depthMask(!0),d&&!te?i.clearColor(0,0,0,0):z?i.clearColor(f[0],f[1],f[2],1):i.clearColor(1,1,1,1),a.clear(a.COLOR_BUFFER_BIT|a.DEPTH_BUFFER_BIT)},clearDepth:function(z){void 0===z&&(z=!1),i.enable(a.SCISSOR_TEST),z?(i.colorMask(!0,!0,!0,!0),i.clearColor(1,1,1,1),a.clear(a.COLOR_BUFFER_BIT|a.DEPTH_BUFFER_BIT)):(i.enable(a.DEPTH_TEST),i.depthMask(!0),a.clear(a.DEPTH_BUFFER_BIT))},update:function(z,te){k.update(w.uView,z.view),k.update(w.uInvView,me.invert(v,z.view)),k.update(w.uProjection,z.projection),k.update(w.uInvProjection,me.invert(b,z.projection)),k.updateIfChanged(w.uIsOrtho,"orthographic"===z.state.mode?1:0),k.update(w.uViewOffset,z.viewOffset.enabled?Fe.set(A,16*z.viewOffset.offsetX,16*z.viewOffset.offsetY):Fe.set(A,0,0)),k.update(w.uCameraPosition,z.state.position),k.update(w.uCameraDir,S.normalize(x,S.sub(x,z.state.target,z.state.position))),k.updateIfChanged(w.uFar,z.far),k.updateIfChanged(w.uNear,z.near),k.updateIfChanged(w.uFogFar,z.fogFar),k.updateIfChanged(w.uFogNear,z.fogNear),k.updateIfChanged(w.uTransparentBackground,d),k.updateIfChanged(w.uMarkerAverage,te.markerAverage)},renderPick:function(z,te,ae,de,he){xt&&r.timer.mark("Renderer.renderPick"),i.disable(a.BLEND),i.enable(a.DEPTH_TEST),i.depthMask(!0),F(z,te,de,0,!1),k.updateIfChanged(w.uPickType,he);for(var pe=z.renderables,re=0,ee=pe.length;re0||ge)&&M(ue,"depth",0)}xt&&r.timer.markEnd("Renderer.renderDepthTransparent")},renderMarkingDepth:function(z,te,ae){xt&&r.timer.mark("Renderer.renderMarkingDepth"),i.disable(a.BLEND),i.enable(a.DEPTH_TEST),i.depthMask(!0),F(z,te,ae,0,!1),k.updateIfChanged(w.uMarkingType,qE.Depth);for(var de=z.renderables,he=0,pe=de.length;he0&&M(de[he],"marking",0);xt&&r.timer.markEnd("Renderer.renderMarkingMask")},renderBlended:function(z,te){z.hasOpaque&&K(z,te,null),z.opacityAverage<1&&ne(z,te,null)},renderBlendedOpaque:K,renderBlendedTransparent:ne,renderBlendedVolume:function(z,te,ae){xt&&r.timer.mark("Renderer.renderBlendedVolume"),i.blendFunc(a.ONE,a.ONE_MINUS_SRC_ALPHA),i.enable(a.BLEND),F(z,te,ae,2,!1);for(var de=z.renderables,he=0,pe=de.length;he0||"directVolume"===ge.values.dGeometryType.ref.value||"fuzzy"===(null===(pe=ge.values.dPointStyle)||void 0===pe?void 0:pe.ref.value)||"text"===ge.values.dGeometryType.ref.value||ze)&&M(ge,"colorWboit",0)}xt&&r.timer.markEnd("Renderer.renderWboitTransparent")},renderDpoitOpaque:function(z,te,ae){var de,he,pe,re;xt&&r.timer.mark("Renderer.renderDpoitOpaque"),i.disable(a.BLEND),i.enable(a.DEPTH_TEST),i.depthMask(!0),F(z,te,ae,1,!1);for(var ee=z.renderables,ue=0,ge=ee.length;ue0||"fuzzy"===(null===(re=Ce.values.dPointStyle)||void 0===re?void 0:re.ref.value)||"text"===Ce.values.dGeometryType.ref.value||je)&&M(Ce,"colorDpoit",0)}xt&&r.timer.markEnd("Renderer.renderDpoitTransparent")},renderDpoitVolume:function(z,te,ae){xt&&r.timer.mark("Renderer.renderDpoitVolume"),i.blendFunc(a.ONE,a.ONE_MINUS_SRC_ALPHA),i.enable(a.BLEND),F(z,te,ae,2,!1);for(var de=z.renderables,he=0,pe=de.length;he"+o(l)+""})},e.Trigger=u,e.TriggerKey=function c(l,f){return u.create(void 0,f,l)},(l=u=e.Trigger||(e.Trigger={})).create=function f(m,v,g){return{buttons:m,modifiers:v,code:g}},l.Empty={},l.match=function d(m,v,g){var y=m.buttons,b=m.modifiers;return void 0!==y&&(y===v||Ka.has(y,v))&&(!b||xc.areEqual(b,g))},l.matchKey=function p(m,v,g,y){var b=m.modifiers,_=m.code;return void 0!==_&&(_===v||1===_.length&&4===v.length&&v.startsWith("Key")&&!!y&&1===y.length&&y.toUpperCase()===_.toUpperCase())&&(!b||xc.areEqual(b,g))},l.format=function h(m){var v=[],g=function s$e(e,t){var r=[];return void 0!==e||t?0===e?r.push("mouse hover"):void 0!==e&&(Dm.has(e,Dm.Flag.Primary)&&r.push("left mouse button"),Dm.has(e,Dm.Flag.Secondary)&&r.push("right mouse button"),Dm.has(e,Dm.Flag.Auxilary)&&r.push("wheel/middle mouse button"),Dm.has(e,Dm.Flag.Forth)&&r.push("three fingers")):r.push("any mouse button"),r.join(" + ")}(m.buttons,m.code);g&&v.push(g);var y=function c$e(e){return e?.startsWith("Key")&&(e=e.substring(3)),e&&function ZPe(e){return Nv(SK(e))}(e).toLowerCase()}(m.code);y&&v.push(y);var b=function u$e(e,t){var r=[];return e?(e.alt&&r.push("alt key"),e.control&&r.push("control key"),e.meta&&r.push("meta/command key"),e.shift&&r.push("shift key"),t&&0===r.length&&r.push("no key")):t&&r.push("any key"),r.join(" + ")}(m.modifiers);return b&&v.push(b),v.join(" + ")}}(Et||(Et={}));var xL,WE,Dm=Ka,Em=Ka,wc=xc,Im=Et.Trigger,Gu=Et.TriggerKey,eoe={dragRotate:Et([Im(Em.Flag.Primary,wc.create())],"Rotate","Drag using ${triggers}"),dragRotateZ:Et([Im(Em.Flag.Primary,wc.create({shift:!0,control:!0}))],"Rotate around z-axis (roll)","Drag using ${triggers}"),dragPan:Et([Im(Em.Flag.Secondary,wc.create()),Im(Em.Flag.Primary,wc.create({control:!0}))],"Pan","Drag using ${triggers}"),dragZoom:Et.Empty,dragFocus:Et([Im(Em.Flag.Forth,wc.create())],"Focus","Drag using ${triggers}"),dragFocusZoom:Et([Im(Em.Flag.Auxilary,wc.create())],"Focus and zoom","Drag using ${triggers}"),scrollZoom:Et([Im(Em.Flag.Auxilary,wc.create())],"Zoom","Scroll using ${triggers}"),scrollFocus:Et([Im(Em.Flag.Auxilary,wc.create({shift:!0}))],"Clip","Scroll using ${triggers}"),scrollFocusZoom:Et.Empty,keyMoveForward:Et([Gu("KeyW")],"Move forward","Press ${triggers}"),keyMoveBack:Et([Gu("KeyS")],"Move back","Press ${triggers}"),keyMoveLeft:Et([Gu("KeyA")],"Move left","Press ${triggers}"),keyMoveRight:Et([Gu("KeyD")],"Move right","Press ${triggers}"),keyMoveUp:Et([Gu("KeyR")],"Move up","Press ${triggers}"),keyMoveDown:Et([Gu("KeyF")],"Move down","Press ${triggers}"),keyRollLeft:Et([Gu("KeyQ")],"Roll left","Press ${triggers}"),keyRollRight:Et([Gu("KeyE")],"Roll right","Press ${triggers}"),keyPitchUp:Et([Gu("ArrowUp",wc.create({shift:!0}))],"Pitch up","Press ${triggers}"),keyPitchDown:Et([Gu("ArrowDown",wc.create({shift:!0}))],"Pitch down","Press ${triggers}"),keyYawLeft:Et([Gu("ArrowLeft",wc.create({shift:!0}))],"Yaw left","Press ${triggers}"),keyYawRight:Et([Gu("ArrowRight",wc.create({shift:!0}))],"Yaw right","Press ${triggers}"),boostMove:Et([Gu("ShiftLeft")],"Boost move","Press ${triggers}"),enablePointerLock:Et([Gu("Space",wc.create({control:!0}))],"Enable pointer lock","Press ${triggers}")},toe={noScroll:D.Boolean(!0,{isHidden:!0}),rotateSpeed:D.Numeric(5,{min:1,max:10,step:1}),zoomSpeed:D.Numeric(7,{min:1,max:15,step:1}),panSpeed:D.Numeric(1,{min:.1,max:5,step:.1}),moveSpeed:D.Numeric(.75,{min:.1,max:3,step:.1}),boostMoveFactor:D.Numeric(5,{min:.1,max:10,step:.1}),flyMode:D.Boolean(!1),animate:D.MappedStatic("off",{off:D.EmptyGroup(),spin:D.Group({speed:D.Numeric(1,{min:-20,max:20,step:1})},{description:"Spin the 3D scene around the x-axis in view space"}),rock:D.Group({speed:D.Numeric(.3,{min:-5,max:5,step:.1}),angle:D.Numeric(10,{min:0,max:90,step:1},{description:"How many degrees to rotate in each direction."})},{description:"Rock the 3D scene around the x-axis in view space"})}),staticMoving:D.Boolean(!0,{isHidden:!0}),dynamicDampingFactor:D.Numeric(.2,{},{isHidden:!0}),minDistance:D.Numeric(.01,{},{isHidden:!0}),maxDistance:D.Numeric(1e150,{},{isHidden:!0}),gestureScaleFactor:D.Numeric(1,{},{isHidden:!0}),maxWheelDelta:D.Numeric(.02,{},{isHidden:!0}),bindings:D.Value(eoe,{isHidden:!0}),autoAdjustMinMaxDistance:D.MappedStatic("on",{off:D.EmptyGroup(),on:D.Group({minDistanceFactor:D.Numeric(0),minDistancePadding:D.Numeric(5),maxDistanceFactor:D.Numeric(10),maxDistanceMin:D.Numeric(20)})},{isHidden:!0})};!function(e){e.create=function t(r,n,a,i){void 0===i&&(i={});var o=R(R(R({},D.getDefaultValues(toe)),i),{bindings:R(R({},eoe),i.bindings)}),s=o.bindings,u=po.clone(n.viewport),c=!1,l=r.drag.subscribe(function Ct(Ze){var yt=Ze.x,Yt=Ze.y,Er=Ze.pageX,ya=Ze.pageY,Pa=Ze.buttons,us=Ze.modifiers,Pl=Ze.isStart,cs=_t(yt,Yt);if((!Pl||!cs)&&(Pl||_)){_=!0,Jm();var Sh=Et.match(s.dragRotate,Pa,us),ev=Et.match(s.dragRotateZ,Pa,us),tv=Et.match(s.dragPan,Pa,us),U1=Et.match(s.dragZoom,Pa,us),Co=Et.match(s.dragFocus,Pa,us),Bd=Et.match(s.dragFocusZoom,Pa,us);Z(Er,ya),function Y(Ze,yt){Fe.set(L,(Ze-u.x)/u.width,(yt-u.y)/u.height)}(Er,ya);var Hs=r.pixelRatio,$I=(yt*Hs-u.width/2-u.x)/u.width,JI=-(r.height-Yt*Hs-u.height/2-u.y)/u.height;if(Pl&&(Sh&&(Fe.copy(T,$),Fe.copy(A,T)),ev&&(Fe.set(M,$I,JI),Fe.copy(I,M)),(U1||Bd)&&(Fe.copy(N,L),Fe.copy(H,N)),Co&&(Fe.copy(G,L),Fe.copy(U,G)),tv&&(Fe.copy(Q,L),Fe.copy(W,Q))),Sh&&Fe.copy(T,$),ev&&Fe.set(M,$I,JI),(U1||Bd)&&Fe.copy(H,L),Co&&Fe.copy(U,L),Bd){var u0=S.distance(n.state.position,n.state.target);n.setState({radius:u0/5})}tv&&Fe.copy(W,L)}}),f=r.interactionEnd.subscribe(function bt(){_=!1}),d=r.wheel.subscribe(function kt(Ze){var Er=Ze.spinX,ya=Ze.spinY,Pa=Ze.dz,us=Ze.buttons,Pl=Ze.modifiers;if(!_t(Ze.x,Ze.y)){var cs=function mEe(){for(var e=[],t=0;tn&&(r=o,n=s)}return r}(.075*Er,.075*ya,1e-4*Pa);cs<-o.maxWheelDelta?cs=-o.maxWheelDelta:cs>o.maxWheelDelta&&(cs=o.maxWheelDelta),Et.match(s.scrollZoom,us,Pl)&&(H[1]+=cs),Et.match(s.scrollFocus,us,Pl)&&(U[1]+=cs)}}),p=r.pinch.subscribe(function Ot(Ze){var yt=Ze.fractionDelta;Et.match(s.scrollZoom,Ze.buttons,Ze.modifiers)&&(_=!0,H[1]+=o.gestureScaleFactor*yt)}),h=r.gesture.subscribe(function oe(Ze){_=!0,H[1]+=o.gestureScaleFactor*Ze.deltaScale}),m=r.keyDown.subscribe(function Se(Ze){var yt=Ze.modifiers,Yt=Ze.code,Er=Ze.key;_t(Ze.x,Ze.y)||(Et.matchKey(s.keyMoveForward,Yt,yt,Er)?Pe.moveForward=1:Et.matchKey(s.keyMoveBack,Yt,yt,Er)?Pe.moveBack=1:Et.matchKey(s.keyMoveLeft,Yt,yt,Er)?Pe.moveLeft=1:Et.matchKey(s.keyMoveRight,Yt,yt,Er)?Pe.moveRight=1:Et.matchKey(s.keyMoveUp,Yt,yt,Er)?Pe.moveUp=1:Et.matchKey(s.keyMoveDown,Yt,yt,Er)?Pe.moveDown=1:Et.matchKey(s.keyRollLeft,Yt,yt,Er)?Pe.rollLeft=1:Et.matchKey(s.keyRollRight,Yt,yt,Er)?Pe.rollRight=1:Et.matchKey(s.keyPitchUp,Yt,yt,Er)?Pe.pitchUp=1:Et.matchKey(s.keyPitchDown,Yt,yt,Er)?Pe.pitchDown=1:Et.matchKey(s.keyYawLeft,Yt,yt,Er)?Pe.yawLeft=1:Et.matchKey(s.keyYawRight,Yt,yt,Er)&&(Pe.yawRight=1),Et.matchKey(s.boostMove,Yt,yt,Er)&&(Pe.boostMove=1),Et.matchKey(s.enablePointerLock,Yt,yt,Er)&&r.requestPointerLock(u))}),v=r.keyUp.subscribe(function Qe(Ze){var yt,Yt,Er,ya,Pa,us,Pl,cs,Sh,ev,tv,U1,Co=Ze.modifiers,Bd=Ze.code,Hs=Ze.key;if(!_t(Ze.x,Ze.y)){var u0=!1;Bd.startsWith("Alt")?(u0=!0,Co.alt=!0):Bd.startsWith("Shift")?(u0=!0,Co.shift=!0):Bd.startsWith("Control")?(u0=!0,Co.control=!0):Bd.startsWith("Meta")&&(u0=!0,Co.meta=!0);var Ku=[];u0?(Pe.moveForward&&Ku.push((null===(yt=s.keyMoveForward.triggers[0])||void 0===yt?void 0:yt.code)||""),Pe.moveBack&&Ku.push((null===(Yt=s.keyMoveBack.triggers[0])||void 0===Yt?void 0:Yt.code)||""),Pe.moveLeft&&Ku.push((null===(Er=s.keyMoveLeft.triggers[0])||void 0===Er?void 0:Er.code)||""),Pe.moveRight&&Ku.push((null===(ya=s.keyMoveRight.triggers[0])||void 0===ya?void 0:ya.code)||""),Pe.moveUp&&Ku.push((null===(Pa=s.keyMoveUp.triggers[0])||void 0===Pa?void 0:Pa.code)||""),Pe.moveDown&&Ku.push((null===(us=s.keyMoveDown.triggers[0])||void 0===us?void 0:us.code)||""),Pe.rollLeft&&Ku.push((null===(Pl=s.keyRollLeft.triggers[0])||void 0===Pl?void 0:Pl.code)||""),Pe.rollRight&&Ku.push((null===(cs=s.keyRollRight.triggers[0])||void 0===cs?void 0:cs.code)||""),Pe.pitchUp&&Ku.push((null===(Sh=s.keyPitchUp.triggers[0])||void 0===Sh?void 0:Sh.code)||""),Pe.pitchDown&&Ku.push((null===(ev=s.keyPitchDown.triggers[0])||void 0===ev?void 0:ev.code)||""),Pe.yawLeft&&Ku.push((null===(tv=s.keyYawLeft.triggers[0])||void 0===tv?void 0:tv.code)||""),Pe.yawRight&&Ku.push((null===(U1=s.keyYawRight.triggers[0])||void 0===U1?void 0:U1.code)||"")):Ku.push(Bd);for(var rV=0,Tpe=Ku;rVZe*Ze&&(S.setMagnitude(x,x,Ze),S.add(n.position,n.target,x),Fe.copy(N,H),Fe.copy(G,U)),S.squaredMagnitude(x)u.x+u.width||r.height-yt>u.y+u.height||Ze0&&("spin"===o.animate.name?function So(Ze){if("spin"===o.animate.name&&0!==o.animate.params.speed&&!_){var yt=o.animate.params.speed/1e3;aa[0]=60*Math.min(Math.abs(Ze),125)/1e3*yt,Fe.add(T,A,aa)}}(yt):"rock"===o.animate.name&&function Nd(Ze){if("rock"===o.animate.name&&0!==o.animate.params.speed&&!_){var yt=Ze/1e3*o.animate.params.speed,Yt=Zr(o.animate.params.angle)/q(),Er=Math.sin($a*Math.PI*2)*Yt,ya=Math.sin(($a+yt)*Math.PI*2)*Yt;eo[0]=ya-Er,Fe.add(T,A,eo),($a+=yt)>=1&&($a=0)}}(yt)),S.sub(x,n.position,n.target),function re(){var Ze=T[0]-A[0],yt=T[1]-A[1];S.set(pe,Ze,yt,0);var Yt=S.magnitude(pe)*q();Yt?(S.sub(x,n.position,n.target),S.normalize(ae,x),S.normalize(de,n.up),S.normalize(he,S.cross(he,de,ae)),S.setMagnitude(de,de,yt),S.setMagnitude(he,he,Ze),S.add(pe,de,he),S.normalize(z,S.cross(z,pe,x)),yn.setAxisAngle(te,z,Yt),S.transformQuat(x,x,te),S.transformQuat(n.up,n.up,te),S.copy(w,z),E=Yt):!o.staticMoving&&E&&(E*=Math.sqrt(1-o.dynamicDampingFactor),S.sub(x,n.position,n.target),yn.setAxisAngle(te,w,E),S.transformQuat(x,x,te),S.transformQuat(n.up,n.up,te)),Fe.copy(A,T)}(),function ge(){var Ze=(Pe.rollRight-Pe.rollLeft)/45,yt=(M[0]-I[0])*-Math.sign(M[1]),Yt=(M[1]-I[1])*-Math.sign(M[0]),Er=-o.rotateSpeed*(-yt+Yt)+Ze;Er?(S.normalize(ue,x),yn.setAxisAngle(ee,ue,Er),S.transformQuat(n.up,n.up,ee),O=Er):!o.staticMoving&&O&&(O*=Math.sqrt(1-o.dynamicDampingFactor),S.normalize(ue,x),yn.setAxisAngle(ee,ue,O),S.transformQuat(n.up,n.up,ee)),Fe.copy(I,M)}(),function je(){var yt=(Pe.pitchUp-Pe.pitchDown)/(o.flyMode?360:90)*-o.rotateSpeed;yt?(S.cross(ze,x,n.up),S.normalize(ze,ze),yn.setAxisAngle(Ce,ze,yt),S.transformQuat(x,x,Ce),S.transformQuat(n.up,n.up,Ce),F=yt):!o.staticMoving&&F&&(F*=Math.sqrt(1-o.dynamicDampingFactor),S.cross(ze,x,n.up),S.normalize(ze,ze),yn.setAxisAngle(Ce,ze,F),S.transformQuat(x,x,Ce),S.transformQuat(n.up,n.up,Ce))}(),function ye(){var yt=(Pe.yawRight-Pe.yawLeft)/(o.flyMode?360:90)*-o.rotateSpeed;yt?(S.normalize(J,n.up),yn.setAxisAngle(V,J,yt),S.transformQuat(x,x,V),S.transformQuat(n.up,n.up,V),j=yt):!o.staticMoving&&j&&(j*=Math.sqrt(1-o.dynamicDampingFactor),S.normalize(J,n.up),yn.setAxisAngle(V,J,j),S.transformQuat(x,x,V),S.transformQuat(n.up,n.up,V))}(),function we(){var Ze=1+(H[1]-N[1])*o.zoomSpeed;1!==Ze&&Ze>0&&S.scale(x,x,Ze),o.staticMoving?Fe.copy(N,H):N[1]+=(H[1]-N[1])*o.dynamicDampingFactor}(),function Ee(){var Ze=(U[1]-G[1])*o.zoomSpeed;if(0!==Ze){var yt=Math.max(1,n.state.radius+n.state.radius*Ze);n.setState({radius:yt})}o.staticMoving?Fe.copy(G,U):G[1]+=(U[1]-G[1])*o.dynamicDampingFactor}(),function $e(){if(Fe.sub(Oe,Fe.copy(Oe,W),Q),Fe.squaredMagnitude(Oe)){var Ze=r.pixelRatio*o.panSpeed;Oe[0]*=1/n.zoom*n.viewport.width*Ze,Oe[1]*=1/n.zoom*n.viewport.height*Ze,S.cross(Ue,S.copy(Ue,x),n.up),S.setMagnitude(Ue,Ue,Oe[0]),S.setMagnitude(Ne,n.up,Oe[1]),S.add(Ue,Ue,Ne),S.add(n.position,n.position,Ue),S.add(n.target,n.target,Ue),o.staticMoving?Fe.copy(Q,W):(Fe.sub(Oe,W,Q),Fe.scale(Oe,Oe,o.dynamicDampingFactor),Fe.add(Q,Q,Oe))}}(),S.add(n.position,n.target,x),ut(),At>0&&function vt(Ze){S.sub(Je,n.position,n.target);var yt=Math.max(n.state.minNear,o.minDistance);S.setMagnitude(Je,Je,yt);var Yt=.06*Ze*o.moveSpeed*(1===Pe.boostMove?o.boostMoveFactor:1);if(1===Pe.moveForward&&(S.normalize(He,Je),S.scaleAndSub(n.position,n.position,He,Yt),(o.flyMode||r.pointerLock)&&S.sub(n.target,n.position,Je)),1===Pe.moveBack&&(S.normalize(He,Je),S.scaleAndAdd(n.position,n.position,He,Yt),(o.flyMode||r.pointerLock)&&S.sub(n.target,n.position,Je)),1===Pe.moveLeft&&(S.cross(He,Je,n.up),S.normalize(He,He),o.flyMode||r.pointerLock?(S.scaleAndAdd(n.position,n.position,He,Yt),S.sub(n.target,n.position,Je)):(S.scaleAndSub(n.position,n.position,He,Yt),S.sub(n.target,n.position,x))),1===Pe.moveRight&&(S.cross(He,Je,n.up),S.normalize(He,He),o.flyMode||r.pointerLock?(S.scaleAndSub(n.position,n.position,He,Yt),S.sub(n.target,n.position,Je)):(S.scaleAndAdd(n.position,n.position,He,Yt),S.sub(n.target,n.position,x))),1===Pe.moveUp&&(S.normalize(He,n.up),o.flyMode||r.pointerLock?(S.scaleAndAdd(n.position,n.position,He,Yt),S.sub(n.target,n.position,Je)):(S.scaleAndSub(n.position,n.position,He,Yt),S.sub(n.target,n.position,x))),1===Pe.moveDown&&(S.normalize(He,n.up),o.flyMode||r.pointerLock?(S.scaleAndSub(n.position,n.position,He,Yt),S.sub(n.target,n.position,Je)):(S.scaleAndAdd(n.position,n.position,He,Yt),S.sub(n.target,n.position,x))),o.flyMode||r.pointerLock){var Er=S.distance(n.position,a.boundingSphereVisible.center);n.setState({minFar:Er+a.boundingSphereVisible.radius})}}(Math.min(yt,250)),S.sub(x,n.position,n.target),ut(),S.squaredDistance(C,n.position)>gn&&S.copy(C,n.position),At=Ze}}function It(){S.sub(Je,n.position,n.target);var Ze=Math.max(n.state.minNear,o.minDistance);S.setMagnitude(Je,Je,Ze),S.sub(n.target,n.position,Je);var yt=S.distance(n.position,a.boundingSphereVisible.center);n.setState({minFar:yt+a.boundingSphereVisible.radius})}function Tt(){var Ze=a.boundingSphereVisible,yt=Ze.center,Yt=Ze.radius;if(S.distance(n.position,yt)>Yt){var ya=n.getFocus(yt,Yt);n.setState(R(R({},ya),{minFar:0}))}else n.setState({minFar:0,radius:a.boundingSphereVisible.radius})}var aa=Fe.create(.005,0),$a=0,eo=Fe.create(.005,0);function Jm(){$a=0}return{viewport:u,get isAnimating(){return"off"!==o.animate.name},get isMoving(){return 1===Pe.moveForward||1===Pe.moveBack||1===Pe.moveLeft||1===Pe.moveRight||1===Pe.moveUp||1===Pe.moveDown||1===Pe.rollLeft||1===Pe.rollRight||1===Pe.pitchUp||1===Pe.pitchDown||1===Pe.yawLeft||1===Pe.yawRight},get props(){return o},setProps:function(Ze){var yt;"rock"===(null===(yt=Ze.animate)||void 0===yt?void 0:yt.name)&&"rock"!==o.animate.name&&Jm(),void 0!==Ze.flyMode&&Ze.flyMode!==o.flyMode&&(Ze.flyMode?It():Tt()),Object.assign(o,Ze),Object.assign(s,Ze.bindings)},start:function Ge(Ze){At=-1,Le(Ze)},update:Le,reset:function st(){S.copy(n.target,K),S.copy(n.position,ne),S.copy(n.up,X),S.sub(x,n.position,n.target),S.copy(C,n.position)},dispose:function mn(){c||(c=!0,l.unsubscribe(),d.unsubscribe(),p.unsubscribe(),h.unsubscribe(),f.unsubscribe(),m.unsubscribe(),v.unsubscribe(),g.unsubscribe(),y.unsubscribe(),b.unsubscribe())}}}}(xL||(xL={})),function(e){e.create=function t(){return{view:me.identity(),position:S.create(0,0,0),direction:S.create(0,0,-1),up:S.create(0,1,0)}};var r=S.zero();e.update=function n(a){S.add(r,a.position,a.direction),me.lookAt(a.view,a.position,r,a.up)}}(WE||(WE={}));var Lb,l$e=function(){function e(){this.removeList=kO(),this.removeMap=new Map,this.addList=kO(),this.addMap=new Map}return Object.defineProperty(e.prototype,"isEmpty",{get:function(){return 0===this.removeList.count&&0===this.addList.count},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this.removeMap.size+this.addMap.size},enumerable:!1,configurable:!0}),e.prototype.add=function(t){if(this.removeMap.has(t)){var r=this.removeMap.get(t);this.removeMap.delete(t),this.removeList.remove(r)}if(!this.addMap.has(t)){var n=this.addList.addLast(t);this.addMap.set(t,n)}},e.prototype.remove=function(t){if(this.addMap.has(t)){var r=this.addMap.get(t);this.addMap.delete(t),this.addList.remove(r)}if(!this.removeMap.has(t)){var n=this.removeList.addLast(t);this.removeMap.set(t,n)}},e.prototype.tryGetRemove=function(){var t=this.removeList.removeFirst();return t&&this.removeMap.delete(t),t},e.prototype.tryGetAdd=function(){var t=this.addList.removeFirst();return t&&this.addMap.delete(t),t},e}(),IC=new lc("98");function roe(e,t,r){IC.reset();for(var n=0,a=e.length;nG)return!1;for(;;){var W;if(!(W=I.tryGetAdd()))break;if(A(W),++Q%100==0&&da()-U>G)return!1}return i.sort(f$e),d=!0,p=!0,h=!0,!0}(G)},get commitQueueSize(){return I.size},get needsCommit(){return!I.isEmpty},has:function(G){return a.has(G)},clear:function(){for(var G=0,U=i.length;G0?U/G:0}(),d=!1),m},get opacityAverage(){return p&&(v=function N(){var G,U;if(0===u.length)return 0;for(var Q=0,W=0,K=0,ne=u.length;K0?W/Q:0}(),p=!1),v},get hasOpaque(){return h&&(g=function H(){var G;if(0===u.length)return!1;for(var U=0,Q=u.length;U0)&&Za.copySnapshot(this._source,this.camera.state),this.inTransition||Za.copySnapshot(this._target,this.camera.state),Za.copySnapshot(this._target,t),this._target.radius>this._target.radiusMax&&(this._target.radius=this._target.radiusMax),this._target.radius<.01&&(this._target.radius=.01),this._target.radiusMax<.01&&(this._target.radiusMax=.01),!this.inTransition&&r<=0||typeof t.mode<"u"&&t.mode!==this.camera.state.mode?this.finish(this._target):(this.inTransition=!0,this.func=n||e.defaultTransition,(!this.inTransition||r>0)&&(this.start=this.t,this.durationMs=r))},e.prototype.tick=function(t){this.t=t,this.update()},e.prototype.finish=function(t){Za.copySnapshot(this.camera.state,t),this.inTransition=!1},e.prototype.update=function(){if(this.inTransition){var t=Math.min((this.t-this.start)/this.durationMs,1);if(1===t)return void this.finish(this._target);this.func(this._current,t,this._source,this._target),Za.copySnapshot(this.camera.state,this._current)}},e}();!function(e){var t=yn.identity();e.defaultTransition=function r(n,a,i,o){Za.copySnapshot(n,o),yn.slerp(t,yn.Identity,yn.rotationTo(t,i.up,o.up),a),S.transformQuat(n.up,i.up,t),S.lerp(n.target,i.target,o.target,a),S.lerp(n.position,i.position,o.position,a),n.radius=sa(i.radius,o.radius,a),n.radiusMax=sa(i.radiusMax,o.radiusMax,a),n.fov=sa(i.fov,o.fov,a),n.fog=sa(i.fog,o.fog,a)}}(wL||(wL={}));var noe=S(),aoe=S(),YE=pr(),Za=function(){function e(t,r,n){void 0===r&&(r=po.create(0,0,128,128)),void 0===n&&(n={}),this.view=me.identity(),this.projection=me.identity(),this.projectionView=me.identity(),this.inverseProjectionView=me.identity(),this.state=e.createDefaultSnapshot(),this.viewOffset=e.ViewOffset(),this.near=1,this.far=1e4,this.fogNear=5e3,this.fogFar=1e4,this.zoom=1,this.transition=new wL(this),this.stateChanged=new Ui(this.state),this.prevProjection=me.identity(),this.prevView=me.identity(),this.deltaDirection=S(),this.newPosition=S(),this.viewport=r,this.pixelScale=n.pixelScale||1,e.copySnapshot(this.state,t)}return Object.defineProperty(e.prototype,"pixelRatio",{get:function(){return(typeof window<"u"?window.devicePixelRatio:1)*this.pixelScale},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"position",{get:function(){return this.state.position},set:function(t){S.copy(this.state.position,t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"up",{get:function(){return this.state.up},set:function(t){S.copy(this.state.up,t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"target",{get:function(){return this.state.target},set:function(t){S.copy(this.state.target,t)},enumerable:!1,configurable:!0}),e.prototype.update=function(){var t=this.state;if(0===t.radiusMax)return!1;var r=2*Math.tan(t.fov/2)*S.distance(t.position,t.target);switch(this.zoom=this.viewport.height/r,function h$e(e){var t=e.state,r=t.radius,n=t.radiusMax,i=t.fog,s=t.minNear;r<.01&&(r=.01);var c=Math.max(t.clipFar?r:n,t.minFar),l=S.distance(e.position,e.target),f=l-r,d=l+c;(f=Math.max(Math.min(n,s),f))===(d=Math.max(s,d))&&(d=f+.01);var h=l-c*(-(50-i)/50),m=d;e.near=f,e.far=d,e.fogNear=h,e.fogFar=m}(this),this.state.mode){case"orthographic":!function d$e(e){var t=e.viewport,r=e.zoom,i=e.viewOffset,o=-t.width/2,s=t.width/2,u=t.height/2,c=-t.height/2,l=(s-o)/(2*r),f=(u-c)/(2*r),d=(s+o)/2,p=(u+c)/2,h=d-l,m=d+l,v=p+f,g=p-f;if(i.enabled){var y=r/(i.width/i.fullWidth),b=r/(i.height/i.fullHeight),_=(s-o)/i.width,C=(u-c)/i.height;m=(h+=_*(i.offsetX/y))+_*(i.width/y),g=(v-=C*(i.offsetY/b))-C*(i.height/b)}me.ortho(e.projection,h,m,v,g,e.near,e.far),me.lookAt(e.view,e.position,e.target,e.up)}(this);break;case"perspective":!function p$e(e){var t=e.viewport.width/e.viewport.height,r=e.near,n=e.far,a=e.viewOffset,i=r*Math.tan(.5*e.state.fov),o=2*i,s=t*o,u=-.5*s;a.enabled&&(u+=a.offsetX*s/a.fullWidth,i-=a.offsetY*o/a.fullHeight,s*=a.width/a.fullWidth,o*=a.height/a.fullHeight),me.perspective(e.projection,u,u+s,i,i-o,r,n),me.lookAt(e.view,e.position,e.target,e.up)}(this);break;default:xn()}var n=!me.areEqual(this.projection,this.prevProjection,gn)||!me.areEqual(this.view,this.prevView,gn);if(n){if(me.mul(this.projectionView,this.projection,this.view),!me.tryInvert(this.inverseProjectionView,this.projectionView))return me.copy(this.view,this.prevView),me.copy(this.projection,this.prevProjection),me.mul(this.projectionView,this.projection,this.view),!1;me.copy(this.prevView,this.view),me.copy(this.prevProjection,this.projection)}return n},e.prototype.setState=function(t,r){this.transition.apply(t,r),this.stateChanged.next(t)},e.prototype.getSnapshot=function(){return e.copySnapshot(e.createDefaultSnapshot(),this.state)},e.prototype.getTargetDistance=function(t){return e.targetDistance(t,this.state.mode,this.state.fov,this.viewport.width,this.viewport.height)},e.prototype.getFocus=function(t,r,n,a,i){var o,s,u=Math.max(r,.01),c=this.getTargetDistance(u);S.sub(this.deltaDirection,null!==(o=i?.target)&&void 0!==o?o:this.target,null!==(s=i?.position)&&void 0!==s?s:this.position),a&&S.matchDirection(this.deltaDirection,a,this.deltaDirection),S.setMagnitude(this.deltaDirection,this.deltaDirection,c),S.sub(this.newPosition,t,this.deltaDirection);var l=e.copySnapshot(e.createDefaultSnapshot(),this.state);return l.target=S.clone(t),l.radius=u,l.position=S.clone(this.newPosition),n&&S.matchDirection(l.up,n,l.up),l},e.prototype.getCenter=function(t,r){S.sub(this.deltaDirection,this.target,this.position),S.sub(this.newPosition,t,this.deltaDirection);var n=e.copySnapshot(e.createDefaultSnapshot(),this.state);return n.target=S.clone(t),n.position=S.clone(this.newPosition),r&&(n.radius=Math.max(r,.01)),n},e.prototype.getInvariantFocus=function(t,r,n,a){var i=Math.max(r,.01),o=this.getTargetDistance(i);S.copy(this.deltaDirection,a),S.setMagnitude(this.deltaDirection,this.deltaDirection,o),S.sub(this.newPosition,t,this.deltaDirection);var s=e.copySnapshot(e.createDefaultSnapshot(),this.state);return s.target=S.clone(t),s.radius=i,s.position=S.clone(this.newPosition),S.copy(s.up,n),s},e.prototype.focus=function(t,r,n,a,i){r>0&&this.setState(this.getFocus(t,r,a,i),n)},e.prototype.center=function(t,r){this.setState(this.getCenter(t),r)},e.prototype.project=function(t,r){return function a$e(e,t,r,n){var a=r.x,i=r.y,o=r.width,s=r.height;pr.set(yd,t[0],t[1],t[2],1),pr.transformMat4(yd,yd,n);var u=yd[3];return 0!==u&&(yd[0]/=u,yd[1]/=u,yd[2]/=u),e[0]=(yd[0]+1)*o*.5+a,e[1]=(yd[1]+1)*s*.5+i,e[2]=.5*(yd[2]+1),e[3]=0===u?0:1/u,e}(t,r,this.viewport,this.projectionView)},e.prototype.unproject=function(t,r){return jE(t,r,this.viewport,this.inverseProjectionView)},e.prototype.getPixelSize=function(t){return this.project(YE,t),this.unproject(noe,YE),YE[0]+=1,this.unproject(aoe,YE),S.distance(noe,aoe)},e}();!function(e){e.ViewOffset=function t(){return{enabled:!1,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}},e.setViewOffset=function r(u,c,l,f,d,p,h){u.fullWidth=c,u.fullHeight=l,u.offsetX=f,u.offsetY=d,u.width=p,u.height=h},e.copyViewOffset=function n(u,c){u.enabled=c.enabled,u.fullWidth=c.fullWidth,u.fullHeight=c.fullHeight,u.offsetX=c.offsetX,u.offsetY=c.offsetY,u.width=c.width,u.height=c.height},e.targetDistance=function a(u,c,l,f,d){var p=Math.max(u,.01),m=d1e3/this.props.maxFps&&(this.prevT=t,this.currentIdentifyT=t,this.identify(this.isInteracting?Ag.Drag:Ag.Move,t))},e.prototype.leave=function(){this.inside=!1,dr.Loci.isEmpty(this.prevLoci)||(this.prevLoci=dr.Loci.Empty,this.events.hover.next({current:this.prevLoci,buttons:this.buttons,button:this.button,modifiers:this.modifiers}))},e.prototype.move=function(t,r,n,a,i){this.inside=!0,this.buttons=n,this.button=a,this.modifiers=i,this.endX=t,this.endY=r},e.prototype.click=function(t,r,n,a,i){this.endX=t,this.endY=r,this.buttons=n,this.button=a,this.modifiers=i,this.identify(Ag.Click,0)},e.prototype.drag=function(t,r,n,a,i){this.endX=t,this.endY=r,this.buttons=n,this.button=a,this.modifiers=i,this.identify(Ag.Drag,0)},e.prototype.modify=function(t){xc.areEqual(t,this.modifiers)||(this.modifiers=t,this.events.hover.next({current:this.prevLoci,buttons:this.buttons,button:this.button,modifiers:this.modifiers,page:Fe.create(this.endX,this.endY),position:this.position}))},e.prototype.outsideViewport=function(t,r){var a=this.input,i=this.camera.viewport;return r*=a.pixelRatio,(t*=a.pixelRatio)>i.x+i.width||a.height-r>i.y+i.height||t 5 ? ((q) < 10 ? 2.0 : ((q) < 11 ? 4.0 : 8.0)) : 1.5))\n\nfloat rgb2luma(vec3 rgb){\n return sqrt(dot(rgb, vec3(0.299, 0.587, 0.114)));\n}\n\nfloat sampleLuma(vec2 uv) {\n return rgb2luma(texture2D(tColor, uv).rgb);\n}\n\nfloat sampleLuma(vec2 uv, float uOffset, float vOffset) {\n uv += uTexSizeInv * vec2(uOffset, vOffset);\n return sampleLuma(uv);\n}\n\nvoid main(void) {\n vec2 coords = gl_FragCoord.xy * uTexSizeInv;\n vec2 inverseScreenSize = uTexSizeInv;\n\n vec4 colorCenter = texture2D(tColor, coords);\n\n // Luma at the current fragment\n float lumaCenter = rgb2luma(colorCenter.rgb);\n\n // Luma at the four direct neighbours of the current fragment.\n float lumaDown = sampleLuma(coords, 0.0, -1.0);\n float lumaUp = sampleLuma(coords, 0.0, 1.0);\n float lumaLeft = sampleLuma(coords, -1.0, 0.0);\n float lumaRight = sampleLuma(coords, 1.0, 0.0);\n\n // Find the maximum and minimum luma around the current fragment.\n float lumaMin = min(lumaCenter, min(min(lumaDown, lumaUp), min(lumaLeft, lumaRight)));\n float lumaMax = max(lumaCenter, max(max(lumaDown, lumaUp), max(lumaLeft, lumaRight)));\n\n // Compute the delta.\n float lumaRange = lumaMax - lumaMin;\n\n // If the luma variation is lower that a threshold (or if we are in a really dark area),\n // we are not on an edge, don't perform any AA.\n if (lumaRange < max(dEdgeThresholdMin, lumaMax * dEdgeThresholdMax)) {\n gl_FragColor = colorCenter;\n return;\n }\n\n // Query the 4 remaining corners lumas.\n float lumaDownLeft = sampleLuma(coords, -1.0, -1.0);\n float lumaUpRight = sampleLuma(coords, 1.0, 1.0);\n float lumaUpLeft = sampleLuma(coords, -1.0, 1.0);\n float lumaDownRight = sampleLuma(coords, 1.0, -1.0);\n\n // Combine the four edges lumas (using intermediary variables for future computations\n // with the same values).\n float lumaDownUp = lumaDown + lumaUp;\n float lumaLeftRight = lumaLeft + lumaRight;\n\n // Same for corners\n float lumaLeftCorners = lumaDownLeft + lumaUpLeft;\n float lumaDownCorners = lumaDownLeft + lumaDownRight;\n float lumaRightCorners = lumaDownRight + lumaUpRight;\n float lumaUpCorners = lumaUpRight + lumaUpLeft;\n\n // Compute an estimation of the gradient along the horizontal and vertical axis.\n float edgeHorizontal = abs(-2.0 * lumaLeft + lumaLeftCorners) + abs(-2.0 * lumaCenter + lumaDownUp) * 2.0 + abs(-2.0 * lumaRight + lumaRightCorners);\n float edgeVertical = abs(-2.0 * lumaUp + lumaUpCorners) + abs(-2.0 * lumaCenter + lumaLeftRight) * 2.0 + abs(-2.0 * lumaDown + lumaDownCorners);\n\n // Is the local edge horizontal or vertical ?\n bool isHorizontal = (edgeHorizontal >= edgeVertical);\n\n // Choose the step size (one pixel) accordingly.\n float stepLength = isHorizontal ? inverseScreenSize.y : inverseScreenSize.x;\n\n // Select the two neighboring texels lumas in the opposite direction to the local edge.\n float luma1 = isHorizontal ? lumaDown : lumaLeft;\n float luma2 = isHorizontal ? lumaUp : lumaRight;\n // Compute gradients in this direction.\n float gradient1 = luma1 - lumaCenter;\n float gradient2 = luma2 - lumaCenter;\n\n // Which direction is the steepest ?\n bool is1Steepest = abs(gradient1) >= abs(gradient2);\n\n // Gradient in the corresponding direction, normalized.\n float gradientScaled = 0.25 * max(abs(gradient1), abs(gradient2));\n\n // Average luma in the correct direction.\n float lumaLocalAverage = 0.0;\n if(is1Steepest){\n // Switch the direction\n stepLength = -stepLength;\n lumaLocalAverage = 0.5 * (luma1 + lumaCenter);\n } else {\n lumaLocalAverage = 0.5 * (luma2 + lumaCenter);\n }\n\n // Shift UV in the correct direction by half a pixel.\n vec2 currentUv = coords;\n if(isHorizontal){\n currentUv.y += stepLength * 0.5;\n } else {\n currentUv.x += stepLength * 0.5;\n }\n\n // Compute offset (for each iteration step) in the right direction.\n vec2 offset = isHorizontal ? vec2(inverseScreenSize.x, 0.0) : vec2(0.0, inverseScreenSize.y);\n // Compute UVs to explore on each side of the edge, orthogonally.\n // The QUALITY allows us to step faster.\n vec2 uv1 = currentUv - offset * QUALITY(0);\n vec2 uv2 = currentUv + offset * QUALITY(0);\n\n // Read the lumas at both current extremities of the exploration segment,\n // and compute the delta wrt to the local average luma.\n float lumaEnd1 = sampleLuma(uv1);\n float lumaEnd2 = sampleLuma(uv2);\n lumaEnd1 -= lumaLocalAverage;\n lumaEnd2 -= lumaLocalAverage;\n\n // If the luma deltas at the current extremities is larger than the local gradient,\n // we have reached the side of the edge.\n bool reached1 = abs(lumaEnd1) >= gradientScaled;\n bool reached2 = abs(lumaEnd2) >= gradientScaled;\n bool reachedBoth = reached1 && reached2;\n\n // If the side is not reached, we continue to explore in this direction.\n if(!reached1){\n uv1 -= offset * QUALITY(1);\n }\n if(!reached2){\n uv2 += offset * QUALITY(1);\n }\n\n // If both sides have not been reached, continue to explore.\n if(!reachedBoth){\n for(int i = 2; i < dIterations; i++){\n // If needed, read luma in 1st direction, compute delta.\n if(!reached1){\n lumaEnd1 = sampleLuma(uv1);\n lumaEnd1 = lumaEnd1 - lumaLocalAverage;\n }\n // If needed, read luma in opposite direction, compute delta.\n if(!reached2){\n lumaEnd2 = sampleLuma(uv2);\n lumaEnd2 = lumaEnd2 - lumaLocalAverage;\n }\n // If the luma deltas at the current extremities is larger than the local gradient,\n // we have reached the side of the edge.\n reached1 = abs(lumaEnd1) >= gradientScaled;\n reached2 = abs(lumaEnd2) >= gradientScaled;\n reachedBoth = reached1 && reached2;\n\n // If the side is not reached, we continue to explore in this direction,\n // with a variable quality.\n if(!reached1){\n uv1 -= offset * QUALITY(i);\n }\n if(!reached2){\n uv2 += offset * QUALITY(i);\n }\n\n // If both sides have been reached, stop the exploration.\n if(reachedBoth){\n break;\n }\n }\n }\n\n // Compute the distances to each side edge of the edge (!).\n float distance1 = isHorizontal ? (coords.x - uv1.x) : (coords.y - uv1.y);\n float distance2 = isHorizontal ? (uv2.x - coords.x) : (uv2.y - coords.y);\n\n // In which direction is the side of the edge closer ?\n bool isDirection1 = distance1 < distance2;\n float distanceFinal = min(distance1, distance2);\n\n // Thickness of the edge.\n float edgeThickness = (distance1 + distance2);\n\n // Is the luma at center smaller than the local average ?\n bool isLumaCenterSmaller = lumaCenter < lumaLocalAverage;\n\n // If the luma at center is smaller than at its neighbour,\n // the delta luma at each end should be positive (same variation).\n bool correctVariation1 = (lumaEnd1 < 0.0) != isLumaCenterSmaller;\n bool correctVariation2 = (lumaEnd2 < 0.0) != isLumaCenterSmaller;\n\n // Only keep the result in the direction of the closer side of the edge.\n bool correctVariation = isDirection1 ? correctVariation1 : correctVariation2;\n\n // UV offset: read in the direction of the closest side of the edge.\n float pixelOffset = - distanceFinal / edgeThickness + 0.5;\n\n // If the luma variation is incorrect, do not offset.\n float finalOffset = correctVariation ? pixelOffset : 0.0;\n\n // Sub-pixel shifting\n // Full weighted average of the luma over the 3x3 neighborhood.\n float lumaAverage = (1.0 / 12.0) * (2.0 * (lumaDownUp + lumaLeftRight) + lumaLeftCorners + lumaRightCorners);\n // Ratio of the delta between the global average and the center luma,\n // over the luma range in the 3x3 neighborhood.\n float subPixelOffset1 = clamp(abs(lumaAverage - lumaCenter) / lumaRange, 0.0, 1.0);\n float subPixelOffset2 = (-2.0 * subPixelOffset1 + 3.0) * subPixelOffset1 * subPixelOffset1;\n // Compute a sub-pixel offset based on this delta.\n float subPixelOffsetFinal = subPixelOffset2 * subPixelOffset2 * float(dSubpixelQuality);\n\n // Pick the biggest of the two offsets.\n finalOffset = max(finalOffset, subPixelOffsetFinal);\n\n // Compute the final UV coordinates.\n vec2 finalUv = coords;\n if(isHorizontal){\n finalUv.y += finalOffset * stepLength;\n } else {\n finalUv.x += finalOffset * stepLength;\n }\n\n // Read the color at the new UV coordinates, and use it.\n gl_FragColor = texture2D(tColor, finalUv);\n}\n"),U$e={edgeThreshold:D.Numeric(.1,{min:.05,max:.15,step:.01}),maxSearchSteps:D.Numeric(16,{min:0,max:32,step:1})},V$e=function(){function e(t,r){if(this.webgl=t,this._supported=!1,typeof HTMLImageElement>"u")xr&&console.log('Missing "HTMLImageElement" required for "SMAA"');else{var n=r.getWidth(),a=r.getHeight();this.edgesTarget=t.createRenderTarget(n,a,!1,"uint8","linear"),this.weightsTarget=t.createRenderTarget(n,a,!1,"uint8","linear"),this.edgesRenderable=function H$e(e,t){var r=t.getWidth(),n=t.getHeight(),a=R(R({},Ii),{tColor:k.create(t),uTexSizeInv:k.create(Fe.create(1/r,1/n)),uViewport:k.create(pr()),dEdgeThreshold:k.create(.1)}),i=R({},z$e);return Xa(Ya(e,"triangles",G$e,i,a),a)}(t,r),this.weightsRenderable=function W$e(e,t){var r=t.getWidth(),n=t.getHeight(),a=e.resources.texture("image-uint8","rgb","ubyte","linear"),i=e.resources.texture("image-uint8","rgba","ubyte","nearest"),o=R(R({},Ii),{tEdges:k.create(t),tArea:k.create(a),tSearch:k.create(i),uTexSizeInv:k.create(Fe.create(1/r,1/n)),uViewport:k.create(pr()),dMaxSearchSteps:k.create(16)});Gee("data:image/png;base64,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",o.tArea,a),Gee("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEIAAAAhCAAAAABIXyLAAAAAOElEQVRIx2NgGAWjYBSMglEwEICREYRgFBZBqDCSLA2MGPUIVQETE9iNUAqLR5gIeoQKRgwXjwAAGn4AtaFeYLEAAAAASUVORK5CYII=",o.tSearch,i);var s=R({},j$e);return Xa(Ya(e,"triangles",q$e,s,o),o)}(t,this.edgesTarget.texture),this.blendRenderable=function K$e(e,t,r){var n=t.getWidth(),a=t.getHeight(),i=R(R({},Ii),{tColor:k.create(t),tWeights:k.create(r),uTexSizeInv:k.create(Fe.create(1/n,1/a)),uViewport:k.create(pr())}),o=R({},Y$e);return Xa(Ya(e,"triangles",X$e,o,i),i)}(t,r,this.weightsTarget.texture),this._supported=!0}}return Object.defineProperty(e.prototype,"supported",{get:function(){return this._supported},enumerable:!1,configurable:!0}),e.prototype.updateState=function(t){var r=this.webgl,n=r.gl,a=r.state;a.enable(n.SCISSOR_TEST),a.disable(n.BLEND),a.disable(n.DEPTH_TEST),a.depthMask(!1);var i=t.x,o=t.y,s=t.width,u=t.height;a.viewport(i,o,s,u),a.scissor(i,o,s,u),a.colorMask(!0,!0,!0,!0),a.clearColor(0,0,0,1),n.clear(n.COLOR_BUFFER_BIT),k.update(this.edgesRenderable.values.uViewport,po.toVec4(this.edgesRenderable.values.uViewport.ref.value,t)),k.update(this.weightsRenderable.values.uViewport,po.toVec4(this.weightsRenderable.values.uViewport.ref.value,t)),k.update(this.blendRenderable.values.uViewport,po.toVec4(this.blendRenderable.values.uViewport.ref.value,t))},e.prototype.setSize=function(t,r){var n=this.edgesTarget.getWidth(),a=this.edgesTarget.getHeight();(t!==n||r!==a)&&(this.edgesTarget.setSize(t,r),this.weightsTarget.setSize(t,r),k.update(this.edgesRenderable.values.uTexSizeInv,Fe.set(this.edgesRenderable.values.uTexSizeInv.ref.value,1/t,1/r)),k.update(this.weightsRenderable.values.uTexSizeInv,Fe.set(this.weightsRenderable.values.uTexSizeInv.ref.value,1/t,1/r)),k.update(this.blendRenderable.values.uTexSizeInv,Fe.set(this.blendRenderable.values.uTexSizeInv.ref.value,1/t,1/r)))},e.prototype.update=function(t,r){var n=!1;this.edgesRenderable.values.tColor.ref.value!==t&&(k.update(this.edgesRenderable.values.tColor,t),n=!0),this.edgesRenderable.values.dEdgeThreshold.ref.value!==r.edgeThreshold&&(k.update(this.edgesRenderable.values.dEdgeThreshold,r.edgeThreshold),n=!0),n&&this.edgesRenderable.update(),this.weightsRenderable.values.dMaxSearchSteps.ref.value!==r.maxSearchSteps&&(k.update(this.weightsRenderable.values.dMaxSearchSteps,r.maxSearchSteps),this.weightsRenderable.update()),this.blendRenderable.values.tColor.ref.value!==t&&(k.update(this.blendRenderable.values.tColor,t),this.blendRenderable.update())},e.prototype.render=function(t,r){xt&&this.webgl.timer.mark("SmaaPass.render"),this.edgesTarget.bind(),this.updateState(t),this.edgesRenderable.render(),this.weightsTarget.bind(),this.updateState(t),this.weightsRenderable.render(),r?r.bind():this.webgl.unbindFramebuffer(),this.updateState(t),this.blendRenderable.render(),xt&&this.webgl.timer.markEnd("SmaaPass.render")},e}(),z$e=R(R({},Ei),{tColor:Xt("texture","rgba","ubyte","linear"),uTexSizeInv:Te("v2"),uViewport:Te("v4"),dEdgeThreshold:Vt("number")}),G$e=Un("smaa-edges","\nprecision highp float;\n\nattribute vec2 aPosition;\nuniform vec2 uQuadScale;\n\nuniform vec2 uTexSizeInv;\nuniform vec4 uViewport;\n\nvarying vec2 vUv;\nvarying vec4 vOffset[3];\n\nvoid SMAAEdgeDetectionVS(vec2 texCoord) {\n vOffset[0] = texCoord.xyxy + uTexSizeInv.xyxy * vec4(-1.0, 0.0, 0.0, 1.0); // WebGL port note: Changed sign in W component\n vOffset[1] = texCoord.xyxy + uTexSizeInv.xyxy * vec4(1.0, 0.0, 0.0, -1.0); // WebGL port note: Changed sign in W component\n vOffset[2] = texCoord.xyxy + uTexSizeInv.xyxy * vec4(-2.0, 0.0, 0.0, 2.0); // WebGL port note: Changed sign in W component\n}\n\nvoid main() {\n vec2 scale = uViewport.zw * uTexSizeInv;\n vec2 shift = uViewport.xy * uTexSizeInv;\n vUv = (aPosition + 1.0) * 0.5 * scale + shift;\n SMAAEdgeDetectionVS(vUv);\n vec2 position = aPosition * uQuadScale - vec2(1.0, 1.0) + uQuadScale;\n gl_Position = vec4(position, 0.0, 1.0);\n}\n","\nprecision highp float;\nprecision highp int;\nprecision highp sampler2D;\n\nuniform sampler2D tColor;\nuniform vec2 uTexSizeInv;\n\nvarying vec2 vUv;\nvarying vec4 vOffset[3];\n\nvec4 SMAAColorEdgeDetectionPS(vec2 texcoord, vec4 offset[3], sampler2D colorTex) {\n vec2 threshold = vec2(dEdgeThreshold, dEdgeThreshold);\n\n // Calculate color deltas:\n vec4 delta;\n vec3 C = texture2D(colorTex, texcoord).rgb;\n\n vec3 Cleft = texture2D(colorTex, offset[0].xy).rgb;\n vec3 t = abs(C - Cleft);\n delta.x = max(max(t.r, t.g), t.b);\n\n vec3 Ctop = texture2D(colorTex, offset[0].zw).rgb;\n t = abs(C - Ctop);\n delta.y = max(max(t.r, t.g), t.b);\n\n // We do the usual threshold:\n vec2 edges = step(threshold, delta.xy);\n\n // Then discard if there is no edge:\n if (dot(edges, vec2(1.0, 1.0 )) == 0.0)\n discard;\n\n // Calculate right and bottom deltas:\n vec3 Cright = texture2D(colorTex, offset[1].xy).rgb;\n t = abs( C - Cright );\n delta.z = max(max(t.r, t.g), t.b);\n\n vec3 Cbottom = texture2D(colorTex, offset[1].zw).rgb;\n t = abs(C - Cbottom);\n delta.w = max(max(t.r, t.g), t.b);\n\n // Calculate the maximum delta in the direct neighborhood:\n float maxDelta = max(max(max(delta.x, delta.y), delta.z), delta.w );\n\n // Calculate left-left and top-top deltas:\n vec3 Cleftleft = texture2D(colorTex, offset[2].xy).rgb;\n t = abs( C - Cleftleft );\n delta.z = max(max(t.r, t.g), t.b);\n\n vec3 Ctoptop = texture2D(colorTex, offset[2].zw).rgb;\n t = abs(C - Ctoptop);\n delta.w = max(max(t.r, t.g), t.b);\n\n // Calculate the final maximum delta:\n maxDelta = max(max(maxDelta, delta.z), delta.w);\n\n // Local contrast adaptation in action:\n edges.xy *= step(0.5 * maxDelta, delta.xy);\n\n return vec4(edges, 0.0, 0.0);\n}\n\nvoid main() {\n gl_FragColor = SMAAColorEdgeDetectionPS(vUv, vOffset, tColor);\n}\n"),j$e=R(R({},Ei),{tEdges:Xt("texture","rgba","ubyte","linear"),tArea:Xt("texture","rgb","ubyte","linear"),tSearch:Xt("texture","rgba","ubyte","nearest"),uTexSizeInv:Te("v2"),uViewport:Te("v4"),dMaxSearchSteps:Vt("number")}),q$e=Un("smaa-weights","\nprecision highp float;\n\nattribute vec2 aPosition;\nuniform vec2 uQuadScale;\n\nuniform vec2 uTexSizeInv;\nuniform vec4 uViewport;\n\nvarying vec2 vUv;\nvarying vec4 vOffset[3];\nvarying vec2 vPixCoord;\n\nvoid SMAABlendingWeightCalculationVS(vec2 texCoord) {\n vPixCoord = texCoord / uTexSizeInv;\n\n // We will use these offsets for the searches later on (see @PSEUDO_GATHER4):\n vOffset[0] = texCoord.xyxy + uTexSizeInv.xyxy * vec4(-0.25, 0.125, 1.25, 0.125); // WebGL port note: Changed sign in Y and W components\n vOffset[1] = texCoord.xyxy + uTexSizeInv.xyxy * vec4(-0.125, 0.25, -0.125, -1.25); // WebGL port note: Changed sign in Y and W components\n\n // And these for the searches, they indicate the ends of the loops:\n vOffset[2] = vec4(vOffset[0].xz, vOffset[1].yw) + vec4(-2.0, 2.0, -2.0, 2.0) * uTexSizeInv.xxyy * float(dMaxSearchSteps);\n}\n\nvoid main() {\n vec2 scale = uViewport.zw * uTexSizeInv;\n vec2 shift = uViewport.xy * uTexSizeInv;\n vUv = (aPosition + 1.0) * 0.5 * scale + shift;\n SMAABlendingWeightCalculationVS(vUv);\n vec2 position = aPosition * uQuadScale - vec2(1.0, 1.0) + uQuadScale;\n gl_Position = vec4(position, 0.0, 1.0);\n}\n","\nprecision highp float;\nprecision highp int;\nprecision highp sampler2D;\n\n#define SMAASampleLevelZeroOffset(tex, coord, offset) texture2D(tex, coord + float(offset) * uTexSizeInv, 0.0)\n\n#define SMAA_AREATEX_MAX_DISTANCE 16\n#define SMAA_AREATEX_PIXEL_SIZE (1.0 / vec2(160.0, 560.0))\n#define SMAA_AREATEX_SUBTEX_SIZE (1.0 / 7.0)\n\nuniform sampler2D tEdges;\nuniform sampler2D tArea;\nuniform sampler2D tSearch;\nuniform vec2 uTexSizeInv;\n\nvarying vec2 vUv;\nvarying vec4 vOffset[3];\nvarying vec2 vPixCoord;\n\n#if __VERSION__ == 100\n vec2 round(vec2 x) {\n return sign(x) * floor(abs(x) + 0.5);\n }\n#endif\n\nfloat SMAASearchLength(sampler2D searchTex, vec2 e, float bias, float scale) {\n // Not required if searchTex accesses are set to point:\n // float2 SEARCH_TEX_PIXEL_SIZE = 1.0 / float2(66.0, 33.0);\n // e = float2(bias, 0.0) + 0.5 * SEARCH_TEX_PIXEL_SIZE +\n // e * float2(scale, 1.0) * float2(64.0, 32.0) * SEARCH_TEX_PIXEL_SIZE;\n e.r = bias + e.r * scale;\n return 255.0 * texture2D(searchTex, e, 0.0).r;\n}\n\nfloat SMAASearchXLeft(sampler2D edgesTex, sampler2D searchTex, vec2 texCoord, float end) {\n /**\n * @PSEUDO_GATHER4\n * This texCoord has been offset by (-0.25, -0.125) in the vertex shader to\n * sample between edge, thus fetching four edges in a row.\n * Sampling with different offsets in each direction allows to disambiguate\n * which edges are active from the four fetched ones.\n */\n vec2 e = vec2(0.0, 1.0);\n\n for (int i = 0; i < dMaxSearchSteps; i++) { // WebGL port note: Changed while to for\n e = texture2D( edgesTex, texCoord, 0.0).rg;\n texCoord -= vec2(2.0, 0.0) * uTexSizeInv;\n if (!(texCoord.x > end && e.g > 0.8281 && e.r == 0.0)) break;\n }\n\n // We correct the previous (-0.25, -0.125) offset we applied:\n texCoord.x += 0.25 * uTexSizeInv.x;\n\n // The searches are bias by 1, so adjust the coords accordingly:\n texCoord.x += uTexSizeInv.x;\n\n // Disambiguate the length added by the last step:\n texCoord.x += 2.0 * uTexSizeInv.x; // Undo last step\n texCoord.x -= uTexSizeInv.x * SMAASearchLength(searchTex, e, 0.0, 0.5);\n\n return texCoord.x;\n}\n\nfloat SMAASearchXRight(sampler2D edgesTex, sampler2D searchTex, vec2 texCoord, float end) {\n vec2 e = vec2( 0.0, 1.0 );\n\n for (int i = 0; i < dMaxSearchSteps; i++) { // WebGL port note: Changed while to for\n e = texture2D(edgesTex, texCoord, 0.0).rg;\n texCoord += vec2(2.0, 0.0) * uTexSizeInv;\n if (!(texCoord.x < end && e.g > 0.8281 && e.r == 0.0)) break;\n }\n\n texCoord.x -= 0.25 * uTexSizeInv.x;\n texCoord.x -= uTexSizeInv.x;\n texCoord.x -= 2.0 * uTexSizeInv.x;\n texCoord.x += uTexSizeInv.x * SMAASearchLength( searchTex, e, 0.5, 0.5 );\n\n return texCoord.x;\n}\n\nfloat SMAASearchYUp(sampler2D edgesTex, sampler2D searchTex, vec2 texCoord, float end) {\n vec2 e = vec2( 1.0, 0.0 );\n\n for (int i = 0; i < dMaxSearchSteps; i++) { // WebGL port note: Changed while to for\n e = texture2D(edgesTex, texCoord, 0.0).rg;\n texCoord += vec2(0.0, 2.0) * uTexSizeInv; // WebGL port note: Changed sign\n if (!(texCoord.y > end && e.r > 0.8281 && e.g == 0.0)) break;\n }\n\n texCoord.y -= 0.25 * uTexSizeInv.y; // WebGL port note: Changed sign\n texCoord.y -= uTexSizeInv.y; // WebGL port note: Changed sign\n texCoord.y -= 2.0 * uTexSizeInv.y; // WebGL port note: Changed sign\n texCoord.y += uTexSizeInv.y * SMAASearchLength(searchTex, e.gr, 0.0, 0.5); // WebGL port note: Changed sign\n\n return texCoord.y;\n}\n\nfloat SMAASearchYDown(sampler2D edgesTex, sampler2D searchTex, vec2 texCoord, float end) {\n vec2 e = vec2( 1.0, 0.0 );\n\n for (int i = 0; i < dMaxSearchSteps; i++) { // WebGL port note: Changed while to for\n e = texture2D(edgesTex, texCoord, 0.0).rg;\n texCoord -= vec2( 0.0, 2.0 ) * uTexSizeInv; // WebGL port note: Changed sign\n if (!(texCoord.y < end && e.r > 0.8281 && e.g == 0.0)) break;\n }\n\n texCoord.y += 0.25 * uTexSizeInv.y; // WebGL port note: Changed sign\n texCoord.y += uTexSizeInv.y; // WebGL port note: Changed sign\n texCoord.y += 2.0 * uTexSizeInv.y; // WebGL port note: Changed sign\n texCoord.y -= uTexSizeInv.y * SMAASearchLength(searchTex, e.gr, 0.5, 0.5); // WebGL port note: Changed sign\n\n return texCoord.y;\n}\n\nvec2 SMAAArea(sampler2D areaTex, vec2 dist, float e1, float e2, float offset) {\n // Rounding prevents precision errors of bilinear filtering:\n vec2 texCoord = float(SMAA_AREATEX_MAX_DISTANCE) * round(4.0 * vec2(e1, e2)) + dist;\n\n // We do a scale and bias for mapping to texel space:\n texCoord = SMAA_AREATEX_PIXEL_SIZE * texCoord + (0.5 * SMAA_AREATEX_PIXEL_SIZE);\n\n // Move to proper place, according to the subpixel offset:\n texCoord.y += SMAA_AREATEX_SUBTEX_SIZE * offset;\n\n return texture2D(areaTex, texCoord, 0.0).rg;\n}\n\nvec4 SMAABlendingWeightCalculationPS(vec2 texCoord, vec2 pixCoord, vec4 offset[3], sampler2D edgesTex, sampler2D areaTex, sampler2D searchTex, ivec4 subsampleIndices) {\n vec4 weights = vec4(0.0, 0.0, 0.0, 0.0);\n\n vec2 e = texture2D(edgesTex, texCoord).rg;\n\n if (e.g > 0.0) { // Edge at north\n vec2 d;\n\n // Find the distance to the left:\n vec2 coords;\n coords.x = SMAASearchXLeft(edgesTex, searchTex, offset[0].xy, offset[2].x );\n coords.y = offset[1].y; // offset[1].y = texCoord.y - 0.25 * uTexSizeInv.y (@CROSSING_OFFSET)\n d.x = coords.x;\n\n // Now fetch the left crossing edges, two at a time using bilinear\n // filtering. Sampling at -0.25 (see @CROSSING_OFFSET) enables to\n // discern what value each edge has:\n float e1 = texture2D(edgesTex, coords, 0.0).r;\n\n // Find the distance to the right:\n coords.x = SMAASearchXRight(edgesTex, searchTex, offset[0].zw, offset[2].y);\n d.y = coords.x;\n\n // We want the distances to be in pixel units (doing this here allow to\n // better interleave arithmetic and memory accesses):\n d = d / uTexSizeInv.x - pixCoord.x;\n\n // SMAAArea below needs a sqrt, as the areas texture is compressed\n // quadratically:\n vec2 sqrt_d = sqrt(abs(d));\n\n // Fetch the right crossing edges:\n coords.y -= 1.0 * uTexSizeInv.y; // WebGL port note: Added\n float e2 = SMAASampleLevelZeroOffset(edgesTex, coords, ivec2(1, 0)).r;\n\n // Ok, we know how this pattern looks like, now it is time for getting\n // the actual area:\n weights.rg = SMAAArea(areaTex, sqrt_d, e1, e2, float(subsampleIndices.y));\n }\n\n if (e.r > 0.0) { // Edge at west\n vec2 d;\n\n // Find the distance to the top:\n vec2 coords;\n\n coords.y = SMAASearchYUp(edgesTex, searchTex, offset[1].xy, offset[2].z );\n coords.x = offset[0].x; // offset[1].x = texCoord.x - 0.25 * uTexSizeInv.x;\n d.x = coords.y;\n\n // Fetch the top crossing edges:\n float e1 = texture2D(edgesTex, coords, 0.0).g;\n\n // Find the distance to the bottom:\n coords.y = SMAASearchYDown(edgesTex, searchTex, offset[1].zw, offset[2].w);\n d.y = coords.y;\n\n // We want the distances to be in pixel units:\n d = d / uTexSizeInv.y - pixCoord.y;\n\n // SMAAArea below needs a sqrt, as the areas texture is compressed\n // quadratically:\n vec2 sqrt_d = sqrt(abs(d));\n\n // Fetch the bottom crossing edges:\n coords.y -= 1.0 * uTexSizeInv.y; // WebGL port note: Added\n float e2 = SMAASampleLevelZeroOffset(edgesTex, coords, ivec2(0, 1)).g;\n\n // Get the area for this direction:\n weights.ba = SMAAArea(areaTex, sqrt_d, e1, e2, float(subsampleIndices.x));\n }\n\n return weights;\n}\n\nvoid main() {\n gl_FragColor = SMAABlendingWeightCalculationPS(vUv, vPixCoord, vOffset, tEdges, tArea, tSearch, ivec4(0.0));\n}\n"),Y$e=R(R({},Ei),{tColor:Xt("texture","rgba","ubyte","linear"),tWeights:Xt("texture","rgba","ubyte","linear"),uTexSizeInv:Te("v2"),uViewport:Te("v4")}),X$e=Un("smaa-blend","\nprecision highp float;\n\nattribute vec2 aPosition;\nuniform vec2 uQuadScale;\n\nuniform vec2 uTexSizeInv;\nuniform vec4 uViewport;\n\nvarying vec2 vUv;\nvarying vec4 vOffset[2];\n\nvoid SMAANeighborhoodBlendingVS(vec2 texCoord) {\n vOffset[0] = texCoord.xyxy + uTexSizeInv.xyxy * vec4(-1.0, 0.0, 0.0, 1.0); // WebGL port note: Changed sign in W component\n vOffset[1] = texCoord.xyxy + uTexSizeInv.xyxy * vec4(1.0, 0.0, 0.0, -1.0); // WebGL port note: Changed sign in W component\n}\n\nvoid main() {\n vec2 scale = uViewport.zw * uTexSizeInv;\n vec2 shift = uViewport.xy * uTexSizeInv;\n vUv = (aPosition + 1.0) * 0.5 * scale + shift;\n SMAANeighborhoodBlendingVS(vUv);\n vec2 position = aPosition * uQuadScale - vec2(1.0, 1.0) + uQuadScale;\n gl_Position = vec4(position, 0.0, 1.0);\n}\n","\nprecision highp float;\nprecision highp int;\nprecision highp sampler2D;\n\nuniform sampler2D tWeights;\nuniform sampler2D tColor;\nuniform vec2 uTexSizeInv;\n\nvarying vec2 vUv;\nvarying vec4 vOffset[2];\n\nvec4 SMAANeighborhoodBlendingPS(vec2 texCoord, vec4 offset[2], sampler2D colorTex, sampler2D blendTex) {\n // Fetch the blending weights for current pixel:\n vec4 a;\n a.xz = texture2D(blendTex, texCoord).xz;\n a.y = texture2D(blendTex, offset[1].zw).g;\n a.w = texture2D(blendTex, offset[1].xy).a;\n\n // Is there any blending weight with a value greater than 0.0?\n if (dot(a, vec4(1.0, 1.0, 1.0, 1.0)) < 1e-5) {\n return texture2D(colorTex, texCoord, 0.0);\n } else {\n // Up to 4 lines can be crossing a pixel (one through each edge). We\n // favor blending by choosing the line with the maximum weight for each\n // direction:\n vec2 offset;\n offset.x = a.a > a.b ? a.a : -a.b; // left vs. right\n offset.y = a.g > a.r ? -a.g : a.r; // top vs. bottom // WebGL port note: Changed signs\n\n // Then we go in the direction that has the maximum weight:\n if (abs(offset.x) > abs(offset.y)) { // horizontal vs. vertical\n offset.y = 0.0;\n } else {\n offset.x = 0.0;\n }\n\n // Fetch the opposite color and lerp by hand:\n vec4 C = texture2D(colorTex, texCoord, 0.0);\n texCoord += sign(offset) * uTexSizeInv;\n vec4 Cop = texture2D(colorTex, texCoord, 0.0);\n float s = abs(offset.x) > abs(offset.y) ? abs(offset.x) : abs(offset.y);\n\n // WebGL port note: Added gamma correction\n C.xyz = pow(C.xyz, vec3(2.2));\n Cop.xyz = pow(Cop.xyz, vec3(2.2));\n vec4 mixed = mix(C, Cop, s);\n mixed.xyz = pow(mixed.xyz, vec3(1.0 / 2.2));\n\n return mixed;\n }\n}\n\nvoid main() {\n gl_FragColor = SMAANeighborhoodBlendingPS(vUv, vOffset, tColor, tWeights);\n}\n"),soe={opacity:D.Numeric(1,{min:0,max:1,step:.01}),saturation:D.Numeric(0,{min:-1,max:1,step:.01}),lightness:D.Numeric(0,{min:-1,max:1,step:.01})},eJe=R({faces:D.MappedStatic("urls",{urls:D.Group({nx:D.Text("",{label:"Negative X / Left"}),ny:D.Text("",{label:"Negative Y / Bottom"}),nz:D.Text("",{label:"Negative Z / Back"}),px:D.Text("",{label:"Positive X / Right"}),py:D.Text("",{label:"Positive Y / Top"}),pz:D.Text("",{label:"Positive Z / Front"})},{isExpanded:!0,label:"URLs"}),files:D.Group({nx:D.File({label:"Negative X / Left",accept:"image/*"}),ny:D.File({label:"Negative Y / Bottom",accept:"image/*"}),nz:D.File({label:"Negative Z / Back",accept:"image/*"}),px:D.File({label:"Positive X / Right",accept:"image/*"}),py:D.File({label:"Positive Y / Top",accept:"image/*"}),pz:D.File({label:"Positive Z / Front",accept:"image/*"})},{isExpanded:!0,label:"Files"})}),blur:D.Numeric(0,{min:0,max:1,step:.01},{description:'Note, this only works in WebGL2 or when "EXT_shader_texture_lod" is available.'})},soe),tJe=R(R({source:D.MappedStatic("url",{url:D.Text(""),file:D.File({accept:"image/*"})}),blur:D.Numeric(0,{min:0,max:1,step:.01},{description:'Note, this only works in WebGL2 or with power-of-two images and when "EXT_shader_texture_lod" is available.'})},soe),{coverage:D.Select("viewport",D.arrayToOptions(["viewport","canvas"]))}),rJe={topColor:D.Color(ft(14540253)),bottomColor:D.Color(ft(15658734)),ratio:D.Numeric(.5,{min:0,max:1,step:.01}),coverage:D.Select("viewport",D.arrayToOptions(["viewport","canvas"]))},nJe={centerColor:D.Color(ft(14540253)),edgeColor:D.Color(ft(15658734)),ratio:D.Numeric(.5,{min:0,max:1,step:.01}),coverage:D.Select("viewport",D.arrayToOptions(["viewport","canvas"]))},aJe={variant:D.MappedStatic("off",{off:D.EmptyGroup(),skybox:D.Group(eJe,{isExpanded:!0}),image:D.Group(tJe,{isExpanded:!0}),horizontalGradient:D.Group(rJe,{isExpanded:!0}),radialGradient:D.Group(nJe,{isExpanded:!0})},{label:"Environment"})},iJe=function(){function e(t,r,n,a){this.webgl=t,this.assetManager=r,this.camera=new Za,this.target=S(),this.position=S(),this.dir=S(),this.renderable=function hJe(e,t,r){var n={drawCount:k.create(6),instanceCount:k.create(1),aPosition:k.create(VB),tSkybox:k.create(Go()),tImage:k.create(Go()),uImageScale:k.create(Fe()),uImageOffset:k.create(Fe()),uTexSize:k.create(Fe.create(t,r)),uViewport:k.create(pr()),uViewportAdjusted:k.create(!0),uViewDirectionProjectionInverse:k.create(me()),uGradientColorA:k.create(S()),uGradientColorB:k.create(S()),uGradientRatio:k.create(.5),uBlur:k.create(0),uOpacity:k.create(1),uSaturation:k.create(0),uLightness:k.create(0),dVariant:k.create("skybox")},a=R({},dJe);return Xa(Ya(e,"triangles",pJe,a,n),n)}(t,n,a)}return e.prototype.setSize=function(t,r){var n=this.renderable.values.uTexSize.ref.value;(t!==n[0]||r!==n[1])&&k.update(this.renderable.values.uTexSize,Fe.set(this.renderable.values.uTexSize.ref.value,t,r))},e.prototype.clearSkybox=function(){var t=this;void 0!==this.skybox&&(this.skybox.texture.destroy(),this.skybox.assets.forEach(function(r){return t.assetManager.release(r)}),this.skybox=void 0)},e.prototype.updateSkybox=function(t,r,n){var i,a=this,o=null===(i=this.skybox)||void 0===i?void 0:i.props.faces,s=r.faces.params;if(!(s.nx&&s.ny&&s.nz&&s.px&&s.py&&s.pz))return this.clearSkybox(),void n?.(!1);if(this.skybox&&o&&function uJe(e,t){return coe(e)===coe(t)}(r.faces,this.skybox.props.faces))n?.(!1);else{this.clearSkybox();var u=function cJe(e,t,r,n){var a=function oJe(e,t){return"urls"===t.name?{nx:pn.getUrlAsset(e,t.params.nx),ny:pn.getUrlAsset(e,t.params.ny),nz:pn.getUrlAsset(e,t.params.nz),px:pn.getUrlAsset(e,t.params.px),py:pn.getUrlAsset(e,t.params.py),pz:pn.getUrlAsset(e,t.params.pz)}:{nx:t.params.nx,ny:t.params.ny,nz:t.params.nz,px:t.params.px,py:t.params.py,pz:t.params.pz}}(t,r),i=function sJe(e,t){var r=function(n){return e.resolve(n,"binary").run().then(function(a){return new Blob([a.data])})};return{nx:r(t.nx),ny:r(t.ny),nz:r(t.nz),px:r(t.px),py:r(t.py),pz:r(t.pz)}}(t,a),o=[a.nx,a.ny,a.nz,a.px,a.py,a.pz];return typeof HTMLImageElement>"u"?(console.error('Missing "HTMLImageElement" required for background skybox'),n?.(!0),{texture:Go(),assets:o}):{texture:e.resources.cubeTexture(i,!0,n),assets:o}}(this.webgl,this.assetManager,r.faces,function(p){a.skybox&&(a.skybox.loaded=!p),n?.(!0)}),c=u.texture,l=u.assets;this.skybox={texture:c,props:R({},r),assets:l,loaded:!1},k.update(this.renderable.values.tSkybox,c),this.renderable.update()}if(this.skybox){var f=t;"orthographic"===t.state.mode&&(this.camera.setState(R(R({},t.state),{mode:"perspective"})),this.camera.update(),f=this.camera);var d=this.renderable.values.uViewDirectionProjectionInverse.ref.value;S.sub(this.dir,f.state.position,f.state.target),S.setMagnitude(this.dir,this.dir,.1),S.copy(this.position,this.dir),me.lookAt(d,this.position,this.target,f.state.up),me.mul(d,f.projection,d),me.invert(d,d),k.update(this.renderable.values.uViewDirectionProjectionInverse,d),k.updateIfChanged(this.renderable.values.uBlur,r.blur),k.updateIfChanged(this.renderable.values.uOpacity,r.opacity),k.updateIfChanged(this.renderable.values.uSaturation,r.saturation),k.updateIfChanged(this.renderable.values.uLightness,r.lightness),k.updateIfChanged(this.renderable.values.dVariant,"skybox"),this.renderable.update()}},e.prototype.clearImage=function(){void 0!==this.image&&(this.image.texture.destroy(),this.assetManager.release(this.image.asset),this.image=void 0)},e.prototype.updateImage=function(t,r){var n=this;if(!t.source.params)return this.clearImage(),void r?.(!1);if(this.image&&this.image.props.source.params&&function lJe(e,t){return foe(e)===foe(t)}(t.source,this.image.props.source))r?.(!1);else{this.clearImage();var a=function fJe(e,t,r,n){var a="url"===r.name?pn.getUrlAsset(t,r.params):r.params;if(typeof HTMLImageElement>"u")return console.error('Missing "HTMLImageElement" required for background image'),n?.(!0),{texture:Go(),asset:a};var i=e.resources.texture("image-uint8","rgba","ubyte","linear"),o=new Image;return o.onload=function(){i.load(o),(e.isWebGL2||T_(o.width)&&T_(o.height))&&i.mipmap(),n?.()},o.onerror=function(){n?.(!0)},t.resolve(a,"binary").run().then(function(s){var u=new Blob([s.data]);o.src=URL.createObjectURL(u)}),{texture:i,asset:a}}(this.webgl,this.assetManager,t.source,function(s){n.image&&(n.image.loaded=!s),r?.(!0)}),i=a.texture,o=a.asset;this.image={texture:i,props:R({},t),asset:o,loaded:!1},k.update(this.renderable.values.tImage,i),this.renderable.update()}this.image&&(k.updateIfChanged(this.renderable.values.uBlur,t.blur),k.updateIfChanged(this.renderable.values.uOpacity,t.opacity),k.updateIfChanged(this.renderable.values.uSaturation,t.saturation),k.updateIfChanged(this.renderable.values.uLightness,t.lightness),k.updateIfChanged(this.renderable.values.uViewportAdjusted,"viewport"===t.coverage),k.updateIfChanged(this.renderable.values.dVariant,"image"),this.renderable.update())},e.prototype.updateImageScaling=function(){var t,r,n=this.renderable.values,a=n.uTexSize.ref.value,i=a[0],o=a[1],s=(null===(t=this.image)||void 0===t?void 0:t.texture.getWidth())||0,u=(null===(r=this.image)||void 0===r?void 0:r.texture.getHeight())||0,c=i/o;k.update(n.uImageScale,cc?Fe.set(n.uImageOffset.ref.value,(1-c/h)/2,0):Fe.set(n.uImageOffset.ref.value,0,(1-h/c)/2))},e.prototype.updateGradient=function(t,r,n,a,i){k.update(this.renderable.values.uGradientColorA,ft.toVec3Normalized(this.renderable.values.uGradientColorA.ref.value,t)),k.update(this.renderable.values.uGradientColorB,ft.toVec3Normalized(this.renderable.values.uGradientColorB.ref.value,r)),k.updateIfChanged(this.renderable.values.uGradientRatio,n),k.updateIfChanged(this.renderable.values.uViewportAdjusted,i),k.updateIfChanged(this.renderable.values.dVariant,a),this.renderable.update()},e.prototype.update=function(t,r,n){if("off"===r.variant.name)return this.clearSkybox(),this.clearImage(),void n?.(!1);"skybox"===r.variant.name?(this.clearImage(),this.updateSkybox(t,r.variant.params,n)):"image"===r.variant.name?(this.clearSkybox(),this.updateImage(r.variant.params,n)):"horizontalGradient"===r.variant.name?(this.clearSkybox(),this.clearImage(),this.updateGradient(r.variant.params.topColor,r.variant.params.bottomColor,r.variant.params.ratio,r.variant.name,"viewport"===r.variant.params.coverage),n?.(!1)):"radialGradient"===r.variant.name&&(this.clearSkybox(),this.clearImage(),this.updateGradient(r.variant.params.centerColor,r.variant.params.edgeColor,r.variant.params.ratio,r.variant.name,"viewport"===r.variant.params.coverage),n?.(!1));var a=t.viewport;k.update(this.renderable.values.uViewport,pr.set(this.renderable.values.uViewport.ref.value,a.x,a.y,a.width,a.height))},e.prototype.isEnabled=function(t){return!!(this.skybox&&this.skybox.loaded||this.image&&this.image.loaded||"horizontalGradient"===t.variant.name||"radialGradient"===t.variant.name)},e.prototype.isReady=function(){return!!(this.skybox&&this.skybox.loaded||this.image&&this.image.loaded||"horizontalGradient"===this.renderable.values.dVariant.ref.value||"radialGradient"===this.renderable.values.dVariant.ref.value)},e.prototype.render=function(){this.isReady()&&("image"===this.renderable.values.dVariant.ref.value&&this.updateImageScaling(),xt&&this.webgl.timer.mark("BackgroundPass.render"),this.renderable.render(),xt&&this.webgl.timer.markEnd("BackgroundPass.render"))},e.prototype.dispose=function(){this.clearSkybox(),this.clearImage()},e}(),uoe="background-skybox";function coe(e){var t,r,n,a,i,o;return"urls"===e.name?"".concat(uoe,"_").concat(e.params.nx,"|").concat(e.params.ny,"|").concat(e.params.nz,"|").concat(e.params.px,"|").concat(e.params.py,"|").concat(e.params.pz):"".concat(uoe,"_").concat(null===(t=e.params.nx)||void 0===t?void 0:t.id,"|").concat(null===(r=e.params.ny)||void 0===r?void 0:r.id,"|").concat(null===(n=e.params.nz)||void 0===n?void 0:n.id,"|").concat(null===(a=e.params.px)||void 0===a?void 0:a.id,"|").concat(null===(i=e.params.py)||void 0===i?void 0:i.id,"|").concat(null===(o=e.params.pz)||void 0===o?void 0:o.id)}var loe="background-image";function foe(e){var t;return"url"===e.name?"".concat(loe,"_").concat(e.params):"".concat(loe,"_").concat(null===(t=e.params)||void 0===t?void 0:t.id)}var dJe={drawCount:ha("number"),instanceCount:ha("number"),aPosition:Mn("float32",2,0),tSkybox:Xt("texture","rgba","ubyte","linear"),tImage:Xt("texture","rgba","ubyte","linear"),uImageScale:Te("v2"),uImageOffset:Te("v2"),uTexSize:Te("v2"),uViewport:Te("v4"),uViewportAdjusted:Te("b"),uViewDirectionProjectionInverse:Te("m4"),uGradientColorA:Te("v3"),uGradientColorB:Te("v3"),uGradientRatio:Te("f"),uBlur:Te("f"),uOpacity:Te("f"),uSaturation:Te("f"),uLightness:Te("f"),dVariant:Vt("string",["skybox","image","verticalGradient","horizontalGradient","radialGradient"])},pJe=Un("background","\nprecision mediump float;\n\nattribute vec2 aPosition;\n\nvarying vec4 vPosition;\n\nvoid main() {\n vPosition = vec4(aPosition, 1.0, 1.0);\n gl_Position = vec4(aPosition, 1.0, 1.0);\n}\n","\nprecision mediump float;\nprecision mediump samplerCube;\nprecision mediump sampler2D;\n\n#if defined(dVariant_skybox)\n uniform samplerCube tSkybox;\n uniform mat4 uViewDirectionProjectionInverse;\n uniform float uBlur;\n uniform float uOpacity;\n uniform float uSaturation;\n uniform float uLightness;\n#elif defined(dVariant_image)\n uniform sampler2D tImage;\n uniform vec2 uImageScale;\n uniform vec2 uImageOffset;\n uniform float uBlur;\n uniform float uOpacity;\n uniform float uSaturation;\n uniform float uLightness;\n#elif defined(dVariant_horizontalGradient) || defined(dVariant_radialGradient)\n uniform vec3 uGradientColorA;\n uniform vec3 uGradientColorB;\n uniform float uGradientRatio;\n#endif\n\nuniform vec2 uTexSize;\nuniform vec4 uViewport;\nuniform bool uViewportAdjusted;\nvarying vec4 vPosition;\n\n// TODO: add as general pp option to remove banding?\n// Iestyn's RGB dither from http://alex.vlachos.com/graphics/Alex_Vlachos_Advanced_VR_Rendering_GDC2015.pdf\nvec3 ScreenSpaceDither(vec2 vScreenPos) {\n vec3 vDither = vec3(dot(vec2(171.0, 231.0), vScreenPos.xy));\n vDither.rgb = fract(vDither.rgb / vec3(103.0, 71.0, 97.0));\n return vDither.rgb / 255.0;\n}\n\nvec3 saturateColor(vec3 c, float amount) {\n // https://www.w3.org/TR/WCAG21/#dfn-relative-luminance\n const vec3 W = vec3(0.2125, 0.7154, 0.0721);\n vec3 intensity = vec3(dot(c, W));\n return mix(intensity, c, 1.0 + amount);\n}\n\nvec3 lightenColor(vec3 c, float amount) {\n return c + amount;\n}\n\nvoid main() {\n #if defined(dVariant_skybox)\n vec4 t = uViewDirectionProjectionInverse * vPosition;\n #ifdef enabledShaderTextureLod\n gl_FragColor = textureCubeLodEXT(tSkybox, normalize(t.xyz / t.w), uBlur * 8.0);\n #else\n gl_FragColor = textureCube(tSkybox, normalize(t.xyz / t.w));\n #endif\n gl_FragColor.a = uOpacity;\n gl_FragColor.rgb = lightenColor(saturateColor(gl_FragColor.rgb, uSaturation), uLightness);\n #elif defined(dVariant_image)\n vec2 coords;\n if (uViewportAdjusted) {\n coords = ((gl_FragCoord.xy - uViewport.xy) * (uTexSize / uViewport.zw) / uImageScale) + uImageOffset;\n } else {\n coords = (gl_FragCoord.xy / uImageScale) + uImageOffset;\n }\n #ifdef enabledShaderTextureLod\n gl_FragColor = texture2DLodEXT(tImage, vec2(coords.x, 1.0 - coords.y), uBlur * 8.0);\n #else\n gl_FragColor = texture2D(tImage, vec2(coords.x, 1.0 - coords.y));\n #endif\n gl_FragColor.a = uOpacity;\n gl_FragColor.rgb = lightenColor(saturateColor(gl_FragColor.rgb, uSaturation), uLightness);\n #elif defined(dVariant_horizontalGradient)\n float d;\n if (uViewportAdjusted) {\n d = ((gl_FragCoord.y - uViewport.y) * (uTexSize.y / uViewport.w) / uTexSize.y) + 1.0 - (uGradientRatio * 2.0);\n } else {\n d = (gl_FragCoord.y / uTexSize.y) + 1.0 - (uGradientRatio * 2.0);\n }\n gl_FragColor = vec4(mix(uGradientColorB, uGradientColorA, clamp(d, 0.0, 1.0)), 1.0);\n gl_FragColor.rgb += ScreenSpaceDither(gl_FragCoord.xy);\n #elif defined(dVariant_radialGradient)\n float d;\n if (uViewportAdjusted) {\n d = distance(vec2(0.5), (gl_FragCoord.xy - uViewport.xy) * (uTexSize / uViewport.zw) / uTexSize) + uGradientRatio - 0.5;\n } else {\n d = distance(vec2(0.5), gl_FragCoord.xy / uTexSize) + uGradientRatio - 0.5;\n }\n gl_FragColor = vec4(mix(uGradientColorB, uGradientColorA, 1.0 - clamp(d, 0.0, 1.0)), 1.0);\n gl_FragColor.rgb += ScreenSpaceDither(gl_FragCoord.xy);\n #endif\n}\n",{shaderTextureLod:"optional"}),gJe={sharpness:D.Numeric(.5,{min:0,max:1,step:.05}),denoise:D.Boolean(!0)},yJe=function(){function e(t,r){this.webgl=t,this.renderable=function SJe(e,t){var r=t.getWidth(),n=t.getHeight(),a=R(R({},Ii),{tColor:k.create(t),uTexSizeInv:k.create(Fe.create(1/r,1/n)),uSharpness:k.create(.5),dDenoise:k.create(!0)}),i=R({},bJe);return Xa(Ya(e,"triangles",_Je,i,a),a)}(t,r)}return e.prototype.updateState=function(t){var r=this.webgl,n=r.gl,a=r.state;a.enable(n.SCISSOR_TEST),a.disable(n.BLEND),a.disable(n.DEPTH_TEST),a.depthMask(!1);var i=t.x,o=t.y,s=t.width,u=t.height;a.viewport(i,o,s,u),a.scissor(i,o,s,u),a.clearColor(0,0,0,1),n.clear(n.COLOR_BUFFER_BIT)},e.prototype.setSize=function(t,r){k.update(this.renderable.values.uTexSizeInv,Fe.set(this.renderable.values.uTexSizeInv.ref.value,1/t,1/r))},e.prototype.update=function(t,r){var n=this.renderable.values,a=r.sharpness,i=r.denoise,o=!1;n.tColor.ref.value!==t&&(k.update(this.renderable.values.tColor,t),o=!0),k.updateIfChanged(n.uSharpness,2-2*Math.pow(a,.25)),n.dDenoise.ref.value!==i&&(o=!0),k.updateIfChanged(n.dDenoise,i),o&&this.renderable.update()},e.prototype.render=function(t,r){xt&&this.webgl.timer.mark("CasPass.render"),r?r.bind():this.webgl.unbindFramebuffer(),this.updateState(t),this.renderable.render(),xt&&this.webgl.timer.markEnd("CasPass.render")},e}(),bJe=R(R({},Ei),{tColor:Xt("texture","rgba","ubyte","linear"),uTexSizeInv:Te("v2"),uSharpness:Te("f"),dDenoise:Vt("boolean")}),_Je=Un("cas",Fo,"\nprecision mediump float;\nprecision mediump sampler2D;\n\nuniform sampler2D tColor;\nuniform vec2 uTexSizeInv;\n\nuniform float uSharpness;\n\n// adapted from https://www.shadertoy.com/view/stXSWB\n\n/*\n* FidelityFX Super Resolution scales up a low resolution\n* image, while adding fine detail.\n*\n* MIT Open License\n*\n* https://gpuopen.com/fsr\n*\n* Left: FSR processed\n* Right: Original texture, bilinear interpolation\n*\n* Mouse at top: Sharpness 0 stops (maximum)\n* Mouse at bottom: Sharpness 2 stops (minimum)\n*\n* It works in two passes-\n* EASU upsamples the image with a clamped Lanczos kernel.\n* RCAS sharpens the image at the target resolution.\n*\n* I needed to make a few changes to improve readability and\n* WebGL compatibility in an algorithm I don't fully understand.\n* Expect bugs.\n*\n* Shader not currently running for WebGL1 targets (eg. mobile Safari)\n*\n* There is kind of no point to using FSR in Shadertoy, as it renders buffers\n* at full target resolution. But this might be useful for WebGL based demos\n* running smaller-than-target render buffers.\n*\n* For sharpening with a full resolution render buffer,\n* FidelityFX CAS is a better option.\n* https://www.shadertoy.com/view/ftsXzM\n*\n* For readability and compatibility, these optimisations have been removed:\n* * Fast approximate inverse and inversesqrt\n* * textureGather fetches (not WebGL compatible)\n* * Multiplying by reciprocal instead of division\n*\n* Apologies to AMD for the numerous slowdowns and errors I have introduced.\n*\n*/\n\n/***** RCAS *****/\n#define FSR_RCAS_LIMIT (0.25-(1.0/16.0))\n\n// Input callback prototypes that need to be implemented by calling shader\nvec4 FsrRcasLoadF(vec2 p);\n//------------------------------------------------------------------------------------------------------------------------------\nvoid FsrRcasCon(\n out float con,\n // The scale is {0.0 := maximum, to N>0, where N is the number of stops (halving) of the reduction of sharpness}.\n float sharpness\n) {\n // Transform from stops to linear value.\n con = exp2(-sharpness);\n}\n\nvec3 FsrRcasF(\n vec2 ip, // Integer pixel position in output.\n float con\n) {\n // Constant generated by RcasSetup().\n // Algorithm uses minimal 3x3 pixel neighborhood.\n // b\n // d e f\n // h\n vec2 sp = vec2(ip);\n vec3 b = FsrRcasLoadF(sp + vec2( 0,-1)).rgb;\n vec3 d = FsrRcasLoadF(sp + vec2(-1, 0)).rgb;\n vec3 e = FsrRcasLoadF(sp).rgb;\n vec3 f = FsrRcasLoadF(sp + vec2( 1, 0)).rgb;\n vec3 h = FsrRcasLoadF(sp + vec2( 0, 1)).rgb;\n\n // Luma times 2.\n float bL = b.g + .5 * (b.b + b.r);\n float dL = d.g + .5 * (d.b + d.r);\n float eL = e.g + .5 * (e.b + e.r);\n float fL = f.g + .5 * (f.b + f.r);\n float hL = h.g + .5 * (h.b + h.r);\n\n // Noise detection.\n #ifdef dDenoise\n float nz = .25 * (bL + dL + fL + hL) - eL;\n nz=clamp(\n abs(nz)\n /(\n max(max(bL,dL),max(eL,max(fL,hL)))\n -min(min(bL,dL),min(eL,min(fL,hL)))\n ),\n 0., 1.\n );\n nz=1.-.5*nz;\n #endif\n\n // Min and max of ring.\n vec3 mn4 = min(b, min(f, h));\n vec3 mx4 = max(b, max(f, h));\n\n // Immediate constants for peak range.\n vec2 peakC = vec2(1., -4.);\n\n // Limiters, these need to be high precision RCPs.\n vec3 hitMin = mn4 / (4. * mx4);\n vec3 hitMax = (peakC.x - mx4) / (4.* mn4 + peakC.y);\n vec3 lobeRGB = max(-hitMin, hitMax);\n float lobe = max(\n -FSR_RCAS_LIMIT,\n min(max(lobeRGB.r, max(lobeRGB.g, lobeRGB.b)), 0.)\n )*con;\n\n // Apply noise removal.\n #ifdef dDenoise\n lobe *= nz;\n #endif\n\n // Resolve, which needs the medium precision rcp approximation to avoid visible tonality changes.\n return (lobe * (b + d + h + f) + e) / (4. * lobe + 1.);\n}\n\n\nvec4 FsrRcasLoadF(vec2 p) {\n return texture2D(tColor, p * uTexSizeInv);\n}\n\nvoid main() {\n // Set up constants\n float con;\n FsrRcasCon(con, uSharpness);\n\n // Perform RCAS pass\n vec3 col = FsrRcasF(gl_FragCoord.xy, con);\n\n gl_FragColor = vec4(col, FsrRcasLoadF(gl_FragCoord.xy).a);\n}\n"),CJe=R(R({},Ei),{tDepthOpaque:Xt("texture","rgba","ubyte","nearest"),tDepthTransparent:Xt("texture","rgba","ubyte","nearest"),uTexSize:Te("v2"),dOrthographic:Vt("number"),uNear:Te("f"),uFar:Te("f"),uInvProjection:Te("m4"),uOutlineThreshold:Te("f"),dTransparentOutline:Vt("boolean")}),wJe=R(R({},Ei),{tDepth:Xt("texture","rgba","ubyte","nearest"),uTexSize:Te("v2"),uProjection:Te("m4"),uInvProjection:Te("m4"),uBounds:Te("v4"),dOrthographic:Vt("number"),uNear:Te("f"),uFar:Te("f"),dSteps:Vt("number"),uMaxDistance:Te("f"),uTolerance:Te("f"),uBias:Te("f"),uLightDirection:Te("v3[]"),uLightColor:Te("v3[]"),dLightCount:Vt("number")}),TJe=R(R({},Ei),{tDepth:Xt("texture","rgba","ubyte","nearest"),tDepthHalf:Xt("texture","rgba","ubyte","nearest"),tDepthQuarter:Xt("texture","rgba","ubyte","nearest"),uSamples:Te("v3[]"),dNSamples:Vt("number"),uProjection:Te("m4"),uInvProjection:Te("m4"),uBounds:Te("v4"),uTexSize:Te("v2"),uRadius:Te("f"),uBias:Te("f"),dMultiScale:Vt("boolean"),dLevels:Vt("number"),uLevelRadius:Te("f[]"),uLevelBias:Te("f[]"),uNearThreshold:Te("f"),uFarThreshold:Te("f")}),EJe=R(R({},Ei),{tSsaoDepth:Xt("texture","rgba","ubyte","nearest"),uTexSize:Te("v2"),uKernel:Te("f[]"),dOcclusionKernelSize:Vt("number"),uBlurDirectionX:Te("f"),uBlurDirectionY:Te("f"),uInvProjection:Te("m4"),uNear:Te("f"),uFar:Te("f"),uBounds:Te("v4"),dOrthographic:Vt("number")});function doe(e,t,r){var n=R(R({},Ii),{tSsaoDepth:k.create(t),uTexSize:k.create(Fe.create(t.getWidth(),t.getHeight())),uKernel:k.create(poe(15)),dOcclusionKernelSize:k.create(15),uBlurDirectionX:k.create("horizontal"===r?1:0),uBlurDirectionY:k.create("vertical"===r?1:0),uInvProjection:k.create(me.identity()),uNear:k.create(0),uFar:k.create(1e4),uBounds:k.create(pr()),dOrthographic:k.create(0)}),a=R({},EJe);return Xa(Ya(e,"triangles",Un("ssao_blur",Fo,"\nprecision highp float;\nprecision highp int;\nprecision highp sampler2D;\n\nuniform sampler2D tSsaoDepth;\nuniform vec2 uTexSize;\nuniform vec4 uBounds;\n\nuniform float uKernel[dOcclusionKernelSize];\n\nuniform float uBlurDirectionX;\nuniform float uBlurDirectionY;\n\nuniform mat4 uInvProjection;\nuniform float uNear;\nuniform float uFar;\n\n#include common\n\nfloat getViewZ(const in float depth) {\n #if dOrthographic == 1\n return orthographicDepthToViewZ(depth, uNear, uFar);\n #else\n return perspectiveDepthToViewZ(depth, uNear, uFar);\n #endif\n}\n\nbool isBackground(const in float depth) {\n return depth == 1.0;\n}\n\nbool outsideBounds(const in vec2 p) {\n return p.x < uBounds.x || p.y < uBounds.y || p.x > uBounds.z || p.y > uBounds.w;\n}\n\nfloat getPixelSize(const in vec2 coords, const in float depth) {\n vec3 viewPos0 = screenSpaceToViewSpace(vec3(coords, depth), uInvProjection);\n vec3 viewPos1 = screenSpaceToViewSpace(vec3(coords + vec2(1.0, 0.0) / uTexSize, depth), uInvProjection);\n return distance(viewPos0, viewPos1);\n}\n\nvoid main(void) {\n vec2 coords = gl_FragCoord.xy / uTexSize;\n\n vec2 packedDepth = texture2D(tSsaoDepth, coords).zw;\n\n if (outsideBounds(coords)) {\n gl_FragColor = vec4(packUnitIntervalToRG(1.0), packedDepth);\n return;\n }\n\n float selfDepth = unpackRGToUnitInterval(packedDepth);\n // if background and if second pass\n if (isBackground(selfDepth) && uBlurDirectionY != 0.0) {\n gl_FragColor = vec4(packUnitIntervalToRG(1.0), packedDepth);\n return;\n }\n\n float selfViewZ = getViewZ(selfDepth);\n float pixelSize = getPixelSize(coords, selfDepth);\n float maxDiffViewZ = pixelSize * 10.0;\n\n vec2 offset = vec2(uBlurDirectionX, uBlurDirectionY) / uTexSize;\n\n float sum = 0.0;\n float kernelSum = 0.0;\n // only if kernelSize is odd\n for (int i = -dOcclusionKernelSize / 2; i <= dOcclusionKernelSize / 2; i++) {\n if (abs(float(i)) > 1.0 && abs(float(i)) * pixelSize > 0.8) continue;\n\n vec2 sampleCoords = coords + float(i) * offset;\n if (outsideBounds(sampleCoords)) {\n continue;\n }\n\n vec4 sampleSsaoDepth = texture2D(tSsaoDepth, sampleCoords);\n\n float sampleDepth = unpackRGToUnitInterval(sampleSsaoDepth.zw);\n if (isBackground(sampleDepth)) {\n continue;\n }\n\n if (abs(float(i)) > 1.0) {\n float sampleViewZ = getViewZ(sampleDepth);\n if (abs(selfViewZ - sampleViewZ) > maxDiffViewZ) {\n continue;\n }\n }\n\n float kernel = uKernel[int(abs(float(i)))]; // abs is not defined for int in webgl1\n float sampleValue = unpackRGToUnitInterval(sampleSsaoDepth.xy);\n\n sum += kernel * sampleValue;\n kernelSum += kernel;\n }\n\n gl_FragColor = vec4(packUnitIntervalToRG(sum / kernelSum), packedDepth);\n}\n"),a,n),n)}function poe(e){for(var t=e/3,r=Math.floor((e+1)/2),n=[],a=0;a pixelSizeOpaque && selfDepthOpaque > sampleDepthOpaque && sampleDepthOpaque <= bestDepth) {\n outline = 0.0;\n bestDepth = sampleDepthOpaque;\n }\n\n if (sampleDepthTransparent < sampleDepthOpaque) {\n float sampleViewZTransparent = isBackground(sampleDepthTransparent) ? backgroundViewZ : getViewZ(sampleDepthTransparent);\n if (abs(selfViewZTransparent - sampleViewZTransparent) > pixelSizeTransparent && selfDepthTransparent > sampleDepthTransparent && sampleDepthTransparent <= bestDepth) {\n outline = 0.0;\n bestDepth = sampleDepthTransparent;\n transparentFlag = 1.0;\n }\n }\n }\n }\n\n gl_FragColor = vec4(outline, packUnitIntervalToRG(bestDepth), transparentFlag);\n}\n"),s,o),o)}(t,o,i,!0),this.shadowsTarget=t.createRenderTarget(s,u,!1),this.shadowsRenderable=function AJe(e,t){var r=t.getWidth(),n=t.getHeight(),a=R(R({},Ii),{tDepth:k.create(t),uTexSize:k.create(Fe.create(r,n)),uProjection:k.create(me.identity()),uInvProjection:k.create(me.identity()),uBounds:k.create(pr()),dOrthographic:k.create(0),uNear:k.create(1),uFar:k.create(1e4),dSteps:k.create(1),uMaxDistance:k.create(3),uTolerance:k.create(1),uBias:k.create(.6),uLightDirection:k.create([]),uLightColor:k.create([]),dLightCount:k.create(0)}),i=R({},wJe);return Xa(Ya(e,"triangles",Un("shadows",Fo,"\nprecision highp float;\nprecision highp int;\nprecision highp sampler2D;\n\n#include common\n\nuniform sampler2D tDepth;\nuniform vec2 uTexSize;\nuniform vec4 uBounds;\n\nuniform float uNear;\nuniform float uFar;\n\n#if dLightCount != 0\n uniform vec3 uLightDirection[dLightCount];\n uniform vec3 uLightColor[dLightCount];\n#endif\n\nuniform mat4 uProjection;\nuniform mat4 uInvProjection;\n\nuniform float uMaxDistance;\nuniform float uTolerance;\nuniform float uBias;\n\nbool isBackground(const in float depth) {\n return depth == 1.0;\n}\n\nbool outsideBounds(const in vec2 p) {\n return p.x < uBounds.x || p.y < uBounds.y || p.x > uBounds.z || p.y > uBounds.w;\n}\n\nfloat getViewZ(const in float depth) {\n #if dOrthographic == 1\n return orthographicDepthToViewZ(depth, uNear, uFar);\n #else\n return perspectiveDepthToViewZ(depth, uNear, uFar);\n #endif\n}\n\nfloat getDepth(const in vec2 coords) {\n #ifdef depthTextureSupport\n return texture2D(tDepth, coords).r;\n #else\n return unpackRGBAToDepth(texture2D(tDepth, coords));\n #endif\n}\n\nfloat screenFade(const in vec2 coords) {\n vec2 c = (coords - uBounds.xy) / (uBounds.zw - uBounds.xy);\n vec2 fade = max(12.0 * abs(c - 0.5) - 5.0, vec2(0.0));\n return saturate(1.0 - dot(fade, fade));\n}\n\n// based on https://panoskarabelas.com/posts/screen_space_shadows/\nfloat screenSpaceShadow(const in vec3 position, const in vec3 lightDirection, const in float stepLength) {\n // Ray position and direction (in view-space)\n vec3 rayPos = position;\n vec3 rayDir = -lightDirection;\n\n // Compute ray step\n vec3 rayStep = rayDir * stepLength;\n\n // Ray march towards the light\n float occlusion = 0.0;\n vec4 rayCoords = vec4(0.0);\n for (int i = 0; i < dSteps; ++i) {\n // Step the ray\n rayPos += rayStep;\n\n rayCoords = uProjection * vec4(rayPos, 1.0);\n rayCoords.xyz = (rayCoords.xyz / rayCoords.w) * 0.5 + 0.5;\n\n if (outsideBounds(rayCoords.xy))\n return 1.0;\n\n // Compute the difference between the ray's and the camera's depth\n float depth = getDepth(rayCoords.xy);\n float viewZ = getViewZ(depth);\n float zDelta = rayPos.z - viewZ;\n\n if (zDelta < uTolerance) {\n occlusion = 1.0;\n\n // Fade out as we approach the edges of the screen\n occlusion *= screenFade(rayCoords.xy);\n\n break;\n }\n }\n\n return 1.0 - (uBias * occlusion);\n}\n\nvoid main(void) {\n vec2 invTexSize = 1.0 / uTexSize;\n vec2 selfCoords = gl_FragCoord.xy * invTexSize;\n\n float selfDepth = getDepth(selfCoords);\n\n if (isBackground(selfDepth)) {\n gl_FragColor = vec4(0.0);\n return;\n }\n\n vec3 selfViewPos = screenSpaceToViewSpace(vec3(selfCoords, selfDepth), uInvProjection);\n float stepLength = uMaxDistance / float(dSteps);\n\n float o = 1.0;\n #if dLightCount != 0\n float sh[dLightCount];\n #pragma unroll_loop_start\n for (int i = 0; i < dLightCount; ++i) {\n sh[i] = screenSpaceShadow(selfViewPos, uLightDirection[i], stepLength);\n o = min(o, sh[i]);\n }\n #pragma unroll_loop_end\n #endif\n\n gl_FragColor = vec4(o);\n}\n"),i,a),a)}(t,o),this.ssaoFramebuffer=t.resources.framebuffer(),this.ssaoBlurFirstPassFramebuffer=t.resources.framebuffer(),this.ssaoBlurSecondPassFramebuffer=t.resources.framebuffer();var c=Math.floor(s*this.ssaoScale),l=Math.floor(u*this.ssaoScale),f=Math.max(1,Math.floor(.5*c)),d=Math.max(1,Math.floor(.5*l)),p=Math.max(1,Math.floor(.25*c)),h=Math.max(1,Math.floor(.25*l));this.downsampledDepthTarget=n.packedDepth?t.createRenderTarget(c,l,!1,"uint8","linear","rgba"):t.createRenderTarget(c,l,!1,"float32","linear",t.isWebGL2?"alpha":"rgba"),this.downsampleDepthRenderable=yb(t,o);var m=1===this.ssaoScale?o:this.downsampledDepthTarget.texture;this.depthHalfTarget=n.packedDepth?t.createRenderTarget(f,d,!1,"uint8","linear","rgba"):t.createRenderTarget(f,d,!1,"float32","linear",t.isWebGL2?"alpha":"rgba"),this.depthHalfRenderable=yb(t,m),this.depthQuarterTarget=n.packedDepth?t.createRenderTarget(p,h,!1,"uint8","linear","rgba"):t.createRenderTarget(p,h,!1,"float32","linear",t.isWebGL2?"alpha":"rgba"),this.depthQuarterRenderable=yb(t,this.depthHalfTarget.texture),this.ssaoDepthTexture=t.resources.texture("image-uint8","rgba","ubyte","linear"),this.ssaoDepthTexture.define(c,l),this.ssaoDepthTexture.attachFramebuffer(this.ssaoFramebuffer,"color0"),this.ssaoDepthBlurProxyTexture=t.resources.texture("image-uint8","rgba","ubyte","linear"),this.ssaoDepthBlurProxyTexture.define(c,l),this.ssaoDepthBlurProxyTexture.attachFramebuffer(this.ssaoBlurFirstPassFramebuffer,"color0"),this.ssaoDepthTexture.attachFramebuffer(this.ssaoBlurSecondPassFramebuffer,"color0"),this.ssaoRenderable=function DJe(e,t,r,n){var a=R(R({},Ii),{tDepth:k.create(t),tDepthHalf:k.create(r),tDepthQuarter:k.create(n),uSamples:k.create(moe(32)),dNSamples:k.create(32),uProjection:k.create(me.identity()),uInvProjection:k.create(me.identity()),uBounds:k.create(pr()),uTexSize:k.create(Fe.create(e.gl.drawingBufferWidth,e.gl.drawingBufferHeight)),uRadius:k.create(Math.pow(2,5)),uBias:k.create(.8),dMultiScale:k.create(!1),dLevels:k.create(3),uLevelRadius:k.create([Math.pow(2,2),Math.pow(2,5),Math.pow(2,8)]),uLevelBias:k.create([.8,.8,.8]),uNearThreshold:k.create(10),uFarThreshold:k.create(1500)}),i=R({},TJe);return Xa(Ya(e,"triangles",Un("ssao",Fo,"\nprecision highp float;\nprecision highp int;\nprecision highp sampler2D;\n\n#include common\n\nuniform sampler2D tDepth;\nuniform sampler2D tDepthHalf;\nuniform sampler2D tDepthQuarter;\nuniform vec2 uTexSize;\nuniform vec4 uBounds;\n\nuniform vec3 uSamples[dNSamples];\n\nuniform mat4 uProjection;\nuniform mat4 uInvProjection;\n\n#ifdef dMultiScale\n uniform float uLevelRadius[dLevels];\n uniform float uLevelBias[dLevels];\n uniform float uNearThreshold;\n uniform float uFarThreshold;\n#else\n uniform float uRadius;\n#endif\nuniform float uBias;\n\nfloat smootherstep(float edge0, float edge1, float x) {\n x = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);\n return x * x * x * (x * (x * 6.0 - 15.0) + 10.0);\n}\n\nfloat noise(const in vec2 coords) {\n float a = 12.9898;\n float b = 78.233;\n float c = 43758.5453;\n float dt = dot(coords, vec2(a,b));\n float sn = mod(dt, PI);\n return abs(fract(sin(sn) * c)); // is abs necessary?\n}\n\nvec2 getNoiseVec2(const in vec2 coords) {\n return vec2(noise(coords), noise(coords + vec2(PI, 2.71828)));\n}\n\nbool isBackground(const in float depth) {\n return depth == 1.0;\n}\n\nfloat getDepth(const in vec2 coords) {\n vec2 c = vec2(clamp(coords.x, uBounds.x, uBounds.z), clamp(coords.y, uBounds.y, uBounds.w));\n #ifdef depthTextureSupport\n return texture2D(tDepth, c).r;\n #else\n return unpackRGBAToDepth(texture2D(tDepth, c));\n #endif\n}\n\n#define dQuarterThreshold 0.1\n#define dHalfThreshold 0.05\n\nfloat getMappedDepth(const in vec2 coords, const in vec2 selfCoords) {\n vec2 c = vec2(clamp(coords.x, uBounds.x, uBounds.z), clamp(coords.y, uBounds.y, uBounds.w));\n float d = distance(coords, selfCoords);\n #ifdef depthTextureSupport\n if (d > dQuarterThreshold) {\n return texture2D(tDepthQuarter, c).r;\n } else if (d > dHalfThreshold) {\n return texture2D(tDepthHalf, c).r;\n } else {\n return texture2D(tDepth, c).r;\n }\n #else\n if (d > dQuarterThreshold) {\n return unpackRGBAToDepth(texture2D(tDepthQuarter, c));\n } else if (d > dHalfThreshold) {\n return unpackRGBAToDepth(texture2D(tDepthHalf, c));\n } else {\n return unpackRGBAToDepth(texture2D(tDepth, c));\n }\n #endif\n}\n\nvec3 normalFromDepth(const in float depth, const in float depth1, const in float depth2, vec2 offset1, vec2 offset2) {\n vec3 p1 = vec3(offset1, depth1 - depth);\n vec3 p2 = vec3(offset2, depth2 - depth);\n\n vec3 normal = cross(p1, p2);\n normal.z = -normal.z;\n\n return normalize(normal);\n}\n\nfloat getPixelSize(const in vec2 coords, const in float depth) {\n vec3 viewPos0 = screenSpaceToViewSpace(vec3(coords, depth), uInvProjection);\n vec3 viewPos1 = screenSpaceToViewSpace(vec3(coords + vec2(1.0, 0.0) / uTexSize, depth), uInvProjection);\n return distance(viewPos0, viewPos1);\n}\n\n// StarCraft II Ambient Occlusion by [Filion and McNaughton 2008]\nvoid main(void) {\n vec2 invTexSize = 1.0 / uTexSize;\n vec2 selfCoords = gl_FragCoord.xy * invTexSize;\n\n float selfDepth = getDepth(selfCoords);\n vec2 selfPackedDepth = packUnitIntervalToRG(selfDepth);\n\n if (isBackground(selfDepth)) {\n gl_FragColor = vec4(packUnitIntervalToRG(1.0), selfPackedDepth);\n return;\n }\n\n vec2 offset1 = vec2(0.0, invTexSize.y);\n vec2 offset2 = vec2(invTexSize.x, 0.0);\n\n float selfDepth1 = getDepth(selfCoords + offset1);\n float selfDepth2 = getDepth(selfCoords + offset2);\n\n vec3 selfViewNormal = normalFromDepth(selfDepth, selfDepth1, selfDepth2, offset1, offset2);\n vec3 selfViewPos = screenSpaceToViewSpace(vec3(selfCoords, selfDepth), uInvProjection);\n\n vec3 randomVec = normalize(vec3(getNoiseVec2(selfCoords) * 2.0 - 1.0, 0.0));\n vec3 tangent = normalize(randomVec - selfViewNormal * dot(randomVec, selfViewNormal));\n vec3 bitangent = cross(selfViewNormal, tangent);\n mat3 TBN = mat3(tangent, bitangent, selfViewNormal);\n\n float occlusion = 0.0;\n #ifdef dMultiScale\n float pixelSize = getPixelSize(selfCoords, selfDepth);\n\n for(int l = 0; l < dLevels; l++) {\n // TODO: smooth transition\n if (pixelSize * uNearThreshold > uLevelRadius[l]) continue;\n if (pixelSize * uFarThreshold < uLevelRadius[l]) continue;\n\n float levelOcclusion = 0.0;\n for(int i = 0; i < dNSamples; i++) {\n vec3 sampleViewPos = TBN * uSamples[i];\n sampleViewPos = selfViewPos + sampleViewPos * uLevelRadius[l];\n\n vec4 offset = vec4(sampleViewPos, 1.0);\n offset = uProjection * offset;\n offset.xyz = (offset.xyz / offset.w) * 0.5 + 0.5;\n\n float sampleDepth = getMappedDepth(offset.xy, selfCoords);\n float sampleViewZ = screenSpaceToViewSpace(vec3(offset.xy, sampleDepth), uInvProjection).z;\n\n levelOcclusion += step(sampleViewPos.z + 0.025, sampleViewZ) * smootherstep(0.0, 1.0, uLevelRadius[l] / abs(selfViewPos.z - sampleViewZ)) * uLevelBias[l];\n }\n occlusion = max(occlusion, levelOcclusion);\n }\n #else\n for(int i = 0; i < dNSamples; i++) {\n vec3 sampleViewPos = TBN * uSamples[i];\n sampleViewPos = selfViewPos + sampleViewPos * uRadius;\n\n vec4 offset = vec4(sampleViewPos, 1.0);\n offset = uProjection * offset;\n offset.xyz = (offset.xyz / offset.w) * 0.5 + 0.5;\n\n float sampleDepth = getMappedDepth(offset.xy, selfCoords);\n float sampleViewZ = screenSpaceToViewSpace(vec3(offset.xy, sampleDepth), uInvProjection).z;\n\n occlusion += step(sampleViewPos.z + 0.025, sampleViewZ) * smootherstep(0.0, 1.0, uRadius / abs(selfViewPos.z - sampleViewZ));\n }\n #endif\n occlusion = 1.0 - (uBias * occlusion / float(dNSamples));\n\n vec2 packedOcclusion = packUnitIntervalToRG(clamp(occlusion, 0.01, 1.0));\n\n gl_FragColor = vec4(packedOcclusion, selfPackedDepth);\n}\n"),i,a),a)}(t,m,this.depthHalfTarget.texture,this.depthQuarterTarget.texture),this.ssaoBlurFirstPassRenderable=doe(t,this.ssaoDepthTexture,"horizontal"),this.ssaoBlurSecondPassRenderable=doe(t,this.ssaoDepthBlurProxyTexture,"vertical"),this.renderable=function PJe(e,t,r,n,a,i,o,s){var u=R(R({},Ii),{tSsaoDepth:k.create(o),tColor:k.create(t),tDepthOpaque:k.create(r),tDepthTransparent:k.create(n),tShadows:k.create(a),tOutlines:k.create(i),uTexSize:k.create(Fe.create(t.getWidth(),t.getHeight())),dOrthographic:k.create(0),uNear:k.create(1),uFar:k.create(1e4),uFogNear:k.create(1e4),uFogFar:k.create(1e4),uFogColor:k.create(S.create(1,1,1)),uOutlineColor:k.create(S.create(0,0,0)),uOcclusionColor:k.create(S.create(0,0,0)),uTransparentBackground:k.create(!1),dOcclusionEnable:k.create(!0),uOcclusionOffset:k.create(Fe.create(0,0)),dShadowEnable:k.create(!1),dOutlineEnable:k.create(!1),dOutlineScale:k.create(1),dTransparentOutline:k.create(s)}),c=R({},IJe);return Xa(Ya(e,"triangles",Un("postprocessing",Fo,"\nprecision highp float;\nprecision highp int;\nprecision highp sampler2D;\n\nuniform sampler2D tSsaoDepth;\nuniform sampler2D tColor;\nuniform sampler2D tDepthOpaque;\nuniform sampler2D tDepthTransparent;\nuniform sampler2D tShadows;\nuniform sampler2D tOutlines;\nuniform vec2 uTexSize;\n\nuniform float uNear;\nuniform float uFar;\nuniform float uFogNear;\nuniform float uFogFar;\nuniform vec3 uFogColor;\nuniform vec3 uOutlineColor;\nuniform vec3 uOcclusionColor;\nuniform bool uTransparentBackground;\nuniform vec2 uOcclusionOffset;\n\n#include common\n\nfloat getViewZ(const in float depth) {\n #if dOrthographic == 1\n return orthographicDepthToViewZ(depth, uNear, uFar);\n #else\n return perspectiveDepthToViewZ(depth, uNear, uFar);\n #endif\n}\n\nfloat getDepthOpaque(const in vec2 coords) {\n #ifdef depthTextureSupport\n return texture2D(tDepthOpaque, coords).r;\n #else\n return unpackRGBAToDepth(texture2D(tDepthOpaque, coords));\n #endif\n}\n\nfloat getDepthTransparent(const in vec2 coords) {\n #ifdef dTransparentOutline\n return unpackRGBAToDepth(texture2D(tDepthTransparent, coords));\n #else\n return 1.0;\n #endif\n}\n\nbool isBackground(const in float depth) {\n return depth == 1.0;\n}\n\nfloat getOutline(const in vec2 coords, const in float opaqueDepth, out float closestTexel) {\n float backgroundViewZ = 2.0 * uFar;\n vec2 invTexSize = 1.0 / uTexSize;\n\n float transparentDepth = getDepthTransparent(coords);\n float opaqueSelfViewZ = isBackground(opaqueDepth) ? backgroundViewZ : getViewZ(opaqueDepth);\n float transparentSelfViewZ = isBackground(transparentDepth) ? backgroundViewZ : getViewZ(transparentDepth);\n float selfDepth = min(opaqueDepth, transparentDepth);\n\n float outline = 1.0;\n closestTexel = 1.0;\n for (int y = -dOutlineScale; y <= dOutlineScale; y++) {\n for (int x = -dOutlineScale; x <= dOutlineScale; x++) {\n if (x * x + y * y > dOutlineScale * dOutlineScale) {\n continue;\n }\n\n vec2 sampleCoords = coords + vec2(float(x), float(y)) * invTexSize;\n\n vec4 sampleOutlineCombined = texture2D(tOutlines, sampleCoords);\n float sampleOutline = sampleOutlineCombined.r;\n float sampleOutlineDepth = unpackRGToUnitInterval(sampleOutlineCombined.gb);\n float sampleOutlineViewZ = isBackground(sampleOutlineDepth) ? backgroundViewZ : getViewZ(sampleOutlineDepth);\n\n float selfViewZ = sampleOutlineCombined.a == 0.0 ? opaqueSelfViewZ : transparentSelfViewZ;\n if (sampleOutline == 0.0 && sampleOutlineDepth < closestTexel) {\n outline = 0.0;\n closestTexel = sampleOutlineDepth;\n }\n }\n }\n return closestTexel < opaqueDepth ? outline : 1.0;\n}\n\nfloat getSsao(vec2 coords) {\n float rawSsao = unpackRGToUnitInterval(texture2D(tSsaoDepth, coords).xy);\n if (rawSsao > 0.999) {\n return 1.0;\n } else if (rawSsao > 0.001) {\n return rawSsao;\n }\n // treat values close to 0.0 as errors and return no occlusion\n return 1.0;\n}\n\nvoid main(void) {\n vec2 coords = gl_FragCoord.xy / uTexSize;\n vec4 color = texture2D(tColor, coords);\n\n float viewDist;\n float fogFactor;\n float opaqueDepth = getDepthOpaque(coords);\n\n #ifdef dOcclusionEnable\n if (!isBackground(opaqueDepth)) {\n viewDist = abs(getViewZ(opaqueDepth));\n fogFactor = smoothstep(uFogNear, uFogFar, viewDist);\n float occlusionFactor = getSsao(coords + uOcclusionOffset);\n if (!uTransparentBackground) {\n color.rgb = mix(mix(uOcclusionColor, uFogColor, fogFactor), color.rgb, occlusionFactor);\n } else {\n color.rgb = mix(uOcclusionColor * (1.0 - fogFactor), color.rgb, occlusionFactor);\n }\n }\n #endif\n\n #ifdef dShadowEnable\n if (!isBackground(opaqueDepth)) {\n viewDist = abs(getViewZ(opaqueDepth));\n fogFactor = smoothstep(uFogNear, uFogFar, viewDist);\n vec4 shadow = texture2D(tShadows, coords);\n if (!uTransparentBackground) {\n color.rgb = mix(mix(vec3(0), uFogColor, fogFactor), color.rgb, shadow.a);\n } else {\n color.rgb = mix(vec3(0) * (1.0 - fogFactor), color.rgb, shadow.a);\n }\n }\n #endif\n\n // outline needs to be handled after occlusion and shadow to keep them clean\n #ifdef dOutlineEnable\n float closestTexel;\n float outline = getOutline(coords, opaqueDepth, closestTexel);\n if (outline == 0.0) {\n viewDist = abs(getViewZ(closestTexel));\n fogFactor = smoothstep(uFogNear, uFogFar, viewDist);\n if (!uTransparentBackground) {\n color.rgb = mix(uOutlineColor, uFogColor, fogFactor);\n } else {\n color.a = 1.0 - fogFactor;\n color.rgb = mix(uOutlineColor, color.rgb, fogFactor);\n }\n }\n #endif\n\n gl_FragColor = color;\n}\n"),c,u),u)}(t,a.texture,o,i,this.shadowsTarget.texture,this.outlinesTarget.texture,this.ssaoDepthTexture,!0),this.background=new iJe(t,r,s,u)}return e.isEnabled=function(t){return"on"===t.occlusion.name||"on"===t.shadow.name||"on"===t.outline.name||"off"!==t.background.variant.name},e.isTransparentOutlineEnabled=function(t){return"on"===t.outline.name&&t.outline.params.includeTransparent},e.prototype.calcSsaoScale=function(t){return Math.min(1,1/this.webgl.pixelRatio)*t},e.prototype.setSize=function(t,r){var n=this.renderable.values.uTexSize.ref.value,a=n[0],i=n[1],o=this.calcSsaoScale(1);if(t!==a||r!==i||this.ssaoScale!==o){this.ssaoScale=o,this.target.setSize(t,r),this.outlinesTarget.setSize(t,r),this.shadowsTarget.setSize(t,r);var s=Math.floor(t*this.ssaoScale),u=Math.floor(r*this.ssaoScale);this.downsampledDepthTarget.setSize(s,u),this.ssaoDepthTexture.define(s,u),this.ssaoDepthBlurProxyTexture.define(s,u);var c=Math.max(1,Math.floor(.5*s)),l=Math.max(1,Math.floor(.5*u));this.depthHalfTarget.setSize(c,l);var f=Math.max(1,Math.floor(.25*s)),d=Math.max(1,Math.floor(.25*u));this.depthQuarterTarget.setSize(f,d),k.update(this.renderable.values.uTexSize,Fe.set(this.renderable.values.uTexSize.ref.value,t,r)),k.update(this.outlinesRenderable.values.uTexSize,Fe.set(this.outlinesRenderable.values.uTexSize.ref.value,t,r)),k.update(this.shadowsRenderable.values.uTexSize,Fe.set(this.shadowsRenderable.values.uTexSize.ref.value,t,r)),k.update(this.downsampleDepthRenderable.values.uTexSize,Fe.set(this.downsampleDepthRenderable.values.uTexSize.ref.value,s,u)),k.update(this.depthHalfRenderable.values.uTexSize,Fe.set(this.depthHalfRenderable.values.uTexSize.ref.value,c,l)),k.update(this.depthQuarterRenderable.values.uTexSize,Fe.set(this.depthQuarterRenderable.values.uTexSize.ref.value,f,d)),k.update(this.ssaoRenderable.values.uTexSize,Fe.set(this.ssaoRenderable.values.uTexSize.ref.value,s,u)),k.update(this.ssaoBlurFirstPassRenderable.values.uTexSize,Fe.set(this.ssaoBlurFirstPassRenderable.values.uTexSize.ref.value,s,u)),k.update(this.ssaoBlurSecondPassRenderable.values.uTexSize,Fe.set(this.ssaoBlurSecondPassRenderable.values.uTexSize.ref.value,s,u));var p=1===this.ssaoScale?this.drawPass.depthTextureOpaque:this.downsampledDepthTarget.texture;k.update(this.depthHalfRenderable.values.tColor,p),k.update(this.ssaoRenderable.values.tDepth,p),this.depthHalfRenderable.update(),this.ssaoRenderable.update(),this.background.setSize(t,r)}},e.prototype.updateState=function(t,r,n,a,i){var o,s=!1,u=!1,c=!1,l=!1,f=!1,d=!1,p="orthographic"===t.state.mode?1:0,h="on"===a.outline.name,m="on"===a.shadow.name,v="on"===a.occlusion.name,g=me.identity();me.invert(g,t.projection);var y=this.renderable.values.uTexSize.ref.value,b=y[0],_=y[1],C=t.viewport;if("on"===a.occlusion.name){k.update(this.ssaoRenderable.values.uProjection,t.projection),k.update(this.ssaoRenderable.values.uInvProjection,g);var x=this.ssaoRenderable.values.uBounds,A=this.ssaoScale;pr.set(x.ref.value,Math.floor(C.x*A)/(b*A),Math.floor(C.y*A)/(_*A),Math.ceil((C.x+C.width)*A)/(b*A),Math.ceil((C.y+C.height)*A)/(_*A)),k.update(x,x.ref.value),k.update(this.ssaoBlurFirstPassRenderable.values.uBounds,x.ref.value),k.update(this.ssaoBlurSecondPassRenderable.values.uBounds,x.ref.value),k.updateIfChanged(this.ssaoBlurFirstPassRenderable.values.uNear,t.near),k.updateIfChanged(this.ssaoBlurSecondPassRenderable.values.uNear,t.near),k.updateIfChanged(this.ssaoBlurFirstPassRenderable.values.uFar,t.far),k.updateIfChanged(this.ssaoBlurSecondPassRenderable.values.uFar,t.far),k.update(this.ssaoBlurFirstPassRenderable.values.uInvProjection,g),k.update(this.ssaoBlurSecondPassRenderable.values.uInvProjection,g),this.ssaoBlurFirstPassRenderable.values.dOrthographic.ref.value!==p&&(l=!0,k.update(this.ssaoBlurFirstPassRenderable.values.dOrthographic,p),k.update(this.ssaoBlurSecondPassRenderable.values.dOrthographic,p)),this.nSamples!==a.occlusion.params.samples&&(c=!0,this.nSamples=a.occlusion.params.samples,k.update(this.ssaoRenderable.values.uSamples,moe(this.nSamples)),k.updateIfChanged(this.ssaoRenderable.values.dNSamples,this.nSamples));var T="on"===a.occlusion.params.multiScale.name;if(this.ssaoRenderable.values.dMultiScale.ref.value!==T&&(c=!0,k.update(this.ssaoRenderable.values.dMultiScale,T)),"on"===a.occlusion.params.multiScale.name){var w=a.occlusion.params.multiScale.params;if(!zf(this.levels,w.levels)){c=!0,this.levels=w.levels;var E=function MJe(e,t){var r=e.length,n=t||{radius:new Array(3*r).fill(0),bias:new Array(3*r).fill(0)},a=n.radius,i=n.bias;e=e.slice().sort(function(u,c){return u.radius-c.radius});for(var o=0;o=h.length)return-2;var m=i.viewport,v=m.x,g=m.y,y=m.width,b=m.height,_=1/h.length;if(-1===t)l.render(r,n,!1),k.update(s.values.uWeight,1),k.update(s.values.tColor,l.getColorTarget(n.postprocessing).texture),s.update(),c.bind(),p.disable(d.BLEND),p.disable(d.DEPTH_TEST),p.depthMask(!1),p.viewport(v,g,y,b),p.scissor(v,g,y,b),s.render(),t+=1;else{i.viewOffset.enabled=!0,k.update(s.values.tColor,l.getColorTarget(n.postprocessing).texture),k.update(s.values.uWeight,_),s.update();for(var C=Math.pow(2,Math.max(0,n.multiSample.sampleLevel-2)),x=0;x=h.length)break}}l.postprocessing.setOcclusionOffset(0,0),this.bindOutputTarget(a),p.viewport(v,g,y,b),p.scissor(v,g,y,b);var T=t*_;return T>0&&(k.update(s.values.uWeight,1),k.update(s.values.tColor,u.texture),s.update(),p.disable(d.BLEND),s.render()),T<1&&(k.update(s.values.uWeight,1-T),k.update(s.values.tColor,c.texture),s.update(),0===T?p.disable(d.BLEND):p.enable(d.BLEND),s.render()),i.viewOffset.enabled=!1,i.update(),xt&&f.timer.markEnd("MultiSamplePass.renderTemporalMultiSample"),t>=h.length?-2:t},e}(),IL=[[[0,0]],[[0,0],[-4,-4]],[[0,0],[6,-2],[-6,2],[2,6]],[[0,0],[-1,3],[5,1],[-3,-5],[-5,5],[-7,-1],[3,7],[7,-7]],[[0,0],[-1,-3],[-3,2],[4,-1],[-5,-2],[2,5],[5,3],[3,-5],[-2,6],[0,-7],[-4,-6],[-6,4],[-8,0],[7,-4],[6,7],[-7,-8]],[[0,0],[-7,-5],[-3,-5],[-5,-4],[-1,-4],[-2,-2],[-6,-1],[-4,0],[-7,1],[-1,2],[-6,3],[-3,3],[-7,6],[-3,6],[-5,7],[-1,7],[5,-7],[1,-6],[6,-5],[4,-4],[2,-3],[7,-2],[1,-1],[4,-1],[2,1],[6,2],[0,4],[4,4],[2,5],[7,5],[5,6],[3,7]]];IL.forEach(function(e){e.forEach(function(t){t[0]*=.0625,t[1]*=.0625})});var yoe=function(){function e(t){this.multiSamplePass=t,this.sampleIndex=-2}return e.prototype.update=function(t,r){return t&&(this.sampleIndex=-1),"temporal"===r.mode&&-2!==this.sampleIndex},e.prototype.render=function(t,r,n,a){return this.sampleIndex=this.multiSamplePass.render(this.sampleIndex,t,r,n,!!a),this.sampleIndex<0},e}(),boe={eyeSeparation:D.Numeric(.062,{min:.02,max:.1,step:.001},{description:"Distance between left and right camera."}),focus:D.Numeric(10,{min:1,max:20,step:.1},{description:"Apparent object distance."})},NJe=D.getDefaultValues(boe),Ub=function(){function e(t,r){void 0===r&&(r={}),this.parent=t,this.left=new _oe,this.right=new _oe,this.props=R(R({},NJe),r)}return Object.defineProperty(e.prototype,"viewport",{get:function(){return this.parent.viewport},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"viewOffset",{get:function(){return this.parent.viewOffset},enumerable:!1,configurable:!0}),e.prototype.setProps=function(t){Object.assign(this.props,t)},e.prototype.update=function(){this.parent.update(),function BJe(e,t,r,n){po.copy(r.viewport,e.viewport),me.copy(r.view,e.view),me.copy(r.projection,e.projection),Za.copySnapshot(r.state,e.state),Za.copyViewOffset(r.viewOffset,e.viewOffset),r.far=e.far,r.near=e.near,r.fogFar=e.fogFar,r.fogNear=e.fogNear,po.copy(n.viewport,e.viewport),me.copy(n.view,e.view),me.copy(n.projection,e.projection),Za.copySnapshot(n.state,e.state),Za.copyViewOffset(n.viewOffset,e.viewOffset),n.far=e.far,n.near=e.near,n.fogFar=e.fogFar,n.fogNear=e.fogNear;var a=Math.floor(e.viewport.width/2),i=a/e.viewport.height;r.viewport.width=a,n.viewport.x+=a,n.viewport.width-=a;var c,l,o=t.eyeSeparation/2,s=o*e.near/t.focus,u=e.near*Math.tan(.5*e.state.fov);Soe[12]=-o,Coe[12]=o,r.projection[0]=2*e.near/((l=u*i+s)-(c=-u*i+s)),r.projection[8]=(l+c)/(l-c),me.mul(r.view,r.view,Soe),me.mul(r.projectionView,r.projection,r.view),me.invert(r.inverseProjectionView,r.projectionView),n.projection[0]=2*e.near/((l=u*i-s)-(c=-u*i-s)),n.projection[8]=(l+c)/(l-c),me.mul(n.view,n.view,Coe),me.mul(n.projectionView,n.projection,n.view),me.invert(n.inverseProjectionView,n.projectionView)}(this.parent,this.props,this.left,this.right)},e}();!function(e){e.is=function t(r){return"left"in r&&"right"in r}}(Ub||(Ub={}));var _oe=function(){return function e(){this.viewport=po.create(0,0,0,0),this.view=me(),this.projection=me(),this.projectionView=me(),this.inverseProjectionView=me(),this.state=Za.createDefaultSnapshot(),this.viewOffset=Za.ViewOffset(),this.far=0,this.near=0,this.fogFar=0,this.fogNear=0}}(),Soe=me.identity(),Coe=me.identity(),PL=Math.pow(2,24)-2,LJe=function(){function e(t,r,n){this.webgl=t,this.drawPass=r,this.pickBaseScale=n;var a=n/t.pixelRatio;this.pickWidth=Math.ceil(r.colorTarget.getWidth()*a),this.pickHeight=Math.ceil(r.colorTarget.getHeight()*a);var i=t.resources,o=t.extensions.drawBuffers,s=t.gl;o?(this.objectPickTexture=i.texture("image-uint8","rgba","ubyte","nearest"),this.objectPickTexture.define(this.pickWidth,this.pickHeight),this.instancePickTexture=i.texture("image-uint8","rgba","ubyte","nearest"),this.instancePickTexture.define(this.pickWidth,this.pickHeight),this.groupPickTexture=i.texture("image-uint8","rgba","ubyte","nearest"),this.groupPickTexture.define(this.pickWidth,this.pickHeight),this.depthPickTexture=i.texture("image-uint8","rgba","ubyte","nearest"),this.depthPickTexture.define(this.pickWidth,this.pickHeight),this.framebuffer=i.framebuffer(),this.objectPickFramebuffer=i.framebuffer(),this.instancePickFramebuffer=i.framebuffer(),this.groupPickFramebuffer=i.framebuffer(),this.depthPickFramebuffer=i.framebuffer(),this.framebuffer.bind(),o.drawBuffers([o.COLOR_ATTACHMENT0,o.COLOR_ATTACHMENT1,o.COLOR_ATTACHMENT2,o.COLOR_ATTACHMENT3]),this.objectPickTexture.attachFramebuffer(this.framebuffer,"color0"),this.instancePickTexture.attachFramebuffer(this.framebuffer,"color1"),this.groupPickTexture.attachFramebuffer(this.framebuffer,"color2"),this.depthPickTexture.attachFramebuffer(this.framebuffer,"color3"),this.depthRenderbuffer=$t(s)?i.renderbuffer("depth32f","depth",this.pickWidth,this.pickHeight):i.renderbuffer("depth16","depth",this.pickWidth,this.pickHeight),this.depthRenderbuffer.attachFramebuffer(this.framebuffer),this.objectPickTexture.attachFramebuffer(this.objectPickFramebuffer,"color0"),this.instancePickTexture.attachFramebuffer(this.instancePickFramebuffer,"color0"),this.groupPickTexture.attachFramebuffer(this.groupPickFramebuffer,"color0"),this.depthPickTexture.attachFramebuffer(this.depthPickFramebuffer,"color0")):(this.objectPickTarget=t.createRenderTarget(this.pickWidth,this.pickHeight),this.instancePickTarget=t.createRenderTarget(this.pickWidth,this.pickHeight),this.groupPickTarget=t.createRenderTarget(this.pickWidth,this.pickHeight),this.depthPickTarget=t.createRenderTarget(this.pickWidth,this.pickHeight))}return e.prototype.bindObject=function(){this.webgl.extensions.drawBuffers?this.objectPickFramebuffer.bind():this.objectPickTarget.bind()},e.prototype.bindInstance=function(){this.webgl.extensions.drawBuffers?this.instancePickFramebuffer.bind():this.instancePickTarget.bind()},e.prototype.bindGroup=function(){this.webgl.extensions.drawBuffers?this.groupPickFramebuffer.bind():this.groupPickTarget.bind()},e.prototype.bindDepth=function(){this.webgl.extensions.drawBuffers?this.depthPickFramebuffer.bind():this.depthPickTarget.bind()},Object.defineProperty(e.prototype,"drawingBufferHeight",{get:function(){return this.drawPass.colorTarget.getHeight()},enumerable:!1,configurable:!0}),e.prototype.syncSize=function(){var t=this.pickBaseScale/this.webgl.pixelRatio,r=Math.ceil(this.drawPass.colorTarget.getWidth()*t),n=Math.ceil(this.drawPass.colorTarget.getHeight()*t);(r!==this.pickWidth||n!==this.pickHeight)&&(this.pickWidth=r,this.pickHeight=n,this.webgl.extensions.drawBuffers?(this.objectPickTexture.define(this.pickWidth,this.pickHeight),this.instancePickTexture.define(this.pickWidth,this.pickHeight),this.groupPickTexture.define(this.pickWidth,this.pickHeight),this.depthPickTexture.define(this.pickWidth,this.pickHeight),this.depthRenderbuffer.setSize(this.pickWidth,this.pickHeight)):(this.objectPickTarget.setSize(this.pickWidth,this.pickHeight),this.instancePickTarget.setSize(this.pickWidth,this.pickHeight),this.groupPickTarget.setSize(this.pickWidth,this.pickHeight),this.depthPickTarget.setSize(this.pickWidth,this.pickHeight)))},e.prototype.renderVariant=function(t,r,n,a,i,o){t.clear(!1),t.update(r,n),t.renderPick(n.primitives,r,i,null,o),a.handle.isEnabled&&t.renderPick(a.handle.scene,r,i,null,o),a.camera.isEnabled&&(a.camera.update(r),t.update(a.camera.camera,a.camera.scene),t.renderPick(a.camera.scene,a.camera.camera,i,null,o))},e.prototype.render=function(t,r,n,a){this.webgl.extensions.drawBuffers?(this.framebuffer.bind(),this.renderVariant(t,r,n,a,"pick",wg.None)):(this.objectPickTarget.bind(),this.renderVariant(t,r,n,a,"pick",wg.Object),this.instancePickTarget.bind(),this.renderVariant(t,r,n,a,"pick",wg.Instance),this.groupPickTarget.bind(),this.renderVariant(t,r,n,a,"pick",wg.Group),this.depthPickTarget.bind(),this.renderVariant(t,r,n,a,"depth",wg.None))},e}(),UJe=function(){function e(t,r,n,a,i,o,s){void 0===s&&(s=1),this.webgl=t,this.renderer=r,this.scene=n,this.helper=a,this.pickPass=i,this.pickPadding=s,this.dirty=!0,this.viewport=po(),this.setViewport(o.x,o.y,o.width,o.height)}return e.prototype.setupBuffers=function(){var t=this.pickWidth*this.pickHeight*4;(!this.objectBuffer||this.objectBuffer.length!==t)&&(this.objectBuffer=new Uint8Array(t),this.instanceBuffer=new Uint8Array(t),this.groupBuffer=new Uint8Array(t),this.depthBuffer=new Uint8Array(t))},e.prototype.setViewport=function(t,r,n,a){po.set(this.viewport,t,r,n,a),this.pickScale=this.pickPass.pickBaseScale/this.webgl.pixelRatio,this.pickX=Math.ceil(t*this.pickScale),this.pickY=Math.ceil(r*this.pickScale);var i=Math.floor(n*this.pickScale),o=Math.floor(a*this.pickScale);(i!==this.pickWidth||o!==this.pickHeight)&&(this.pickWidth=i,this.pickHeight=o,this.halfPickWidth=Math.floor(this.pickWidth/2),this.setupBuffers()),this.spiral=function vEe(e){for(var t,r=0,n=0,a=[0,-1],i=2*e+1,o=i/2,s=[],u=Math.pow(i,2);u>0;--u)-o0&&r===1-n)&&(a[0]=(t=[-a[1],a[0]])[0],a[1]=t[1]),r+=a[0],n+=a[1];return s}(Math.round(this.pickScale*this.pickPadding))},e.prototype.syncBuffers=function(){xt&&this.webgl.timer.mark("PickHelper.syncBuffers");var t=this,r=t.pickX,n=t.pickY,a=t.pickWidth,i=t.pickHeight;this.pickPass.bindObject(),this.webgl.readPixels(r,n,a,i,this.objectBuffer),this.pickPass.bindInstance(),this.webgl.readPixels(r,n,a,i,this.instanceBuffer),this.pickPass.bindGroup(),this.webgl.readPixels(r,n,a,i,this.groupBuffer),this.pickPass.bindDepth(),this.webgl.readPixels(r,n,a,i,this.depthBuffer),xt&&this.webgl.timer.markEnd("PickHelper.syncBuffers")},e.prototype.getBufferIdx=function(t,r){return 4*(r*this.pickWidth+t)},e.prototype.getDepth=function(t,r){var n=this.getBufferIdx(t,r),a=this.depthBuffer;return function Xze(e,t,r,n){return pr.set(wte,e/255,t/255,r/255,n/255),pr.dot(wte,Yze)}(a[n],a[n+1],a[n+2],a[n+3])},e.prototype.getId=function(t,r,n){var a=this.getBufferIdx(t,r);return PB(n[a],n[a+1],n[a+2])},e.prototype.render=function(t){xt&&this.webgl.timer.mark("PickHelper.render",!0);var r=this,n=r.pickX,a=r.pickY,i=r.pickWidth,o=r.pickHeight,s=r.halfPickWidth,u=this,c=u.renderer,l=u.scene,f=u.helper;c.setTransparentBackground(!1),c.setDrawingBufferSize(i,o),c.setPixelRatio(this.pickScale),Ub.is(t)?(c.setViewport(n,a,s,o),this.pickPass.render(c,t.left,l,f),c.setViewport(n+s,a,i-s,o),this.pickPass.render(c,t.right,l,f)):(c.setViewport(n,a,i,o),this.pickPass.render(c,t,l,f)),this.dirty=!1,xt&&this.webgl.timer.markEnd("PickHelper.render")},e.prototype.identifyInternal=function(t,r,n){var i=this.webgl,o=this.pickScale;if(!i.isContextLost){r=this.pickPass.drawingBufferHeight-(r*=i.pixelRatio);var s=this.viewport;if(!((t*=i.pixelRatio)s.x+s.width||r>s.y+s.height)){this.dirty&&(xt&&this.webgl.timer.mark("PickHelper.identify"),this.render(n),this.syncBuffers(),xt&&this.webgl.timer.markEnd("PickHelper.identify"));var u=t-s.x,c=r-s.y,l=Math.floor(u*o),f=Math.floor(c*o),d=this.getId(l,f,this.objectBuffer);if(-1!==d&&d!==PL){var p=this.getId(l,f,this.instanceBuffer);if(-1!==p&&p!==PL){var h=this.getId(l,f,this.groupBuffer);if(-1!==h&&h!==PL){var m=this.getDepth(l,f),v=S.create(t,r,m);if(Ub.is(n)){var g=Math.floor(s.width/2);t>s.x+g?(v[0]=s.x+2*(u-g),jE(v,v,s,n.right.inverseProjectionView)):(v[0]=s.x+2*u,jE(v,v,s,n.left.inverseProjectionView))}else jE(v,v,s,n.inverseProjectionView);return{id:{objectId:d,instanceId:p,groupId:h},position:v}}}}}}},e.prototype.identify=function(t,r,n){for(var a=0,i=this.spiral;a